query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Set a property indicating whther that the credit card verification is required. This is used in the store during checkout.
public void setRequireCreditCardVerification(boolean pRequireCreditCardVerification) { mRequireCreditCardVerification = pRequireCreditCardVerification; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRequired(boolean value) {\r\n this.required = value;\r\n }", "void setRequired(boolean required);", "final void setProtection(boolean required)\r\n {\r\n requires_PRO = required;\r\n }", "public void setRequired(boolean required);", "public void setRequired(boolean required) {\n this.required = required;\n }", "public boolean isRequireCreditCardVerification() {\n return mRequireCreditCardVerification;\n }", "public final native void setRequired(boolean required) /*-{\n\t\tthis.required = required;\n\t}-*/;", "public void setRequired (boolean required) {\n this.required = required;\n }", "public void setRequired(boolean required) {\r\n this.required = required;\r\n }", "public void setIsRequired(boolean value) {\n this.isRequired = value;\n }", "public void setRequired(boolean required)\n {\n this.isRequired = required;\n }", "public void setRequired(boolean required) {\r\n\t\tthis.required = required;\r\n\t}", "public void setVerificationToSuccessful() {\n verificationSuccessful = true;\n }", "public void setRequired(Boolean fieldRequired) {\n this.fieldRequired = fieldRequired;\n }", "public void setRequired(boolean r)\n\t{\n\t\trequiring = r;\n\t}", "public final void setIsRequired(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean isrequired)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.IsRequired.toString(), isrequired);\r\n\t}", "public void setMandatory(boolean value) {\n this.mandatory = value;\n }", "public void setRequired(int required) {\n this.required = required;\n }", "public final void setRequired() {_occ.setRequired();}", "public void setMandatory(boolean mandatory)\n {\n this.mandatory = mandatory;\n performFlags();\n }", "public void setValidationRequired(String validationRequired) {\n\t\tif (validationRequired != null) {\n\t\t\tif (\"N\".equals(validationRequired) || \"n\".equals(validationRequired)) {\n\t\t\t\tthis.validationRequired = false;\n\t\t\t} else if (\"Y\".equals(validationRequired) || \"y\".equals(validationRequired)) {\n\t\t\t\tthis.validationRequired = true;\n\t\t\t}\n\t\t}\n\t\t//System.out.println(dataItemName + \" validation flag is \" + this.validationRequired);\n\t}", "public void setPaid() {\n isPaid = true;\n }", "final void setCHV(boolean required)\r\n {\r\n requires_CHV = required;\r\n }", "public final void setIsRequired(java.lang.Boolean isrequired)\r\n\t{\r\n\t\tsetIsRequired(getContext(), isrequired);\r\n\t}", "public void setProtection(boolean value);", "public PropertySpecBuilder<T> required(boolean required)\n {\n Preconditions.checkArgument(this.required == null, \"required flag already set\");\n this.required = required;\n\n return this;\n }", "boolean isSetRequired();", "void setProtection(boolean value);", "public TerritoryCardRequirementBonus(boolean needRequirement) {\r\n\t\tsuper(\"TerritoryCardRequirementBonus\");\r\n\t\tthis.needRequirement = needRequirement;\r\n\t}", "public Builder setRequired(boolean value) {\n\n required_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "void xsetRequired(org.apache.xmlbeans.XmlBoolean required);", "public void setRequired(Boolean required) {\n\t\tmFieldRequired = required;\n\t}", "public void setRequiresTaxCertificate (boolean RequiresTaxCertificate)\n{\nset_Value (COLUMNNAME_RequiresTaxCertificate, Boolean.valueOf(RequiresTaxCertificate));\n}", "public void setCreditCardType (String CreditCardType);", "public void setCreditCardNumber(String CreditCardNumber) {\n super.setCreditCardNumber(MPaymentValidate.checkNumeric(CreditCardNumber));\n }", "public String getCardRequired() {\n return cardRequired1;\n }", "public void setValid(boolean value)\r\n {\r\n //Override this method in MediaItem object\r\n getSemanticObject().setBooleanProperty(swb_valid, value,false);\r\n }", "@Test\r\n\tpublic void testSetGetPhoneValid() {\r\n\t\tDoctor doctor = new Doctor();\r\n\t\tdoctor.setPhone(phoneValid);\r\n\t\tassertEquals(phoneValid, doctor.getPhone());\r\n\t}", "public boolean isSetCarprovincename() {\n return this.carprovincename != null;\n }", "public void setIsCpeProvisioningNeeded(String isCpeProvisioningNeeded) {\n this.isCpeProvisioningNeeded = isCpeProvisioningNeeded == null ? null : isCpeProvisioningNeeded.trim();\n }", "void setCreditCardBooleanBinding() {\r\n\t\tBooleanBinding booleanBind;\r\n\t\tbooleanBind = (tfIDNumber.textProperty().isEmpty()).or(tfCreditCard1.textProperty().isEmpty()).or(tfCreditCard2.textProperty().isEmpty()).or(tfCreditCard3.textProperty().isEmpty()).or(tfCreditCard4.textProperty().isEmpty());\r\n\t\tbtnSave.disableProperty().bind(booleanBind);\r\n\t\tif(rbtnPreviousCreditCard.isSelected())\r\n\t\t\tbtnSave.disableProperty().unbind();\r\n\t}", "void setManualCheck (boolean value);", "@Test\n public void testSetIsAccountVerified() {\n System.out.println(\"setIsAccountVerified Test (Passing value)\");\n Boolean isAccountVerified = Boolean.TRUE;\n user.setIsAccountVerified(isAccountVerified);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertTrue(violations.isEmpty());\n }", "public static void setRequired(boolean required)\n\t{\n\t\tAngularPageConfigurator.required = required;\n\t\tif (required)\n\t\t{\n\t\t\t\n\t\t}\n\t}", "public void setIsVerified(int isVerified) {\r\n this.isVerified = isVerified;\r\n }", "public void setClaim(boolean a){\n isClaimed= a;\n \n}", "protected void setValidatedFlag(boolean value) {\n createFlags();\n flags[VALIDATED] = value;\n }", "boolean getRequired();", "boolean getRequired();", "boolean getRequired();", "private void setCardPayment(boolean res) {\n txtCardAmount.setEnabled(res);\n cmboCardBank.setEnabled(res);\n txtCardNo.setEnabled(res);\n if (res) {\n\n txtPayAmount.setCValue(txtPayAmount.getCValue() + txtCardAmount.getCValue());\n } else {\n txtPayAmount.setCValue(txtPayAmount.getCValue() - txtCardAmount.getCValue());\n }\n txtNewBalance.setCValue(txtInvoiceValue.getCValue() - txtPayAmount.getCValue());\n }", "@Test\n public void testSetIsAccountVerifiedNull() {\n System.out.println(\"setIsAccountVerified Test (Null value)\");\n Boolean isAccountVerified = null;\n user.setIsAccountVerified(isAccountVerified);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertFalse(violations.isEmpty());\n }", "public void setValidated(boolean validated) {\n this.validated = validated;\n }", "public void setIssrReq(boolean value) {\n this.issrReq = value;\n }", "public void setRequire(boolean require) {\n this.require = require;\n }", "@JsonSetter(\"blockPayphone\")\r\n public void setBlockPayphone (boolean value) { \r\n this.blockPayphone = value;\r\n }", "void setCustomValidity(String error);", "public void setIsRequired(final boolean attrIsRequired) {\r\n this.required = attrIsRequired;\r\n }", "boolean isSetCapitalPayed();", "public boolean isRequired() {\n return required;\n }", "public void setMandatory(String isMandatory) {\n\t\tif (isMandatory != null) {\n\t\t\tif (\"N\".equals(isMandatory) || \"n\".equals(isMandatory)) {\n\t\t\t\tthis.mandatory = false;\n\t\t\t} else if (\"Y\".equals(isMandatory) || \"y\".equals(isMandatory)) {\n\t\t\t\tthis.mandatory = true;\n\t\t\t}\n\t\t}\n\t\t//System.out.println(dataItemName + \" mandatory flag is \" + this.mandatory);\n\t}", "public void setPrepayment_option(int prepayment_option) {\n this.prepayment_option = prepayment_option;\n }", "void setComponentVerifyTicket(String componentVerifyTicket);", "public boolean isRequired()\n {\n return this.isRequired;\n }", "@Override\n\tpublic void setMandatory(boolean mandatory) {\n\t\t\n\t}", "public void setCreditCard(String creditCard)\n\t{\n\t\tm_creditCard = creditCard;\n\t}", "@java.lang.Override\n public boolean getRequired() {\n return required_;\n }", "@java.lang.Override\n public boolean getRequired() {\n return required_;\n }", "public void setValidated(Player p, boolean value) {\n this.getInstance(p).setValidated(value);\n }", "final public boolean requiresProtection()\r\n {\r\n return requires_PRO;\r\n }", "@Override\r\n\tpublic void validate() {\n\t\tsuper.validate();\r\n\t\tif(nofck == null)\r\n\t\t\tnofck = false;\r\n\t}", "final void setAuthentication(boolean required)\r\n {\r\n requires_AUT = required;\r\n }", "public boolean isRequired() {\r\n return required;\r\n }", "public boolean isRequired() {\r\n return required;\r\n }", "public boolean isRequired() {\r\n return required;\r\n }", "public boolean isRequired () {\n return required;\n }", "@Override\n public HangarMessages addConstraintsCreditCardNumberMessage(String property) {\n assertPropertyNotNull(property);\n add(property, new UserMessage(CONSTRAINTS_CreditCardNumber_MESSAGE));\n return this;\n }", "public boolean isSetPreRepayAmt() {\n return EncodingUtils.testBit(__isset_bitfield, __PREREPAYAMT_ISSET_ID);\n }", "public void setIsApproved (boolean IsApproved);", "public void setIsApproved (boolean IsApproved);", "public boolean getVerifyField() {\n\treturn verify;\n }", "public void setdocverificationflag(Integer value) {\n setAttributeInternal(DOCVERIFICATIONFLAG, value);\n }", "@Override\n public void verifyHasPhone() {\n }", "public void setPaymentInfoInCart(CreditCard cc);", "public boolean setPaymentProcessor() {\n return setPaymentProcessor(getTenderType(), getCreditCardType());\n }", "public Boolean getRequired() {\n return fieldRequired;\n }", "private void setDegreeRequired ()\r\n {\r\n int j = 0;\r\n\r\n while (j < CAREERS.length && !CAREERS[j].equalsIgnoreCase (name))\r\n j++;\r\n\r\n if (j <= 3)\r\n degreeRequired = true;\r\n else degreeRequired = false;\r\n }", "public final boolean isRequired() {\n\t\treturn JsUtils.getNativePropertyBoolean(this, \"required\");\n\t}", "public void setRequiredParam(boolean requiredParam) {\n this.isRequiredParam = requiredParam;\n }", "public void setCost(int cost) {\n/* 79 */ Validate.isTrue((cost > 0), \"The cost must be greater than 0!\");\n/* */ \n/* 81 */ this.cost = cost;\n/* */ }", "public void setLBR_PartialPayment (String LBR_PartialPayment);", "@JSProperty\n boolean isRequired();", "void setConfirmed(String value);", "public void setCardNo(int cardNumber);", "public boolean isIsRequired() {\n return isRequired;\n }", "public void setValidate(boolean validate) {\r\r\r\r\r\r\n this.validate = validate;\r\r\r\r\r\r\n }", "public String getCoursePassRequire() {\n\t\treturn coursePassRequire;\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Define if the task is required.\")\n @JsonProperty(JSON_PROPERTY_IS_REQUIRED)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getIsRequired() {\n return isRequired;\n }", "public void setCreditCardNumber(int creditCardNumber) {\n this.creditCardNumber = creditCardNumber;\n }", "public boolean isSetReceipt_number() {\n return this.receipt_number != null;\n }" ]
[ "0.66857433", "0.6545964", "0.65381855", "0.6523049", "0.64767265", "0.6460119", "0.6449443", "0.6361603", "0.63110757", "0.6308858", "0.62904644", "0.6167898", "0.5937487", "0.58501714", "0.5842784", "0.5836084", "0.58328104", "0.58032125", "0.57623976", "0.5745649", "0.5714267", "0.57051116", "0.5701351", "0.56840426", "0.56805015", "0.5674001", "0.56577516", "0.56575274", "0.56521124", "0.56260157", "0.5603789", "0.55830795", "0.55663365", "0.5559871", "0.5540702", "0.5538346", "0.55351925", "0.5532093", "0.5531259", "0.55281514", "0.55276144", "0.552389", "0.5490866", "0.5485661", "0.54794353", "0.54791397", "0.54741657", "0.54734147", "0.54734147", "0.54734147", "0.5471285", "0.5470763", "0.5468156", "0.54613256", "0.5439986", "0.54208165", "0.54036856", "0.5394244", "0.5388412", "0.5379989", "0.53737485", "0.53618824", "0.5357907", "0.53522456", "0.53473884", "0.5341895", "0.5337731", "0.5325965", "0.5317827", "0.53148466", "0.53006023", "0.52963567", "0.52952486", "0.52952486", "0.5287677", "0.52780277", "0.5269649", "0.5259675", "0.525356", "0.525356", "0.52497965", "0.52430874", "0.5242224", "0.5242001", "0.52406776", "0.52342886", "0.5232228", "0.5231982", "0.5217272", "0.52115643", "0.5179268", "0.5177759", "0.51660144", "0.51642436", "0.5161796", "0.5159483", "0.5158679", "0.51399505", "0.5138798", "0.5137861" ]
0.7572623
0
Determines whether debug logging has been configured to be enabled.
public boolean isDojoDebug() { return mDojoDebug; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isDebugEnabled() {\n\n return debugLogger.isDebugEnabled();\n }", "public final boolean isDebugOn()\n {\n return this.getPropertyValue(GUILoggerSeverityProperty.DEBUG);\n }", "public boolean isDebugEnabled()\n/* */ {\n/* 250 */ return getLogger().isDebugEnabled();\n/* */ }", "boolean isDebugEnabled();", "public boolean isDebugEnabled();", "public boolean isDebugEnabled() {\n return debugEnabled;\n }", "@Override\n\tpublic boolean isDebugEnabled() {\n\t\treturn debugEnabled;\n\t}", "public boolean isDebug() {\n\t\treturn debug;\n\t}", "public boolean isDebug() {\n\t\treturn debug;\n\t}", "public boolean isDebug( ) {\n\t\treturn debug;\n\t}", "public boolean isDebugEnabled() {\n return getFormat().getConverterService().isDebugEnabled();\n }", "public boolean isDebug();", "public boolean isDebug()\n\t{\n\t\treturn this.debug;\n\t}", "boolean isDebug();", "boolean isDebug();", "public boolean isDebug() {\n\t\treturn _debug;\n\t}", "static boolean debug(Configuration conf) {\n return conf.getBoolean(DEBUG_FLAG, false);\n }", "protected final boolean hasDebug() {\n return m_debug;\n }", "public boolean isDebugged() {\r\n\t\treturn debugged;\r\n\t}", "private final boolean isDebugMode() {\r\n\tString debug = m_ctx.getInitParameter(\"gateway.debug\");\r\n\tif (debug == null)\r\n\t return false;\r\n\tif (debug.equalsIgnoreCase(\"true\"))\r\n\t return true;\r\n\telse\r\n\t return false;\r\n }", "protected boolean isDebugging() {\n\t\treturn debugging;\n\t}", "public boolean isLoggingEnabledNow() {\n return this.decider.isLoggingEnabledNow();\n }", "public boolean isDebugMode() {\n return debugMode;\n }", "public boolean isLogging();", "public static boolean isLogEnabled() {\n return mLogEnabled;\n }", "public static boolean debugOn()\r\n {\r\n on = true;\r\n System.out.println(\"Debug Mode On\");\r\n return on;\r\n }", "public boolean isDisplayDebug() {\n return displayDebug;\n }", "public boolean getDebugStatus() {\r\n return DEBUG;\r\n }", "public static boolean isDebugging(final String trace) {\n return getDefault().isDebugging()\n && \"true\".equalsIgnoreCase(Platform.getDebugOption(trace)); //$NON-NLS-1$ \n }", "public boolean isShowLogging() {\n return showLogging;\n }", "protected boolean isDebugEnable() {\n return BlurDialogEngine.DEFAULT_DEBUG_POLICY;\n }", "static public boolean isLogging()\n {\n return GetInstance().m_bLog;\n }", "@Override\n public boolean isDebugEnabled() {\n return innerLog.isDebugEnabled();\n }", "public boolean isLoggingEnabled() {\n return !Level.OFF.equals(getLogLevel());\n }", "public static boolean canShowDebugMessage() {\r\n\t\treturn showDebugMessage;\r\n\t}", "public boolean getDebug() {\n return debug;\n }", "public boolean getDebug() {\n return debug;\n }", "public synchronized boolean isLoggingFeatureEnabled(){\n\t\treturn isLoggingFeatureEnabled;\n\t}", "public boolean isConfigLoggable() {\n return logger.isLoggable(Level.CONFIG);\n }", "public boolean getDebugMode()\n {\n return debugMode;\n }", "public static boolean isAuditEnabled() {\n\n return debugLogger.isInfoEnabled();\n }", "@Override\n public boolean isDebug() {\n return BuildConfig.DEBUG;\n }", "public static boolean isDebugAccessible() {\r\n\t\treturn DEBUG_DEPENDENCY;\r\n\t}", "public boolean isLoggable() {\r\n\t\tif (logger == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn logger.isLoggable(level)\r\n\t\t\t\t|| PerformanceLogger.isEnabled();\r\n\t}", "public boolean getDebugMode() { return debugMode; }", "@Override\r\n public boolean isDebug() {\n return BuildConfig.DEBUG;\r\n }", "public boolean isTraceEnabled()\n/* */ {\n/* 282 */ return getLogger().isDebugEnabled();\n/* */ }", "void setDebugEnabled(boolean value) {\r\n debug_enabled = value;\r\n }", "public boolean getDebug() {\n return this.debug;\n }", "public boolean getDebug() {\n return this.debug;\n }", "public static boolean debugging()\n {\n return info;\n }", "public static boolean UnityAdsGetDebugMode() {\n Log.d(\"Unity cocos2dx Sample\", \"[UnityAds Demo] UnityAdsGetDebugMode\");\n return UnityAds.getDebugMode();\n }", "public boolean isSetLoggers() {\n return this.loggers != null;\n }", "public static void enableDebugging(){\n DEBUG = true;\n }", "public static boolean isInfoEnabled() {\n\n return debugLogger.isInfoEnabled();\n }", "public static boolean isDisableLogging()\n {\n return BaseBoot.getInstance().getGlobalConfig().getConfigProperty\n (DISABLE_LOGGING, DISABLE_LOGGING_DEFAULT).equalsIgnoreCase(\"true\");\n }", "public static boolean isDebugMode(Context context) {\n SharedPreferences preference=context.getSharedPreferences(AppSectionsConstant.Storage.PREFERENCE_CONF_SETTING, Context.MODE_PRIVATE);\n boolean bDebugMode=preference.getBoolean(KEY_SETTING_GENERAL_DEBUGMODE, DEFAULT_VAL_DEBUGMODE);\n return bDebugMode;\n }", "public void enableDebug() {\n this.debug = true;\n }", "public boolean logErrors()\r\n {\r\n return errorLevelHandler.getBoolean();\r\n }", "@Input\n public boolean isDebuggable() {\n return debug;\n }", "@Override\n public boolean isLoggable(int priority, String tag) {\n return BuildConfig.DEBUG;\n }", "protected boolean checkTraceEnabled() {\n String sysTraceEnabled = System.getenv(TRACE_ENABLED_ENV);\n if (sysTraceEnabled == null) {\n return false;\n }\n\n if (sysTraceEnabled.toLowerCase().equals(\"true\")) {\n return true;\n }\n return false;\n }", "protected boolean isContinueDebug() {\n\t\treturn continueDebug;\n\t}", "public final void setDebug() {\r\n setLevel(org.apache.log4j.Level.DEBUG);\r\n }", "public boolean isLog()\n\t{\n\t\treturn log;\n\t}", "public boolean isSetLogInfo() {\n return this.LogInfo != null;\n }", "public boolean isSetLogInfo() {\n return this.LogInfo != null;\n }", "public boolean isSetLogInfo() {\n return this.LogInfo != null;\n }", "public boolean isSetLogInfo() {\n return this.LogInfo != null;\n }", "public static boolean debugOff()\r\n {\r\n on = false;\r\n System.out.println(\"Debug Mode Off\");\r\n return on;\r\n }", "public final DebugLogger Debug() {\n return system.Debug();\n }", "public static boolean isWarnEnabled() {\n\n return debugLogger.isWarnEnabled();\n }", "public void setDebugEnabled(boolean debugEnabled) {\n this.debugEnabled = debugEnabled;\n }", "public static boolean isInfoEnabled1() {\n\n return debugLogger.isInfoEnabled();\n }", "public static boolean verboseOn() {\n return (SolrUtil.DEBUG || Debug.verboseOn());\n }", "public boolean hasLog() {\r\n\t\treturn hasLog;\r\n\t}", "@Override\n protected boolean isDebugEnable() {\n return false;\n }", "public static boolean canShowAdminDebugMessage() {\r\n\t\treturn showAdminDebugMessage;\r\n\t}", "public boolean debug(Class<?> eventClass) {\n return debugGlobal?(debugPrivates.containsKey(eventClass)?debugPrivates.get(eventClass):defaultee(eventClass)):false;\n }", "public void setDebug(boolean value) {\n\t\tdebug = value;\n\t}", "public boolean getSpecifyDebugCcl() {\n return specifyDebugCcl;\n }", "public static boolean isTrace() {\n return getInstance().trace;\n }", "public boolean isLog4JAvailable() {\n return isLogLibraryAvailable(\"Log4J\", LOGGING_IMPL_LOG4J_LOGGER);\n }", "public static boolean isEnabled() {\n return log.isTraceEnabled();\n }", "public boolean logging() {\n\treturn logging;\n }", "public static void syncIsDebug(Context context) {\n if (isDebug == null) {\n isDebug = context.getApplicationInfo() != null\n && (context.getApplicationInfo().flags\n & ApplicationInfo.FLAG_DEBUGGABLE) != 0;\n }\n }", "public void setDebug(boolean b) { debug = b; }", "public static final boolean isDebugInfo() { return true; }", "public void logDebug()\n\t{\n\t\tLogHandler handlerList[];\n\t\tLogHandler handler = null;\n\n\t\tSystem.out.println(\"Logger = \"+logger);\n\t\tSystem.out.println(\"Logger log level is: \"+logger.getLogLevel());\n\t\tSystem.out.println(\"Logger log filter is: \"+logger.getFilter());\n\t\thandlerList = logger.getHandlers();\n\t\tfor(int i = 0; i < handlerList.length; i++)\n\t\t{\n\t\t\thandler = handlerList[i];\n\t\t\tSystem.out.println(\"Logger handler \"+i+\" is:\"+handler+\" and called \"+handler.getName());\n\t\t\tSystem.out.println(\"Logger handler \"+i+\" has filter:\"+handler.getFilter());\n\t\t\tSystem.out.println(\"Logger handler \"+i+\" has log level:\"+handler.getLogLevel());\n\t\t}\n\t}", "public static boolean isActivateConsoleLog() {\r\n\t\treturn activateConsoleLog;\r\n\t}", "private void checkProductionMode() {\n if (getApplicationOrSystemProperty(SERVLET_PARAMETER_DEBUG, \"true\")\n .equals(\"false\")) {\n // \"Debug=true\" is the old way and should no longer be used\n productionMode = true;\n } else if (getApplicationOrSystemProperty(\n SERVLET_PARAMETER_PRODUCTION_MODE, \"false\").equals(\"true\")) {\n // \"productionMode=true\" is the real way to do it\n productionMode = true;\n }\n \n if (!productionMode) {\n /* Print an information/warning message about running in debug mode */\n // TODO Maybe we need a different message for portlets?\n logger.warning(NOT_PRODUCTION_MODE_INFO);\n }\n }", "public boolean isLoggable() {\n return (FINE >= getLevel());\n }", "public boolean supportsDebugArgument();", "public boolean enabled()\n {\n return binLog != null;\n }", "public static boolean isErrorEnabled() {\n\n return errorLogger.isErrorEnabled();\n }", "public boolean isInfoLoggingOn() {\n return verbose || !quiet;\n }", "public void toggleDebug() {\n\t\tdebug = debug ? false : true;\n\t}", "public boolean logInfo()\r\n {\r\n return infoLevelHandler.getBoolean();\r\n }", "private boolean isLoggable() {\n return Log.isLoggable(tag, level);\n }", "public void setDebug(boolean f) {\n debug = f;\n }" ]
[ "0.8148127", "0.7913323", "0.7884066", "0.76556915", "0.7640169", "0.75231427", "0.7471137", "0.74099535", "0.74099535", "0.7392321", "0.73897547", "0.73142684", "0.72735715", "0.7272979", "0.7272979", "0.7251527", "0.71533054", "0.7140585", "0.7126818", "0.7120144", "0.7093368", "0.7083978", "0.7066336", "0.7060535", "0.6982024", "0.6961866", "0.6957128", "0.6935164", "0.6896131", "0.68627685", "0.68556625", "0.67926013", "0.6786644", "0.6770046", "0.6743522", "0.66964614", "0.66964614", "0.6679755", "0.6672391", "0.6670973", "0.6643551", "0.66355616", "0.6633846", "0.6632792", "0.66040355", "0.65845543", "0.657643", "0.6535114", "0.65166867", "0.65166867", "0.646593", "0.6448589", "0.6436021", "0.6427673", "0.6401788", "0.6397497", "0.63874435", "0.63803136", "0.6377466", "0.6369131", "0.6365173", "0.6326811", "0.63185996", "0.6310074", "0.6264831", "0.62577605", "0.62577605", "0.62577605", "0.62577605", "0.62534136", "0.6231839", "0.6213842", "0.6206031", "0.6198889", "0.61445504", "0.6139921", "0.6129286", "0.6119852", "0.61065274", "0.6092647", "0.6080001", "0.60726255", "0.603873", "0.6036441", "0.6035024", "0.60319066", "0.60254884", "0.60185367", "0.6009313", "0.59856325", "0.5970738", "0.5943416", "0.59316576", "0.5919434", "0.5918813", "0.59180653", "0.58979857", "0.5870811", "0.5862528", "0.5841528" ]
0.64437777
52
Sets a property stating that debug logging should be enable in the Dojo Toolkit.
public void setDojoDebug(boolean pDojoDebug) { mDojoDebug = pDojoDebug; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void setDebug() {\r\n setLevel(org.apache.log4j.Level.DEBUG);\r\n }", "void setDebugEnabled(boolean value) {\r\n debug_enabled = value;\r\n }", "public void enableDebug() {\n this.debug = true;\n }", "public void setDebug(boolean b) { debug = b; }", "public void setDebug(boolean value) {\n\t\tdebug = value;\n\t}", "public void setDebugOn(boolean flag)\n {\n this.setProperty(GUILoggerSeverityProperty.DEBUG, flag);\n }", "public void setDebug(boolean f) {\n debug = f;\n }", "public static void setDebug(boolean d) {\n\t\tdebug = d;\n\t}", "void setDebug(boolean mode) {\n\t\tdebug = mode;\n\t}", "public static void setDebug(boolean debug) {\n IsDebug = debug;\n if (debug)\n setLevel(VERBOSE);\n else\n setLevel(INFO);\n }", "public static void enableDebugging(){\n DEBUG = true;\n }", "public void setDebug(boolean debug) {\n this.debug=debug;\n }", "public static void setDebug(boolean flag)\n\t{\n\t\tm_debugFlag = flag;\n\t}", "public void setDebug( boolean debugF ) {\n\t\tthis.debug = debugF;\n\t\t}", "public void setDebug(boolean debug) {\n this.debug = debug;\n }", "public void setDebug(boolean debug) {\n this.debug = debug;\n }", "public void setDebugging(boolean on)\n\t{\n\t\t_options.setDebugging(on);\n\t}", "public static void setDebugMode(boolean debugMode) {\n mDebug = debugMode;\n }", "public void setDebugMode(boolean debugMode)\r\n {\r\n this.debugMode = debugMode;\r\n }", "public void setDebugMode(boolean debugMode) {\n this.debugMode = debugMode;\n }", "public void setDebugMode(final boolean dMode) { debugMode = dMode; }", "public void setDebug(final boolean debug)\n {\n this.debug = debug;\n }", "public void setDebugEnabled(boolean debugEnabled) {\n this.debugEnabled = debugEnabled;\n }", "@Override\n\tpublic void setDebug(boolean isDebug) {\n\t\t\n\t}", "public static void setDebugFlag(boolean flag) {\n\t\tPMA.setDebugFlag(flag);\n\t\tif (flag) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Debug flag enabled. You will receive extra feedback and messages from the Java SDK (like this one)\");\n\t\t\tif (PMA.logger != null) {\n\t\t\t\tPMA.logger.severe(\n\t\t\t\t\t\t\"Debug flag enabled. You will receive extra feedback and messages from the Java SDK (like this one)\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void setDebugMode(boolean debug) {\n\n\t}", "@Override\n\tpublic boolean isDebugEnabled() {\n\t\treturn debugEnabled;\n\t}", "public void setDebug(boolean isDebug)\n {\n this.isDebug = isDebug;\n this.repaint();\n }", "public void setDebug(boolean debug) {\n\t\tthis._debug = debug;\n\t}", "public void toggleDebug() {\n\t\tdebug = debug ? false : true;\n\t}", "public void setLogging(boolean logging);", "@Override\n\tpublic void setDebugMode(int debugMode) {\n\n\t}", "@FXML\n\tpublic void enableDebugLevel() {\n\t\tcheckFieldEditOrNot = true;\n\t\tif (enableDebugLevel.isSelected()) {\n\t\t\tdebugValue.setDisable(false);\n\t\t\tdebugValue.setValue(\"0\");\n\t\t\tSX3Manager.getInstance().addLog(\"Debug Level : Enable.<br>\");\n\t\t} else {\n\t\t\tdebugValue.setDisable(true);\n\t\t\tdebugValue.setValue(\"\");\n\t\t\tSX3Manager.getInstance().addLog(\"Debug Level : Disable.<br>\");\n\t\t}\n\t}", "public static void setDebug(boolean db) {\n\n\t\tdebug = db;\n\n\t}", "public void setDebuggable(boolean debug) {\n this.debug = debug;\n }", "public void setDebug(boolean debug, PrintStream out)\n {\n session.setDebug(debug);\n if (debug)\n session.setDebugOut(out);\n }", "protected static void setDebugLevel(int debugLevel) {\n Program.debugLevel = debugLevel;\n }", "public boolean isDojoDebug() {\n return mDojoDebug;\n }", "void setDebugPort(Integer debugPort);", "public void setDebug(IRubyObject debug) {\n this.debug = debug.isTrue();\n }", "public void setDebug(IRubyObject debug) {\n this.debug = debug.isTrue();\n }", "public void toggleDebugMode() {\r\n DEBUG = !DEBUG;\r\n }", "public boolean isDebugEnabled()\n/* */ {\n/* 250 */ return getLogger().isDebugEnabled();\n/* */ }", "protected void setDebugging(boolean debugging) {\n\t\tthis.debugging = debugging;\n\t}", "public boolean isDebugEnabled() {\n return debugEnabled;\n }", "public boolean isDebugEnabled();", "public synchronized void setDebugTraceEnabled(TrcDbgTrace tracer, boolean enabled)\n {\n debugTracer = enabled ? tracer : null;\n }", "public boolean getDebugMode() { return debugMode; }", "@FXML\n\tpublic void logDebugLevel() {\n\t\tcheckFieldEditOrNot = true;\n\t\tSX3Manager.getInstance().addLog(\"Debug Level : \" + debugValue.getValue() + \".<br>\");\n\t\tlogDetails1.getEngine().setUserStyleSheetLocation(\"data:,body{font: 12px Arial;}\");\n\n\t\tlogDetails1.getEngine().executeScript(\"window.scrollTo(0, document.body.scrollHeight);\");\n\t}", "public static void setDebug(int b) {\n debug = b;\n }", "public void enableLogging();", "static void debug() {\n ProcessRunnerImpl.setGlobalDebug(true);\n }", "public boolean getDebug() {\n return debug;\n }", "public boolean getDebug() {\n return debug;\n }", "public void setDebugSend( boolean debug_on_off )\n {\n debug_send = debug_on_off;\n }", "public void setDebugTransport(final String debugTransport)\n {\n this.debugTransport = debugTransport;\n }", "boolean isDebugEnabled();", "public LagartoDOMBuilder enableDebug() {\n\t\tconfig.collectErrors = true;\n\t\tconfig.parserConfig.setCalculatePosition(true);\n\t\treturn this;\n\t}", "@Override\n protected boolean isDebugEnable() {\n return false;\n }", "public void setDebugMode(boolean status)\n {\n debugMode = status;\n }", "public static void debug(boolean d) {\n D = d;\n }", "public boolean getDebug() {\n return this.debug;\n }", "public boolean getDebug() {\n return this.debug;\n }", "public void setDisplayDebug(boolean displayDebug) {\n this.displayDebug = displayDebug;\n }", "public void setConsoleLog(boolean isSet) {\r\n consoleLog = isSet;\r\n }", "public void setLogging(boolean logging){\n this.logging=logging;\n }", "public static void setLogEnabled(boolean enable) {\n mLogEnabled = enable;\n }", "void libusb_set_debug(Context ctx, int level);", "public void disableDebug() {\n this.debug = false;\n }", "public boolean getDebugMode()\n {\n return debugMode;\n }", "@Test\n\t/**\n\t * This is in effect:\n\t * \n\t * log4j.rootLogger=DEBUG\n\t */\n\tpublic void testDebugAbove(){\n\t\tlogger.trace(\"Trace\");\n\t\t//Above Debug are all logged\n\t\tlogger.debug(\"Debug\");\n\t\tlogger.info(\"Info\");\n\t\tlogger.warn(\"Warning\");\n\t\tlogger.error(\"Error\");\n\t}", "public static void setDebug(boolean debug) {\n ButterKnife.debug = debug;\n }", "public boolean isDebug( ) {\n\t\treturn debug;\n\t}", "public final boolean isDebugOn()\n {\n return this.getPropertyValue(GUILoggerSeverityProperty.DEBUG);\n }", "public boolean isDebug() {\n\t\treturn debug;\n\t}", "public boolean isDebug() {\n\t\treturn debug;\n\t}", "public Render setDebugPrint() {\r\n\t\t_print = true;\r\n\t\treturn this;\r\n\t}", "public void setDebugServer(final boolean debugServer)\n {\n this.debugServer = debugServer;\n }", "void debug() {\n this.renderer.debug = !this.renderer.debug;\n reload();\n }", "public void setDataLogging (boolean dataLogging) {\n this.dataLogging = dataLogging;\n }", "public void setBufferDebug( boolean debug ) {\n\t\tthis.buffer.setDebug( debug );\n\t\t}", "public boolean isDebugMode() {\n return debugMode;\n }", "public static void disableDebugging(){\n DEBUG = false;\n }", "void k2h_set_debug_level_silent();", "public static boolean debugOn()\r\n {\r\n on = true;\r\n System.out.println(\"Debug Mode On\");\r\n return on;\r\n }", "public boolean isDebugEnabled() {\n return getFormat().getConverterService().isDebugEnabled();\n }", "public void debug( int level ) {\r\n\t\tdebugLevel = level;\r\n\t\ts.debug(debugLevel);\r\n\t}", "@Override\r\n public boolean isDebug() {\n return BuildConfig.DEBUG;\r\n }", "public static boolean isDebugEnabled() {\n\n return debugLogger.isDebugEnabled();\n }", "public static final void ccSetDoseLog(boolean pxVal){\n cmLogOn=pxVal;\n }", "public boolean isDebug() {\n\t\treturn _debug;\n\t}", "public static void setLevelDebug(Level filtreLev) {\n logger.setLevel(filtreLev);\n }", "public boolean isDebug()\n\t{\n\t\treturn this.debug;\n\t}", "public boolean isDebug();", "@Override\n public boolean isDebugEnabled() {\n return innerLog.isDebugEnabled();\n }", "public void setLogging(boolean logging) {\n\t\tthis.isLogging = logging;\n\t}", "@Override\n\tpublic boolean isDebugEnabled(Marker marker) {\n\t\treturn false;\n\t}", "public boolean getSpecifyDebugCcl() {\n return specifyDebugCcl;\n }", "@Override\n public boolean isDebug() {\n return BuildConfig.DEBUG;\n }", "public void setShowDebugMessage(boolean showDebugMessage) {\r\n\t\tMessageManager.showDebugMessage = showDebugMessage;\r\n\t}" ]
[ "0.75484914", "0.7395852", "0.7273516", "0.7244237", "0.72195005", "0.71109647", "0.70828885", "0.69610935", "0.6936882", "0.6925744", "0.6918478", "0.68916196", "0.68449545", "0.68366873", "0.6810533", "0.6810533", "0.6806169", "0.6788544", "0.67859066", "0.67679375", "0.6760545", "0.6753701", "0.67491066", "0.6747731", "0.67325723", "0.6732023", "0.6684112", "0.6683702", "0.6662916", "0.6580214", "0.6552844", "0.6524349", "0.65048414", "0.6416502", "0.641058", "0.6389479", "0.63819313", "0.6325824", "0.6323699", "0.631994", "0.631994", "0.6311001", "0.63091725", "0.6290135", "0.6287874", "0.62734675", "0.6270953", "0.61974496", "0.6189855", "0.6162393", "0.6155978", "0.6138914", "0.6114078", "0.6114078", "0.6099864", "0.6097139", "0.6093062", "0.60879076", "0.60821146", "0.60789955", "0.60731965", "0.6057305", "0.6057305", "0.6046209", "0.60400575", "0.60109264", "0.5976578", "0.59649336", "0.5960861", "0.59554154", "0.59527487", "0.59466565", "0.59440416", "0.59328914", "0.59173393", "0.59173393", "0.5907352", "0.59028596", "0.58990633", "0.5897804", "0.58973265", "0.58919406", "0.58810604", "0.586989", "0.5859742", "0.5832409", "0.5819933", "0.58087957", "0.57987547", "0.57912433", "0.57905114", "0.5769405", "0.5758952", "0.5742357", "0.5736988", "0.5726952", "0.57185036", "0.57144815", "0.57118905", "0.56898624" ]
0.7052499
7
Returns the list of configured country codes that are mandatory. Used when shopper creates billing and shipping addresses. These indicate when the state property of the address is a mandatory field.
public List<String> getMandatoryStateCountryList() { return mMandatoryStateCountryList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setMandatoryStateCountryList(List<String> pMandatoryStateCountryList) {\n mMandatoryStateCountryList = pMandatoryStateCountryList;\n }", "public List<String> supportedCountries() {\n final List<String> countryCodes = new ArrayList<>(bbanStructures.size());\n for (BbanStructureDTO structure : this.bbanStructures) {\n countryCodes.add(structure.getCountry_coode());\n }\n return Collections.unmodifiableList(countryCodes);\n }", "public List<Country> getAllAvailableCountry() {\n\t\treturn countryManager.getAllAvailable();\n\t}", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "boolean hasCountryCode();", "boolean hasCountryCode();", "java.lang.String getCountryCode();", "java.lang.String getCountryCode();", "List<GenericTypedGrPostal> getCountryNames();", "private void clearCountryCode() {\n\n countryCode_ = getDefaultInstance().getCountryCode();\n }", "private void validateDefaultCountryInput(List<String> codes, boolean allowed) {\n if (getParams().containsKey(ExtraConstants.COUNTRY_ISO) ||\n getParams().containsKey(ExtraConstants.PHONE)) {\n\n if (!validateDefaultCountryIso(codes, allowed)\n || !validateDefaultPhoneIsos(codes, allowed)) {\n throw new IllegalArgumentException(\"Invalid default country iso. Make \" +\n \"sure it is either part of the allowed list or that you \"\n + \"haven't blocked it.\");\n }\n }\n\n }", "public String[] getCountryNames() {\r\n return countryNames;\r\n }", "public com.google.protobuf.ByteString\n getCountryCodeBytes() {\n return instance.getCountryCodeBytes();\n }", "@Override\n\tprotected LinkedHashSet<String> getOrderedValidatedItemCodes() {\n\t\treturn null;\n\t}", "@Override\n\tprotected LinkedHashSet<String> getOrderedValidatedItemCodes() {\n\t\treturn null;\n\t}", "String getCountryCode();", "public com.google.protobuf.ByteString\n getCountryCodeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(countryCode_);\n }", "public String getCountryCode() {\n return countryCode;\n }", "public String getCountryCode() {\n return countryCode;\n }", "public String getCountryCode()\r\n\t{\r\n\t\treturn this.countryCode;\r\n\t}", "public boolean hasCountry() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "com.google.protobuf.ByteString\n getCountryBytes();", "public boolean hasCountry() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "com.google.protobuf.ByteString\n getCountryBytes();", "public String getCountryCode() {\n return countryCode_;\n }", "public ComboItem[] getCountries() {\r\n\t\treturn countries;\r\n\t}", "public Collection<IRegionalValidity> getValidRegionList();", "public int getCountryCode() {\r\n\t\treturn countryCode;\r\n\t}", "public boolean hasCountry() {\n return fieldSetFlags()[2];\n }", "public String getcountryCode() {\n return countryCode;\n }", "public List<Country> getAll() {\n\t\tif (countries != null) {\n\t\t\treturn countries;\n\t\t}\n\t\telse {\n\t\t\tcountries = new ArrayList<>();\n\n\t\t\tif (Files.exists(countriesPath)) {\n\t\t\t\ttry (BufferedReader in = new BufferedReader(\n\t\t\t\t\t\t\t\t\t\t new FileReader(countriesFile))) {\n\t\t\t\t\tString line = in.readLine();\n\t\t\t\t\twhile (line != null) {\n\t\t\t\t\t\tString[] fields = line.split(FIELD_SEP);\n\t\t\t\t\t\tString idStr = fields[0];\n\t\t\t\t\t\tString code = fields[1];\n\t\t\t\t\t\tString name = fields[2];\n\t\t\t\t\t\tint id = Integer.parseInt(idStr);\n\t\t\t\t\t\tCountry country = new Country(id, code, name);\n\t\t\t\t\t\tcountries.add(country);\n\t\t\t\t\t\tline = in.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (IOException ioe) {\n\t\t\t\t\tSystem.out.println(ioe);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn countries;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(countriesPath.toAbsolutePath()+\" doesn't exist.\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}", "public CountryList() {\n\t\tthis.totalCount = 0;\n\t\tthis.nextAvailable = 0;\n\t}", "public String getCountryCode() {\n\t\treturn countryCode;\n\t}", "public static java.lang.String[] getAvailableIDs(java.lang.String country) { throw new RuntimeException(\"Stub!\"); }", "public java.lang.String getCountryCode() {\n return countryCode;\n }", "List<Country> listCountries();", "public ArrayList<Country> getCountryList() throws LocationException;", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL').\")\n\n public String getCountryCode() {\n return countryCode;\n }", "@Override\n\tpublic List<City> findCityByCountryCode(String countryCode) {\n\t\treturn null;\n\t}", "public List<CountryMasterDesc> getCountryListFromDB() {\n\t\t sessionStateManage = new SessionStateManage(); \n\t\tcountryList = new ArrayList<CountryMasterDesc>();\n\t\tcountryList.addAll( getGeneralService().getCountryList(new BigDecimal(sessionStateManage.isExists(\"languageId\")?sessionStateManage.getSessionValue(\"languageId\"):\"1\")));\n\t\tfor(CountryMasterDesc countryMasterDesc:countryList) {\n\t\t\tmapCountryList.put(countryMasterDesc.getFsCountryMaster().getCountryId(), countryMasterDesc.getCountryName());\n\t\t}\n \t\treturn countryList;\n\t}", "public ArrayList<String> getListOfCountries() {\n ArrayList<String> countries = new ArrayList<>(gameMap.getCountryHashMap().keySet());\n return countries;\n }", "@GetMapping(\"/country\")\n public List<ReadableCountry> getCountry(@ApiIgnore Language language, HttpServletRequest request) {\n MerchantStore merchantStore = storeFacade.getByCode(request);\n return countryFacade.getListCountryZones(language, merchantStore);\n }", "public abstract List<String> requiredFields();", "public String getCanceledCountryCode() {\n return this.canceledCountryCode;\n }", "public Builder clearCountryCode() {\n copyOnWrite();\n instance.clearCountryCode();\n return this;\n }", "public LCountry() {\n this(DSL.name(\"L_COUNTRY\"), null);\n }", "public String countryCode() {\n return countryCode;\n }", "@Override\n\tpublic List<String> findAllCountries() {\n\t\treturn theCountryRepository.findAllCountries();\n\t}", "public List<Country> getCountries()\n {\n return countries;\n }", "public String getLanguagesCountryCode() {\n return mLanguagesCountryCode;\n }", "public void setCountryCode(int value) {\r\n\t\tthis.countryCode = value;\r\n\t}", "public String getAuthyCountryCode () {\n\t\treturn this.authyCountryCode;\n\t}", "public List<String> findIndiaStates(){\n\t\treturn null;\n\t}", "public List<String> getAudioLanguageCodes() {\n return getAudioLanguages()\n .stream()\n .map(locale -> {\n String l = locale.getLanguage();\n if (StringUtils.isNotBlank(locale.getCountry())) {\n l += '-' + locale.getCountry().toLowerCase();\n }\n return l;\n })\n .collect(Collectors.toList());\n }", "@ApiModelProperty(value = \"Two-letter country code of IP address\")\n public String getCountryCode() {\n return countryCode;\n }", "public List<Country> getCountries() {\r\n\t\tList<Country> country=new ArrayList<Country>();\r\n\t\tfor(Country c : graph.vertexSet()){\r\n\t\t\tcountry.add(c);\r\n\t\t}\r\n\t\treturn country;\r\n\t}", "@ApiModelProperty(example = \"null\", value = \"Country resource corresponding to the dial-in number\")\n public DialInNumbersCountryInfo getCountry() {\n return country;\n }", "public boolean isSetProduction_countries() {\n return this.production_countries != null;\n }", "List<List<String>> getFieldOrigins();", "public void setCountries(List<Country> countries)\n {\n this.countries = countries;\n\n countriesMap = countries.stream().\n filter(c -> !\"-99\".equals(c.getIsoCode())).\n collect(Collectors.toMap(Country::getIsoCode, Function.identity()));\n\n LOGGER.info(\"Stored {} countries with valid code ( != -99) \", countriesMap.size());\n\n regions = new WorldRegions(countries);\n }", "@RequestMapping(value = \"/getCountries.abhi\")\n\tpublic List<CountryTO> getCountries(Model model, HttpServletRequest request) {\n\n\t\treturn addressService.getAllActiveCountries();\n\n\t}", "@RequestMapping(value = \"/countries\", method = RequestMethod.GET)\n public List<Country> countries() {\n return dictionaryService.findAllCountries();\n }", "public String getCountryCode() {\n return instance.getCountryCode();\n }", "public List<String> getCountries() {\n\t\tif (countries == null) {\r\n\t\t\tcountries = new ArrayList<>();\r\n\t\t\tif (Files.exists(countriesPath)) {\r\n\t\t\t\ttry (BufferedReader in = new BufferedReader(\r\n\t\t\t\t\t\t new FileReader(countriesFile))) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//read countries from file into array list\r\n\t\t\t\t\tString line = in.readLine();\r\n\t\t\t\t\twhile (line != null) {\r\n\t\t\t\t\t countries.add(line);\r\n\t\t\t\t\t line = in.readLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFiles.createFile(countriesPath);\r\n\t\t\t\t\tSystem.out.println(\"** countries file create!\");\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn countries;\r\n\t}", "@Nonnull public CountryCode getCountry() { return country; }", "boolean hasCountry();", "public String getCountryAccessCode() {\n return countryAccessCode;\n }", "public void populateBasicCountryNames() {\n basicCountryNames = new HashMap<>();\n for (Country c : countries.getCountries()) {\n basicCountryNames.put(c.getNamenorm(), c);\n }\n basicCountryNames.put(\"united states\", countries.getCountry(\"US\"));\n }", "public com.google.protobuf.ByteString\n getCountryBytes() {\n java.lang.Object ref = country_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n country_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static String[] getISOCountries() {\n/* 219 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public String getCountryCode() {\n return normalizedBic.substring(COUNTRY_CODE_INDEX, COUNTRY_CODE_INDEX + COUNTRY_CODE_LENGTH);\n }", "java.lang.String getCountry();", "java.lang.String getCountry();", "void countries_init() throws SQLException {\r\n countries = DatabaseQuerySF.get_all_stations();\r\n }", "public Builder clearCountry() {\n bitField0_ = (bitField0_ & ~0x00000080);\n country_ = getDefaultInstance().getCountry();\n onChanged();\n return this;\n }", "public Set<Integer> getCountriesIds() {\n\t\tSet<Integer> l_countryNameSet = new HashSet<>();\n\t\tfor (Country l_country : d_countriesSet) {\n\t\t\tl_countryNameSet.add(l_country.getId());\n\t\t}\n\t\treturn l_countryNameSet;\n\t}", "@Test\n\tpublic void validateCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tgiven().get(Endpoint.GET_COUNTRY).then().statusCode(200).\n\t\tand().contentType(ContentType.JSON).\n\t\tand().body(\"name\", hasItem(\"India\")).\n\t\tand().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t}", "public com.google.protobuf.ByteString\n getCountryBytes() {\n java.lang.Object ref = country_;\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 country_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "private void setCountryCodeBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n countryCode_ = value.toStringUtf8();\n }", "public List<String> getAdjacentCountries() {\n return adjacentCountries;\n }", "@ApiModelProperty(value = \"UK Standard Industry Code of the business not eligible to access the CCC product. Ref http://resources.companieshouse.gov.uk/sic/\")\n\n\n public List<String> getSiCCodeExcluded() {\n return siCCodeExcluded;\n }", "@Override\n protected Collection<BDDState> preCheck(BDDState pState, VariableTrackingPrecision pPrecision) {\n if (pPrecision.isEmpty()) {\n return Collections.singleton(pState);\n }\n // the path is not fulfilled\n if (pState.getRegion().isFalse()) {\n return ImmutableList.of();\n }\n return null;\n }", "public String getContactCountry() {\n return contactCountry;\n }", "public String getCountryCode() {\n // Always extract from phone number object instead of using mCurrentRegionCode just in case\n return mCurrentPhoneNumber == null ? null : PhoneNumberUtil.getInstance().getRegionCodeForCountryCode(mCurrentPhoneNumber.getCountryCode());\n }", "@ValidStrings({ \"1\", \"2\", \"3\" })\n public Set<String> getAvailabilityZones() {\n return availabilityZones == null\n ? availabilityZones = new HashSet<>()\n : availabilityZones;\n }", "public List<String> requiredZoneNames() {\n return this.requiredZoneNames;\n }", "@GET\r\n\t@Path(\"/countries\")\r\n\tpublic Response getAllCountries() {\r\n\t\ttry {\r\n\t\t\tList<CountryCreatedDto> countryCreatedDto = institutionService.getAllCountries();\r\n\t\t\treturn FarmsResponse.ok(countryCreatedDto);\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// logger.error(ErrorMessage.OPERATION_NOT_RESPONDING, ex);\r\n\t\t\tFarmsMail.sendMailText(\"[email protected]\", \"Erro\", ex.getMessage() + \" \" + ex.toString());\r\n\t\t\treturn FarmsResponse.error(ErrorMessage.OPERATION_NOT_RESPONDING);\r\n\t\t}\r\n\t}", "@RequestLine(\"GET /geoip/territories?codes={codes}\")\n Collection<Collection<Region>> getAvailableRegions(@Param(\"codes\") String codes);", "public Set<Country> getCountriesSet() {\n\t\treturn d_countriesSet;\n\t}", "public JwComparator<AcUpuTagSummaryVo> getOriginCountryCodeComparatorNullsLower()\n {\n return OriginCountryCodeComparatorNullsLower;\n }", "@Test\n\tpublic void ListAllCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tString json = given().get(Endpoint.GET_COUNTRY).then().extract().asString();\n\t\tJsonPath jp = new JsonPath(json);\n\t\tList<String> list = jp.get(\"name\");\n\t\tSystem.out.println(\"Country's are -------\" + list.get(0));\n\t}", "public void setCountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "public boolean isSetCountry() {\n return this.country != null;\n }", "public boolean isSetCountry() {\n return this.country != null;\n }", "@JsonGetter(\"countryCodeA3\")\r\n public String getCountryCodeA3 ( ) { \r\n return this.countryCodeA3;\r\n }", "public boolean isCountryNameFieldPresent() {\r\n\t\treturn isElementPresent(addVehiclesHeader.replace(\"Add Vehicle\", \"Select Country Name\"), SHORTWAIT);\r\n\t}", "public String getCountryCode() {\n return (String)getAttributeInternal(COUNTRYCODE);\n }", "public String getCountryCode() {\n return (String)getAttributeInternal(COUNTRYCODE);\n }" ]
[ "0.6075835", "0.5903679", "0.57933605", "0.5681221", "0.5681221", "0.5679605", "0.5567092", "0.5567092", "0.5510834", "0.5510834", "0.54772466", "0.54578567", "0.5450284", "0.54227924", "0.53993005", "0.53982306", "0.53982306", "0.53439134", "0.53307486", "0.5317962", "0.5317962", "0.5301396", "0.5234011", "0.52159715", "0.5213338", "0.51818275", "0.5172374", "0.5167664", "0.5159316", "0.5143772", "0.5137905", "0.51338434", "0.5129386", "0.51249874", "0.51164705", "0.50817114", "0.5076077", "0.50707346", "0.50487643", "0.5042267", "0.50370556", "0.50035", "0.49808124", "0.49479553", "0.4937416", "0.49313834", "0.49307272", "0.49180388", "0.48963124", "0.48909217", "0.48885342", "0.48868394", "0.48845175", "0.48832703", "0.48712835", "0.48679546", "0.48611608", "0.48554593", "0.48537835", "0.48491704", "0.48440215", "0.48286295", "0.4822819", "0.48171645", "0.47906616", "0.47779348", "0.47769713", "0.47676387", "0.4756951", "0.47568086", "0.4741966", "0.47409987", "0.47398466", "0.47242224", "0.47242224", "0.472298", "0.4720971", "0.4717346", "0.4711658", "0.46985683", "0.46894777", "0.4679731", "0.4673654", "0.46705258", "0.46608764", "0.46596318", "0.4650542", "0.46502113", "0.46501547", "0.4647189", "0.4635962", "0.46300644", "0.46296594", "0.46262813", "0.46261808", "0.46261808", "0.4614775", "0.46142393", "0.46140563", "0.46140563" ]
0.7152223
0
Sets the list of configured country codes that are mandatory. Used when shopper creates billing and shipping addresses. These indicate when the state property of the address is a mandatory field.
public void setMandatoryStateCountryList(List<String> pMandatoryStateCountryList) { mMandatoryStateCountryList = pMandatoryStateCountryList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCountries(List<Country> countries)\n {\n this.countries = countries;\n\n countriesMap = countries.stream().\n filter(c -> !\"-99\".equals(c.getIsoCode())).\n collect(Collectors.toMap(Country::getIsoCode, Function.identity()));\n\n LOGGER.info(\"Stored {} countries with valid code ( != -99) \", countriesMap.size());\n\n regions = new WorldRegions(countries);\n }", "private void validateDefaultCountryInput(List<String> codes, boolean allowed) {\n if (getParams().containsKey(ExtraConstants.COUNTRY_ISO) ||\n getParams().containsKey(ExtraConstants.PHONE)) {\n\n if (!validateDefaultCountryIso(codes, allowed)\n || !validateDefaultPhoneIsos(codes, allowed)) {\n throw new IllegalArgumentException(\"Invalid default country iso. Make \" +\n \"sure it is either part of the allowed list or that you \"\n + \"haven't blocked it.\");\n }\n }\n\n }", "private void setCountryCode(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n countryCode_ = value;\n }", "public void setCountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "private void clearCountryCode() {\n\n countryCode_ = getDefaultInstance().getCountryCode();\n }", "public void setCountryCode(String countryCode)\r\n\t{\r\n\t\tthis.countryCode = countryCode;\r\n\t}", "public void setCountryCode(int value) {\r\n\t\tthis.countryCode = value;\r\n\t}", "private void setCountryCodeBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n countryCode_ = value.toStringUtf8();\n }", "public List<String> getMandatoryStateCountryList() {\n return mMandatoryStateCountryList;\n }", "public void setCountryCode(@Nullable String countryCode) {\n this.countryCode = countryCode;\n api.setCountryCode(this.countryCode);\n }", "public void testSetCountry() {\r\n try {\r\n address.setCountry(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public void setCountryCode(java.lang.String countryCode) {\n this.countryCode = countryCode;\n }", "public void setcountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "public void setCountryCode(String value) {\r\n setAttributeInternal(COUNTRYCODE, value);\r\n }", "private void setCountries(List<Country> countries) {\n this.countries = countries;\n }", "public void setCountryCode(String value) {\n setAttributeInternal(COUNTRYCODE, value);\n }", "public void setCountryCode(String value) {\n setAttributeInternal(COUNTRYCODE, value);\n }", "public void setCountryCode(String countryCode) {\r\n\t\t\tthis.countryCode = countryCode;\r\n\t\t}", "public void setAddressCountry(String addressCountry) {\n this.addressCountry = addressCountry;\n }", "public Builder clearCountryCode() {\n copyOnWrite();\n instance.clearCountryCode();\n return this;\n }", "@Override\r\n public void assignCountries() {\r\n printInvalidCommandMessage();\r\n }", "public Builder clearCountry() {\n bitField0_ = (bitField0_ & ~0x00000080);\n country_ = getDefaultInstance().getCountry();\n onChanged();\n return this;\n }", "public void setCountry(java.lang.CharSequence value) {\n this.country = value;\n }", "public void setCanceledCountryCode(String val) {\n // ProtectBlock setCanceledCountryCode\n // ProtectBlock End\n this.canceledCountryCode = val;\n }", "public void setAuthyCountryCode (String countrycode) {\n\t\tthis.authyCountryCode = countrycode;\n\t}", "public void setCountryAccessCode(String countryAccessCode) {\n this.countryAccessCode = countryAccessCode;\n }", "public void setCOUNTRY_CODE(java.lang.String COUNTRY_CODE) {\r\n\t\tthis._COUNTRY_CODE = COUNTRY_CODE;\r\n\t}", "public Builder setCountryBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000080;\n country_ = value;\n onChanged();\n return this;\n }", "public Builder setCountry(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000080;\n country_ = value;\n onChanged();\n return this;\n }", "public void setCountryCallingCode(int countryCallingCode) {\n this.countryCallingCode = countryCallingCode;\n }", "@Override\n public boolean validate(String value) {\n DefaultShoppingCartImpl cart = (DefaultShoppingCartImpl) ShopUtil.getShoppingCart();\n if (cart != null) {\n cart.setShippingAddressCountry(value);\n }\n return true;\n }", "public void setCountry(String value) {\n setAttributeInternal(COUNTRY, value);\n }", "public void setCountry(String value) {\n setAttributeInternal(COUNTRY, value);\n }", "public void setCountry(String value) {\n setAttributeInternal(COUNTRY, value);\n }", "public void setCountry(String country) {\r\n this.country = country.trim();\r\n }", "public Builder setCountryCode(\n String value) {\n copyOnWrite();\n instance.setCountryCode(value);\n return this;\n }", "public void setCountry(String country) {\n this.country = country == null ? null : country.trim();\n }", "public void setCountry(String country) {\n this.country = country == null ? null : country.trim();\n }", "public void setCountryCode(final String newCountryCode) {\n if (TextUtils.isEmpty(mPhoneNumberInput.getText())) {\n updateCountryCode(newCountryCode);\n } else {\n // Clear old prefix from phone before assigning new one\n String updatedPhone = mPhoneNumberInput.getText().toString();\n if (mCurrentPhonePrefix != null && updatedPhone.startsWith(mCurrentPhonePrefix)) {\n updatedPhone = updatedPhone.substring(mCurrentPhonePrefix.length());\n }\n updateCountryCode(newCountryCode);\n\n if (!TextUtils.isEmpty(updatedPhone)) {\n formatPhoneNumber(updatedPhone);\n } else if (mCountryCodeInput.getVisibility() == View.VISIBLE) {\n initPhoneWithPrefix();\n }\n }\n }", "public LCountry() {\n this(DSL.name(\"L_COUNTRY\"), null);\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountryName(String value);", "public com.luisjrz96.streaming.birthsgenerator.models.BirthInfo.Builder setCountry(java.lang.CharSequence value) {\n validate(fields()[2], value);\n this.country = value;\n fieldSetFlags()[2] = true;\n return this;\n }", "public Builder setCountry(CountryCode country) {\n this.country = country;\n return this;\n }", "@NonNull\n public PhoneBuilder setDefaultCountryIso(@NonNull String iso) {\n Preconditions.checkUnset(getParams(),\n \"Cannot overwrite previously set phone number\",\n ExtraConstants.PHONE,\n ExtraConstants.COUNTRY_ISO,\n ExtraConstants.NATIONAL_NUMBER);\n if (!PhoneNumberUtils.isValidIso(iso)) {\n throw new IllegalStateException(\"Invalid country iso: \" + iso);\n }\n\n getParams().putString(ExtraConstants.COUNTRY_ISO,\n iso.toUpperCase(Locale.getDefault()));\n\n return this;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountryId(int value);", "public void setCountry(Country country) {\n this.country = country;\n }", "public void initialise() {\n\t\tm_country_id = 0;\n\t\tm_country_name = \"\";\n\t\tm_error_string = \"\";\n\t}", "@JsonSetter(\"countryCodeA3\")\r\n public void setCountryCodeA3 (String value) { \r\n this.countryCodeA3 = value;\r\n }", "public void setCountry(Integer country) {\n this.country = country;\n }", "public void setCountry(Integer country) {\n this.country = country;\n }", "public Builder setCountryCodeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setCountryCodeBytes(value);\n return this;\n }", "public CountryList() {\n\t\tthis.totalCount = 0;\n\t\tthis.nextAvailable = 0;\n\t}", "public void setCountry(java.lang.String country) {\r\n this.country = country;\r\n }", "public void setCountry(java.lang.String Country) {\n this.Country = Country;\n }", "public void setCountry(java.lang.String country) {\n this.country = country;\n }", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL').\")\n\n public String getCountryCode() {\n return countryCode;\n }", "public com.luisjrz96.streaming.birthsgenerator.models.BirthInfo.Builder clearCountry() {\n country = null;\n fieldSetFlags()[2] = false;\n return this;\n }", "public void setContactCountry(String contactCountry) {\n this.contactCountry = contactCountry;\n }", "public boolean hasCountry() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public void setCountries(ObservableList<Place> placeList) {\n this.countries.setCountries(placeList);\n indicateModified();\n }", "public String getCountryCode() {\n return countryCode;\n }", "public String getCountryCode() {\n return countryCode;\n }", "public boolean hasCountry() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public void setCountryItems(){\r\n\t\tComboItem[] comboItems;\r\n\t\t//array list is used as interim solution due to the fact that regular arrays size is immutable\r\n\t\tArrayList<ComboItem> itemList = new ArrayList<ComboItem>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t//Query database and populate array list with values. \r\n\t\t\tResultSet result = COUNTRY_OPTIONS.executeQuery();\r\n\t\t\twhile(result.next()){\r\n\t\t\t\titemList.add(new ComboItem(result.getInt(1), result.getString(2)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Initialise new array with needed size\r\n\t\t\tcomboItems = new ComboItem[itemList.size()];\r\n\t\t\t//convert arraylist object into array\r\n\t\t\tcomboItems = itemList.toArray(comboItems);\r\n\t\t} catch (SQLException e) {\r\n\t\t\t//initialise empty array to be returned\r\n\t\t\tcomboItems = new ComboItem[0];\r\n\t\t\tlogger.log(Level.SEVERE, e.getMessage());\r\n\t\t} \r\n\t\t\r\n\t\tthis.countries = comboItems;\r\n\t}", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-03-25 14:14:32.652 -0400\", hash_original_method = \"323D3A6C48A6D472DDFE2721C7FED43F\", hash_generated_method = \"9B8474327C39F7658DB849B205974B0F\")\n \n public static boolean setCountryCodeCommand(String countryCode){\n \tdouble taintDouble = 0;\n \ttaintDouble += countryCode.getTaintInt();\n \n \treturn ((taintDouble) == 1);\n }", "public final void setCountry(final String ccountry) {\n\t\tthis.country = ccountry;\n\t}", "public void setSenderCountry(java.lang.String senderCountry) {\r\n this.senderCountry = senderCountry;\r\n }", "public Builder clearCountryName() {\n \n countryName_ = getDefaultInstance().getCountryName();\n onChanged();\n return this;\n }", "private void populateCountryList(JComboBox cmbCountryList)\n {\n cmbCountryList.removeAllItems();\n CountryEnterprise countryEnterprise;\n \n for(Enterprise country: internationalNetwork.getEnterpriseDirectory().getEnterpriseList())\n {\n cmbCountryList.addItem((CountryEnterprise) country);\n }\n \n }", "public void enterPhoneCountryCode() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying the Phone Country Code is available or not\");\n\t\tWaitClass.WaitForElementisDisplay(driver, 5, enterPhoneCountryCode);\n\t\tAssert.assertTrue(enterPhoneCountryCode.isDisplayed());\n\t\tenterPhoneCountryCode.sendKeys(BasePage.getCellData(xlsxName, sheetName, 7, 0));\n\n\t}", "private void setValidCode() {\n\t\tValidCode.setBounds(330, 170, 180, 30);\n\t}", "public void setCountry(String country) {\n\t\tthis.country = country;\n\t}", "boolean hasCountryCode();", "boolean hasCountryCode();", "public String getcountryCode() {\n return countryCode;\n }", "public void testSetPostalCode_EmptyString() {\r\n try {\r\n address.setPostalCode(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "private void fillMandatoryFields_custom() {\n\n }", "public boolean isSetCountry() {\n return this.country != null;\n }", "public boolean isSetCountry() {\n return this.country != null;\n }", "public Address country(String country) {\n this.country = country;\n return this;\n }", "public void CountryComboSelect(){\n errorLabel.setText(\"\");\n ObservableList<Divisions> divisionsList = DivisionsImp.getAllDivisions();\n ObservableList<Divisions> filteredDivisions = FXCollections.observableArrayList();\n if (countryCombo.getValue() != null){\n int countryId = countryCombo.getValue().getCountryId();\n for(Divisions division : divisionsList){\n if(division.getCountryId() == countryId){\n filteredDivisions.add(division);\n }\n }\n divisionCombo.setItems(filteredDivisions);\n divisionCombo.setValue(null);\n }\n }", "public void setCountry_id(String country_id) {\n this.country_id = country_id;\n }", "public String getCountryCode() {\n return countryCode_;\n }", "@ApiModelProperty(example = \"null\", value = \"Country resource corresponding to the dial-in number\")\n public DialInNumbersCountryInfo getCountry() {\n return country;\n }", "@ApiModelProperty(value = \"Two-letter country code of IP address\")\n public String getCountryCode() {\n return countryCode;\n }", "public int getCountryCode() {\r\n\t\treturn countryCode;\r\n\t}", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "@Override\n\tpublic List<City> findCityByCountryCode(String countryCode) {\n\t\treturn null;\n\t}", "static public void set_country_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"country name:\", \"area (1000 km^2):\", \"GDP per capita (1000 $):\",\n\t\t\t\t\"population (million):\", \"capital:\", \"GDP (billion $):\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3), Edit_row_window.selected[0].getText(4), \n\t\t\t\tEdit_row_window.selected[0].getText(5), Edit_row_window.selected[0].getText(6)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_places_locations l, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_places_location_country lc \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where lc.location_id=l.id and lc.country_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by num_links desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\" from curr_places_locations l \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"location name\", \"rating\", \"population\"};\n\t\tEdit_row_window.label_min_parameter=\"min. population:\";\n\t\tEdit_row_window.linked_category_name = \"LOCATIONS\";\n\t}" ]
[ "0.6290617", "0.61745256", "0.61718386", "0.61245537", "0.6113221", "0.6105057", "0.60961986", "0.60566026", "0.60223436", "0.60195994", "0.60029083", "0.60004306", "0.59165627", "0.5911476", "0.5864404", "0.5851967", "0.5851967", "0.58473176", "0.58067375", "0.5786351", "0.5685455", "0.5659442", "0.5642519", "0.56307274", "0.5620761", "0.55570006", "0.5501897", "0.5468112", "0.54242194", "0.53733206", "0.5346765", "0.5335298", "0.5335298", "0.5335298", "0.533402", "0.53324634", "0.5330645", "0.5330645", "0.5316709", "0.5312268", "0.5303644", "0.5303644", "0.5303644", "0.5303644", "0.5303644", "0.5303644", "0.5303481", "0.5302448", "0.526329", "0.5255174", "0.5251477", "0.5251186", "0.5249154", "0.5235789", "0.52270204", "0.5204307", "0.5204307", "0.51636213", "0.5161909", "0.51606065", "0.5149177", "0.5145265", "0.51428133", "0.51428133", "0.51428133", "0.51324534", "0.5114864", "0.5111821", "0.5101318", "0.50932455", "0.508885", "0.508885", "0.5073962", "0.50619835", "0.50595635", "0.5055036", "0.5047519", "0.5043943", "0.5040998", "0.5040147", "0.50324875", "0.50087327", "0.4986805", "0.4986805", "0.49797022", "0.49634278", "0.49506235", "0.49472684", "0.49472684", "0.4921939", "0.49098876", "0.4900628", "0.490058", "0.48871082", "0.48860425", "0.48853338", "0.48793903", "0.48793903", "0.48779136", "0.48766962" ]
0.70305467
0
Sets the name of the HTTP server.When running of an internal facing instance this should be configured to the production instance. It's used for the generation of external links e.g. those that are sent out in email.
public void setSiteHttpServerName(String pSiteHttpServerName) { mSiteHttpServerName = pSiteHttpServerName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setName (String name) {\n this.name = name;\n NameRegistrar.register (\"server.\"+name, this);\n }", "public void setServerName(String serverName){\n this.serverName = serverName;\n }", "public void setServerName(final String serverName) {\n this.serverName = serverName;\n }", "public void setServerName(String serverName) {\r\n this.serverName = serverName;\r\n }", "public void setHttpServer(String httpServer) {\n this.httpServer = httpServer;\n }", "public void setServerName(String serverName) {\n this.serverName = serverName;\n }", "public void setHttpServerName(String httpServerName) {\n this.httpServerName = httpServerName;\n }", "public void setServername(String servername) {\r\n this.servername = servername == null ? null : servername.trim();\r\n }", "public static server getNameServer(){\n return nameServer;\n }", "public void setServerName(String serverName) {\n this.serverName = serverName == null ? null : serverName.trim();\n }", "public String getServername() {\r\n return servername;\r\n }", "public static void setNameServer(InetAddress ip, int port){\n nameServer.setIp(ip);\n nameServer.setPort(port);\n }", "public void setBackupServerName(String argName){\n\t backupServerName=argName;\n }", "public void setHost(String hostName)\n {\n this.hostName = hostName;\n }", "public void setNameSite(String nameSite){\n this.mFarm.setNameSite(nameSite);\n }", "public String getServerName() {\n return serverName;\n }", "public String getServerName() {\n return serverName;\n }", "public String getHttpServer() {\n return httpServer;\n }", "public void setInstanceName(final String value)\n {\n instanceName = value;\n }", "public String getServerName(){\n return this.serverName;\n }", "public String getSiteHttpServerName() {\n return mSiteHttpServerName;\n }", "public void setSERVER(String SERVER) {\n \t\tthis.SERVER = SERVER;\n \t}", "@Override\n\t\tpublic String getServerName() {\n\t\t\treturn null;\n\t\t}", "public void setName(String name)\n {\n if (name == null || DefaultFileHandler.sanitizeFilename(name, getLogger()).isEmpty())\n {\n throw new NullPointerException(\"Custom deployable name cannot be null or empty\");\n }\n this.name = name;\n }", "protected String getServerUrl() {\r\n\t\treturn server;\r\n\t}", "private ObjectName getHttpAdaptorName() throws javax.management.MalformedObjectNameException {\n return new ObjectName(\"Server:name=HttpAdaptor\");\n }", "public String getServerName() {\n\t\treturn m_serverName;\n\t}", "public void setServerUrl(String serverUrl) \n {\n \tthis.serverUrl = serverUrl;\n }", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "public String getServerName();", "public String getServerUrl() {\n\t return Config.SERVER_URL;\n }", "public String getServerName() {\n if (server == null) {\n final String version = OpenEjbVersion.get().getVersion();\n final String os = System.getProperty(\"os.name\") + \"/\" + System.getProperty(\"os.version\") + \" (\" + System.getProperty(\"os.arch\") + \")\";\n server = \"OpenEJB/\" + version + \" \" + os;\n }\n return server;\n }", "@Column(length = 1024)\r\n @PlaceHolder(key = \"host\")\r\n public String getServerName() {\r\n return serverName;\r\n }", "public void setHostName(String hostName) {\n this.hostName = hostName;\n }", "@Override\n public String getServerDisplayName() {\n return serverDisplayName;\n }", "public void setServer(URL url) {\n\n\t}", "public void setHostName(String hostName) {\n this.hostName = hostName;\n }", "protected final void setServerUrl(final String serverUrl) {\n this.serverUrl = serverUrl;\n }", "public void setHost(String host);", "public String getSERVER() {\n \t\treturn SERVER;\n \t}", "public void setServerURL(String serverURL) {\n this.serverURL = serverURL;\n saveProperties();\n }", "public void setName(String name) {\n setUserProperty(\"ant.project.name\", name);\n this.name = name;\n }", "@Override\n\tpublic String getName() {\n\t\treturn \"Production Configuration\";\n\t}", "public void setHostName(String hostName) {\n\t\tthis.hostName = hostName;\n\t}", "public void setServer (\r\n String strServer) throws java.io.IOException, com.linar.jintegra.AutomationException;", "TestNamingServer(Test test) throws IOException\n {\n this.test = test;\n this.registration_skeleton = HttpServer.create(new InetSocketAddress(REGISTRATION_PORT), 0);\n this.registration_skeleton.setExecutor(Executors.newCachedThreadPool());\n\n this.service_skeleton = HttpServer.create(new InetSocketAddress(SERVICE_PORT), 0);\n this.service_skeleton.setExecutor(Executors.newCachedThreadPool());\n\n this.gson = new Gson();\n }", "public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }", "public ServerScheduledEventBuilder setName(String name) {\n delegate.setName(name);\n return this;\n }", "public Builder setHost(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n host_ = value;\n onChanged();\n return this;\n }", "FentonServerTag(String name) {\n this.name = name;\n }", "public void setServerUrl(String newUrl) {\n if(newUrl == null){\n return;\n }\n props.setProperty(\"url\", newUrl);\n saveProps();\n }", "public void setServer(int server) {\n this.server = server;\n }", "public void setServicename(java.lang.String newServicename) {\n\tservicename = newServicename;\n}", "private static String getServerUrl() {\n\t\treturn \"http://jfabricationgames.ddns.net:5715/genesis_project_server/genesis_project/genesis_project/\";\n\t}", "public void setSrvTargetNameValue(String srvTargetNameValue)\n throws JNCException {\n setSrvTargetNameValue(new YangString(srvTargetNameValue));\n }", "public static String getServerUrl(Context context) {\n if (mServerUrl == null) {\n ApplicationInfo appInfo = null;\n try {\n appInfo = context.getPackageManager()\n .getApplicationInfo(context.getPackageName(),\n PackageManager.GET_META_DATA);\n mServerUrl = appInfo.metaData.getString(\"WHISPER_SERVER_ADDRESS\");\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n }\n return mServerUrl;\n }", "public ServerMap(int nameServerPort) {\n servers = new HashMap<String, Server>();\n this.nameServerPort = nameServerPort;\n nameServer = new Server(ComsFormat.nameserver_hostname\n , ComsFormat.nameserver_ip, nameServerPort);\n }", "public void setSiteHttpServerPort(int pSiteHttpServerPort) {\n mSiteHttpServerPort = pSiteHttpServerPort;\n }", "private void requestClientNameFromServer() {\n writeToServer(ServerAction.GET_NAME + \"\");\n }", "public void addSrvTargetName() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"srv-target-name\",\n null,\n childrenNames());\n }", "void setHostname(String hostname);", "public String getServerURL() {\n return serverURL;\n }", "public String getServerBase() {\n HttpServletRequest request = FxJsfUtils.getRequest().getRequest();\n return \"http\" + (request.isSecure() ? \"s://\" : \"://\") + FxRequestUtils.getExternalServerName(request);\n }", "public final void setName(java.lang.String name)\r\n\t{\r\n\t\tsetName(getContext(), name);\r\n\t}", "public void setSrvTargetNameValue(YangString srvTargetNameValue)\n throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"srv-target-name\",\n srvTargetNameValue,\n childrenNames());\n }", "void startServer(String name, Config.ServerConfig config);", "public String getServerAlias() {\n return serverAlias;\n }", "public final void setName(java.lang.String name)\n\t{\n\t\tsetName(getContext(), name);\n\t}", "public void setName(final String value)\n\t{\n\t\tsetName( getSession().getSessionContext(), value );\n\t}", "public void setDefaultHost() {\r\n\t\tsetHost(DEFAULT_HOST);\r\n\t}", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void setServer(int port) {\n this.server = port;\n }", "public void setName(String name) {\n if (name == null || name.length() == 0)\n throw new IllegalArgumentException(\"Cannot set pool name to null or empty!\");\n if (poolName != null && !poolName.equals(name))\n throw new IllegalStateException(\"Cannot change pool name once set!\");\n poolName = name;\n log = Logger.getLogger(ObjectPool.class.getName() + \".\" + name);\n }", "public String getServerUrl()\n {\n return null;\n }", "public void setServer(boolean isServer) { this.isServer = isServer; }", "public void setWebsite(final String value)\n\t{\n\t\tsetWebsite( getSession().getSessionContext(), value );\n\t}", "public static String getWebHost() { return mWebHost; }", "public void setStunServer(String server);", "public void setName(String name) {\n if (!name.isEmpty()) {\n this.name = name;\n }\n }", "public void addServer(String nameServer) { \n Server server = new Server(nameServer);\n serversList.add(server);\n }", "protected final String getServerUrl() {\n return this.serverUrl;\n }", "public String getServerURI() {\n return settings.getString(\"server_url\", DEFAULT_SERVER_URL);\n }", "private void setName(java.lang.String name) {\n System.out.println(\"setting name \"+name);\n this.name = name;\n }", "@Override\n\tpublic void setName(java.lang.String name) {\n\t\t_scienceApp.setName(name);\n\t}", "public void setDistDbName(String dbName) {\n\t\tthis.setMsgItem(\"dist_db_name\", dbName);\n\t\tdistDbName = dbName;\n\t}", "public void setName(String s) {\n\t\t\n\t\tname = s;\n\t}", "public Optional<String> tlsServerName() {\n return Codegen.stringProp(\"tlsServerName\").config(config).get();\n }", "public String getServerUrl() {\n return mServerUrl;\n }", "public static String getBaseHost() {\r\n if (baseHost == null) {\r\n baseHost = PropertiesProvider.getInstance().getProperty(\"server.name\", \"localhost\");\r\n }\r\n return baseHost;\r\n }", "String getServerName() {\n return game.z.C;\n }", "public void setName(String name) {\n\t\tName = name;\n\t}", "public void setName(String value) {\n\t\tname = value;\n\t}", "public void setServer(Server server) {\n\t\t\r\n\t}", "public static void setName(String n){\n\t\tname = n;\n\t}", "public void setServer(Server server) {\n this.server = server;\n }", "public String getServer() {\r\n return server;\r\n }", "public String getServer()\n {\n return server;\n }", "public void setWareHouseName(String arg)\n\t{\n\t\tsetValue(WAREHOUSENAME, arg);\n\t}", "public void setupWebServers(){\n if(rwsServer == null || csaServer == null){\n String serverURL = getFirstAttribute(cn,FRONTEND_ADDRESS_TAG);\n setupWebServers(serverURL);\n }\n }" ]
[ "0.7285146", "0.6908866", "0.68128484", "0.6797455", "0.6729238", "0.6718365", "0.6674059", "0.65759003", "0.64467824", "0.6433057", "0.6430243", "0.63709426", "0.6247993", "0.62353826", "0.61710435", "0.6140272", "0.6140272", "0.6117464", "0.60892606", "0.60883296", "0.60745543", "0.6070702", "0.60037595", "0.5953155", "0.59473646", "0.59337825", "0.59246796", "0.59100723", "0.5900725", "0.5900725", "0.58930427", "0.5839693", "0.5800473", "0.57872725", "0.5784611", "0.57830805", "0.57569784", "0.57542104", "0.56928426", "0.56486934", "0.56214637", "0.5619368", "0.56180745", "0.56004375", "0.5598986", "0.5595052", "0.5593865", "0.5563492", "0.5557329", "0.55551994", "0.5540894", "0.5518491", "0.55137247", "0.55022335", "0.54918313", "0.54851705", "0.54843736", "0.5479985", "0.5465423", "0.54583097", "0.54554456", "0.5450872", "0.5447157", "0.5446527", "0.54442245", "0.5440821", "0.5440783", "0.54368806", "0.5435963", "0.54268134", "0.5424632", "0.54088193", "0.5406017", "0.54049593", "0.540034", "0.53950983", "0.53901285", "0.5388911", "0.5388729", "0.5379924", "0.53752553", "0.53619033", "0.535741", "0.5352206", "0.5349883", "0.53432107", "0.53393", "0.5335103", "0.5328637", "0.53259385", "0.5320858", "0.53201246", "0.5310738", "0.5308823", "0.53012675", "0.52973986", "0.52973866", "0.52970016", "0.52963716", "0.5291118" ]
0.6557678
8
Returns the name of the HTTP server. When running of an internal facing instance this should be configured to the production instance. It's used for the generation of external links e.g. those that are sent out in email.
public String getSiteHttpServerName() { return mSiteHttpServerName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServername() {\r\n return servername;\r\n }", "public String getServerName() {\n if (server == null) {\n final String version = OpenEjbVersion.get().getVersion();\n final String os = System.getProperty(\"os.name\") + \"/\" + System.getProperty(\"os.version\") + \" (\" + System.getProperty(\"os.arch\") + \")\";\n server = \"OpenEJB/\" + version + \" \" + os;\n }\n return server;\n }", "public String getHttpServer() {\n return httpServer;\n }", "public String getServerName();", "public static String getServerUrl(Context context) {\n if (mServerUrl == null) {\n ApplicationInfo appInfo = null;\n try {\n appInfo = context.getPackageManager()\n .getApplicationInfo(context.getPackageName(),\n PackageManager.GET_META_DATA);\n mServerUrl = appInfo.metaData.getString(\"WHISPER_SERVER_ADDRESS\");\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n }\n return mServerUrl;\n }", "public String getServerUrl() {\n\t return Config.SERVER_URL;\n }", "protected String getServerUrl() {\r\n\t\treturn server;\r\n\t}", "public static server getNameServer(){\n return nameServer;\n }", "public String getServerName() {\n return serverName;\n }", "public String getServerName() {\n return serverName;\n }", "public String getServerBase() {\n HttpServletRequest request = FxJsfUtils.getRequest().getRequest();\n return \"http\" + (request.isSecure() ? \"s://\" : \"://\") + FxRequestUtils.getExternalServerName(request);\n }", "public String getSERVER() {\n \t\treturn SERVER;\n \t}", "public String getServer()\n {\n return server;\n }", "public String getServerURI() {\n return settings.getString(\"server_url\", DEFAULT_SERVER_URL);\n }", "public String getServer() {\r\n return server;\r\n }", "public String getServerURL() {\n return serverURL;\n }", "public String getServerName() {\n\t\treturn m_serverName;\n\t}", "public static String getBaseHost() {\r\n if (baseHost == null) {\r\n baseHost = PropertiesProvider.getInstance().getProperty(\"server.name\", \"localhost\");\r\n }\r\n return baseHost;\r\n }", "public static String getServer() {\n\t\tif(produccion){\n\t\t\treturn server_produccion;\n\t\t}else{\n\t\t\treturn server;\n\t\t}\t\t\n\t}", "public String getServerUrl() {\n return props.getProperty(\"url\");\n }", "@Override\n\t\tpublic String getServerName() {\n\t\t\treturn null;\n\t\t}", "public String getFullHost() {\n return \"http://\" + get(HOSTNAME_KEY) + \":\" + get(PORT_KEY) + \"/\" + get(CONTEXT_ROOT_KEY) + \"/\";\n }", "public String getServerName(){\n return this.serverName;\n }", "public String getServerUrl() {\n return mServerUrl;\n }", "public String getServerUrl()\n {\n return null;\n }", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "protected final String getServerUrl() {\n return this.serverUrl;\n }", "@Override\n public String getServerDisplayName() {\n return serverDisplayName;\n }", "@NonNull\n public String getServerHostname() {\n return mServerHostname;\n }", "public Optional<String> tlsServerName() {\n return Codegen.stringProp(\"tlsServerName\").config(config).get();\n }", "public static String getServerBaseUrl() {\n if (isProductionMode()) {\n return getConfiguration().productionModeServerBaseUrl();\n }\n return getConfiguration().developmentModeServerBaseUrl();\n }", "public String getServerAlias() {\n return serverAlias;\n }", "String getServerName() {\n return game.z.C;\n }", "public String getHostName() {\n return this.hostContext.getHostName();\n }", "public String getServerUrl() {\n return ipAddress;\n }", "public String getServerUrl() {\r\n return this.fedoraBaseUrl;\r\n }", "default String getHost()\n {\n return getString( \"host\", \"localhost:80\");\n }", "private String getUrlBaseForLocalServer() {\n\t HttpServletRequest request = ((ServletRequestAttributes) \n\t\t\t RequestContextHolder.getRequestAttributes()).getRequest();\n\t String base = \"http://\" + request.getServerName() + ( \n\t (request.getServerPort() != 80) \n\t \t\t ? \":\" + request.getServerPort() \n\t\t\t\t : \"\");\n\t return base;\n\t}", "private static String getServerUrl() {\n\t\treturn \"http://jfabricationgames.ddns.net:5715/genesis_project_server/genesis_project/genesis_project/\";\n\t}", "public String getHostname() {\n return this.config.getHostname();\n }", "public String getHost( ) {\n return props.getProperty(HOST, \"localhost\");\n }", "default String socket() {\n return WebServer.DEFAULT_SOCKET_NAME;\n }", "public String getHost() {\r\n \t\treturn properties.getProperty(KEY_HOST);\r\n \t}", "private String getHostName() {\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);\n\n return preferences.getString(activity.getString(R.string.pref_host_id), activity.getString(R.string.pref_default_host_name));\n }", "public URL getServer() {\n\t\treturn null;\n\t}", "private String getServerDetails() {\n String sServerLine = \"Server: Ramon's Killer \";\n String sSocketType = (bIsSecure ? \"(SECURE)\" : \"(unsecure)\");\n sServerLine = sServerLine + sSocketType + \" Server\";\n return sServerLine;\n }", "String getServerUrl();", "java.lang.String getHost();", "java.lang.String getHost();", "public String getWorldName() {\n String worldname = getMapName();\n if (worldname.equals(\"MpServer\")) {\n //This removes the port\n String[] split = getServerName().toLowerCase().split(\":\");\n worldname = split[0];\n }\n return worldname;\n }", "public String getHostName() {\n return FxSharedUtils.getHostName();\n }", "@Column(length = 1024)\r\n @PlaceHolder(key = \"host\")\r\n public String getServerName() {\r\n return serverName;\r\n }", "String host();", "String getHost();", "@NonNull\n public String getServerAddr() {\n if (mIkeTunConnParams == null) return mServerAddr;\n\n final IkeSessionParams ikeSessionParams = mIkeTunConnParams.getIkeSessionParams();\n return ikeSessionParams.getServerHostname();\n }", "public String getHost();", "public String getHost();", "String getHostName();", "String getHostName();", "private ObjectName getHttpAdaptorName() throws javax.management.MalformedObjectNameException {\n return new ObjectName(\"Server:name=HttpAdaptor\");\n }", "private String makeServerUrl(){\n\t\tURL url = null;\n\t\t\n\t\t//Make sure we have a valid url\n\t\tString complete = this.preferences.getString(\"server\", \"\");\n\t\ttry {\n\t\t\turl = new URL( complete );\n\t\t} catch( Exception e ) {\n\t\t\tonCreateDialog(DIALOG_INVALID_URL).show();\n\t\t\treturn null;\n\t\t}\n\t\treturn url.toExternalForm();\n\t}", "public YangString getSrvTargetNameValue() throws JNCException {\n return (YangString)getValue(\"srv-target-name\");\n }", "public String getServerPort() {\r\n\t\treturn this.serverPort;\r\n\t}", "default String getHost() {\n return \"localhost\";\n }", "String getIntegHost();", "public String getHostName();", "public String getBaseUrl() {\n StringBuffer buf = new StringBuffer();\n buf.append(getScheme());\n buf.append(\"://\");\n buf.append(getServerName());\n if ((isSecure() && getServerPort() != 443) ||\n getServerPort() != 80) {\n buf.append(\":\");\n buf.append(getServerPort());\n }\n return buf.toString();\n }", "public static String getHostname()\n\t{\n\t\treturn hostname; // send the hostname\n\t}", "public String getServerDetails();", "public String getServerDescription();", "public static String getWebHost() { return mWebHost; }", "public String getHost() {\n\t\ttry {\n\t\t\treturn InetAddress.getLocalHost().getHostName();\n\t\t} catch (UnknownHostException e) {\n\t\t\treturn \"unknown\";\n\t\t}\n\t}", "public static String getNetServerHandlerName() {\n \t\treturn getNetServerHandlerClass().getSimpleName();\n \t}", "public int getSiteHttpServerPort() {\n return mSiteHttpServerPort;\n }", "public String hostname() {\n return this.hostname;\n }", "public String getServerPort() {\n\t\treturn mServerPort;\n\t}", "public String getNameSite(){\n return this.mFarm.getNameSite();\n }", "public String getHostName() {\n return hostName;\n }", "public String getHostName() {\n return hostName;\n }", "public String getServerAddress() {\r\n\t\treturn this.serverAddress;\r\n\t}", "public String getHostName()\n\t{\n\t\treturn hostName;\n\t}", "public String getTutRepositoryServerName()\n {\n return tutRepositoryServerName;\n }", "public String getHost() {\n\t\treturn url.getHost();\n }", "String getServerId();", "private String getHostName()\n\t{\n\t\treturn hostName;\n\t}", "public int getServerPortNumber(){\n return this.serverPortNumber;\n }", "public String url() {\n return server.baseUri().toString();\n }", "public static String getHttpHostName(ConfigurationExtensions configurationExtensions) {\n return configurationExtensions.get(HTTP_HOSTNAME);\n }", "String getMetaServerAddress(Env targetEnv);", "public static String getServerSSLConfigFileName() {\n return getSSLConfigFileName(\"ssl-server\");\n }", "public String host() {\n return host;\n }", "public final static String getServerIdentificator() {\r\n\t\treturn serverID;\r\n\t}", "private static String getHostNameImpl() {\n String bindAddr = System.getProperty(\"jboss.bind.address\");\n if (bindAddr != null && !bindAddr.trim().equals(\"0.0.0.0\")) {\n return bindAddr;\n }\n\n // Fallback to qualified name\n String qualifiedHostName = System.getProperty(\"jboss.qualified.host.name\");\n if (qualifiedHostName != null) {\n return qualifiedHostName;\n }\n\n // If not on jboss env, let's try other possible fallbacks\n // POSIX-like OSes including Mac should have this set\n qualifiedHostName = System.getenv(\"HOSTNAME\");\n if (qualifiedHostName != null) {\n return qualifiedHostName;\n }\n\n // Certain versions of Windows\n qualifiedHostName = System.getenv(\"COMPUTERNAME\");\n if (qualifiedHostName != null) {\n return qualifiedHostName;\n }\n\n try {\n return NetworkUtils.canonize(getLocalHost().getHostName());\n } catch (UnknownHostException uhe) {\n uhe.printStackTrace();\n return \"unknown-host.unknown-domain\";\n }\n }", "public String getHostName (){\n return hostName;\n }", "public String getDBName()\n {\n return dbServer;\n }", "public String getHostName() {\n\t\treturn hostName;\n\t}", "public String getHostName() {\n\t\treturn hostName;\n\t}", "static String getHostName() {\n try {\n return InetAddress.getLocalHost().getHostName();\n } catch (UnknownHostException e) {\n return \"unknown\";\n }\n }", "public String getHostName() {\n\t\treturn \"RaspberryHostName\";\n\t}" ]
[ "0.74535936", "0.73156667", "0.730189", "0.7197111", "0.7181156", "0.71589714", "0.7150648", "0.7139653", "0.7126989", "0.7126989", "0.7107937", "0.7023816", "0.701307", "0.6964551", "0.69366586", "0.69124466", "0.68849325", "0.68822336", "0.6876154", "0.68070203", "0.6773892", "0.67487925", "0.6744073", "0.66738176", "0.66600484", "0.6656191", "0.6656191", "0.6643187", "0.6615922", "0.65995353", "0.65857893", "0.65812933", "0.65732235", "0.6569007", "0.6566856", "0.65570045", "0.6556155", "0.65304893", "0.6480586", "0.64698416", "0.64545035", "0.6401818", "0.63990253", "0.6372706", "0.63618684", "0.6355127", "0.63514555", "0.633192", "0.63139206", "0.63139206", "0.63109", "0.6309281", "0.63092613", "0.63029", "0.62820345", "0.62287647", "0.6223565", "0.6223565", "0.62076795", "0.62076795", "0.6204999", "0.6201747", "0.6188739", "0.6186124", "0.61636096", "0.61590934", "0.6151721", "0.61340684", "0.612838", "0.61260355", "0.61166245", "0.6113785", "0.61128694", "0.6107302", "0.61015934", "0.6099448", "0.60945165", "0.608792", "0.6077964", "0.6077964", "0.60623044", "0.6051128", "0.6050539", "0.60453254", "0.60435665", "0.6033693", "0.6031412", "0.6026592", "0.602314", "0.6012768", "0.6006805", "0.60065836", "0.60062706", "0.60024583", "0.5995406", "0.5991803", "0.598639", "0.598639", "0.5982142", "0.59802973" ]
0.7266547
3
Sets the port number of the HTTP server. When running of an internal facing instance this should be configured to the production instance. It's used for the generation of external links e.g. those that are sent out in email. Sets the port of the HTTP server.
public void setSiteHttpServerPort(int pSiteHttpServerPort) { mSiteHttpServerPort = pSiteHttpServerPort; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setServerPort(int serverPort) {\n this.serverPort = serverPort;\n }", "public void setServer(int port) {\n this.server = port;\n }", "@Parameter(optional=true, description=\"Port number for the embedded Jetty HTTP server, default: \\\\\\\"\" + ServletEngine.DEFAULT_PORT + \"\\\\\\\". \"\n\t\t\t+ \"If the port is set to 0, the jetty server uses a free tcp port, and the metric `serverPort` delivers the actual value.\")\n\tpublic void setPort(int port) {}", "public void setServerport(Integer serverport) {\n this.serverport = serverport;\n }", "public void setServerPortNumber(int serverPortNumber){\n this.serverPortNumber = serverPortNumber;\n }", "public void setHttpPort(Integer port) {\n\t\tif (myNode != null) {\n\t\t\tthrow new IllegalStateException(\"change of port only before startup!\");\n\t\t}\n\t\tif (port == null || port < 1) {\n\t\t\thttpPort = 0;\n\t\t} else {\n\t\t\thttpPort = port;\n\t\t}\n\t}", "public void setServerPort(int serverPort) {\n\t\tthis.serverPort = serverPort;\n\t}", "protected final void setServerPort(final int serverPort) {\n this.serverPort = serverPort;\n }", "final public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\r\n this.port = port;\r\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port);", "public void setPort(int port);", "public void setPort (int port) {\n this.port = port;\n }", "public void port (int port) {\n this.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setServerPort(final UnsignedShort serverPort) {\n this.serverPort = serverPort;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(String port) {\r\n this.port = port;\r\n }", "public static void setPort(int port){\n catalogue.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(int port) {\n m_Port = port;\n }", "public void setServerPort(String mServerPort) {\n\t\tthis.mServerPort = mServerPort;\n\t}", "public void setPort(int port) {\r\n\t\tthis.port = port;\r\n\t}", "public void setPort(int port) {\r\n\t\tthis.port = port;\r\n\t}", "public void setPortNumber(int portNumber) {\n this.portNumber = portNumber;\n }", "public void setPort(int value) {\n this.port = value;\n }", "public void setPort(final String port){\n this.port=port;\n }", "public void setPort(int port) {\n\t\tthis.port = port;\n\t}", "public void setPort(int port) {\n\t\tthis.port = port;\n\t}", "public void setHttpsPort(Integer port) {\n\t\tif (myNode != null) {\n\t\t\tthrow new IllegalStateException(\"change of port only before startup!\");\n\t\t}\n\t\tif (port == null || port < 1) {\n\t\t\thttpsPort = 0;\n\t\t} else {\n\t\t\thttpsPort = port;\n\t\t}\n\t}", "Builder setPort(String port);", "public HttpClient setPort(Env env, NumberValue port) {\n client.setPort(port.toInt());\n return this;\n }", "public WebServer (int port)\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}", "public void setPortNumber(long portNumber) {\n this.portNumber = portNumber;\n }", "public void setPortNumber(int value) {\n this.portNumber = value;\n }", "public void setPort(final int p) {\n this.port = p;\n }", "public int getServerPort(){\n\t\treturn serverPort; \n\t}", "@Override\n\tpublic void setPort(Integer port) {\n\t\tthis.port=port;\n\t}", "public void setPort(final int p) {\n this.port = p;\n }", "public void setPort(int p) {\n\t\tport = p;\n\t}", "public void setPortNumber(java.lang.Integer portNumber) {\r\n this.portNumber = portNumber;\r\n }", "public void setPort(int portNo) {\n if(port != portNo) {\n port = portNo;\n init();\n }\n }", "public CertAuthHost setPort(int port)\n\t\t{\n\t\t\tif (this.started)\n\t\t\t\tthrow new IllegalStateException(\"Server already started!\");\n\t\t\tthis.port = port;\n\t\t\treturn this;\n\t\t}", "private void setPort(int value) {\n \n port_ = value;\n }", "private void setPort(int value) {\n \n port_ = value;\n }", "public com.example.DNSLog.Builder setPort(int value) {\n validate(fields()[6], value);\n this.port = value;\n fieldSetFlags()[6] = true;\n return this;\n }", "public static int getServerPort() {\n return serverPort;\n }", "public int getHttpPort() {\n return httpServer.getPort();\n }", "public void setHL7ServerPort(Integer val) {\n\t\tmServerPort = val;\n\t}", "public int getServerPortNumber(){\n return this.serverPortNumber;\n }", "public static int getServerPort() {\n return _serverPort;\n }", "public int getServerPort() {\n return serverPort;\n }", "void setServicePort( int p );", "public GameServer(int portNum)\n\t{\n\t\tport = portNum;\n\t}", "public HttpProxy(int port)\n {\n thisPort = port;\n }", "public void setPort(int a_port)\n\t{\n\t\tif (!isValidPort(a_port))\n\t\t{\n\t\t\tm_iInetPort = -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_iInetPort = a_port;\n\t\t}\n\t}", "public int getServerPort() {\n\t\treturn serverPort;\n\t}", "public void setHttpProxyPort(int port);", "public void setPort(int port) {\n this.port = port;\n prefs.putInt(\"AEUnicastOutput.port\", port);\n }", "public SecureWebServer(int port)\n {\n this(port, null);\n }", "public Builder setPort(int value) {\n \n port_ = value;\n onChanged();\n return this;\n }", "public Builder setPort(int value) {\n \n port_ = value;\n onChanged();\n return this;\n }", "public static int getServerPort(){\n return thisServer.getPort();\n }", "public Builder setPort(int value) {\n\n port_ = value;\n onChanged();\n return this;\n }", "public Builder setPort(int value) {\n\n port_ = value;\n onChanged();\n return this;\n }", "public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}", "public static void setTestConnectionPort(String port) {\n TEST_CONNECTION_PORT = port;\n }", "public WebServer (String sHost, int port)\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = sHost; \t\t\t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}", "default int getPort() {\n return getServer().getPort();\n }", "public void setTcpServerPort(int tcpServerPort)\n \t{\n \t\tthis.tcpServerPort = tcpServerPort;\n \t}", "public Server(int port)\r\n\t\t{\r\n log(\"Initialising port \" + port);\r\n\r\n\t\t// Set the port\r\n\t\tthis.port = port;\r\n\r\n // Create the server socket\r\n createServerSocket();\r\n \t}", "public ChatRoomServer(int portNumber){\n this.ClientPort = portNumber;\n }", "default Object port() {\n return metadata().get(\"server-port\");\n }", "public int getServerPort() {\n return Integer.parseInt(this.serverProperties.getProperty(PORT));\n }", "public void setSmtpPort(int value) {\n this.smtpPort = value;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public Integer getServerport() {\n return serverport;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "protected final int getServerPort() {\n return this.serverPort;\n }", "@java.lang.Override\n public int getPort() {\n return port_;\n }", "@java.lang.Override\n public int getPort() {\n return port_;\n }", "@Override\n\t\tpublic int getServerPort() {\n\t\t\treturn 0;\n\t\t}", "public Builder setPort(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n port_ = value;\n onChanged();\n return this;\n }" ]
[ "0.8017567", "0.7959048", "0.79269797", "0.78195745", "0.78049415", "0.7735967", "0.7721644", "0.75833416", "0.7526686", "0.7508343", "0.750116", "0.750116", "0.750116", "0.750116", "0.750116", "0.750116", "0.74819773", "0.74819773", "0.74652624", "0.7453089", "0.74507", "0.7449104", "0.7400029", "0.7397246", "0.7381223", "0.7368645", "0.7368645", "0.7368645", "0.7368645", "0.73431087", "0.73345214", "0.732543", "0.732543", "0.7317031", "0.7278214", "0.7260936", "0.7255583", "0.7255583", "0.7241747", "0.71147585", "0.7104715", "0.7091635", "0.70551354", "0.7048308", "0.70413804", "0.70396155", "0.70334274", "0.70025605", "0.70021725", "0.69868237", "0.6983998", "0.6963299", "0.6937188", "0.6937188", "0.6933929", "0.6911336", "0.6907328", "0.6893139", "0.6886815", "0.6843289", "0.68322676", "0.6817018", "0.6813853", "0.6798084", "0.6776779", "0.6772802", "0.6772553", "0.67053854", "0.6674578", "0.6672644", "0.6672644", "0.6659541", "0.6655999", "0.6655999", "0.66521525", "0.66335416", "0.6631224", "0.66279525", "0.66129315", "0.6612732", "0.66089946", "0.65824115", "0.6567031", "0.65627813", "0.65323555", "0.65323555", "0.65323555", "0.65323555", "0.65318996", "0.6516024", "0.6516024", "0.6516024", "0.6516024", "0.6516024", "0.6516024", "0.6504624", "0.6472736", "0.6472253", "0.6446445", "0.6440239" ]
0.74411464
22
Returns the port number of the HTTP server. When running of an internal facing instance this should be configured to the production instance. It's used for the generation of external links e.g. those that are sent out in email.
public int getSiteHttpServerPort() { return mSiteHttpServerPort; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getHttpPort() {\n return httpServer.getPort();\n }", "public static int getServerPort() {\n return _serverPort;\n }", "public int getServerPortNumber(){\n return this.serverPortNumber;\n }", "public static int getServerPort() {\n return serverPort;\n }", "public static int getServerPort(){\n return thisServer.getPort();\n }", "public int getServerPort() {\n return Integer.parseInt(this.serverProperties.getProperty(PORT));\n }", "public int getServerPort(){\n\t\treturn serverPort; \n\t}", "public int getServerPort() {\n return serverPort;\n }", "default int getPort() {\n return getServer().getPort();\n }", "public String getServerPort() {\r\n\t\treturn this.serverPort;\r\n\t}", "public int getServerPort() {\n\t\treturn serverPort;\n\t}", "public Integer getServerport() {\n return serverport;\n }", "protected final int getServerPort() {\n return this.serverPort;\n }", "default Object port() {\n return metadata().get(\"server-port\");\n }", "public String getServerPort() {\n\t\treturn mServerPort;\n\t}", "public UnsignedShort getServerPort() {\n return this.serverPort;\n }", "public static String getBasePort() {\r\n if (basePort == null) {\r\n basePort = PropertiesProvider.getInstance().getProperty(\"server.port\", \"8080\");\r\n }\r\n return basePort;\r\n }", "public int getPort()\n {\n\t\treturn url.getPort();\n }", "public int getPort() {\n final int port = getPortIfSpecified();\n if (port == UNSPECIFIED_PORT) {\n String prot = getProtocol();\n if (HTTPConstants.PROTOCOL_HTTPS.equalsIgnoreCase(prot)) {\n return HTTPConstants.DEFAULT_HTTPS_PORT;\n }\n if (!HTTPConstants.PROTOCOL_HTTP.equalsIgnoreCase(prot)) {\n log.warn(\"Unexpected protocol: \"+prot);\n // TODO - should this return something else?\n }\n return HTTPConstants.DEFAULT_HTTP_PORT;\n }\n return port;\n }", "public int getPort() {\n final int port = getPortIfSpecified();\n if (port == UNSPECIFIED_PORT) {\n String prot = getProtocol();\n if (HTTPConstants.PROTOCOL_HTTPS.equalsIgnoreCase(prot)) {\n return HTTPConstants.DEFAULT_HTTPS_PORT;\n }\n if (!HTTPConstants.PROTOCOL_HTTP.equalsIgnoreCase(prot)) {\n log.warn(\"Unexpected protocol: \" + prot);\n // TODO - should this return something else?\n }\n return HTTPConstants.DEFAULT_HTTP_PORT;\n }\n return port;\n }", "@Override\n public int getPort() {\n final ServiceTracker<HttpService, HttpService> serviceTracker = new ServiceTracker<>(context, HttpService.class, null);\n serviceTracker.open();\n final ServiceReference<HttpService> serviceReference = serviceTracker.getServiceReference();\n serviceTracker.close();\n return ofNullable(serviceReference)\n .map(it -> it.getProperty(\"org.osgi.service.http.port\"))\n .map(String::valueOf)\n .map(Integer::parseInt)\n .orElse(80);\n }", "public int getHttpdPort() {\r\n int toReturn = 0;\r\n\r\n String[] paramFields = {};\r\n SocketMessage request = new SocketMessage(\"admin\", \"httpd_port\",\r\n SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n\r\n SocketMessage response = handleMessage(request);\r\n if (isSuccessful(response)) {\r\n toReturn = Tools.parseInt(response.getValue(\"port\"));\r\n } else {\r\n wrapError(\"APIL_0206\", \"couldn't get httpd port number\");\r\n }\r\n\r\n return toReturn;\r\n }", "public Integer getServerPortValue() {\n\t\treturn Integer.decode(this.properties.getProperty(PARAM_NAME_SERVER_PORT, DEFAULT_SERVER_PORT));\n\t}", "default int getPort()\n {\n return getInt(\"port\", 80);\n }", "public int getDesiredHttpPort() {\n return desiredHttpPort;\n }", "public int getPort() {\n return this.config.getPort();\n }", "public static int getPort() {\n return port;\n }", "public static int getServerPort() { return Integer.parseInt(tfJoinPort.getText()); }", "public int getPort() {\n return serverSocket.getLocalPort();\n }", "public int getPortNumber() {\n return portNumber;\n }", "public int getPortNumber() {\n return portNumber;\n }", "@Override\n\t\tpublic int getServerPort() {\n\t\t\treturn 0;\n\t\t}", "public static int getPort(){\n return catalogue.port;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public long getPortNumber() {\n return portNumber;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public int getPort() {\n return port_;\n }", "public static String getPort() {\n\t\treturn port;\r\n\t}", "static int getHerokuAssignedPort() {\n ProcessBuilder processBuilder = new ProcessBuilder();\n if (processBuilder.environment().get(\"PORT\") != null) {\n return Integer.parseInt(processBuilder.environment().get(\"PORT\"));\n }\n return 7000; //Retorna el puerto por defecto en caso de no estar en Heroku.\n }", "@Override\n\tpublic int getServerPort() {\n\t\treturn 0;\n\t}", "public int getPort() {\n return instance.getPort();\n }", "public int getPort() {\n return instance.getPort();\n }", "static int getHerokuAssignedPort() {\n ProcessBuilder processBuilder = new ProcessBuilder();\n if (processBuilder.environment().get(\"PORT\") != null) {\n return Integer.parseInt(processBuilder.environment().get(\"PORT\"));\n }\n return 4567; //Retorna el puerto por defecto en caso de no estar en Heroku.\n }", "public int getPortNumber (){\r\n\t\treturn portNumber;\r\n\t}", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\r\n return port;\r\n }", "public int getPort() {\r\n return port;\r\n }", "public int getPort() {\r\n return port;\r\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getPort() {\n return port;\n }", "public int getTcpServerPort()\n \t{\n \t\treturn tcpServerPort;\n \t}", "private static int getHerokuAssignedPort() {\n return 4567;\n }", "public int getPort()\n {\n return port;\n }", "public int getPort () {\n return port;\n }", "@java.lang.Override\n public int getPort() {\n return port_;\n }", "@java.lang.Override\n public int getPort() {\n return port_;\n }", "public int actualPort() {\n return this.port;\n }", "public int getDesiredHttpsPort() {\n return desiredHttpsPort;\n }", "public Integer port() {\n return this.port;\n }", "public Integer port() {\n return this.port;\n }", "public int getPort()\n\t{\n\t\treturn port;\n\t}", "public int getPort()\n\t{\n\t\treturn port;\n\t}", "public int getPort(){\r\n\t\ttry {\r\n\t\t\treturn this.workerobj.getInt(WorkerController.PORT);\r\n\t\t} catch (JSONException e) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public Integer getPort() {\n return port;\n }", "public Integer getPort() {\n return port;\n }", "public int getPort() {\n \t\treturn port;\n \t}", "public int getPort() {\n \t\treturn port;\n \t}", "@java.lang.Override\n public int getPort() {\n return port_;\n }", "@java.lang.Override\n public int getPort() {\n return port_;\n }", "public Integer getPort() {\n return port;\n }", "public int getPort() {\n\t\treturn port;\n\t}", "public int getPort() {\n\t\treturn port;\n\t}", "public int getPort() {\n\t\treturn port;\n\t}", "public int getPort() {\n\t\treturn port;\n\t}", "public int getPort() {\n\t\treturn port;\n\t}", "public java.lang.Integer getPortNumber() {\r\n return portNumber;\r\n }", "public int getPort() { return port; }", "public int getPort() {\r\n\t\treturn port;\r\n\t}", "public int getPort() {\r\n\t\treturn port;\r\n\t}", "int getPort()\n {\n return port;\n }", "int getPort() {\n return port;\n }" ]
[ "0.8235176", "0.8224679", "0.8212177", "0.8205399", "0.8193774", "0.8164073", "0.8114819", "0.81011146", "0.80822825", "0.8002187", "0.7991916", "0.79383415", "0.7897936", "0.7896748", "0.7886073", "0.7791272", "0.7766935", "0.77581185", "0.77521366", "0.77449393", "0.7686146", "0.7443646", "0.7441933", "0.7438124", "0.73907447", "0.73532915", "0.73293287", "0.7303855", "0.7288069", "0.7249407", "0.7249407", "0.7246538", "0.72320426", "0.7197152", "0.7197152", "0.7197152", "0.7197152", "0.71840316", "0.71706283", "0.71706283", "0.71706283", "0.71706283", "0.71706283", "0.71706283", "0.7153622", "0.71192414", "0.7108392", "0.7073611", "0.7073611", "0.70523494", "0.70383936", "0.70301384", "0.70301384", "0.7007943", "0.7007943", "0.7007943", "0.6999154", "0.6999154", "0.6999154", "0.6999154", "0.6999154", "0.6999154", "0.6999154", "0.6999154", "0.69888216", "0.69888216", "0.69888216", "0.69888216", "0.69888216", "0.6973041", "0.69720453", "0.6969398", "0.6961374", "0.6956593", "0.6956593", "0.6932593", "0.6931168", "0.69178724", "0.69178724", "0.6909256", "0.6909256", "0.68908334", "0.6888538", "0.6888538", "0.6887314", "0.6887314", "0.6885813", "0.68852746", "0.6872854", "0.6872498", "0.6872498", "0.6872498", "0.6872498", "0.6872498", "0.68713385", "0.68688136", "0.6865281", "0.6865281", "0.6858435", "0.6847327" ]
0.7565145
21
Sets the location of the default resource bundle. This is used if no resource bundle is defined in the site configuration repository item.
public void setDefaultResourceBundle(String pDefaultResourceBundle) { mDefaultResourceBundle = pDefaultResourceBundle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBundleLocation(String bundleLocation) {\n this.bundleLocation = bundleLocation;\n }", "private void loadDefaultConfig() {\r\n ResourceBundle bundle = ResourceLoader.getProperties(DEFAULT_CONFIG_NAME);\r\n if (bundle != null) {\r\n putAll(bundle);\r\n } else {\r\n LOG.error(\"Can't load default Scope config from: \" + DEFAULT_CONFIG_NAME);\r\n }\r\n }", "abstract public ResourceManager getDefaultConfig();", "public String getDefaultResourceFileName() \n {\n return null; \n }", "@Override\n public void setResourceBundle(String resourceBundleName) {\n myResourceBundle = ResourceBundle.getBundle(\"/buttonProperties/\" + resourceBundleName);\n }", "public String getDefaultResourceBundle() {\n return mDefaultResourceBundle;\n }", "@Override\r\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\r\n\t}", "public void setLocation(Resource location) {\n\t\tthis.locations = new Resource[] {location};\n\t}", "abstract public void setTopResourcesDir(String path);", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n bundle = ResourceBundle.getBundle(\"net.sourceforge.tessboxeditor.Gui\"); // NOI18N\n imageFolder = new File(prefs.get(\"ImageFolder\", System.getProperty(\"user.home\")));\n }", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t// set images\n\t\tImage img1 = new Image(this.getClass().getResource(\"loginForm.PNG\").toString());\n\t\timgLogin.setImage(img1);\n\t\tImage img2 = new Image(this.getClass().getResource(\"logo.png\").toString());\n\t\timgLogo.setImage(img2);\n\t\tImage img3 = new Image(this.getClass().getResource(\"copyright.png\").toString());\n\t\timgCopyRights.setImage(img3);\n\t}", "private void initResources() {\n resources = ResourceBundle.getBundle(\"bundles.ChangeTBRFrameResources\");\n }", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "public void setResourcePath(String resourcePath) {\n //To change body of implemented methods use File | Settings | File Templates.\n }", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t}", "public void forceDefaultConfig()\n {\n plugin.saveResource(fileName, true);\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n }", "public void initialize(URL location, ResourceBundle resources) {\t\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t \n\t}", "@Override\n public void initialize(URL location, ResourceBundle resources) {}", "public void initialize(URL location, ResourceBundle resources) {\r\n\r\n\t}", "@Override\r\n public void initialize(URL location, ResourceBundle resources) {\r\n\r\n }", "public String getBundleLocation() {\n return bundleLocation;\n }", "public void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t}", "@Override\n public void initialize(URL location, ResourceBundle resources)\n {\n init();\n }", "abstract public void setRingResourcesDir(String path);", "@Override\r\n public void initialize(URL location, ResourceBundle resources)\r\n {\n }", "@Override\r\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\r\n\t}", "public void setLocalizedResourceBundle(String path) {\n resourceBundlePath = path;\n resource = ResourceBundle.getBundle(path);\n }", "@Override\n public void initialize(URL location, ResourceBundle rb) {\n }", "public void setResourceBundle(ResourceBundle rb) {\n resourcesBundle = rb;\n loader.setResources(rb);\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n\n }", "private void extractDefaultGeneratorLogo() {\n try {\n PlatformUtil.extractResourceToUserConfigDir(getClass(), DEFAULT_GENERATOR_LOGO, true);\n } catch (IOException ex) {\n logger.log(Level.SEVERE, \"Error extracting report branding resource for generator logo \", ex); //NON-NLS\n }\n defaultGeneratorLogoPath = PlatformUtil.getUserConfigDirectory() + File.separator + DEFAULT_GENERATOR_LOGO;\n }", "public void setResourceBundle(String value)\r\n {\r\n getSemanticObject().setProperty(swb_resourceBundle, value);\r\n }", "private void setDefaultPath(){\n\t\tdownloadPath = System.getProperty(\"user.home\") + File.separator + \"Downloads\" + File.separator;\n\t\tif(!downloadPath.endsWith(File.separator)){\n\t\t\tdownloadPath += File.separator;\n\t\t}\n\t\tcurrentPath.setText(downloadPath);\n\t\tcurrentPath.setToolTipText(downloadPath);\n\t}", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n undoButton.setDisable(true);\n resetButton.setDisable(true);\n }", "@Override\n\tpublic void initialize(URL url, ResourceBundle rsb) {\n\t\twelcomeAdmin.setText(\"Welcome!\");\n\t\twelcomeAdmin.setFont(Font.font(40));\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\tImage imgcontact = new Image(\"/images/Contact.png\");\n\t\tthis.contactUs.setImage(imgcontact);\n\t}", "public void init (String path, ResourceBundle bundle)\n {\n _path = path;\n _bundle = bundle;\n }", "private static void resetConfiguration(Configuration defaultConfig) {\n new Resources(IEAApp.getInstance().getResources().getAssets(),\n IEAApp.getInstance().getResources().getDisplayMetrics(),\n defaultConfig);\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n // set treeView. Show all subdirectories and photos under every subdirectories.\n try {\n setTree();\n } catch (IOException e) {\n e.printStackTrace();\n }\n // set Gallery Display. Only show the photo directly under the selected directory.\n setGalleryDisplay();\n }", "protected void initBundle (MessageBundle bundle, String path, ResourceBundle rbundle) {\n MessageBundle parentBundle = null;\n try {\n parentBundle = getBundle(rbundle.getString(\"__parent\"));\n // Note: if getBundle() fails to find our parent it will log a warning and return null\n } catch (MissingResourceException mre ) {\n // no resource named __parent: it's ok.\n }\n if (parentBundle == null) {\n parentBundle = _global;\n }\n bundle.init(this, path, rbundle, parentBundle);\n }", "public static void setDefaultPath(String path) {\n\t\tPATH = path;\n\t}", "@Override\n public void initialize(java.net.URL location, java.util.ResourceBundle resources) {\n login = new Login();\n navLogin();\n }", "public void setResourcePath(IPath path) {\n setResourcePath(path != null ? path.toString() : \"\");\n }", "@Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n // Method override to initialize the root and resource bundle\n }", "private void updateBundle() {\n\n this.bundle = ResourceBundle.getBundle(\"languages\", this.locales.get(this.currentLocaleIndex));\n }", "private Properties loadDefaultProperties() {\n Properties pref = new Properties();\n try {\n String path = \"resources/bundle.properties\";\n InputStream stream = PreferenceInitializer.class.getClassLoader().getResourceAsStream(path);\n pref.load(stream);\n } catch (IOException e) {\n ExceptionHandler.logAndNotifyUser(\"The default preferences for AgileReview could not be initialized.\"\n + \"Please try restarting Eclipse and consider to write a bug report.\", e, Activator.PLUGIN_ID);\n return null;\n }\n return pref;\n }", "public DefaultPackagesResourceConfig() {\n this(Class.class.getPackage().getName());\n }", "@Override\r\n\tpublic void initialize(URL location, ResourceBundle resources) {\r\n \tnewUser_Manage.setPromptText(currentUser.getUserName());\r\n \tnewGoal_Manage.setPromptText(currentUser.getGoal());\r\n\t}", "private void configureResourceBundles() {\n getResourceBundles().addJavaScriptBundle(XKonneXRepoApplication.class, \"core.js\",\n (JavaScriptResourceReference) getJavaScriptLibrarySettings().getJQueryReference(),\n (JavaScriptResourceReference) getJavaScriptLibrarySettings().getWicketEventReference(),\n (JavaScriptResourceReference) getJavaScriptLibrarySettings().getWicketAjaxReference()\n );\n\n getResourceBundles().addCssBundle(XKonneXRepoApplication.class, \"application.css\",\n org.xkonnex.repo.server.web.layout.FixBootstrapStylesCssResourceReference.INSTANCE\n );\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n log.trace(LogMessages.MSG_CTRL_INITIALIZATION);\n this.languageBundle.setValue(resources);\n initPanes();\n initListeners();\n log.trace(LogMessages.MSG_CTRL_INITIALIZED);\n\n }", "public static String getResourceString (String aResourceKey,\n String aDefaultValue)\n {\n String result = null;\n String resourceFile = ADMIN_CONSOLE_BUNDLE;\n result = getResourceString(resourceFile, aResourceKey, aDefaultValue);\n return result;\n }", "protected void SetDefault() {\r\n\t\tBrickFinder.getDefault().setDefault();\t\t\r\n\t}", "static private void loadBundle() {\r\n\r\n\t\tfinal Locale loc;\r\n\r\n\t\t//load the default or a forced locale\r\n\t\tif (strLanguage == null) {\r\n\t\t\tloc = Locale.getDefault();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tloc = new Locale(strLanguage);\r\n\t\t}\r\n\r\n\t\tresBundle = RiskUtil.getResourceBundle(TranslationBundle.class,\"Risk\",loc);\r\n\r\n\t\t// this will work MOST of the time, but does not in lobby\r\n\t\t// for some reason it stops the classes from loading, and does not find the files\r\n\t\t//resBundle = ResourceBundle.getBundle(\"net.yura.domination.engine.translation.Risk\", loc );\r\n\r\n\r\n\t}", "@Override\r\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\tpendingBookingsTable.setPlaceholder(new Label(\"NO PENDING BOOKINGS. PLEASE UPDATE TO CHECK AGAIN\"));\r\n\t\tcarsExposedTable.setPlaceholder(new Label(\"THERE ARE NO CARS IN THIS CONCESSIONAIRE\"));\r\n\t}", "public static void setDefault(SARLEclipsePlugin defaultInstance) {\n\t\tinstance = defaultInstance;\n\t}", "public void setDefaultImg(YuiImage defaultImg) {\r\n\t\tthis.defaultImg = defaultImg;\r\n\t}", "public void initialize(URL location, ResourceBundle resources) {\n\n }", "@Override\n\tpublic ResourceLocator getResourceLocator() {\n\t\treturn SampledefinitionEditPlugin.INSTANCE;\n\t}", "public void setDefaultProperties(ResourceProperties defaultProperties) {\n this.defaultProperties = defaultProperties;\n update();\n }", "public void setResource(URI resource) {\n this.resource = resource;\n }", "@Override\r\n\t\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic String getResource(ResourceLocation registryName) {\n\t\treturn null;\r\n\t}", "public String getResourceBundlePath() {\n return resourceBundlePath;\n }", "public void initialize() {\n if (!BungeeBan.getInstance().getDataFolder().exists()) {\n BungeeBan.getInstance().getDataFolder().mkdirs();\n }\n File file = this.getConfigurationFile();\n if (!file.exists()) {\n try {\n file.createNewFile();\n if (this.defaultConfig != null) {\n try (InputStream is = BungeeBan.getInstance().getResourceAsStream(this.defaultConfig);\n OutputStream os = new FileOutputStream(file)) {\n ByteStreams.copy(is, os);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n this.reload();\n }", "public String getResourceLocation() {\n return resourceLocation;\n }", "public void setResourcePath(String path) {\n appPathField.setText(path != null ? path : \"\");\n }", "private void setupFiles(){\n\t\t// Copies the default configuration files to the workspace \n\t\ttry{\n\t\t\tBundle bundle = Platform.getBundle(Activator.PLUGIN_ID);\n\t\t\tIPath destBasePath = Platform.getStateLocation(bundle);\n\t\t\tpropertiesFile = destBasePath.append(PreferencesConstants.PROP_BUNDLE_STATE_PATH).toFile();\n\t\t\tif(!propertiesFile.exists()){\n\n\t\t\t\tURI sourceBaseURI = bundle.getEntry(PreferencesConstants.DEFAULT_CONFIG_BUNDLE_PATH).toURI();\n\t\t\t\t//TODO: fix the item below?\n\t\t\t\tEnumeration<URL> entries = bundle.findEntries(PreferencesConstants.DEFAULT_CONFIG_BUNDLE_PATH, null, true);\n\t\t\t\tfor(; entries != null && entries.hasMoreElements();){\n\t\t\t\t\tURL url = entries.nextElement();\n\t\t\t\t\tURI uri = url.toURI();\n\t\t\t\t\tURI relativeURI = sourceBaseURI.relativize(uri);\n\t\t\t\t\tIPath destPath = destBasePath.append(relativeURI.toString());\n\n\t\t\t\t\tif(destPath.hasTrailingSeparator()){\n\t\t\t\t\t\t// it's a folder\n\t\t\t\t\t\tdestPath.toFile().mkdirs();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t// it's a file\n\t\t\t\t\t\tURL contentURL = FileLocator.resolve(url);\n\t\t\t\t\t\tSystemUtils.blt(contentURL.openStream(), new FileOutputStream(destPath.toFile()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//now save the destination paths to the System properties\n\t\t\t//save the report paths\n\t\t\tString reportTemplatePath = destBasePath.append(PreferencesConstants.DEFAULT_REPORT_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_REPORT_TEMPLATE_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE, \n\t\t\t\t\treportTemplatePath);\n\t\t\tSystem.out.println(\"report template file: \" + reportTemplatePath);\t\t\n\t\t\t\n\t\t\tString reportPath = destBasePath.append(PreferencesConstants.DEFAULT_REPORT_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_REPORT_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT, \n\t\t\t\t\treportPath);\t\t\t\n\t\t\tSystem.out.println(\"report file: \" + reportPath);\t\t\t\n\t\t\t\n\t\t\t//save the rule paths\n\t\t\tString ruleSessionPath = destBasePath.append(PreferencesConstants.DEFAULT_RULE_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_RULE_SESSION_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION, \n\t\t\t\t\truleSessionPath);\t\t\t\n\t\t\tSystem.out.println(\"rule session file: \" + ruleSessionPath);\t\t\t\t\t\n\t\t\t\n\t\t\tString ruleSessionOutPath = destBasePath.append(PreferencesConstants.DEFAULT_RULE_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_RULE_SESSION_OUT_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT, \n\t\t\t\t\truleSessionOutPath);\t\t\t\n\t\t\tSystem.out.println(\"rule session out file: \" + ruleSessionOutPath);\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t\t\n\t\t/*\n\t\tString pluginName = Activator.PLUGIN_ID;\n\t\tBundle bundle = Platform.getBundle(pluginName);\n\n\t\tString propFileStr = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.PROP_URL);\n\t\tFile sourcePropFile = new File(propFileStr);\n\n\t\t//propertiesFile = new File(fixedPath);\n\t\tIWorkspace workspace = ResourcesPlugin.getWorkspace();\n\t\tIWorkspaceRoot root = workspace.getRoot();\n\t\tIPath location = root.getLocation();\n\t\t//location.toString()\n\t\t//String path = location.toString() + location.SEPARATOR + \".metadata\" \n\t\t//\t+ location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\t\tString path = location.toString() + location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\t\t//URL entry = Platform.getInstallLocation().getURL();\n\t\t//String path = entry.toString() + location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\n\t\tFile usersResourceDir = new File(path);\n\t\tpropertiesFile = new File(path + PreferencesConstants.PROP_URL);\n\t\tSystem.out.println(\"properties file \" + propertiesFile.getAbsolutePath());\n\t\tFile reportDir;\n\t\tFile ruleDir;\n\t\tif(!usersResourceDir.exists()){\n\t\t\ttry{\n\t\t\t\tSystemUtils.createDirectory(usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy the properties file\n\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyFile(sourcePropFile, propertiesFile);\n\t\t\t}\n\t\t\tcatch(IOException e1){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy report directory\n\t\t\tString fixedReportPath = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.DEFAULT_REPORT_PATH);\n\t\t\treportDir = new File(fixedReportPath);\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyDirectory(reportDir, usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy rule directory\n\t\t\tString fixedRulePath = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.DEFAULT_RULE_PATH);\n\t\t\truleDir = new File(fixedRulePath);\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyDirectory(ruleDir, usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tSystem.out.println(\"success\");\n\t\t}\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_TEMPLATE_URL);\n\t\tSystem.out.println(\"report template file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE));\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_URL.substring(1));\n\t\tSystem.out.println(\"report file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_REPORT));\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_SESSION_URL.substring(1));\n\t\tSystem.out.println(\"rule session file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION));\n\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_SESSION_OUT_URL.substring(1));\n\t\tSystem.out.println(\"rule session file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT));\n\t\t*/\n\t}", "public ResourceLocator getResourceLocator() {\r\n\t\treturn MARTE_sbEditPlugin.INSTANCE;\r\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\tUserName.setText(MainAllControllers.user.getName());\n\t\temail.setText(MainAllControllers.user.getName() + \"@braude.ac.il\");\n\t\tposition.setText(MainAllControllers.user.getstrPosition());\n\t\tswitch (MainAllControllers.user.getstrPosition()) {\n\t\tcase \"lecturer\": {\n\t\t\tlecturerIMG.setVisible(true);\n\n\t\t}\n\t\t\tbreak;\n\t\tcase \"student\": {\n\t\t\tstudentIMG.setVisible(true);\n\t\t}\n\t\t\tbreak;\n\t\tcase \"CollegeEmployee\": {\n\t\t\tempIMG.setVisible(true);\n\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\r\n\t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\t\n\t\tsetaValores(cliente);\n\t\t\n\t\t\n\t\ttxtNome.setEditable(false);\n\t}", "@Override\n public ResourceLocator getResourceLocator() {\n return BibtexmlHandwrittenEditPlugin.INSTANCE;\n }", "private native void setDefaultRealmFileDirectory(String fileDir, AssetManager assets);", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n sistema = new SistemaAleMC();\n }", "public DefaultActionConfigurer(ResourceLocator resourceLocator) {\t\t\r\n\t\tthis();\r\n\t\tthis.resourceLocator = resourceLocator;\r\n\t}", "public void geraArquivoIniDefault(String pathToArqIni, String pathToDefaultIni){\n\t\tFile fileIni = new File(pathToArqIni);\n\t\ttry {\n\t\t\tFileUtils.copyInputStreamToFile(getClass().getResourceAsStream(pathToDefaultIni), fileIni);\n\t\t\tlogger.debug(\"Arquivo Ini gerado com sucesso a partir de default.ini\");\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Nao foi Possivel criar arquivo ini apartir de default.ini\");\n\t\t\tLoggerPrintExceptionHelper.printExceptionOnLogger(logger, e);\n\t\t}\n\t}", "public void setResourcePath(String resourcePath) {\n _resourcePath = resourcePath;\n }", "@Override\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\n\t}", "@Override\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\n\t}" ]
[ "0.612458", "0.61179566", "0.5898209", "0.58385974", "0.571081", "0.5682681", "0.56149644", "0.5592436", "0.5572433", "0.5571669", "0.5531163", "0.5514842", "0.55016553", "0.55016553", "0.55016553", "0.55016553", "0.55016553", "0.55016553", "0.55016553", "0.55016553", "0.54797155", "0.5473608", "0.5473608", "0.5471592", "0.5471592", "0.5471592", "0.5469769", "0.54619", "0.54619", "0.54619", "0.54619", "0.54619", "0.5450154", "0.5435527", "0.54343396", "0.53972197", "0.5387783", "0.5383004", "0.53760654", "0.5373958", "0.5371407", "0.5369196", "0.5361238", "0.5352054", "0.53470093", "0.53352076", "0.53333205", "0.5329993", "0.53116643", "0.5307626", "0.5270241", "0.5265613", "0.52545077", "0.5252364", "0.5231194", "0.5227863", "0.52220935", "0.52104723", "0.5208552", "0.52048427", "0.5202481", "0.5201811", "0.5197911", "0.51861477", "0.5176974", "0.5173723", "0.5170138", "0.5169644", "0.51532096", "0.5138683", "0.51199317", "0.5116989", "0.5104104", "0.5097826", "0.5094093", "0.5093279", "0.50905246", "0.50595874", "0.50545686", "0.50483567", "0.50459474", "0.5030991", "0.50299877", "0.50194114", "0.5018348", "0.5006027", "0.50041187", "0.50041187", "0.50041187", "0.50041187", "0.50041187", "0.5003502", "0.49965918", "0.49959427", "0.49869224", "0.49688983", "0.49681273", "0.496607", "0.49448806", "0.49448806" ]
0.6591862
0
Returns the location of the default resource bundle. This is used if no resource bundle is defined in the site configuration repository item.
public String getDefaultResourceBundle() { return mDefaultResourceBundle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDefaultResourceFileName() \n {\n return null; \n }", "public String getBundleLocation() {\n return bundleLocation;\n }", "abstract public ResourceManager getDefaultConfig();", "public String getResourceLocation() {\n return resourceLocation;\n }", "@Override\n public URL getTemplateLocation() {\n try {\n String[] candidates = getDirectoryCandidates();\n for (int i = 0; i < candidates.length; i++) {\n if (Activator.getDefault().getBundle().getEntry(candidates[i]) != null) {\n URL candidate = new URL(getInstallURL(), candidates[i]);\n return candidate;\n }\n }\n } catch (MalformedURLException e) { // do nothing\n }\n return null;\n }", "public String getResourceBundle()\r\n {\r\n return getSemanticObject().getProperty(swb_resourceBundle);\r\n }", "public ResourceLocator getResourceLocator() {\r\n\t\treturn MARTE_sbEditPlugin.INSTANCE;\r\n\t}", "private void extractDefaultGeneratorLogo() {\n try {\n PlatformUtil.extractResourceToUserConfigDir(getClass(), DEFAULT_GENERATOR_LOGO, true);\n } catch (IOException ex) {\n logger.log(Level.SEVERE, \"Error extracting report branding resource for generator logo \", ex); //NON-NLS\n }\n defaultGeneratorLogoPath = PlatformUtil.getUserConfigDirectory() + File.separator + DEFAULT_GENERATOR_LOGO;\n }", "public static String getResourceString (String aResourceKey,\n String aDefaultValue)\n {\n String result = null;\n String resourceFile = ADMIN_CONSOLE_BUNDLE;\n result = getResourceString(resourceFile, aResourceKey, aDefaultValue);\n return result;\n }", "public String getResourceBundlePath() {\n return resourceBundlePath;\n }", "private ISiteEntry getRootSite() {\n \t\tISitePolicy defaultPolicy = createSitePolicy(DEFAULT_POLICY_TYPE, DEFAULT_POLICY_LIST);\n \t\tURL siteURL = null;\n \t\ttry {\n \t\t\tsiteURL = new URL(PlatformURLBaseConnection.PLATFORM_URL_STRING); // try using platform-relative URL\n \t\t} catch (MalformedURLException e) {\n \t\t\tsiteURL = BootLoader.getInstallURL(); // ensure we come up ... use absolute file URL\n \t\t}\n \t\tISiteEntry defaultSite = createSiteEntry(siteURL, defaultPolicy);\n \t\treturn defaultSite;\n \t}", "public void setDefaultResourceBundle(String pDefaultResourceBundle) {\n mDefaultResourceBundle = pDefaultResourceBundle;\n }", "abstract public String getTopResourcesDir();", "@Override\r\n\tpublic String getResource(ResourceLocation registryName) {\n\t\treturn null;\r\n\t}", "private void loadDefaultConfig() {\r\n ResourceBundle bundle = ResourceLoader.getProperties(DEFAULT_CONFIG_NAME);\r\n if (bundle != null) {\r\n putAll(bundle);\r\n } else {\r\n LOG.error(\"Can't load default Scope config from: \" + DEFAULT_CONFIG_NAME);\r\n }\r\n }", "@Override\n public String getFullDefaultConfigName() {\n return getConfigPath() + defaultConfigFileName;\n }", "private String getBundleLocation(String location) {\n\t\tint index = location.lastIndexOf(PREFIX_DELIMITER);\r\n\t\tString path = ((index > 0) ? location.substring(index + 1) : location);\r\n\t\t// clean up the path\r\n\t\tpath = StringUtils.cleanPath(path);\r\n\t\t// check if it's a folder\r\n\t\tif (path.endsWith(SLASH)) {\r\n\t\t\t// remove trailing slash\r\n\t\t\tpath = path.substring(0, path.length() - 1);\r\n\t\t\tint separatorIndex = path.lastIndexOf(SLASH);\r\n\r\n\t\t\t// if there is no other slash, consider the whole location, otherwise detect the folder\r\n\t\t\tpath = (separatorIndex > -1 ? path.substring(separatorIndex + 1) : path);\r\n\t\t}\r\n\t\tpath = StringUtils.getFilename(path);\r\n\t\t// remove file extension\r\n\t\tpath = StringUtils.stripFilenameExtension(path);\r\n\r\n\t\tif (log.isTraceEnabled())\r\n\t\t\tlog.trace(\"Bundle location [\" + location + \"] resulted in context path [\" + path + \"]\");\r\n\r\n\t\treturn path;\r\n\t}", "private static ResourceBundle locateBundle(final String bundleName, final String lang) {\n \n /* Validate parameters. */\n if (bundleName == null || bundleName.equals(\"\")) { throw new IllegalArgumentException(\"bundleName must be a non-empty string.\"); }\n if (lang == null || lang.equals(\"\")) { throw new IllegalArgumentException(\"lang must be a non-empty string.\"); }\n \n /* Find fallback resource bundle. */\n ResourceBundle fallback;\n try {\n fallback = ResourceBundle.getBundle(bundleName, new Locale(\"bogus\"));\n } catch (MissingResourceException e) {\n fallback = null;\n }\n \n final Locale locale = new Locale(lang);\n ResourceBundle bundle = null;\n try {\n bundle = ResourceBundle.getBundle(bundleName, locale);\n } catch (MissingResourceException e) {\n /* No bundle was found, ignore and move on. */\n }\n \n if (bundle != fallback) { return bundle; }\n \n /* Check if the fallback is actually requested. */\n if (bundle != null && bundle == fallback && locale.getLanguage().equals(Locale.getDefault().getLanguage())) { return bundle; }\n \n /* No bundle found. */\n return null;\n }", "public AbstractBundle getBundleByLocation(String location) {\n \t\treturn (framework.getBundleByLocation(location));\n \t}", "@Override\n\tpublic ResourceLocator getResourceLocator() {\n\t\treturn SampledefinitionEditPlugin.INSTANCE;\n\t}", "public ResourceBundle getResourceBundle() {\n \t\ttry {\n \t\t\tif (resourceBundle == null)\n \t\t\t\t// resourceBundle = ResourceBundle.getBundle(\"org.eclipse.wst.xsd.ui.internal.editor.EditorPluginResources\");\n resourceBundle = Platform.getResourceBundle(getBundle());\n \t\t} catch (MissingResourceException x) {\n \t\t\tresourceBundle = null;\n \t\t}\n \t\treturn resourceBundle;\n \t}", "File getBundle();", "private static SearchBoxUserRecordResources getDefaultResources() {\n if (DEFAULT_RESOURCES == null) {\n DEFAULT_RESOURCES = GWT.create(SearchBoxUserRecordResources.class);\n }\n return DEFAULT_RESOURCES;\n }", "public static String sBasePath() \r\n\t{\r\n\t\tif(fromJar) \r\n\t\t{\r\n\t\t\tFile file = new File(System.getProperty(\"java.class.path\"));\r\n\t\t\tif (file.getParent() != null)\r\n\t\t\t{\r\n\t\t\t\treturn file.getParent().toString();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn new java.io.File(\"\").getCanonicalPath();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic String getResource() {\n\t\tif (this.getUpgraded()) {\n\t\t\ttry {\n\t\t\t\treturn (new File(\"./resources/images/ArcherTower_Upgrade.png\")).getCanonicalPath();\n\t\t\t} catch (IOException e) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t} else {\n\t\t\ttry {\n\t\t\t\treturn (new File(\"./resources/images/ArcherTower_Default.png\")).getCanonicalPath();\n\t\t\t} catch (IOException e) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}", "public String getDefaultApp()\n {\n if (defaultApp == null)\n {\n return apps.get(0).getName();\n }\n\n return defaultApp;\n }", "abstract public String getRingResourcesDir();", "static public ResourceBundle getBundle() {\r\n\r\n\t\tif (resBundle == null) {\r\n\t\t\tloadBundle();\r\n\t\t}\r\n\t\treturn resBundle;\r\n\t}", "private Properties loadDefaultProperties() {\n Properties pref = new Properties();\n try {\n String path = \"resources/bundle.properties\";\n InputStream stream = PreferenceInitializer.class.getClassLoader().getResourceAsStream(path);\n pref.load(stream);\n } catch (IOException e) {\n ExceptionHandler.logAndNotifyUser(\"The default preferences for AgileReview could not be initialized.\"\n + \"Please try restarting Eclipse and consider to write a bug report.\", e, Activator.PLUGIN_ID);\n return null;\n }\n return pref;\n }", "@Override\r\n\tpublic ResourceLocator getResourceLocator() {\r\n\t\treturn SpringConfigDslEditPlugin.INSTANCE;\r\n\t}", "@Override\r\n\t\tpublic String getBaseURI()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public String getDefaultThemeName() {\n\treturn resources.getString(\"defaultTheme\", null);\n }", "public ResourceBundle getResourceBundle() {\r\n\t\ttry {\r\n\t\t\tif (resourceBundle == null)\r\n\t\t\t\tresourceBundle = ResourceBundle.getBundle(PLUGIN_ID + \".DebugCorePluginResources\");\r\n\t\t} catch (MissingResourceException x) {\r\n\t\t\tresourceBundle = null;\r\n\t\t}\r\n\t\treturn resourceBundle;\r\n\t}", "@Override\n\tpublic InputStream getResource(ResourcePackType p_195761_1_, ResourceLocation p_195761_2_) throws IOException {\n\t\treturn null;\n\t}", "public String getBasePath(){\r\n\t\t \r\n\t\t String basePath = properties.getProperty(\"getPath\");\r\n\t\t if(basePath != null) return basePath;\r\n\t\t else throw new RuntimeException(\"getPath not specified in the configuration.properties file.\");\r\n\t }", "public ICUResourceBundle getWithFallback(String path)\n/* */ throws MissingResourceException\n/* */ {\n/* 339 */ ICUResourceBundle result = null;\n/* 340 */ ICUResourceBundle actualBundle = this;\n/* */ \n/* */ \n/* 343 */ result = findResourceWithFallback(path, actualBundle, null);\n/* */ \n/* 345 */ if (result == null) {\n/* 346 */ throw new MissingResourceException(\"Can't find resource for bundle \" + getClass().getName() + \", key \" + getType(), path, getKey());\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 351 */ return result;\n/* */ }", "public String getResourcePath() {\n\t\treturn resourcePath;\n\t}", "public DefaultPackagesResourceConfig() {\n this(Class.class.getPackage().getName());\n }", "@Override\n protected URL getInstallURL() {\n return Activator.getDefault().getBundle().getEntry(\"/\");\n }", "public void setBundleLocation(String bundleLocation) {\n this.bundleLocation = bundleLocation;\n }", "public String getBaseURI(){\r\n\t\t \r\n\t\t String uri = properties.getProperty(\"baseuri\");\r\n\t\t if(uri != null) return uri;\r\n\t\t else throw new RuntimeException(\"baseuri not specified in the configuration.properties file.\");\r\n\t }", "public String getResourcePath () {\n return resourcePath;\n }", "public String getResourcePath () {\n return resourcePath;\n }", "public Resource getDefaultGraphName() {\n \t\treturn createResource(this.baseGraphName);\n \t}", "public ResourceBundle getBundle() {\r\n\t\treturn bundle;\r\n\t}", "public String getLocalBasePath() {\n\t\treturn DataManager.getLocalBasePath();\n\t}", "private File findDefaultsFile() {\r\n String defaultsPath = \"/defaults/users.defaults.xml\";\r\n String xmlDir = server.getServerProperties().get(XML_DIR_KEY);\r\n return (xmlDir == null) ?\r\n new File (System.getProperty(\"user.dir\") + \"/xml\" + defaultsPath) :\r\n new File (xmlDir + defaultsPath);\r\n }", "@Override\n public ResourceLocator getResourceLocator() {\n return BibtexmlHandwrittenEditPlugin.INSTANCE;\n }", "@Override\n default ResourceLocation getRegistryName() {\n return getBlock().getRegistryName();\n }", "public static String GetvDefaultBilibiliSavePath(Context ctx){\n return GetAppDataPathExternal(ctx);\n }", "public String sourceResourceLocation() {\n return this.sourceResourceLocation;\n }", "public String getBundleDir()\n {\n if ( bundleDir != null )\n {\n bundleDir = cleanBundleDir( bundleDir );\n }\n return bundleDir;\n }", "URI location() {\n if (module.isNamed() && module.getLayer() != null) {\n Configuration cf = module.getLayer().configuration();\n ModuleReference mref\n = cf.findModule(module.getName()).get().reference();\n return mref.location().orElse(null);\n }\n return null;\n }", "public String getExtResLocation(){\n\t\treturn extResLocation;\n\t}", "protected String getDefaultFilename()\n {\n return DEFAULT_FILENAME;\n }", "public String getDefaultCssFile() {\n return mDefaultCssFile;\n }", "public YuiImage getDefaultImg() {\r\n\t\treturn defaultImg;\r\n\t}", "public String getName(Resource resource, OgemaLocale locale, boolean useRelativePathAsAlias, boolean useDefaultLanguage);", "@Override\n\tpublic InputStream getRootResource(String p_195763_1_) throws IOException {\n\t\treturn null;\n\t}", "public String getResourcePath();", "public String getResourcePath() {\n return BARDConstants.API_BASE + \"/biology/\" + serial;\n }", "public ResourceLocator getResourceLocator() {\r\n\t\treturn UmlDomainEditPlugin.INSTANCE;\r\n\t}", "protected ResourceBundle getBundle() {\n return _bundle;\n }", "public String getDefaultImgSrc(){return \"/students/footballstudentdefault.png\";}", "@Override\n public String getDefaultConfigName() {\n return defaultConfigFileName;\n }", "public BundleDescription getBundle() {\n \t\treturn bundle;\n \t}", "@Override\n\tpublic TaskManagerLocation getAssignedResourceLocation() {\n\t\tfinal LogicalSlot currentAssignedResource = assignedResource;\n\t\treturn currentAssignedResource != null ? currentAssignedResource.getTaskManagerLocation() : null;\n\t}", "protected URL convertedFindResource(String name) {\n ServiceReference reference = bundle.getBundleContext().getServiceReference(PackageAdmin.class.getName());\n PackageAdmin packageAdmin = (PackageAdmin) bundle.getBundleContext().getService(reference);\n try {\n List<URL> resources = findResources(packageAdmin, bundle, name, false);\n if (resources.isEmpty() && isMetaInfResource(name)) {\n LinkedHashSet<Bundle> wiredBundles = getWiredBundles();\n Iterator<Bundle> iterator = wiredBundles.iterator();\n while (iterator.hasNext() && resources.isEmpty()) { \n Bundle wiredBundle = iterator.next();\n resources = findResources(packageAdmin, wiredBundle, name, false);\n }\n }\n return (resources.isEmpty()) ? null : resources.get(0);\n } catch (Exception e) {\n return null;\n } finally {\n bundle.getBundleContext().ungetService(reference);\n }\n }", "@Override\n\tpublic ResourceLocator getResourceLocator() {\n\t\treturn OpenAPIEditPlugin.INSTANCE;\n\t}", "public interface FsBundle {\n Type getType();\n\n Path getPath();\n\n /**\n * All files inside the bundle, all paths are relative to its root and sorted.\n */\n List<Path> getFiles();\n\n String getVendor();\n\n String getId();\n\n Optional<String> getVersion();\n\n String getArchiveName();\n\n default Path getArchivePath(Path archivesDir) {\n return archivesDir\n .resolve(getVendor())\n .resolve(getArchiveName() + ARCHIVE_EXTENSION);\n }\n\n default URI getDownloadUrl(URI bundlesRepository) {\n String repo = bundlesRepository.toString();\n String repoSlash = repo.endsWith(\"/\") ? repo : repo + \"/\";\n return URI.create(repoSlash + getVendor() + \"/\" + getArchiveName() + ARCHIVE_EXTENSION);\n }\n\n default Path getMetadataPath() {\n return getPath().resolve(METADATA_FILE);\n }\n\n default Path getTemplatePath() {\n return getPath().resolve(TEMPLATE_FILE);\n }\n}", "public abstract String getDefaultStylesheet ();", "@Override\n\tpublic String getResource() {\n\t\ttry {\n\t\t\treturn (new File(\"./resources/images/mageTowerCard.png\")).getCanonicalPath();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\treturn \"\";\n\t\t}\n\t}", "public String getImageResource() {\n \t\t// if (isWindows)\n \t\t// return \"/\" + new File(imageResource).getPath();\n \t\t// else\n \t\treturn imageResource;\n \t}", "public String getNabtoResourceDirectory() {\n return nabtoResourceDirectory.getAbsolutePath();\n }", "public String getDefaultNamespace() {\n return defaultNamespaceUri;\n }", "public static UResourceBundle getBundleInstance(String baseName, String localeID,\n ClassLoader root, boolean disableFallback){\n UResourceBundle b = instantiateBundle(baseName, localeID, root, disableFallback);\n if(b==null){\n throw new MissingResourceException(\"Could not find the bundle \"+ baseName+\"/\"+ localeID+\".res\",\"\",\"\");\n }\n return b;\n }", "public abstract ResourceBundle getBundle();", "public ResourceBundle getResourceBundle() {\n try {\n if (resourceBundle == null) {\n resourceBundle = ResourceBundle\n .getBundle(\"org.apache.ivyde.eclipse.IvyPluginResources\");\n }\n } catch (MissingResourceException x) {\n resourceBundle = new ResourceBundle() {\n protected Object handleGetObject(String key) {\n return null;\n }\n\n public Enumeration<String> getKeys() {\n return Collections.emptyEnumeration();\n }\n\n };\n }\n return resourceBundle;\n }", "@Override\n protected String getDefaultScriptsDir() {\n return null;\n }", "String fallbackBaseUrl() {\n return settings.get(FALLBACK_BASE_URL);\n }", "String getAbsolutePathWithinSlingHome(String relativePath);", "public static String getBaseURL()\r\n {\r\n String savedUrl = P.getChoreoServicesUrl();\r\n return savedUrl.length() > 0 ? savedUrl : Config.DEFAULT_SERVER_URL;\r\n }", "public interface BundleLoader {\n /**\n * Returns the bundle referred to by the given path, for the given locale, or null if the\n * bundle could not be loaded.\n */\n ResourceBundle loadBundle (String path, Locale locale);\n }", "public Bundle getBundle() {\n \t\tcheckValid();\n \n \t\treturn getBundleImpl();\n \t}", "File getDefaultFile();", "static private void loadBundle() {\r\n\r\n\t\tfinal Locale loc;\r\n\r\n\t\t//load the default or a forced locale\r\n\t\tif (strLanguage == null) {\r\n\t\t\tloc = Locale.getDefault();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tloc = new Locale(strLanguage);\r\n\t\t}\r\n\r\n\t\tresBundle = RiskUtil.getResourceBundle(TranslationBundle.class,\"Risk\",loc);\r\n\r\n\t\t// this will work MOST of the time, but does not in lobby\r\n\t\t// for some reason it stops the classes from loading, and does not find the files\r\n\t\t//resBundle = ResourceBundle.getBundle(\"net.yura.domination.engine.translation.Risk\", loc );\r\n\r\n\r\n\t}", "java.lang.String getResourceUri();", "public String getReasonerKnowledgeBaseURI();", "private static File getAspectWorkspace() {\n try {\n URL url = Platform.getBundle(Activator.PLUGIN_ID).getEntry(\"resources\");\n URL resolved = FileLocator.resolve(url);\n return new File(resolved.getPath());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "@Deprecated\n public Object getDefault(String path) {return defaultConfig.get(path); }", "String getDefaultRoot() {\n return mDefaultRoot;\n }", "@Override\r\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\r\n\t}", "public static IssUiActivator getDefault() {\r\n\t\treturn plugin;\r\n\t}", "protected abstract String getResourcePath();", "@Override\n\tpublic ResourceLocator getResourceLocator() {\n\t\treturn SystemBehaviorEditPlugin.INSTANCE;\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public String getResourceUri() {\n return resourceUri;\n }", "public static InstallerRegistry getDefault() {\n InstallerRegistry regs = defaultInstance.get();\n if (regs != null)\n return regs;\n regs = new InstallerRegistry();\n defaultInstance = new WeakReference<InstallerRegistry>(regs);\n return regs;\n }", "static public File getLatestPlatformLocation(){\n Iterator i = serverLocationAndClassLoaderMap.entrySet().iterator();\n File ret =null;\n while (i.hasNext()){\n Map.Entry e = (Map.Entry)i.next();\n String loc = (String)e.getKey();\n File possibleOne = new File(loc);\n if (ret==null){\n ret =possibleOne;\n }\n if (isGlassFish(possibleOne)){\n ret =possibleOne;\n }\n }\n return ret;\n \n }" ]
[ "0.63783073", "0.6349521", "0.60589707", "0.60071737", "0.59383506", "0.5762777", "0.57169867", "0.56857115", "0.56560993", "0.56515795", "0.56289345", "0.5554605", "0.55322766", "0.54937273", "0.5452751", "0.5448953", "0.5447714", "0.54336524", "0.5389006", "0.5388627", "0.5368121", "0.5313722", "0.5289427", "0.5284784", "0.52840436", "0.5277363", "0.52715045", "0.5242261", "0.52241766", "0.52221394", "0.5181752", "0.51770383", "0.5162327", "0.5161872", "0.5161723", "0.5155586", "0.51485556", "0.51377314", "0.513521", "0.51303804", "0.5121595", "0.5113216", "0.51031756", "0.5088133", "0.5085438", "0.5085021", "0.5079516", "0.50745827", "0.5064149", "0.50628227", "0.5057495", "0.50498754", "0.5045757", "0.5029377", "0.5027741", "0.50157136", "0.5005732", "0.50039744", "0.50008196", "0.49998868", "0.49990156", "0.4995184", "0.49928316", "0.4992745", "0.49887398", "0.49870804", "0.49853775", "0.4981261", "0.49522308", "0.49493125", "0.49317345", "0.49207318", "0.49153253", "0.49137455", "0.48928508", "0.48858973", "0.48735023", "0.4866741", "0.48638174", "0.48635817", "0.48612958", "0.48586857", "0.48580584", "0.48571795", "0.48534578", "0.4851969", "0.48458827", "0.48446256", "0.48325732", "0.48321941", "0.48297906", "0.48198226", "0.48177305", "0.48171452", "0.48141968", "0.4810533", "0.4810533", "0.48012474", "0.47981042", "0.47949165" ]
0.6481286
0
Sets the location of the default css file(s). This is used if no CSS location is defined in the site configuration repository item
public void setDefaultCssFile( String pDefaultCssFile ) { mDefaultCssFile = pDefaultCssFile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDefaultCssFile() {\n return mDefaultCssFile;\n }", "public abstract String getDefaultStylesheet ();", "public void setDefaultStylesheet() {\n\n\t\tsetAttribute(\"stylesheet\", \"node { \"\n\t\t\t//\t+ \"size: 10px;\"\n\t\t\t\t+ \"size: 10px, 10px;\"\n\t\t\t\t+ \"fill-mode: dyn-plain; \"\n\t\t\t//\t+ \"stroke-mode: plain;\"\n\t\t\t//\t+ \"stroke-color: black;\"\n\t\t\t\t+ \"stroke-mode: plain;\"\n\t\t\t\t+ \"stroke-width: 1px;\"\n\t\t\t\t+ \"text-alignment: under;\"\n\t\t\t\t+ \"} \"\n\t\t\t\t+ \"node.enzyme {\"\n\t\t\t\t+ \"shape: box;\"\n\t\t\t//\t+ \"size: 10px, 10px;\"\n\t\t\t\t+ \"text-alignment: under;\"\n\t\t\t\t+ \"fill-color: #DEE;\"\n\t\t\t\t+ \"} \"\n\t\t\t\t+ \"node.compound { \"\n\t\t\t//\t+ \"size: 10px, 10px;\"\n\t\t\t\t+ \"shape: circle;\"\n\t\t\t\t+ \"text-alignment: under;\"\n\t\t\t\t+ \"}\");\n\t}", "private void setDefaultPath(){\n\t\tdownloadPath = System.getProperty(\"user.home\") + File.separator + \"Downloads\" + File.separator;\n\t\tif(!downloadPath.endsWith(File.separator)){\n\t\t\tdownloadPath += File.separator;\n\t\t}\n\t\tcurrentPath.setText(downloadPath);\n\t\tcurrentPath.setToolTipText(downloadPath);\n\t}", "protected void SetDefault() {\r\n\t\tBrickFinder.getDefault().setDefault();\t\t\r\n\t}", "private void addCss() {\n StyleLink jqueryLink = new StyleLink(\"http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css\");\n page.addHeader(jqueryLink);\n StyleLink jqueryTooltipLink = new StyleLink(\"/css/jquery.ui.tooltip.css\");\n page.addHeader(jqueryTooltipLink);\n StyleLink cssLink = new StyleLink(\"/css/lockss-new.css\");\n page.addHeader(cssLink);\n }", "public void forceDefaultConfig()\n {\n plugin.saveResource(fileName, true);\n }", "private void setCss(String cssFile) {\n _scene.getStylesheets().clear();\n _scene.getStylesheets().add(getClass().getResource(cssFile).toExternalForm());\n }", "private void extractDefaultGeneratorLogo() {\n try {\n PlatformUtil.extractResourceToUserConfigDir(getClass(), DEFAULT_GENERATOR_LOGO, true);\n } catch (IOException ex) {\n logger.log(Level.SEVERE, \"Error extracting report branding resource for generator logo \", ex); //NON-NLS\n }\n defaultGeneratorLogoPath = PlatformUtil.getUserConfigDirectory() + File.separator + DEFAULT_GENERATOR_LOGO;\n }", "public String createCSSFolder(String websiteName){\n directory = path + websiteName + \"/css\";\n return directory;\n }", "public void setDefaultSettings()\n {\n this.IndexerEffort = 0;\n this.indexZIPFiles = true;\n this.thumbnailsMatrix = \"64\";\n this.SaveThumbnails = false;\n }", "public static void loadStyleSheet()\n {\n StyleManager.getInstance().addUserAgentStylesheet(ResourceLoader.loadComponent(USER_AGENT_STYLESHEET));\n }", "public static void setDefaultPath(String path) {\n\t\tPATH = path;\n\t}", "public void setDefaultUrl(String url) {\n\t\tthis.defaultUrl = url;\n\t}", "@SuppressWarnings(\"unused\")\n\tprotected void initializeTheme() {\n\t\tthis.httpContext.setDefaultTheme(ConfigurationManager.getValue(\"Theme\"));\n\t}", "private void updateDisplayName() {\n String path;\n FileObject webRoot = ProjectWebRootQuery.getWebRoot(styleSheet);\n if(webRoot == null) {\n path = styleSheet.getNameExt();\n } else {\n path = FileUtil.getRelativePath(webRoot, styleSheet);\n }\n setDisplayName(path);\n }", "public void setDefaultImg(YuiImage defaultImg) {\r\n\t\tthis.defaultImg = defaultImg;\r\n\t}", "abstract protected DocumentCSSStyleSheet getDefaultStyleSheet(CSSDocument.ComplianceMode mode);", "private void defaultStyle() {\n\t\t//idField.setStyle(\"\");\n\t\tproductNameField.setStyle(\"\");\n\t\tinvField.setStyle(\"\");\n\t\tpriceField.setStyle(\"\");\n\t\tmaxField.setStyle(\"\");\n\t\tminField.setStyle(\"\");\n\t}", "public void setDefaultProperties(ResourceProperties defaultProperties) {\n this.defaultProperties = defaultProperties;\n update();\n }", "public void setStyleSheet(URL path) {\n root.getStylesheets().add(path.toExternalForm());\n }", "protected ResourceReference getCSS()\n\t{\n\t\treturn CSS;\n\t}", "private void applyDefaultConfiguration(ServletContext context, Properties properties) {\n // ensure that caching isn't overly aggressive\n\n LOG.debug(\"Load a default resource loader definition if there isn't one present.\");\n if (properties.getProperty(Velocity.RESOURCE_LOADER) == null) {\n properties.setProperty(Velocity.RESOURCE_LOADER, \"strutsfile, strutsclass\");\n }\n\n /*\n * If there's a \"real\" path add it for the strutsfile resource loader.\n * If there's no real path and they haven't configured a loader then we change\n * resource loader property to just use the strutsclass loader\n * Ben Hall (22/08/2003)\n */\n if (context.getRealPath(\"\") != null) {\n properties.setProperty(\"strutsfile.resource.loader.description\", \"Velocity File Resource Loader\");\n properties.setProperty(\"strutsfile.resource.loader.class\", \"org.apache.velocity.runtime.resource.loader.FileResourceLoader\");\n properties.setProperty(\"strutsfile.resource.loader.path\", context.getRealPath(\"\"));\n properties.setProperty(\"strutsfile.resource.loader.modificationCheckInterval\", \"2\");\n properties.setProperty(\"strutsfile.resource.loader.cache\", \"true\");\n } else {\n // remove strutsfile from resource loader property\n String prop = properties.getProperty(Velocity.RESOURCE_LOADER);\n if (prop.contains(\"strutsfile,\")) {\n prop = prop.replace(\"strutsfile,\", \"\");\n } else if (prop.contains(\", strutsfile\")) {\n prop = prop.replace(\", strutsfile\", \"\");\n } else if (prop.contains(\"strutsfile\")) {\n prop = prop.replace(\"strutsfile\", \"\");\n }\n\n properties.setProperty(Velocity.RESOURCE_LOADER, prop);\n }\n\n /*\n * Refactored the Velocity templates for the Struts taglib into the classpath from the web path. This will\n * enable Struts projects to have access to the templates by simply including the Struts jar file.\n * Unfortunately, there does not appear to be a macro for the class loader keywords\n */\n properties.setProperty(\"strutsclass.resource.loader.description\", \"Velocity Classpath Resource Loader\");\n properties.setProperty(\"strutsclass.resource.loader.class\", \"org.apache.struts2.views.velocity.StrutsResourceLoader\");\n properties.setProperty(\"strutsclass.resource.loader.modificationCheckInterval\", \"2\");\n properties.setProperty(\"strutsclass.resource.loader.cache\", \"true\");\n\n // components\n String directives = tagLibraries.stream().map(TagLibraryDirectiveProvider::getDirectiveClasses).flatMap(\n Collection::stream).map(directive -> directive.getName() + \",\").collect(joining());\n\n String userdirective = properties.getProperty(\"userdirective\");\n if (userdirective == null || userdirective.trim().isEmpty()) {\n userdirective = directives;\n } else {\n userdirective = userdirective.trim() + \",\" + directives;\n }\n properties.setProperty(\"userdirective\", userdirective);\n }", "public final void setMxSheet_DefaultStyle(com.mendix.systemwideinterfaces.core.IContext context, xlsreport.proxies.MxCellStyle mxsheet_defaultstyle)\r\n\t{\r\n\t\tif (mxsheet_defaultstyle == null)\r\n\t\t\tgetMendixObject().setValue(context, MemberNames.MxSheet_DefaultStyle.toString(), null);\r\n\t\telse\r\n\t\t\tgetMendixObject().setValue(context, MemberNames.MxSheet_DefaultStyle.toString(), mxsheet_defaultstyle.getMendixObject().getId());\r\n\t}", "private File findDefaultsFile() {\r\n String defaultsPath = \"/defaults/users.defaults.xml\";\r\n String xmlDir = server.getServerProperties().get(XML_DIR_KEY);\r\n return (xmlDir == null) ?\r\n new File (System.getProperty(\"user.dir\") + \"/xml\" + defaultsPath) :\r\n new File (xmlDir + defaultsPath);\r\n }", "private void setupFiles(){\n\t\t// Copies the default configuration files to the workspace \n\t\ttry{\n\t\t\tBundle bundle = Platform.getBundle(Activator.PLUGIN_ID);\n\t\t\tIPath destBasePath = Platform.getStateLocation(bundle);\n\t\t\tpropertiesFile = destBasePath.append(PreferencesConstants.PROP_BUNDLE_STATE_PATH).toFile();\n\t\t\tif(!propertiesFile.exists()){\n\n\t\t\t\tURI sourceBaseURI = bundle.getEntry(PreferencesConstants.DEFAULT_CONFIG_BUNDLE_PATH).toURI();\n\t\t\t\t//TODO: fix the item below?\n\t\t\t\tEnumeration<URL> entries = bundle.findEntries(PreferencesConstants.DEFAULT_CONFIG_BUNDLE_PATH, null, true);\n\t\t\t\tfor(; entries != null && entries.hasMoreElements();){\n\t\t\t\t\tURL url = entries.nextElement();\n\t\t\t\t\tURI uri = url.toURI();\n\t\t\t\t\tURI relativeURI = sourceBaseURI.relativize(uri);\n\t\t\t\t\tIPath destPath = destBasePath.append(relativeURI.toString());\n\n\t\t\t\t\tif(destPath.hasTrailingSeparator()){\n\t\t\t\t\t\t// it's a folder\n\t\t\t\t\t\tdestPath.toFile().mkdirs();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t// it's a file\n\t\t\t\t\t\tURL contentURL = FileLocator.resolve(url);\n\t\t\t\t\t\tSystemUtils.blt(contentURL.openStream(), new FileOutputStream(destPath.toFile()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//now save the destination paths to the System properties\n\t\t\t//save the report paths\n\t\t\tString reportTemplatePath = destBasePath.append(PreferencesConstants.DEFAULT_REPORT_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_REPORT_TEMPLATE_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE, \n\t\t\t\t\treportTemplatePath);\n\t\t\tSystem.out.println(\"report template file: \" + reportTemplatePath);\t\t\n\t\t\t\n\t\t\tString reportPath = destBasePath.append(PreferencesConstants.DEFAULT_REPORT_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_REPORT_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT, \n\t\t\t\t\treportPath);\t\t\t\n\t\t\tSystem.out.println(\"report file: \" + reportPath);\t\t\t\n\t\t\t\n\t\t\t//save the rule paths\n\t\t\tString ruleSessionPath = destBasePath.append(PreferencesConstants.DEFAULT_RULE_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_RULE_SESSION_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION, \n\t\t\t\t\truleSessionPath);\t\t\t\n\t\t\tSystem.out.println(\"rule session file: \" + ruleSessionPath);\t\t\t\t\t\n\t\t\t\n\t\t\tString ruleSessionOutPath = destBasePath.append(PreferencesConstants.DEFAULT_RULE_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_RULE_SESSION_OUT_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT, \n\t\t\t\t\truleSessionOutPath);\t\t\t\n\t\t\tSystem.out.println(\"rule session out file: \" + ruleSessionOutPath);\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t\t\n\t\t/*\n\t\tString pluginName = Activator.PLUGIN_ID;\n\t\tBundle bundle = Platform.getBundle(pluginName);\n\n\t\tString propFileStr = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.PROP_URL);\n\t\tFile sourcePropFile = new File(propFileStr);\n\n\t\t//propertiesFile = new File(fixedPath);\n\t\tIWorkspace workspace = ResourcesPlugin.getWorkspace();\n\t\tIWorkspaceRoot root = workspace.getRoot();\n\t\tIPath location = root.getLocation();\n\t\t//location.toString()\n\t\t//String path = location.toString() + location.SEPARATOR + \".metadata\" \n\t\t//\t+ location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\t\tString path = location.toString() + location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\t\t//URL entry = Platform.getInstallLocation().getURL();\n\t\t//String path = entry.toString() + location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\n\t\tFile usersResourceDir = new File(path);\n\t\tpropertiesFile = new File(path + PreferencesConstants.PROP_URL);\n\t\tSystem.out.println(\"properties file \" + propertiesFile.getAbsolutePath());\n\t\tFile reportDir;\n\t\tFile ruleDir;\n\t\tif(!usersResourceDir.exists()){\n\t\t\ttry{\n\t\t\t\tSystemUtils.createDirectory(usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy the properties file\n\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyFile(sourcePropFile, propertiesFile);\n\t\t\t}\n\t\t\tcatch(IOException e1){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy report directory\n\t\t\tString fixedReportPath = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.DEFAULT_REPORT_PATH);\n\t\t\treportDir = new File(fixedReportPath);\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyDirectory(reportDir, usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy rule directory\n\t\t\tString fixedRulePath = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.DEFAULT_RULE_PATH);\n\t\t\truleDir = new File(fixedRulePath);\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyDirectory(ruleDir, usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tSystem.out.println(\"success\");\n\t\t}\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_TEMPLATE_URL);\n\t\tSystem.out.println(\"report template file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE));\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_URL.substring(1));\n\t\tSystem.out.println(\"report file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_REPORT));\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_SESSION_URL.substring(1));\n\t\tSystem.out.println(\"rule session file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION));\n\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_SESSION_OUT_URL.substring(1));\n\t\tSystem.out.println(\"rule session file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT));\n\t\t*/\n\t}", "@Override\n protected String getDefaultScriptsDir() {\n return null;\n }", "protected void installDefaults()\n {\n String prefix = getPropertyPrefix();\n Font f = editor.getFont();\n if ((f == null) || (f instanceof UIResource)) {\n editor.setFont(UIManager.getFont(prefix + \".font\"));\n }\n\n Color bg = editor.getBackground();\n if ((bg == null) || (bg instanceof UIResource)) {\n editor.setBackground(UIManager.getColor(prefix + \".background\"));\n }\n\n Color fg = editor.getForeground();\n if ((fg == null) || (fg instanceof UIResource)) {\n editor.setForeground(UIManager.getColor(prefix + \".foreground\"));\n }\n\n Color color = editor.getCaretColor();\n if ((color == null) || (color instanceof UIResource)) {\n editor.setCaretColor(UIManager.getColor(prefix + \".caretForeground\"));\n }\n\n Color s = editor.getSelectionColor();\n if ((s == null) || (s instanceof UIResource)) {\n editor.setSelectionColor(UIManager.getColor(prefix + \".selectionBackground\"));\n }\n\n Color sfg = editor.getSelectedTextColor();\n if ((sfg == null) || (sfg instanceof UIResource)) {\n editor.setSelectedTextColor(UIManager.getColor(prefix + \".selectionForeground\"));\n }\n\n Color dfg = editor.getDisabledTextColor();\n if ((dfg == null) || (dfg instanceof UIResource)) {\n editor.setDisabledTextColor(UIManager.getColor(prefix + \".inactiveForeground\"));\n }\n\n Border b = editor.getBorder();\n if ((b == null) || (b instanceof UIResource)) {\n editor.setBorder(UIManager.getBorder(prefix + \".border\"));\n }\n\n Insets margin = editor.getMargin();\n if (margin == null || margin instanceof UIResource) {\n editor.setMargin(UIManager.getInsets(prefix + \".margin\"));\n }\n\n updateCursor();\n }", "@Override public String getUserAgentStylesheet() {\r\n return getClass().getResource(\"switch.css\").toExternalForm();\r\n }", "private void loadDefaultConfig() {\r\n ResourceBundle bundle = ResourceLoader.getProperties(DEFAULT_CONFIG_NAME);\r\n if (bundle != null) {\r\n putAll(bundle);\r\n } else {\r\n LOG.error(\"Can't load default Scope config from: \" + DEFAULT_CONFIG_NAME);\r\n }\r\n }", "public void setDefaultIconCls(String defaultIconCls) {\n\t\tthis.defaultIconCls = defaultIconCls;\n\t\thandleConfig(\"defaultIconCls\", defaultIconCls);\n\t}", "public static File getFileToLoad() {\n\t\treturn new File(System.getProperty(\"user.home\") + File.separatorChar + \"Documents\" + File.separatorChar + \"main.css\");\n\t\t//return null;\n\t}", "protected void installDefaults() {\n\t\tColor bg = this.controlPanel.getBackground();\n\t\tif (bg == null || bg instanceof UIResource) {\n\t\t\tthis.controlPanel.setBackground(FlamingoUtilities.getColor(\n\t\t\t\t\tColor.lightGray, \"ControlPanel.background\",\n\t\t\t\t\t\"Panel.background\"));\n\t\t}\n\n\t\tBorder b = this.controlPanel.getBorder();\n\t\tif (b == null || b instanceof UIResource) {\n\t\t\tBorder toSet = UIManager.getBorder(\"ControlPanel.border\");\n\t\t\tif (toSet == null)\n\t\t\t\tnew BorderUIResource.EmptyBorderUIResource(1, 2, 1, 2);\n\t\t\tthis.controlPanel.setBorder(toSet);\n\t\t}\n\t\t\n\t\tFont font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = UIManager.getFont(\"Panel.font\");\n this.controlPanel.setFont(toSet);\n }\n\t}", "public final void setMxSheet_DefaultStyle(xlsreport.proxies.MxCellStyle mxsheet_defaultstyle)\r\n\t{\r\n\t\tsetMxSheet_DefaultStyle(getContext(), mxsheet_defaultstyle);\r\n\t}", "@Override\n public void loadDefaultConfig() {\n currentConfigFileName = defaultConfigFileName;\n mesoCfgXML = (SCANConfigMesoXML) readDefaultConfig();\n createAttributeMap(getAttributes());\n }", "@Override\n protected String getStyle() {\n return App.getInstance().getThemeCssFileName();\n\n }", "@StyleDefaults(ELEMENT_ID)\n public static void initializeDefaultStyles(Styles styles, Attributes attrs) {\n styles.getSelector(meid, null).set(\"setReadfieldPreferredWidth\", 50, false);\n styles.getSelector(meid, null).set(\"setHeadlineHAlignment\", HAlignment.Center, false);\n styles.getSelector(meid, null).set(\"setReadfieldimagewidth\", 0f, false);\n styles.getSelector(meid, null).set(\"setReadfieldimageheight\", 0f, false);\n }", "private void setStyleToDefault() {\n // enable syntax highlighting\n commandTextField.enableSyntaxHighlighting();\n }", "public final void setDefault() {\n wind.setCoordinates(DEFAULT_TURBULENCES, DEFAULT_TURBULENCES,\n DEFAULT_TURBULENCES);\n }", "abstract public void setTopResourcesDir(String path);", "@Override\n\tprotected NSArray<String> additionalCSSFiles() {\n\t\treturn new NSMutableArray<String>( new String[] { \"modalbox.css\" } );\n\t}", "public void setCurrentcss(String currentcss) {\n this.currentcss = currentcss;\n }", "protected void init() {\r\n\t\tgetPage().addWgtCSS(\"standard/jquery-ui.css\");\r\n\t\tgetPage().addWgtCSS(\"standard/ui.jqgrid.css\");\r\n\t\tgetPage().addControllerJS( JSResourceProcessor.GRID_JS );\r\n\t}", "public BlockUIThemedCSS()\n\t{\n\t\t//No config required\n\t}", "public static void addDefaultClasspathSettings(String defaultClasspathSettingsPath) {\n\t\tArgumentNotValid.checkNotNullOrEmpty(defaultClasspathSettingsPath, \"String defaultClasspathSettingsPath\");\n\t\tInputStream stream = Thread.currentThread().getContextClassLoader()\n\t\t\t\t.getResourceAsStream(defaultClasspathSettingsPath);\n\t\tif (stream != null) {\n\t\t\tdefaultClasspathSettingsXmlList.add(new SimpleXml(stream));\n\t\t} else {\n\t\t\tlog.warn(\"Unable to read the settings file represented by path: '{}'\", defaultClasspathSettingsPath);\n\t\t}\n\t}", "private void initializeWithDefaultValues() {\n setProjectFolder(\"projectFolder\");\n setContext(\"context\");\n setGroupId(\"com.company.project\");\n setArtifactId(\"project\");\n setModulePrefix(\"project-\");\n setVersion(\"0.0.1-SNAPSHOT\");\n setName(\"Project Name\");\n setDescription(\"Project Description\");\n setUrl(\"https://www.company-project.com\");\n setInceptionYear(String.valueOf(LocalDateTime.now().getYear()));\n setOrganizationName(\"Your Company Name\");\n setOrganizationUrl(\"https://www.company.com\");\n setLicenseName(\"apache_v2\");\n setLicenseUrl(\"https://www.license-url.com\");\n setScmConnection(\"\");\n setScmDeveloperConnection(\"\");\n setScmUrl(\"\");\n setDistributionProfile(\"\");\n setExtraModules(new LinkedHashSet<>());\n setContextDescriptions(new LinkedHashSet<>());\n setAppConfigLocationType(AppConfigLocationType.INSIDE);\n }", "private void init()\n\t{\n\t\tResourceReference css = getCSS();\n\t\tif (css != null)\n\t\t{\n\t\t\tadd(HeaderContributor.forCss(css.getScope(), css.getName()));\n\t\t}\n\t}", "private static void resetConfiguration(Configuration defaultConfig) {\n new Resources(IEAApp.getInstance().getResources().getAssets(),\n IEAApp.getInstance().getResources().getDisplayMetrics(),\n defaultConfig);\n }", "public void addDefaultCostumes() {\n addCostume(\"images/cat.costume1.png\");\n addCostume(\"images/cat.costume2.png\");\n }", "private void setDefaultConfiguration(){\n\t\tthis.setProperty(\"DefaultNodeCapacity\", \"5\");\n\t\tthis.setProperty(\"ReplicaNumber\", \"3\");\n\t\tthis.setProperty(\"JobReattemptTimes\", \"2\");\n\t\tthis.setProperty(\"ReducerCount\", \"3\");\n\t}", "protected void installDefaults() {\n this.controlPanel.setBackground(null);\n\n Font font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = RadianceThemingCortex.GlobalScope.getFontPolicy().getFontSet().\n getControlFont();\n this.controlPanel.setFont(toSet);\n }\n }", "private void changeUIdefaults() {\n\t\tUIManager.put(\"TaskPaneContainer.useGradient\", Boolean.FALSE);\n\t\tUIManager.put(\"TaskPaneContainer.background\",\n\t\t\t\tColors.LightGray.color(0.5f));\n\n\t\t// setting taskpane defaults\n\t\tUIManager.put(\"TaskPane.font\", new FontUIResource(new Font(\"Verdana\",\n\t\t\t\tFont.BOLD, 16)));\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientStart\",\n\t\t\t\tColors.White.color());\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientEnd\",\n\t\t\t\tColors.LightBlue.color());\n\t}", "private void defaultConfig(Set<String> defaultFontFamilyNames) {\n defaultFontFamily = DEFAULT_SELECTED_FONT_NAME;\n\n // the empty font name\n addItem(\"\");\n\n // all the system font names to combo box\n for (String defaultFontFamilyName : defaultFontFamilyNames) {\n this.listFontFamily.add(defaultFontFamilyName);\n addItem(defaultFontFamilyName);\n }\n\n this.setSelectedItem(defaultFontFamily);\n }", "public void geraArquivoIniDefault(String pathToArqIni, String pathToDefaultIni){\n\t\tFile fileIni = new File(pathToArqIni);\n\t\ttry {\n\t\t\tFileUtils.copyInputStreamToFile(getClass().getResourceAsStream(pathToDefaultIni), fileIni);\n\t\t\tlogger.debug(\"Arquivo Ini gerado com sucesso a partir de default.ini\");\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Nao foi Possivel criar arquivo ini apartir de default.ini\");\n\t\t\tLoggerPrintExceptionHelper.printExceptionOnLogger(logger, e);\n\t\t}\n\t}", "public String getDefaultResourceFileName() \n {\n return null; \n }", "public MutablePropertiesPropertySource(File propertiesLocation, int defaultOrdinal) {\n super(propertiesLocation.toString(), defaultOrdinal);\n try {\n this.file = propertiesLocation;\n refresh();\n } catch (Exception e) {\n LOG.log(Level.SEVERE, \"Cannot convert file to URL: \" + propertiesLocation, e);\n }\n }", "private void loadStyles() {\n ShowcaseResources.INSTANCE.showcaseCss().ensureInjected();\n RoundedCornersResource.INSTANCE.roundCornersCss().ensureInjected();\n }", "public void setBaseURL(final String url) {\r\n String location = url;\r\n //-- remove filename if necessary:\r\n if (location != null) { \r\n int idx = location.lastIndexOf('/');\r\n if (idx < 0) idx = location.lastIndexOf('\\\\');\r\n if (idx >= 0) {\r\n int extIdx = location.indexOf('.', idx);\r\n if (extIdx > 0) {\r\n location = location.substring(0, idx);\r\n }\r\n }\r\n }\r\n \r\n try {\r\n _resolver.setBaseURL(new URL(location));\r\n } catch (MalformedURLException except) {\r\n // try to parse the url as an absolute path\r\n try {\r\n LOG.info(Messages.format(\"mapping.wrongURL\", location));\r\n _resolver.setBaseURL(new URL(\"file\", null, location));\r\n } catch (MalformedURLException except2) { }\r\n }\r\n }", "@Override\n\tpublic void setDefaultCpus(int defaultCpus) {\n\t\t_scienceApp.setDefaultCpus(defaultCpus);\n\t}", "private void loadCssForThisClass() {\n\t\tString className = getClass().getName();\n\t\tString cssPath = className.replace(\".\", \"/\") + \".css\";\n\t\tURL cssUrl = getClass().getClassLoader().getResource(cssPath);\n\t\tloadCss(cssUrl);\n\n\t\t// System.out.println(\"CSS:\\n\" + getCssContent(cssUrl) );\n\t}", "public void setSiteLocation(URI location) {\n \t\tthis.siteLocation = location;\n \t}", "protected void setSiteContentBase(String path) {\n try {\n if (StringUtils.isBlank(path) || !path.startsWith(\"/\")) {\n throw new IllegalArgumentException(\"Parameter path must be a String that starts with /\");\n }\n HippoBean hippoBean = (HippoBean) requestContext.getObjectBeanManager().getObject(path);\n // here it must be relative to root\n requestContext.setSiteContentBasePath(path.substring(1));\n requestContext.setSiteContentBaseBean(hippoBean);\n } catch (ObjectBeanManagerException e) {\n throw new HstComponentException(e);\n }\n }", "private void setCarbonHome() {\n Path carbonHome = Paths.get(\"\");\n carbonHome = Paths.get(carbonHome.toString(), \"src\", \"test\");\n System.setProperty(CARBON_HOME, carbonHome.toString());\n logger.info(\"Carbon Home Absolute path set to: \" + carbonHome.toAbsolutePath());\n\n }", "public String getDefaultImgSrc(){return \"/students/footballstudentdefault.png\";}", "public void setDefaultSelector(final String defaultSelector) {\n\t\tthis.defaultSelector = defaultSelector;\n\t}", "public void setBackgroundToDefault(){\n\t\tcurrentBackgroundImage = defaultBackgroundImage;\n\t\tbackgroundPanel.changeBackground(defaultBackgroundImage);\n\t}", "public void loadExternalRepositories() {\n\t\tString envExternalRepsString = System.getenv(\"ODFI_DOCBOOK_STYLESHEETS_REPS\");\r\n\t\tif (envExternalRepsString!=null) {\r\n\t\t\tString[] externalEnvReps = envExternalRepsString.split(\"\"+File.pathSeparatorChar);\r\n\t\t\tfor (String rep : externalEnvReps) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.loadRepository(rep);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// Remove wrong URL\r\n\t\t\t\t\t//it.remove();\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t// Load Preferences with Environment variable if there is one, otherwise don't touch it\r\n\t\t//---------------------\r\n\t\tString envExternalReps = System.getenv(DocbookPlugin.ENV_EXTERNAL_REPS);\r\n\t\tif (envExternalReps!=null) {\r\n\t\t\tDocbookPlugin.getDefault().getPreferenceStore().setDefault(\"reps.external.env\", envExternalReps);\r\n\t\t}\r\n\t\t\r\n\t\t// Do we have any manually added stylesheets repositories?\r\n\t\t//-----------------------\r\n\t\tString externalAddedRepsString = DocbookPlugin.getDefault().getPreferenceStore().getString(\"reps.external.added\");\r\n\t\tString externalEnvRepsString = DocbookPlugin.getDefault().getPreferenceStore().getString(\"reps.external.env\");\r\n\r\n\t\t\r\n\t\t// Parse the repositories\r\n\t\t//----------------------------------\r\n\t\tString[] externalEnvReps = externalEnvRepsString.split(\";\");\r\n\t\tArrayIterator<String> it = new ArrayIterator<String>(externalEnvReps);\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tString rep = it.next();\r\n\t\t\ttry {\r\n\t\t\t\tthis.loadRepository(rep);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// Remove wrong URL\r\n\t\t\t\t//it.remove();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString[] externalAddedReps = externalAddedRepsString.split(\";\");\r\n\t\tit = new ArrayIterator<String>(externalAddedReps);\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tString rep = it.next();\r\n\t\t\ttry {\r\n\t\t\t\tthis.loadRepository(rep);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// Remove wrong URL\r\n\t\t\t\t//it.remove();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} \r\n\t\t}\r\n\t\t\r\n\t\t// Resave in case we cleaned them\r\n\t\t//-------------------------------------\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public String getDefaultConfigName() {\n return defaultConfigFileName;\n }", "private native void setDefaultRealmFileDirectory(String fileDir, AssetManager assets);", "private void writeCss(HttpServletRequest request,\n HttpServletResponse response) throws IOException, QuickFixException {\n AuraContext context = Aura.getContextService().getCurrentContext();\n response.setCharacterEncoding(AuraBaseServlet.UTF_ENCODING);\n List<String> namespaces = Lists.newArrayList(context.getPreloads());\n DefinitionService definitionService = Aura.getDefinitionService();\n Client.Type type = Aura.getContextService().getCurrentContext().getClient().getType();\n Mode mode = context.getMode();\n StringBuffer sb = new StringBuffer();\n \n for (String ns : namespaces) {\n String key = type.name() + \"$\" + ns;\n \n String nsCss = !mode.isTestMode() ? cssCache.get(key) : null;\n if (nsCss == null) {\n DefDescriptor<ThemeDef> matcher = definitionService.getDefDescriptor(String.format(\"css://%s.*\", ns),\n ThemeDef.class);\n Set<DefDescriptor<ThemeDef>> descriptors = definitionService.find(matcher);\n List<ThemeDef> nddefs = new ArrayList<ThemeDef>();\n \n sb.setLength(0);\n for(DefDescriptor<ThemeDef> descriptor : descriptors){\n //\n // This could use the generic routine above except for this brain dead little\n // gem.\n //\n if(!descriptor.getName().toLowerCase().endsWith(\"template\")){\n ThemeDef def = descriptor.getDef();\n if(def != null){\n nddefs.add(def);\n }\n }\n }\n \n context.setPreloading(true);\n Appendable tmp = mode.isTestMode() ? response.getWriter() : sb;\n preloadSerialize(nddefs, ThemeDef.class, tmp);\n if (!mode.isTestMode()) {\n nsCss = sb.toString();\n cssCache.put(key, nsCss);\n }\n }\n \n if (nsCss != null) {\n \tresponse.getWriter().append(nsCss);\n }\n }\n }", "public CSGStyle(AppTemplate initApp) {\r\n // KEEP THIS FOR LATER\r\n app = initApp;\r\n\r\n // LET'S USE THE DEFAULT STYLESHEET SETUP\r\n super.initStylesheet(app);\r\n\r\n // INIT THE STYLE FOR THE FILE TOOLBAR\r\n app.getGUI().initFileToolbarStyle();\r\n\r\n // AND NOW OUR WORKSPACE STYLE\r\n initTAWorkspaceStyle();\r\n }", "public void setDefaultHost() {\r\n\t\tsetHost(DEFAULT_HOST);\r\n\t}", "private WidgetConfiguration setStyling(Item item, WidgetConfiguration defaultConfig) {\n\t\tWidgetConfiguration newConfig = new WidgetConfiguration(\n\t\t\t\tdefaultConfig.getFont(), defaultConfig.getColor(), new Dimension(defaultConfig.getWidth(), defaultConfig.getHeight()));\n\n\t\t//go through all properties, visit and set found formatting\n\t\tfor (StyleProperty prop : item.getProperties()) {\n\t\t\tprop.accept(new StyleVisitor<Void, Void>() {\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(Height h, Void ctx2) {\n\t\t\t\t\tnewConfig.setHeight(h.getHeightVal());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(Width w, Void ctx2) {\n\t\t\t\t\tnewConfig.setWidth(w.getWidthVal());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(FontName fn, Void ctx2) {\n\t\t\t\t\tnewConfig.setFontName(fn.getName());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(FontSize fs, Void ctx2) {\n\t\t\t\t\tnewConfig.setFontSize(fs.getSize());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(FontColor fc, Void ctx2) {\n\t\t\t\t\tnewConfig.setFontColor(fc.getColor());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t},\n\t\t\tnull);\n\t\t}\n\t\t//return new configuration to style the question\n\t\treturn newConfig;\n\t}", "protected String overwriteSwaggerDefaultUrl(String html) {\n\t\treturn html.replace(Constants.SWAGGER_UI_DEFAULT_URL, StringUtils.EMPTY);\n\t}", "static String getDefaultConfigurationFileName() {\n // This is a file calles 'jmx-scandir.xml' located\n // in the user directory.\n final String user = System.getProperty(\"user.home\");\n final String defconf = user+File.separator+\"jmx-scandir.xml\";\n return defconf;\n }", "@FXML\n\tprivate void setDarkStyle() {\n\t\tapplication.getScene().getStylesheets().remove(urlDefaultTheme);\n\n\t\t// Add the new theme\n\t\tapplication.getScene().getStylesheets().add(urlDarkTheme);\n\t}", "private static void addDefaultWebXml(IFacetedProjectWorkingCopy fpjwc, IDataModel dm)\n \t\tthrows CoreException {\n \t\tIPath webinfPath = fpjwc.getProjectLocation().append(\"docroot/WEB-INF\");\n \n \t\tif (ProjectUtil.isExtProject(fpjwc.getProject()) || fpjwc.getProjectLocation().lastSegment().endsWith(\"-ext\")) {\n \t\t\tfpjwc.getProjectLocation().append(IPluginFacetConstants.EXT_PLUGIN_SDK_CONFIG_FOLDER);\n \t\t}\n \n \t\tif (webinfPath.toFile().exists()) {\n \t\t\tFile webXml = webinfPath.append(\"web.xml\").toFile();\n \n \t\t\tif (!webXml.exists()) {\n \t\t\t\tProjectUtil.setGenerateDD(dm, false);\n \n \t\t\t\tProjectUtil.createDefaultWebXml(webXml);\n \n \t\t\t\tIProject project = fpjwc.getProject();\n \n \t\t\t\tif (project != null) {\n \t\t\t\t\tproject.refreshLocal(IResource.DEPTH_INFINITE, null);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public void initialize() {\n if (!BungeeBan.getInstance().getDataFolder().exists()) {\n BungeeBan.getInstance().getDataFolder().mkdirs();\n }\n File file = this.getConfigurationFile();\n if (!file.exists()) {\n try {\n file.createNewFile();\n if (this.defaultConfig != null) {\n try (InputStream is = BungeeBan.getInstance().getResourceAsStream(this.defaultConfig);\n OutputStream os = new FileOutputStream(file)) {\n ByteStreams.copy(is, os);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n this.reload();\n }", "public void filesLocation (String externalFolder) {\n externalStaticFileFolder = externalFolder;\n }", "protected void installDefaults() {\n spinner.setLayout(createLayout());\n LookAndFeel.installBorder(spinner, \"Spinner.border\");\n LookAndFeel.installColorsAndFont(spinner, \"Spinner.background\", \"Spinner.foreground\", \"Spinner.font\"); }", "private void configuracoes() {\n setLocationRelativeTo(null);\n this.setIconImage(new ImageIcon(getClass().getResource(SystemMessage.IMAGE_URL)).getImage());\n this.setTitle(SystemMessage.SYSTEM_NAME + \" -\");\n }", "public void setDefaultStyleString(String defaultStyleString) {\n/* 564 */ getCOSObject().setString(COSName.DS, defaultStyleString);\n/* */ }", "public Controller(){\n initControl();\n this.getStylesheets().addAll(\"/resource/style.css\");\n }", "public void setDefaultImgOver(YuiImage defaultImgOver) {\r\n\t\tthis.defaultImgOver = defaultImgOver;\r\n\t}", "protected void setToDefault(){\n\n\t}", "public void setUpDefaultAvatar(User user) throws IOException,\n\t\t\tURISyntaxException;", "private InputStream getStyleSheet() throws MojoExecutionException {\n if (reportStyle == null || ReportFormat.PLAIN.is(reportStyle)) {\n return Defaults.getPlainStyleSheet();\n } else if (ReportFormat.XML.is(reportStyle)) {\n return null;\n } else {\n try {\n return new FileInputStream(reportStyle);\n } catch (FileNotFoundException e) {\n throw new MojoExecutionException(\n \"Unable to find report stylesheet: \" + reportStyle, e);\n }\n }\n }", "public void resourcesLocation (String folder) {\n staticFileFolder = folder.startsWith (\"/\")? folder.substring (1) : folder;\n }", "public void setCss(String css) {\n this.css = css;\n }", "private void init() {\n\t\n\t\tthis.setSize(DEFAULT_W, DEFAULT_H);\n\t\tthis.setLocation(DEFAULT_X, DEFAULT_X);\n\t\tthis.setTitle(DEFAULT_TITLE);\n\n\t}", "public void setDefaultResourceBundle(String pDefaultResourceBundle) {\n mDefaultResourceBundle = pDefaultResourceBundle;\n }", "public void setOfficialFileWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALFILEWEBPAGE, value);\r\n\t}", "public DefaultSyntaxDocument()\n {\n colors = SyntaxUtilities.getDefaultSyntaxColors();\n addDocumentListener(new DocumentHandler());\n }", "File getDefaultFile();", "public void setDefault(String defaultTarget) {\n this.defaultTarget = defaultTarget;\n }", "public static void setDefaultUserImage() {\n user.setUserProfileImage(null);\n setUpNavigationHeader();\n ImageManager.deleteImage(ImageManager.USER_PROFILE_IMAGES_PATH, user.getUsername());\n }", "public void setImageDir(File imageRepDir) {\n\t\tFileDataPersister.getInstance().put(\"gui.configuration\", \"image.repository\", imageRepDir.getPath());\n\t\tRepository.getInstance().setRepository(imageRepDir);\n\t\tthis.getSelectedGraphEditor().repaint();\n\t}", "public void setDefaultTarget(String defaultTarget) {\n this.defaultTarget = defaultTarget;\n }", "public void setBasedir( File basedir )\n {\n this.basedir = basedir;\n }", "public File getDefaultOutputDir() {\n File out = _mkdir(XPreferencesFactory.kDefaultReportsOutputDir.getDir(false));\r\n String dn = NamingConventions.createNiceEnglishDate_for_dirs();\r\n return _mkdir(new File(out, dn));\r\n }" ]
[ "0.63323987", "0.59085536", "0.5636047", "0.552781", "0.54041064", "0.5285788", "0.51634276", "0.5134439", "0.50845134", "0.5062416", "0.5040475", "0.50128037", "0.50092006", "0.5003422", "0.4912006", "0.48440123", "0.48439786", "0.48134932", "0.4812016", "0.4804904", "0.48038813", "0.47961187", "0.47935128", "0.47863382", "0.4745576", "0.47426403", "0.47404188", "0.47323534", "0.47159246", "0.4700755", "0.46934852", "0.4690933", "0.46873033", "0.46863654", "0.46715188", "0.46679616", "0.46381384", "0.4632814", "0.46301347", "0.46277952", "0.46276638", "0.4618594", "0.46152297", "0.4610837", "0.4605833", "0.456592", "0.4565082", "0.45542273", "0.45455918", "0.45430467", "0.45315644", "0.4527329", "0.45079765", "0.4492299", "0.44917974", "0.4484832", "0.4480911", "0.4472438", "0.44613415", "0.44610068", "0.44535214", "0.4447652", "0.4422053", "0.44219074", "0.441114", "0.44094744", "0.44043425", "0.44028544", "0.43928403", "0.437888", "0.437721", "0.43762746", "0.43755743", "0.437416", "0.4374159", "0.43730873", "0.43685663", "0.43536246", "0.43522802", "0.43473932", "0.4345514", "0.43447685", "0.43438083", "0.43413848", "0.43398696", "0.43157724", "0.4311751", "0.43109417", "0.4300056", "0.42984873", "0.42972958", "0.4282223", "0.42715684", "0.42709875", "0.42684224", "0.4263804", "0.42615473", "0.4258872", "0.42584246", "0.4258257" ]
0.7016285
0
Gets the location of the default css file(s). This is used if no CSS location is defined in the site configuration repository item
public String getDefaultCssFile() { return mDefaultCssFile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String getDefaultStylesheet ();", "public static File getFileToLoad() {\n\t\treturn new File(System.getProperty(\"user.home\") + File.separatorChar + \"Documents\" + File.separatorChar + \"main.css\");\n\t\t//return null;\n\t}", "public void setDefaultCssFile( String pDefaultCssFile ) {\n mDefaultCssFile = pDefaultCssFile;\n }", "protected ResourceReference getCSS()\n\t{\n\t\treturn CSS;\n\t}", "private File findDefaultsFile() {\r\n String defaultsPath = \"/defaults/users.defaults.xml\";\r\n String xmlDir = server.getServerProperties().get(XML_DIR_KEY);\r\n return (xmlDir == null) ?\r\n new File (System.getProperty(\"user.dir\") + \"/xml\" + defaultsPath) :\r\n new File (xmlDir + defaultsPath);\r\n }", "private InputStream getStyleSheet() throws MojoExecutionException {\n if (reportStyle == null || ReportFormat.PLAIN.is(reportStyle)) {\n return Defaults.getPlainStyleSheet();\n } else if (ReportFormat.XML.is(reportStyle)) {\n return null;\n } else {\n try {\n return new FileInputStream(reportStyle);\n } catch (FileNotFoundException e) {\n throw new MojoExecutionException(\n \"Unable to find report stylesheet: \" + reportStyle, e);\n }\n }\n }", "private void extractDefaultGeneratorLogo() {\n try {\n PlatformUtil.extractResourceToUserConfigDir(getClass(), DEFAULT_GENERATOR_LOGO, true);\n } catch (IOException ex) {\n logger.log(Level.SEVERE, \"Error extracting report branding resource for generator logo \", ex); //NON-NLS\n }\n defaultGeneratorLogoPath = PlatformUtil.getUserConfigDirectory() + File.separator + DEFAULT_GENERATOR_LOGO;\n }", "public String getCurrentcss() {\n return clean(currentcss);\n }", "public File getCommonDir()\n {\n return validatePath(ServerSettings.getInstance().getProperty(ServerSettings.COMMON_DIR));\n }", "public String getDefaultIconCls() {\n\t\tif (null != this.defaultIconCls) {\n\t\t\treturn this.defaultIconCls;\n\t\t}\n\t\tValueExpression _ve = getValueExpression(\"defaultIconCls\");\n\t\tif (_ve != null) {\n\t\t\treturn (String) _ve.getValue(getFacesContext().getELContext());\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n protected String getStyle() {\n return App.getInstance().getThemeCssFileName();\n\n }", "static String getDefaultConfigurationFileName() {\n // This is a file calles 'jmx-scandir.xml' located\n // in the user directory.\n final String user = System.getProperty(\"user.home\");\n final String defconf = user+File.separator+\"jmx-scandir.xml\";\n return defconf;\n }", "private static String getStyleSheet() {\n\t\tif (fgStyleSheet == null)\n\t\t\tfgStyleSheet= loadStyleSheet();\n\t\tString css= fgStyleSheet;\n\t\tif (css != null) {\n\t\t\tFontData fontData= JFaceResources.getFontRegistry().getFontData(PreferenceConstants.APPEARANCE_JAVADOC_FONT)[0];\n\t\t\tcss= HTMLPrinter.convertTopLevelFont(css, fontData);\n\t\t}\n\n\t\treturn css;\n\t}", "public static Properties getPropertiesDefault() throws IOException {\n\t\treturn getProperties(\"/properties/configuration.properties\");\n\t\t\n\t}", "public String getDefaultResourceFileName() \n {\n return null; \n }", "private static String loadStyleSheet() {\n\t\tBundle bundle= Platform.getBundle(JavaPlugin.getPluginId());\n\t\tURL styleSheetURL= bundle.getEntry(\"/JavadocHoverStyleSheet.css\"); //$NON-NLS-1$\n\t\tif (styleSheetURL != null) {\n\t\t\tBufferedReader reader= null;\n\t\t\ttry {\n\t\t\t\treader= new BufferedReader(new InputStreamReader(styleSheetURL.openStream()));\n\t\t\t\tStringBuffer buffer= new StringBuffer(1500);\n\t\t\t\tString line= reader.readLine();\n\t\t\t\twhile (line != null) {\n\t\t\t\t\tbuffer.append(line);\n\t\t\t\t\tbuffer.append('\\n');\n\t\t\t\t\tline= reader.readLine();\n\t\t\t\t}\n\t\t\t\treturn buffer.toString();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tJavaPlugin.log(ex);\n\t\t\t\treturn \"\"; //$NON-NLS-1$\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (reader != null)\n\t\t\t\t\t\treader.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@Override public String getUserAgentStylesheet() {\r\n return getClass().getResource(\"switch.css\").toExternalForm();\r\n }", "public String createCSSFolder(String websiteName){\n directory = path + websiteName + \"/css\";\n return directory;\n }", "abstract protected DocumentCSSStyleSheet getDefaultStyleSheet(CSSDocument.ComplianceMode mode);", "public File getDefaultDiskCacheDir() {\n if (mContext == null)\n throw new FIllegalArgumentException(\"Context can not be null\");\n return DiskCacheUtil.getDiskLruCacheDir(mContext);\n }", "private ISiteEntry getRootSite() {\n \t\tISitePolicy defaultPolicy = createSitePolicy(DEFAULT_POLICY_TYPE, DEFAULT_POLICY_LIST);\n \t\tURL siteURL = null;\n \t\ttry {\n \t\t\tsiteURL = new URL(PlatformURLBaseConnection.PLATFORM_URL_STRING); // try using platform-relative URL\n \t\t} catch (MalformedURLException e) {\n \t\t\tsiteURL = BootLoader.getInstallURL(); // ensure we come up ... use absolute file URL\n \t\t}\n \t\tISiteEntry defaultSite = createSiteEntry(siteURL, defaultPolicy);\n \t\treturn defaultSite;\n \t}", "public File getDefaultOutputDir() {\n File out = _mkdir(XPreferencesFactory.kDefaultReportsOutputDir.getDir(false));\r\n String dn = NamingConventions.createNiceEnglishDate_for_dirs();\r\n return _mkdir(new File(out, dn));\r\n }", "String getMobileCSSFile() throws FndException\n {\n return configfile.mobilecssfile;\n }", "@Override\n protected String getDefaultScriptsDir() {\n return null;\n }", "public String getDefaultThemeName() {\n\treturn resources.getString(\"defaultTheme\", null);\n }", "public String getDefaultRepositoryFileName() {\n\t\tString fileName = System.getProperty(\"java.io.tmpdir\");\n\t\tif (!fileName.endsWith(File.separator)) {\n\t\t\tfileName += File.separator;\n\t\t}\n\t\tfileName += \".repository\";\n\t\treturn fileName;\n\t}", "public static String sBasePath() \r\n\t{\r\n\t\tif(fromJar) \r\n\t\t{\r\n\t\t\tFile file = new File(System.getProperty(\"java.class.path\"));\r\n\t\t\tif (file.getParent() != null)\r\n\t\t\t{\r\n\t\t\t\treturn file.getParent().toString();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn new java.io.File(\"\").getCanonicalPath();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "@Override\n public String getFullDefaultConfigName() {\n return getConfigPath() + defaultConfigFileName;\n }", "public String getCss() {\n return clean(css);\n }", "protected String getDefaultFilename()\n {\n return DEFAULT_FILENAME;\n }", "@Override\n public String getDefaultConfig(Log log) throws CommandLineException {\n File defaultCfg = null;\n if (DEFAULT_CONFIG_FILE.equals(defaultConfigFile)) {\n final String conf = ExecutionUtils.executeCommand(log, \"\\\"\" + this.executable + \"\\\" -V SERVER_CONFIG_FILE\");\n final Pattern pattern = Pattern.compile(\"^\\\\s*-D\\\\s*SERVER_CONFIG_FILE=\\\"(.*)?\\\"$\");\n final Matcher matcher = pattern.matcher(conf);\n final String result = matcher.group(1);\n defaultCfg = new File(result);\n if (defaultCfg.isAbsolute()) {\n if (defaultCfg.exists()) {\n return ConfigUtils.readConfigFile(defaultCfg);\n }\n } else {\n final String exec = ExecutionUtils.searchExecutable(log, this.executable);\n if (exec != null) {\n final File execFile = new File(exec);\n File execDir = execFile.getParentFile();\n if (\"bin\".equals(execDir.getName())) {\n execDir = execDir.getParentFile();\n }\n File confDir = new File(execDir, \"conf\");\n if (!confDir.exists()) {\n confDir = execDir;\n }\n defaultCfg = new File(confDir, \"httpd.conf\");\n if (defaultCfg.exists()) {\n return ConfigUtils.readConfigFile(defaultCfg);\n }\n }\n }\n } else {\n defaultCfg = new File(this.defaultConfigFile);\n if (defaultCfg.exists()) {\n return ConfigUtils.readConfigFile(defaultCfg);\n }\n }\n return null;\n }", "public String getBasePath(){\r\n\t\t \r\n\t\t String basePath = properties.getProperty(\"getPath\");\r\n\t\t if(basePath != null) return basePath;\r\n\t\t else throw new RuntimeException(\"getPath not specified in the configuration.properties file.\");\r\n\t }", "private static File findPropertyFile(String startPath) {\n var defaultConfig = new File(startPath);\n var list = defaultConfig\n .listFiles((dir, name) -> name\n .endsWith(GENERAL_PROPERTIES));\n\n if (nonNull(list) && list.length > 0) {\n return list[0];\n } else if (nonNull(list)) {\n var inner = defaultConfig.listFiles();\n File result = null;\n for (File element : inner) {\n if (element.isDirectory()) {\n result = findPropertyFile(element.getPath());\n }\n if (nonNull(result)) {\n return result;\n }\n }\n }\n return null;\n }", "File getDefaultFile();", "@Override\n\tpublic File getDefaultLogFile() {\n\t\tif (SystemUtils.IS_OS_WINDOWS) {\n\t\t\tfinal File[] foundFiles = getLogDirInternal().listFiles(new FilenameFilter() {\n\t\t\t\tpublic boolean accept(File dir, String name) {\n\t\t\t\t\treturn name.startsWith(\"catalina.\");\n\t\t\t\t}\n\t\t\t});\n\t\t\tArrays.sort(foundFiles, NameFileComparator.NAME_COMPARATOR);\n\t\t\tif (foundFiles.length > 0) {\n\t\t\t\treturn foundFiles[foundFiles.length - 1];\n\t\t\t}\n\t\t}\n\t\treturn super.getDefaultLogFile();\n\t}", "public String getDefaultNamespace() {\n return defaultNamespaceUri;\n }", "protected String getStaticFilesLocation(PortletRequest request) {\n // TODO allow overriding on portlet level?\n String staticFileLocation = getPortalProperty(\n Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH,\n request.getPortalContext());\n if (staticFileLocation != null) {\n // remove trailing slash if any\n while (staticFileLocation.endsWith(\".\")) {\n staticFileLocation = staticFileLocation.substring(0,\n staticFileLocation.length() - 1);\n }\n return staticFileLocation;\n } else {\n // default for Liferay\n return \"/html\";\n }\n }", "public static String GetBaseAddress() {\n\t\t// Load Projects Settings XML file\n\t\tDocument doc = Utilities.LoadDocumentFromFilePath(IDE.projectFolderPath + \"\\\\ProjectSettings.xml\");\n\t\tString baseAddress = \"\";\n\t\tif (doc != null) {\n\t\t\t// Get all \"files\"\n\t\t\tNodeList baseAddressNode = doc.getDocumentElement().getElementsByTagName(\"baseAddress\");\n\t\t\t// Handle result\n\t\t\tif (baseAddressNode.getLength() > 0) {\n\t\t\t\tbaseAddress = Utilities.getXmlNodeAttribute(baseAddressNode.item(0), \"value\");\n\t\t\t}\n\t\t}\n\t\treturn baseAddress;\n\t}", "@Override\n public URL getTemplateLocation() {\n try {\n String[] candidates = getDirectoryCandidates();\n for (int i = 0; i < candidates.length; i++) {\n if (Activator.getDefault().getBundle().getEntry(candidates[i]) != null) {\n URL candidate = new URL(getInstallURL(), candidates[i]);\n return candidate;\n }\n }\n } catch (MalformedURLException e) { // do nothing\n }\n return null;\n }", "public static String getCommonConfigFile(String baseDir) throws Exception {\n\t\tString configFile = \"\";\n\n\t\tString commonConfig = baseDir + Constants.FILE_SEPERATOR + Constants.COMMON_CONFIG_PREFS_FILE;\n\t\tString defaultConfigFile = baseDir + Constants.FILE_SEPERATOR + Constants.SETTING_HOME + Constants.FILE_SEPERATOR\n\t\t\t\t+ Constants.COMMON_SETTINGS_XML_FILE;\n\t\tFile file = new File(commonConfig);\n\t\tif (!file.exists()) {\n\t\t\t// file not found - default path\n\t\t\tconfigFile = defaultConfigFile;\n\t\t} else {\n\t\t\tPropertyUtil propertyUtil = new PropertyUtil(commonConfig);\n\t\t\tconfigFile = propertyUtil.getProperty(Constants.COMMON_CONFIG_PREFS_KEY);\n\t\t\tif (\"\".equals(configFile)) {\n\t\t\t\tconfigFile = defaultConfigFile;\n\t\t\t} else {\n\t\t\t\tconfigFile += Constants.FILE_SEPERATOR + Constants.COMMON_SETTINGS_XML_FILE;\n\t\t\t}\n\n\t\t}\n\n\t\treturn configFile;\n\t}", "@Override\n public String getDefaultConfigName() {\n return defaultConfigFileName;\n }", "@Override\n public List<String> getCmsLocations() {\n return Collections.emptyList();\n }", "public static String getBaseURL()\r\n {\r\n String savedUrl = P.getChoreoServicesUrl();\r\n return savedUrl.length() > 0 ? savedUrl : Config.DEFAULT_SERVER_URL;\r\n }", "public String getDefaultStyleString() {\n/* 552 */ return getCOSObject().getString(COSName.DS);\n/* */ }", "static public File getLatestPlatformLocation(){\n Iterator i = serverLocationAndClassLoaderMap.entrySet().iterator();\n File ret =null;\n while (i.hasNext()){\n Map.Entry e = (Map.Entry)i.next();\n String loc = (String)e.getKey();\n File possibleOne = new File(loc);\n if (ret==null){\n ret =possibleOne;\n }\n if (isGlassFish(possibleOne)){\n ret =possibleOne;\n }\n }\n return ret;\n \n }", "public YuiImage getDefaultImg() {\r\n\t\treturn defaultImg;\r\n\t}", "public static File getPlatformDir () {\n return new File (System.getProperty (\"netbeans.home\")); // NOI18N\n }", "@Override\n\tpublic DocumentCSSStyleSheet getStyleSheet() {\n\t\tif (mergedStyleSheet == null) {\n\t\t\tmergeStyleSheets();\n\t\t}\n\t\treturn mergedStyleSheet;\n\t}", "public final String getDefaultNsURI() {\n if (mSize == 0) {\n throw new IllegalStateException(\"Illegal access, empty stack.\");\n }\n return mElements[mSize-(ENTRY_SIZE - IX_DEFAULT_NS)];\n }", "public URL getRootDirURL() {\n\t\treturn null;\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "@Override\r\n\t\tpublic String getBaseURI()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public Cache getDefaultCache() {\n return defaultCache;\n }", "public String getBaseURI(){\r\n\t\t \r\n\t\t String uri = properties.getProperty(\"baseuri\");\r\n\t\t if(uri != null) return uri;\r\n\t\t else throw new RuntimeException(\"baseuri not specified in the configuration.properties file.\");\r\n\t }", "public String getDocumentBase() {\n return getServerBase() + getContextPath() + \"/\";\n }", "private String getSpringLoginUrl() {\n if (this.springLoginUrl == null) {\n this.springLoginUrl = GWT.getHostPageBaseURL() + DEFAULT_SPRING_LOGIN_URL;\n }\n return springLoginUrl;\n }", "@Deprecated\n public Object getDefault(String path) {return defaultConfig.get(path); }", "private static String getConfigFile() {\n\n final String sPath = getUserFolder();\n\n return sPath + File.separator + \"sextante.settings\";\n\n }", "public String getDefaultImgSrc(){return \"/students/footballstudentdefault.png\";}", "public String getDefaultMarkerIcon() {\n String defaultIcon = \"\";\n for (MapInfo mapMarker : mapMarkers) {\n if (mapMarker.getMapEntityName().equalsIgnoreCase(Constants.PROJECT_LIST_DEFAULT_MAP_ICON)) {\n defaultIcon = MapUtils.getInstance().getMapElementIcon(mapMarker.getIconUrl());\n }\n }\n return defaultIcon;\n\n }", "public File getConfigFile() {\r\n\t\treturn new File(homeDir, \"tacos.config\");\r\n\t}", "abstract public String getTopResourcesDir();", "public static String getPluginsLocation() {\r\n return pluginsLocation.getValue();\r\n }", "protected File getDefaultHomeDir()\n throws AntException\n {\n if( null != m_userDir )\n {\n try \n {\n checkDirectory( m_userDir, null );\n return m_userDir;\n }\n catch( final AntException ae ) {}\n }\n\n final String os = System.getProperty( \"os.name\" );\n final File candidate = \n (new File( getSystemLocationFor( os ) )).getAbsoluteFile();\n checkDirectory( candidate, \"ant-home\" );\n return candidate;\n }", "public static String getOutputFolderName() {\n\t\treturn PropertiesFile.getSystemRoot()+PropertiesFile.getInstance().getProperty(\"default_folder\");\n\t}", "public File getConfigRoot()\r\n\t{\n\t\treturn file.getParentFile();\r\n\t}", "protected IClasspathEntry[] defaultClasspath() {\n\n\treturn new IClasspathEntry[] { JavaCore.newSourceEntry(this.project.getFullPath()) };\n }", "private String getConfigurationDirectory() throws UnsupportedEncodingException {\r\n\r\n String folder;\r\n if (ISphereJobLogExplorerPlugin.getDefault() != null) {\r\n // Executed, when started from a plug-in.\r\n folder = ISphereJobLogExplorerPlugin.getDefault().getStateLocation().toFile().getAbsolutePath() + File.separator + REPOSITORY_LOCATION\r\n + File.separator;\r\n FileHelper.ensureDirectory(folder);\r\n } else {\r\n // Executed, when started on a command line.\r\n URL url = getClass().getResource(DEFAULT_CONFIGURATION_FILE);\r\n if (url == null) {\r\n return null;\r\n }\r\n String resource = URLDecoder.decode(url.getFile(), \"utf-8\"); //$NON-NLS-1$\r\n folder = new File(resource).getParent() + File.separator;\r\n }\r\n return folder;\r\n }", "public String getResourceLocation() {\n return resourceLocation;\n }", "public final Namespace getDefaultNamespace() {\n return _defaultNamespace;\n }", "private String getRepositoryPath() {\n if (repoPath != null) {\n return repoPath;\n }\n\n final String pathProp = System.getProperty(SYSTEM_PATH_PROPERTY);\n\n if (pathProp == null || pathProp.isEmpty()) {\n repoPath = getWorkingDirectory();\n } else if (pathProp.charAt(0) == '.') {\n // relative path\n repoPath = getWorkingDirectory() + System.getProperty(\"file.separator\") + pathProp;\n } else {\n repoPath = RepoUtils.stripFileProtocol(pathProp);\n }\n\n log.info(\"Using repository path: \" + repoPath);\n return repoPath;\n }", "public Dimension getDefaultSize() {\n\t\tint width = Integer.parseInt(FileDataPersister.getInstance().get(\"gui.configuration\", \"defaultWidth\", \"600\"));\n\t\tint height = Integer.parseInt(FileDataPersister.getInstance().get(\"gui.configuration\", \"defaultHeight\", \"600\"));\n\t\treturn new Dimension(width, height);\n\t}", "public IndexType getDefaultIndexType() {\n return BlackLab.isFeatureEnabled(BlackLab.FEATURE_INTEGRATE_EXTERNAL_FILES) ?\n IndexType.INTEGRATED :\n IndexType.EXTERNAL_FILES;\n }", "public static Properties getDefaultProperties() {\r\n return getProperties(true);\r\n }", "private static SearchBoxUserRecordResources getDefaultResources() {\n if (DEFAULT_RESOURCES == null) {\n DEFAULT_RESOURCES = GWT.create(SearchBoxUserRecordResources.class);\n }\n return DEFAULT_RESOURCES;\n }", "@Override\n\tprotected NSArray<String> additionalCSSFiles() {\n\t\treturn new NSMutableArray<String>( new String[] { \"modalbox.css\" } );\n\t}", "public static String getConfigFileLocation(String propertyFilePath) {\n String fileLoc = System.getProperty(\"user.dir\") + propertyFilePath;\n return fileLoc.replace(\"/\", File.separator);\n }", "public File getGitRepoContainerDir() {\n return config.getGitReposParentDir();\n }", "public String getContentLocation() {\n\n String as[] = getMimeHeader(\"Content-Location\");\n\n if (as != null && as.length > 0) {\n return as[0];\n } else {\n return null;\n }\n }", "@Override\n\tpublic URL getBaseURL() {\n\t\tURL url = null;\n\t\tString buri = getBaseURI();\n\t\tif (buri != null) {\n\t\t\ttry {\n\t\t\t\turl = new URL(buri);\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\ttry {\n\t\t\t\t\tString docuri = document.getDocumentURI();\n\t\t\t\t\tif (docuri != null) {\n\t\t\t\t\t\tURL context = new URL(docuri);\n\t\t\t\t\t\turl = new URL(context, buri);\n\t\t\t\t\t}\n\t\t\t\t} catch (MalformedURLException e1) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}", "public String getXslFile() {\n return directory_path2;\n }", "public String getLastDocRepository() {\n return \"\";\n }", "public String getBaseStaticUrl() {\n return (String) get(\"base_static_url\");\n }", "@Override\n public String getCSSStyle() {\n return null;\n }", "public FileSystem getDefaultFileSystem () {\n return system;\n }", "public void setDefaultStylesheet() {\n\n\t\tsetAttribute(\"stylesheet\", \"node { \"\n\t\t\t//\t+ \"size: 10px;\"\n\t\t\t\t+ \"size: 10px, 10px;\"\n\t\t\t\t+ \"fill-mode: dyn-plain; \"\n\t\t\t//\t+ \"stroke-mode: plain;\"\n\t\t\t//\t+ \"stroke-color: black;\"\n\t\t\t\t+ \"stroke-mode: plain;\"\n\t\t\t\t+ \"stroke-width: 1px;\"\n\t\t\t\t+ \"text-alignment: under;\"\n\t\t\t\t+ \"} \"\n\t\t\t\t+ \"node.enzyme {\"\n\t\t\t\t+ \"shape: box;\"\n\t\t\t//\t+ \"size: 10px, 10px;\"\n\t\t\t\t+ \"text-alignment: under;\"\n\t\t\t\t+ \"fill-color: #DEE;\"\n\t\t\t\t+ \"} \"\n\t\t\t\t+ \"node.compound { \"\n\t\t\t//\t+ \"size: 10px, 10px;\"\n\t\t\t\t+ \"shape: circle;\"\n\t\t\t\t+ \"text-alignment: under;\"\n\t\t\t\t+ \"}\");\n\t}", "@Override\r\n\tpublic ResourceLocator getResourceLocator() {\r\n\t\treturn SpringConfigDslEditPlugin.INSTANCE;\r\n\t}", "String getBaseCDNPathForDocument(Document document);", "public Color getDefaultColor() {\n return defaultColor;\n }", "File findConfigFile(String path) {\n\t\tClassLoader cl = PropertiesUtil.class.getClassLoader();\n\t\tURL url = cl.getResource(path);\n\t\tif (url != null) {\n\t\t\treturn new File(url.getFile());\n\t\t}\n\n\t\turl = ClassLoader.getSystemResource(path);\n\t\tif (url != null) {\n\t\t\treturn new File(url.getFile());\n\t\t}\n\n\t\tFile file = new File(path);\n\t\tif (file.exists()) {\n\t\t\treturn file;\n\t\t}\n\n\t\tString newPath = \"conf\" + (path.startsWith(File.separator) ? \"\" : \"/\")\n\t\t\t\t+ path;\n\t\turl = ClassLoader.getSystemResource(newPath);\n\t\tif (url != null) {\n\t\t\treturn new File(url.getFile());\n\t\t}\n\n\t\turl = cl.getResource(newPath);\n\t\tif (url != null) {\n\t\t\treturn new File(url.getFile());\n\t\t}\n\n\t\tnewPath = \"conf\"\n\t\t\t\t+ (path.startsWith(File.separator) ? \"\" : File.separator)\n\t\t\t\t+ path;\n\t\tfile = new File(newPath);\n\t\tif (file.exists()) {\n\t\t\treturn file;\n\t\t}\n\n\t\tnewPath = System.getenv(\"CATALINA_HOME\");\n\t\tif (newPath == null) {\n\t\t\tnewPath = System.getenv(\"CATALINA_BASE\");\n\t\t}\n\n\t\tif (newPath == null) {\n\t\t\tnewPath = System.getProperty(\"catalina.home\");\n\t\t}\n\n\t\tif (newPath == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfile = new File(newPath + File.separator + \"conf\" + File.separator\n\t\t\t\t+ path);\n\t\tif (file.exists()) {\n\t\t\treturn file;\n\t\t}\n\n\t\treturn null;\n\t}", "public static DocumentationSettings getDefault(){\n return INSTANCE;\n }", "public static String getDefaultProperty(String key) {\n return defaults.getProperty(key);\n }", "private static File getAspectWorkspace() {\n try {\n URL url = Platform.getBundle(Activator.PLUGIN_ID).getEntry(\"resources\");\n URL resolved = FileLocator.resolve(url);\n return new File(resolved.getPath());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public final Properties getDefaultProperties() {\n \t\treturn properties;\n \t}", "public List<String> getDefaultOptionsDir() {\n return defaultOptionsDir;\n }", "public static Properties getDefaultProperties() {\n Properties json = new Properties();\n json.put(REROUTE_PROPERTY, \"true\");\n json.put(AUTO_CLEAN_PATH_PROPERTY, \"true\");\n json.put(UPLOAD_DIRECTORY_PROP, \"webroot/images/\");\n json.put(UPLOAD_RELATIVE_PATH_PROP, \"images/\");\n return json;\n }", "String fallbackBaseUrl() {\n return settings.get(FALLBACK_BASE_URL);\n }", "public static String getCommonImagePropertiesFullPath() throws IOException {\n return getImagePropertiesFullPath(COMMON_IMAGEPROP_FILEPATH);\n }", "private String searchForInitFileName() {\n String homeDirectoryInitFileName =\n System.getProperty(\"user.home\") + File.separatorChar + DEFAULT_INIT_FILE_NAME;\n String currentDirectoryInitFileName =\n System.getProperty(\"user.dir\") + File.separatorChar + DEFAULT_INIT_FILE_NAME;\n String systemPropertyInitFileName = System.getProperty(INIT_FILE_PROPERTY);\n\n String[] initFileNames =\n {systemPropertyInitFileName, currentDirectoryInitFileName, homeDirectoryInitFileName};\n\n for (String initFileName : initFileNames) {\n if (IOUtils.isExistingPathname(initFileName)) {\n return initFileName;\n }\n }\n\n return null;\n }" ]
[ "0.61377907", "0.60731274", "0.59283346", "0.57097375", "0.5528884", "0.5463841", "0.5436381", "0.5254272", "0.5239819", "0.5220789", "0.5195823", "0.51841676", "0.51092446", "0.50667083", "0.50646645", "0.5044017", "0.5007519", "0.49794745", "0.4973279", "0.49673223", "0.4963845", "0.49591124", "0.49384966", "0.49223304", "0.49172994", "0.48993623", "0.4898265", "0.48815703", "0.48680747", "0.48592752", "0.48548156", "0.48453394", "0.4841355", "0.48305336", "0.47981173", "0.47767383", "0.4773966", "0.4773209", "0.47604463", "0.4756147", "0.47490463", "0.47327423", "0.47180364", "0.47163832", "0.47073522", "0.47045434", "0.46967667", "0.46932423", "0.46632126", "0.46443275", "0.4644118", "0.4644118", "0.46424276", "0.46415", "0.46403274", "0.4637575", "0.46374798", "0.462614", "0.46182728", "0.46119604", "0.46115234", "0.46067396", "0.4605228", "0.45963272", "0.45958984", "0.45728204", "0.45721108", "0.4571962", "0.45639712", "0.456196", "0.45565596", "0.4543521", "0.45378587", "0.4533878", "0.45324618", "0.45260108", "0.45230058", "0.45228553", "0.45180845", "0.45174554", "0.4511786", "0.45096213", "0.45080152", "0.45013517", "0.44947243", "0.4492143", "0.4480063", "0.44739538", "0.44654062", "0.44646555", "0.445981", "0.44570193", "0.44560343", "0.44552574", "0.4454216", "0.44488117", "0.44478923", "0.4442682", "0.44406554", "0.44297335" ]
0.7431559
0
Sets the store epoch date. The epochDate property must follow the epochDatePattern property format.
public void setEpochDate( String pEpochDate ) { mEpochDate = pEpochDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getEpochDate() {\n return mEpochDate;\n }", "public void setEpochDatePattern( String pEpochDatePattern ) {\n mEpochDatePattern = pEpochDatePattern;\n }", "String getDate() { return epoch; }", "public Date getEpochDateAsDate() {\n if ( mEpochDateAsDate == null ) {\n SimpleDateFormat dateFormat = new SimpleDateFormat( getEpochDatePattern() );\n mEpochDateAsDate = dateFormat.parse( getEpochDate(), \n new ParsePosition(0) );\n }\n \n return mEpochDateAsDate;\n }", "public String getEpochDatePattern() {\n return mEpochDatePattern;\n }", "public void setEpochLongitude(double value) {\n this.epochLongitude = value;\n }", "public void setDate(long value) {\n this.date = value;\n }", "public PubDateFilter(long epoch) {\r\n this(epoch,false);\r\n }", "@Test\n public void getEpochDay() {\n assertEquals(MinguoDate.of(110, 5, 19), MinguoChronology.INSTANCE.dateEpochDay(18766));\n assertEquals(MinguoDate.of(59, 1, 1), MinguoChronology.INSTANCE.dateEpochDay(0));\n }", "private static long makeEpoch() {\n Calendar c = Calendar.getInstance(TimeZone.getTimeZone(\"GMT-0\"));\n c.set(Calendar.YEAR, 1582);\n c.set(Calendar.MONTH, Calendar.OCTOBER);\n c.set(Calendar.DAY_OF_MONTH, 15);\n c.set(Calendar.HOUR_OF_DAY, 0);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n c.set(Calendar.MILLISECOND, 0);\n return c.getTimeInMillis();\n }", "@Override\n public boolean isEpochCheckEnabled() {\n return false;\n }", "public Epoch createEpoch(ServerViewController recManager) {\n epochsLock.lock();\n\n Set<Integer> keys = epochs.keySet();\n\n int max = -1;\n for (int k : keys) {\n if (k > max) max = k;\n }\n\n max++;\n Epoch epoch = new Epoch(recManager, this, max);\n epochs.put(max, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "public void setDate(long date) {\r\n\t\tthis.date = new Date(date);\r\n\t}", "public void setEpochLongitudeDelta(double value) {\n this.epochLongitudeDelta = value;\n }", "private int validateEpoch (int epoch)\n throws ControlDataInvalidException\n {\n if (!(epoch >= 0)) {\n throw new ControlDataInvalidException(\n \"Epoch must be equal to or greater than 0. epoch=[\" + epoch + \"]\");\n }\n\n return epoch;\n }", "public Builder saveEveryEpoch(){\n return saveEveryNEpochs(1);\n }", "public double getEpochLongitude() {\n return epochLongitude;\n }", "public Epoch createEpoch(int timestamp, ServerViewController recManager) {\n epochsLock.lock();\n\n Epoch epoch = new Epoch(recManager, this, timestamp);\n epochs.put(timestamp, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "public void setDate(long date)\r\n/* 199: */ {\r\n/* 200:299 */ setDate(\"Date\", date);\r\n/* 201: */ }", "@Override\n public LocalDate convertToEntityAttribute(Long epochDay) {\n if (epochDay != null) {\n LocalDate date = LocalDate.ofEpochDay(epochDay);\n return date;\n }\n return null;\n }", "public Builder setDate(long value) {\n bitField0_ |= 0x00000002;\n date_ = value;\n onChanged();\n return this;\n }", "private void updateEpochNum() {\n\t\t// TODO Auto-generated method stub\n\t\tFile epCount = new File(VisualizerMain.experimentBaseLocation+\"/\"+VisualizerMain.selectedRun);\n\t\tFile[] list = epCount.listFiles();\n\t\tint count = 0;\n\t\tfor (File file : list){\n\t\t\tif (file.isDirectory())\n\t\t\t\tcount++;\n\t\t}\n\t\tSystem.out.println(\"Folder Count: \" + count);\n\t\tmaxEpoch = count-1;\n\t\tSpinnerNumberModel model1 = new SpinnerNumberModel(((Number)epochSelector.getValue()).intValue(), minEpoch, maxEpoch, 1); \n\t\tepochSelector.setModel(model1);\n\t}", "public PubDateFilter(long epoch, boolean after) {\r\n this.epoch = epoch;\r\n this.after = after;\r\n }", "@Override\n public void eventEpoch(int eventNum, int val, long epoch) {\n }", "public Builder setOneof1970(int value) {\n hugeOneofCase_ = 1970;\n hugeOneof_ = value;\n onChanged();\n return this;\n }", "private void setDate() {\n\t\tthis.date = Integer.parseInt(this.year + String.format(\"%02d\", this.calenderWeek));\n\n\t}", "public void setDate(long date) {\n\t\tthis.date = date;\n\t}", "public Builder setField1970(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n field1970_ = value;\n onChanged();\n return this;\n }", "public com.luisjrz96.streaming.birthsgenerator.models.BirthInfo.Builder setDate(long value) {\n validate(fields()[5], value);\n this.date = value;\n fieldSetFlags()[5] = true;\n return this;\n }", "public static long dateFormatedToEpoch(String dateFormated) {\r\n String dateDeb = String.valueOf(dateFormated);\r\n // The mask\r\n DateFormat dF = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateDeb);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n long epoch = date.getTime();\r\n return epoch;\r\n }", "public double getEpochLongitudeDelta() {\n return epochLongitudeDelta;\n }", "public Builder setField1970Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1970_ = value;\n onChanged();\n return this;\n }", "private long getPeerEpoch() {\n if (self.getLearnerType() == LearnerType.PARTICIPANT) {\n try {\n return self.getCurrentEpoch();\n } catch (IOException e) {\n RuntimeException re = new RuntimeException(e.getMessage());\n re.setStackTrace(e.getStackTrace());\n throw re;\n }\n } else {\n return Long.MIN_VALUE;\n }\n }", "public Epoch(Parcel in){\n name = in.readString();\n init = (Calendar)in.readSerializable();\n end = (Calendar)in.readSerializable();\n id = in.readInt();\n }", "public Epoch getEpoch(int timestamp, boolean create, ServerViewController controller) {\n epochsLock.lock();\n\n Epoch epoch = epochs.get(timestamp);\n if(epoch == null && create){\n epoch = new Epoch(controller, this, timestamp);\n epochs.put(timestamp, epoch);\n }\n\n epochsLock.unlock();\n\n return epoch;\n }", "public int getDaysSinceStartOfEpoch() {\r\n long millis = new GregorianCalendar(year, month - 1, day).getTimeInMillis();\r\n return (int) (millis / MILLIS_PER_DAY);\r\n\r\n }", "public void setLoadDate(Date value) {\n setAttributeInternal(LOADDATE, value);\n }", "public Builder setExpirationDate(long value) {\n\n expirationDate_ = value;\n bitField0_ |= 0x00000020;\n onChanged();\n return this;\n }", "public static String fetchGraphDate(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\").format(new Date(epoch));\n\t}", "public Epoch getEpoch(int timestamp, ServerViewController controller) {\n return getEpoch(timestamp,true, controller);\n }", "public static String fetchGraphDate11(int epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\", Locale.US).format(new Date(epoch));\n\t}", "public static long getSecondsSinceEpoch() {\n return System.currentTimeMillis() / 1000L;\n }", "@Override\n public Builder epochs(int numEpochs) {\n super.epochs(numEpochs);\n return this;\n }", "public void setDate( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), DATE, value);\r\n\t}", "private void setDeltaDate(long deltaDate) {\n\t\tthis.deltaDate = deltaDate;\n\t}", "public static void setDate( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, DATE, value);\r\n\t}", "public boolean validateEpoch(CorfuMsg msg, ChannelHandlerContext ctx) {\n long serverEpoch = getServerEpoch();\n if (!msg.getMsgType().ignoreEpoch && msg.getEpoch() != serverEpoch) {\n sendResponse(ctx, msg, new CorfuPayloadMsg<>(CorfuMsgType.WRONG_EPOCH,\n serverEpoch));\n log.trace(\"Incoming message with wrong epoch, got {}, expected {}, message was: {}\",\n msg.getEpoch(), serverEpoch, msg);\n return false;\n }\n return true;\n }", "public void setRecordingDate( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), RECORDINGDATE, value);\r\n\t}", "public Builder saveEveryNEpochs(int n){\n this.saveEveryNEpochs = n;\n return this;\n }", "public abstract void setDate(Timestamp uneDate);", "public Builder setCreationDate(long value) {\n\n creationDate_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "public Builder setExpirationDate(long value) {\n bitField0_ |= 0x00000200;\n expirationDate_ = value;\n\n return this;\n }", "public void setDate(String date) {\n while (!date.endsWith(\"00\")){\n date+=\"0\";\n }\n try{\n this.date = FORMATTER.parse(date.trim());\n }catch (ParseException e){\n throw new RuntimeException(e);\n }\n\n }", "public static void setRecordingDate( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, RECORDINGDATE, value);\r\n\t}", "public void setDate() {\n this.date = new Date();\n }", "public Value(long millis) throws IllegalArgumentException {\n\n // Check preconditions\n if (millis < 0L) {\n throw new IllegalArgumentException(\"millis (\" + millis + \" < 0L\");\n }\n\n // Convert the number of milliseconds to a Date object\n java.util.Date date = new java.util.Date(millis);\n\n // Construct the Calendar\n _calendar = Calendar.getInstance();\n _calendar.setTime(date);\n }", "public Builder setCreationDate(long value) {\n \n creationDate_ = value;\n onChanged();\n return this;\n }", "@Override\n\t\t\tpublic void setValue(Date value) {\n\t\t\t\tsuper.setValue(value);\n\t\t\t\tstart_cal_date = value.getTime();\n\t\t\t\tinfo_loader.load();\n\t\t\t}", "void setDate(Date data);", "public Epoch getLastEpoch() {\n epochsLock.lock();\n if (epochs.isEmpty()) {\n epochsLock.unlock();\n return null;\n }\n //Epoch epoch = epochs.get(epochs.size() - 1);\n Epoch epoch = epochs.get(ets); // the last epoch corresponds to the current ETS\n epochsLock.unlock();\n return epoch;\n }", "public void setLastRenewedDate(Date lrd) { lastRenewedDate = lrd; }", "public void setDate(String eDate) {\n\t\tmDate = eDate;\n\t}", "public double getMaxNumberOfEpochs() {\n return maxNumberOfEpochs;\n }", "@Override\n\tpublic void setCheckpoint(java.util.Date checkpoint) {\n\t\t_userSync.setCheckpoint(checkpoint);\n\t}", "@Test\r\n\tpublic void testSetDate() {\n\t\tfail(\"Not yet implemented\");\r\n\t}", "public void SetDate(Date date);", "public void setLastModifiedDate(Long lastModifiedDate)\r\n\t{\r\n\t\tthis.lastModifiedDate = lastModifiedDate;\r\n\t}", "@Override\n\tprotected void setNextSiegeDate()\n\t{\n\t\tif(_siegeDate.getTimeInMillis() < Calendar.getInstance().getTimeInMillis())\n\t\t{\n\t\t\t_siegeDate = Calendar.getInstance();\n\t\t\t// Осада не чаще, чем каждые 4 часа + 1 час на подготовку.\n\t\t\tif(Calendar.getInstance().getTimeInMillis() - getSiegeUnit().getLastSiegeDate() * 1000L > 14400000)\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 1);\n\t\t\telse\n\t\t\t{\n\t\t\t\t_siegeDate.setTimeInMillis(getSiegeUnit().getLastSiegeDate() * 1000L);\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 5);\n\t\t\t}\n\t\t\t_database.saveSiegeDate();\n\t\t}\n\t}", "public void setDate(int date){\n this.date = date;\n }", "public static String notificationepochToDate(long epoch)\n\t{\n\t\ttry {\n\t\t\t if(epoch==0){\n\t\t\t \treturn \"\";\n\t\t\t }\n\t\t\tString Date1 = \"\";\n\t\t\tString Time1 = \"\";\n\t\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tSimpleDateFormat dateFormatGmt1 = new SimpleDateFormat(\"dd-MMM-yyyy\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\tDate1 = dateFormatGmt1.format(epoch);\n\t\t\tTime1 = dateFormatGmt.format(epoch);\n\t\t\treturn Date1 + \" \"\n\t\t\t\t\t+ Time1;/*new SimpleDateFormat(\"dd-MMM-yyyy hh:mm:ss a\",Locale.getDefault()).format(calendar.getTime())*/\n\t\t}\n\t\tcatch (Exception e){\n\t\t\treturn \"\";\n\t\t}\n\t\t/*\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\treturn dateFormatGmt.format(epoch);*/\n\t}", "@PrePersist\n protected void onPersist() {\n this.data = LocalDate.now();\n }", "public void setRunDate(Date runDate) {\n this.runDate = runDate;\n Calendar calendar = new GregorianCalendar();\n calendar.setTime(runDate);\n year = calendar.get(Calendar.YEAR);\n month = calendar.get(Calendar.MONTH);\n }", "@TypeConverter\n public Date toDate(long l){\n return new Date(l);\n }", "public void setLast_seen(Date last_seen) {\n this.last_seen = last_seen;\n }", "@Override\n\tprotected void setDate() {\n\n\t}", "public void setsaledate(Timestamp value) {\n setAttributeInternal(SALEDATE, value);\n }", "public static void setDate(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.util.Calendar value) {\r\n\t\tBase.set(model, instanceResource, DATE, value);\r\n\t}", "public static void main(String[] args) {\n\t\tLocalDate localDate = LocalDate.now();\n\t\tlong epochDay = localDate.toEpochDay();\n\t\tSystem.out.println(epochDay);\n\t\t//\n\n\t\tLocalDateTime ldt = LocalDateTime.now();\n\t\tlong epochSecond = ldt.toEpochSecond(ZoneOffset.UTC);\n\t\tSystem.out.println(epochSecond);\n\n\t}", "public void setDate(int dt) {\n date = dt;\n }", "@Override\n\tpublic void setLastSavePoint(java.util.Date lastSavePoint) {\n\t\t_keHoachKiemDemNuoc.setLastSavePoint(lastSavePoint);\n\t}", "public void setInstallDate() {\n if (PrefUtils.getInstallDate(mContext) == 0) {\n //getting the current time in milliseconds, and creating a Date object from it:\n Date date = new Date(System.currentTimeMillis()); //or simply new Date();\n long millis = date.getTime();\n PrefUtils.setInstallDate(millis, mContext);\n }\n }", "Employee setBirthdate(Date birthdate);", "void setLastLogin(Date lastLogin);", "public static String epochToDateTime(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"dd-MM-yyyy hh:mm a\").format(new Date(epoch));\n\t}", "public void setExpiryDate(SIPDateOrDeltaSeconds e) {\n expiryDate = e ;\n }", "public void setTimestamp(long value) {\r\n this.timestamp = value;\r\n }", "@JsonIgnore\n @DynamoDBAttribute(attributeName=\"createdAt\")\n public void setCreatedAtDD(Long value) {\n setCreatedAt(new Date(value));\n }", "void setCreationDate(Date val)\n throws RemoteException;", "public void setRealCheckDate(Date realCheckDate) {\n this.realCheckDate = realCheckDate;\n }", "public static long nowEpochMilli() {\n\n return\n ZonedDateTime\n .now(\n UTC)\n .toInstant()\n .toEpochMilli();\n\n }", "void setDate(java.lang.String date);", "public void setEnrolDate(Date enrolDate) {\n this.enrolDate = enrolDate;\n }", "public void setEditionDate(Calendar editionDate) throws BadParametersException {\n\t\tif (editionDate == null)\n\t\t\tthrow new BadParametersException();\n\t\t\n\t\tthis.editionDate = editionDate;\n\t}", "public void setDateDoc (Timestamp DateDoc);", "public void setDateDoc (Timestamp DateDoc);", "public void setDateDoc (Timestamp DateDoc);", "public Builder setEndDate(long value) {\n \n endDate_ = value;\n onChanged();\n return this;\n }", "void setFetchedDate(long time);", "public void setSentinel () {\n try {\n sentinel = new DateSentinel(this);\n }\n catch (CGException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\n public void playStart(long epoch) {\n }" ]
[ "0.71228033", "0.68441814", "0.66339815", "0.6545384", "0.6378003", "0.61734056", "0.58793676", "0.58679944", "0.58565235", "0.5775789", "0.5768164", "0.57426924", "0.5680984", "0.56523454", "0.5616766", "0.55866647", "0.5584218", "0.55745643", "0.55082226", "0.54363847", "0.53948736", "0.5378404", "0.535562", "0.5310858", "0.5301241", "0.5279656", "0.52078646", "0.51938933", "0.51354605", "0.51115763", "0.50601435", "0.50464576", "0.49795502", "0.49633944", "0.49630505", "0.49570814", "0.49416888", "0.49155346", "0.48983824", "0.48892546", "0.4881738", "0.48761818", "0.48590618", "0.48561242", "0.48470077", "0.48450705", "0.4844862", "0.4837546", "0.48268217", "0.4823744", "0.4812594", "0.4810076", "0.48099905", "0.47872582", "0.4784773", "0.47734147", "0.47567323", "0.47515553", "0.47447294", "0.47215262", "0.47057813", "0.46955562", "0.46947575", "0.46922338", "0.46854827", "0.46739087", "0.46684113", "0.4668193", "0.46657228", "0.46644402", "0.46554026", "0.46515614", "0.46304557", "0.4626708", "0.46218798", "0.46096778", "0.45986918", "0.45950767", "0.4592963", "0.45900387", "0.4587979", "0.4587829", "0.4586462", "0.45862535", "0.4578528", "0.4577944", "0.4560078", "0.45507118", "0.45491964", "0.45397648", "0.45357436", "0.45353556", "0.45346475", "0.45327556", "0.45327556", "0.45327556", "0.45321888", "0.45295194", "0.45277396", "0.45170152" ]
0.7830946
0
Returns the store epoch date represented as a String object.
public String getEpochDate() { return mEpochDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getDate() { return epoch; }", "public Date getEpochDateAsDate() {\n if ( mEpochDateAsDate == null ) {\n SimpleDateFormat dateFormat = new SimpleDateFormat( getEpochDatePattern() );\n mEpochDateAsDate = dateFormat.parse( getEpochDate(), \n new ParsePosition(0) );\n }\n \n return mEpochDateAsDate;\n }", "private static long makeEpoch() {\n Calendar c = Calendar.getInstance(TimeZone.getTimeZone(\"GMT-0\"));\n c.set(Calendar.YEAR, 1582);\n c.set(Calendar.MONTH, Calendar.OCTOBER);\n c.set(Calendar.DAY_OF_MONTH, 15);\n c.set(Calendar.HOUR_OF_DAY, 0);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n c.set(Calendar.MILLISECOND, 0);\n return c.getTimeInMillis();\n }", "public static String fetchGraphDate(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\").format(new Date(epoch));\n\t}", "long getDate();", "public String getDataNastereString(){\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\tString sd = df.format(new Date(data_nastere.getTime()));\n\t\treturn sd;\n\t\t\n\t}", "public static String fetchGraphDate11(int epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\", Locale.US).format(new Date(epoch));\n\t}", "public void setEpochDate( String pEpochDate ) {\n mEpochDate = pEpochDate;\n }", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "String getDate();", "String getDate();", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "java.lang.String getDate();", "public static long getSecondsSinceEpoch() {\n return System.currentTimeMillis() / 1000L;\n }", "public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }", "public static String notificationepochToDate(long epoch)\n\t{\n\t\ttry {\n\t\t\t if(epoch==0){\n\t\t\t \treturn \"\";\n\t\t\t }\n\t\t\tString Date1 = \"\";\n\t\t\tString Time1 = \"\";\n\t\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tSimpleDateFormat dateFormatGmt1 = new SimpleDateFormat(\"dd-MMM-yyyy\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\tDate1 = dateFormatGmt1.format(epoch);\n\t\t\tTime1 = dateFormatGmt.format(epoch);\n\t\t\treturn Date1 + \" \"\n\t\t\t\t\t+ Time1;/*new SimpleDateFormat(\"dd-MMM-yyyy hh:mm:ss a\",Locale.getDefault()).format(calendar.getTime())*/\n\t\t}\n\t\tcatch (Exception e){\n\t\t\treturn \"\";\n\t\t}\n\t\t/*\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\treturn dateFormatGmt.format(epoch);*/\n\t}", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "public static String getDate() {\n return getDate(System.currentTimeMillis());\n }", "@Test\n public void getEpochDay() {\n assertEquals(MinguoDate.of(110, 5, 19), MinguoChronology.INSTANCE.dateEpochDay(18766));\n assertEquals(MinguoDate.of(59, 1, 1), MinguoChronology.INSTANCE.dateEpochDay(0));\n }", "public String getSystemDate() {\n\t\tDate date = new Date();\n\t\treturn date.toString();\n\t}", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public static String epochToDateTime(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"dd-MM-yyyy hh:mm a\").format(new Date(epoch));\n\t}", "public String getTime() {\n Date date = new Date();\n return (date.toString());\n }", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "public String getEpochDatePattern() {\n return mEpochDatePattern;\n }", "Long timestamp();", "public static String getSystemDate()\n {\n\t DateFormat dateFormat= new SimpleDateFormat(\"_ddMMyyyy_HHmmss\");\n\t Date date = new Date();\n\t return dateFormat.format(date);\n }", "public static String getDateId() {\n Date date = new Date();\n String dateFormatStyle = \"yy-MM-dd-HH-mm-ss\";\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStyle);\n String dateFormat = sdf.format(date);\n String[] formatedDate = dateFormat.split(\"-\");\n int i = 0;\n String year = formatedDate[i];\n String month = formatedDate[++i];\n String cDate = formatedDate[++i];\n String hour = formatedDate[++i];\n String minute = formatedDate[++i];\n String second = formatedDate[++i];\n return alphanum[Integer.parseInt(year)]\n .concat(alphanum[Integer.parseInt(month)])\n .concat(alphanum[Integer.parseInt(cDate)])\n .concat(alphanum[Integer.parseInt(hour)])\n .concat(alphanum[Integer.parseInt(minute)])\n .concat(alphanum[Integer.parseInt(second)]);\n }", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "public java.lang.String getField1970() {\n java.lang.Object ref = field1970_;\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 field1970_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public long getDate() {\n return date;\n }", "java.lang.String getTime();", "public double getEpochLongitude() {\n return epochLongitude;\n }", "public long getDate() {\n return date;\n }", "public static String getTimeStamp() {\n\t\tDate date = new Date();\n\t\treturn date.toString().replaceAll(\":\", \"_\").replaceAll(\" \", \"_\");\n\n\t}", "public String getUserDateString() {\n\t\tString[] tmpArr = this.getUserDate();\n\t\tString year = tmpArr[0];\n\t\tString month = tmpArr[1];\n\t\tString day = tmpArr[2];\n\t\tString out = year + \"/\" + month + \"/\" + day;\n\t\treturn out;\n\t}", "public static long dateFormatedToEpoch(String dateFormated) {\r\n String dateDeb = String.valueOf(dateFormated);\r\n // The mask\r\n DateFormat dF = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateDeb);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n long epoch = date.getTime();\r\n return epoch;\r\n }", "public static long nowEpochMilli() {\n\n return\n ZonedDateTime\n .now(\n UTC)\n .toInstant()\n .toEpochMilli();\n\n }", "public long getCurrentDate() {\n\t\treturn LocalDate.now().atStartOfDay(ZONE).toInstant().toEpochMilli();\n\t}", "public String getDateString() {\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH); // month is stored from 0-11 so adjust +1 for final display\n int day_of_month = date.get(Calendar.DAY_OF_MONTH);\n return String.valueOf(month + 1) + '/' + String.valueOf(day_of_month) + '/' + year;\n }", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public java.lang.String getField1970() {\n java.lang.Object ref = field1970_;\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 field1970_ = s;\n return s;\n }\n }", "public static String longToStringDate(long l)\r\n/* 212: */ {\r\n/* 213:293 */ SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n/* 214:294 */ String date = sdf.format(new Date(l * 1000L));\r\n/* 215:295 */ return date;\r\n/* 216: */ }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "String getTimestamp();", "String getTimestamp();", "public String getDate(){\n\t\treturn toString();\n\t}", "public long getDate() {\n\t\treturn date;\n\t}", "public long getDate() {\n\t\treturn date;\n\t}", "public static String getTimestamp() {\r\n\t\t\r\n\t\treturn new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t}", "public static int getNowDate() {\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyMMdd\");\n\t\treturn Integer.parseInt(dateFormat.format(new Date()));\n\t}", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "public long getTimeStampL() {\n\t\treturn Long.parseLong(timeStamp);\n\t}", "public String getDateSaved()\n {\n return dateSaved;\n }", "public static long getDayNumber() {\n return getSecondsSinceEpoch() / SECS_TO_DAYS;\n }", "private String getTimestamp() {\n return Calendar.getInstance().getTime().toString();\n }", "private String getDateFromLong(Long msec) {\n DateFormat df = DateFormat.getDateTimeInstance();\n return df.format(new Date(msec));\n }", "public long getTimeStamp() {\n return 1370918376296L;\n }", "public String generateTimeStamp() {\t\t\r\n\t\t\tCalendar now = Calendar.getInstance();\r\n\t\t\tint year = now.get(Calendar.YEAR);\r\n\t\t\tint month = now.get(Calendar.MONTH) + 1;\r\n\t\t\tint day = now.get(Calendar.DATE);\r\n\t\t\tint hour = now.get(Calendar.HOUR_OF_DAY); // 24 hour format\r\n\t\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\t\tint second = now.get(Calendar.SECOND);\r\n\t\t\t\r\n\t\t\tString date = new Integer(year).toString() + \"y\";\r\n\t\t\t\r\n\t\t\tif(month<10)date = date + \"0\"; // zero padding single digit months to aid sorting.\r\n\t\t\tdate = date + new Integer(month).toString() + \"m\"; \r\n\r\n\t\t\tif(day<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(day).toString() + \"d\";\r\n\r\n\t\t\tif(hour<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(hour).toString() + \"_\"; \r\n\r\n\t\t\tif(minute<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(minute).toString() + \"_\"; \r\n\r\n\t\t\tif(second<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(second).toString() + \"x\";\r\n\t\t\t\r\n\t\t\t// add the random number just to be sure we avoid name collisions\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tdate = date + rand.nextInt(1000);\r\n\t\t\treturn date;\r\n\t\t}", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "java.lang.String getTimestamp();", "java.lang.String getTimestamp();", "public long getDate() {\n return date_;\n }", "public static String getTimeString() {\n\t\treturn getTimeString(time);\n\t}", "public String getSystemdatum() {\n\t\treturn systemdatum;\n\t}", "public static String getTimestamp() {\n\t\tCalendar cal = Calendar.getInstance();\n\t\t//define the format of time stamp\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\treturn sdf.format(cal.getTime());\n\n\t}", "public long getTime() {\n\t\treturn date.getTime();\n }", "public String Get_date() \n {\n \n return date;\n }", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "public String dateToString() {\n\t\treturn new String(year + \"/\"\n\t\t\t\t+ month + \"/\"\n\t\t\t\t+ day);\n }", "@Override\n public String save_toString() {\n return \"D | \" + super.save_toString() + \"| \" + date;\n }", "public static long longTimestamp() {\n return now().getTime();\n }", "public String getTimeStamp()\n\t{\n\t\tString timeStamp = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(Calendar.getInstance().getTime());\n\t\treturn timeStamp; \n\t}", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "public String getTime() {\n\t}", "public String getDataNascimentoString() {\r\n\r\n\t\tSimpleDateFormat data = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t\treturn data.format(this.dataNascimento.getTime());\r\n\r\n\t}", "public final String get_mode_timestamp_as_string () {\n\t\treturn SimpleUtils.time_raw_and_string (mode_timestamp);\n\t}", "public static String getLog14Date(){\r\n return TIMESTAMP14ISO8601Z.get().format(new Date());\r\n }", "public Epoch getLastEpoch() {\n epochsLock.lock();\n if (epochs.isEmpty()) {\n epochsLock.unlock();\n return null;\n }\n //Epoch epoch = epochs.get(epochs.size() - 1);\n Epoch epoch = epochs.get(ets); // the last epoch corresponds to the current ETS\n epochsLock.unlock();\n return epoch;\n }", "public static String dateToString(long date) {\n return DATE_FORMAT.format(date);\n }", "public long getDate() {\n return date_;\n }", "public static String timestamp() {\n\t\tString t = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\").format(new Date());\n\t\t// File f=new\n\t\t// File(String.format(\"%s.%s\",t,RandomStringUtils.randomAlphanumeric(8)));\n\t\tSystem.out.println(\"Time is :\" + t);\n\t\treturn t;\n\t}", "public String getDate()\n {\n return day + \"/\" + month + \"/\" + year;\n }", "public String getTimeKML() {\r\n if (timeKML==null) return \"\";\r\n return timeKML;\r\n }", "public String toString() {\n if(getPersistedAttribute().getDatevalue() == null) {\n return \"null\";\n }\n return DateUtil.formatRfc3339Calendar(getValue());\n }", "java.lang.String getFoundingDate();", "public static String now() {\n\t\t\treturn fromCalendar(GregorianCalendar.getInstance());\n\t\t}", "public static String now() {\n // TODO: move this method to DateUtils\n return fromCalendar(GregorianCalendar.getInstance());\n }", "public static void main(String[] args) {\n\t\tLocalDate localDate = LocalDate.now();\n\t\tlong epochDay = localDate.toEpochDay();\n\t\tSystem.out.println(epochDay);\n\t\t//\n\n\t\tLocalDateTime ldt = LocalDateTime.now();\n\t\tlong epochSecond = ldt.toEpochSecond(ZoneOffset.UTC);\n\t\tSystem.out.println(epochSecond);\n\n\t}", "Date getTimeStamp();", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "public int getDateAsNumber(){\n\t\tSimpleDateFormat f = new SimpleDateFormat(\"yyyyMMdd\");\n\t\treturn Integer.parseInt(f.format(date.get()));\n\t}", "@Override\n\tpublic java.util.Date getLastSavePoint() {\n\t\treturn _keHoachKiemDemNuoc.getLastSavePoint();\n\t}", "public String getTimeStamp() {\n return new SimpleDateFormat(\"dd.MM.yyyy HH.mm.ss\").format(new Date());\n }", "private long makeTimestamp() {\n return new Date().getTime();\n }", "public static final long getTimeStem() {\n\t\tlong unix_time = Instant.now().getEpochSecond();\n\t\treturn unix_time;\n\t}", "public String getNow() {\n\t\treturn new Date().toString();\n\t}" ]
[ "0.79494256", "0.6556745", "0.6223795", "0.621902", "0.6057662", "0.5893859", "0.5859103", "0.5857407", "0.5842112", "0.58055204", "0.58055204", "0.5773712", "0.57657874", "0.57236856", "0.57151943", "0.57126564", "0.56998736", "0.5647415", "0.5635377", "0.557787", "0.5572299", "0.5553868", "0.5550442", "0.55299354", "0.5515035", "0.5513175", "0.5485201", "0.5467155", "0.54616606", "0.54515016", "0.54189026", "0.5414474", "0.54017115", "0.53945845", "0.5379663", "0.5373806", "0.53729266", "0.53691244", "0.5368862", "0.5363905", "0.53535986", "0.5351004", "0.53479946", "0.5335782", "0.5335404", "0.5334338", "0.5334338", "0.5329682", "0.5326061", "0.5326061", "0.53228724", "0.52930343", "0.52778536", "0.52778536", "0.52748036", "0.52623194", "0.5260963", "0.5260731", "0.52399105", "0.523697", "0.52364475", "0.5221702", "0.5218043", "0.51891214", "0.51891214", "0.5178585", "0.5176787", "0.51692295", "0.51654005", "0.5150504", "0.51470876", "0.5142224", "0.51417214", "0.5141426", "0.51328105", "0.5132234", "0.51267684", "0.51240647", "0.5123111", "0.51223826", "0.5113179", "0.51122886", "0.51118034", "0.51044726", "0.5099599", "0.5097843", "0.50929415", "0.50923795", "0.50840926", "0.507617", "0.50747776", "0.50723743", "0.50705284", "0.50676334", "0.50669104", "0.50650007", "0.5064255", "0.5062869", "0.5060403", "0.50580096" ]
0.7392802
1
Sets the date pattern defining the date format for the epochDate property. The epochDate property must follow the epochDatePattern property format.
public void setEpochDatePattern( String pEpochDatePattern ) { mEpochDatePattern = pEpochDatePattern; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getEpochDatePattern() {\n return mEpochDatePattern;\n }", "public void setEpochDate( String pEpochDate ) {\n mEpochDate = pEpochDate;\n }", "public void setDatePattern(String datePattern)\r\n\t{\r\n\t\tthis.datePattern = datePattern;\r\n\t}", "public ValidatorFactory setDateFormat(String pattern) {\n this.datePattern = pattern == null ? null : new SimpleDateFormat(pattern).toPattern();\n return this;\n }", "public Date getEpochDateAsDate() {\n if ( mEpochDateAsDate == null ) {\n SimpleDateFormat dateFormat = new SimpleDateFormat( getEpochDatePattern() );\n mEpochDateAsDate = dateFormat.parse( getEpochDate(), \n new ParsePosition(0) );\n }\n \n return mEpochDateAsDate;\n }", "public String getEpochDate() {\n return mEpochDate;\n }", "public PubDateFilter(long epoch) {\r\n this(epoch,false);\r\n }", "public String getDatePattern()\r\n\t{\r\n\t\treturn datePattern;\r\n\t}", "@Override\n public boolean isEpochCheckEnabled() {\n return false;\n }", "public static String getDatePattern() {\n\t\treturn DATE_PATTERN;\n\t}", "public ValidatorFactory setIntegerFormat(String pattern) {\n this.integerPattern = pattern == null ? null : new DecimalFormat(pattern).toPattern();\n return this;\n }", "public DateGraphFormat(String pattern){\n\t((SimpleDateFormat) dateFormat).applyPattern(pattern);\n }", "public ValidatorFactory setDecimalFormat(String pattern) {\n this.decimalPattern = pattern == null ? null : new DecimalFormat(pattern).toPattern();\n return this;\n }", "String getDate() { return epoch; }", "@Test\n public void getEpochDay() {\n assertEquals(MinguoDate.of(110, 5, 19), MinguoChronology.INSTANCE.dateEpochDay(18766));\n assertEquals(MinguoDate.of(59, 1, 1), MinguoChronology.INSTANCE.dateEpochDay(0));\n }", "public SimpleDateFormat(final String pattern) {\n\t\tthis(pattern, null, null, null, null, true, null);\n\t}", "public void setEpochLongitude(double value) {\n this.epochLongitude = value;\n }", "public void setTooltipDatePattern(String pattern) {\r\n calendarTable.setTooltipDatePattern(pattern);\r\n }", "public void setTimestampFormatPattern(String timestampFormatPattern) {\r\n this.timestampFormatPattern = timestampFormatPattern;\r\n }", "private void setDate() {\n\t\tthis.date = Integer.parseInt(this.year + String.format(\"%02d\", this.calenderWeek));\n\n\t}", "private void updateEpochNum() {\n\t\t// TODO Auto-generated method stub\n\t\tFile epCount = new File(VisualizerMain.experimentBaseLocation+\"/\"+VisualizerMain.selectedRun);\n\t\tFile[] list = epCount.listFiles();\n\t\tint count = 0;\n\t\tfor (File file : list){\n\t\t\tif (file.isDirectory())\n\t\t\t\tcount++;\n\t\t}\n\t\tSystem.out.println(\"Folder Count: \" + count);\n\t\tmaxEpoch = count-1;\n\t\tSpinnerNumberModel model1 = new SpinnerNumberModel(((Number)epochSelector.getValue()).intValue(), minEpoch, maxEpoch, 1); \n\t\tepochSelector.setModel(model1);\n\t}", "public static long dateFormatedToEpoch(String dateFormated) {\r\n String dateDeb = String.valueOf(dateFormated);\r\n // The mask\r\n DateFormat dF = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateDeb);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n long epoch = date.getTime();\r\n return epoch;\r\n }", "public static void setDate( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, DATE, value);\r\n\t}", "public ElementDefinitionDt setPattern(IDatatype theValue) {\n\t\tmyPattern = theValue;\n\t\treturn this;\n\t}", "public void setEpochLongitudeDelta(double value) {\n this.epochLongitudeDelta = value;\n }", "@Override\n public LocalDate convertToEntityAttribute(Long epochDay) {\n if (epochDay != null) {\n LocalDate date = LocalDate.ofEpochDay(epochDay);\n return date;\n }\n return null;\n }", "public void setPattern(Pattern pattern) {\n this.pattern = pattern;\n }", "public void setDateFormats(String dateFormats)\n {\n this.dateFormats = dateFormats;\n }", "public void setDate(long value) {\n this.date = value;\n }", "public void setDate( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), DATE, value);\r\n\t}", "public void setDayDate(Number value) {\n setAttributeInternal(DAYDATE, value);\n }", "public static void setDate(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.util.Calendar value) {\r\n\t\tBase.set(model, instanceResource, DATE, value);\r\n\t}", "public void setPattern(String pPattern) {\n pattern = Pattern.compile(pPattern);\n }", "public void setDataFormatPattern(String dataFormatPattern) {\r\n this.dataFormatPattern = dataFormatPattern;\r\n }", "public void setDate(String date) {\n while (!date.endsWith(\"00\")){\n date+=\"0\";\n }\n try{\n this.date = FORMATTER.parse(date.trim());\n }catch (ParseException e){\n throw new RuntimeException(e);\n }\n\n }", "public PubDateFilter(long epoch, boolean after) {\r\n this.epoch = epoch;\r\n this.after = after;\r\n }", "public GlobFileSet setDirectoryPattern(String pattern)\n\t\t{\n\t\tm_dirPattern = Pattern.compile(pattern);\n\t\treturn (this);\n\t\t}", "@Test public void Day_1__month__year()\t\t\t\t\t\t\t{tst_date_(\"03-31-02\"\t\t\t\t, \"2002-03-31\");}", "public final void mRULE_DATE() throws RecognitionException {\n try {\n int _type = RULE_DATE;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../com.pellcorp.mydsl/src-gen/com/pellcorp/mydsl/parser/antlr/internal/InternalMyDsl.g:657:11: ( '0' .. '9' '0' .. '9' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9' )\n // ../com.pellcorp.mydsl/src-gen/com/pellcorp/mydsl/parser/antlr/internal/InternalMyDsl.g:657:13: '0' .. '9' '0' .. '9' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9'\n {\n matchRange('0','9'); \n matchRange('0','9'); \n matchRange('0','9'); \n matchRange('0','9'); \n match('-'); \n matchRange('0','9'); \n matchRange('0','9'); \n match('-'); \n matchRange('0','9'); \n matchRange('0','9'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Override\n\tpublic void initDate() {\n\n\t}", "private void initDates() throws RIFCSException {\n NodeList nl = super.getElements(Constants.ELEMENT_DATE);\n\n for (int i = 0; i < nl.getLength(); i++) {\n dates.add(new DateWithTypeDateFormat(nl.item(i)));\n }\n }", "public void setDate(String newDate)throws Exception{\n\t\t\n\t\tif (Pattern.matches(\"\\\\d\\\\d/\\\\d\\\\d/\\\\d\\\\d\\\\d\\\\d\", newDate)){\n\t\t\tthis.date = newDate;\n\t\t\toverWriteLine(\"Date\", newDate);\n\t\t}\n\t\n\t}", "public void makeValidDate() {\n\t\tdouble jd = swe_julday(this.year, this.month, this.day, this.hour, SE_GREG_CAL);\n\t\tIDate dt = swe_revjul(jd, SE_GREG_CAL);\n\t\tthis.year = dt.year;\n\t\tthis.month = dt.month;\n\t\tthis.day = dt.day;\n\t\tthis.hour = dt.hour;\n\t}", "public void setPattern(String pattern) {\r\n\t\tthis.pattern = pattern;\r\n\t}", "public static String fetchGraphDate11(int epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\", Locale.US).format(new Date(epoch));\n\t}", "public Builder setDate(long value) {\n bitField0_ |= 0x00000002;\n date_ = value;\n onChanged();\n return this;\n }", "public Epoch createEpoch(ServerViewController recManager) {\n epochsLock.lock();\n\n Set<Integer> keys = epochs.keySet();\n\n int max = -1;\n for (int k : keys) {\n if (k > max) max = k;\n }\n\n max++;\n Epoch epoch = new Epoch(recManager, this, max);\n epochs.put(max, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "public void setPattern (String pattern) {\n this.pattern = pattern;\n }", "public void setDay(int day) throws InvalidDateException {\r\n\t\tif (day <= 31 & day >= 1) {\r\n\t\t\tthis.day = day;\r\n\t\t} else {\r\n\t\t\tthrow new InvalidDateException(\"Please enter a realistic day for the date (between 1 and 31) !\");\r\n\t\t}\r\n\t}", "public void setDate(long date) {\r\n\t\tthis.date = new Date(date);\r\n\t}", "private void setPattern(Settings set) {\n PATTERN_JAVA = Pattern.compile(set.getValue(\"pattern.java\"));\n PATTERN_TODAY = Pattern.compile(set.getValue(\"pattern.today\"));\n PATTERN_YESTERDAY = Pattern.compile(set.getValue(\"pattern.yesterday\"));\n }", "@Override\n\t\t\tprotected DatePicker newDatePicker(String id, IModel<Date> model, String datePattern)\n\t\t\t{\n\t\t\t\t//Specified date pattern is not the default kendo-ui date pattern, but is compatible with both java & kendo-ui\n\t\t\t\t//It can therefore be transmitted as-is to the DatePicker widget\n\t\t\t\treturn new DatePicker(id, model, datePattern, new Options(\"format\", Options.asString(datePattern)));\n\t\t\t}", "public SimpleDateFormat() {\n\t\tthis(getDefaultPattern(), null, null, null, null, true, null);\n\t}", "public Builder saveEveryEpoch(){\n return saveEveryNEpochs(1);\n }", "public void setFechaNacimiento(Date fechaNacimiento)\r\n/* 138: */ {\r\n/* 139:252 */ this.fechaNacimiento = fechaNacimiento;\r\n/* 140: */ }", "public void setDate(long date)\r\n/* 199: */ {\r\n/* 200:299 */ setDate(\"Date\", date);\r\n/* 201: */ }", "public referential.store.v2.WeekPattern.Builder setPatternId(java.lang.Integer value) {\n validate(fields()[0], value);\n this.patternId = value;\n fieldSetFlags()[0] = true;\n return this; \n }", "public void setDate(java.util.Calendar value) {\r\n\t\tBase.set(this.model, this.getResource(), DATE, value);\r\n\t}", "public Epoch createEpoch(int timestamp, ServerViewController recManager) {\n epochsLock.lock();\n\n Epoch epoch = new Epoch(recManager, this, timestamp);\n epochs.put(timestamp, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "public void setPattern(String pattern)\n/* */ {\n/* 71 */ setPatterns(new String[] { pattern });\n/* */ }", "public MyDate(){\n this.day = 0;\n this.month = 0;\n this.year = 0;\n }", "public String getTimestampFormatPattern() {\r\n return timestampFormatPattern;\r\n }", "public SimpleDateFormat(final String pattern, final ULocale loc) {\n\t\tthis(pattern, null, null, null, loc, true, null);\n\t}", "public void setDate(int month, int day) {\r\n\t\tString dayString = \"\";\r\n\t\tif(day < 10)\r\n\t\t{\r\n\t\t\tfor(int i = 0; i < 10; i++)\r\n\t\t\t{\r\n\t\t\t\tif(day == i)\r\n\t\t\t\t{\r\n\t\t\t\t\tdayString = \"0\" + i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.date = month + \"-\" + dayString;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.date = month + \"-\" + day;\r\n\t\t}\r\n\t}", "void setCreationDate(Date val)\n throws RemoteException;", "public ValidatorFactory setDateFormat(int dateStyle, int timeStyle) {\n if (timeStyle < 0) {\n DateFormat.getDateInstance(dateStyle);\n } else if (dateStyle < 0) {\n DateFormat.getTimeInstance(timeStyle);\n } else {\n DateFormat.getDateTimeInstance(dateStyle, timeStyle);\n }\n this.dateStyle = dateStyle;\n this.timeStyle = timeStyle;\n this.datePattern = null;\n return this;\n }", "@Test public void Year_0__month__day()\t\t\t\t\t\t\t{tst_date_(\"2001-03-31\"\t\t\t\t, \"2001-03-31\");}", "public void setDay(int day) {\r\n if ((day >= 1) && (day <= 31)) {\r\n this.day = day; //Validate day if true set else throws an exception\r\n } else {\r\n throw new IllegalArgumentException(\"Invalid Day!\");\r\n }\r\n\r\n }", "public void setDay(int day)\r\n {\n \tif (!(day <= daysInMonth(month) || (day < 1)))\r\n\t\t{\r\n \t\tthrow new IllegalArgumentException(\"Bad day: \" + day);\r\n\t\t}\r\n this.day = day;\r\n }", "public DateUtil (double proplepticJulianDay)\n {\n setOrdinal((int)((long)(proplepticJulianDay\n + 0.5 /* noon adjust, .5 or bigger really part of next day */)\n -2440588L /* i.e. diff in base epochs of calendars */));\n\n }", "private boolean writeRinexEpochToFile(FileOperation mFileOperation, RandomAccessFile mFile, String epoch_date, String[][] values) {\n String epoch_str;\n int epoch_cnt = 0;\n\n // count the number of satellite\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && (values[i][SVID].contains(\"G\") || values[i][SVID].contains(\"C\") ||\n values[i][SVID].contains(\"E\") || values[i][SVID].contains(\"R\") || values[i][SVID].contains(\"J\"))) {\n epoch_cnt++;\n }\n }\n\n //epoch time\n epoch_str = epoch_date + epoch_cnt + \"\\n\";\n //Log.d(\"epoch_str\", epoch_str);\n\n\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"G\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"C\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"E\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"R\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"J\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n\n //write\n boolean status = mFileOperation.writeToFileAppend(mFile, epoch_str.getBytes(), epoch_str.length());\n //Log.d(\"epoch_str\", epoch_str);\n\n return status;\n }", "@Test public void Mdy_at_y_slash()\t\t\t\t\t\t\t\t{tst_date_(\"1/2/70\"\t\t\t\t\t, \"1970-01-02\");}", "public static boolean notDate(String value, String pattern)\r\n\t{\r\n\t\treturn !isDate(value, pattern);\r\n\t}", "public Builder saveEveryNEpochs(int n){\n this.saveEveryNEpochs = n;\n return this;\n }", "public EpochTimer(int rate) {\n\tThread t = new Thread(this);\n\n\tsleepMs = 1000 / rate;\n\tint sleepLeftover = 1000 - (sleepMs * rate);\n\tsleepExtraEvery = rate / sleepLeftover; \n\n\tthis.rate = rate;\n\n\tt.start();\n\t\n }", "public void setDate(int day,int month,int year){\n this.day=day;\n this.month=month;\n this.year=year;\n }", "public void setFechaInclusion(Date fechaInclusion)\r\n/* 155: */ {\r\n/* 156:174 */ this.fechaInclusion = fechaInclusion;\r\n/* 157: */ }", "public Builder setCreationDate(long value) {\n\n creationDate_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "public Builder setOneof1970(int value) {\n hugeOneofCase_ = 1970;\n hugeOneof_ = value;\n onChanged();\n return this;\n }", "public void markFileRetentionPeriodReplace() throws JNCException {\n markLeafReplace(\"fileRetentionPeriod\");\n }", "public RegexFormatter(Pattern pattern) {\n this();\n setPattern(pattern);\n }", "public com.luisjrz96.streaming.birthsgenerator.models.BirthInfo.Builder setDate(long value) {\n validate(fields()[5], value);\n this.date = value;\n fieldSetFlags()[5] = true;\n return this;\n }", "@Override\n\tprotected void setDate() {\n\n\t}", "public void setPatternId(java.lang.Integer value) {\n this.patternId = value;\n }", "protected void setPattern(ExchangePattern pattern) {\n _pattern = pattern;\n }", "private List<Date> parseDateBeforeEpochYear(String source,\n List<Date> dateList) throws ParseException {\n final int INITIAL_INDEX = 0;\n final int EPOCH_START_YEAR = 1970;\n final int yearGroup = 1;\n final int monthGroup = 2;\n final int dayGroup = 3;\n\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"u/M/d\");\n String yyyymmddRegex = \"(\\\\d\\\\d\\\\d\\\\d)[/-](0?[1-9]|1[012])[/-](3[01]|[012]?[0-9])\";\n\n Pattern pattern = Pattern.compile(yyyymmddRegex);\n Matcher matcher = pattern.matcher(source);\n int dateIndex = INITIAL_INDEX;\n\n while (matcher.find()) {\n int year = Integer.parseInt(matcher.group(1));\n if (year >= EPOCH_START_YEAR) {\n continue;\n }\n\n Calendar calendar = convertDateToCalendar(dateList.get(dateIndex));\n\n LocalDate localDate = LocalDate.parse(\n matcher.group(yearGroup) + \"/\" + matcher.group(monthGroup)\n + \"/\" + matcher.group(dayGroup), formatter);\n LocalTime localTime = getLocalTime(calendar);\n LocalDateTime localDateTime = LocalDateTime\n .of(localDate, localTime);\n\n Date parseResult = convertLocalDateToDate(localDateTime);\n dateList.remove(dateIndex);\n dateList.add(dateIndex, parseResult);\n dateIndex++;\n\n }\n\n sortDateList(dateList);\n\n return dateList;\n }", "public void setDateFormat(String format) {\n this.mDateFormat = format;\n }", "public DateNextDateExceptionTest(int year, int month, int day) {\n\t\tthis.year = year;\n\t\tthis.month = month;\n\t\tthis.day = day;\n\t}", "public boolean setDateFromString(String s){\n String[] strs = s.split(\"/\");\n if(strs.length != 3){\n return false;\n }\n try {\n this.year = Integer.parseInt(strs[0].toString());\n this.month = Integer.parseInt(strs[1].toString());\n this.dayOfMonth = Integer.parseInt(strs[2].toString());\n }catch (NumberFormatException e){\n e.printStackTrace();\n return false;\n }\n this.dateString = s;\n return true;\n }", "public static String fetchGraphDate(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\").format(new Date(epoch));\n\t}", "private void setDate() {\n java.util.Date d1 = new java.util.Date();\n SimpleDateFormat df = new SimpleDateFormat(\"YYYY-MM-dd\");\n String formateDate = df.format(d1);\n lblDate.setText(formateDate); \n }", "public void setBirthday( String s) throws IOException {\n\t\ttry {\r\n\t\t int day = Integer.parseInt(s.substring(0, 2));\r\n\t\t int month = Integer.parseInt(s.substring(3, 5))-1;\r\n\t\t int year = Integer.parseInt(s.substring(6, 10));\r\n\t\t birthday.set(year, month, day);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tbirthday.set(1900, Calendar.JANUARY, 1);\r\n\t\t}\r\n\t}", "@Override\n public Builder epochs(int numEpochs) {\n super.epochs(numEpochs);\n return this;\n }", "public void setDate(String ymd) throws RelationException;", "private static void formatDate (XmlDoc.Element date) throws Throwable {\n\t\tString in = date.value();\n\t\tString out = DateUtil.convertDateString(in, \"dd-MMM-yyyy\", \"yyyy-MM-dd\");\n\t\tdate.setValue(out);\n\t}", "public void setRunDate(Date runDate) {\n this.runDate = runDate;\n Calendar calendar = new GregorianCalendar();\n calendar.setTime(runDate);\n year = calendar.get(Calendar.YEAR);\n month = calendar.get(Calendar.MONTH);\n }", "public void setPatternSeparator(String timestampSeparator)\r\n\t{\r\n\t\tthis.patternSeparator = timestampSeparator;\r\n\t}", "public void markFileCreationPeriodReplace() throws JNCException {\n markLeafReplace(\"fileCreationPeriod\");\n }", "public static void valDate() {\n Scanner input = new Scanner(System.in);\n try {\n LocalDate dateObj = LocalDate.parse(date);\n } catch (DateTimeParseException ex) {\n System.err.println(\"Invalid date, please insert a valid date with pattern yyyy-MM-dd\");\n date = input.next();\n valDate();\n }\n }", "private void setDeltaDate(long deltaDate) {\n\t\tthis.deltaDate = deltaDate;\n\t}" ]
[ "0.754276", "0.6404532", "0.59109175", "0.58051497", "0.5340756", "0.5317811", "0.50434744", "0.49914798", "0.4952493", "0.48987582", "0.4793559", "0.47897542", "0.4670383", "0.46531254", "0.4631563", "0.46027386", "0.45906606", "0.45787096", "0.45495963", "0.45391345", "0.45312464", "0.4508103", "0.45061055", "0.44887957", "0.44803578", "0.44736582", "0.4471446", "0.4467751", "0.44651246", "0.44644696", "0.44466105", "0.44444612", "0.4442223", "0.44353148", "0.44214076", "0.44152752", "0.44103825", "0.44086748", "0.44083944", "0.4399557", "0.43502888", "0.43444797", "0.43258172", "0.43009108", "0.42975634", "0.42829806", "0.42814994", "0.42647624", "0.4257074", "0.42479187", "0.4208844", "0.4194722", "0.4188514", "0.41859993", "0.41845995", "0.4182036", "0.41722858", "0.41603085", "0.41563395", "0.41497156", "0.41466898", "0.4142626", "0.41079742", "0.41057667", "0.40992558", "0.40956283", "0.4093311", "0.4085755", "0.4085194", "0.40840966", "0.40773705", "0.40619397", "0.40610126", "0.40609097", "0.40590912", "0.40563563", "0.4055807", "0.40490896", "0.40465584", "0.40410104", "0.40352228", "0.40316257", "0.40310076", "0.4029871", "0.40050653", "0.40033257", "0.39927238", "0.39886066", "0.3985542", "0.39845678", "0.39819914", "0.39813396", "0.3978662", "0.39770284", "0.39662033", "0.39647466", "0.39640674", "0.396406", "0.39603227", "0.3959879" ]
0.87037635
0
Returns the date pattern defining the date format for the epochDate property. The epochDate property must follow the epochDatePattern property format.
public String getEpochDatePattern() { return mEpochDatePattern; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEpochDatePattern( String pEpochDatePattern ) {\n mEpochDatePattern = pEpochDatePattern;\n }", "public Date getEpochDateAsDate() {\n if ( mEpochDateAsDate == null ) {\n SimpleDateFormat dateFormat = new SimpleDateFormat( getEpochDatePattern() );\n mEpochDateAsDate = dateFormat.parse( getEpochDate(), \n new ParsePosition(0) );\n }\n \n return mEpochDateAsDate;\n }", "public String getEpochDate() {\n return mEpochDate;\n }", "String getDate() { return epoch; }", "public static String getDatePattern() {\n\t\treturn DATE_PATTERN;\n\t}", "public String getDatePattern()\r\n\t{\r\n\t\treturn datePattern;\r\n\t}", "public void setEpochDate( String pEpochDate ) {\n mEpochDate = pEpochDate;\n }", "@Test\n public void getEpochDay() {\n assertEquals(MinguoDate.of(110, 5, 19), MinguoChronology.INSTANCE.dateEpochDay(18766));\n assertEquals(MinguoDate.of(59, 1, 1), MinguoChronology.INSTANCE.dateEpochDay(0));\n }", "public static long dateFormatedToEpoch(String dateFormated) {\r\n String dateDeb = String.valueOf(dateFormated);\r\n // The mask\r\n DateFormat dF = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateDeb);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n long epoch = date.getTime();\r\n return epoch;\r\n }", "public static String fetchGraphDate11(int epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\", Locale.US).format(new Date(epoch));\n\t}", "public static String fetchGraphDate(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\").format(new Date(epoch));\n\t}", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "private static long makeEpoch() {\n Calendar c = Calendar.getInstance(TimeZone.getTimeZone(\"GMT-0\"));\n c.set(Calendar.YEAR, 1582);\n c.set(Calendar.MONTH, Calendar.OCTOBER);\n c.set(Calendar.DAY_OF_MONTH, 15);\n c.set(Calendar.HOUR_OF_DAY, 0);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n c.set(Calendar.MILLISECOND, 0);\n return c.getTimeInMillis();\n }", "public String getTimestampFormatPattern() {\r\n return timestampFormatPattern;\r\n }", "public static long getDayNumber() {\n return getSecondsSinceEpoch() / SECS_TO_DAYS;\n }", "public static String epochToDateTime(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"dd-MM-yyyy hh:mm a\").format(new Date(epoch));\n\t}", "public String getDatePattern(HttpServletRequest req) {\n\t\treturn DateUtil.getDatePattern(getResourceBundle(req));\n\t}", "public static String notificationepochToDate(long epoch)\n\t{\n\t\ttry {\n\t\t\t if(epoch==0){\n\t\t\t \treturn \"\";\n\t\t\t }\n\t\t\tString Date1 = \"\";\n\t\t\tString Time1 = \"\";\n\t\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tSimpleDateFormat dateFormatGmt1 = new SimpleDateFormat(\"dd-MMM-yyyy\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\tDate1 = dateFormatGmt1.format(epoch);\n\t\t\tTime1 = dateFormatGmt.format(epoch);\n\t\t\treturn Date1 + \" \"\n\t\t\t\t\t+ Time1;/*new SimpleDateFormat(\"dd-MMM-yyyy hh:mm:ss a\",Locale.getDefault()).format(calendar.getTime())*/\n\t\t}\n\t\tcatch (Exception e){\n\t\t\treturn \"\";\n\t\t}\n\t\t/*\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\treturn dateFormatGmt.format(epoch);*/\n\t}", "@Override\n public boolean isEpochCheckEnabled() {\n return false;\n }", "public int getDaysSinceStartOfEpoch() {\r\n long millis = new GregorianCalendar(year, month - 1, day).getTimeInMillis();\r\n return (int) (millis / MILLIS_PER_DAY);\r\n\r\n }", "@Override\n public LocalDate convertToEntityAttribute(Long epochDay) {\n if (epochDay != null) {\n LocalDate date = LocalDate.ofEpochDay(epochDay);\n return date;\n }\n return null;\n }", "private static synchronized String getDefaultPattern() {\n\t\tULocale defaultLocale = ULocale.getDefault(Category.FORMAT);\n\t\tif (!defaultLocale.equals(cachedDefaultLocale)) {\n\t\t\tcachedDefaultLocale = defaultLocale;\n\t\t\tCalendar cal = Calendar.getInstance(cachedDefaultLocale);\n\t\t\ttry {\n\t\t\t\tCalendarData calData = new CalendarData(cachedDefaultLocale, cal.getType());\n\t\t\t\tString[] dateTimePatterns = calData.getDateTimePatterns();\n\t\t\t\tint glueIndex = 8;\n\t\t\t\tif (dateTimePatterns.length >= 13) {\n\t\t\t\t\tglueIndex += (SHORT + 1);\n\t\t\t\t}\n\t\t\t\tcachedDefaultPattern = MessageFormat.format(dateTimePatterns[glueIndex], new Object[] { dateTimePatterns[SHORT],\n\t\t\t\t\t\tdateTimePatterns[SHORT + 4] });\n\t\t\t} catch (MissingResourceException e) {\n\t\t\t\tcachedDefaultPattern = FALLBACKPATTERN;\n\t\t\t}\n\t\t}\n\t\treturn cachedDefaultPattern;\n\t}", "public Epoch createEpoch(ServerViewController recManager) {\n epochsLock.lock();\n\n Set<Integer> keys = epochs.keySet();\n\n int max = -1;\n for (int k : keys) {\n if (k > max) max = k;\n }\n\n max++;\n Epoch epoch = new Epoch(recManager, this, max);\n epochs.put(max, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "public PubDateFilter(long epoch) {\r\n this(epoch,false);\r\n }", "public void setDatePattern(String datePattern)\r\n\t{\r\n\t\tthis.datePattern = datePattern;\r\n\t}", "public int computeCheckPeriod()\r\n\t{\r\n\t\tRollingCalendar rollingCalendar = new RollingCalendar(gmtTimeZone, Locale.ENGLISH);\r\n\t\t// set sate to 1970-01-01 00:00:00 GMT\r\n\t\tDate epoch = new Date(0);\r\n\r\n\t\tif (this.getDatePattern() != null)\r\n\t\t{\r\n\t\t\tSimpleDateFormat simpleDateFormat;\r\n\t\t\tString r0;\r\n\t\t\tString r1;\r\n\t\t\tDate nextDate;\r\n\t\t\tfor (int type = TOP_OF_MINUTE; type <= TOP_OF_MONTH; type++)\r\n\t\t\t{\r\n\t\t\t\tsimpleDateFormat = new SimpleDateFormat(this.getDatePattern());\r\n\t\t\t\tsimpleDateFormat.setTimeZone(gmtTimeZone); // do all date formatting in GMT\r\n\t\t\t\tr0 = simpleDateFormat.format(epoch);\r\n\t\t\t\trollingCalendar.setType(type);\r\n\t\t\t\tnextDate = new Date(rollingCalendar.getNextCheckMillis(epoch));\r\n\t\t\t\tr1 = simpleDateFormat.format(nextDate);\r\n\t\t\t\tif (r0 != null && r1 != null && !r0.equals(r1))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn TOP_OF_TROUBLE; // Deliberately head for trouble...\r\n\t}", "public static String getDateFormatForFileName() {\n final DateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HH-mm-ss\");\n return sdf.format(new Date());\n }", "public ValidatorFactory setDateFormat(String pattern) {\n this.datePattern = pattern == null ? null : new SimpleDateFormat(pattern).toPattern();\n return this;\n }", "public interface RegexRule {\n /**\n * yyyy-MM 格式校验\n */\n String START_END_TIME_RULE=\"(19|20)[0-9][0-9]-(0[1-9]|1[0-2])\";\n /**\n * yyyy-MM 格式校验\n */\n String START_END_TIME_RULE_Y_M = \"(19|20)[0-9][0-9]-(0[1-9]|1[0-2])\";\n /**\n * yyyy-MM-dd 时间格式校验\n */\n String START_END_TIME_RULE_Y_M_D = \"((\\\\d{2}(([02468][048])|([13579][26]))[\\\\-\\\\s]?((((0?[13578])|(1[02]))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])))))|(\\\\d{2}(([02468][1235679])|([13579][01345789]))[\\\\-\\\\s]?((((0?[13578])|(1[02]))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\\\-\\\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))\";\n /**\n * yyyy-MM-dd hh:mm:ss\n */\n String START_END_TIME_RULE_Y_M_D_H_M_S = \"^\\\\d{4}[-]([0][1-9]|(1[0-2]))[-]([1-9]|([012]\\\\d)|(3[01]))([ \\\\t\\\\n\\\\x0B\\\\f\\\\r])(([0-1]{1}[0-9]{1})|([2]{1}[0-4]{1}))([:])(([0-5]{1}[0-9]{1}|[6]{1}[0]{1}))([:])((([0-5]{1}[0-9]{1}|[6]{1}[0]{1})))$\";\n /**\n * 名称格式校验\n */\n String NAME_RULE = \"[^\\\\\\\\<>%'\\\"]{0,10}\";\n /**\n * 不含有特殊字符格式校验\n */\n String SPECIAL_WORD_RULE = \"[^\\\\\\\\<>%'\\\"]{1,50}\";\n /**\n * 不含有特殊字符格式校验\n */\n String SPECIAL_WORD_RULE_TWENTY = \"[^\\\\\\\\<>%'\\\"]{1,19}\";\n /**\n * 标题校验\n */\n String TITLE_RULE = \"[^\\\\\\\\<>%'\\\"]{1,60}\";\n /**\n * 用户昵称格式\n */\n String USERNAME_RULE = \"[^\\\\\\\\<>%'\\\"]{1,15}$\";\n /**\n * 时间的格式\n */\n String TIME_FORMAT_Y_M_D = \"yyyy-MM-dd\";\n /**\n * 时间的格式yyyy-MM-dd HH:MM:SS 12时制\n */\n String TIME_FARMAT_Y_M_D_H_M_S = \"yyyy-MM-dd hh:mm:ss\";\n /**\n * 24时制\n */\n String TIME_FARMAT_YYYY_MM_DD_HH_MM_SS_24 = \"yyyy-MM-dd HH:mm:ss\";\n\n /**\n * 1-50汉字格式校验\n */\n String CHINA_WORD = \"[^\\\\\\\\<>%'\\\"]{1,50}\";\n /**\n * 1-5汉字的格式检验\n */\n String CHINESE_RULE = \"^[\\\\u4e00-\\\\u9fa5 ]{1,5}$\";\n\n int FIVE_THOUSAND = 500;\n\n}", "public double getEpochLongitude() {\n return epochLongitude;\n }", "public String getDateFormats()\n {\n return dateFormats;\n }", "public Epoch createEpoch(int timestamp, ServerViewController recManager) {\n epochsLock.lock();\n\n Epoch epoch = new Epoch(recManager, this, timestamp);\n epochs.put(timestamp, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "private DateFormatsConfig getDateFormats()\r\n {\r\n ClasspathPreferencesPersistenceManager manager = new ClasspathPreferencesPersistenceManager();\r\n InternalPreferencesIF preferences = manager.load(MantleConstants.USER_DATE_FORMAT_CONFIG_FILE_TOPIC, null, false);\r\n\r\n DateFormatsConfig config = preferences.getJAXBObject(DateFormatsConfig.class, \"DateFormatConfig\", null);\r\n\r\n return config;\r\n }", "public double getEpochLongitudeDelta() {\n return epochLongitudeDelta;\n }", "public String getTooltipDatePattern() {\r\n return calendarTable.getTooltipDatePattern();\r\n }", "public String getDataFormatPattern() {\r\n return dataFormatPattern;\r\n }", "public static String epochToTimeGMT(long epoch)\n\t{\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"HHmm\");\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\treturn dateFormatGmt.format(epoch);\n\t}", "protected static SimpleDateFormat xsdDateFormat() {\n return new SimpleDateFormat(\"yyyy-MM-dd\");\n }", "public DateGraphFormat(String pattern){\n\t((SimpleDateFormat) dateFormat).applyPattern(pattern);\n }", "private boolean writeRinexEpochToFile(FileOperation mFileOperation, RandomAccessFile mFile, String epoch_date, String[][] values) {\n String epoch_str;\n int epoch_cnt = 0;\n\n // count the number of satellite\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && (values[i][SVID].contains(\"G\") || values[i][SVID].contains(\"C\") ||\n values[i][SVID].contains(\"E\") || values[i][SVID].contains(\"R\") || values[i][SVID].contains(\"J\"))) {\n epoch_cnt++;\n }\n }\n\n //epoch time\n epoch_str = epoch_date + epoch_cnt + \"\\n\";\n //Log.d(\"epoch_str\", epoch_str);\n\n\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"G\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"C\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"E\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"R\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n for(int i = 0; i < values.length; i++) {\n if (values[i][SVID] != null && values[i][SVID].contains(\"J\")) {\n epoch_str += String.format(\"%-5s%12s %14s %14s %14s %14s %14s %14s %14s\\n\",\n values[i][SVID], values[i][C_1], values[i][L_1], values[i][D_1], values[i][S_1],\n values[i][C_2], values[i][L_2], values[i][D_2], values[i][S_2]);\n }\n }\n\n //write\n boolean status = mFileOperation.writeToFileAppend(mFile, epoch_str.getBytes(), epoch_str.length());\n //Log.d(\"epoch_str\", epoch_str);\n\n return status;\n }", "public DateUtil (double proplepticJulianDay)\n {\n setOrdinal((int)((long)(proplepticJulianDay\n + 0.5 /* noon adjust, .5 or bigger really part of next day */)\n -2440588L /* i.e. diff in base epochs of calendars */));\n\n }", "public static SimpleDateFormat getDayFormat() {\n return new SimpleDateFormat(\"EEE dd\");\n }", "@Test public void Day_1__month__year()\t\t\t\t\t\t\t{tst_date_(\"03-31-02\"\t\t\t\t, \"2002-03-31\");}", "private String generateCronExp() {\n LocalDate now = LocalDate.now();\n\n return String.format(\"0 0 0 %s %s ? %s\", now.getDayOfMonth() - 1, now.getMonthOfYear(),\n now.getYear());\n }", "public String getTimeFormatPattern() {\r\n return timeFormatPattern;\r\n }", "public String randomDateGenerator() {\n\n\t\tLocalDate startDate = LocalDate.now();\n\n\t\tint year = startDate.getYear();\n\t\tint month = startDate.getMonthValue();\n\t\tint day = startDate.getDayOfMonth();\n\n\t\tLocalDate endDate = LocalDate.of(year + 1, month, day);\n\n\t\tlong randomDate = randBetween(startDate.toEpochDay(), endDate.toEpochDay());\n\t\treturn LocalDate.ofEpochDay(randomDate).toString();\n\n\t}", "public String toLocalizedPattern() {\n\t\treturn translatePattern(pattern, DateFormatSymbols.patternChars, formatData.localPatternChars);\n\t}", "public SimpleDateFormat getDateFormat(int displayType, Language language, String pattern) {\n\t\treturn null;\n\t}", "public String getCreationTime(String pattern) {\n\t\tString ret = new SimpleDateFormat(pattern).format(this.creationTime);\n\t\treturn ret;\n\t}", "public double getMaxNumberOfEpochs() {\n return maxNumberOfEpochs;\n }", "private List<Date> parseDateBeforeEpochYear(String source,\n List<Date> dateList) throws ParseException {\n final int INITIAL_INDEX = 0;\n final int EPOCH_START_YEAR = 1970;\n final int yearGroup = 1;\n final int monthGroup = 2;\n final int dayGroup = 3;\n\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"u/M/d\");\n String yyyymmddRegex = \"(\\\\d\\\\d\\\\d\\\\d)[/-](0?[1-9]|1[012])[/-](3[01]|[012]?[0-9])\";\n\n Pattern pattern = Pattern.compile(yyyymmddRegex);\n Matcher matcher = pattern.matcher(source);\n int dateIndex = INITIAL_INDEX;\n\n while (matcher.find()) {\n int year = Integer.parseInt(matcher.group(1));\n if (year >= EPOCH_START_YEAR) {\n continue;\n }\n\n Calendar calendar = convertDateToCalendar(dateList.get(dateIndex));\n\n LocalDate localDate = LocalDate.parse(\n matcher.group(yearGroup) + \"/\" + matcher.group(monthGroup)\n + \"/\" + matcher.group(dayGroup), formatter);\n LocalTime localTime = getLocalTime(calendar);\n LocalDateTime localDateTime = LocalDateTime\n .of(localDate, localTime);\n\n Date parseResult = convertLocalDateToDate(localDateTime);\n dateList.remove(dateIndex);\n dateList.add(dateIndex, parseResult);\n dateIndex++;\n\n }\n\n sortDateList(dateList);\n\n return dateList;\n }", "private String getTimeFormat() {\r\n return mData.getConfiguration(\"x-labels-time-format\", \"yyyy-MM-dd\");\r\n }", "public String toPattern() {\n\t\treturn pattern;\n\t}", "@Override\n public Date generate() {\n int year = 2000 + Rng.instance().nextInt(20);\n int date = Rng.instance().nextInt(28) + 1;\n int month = Rng.instance().nextInt(10) + 1;\n\n Calendar calendar = Calendar.getInstance();\n calendar.set(year, month, date);\n\n return calendar.getTime();\n }", "public String getGUIDateFormat();", "public static String getDisplayDateFormat(Date val) {\n\n\t\tif (val != null) {\n\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\treturn \"\" + format.format(val);\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}", "public final void mRULE_DATE() throws RecognitionException {\n try {\n int _type = RULE_DATE;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../com.pellcorp.mydsl/src-gen/com/pellcorp/mydsl/parser/antlr/internal/InternalMyDsl.g:657:11: ( '0' .. '9' '0' .. '9' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9' )\n // ../com.pellcorp.mydsl/src-gen/com/pellcorp/mydsl/parser/antlr/internal/InternalMyDsl.g:657:13: '0' .. '9' '0' .. '9' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9' '-' '0' .. '9' '0' .. '9'\n {\n matchRange('0','9'); \n matchRange('0','9'); \n matchRange('0','9'); \n matchRange('0','9'); \n match('-'); \n matchRange('0','9'); \n matchRange('0','9'); \n match('-'); \n matchRange('0','9'); \n matchRange('0','9'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public SimpleDateFormat getDateFormat(HttpServletRequest req) {\n\t\treturn new SimpleDateFormat(DateUtil.getDatePattern(getResourceBundle(req)), Constants.DEF_LOCALE_NUMBER);\n\t}", "public static java.lang.String getDateFormat() {\r\n\t\treturn getDBLayer().getDateFormat();\r\n\t}", "public static String dateConv(int date) {\n\t\tDate mills = new Date(date*1000L); \n\t\tString pattern = \"dd-MM-yyyy\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tsimpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+1\"));\n\t\tString formattedDate = simpleDateFormat.format(mills);\n\t\treturn formattedDate;\n\t}", "private String getDefaultDateFormat() {\n return getString(DATE_FORMAT_KEY, DEFAULT_DATE_FORMAT);\n }", "DateFormat getDisplayDateFormat();", "private static List<String> listDateFormats(){\r\n List<String> result = new ArrayList<String>();\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\r\n result.add(\"yyyy-MM-ddZZ\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ssz\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\");\r\n result.add(\"EEE MMM d hh:mm:ss z yyyy\");\r\n result.add(\"EEE MMM dd HH:mm:ss yyyy\");\r\n result.add(\"EEEE, dd-MMM-yy HH:mm:ss zzz\");\r\n result.add(\"EEE, dd MMM yyyy HH:mm:ss zzz\");\r\n result.add(\"EEE, dd MMM yy HH:mm:ss z\");\r\n result.add(\"EEE, dd MMM yy HH:mm z\");\r\n result.add(\"EEE, dd MMM yyyy HH:mm:ss z\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss\");\r\n result.add(\"EEE, dd MMM yyyy HH:mm:ss Z\");\r\n result.add(\"dd MMM yy HH:mm:ss z\");\r\n result.add(\"dd MMM yy HH:mm z\");\r\n result.add(\"'T'HH:mm:ss\");\r\n result.add(\"'T'HH:mm:ssZZ\");\r\n result.add(\"HH:mm:ss\");\r\n result.add(\"HH:mm:ssZZ\");\r\n result.add(\"yyyy-MM-dd\");\r\n result.add(\"yyyy-MM-dd hh:mm:ss\");\r\n result.add(\"yyyy-MM-dd HH:mm:ss\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ssz\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ss\");\r\n result.add(\"yyyy-MM-dd'T'HH:mm:ssZZ\");\r\n result.add(\"dd.MM.yyyy\");\r\n result.add(\"dd.MM.yyyy hh:mm:ss\");\r\n result.add(\"dd.MM.yyyy HH:mm:ss\");\r\n result.add(\"dd.MM.yyyy'T'HH:mm:ssz\");\r\n result.add(\"dd.MM.yyyy'T'HH:mm:ss\");\r\n result.add(\"dd.MM.yyyy'T'HH:mm:ssZZ\");\r\n result.add(\"dd.MM.yyyy hh:mm\");\r\n result.add(\"dd.MM.yyyy HH:mm\");\r\n result.add(\"dd/MM/yyyy\");\r\n result.add(\"dd/MM/yy\");\r\n result.add(\"MM/dd/yyyy\");\r\n result.add(\"MM/dd/yy\");\r\n result.add(\"MM/dd/yyyy hh:mm:ss\");\r\n result.add(\"MM/dd/yy hh:mm:ss\");\r\n return result;\r\n }", "DateLiteral createDateLiteral();", "public static String generateDate()\r\n\t{\r\n\t\tDate d = new Date();\r\n\t\tSimpleDateFormat datef = new SimpleDateFormat(\"YYYY_MM_dd_ss\");\r\n\t\treturn datef.format(d);\r\n\r\n\r\n\t}", "public String toString() {\r\n\t\treturn String.format(\"%02d/%02d/%02d\", month, day, year);\r\n\r\n\t}", "public static DateFormat urlDateFormatter() {\n return Iso8601Formatter.dateTimeMillisFormatter();\n }", "int getOneof1970();", "public PubDateFilter(long epoch, boolean after) {\r\n this.epoch = epoch;\r\n this.after = after;\r\n }", "static private Pattern getInstantPattern() {\n if (instantPattern == null) {\n instantPattern = Pattern.compile(\"Z.*$\");\n }\n return instantPattern;\n }", "@TruffleBoundary\n public static double dateFromDaysRegularLeapYears(int daysAfter1970) {\n int daysAfter2000 = daysAfter1970 - DAYS_FROM_1970_TO_2000;\n // days after year 1900 (as if it was a leap year)\n int days = daysAfter2000 + 25 * DAYS_IN_4_YEARS;\n // we need days > 0 to ensure that integer division rounds correctly\n assert days > 0;\n int year = 4 * (days / DAYS_IN_4_YEARS);\n int remainingDays = days % DAYS_IN_4_YEARS;\n remainingDays--;\n year += remainingDays / 365 + 1900;\n remainingDays %= 365;\n boolean leapYear = (year & 3) == 0;\n if (leapYear) {\n remainingDays++;\n }\n return dateFromDayInYear(year, remainingDays);\n }", "public static String getDate(String pattern) {\n return getDate(pattern, System.currentTimeMillis());\n }", "@Test public void Mdy_at_y_slash()\t\t\t\t\t\t\t\t{tst_date_(\"1/2/70\"\t\t\t\t\t, \"1970-01-02\");}", "@Test public void Year_0__month__day()\t\t\t\t\t\t\t{tst_date_(\"2001-03-31\"\t\t\t\t, \"2001-03-31\");}", "protected final void toGregorian()\n {\n // ordinal must be set at this point.\n\n // handle the null date as a special case\n if ( ordinal == NULL_ORDINAL )\n {\n yyyy = 0;\n mm = 0;\n dd = 0;\n return;\n }\n if ( ordinal > MAX_ORDINAL )\n throw new IllegalArgumentException(\"invalid ordinal date: \"+ ordinal);\n else if ( ordinal >= GC_firstOrdinal )\n {\n yyyy = Leap400RuleYYYY\n + flooredMulDiv(ordinal - Jan_01_Leap400RuleYear,\n 10000,\n 3652425); /* 365 + 0.25 - 0.01 - 0.0025 */\n /* division may be done on a negative number.\n That's ok. We don't need to mess with the\n 100RuleYear. The 400RuleYear handles it all. */\n }\n\n else if ( ordinal >= Jan_01_0001 )\n {\n // Jan_01_0001 to Oct_04_1582\n // year 4 was first AD leap year.\n yyyy = 4 + flooredMulDiv(ordinal - Jan_01_0004, 100, 36525);\n /* 365 + 0.25 */\n }\n\n else if ( ordinal >= MIN_ORDINAL )\n {\n // LowestDate to Dec_31_0001BC\n // -1 was first BC leap year.\n // dividend will be negative\n yyyy = -1 + flooredMulDiv(ordinal - Jan_01_0001BC, 100, 36525);\n /* 365 + 0.25 */\n }\n else throw new IllegalArgumentException(\"invalid ordinal date: \"+ordinal);\n\n int aim = ordinal + 1;\n\n // Oct_15_1582 <= ordinal && ordinal <= Dec_31_1582\n if ( GC_firstOrdinal <= ordinal && ordinal <= GC_firstDec_31 ) aim += missingDays;\n\n // ddd should be 1..366\n int ddd = aim - jan01OfYear(yyyy);\n while ( ddd <= 0 )\n {\n // our approximation was too high\n yyyy--;\n ddd = aim - jan01OfYear(yyyy);\n }\n boolean leap = isLeap(yyyy);\n while ( ddd > (leap ? 366 : 365) )\n {\n // our approximation was too low\n yyyy++;\n ddd = aim - jan01OfYear(yyyy);\n leap = isLeap(yyyy);\n }\n\n mm = dddToMM(ddd, leap);\n dd = ddd - daysInYearPriorToMonth(mm, leap);\n\n // at this point yyyy, mm and dd have been computed.\n }", "public LocalDate getValidDateFormat(String msg) {\n String sDate = getCommand(msg);\n\n while (!isValidDate(sDate)){\n sDate = getCommand(ANSI_RED+\"Invalid date. Enter ISO format\"+ANSI_RESET);\n }\n return LocalDate.parse(sDate);\n }", "public static String getDate(String pattern, long timeInMillis) {\n SimpleDateFormat format = new SimpleDateFormat(pattern);\n return format.format(new Date(timeInMillis));\n }", "public static void main(String[] args) {\n\t\tLocalDate localDate = LocalDate.now();\n\t\tlong epochDay = localDate.toEpochDay();\n\t\tSystem.out.println(epochDay);\n\t\t//\n\n\t\tLocalDateTime ldt = LocalDateTime.now();\n\t\tlong epochSecond = ldt.toEpochSecond(ZoneOffset.UTC);\n\t\tSystem.out.println(epochSecond);\n\n\t}", "@Override\n\tpublic String[] getFormats() {\n\t\treturn new String[] {\"yyyy-MM-dd'T'HH:mm:ss\",\"yyyy-MM-dd HH:mm:ss\",\"yyyy-MM-dd HH:mm\",\"yyyy-MM-dd'T'HH:mm\",\"yyyy-MM-dd HH\", \"yyyy-MM-dd\" };\n\t}", "public String getSimpleDate( java.util.Date date, String pattern ){\n if ( date == null || pattern == null ) return null;\n SimpleDateFormat sdf = new SimpleDateFormat(pattern);\n return sdf.format(date);\n }", "public String getFormattedDateLong(DateTime date) {\n String datePattern = context.getString(R.string.general_date_pattern_long);\n DateTimeFormatter dtfOut = DateTimeFormat.forPattern(datePattern);\n return dtfOut.print(date);\n }", "@Test public void Month_name_1__day__year__guess()\t\t\t\t{tst_date_(\"02 Mar 01\"\t\t\t\t, \"2001-03-02\");}", "protected abstract DateFormat getDateFormat();", "public static final long getTicksPerDay() {\n return p().TICKS_PER_RLDAY;\n }", "public String getREGN_DATE() {\r\n return REGN_DATE;\r\n }", "public int MagicDate(){\n return month = day = year = 1;\n \n }", "@Test public void Year_2__month__day()\t\t\t\t\t\t\t{tst_date_(\"03/31/2001\"\t\t\t\t, \"2001-03-31\");}", "@TypeConverter\n public Date toDate(long l){\n return new Date(l);\n }", "public SimpleDateFormat() {\n\t\tthis(getDefaultPattern(), null, null, null, null, true, null);\n\t}", "public Epoch getLastEpoch() {\n epochsLock.lock();\n if (epochs.isEmpty()) {\n epochsLock.unlock();\n return null;\n }\n //Epoch epoch = epochs.get(epochs.size() - 1);\n Epoch epoch = epochs.get(ets); // the last epoch corresponds to the current ETS\n epochsLock.unlock();\n return epoch;\n }", "public String getFileFormattedDate() {\n return this.date.format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\n }", "public final void mDATE() throws RecognitionException {\n try {\n int _type = DATE;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2967:6: ( DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT ( ( ' ' | 'T' ) DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ( ( ( ',' | '.' ) DIGIT )=> ( ( ',' | '.' ) ( DIGIT )+ ) | ) ( 'Z' | ( ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT )? ) )? )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2967:8: DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT ( ( ' ' | 'T' ) DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ( ( ( ',' | '.' ) DIGIT )=> ( ( ',' | '.' ) ( DIGIT )+ ) | ) ( 'Z' | ( ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT )? ) )?\n {\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n match('-'); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n match('-'); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2967:64: ( ( ' ' | 'T' ) DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ( ( ( ',' | '.' ) DIGIT )=> ( ( ',' | '.' ) ( DIGIT )+ ) | ) ( 'Z' | ( ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT )? ) )?\n int alt17=2;\n int LA17_0 = input.LA(1);\n\n if ( (LA17_0==' '||LA17_0=='T') ) {\n alt17=1;\n }\n switch (alt17) {\n case 1 :\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2967:65: ( ' ' | 'T' ) DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ( ( ( ',' | '.' ) DIGIT )=> ( ( ',' | '.' ) ( DIGIT )+ ) | ) ( 'Z' | ( ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT )? )\n {\n if ( input.LA(1)==' '||input.LA(1)=='T' ) {\n input.consume();\n state.failed=false;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n match(':'); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n match(':'); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2968:13: ( ( ( ',' | '.' ) DIGIT )=> ( ( ',' | '.' ) ( DIGIT )+ ) | )\n int alt14=2;\n int LA14_0 = input.LA(1);\n\n if ( (LA14_0==','||LA14_0=='.') && (synpred4_Binding())) {\n alt14=1;\n }\n else {\n alt14=2;}\n switch (alt14) {\n case 1 :\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2969:15: ( ( ',' | '.' ) DIGIT )=> ( ( ',' | '.' ) ( DIGIT )+ )\n {\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2969:40: ( ( ',' | '.' ) ( DIGIT )+ )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2969:41: ( ',' | '.' ) ( DIGIT )+\n {\n if ( input.LA(1)==','||input.LA(1)=='.' ) {\n input.consume();\n state.failed=false;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2969:53: ( DIGIT )+\n int cnt13=0;\n loop13:\n do {\n int alt13=2;\n int LA13_0 = input.LA(1);\n\n if ( ((LA13_0>='0' && LA13_0<='9')) ) {\n alt13=1;\n }\n\n\n switch (alt13) {\n \tcase 1 :\n \t // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2969:54: DIGIT\n \t {\n \t mDIGIT(); if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt13 >= 1 ) break loop13;\n \t if (state.backtracking>0) {state.failed=true; return ;}\n EarlyExitException eee =\n new EarlyExitException(13, input);\n throw eee;\n }\n cnt13++;\n } while (true);\n\n\n }\n\n\n }\n break;\n case 2 :\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2971:13: \n {\n }\n break;\n\n }\n\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2972:13: ( 'Z' | ( ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT )? )\n int alt16=2;\n int LA16_0 = input.LA(1);\n\n if ( (LA16_0=='Z') ) {\n alt16=1;\n }\n else {\n alt16=2;}\n switch (alt16) {\n case 1 :\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2972:14: 'Z'\n {\n match('Z'); if (state.failed) return ;\n\n }\n break;\n case 2 :\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2972:20: ( ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT )?\n {\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2972:20: ( ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT )?\n int alt15=2;\n int LA15_0 = input.LA(1);\n\n if ( (LA15_0=='+'||LA15_0=='-') ) {\n alt15=1;\n }\n switch (alt15) {\n case 1 :\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2972:21: ( '+' | '-' ) DIGIT DIGIT DIGIT DIGIT\n {\n if ( input.LA(1)=='+'||input.LA(1)=='-' ) {\n input.consume();\n state.failed=false;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n mDIGIT(); if (state.failed) return ;\n\n }\n break;\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "java.lang.String getStartDateYYYYMMDD();", "public Epoch getDecisionEpoch() {\n epochsLock.lock();\n Epoch e = epochs.get(decisionEpoch);\n epochsLock.unlock();\n return e;\n }", "public String generateRuleName(AbstractGenerateParms genParams) {\r\n\t\t// rule number\r\n\t\tnextRuleNumber++;\r\n\t\t// date string\r\n\t\tDate date = new Date();\r\n\t\tString datestr = (new SimpleDateFormat(\"'D'dd-MM-yyyy-'T'HH-mm-ss\")).format(date);\r\n\t\tString ruleNameSeed = getSeedName(genParams.getUsage());\r\n\r\n\t\treturn ruleNameSeed + \"-\" + genParams.getID() + \"-R\" + genParams.getRowNum() + \"-\" + nextRuleNumber + \"-\" + datestr;\r\n\t}", "private void updateEpochNum() {\n\t\t// TODO Auto-generated method stub\n\t\tFile epCount = new File(VisualizerMain.experimentBaseLocation+\"/\"+VisualizerMain.selectedRun);\n\t\tFile[] list = epCount.listFiles();\n\t\tint count = 0;\n\t\tfor (File file : list){\n\t\t\tif (file.isDirectory())\n\t\t\t\tcount++;\n\t\t}\n\t\tSystem.out.println(\"Folder Count: \" + count);\n\t\tmaxEpoch = count-1;\n\t\tSpinnerNumberModel model1 = new SpinnerNumberModel(((Number)epochSelector.getValue()).intValue(), minEpoch, maxEpoch, 1); \n\t\tepochSelector.setModel(model1);\n\t}", "public void setEpochLongitude(double value) {\n this.epochLongitude = value;\n }", "@Override\n\t\tpublic java.sql.Date convert(String s) throws ParseException {\n\t\t\ts = supportHtml5DateTimePattern(s);\n\t\t\t\n\t\t\tif (timeStampWithoutSecPatternLen == s.length()) {\n\t\t\t\ts = s + \":00\";\n\t\t\t}\n\t\t\tif (s.length() > dateLen) {\t// if (x < timeStampLen) 改用 datePattern 转换,更智能\n\t\t\t\t// return new java.sql.Date(java.sql.Timestamp.valueOf(s).getTime());\t// error under jdk 64bit(maybe)\n\t\t\t\treturn new java.sql.Date(getFormat(timeStampPattern).parse(s).getTime());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// return new java.sql.Date(java.sql.Date.valueOf(s).getTime());\t// error under jdk 64bit\n\t\t\t\treturn new java.sql.Date(getFormat(datePattern).parse(s).getTime());\n\t\t\t}\n\t\t}", "String toLocalizedPattern() {\n return toPattern(true);\n }", "private int validateEpoch (int epoch)\n throws ControlDataInvalidException\n {\n if (!(epoch >= 0)) {\n throw new ControlDataInvalidException(\n \"Epoch must be equal to or greater than 0. epoch=[\" + epoch + \"]\");\n }\n\n return epoch;\n }" ]
[ "0.7633993", "0.6328775", "0.6077979", "0.5822296", "0.56914556", "0.5562822", "0.5539703", "0.5260872", "0.5259708", "0.50449336", "0.49171558", "0.49029654", "0.47963732", "0.473992", "0.4712679", "0.46424034", "0.46393594", "0.46226814", "0.46219358", "0.45929575", "0.4531061", "0.4498633", "0.44970834", "0.4470533", "0.4444393", "0.44414642", "0.44263673", "0.43873194", "0.43407893", "0.43401358", "0.4316889", "0.43134204", "0.43107", "0.43061072", "0.4305484", "0.42986354", "0.4286366", "0.42675647", "0.42644864", "0.42200804", "0.42154267", "0.4203524", "0.42030582", "0.41969007", "0.4180361", "0.41540304", "0.41306677", "0.4115277", "0.4108711", "0.4099678", "0.4071184", "0.40649953", "0.40614736", "0.40612382", "0.40565413", "0.40353447", "0.4030953", "0.40301883", "0.40287057", "0.40145862", "0.4007353", "0.399403", "0.3991742", "0.3980896", "0.3980793", "0.39801356", "0.3972105", "0.39685345", "0.39672667", "0.3965586", "0.3955698", "0.39467013", "0.39200658", "0.39185175", "0.39159763", "0.3915622", "0.39002842", "0.3899179", "0.38899556", "0.38883173", "0.38869318", "0.38849854", "0.38823536", "0.38822138", "0.38811484", "0.38805005", "0.38680917", "0.386514", "0.38633522", "0.38558713", "0.38511658", "0.38492838", "0.38399994", "0.38356668", "0.38342795", "0.38297996", "0.3828279", "0.38258722", "0.38253206", "0.38247854" ]
0.8115381
0
Returns the epochDate property represented as a Date object.
public Date getEpochDateAsDate() { if ( mEpochDateAsDate == null ) { SimpleDateFormat dateFormat = new SimpleDateFormat( getEpochDatePattern() ); mEpochDateAsDate = dateFormat.parse( getEpochDate(), new ParsePosition(0) ); } return mEpochDateAsDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getEpochDate() {\n return mEpochDate;\n }", "String getDate() { return epoch; }", "public void setEpochDate( String pEpochDate ) {\n mEpochDate = pEpochDate;\n }", "@Test\n public void getEpochDay() {\n assertEquals(MinguoDate.of(110, 5, 19), MinguoChronology.INSTANCE.dateEpochDay(18766));\n assertEquals(MinguoDate.of(59, 1, 1), MinguoChronology.INSTANCE.dateEpochDay(0));\n }", "public String getEpochDatePattern() {\n return mEpochDatePattern;\n }", "private static long makeEpoch() {\n Calendar c = Calendar.getInstance(TimeZone.getTimeZone(\"GMT-0\"));\n c.set(Calendar.YEAR, 1582);\n c.set(Calendar.MONTH, Calendar.OCTOBER);\n c.set(Calendar.DAY_OF_MONTH, 15);\n c.set(Calendar.HOUR_OF_DAY, 0);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n c.set(Calendar.MILLISECOND, 0);\n return c.getTimeInMillis();\n }", "public double getEpochLongitude() {\n return epochLongitude;\n }", "public int getDaysSinceStartOfEpoch() {\r\n long millis = new GregorianCalendar(year, month - 1, day).getTimeInMillis();\r\n return (int) (millis / MILLIS_PER_DAY);\r\n\r\n }", "@Override\n public LocalDate convertToEntityAttribute(Long epochDay) {\n if (epochDay != null) {\n LocalDate date = LocalDate.ofEpochDay(epochDay);\n return date;\n }\n return null;\n }", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "@TypeConverter\n public Date toDate(long l){\n return new Date(l);\n }", "public Date getAsDate()\n {\n // Nope, shouldn't do that\n if (isASAP() || isNEVER()) {\n return null;\n }\n\n // The value of 3506716800000000L is the BAT as at midnight on\n // 1-Jan-1970, which is the base of the time that the system\n // gives us. It has to be adjusted for leap seconds though.\n return new Date((itsValue - DUTC.get() * 1000000L - 3506716800000000L) / 1000L);\n }", "public static long getSecondsSinceEpoch() {\n return System.currentTimeMillis() / 1000L;\n }", "public static String fetchGraphDate(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\").format(new Date(epoch));\n\t}", "public double getEpochLongitudeDelta() {\n return epochLongitudeDelta;\n }", "public long getDate() {\n return date;\n }", "public long getDate() {\n return date;\n }", "public long getDate() {\n\t\treturn date;\n\t}", "public long getDate() {\n\t\treturn date;\n\t}", "long getDate();", "@TypeConverter\n public long fromDate(Date mDate){\n return mDate.getTime();\n }", "public long toTimelineValue(Date date) { return date.getTime(); }", "public long getDate() {\n return date_;\n }", "public long getDate() {\n return date_;\n }", "public int getDateAsNumber(){\n\t\tSimpleDateFormat f = new SimpleDateFormat(\"yyyyMMdd\");\n\t\treturn Integer.parseInt(f.format(date.get()));\n\t}", "public static long getDayNumber() {\n return getSecondsSinceEpoch() / SECS_TO_DAYS;\n }", "@TypeConverter\n public Long fromDate(Date date) {\n if (date == null) { return null; }\n return date.getTime();\n }", "public static String epochToDateTime(long epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"dd-MM-yyyy hh:mm a\").format(new Date(epoch));\n\t}", "public static Date convertToDate(long value) {\r\n return new Date(value);\r\n }", "public Date getdate() {\n\t\treturn new Date(date.getTime());\n\t}", "public static Date randomDate() {\n return VALUES.get(RND.nextInt(SIZE));\n }", "Date getEDate();", "public final Date dateValue() {\n if (calValue != null)\n return calValue.getTime();\n else\n return null;\n }", "public static String fetchGraphDate11(int epoch)\n\t{\n\n\t\treturn new SimpleDateFormat(\"MMM yy\", Locale.US).format(new Date(epoch));\n\t}", "public static Date LongTotime(Long lDate)\n\t{\n\t\tif(lDate==0)\n\t\t\treturn new Date(1970,1,1);\n\t\telse\n\t\t\treturn new Date(lDate);\n\t}", "Date getDate();", "Date getDate();", "Date getDate();", "public static long dateFormatedToEpoch(String dateFormated) {\r\n String dateDeb = String.valueOf(dateFormated);\r\n // The mask\r\n DateFormat dF = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateDeb);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n long epoch = date.getTime();\r\n return epoch;\r\n }", "Date getFechaNacimiento();", "public Date getCertifiedDate() {\r\n \r\n Long deprovisioningCertifiedMillis = this.getCertifiedMillis();\r\n \r\n Date deprovisioningCertifiedDate = deprovisioningCertifiedMillis == null ? null : new Date(deprovisioningCertifiedMillis);\r\n \r\n return deprovisioningCertifiedDate;\r\n }", "public java.util.Date getValue() {\n return this.value;\n }", "@NotNull\n @Generated\n @Selector(\"date\")\n public native NSDate date();", "public void setEpochLongitude(double value) {\n this.epochLongitude = value;\n }", "public Epoch getDecisionEpoch() {\n epochsLock.lock();\n Epoch e = epochs.get(decisionEpoch);\n epochsLock.unlock();\n return e;\n }", "public Number getDayDate() {\n return (Number) getAttributeInternal(DAYDATE);\n }", "public Epoch createEpoch(int timestamp, ServerViewController recManager) {\n epochsLock.lock();\n\n Epoch epoch = new Epoch(recManager, this, timestamp);\n epochs.put(timestamp, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "public Epoch createEpoch(ServerViewController recManager) {\n epochsLock.lock();\n\n Set<Integer> keys = epochs.keySet();\n\n int max = -1;\n for (int k : keys) {\n if (k > max) max = k;\n }\n\n max++;\n Epoch epoch = new Epoch(recManager, this, max);\n epochs.put(max, epoch);\n\n epochsLock.unlock();\n\n return epoch;\n }", "public java.util.Date getDate() {\n\t}", "public Date getLoadDate() {\n return (Date)getAttributeInternal(LOADDATE);\n }", "public Date getDate(InetAddress host) throws IOException {\n\t\treturn new Date((getTime(host, DEFAULT_PORT) - SECONDS_1900_TO_1970) * 1000L);\n\t}", "public Date getDateObject(){\n \n Date date = new Date(this.getAnio(), this.getMes(), this.getDia());\n return date;\n }", "public long getTime() {\n\t\treturn date.getTime();\n }", "int getOneof1970();", "public Date date() {\n return new Date(this.msec);\n }", "public void setEpochDatePattern( String pEpochDatePattern ) {\n mEpochDatePattern = pEpochDatePattern;\n }", "private long getPeerEpoch() {\n if (self.getLearnerType() == LearnerType.PARTICIPANT) {\n try {\n return self.getCurrentEpoch();\n } catch (IOException e) {\n RuntimeException re = new RuntimeException(e.getMessage());\n re.setStackTrace(e.getStackTrace());\n throw re;\n }\n } else {\n return Long.MIN_VALUE;\n }\n }", "public static long dateFun( java.sql.Date v ) {\n return v == null ? -1L : Functions.toLong( v );\n }", "public int getDate() {\n return date;\n }", "public int getDate() {\n return date;\n }", "public static Date date() {\n GregorianCalendar cal = new GregorianCalendar();\n return cal.getTime();\n }", "public static long toLong( Date date ) {\n return date == null ? 0 : Functions.toLong( date );\n }", "public DateUtil (double proplepticJulianDay)\n {\n setOrdinal((int)((long)(proplepticJulianDay\n + 0.5 /* noon adjust, .5 or bigger really part of next day */)\n -2440588L /* i.e. diff in base epochs of calendars */));\n\n }", "public int getDate() {\n\t\treturn date;\n\t}", "public CustomDate getDate() {\n return new CustomDate(date.getTime());\n }", "public int getDate(){\n return date;\n }", "public void setDate(long value) {\n this.date = value;\n }", "public Date GetDate();", "public Epoch getLastEpoch() {\n epochsLock.lock();\n if (epochs.isEmpty()) {\n epochsLock.unlock();\n return null;\n }\n //Epoch epoch = epochs.get(epochs.size() - 1);\n Epoch epoch = epochs.get(ets); // the last epoch corresponds to the current ETS\n epochsLock.unlock();\n return epoch;\n }", "public int getDate() {\n return date ;\n }", "public java.util.Date toDate() {\n return toCalendar().getTime();\n }", "@Id\n\t@Column(name=\"DataInicialCota\", nullable=false)\n\t@Temporal(TemporalType.DATE)\n\tpublic Date getId() {\n\t\tif(dataInicialCota != null){\n\t\t\treturn new Date(dataInicialCota.getTime());\n\t\t}\n\t\treturn null;\n\t}", "long toTimelineValue(Date date);", "private Date randomDate() {\n int minDay = (int) LocalDate.of(2012, 1, 1).toEpochDay();\n int maxDay = (int) LocalDate.now().toEpochDay();\n int randomDay = minDay + intRandom(maxDay - minDay);\n LocalDate randomDate = LocalDate.ofEpochDay(randomDay);\n Date d = toDate(randomDate);\n return d;\n }", "public static String notificationepochToDate(long epoch)\n\t{\n\t\ttry {\n\t\t\t if(epoch==0){\n\t\t\t \treturn \"\";\n\t\t\t }\n\t\t\tString Date1 = \"\";\n\t\t\tString Time1 = \"\";\n\t\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tSimpleDateFormat dateFormatGmt1 = new SimpleDateFormat(\"dd-MMM-yyyy\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\tDate1 = dateFormatGmt1.format(epoch);\n\t\t\tTime1 = dateFormatGmt.format(epoch);\n\t\t\treturn Date1 + \" \"\n\t\t\t\t\t+ Time1;/*new SimpleDateFormat(\"dd-MMM-yyyy hh:mm:ss a\",Locale.getDefault()).format(calendar.getTime())*/\n\t\t}\n\t\tcatch (Exception e){\n\t\t\treturn \"\";\n\t\t}\n\t\t/*\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"hh:mm a\");\n\t\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\t\treturn dateFormatGmt.format(epoch);*/\n\t}", "public final java.util.Date getUTCDate()\n {\n return ordinal == NULL_ORDINAL ? null : new java.util.Date(getUTCTimeStamp());\n }", "final public synchronized Date getDate() {\n return new Date(crtime) ;\n }", "public Epoch(Parcel in){\n name = in.readString();\n init = (Calendar)in.readSerializable();\n end = (Calendar)in.readSerializable();\n id = in.readInt();\n }", "private static Date nextNodeAsDate(Iterator<JsonNode> iterator) {\n if (iterator == null || !iterator.hasNext()) {\n return null;\n }\n return DateUtils.fromMillisUtc(\n (long) (Double.parseDouble(iterator.next().textValue()) * 1000));\n }", "public PubDateFilter(long epoch) {\r\n this(epoch,false);\r\n }", "public Epoch getEpoch(int timestamp, ServerViewController controller) {\n return getEpoch(timestamp,true, controller);\n }", "public Date getDate() {\n return date;\n }", "public Date getNormalizedDate(Date date)\n/* */ {\n/* 208 */ return new Date(date.getTime());\n/* */ }", "public Date getDate()\n\t{\n\t\treturn date;\n\t}", "@Override\n public byte[] serialize(Date value) {\n return LONG_SERIALIZER.serialize(value.getTime());\n }", "public static void main(String[] args) {\n\t\tLocalDate localDate = LocalDate.now();\n\t\tlong epochDay = localDate.toEpochDay();\n\t\tSystem.out.println(epochDay);\n\t\t//\n\n\t\tLocalDateTime ldt = LocalDateTime.now();\n\t\tlong epochSecond = ldt.toEpochSecond(ZoneOffset.UTC);\n\t\tSystem.out.println(epochSecond);\n\n\t}", "Date getTimestamp();", "public Date getDate() {\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n calendar.set(Calendar.YEAR, year);\n calendar.set(Calendar.MONTH, month - 1); // MONTH is zero based\n calendar.set(Calendar.DAY_OF_MONTH, day);\n calendar.set(Calendar.HOUR_OF_DAY, hour);\n calendar.set(Calendar.MINUTE, minute);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar.getTime();\n }", "public Date getDate(){\n\t\treturn date;\n\t}", "public Date getFechaNacimiento() {\r\n\t\treturn fechaNacimiento;\r\n\t}", "public Date getLastRankDate() {\r\n return (Date) getAttributeInternal(LASTRANKDATE);\r\n }", "public Date getDate(InetAddress host, int port) throws IOException {\n\t\treturn new Date((getTime(host, port) - SECONDS_1900_TO_1970) * 1000L);\n\t}", "public long getDate()\r\n/* 204: */ {\r\n/* 205:309 */ return getFirstDate(\"Date\");\r\n/* 206: */ }", "public Date getTimeRead() {\n\t\treturn new Date(timeRead.getTime());\n\t}", "public Date getDate() {\r\n return date;\r\n }", "public Date getDate() {\r\n return date;\r\n }", "public Date getDate() {\r\n return date;\r\n }", "Date getForDate();", "public Date getCutDate() {\n return (Date) getAttributeInternal(CUTDATE);\n }", "public Date date (){\r\n\t\t\treturn _date;\r\n\t\t}" ]
[ "0.7953154", "0.77948105", "0.68942094", "0.664256", "0.63219905", "0.6198622", "0.61662084", "0.61185586", "0.60400414", "0.599565", "0.5983839", "0.5849158", "0.57881933", "0.5748884", "0.57410496", "0.57181156", "0.5716049", "0.5710214", "0.5710214", "0.569491", "0.5688569", "0.56539553", "0.56208473", "0.5613173", "0.5589531", "0.557233", "0.5543584", "0.5514626", "0.54751635", "0.54745144", "0.54496396", "0.5436392", "0.5422679", "0.5421934", "0.54141784", "0.5394905", "0.5394905", "0.5394905", "0.539395", "0.538119", "0.537587", "0.5373099", "0.5372725", "0.537041", "0.536378", "0.536069", "0.53505063", "0.53483367", "0.5292369", "0.52657706", "0.5261872", "0.5245957", "0.52414405", "0.5233135", "0.521756", "0.5208622", "0.5189221", "0.5186561", "0.51738757", "0.51738757", "0.5169401", "0.5165916", "0.51649874", "0.51403356", "0.5130545", "0.5121601", "0.5114302", "0.5113275", "0.5112495", "0.5107362", "0.51058173", "0.5101333", "0.50892484", "0.50859785", "0.5075854", "0.50667584", "0.5060871", "0.5034941", "0.5033766", "0.5024355", "0.50239456", "0.5021983", "0.5017427", "0.50132054", "0.5010185", "0.50098944", "0.5009485", "0.5003868", "0.50015616", "0.49984953", "0.4998445", "0.49977702", "0.49973473", "0.4984728", "0.49819204", "0.49819204", "0.49819204", "0.4978054", "0.49715295", "0.4962895" ]
0.8180149
0
Returns the list of supported credit card types.
public List<String> getSupportedCreditCardTypes() { return mSupportedCreditCardTypes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String setCardTypes()\n\t{\n\t\tString creditCards = \"vi-mc\";\n\t\tcreditCards = (DISCOVER_IMAGE == \"discvr.gif\") ? (creditCards + \"-di\") : creditCards;\n\t\tcreditCards = (AMEX_IMAGE == \"amex.gif\") ? (creditCards + \"-am\") : creditCards;\n\t\treturn creditCards;\n\t}", "public void setSupportedCreditCardTypes(List<String> pSupportedCreditCardTypes) {\n mSupportedCreditCardTypes = pSupportedCreditCardTypes;\n }", "public String getCreditCardType();", "String [] getSupportedTypes();", "List<CardTypeDTO> lookupCardTypes();", "public String getCardType()\n\t{\n\t\tif(response.containsKey(\"CARD_TYPE\")) {\n\t\t\treturn response.get(\"CARD_TYPE\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public String getCardType() {\n return cardType;\n }", "List<CmdType> getSupportedTypes();", "public java.lang.String getCardType() {\r\n return cardType;\r\n }", "public CardTypes getType() {\n\t\treturn type;\n\t}", "@org.jetbrains.annotations.NotNull()\n public abstract java.util.List<java.lang.String> getPaymentMethodTypes();", "public List<CarrierType> all() throws EasyPostException {\n String endpoint = \"carrier_types\";\n\n CarrierType[] response = Requestor.request(RequestMethod.GET, endpoint, null, CarrierType[].class, client);\n return Arrays.asList(response);\n }", "public int getCardType() {\n\t\t\treturn cardType;\n\t\t}", "public List<VOPaymentType> getAvailablePaymentTypesForCreation() {\n return paymentInfoBean.getAvailablePaymentTypesForCreation(\n model.getService().getKey(), getAccountingService());\n }", "public List<SecTyp> getAllTypes();", "boolean hasCardType();", "public List<Class<? extends Resource>> getAvailableTypes(OgemaLocale locale);", "public List<CardType> test() {\n\t\treturn null;\n\t}", "public List<String> getAvailableDataTypes() {\n Set<String> typeSet = new TreeSet<String>();\n\n ITimer timer = TimeUtil.getTimer();\n timer.start();\n\n try {\n for (Provider provider : DataDeliveryHandlers.getProviderHandler()\n .getAll()) {\n\n for (ProviderType type : provider.getProviderType()) {\n typeSet.add(type.getDataType().toString());\n }\n }\n } catch (RegistryHandlerException e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Unable to retrieve the provider list.\", e);\n }\n\n List<String> typeList = new ArrayList<String>(typeSet);\n timer.stop();\n\n return typeList;\n }", "public Set<String> getAvailableTypes() {\n return ApiSpecificationFactory.getTypes();\n }", "public Collection<String> getSupportedRecordTypes() {\n\t\tif (this.supportedRecordTypes == null){ this.supportedRecordTypes=new ArrayList<>();}\n\t\treturn supportedRecordTypes;\n\t}", "@Override\r\n\tpublic List<CreditCard> findAll() {\n\t\treturn this.cardList;\r\n\t\t\r\n\t}", "public Set<MediaType> getSupportedMediaTypes();", "public Byte getCardType() {\r\n return cardType;\r\n }", "public ComboItem[] getContract_types() {\r\n\t\treturn contract_types;\r\n\t}", "public List<Type> getTypeList() {\n\t\treturn sm.selectList(\"com.lanzhou.entity.Longpay.getTypeList\");\n\t}", "public List<ContestType> getAllContestTypes() throws ContestManagementException {\n return null;\r\n }", "public List<ContestType> getAllContestTypes() throws ContestManagementException {\n return null;\r\n }", "public Integer getCardtype() {\n return cardtype;\n }", "public void setCreditCardType (String CreditCardType);", "protected List<String> getEncumbranceBalanceTypes(Integer fiscalYear) {\n SystemOptions options = optionsService.getOptions(fiscalYear);\n\n List<String> balanceTypes = new ArrayList<String>();\n balanceTypes.add(options.getExtrnlEncumFinBalanceTypCd());\n balanceTypes.add(options.getIntrnlEncumFinBalanceTypCd());\n balanceTypes.add(options.getPreencumbranceFinBalTypeCd());\n balanceTypes.add(options.getCostShareEncumbranceBalanceTypeCd());\n return balanceTypes;\n }", "public eBLBaseComponents.apis.ebay.CreditCardDetailsType getCreditCard() {\r\n return creditCard;\r\n }", "@JsonIgnore\n\tpublic List<Card> getAvailableCards() {\n\t\tList<Card> availableCards = new ArrayList<>();\n\t\tfor (int i = dealtCards.get(); i < Deck.DECK_SIZE; i++) {\n\t\t\tCard card = cards.get(i);\n\t\t\tavailableCards.add(card);\n\t\t}\n\t\treturn availableCards;\n\t}", "private String getCardTypeListXML(int personId) {\n\t\tArrayList<String> types = DatabaseManager.getCurrentCardTypesForPerson(personId);\n\n\t\tif(types == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tString xml = \"<card_types>\";\n\t\tfor(String type : types) {\n\t\t\txml+=\"<type>\"+ type + \"</type>\";\n\t\t}\n\t\txml += \"</card_types>\";\n\t\treturn xml;\n\t}", "public String get類型Name() {\r\n return CardType.CARD_TYPE_NAME[類型];\r\n }", "public static List<CodecInfo> getSupportedCodecs()\n {\n return Collections.unmodifiableList(codecs);\n }", "public String getAllContactsTypes() {\n\t\treturn \"SELECT * FROM CONTACTSTYPES\";\n\t}", "protected List<String> getBudgetBalanceTypes(Integer fiscalYear) {\n SystemOptions options = optionsService.getOptions(fiscalYear);\n\n List<String> balanceTypes = new ArrayList<String>();\n balanceTypes.add(options.getBudgetCheckingBalanceTypeCd());\n balanceTypes.add(options.getBaseBudgetFinancialBalanceTypeCd());\n balanceTypes.add(options.getMonthlyBudgetFinancialBalanceTypeCd());\n return balanceTypes;\n }", "public abstract String[] getSupportedMediaTypes();", "public abstract java.util.Set getPaymentTypes();", "protected List<String> getActualBalanceTypes(Integer fiscalYear) {\n SystemOptions options = optionsService.getOptions(fiscalYear);\n\n List<String> balanceTypes = new ArrayList<String>();\n balanceTypes.add(options.getActualFinancialBalanceTypeCd());\n return balanceTypes;\n }", "@Override\n public Set<String> validTypes() {\n return factory.validTypes();\n }", "public ArrayList<CreditCard> getCreditCards() {\n\t\treturn this.creditCards;\n\t}", "public java.util.List<java.lang.Integer>\n getSupportedTripTypesValueList() {\n return java.util.Collections.unmodifiableList(supportedTripTypes_);\n }", "public String get卡名and類型Name() {\r\n return \"[\" + 卡名 + \"-\" + CardType.CARD_TYPE_NAME[類型] + \"] \";\r\n }", "public int[] getTypes(){\n int[] types={TYPE_STRING,TYPE_STRING,TYPE_STRING,TYPE_INT};\n return types;\n }", "public List<ContainerTypes> selectContainerTypes() {\n\n\t\tList<ContainerTypes> customers = new ArrayList<ContainerTypes>();\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\n\t\t\tconnection = (Connection) DBConnection.getConnection();\n\t\t\tString sql = \"select * from container_types\";\n\t\t\tpreparedStatement = (PreparedStatement) connection.prepareStatement(sql);\n\t\t\tresultSet = preparedStatement.executeQuery();\n\n\t\t\tContainerTypes customer = null;\n\t\t\twhile (resultSet.next()) {\n\n\t\t\t\tcustomer = new ContainerTypes();\n\n\t\t\t\tcustomer.setName(resultSet.getString(1));\n\t\t\t\tcustomer.setCpu_shares(resultSet.getInt(2));\n\t\t\t\tcustomer.setMemory(resultSet.getInt(3));\n\t\t\t\tcustomer.setDescription(resultSet.getString(4));\n\n\t\t\t\tcustomers.add(customer);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.error(e.getMessage());\n\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tresultSet.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\tLOGGER.error(e.getMessage());\n\t\t\t}\n\t\t}\n\n\t\treturn customers;\n\t}", "public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }", "private JComboBox getCardType() {\n\t\tif (cardType == null) {\n\t\t\tcardType = new JComboBox();\n\t\t\tcardType.setModel(new TypeModel(TypeModel.type_cards));\n\t\t\tcardType.setSelectedIndex(0);\n\t\t}\n\t\treturn cardType;\n\t}", "public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}", "public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}", "public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}", "public final CompositeType[] getCompositeTypes()\n {\n CompositeType[] names = new CompositeType[listModel.size()];\n\tfor(int i=0; i<names.length; i++) {\n\t names[i] = (CompositeType) listModel.elementAt(i);\n\t}\n\treturn names;\n }", "public Set<Class<?>> getTypes() {\n\t\treturn dataTypes;\n\t}", "public Set<Class<?>> getTypes() {\n\t\treturn dataTypes;\n\t}", "public List<CWLType> getTypes() {\n return types;\n }", "public List<String> getSupportedObjectTypes() {\n\n\t\tList<String> types = super.getSupportedObjectTypes();\n\t\ttypes.add(OBJECT_TYPE_GROUP);\n\t\treturn types;\n\t}", "public ValueNamePair[] getCreditCards() {\n return getCreditCards(getPayAmt());\n }", "public PowerTypes[] getValidPowerTypes();", "public String[] getTypes() {\n return impl.getTypes();\n }", "public Type[] types();", "@java.lang.Override\n public java.util.List<google.maps.fleetengine.v1.TripType> getSupportedTripTypesList() {\n return new com.google.protobuf.Internal.ListAdapter<\n java.lang.Integer, google.maps.fleetengine.v1.TripType>(supportedTripTypes_, supportedTripTypes_converter_);\n }", "public static CreditCardType lookup(String ccNumber)\r\n\t{\r\n\t\tif (!SharedStringUtil.isEmpty(ccNumber))\r\n\t\t{\r\n\t\t\tfor (CreditCardType type: CreditCardType.values())\r\n\t\t\t{\r\n\t\t\t\tif (type.isValid(ccNumber))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public List<Card> getCards(CardType type) {\n List<Card> cards = new ArrayList<>();\n for (Card card : this) {\n if (card.getCardType() == type) {\n cards.add(card);\n }\n }\n return cards;\n }", "public static List<TypeCharge> getListeTypeCharge() \t{\r\n\t\treturn s.createQuery(\"from TypeCharge\").list();\r\n\t\t\t\t\t}", "public List<__Type> getTypes() {\n return (List<__Type>) get(\"types\");\n }", "List<Type> getAllTypeList();", "public ResultFormat[] getTypes() {\n\n if (types == null) {\n types = loadFormats();\n }\n return types.clone();\n }", "public List<TypeInfo> getTypes() {\r\n return types;\r\n }", "public synchronized static Set<String> getAvailableTypes() {\n populateCache();\n return Collections.unmodifiableSet(cache.keySet());\n }", "public java.util.List<google.maps.fleetengine.v1.TripType> getSupportedTripTypesList() {\n return new com.google.protobuf.Internal.ListAdapter<\n java.lang.Integer, google.maps.fleetengine.v1.TripType>(supportedTripTypes_, supportedTripTypes_converter_);\n }", "@Override\n\tpublic List<Facilities_type> getAllFacilitiesType() {\n\t\treturn this.facilitiesDao.getAllFacilitiesType();\n\t}", "public java.lang.String getCardTypeName() {\r\n return cardTypeName;\r\n }", "public List getCourseTypes() throws ULMSSysException\r\n {\r\n return codeMaintainDAO.getCourseTypes();\r\n }", "public String[] getFfTypes(){\n return ffc.getFfTypes();\n }", "public Collection getSupportedUIDTypes() {\n return null;\r\n }", "public List<PrizeType> getAllPrizeTypes() throws ContestManagementException {\n return null;\r\n }", "public List<PrizeType> getAllPrizeTypes() throws ContestManagementException {\n return null;\r\n }", "public static List<ScrumPokerCard> getDeck() {\n return Arrays.stream(values()).collect(Collectors.toList());\n }", "@GET\n\t@Path(\"types\")\n public Response getDeviceTypes() {\n List<DeviceType> deviceTypes;\n try {\n deviceTypes = DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes();\n return Response.status(Response.Status.OK).entity(deviceTypes).build();\n } catch (DeviceManagementException e) {\n String msg = \"Error occurred while fetching the list of device types.\";\n log.error(msg, e);\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();\n }\n }", "public List<MediaType> getContentTypes() {\n\t\treturn this.contentTypes;\n\t}", "@java.lang.Override\n public java.util.List<java.lang.Integer>\n getSupportedTripTypesValueList() {\n return supportedTripTypes_;\n }", "public GiftCardProductQuery giftcardType() {\n startField(\"giftcard_type\");\n\n return this;\n }", "public List<AbstractCard> cards();", "public static List<String> getKnownSerialPorts()\r\n\t{\r\n\t\tArrayList<String> knownSerialPorts = new ArrayList<String>(4);\r\n\r\n\t\tEnumeration<CommPortIdentifier> ports = CommPortIdentifier.getPortIdentifiers();\r\n\t\twhile (ports.hasMoreElements()) {\r\n\t\t\tCommPortIdentifier cpi = ports.nextElement();\r\n\t\t\t\r\n\t\t\tif (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) {\r\n\t\t\t\tknownSerialPorts.add(cpi.getName());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlogger.debug(\"found {} serial comm ports that the user could choose from\", knownSerialPorts.size());\r\n\r\n\t\treturn knownSerialPorts;\r\n\t}", "UsedTypes getTypes();", "@GetMapping(\"/buy-types/customer-credit\")\n @Timed\n public ResponseEntity<List<BuyTypeDTO>> getAllBuyTypesForCustomerCredit(@RequestParam(required = false, name = \"customerId\") Long customerId, @RequestParam(required = false, name = \"isCredit\") Boolean isCredit) {\n log.debug(\"REST request to get a page of BuyTypes\");\n List<BuyTypeDTO> list = buyTypeService.findAllForCustomerCredit(customerId, isCredit);\n return new ResponseEntity<>(list, HttpStatus.OK);\n }", "@Secured({ \"IS_AUTHENTICATED_ANONYMOUSLY\", \"ACL_SECURABLE_READ\" })\n Collection<QuantitationType> getQuantitationTypes( ExpressionExperiment expressionExperiment,\n ubic.gemma.model.expression.arrayDesign.ArrayDesign arrayDesign );", "public List<EnvironmentTypes> selectEnvironmentTypes() {\n\n\t\tList<EnvironmentTypes> customers = new ArrayList<EnvironmentTypes>();\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\n\t\t\tconnection = (Connection) DBConnection.getConnection();\n\t\t\tString sql = \"select * from environment_types\";\n\t\t\tpreparedStatement = (PreparedStatement) connection.prepareStatement(sql);\n\t\t\tresultSet = preparedStatement.executeQuery();\n\n\t\t\tEnvironmentTypes customer = null;\n\t\t\twhile (resultSet.next()) {\n\n\t\t\t\tcustomer = new EnvironmentTypes();\n\n\t\t\t\tcustomer.setName(resultSet.getString(1));\n\t\t\t\tcustomer.setDescription(resultSet.getString(2));\n\t\t\t\tcustomer.setAccept_tag(resultSet.getString(3));\n\t\t\t\tcustomer.setPromote_tag(resultSet.getString(4));\n\t\t\t\tcustomer.setAction(resultSet.getString(5));\n\t\t\t\tcustomer.setRestart_interval(resultSet.getInt(6));\n\t\t\t\tcustomer.setQuiet_period(resultSet.getInt(7));\n\n\t\t\t\tcustomers.add(customer);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.error(e.getMessage());\n\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tresultSet.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\tLOGGER.error(e.getMessage());\n\t\t\t}\n\t\t}\n\n\t\treturn customers;\n\t}", "public List getTypeSpecifiers() {\n return member.getTypeSpecifiers();\n }", "public static List<RegisterModuleType> listAll() {\n return new ArrayList<RegisterModuleType>(Arrays.asList(values()));\n }", "public Collection<VOPaymentType> getEnabledPaymentTypes() {\n return paymentInfoBean.getEnabledPaymentTypes(\n Long.valueOf(model.getService().getKey()),\n getAccountingService());\n }", "public List<Preference<MediaType>> getAcceptedMediaTypes() {\n // Lazy initialization with double-check.\n List<Preference<MediaType>> a = this.acceptedMediaTypes;\n if (a == null) {\n synchronized (this) {\n a = this.acceptedMediaTypes;\n if (a == null) {\n this.acceptedMediaTypes = a = new ArrayList<Preference<MediaType>>();\n }\n }\n }\n return a;\n }", "@Override\n\tpublic List<Card> findAllCard() {\n\t\treturn cb.findAllCard();\n\t}", "public interface CreditCard {\n\t// Getter Methods\n\tpublic Long getId();\n\tpublic CreditCardType getCreditCardType();\n\tpublic String getAccountNumber();\n\t/**\n\t * CVV number is the three-digit number on the back of a Discover, Visa or MasterCard;\n\t * or the four-digit number on the front of the American Express card.\n\t * @return\n\t */\n\tpublic String getCvvNumber();\n\tpublic String getCardHolderFirstName();\n\tpublic String getCardHolderLastName();\n\tpublic String getExpirationMonth();\n\tpublic String getExpirationYear();\n\tpublic String getBillingAddress();\n\tpublic String getBillingAddress2();\n\tpublic String getBillingCity();\n\tpublic States getBillingState();\n\tpublic String getBillingZipcode();\n\tpublic User getCreditCardHolder();\n\tpublic Boolean getPrimaryCreditCard();\n\tpublic Boolean getActive();\n\tpublic Date getCreationDate();\n\tpublic Date getModifiedDate();\n\tpublic Date getDeactivationDate();\n\t\n\t// Setter Methods\n\tpublic void setId(Long id);\n\tpublic void setCreditCardType(CreditCardType creditCardType);\n\tpublic void setAccountNumber(String accountNumber);\n\tpublic void setCvvNumber(String cvvNumber);\n\tpublic void setCardHolderFirstName(String cardHolderFirstName);\n\tpublic void setCardHolderLastName(String cardHolderLastName);\n\tpublic void setExpirationMonth(String expirationMonth);\n\tpublic void setExpirationYear(String expirationYear);\n\tpublic void setBillingAddress(String billingAddress);\n\tpublic void setBillingAddress2(String billAddress2);\n\tpublic void setBillingCity(String billingCity);\n\tpublic void setBillingState(States billingState);\n\tpublic void setBillingZipcode(String billingZipcode);\n\tpublic void setCreditCardHolder(User creditCardHolder);\n\tpublic void setPrimaryCreditCard(Boolean primaryCreditCard);\n\tpublic void setActive(Boolean active);\n\tpublic void setCreationDate(Date creationDate);\n\tpublic void setModifiedDate(Date modifiedDate);\n\tpublic void setDeactivationDate(Date deactivationDate);\n\n\t// Check to see if this card is active.\n\tpublic Boolean isActive();\n\t\n\t// Check to see if this card is the primary one for the account\n\tpublic Boolean isPrimaryCreditCard();\n\t\n\t// See if the card has expired.\n\tpublic Boolean hasCardExpired(Date currentDate);\n}", "List<ResourceType> resourceTypes();", "public PaymentTypeObject[] getAllPaymentTypes() throws AppException;", "private List<Document> generateCC(final Optional<String> cardType, final boolean expRequired,\n final boolean cvvRequired, final long quantity) {\n\n\n List<Document> creditCardList = new ArrayList<>();\n\n CommonUtil.CCList.stream().filter(\n ccType -> ccType.contains(!(cardType.isPresent() || cardType.get().equals(\"\"))\n ? CommonUtil.DEFAULT_CARD_TYPE : cardType.get()))\n .forEach(ccType -> {\n\n for(int qty = 0; qty < quantity; qty++) {\n\n String intermediateCardNumber = \"\";\n //boolean isValidLuhn;\n Document json = new Document();\n\n json.append(\"usrnm\",CommonUtil.generateUserName());\n\n //TODO really required Luhn check here?\n /*for(int trial = 1000; trial >= 1; trial--) {\n\n intermediateCardNumber = CommonUtil.generateRandomNumber(ccType.substring(0,19),\"x\", \"0123456789\");\n isValidLuhn = CommonUtil.luhnCheck(intermediateCardNumber.replaceAll(\" \", \"\"));\n\n if(isValidLuhn) {\n break;\n }\n }*/\n intermediateCardNumber = CommonUtil.generateRandomNumber(ccType.substring(0,19),\"x\", \"0123456789\");\n\n json.append(\"ctyp\",ccType.substring(20));\n json.append(\"cnum\",intermediateCardNumber);\n\n if (expRequired) {\n json.append(\"exp\",CommonUtil.generateExpDate());\n }\n if (cvvRequired) {\n //If Amex generate 4 digit CVV otherwise 3 digit cvv\n if(ccType.contains(\"American Express\")) {\n json.append(\"cvv\",CommonUtil.generateCvv(true));\n }else {\n json.append(\"cvv\",CommonUtil.generateCvv(false));\n }\n }\n\n creditCardList.add(json);\n\n }\n }\n );\n return creditCardList;\n }", "List<Type> getTypeList(String type);", "public List<SortedBag<Card>> possibleClaimCards() {\n List<SortedBag<Card>> cardCombinations = new ArrayList<>();\n List<Color> colors;\n boolean isUnderground = level == Level.UNDERGROUND;\n if (color == null) {\n colors = Color.ALL;\n } else {\n colors = List.of(color);\n }\n if (isUnderground) {\n for (int i = 0; i < length; i++) {\n for (Color c : colors) {\n cardCombinations.add(SortedBag.of(length - i, Card.of(c), i, Card.LOCOMOTIVE));\n }\n }\n //add all locomotive combination at end\n cardCombinations.add(SortedBag.of(length, Card.LOCOMOTIVE));\n }\n if (!isUnderground) {\n for (Color c : colors) {\n cardCombinations.add(SortedBag.of(length, Card.of(c)));\n }\n }\n\n return cardCombinations;\n }" ]
[ "0.72178316", "0.7051966", "0.689042", "0.6473996", "0.62994933", "0.6287921", "0.6268604", "0.62111926", "0.6199311", "0.6049129", "0.60266566", "0.60073715", "0.5993732", "0.5954985", "0.58866465", "0.5828697", "0.5827354", "0.58161366", "0.58005214", "0.5783326", "0.57754004", "0.5754328", "0.5742161", "0.57344836", "0.56959814", "0.56922233", "0.56897503", "0.56897503", "0.5681993", "0.5671723", "0.56488246", "0.564367", "0.56432134", "0.5608912", "0.5607636", "0.55944854", "0.5564823", "0.55495274", "0.54877716", "0.5478762", "0.54785556", "0.5449558", "0.5444629", "0.5432613", "0.5416386", "0.54140294", "0.53902787", "0.53821534", "0.5382038", "0.53747004", "0.53747004", "0.53747004", "0.53716755", "0.5365918", "0.5365918", "0.53634965", "0.5351977", "0.53486234", "0.53323853", "0.53307754", "0.53209305", "0.53155327", "0.5313439", "0.5310203", "0.5308589", "0.53077596", "0.5302381", "0.52804905", "0.5280267", "0.52630043", "0.52566147", "0.52502257", "0.5242874", "0.52376634", "0.52311486", "0.523112", "0.52228403", "0.52228403", "0.5221572", "0.5216679", "0.5215072", "0.52107173", "0.51996017", "0.519617", "0.5195354", "0.5193448", "0.5187489", "0.51822704", "0.5179447", "0.5153572", "0.5149399", "0.5149346", "0.51416415", "0.51365197", "0.51306164", "0.5125462", "0.51098233", "0.5108813", "0.51086843", "0.5096767" ]
0.8500915
0
Sets the list of supported credit card types.
public void setSupportedCreditCardTypes(List<String> pSupportedCreditCardTypes) { mSupportedCreditCardTypes = pSupportedCreditCardTypes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String setCardTypes()\n\t{\n\t\tString creditCards = \"vi-mc\";\n\t\tcreditCards = (DISCOVER_IMAGE == \"discvr.gif\") ? (creditCards + \"-di\") : creditCards;\n\t\tcreditCards = (AMEX_IMAGE == \"amex.gif\") ? (creditCards + \"-am\") : creditCards;\n\t\treturn creditCards;\n\t}", "public List<String> getSupportedCreditCardTypes() {\n return mSupportedCreditCardTypes;\n }", "public void setCreditCardType (String CreditCardType);", "public abstract void setPaymentTypes(java.util.Set paymentTypes);", "public org.xms.g.common.AccountPicker.AccountChooserOptions.Builder setAllowableAccountsTypes(java.util.List param0) {\n throw new java.lang.RuntimeException(\"Not Supported\");\n }", "public void setCards(List<T> cards) {\n\t\tthis.cards = cards;\n\t}", "public void setCreditCard(eBLBaseComponents.apis.ebay.CreditCardDetailsType creditCard) {\r\n this.creditCard = creditCard;\r\n }", "public void setTypes(List<CWLType> types) {\n this.types = types;\n }", "public void setCardType(Byte cardType) {\r\n this.cardType = cardType;\r\n }", "public void setCardtype(Integer cardtype) {\n this.cardtype = cardtype;\n }", "public void setTypes(ArrayList<String> types){\n this.types = types;\n }", "public abstract void setCurrencyType(String currencyType);", "public void setAccept(List<MediaType> acceptableMediaTypes)\r\n/* 82: */ {\r\n/* 83:139 */ set(\"Accept\", MediaType.toString(acceptableMediaTypes));\r\n/* 84: */ }", "public final void setTypes(AutocompleteType... types) {\n if (types == null) {\n return;\n }\n String[] stypes = new String[types.length]; \n for (int i=0; i < types.length; i++) {\n stypes[i] = types[i].value();\n }\n JsArrayString a = ArrayHelper.toJsArrayString(stypes);\n setTypesImpl(a);\n }", "public void setCardType(java.lang.String cardType) {\r\n this.cardType = cardType;\r\n }", "public void setAcceptedMediaTypes(\n List<Preference<MediaType>> acceptedMediaTypes) {\n this.acceptedMediaTypes = acceptedMediaTypes;\n }", "public void setCardType(int cardType) {\n\t\t\tthis.cardType = cardType;\n\t\t}", "public void setSupportedRecordTypes(Collection<String> supportedRecordTypes) {\n\t\tthis.supportedRecordTypes = supportedRecordTypes;\n\t}", "public void setFileTypes(String[] fileTypes);", "public String getCreditCardType();", "public void setCharSet(List<Character> charSet){\n mCharSet = charSet;\n }", "public void setClearCards(String type) {\r\n int currentSize = getGiftCardList().size();\r\n \r\n setGiftCardList(new ArrayList());\r\n for (int i = 0; i < currentSize; i++) {\r\n addBlankGiftCard(getGiftCardList());\r\n }\r\n \r\n setGiftCardTempList(new ArrayList());\r\n for (int i = 0; i < getMaxNumGiftCards(); i++) {\r\n addBlankGiftCard(getGiftCardTempList());\r\n }\r\n }", "public void setTypes(ResultFormat[] types) {\n\n this.types = types != null ? types.clone() : null;;\n }", "@JsonSetter(\"fieldTypes\")\r\n public void setFieldTypes (List<DocumentFieldType> value) { \r\n this.fieldTypes = value;\r\n }", "void onCardTypeChange(String type);", "String [] getSupportedTypes();", "public abstract void setPhoneTypes(Vector vecPhoneTypes, Vector vecPhoneTypeKeys);", "public Builder setSupportedTripTypesValue(\n int index, int value) {\n ensureSupportedTripTypesIsMutable();\n supportedTripTypes_.set(index, value);\n onChanged();\n return this;\n }", "public void setAcceptCharset(List<Charset> acceptableCharsets)\r\n/* 93: */ {\r\n/* 94:157 */ StringBuilder builder = new StringBuilder();\r\n/* 95:158 */ for (Iterator<Charset> iterator = acceptableCharsets.iterator(); iterator.hasNext();)\r\n/* 96: */ {\r\n/* 97:159 */ Charset charset = (Charset)iterator.next();\r\n/* 98:160 */ builder.append(charset.name().toLowerCase(Locale.ENGLISH));\r\n/* 99:161 */ if (iterator.hasNext()) {\r\n/* 100:162 */ builder.append(\", \");\r\n/* 101: */ }\r\n/* 102: */ }\r\n/* 103:165 */ set(\"Accept-Charset\", builder.toString());\r\n/* 104: */ }", "public void setDataFormatTypes(String dataFormatTypes) {\n this.dataFormatTypes = dataFormatTypes;\n }", "public String getCardType() {\n return cardType;\n }", "public void setCardType(String cardType) {\n this.cardType = cardType == null ? null : cardType.trim();\n }", "private void setPlayerDeckByCardType(List<CardModel> cards, EnumHandler.CardType cardType) {\n ArrayList<CardModel> playerCards=playerModel.getDeck();\n ArrayList<CardModel> playerCardsToRemove=new ArrayList<CardModel>();\n int cardCounter=0;\n int cardsLimit=(3 * (cards.size()/ 3));\n if(cards!=null){\n\n for (int i = 0; i < playerCards.size(); i++){\n if(playerCards.get(i).getCardType() == cardType && cardCounter<cardsLimit){\n playerCardsToRemove.add(playerCards.get(i));\n cardCounter=cardCounter+1;\n }\n }\n if(playerCardsToRemove.size() >0) {\n playerCards.removeAll(playerCardsToRemove);\n }\n cardCounter=0;\n }\n }", "private void initializeDeck() {\r\n\t\t// Loop over the 4 card suits\r\n\t\tfor (Suit suit : Suit.values()) {\r\n\t\t\t// Loop over 13 card types\r\n\t\t\tfor (CardType value : CardType.values()) {\r\n\t\t\t\tcards.addCard(new Card(suit, value));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setType(String type);", "public void setType(String type);", "public void setType(String type);", "public abstract void setCrcdReimbTypeCd(String crcdReimbTypeCd);", "public Set<MediaType> getSupportedMediaTypes();", "public void setContractTypeItems(){\r\n\t\tComboItem[] comboItems;\r\n\t\t//array list is used as interim solution due to the fact that regular arrays size is immutable\r\n\t\tArrayList<ComboItem> itemList = new ArrayList<ComboItem>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t//Query database and populate array list with values. \r\n\t\t\tResultSet result = CONTRACT_TYPE_OPTIONS.executeQuery();\r\n\t\t\twhile(result.next()){\r\n\t\t\t\titemList.add(new ComboItem(result.getInt(1), result.getString(2)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Initialise new array with needed size\r\n\t\t\tcomboItems = new ComboItem[itemList.size()];\r\n\t\t\t//convert arraylist object into array\r\n\t\t\tcomboItems = itemList.toArray(comboItems);\r\n\t\t} catch (SQLException e) {\r\n\t\t\t//initialise empty array to be returned\r\n\t\t\tcomboItems = new ComboItem[0];\r\n\t\t\tlogger.log(Level.SEVERE, e.getMessage());\r\n\t\t} \r\n\t\t\r\n\t\tthis.contract_types = comboItems;\r\n\t}", "public int getCardType() {\n\t\t\treturn cardType;\n\t\t}", "@Override\n public Set<String> validTypes() {\n return factory.validTypes();\n }", "List<CmdType> getSupportedTypes();", "@Override\n public void initializeBoard(List<DevelopmentCard> towersCardsList) {\n List<String> list = new ArrayList<>();\n towersCardsList.forEach((developmentCard -> list.add(developmentCard.getName())));\n try {\n if (getClientInterface() != null)\n getClientInterface().setTowersCards(list);\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending tower cards error\");\n }\n }", "public void setCtype(String ctype) {\n this.ctype = ctype;\n }", "static /* synthetic */ void m56321b(HoneyPayMainUI honeyPayMainUI, List list) {\n AppMethodBeat.m2504i(41910);\n ArrayList arrayList = new ArrayList();\n if (!(list == null || list.isEmpty())) {\n for (asj honeyPayCardType : list) {\n arrayList.add(new HoneyPayCardType(honeyPayCardType));\n }\n }\n Intent intent = new Intent(honeyPayMainUI, HoneyPaySelectCardTypeUI.class);\n intent.putParcelableArrayListExtra(\"key_card_type_list\", arrayList);\n honeyPayMainUI.startActivity(intent);\n AppMethodBeat.m2505o(41910);\n }", "public void setBankAccountType (String BankAccountType);", "public java.lang.String getCardType() {\r\n return cardType;\r\n }", "void setInputs(List<ContractIOType> inputs) {\n this.inputs = inputs;\n }", "public void setDiscountTypes(DiscountTypes aDiscountTypes) {\n discountTypes = aDiscountTypes;\n }", "public void setAcceptedCharacterSets(\n List<Preference<CharacterSet>> acceptedCharacterSets) {\n this.acceptedCharacterSets = acceptedCharacterSets;\n }", "public Builder setSupportedTripTypes(\n int index, google.maps.fleetengine.v1.TripType value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureSupportedTripTypesIsMutable();\n supportedTripTypes_.set(index, value.getNumber());\n onChanged();\n return this;\n }", "public void setPaymentMethodCode_CreditCard() {\n setPaymentMethodCodeAsPaymentMethod(AppCDef.PaymentMethod.CreditCard);\n }", "public void setContentTypes(List<ContentTypeMappingValue> contentTypes) {\r\n\t\tthis.contentTypes = contentTypes;\r\n\t}", "public void setCreditCard(String creditCard)\n\t{\n\t\tm_creditCard = creditCard;\n\t}", "default void listAcceleratorTypes(\n com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest request,\n io.grpc.stub.StreamObserver<com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse>\n responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getListAcceleratorTypesMethod(), responseObserver);\n }", "public void setCardList(ArrayList<DestinationCard> list) {\n destinationCards = list;\n }", "public Builder setCharSet(List<Character> charSet){\n mCharSet = charSet;\n return this;\n }", "public void setType(int nType) { m_nType = nType; }", "List<CardTypeDTO> lookupCardTypes();", "public void listAcceleratorTypes(\n com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest request,\n io.grpc.stub.StreamObserver<com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse>\n responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getListAcceleratorTypesMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "void setType(java.lang.String type);", "public void setSupports(long supports);", "@ReactMethod\n public void setReportTypes(final ReadableArray types) {\n MainThreadHandler.runOnMainThread(new Runnable() {\n @SuppressLint(\"WrongConstant\")\n @Override\n public void run() {\n try {\n final ArrayList<String> keys = ArrayUtil.parseReadableArrayOfStrings(types);\n final ArrayList<Integer> types = ArgsRegistry.reportTypes.getAll(keys);\n\n final int[] typesInts = new int[types.size()];\n for (int i = 0; i < types.size(); i++) {\n typesInts[i] = types.get(i);\n }\n\n BugReporting.setReportTypes(typesInts);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n }", "public void setMemberTypes(java.util.List memberTypes)\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(MEMBERTYPES$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(MEMBERTYPES$2);\n }\n target.setListValue(memberTypes);\n }\n }", "public void setDataSourceTypes (List<DataSourceType> dataSourceTypes) {\n this.dataSourceTypes = dataSourceTypes;\n }", "public void setAcrs(List<ACR> acrList) {\n this.acrs = acrList;\n }", "public void setCards(Card[] cards) {\r\n this.cards = cards;\r\n }", "public void setAllowedPlaneTypes(EnumSet<Plane.Type> allowedPlaneTypes) {\n this.allowedPlaneTypes = allowedPlaneTypes;\n }", "public void setValidType(int value) {\r\n this.validType = value;\r\n }", "public Builder addSupportedTripTypesValue(int value) {\n ensureSupportedTripTypesIsMutable();\n supportedTripTypes_.add(value);\n onChanged();\n return this;\n }", "public void setActionTypes(Set<ActionTypeDescriptor> actionTypes) {\r\n this.actionTypes = actionTypes;\r\n }", "void setPossibleValues(List<? extends Suggest<?>> possibleValues);", "public void setType(String type) {\n if (this.type == null)\n this.type = type;\n else throw new IllegalStateException(\"Chip already has a type.\");\n }", "public CardTypes getType() {\n\t\treturn type;\n\t}", "public boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber,\n String creditCardVV, String creditCardExp) {\n return setCreditCard(TrxType, creditCardType, creditCardNumber,\n creditCardVV, MPaymentValidate.getCreditCardExpMM(creditCardExp),\n MPaymentValidate.getCreditCardExpYY(creditCardExp));\n }", "public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}", "public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}", "public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}", "public void setMemberTypes( java.util.List memberTypes )\n\t{\n\t}", "void setIdentityTokenTypes(org.apache.geronimo.corba.xbeans.csiv2.tss.TSSIdentityTokenTypeList identityTokenTypes);", "private static void initNumberTypeList()\n\t{\n\t\tfor(String numberType : NUMBER_TYPE_ARRAY)\n\t\t{\n\t\t\tnumberTypeList.add(numberType);\n\t\t}\n\t\tlogger.info(\" --|*|-- Number types are initialized! --|*|--\");\n\t}", "void setDataType(int type );", "public void setSupportedClaims(Map<String, InfocardClaim> claims) {\n supportedClaims = claims;\n }", "void addConstructorParametersTypes(final List<Class<?>> parametersTypes) {\r\n\t\tconstructorParametersTypes.add(parametersTypes);\r\n\t}", "public void setServiceType(typekey.ReviewServiceType value);", "public String getCardType()\n\t{\n\t\tif(response.containsKey(\"CARD_TYPE\")) {\n\t\t\treturn response.get(\"CARD_TYPE\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public void setSpecialReviewTypeCodes(Vector specialReviewTypeCodes){ \r\n this.vecSpecialReviewCode = specialReviewTypeCodes;\r\n specialReviewForm.setSpecialReviewTypeCodes(this.vecSpecialReviewCode);\r\n }", "public void setCardPower(List<CardPower> cardPower) {\n this.cardPower = cardPower;\n }", "public void setType (int nType)\n\t{\n\t\tm_nType = nType;\n\t}", "public void setRegitemTypes(RegitemTypes aRegitemTypes) {\n regitemTypes = aRegitemTypes;\n }", "public abstract java.util.Set getPaymentTypes();", "public Set<Class<?>> getTypes() {\n\t\treturn dataTypes;\n\t}", "public Set<Class<?>> getTypes() {\n\t\treturn dataTypes;\n\t}", "public Byte getCardType() {\r\n return cardType;\r\n }", "private void setBasicType(Class c)\n {\n if (Boolean.class.equals(c))\n {\n type = BasicTypes.BOOLEAN;\n }\n else if (Character.class.equals(c))\n {\n type = BasicTypes.CHARACTER;\n }\n else if (Byte.class.equals(c))\n {\n type = BasicTypes.BYTE;\n }\n else if (Short.class.equals(c))\n {\n type = BasicTypes.SHORT;\n }\n else if (Integer.class.equals(c))\n {\n type = BasicTypes.INTEGER;\n }\n else if (Long.class.equals(c))\n {\n type = BasicTypes.LONG;\n }\n else if (Float.class.equals(c))\n {\n type = BasicTypes.FLOAT;\n }\n else if (Double.class.equals(c))\n {\n type = BasicTypes.DOUBLE;\n }\n else\n {\n type = BasicTypes.OTHER;\n }\n }", "public void setPaymentMethods(final List<BrainTreePaymentInfo> value)\n\t{\n\t\tsetPaymentMethods( getSession().getSessionContext(), value );\n\t}", "public boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber,\n String creditCardVV, int creditCardExpMM, int creditCardExpYY) {\n setTenderType(TENDERTYPE_CreditCard);\n setTrxType(TrxType);\n //\n setCreditCardType(creditCardType);\n setCreditCardNumber(creditCardNumber);\n setCreditCardVV(creditCardVV);\n setCreditCardExpMM(creditCardExpMM);\n setCreditCardExpYY(creditCardExpYY);\n //\n int check = MPaymentValidate.validateCreditCardNumber(creditCardNumber, creditCardType).length()\n + MPaymentValidate.validateCreditCardExp(creditCardExpMM, creditCardExpYY).length();\n if (creditCardVV.length() > 0) {\n check += MPaymentValidate.validateCreditCardVV(creditCardVV, creditCardType).length();\n }\n return check == 0;\n }", "public Integer getCardtype() {\n return cardtype;\n }", "public final void setApplicationTypes(List<Application.ApplicationType> applicationTypes){\n\t\tJSONArray array = new JSONArray();\n\t\tfor(int i = 0; i < applicationTypes.size(); i++){\n\t\t\tarray.set(i, new JSONString(applicationTypes.get(i).toString().toUpperCase()));\n\t\t}\n\t\tthis.setApplicationTypes(array.getJavaScriptObject());\n\t}" ]
[ "0.6845029", "0.6797601", "0.67631316", "0.6216405", "0.6048768", "0.56479585", "0.562239", "0.5561732", "0.55073094", "0.5457847", "0.5393803", "0.5349167", "0.5335542", "0.5291529", "0.5227879", "0.5211833", "0.52023727", "0.5198312", "0.5196268", "0.51907843", "0.5145643", "0.51397824", "0.51379406", "0.512427", "0.5123532", "0.5120298", "0.51032037", "0.50934404", "0.5092103", "0.50807357", "0.50646937", "0.5022741", "0.5017649", "0.50098014", "0.50048816", "0.50048816", "0.50048816", "0.49753663", "0.49491143", "0.494814", "0.4946111", "0.4932515", "0.48999098", "0.48638344", "0.485122", "0.48364443", "0.48341563", "0.48317018", "0.48260695", "0.48230156", "0.481384", "0.47873586", "0.4784454", "0.47818798", "0.47713846", "0.47655416", "0.47628072", "0.47534406", "0.47525266", "0.4729659", "0.4723268", "0.47073454", "0.47072053", "0.4707063", "0.47052893", "0.4705029", "0.47036773", "0.47034296", "0.46968016", "0.46778843", "0.4676394", "0.467055", "0.46542993", "0.46536565", "0.46532422", "0.46473676", "0.4624435", "0.4624435", "0.4624435", "0.46223807", "0.46206942", "0.4607598", "0.45946014", "0.45888174", "0.45886087", "0.45870224", "0.4585801", "0.4583473", "0.45794138", "0.45792463", "0.45763558", "0.45726258", "0.4572433", "0.4572433", "0.45704985", "0.4564797", "0.45645127", "0.45631936", "0.4549279", "0.45488083" ]
0.81278086
0
It's easier on the eyes to use single quotes rather than escaped double quotes; this then converts into valid JSON
public static String replaceQuotes(String orig) { return orig.replaceAll("'", "\""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static String getStringJsonEscaped(String str) {\n JsonStringEncoder e = JsonStringEncoder.getInstance();\n StringBuilder sb = new StringBuilder();\n e.quoteAsString(str, sb);\n return sb.toString();\n }", "public static String jsonQuote(String value) {\n\tif (value == null)\n\t return null;\n\telse\n\t return String.format(\"\\\"%s\\\"\", value);\n }", "String toJson() throws IOException;", "public static void main(String[] args) {\n String jsonText = \"{'name': 'Yuki', 'feedback': 'OK'}\";\r\n jsonText = jsonText.replaceAll(\"(')\", \"\\\"\");\r\n\r\n System.out.println(jsonText);\r\n }", "public String renderJsonString(Object model) {\r\n \r\n StringBuffer buffer = new StringBuffer();\r\n jsonSerializer.deepSerialize(model, buffer);\r\n StringBuilder jsonResponse = new StringBuilder();\r\n jsonResponse.append(buffer);\r\n \r\n //Pattern.compile(regex).matcher(str).replaceAll(repl)\r\n String s = pattrenEscapedBackquote.matcher(jsonResponse.toString()).replaceAll(\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");\r\n //String s = jsonResponse.toString().replaceAll(\"\\\\\\\\\\\\\\\\\", \"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");\r\n s = pattrenEscapedQuoubleQuotePrefixedwithBackquote.matcher(s).replaceAll(\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\");\r\n //s = s.replaceAll(\"\\\\\\\\\\\\\\\"\", \"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\");\r\n s = pattrenForDoubleQuote.matcher(s).replaceAll(\"$1\\\\\\\\\\\"\");\r\n s = pattrenEscapedQuoubleQuoteNotPrefixedwithBackquote.matcher(s).replaceAll(\"$1\\\\\\\\\\\"\");\r\n //s = s.replaceAll(\"([^\\\\\\\\])\\\"\", \"$1\\\\\\\\\\\"\");\r\n \r\n return (\"\\\"\" + s + \"\\\"\");\r\n }", "String toJSON();", "public abstract String toJsonString();", "private String doubleQuote( String raw ) { return '\"' + raw + '\"'; }", "public String toJsonString() {\n String str;\n String str2;\n try {\n if (this.lifetime == null) {\n str = \"null\";\n } else {\n str = \"\\\"\" + this.lifetime.toString() + \"\\\"\";\n }\n if (this.frequency == null) {\n str2 = \"\";\n } else {\n str2 = \",\\\"frequency\\\":\" + this.frequency;\n }\n return \"{\\\"enabled\\\":\" + this.enabled + str2 + \",\\\"lifetime\\\":\" + str + \"}\";\n } catch (Exception e) {\n C3490e3.m663c(e.getMessage());\n return \"\";\n }\n }", "public static Value makeJSONStr() {\n return theJSONStr;\n }", "public abstract String toJson();", "public String toJson(final String object) {\n if (object != null && (object.startsWith(\"[\") || object.startsWith(\"{\")\n || (object.startsWith(\"\\\"[\") || object.startsWith(\"\\\"{\")))) {\n return object;\n } else\n return \"{\\\"\" + \"{\\\"success\\\" : 1}\" + \"\\\":\\\"\" + object + \"\\\"}\";\n }", "public static Example stringToJSON(String s){\n Gson gson = new Gson();\n JsonReader reader = new JsonReader(new StringReader(s));\n reader.setLenient(true);\n\n Example ex = gson.fromJson(reader, Example.class);\n\n return ex;\n }", "public String toJSON() throws JSONException;", "protected String convertToJSON(List<NewsItem> newsItems) {\n Gson gson = new GsonBuilder().disableHtmlEscaping().create();\n return gson.toJson(newsItems);\n }", "public String toJsonObject() {\n if (this.isEmpty()) return \"\";\n StringBuilder sb = new StringBuilder(this.filterExpression.length() + 30);\n sb.append(\"\\\"keyFilter\\\" : \\\"\");\n sb.append(this.filterExpression);\n sb.append(\"\\\"\");\n return sb.toString();\n }", "@Override\n\tprotected String toJSON()\n\t{\n\t\treturn getJSON(null);\n\t}", "public static String encodeJsString(String s) throws Exception {\r\n StringBuilder sb = new StringBuilder();\r\n sb.append(\"\\\"\");\r\n for (Character c : s.toCharArray())\r\n {\r\n switch(c)\r\n {\r\n case '\\\"': \r\n sb.append(\"\\\\\\\"\");\r\n break;\r\n case '\\\\': \r\n sb.append(\"\\\\\\\\\");\r\n break;\r\n case '\\b': \r\n sb.append(\"\\\\b\");\r\n break;\r\n case '\\f': \r\n sb.append(\"\\\\f\");\r\n break;\r\n case '\\n': \r\n sb.append(\"\\\\n\");\r\n break;\r\n case '\\r': \r\n sb.append(\"\\\\r\");\r\n break;\r\n case '\\t': \r\n sb.append(\"\\\\t\");\r\n break;\r\n default: \r\n Int32 i = (int)c;\r\n if (i < 32 || i > 127)\r\n {\r\n sb.append(String.format(StringSupport.CSFmtStrToJFmtStr(\"\\\\u{0:X04}\"),i));\r\n }\r\n else\r\n {\r\n sb.append(c);\r\n } \r\n break;\r\n \r\n }\r\n }\r\n sb.append(\"\\\"\");\r\n return sb.toString();\r\n }", "protected static String buildJson(String key, String value) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\\\"\").append(key).append(\"\\\":\\\"\").append(value).append(\"\\\"}\");\n return sb.toString();\n }", "@Override\r\n\tprotected void convertStringConst(String str) {\r\n\t\tappend(\"\\'\\\"\", str.replace(\"\\'\",\"\\'\\'\"), \"\\\"\\'\");\r\n\t}", "@Test\n public void testToJSONString() {\n System.out.println(\"toJSONString\");\n Setting s = Setting.factory();\n s.setStype(Setting.SETTING_TYPE.TPATH);\n s.setName(\"mytest\");\n String userFile = System.getProperty(\"user.dir\");\n\n s.setValue(Paths.get(userFile));\n String jResult = s.toJSONString();\n String jExpected = \"{\\\"stype\\\":\\\"TPATH\\\",\\\"name\\\":\\\"mytest\\\",\\\"value\\\":\\\"J:\\\\\\\\Java\\\\\\\\DBCUtilLib\\\"}\";\n assertEquals(jExpected, jResult);\n\n s.setValue(Setting.SETTING_TYPE.TPATH, Paths.get(userFile));\n jResult = s.toJSONString();\n assertEquals(jExpected, jResult);\n\n }", "@Override\n public String stringify()\n {\n return StringUtils.format(\"\\\"%s\\\"\", StringEscapeUtils.escapeJava(binding));\n }", "public String toJsonString() {\n\t\tString json = null;\n\t\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.setSerializationInclusion(Include.NON_NULL);\n\t\tmapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);\n\t\ttry {\n\t\t\tjson = mapper.writeValueAsString(this);\n\t\t} catch (JsonProcessingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn json;\n\t}", "private static String escapeDoubleQuotes(String s) {\n\n if (s == null || s.length() == 0 || s.indexOf('\"') == -1) {\n return s;\n }\n\n StringBuffer b = new StringBuffer();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (c == '\"')\n b.append('\\\\').append('\"');\n else\n b.append(c);\n }\n\n return b.toString();\n }", "public static String formatJSONStringFromResponse(String apiString) {\n String remove_new_line = apiString.replace(\"\\\\n\", \"\\\\\");\n String remove_begin_slash = remove_new_line.replace(\"\\\"{\", \"{\");\n String remove_end_slash = remove_begin_slash.replace(\"}\\\"\", \"}\");\n String remove_extra_slashes = remove_end_slash.replace(\"\\\\\", \"\");\n return remove_extra_slashes;\n }", "public JSONString(String stringIn)\n {\n this.string = stringIn;\n }", "private JSON() {\n\t}", "public String toJson()\n\t{\n\t\tJsonStringEncoder encoder = JsonStringEncoder.getInstance();\n\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append('{');\n\n\t\tboolean needComma = true;\n\t\tif (m_Message != null)\n\t\t{\n\t\t\tchar [] message = encoder.quoteAsString(m_Message.toString());\n\t\t\tbuilder.append(\"\\n \\\"message\\\" : \\\"\").append(message).append('\"').append(',');\n\t\t\tneedComma = false;\n\t\t}\n\n\t\tif (m_ErrorCode != null)\n\t\t{\n\t\t\tbuilder.append(\"\\n \\\"errorCode\\\" : \").append(m_ErrorCode.getValueString());\n\t\t\tneedComma = true;\n\t\t}\n\n\t\tif (m_Cause != null)\n\t\t{\n\t\t\tif (needComma)\n\t\t\t{\n\t\t\t\tbuilder.append(',');\n\t\t\t}\n\t\t\tchar [] cause = encoder.quoteAsString(m_Cause.toString());\n\t\t\tbuilder.append(\"\\n \\\"cause\\\" : \\\"\").append(cause).append('\"');\n\t\t}\n\n\t\tbuilder.append(\"\\n}\\n\");\n\n\t\treturn builder.toString();\n\t}", "static public Json wrapString(String string, QName type) {\n JsonObject json = new JsonObject();\n json.put(Manager.XP_VALUE.toString(), string);\n json.put(Manager.XP_TYPE.toString(), type.toString());\n return json;\n }", "private static void writeJSONString(Map<?, ?> map, Appendable out) throws IOException {\n @Var boolean first = true;\n\n out.append('{');\n for (Map.Entry<?, ?> entry : map.entrySet()) {\n if (first) {\n first = false;\n } else {\n out.append(',');\n }\n out.append('\\\"');\n escape(String.valueOf(entry.getKey()), out);\n out.append('\\\"');\n out.append(':');\n writeJSONString(entry.getValue(), out);\n }\n out.append('}');\n }", "public String toJSONString() throws CharConversionException, UnsupportedEncodingException {\n return objectMap.toJSONString();\n }", "public String encodeValue(String value) {\r\n\t\treturn (null == value) ? \"\" : JSONUtil.encodeString(value);\r\n\t}", "public String toJson() {\n\n final StringBuilder jsonRepresentation = new StringBuilder();\n\n jsonRepresentation.append(\"[\");\n\n final Iterator<TrackingDataEntry> entriesIter = getEntries().iterator();\n while (entriesIter.hasNext()) {\n\n final TrackingDataEntry entry = entriesIter.next();\n\n serializeTrackingDataVariables(jsonRepresentation, entry.getVars());\n\n if (null != entry.getName()) {\n jsonRepresentation.append(\",\\\"name\\\":\\\"\").append(entry.getName()).append(\"\\\"\");\n }\n if (null != entry.getId()) {\n jsonRepresentation.append(\",\\\"id\\\":\\\"\").append(entry.getId()).append(\"\\\"\");\n }\n if (null != entry.getType()) {\n jsonRepresentation.append(\",\\\"type\\\":\\\"\").append(entry.getType()).append(\"\\\"\");\n }\n if (null != entry.getUrl()) {\n jsonRepresentation.append(\",\\\"url\\\":\\\"\").append(entry.getUrl()).append(\"\\\"\");\n }\n jsonRepresentation.append(\"}\");\n if (entriesIter.hasNext()) {\n jsonRepresentation.append(\",\");\n }\n }\n\n jsonRepresentation.append(\"]\");\n\n return jsonRepresentation.toString();\n }", "@org.junit.Test\n public void jsString()\n {\n assertEquals(\"empty\", \"''\", Encodings.toJSString(\"\"));\n assertEquals(\"simple\", \"'test'\", Encodings.toJSString(\"test\"));\n assertEquals(\"escape\", \"'escape \\\\\\'\\\\\\\"strings\\\\\\\"\\\\''\",\n Encodings.toJSString(\"escape '\\\"strings\\\"'\"));\n }", "public String toJsonString() {\n JSONObject jsonObject = new JSONObject();\n try {\n jsonObject.put(\"from\", from);\n jsonObject.put(\"domain\", domain);\n jsonObject.put(\"provider\", provider);\n jsonObject.put(\"action\", action);\n\n try {\n JSONObject jsonData = new JSONObject();\n for (Map.Entry<String, String> entry : data.entrySet()) {\n jsonData.put(entry.getKey(), entry.getValue());\n }\n jsonObject.put(\"data\", jsonData);\n } catch (Exception e) {\n e.printStackTrace();\n jsonObject.put(\"data\", \"{}\");\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return jsonObject.toString();\n }", "String toJSONString(Object data);", "public String convertToJSON()\n\t{\n\t\tString json = \"\";\n\n\t\t//Engine and Rule info\n\t\tjson = \t\" \\\"infEngine\\\" : \\\"\"+ inferenceEngine +\"\\\", \" +\n\t\t\t\t\" \\\"infEngURI\\\" : \\\"\"+ infEngURI +\"\\\", \" +\n\t\t\t\t\" \\\"declRule\\\" : \\\"\"+ declarativeRule +\"\\\", \" +\n\t\t\t\t\" \\\"declRuleURI\\\" : \\\"\"+ decRuleURI +\"\\\" \";\n\n\t\t//Antecedent info\n\t\tif(antecedentRawStrings != null)\n\t\t{\n\n\t\t\tString jsonArray = \" [ \";\n\n\t\t\tint i;\n\t\t\tfor(i=0; i < antecedentRawStrings.length -1 ; i++)\n\t\t\t{\n\t\t\t\tString currAntecedentRawString = JSONUtils.toValidJSONString(antecedentRawStrings[i]);\n\t\t\t\tjsonArray += \"{ \\\"antecedentRawString\\\" : \\\"\"+ currAntecedentRawString +\"\\\" , \\\"antecedentURI\\\" : \\\"\"+ antecedentURIs[i] +\"\\\" \";\n\t\t\t\tif(antecedentCachedThumbURL[i] != null)\n\t\t\t\t\tjsonArray +=\", \\\"antecedentCachedThumbURL\\\" : \\\"\"+antecedentCachedThumbURL[i]+\"\\\" , \\\"antecedentConclusionURL\\\" : \\\"\"+antecedentConclusionURL[i]+\"\\\" }, \";\n\t\t\t\telse\n\t\t\t\t\tjsonArray +=\", \\\"antecedentCachedThumbURL\\\" : null , \\\"antecedentConclusionURL\\\" : \\\"\"+antecedentConclusionURL[i]+\"\\\" }, \";\n\t\t\t}\n\n\t\t\tString currAntecedentRawString = JSONUtils.toValidJSONString(antecedentRawStrings[i]);\n\t\t\t//insert last element and close the array.\n\t\t\tjsonArray += \"{ \\\"antecedentRawString\\\" : \\\"\"+ currAntecedentRawString +\"\\\" , \\\"antecedentURI\\\" : \\\"\"+ antecedentURIs[i] +\"\\\" \";\n\t\t\tif(antecedentCachedThumbURL[i] != null)\n\t\t\t\tjsonArray +=\", \\\"antecedentCachedThumbURL\\\" : \\\"\"+antecedentCachedThumbURL[i]+\"\\\" , \\\"antecedentConclusionURL\\\" : \\\"\"+antecedentConclusionURL[i]+\"\\\" } ]\";\n\t\t\telse\n\t\t\t\tjsonArray +=\", \\\"antecedentCachedThumbURL\\\" : null , \\\"antecedentConclusionURL\\\" : \\\"\"+antecedentConclusionURL[i]+\"\\\" } ]\";\n\n\n\t\t\tjson += \", \\\"antecedents\\\" : \"+ jsonArray;//+\", \";\n\n\t\t}\n\t\telse \n\t\t\tjson += \", \\\"antecedents\\\" : null\";//+\", \";\n\n\t\t//Metadata\n\t\t//json += \", \\\"metadata\\\" : \"+ ;\n\n\t\t//Assertions\n\t\t//json += \", \\\"assertions\\\" : \"+ ;\n\n\t\treturn \"{ \"+ json +\" }\";\n\t}", "public String toJson() throws Exception {\r\n\t\treturn SimpleJson.HashMapToText(getJsonToken());\r\n\t}", "private static String format(String value) {\n String result = value;\n if (result.contains(\"\\\"\")) {\n result = result.replace(\"\\\"\", \"\\\"\\\"\");\n }\n return result;\n\n }", "public final native String toJson() /*-{\n // Safari 4.0.5 appears not to honor the replacer argument, so we can't do this:\n \n // var replacer = function(key, value) {\n // if (key == '__key') {\n // return;\n // }\n // return value;\n // }\n // return $wnd.JSON.stringify(this, replacer);\n \n var key = this.__key;\n delete this.__key;\n var rf = this.__rf;\n delete this.__rf;\n var gwt = this.__gwt_ObjectId;\n delete this.__gwt_ObjectId;\n // TODO verify that the stringify() from json2.js works on IE\n var rtn = $wnd.JSON.stringify(this);\n this.__key = key;\n this.__rf = rf;\n this.__gwt_ObjectId = gwt;\n return rtn;\n }-*/;", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n String string0 = JSONObject.quote(\"\\\"\\\"\");\n assertEquals(\"\\\"\\\\\\\"\\\\\\\"\\\"\", string0);\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n String string0 = JSONObject.quote(\"f+\\n\");\n assertEquals(\"\\\"f+\\\\n\\\"\", string0);\n \n JSONObject jSONObject0 = new JSONObject();\n JSONArray jSONArray0 = jSONObject0.names();\n assertNull(jSONArray0);\n \n String string1 = JSONObject.valueToString(jSONObject0, 1566, 1566);\n assertEquals(\"{}\", string1);\n }", "public JsonFactory setCharacterEscapes(CharacterEscapes esc)\n/* */ {\n/* 666 */ this._characterEscapes = esc;\n/* 667 */ return this;\n/* */ }", "@Override\n public String toString() {\n //https://github.com/google/gson/issues/388\n\n String src = super.toString();\n StringBuilder builder = new StringBuilder(src.length() * 4);\n for (char c : src.toCharArray()) {\n if (c >= 0x80) {\n // 为所有非ASCII字符生成转义的unicode字符\n writeUnicodeEscape(builder, c);\n } else {\n // 为ASCII字符中前128个字符使用转义的unicode字符\n int code = (c < ESCAPE_CODES.length ? ESCAPE_CODES[c] : 0);\n if (code == 0) {\n // 此处不用转义\n builder.append(c);\n } else if (code < 0) {\n // 通用转义字符\n writeUnicodeEscape(builder, (char) (-code - 1));\n } else {\n // 短转义字符 (\\n \\t ...)\n builder.append(\"\\\\\").append((char) code);\n }\n }\n }\n return builder.toString();\n }", "static String wrap(Object value)\n/* */ {\n/* 156 */ if ((value == null) || (\"-\".equals(value))) {\n/* 157 */ return \"-\";\n/* */ }\n/* */ try\n/* */ {\n/* 161 */ svalue = value.toString();\n/* */ } catch (Throwable e) { String svalue;\n/* 163 */ ExceptionUtils.handleThrowable(e);\n/* */ \n/* 165 */ return \"-\";\n/* */ }\n/* */ \n/* */ String svalue;\n/* 169 */ StringBuilder buffer = new StringBuilder(svalue.length() + 2);\n/* 170 */ buffer.append('\"');\n/* 171 */ int i = 0;\n/* 172 */ while (i < svalue.length()) {\n/* 173 */ int j = svalue.indexOf('\"', i);\n/* 174 */ if (j == -1) {\n/* 175 */ buffer.append(svalue.substring(i));\n/* 176 */ i = svalue.length();\n/* */ } else {\n/* 178 */ buffer.append(svalue.substring(i, j + 1));\n/* 179 */ buffer.append('\"');\n/* 180 */ i = j + 1;\n/* */ }\n/* */ }\n/* */ \n/* 184 */ buffer.append('\"');\n/* 185 */ return buffer.toString();\n/* */ }", "@Test\n public void testBugFound151110() {\n String s = \"{\\\"names\\\":[{\\\"firstname\\\":\\\"Sebastian\\\",\\\"surname\\\":\\\"\\\\u00c5kesson\\\",\\\"gender\\\":\\\"male\\\"}]}\";\n Binson obj = Binson.fromJson(s);\n assertEquals(\"Åkesson\", obj.getArray(\"names\").getObject(0).getString(\"surname\"));\n }", "JSONObject toJson();", "JSONObject toJson();", "public final static JSONObject createLiteralAsJSONObject(final Literal literal) throws JSONException {\n\t\tfinal JSONObject literalJson = new JSONObject();\n\t\tliteralJson.put(\"type\", \"literal\");\n\t\tliteralJson.put(\"value\", literal.originalString());\n\t\treturn literalJson;\n\t}", "public String serializeJSON () {\n ObjectMapper mapper = new ObjectMapper();\n String jsonString = null;\n \n try {\n jsonString = mapper.writeValueAsString(this);\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n return jsonString;\n }", "@Override\n\tpublic JSON parse(String in) throws IOException {\n\t\tMyJSON js = new MyJSON();\n\t\t//count brackets make sure they match\n\t\tif(!syntaxOkay(in)){\n\t\t\tthrow new IllegalStateException(\"Mismatched brackets error\");\n\t\t}\n\t\t//get rid of spaces to make things easier\n\t\tString withoutSpaces = remove(in, ' ');\n\t\t//handles edge case of an empty object\n\t\tString withoutBraces = remove(withoutSpaces, '{');\n\t\twithoutBraces = remove(withoutBraces, '}');\n\t\tif(withoutBraces.length() == 0){\n\t\t\treturn js;\n\t\t}\n\t\tint colonIndex = in.indexOf(\":\");\n\t\tString key = in.substring(0, colonIndex);\n\t\tString value = in.substring(colonIndex + 1);\n\n\t\tif(value.contains(\":\")){\n\t\t\t//this means the value is an object so we figure out how many strings to add to the object\n\t\t\tString[] values = value.split(\",\");\n\t\t\t//creates a temp for the new object\n\t\t\tMyJSON temp = new MyJSON();\n\t\t\tfillObject(values, temp);\n\t\t\tkey = removeOutsides(key);\n\t\t\tjs.setObject(key, temp);\n\t\t}else{\n\t\t\t//the base case that actually puts things as a JSON object\n\t\t\tkey = removeOutsides(key);\n\t\t\tvalue = removeOutsides(value);\n\t\t\tjs.setString(key, value);\n\t\t}\n\n\t\treturn js;\n\t}", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n String string0 = JSONObject.quote(\",\\n\");\n assertEquals(\"\\\",\\\\n\\\"\", string0);\n \n HashMap<Integer, String> hashMap0 = new HashMap<Integer, String>();\n JSONObject jSONObject0 = new JSONObject((Map) hashMap0);\n Integer integer0 = new Integer(2526);\n hashMap0.replace(integer0, \"\\\",\\n\\\"\", \"\\\",\\n\\\"\");\n String string1 = jSONObject0.toString(545, 1230);\n assertEquals(\"{}\", string1);\n }", "public static String escapeJS(String inText)\n {\n return inText\n .replaceAll(\"(?<!\\\\\\\\)'\", \"\\\\\\\\'\")\n .replaceAll(\"(?<!\\\\\\\\)\\\"\", \"\\\\\\\\\\\"\")\n .replaceAll(\"\\n\", \"\\\\\\\\n\");\n }", "public String getAsJson() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"{\\\"code\\\": \\\"\").append(this.code).append(\"\\\", \");\n sb.append(\"\\\"color\\\": \\\"\").append(this.color).append(\"\\\", \");\n\n /* Append a size only if the product has a Size */\n if (this.size.getClass() != NoSize.class) {\n sb.append(\"\\\"size\\\": \\\"\").append(this.size).append(\"\\\", \");\n }\n\n sb.append(\"\\\"price\\\": \").append(this.price).append(\", \");\n sb.append(\"\\\"currency\\\": \\\"\").append(this.currency).append(\"\\\"}, \");\n\n return sb.toString();\n }", "private static String asJsonString(final Object obj) {\n try {\n return new ObjectMapper().writeValueAsString(obj);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "void mo16412a(String str, JSONObject jSONObject);", "@Override\n\tpublic String toJSON()\n\t{\n\t\tStringJoiner json = new StringJoiner(\", \", \"{\", \"}\")\n\t\t.add(\"\\\"name\\\": \\\"\" + this.name + \"\\\"\")\n\t\t.add(\"\\\"id\\\": \" + this.getId());\n\t\tString locationJSON = \"\"; \n\t\tif(this.getLocation() == null)\n\t\t{\n\t\t\tlocationJSON = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlocationJSON = this.getLocation().toJSON(); \n\t\t}\n\t\tjson.add(\"\\\"location\\\": \" + locationJSON);\n\t\tStringJoiner carsJSON = new StringJoiner(\", \", \"[\", \"]\");\n\t\tfor(Object r : cars)\n\t\t{\n\t\t\tcarsJSON.add(((RollingStock) r).toJSON());\n\t\t}\n\t\tjson.add(\"\\\"cars\\\": \" + carsJSON.toString());\n\t\treturn json.toString(); \n\t}", "String getJSON();", "@SuppressWarnings(\"unchecked\")\n @Override\n public String toJSONString() {\n JSONObject entry = new JSONObject();\n\n Map<String, Object> configuration = new LinkedHashMap<String, Object>();\n configuration.put(\"smtpHostname\", smtpHostname);\n configuration.put(\"smtpPort\", new Integer(smtpPort));\n configuration.put(\"tls\", tls);\n configuration.put(\"ssl\", ssl);\n configuration.put(\"username\", username);\n configuration.put(\"password\", password);\n configuration.put(\"fromEMail\", fromEMail);\n configuration.put(\"fromSenderName\", fromSenderName);\n\n entry.put(configurationName, configuration);\n\n /*\n * The JSONWriter will pretty-print the output\n */\n Writer jsonWriter = new JSONWriter();\n try {\n entry.writeJSONString(jsonWriter);\n } catch (IOException ioe) {\n throw new RuntimeException(ioe);\n }\n\n return jsonWriter.toString();\n }", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn \"{\\\"a\\\":\"+a+\", \\\"B\\\":\\\"\"+B+\"\\\"}\";\n\t}", "public String toJSON() {\n\t JSONObject outer = new JSONObject();\r\n\t JSONObject inner = new JSONObject();\r\n\t // Now generate the JSON output\r\n\t try {\r\n\t outer.put(\"articleMobile\", inner); // the outer object name\r\n\t inner.put(\"codeArticle\", codeArticle); // a name/value pair\r\n\t inner.put(\"designation\", designation); // a name/value pair\r\n\t inner.put(\"prixVente\", prixVente); // a name/value pair\r\n\t inner.put(\"stockTh\", stockTh);\r\n\t inner.put(\"error\", error); // a name/value pair\r\n\t inner.put(\"gisement\", gisement); // a name/value pair\r\n\t } catch (JSONException ex) {\r\n\t ex.printStackTrace();\r\n\t }\r\n\t return outer.toString(); // return the JSON text\r\n\t}", "void mo59932a(String str, JSONObject jSONObject);", "private String getExpectedJSONOutput() {\r\n\t\tStringBuffer json = new StringBuffer();\r\n\t\tjson.append(\"{\\\"unitOfMeasure\\\":\\\"Meter\\\",\\\"datum\\\":\\\"AGL\\\",\\\"minimum\\\":0.1,\\\"maximum\\\":100.1}\");\r\n\t\treturn (json.toString());\r\n\t}", "public final String toJson( )\n\t{\n\t\tString json = \"\";\n\t\tif ( getHref( ) != null )\n\t\t{\n\t\t\tthis.data.put( \"id\", getHref( ).substring( getHref( ).lastIndexOf( \"/\" ) + 1 ) );\n\t\t\tjson = this.data.toString( );\n\t\t\tthis.data.remove( \"id\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tjson = this.data.toString( );\n\t\t}\n\t\treturn json;\n\t}", "default Escaper escapeSingleQuotes() {\n return and((char c) -> {\n if (c == '\"') {\n return \"\\\\\\\"\";\n }\n return null;\n });\n }", "public String encodeJava()\n {\n return '\"' + val + '\"';\n }", "public static String javaStringEscape(String str)\n {\n test:\n {\n for (int i = 0; i < str.length(); i++) {\n switch (str.charAt(i)) {\n case '\\n':\n case '\\r':\n case '\\\"':\n case '\\\\':\n break test;\n }\n }\n return str;\n }\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n switch (ch) {\n default:\n sb.append(ch);\n break;\n case '\\n':\n sb.append(\"\\\\n\");\n break;\n case '\\r':\n sb.append(\"\\\\r\");\n break;\n case '\\\"':\n sb.append(\"\\\\\\\"\");\n break;\n case '\\\\':\n sb.append(\"\\\\\\\\\");\n break;\n }\n }\n return sb.toString();\n }", "@Override\n public String toString() {\n return jsonString;\n }", "public static String GetJSONString(String resourceString) {\n String retVal = \"\";\n resourceString = resourceString.replaceAll(\"<API_.*?>\", \"\").replaceAll(\"</API_.*?>\", \"\");\n try {\n String json = XML.toJSONObject(resourceString).toString();\n json = \"{\" + json.substring(1, json.length() - 1).replaceAll(\"\\\\{\", \"\\\\[{\").replaceAll(\"\\\\}\", \"\\\\]}\") + \"}\";\n retVal = json;\n } catch (Exception ex) {\n ApiLog.One.WriteException(ex);\n }\n return retVal;\n }", "@Override\r\n\tpublic String toJsonString() {\n\t\treturn null;\r\n\t}", "public String getJson();", "String getJson();", "String getJson();", "String getJson();", "public static void writeJSONString(@Nullable Object value, Path file) throws IOException {\n // We escape everything, so pure ASCII remains\n try (Writer out = IO.openOutputFile(file, StandardCharsets.US_ASCII)) {\n writeJSONString(value, out);\n }\n }", "private String convertToJSON(Object o) throws JsonProcessingException {\n return new ObjectMapper().writeValueAsString(o);\n }", "public static String toJson(Object obj) {\n\t\treturn toJson(obj, true, true);\n\t}", "public static String asJsonString(VoteSession voteSession) {\n try {\n ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);\n objectMapper.registerModules(new JavaTimeModule());\n\n return objectMapper.writeValueAsString(voteSession);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public JsonWriter json (String json) throws IOException {\n\t\trequireCommaOrName();\n\t\twriter.write(json);\n\t\treturn this;\n\t}", "private static String escapeJavaString(String input)\n {\n int len = input.length();\n // assume (for performance, not for correctness) that string will not expand by more than 10 chars\n StringBuilder out = new StringBuilder(len + 10);\n for (int i = 0; i < len; i++) {\n char c = input.charAt(i);\n if (c >= 32 && c <= 0x7f) {\n if (c == '\"') {\n out.append('\\\\');\n out.append('\"');\n } else if (c == '\\\\') {\n out.append('\\\\');\n out.append('\\\\');\n } else {\n out.append(c);\n }\n } else {\n out.append('\\\\');\n out.append('u');\n // one liner hack to have the hex string of length exactly 4\n out.append(Integer.toHexString(c | 0x10000).substring(1));\n }\n }\n return out.toString();\n }", "void mo26099a(String str, JSONObject jSONObject);", "private String convertToJson(Users user) throws JsonProcessingException{\n\t ObjectMapper objectMapper = new ObjectMapper();\n\t return objectMapper.writeValueAsString(user); \n\t}", "public String toJson() throws JSONException{\n\t\tif(this.email==null || this.password==null){\n\t\t\tthrow new IllegalStateException(\"Invalid Account information\");\n\t\t}\n\t\tJSONObject obj = new JSONObject();\n\t\tobj.put(\"email\", this.email);\n\t\tobj.put(\"password\", this.password);\n\t\treturn obj.toString();\n\t}", "private String toJson(PredictionsList plist) {\n\tString json = \"If you see this, there's a problem.\";\n\ttry {\n\t json = new ObjectMapper().writeValueAsString(plist);\n\t}\n\tcatch(Exception e) { }\n\treturn json;\n }", "public String convert2json(String dpid, DataSetInfo ds){\n String out = \"{\\n\";\n out += \"\\\"dpid\\\" : \\\"\" + dpid + \"\\\",\\n\";\n out += \"\\\"lags\\\" : \\\"\" + ds.getLags() + \"\\\",\\n\";\n out += \"\\\"derivative\\\" : \\\"\" + ds.getDerivative() + \"\\\",\\n\";\n out += \"\\\"classSize\\\" : \\\"\" + ds.getClassSize() + \"\\\"\\n\";\n out += \"}\\n\";\n return out;\n }", "static JsonResource forString( String contents ) {\n return new JsonResource() {\n @Override\n public <T> T readFrom( ReadMethod<T> consumer ) throws IOException {\n try ( ByteArrayInputStream stream = new ByteArrayInputStream(contents.getBytes(Json.getDefaultConfig().getCharset())) ) {\n return consumer.read(stream);\n }\n }\n };\n }", "String parseObjectToJson(Object obj);", "public String toJson() { return new Gson().toJson(this); }", "public static String reParseJson(String old){\n int start = old.indexOf(\"{\");\n int end = old.lastIndexOf(\"}\");\n return old.substring(start,end+1);\n\n }", "private String literal(String str) {\n StringBuffer buffer = new StringBuffer();\n \n buffer.append(\"'\");\n for (int i = 0; i < str.length(); i++) {\n switch (str.charAt(i)) {\n case '\\'':\n buffer.append(\"''\");\n break;\n default:\n buffer.append(str.charAt(i));\n break;\n }\n }\n buffer.append(\"'\");\n return buffer.toString();\n }", "public String toJsonString() {\n return JsonUtils.getGson().toJson(toJson());\n }", "private JSONObject serializeJson(String text){\n try {\n JSONObject jsonObject = new JSONObject(text);\n return jsonObject;\n }catch (JSONException err){\n return null;\n }\n }", "default Escaper escapeDoubleQuotes() {\n return and((char c) -> {\n if (c == '\"') {\n return \"\\\\\\\"\";\n }\n return null;\n });\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n JSONObject.quote(\"=\\\" p^/$6Yz29)9\");\n JSONObject jSONObject0 = new JSONObject();\n jSONObject0.append(\"\\\"=\\\" p^/$6Yz29)9\\\"\", \"=\\\" p^/$6Yz29)9\");\n jSONObject0.toString(3125, 3125);\n assertEquals(1, jSONObject0.length());\n }", "public static String quote(String str) {\n return \"\\\"\" + str.replaceAll(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\").replaceAll(\"\\\"\", \"\\\\\\\\\\\"\") + \"\\\"\";\n }", "public String toJson() {\n try{\n return new JsonSerializer().getObjectMapper().writeValueAsString(this);\n } catch (IOException e){\n throw new RuntimeException(e);\n }\n }", "public String CriteriatoJson() {\n\t\t\tJsonb jsonb = JsonbBuilder.create((new JsonbConfig().withFormatting(true)));\n\t\t \tString json = jsonb.toJson(criteria);\n\t\t\treturn json;\n\n\t }", "public static String str(String str) {\n\t\tStringBuffer result = new StringBuffer(\"\\\"\");\n\t\tfor (int i=0; i<str.length(); i++) {\n\t\t\tchar c = str.charAt(i);\n\t\t\tswitch (c) {\n\t\t\t case '\\n':\n\t\t\t\tresult.append(\"\\\\n\");\n\t\t\t\tbreak;\n\t\t\t case '\\t':\n\t\t\t\tresult.append(\"\\\\t\");\n\t\t\t\tbreak;\n\t\t\t case '\\r':\n\t\t\t\tresult.append(\"\\\\r\");\n\t\t\t\tbreak;\n\t\t\t case '\"':\n\t\t\t\tresult.append(\"\\\\\\\"\");\n\t\t\t\tbreak;\n\t\t\t case '\\\\':\n\t\t\t\tresult.append(\"\\\\\\\\\");\n\t\t\t\tbreak;\n\t\t\t default:\n\t\t\t\tresult.append(c);\n\t\t\t}\n\t\t}\n\t\tresult.append('\"');\n\t\treturn result.toString();\n\t}", "<T> String toJson(T source);", "public String createJsonObject() {\n JSONObject jsonObject = new JSONObject();\n\n try {\n if (!vslaId.equalsIgnoreCase(\"-1\")) {\n // editing existing information\n jsonObject.put(\"VslaId\", vslaId);\n }\n jsonObject.put(\"GroupSupport\", grpSupportType);\n jsonObject.put(\"VslaName\", vslaName);\n jsonObject.put(\"grpPhoneNumber\", grpPhoneNumber);\n jsonObject.put(\"PhysicalAddress\", physAddress);\n jsonObject.put(\"GpsLocation\", locCoordinates);\n jsonObject.put(\"representativeName\", representativeName);\n jsonObject.put(\"representativePosition\", representativePost);\n jsonObject.put(\"GroupAccountNumber\", grpBankAccount);\n jsonObject.put(\"repPhoneNumber\", repPhoneNumber);\n jsonObject.put(\"RegionName\", regionName);\n jsonObject.put(\"tTrainerId\", tTrainerId);\n jsonObject.put(\"Status\", \"2\");\n jsonObject.put(\"numberOfCycles\", numberOfCycles);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return jsonObject.toString();\n }", "public Map<String, String> getEscapeForJavaScript() {\n return FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<String, String>() {\n @Override\n public String get(Object key) {\n return FxFormatUtils.escapeForJavaScript(String.valueOf(key), false, true);\n }\n });\n }" ]
[ "0.71248883", "0.6960841", "0.67515093", "0.6631659", "0.64434", "0.6430687", "0.6398738", "0.6396943", "0.62905496", "0.6144118", "0.6137283", "0.6105194", "0.60143983", "0.5954792", "0.5907591", "0.5869652", "0.5845897", "0.58385354", "0.5833602", "0.5832891", "0.5828346", "0.5811481", "0.57899386", "0.57803434", "0.57453215", "0.57004696", "0.56931573", "0.56930673", "0.5671881", "0.56648463", "0.56538016", "0.5642926", "0.56392956", "0.56330127", "0.5631266", "0.5629821", "0.56205755", "0.5612568", "0.5593271", "0.5592162", "0.55801845", "0.5577077", "0.5566666", "0.5560982", "0.5559764", "0.5554938", "0.5539602", "0.5539602", "0.55389607", "0.5531015", "0.5499007", "0.549146", "0.54849505", "0.5449415", "0.544341", "0.543983", "0.5439394", "0.54227716", "0.54183096", "0.54101455", "0.54064566", "0.5405098", "0.53997207", "0.53955793", "0.53949857", "0.5391767", "0.5390333", "0.53852445", "0.53826916", "0.5373071", "0.5364887", "0.5363217", "0.5363217", "0.5363217", "0.5350146", "0.53500515", "0.53483665", "0.5347637", "0.5341827", "0.53386146", "0.53379637", "0.5325666", "0.5325596", "0.5318122", "0.5314811", "0.53027785", "0.52985585", "0.5289687", "0.52841574", "0.5280596", "0.5278906", "0.52783483", "0.52768314", "0.52711844", "0.5270907", "0.52634066", "0.5258762", "0.5255651", "0.52345484", "0.523356", "0.5230122" ]
0.0
-1
write your code here
public static void main(String[] args) { String inputFile = "data/input.txt"; String outputFile = "data/output.txt"; String studentInfo = "data/students_info.txt"; String studentData = ""; BufferedReader reader = null; String[] data = null; boolean sex = false; try { reader = new BufferedReader(new FileReader(studentInfo)); studentData = reader.readLine(); data = studentData.split(" "); } catch (Exception e) { e.printStackTrace(); } if (data[3].equals("1")) { sex = true; } Student testStudent1 = new Student(Integer.parseInt(data[0]),data[1],sex,Integer.parseInt(data[3])); testStudent1.doHomework(inputFile,outputFile,"Со"); }
{ "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 baocun() {\n\t\t\n\t}", "public void mo38117a() {\n }", "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}", "public static void main(String[] args) {\n\t// write your code here\n }", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "@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 perder() {\n // TODO implement here\n }", "public void smell() {\n\t\t\n\t}", "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}", "protected void execute() {\n\n\n \n }", "@Override\n public void execute() {\n \n \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\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();", "protected void additionalProcessing() {\n\t}", "private void sub() {\n\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}", "@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}", "void mo67924c();", "@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}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void mo3376r() {\n }", "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.61019534", "0.6054925", "0.58806974", "0.58270746", "0.5796887", "0.56999695", "0.5690986", "0.56556827", "0.5648637", "0.5640487", "0.56354505", "0.56032085", "0.56016207", "0.56006724", "0.5589654", "0.5583692", "0.55785793", "0.55733466", "0.5560209", "0.55325305", "0.55133164", "0.55123806", "0.55114794", "0.5500045", "0.5489272", "0.5482718", "0.5482718", "0.5477585", "0.5477585", "0.54645246", "0.5461012", "0.54548836", "0.5442613", "0.5430592", "0.5423748", "0.5419415", "0.5407118", "0.54048806", "0.5399331", "0.539896", "0.5389593", "0.5386248", "0.5378453", "0.53751254", "0.5360644", "0.5357343", "0.5345515", "0.53441405", "0.5322276", "0.5318302", "0.53118485", "0.53118485", "0.53085434", "0.530508", "0.53038436", "0.5301922", "0.5296964", "0.52920514", "0.52903354", "0.5289583", "0.5287506", "0.52869135", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.52859664", "0.52849185", "0.52817136", "0.52791214", "0.5278664", "0.5278048", "0.5276269", "0.52728665", "0.5265451", "0.526483", "0.526005", "0.5259683", "0.52577406", "0.5257731", "0.5257731", "0.52560073", "0.5255759", "0.5255707", "0.5250705", "0.5246863", "0.5243053", "0.52429926", "0.5242727", "0.52396125", "0.5239378", "0.5232576", "0.5224529", "0.52240705", "0.52210563", "0.52203166", "0.521787", "0.52172214" ]
0.0
-1
Here we are returning an object of type 'Vets' rather than a collection of Vet objects so it is simpler for ObjectXml mapping
@GetMapping("/vets.html") public String showVetList(Map<String, Object> model) { Vets vets = new Vets(); List<Vet> allVets = (List<Vet>) vetRepository.findAll(); Collections.sort(allVets, Comparator.comparing(vet -> vet.getFirstName())); vets.getVetList().addAll(allVets); model.put("vets", vets); return "vets/vetList"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Vet> getAllVets() {\n\t\tentityManager = JPAUtils.getEntityManager();\n\t\tentityManager.getTransaction().begin();\n\t\tvets = entityManager.createQuery(\"from Vet\", Vet.class).getResultList();\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t\treturn vets;\n\t}", "private static List<Element> getXMLVehicles(Model model) {\n Set<Vehicle> vehicles = new TreeSet<>(Comparators.objectsById());\n vehicles.addAll(model.getVehicles(null));\n List<Element> result = new ArrayList<>(vehicles.size());\n for (Vehicle curVehicle : vehicles) {\n Element vehicleElement = new Element(\"vehicle\");\n vehicleElement.setAttribute(\"id\", String.valueOf(curVehicle.getId()));\n vehicleElement.setAttribute(\"name\", curVehicle.getName());\n vehicleElement.setAttribute(\"length\",\n String.valueOf(curVehicle.getLength()));\n vehicleElement.setAttribute(\"energyLevelCritical\",\n String.valueOf(curVehicle.getEnergyLevelCritical()));\n vehicleElement.setAttribute(\"energyLevelGood\",\n String.valueOf(curVehicle.getEnergyLevelGood()));\n for (Map.Entry<String, String> curEntry\n : curVehicle.getProperties().entrySet()) {\n Element propertyElement = new Element(\"property\");\n propertyElement.setAttribute(\"name\", curEntry.getKey());\n propertyElement.setAttribute(\"value\", curEntry.getValue());\n vehicleElement.addContent(propertyElement);\n }\n result.add(vehicleElement);\n }\n return result;\n }", "@GetMapping({ \"/vets\" })\n\tpublic @ResponseBody Vets showResourcesVetList() {\n\t\tVets vets = new Vets();\n\t\tvets.getVetList().addAll(this.vetRepository.findAll());\n\t\treturn vets;\n\t}", "public List<Voto> getVotos(){\n\t\treturn em.createQuery(\"SELECT c from Voto c\", Voto.class).getResultList();\n\t}", "@Test\n\tpublic void testVirtualPetShelterHasACollectionOfVirtualPets() {\n\t\tVirtualPetShelter testPetShelter = new VirtualPetShelter(); \n\n\t\tMap<String, VirtualPet> virtualPets = new HashMap<String, VirtualPet>(); // I want a map of VP's\n\t\t// Map<Key, Value (instances of virtualPet)> - the key will be the name of pet, the key is assigned to the pets instance\n\t\tString pet1 = \"Tui\"; //this is my first key called \"Tui\"\n\t\tVirtualPet tui = new VirtualPet(\"Tui\", \"Is a cute little calico\", 30, 30, 30);\n\t\tvirtualPets.put(pet1, tui);\n\n\t\tString pet2 = \"Ditch\";\n\t\tVirtualPet ditch = new VirtualPet(\"Ditch\", \"Is as cunning as a shithouse rat\", 10, 40, 15);\n\t\tvirtualPets.put(pet2, ditch);\n\n\t\tString pet3 = \"Blusey\";\n\t\tVirtualPet bluesy = new VirtualPet(\"Bluesy\", \"A black and tan Main coon who is a mushy cat who loves snuggles\",\n\t\t\t\t5, 5, 5);\n\t\tvirtualPets.put(pet3, bluesy);\n\n\t\tString pet4 = \"Jazzy\";\n\t\tVirtualPet jazzy = new VirtualPet(\"Jazzy\", \"Grey tiger who hunter who who be great in the barn\", 15, 20, 25);\n\t\tvirtualPets.put(pet4, jazzy);\n\n\t\tString pet5 = \"Nigel\";\n\t\tVirtualPet nigel = new VirtualPet(\"Nigel\", \"A big old ginger cat\", 10, 10, 50);\n\t\tvirtualPets.put(pet5, nigel);\n\n\t\t// Moved the Map/HashMap below to the VirtualPetShelter\n\t\t// Map<String, VirtualPet> virtualPets = new HashMap<String, VirtualPet>();\n\t\t// Then I created a method in VirtualPetShelter which returned the VirtualPets\n\t\t// \"Values\"\n\n\t\tCollection<VirtualPet> virtualPetCollection = testPetShelter.getVirtualPets(); //Initially got error, eclipse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// asked me to create collection in VPS\n\n\t\tAssert.assertNotNull(testPetShelter.virtualPets);//I got error, eclipse asked me to create a HashMap in VPS\n\t\tAssert.assertEquals(virtualPetCollection, testPetShelter.virtualPets.values()); //\".values() is a Maps \n\t\t //way to return a \"Collection\"\n\t\tAssert.assertEquals(\"Nigel\", virtualPets.get(pet5).name); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(30, virtualPets.get(pet1).hunger); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(40, virtualPets.get(pet2).boredom); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(5, virtualPets.get(pet3).thirst); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(\"Grey tiger who hunter who who be great in the barn\", virtualPets.get(pet4).description);\n\t}", "private static List<Element> getXMLPoints(Model model) {\n Set<Point> points = new TreeSet<>(Comparators.objectsById());\n points.addAll(model.getPoints(null));\n List<Element> result = new ArrayList<>(points.size());\n for (Point curPoint : points) {\n Element pointElement = new Element(\"point\");\n pointElement.setAttribute(\"id\", String.valueOf(curPoint.getId()));\n pointElement.setAttribute(\"name\", curPoint.getName());\n pointElement.setAttribute(\"xPosition\",\n String.valueOf(curPoint.getPosition().getX()));\n pointElement.setAttribute(\"yPosition\",\n String.valueOf(curPoint.getPosition().getY()));\n pointElement.setAttribute(\"zPosition\",\n String.valueOf(curPoint.getPosition().getZ()));\n pointElement.setAttribute(\"vehicleOrientationAngle\",\n String.valueOf(curPoint.getVehicleOrientationAngle()));\n pointElement.setAttribute(\"type\", curPoint.getType().toString());\n for (TCSObjectReference<Path> curRef : curPoint.getOutgoingPaths()) {\n Element outgoingElement = new Element(\"outgoingPath\");\n outgoingElement.setAttribute(\"name\", curRef.getName());\n pointElement.addContent(outgoingElement);\n }\n for (Map.Entry<String, String> curEntry\n : curPoint.getProperties().entrySet()) {\n Element propertyElement = new Element(\"property\");\n propertyElement.setAttribute(\"name\", curEntry.getKey());\n propertyElement.setAttribute(\"value\", curEntry.getValue());\n pointElement.addContent(propertyElement);\n }\n result.add(pointElement);\n }\n return result;\n }", "@Override\n public List<Vessel> getVessels() {\n return new ArrayList<>(boats);\n }", "public ArrayList<VtbObject> findAll() throws MappingException {\n\t\treturn null;\n\t}", "public ArrayList<Pets> getPets(){\n DataBase db = new DataBase(context);\n initPets(db);\n return db.getPets();\n }", "@GetMapping(\"/Vets/{id}\")\n\tpublic ResponseEntity<Vets> getVetsById(@PathVariable int id) {\n\t\tVets vets = VetsRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new ResourceNotFoundException(\"Vet not exist with id :\" + id));\n\t\treturn ResponseEntity.ok(vets);\n\t}", "protected JsonJavaObject getVcapServices() {\n\t\tJsonJavaObject vcapJson = null;\n\t\tJsonJavaFactory factory = JsonJavaFactory.instanceEx;\n\t\tString sysEnv = BluemixContextManager.getInstance().getVCAP_SERVICES();\n\n\t\ttry {\n\t\t\tvcapJson = (JsonJavaObject) JsonParser.fromJson(factory, sysEnv);\n\n\t\t} catch (JsonException e) {\n\t\t\tPlatform.getInstance().log(e);\n\t\t\tLogging.logError(e);\n\t\t}\n\t\treturn vcapJson;\n\t}", "public Object getV1(){\n \treturn v1;\n }", "@Override\n\tpublic LovServiceResponse getLovDetails() {\n\t\tLovServiceResponse l_res = new LovServiceResponse();\n\t\tList<LovDetail> l_lovList=null;\n\t\tList<LovVO> l_lovVoList=new ArrayList<LovVO>();\n\t\tLovVO l_lovVo = null;\n\t\ttry {\n\t\t\tl_lovList = lovDao.getLovDetails();\n\t\t\tfor(LovDetail l_etity : l_lovList ){\n\t\t\t\tl_lovVo = new LovVO(l_etity);\n\t\t\t\tBeanUtils.copyProperties(l_etity, l_lovVo);\n\t\t\t\tl_lovVoList.add(l_lovVo);\t\t\t\t\n\t\t\t}\n\t\t\tl_res.setLovList(l_lovVoList);\n\t\t\tl_res.setStatus(true);\n\t\t\t\n\t\t}catch(DataAccessException e){\t\t\t\n\t\t\tthrow new ServiceException(\"DataAccessException while fetch lov data\",e);\n\t\t}\n\t\tcatch (Exception e) {\t\t\t\n\t\t\tthrow new ServiceException(\"Unhandled Exception while fetch lov data\",e);\n\t\t}\n\t\treturn l_res;\t\t\n\t}", "public Collection<VirtualPet> pets() {\n\t\treturn shelterPets.values();\n\t}", "public List<VerbPhrase> getVpList(){\n\t\tSet<NounPhrase> entitySet = this.getEntConsiderPass(\"O\");\n\t\tList<VerbPhrase> vpList = new ArrayList<VerbPhrase>();\n\t\t\n\t\tfor(NounPhrase object : entitySet){\t\t\n\t\t\t//vpList.add(new VerbPhrase(this.getActionStr(), object));\n\t\t\tvpList.add(new VerbPhrase(this.action, object));\n\t\t}\t\t\n\t\treturn vpList;\n\t}", "public ViatgesDTO() {\n \n }", "public static ArrayOfPetModelE parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n ArrayOfPetModelE object = new ArrayOfPetModelE();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n // Skip the element and report the null value. It cannot have subelements.\n while (!reader.isEndElement())\n reader.next();\n\n return object;\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n while (!reader.isEndElement()) {\n if (reader.isStartElement()) {\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"ArrayOfPetModel\").equals(\n reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n object.setArrayOfPetModel(null);\n reader.next();\n } else {\n object.setArrayOfPetModel(ArrayOfPetModel.Factory.parse(\n reader));\n }\n } // End of if for expected property start element\n\n else {\n // 3 - A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" +\n reader.getName());\n }\n } else {\n reader.next();\n }\n } // end of while loop\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "List<VoziloDto> sveVozila();", "public static ArrayOfPetModel parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n ArrayOfPetModel object = new ArrayOfPetModel();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n if (reader.getAttributeValue(\n \"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\") != null) {\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n\n if (fullTypeName != null) {\n java.lang.String nsPrefix = null;\n\n if (fullTypeName.indexOf(\":\") > -1) {\n nsPrefix = fullTypeName.substring(0,\n fullTypeName.indexOf(\":\"));\n }\n\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\n \":\") + 1);\n\n if (!\"ArrayOfPetModel\".equals(type)) {\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext()\n .getNamespaceURI(nsPrefix);\n\n return (ArrayOfPetModel) ExtensionMapper.getTypeObject(nsUri,\n type, reader);\n }\n }\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n reader.next();\n\n java.util.ArrayList list1 = new java.util.ArrayList();\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"PetModel\").equals(reader.getName())) {\n // Process the array and step past its final element's end.\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n list1.add(null);\n reader.next();\n } else {\n list1.add(PetModel.Factory.parse(reader));\n }\n\n //loop until we find a start element that is not part of this array\n boolean loopDone1 = false;\n\n while (!loopDone1) {\n // We should be at the end element, but make sure\n while (!reader.isEndElement())\n reader.next();\n\n // Step out of this element\n reader.next();\n\n // Step to next element event.\n while (!reader.isStartElement() &&\n !reader.isEndElement())\n reader.next();\n\n if (reader.isEndElement()) {\n //two continuous end elements means we are exiting the xml structure\n loopDone1 = true;\n } else {\n if (new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"PetModel\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n list1.add(null);\n reader.next();\n } else {\n list1.add(PetModel.Factory.parse(reader));\n }\n } else {\n loopDone1 = true;\n }\n }\n }\n\n // call the converter utility to convert and set the array\n object.setPetModel((PetModel[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(\n PetModel.class, list1));\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement()) {\n // 2 - A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" + reader.getName());\n }\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "public TestStockPricesVOImpl getTestStockPricesVO() {\n return (TestStockPricesVOImpl)findViewObject(\"TestStockPricesVO\");\n }", "public List<Visit> getVisitsByVetId(int vetId) {\n JdbcTemplate select = new JdbcTemplate(dataSource);\n return select.query(\"SELECT * FROM visit WHERE vetId=?\",new Object[] {vetId}, new VisitRowMapper()); \n }", "private static void testFromXmlToObj() {\n String xml2 = \"<xml.mapping.xstream.MappingTestBean> <stringParam>aaa</stringParam> <integerParam>9</integerParam> <arrayStringParam> <string>ggg</string> <string>hhh</string> <string>222</string> </arrayStringParam> <listStringParam> <string>bbb</string> <string>ccc</string> <string>111</string> </listStringParam> <mapStringParam> <entry> <string>f</string> <string>fff</string> </entry> <entry> <string>e</string> <string>eee</string> </entry> </mapStringParam> </xml.mapping.xstream.MappingTestBean>\";\n String xml3 = \"<MappingTestBean> <stringParam>aaa</stringParam> <integerParam>9</integerParam> <arrayStringParam> <string>ggg</string> <string>hhh</string> <string>222</string> </arrayStringParam> <listStringParam> <string>bbb</string> <string>ccc</string> <string>111</string> </listStringParam> <mapStringParam> <entry> <string>f</string> <string>fff</string> </entry> <entry> <string>e</string> <string>eee</string> </entry> </mapStringParam> </MappingTestBean>\";\n MappingTestBean mtb2 = (MappingTestBean) xstream.fromXML(xml2);\n MappingTestBean mtb3 = (MappingTestBean) xstream.fromXML(xml3);\n System.out.println(ReflectionToStringBuilder.toString(mtb2));\n System.out.println(ReflectionToStringBuilder.toString(mtb3));\n }", "public ViewObjectImpl getStockPricesROVO() {\n return (ViewObjectImpl)findViewObject(\"StockPricesROVO\");\n }", "void parseOriginalPlanet() {\r\n\t\tXElement e = rl.getXML(\"campaign/main/planets_old\");\r\n\t\tfor (XElement planet : e.childrenWithName(\"planet\")) {\r\n\t\t\tOriginalPlanet op = new OriginalPlanet();\r\n\t\t\top.name = planet.get(\"id\");\r\n\t\t\top.surfaceType = planet.childValue(\"type\");\r\n\t\t\top.location.x = Integer.parseInt(planet.childValue(\"location-x\"));\r\n\t\t\top.location.y = Integer.parseInt(planet.childValue(\"location-y\"));\r\n\t\t\top.surfaceVariant = Integer.parseInt(planet.childValue(\"variant\"));\r\n\t\t\top.race = planet.childValue(\"race\");\r\n\t\t\tfor (XElement building : planet.childElement(\"buildings\").childrenWithName(\"building\")) {\r\n\t\t\t\tOriginalBuilding ob = new OriginalBuilding();\r\n\t\t\t\tob.name = building.childValue(\"id\");\r\n\t\t\t\tob.location = Location.of(Integer.parseInt(building.childValue(\"x\")), \r\n\t\t\t\t\t\tInteger.parseInt(building.childValue(\"y\")));\r\n\t\t\t\top.buildings.add(ob);\r\n\t\t\t}\r\n\t\t\toriginalPlanets.add(op);\r\n\t\t}\r\n\t}", "@Override\n public T getItemVO() {\n return this.itemVO;\n }", "public Vector<HotelInfo> getAllHotels(){\n Session session=null;\n List result=null;\n Vector<HotelInfo> hotelInfos = null;\n try\n {\n session= HibernateUtil.getSessionFactory().getCurrentSession();\n session.beginTransaction();\n result=session.createQuery(\"from Hotel\").list();\n System.out.println(\"Successfully return hotels from database\");\n session.getTransaction().commit();\n hotelInfos= new Vector<HotelInfo>();\n for (int i = 0; i < result.size(); i++)\n {\n HotelInfo myHotel=new HotelInfo();\n myHotel.setHotelId(((Hotel)result.get(i)).getHotelId());\n myHotel.setName(((Hotel)result.get(i)).getName());\n myHotel.setUsername((((Hotel)result.get(i)).getUsername()));\n myHotel.setPassword((((Hotel)result.get(i)).getPassword()));\n myHotel.setIpaddress((((Hotel)result.get(i)).getIpaddress()));\n myHotel.setPort((((Hotel)result.get(i)).getPort()));\n myHotel.setContextpath((((Hotel)result.get(i)).getContextPath()));\n hotelInfos.add(myHotel);\n }\n }\n catch(Exception e)\n {\n System.out.println(e.getMessage());\n }\n return hotelInfos;\n }", "void setTvAttrib() {\r\n obj1.brandname = \"PANASONIC\"; //setting brandname for obj1\r\n obj1.size = 65; //setting size for obj1\r\n vendor.add(obj1); //adding to arraylist vendor\r\n\r\n obj2.brandname = \"KELVIN\"; //setting brandname for obj2\r\n obj2.size = 51; //setting size for obj2\r\n vendor.add(obj2); //adding to arraylist vendor\r\n\r\n obj3.brandname = \"SONY\"; //setting size for obj2\r\n obj3.size = 42; //setting size for obj2\r\n vendor.add(obj3); //adding to arraylist vendor\r\n\r\n }", "public Object getV2(){\n \treturn v2;\n }", "public StockPricesVOImpl getStockPricesVO() {\n return (StockPricesVOImpl)findViewObject(\"StockPricesVO\");\n }", "public static void convertBookToBookVO() {\n\t\t// TODDO\n\t}", "private void populatepets(){\r\n\t\tpets.add(new Cat(\"UnNamed\"));\r\n\t\tpets.add(new Cow(\"UnNamed\"));\r\n\t\tpets.add(new Dog(\"UnNamed\"));\r\n\t\tpets.add(new Rabbit(\"UnNamed\"));\r\n\t\tpets.add(new Rat(\"UnNamed\"));\r\n\t\tpets.add(new Velociraptor(\"UnNamed\"));\r\n\t}", "public ArrayOfPetModel getPets() {\n return localPets;\n }", "public VatDetail[] getRetailExportVatSummaries() {\n POSLineItem[] items = compositePOSTransaction.getLineItemsArray();\n HashMap vatDetails = new HashMap();\n for (int idx = 0; idx < items.length; idx++) {\n //if(!((CMSItem)items[idx].getItem()).isConcessionItem() && !((CMSItem)items[idx].getItem()).getVatCode().equals(\"0\"))\n if (((CMSItem)items[idx].getItem()).getVatRate() != null\n && ((CMSItem)items[idx].getItem()).getVatRate().doubleValue() > 0) {\n int signMult = 1;\n if (items[idx] instanceof ReturnLineItem)\n signMult = -1;\n double rate = items[idx].getItem().getVatRate().doubleValue();\n if (vatDetails.get(((CMSItem)items[idx].getItem()).getVatRate()) == null) {\n VatDetail detail = new VatDetail(items[idx].getExtendedNetAmount().multiply(signMult)\n , items[idx].getExtendedVatAmount().multiply(signMult), rate\n , items[idx].getNetAmount().multiply(rate / (1 + rate)).multiply(signMult).round().\n multiply(items[idx].getQuantity().intValue()), items[idx].getQuantity().intValue());\n // to do: need a new vat service at item level rather than calcing right here, vatAmount = lineItemDetail.getNetAmount().multiply((1.0 - creditCardRatio * CREDIT_CARD_CHARGE_RATE) * rate / (1.0 + rate));\n vatDetails.put(items[idx].getItem().getVatRate(), detail);\n } else {\n VatDetail detail = (VatDetail)vatDetails.get(((CMSItem)items[idx].getItem()).getVatRate());\n detail.addCompositeAmount(items[idx].getExtendedNetAmount().multiply(signMult));\n detail.addVatAmount(items[idx].getExtendedVatAmount().multiply(signMult));\n detail.addOriginalVatAmount(items[idx].getNetAmount().multiply(rate / (1 + rate)).\n multiply(signMult).round().multiply(items[idx].getQuantity().intValue()));\n detail.addItemQty(items[idx].getQuantity().intValue());\n }\n }\n }\n return (VatDetail[])vatDetails.values().toArray(new VatDetail[0]);\n }", "E toEntity(V dto);", "ArrayList<EvCustomer> getEvCustomers ()\n {\n return evCustomers;\n }", "public Map<String, VPlexVirtualVolumeInfo> getVirtualVolumes(boolean shallow) throws VPlexApiException {\n s_logger.info(\"Request for {} discovery of virtual volume info for VPlex at {}\",\n (shallow ? \"shallow\" : \"deep\"), _baseURI);\n\n Map<String, VPlexVirtualVolumeInfo> virtualVolumeInfoMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n Map<String, VPlexVirtualVolumeInfo> distributedVirtualVolumesMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n Map<String, Map<String, VPlexVirtualVolumeInfo>> localVirtualVolumesMap = new HashMap<String, Map<String, VPlexVirtualVolumeInfo>>();\n\n // Get the cluster information.\n List<VPlexClusterInfo> clusterInfoList = getClusterInfoLite();\n for (VPlexClusterInfo clusterInfo : clusterInfoList) {\n String clusterId = clusterInfo.getName();\n // for each cluster get the virtual volume information.\n List<VPlexVirtualVolumeInfo> clusterVirtualVolumeInfoList = _discoveryMgr.getVirtualVolumesForCluster(clusterId);\n for (VPlexVirtualVolumeInfo virtualVolumeInfo : clusterVirtualVolumeInfoList) {\n virtualVolumeInfo.addCluster(clusterId);\n String virtualVolumeName = virtualVolumeInfo.getName();\n\n if (!virtualVolumeInfoMap.containsKey(virtualVolumeName)) {\n // We want the unique list of virtual volumes on all\n // clusters. Distributed volumes will appear on both\n // clusters.\n virtualVolumeInfoMap.put(virtualVolumeName, virtualVolumeInfo);\n\n // If we are doing a deep discovery of the virtual volumes\n // keep a list of the distributed virtual volumes and a list\n // of the local virtual volumes for each cluster.\n if (!shallow) {\n String supportingDeviceName = virtualVolumeInfo.getSupportingDevice();\n if (VPlexVirtualVolumeInfo.Locality.distributed.name().equals(\n virtualVolumeInfo.getLocality())) {\n distributedVirtualVolumesMap.put(supportingDeviceName,\n virtualVolumeInfo);\n } else {\n Map<String, VPlexVirtualVolumeInfo> clusterLocalVolumesMap = localVirtualVolumesMap\n .get(clusterId);\n if (clusterLocalVolumesMap == null) {\n clusterLocalVolumesMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n localVirtualVolumesMap.put(clusterId, clusterLocalVolumesMap);\n }\n clusterLocalVolumesMap.put(supportingDeviceName, virtualVolumeInfo);\n }\n }\n } else if (VPlexVirtualVolumeInfo.Locality.distributed.name().equals(\n virtualVolumeInfo.getLocality())) {\n // on a distributed volume, we need to be sure to add the second\n // cluster id as well... this is needed by ingestion. see CTRL-10982\n virtualVolumeInfoMap.get(virtualVolumeName).addCluster(clusterId);\n }\n }\n }\n // Do the deep discovery of the component structure for each\n // virtual volume, if necessary.\n if (!shallow) {\n // Get the component structure for each distributed virtual volume\n // starting with the supporting distributed device.\n _discoveryMgr.setSupportingComponentsForDistributedVirtualVolumes(distributedVirtualVolumesMap);\n\n // Get the component structure for each local virtual volume\n // starting with the supporting local device.\n for (Map.Entry<String, Map<String, VPlexVirtualVolumeInfo>> mapEntry : localVirtualVolumesMap\n .entrySet()) {\n _discoveryMgr.setSupportingComponentsForLocalVirtualVolumes(\n mapEntry.getKey(), mapEntry.getValue());\n }\n }\n\n return virtualVolumeInfoMap;\n }", "List<IViewEntity> getEntities();", "List<SimpleInventory> getInventories();", "public List<Inventory> getInventory();", "public ArrayList<PointVente> getPointV() {\n\t\t\treturn pointV;\n\t\t}", "@Override\r\n\tpublic Collection<TVA> obtenirTousTVA() {\n\t\treturn null;\r\n\t}", "public static JSONObject processVclassResultsJSON(Map<String, Object> map, VitroRequest vreq, boolean multipleVclasses) {\n JSONObject rObj = new JSONObject();\n VClass vclass=null; \n \n try { \n \n // Properties from ontologies used by VIVO - should not be in vitro\n DataProperty fNameDp = (new DataProperty()); \n fNameDp.setURI(\"http://xmlns.com/foaf/0.1/firstName\");\n DataProperty lNameDp = (new DataProperty());\n lNameDp.setURI(\"http://xmlns.com/foaf/0.1/lastName\");\n DataProperty preferredTitleDp = (new DataProperty());\n preferredTitleDp.setURI(\"http://vivoweb.org/ontology/core#preferredTitle\");\n \n if( log.isDebugEnabled() ){\n @SuppressWarnings(\"unchecked\")\n Enumeration<String> e = vreq.getParameterNames();\n while(e.hasMoreElements()){\n String name = (String)e.nextElement();\n log.debug(\"parameter: \" + name);\n for( String value : vreq.getParameterValues(name) ){\n log.debug(\"value for \" + name + \": '\" + value + \"'\");\n } \n }\n }\n \n //need an unfiltered dao to get firstnames and lastnames\n WebappDaoFactory fullWdf = vreq.getFullWebappDaoFactory();\n \n String[] vitroClassIdStr = vreq.getParameterValues(\"vclassId\"); \n if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){ \n for(String vclassId: vitroClassIdStr) {\n vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(vclassId);\n if (vclass == null) {\n log.error(\"Couldn't retrieve vclass \"); \n throw new Exception (\"Class \" + vclassId + \" not found\");\n } \n }\n }else{\n log.error(\"parameter vclassId URI parameter expected \");\n throw new Exception(\"parameter vclassId URI parameter expected \");\n }\n List<String> vclassIds = Arrays.asList(vitroClassIdStr); \n //if single vclass expected, then include vclass. This relates to what the expected behavior is, not size of list \n if(!multipleVclasses) {\n //currently used for ClassGroupPage\n rObj.put(\"vclass\", \n new JSONObject().put(\"URI\",vclass.getURI())\n .put(\"name\",vclass.getName()));\n } else {\n //For now, utilize very last VClass (assume that that is the one to be employed)\n //TODO: Find more general way of dealing with this\n //put multiple ones in?\n if(vclassIds.size() > 0) {\n \tint numberVClasses = vclassIds.size();\n vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(vclassIds.get(numberVClasses - 1));\n rObj.put(\"vclass\", new JSONObject().put(\"URI\",vclass.getURI())\n .put(\"name\",vclass.getName()));\n } \n // rObj.put(\"vclasses\", new JSONObject().put(\"URIs\",vitroClassIdStr)\n // .put(\"name\",vclass.getName()));\n }\n if (vclass != null) { \n \n rObj.put(\"totalCount\", map.get(\"totalCount\"));\n rObj.put(\"alpha\", map.get(\"alpha\"));\n \n List<Individual> inds = (List<Individual>)map.get(\"entities\");\n log.debug(\"Number of individuals returned from request: \" + inds.size());\n JSONArray jInds = new JSONArray();\n for(Individual ind : inds ){\n JSONObject jo = new JSONObject();\n jo.put(\"URI\", ind.getURI());\n jo.put(\"label\",ind.getRdfsLabel());\n jo.put(\"name\",ind.getName());\n jo.put(\"thumbUrl\", ind.getThumbUrl());\n jo.put(\"imageUrl\", ind.getImageUrl());\n jo.put(\"profileUrl\", UrlBuilder.getIndividualProfileUrl(ind, vreq));\n \n jo.put(\"mostSpecificTypes\", JsonServlet.getMostSpecificTypes(ind,fullWdf)); \n jo.put(\"preferredTitle\", JsonServlet.getDataPropertyValue(ind, preferredTitleDp, fullWdf)); \n \n jInds.put(jo);\n }\n rObj.put(\"individuals\", jInds);\n \n JSONArray wpages = new JSONArray();\n //Made sure that PageRecord here is SolrIndividualListController not IndividualListController\n List<PageRecord> pages = (List<PageRecord>)map.get(\"pages\"); \n for( PageRecord pr: pages ){ \n JSONObject p = new JSONObject();\n p.put(\"text\", pr.text);\n p.put(\"param\", pr.param);\n p.put(\"index\", pr.index);\n wpages.put( p );\n }\n rObj.put(\"pages\",wpages); \n \n JSONArray jletters = new JSONArray();\n List<String> letters = Controllers.getLetters();\n for( String s : letters){\n JSONObject jo = new JSONObject();\n jo.put(\"text\", s);\n jo.put(\"param\", \"alpha=\" + URLEncoder.encode(s, \"UTF-8\"));\n jletters.put( jo );\n }\n rObj.put(\"letters\", jletters);\n } \n } catch(Exception ex) {\n log.error(\"Error occurred in processing JSON object\", ex);\n }\n return rObj;\n }", "public static PetModelE parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n PetModelE object = new PetModelE();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n // Skip the element and report the null value. It cannot have subelements.\n while (!reader.isEndElement())\n reader.next();\n\n return object;\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n while (!reader.isEndElement()) {\n if (reader.isStartElement()) {\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"PetModel\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n object.setPetModel(null);\n reader.next();\n } else {\n object.setPetModel(PetModel.Factory.parse(\n reader));\n }\n } // End of if for expected property start element\n\n else {\n // 3 - A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" +\n reader.getName());\n }\n } else {\n reader.next();\n }\n } // end of while loop\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "public static PetModel parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n PetModel object = new PetModel();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n if (reader.getAttributeValue(\n \"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\") != null) {\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n\n if (fullTypeName != null) {\n java.lang.String nsPrefix = null;\n\n if (fullTypeName.indexOf(\":\") > -1) {\n nsPrefix = fullTypeName.substring(0,\n fullTypeName.indexOf(\":\"));\n }\n\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\n \":\") + 1);\n\n if (!\"PetModel\".equals(type)) {\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext()\n .getNamespaceURI(nsPrefix);\n\n return (PetModel) ExtensionMapper.getTypeObject(nsUri,\n type, reader);\n }\n }\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n reader.next();\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"DateCreated\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n throw new org.apache.axis2.databinding.ADBException(\n \"The element: \" + \"DateCreated\" +\n \" cannot be null\");\n }\n\n java.lang.String content = reader.getElementText();\n\n object.setDateCreated(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(\n content));\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"Id\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (!\"true\".equals(nillableValue) &&\n !\"1\".equals(nillableValue)) {\n java.lang.String content = reader.getElementText();\n\n object.setId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(\n content));\n } else {\n reader.getElementText(); // throw away text nodes if any.\n }\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"LastModified\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n throw new org.apache.axis2.databinding.ADBException(\n \"The element: \" + \"LastModified\" +\n \" cannot be null\");\n }\n\n java.lang.String content = reader.getElementText();\n\n object.setLastModified(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(\n content));\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"Animal\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n object.setAnimal(null);\n reader.next();\n\n reader.next();\n } else {\n object.setAnimal(AnimalModel.Factory.parse(reader));\n\n reader.next();\n }\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"EatPoints\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n throw new org.apache.axis2.databinding.ADBException(\n \"The element: \" + \"EatPoints\" +\n \" cannot be null\");\n }\n\n java.lang.String content = reader.getElementText();\n\n object.setEatPoints(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(\n content));\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n object.setEatPoints(java.lang.Integer.MIN_VALUE);\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"Gender\").equals(reader.getName())) {\n object.setGender(Gender.Factory.parse(reader));\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"Logs\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n object.setLogs(null);\n reader.next();\n\n reader.next();\n } else {\n object.setLogs(ArrayOfLogModel.Factory.parse(reader));\n\n reader.next();\n }\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"Nickname\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (!\"true\".equals(nillableValue) &&\n !\"1\".equals(nillableValue)) {\n java.lang.String content = reader.getElementText();\n\n object.setNickname(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(\n content));\n } else {\n reader.getElementText(); // throw away text nodes if any.\n }\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"Owner\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n object.setOwner(null);\n reader.next();\n\n reader.next();\n } else {\n object.setOwner(UserModel.Factory.parse(reader));\n\n reader.next();\n }\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"PlayPoints\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n throw new org.apache.axis2.databinding.ADBException(\n \"The element: \" + \"PlayPoints\" +\n \" cannot be null\");\n }\n\n java.lang.String content = reader.getElementText();\n\n object.setPlayPoints(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(\n content));\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n object.setPlayPoints(java.lang.Integer.MIN_VALUE);\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.datacontract.org/2004/07/Tamagotchi.Common.Models\",\n \"SleepPoints\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n throw new org.apache.axis2.databinding.ADBException(\n \"The element: \" + \"SleepPoints\" +\n \" cannot be null\");\n }\n\n java.lang.String content = reader.getElementText();\n\n object.setSleepPoints(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(\n content));\n\n reader.next();\n } // End of if for expected property start element\n\n else {\n object.setSleepPoints(java.lang.Integer.MIN_VALUE);\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement()) {\n // 2 - A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" + reader.getName());\n }\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@Override\n\tpublic Class<T> getVOClass() {\n\t\treturn null;\n\t}", "@Override\r\n public ViviendaEntity toEntity() {\r\n ViviendaEntity viviendaEntity = super.toEntity();\r\n if (contratos != null) {\r\n List<ContratoEntity> contratosEntity = new ArrayList<>();\r\n for (ContratoDTO dtoContrato : contratos) {\r\n contratosEntity.add(dtoContrato.toEntity());\r\n }\r\n viviendaEntity.setContratos(contratosEntity);\r\n }\r\n\r\n if (cuartos != null) {\r\n List<CuartoEntity> cuartoEntities = new ArrayList<>();\r\n for (CuartoDTO dto : cuartos) {\r\n cuartoEntities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setCuartos(cuartoEntities);\r\n }\r\n\r\n if (sitiosDeInteres != null) {\r\n List<SitioInteresEntity> entities = new ArrayList<>();\r\n for (SitioInteresDTO dto : sitiosDeInteres) {\r\n entities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setSitiosDeInteres(entities);\r\n }\r\n\r\n if (calificaciones != null) {\r\n List<CalificacionEntity> entities = new ArrayList<>();\r\n for (CalificacionDTO dto : calificaciones) {\r\n entities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setCalificaciones(entities);\r\n }\r\n\r\n if (serviciosOfrecidos != null) {\r\n viviendaEntity.setServiciosIncluidos(serviciosOfrecidos);\r\n }\r\n\r\n if (serviciosAdicionales != null) {\r\n List<ServicioAdicionalEntity> entities = new ArrayList<>();\r\n for (ServicioAdicionalDTO dto : serviciosAdicionales) {\r\n entities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setServiciosAdicionales(entities);\r\n }\r\n\r\n return viviendaEntity;\r\n }", "public Vector<EntityWeapon> getWeaponList();", "public Vector getResultObjects() {\n\treturn _vcResults;\n }", "public List<PetOwnerDTO> getAllPetsOwnerDTO() {\n EntityManager em = emf.createEntityManager();\n Query query = em.createQuery(\"SELECT NEW dto.PetOwnerDTO(p) FROM Pet AS p\");\n return query.getResultList();\n }", "public Vector toVector(){\r\n\t\tVector v = new Vector();\r\n\r\n\t\t// ATTENTION l'ordre est très important !!\r\n\t\t// l'ordre doit être :\r\n\t\t// id, id localisation, adresse, code postal, ville, telephone\r\n\r\n\t\tv.add(id);\r\n\t\tv.add(localisation.getId());\r\n\t\tv.add(localisation.getAdresse());\r\n\t\tv.add(localisation.getCodePostal());\r\n\t\tv.add(localisation.getVille());\r\n\t\tv.add(telephone);\r\n\r\n\t\treturn v;\r\n\t}", "protected Page<V> getVO (Page<T> page, Pageable pageRequest) {\n List<V> contentVO = getVO(page.getContent());\n Page<V> pageResult = new PageImpl<>(contentVO, pageRequest, page.getTotalElements());\n return pageResult;\n }", "public static Vertical toModel(VerticalSoap soapModel) {\n Vertical model = new VerticalImpl();\n\n model.setId(soapModel.getId());\n model.setDescription(soapModel.getDescription());\n model.setEdition(soapModel.getEdition());\n\n return model;\n }", "protected List<V> getVO(List<T> list) {\n List<V> listVO = new ArrayList();\n\n for (T t : list) {\n V vo = getVO(t);\n\n if (vo != null) {\n listVO.add(vo);\n }\n }\n\n return listVO;\n }", "public ViewObjectImpl getFindYourStockistVO1() {\n return (ViewObjectImpl) findViewObject(\"FindYourStockistVO1\");\n }", "public abstract V getEntity();", "public List<Venta> getVentas() {\n List<Venta> vts = new ArrayList<>();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"src/Archivo/ventas/ventas.txt\"));\n String record;\n\n while ((record = br.readLine()) != null) {\n\n StringTokenizer st = new StringTokenizer(record, \",\");\n \n String id = st.nextToken();\n String idCliente = st.nextToken();\n String sacosVendidos = st.nextToken();\n String valueVenta = st.nextToken();\n String fecha = st.nextToken();\n\n\n Venta venta = new Venta(\n Integer.parseInt(id),\n Integer.parseInt(idCliente),\n Integer.parseInt(sacosVendidos),\n Float.parseFloat(valueVenta),\n fecha\n );\n\n vts.add(venta);\n }\n\n br.close();\n } catch (Exception e) {\n System.err.println(e);\n }\n\n return vts;\n }", "public Collection<V> getVertices();", "private Recipe mapToRecipeObject(RecipeEntity recipeEntity) {\n\t\tRecipe recipe = new Recipe();\n\t\t//Map primitive fields\n\t\trecipe.setId(recipeEntity.getId());\n\t\trecipe.setName(recipeEntity.getName());\n\t\trecipe.setType(recipeEntity.getType());\n\t\trecipe.setServingCapacity(recipeEntity.getServingCapacity());\n\t\t\n\t\t//Format creation date time to required format\n\t\tif(recipeEntity.getCreationDateTime() != null)\n\t\t\trecipe.setCDateTimeString(Util.formatDateTime(recipeEntity.getCreationDateTime()));\n\t\trecipe.setCreationDateTime(recipeEntity.getCreationDateTime());\n\t\t\n\t\t//Convert ingredients string into list and set to recipe object \n\t\tlog.debug(\"Ingredients String from DB: \"+recipeEntity.getIngredients());\n\t\tList<Ingredient> ingredientsList = Util.convertJSONStringToIngredientsList(recipeEntity.getIngredients());\n\t\tlog.debug(\"Ingredients List size after conversion: \"+ingredientsList.size());\n\t\trecipe.setIngredientsList(ingredientsList);\n\n\t\trecipe.setInstructions(recipeEntity.getInstructions());\n\n\t\treturn recipe;\n\t}", "public ViewObjectImpl getLovVehicleTypeVO1() {\n return (ViewObjectImpl) findViewObject(\"LovVehicleTypeVO1\");\n }", "public List<Vegetable> getVegetables() {\n ArrayList<Vegetable> vegetables = new ArrayList<>();\n for (VegetablePortion vegetablePortion : list) {\n vegetables.add(vegetablePortion.getVegetable());\n }\n return vegetables;\n }", "public PetModel[] getPetModel() {\n return localPetModel;\n }", "public List<String> getV();", "public Inventory getInventory(){ //needed for InventoryView - Sam\n return inventory;\n }", "public Planet[] getPlanets() {\n return this.planets;\n }", "public ViewObjectImpl getVehicleTypeVo1() {\n return (ViewObjectImpl) findViewObject(\"VehicleTypeVo1\");\n }", "abstract Collection<Object> mapResultClass(Collection<Object> resultSet);", "public ViviendaEntity toEntity() {\r\n ViviendaEntity entity = new ViviendaEntity();\r\n entity.setIdVivienda(this.getIdVivienda());\r\n entity.setCiudad(this.getCiudad());\r\n entity.setDescripcion(this.getDescripcion());\r\n entity.setDireccion(this.getDireccion());\r\n entity.setCapacidad(this.getCapacidad());\r\n \r\n entity.setValorDiario(this.getValorDiario());\r\n entity.setImagen(this.getImagen());\r\n entity.setNumeroHabitaciones (this.getNumeroHabitaciones());\r\n return entity;\r\n }", "@XmlTransient\n Collection<Libro> getLibroCollection1();", "public Entrepot(Vector v){\r\n\t\tthis.id =(Integer)v.get(0);\r\n\t\tthis.localisation=new Localisation(\r\n\t\t\t\t(Integer)v.get(1),\r\n\t\t\t\t(String)v.get(2),\r\n\t\t\t\t(String)v.get(3),\r\n\t\t\t\t(String)v.get(4));\r\n\t\tthis.telephone=(String)v.get(5);\r\n\t}", "List<InventoryItem> getInventory();", "private static List<Element> getXMLLocationTypes(Model model) {\n Set<LocationType> locTypes = new TreeSet<>(Comparators.objectsById());\n locTypes.addAll(model.getLocationTypes(null));\n List<Element> result = new ArrayList<>(locTypes.size());\n for (LocationType curType : locTypes) {\n Element typeElement = new Element(\"locationType\");\n typeElement.setAttribute(\"id\", String.valueOf(curType.getId()));\n typeElement.setAttribute(\"name\", curType.getName());\n for (String curOperation : curType.getAllowedOperations()) {\n Element opElement = new Element(\"allowedOperation\");\n opElement.setAttribute(\"name\", curOperation);\n typeElement.addContent(opElement);\n }\n result.add(typeElement);\n for (Map.Entry<String, String> curEntry\n : curType.getProperties().entrySet()) {\n Element propertyElement = new Element(\"property\");\n propertyElement.setAttribute(\"name\", curEntry.getKey());\n propertyElement.setAttribute(\"value\", curEntry.getValue());\n typeElement.addContent(propertyElement);\n }\n }\n return result;\n }", "@Override\n public DietCollection digestion() {\n return new DietCollection();\n }", "public Collection<node_info> getV()\n{\n\treturn this.getNodes().values();\n}", "public List<PetDTO> getAllPetsLivingDTO() {\n EntityManager em = emf.createEntityManager();\n Query query = em.createQuery(\"SELECT NEW dto.PetDTO(p) FROM Pet AS p WHERE p.death = null\");\n return query.getResultList();\n }", "List<Product> findByVat(Vat vat);", "public /*@ non_null @*/ JMLObjectBag<E> toBag() {\n JMLObjectBag<E> ret = new JMLObjectBag<E>();\n JMLIterator<E> elems = iterator();\n while (elems.hasNext()) {\n //@ assume elems.moreElements;\n E o = elems.next();\n E e = (o == null ? null : o);\n ret = ret.insert(e);\n }\n return ret;\n }", "public Set<V> getVertices();", "public Set<V> getVertices();", "@SuppressWarnings(\"unchecked\")\n private static Object mapValueToVil(Object result, TypeDescriptor<?> type) {\n if (result instanceof java.util.Map<?, ?>) {\n result = new Map<Object, Object>((java.util.Map<Object, Object>) result, type.getGenericParameter());\n } else if (result instanceof java.util.Set<?>) {\n result = new ArraySet<Object>(((java.util.Set<?>) result).toArray(), type.getGenericParameter());\n } else if (result instanceof java.util.List<?>) {\n result = new ArraySequence<Object>(((java.util.List<?>) result).toArray(), type.getGenericParameter());\n }\n return result;\n }", "public ViewObjectImpl getSvLpgStoveProductVo1() {\n return (ViewObjectImpl) findViewObject(\"SvLpgStoveProductVo1\");\n }", "Objet getObjetAlloue();", "private Object instObj(final Value v) throws QueryException {\r\n return cls.isInstance(v) ? v : v.toJava();\r\n }", "default <T extends SimpleInventory> List<T> getInventories(Class<T> clazz) {\n return this.getInventories().stream()\n .filter(inventory -> inventory.getClass().equals(clazz))\n .map(clazz::cast)\n .collect(Collectors.toList());\n }", "@Override\n\tpublic Collection<V> values() {\n\t\t// TODO\n\t\treturn new ValueView();\n\t}", "@Override\n\tpublic SATipoVivienda generarSATipoVivienda() {\n\t\treturn new SATipoViviendaImp();\n\t}", "@GET\r\n @Produces(MediaType.APPLICATION_JSON)\r\n @Path(\"StockProducto/list\")\r\n public ArrayList<StockProducto> getXmls() throws Exception {\n ArrayList<StockProducto> lista=new ArrayList<StockProducto>();\r\n lista=StockProducto.stockproducto();\r\n return lista;\r\n }", "private static Map<VOTableVersion,VersionDetail>\n createMap( VersionDetail[] vds ) {\n Map<VOTableVersion,VersionDetail> map =\n new LinkedHashMap<VOTableVersion,VersionDetail>();\n for ( int i = 0; i < vds.length; i++ ) {\n map.put( vds[ i ].version_, vds[ i ] );\n }\n return map;\n }", "public abstract java.util.Collection getTecnico_peticion();", "public VVentasRecord() {\n super(VVentas.V_VENTAS);\n }", "@Override\r\n\tprotected void initVentajas() {\n\r\n\t}", "public ArrayOfPetModel getArrayOfPetModel() {\n return localArrayOfPetModel;\n }", "Map<String, Object> getServiceSpecificObjects();", "public ViewObjectImpl getTestPortfolioStocksVO() {\n return (ViewObjectImpl)findViewObject(\"TestPortfolioStocksVO\");\n }", "public String getVatId()\n {\n return vatId;\n }", "ProductInner innerModel();", "@Override\n\tpublic String toJSON()\n\t{\n\t\tStringJoiner json = new StringJoiner(\", \", \"{\", \"}\")\n\t\t.add(\"\\\"name\\\": \\\"\" + this.name + \"\\\"\")\n\t\t.add(\"\\\"id\\\": \" + this.getId());\n\t\tString locationJSON = \"\"; \n\t\tif(this.getLocation() == null)\n\t\t{\n\t\t\tlocationJSON = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlocationJSON = this.getLocation().toJSON(); \n\t\t}\n\t\tjson.add(\"\\\"location\\\": \" + locationJSON);\n\t\tStringJoiner carsJSON = new StringJoiner(\", \", \"[\", \"]\");\n\t\tfor(Object r : cars)\n\t\t{\n\t\t\tcarsJSON.add(((RollingStock) r).toJSON());\n\t\t}\n\t\tjson.add(\"\\\"cars\\\": \" + carsJSON.toString());\n\t\treturn json.toString(); \n\t}", "@Override\n public String toString() {\n return \"Pet{\" +\n \"mId=\" + mId +\n \", mName='\" + mName + '\\'' +\n \", mDetails='\" + mDetails + '\\'' +\n \", mPhone='\" + mPhone + '\\'' +\n \", mImageUri=\" + mImageUri +\n '}';\n }", "public List<PetDTO> getAllPetsEventsDate(Date date) { \n EntityManager em = emf.createEntityManager();\n Query query = em.createQuery(\"SELECT NEW dto.PetDTO(p) FROM Pet p JOIN p.eventCollection e WHERE e.date = :date\");\n query.setParameter(\"date\", date);\n return query.getResultList();\n }", "@Override\n\tpublic ResponseConsulta consultarVehiculos() {\n\t\tResponseConsulta respConsulta = new ResponseConsulta();\n\t\ttry {\n\t\t\tList<Vehiculo> listaVeiculos = vehiculoRepositorio.buscarTodasVehiculo();\n\t\t\trespConsulta.setListVehiculos(listaVeiculos);\n\t\t\trespConsulta.setMensaje(properties.msgExito);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(properties.errorGenerico + e);\n\t\t\trespConsulta.setMensaje(properties.errorGenerico);\n\t\t}\n\t\treturn respConsulta;\n\t}", "public Collection<V> getOtherVertices(V v);" ]
[ "0.6116283", "0.5738142", "0.5654772", "0.5521792", "0.53627324", "0.5218932", "0.5217166", "0.51861906", "0.5108026", "0.50675154", "0.50363404", "0.5031501", "0.50308686", "0.50226676", "0.5012794", "0.49960205", "0.49731633", "0.49593535", "0.4953455", "0.4950011", "0.49255145", "0.49178472", "0.48875418", "0.48840067", "0.48577705", "0.48328695", "0.48252815", "0.48247156", "0.4821232", "0.4816301", "0.48156372", "0.4805372", "0.4803098", "0.48004708", "0.47962368", "0.4791298", "0.4781712", "0.47784397", "0.4772537", "0.47717038", "0.47684008", "0.4767743", "0.4763186", "0.47569573", "0.4754769", "0.47526035", "0.474677", "0.47433388", "0.47341818", "0.47312462", "0.47310826", "0.4725041", "0.47246593", "0.47240135", "0.47234464", "0.47186193", "0.47184157", "0.47104996", "0.47070107", "0.47017625", "0.46957204", "0.46943596", "0.46907815", "0.46896797", "0.46839014", "0.46655393", "0.46649048", "0.46583754", "0.46580544", "0.46576232", "0.46504015", "0.46475497", "0.46474695", "0.4640832", "0.46403706", "0.4639012", "0.46389037", "0.46389037", "0.4637729", "0.46348497", "0.46336916", "0.4633227", "0.46326163", "0.46297288", "0.4624455", "0.46205357", "0.46135893", "0.4607516", "0.46067166", "0.46044204", "0.46001187", "0.45962775", "0.45935303", "0.4592634", "0.45923743", "0.45920676", "0.45894635", "0.45875674", "0.45848942", "0.4581598" ]
0.5237089
5
Here we are returning an object of type 'Vets' rather than a collection of Vet objects so it is simpler for JSon/Object mapping
@GetMapping({ "/vets" }) public @ResponseBody Vets showResourcesVetList() { Vets vets = new Vets(); vets.getVetList().addAll(this.vetRepository.findAll()); return vets; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Vet> getAllVets() {\n\t\tentityManager = JPAUtils.getEntityManager();\n\t\tentityManager.getTransaction().begin();\n\t\tvets = entityManager.createQuery(\"from Vet\", Vet.class).getResultList();\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t\treturn vets;\n\t}", "protected JsonJavaObject getVcapServices() {\n\t\tJsonJavaObject vcapJson = null;\n\t\tJsonJavaFactory factory = JsonJavaFactory.instanceEx;\n\t\tString sysEnv = BluemixContextManager.getInstance().getVCAP_SERVICES();\n\n\t\ttry {\n\t\t\tvcapJson = (JsonJavaObject) JsonParser.fromJson(factory, sysEnv);\n\n\t\t} catch (JsonException e) {\n\t\t\tPlatform.getInstance().log(e);\n\t\t\tLogging.logError(e);\n\t\t}\n\t\treturn vcapJson;\n\t}", "@GetMapping(\"/Vets/{id}\")\n\tpublic ResponseEntity<Vets> getVetsById(@PathVariable int id) {\n\t\tVets vets = VetsRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new ResourceNotFoundException(\"Vet not exist with id :\" + id));\n\t\treturn ResponseEntity.ok(vets);\n\t}", "@Test\n\tpublic void testVirtualPetShelterHasACollectionOfVirtualPets() {\n\t\tVirtualPetShelter testPetShelter = new VirtualPetShelter(); \n\n\t\tMap<String, VirtualPet> virtualPets = new HashMap<String, VirtualPet>(); // I want a map of VP's\n\t\t// Map<Key, Value (instances of virtualPet)> - the key will be the name of pet, the key is assigned to the pets instance\n\t\tString pet1 = \"Tui\"; //this is my first key called \"Tui\"\n\t\tVirtualPet tui = new VirtualPet(\"Tui\", \"Is a cute little calico\", 30, 30, 30);\n\t\tvirtualPets.put(pet1, tui);\n\n\t\tString pet2 = \"Ditch\";\n\t\tVirtualPet ditch = new VirtualPet(\"Ditch\", \"Is as cunning as a shithouse rat\", 10, 40, 15);\n\t\tvirtualPets.put(pet2, ditch);\n\n\t\tString pet3 = \"Blusey\";\n\t\tVirtualPet bluesy = new VirtualPet(\"Bluesy\", \"A black and tan Main coon who is a mushy cat who loves snuggles\",\n\t\t\t\t5, 5, 5);\n\t\tvirtualPets.put(pet3, bluesy);\n\n\t\tString pet4 = \"Jazzy\";\n\t\tVirtualPet jazzy = new VirtualPet(\"Jazzy\", \"Grey tiger who hunter who who be great in the barn\", 15, 20, 25);\n\t\tvirtualPets.put(pet4, jazzy);\n\n\t\tString pet5 = \"Nigel\";\n\t\tVirtualPet nigel = new VirtualPet(\"Nigel\", \"A big old ginger cat\", 10, 10, 50);\n\t\tvirtualPets.put(pet5, nigel);\n\n\t\t// Moved the Map/HashMap below to the VirtualPetShelter\n\t\t// Map<String, VirtualPet> virtualPets = new HashMap<String, VirtualPet>();\n\t\t// Then I created a method in VirtualPetShelter which returned the VirtualPets\n\t\t// \"Values\"\n\n\t\tCollection<VirtualPet> virtualPetCollection = testPetShelter.getVirtualPets(); //Initially got error, eclipse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// asked me to create collection in VPS\n\n\t\tAssert.assertNotNull(testPetShelter.virtualPets);//I got error, eclipse asked me to create a HashMap in VPS\n\t\tAssert.assertEquals(virtualPetCollection, testPetShelter.virtualPets.values()); //\".values() is a Maps \n\t\t //way to return a \"Collection\"\n\t\tAssert.assertEquals(\"Nigel\", virtualPets.get(pet5).name); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(30, virtualPets.get(pet1).hunger); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(40, virtualPets.get(pet2).boredom); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(5, virtualPets.get(pet3).thirst); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(\"Grey tiger who hunter who who be great in the barn\", virtualPets.get(pet4).description);\n\t}", "@GetMapping(\"/vets.html\")\n\tpublic String showVetList(Map<String, Object> model) {\n\t\tVets vets = new Vets();\n\t\tList<Vet> allVets = (List<Vet>) vetRepository.findAll();\n\t\tCollections.sort(allVets, Comparator.comparing(vet -> vet.getFirstName()));\n\t\tvets.getVetList().addAll(allVets);\n\t\tmodel.put(\"vets\", vets);\n\t\treturn \"vets/vetList\";\n\t}", "public Collection<VirtualPet> pets() {\n\t\treturn shelterPets.values();\n\t}", "public static JSONObject processVclassResultsJSON(Map<String, Object> map, VitroRequest vreq, boolean multipleVclasses) {\n JSONObject rObj = new JSONObject();\n VClass vclass=null; \n \n try { \n \n // Properties from ontologies used by VIVO - should not be in vitro\n DataProperty fNameDp = (new DataProperty()); \n fNameDp.setURI(\"http://xmlns.com/foaf/0.1/firstName\");\n DataProperty lNameDp = (new DataProperty());\n lNameDp.setURI(\"http://xmlns.com/foaf/0.1/lastName\");\n DataProperty preferredTitleDp = (new DataProperty());\n preferredTitleDp.setURI(\"http://vivoweb.org/ontology/core#preferredTitle\");\n \n if( log.isDebugEnabled() ){\n @SuppressWarnings(\"unchecked\")\n Enumeration<String> e = vreq.getParameterNames();\n while(e.hasMoreElements()){\n String name = (String)e.nextElement();\n log.debug(\"parameter: \" + name);\n for( String value : vreq.getParameterValues(name) ){\n log.debug(\"value for \" + name + \": '\" + value + \"'\");\n } \n }\n }\n \n //need an unfiltered dao to get firstnames and lastnames\n WebappDaoFactory fullWdf = vreq.getFullWebappDaoFactory();\n \n String[] vitroClassIdStr = vreq.getParameterValues(\"vclassId\"); \n if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){ \n for(String vclassId: vitroClassIdStr) {\n vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(vclassId);\n if (vclass == null) {\n log.error(\"Couldn't retrieve vclass \"); \n throw new Exception (\"Class \" + vclassId + \" not found\");\n } \n }\n }else{\n log.error(\"parameter vclassId URI parameter expected \");\n throw new Exception(\"parameter vclassId URI parameter expected \");\n }\n List<String> vclassIds = Arrays.asList(vitroClassIdStr); \n //if single vclass expected, then include vclass. This relates to what the expected behavior is, not size of list \n if(!multipleVclasses) {\n //currently used for ClassGroupPage\n rObj.put(\"vclass\", \n new JSONObject().put(\"URI\",vclass.getURI())\n .put(\"name\",vclass.getName()));\n } else {\n //For now, utilize very last VClass (assume that that is the one to be employed)\n //TODO: Find more general way of dealing with this\n //put multiple ones in?\n if(vclassIds.size() > 0) {\n \tint numberVClasses = vclassIds.size();\n vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(vclassIds.get(numberVClasses - 1));\n rObj.put(\"vclass\", new JSONObject().put(\"URI\",vclass.getURI())\n .put(\"name\",vclass.getName()));\n } \n // rObj.put(\"vclasses\", new JSONObject().put(\"URIs\",vitroClassIdStr)\n // .put(\"name\",vclass.getName()));\n }\n if (vclass != null) { \n \n rObj.put(\"totalCount\", map.get(\"totalCount\"));\n rObj.put(\"alpha\", map.get(\"alpha\"));\n \n List<Individual> inds = (List<Individual>)map.get(\"entities\");\n log.debug(\"Number of individuals returned from request: \" + inds.size());\n JSONArray jInds = new JSONArray();\n for(Individual ind : inds ){\n JSONObject jo = new JSONObject();\n jo.put(\"URI\", ind.getURI());\n jo.put(\"label\",ind.getRdfsLabel());\n jo.put(\"name\",ind.getName());\n jo.put(\"thumbUrl\", ind.getThumbUrl());\n jo.put(\"imageUrl\", ind.getImageUrl());\n jo.put(\"profileUrl\", UrlBuilder.getIndividualProfileUrl(ind, vreq));\n \n jo.put(\"mostSpecificTypes\", JsonServlet.getMostSpecificTypes(ind,fullWdf)); \n jo.put(\"preferredTitle\", JsonServlet.getDataPropertyValue(ind, preferredTitleDp, fullWdf)); \n \n jInds.put(jo);\n }\n rObj.put(\"individuals\", jInds);\n \n JSONArray wpages = new JSONArray();\n //Made sure that PageRecord here is SolrIndividualListController not IndividualListController\n List<PageRecord> pages = (List<PageRecord>)map.get(\"pages\"); \n for( PageRecord pr: pages ){ \n JSONObject p = new JSONObject();\n p.put(\"text\", pr.text);\n p.put(\"param\", pr.param);\n p.put(\"index\", pr.index);\n wpages.put( p );\n }\n rObj.put(\"pages\",wpages); \n \n JSONArray jletters = new JSONArray();\n List<String> letters = Controllers.getLetters();\n for( String s : letters){\n JSONObject jo = new JSONObject();\n jo.put(\"text\", s);\n jo.put(\"param\", \"alpha=\" + URLEncoder.encode(s, \"UTF-8\"));\n jletters.put( jo );\n }\n rObj.put(\"letters\", jletters);\n } \n } catch(Exception ex) {\n log.error(\"Error occurred in processing JSON object\", ex);\n }\n return rObj;\n }", "public ArrayList<Pets> getPets(){\n DataBase db = new DataBase(context);\n initPets(db);\n return db.getPets();\n }", "public List<Voto> getVotos(){\n\t\treturn em.createQuery(\"SELECT c from Voto c\", Voto.class).getResultList();\n\t}", "@Override\r\n\tpublic JSONObject getJSON() {\n\t\treturn tenses;\r\n\t}", "public List<Visit> getVisitsByVetId(int vetId) {\n JdbcTemplate select = new JdbcTemplate(dataSource);\n return select.query(\"SELECT * FROM visit WHERE vetId=?\",new Object[] {vetId}, new VisitRowMapper()); \n }", "@Override\n public List<Vessel> getVessels() {\n return new ArrayList<>(boats);\n }", "@PostMapping(\"/Vets\")\n\tpublic Vets createVets(@RequestBody Vets vets) {\n\t\treturn VetsRepository.save(vets);\n\t}", "@Override\n\tpublic String toJSON()\n\t{\n\t\tStringJoiner json = new StringJoiner(\", \", \"{\", \"}\")\n\t\t.add(\"\\\"name\\\": \\\"\" + this.name + \"\\\"\")\n\t\t.add(\"\\\"id\\\": \" + this.getId());\n\t\tString locationJSON = \"\"; \n\t\tif(this.getLocation() == null)\n\t\t{\n\t\t\tlocationJSON = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlocationJSON = this.getLocation().toJSON(); \n\t\t}\n\t\tjson.add(\"\\\"location\\\": \" + locationJSON);\n\t\tStringJoiner carsJSON = new StringJoiner(\", \", \"[\", \"]\");\n\t\tfor(Object r : cars)\n\t\t{\n\t\t\tcarsJSON.add(((RollingStock) r).toJSON());\n\t\t}\n\t\tjson.add(\"\\\"cars\\\": \" + carsJSON.toString());\n\t\treturn json.toString(); \n\t}", "private JSONArray foodsToJson() {\n JSONArray jsonArray = new JSONArray();\n\n for (Food f : units) {\n jsonArray.put(f.toJson());\n }\n\n return jsonArray;\n }", "private org.json.simple.JSONArray createJsonArrayList() {\n org.json.simple.JSONArray list = new org.json.simple.JSONArray();\n for (VoteOption v : voteOptions) {\n list.add(v.getText());\n }\n return list;\n }", "private void populatepets(){\r\n\t\tpets.add(new Cat(\"UnNamed\"));\r\n\t\tpets.add(new Cow(\"UnNamed\"));\r\n\t\tpets.add(new Dog(\"UnNamed\"));\r\n\t\tpets.add(new Rabbit(\"UnNamed\"));\r\n\t\tpets.add(new Rat(\"UnNamed\"));\r\n\t\tpets.add(new Velociraptor(\"UnNamed\"));\r\n\t}", "public Map<String, Planet> getPlanets(){\n\t\treturn galaxy;\n\t}", "public ArrayOfPetModel getPets() {\n return localPets;\n }", "@SuppressWarnings(\"unchecked\")\n private static Object mapValueToVil(Object result, TypeDescriptor<?> type) {\n if (result instanceof java.util.Map<?, ?>) {\n result = new Map<Object, Object>((java.util.Map<Object, Object>) result, type.getGenericParameter());\n } else if (result instanceof java.util.Set<?>) {\n result = new ArraySet<Object>(((java.util.Set<?>) result).toArray(), type.getGenericParameter());\n } else if (result instanceof java.util.List<?>) {\n result = new ArraySequence<Object>(((java.util.List<?>) result).toArray(), type.getGenericParameter());\n }\n return result;\n }", "List<VoziloDto> sveVozila();", "private static Serde<VehiclePosition> getJsonSerde(){\n Map<String, Object> serdeProps = new HashMap<>();\n serdeProps.put(\"json.value.type\", VehiclePosition.class);\n final Serializer<VehiclePosition> vpSerializer = new KafkaJsonSerializer<>();\n vpSerializer.configure(serdeProps, false);\n \n final Deserializer<VehiclePosition> vpDeserializer = new KafkaJsonDeserializer<>();\n vpDeserializer.configure(serdeProps, false);\n return Serdes.serdeFrom(vpSerializer, vpDeserializer);\n }", "public ViatgesDTO() {\n \n }", "private Recipe mapToRecipeObject(RecipeEntity recipeEntity) {\n\t\tRecipe recipe = new Recipe();\n\t\t//Map primitive fields\n\t\trecipe.setId(recipeEntity.getId());\n\t\trecipe.setName(recipeEntity.getName());\n\t\trecipe.setType(recipeEntity.getType());\n\t\trecipe.setServingCapacity(recipeEntity.getServingCapacity());\n\t\t\n\t\t//Format creation date time to required format\n\t\tif(recipeEntity.getCreationDateTime() != null)\n\t\t\trecipe.setCDateTimeString(Util.formatDateTime(recipeEntity.getCreationDateTime()));\n\t\trecipe.setCreationDateTime(recipeEntity.getCreationDateTime());\n\t\t\n\t\t//Convert ingredients string into list and set to recipe object \n\t\tlog.debug(\"Ingredients String from DB: \"+recipeEntity.getIngredients());\n\t\tList<Ingredient> ingredientsList = Util.convertJSONStringToIngredientsList(recipeEntity.getIngredients());\n\t\tlog.debug(\"Ingredients List size after conversion: \"+ingredientsList.size());\n\t\trecipe.setIngredientsList(ingredientsList);\n\n\t\trecipe.setInstructions(recipeEntity.getInstructions());\n\n\t\treturn recipe;\n\t}", "public static Object fromJSON(quark.reflect.Class cls, Object result, io.datawire.quark.runtime.JSONObject json) {\n if (((json)==(null) || ((Object)(json) != null && ((Object) (json)).equals(null))) || ((json).isNull())) {\n return null;\n }\n Integer idx = 0;\n if ((result)==(null) || ((Object)(result) != null && ((Object) (result)).equals(null))) {\n if (((cls).name)==(\"quark.String\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.String\"))) {\n String s = (json).getString();\n return s;\n }\n if (((cls).name)==(\"quark.float\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.float\"))) {\n Double flt = (json).getNumber();\n return flt;\n }\n if (((cls).name)==(\"quark.int\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.int\"))) {\n Integer i = ((int) Math.round((json).getNumber()));\n return i;\n }\n if (((cls).name)==(\"quark.bool\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.bool\"))) {\n Boolean b = (json).getBool();\n return b;\n }\n result = (cls).construct(new java.util.ArrayList(java.util.Arrays.asList(new Object[]{})));\n }\n if (((cls).name)==(\"quark.List\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.List\"))) {\n java.util.ArrayList<Object> list = (java.util.ArrayList<Object>) (result);\n while ((idx) < ((json).size())) {\n (list).add(Functions.fromJSON(((cls).getParameters()).get(0), null, (json).getListItem(idx)));\n idx = (idx) + (1);\n }\n return list;\n }\n java.util.ArrayList<quark.reflect.Field> fields = (cls).getFields();\n while ((idx) < ((fields).size())) {\n quark.reflect.Field f = (fields).get(idx);\n idx = (idx) + (1);\n if (Boolean.valueOf(((f).name).startsWith(\"_\"))) {\n continue;\n }\n if (!(((json).getObjectItem((f).name)).isNull())) {\n ((io.datawire.quark.runtime.QObject) (result))._setField((f).name, Functions.fromJSON((f).getType(), null, (json).getObjectItem((f).name)));\n }\n }\n return result;\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 Vegetable createVegFromJson(final String rawVeg)\n throws NoSuchIngredientException {\n CoderFactory coderFactory = CoderFactory.getSingleInstance();\n VegetableDecoder vegDecoder = coderFactory.getVegetableDecoder();\n Optional<Vegetable> optionalVeg = vegDecoder.decodeVegetable(rawVeg);\n Vegetable vegetable = optionalVeg.orElseThrow(() ->\n new NoSuchIngredientException(getContentError()));\n return validateVeg(vegetable, rawVeg);\n }", "public JsonObject covertToJson() {\n JsonObject transObj = new JsonObject(); //kasutaja portf. positsiooni tehing\n transObj.addProperty(\"symbol\", symbol);\n transObj.addProperty(\"type\", type);\n transObj.addProperty(\"price\", price);\n transObj.addProperty(\"volume\", volume);\n transObj.addProperty(\"date\", date);\n transObj.addProperty(\"time\", time);\n transObj.addProperty(\"profitFromSell\", profitFromSell);\n transObj.addProperty(\"averagePurchasePrice\", averagePurchasePrice);\n return transObj;\n }", "private static Map<VOTableVersion,VersionDetail>\n createMap( VersionDetail[] vds ) {\n Map<VOTableVersion,VersionDetail> map =\n new LinkedHashMap<VOTableVersion,VersionDetail>();\n for ( int i = 0; i < vds.length; i++ ) {\n map.put( vds[ i ].version_, vds[ i ] );\n }\n return map;\n }", "public static HashMap<String, Vol> getlesVols(){\n\t\treturn lesVols;\n\t}", "public abstract Object toJson();", "public Planet[] getPlanets() {\n return this.planets;\n }", "public Object getV1(){\n \treturn v1;\n }", "@PutMapping(\"/Vets/{id}\")\n\tpublic ResponseEntity<Vets> updateVets(@PathVariable int id, @RequestBody Vets vets) {\n\t\tVets vets11 = VetsRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new ResourceNotFoundException(\"Vetenarian not exist with id :\" + id));\n\n\t\tvets11.setFirstName(vets.getFirstName());\n\t\tvets11.setLastName(vets.getLastName());\n\t\tvets11.setSpecialties(vets.getSpecialties());\n\t\tvets11.setExperience(vets.getExperience());\n\t\tvets11.setPrice(vets.getPrice());\n\n\t\tVets updatedEmployee = VetsRepository.save(vets11);\n\t\treturn ResponseEntity.ok(updatedEmployee);\n\t}", "public VirtualPet getPet(String name) {\n\t\treturn shelterPets.get(name);\n\n\t}", "public Map<String, VPlexVirtualVolumeInfo> getVirtualVolumes(boolean shallow) throws VPlexApiException {\n s_logger.info(\"Request for {} discovery of virtual volume info for VPlex at {}\",\n (shallow ? \"shallow\" : \"deep\"), _baseURI);\n\n Map<String, VPlexVirtualVolumeInfo> virtualVolumeInfoMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n Map<String, VPlexVirtualVolumeInfo> distributedVirtualVolumesMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n Map<String, Map<String, VPlexVirtualVolumeInfo>> localVirtualVolumesMap = new HashMap<String, Map<String, VPlexVirtualVolumeInfo>>();\n\n // Get the cluster information.\n List<VPlexClusterInfo> clusterInfoList = getClusterInfoLite();\n for (VPlexClusterInfo clusterInfo : clusterInfoList) {\n String clusterId = clusterInfo.getName();\n // for each cluster get the virtual volume information.\n List<VPlexVirtualVolumeInfo> clusterVirtualVolumeInfoList = _discoveryMgr.getVirtualVolumesForCluster(clusterId);\n for (VPlexVirtualVolumeInfo virtualVolumeInfo : clusterVirtualVolumeInfoList) {\n virtualVolumeInfo.addCluster(clusterId);\n String virtualVolumeName = virtualVolumeInfo.getName();\n\n if (!virtualVolumeInfoMap.containsKey(virtualVolumeName)) {\n // We want the unique list of virtual volumes on all\n // clusters. Distributed volumes will appear on both\n // clusters.\n virtualVolumeInfoMap.put(virtualVolumeName, virtualVolumeInfo);\n\n // If we are doing a deep discovery of the virtual volumes\n // keep a list of the distributed virtual volumes and a list\n // of the local virtual volumes for each cluster.\n if (!shallow) {\n String supportingDeviceName = virtualVolumeInfo.getSupportingDevice();\n if (VPlexVirtualVolumeInfo.Locality.distributed.name().equals(\n virtualVolumeInfo.getLocality())) {\n distributedVirtualVolumesMap.put(supportingDeviceName,\n virtualVolumeInfo);\n } else {\n Map<String, VPlexVirtualVolumeInfo> clusterLocalVolumesMap = localVirtualVolumesMap\n .get(clusterId);\n if (clusterLocalVolumesMap == null) {\n clusterLocalVolumesMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n localVirtualVolumesMap.put(clusterId, clusterLocalVolumesMap);\n }\n clusterLocalVolumesMap.put(supportingDeviceName, virtualVolumeInfo);\n }\n }\n } else if (VPlexVirtualVolumeInfo.Locality.distributed.name().equals(\n virtualVolumeInfo.getLocality())) {\n // on a distributed volume, we need to be sure to add the second\n // cluster id as well... this is needed by ingestion. see CTRL-10982\n virtualVolumeInfoMap.get(virtualVolumeName).addCluster(clusterId);\n }\n }\n }\n // Do the deep discovery of the component structure for each\n // virtual volume, if necessary.\n if (!shallow) {\n // Get the component structure for each distributed virtual volume\n // starting with the supporting distributed device.\n _discoveryMgr.setSupportingComponentsForDistributedVirtualVolumes(distributedVirtualVolumesMap);\n\n // Get the component structure for each local virtual volume\n // starting with the supporting local device.\n for (Map.Entry<String, Map<String, VPlexVirtualVolumeInfo>> mapEntry : localVirtualVolumesMap\n .entrySet()) {\n _discoveryMgr.setSupportingComponentsForLocalVirtualVolumes(\n mapEntry.getKey(), mapEntry.getValue());\n }\n }\n\n return virtualVolumeInfoMap;\n }", "public List<String> getV();", "E toEntity(V dto);", "private ArrayList<ServiceModel> getServiceModelJSON(JSONObject obj) {\n ArrayList<ServiceModel> servicesModel = new ArrayList<>();\n\n try {\n JSONArray servicesArray = obj.getJSONArray(\"services\");\n int limit = servicesArray.length();\n\n for (int i = 0; i < limit; i++) {\n JSONObject service = servicesArray.getJSONObject(i);\n\n ServiceModel serviceModel = new ServiceModel();\n\n serviceModel.setId(service.getInt(\"ID_SERVICE\"));\n serviceModel.setName(Conexion.decode(service.getString(\"NAME_SERVICE\")));\n serviceModel.setReserved(service.getInt(\"RESERVED_SERVICE\"));\n serviceModel.setDescription(Conexion.decode(service.getString(\"DESCRIPTION_SERVICE\")));\n serviceModel.setImage(service.getString(\"IMAGE_SERVICE\"));\n serviceModel.setIdType(service.getInt(\"ID_TYPE_SERVICE\"));\n serviceModel.setNameType(Conexion.decode(service.getString(\"NAME_TYPE_SERVICE\")));\n serviceModel.setValueType(service.getInt(\"VALUE_TYPE_SERVICE\"));\n\n serviceModel.setServicePrice(serviceServicePrice.getServicePriceModelJSON(service, serviceModel.getId(), false));\n servicesModel.add(serviceModel);\n }\n\n } catch (JSONException e) {\n System.out.println(\"Error: Objeto no convertible, \" + e.toString());\n e.printStackTrace();\n }\n return servicesModel;\n }", "public static JSONObject covertDataToJSONForPage(String pageUri, Map<String, Object> data, VitroRequest vreq, ServletContext context) throws InstantiationException, IllegalAccessException, ClassNotFoundException { \n //Get PageDataGetter types associated with pageUri\n JSONObject rObj = null; \n List<PageDataGetter> dataGetters = getPageDataGetterObjects(vreq, pageUri);\n for(PageDataGetter getter: dataGetters) {\n \t JSONObject typeObj = null;\n try{\n typeObj = getter.convertToJSON(data, vreq);\n if( typeObj != null) {\n //Copy over everything from this type Obj to \n //TODO: Review how to handle duplicate keys, etc.\n if(rObj != null) {\n //For now, just nests as separate entry\n rObj.put(getter.getType(), typeObj);\n } else {\n rObj = typeObj;\n }\n } \n \t\n } catch(Throwable th){\n log.error(th,th);\n }\n } \n return rObj;\n }", "@Override\n\tpublic JsonElement serialize(Dog src, Type typeOfT,\n\t\t\tJsonSerializationContext context) {\n\t\tJsonObject obj = new JsonObject();\n\t\tobj.addProperty(\"name\", src.name());\n\t\tobj.addProperty(\"ferocity\", src.ferocity());\n\t\treturn obj;\n\t}", "public void generateVehicles(JSONObject resp) throws JSONException {\n birds = new ArrayList<Vehicle>();\n JSONArray items = resp.getJSONArray(\"birds\");\n double lat = 0;\n double lng = 0;\n String id = \"\";\n int bat = 0;\n System.out.println(items.toString());\n System.out.println(\"parsing.....\");\n for(int i=0;i<items.length();++i){\n JSONObject current = (JSONObject) items.get(i);\n //Vehicle(String vendor,String id, int battery, double lat, double lng, double startPrice, double minutePrice)\n //birds.add(new Vehicle(\"bird\",items.get(i).getString(\"id\");\n if(current.getString(\"captive\").equals(\"false\")) {\n JSONObject loc = current.getJSONObject(\"location\");\n lat = loc.getDouble(\"latitude\");\n lng = loc.getDouble(\"longitude\");\n bat = Integer.parseInt(current.getString(\"battery_level\"));\n id = current.getString(\"id\");\n\n Vehicle veh = new Vehicle(\"bird\",id,bat,lat,lng,\"$1 to unlock $0.27 / 1 min\");\n veh.setType(\"scooter\");\n System.out.print(veh);\n\n birds.add(veh);\n }\n }\n/* for(int i=0;i<birds.size();++i){\n System.out.println(birds.get(i));\n }\n */\n\n }", "public interface SearchVerses {\n @GET(\"/api/?type=json\")\n void searchForVerse(@Query(\"passage\") String passage, Callback<List<Verse>> callback);\n \n @GET(\"/api/?type=json\")\n List<Verse> listVerses(@Query(\"passage\") String passage);\n\n// public static class SearchResponse {\n// VerseContent response;\n//\n// public List<Verse> getVerses() {\n// return response.verses;\n// }\n// }\n\n public static class Verse {\n public String bookname;\n public String chapter;\n public String verse;\n public String text;\n public String title;\n }\n\n class VerseContent {\n List<Verse> verses;\n }\n}", "@Override\n public JSONObject toJSON() throws JSONException {\n JSONObject jo = super.toJSON();\n\n jo.putOpt(Constants.JSON.ELEM_EVENT_VENUE_NAME, venueName);\n jo.putOpt(Constants.JSON.ELEM_EVENT_VENUE_ADDR, venueAddress);\n jo.putOpt(Constants.JSON.ELEM_EVENT_VENUE_POST_CODE, venuePostCode);\n jo.putOpt(Constants.JSON.ELEM_EVENT_VENUE_CITY, venueCity);\n jo.putOpt(Constants.JSON.ELEM_EVENT_VENUE_PHONE, venuePhone);\n jo.putOpt(Constants.JSON.ELEM_EVENT_START_TIME, startTimeText);\n jo.putOpt(Constants.JSON.ELEM_EVENT_TIMEZONE, timezone);\n if (travelTime != TRAVEL_TIME_UNKNOWN) {\n jo.putOpt(Constants.JSON.ELEM_EVENT_TRAVEL_TIME, travelTime);\n }\n jo.putOpt(Constants.JSON.ELEM_EVENT_ACCESS_INFO, accessInfo);\n\n return jo;\n }", "@RequestMapping(method = RequestMethod.GET, produces = \"application/json\", headers = \"Accept=application/json\" )\n public ResponseEntity<List<InventoryResponse>> getInventory(){\n List<InventoryResponse> inventoryResponse = new ArrayList<>();\n inventoryService.getInventory().stream().forEach(inventoryItem -> inventoryResponse.add(\n new InventoryResponse(inventoryItem.getProduct().getId(), inventoryItem.getAmount())));\n\n return ResponseEntity.ok(inventoryResponse);\n }", "private Object instObj(final Value v) throws QueryException {\r\n return cls.isInstance(v) ? v : v.toJava();\r\n }", "@POST(\"listedVenues\")\n Call<Map<String, Venue>> listedVenues();", "private Movie getMovie() {\n Gson gson = new Gson();\n return gson.fromJson(result, Movie.class);\n }", "public void parseProductFromJson(String jsonData) { \r\n\t\t \r\n Type typeList = new TypeToken<ArrayList<Product>>(){}.getType(); \r\n Gson gson = new Gson(); \r\n ArrayList<Product> products = gson.fromJson(jsonData, typeList); \r\n for(Product product:products) { \r\n System.out.println(\"name---------->\" + product.getpName()); \r\n System.out.println(\"price---------->\" + product.getpPrice()); \r\n } \r\n }", "public FilterItems jsonToObject(String json){\n json = json.replace(\"body=\",\"{ \\\"body\\\" : \");\n json = json.replace(\"&oil=\",\", \\\"oil\\\" : \");\n json = json.replace(\"&transmission=\",\", \\\"transmission\\\" :\");\n json = json + \"}\";\n json = json.replace(\"[]\",\"null\");\n ObjectMapper mapper = new ObjectMapper();\n FilterItems itemSearch = null;\n try {\n itemSearch = mapper.readValue(json, FilterItems.class);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return itemSearch;\n }", "private Variant setVariantsFromApi(VariantsModel variantsModel, Long id, Long productID) {\n return new Variant(id,\n variantsModel.getId(),\n productID,\n variantsModel.getColor(),\n variantsModel.getSize(),\n variantsModel.getPrice()\n );\n }", "public List<PetDTO> getAllPetsLivingDTO() {\n EntityManager em = emf.createEntityManager();\n Query query = em.createQuery(\"SELECT NEW dto.PetDTO(p) FROM Pet AS p WHERE p.death = null\");\n return query.getResultList();\n }", "public ArrayList<Pets> getPetList() {\n\n ArrayList<Pets> petList = new ArrayList<>();\n\n try {\n Statement statement = conn.createStatement();\n String sqlStatement = \"SELECT name FROM pets\";\n\n ResultSet rs = statement.executeQuery(sqlStatement);\n\n while (rs.next()) {\n //Create a new Pets object\n Pets pet = new Pets();\n pet.setName(rs.getString(\"name\"));\n\n System.out.println(pet.getName());\n\n }\n } catch (SQLException exception) {\n System.out.println(\"Error getting Pet name list: \" + exception);\n }\n return petList;\n }", "@Override\r\n\tpublic void translateToJSON(ParsedJSONContainer jsonContainer) {\t\tjsonContainer.put(\"id\",getId());\r\n\t\tjsonContainer.put(\"labels\",getLabels());\r\n\t\tjsonContainer.put(\"version\",getVersion());\r\n\t}", "@Override\n\tpublic LovServiceResponse getLovDetails() {\n\t\tLovServiceResponse l_res = new LovServiceResponse();\n\t\tList<LovDetail> l_lovList=null;\n\t\tList<LovVO> l_lovVoList=new ArrayList<LovVO>();\n\t\tLovVO l_lovVo = null;\n\t\ttry {\n\t\t\tl_lovList = lovDao.getLovDetails();\n\t\t\tfor(LovDetail l_etity : l_lovList ){\n\t\t\t\tl_lovVo = new LovVO(l_etity);\n\t\t\t\tBeanUtils.copyProperties(l_etity, l_lovVo);\n\t\t\t\tl_lovVoList.add(l_lovVo);\t\t\t\t\n\t\t\t}\n\t\t\tl_res.setLovList(l_lovVoList);\n\t\t\tl_res.setStatus(true);\n\t\t\t\n\t\t}catch(DataAccessException e){\t\t\t\n\t\t\tthrow new ServiceException(\"DataAccessException while fetch lov data\",e);\n\t\t}\n\t\tcatch (Exception e) {\t\t\t\n\t\t\tthrow new ServiceException(\"Unhandled Exception while fetch lov data\",e);\n\t\t}\n\t\treturn l_res;\t\t\n\t}", "private Weather mapWeather(JSONObject objectWeater) {\n Gson datos = new Gson();\n return datos.fromJson(objectWeater.toString(),Weather.class);\n }", "public List<Planet> getPlanets() {\n return planetList;\n }", "@Override\r\n public ViviendaEntity toEntity() {\r\n ViviendaEntity viviendaEntity = super.toEntity();\r\n if (contratos != null) {\r\n List<ContratoEntity> contratosEntity = new ArrayList<>();\r\n for (ContratoDTO dtoContrato : contratos) {\r\n contratosEntity.add(dtoContrato.toEntity());\r\n }\r\n viviendaEntity.setContratos(contratosEntity);\r\n }\r\n\r\n if (cuartos != null) {\r\n List<CuartoEntity> cuartoEntities = new ArrayList<>();\r\n for (CuartoDTO dto : cuartos) {\r\n cuartoEntities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setCuartos(cuartoEntities);\r\n }\r\n\r\n if (sitiosDeInteres != null) {\r\n List<SitioInteresEntity> entities = new ArrayList<>();\r\n for (SitioInteresDTO dto : sitiosDeInteres) {\r\n entities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setSitiosDeInteres(entities);\r\n }\r\n\r\n if (calificaciones != null) {\r\n List<CalificacionEntity> entities = new ArrayList<>();\r\n for (CalificacionDTO dto : calificaciones) {\r\n entities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setCalificaciones(entities);\r\n }\r\n\r\n if (serviciosOfrecidos != null) {\r\n viviendaEntity.setServiciosIncluidos(serviciosOfrecidos);\r\n }\r\n\r\n if (serviciosAdicionales != null) {\r\n List<ServicioAdicionalEntity> entities = new ArrayList<>();\r\n for (ServicioAdicionalDTO dto : serviciosAdicionales) {\r\n entities.add(dto.toEntity());\r\n }\r\n viviendaEntity.setServiciosAdicionales(entities);\r\n }\r\n\r\n return viviendaEntity;\r\n }", "public ViviendaEntity toEntity() {\r\n ViviendaEntity entity = new ViviendaEntity();\r\n entity.setIdVivienda(this.getIdVivienda());\r\n entity.setCiudad(this.getCiudad());\r\n entity.setDescripcion(this.getDescripcion());\r\n entity.setDireccion(this.getDireccion());\r\n entity.setCapacidad(this.getCapacidad());\r\n \r\n entity.setValorDiario(this.getValorDiario());\r\n entity.setImagen(this.getImagen());\r\n entity.setNumeroHabitaciones (this.getNumeroHabitaciones());\r\n return entity;\r\n }", "private VectorArit CasteoVectores(VectorArit v, TipoPrimitivo t) {\r\n switch (t) {\r\n case STRING:\r\n return VectorToString(v);\r\n case NUMERIC:\r\n return VectorToDouble(v);\r\n case INTEGER:\r\n return VectorToInt(v);\r\n default:\r\n return v;\r\n }\r\n }", "public TestStockPricesVOImpl getTestStockPricesVO() {\n return (TestStockPricesVOImpl)findViewObject(\"TestStockPricesVO\");\n }", "@JsonIgnore\n List<T> getValues();", "public Vector toVector(){\r\n\t\tVector v = new Vector();\r\n\r\n\t\t// ATTENTION l'ordre est très important !!\r\n\t\t// l'ordre doit être :\r\n\t\t// id, id localisation, adresse, code postal, ville, telephone\r\n\r\n\t\tv.add(id);\r\n\t\tv.add(localisation.getId());\r\n\t\tv.add(localisation.getAdresse());\r\n\t\tv.add(localisation.getCodePostal());\r\n\t\tv.add(localisation.getVille());\r\n\t\tv.add(telephone);\r\n\r\n\t\treturn v;\r\n\t}", "public static ArrayList<Recipe> convertJsonToRecipeObjects() throws JSONException {\n //Convert fullJsonMoviesData to JsonObject\n String urlResponse = null;\n URL jsonURL = buildUrl();\n try {\n urlResponse = getResponseFromHttpUrl(jsonURL);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n JSONArray bakingDataArray = new JSONArray(urlResponse);\n ArrayList<Recipe> results = new ArrayList<>();\n for (int i = 0; i < bakingDataArray.length(); i++) {\n Recipe recipe = new Recipe();\n recipe.setId(bakingDataArray.getJSONObject(i).getInt(ID));\n recipe.setName(bakingDataArray.getJSONObject(i).getString(NAME));\n recipe.setImage(getDefaultorActualImage(bakingDataArray.getJSONObject(i).getString(IMAGE)));\n recipe.setServings(bakingDataArray.getJSONObject(i).getString(SERVINGS));\n JSONArray ingredientsJSONArray = bakingDataArray.getJSONObject(i).getJSONArray(INGREDIENTS);\n ArrayList<Ingredient> ingredientsArray = new ArrayList<>();\n for (int j = 0; j < ingredientsJSONArray.length(); j++) {\n Ingredient ingredient = new Ingredient();\n ingredient.setIngredient(ingredientsJSONArray.getJSONObject(j).getString(INGREDIENT));\n ingredient.setMeasure(ingredientsJSONArray.getJSONObject(j).getString(MEASURE));\n ingredient.setQuantity(ingredientsJSONArray.getJSONObject(j).getString(QUANTITY));\n ingredientsArray.add(ingredient);\n }\n recipe.setIngredients(ingredientsArray);\n JSONArray stepJSONArray = bakingDataArray.getJSONObject(i).getJSONArray(STEPS);\n ArrayList<Step> stepArray = new ArrayList<>();\n for (int k = 0; k < stepJSONArray.length(); k++) {\n Step step = new Step();\n step.setId(stepJSONArray.getJSONObject(k).getString(STEP_ID));\n step.setDescription(stepJSONArray.getJSONObject(k).getString(DESCRIPTION));\n step.setShortDescription(stepJSONArray.getJSONObject(k).getString(SHORT_DESCRIPTION));\n step.setThumbnailURL(stepJSONArray.getJSONObject(k).getString(thumbnailURL));\n step.setVideoURL(stepJSONArray.getJSONObject(k).getString(videoURL));\n stepArray.add(step);\n }\n recipe.setSteps(stepArray);\n results.add(recipe);\n }\n return results;\n }", "public ListVS<V> getValues() {\n ListVS<V> result = new ListVS<V>(getUniverse());\n for (V value : this.entries.values()) {\n result = result.add(value);\n }\n return result;\n }", "private void getPlanSkus() {\n\n List<PlanSkuVo> planList = new ArrayList<>();\n final Session session = sessionManager.getSession();\n\n\n PreparedStatement statement = session.prepare(\"SELECT * FROM PLANSKU\");\n BoundStatement boundStatement = statement.bind();\n ResultSet result = session.execute(boundStatement);\n\n if (result == null){\n log.info(\"No Planskus found\");\n// throw new NoDataAvailableException(\"There are no Plans available right now\");\n }\n else {\n log.info(\"Populating results for getPlanSkus\");\n result.forEach(row -> {\n PlanSkuVo planSkuVo = new PlanSkuVo(row.getString(\"product_id\"),\n row.getString(\"sku_id\"),\n row.getString(\"prod_desc\"),\n row.getString(\"prod_frenchname\"),\n row.getString(\"prod_name\"),\n row.getMap(\"sku_features\", String.class, String.class),\n row.getInt(\"sku_order\"));\n planList.add(planSkuVo);\n });\n\n ObjectMapper mapper = new ObjectMapper();\n String jsonInString =\"\";\n try {\n jsonInString = mapper.writeValueAsString(planList);\n } catch (JsonProcessingException e) {\n log.info(\"error in forming json \");\n }\n\n getSender().tell(jsonInString, ActorRef.noSender());\n }\n\n }", "public Vector<EntityWeapon> getWeaponList();", "public List<Venta> getVentas() {\n List<Venta> vts = new ArrayList<>();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"src/Archivo/ventas/ventas.txt\"));\n String record;\n\n while ((record = br.readLine()) != null) {\n\n StringTokenizer st = new StringTokenizer(record, \",\");\n \n String id = st.nextToken();\n String idCliente = st.nextToken();\n String sacosVendidos = st.nextToken();\n String valueVenta = st.nextToken();\n String fecha = st.nextToken();\n\n\n Venta venta = new Venta(\n Integer.parseInt(id),\n Integer.parseInt(idCliente),\n Integer.parseInt(sacosVendidos),\n Float.parseFloat(valueVenta),\n fecha\n );\n\n vts.add(venta);\n }\n\n br.close();\n } catch (Exception e) {\n System.err.println(e);\n }\n\n return vts;\n }", "public List<Visit> getVisitsByPetId(int petId) {\n JdbcTemplate select = new JdbcTemplate(dataSource);\n return select.query(\"SELECT * FROM visit WHERE petId=?\",new Object[] {petId}, new VisitRowMapper()); \n }", "public VenueDTO getVenue(int itemID) {\n\t\tVenueDTO venue = new VenueDTO();\n\t\tString sql = \"select Venues.VenueID as VenueID, Venues.VenueName as VenueName from Venues inner join VenueIn on Venues.VenueID = \"\n\t\t\t\t+ \"VenueIn.VenueID where VenueIn.ItemID = ?\";\n\t\tPreparedStatement preparedStatement;\n\t\ttry {\n\t\t\tConnection connection = dataSource.getConnection();\n\t\t\tpreparedStatement = connection.prepareStatement(sql);\n\t\t\tpreparedStatement.setInt(1, itemID);\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tvenue.setVenueID(resultSet.getInt(\"VenueID\"));\n\t\t\t\tvenue.setVenueName(resultSet.getString(\"VenueName\"));\n\t\t\t}\n\t\t\tconnection.close();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn venue;\n\t}", "public VatDetail[] getRetailExportVatSummaries() {\n POSLineItem[] items = compositePOSTransaction.getLineItemsArray();\n HashMap vatDetails = new HashMap();\n for (int idx = 0; idx < items.length; idx++) {\n //if(!((CMSItem)items[idx].getItem()).isConcessionItem() && !((CMSItem)items[idx].getItem()).getVatCode().equals(\"0\"))\n if (((CMSItem)items[idx].getItem()).getVatRate() != null\n && ((CMSItem)items[idx].getItem()).getVatRate().doubleValue() > 0) {\n int signMult = 1;\n if (items[idx] instanceof ReturnLineItem)\n signMult = -1;\n double rate = items[idx].getItem().getVatRate().doubleValue();\n if (vatDetails.get(((CMSItem)items[idx].getItem()).getVatRate()) == null) {\n VatDetail detail = new VatDetail(items[idx].getExtendedNetAmount().multiply(signMult)\n , items[idx].getExtendedVatAmount().multiply(signMult), rate\n , items[idx].getNetAmount().multiply(rate / (1 + rate)).multiply(signMult).round().\n multiply(items[idx].getQuantity().intValue()), items[idx].getQuantity().intValue());\n // to do: need a new vat service at item level rather than calcing right here, vatAmount = lineItemDetail.getNetAmount().multiply((1.0 - creditCardRatio * CREDIT_CARD_CHARGE_RATE) * rate / (1.0 + rate));\n vatDetails.put(items[idx].getItem().getVatRate(), detail);\n } else {\n VatDetail detail = (VatDetail)vatDetails.get(((CMSItem)items[idx].getItem()).getVatRate());\n detail.addCompositeAmount(items[idx].getExtendedNetAmount().multiply(signMult));\n detail.addVatAmount(items[idx].getExtendedVatAmount().multiply(signMult));\n detail.addOriginalVatAmount(items[idx].getNetAmount().multiply(rate / (1 + rate)).\n multiply(signMult).round().multiply(items[idx].getQuantity().intValue()));\n detail.addItemQty(items[idx].getQuantity().intValue());\n }\n }\n }\n return (VatDetail[])vatDetails.values().toArray(new VatDetail[0]);\n }", "@Override\n\tpublic Collection<V> values() {\n\t\t// TODO\n\t\treturn new ValueView();\n\t}", "protected List<V> getVO(List<T> list) {\n List<V> listVO = new ArrayList();\n\n for (T t : list) {\n V vo = getVO(t);\n\n if (vo != null) {\n listVO.add(vo);\n }\n }\n\n return listVO;\n }", "public String toString() {\r\n return \"Rettangolo[vbs=\" + vbs.toString() +\r\n \",vad=\" + vad.toString() + \"]\";\r\n }", "public static JSONObject processVClassGroupJSON(VitroRequest vreq, ServletContext context, VClassGroup vcg) {\n JSONObject map = new JSONObject(); \n try {\n ArrayList<JSONObject> classes = new ArrayList<JSONObject>(vcg.size());\n for( VClass vc : vcg){\n JSONObject vcObj = new JSONObject();\n vcObj.put(\"name\", vc.getName());\n vcObj.put(\"URI\", vc.getURI());\n vcObj.put(\"entityCount\", vc.getEntityCount());\n classes.add(vcObj);\n }\n map.put(\"classes\", classes); \n map.put(\"classGroupName\", vcg.getPublicName());\n map.put(\"classGroupUri\", vcg.getURI());\n \n } catch(Exception ex) {\n log.error(\"Error occurred in processing VClass group \", ex);\n }\n return map; \n }", "List<SimpleInventory> getInventories();", "public Pet convertToEntity(PetDTO petDTO) {\n\t\tPet pet = new Pet();\n\t\tOptional<Advertisement> advertisement = advertisementRepository.findById(pet.getAdvertisement().getId());\n\t\tif (advertisement.isPresent()) {\n\t\t\tpet.setAdvertisement(advertisement.get());\n\t\t} else {\n\t\t\tpet.setAdvertisement(null);\n\t\t}\n\t\tpet.setGender(petDTO.getGender());\n\t\tpet.setId(petDTO.getId());\n\t\tpet.setSpecies(petDTO.getSpecies());\n\t\tpet.setDescription(petDTO.getDescription());\n\t\tpet.setDateOfBirth(petDTO.getDateOfBirth());\n\t\tpet.setBreed(petDTO.getBreed());\n\t\tpet.setName(petDTO.getName());\n\t\tpet.setPicture(petDTO.getPicture());\n\t\treturn pet;\n\t}", "public List<Planet> getPlanets() {\n return planet;\n }", "@Override\n public String toString() {\n return \"Pet{\" +\n \"mId=\" + mId +\n \", mName='\" + mName + '\\'' +\n \", mDetails='\" + mDetails + '\\'' +\n \", mPhone='\" + mPhone + '\\'' +\n \", mImageUri=\" + mImageUri +\n '}';\n }", "private DatasetJsonConversion() {}", "T fromJson(Object source);", "private JSONArray createJSONWeaponList(List<Weapon> weapons) {\n\t\tJSONArray jArray = new JSONArray();\n\t\tweapons.forEach(s -> jArray.add(s.getName()));\n\t\treturn jArray;\n\t}", "private static Object mapValueToJava(Object value) {\n if (value instanceof Map) {\n value = ((Map<?, ?>) value).toMap();\n } else if (value instanceof Sequence) {\n value = ((Sequence<?>) value).toMappedList();\n } else if (value instanceof net.ssehub.easy.instantiation.core.model.vilTypes.Set<?>) {\n value = ((net.ssehub.easy.instantiation.core.model.vilTypes.Set<?>) value).toMappedSet();\n }\n return value;\n }", "public static Value makeObject(Set<ObjectLabel> v) {\n Value r = new Value();\n if (!v.isEmpty())\n r.object_labels = newSet(v);\n return canonicalize(r);\n }", "public List<Inventory> getInventory();", "List<SpotPrice> getAll();", "public PetModel[] getPetModel() {\n return localPetModel;\n }", "@Override\r\n\tpublic JSONConvertor<?> getJSONConveter() throws OneM2MException {\n\t\treturn ConvertorFactory.getJSONConvertor(TimeSeries.class, TimeSeries.SCHEMA_LOCATION);\r\n\t}", "public List<VerbPhrase> getVpList(){\n\t\tSet<NounPhrase> entitySet = this.getEntConsiderPass(\"O\");\n\t\tList<VerbPhrase> vpList = new ArrayList<VerbPhrase>();\n\t\t\n\t\tfor(NounPhrase object : entitySet){\t\t\n\t\t\t//vpList.add(new VerbPhrase(this.getActionStr(), object));\n\t\t\tvpList.add(new VerbPhrase(this.action, object));\n\t\t}\t\t\n\t\treturn vpList;\n\t}", "Collection<V> values();", "Collection<V> values();", "public HashMap<VertexLocation, VertexObject> parseCitiesAndStlmtsFromJSON(JSONArray stlmtsJSON, JSONArray citiesJSON){\n\n HashMap<VertexLocation, VertexObject> newCitiesStlmtsMap = new HashMap<>();\n\n //SETTLEMENTS\n //go parse all the data in the newStlmts array:\n for (int s = 0; s < stlmtsJSON.length(); s++){\n\n JSONObject currStlmtJSON = stlmtsJSON.getJSONObject(s);\n //get the HexLocation object out of the currStlmtJSON:\n JSONObject currStlmtLocJSON = currStlmtJSON.getJSONObject(\"location\");\n int sHLx = currStlmtLocJSON.getInt(\"x\");\n int sHLy = currStlmtLocJSON.getInt(\"y\");\n HexLocation newStlmtHexLoc = new HexLocation(sHLx, sHLy);\n //get the VertexDirection out of the currStlmtLocJSON:\n //VertexDirection newStlmtVtxDir = exchangeStringForVertexDirection(currStlmtLocJSON.getString(\"direction\"));\n VertexDirection newStlmtVtxDir = Converter.stringToVertexDirection(currStlmtLocJSON.getString(\"direction\"));\n //build a VertexLocation obj out of HexLoc and VertexDir:\n VertexLocation newStlmtVtxLoc = new VertexLocation(newStlmtHexLoc, newStlmtVtxDir);\n //get the stlmt owner:\n int newStlmtOwnerIndex = currStlmtJSON.getInt(\"owner\");\n //now build a complete VertexObject to represent the new settlement:\n VertexObject newSettlement = new VertexObject(newStlmtVtxLoc.getNormalizedLocation());\n newSettlement.setOwner(newStlmtOwnerIndex);\n newSettlement.setPieceType(PieceType.SETTLEMENT); //these are all of Settlement pieceType!\n\n newCitiesStlmtsMap.put(newSettlement.getVertexLocation().getNormalizedLocation(), newSettlement);\n }\n\n //CITIES\n for (int c = 0; c < citiesJSON.length(); c++){\n\n JSONObject currCityJSON = citiesJSON.getJSONObject(c);\n //get the HexLocation object out of the currCityJSON:\n JSONObject currCityLocJSON = currCityJSON.getJSONObject(\"location\");\n int cHLx = currCityLocJSON.getInt(\"x\");\n int cHLy = currCityLocJSON.getInt(\"y\");\n HexLocation newCityHexLoc = new HexLocation(cHLx, cHLy);\n //get the VertexDirection out of the currCityLocJSON:\n VertexDirection newCityVtxDir = Converter.stringToVertexDirection(currCityLocJSON.getString(\"direction\"));\n //build a VertexLocation obj out of HexLoc and VertexDir:\n VertexLocation newCityVtxLoc = new VertexLocation(newCityHexLoc, newCityVtxDir);\n //get the city owner:\n int newCityOwnerIndex = currCityJSON.getInt(\"owner\");\n //now build a complete VertexObject to represent the new city:\n VertexObject newCity = new VertexObject(newCityVtxLoc.getNormalizedLocation());\n newCity.setOwner(newCityOwnerIndex);\n newCity.setPieceType(PieceType.CITY); //these are all of City pieceType!\n\n newCitiesStlmtsMap.put(newCity.getVertexLocation().getNormalizedLocation(), newCity);\n }\n\n return newCitiesStlmtsMap;\n }", "public abstract V getEntity();", "public static ArrayList<Ventas> parsingVentasClientes(String json) throws ParseException{\n\t\tJSONParser jsonParser = new JSONParser();\n\t\tArrayList<Ventas> lista = new ArrayList<Ventas>();\n\t\tJSONArray ventas = (JSONArray) jsonParser.parse(json);\n\t\tIterator i = ventas.iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tJSONObject innerObj = (JSONObject) i.next();\n\t\t\tVentas venta = new Ventas();\n\t\t\t\n\t\t\t//Enviamos los datos que necesitamos\n\t\t\tventa.setCodigo_venta(Integer.parseInt(innerObj.get(\"codigo_venta\").toString()));\n\t\t\tventa.setIva_venta(Double.parseDouble(innerObj.get(\"iva_venta\").toString()));\n\t\t\tventa.setValor_venta(Double.parseDouble(innerObj.get(\"valor_venta\").toString()));\n\t\t\tventa.setValor_total(Double.parseDouble(innerObj.get(\"valor_total\").toString()));\n\n\t\t\tlista.add(venta);\n\t\t}\n\t\treturn lista;\n\t}", "private JsonElement serializeEntityType(Pair<EntityPrimitiveTypes, Stats> content) {\n JsonObject entityObject = new JsonObject();\n JsonObject statObject = new JsonObject();\n for (Map.Entry<Statistic, Double> entry :\n content.getSecond().getStatistics().entrySet()) {\n statObject.add(entry.getKey().name(), new JsonPrimitive(entry.getValue()));\n }\n entityObject.add(STATS, statObject);\n entityObject.add(JSONEntitySerializer.PRIMITIVE_TYPE, new JsonPrimitive(content.getFirst().name()));\n return entityObject;\n }", "public abstract String toJson();", "private void createVTables() {\n this.vTable = new HashMap<String, Map>();\n\n Map classes = this.declaredTypes.getClasses();\n Iterator cls_it = classes.entrySet().iterator();\n while(cls_it.hasNext()) {\n Map.Entry clsMapEntry = (Map.Entry)cls_it.next();\n\n String clsName = (String)clsMapEntry.getKey();\n ClassNode clsNode = (ClassNode)clsMapEntry.getValue();\n\n Map methods = collectVtableMethods(clsName, clsNode, classes);\n\n List<ClassNode> clsRel = createClsRelList(clsNode, classes);\n HashMap<String, Integer> clsVTable = constructTableEntry(clsName,\n methods,\n clsRel,\n clsNode);\n this.vTable.put(clsName, clsVTable);\n }\n }", "public List<Vegetable> getVegetables() {\n ArrayList<Vegetable> vegetables = new ArrayList<>();\n for (VegetablePortion vegetablePortion : list) {\n vegetables.add(vegetablePortion.getVegetable());\n }\n return vegetables;\n }", "public abstract List<V> makeRowData();", "Map<String, Object> getIngredient(long foodID);" ]
[ "0.6013566", "0.5838809", "0.56907684", "0.5644434", "0.5498723", "0.54599965", "0.52851695", "0.5281442", "0.52071726", "0.520484", "0.5168463", "0.5128191", "0.5126084", "0.5103975", "0.50827897", "0.5053932", "0.5044547", "0.5001348", "0.49978402", "0.49793583", "0.49679616", "0.49672425", "0.4955449", "0.49023855", "0.4899759", "0.48992392", "0.4887887", "0.48873594", "0.48684368", "0.48611647", "0.4842798", "0.48307756", "0.4823775", "0.48215684", "0.48190337", "0.48010498", "0.47928178", "0.47737262", "0.4770271", "0.47561407", "0.4748645", "0.47397637", "0.4719524", "0.47115073", "0.47045153", "0.47000945", "0.46910086", "0.46808568", "0.4677717", "0.4674438", "0.4656947", "0.46568683", "0.4653402", "0.4648467", "0.4638212", "0.4634864", "0.4632991", "0.4618518", "0.46181646", "0.46140435", "0.4608726", "0.46054348", "0.4601912", "0.4601536", "0.4601384", "0.45995176", "0.45976186", "0.4586581", "0.45855054", "0.45838332", "0.45822668", "0.45724642", "0.4559062", "0.45581463", "0.45570102", "0.45564112", "0.4553851", "0.4552212", "0.4550324", "0.45430952", "0.4541845", "0.45370525", "0.45334202", "0.45322472", "0.4521944", "0.4521762", "0.45210266", "0.45205513", "0.45190823", "0.45164603", "0.45164603", "0.45080802", "0.4507488", "0.45059973", "0.44980654", "0.44938862", "0.44932005", "0.44903705", "0.44882777", "0.4486503" ]
0.58106714
2
we declare and initialize an array
public static void main(String[] args) { int [] array = {10,20,30,40}; // index starts with 0 1 2 3 .... System.out.println(array[2]); // find the size of the array System.out.println(array.length); // 4 ( because 4 values in the [] ) // create string of names - 5; // we can access them based on indexes... String [] names = { "John", "Mike", "Jane", "Alexaneru", "Olga"}; System.out.println("there are " + names.length + " values in my array of my names"); System.out.println(names[2]); //int[] numbers; // numbers = {2,3,4,5}; ---> wrong // when we are using curly braces, we need to be in the same line; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Array() {\n\t\tarray = new int[0];\n\t}", "Array createArray();", "public static void arrayDeclarationInitialization() {\n\n double[] arrayOfDoubles = new double[] { 12.56, 45.87, 14.85 };\n\n // This is also ok.\n\n int[] arrayOfInts = { 12, 21, 0, 5, 7 };\n\n int[] i = new int[10 + 5]; // Array size can be an expression resulting an integer\n\n int[] i1 = new int[(byte) 10]; // byte is auto-widened to int\n\n // int i3 = new int[10.25]; //Compile Time Error : size can not be double\n }", "public static int[][] init() {\n int[][] arr={\n {0,1,0,1,0,0,0},\n {0,0,1,0,0,1,0},\n {1,0,0,1,0,1,0},\n {0,0,1,0,0,1,0},\n {0,0,1,1,0,1,0},\n {1,0,0,0,0,0,0}\n };\n return arr;\n }", "Array(int[] n) {\n\t\tarray = n;\n\t}", "private static int[] arrayInitializer(int length) {\n int[] myArray = new int[length];\n Random rand = new Random();\n for (int i = 0; i < length; i++) {\n myArray[i] = rand.nextInt(1000);\n }\n return myArray;\n }", "private final int[] initializeInstanceVariable() {\n\t\tint n = 10;\n\t\tint[] temp = new int[n];\n\t\tfor (int i = 0; i < n; i++) {temp[i] = i;}\n\t\treturn temp;\n\t}", "private void declareArray() {\n\t\twriter.println();\n\t\twriter.println(\"; array of 52 for variables:\");\n\t\twriter.print(variables + \" dw\");\n\t\tfor (int i = 0; i < 51; i++) {\n\t\t\twriter.print(\" 0,\");\n\t\t}\n\t\twriter.println(\" 0\");\n\t}", "public static void arrayCreation() {\n int[] arr = new int[3];\n // as we are using new operator and that is how we create objects hence arrays\n // are called objects\n // every array in java is an object\n System.out.println(arr.getClass()\n .getSimpleName()); // int[]\n System.out.println(arr.getClass()\n .getName()); // [I\n\n int[] a1 = new int[3];\n int[][] a2 = new int[3][3];\n double[] a3 = new double[3];\n short[] a4 = new short[3];\n byte[] a5 = new byte[3];\n boolean[] a6 = new boolean[3];\n long[] a7 = new long[3];\n float[] a8 = new float[3];\n Integer[] a9 = new Integer[3];\n\n System.out.println(a1.getClass()\n .getName()); // [I\n System.out.println(a2.getClass()\n .getName()); // [[I\n System.out.println(a3.getClass()\n .getName()); // [D\n System.out.println(a4.getClass()\n .getName()); // [S\n System.out.println(a5.getClass()\n .getName()); // [B\n System.out.println(a6.getClass()\n .getName()); // [Z\n System.out.println(a7.getClass()\n .getName()); // [J\n System.out.println(a8.getClass()\n .getName()); // [F\n System.out.println(a9.getClass()\n .getName()); // [Ljava.lang.Integer;\n\n // at the time of the array initialization we should compulsory specify the size\n // new int[3] we should specify the size else it will lead to compilation error\n\n // It is legal to have size zero in java\n int[] a = new int[0];\n System.out.println(a);\n\n }", "public void makeArray() {\r\n for (int i = 0; i < A.length; i++) {\r\n A[i] = i;\r\n }\r\n }", "public void initializeArray(){\n if(topOfStack==-1){\n for(int i=0;i<this.arr.length;i++){\n this.arr[i]=Integer.MIN_VALUE;\n }\n }\n }", "public ZYArraySet(){\n elements = (ElementType[])new Object[DEFAULT_INIT_LENGTH];\n }", "public void init(int[] a){\n this.array = a;\n moves = 0; \n }", "public SuperArray() { \n \t_data = new Comparable[10];\n \t_lastPos = -1; //flag to indicate no lastpos yet\n \t_size = 0;\t\n }", "public Array()\n {\n assert DEFAULT_CAPACITY > 0;\n\n array = new Object[DEFAULT_CAPACITY];\n }", "public Stmt\ninitiateArray(\n Exp pArray, Exp pInitExp,\n Exp pFrom, Exp pTo, Subp pSubp );", "Array(int x) {\n\t\tarray = new int[x];\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tarray[i] = 0; // make each index 0\n\t\t}\n\t}", "ArrayADT() {\n this.size = 10;\n this.base = createArrayInstance(this.size);\n this.length = 0;\n }", "public MyArray() {\n this.length = 10;\n this.array = (T[]) Array.newInstance(MyArray.class, length);\n this.size = 0;\n }", "public ZYArraySet(int initLength){\n if(initLength<0)\n throw new IllegalArgumentException(\"The length cannot be nagative\");\n elements = (ElementType[])new Object[initLength];\n }", "public static void arrayDemo() {\n\t}", "public purchaseDesign()\n {\n priceArray = new int[5][4];\n }", "FunWithArrays(int size){\r\n\t\tnumbers = new int[size];\r\n\t}", "public DynamicArray() {\n this(16);\n }", "public IntArrays()\n\t{\n\t\tthis(10);\n\t}", "public ExpandableArray() {\n\n\t}", "private void initializeArrays(){\n arrayOfBadges = new String[6];\n stateArray = new int[6];\n for (int i = 0; i<6; i++){\n stateArray[i]=0;\n }\n arrayOfBadges[0] = \"Community\";\n arrayOfBadges[1] = \"Academic\";\n arrayOfBadges[2] = \"Dean\";\n arrayOfBadges[3] = \"Honor\";\n arrayOfBadges[4] = \"Abroad\";\n arrayOfBadges[5] = \"Graduation\";\n\n\n }", "public void inicialisation(){\r\n\t\t\r\n\t\tgoods = new AutoParts[0];\r\n\t\tclient = new Client[0];\r\n\t\t\r\n\t\tshop = new Shopping[0];\r\n\t\tsale = new Sale[0];\r\n\t\ttransaction = new Document[0];\r\n\t\t\r\n\t\tbalancesAutoParts = new BalancesAutoParts[0];\r\n\t\t\r\n\t\tprices = new Prices[0];\r\n\t\t\r\n\t\tagriment = new Agreement[0];\r\n\t\t\r\n\t}", "@Override\n public void init(float[] data) {\n this.data = data;\n\n //\n shapeArr = new Rectangle2D.Float[data.length];\n colorArr = new Color[data.length];\n pointArr = new Point2D.Float[data.length];\n }", "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}", "public ArrayAccessor() {\r\n super(\"<array>\");\r\n }", "public ulsinArray(int length) {\n intArr = new int[length];\n }", "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}", "public WeetArray() {\n count = 0;\n nullCount = 0;\n }", "public void inicializarArrays(){\n for(int i=0;i<=10;i++){\n dni[i] = 0;\n nombre[i] = \"\";\n apellido[i] = \"\";\n direccion[i] = \"\";\n telefono[i] = \"\";\n fNacimiento[i] = \"\";\n }\n }", "private RubyArray(Ruby runtime, long length) {\n super(runtime, runtime.getArray());\n checkLength(length);\n values = new IRubyObject[(int)length];\n }", "public static NewArrayExpression newArrayInit(Class type, Iterable<Expression> expressions) { throw Extensions.todo(); }", "private void newArrayInitialize(NewArrayIRTuple instr) throws IOException{\n\n String type = (String)instr.getArg0();\n ArgumentVariable arg1 = new ArgumentVariable(instr.getArg1());\n ArgumentVariable result = new ArgumentVariable(instr.getResult());\n\n //Store $ra on stack\n writer.write(\"addi $sp, $sp, -20\\n\");\n writer.write(\"sw $ra, 16($sp)\\n\");\n\n //Store $a0\n writer.write(\"sw $a0, 12($sp)\\n\");\n\n //Store $t0-$t1 on the stack\n for(int i = 0; i < 2; i++)\n {\n writer.write(\"sw $t\" + i + \", \" + (8 - (4*i)) + \"($sp)\\n\");\n }\n\n //Store $v0 on the stack\n writer.write(\"sw $v0, 0($sp)\\n\");\n\n if(arg1.type.equals(\"constant\"))\n writer.write(\"li $a0, \" + arg1.getValue(curAddTable) + \"\\n\");\n else\n writer.write(\"move $a0, \" + arg1.getValue(curAddTable) + \"\\n\");\n if(type.equals(\"int\"))\n writer.write(\"sll $a0, $a0, 2\\n\");\n\n //Call the function of \"_new_array\"\n writer.write(\"jal _new_array\\n\");\n writer.write(\"lw $t0, 8($sp)\\n\");\n writer.write(\"lw $t1, 4($sp)\\n\");\n\n writer.write(\"lw $a0, 12($sp)\\n\");\n writer.write(\"move \" + result.getValue(curAddTable) + \", $v0\\n\");\n\n writer.write(\"lw $v0, 0($sp)\\n\");\n writer.write(\"lw $ra, 16($sp)\\n\");\n writer.write(\"addi $sp, $sp, 20\\n\");\n\n }", "public static NewArrayExpression newArrayInit(Class type, Expression[] expressions) { throw Extensions.todo(); }", "public static void main(String[] args) {\n\r\n\r\n\r\n\r\n int[] myIntArray = new int[10];\r\n myIntArray [5]= 50;\r\n System.out.println(myIntArray [5]);\r\n//\r\n// double [] myDoubleArray = new double [5];\r\n// myDoubleArray [3]= 80;\r\n// System.out.println(\"My double is \" +myDoubleArray [3]);\r\n//\r\n// //String [3] myStringArray = new String [10];\r\n\r\n\r\n //first way to initialize\r\n// int [] myNewArray = new int [10];\r\n// myNewArray [0]= 20;\r\n// myNewArray [1]= 30;\r\n// myNewArray [2]= 40;\r\n// myNewArray [3]= 50;\r\n// myNewArray [4]= 60;\r\n// myNewArray [5]= 70;\r\n// myNewArray [6]= 80;\r\n// myNewArray [7]= 90;\r\n// myNewArray [8]= 100;\r\n//\r\n// System.out.println(\"My new array value \" + myNewArray [4]);\r\n\r\n\r\n //second way to initialize\r\n// double[] newDoubleArray = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};\r\n// System.out.println(\"My array double is \" + newDoubleArray[4]);\r\n//\r\n//\r\n //third way to initialize with a loop\r\n// int[] myNewInt = new int[99];\r\n\r\n //for(int i=0; i<10; i++) hardcoding with initializing condition with a 10 (i<10) \r\n\r\n //different way to initialize where array length is 'myNewInt.length' rather than (i<10)\r\n// for (int i = 0; i < myNewInt.length; i++) {\r\n// myNewInt[i] = i * 10;\r\n// }\r\n\r\n// for (int i = 0; i < myNewInt.length; i++) {\r\n// System.out.println(\"Element \" + i + \" value is \" + myNewInt[i]);\r\n// }\r\n// methodArray(myNewInt);\r\n// }\r\n\r\n// public static void methodArray (int [] array){\r\n// for(int i=0; i<array.length; i++ )\r\n// System.out.println(\"Element \"+ i + \" value is \" + array [i]);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n }", "public ArrayOfFraction()\r\n\t{\r\n\t\ta=new Fraction [2];\r\n\t\tn=0;\r\n\t}", "public DynamicArray(){\n\t \n\t array = (E[]) new Object[dim];\n }", "private RubyArray(Ruby runtime, IRubyObject[] vals, int begin) {\n super(runtime, runtime.getArray());\n this.values = vals;\n this.begin = begin;\n this.realLength = vals.length - begin;\n this.isShared = true;\n }", "public static void initializeArr(String[] arr){\n\t for(int i = 0; i < arr.length; i++){\n\t arr[i] = \"\";\n\t }\n\t}", "public IntArrays(int initialCapacity)\n\t{\n\t\tarraySize = 0;\n\t\tif (initialCapacity > 0)\n\t\t{\n\t\t\tarray = new int[initialCapacity];\n\t\t} else\n\t\t{\n\t\t\tSystem.err.println(\"Error: Initial capacity invalid, setting capacity to default of 10...\");\n\t\t\tarray = new int[DEFAULT_ARRAY_SIZE];\n\t\t}\t\t\n\t}", "private ArrayOps() {\r\n }", "private void createArray() {\n\t\tdata = new Integer[userInput];\n\t\tRandom rand = new Random();\n\n\t\t// load the array with random numbers\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\tdata[i] = rand.nextInt(maximumNumberInput);\n\t\t}\n\n\t\t// copy the array to the sorting method\n\t\tinsertionData = data.clone();\n\t\tquickData = data.clone();\n\n\t}", "public MyArray() {\n\t\tcapacity = DEFAULT_CAPACITY;\n\t\tnumElements = 0;\n\t\telements = (E[]) new Object[capacity];\n\t}", "public Array(int capacity)\n {\n array = new Object[capacity];\n }", "private void initialize(int[] arr) {\n a = ArraysUtils.sortAndRemoveDuplicates(arr);\n if (a.length != arr.length) {\n throw new IllegalArgumentException(\"Need unique list of numbers\");\n }\n numLeft = new BigInteger(total.toString());\n }", "public ArrayADT() \r\n\t{\r\n\t\tbookArray = new String[MAXSIZE];\r\n\t\tnumItems = 0;\r\n\t}", "OrderedIntList ()\r\n\t{\r\n\t\tarray = new int[10];\r\n\t}", "public BaseArray(int max) // constructor\n {\n a = new long[max]; // create the array\n nElems = 0; // no items yet\n }", "public ArrayAccess()\r\n {\r\n }", "ArrayValue createArrayValue();", "private RubyArray(Ruby runtime, RubyClass klass, int length) {\n super(runtime, klass);\n values = new IRubyObject[length];\n }", "public SimpleArray(int size)\n\t{\n\t\tarray = new int[size];\n\t}", "public Integer[] createArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = (int)(value.length*Math.random());\n }\n\n return value;\n }", "public void setArr(int[] arr){ this.arr = arr; }", "public SpecimenArray()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public CircularQueueUsingArray() {\n\t\tarray = new int[size];\n\t}", "private static int[] initArray(int N){\n int[] a = new int[N];\n for (int i=0;i<N;i++)\n a[i] = (int)(Math.random()*99999 + 100000);\n return a;\n }", "@Override\n public void visit(ArrayDeclaration node) {\n }", "@SuppressWarnings(\"unchecked\")\n\t\tvoid init() {\n\t\t\tsetNodes(offHeapService.newArray(JudyIntermediateNode[].class, NODE_SIZE, true));\n\t\t}", "public GenericDynamicArray() {this(11);}", "private RubyArray(Ruby runtime, boolean objectSpace) {\n super(runtime, runtime.getArray(), objectSpace);\n }", "private void setArray(byte[] initialArray)\r\n/* 60: */ {\r\n/* 61: 95 */ this.array = initialArray;\r\n/* 62: 96 */ this.tmpNioBuf = null;\r\n/* 63: */ }", "public ArrBag()\n {\n count = 0; // i.e. logical size, actual number of elems in the array\n }", "public ArrayIns(int max) // constructor\r\n {\r\n a = new long[max]; // create the array\r\n nElems = 0; // no items yet\r\n }", "public void setArray(int i, Array x);", "private static int[] createArray() {\n\t\trnd = new Random();\r\n\t\trandomArray = new int[8];\r\n\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\trandomArray[i] = rnd.nextInt(45);\r\n\t\t}\r\n\t\treturn randomArray;\r\n\t}", "public void makeArray(int num)\n {\n \tmakeArray(num,0);\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}", "private RubyArray(Ruby runtime, IRubyObject[] vals, boolean objectSpace) {\n super(runtime, runtime.getArray(), objectSpace);\n values = vals;\n realLength = vals.length;\n }", "private RubyArray(Ruby runtime, IRubyObject[] vals) {\n super(runtime, runtime.getArray());\n values = vals;\n realLength = vals.length;\n }", "private void init() {\r\n\tlocals = new float[maxpoints * 3];\r\n\ti = new float[] {1, 0, 0};\r\n\tj = new float[] {0, 1, 0};\r\n\tk = new float[] {0, 0, 1};\r\n\ti_ = new float[] {1, 0, 0};\r\n\tk_ = new float[] {0, 0, 1};\r\n }", "public int[] initializingArray(int size) {\n\t\tint [] array = createArrays(size);\n\t\tfor(int i = 0;i < array.length; i++) {\n\t\t\tarray[i] = rand.nextInt(10);\n\t\t}\n\t\treturn array;\n\t}", "public InputArray() \n\t{\n\t\tinputArray = null;\n\t}", "public void makeArray(int size) {\n\t\t\n\t}", "public void visit(BinArrayInitExpression x){\n }", "public abstract void startArray();", "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 void main(String[] args) {\n\n for(int i=0; i<3;i++){\n // arr[i] = new Array1(i+3,i*2);\n //arr[0] = arr.getArray(3,5);\n\n }\n\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}", "public MyArrayList()\n\t{\n\t\tmyArray = new Object[StartSize];\n\t}", "public static void main(String[] args) {\n ArrayOfUnInitializedObjects arrayOfUnInitializedObjects[] = new ArrayOfUnInitializedObjects[10];\n }", "public static void main(String[] args) {\n int arrayName[] = new int[]{'a','b','c','1','2'};\n String objArray[] = new String[]{\"Shreya\",\"Paul\"};\n System.out.println(arrayName);\n System.out.println(objArray);\n //Arrays are objects and refer to a collection of primitive data types or other objects.(same data type)\n int [] multiarray []; // 2 dimensional or multi dimensional array\n // no elements of an array are created when it’s declared, it’s invalid to define the size of an array with its declaration.\n //int [3] declarearray[2]; this line fails as no elements are created but we have given the size\n // An array type can be any of the following:\n // Primitive data type ,Interface ,Abstract class ,Concrete class\n // Arrays can be of any data type other than null.\n int arr[] []= new int[3][];\n System.out.println(\"this is \"+arr);\n int intArray[]; // it is declaration\n intArray = new int[2]; // allocation\n for(int i=0;i<intArray.length;i++){\n intArray[i] = 4+i; // initializing the loop\n }\n System.out.println(intArray[1]);\n int multidimArray[][];\n multidimArray = new int[2][2];\n for (int i=0;i<multidimArray.length;i++){\n for (int j=0;j<multidimArray.length;j++){\n multidimArray[i][j] = j+i;\n System.out.println(multidimArray[1][0]);\n }\n }\n String all3[] = new String[]{\"apple\",\"call\",\"ball\",\"doll\"}; // creates an array of string and initializes\n all3[2] = null; // sets the value of array index 2 to null\n for (String val:all3) {\n System.out.println(val);\n }\n String ar[] = {\"app\",\"bpp\"};\n int aw[] = {1,2}; // these 3 lines are single line declarations,allocations and initializations\n int multarra[][] = {{1,2},{3,4,5},{}}; // the length is 3\n System.out.println(multarra.length);\n // int intArray2[] = new int[2]{0, 1}; this line fails as When you combine an array declaration, allocation, and initialization in a single step, you can’t specify the size of the array.\n // The size of the array is calculated by the number of values that are assigned to the array.\n int intArray2[] = new int[]{0, 1}; // this is acceptable\n // a multidimensional array can be asymmetrical. An array can define a different number of columns for each of its rows.\n String multiStrArr[][] = new String[][]{\n {\"A\", \"B\"},\n null,\n {\"Jan\", \"Feb\", \"Mar\"}};\n System.out.println(multiStrArr[2][2]);\n multiStrArr[2][2] = null;\n System.out.println(multiStrArr[2][2]);\n System.out.println(multiStrArr[1]);\n }", "public static void main(String[] args) {\n\t\tint arr[]=new int[5];\r\n\t\tfor(int i=0;i<5;i++){\r\n\t\t\tarr[i]=i;\r\n\t\t}\r\n\t\tArrays.fill(arr,1,4,9);\r\n\t\r\nfor(int i=0;i<5;i++){\r\n\tSystem.out.println(arr[i]);\r\n}\r\n}", "public void initialize(int size);", "public RubyArray(Ruby ruby) {\n \t\tthis(ruby, new ArrayList());\n \t}", "@SuppressWarnings(value = \"unchecked\") // sem isto, dá warning!\n public DelayArray(int size, E init) {\n assert size >= 0;\n\n\tbuffer = (E[])(new Object[size]);\n\n\tfor (int i = 0; i < size; i++){\n\t\tbuffer[i] = init;\n\t}\n\n // Invariante:\n assert size()==size: String.format(\"Delay line size should be %d\", size);\n // Pós-condição:\n assert get(-size()).equals(init) && get(-1).equals(init): \"All samples should have the initial value\";\n }", "private void _initialize(long[][] value, int copy) {\n\t\t_rowCount = value.length;\n\t\t_columnCount = value[0].length;\n\t\t_value = LongMatrixMath.fromMatrixToArray(value);\n\t}", "public static void main(String[] args) {\n\tint[] a = new int[3];\r\n\t\r\n\t// At the time of construction we must specify the size\r\n\t//int[] a = new int[]; => Gives compile time error.\r\n\t\r\n\tint[] b = new int[0]; //=> Legal to have zero size array\r\n\t\r\n\tint[] c = new int[-6]; //=> no compile time error but gives run time exception\r\n\t\r\n\t// Array size can be specified using byte,short,int,char types of data.\r\n\t\r\n\tint[] d = new int['a']; //char type\r\n\t\r\n\tbyte e = 10;\r\n\tint[] f = new int[e]; //byte type\r\n\t\r\n\tshort g = 20;\r\n\tint[] h = new int[g]; //short type\r\n\t\r\n //int[] i = new int[58l]; // Compile time error\r\n //int[] j = new int[10.2]; //Compile time error\r\n\t\r\n\t\r\n\t//========> Construction of multi dimensional Arrays <=========//\r\n\t\r\n\t// In Java multi dimensional arrays are implemented by using Array of Arrays concept\r\n\t\r\n\tint[][] i = new int[3][]; \r\n\ti[0] = new int[2];\r\n\ti[1] = new int[3];\r\n\ti[2] = new int[8];\r\n\t\r\n\t\r\n\tint[][][] j = new int[2][][];\r\n\tj[0] = new int[3][];\r\n\tj[0][0] = new int[1];\r\n\tj[0][1] = new int[2];\r\n\tj[0][2] = new int[3];\r\n\tj[1] = new int[2][2];\r\n\t\r\n\t\r\n\t\r\n\t\r\n}", "public ProbIA5Board(int []init) {\n board = new int[init.length];\n\n for (int i = 0; i< init.length; i++) {\n board[i] = init[i];\n }\n }", "protected void setArray(Expression expr)\n {\n setExpression(expr);\n }", "public abstract void init(ArrayList<String> ary);", "private int [] createXArray(){\r\n\t\tint [] xCoord = {\r\n\t\t\t\txStart,\r\n\t\t\t\txStart + 50,\r\n\t\t\t\txStart + 65,\r\n\t\t\t\txStart + 65,\r\n\t\t\t\txStart + 50, \r\n\t\t\t\txStart,\r\n\t\t\t\txStart,\r\n\t\t\t\txStart + 50,\r\n\t\t\t\txStart + 50,\r\n\t\t\t\txStart,\r\n\t\t\t\txStart\r\n\t\t};\r\n\t\treturn xCoord;\r\n\t}", "private int[] createArrays(int size) {//creating method, using variable \"SIZE\"\n\t\tint [] array = new int[size];\n\t\treturn array;\n\t}", "public DArray (int max)\n // constructor\n {\n theArray = new long[max];\n // create array\n nElems = 0;\n }", "void setArrayGeneric(int paramInt)\n/* */ {\n/* 1062 */ this.length = paramInt;\n/* 1063 */ this.datums = new Datum[paramInt];\n/* 1064 */ this.pickled = null;\n/* 1065 */ this.pickledCorrect = false;\n/* */ }", "ArrayTypeRule createArrayTypeRule();" ]
[ "0.72762716", "0.71360165", "0.71168375", "0.6993478", "0.69000804", "0.68937343", "0.68539745", "0.6768475", "0.6748332", "0.67366266", "0.6731465", "0.66953915", "0.66871613", "0.66848737", "0.6653957", "0.66375613", "0.6613288", "0.6597463", "0.65932155", "0.65692466", "0.6544474", "0.6495512", "0.6484853", "0.6464838", "0.64486974", "0.6445883", "0.64421946", "0.64410627", "0.6416881", "0.63952214", "0.63880956", "0.638069", "0.63804084", "0.6374482", "0.63720125", "0.6346281", "0.634496", "0.63294256", "0.6322618", "0.6315155", "0.6301797", "0.62779367", "0.62768495", "0.6272136", "0.6271349", "0.6265883", "0.6257054", "0.625309", "0.6229631", "0.6226313", "0.6224588", "0.62178886", "0.62130934", "0.6210458", "0.6207754", "0.6204174", "0.62000006", "0.6191977", "0.61878306", "0.61866814", "0.6177275", "0.6176156", "0.61745405", "0.6169823", "0.61677974", "0.61508405", "0.6145703", "0.61416805", "0.6139947", "0.6135935", "0.61267173", "0.6114085", "0.6112902", "0.6100667", "0.60928845", "0.6081289", "0.6069313", "0.6066264", "0.60633075", "0.6060938", "0.6058941", "0.6047556", "0.6027725", "0.60240537", "0.6019507", "0.6010733", "0.5999871", "0.5996316", "0.5991484", "0.59837925", "0.598063", "0.5977943", "0.597653", "0.59693706", "0.596866", "0.5955993", "0.5946863", "0.5946575", "0.5945042", "0.59385455", "0.59348965" ]
0.0
-1
Method helps to switch the window
public boolean isEquellContentPage() throws Exception { flag = false; try { logInstruction("LOG INSTRUCTION : CHECKING FOR EQUELLA CONTENT PAGE "); uiDriver.getUIWindowLocator().switchToNewWindow(); uiDriver.getUIFrameLocator().selectFrame("popupcontent"); uiDriver.waitToBeDisplayed(isEquella, waitTime); String data = isEquella.getText().trim(); if (data.contains("Add Content from Equella")) flag = true; uiDriver.close(); uiDriver.getUIWindowLocator().switchToFirstWindow(); } catch (Exception e) { throw new Exception("UNABLE TO GET THE TEXT OF HEADER \n METHOD :isEquellContentPage"); } return flag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void SwitchToWindow(String handle)\n\t{\n\t}", "public void switchToDefaultWindow() {\n\n\t}", "public void switchToWindow(int index) {\n\t\ttry {\r\n\t\t\tSet<String> allWindows = getter().getWindowHandles();\r\n\t\t\tList<String> allhandles = new ArrayList<String>(allWindows);\r\n\t\t\tString windowIndex = allhandles.get(index);\r\n\t\t\tgetter().switchTo().window(windowIndex);\r\n\t\t\tSystem.out.println(\"The Window With index: \"+index+\r\n\t\t\t\t\t\" switched successfully\");\r\n\t\t} catch (NoSuchWindowException e) {\r\n\t\t\tSystem.err.println(\"The Window With index: \"+index+ \" not found\");\t\r\n\t\t}\t\r\n\t}", "public void switchToNewlyOpenedWindow(){\n\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t\tdriver.getWindowHandles();\n\t\t\tfor(String handle : driver.getWindowHandles())\n\t\t\t{\n\t\t\t\tdriver.switchTo().window(handle);\n\t\t\t}\n\t\t\tLOGGER.info(\"Step : Switching to New Window : Pass\");\n\t\t} catch (InterruptedException e) {\n\t\t\tLOGGER.error(\"Step : Switching to New Window : Fail\");\n\t\t\t//e.printStackTrace();\n\t\t\tthrow new NotFoundException(\"Exception while switching to newly opened window\");\n\t\t}\n\t}", "@Test(groups=\"swithorAlert\")\n\tpublic void switchWindow() {\n\t\t\n\t\tWebElement newtabButton = driver.findElement(By.id(\"new-tab-button\"));\n\t\tAssert.assertNotNull(newtabButton, \"New tab button not present\");\n\t\tnewtabButton.click();\n\t\t\n\t\t\n\t\tString orgHandle = driver.getWindowHandle();\n\t\tfor (String handle: driver.getWindowHandles())\n\t\t{\n\t\t\tif(!handle.equals(orgHandle)) {\n\t\t\t\tdriver.switchTo().window(handle);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Switched window Url=\"+driver.getCurrentUrl());\n\t\t\n\t\t// Click on Alert\n\t\t\n\t}", "public static void switchWindow(String windowName, WebDriver driver)\n\t{\n\t\tdriver.switchTo().window(windowName);\n\t}", "public static void goToEditSongWindow()\n {\n EditSongWindow editSongWindow = new EditSongWindow();\n editSongWindow.setVisible(true);\n editSongWindow.setFatherWindow(actualWindow, false);\n }", "public synchronized void goToWindow(String key)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tThread.sleep(1000);\r\n\t\t\taniWin.goToWindow(key);\r\n\t\t}\r\n\t\tcatch (InterruptedException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void showWindow() {\n\t\tupdate();\n\t\tsetVisible(true);\n\t}", "private void winScreen() {\n timer.stop();\n gameModel.setState(\"Win Screen\");\n WinScreen screen = new WinScreen(width, height);\n Button replayButton = screen.getReplayButton();\n replayButton.setOnAction(e -> {\n try {\n Controller newGame = new Controller();\n newGame.start(mainWindow);\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n Button exitButton = screen.getExitButton();\n exitButton.setOnAction(e -> {\n System.exit(0);\n });\n Scene scene = screen.getScene();\n mainWindow.setScene(scene);\n }", "public void switchToWindow(String title) {\n\t\ttry {\r\n\t\t\tSet<String> allWindows = getter().getWindowHandles();\r\n\t\t\tfor (String eachWindow : allWindows) {\r\n\t\t\t\tgetter().switchTo().window(eachWindow);\r\n\t\t\t\tif (getter().getTitle().equals(title)) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"The Window Title: \"+title+\r\n\t\t\t\t\t\"is switched \");\r\n\t\t} catch (NoSuchWindowException e) {\r\n\t\t\tSystem.err.println(\"The Window Title: \"+title+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\t}", "private void openManagementWindow() {\n\n\t\tWindowManager.getInstance().openManagementWindow();\n\t\t// Close the current window\n\t\tthis.close();\n\t}", "public static void goToAboutWindow()\n {\n AboutWindow aboutWindow = new AboutWindow();\n aboutWindow.setVisible(true);\n aboutWindow.setFatherWindow(actualWindow, false);\n }", "public void selectWindow(int index) {\n\t\tList<String> listOfWindows = new ArrayList<>(SharedSD.getDriver().getWindowHandles());\n\t\tSharedSD.getDriver().switchTo().window(listOfWindows.get(index));\n\t}", "public void openWindow()\r\n {\r\n myWindow = new TraderWindow(this);\r\n while(!mailbox.isEmpty())\r\n {\r\n myWindow.showMessage( mailbox.remove() );\r\n }\r\n }", "public void open() {\r\n\t\tthis.setVisible(true);\r\n\t}", "public void switchToParentWindow() throws InterruptedException {\n\t\tSet<String>windowid=driver.getWindowHandles();\n\t\tIterator<String>itr=windowid.iterator();\n\t\tString mainwindow=itr.next();\n\t\tString childwindow=itr.next();\n\t\tdriver.close();\n\t\tdriver.switchTo().window(mainwindow);\n\t\tdriver.switchTo().defaultContent();\n\t\tThread.sleep(5000);\n\t\t\n\t}", "public void mainWindow(MainController group)\n {\n desktop.shell(group, _this());\n }", "public void setWindow(GWindow w) {\r\n window = w;\r\n }", "public void setWindowVisible()\n {\n lobbyWindowFrame.setVisible(true);\n }", "public void startWindow() {\r\n \r\n \tfirstBorderWindow = new BorderPane();\r\n \tScene scene = new Scene(firstBorderWindow,600,600);\r\n\t\tstage.setScene(scene);\r\n\t\t\r\n\t\t//MenuBar\r\n\t\tMenuBar mb = new MenuBar();\r\n\t\tMenu topMenu = new Menu(\"Impostazioni\");\r\n\t\t\r\n\t\tMenuItem regole = new MenuItem(\"Regole\");\r\n\t\tMenuItem esci = new MenuItem(\"Esci\");\r\n\t\ttopMenu.getItems().addAll(esci, regole);\r\n\t\tmb.getMenus().add(topMenu);\r\n\t\t\r\n\t\tEventHandler<ActionEvent> MEHandler = new EventHandler<ActionEvent>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\r\n\t\t\t\tString nome = ((MenuItem)event.getTarget()).getText();\r\n\t\t\t\tif (nome.equals(\"Esci\")) Platform.exit();\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\tesci.setOnAction(MEHandler);\r\n\t\t\r\n\t\tfirstBorderWindow.setTop(mb);\r\n\t\t// Show the scene\r\n\t\tstage.show();\r\n }", "public void switchToLastWindow() {\n\t\tSet<String> windowHandles = getDriver().getWindowHandles();\n\t\tfor (String str : windowHandles) {\n\t\t\tgetDriver().switchTo().window(str);\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdispose();\r\n\t\t\t\tFirstWindow.main(null);\r\n\t\t\t}", "public static void goToPlaylistChooserWindow()\n {\n PlaylistChooser playlistChooser = new PlaylistChooser();\n playlistChooser.setVisible(true);\n playlistChooser.setFatherWindow(actualWindow, false);\n }", "public void go() {\n\t\tjfad.setVisible(true);\n\t}", "public void switchToWindow(String handle)\n\t{\n\t\ttry {\n\t\t\tdriver.switchTo().window(handle);\n\t\t}catch(Exception e)\n\t\t{\n\t\t\tLOGGER.error(\"Step : Switching to New Window : Fail\");\n\t\t\t//e.printStackTrace();\n\t\t\tthrow new NotFoundException(\"Exception while switching to window\");\n\n\t\t}\n\t}", "public void newWindow() {\n\t\tJMenuTest frame1 = new JMenuTest();\n\t\tframe1.setBounds(100, 100, 400, 400);\n\t\tframe1.setVisible(true);\n\t}", "public void changeWindowTo(Class activity){\n Intent guestActivity = new Intent(this,activity);\n startActivity(guestActivity);\n }", "public final void change() {\n\t\tBSUIWindow.change_do(this);\n\t}", "public void start() {\r\n\t\tif (FormsContext.isFormsServicesApp()) {\r\n\t\t\tinitialOpenLWWindows = new LWWindowOperator().getWindowTitles();\r\n\t\t} else {\r\n\r\n\t\t}\r\n\t}", "public void ifWin() {\n WinMenu.setVisible(true);\n }", "@FXML\n void openMainWindow() {\n window.setTitle(\"Timelines\");\n window.setScene(mainScene);\n window.show();\n window.requestFocus();\n drawMainElements();\n\n messageLabel.setVisible(false);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcontrolleur.executeFirstWindow();\n\t\t\t\tdispose();\n\t\t\t}", "public void windowBecameFront() \n {\n return; \n }", "public static void switchToChildWindow() {\n\t\tString mainWindow = driver.getWindowHandle();\n\t\tSet<String> windows = driver.getWindowHandles();\n\t\tfor (String window : windows) {\n\t\t\tif (!window.equals(mainWindow)) {\n\t\t\t\tdriver.switchTo().window(window);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public abstract void newWindow(ReFrame newFrame);", "public void open() {\n\t\tthis.createContents();\n\n\t\tWindowBuilder delegate = this.getDelegate();\n\t\tdelegate.setTitle(this.title);\n\t\tdelegate.setContents(this);\n\t\tdelegate.setIcon(this.iconImage);\n\t\tdelegate.setMinHeight(this.minHeight);\n\t\tdelegate.setMinWidth(this.minWidth);\n\t\tdelegate.open();\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\twin.change(\"jpanel01\");\n\t\t\t}", "@Override\n public void windowOpened(WindowEvent we) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n Main.switchViews();\n }", "public void refreshFrame() {\n switchWindow();\n this.switchToFrame(\"botFr\");\n }", "@Override\n\tpublic void afterSwitchToWindow(String arg0, WebDriver arg1) {\n\n\t}", "public void selectRootWindow() {\n\t\tList<String> listOfWindows = new ArrayList<>(SharedSD.getDriver().getWindowHandles());\n\t\tSharedSD.getDriver().switchTo().window(listOfWindows.get(0));\n\t}", "public void switchToAnotherWindowHandle(String winHandleBefore) {\n\t\t\r\n\t\t\r\n\t\tfor (String winHandle : driver.getWindowHandles()) {\r\n\t\t\tif (!winHandle.equals(winHandleBefore))\r\n\t\t\t\tdriver.switchTo().window(winHandle);\r\n\t\t\t\t\r\n\t\t}\r\n\t\t// driver.manage().window().maximize();\r\n\t}", "private void openClientManagementWindow() {\r\n\t\tnew JFrameClient();\r\n\t}", "public static void switchToWindow(WebDriver driver, String window) {\r\n\r\n\t\tdriver.switchTo().window(window);\r\n\t}", "public void finishedWindow() {\n\t\tcloseWindow();\n\t\tstoreBuyWindow.getJFrame().setVisible(true);\n\t}", "public void switchToSettings() {\r\n\t\tlayout.show(this, \"settingsPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "public void routetopage() {\n this.setVisible(true);\n }", "@Override\r\n\tpublic void windowOpened(WindowEvent e) {\n\t\tsetFocusableWindowState(true);\r\n\t}", "@FXML\n void openMenuWindow() {\n window.setTitle(\"Timelines: Menu\");\n window.setScene(menuScene);\n window.show();\n window.requestFocus();\n\n messageLabel.setVisible(true);\n }", "public String switchToNewWindow(WebDriver driver)\n\t{\n\t\t Set<String> ids = driver.getWindowHandles();\n\t\t Iterator<String> it = ids.iterator();\n\t\t \n\t\t String pid = it.next();\n\t\t String cid = it.next();\n\t\t \n\t\t driver.switchTo().window(cid);\n\t\t return pid;\n\t}", "void goMainScreen(){\n\t\tcheckSavePwd();\n\t\tActionEvent e = new ActionEvent();\n\t\te.sender = this;\n\t\te.action = ActionEventConstant.ACTION_SWITH_TO_CATEGORY_SCREEN;\n\t\tUserController.getInstance().handleSwitchActivity(e);\n\t}", "public static void switchWindow(WebDriver driver, String firstWindow, String secondWindow) {\n\t \n\t Set<String> windowHandles = driver.getWindowHandles();\n\t \n\t for(String windows : windowHandles) {\n\t\t \n\t\t if(!windows.equals(firstWindow) && !windows.equals(secondWindow)) {\n\t\t\t \n\t\t\t driver.switchTo().window(windows);\n\t\t }\n\t\t \n\t }\n }", "public void start()\n\t{\n\t\tview.showWindow();\n\t\taddListeners();\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:/Driver/chromedriver.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\t\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.get(\"http://toolsqa.com/automation-practice-switch-windows/\");\r\n\t\t\r\n\t\tdriver.findElement(By.xpath(\".//*[@id='button1']\")).click();\r\n\t\tdriver.findElement(By.xpath(\".//*[@id='content']/p[3]/button\")).click();\r\n\t\tdriver.findElement(By.xpath(\".//*[@id='content']/p[4]/button\")).click();\r\n\t\t\r\n\t\tSet<String> winids =driver.getWindowHandles();\r\n\t\tIterator<String> itr = winids.iterator();\r\n\t\t\r\n\t\tString mainwindow= itr.next();\r\n\t\tString childwindow = itr.next();\r\n\t\t\r\n\t\tSystem.out.println(\"title main window\" + driver.getTitle());\r\n\t\t\r\n\t\tdriver.switchTo().window(childwindow);\r\n\t\t\r\n\t\tSystem.out.println(\"title main window1\" + driver.getTitle());\r\n\t\t\r\n\t\tchildwindow = itr.next();\r\n\t\tdriver.switchTo().window(childwindow);\r\n\t\t\r\n\t\tSystem.out.println(\"title main window2\" + driver.getTitle());\r\n\t\t\r\n\r\n\t}", "public void launch() {\n m_frame.pack();\n m_frame.setVisible(true);\n }", "@Override\n\t\t\tpublic void windowOpened(WindowEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@FXML\n public void cancelButtonPressed()\n {\n mainView.setWindow(\"START\");\n }", "@Override\n public void windowOpened(WindowEvent e) {\n \n }", "@Override\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "public static void switchToChildWindow() {\t\t\n\t\tString parent = Constants.driver.getWindowHandle();\n\t\tLOG.info(\"Parent window handle: \" +parent);\n\t\tSet <String> windows = Constants.driver.getWindowHandles();\n\t\tIterator <String> itr = windows.iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString child = itr.next();\n\t\t\tif (!child.equals(parent)) {\n\t\t\t\tLOG.info(\"Child window handle: \" +child);\n\t\t\t\tConstants.driver.switchTo().window(child);\n\t\t\t} else {\n\t\t\t\tLOG.error(\"Parent(main) and child window hanldles are same.\");\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n public void windowOpened(WindowEvent e)\n {\n\n }", "public static void windowspwcw() {\n\t\tString windowHandle = driver.getWindowHandle();\n\t\tSystem.out.println(\"parent window is: \"+windowHandle);\n\t\tSet<String> windowHandles = driver.getWindowHandles();\n\t\tSystem.out.println(\"child window is \"+windowHandles);\n\t\tfor(String eachWindowId:windowHandles)\n\t\t{\n\t\t\tif(!windowHandle.equals(eachWindowId))\n\t\t\t{\n\t\t\t\tdriver.switchTo().window(eachWindowId);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t}", "public void showWindow(Link link) {\n\t\tlinkToEdit = link;\n\t\tthis.workingLink = link.clone();\n\t\tupdate();\n\t\tMenuStart.centerWindow(this);\n\t\tsetVisible(true);\n\t}", "public void launchMainScreen() {\n\t\tmainWindow = new MainGameScreen(this);\n\t}", "private void newGame()\r\n {\r\n //close the current screen\r\n screen.dispose();\r\n //start back at the set up menu\r\n SetupView screen = new SetupView();\r\n SetupController controller = new SetupController(screen);\r\n screen.registerObserver(controller);\r\n }", "public void switchLastWindow() {\n\n Set<String> allwindow = driver.getWindowHandles();\n\n for (String next : allwindow) {\n driver.switchTo().window(next);\n\n }\n }", "@Override\n public void windowOpened(WindowEvent e) {\n this.mostrar();\n }", "public void openOptionsWindow() {\n\t\tthis.dispose();\t//built-in method to destroy this GUI.\n\t\tnew SARMain().setVisible(true);\n\t}", "protected void switchTab(int index) {\n\t\tCapabilities.getDriver().switchTo().window(new ArrayList<String>(Capabilities.getDriver().getWindowHandles()).get(index));\n\t}", "@Override\r\n\tpublic void windowOpened(WindowEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowOpened(WindowEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowOpened(WindowEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowOpened(WindowEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowOpened(WindowEvent e) {\n\t\t\r\n\t}", "public void windowOpened (WindowEvent we) { }", "public void windowActivated(WindowEvent e) {\n adaptee.this_windowActivated();\n }", "public void windowsUp() {\n\n windowStatus = true;\n System.out.println(\"Windows stay closed\");\n\n }", "public void otherWin\n (String name);", "public void switchToGameScreen() {\n \tCardLayout currLayout = (CardLayout) screens.getLayout();\n \tcurrLayout.show(screens, \"game\");\n \troom.reset();\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\t public void run() {\r\n\t\t\t try {\r\n\t\t\t NewLogin window = new NewLogin();\r\n\t\t\t window.setVisible(true);\r\n\t\t\t } catch (Exception e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t });\r\n\t\t\t\t\r\n \t\r\n\t\t\t\t\r\n\t\t\t}", "@Override public void windowOpened(WindowEvent evt) { }", "@Override public void windowOpened(WindowEvent evt) { }", "private void BacktoMainActionPerformed(java.awt.event.ActionEvent evt) {\n new Machines().setVisible(true);\n }", "@Override\n\tpublic void windowStateChanged(WindowEvent arg0) {\n\t\t\n\t}", "public static void changeScreen(Parent screen) {\n mainStage.setScene( new Scene( screen ) );\n mainStage.show();\n }", "public void switchToWindow(String title) {\n\t\tSet<String> windowHandles = getDriver().getWindowHandles();\n\t\tfor (String str : windowHandles) {\n\t\t\tgetDriver().switchTo().window(str);\n\t\t\tSystem.out.println(\"window title: \" + getDriver().getTitle());\n\t\t\tif (getDriver().getTitle().contains(title))\n\t\t\t\tbreak;\n\t\t}\n\t}", "public abstract void start(String[] args, Window window);", "@Override\r\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\t\r\n\t\t\t}", "public void afterSwitchToWindow(String windowName, WebDriver driver) {\n\t\t\r\n\t}", "@Override\n public void show() {\n displayWindow.addWindowFocusListener(this);\n displayWindow.setVisible(true);\n }", "@Override\n\tpublic void beforeSwitchToWindow(String arg0, WebDriver arg1) {\n\n\t}", "private void i_win() {\n\t\tif (MainMusic.isPlaying())\n\t\t\tMainMusic.stop();\n\t\tMainMusic = MediaPlayer.create(Game.this, R.raw.win);\n\t\tMainMusic.start();\n\t\tgame_panel.Pause_game=true;\n\t\tWinDialog.setVisibility(View.VISIBLE);\n\t}", "@Override\r\n\t\t\tpublic void windowOpened(WindowEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "public void start() {\n\t\t setVisible(true);\n\t}", "@Override\n public void windowOpened(WindowEvent e) {\n }" ]
[ "0.7737788", "0.7686098", "0.7405624", "0.69962937", "0.68120444", "0.6780441", "0.6728211", "0.6716508", "0.6640086", "0.6609914", "0.6604348", "0.65612215", "0.6560508", "0.6542208", "0.6518286", "0.6502044", "0.6494237", "0.64927214", "0.64859354", "0.6485916", "0.64833605", "0.64788926", "0.64683366", "0.6466392", "0.64646596", "0.6433755", "0.6406438", "0.6397148", "0.63906217", "0.63867337", "0.6386199", "0.63856417", "0.6333755", "0.6308341", "0.6307132", "0.62771434", "0.6260993", "0.62587154", "0.6254152", "0.6246862", "0.62460494", "0.62440175", "0.6230972", "0.6221279", "0.6220768", "0.6210264", "0.6206768", "0.6203431", "0.62011045", "0.6185662", "0.61670536", "0.6165166", "0.6163265", "0.6159857", "0.61574215", "0.6144106", "0.6143288", "0.613734", "0.6133435", "0.6123879", "0.61201376", "0.61201376", "0.61201376", "0.61201376", "0.6112663", "0.6111794", "0.6111397", "0.6103827", "0.6084867", "0.6081967", "0.6074969", "0.60749257", "0.60746866", "0.6073701", "0.6073397", "0.6073397", "0.6073397", "0.6073397", "0.6073397", "0.60730064", "0.6069982", "0.606979", "0.60676223", "0.606743", "0.60660356", "0.6064693", "0.6064693", "0.60585815", "0.6055812", "0.6049314", "0.6049084", "0.6046688", "0.6046002", "0.6046002", "0.6044484", "0.60433984", "0.6041144", "0.6040433", "0.60383666", "0.6031403", "0.6031225" ]
0.0
-1
Returns the value of the 'Inizialized Function Name' attribute.
String getInizializedFunctionName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getName() {\n return m_function.getName();\n }", "public String getName()\n {\n return m_functionName;\n }", "public String getFuncName() {\n return funcName;\n }", "public String getFuncname() {\r\n return funcname;\r\n }", "public String getFunctionName() {\r\n\t\treturn this.functionName;\r\n\t}", "public String getFunctionName()\n {\n return m_functionName;\n }", "public String getFunctionName() {\n\t\treturn null;\n\t}", "public String toString ()\n {\n return \"function:\" + _vname;\n }", "public String getfunction() {\n\t\treturn _function;\n\t}", "@Override\n public String toString() {\n return String.format(\"REIL function %s\", getName());\n }", "String getFunctionName();", "protected abstract String getFunctionName();", "@Nonnull\n FunctionName getFunctionName() {\n return name;\n }", "public String getFunctionLocation() {\n return \" [\" + name + \"]\";\n }", "@Override\r\n\tpublic String getFunc() {\n\t\treturn null;\r\n\t}", "public String getActionName() {\n\t\treturn this.function;\n\t}", "public String toString() {\n return function.toString();\n }", "public static String getName() {\n\t\treturn _asmFileStr;\n\t}", "public String getIfName()\n {\n return (String) getAttributes().get(ATTR_IF_NAME);\n }", "public String getFunctionId() {\n return functionId;\n }", "private FunctionIdentifier getFunctionIdentifier() {\n return functionIdentifier;\n }", "public java.lang.String getCallingNameGenericString() {\r\n return callingNameGenericString;\r\n }", "public String getSFunc() {\n Object ref = sFunc_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n sFunc_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getCustomName ( ) {\n\t\treturn extract ( handle -> handle.getCustomName ( ) );\n\t}", "private String getFunctionName() {\n StackTraceElement[] sts = Thread.currentThread().getStackTrace();\n if (sts == null) {\n return null;\n }\n for (StackTraceElement st : sts) {\n if (st.isNativeMethod()) {\n continue;\n }\n if (st.getClassName().equals(Thread.class.getName())) {\n continue;\n }\n if (st.getClassName().equals(LogUtils.this.getClass().getName())) {\n continue;\n }\n return \"[ \" + Thread.currentThread().getName() + \": \"\n + st.getFileName() + \":\" + st.getLineNumber() + \" \"\n + st.getMethodName() + \" ]\";\n }\n return null;\n }", "@ApiModelProperty(example = \"nodeinfo\", required = true, value = \"The name of the function\")\n public String getName() {\n return name;\n }", "public String getFun() {\n return fun;\n }", "java.lang.String getCodeName();", "@Override\n public String getFunctionId() {\n return getFunction().getFunctionDefinition().getUniqueId();\n }", "public String getJS_FUNCTION() {\r\n return JS_FUNCTION;\r\n }", "public String getFuncConfig() {\n\t\treturn funcConfig;\n\t}", "public String getDefinedName() {\n return definedName;\n }", "@Override\n public String getSFunc() {\n Object ref = sFunc_;\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 sFunc_ = s;\n return s;\n }\n }", "public String getCurrentMethodName () {\n String currentMethod = getCurrentElement(ElementKind.METHOD);\n if (currentMethod == null) return \"\";\n else return currentMethod;\n }", "public int getFunction() {\n\t\treturn var;\n\t}", "public Integer getFuncCode() {\n\t\treturn funcCode;\n\t}", "@DhtmlColumn(columnIndex = 3, headerName = \"函数\", coulumnType = DhtmlxBaseType.TXT)\n\t@NotBlank\n\tpublic String getEventFun() {\n\t\treturn eventFun;\n\t}", "@Override\n\tpublic TextBox getFuncNameTxtArea() {\n\t\treturn funcNameTxtArea;\n\t}", "String getValueName();", "protected String getName() {\n\t\tfinal String tmpName = getClass().getSimpleName();\n\t\tif (tmpName.length() == 0) {\n\t\t\t// anonymous class\n\t\t\treturn \"???\";//createAlgorithm(replanningContext).getClass().getSimpleName();\n\t\t}\n\n\t\treturn tmpName;\n\t}", "String getVarName();", "String getVarName();", "String getVarName();", "public String getFunctionDesc() {\n return functionDesc;\n }", "public Identifier getName();", "public String getCallingName() throws FrameException {\n try {\n byte data[] = (byte[])infoElements.get(new Integer(InfoElement.CALLING_NAME));\n return new String(data);\n } catch (Exception e) {\n throw new FrameException(e);\n }\n }", "public char local_name() {\n return local_name;\n }", "public String getName()\r\n\t{\r\n\t\treturn name; // gives the value of the name to the caller\r\n\t}", "public String getName()\n {\n return (String)getAttributeInternal(NAME);\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();", "public Map<String, String> getFuncNameMap() {\n\t\treturn funcNameMap;\n\t}", "public String getName() {\n return nameRule.getMethodName();\n }", "public Function getFunction()\n\t{\n\t\treturn function;\n\t}", "public String getInstName() {\r\n return instName;\r\n }", "public String getFunType() {\r\n return funType;\r\n }", "public String toInvariantString() {\n\t\treturn fInvariantName;\n\t}", "public Expression getFunction()\n\t{\n\t\treturn function;\n\t}", "public SimpleName getName() {\n if (this.methodName == null) {\n // lazy init must be thread-safe for readers\n synchronized (this) {\n if (this.methodName == null) {\n preLazyInit();\n this.methodName = new SimpleName(this.ast);\n postLazyInit(this.methodName, NAME_PROPERTY);\n }\n }\n }\n return this.methodName;\n }", "public RemoteCall<String> name() {\n final Function function = new Function(FUNC_NAME,\n Arrays.<Type>asList(),\n Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));\n return executeRemoteCallSingleValueReturn(function, String.class);\n }", "@Override public String toString() {\n return \"\" + \"function_i=\" + function_i // NOI18N\n + \", function_e=\" + function_e // NOI18N\n + \", global_i=\" + global_i; // NOI18N\n }", "private String getName() {\n return method.getName();\n }", "String getOutputName();", "public java.lang.String getName() {\n return localName;\n }", "public java.lang.String getName() {\n return localName;\n }", "public java.lang.String getName() {\n return localName;\n }", "public java.lang.String getName() {\r\n return localName;\r\n }" ]
[ "0.72020525", "0.7196345", "0.7066486", "0.7048547", "0.69796985", "0.6882234", "0.68327427", "0.65793365", "0.6491991", "0.6446226", "0.6374833", "0.6313709", "0.6292487", "0.6256273", "0.61155266", "0.61134803", "0.6104449", "0.60694844", "0.60117424", "0.6009666", "0.5995909", "0.5991364", "0.59811795", "0.59364766", "0.5917121", "0.5879056", "0.58510065", "0.5810184", "0.5802622", "0.5787977", "0.5777719", "0.5773722", "0.5758016", "0.57466346", "0.571765", "0.5712668", "0.5708562", "0.5708149", "0.57061535", "0.5691749", "0.5684439", "0.5684439", "0.5684439", "0.5681747", "0.5677116", "0.56692463", "0.56672704", "0.56615376", "0.56512576", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5641198", "0.5638156", "0.5633789", "0.56205374", "0.5613681", "0.56060296", "0.5593889", "0.5592595", "0.5591546", "0.5591006", "0.5590662", "0.55800855", "0.5577302", "0.5565658", "0.5565658", "0.5565658", "0.5563061" ]
0.78643095
0
Returns the value of the 'Body' containment reference.
Term getBody();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getBody() {\r\n\t\treturn mBody;\r\n\t}", "public Object getBody() {\n return body;\n }", "public Body getBody() {\n return body;\n }", "public String getBody() {\n\t\treturn Body;\n\t}", "public String getBody () {\n\t\treturn body;\n\t}", "public String getBody() {\r\n return body;\r\n }", "public String getBody() {\n return body;\n }", "public String getBody() {\n return body;\n }", "public String getBody() {\n return body;\n }", "public AgentBody getBody() {\n\t\treturn body;\n\t}", "public String getBody()\n\t{\n\t\treturn m_sBody;\t\n\t}", "public java.lang.String getBody() {\n return body_;\n }", "public byte[] getBody() {\n\t\treturn body;\n\t}", "public java.lang.String getBody() {\n return instance.getBody();\n }", "public String getBody()\n {\n return body;\n }", "public LinkedList<Location> getBody() {\n return this.body;\n }", "public byte[] getBody() {\n return body;\n }", "public String getBody_() {\n return body_;\n }", "public org.chartacaeli.model.Body[] getBody() {\n org.chartacaeli.model.Body[] array = new org.chartacaeli.model.Body[0];\n return this.bodyList.toArray(array);\n }", "Body getBody();", "public String getBody(){\n return body;\n }", "public List<Atom> getBody ()\r\n\t{\r\n\t\treturn _body;\r\n\t}", "public Body getBody() {\n if (jBody == null) {\n throw new RuntimeException(\"No jimplification happened yet, no body available.\");\n }\n return jBody;\n }", "public com.google.protobuf.ByteString\n getBodyBytes() {\n Object ref = body_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n body_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getContentBody() {\n return contentBody;\n }", "public com.google.protobuf.ByteString\n getBodyBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(body_);\n }", "public UserModel getBody() {\n return localBody;\n }", "public UserModel getBody() {\n return localBody;\n }", "public com.google.protobuf.ByteString\n getBodyBytes() {\n java.lang.Object ref = body_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n body_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getBodyBytes() {\n java.lang.Object ref = body_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n body_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public DrakonMacro getBody()\r\n {\r\n return body;\r\n }", "public com.google.protobuf.ByteString\n getBodyBytes() {\n java.lang.Object ref = body_;\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 body_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getBodyBytes() {\n java.lang.Object ref = body_;\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 body_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getBody(){\n return bodiesText;\n }", "public AnimalModel getBody() {\n return localBody;\n }", "public AnimalModel getBody() {\n return localBody;\n }", "public com.google.protobuf.ByteString\n getBodyBytes() {\n return instance.getBodyBytes();\n }", "SmilBody getBody();", "public abstract Body getBody();", "public java.lang.String getBody() {\n java.lang.Object ref = body_;\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 body_ = s;\n }\n return s;\n }\n }", "public String getBody() {\n Object ref = body_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n body_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public Body getNativeBody() {\r\n\t\treturn box2dComponent.getBody();\r\n\t}", "public java.lang.String getBody() {\n java.lang.Object ref = body_;\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 body_ = s;\n return s;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getBodyBytes() {\n Object ref = body_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n body_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "CompoundSt getBody () { return body; }", "public Body getBody1() {\r\n\t\treturn body1;\r\n\t}", "public java.lang.String getBody() {\n java.lang.Object ref = body_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n body_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getBody() {\n java.lang.Object ref = body_;\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 body_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getCellBody() {\n\t\treturn cellBody;\n\t}", "public String getBodyLoc() {\n return bodyLoc;\n }", "public InputStream body() {\n return body;\n }", "public List<SignatureNode> getBody() {\n return body;\n }", "public ClassBodyNode getBody()throws ClassCastException;", "public String getBodyText() {\n return bodyText;\n }", "@Override\n public String getBody() {\n Object ref = body_;\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 body_ = s;\n return s;\n }\n }", "public String getBodyString() {\n return this.bodyString;\n }", "DBody getBody();", "public Statement getBody() {\n if (body == null) {\n // lazy initialize - use setter to ensure parent link set too\n setBody(new Block(getAST())); }\n return body; }", "public String getBody()\n {\n return super.getBody();\n }", "String getBody();", "String getBody();", "String getBody();", "String getBody();", "java.lang.String getBody();", "com.google.protobuf.ByteString\n getBodyBytes();", "com.google.protobuf.ByteString\n getBodyBytes();", "public JPanel getBody() {\n\t\treturn contentPane;\n\t}", "public boolean hasBody() {\n return result.hasBody();\n }", "public boolean hasBody() {\n return result.hasBody();\n }", "public boolean hasBody() {\n return result.hasBody();\n }", "public boolean hasBody() {\n return result.hasBody();\n }", "public boolean hasBody() {\n return result.hasBody();\n }", "public String getTypeOfBody() {\n\t\treturn typeOfBody;\n\t}", "@Override\n public Object getBody() {\n return null;\n }", "public Object getBody() throws MessagingException {\n if (body == null) {\n body = getMarshaler().unmarshal(exchange, this);\n }\n return body;\n }", "public CodingDt getBodySiteElement() { \n\t\tif (myBodySite == null) {\n\t\t\tmyBodySite = new CodingDt();\n\t\t}\n\t\treturn myBodySite;\n\t}", "public Body getBody() {\n return new BufferBody(buffer);\n }", "public GHFrom getBody() {\n return body;\n }", "public List<BodyDecl> getBodyElelemts() {\n return getBodyElelemtList();\n }", "public void setBody(Body body) {\n this.body = body;\n }", "@Override\n\tpublic java.lang.String getBody() {\n\t\treturn _news_Blogs.getBody();\n\t}", "public HttpEntity body() {\n return body;\n }", "public boolean isSetBody() {\n return this.body != null;\n }", "public boolean isSetBody() {\n return this.body != null;\n }", "public Body getBody2() {\r\n\t\treturn body2;\r\n\t}", "public Polygon getBody() {\r\n\t\treturn getRotatedBody(angle);\r\n\t}", "public Integer getTypeOfBodyCd() {\n\t\treturn typeOfBodyCd;\n\t}", "public CodingDt getBodySite() { \n\t\tif (myBodySite == null) {\n\t\t\tmyBodySite = new CodingDt();\n\t\t}\n\t\treturn myBodySite;\n\t}", "public PosSymbol getBodyName() {\n return bodyName;\n }", "public Vector<YANG_Body> getBodies() {\n\t\treturn bodies;\n\t}", "OclExpressionCS getBodyExpression();", "@Override\n\tpublic PhysixBody getRigidBody() {\n\t\treturn rigidBody;\n\t}", "public void setBody(Object body) {\n this.body = body;\n }", "public final Body getBody( int i )\n {\n return ( this.bodies.get( i ) );\n }", "public ArrayList<Integer> getBodyPositions() {\n\t\treturn bodyPositions;\n\t}", "public HeroBody getHeroBody() {\n return heroBody;\n }", "private final native NodeRemote getBody0() /*-{\n return this.body;\n\t}-*/;", "public boolean hasBody() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public final int length() {\n return m_body.size();\n }", "public void setBody_(String body_) {\n this.body_ = body_;\n }" ]
[ "0.74174863", "0.7411203", "0.7341126", "0.7333961", "0.7109697", "0.70849067", "0.707255", "0.707255", "0.707255", "0.70511365", "0.70282793", "0.7000054", "0.69719815", "0.69646245", "0.6925693", "0.6841236", "0.6841089", "0.6834172", "0.683019", "0.6786219", "0.6691088", "0.66568696", "0.6646682", "0.6583369", "0.6575781", "0.65582716", "0.6547164", "0.6547164", "0.6545898", "0.6534631", "0.65252674", "0.6504402", "0.6495803", "0.646878", "0.6426563", "0.6426563", "0.6415757", "0.6402817", "0.6396394", "0.63875955", "0.637288", "0.6360403", "0.63382965", "0.6292642", "0.6274831", "0.62565845", "0.62422746", "0.6206037", "0.6197061", "0.61823815", "0.614199", "0.6141956", "0.61191845", "0.61007774", "0.6004702", "0.6003446", "0.59813803", "0.59639347", "0.5946109", "0.5931473", "0.5931473", "0.5931473", "0.5931473", "0.5922669", "0.5918605", "0.5918605", "0.58943945", "0.5882839", "0.5882839", "0.5882839", "0.5882839", "0.5882839", "0.5847332", "0.5840353", "0.5815711", "0.580279", "0.57886875", "0.5780852", "0.5748012", "0.5741873", "0.5739871", "0.57393825", "0.57359684", "0.57359684", "0.57303953", "0.57116216", "0.56581676", "0.56549734", "0.55778265", "0.5568445", "0.55529565", "0.55476", "0.55106723", "0.5504944", "0.54814845", "0.548003", "0.5457226", "0.5408747", "0.53435874", "0.5310833" ]
0.5882312
72
Returns a constant from Suits enumeration that represents the color of the card.
public Suits getSuit() { return suit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Color color(){\n return PackedCard.color(this.nbCard);\n }", "public Card.Color color() {\n return PackedCard.color(packedCard);\n }", "public CardColor getColor() {\n return this.color;\n }", "public static interface CardColors{\n public static final Color RGBA_0 = new Color(0xCCC0B3FF);\n public static final Color RGBA_2 = new Color(0xEEE4DAFF);\n public static final Color RGBA_4 = new Color(0xEDE0C8FF);\n public static final Color RGBA_8 = new Color(0xF2B179FF);\n public static final Color RGBA_16 = new Color(0xF49563FF);\n public static final Color RGBA_32 = new Color(0xF5794DFF);\n public static final Color RGBA_64 = new Color(0xF55D37FF);\n public static final Color RGBA_128 = new Color(0xEEE863FF);\n public static final Color RGBA_256 = new Color(0xEDB04DFF);\n public static final Color RGBA_512 = new Color(0xECB04DFF);\n public static final Color RGBA_1024 = new Color(0xEB9437FF);\n public static final Color RGBA_2048 = new Color(0xEA7821FF);\n }", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "String getColor();", "String getColour();", "public Color getColor() {\n switch(this.value) {\n case 2: return new Color(0xEEE4DA);\n case 4: return new Color(0xEDE0C8);\n case 8: return new Color(0xF2B179);\n case 16: return new Color(0xF59563);\n case 32: return new Color(0xF67C5F);\n case 64: return new Color(0xF65E3B);\n case 128: return new Color(0xEDCF72);\n case 256: return new Color(0xEDCC61);\n case 512: return new Color(0xEDC850);\n case 1024: return new Color(0xEDC53F);\n case 2048: return new Color(0xEDC22E);\n \n }\n // Default color for null tiles\n return new Color(0xCDC1B4);\n }", "public int getColor();", "public int getColor();", "public int getColor() {\n return color;\n }", "public int getColor(){\r\n\t\treturn color;\r\n\t}", "java.awt.Color getColor();", "public int getColor() {\n \t\treturn color;\n \t}", "public int getColor(){\n\t\treturn color;\n\t}", "public int getColor(){\n\t\treturn color;\n\t}", "public char getColor();", "public Integer getColor() {\n\t\treturn color;\n\t}", "public Integer getColorCd() {\n\t\treturn colorCd;\n\t}", "int getColour();", "public String getColor()\n {\n return color;\n }", "public String getColor()\n {\n return color;\n }", "public GameColor getColor();", "public int getColorValue() {\r\n\t\treturn color;\r\n\t}", "@Override\n Color getColor() {\n return new Color(32, 83, 226, 255);\n }", "public String getColor() {\r\n return color;\r\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\r\n\t\treturn color;\r\n\t}", "public String getColor(){\n\t\treturn color;\n\t}", "public short getColor()\n {\n return font.getColorPaletteIndex();\n }", "public short getColor() {\n\t\treturn this.color;\n\t}", "public Color getColor();", "public Color getColor();", "public Color getColor();", "public int getColor() {\n return this.color;\n }", "public String getColor() {\n\t\treturn color;\n\t}", "public String getColor() {\n\t\treturn color;\n\t}", "public String getColor(){\r\n return color;\r\n }", "String getColour(int winningNumber);", "public String getColor() { \n return color; \n }", "public String obtenColor() {\r\n return color;\r\n }", "public String getColor()\n {\n return this.color;\n }", "public static int color(Context context) {\n\t\tSharedPreferences prefs = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tint bg = prefs.getInt(\"menu.background\", 0x7c000000);\n\t\tint alpha =\t((bg>>24)&0xFF);\n\t\tint red = \t((bg>>16)&0xFF);\n\t\tint green = ((bg>>8)&0xFF);\n\t\tint blue = \t((bg)&0xFF);\n\t\tdouble lum = ((0.2126*(red)+0.7152*(green)+0.0722*(blue))*((alpha)/255.0))/255.0;\n\t\tif(lum>0.35)\n\t\t\treturn 0xFF000000;//black\n\t\telse return 0xFFFFFFFF;//white\n\t}", "public String getColor() {\r\n\t\treturn \"Color = [\"+ ColorUtil.red(color) + \", \"+ ColorUtil.green(color) + \", \"+ ColorUtil.blue(color) + \"]\";\r\n\t}", "@Override\n public String getColor() {\n return this.color.name();\n }", "public int color() {\n\t\treturn color;\n\t}", "public final Color getColor() {\n return color;\n }", "public int getColor() {\r\n return Color;\r\n }", "private static String getColorString(int index) {\n switch (index) {\n case 0: return \"None\";\n case 1: case 6: return \"Orange\";\n case 2: case 7: return \"Green\";\n case 3: return \"Blue\";\n case 4: case 14: return \"Yellow\";\n case 8: return \"Black\";\n default: return \"not a color\";\n }\n }", "public static Color getColor() {\n return myColor;\n }", "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 int getColor()\r\n {\r\n return m_iColor;\r\n }", "public String showColor(){\r\n\t\tSystem.out.println(\"The color of this fruit is \" + color);\r\n\t\treturn color;}", "public String getColor() {\n return this.color;\n }", "public DiceColor getColor() {\n return color;\n }", "public Piece.color getColor() { return color; }", "public int getColour()\r\n\t{\r\n\t\treturn colour;\r\n\t}", "public char getSeekerColor() {\n return getCharProperty(\"RequestedColor\");\n }", "public String getColorString();", "public final String getColorCode() {\n\t\treturn colorCode;\n\t}", "public PieceColor getColor(){\r\n\t\treturn this.color;\r\n\t}", "public String getColor(){\n return this._color;\n }", "public String dame_color() {\n\t\treturn color;\n\t}", "public Color getColor() {\n return color;\n }", "public Color getColor() {\n return color;\r\n }", "public Color getColor() \n\t{\n\t\treturn color;\n\t}", "default Color getColor() {\r\n\t\treturn Color.RED;\r\n\t}", "public Color getColor() {\n \t\treturn color;\n \t}", "@Override\n public Color getColor() {\n return Utils.Pion.BLANC.getCouleur();\n }", "public Color getColor(){\n\t\t\n\t\treturn COL;\n\t}", "public Color getChosenColor(int index){\n\t\treturn this.colorSet[index];\n\t}", "public IsColor getColor() {\n\t\treturn ColorBuilder.parse(getColorAsString());\n\t}", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public String getColor() {\n return colorID;\n }", "public final Color getColor() {\r\n return color;\r\n }", "public Color getColor() { return color; }", "public Color getColor()\n {\n return color;\n }", "public int getRenderColor(int p_149741_1_)\n {\n \n \tBlock[] coloredStones = MachineryCraft.blocks.coloredStoneSlab;\n \n \tfor(int i = 0; i<coloredStones.length; i++){\n \t\tif(this == coloredStones[i]) return this.colors[i];\n \t\t\n \t}\n \treturn colors[1];\n \n }", "public Color getColor() {\r\n return this.BoardColor;\r\n }", "public Color getColor() { return color.get(); }", "public final Color getColor() {\n\t\treturn color;\n\t}", "public int getColorInt () {\r\n return this.colorReturned;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "@ColorInt\n public int getColor() {\n return Color.HSVToColor(mColorHSV);\n }", "public Color getColor(int i) {\n switch (i) {\n case 0:\n return Color.GRAY;\n case 1:\n return Color.RED.darker();\n case 2:\n return Color.YELLOW.darker();\n case 3:\n return Color.CYAN.darker().darker();\n case 4:\n return Color.PINK.darker();\n case 5:\n return Color.GREEN.darker();\n default:\n return Color.BLACK;\n }\n }", "private int getCurrentMainColor () {\n int translatedHue = 255 - ( int ) ( mCurrentHue * 255 / 360 );\n int index = 0;\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 255, 0, ( int ) i );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 255 - ( int ) i, 0, 255 );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 0, ( int ) i, 255 );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 0, 255, 255 - ( int ) i );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( ( int ) i, 255, 0 );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 255, 255 - ( int ) i, 0 );\n index++;\n }\n return Color.RED;\n }" ]
[ "0.74053407", "0.72094756", "0.7096034", "0.7022566", "0.6884925", "0.6884925", "0.6884925", "0.6884925", "0.6884925", "0.6868904", "0.686137", "0.6852164", "0.67999583", "0.67999583", "0.6738134", "0.67375755", "0.67335504", "0.6717178", "0.6693136", "0.6693136", "0.6685832", "0.6671526", "0.6662061", "0.66415554", "0.6627641", "0.6627641", "0.66158366", "0.66053426", "0.65892315", "0.65830445", "0.65598047", "0.65598047", "0.65598047", "0.65598047", "0.65598047", "0.65598047", "0.65598047", "0.65598047", "0.65415245", "0.6535709", "0.652439", "0.6510572", "0.6506459", "0.6506459", "0.6506459", "0.6502608", "0.65017235", "0.65017235", "0.648573", "0.64766324", "0.64759344", "0.64593124", "0.6441877", "0.64366376", "0.6431892", "0.6430933", "0.6419771", "0.64108", "0.64026916", "0.63940334", "0.6393042", "0.6380766", "0.63718885", "0.63641673", "0.63614345", "0.63599753", "0.63544255", "0.6347068", "0.6339251", "0.6336903", "0.6330982", "0.63294184", "0.63241976", "0.6322187", "0.63187516", "0.6307975", "0.6306414", "0.6301279", "0.6296844", "0.6296518", "0.6283072", "0.62793285", "0.6278487", "0.6277438", "0.6277438", "0.6277438", "0.6276428", "0.6270291", "0.6268908", "0.6258442", "0.62580204", "0.6256106", "0.6254569", "0.62499994", "0.6236176", "0.6233694", "0.6233694", "0.6233694", "0.62291515", "0.6226434", "0.622171" ]
0.0
-1
Returns card value, a number between 1 and 13.
public int getValue() { return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getValue() {\n\t\tif (!this.isCard()) {\n\t\t\tSystem.out.println(\"Error! \" + id + \" isn't a card!\");\n\t\t\treturn 0;\n\t\t} else if (id % 13 != 0)\n\t\t\treturn id % 13;\n\t\telse\n\t\t\treturn 13;\n\t}", "public int getCardValue(int card) {\n\t\tint result = card;\n\t\tswitch (card) {\n\t\tcase 11:\n\t\tcase 12:\n\t\tcase 13:\n\t\t\tresult = 10;\n\t\t}\n\t\treturn result;\n\t}", "public int getCardVal(){\n\t\tint aces = 0;\n\t\tif(cardString.charAt(0) == 'J' || cardString.charAt(0) == 'Q' || cardString.charAt(0) == 'K' || cardString.charAt(0) == 'T'){\n\t\t\tcardValue = 10;\n\t\t}\n\t\telse if(cardString.charAt(0) == 'A'){\n\t\t\tcardValue = 11;\n\t\t}\n\t\telse{\n\t\t\tcardValue = Character.getNumericValue(cardString.charAt(0));\n\t\t}\n\t\treturn cardValue;\n\t}", "public void generateCardValue() {\r\n\t\tswitch (cardNumber) {\r\n\t\tcase 1:\r\n\t\t\tcardValue = \"Ace\";\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tcardValue = \"Two\";\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tcardValue = \"Three\";\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tcardValue = \"Four\";\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tcardValue = \"Five\";\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tcardValue = \"Six\";\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tcardValue = \"Seven\";\r\n\t\t\tbreak;\r\n\t\tcase 8:\r\n\t\t\tcardValue = \"Eight\";\r\n\t\t\tbreak;\r\n\t\tcase 9:\r\n\t\t\tcardValue = \"Nine\";\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tcardValue = \"Ten\";\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tcardValue = \"Jack\";\r\n\t\t\tcardNumber = 10;\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tcardValue = \"Queen\";\r\n\t\t\tcardNumber = 10;\r\n\t\t\tbreak;\r\n\t\tcase 13:\r\n\t\t\tcardValue = \"King\";\r\n\t\t\tcardNumber = 10;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public int getCardValue()\n {\n return cardValue; \n }", "public int cardValue(Card card) //translate string into card's numerical value\r\n {\r\n if (card.face.equals(\"Deuce\"))\r\n return 2;\r\n if (card.face.equals(\"Three\"))\r\n return 3;\r\n if (card.face.equals(\"Four\"))\r\n return 4;\r\n if (card.face.equals(\"Five\"))\r\n return 5;\r\n if (card.face.equals(\"Six\"))\r\n return 6;\r\n if (card.face.equals(\"Seven\"))\r\n return 7;\r\n if (card.face.equals(\"Eight\"))\r\n return 8;\r\n if (card.face.equals(\"Nine\"))\r\n return 9;\r\n if (card.face.equals(\"Ten\"))\r\n return 10;\r\n if (card.face.equals(\"Jack\"))\r\n return 11;\r\n if (card.face.equals(\"Queen\"))\r\n return 12;\r\n if (card.face.equals(\"King\"))\r\n return 13;\r\n if (card.face.equals(\"Ace\"))\r\n return 14;\r\n return -2;\r\n }", "public int getCardVal(boolean aceIsOne) {\n\t\tint val = (this.getCardNum()-1)/4 + 2;\n\t\tif(val==14 && aceIsOne)\n\t\t\tval = 1;\n\t\telse if(val > 10 && val < 14)\n\t\t\tval = 10;\n\t\telse if(val == 14)\n\t\t\tval = 11;\n\t\t\n\t\treturn val;\n\t}", "public String getCardValue() {\n return Cvalue;\n }", "public static int calculateCard(Card c)\n\t{\n\t\tint value=c.getValue();\n\t\tif(value>=10)\n\t\t\treturn 10;\n\t\telse if(value==1)\n\t\t\treturn 11;\n\t\treturn value;\n\t}", "private String getCardNumber() {\n try {\n String cardNumberWithoutSpaces = cardNumber.getAttribute(\"value\").replaceAll(\" \", \"\");\n int cardLength = cardNumberWithoutSpaces.length();\n return cardNumberWithoutSpaces.substring(cardLength - 4, cardLength);\n }\n catch (Exception ex) {\n // no action\n }\n return null;\n }", "public int getNumber(){return cardNumber;}", "public int value(){\r\n\t\t\r\n\t\tthis.sort();\r\n\t\t\r\n\t\tint result = 0;\r\n\t\t\r\n\t\tfor(int i = this.cardCount()-1; i >= 0; i--){\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.ACE) == 0){\r\n\t\t\t\tif(result <= 10 - i)\r\n\t\t\t\t\tresult += 11;\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.TEN) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.JACK) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.QUEEN) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.KING) == 0 ){\r\n\t\t\t\tresult += 10;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.TWO) == 0){\r\n\t\t\t\tresult += 2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.THREE) == 0){\r\n\t\t\t\tresult += 3;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.FOUR) == 0){\r\n\t\t\t\tresult += 4;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.FIVE) == 0){\r\n\t\t\t\tresult += 5;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.SIX) == 0){\r\n\t\t\t\tresult += 6;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.SEVEN) == 0){\r\n\t\t\t\tresult += 7;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.EIGHT) == 0){\r\n\t\t\t\tresult += 8;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.NINE) == 0){\r\n\t\t\t\tresult += 9;\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public int getHandValue() {\n\t\tint value = 0;\n\t\tint aces = 0;\n\t\tfor (Card card : cardHand) {\n\t\t\t// convert suits to 10\n\t\t\tif (card.getValue() > 10) {\n\t\t\t\tvalue += 10;\n\t\t\t} else if (card.getValue() == 1) {\n\t\t\t\taces++;\n\t\t\t} else {\n\t\t\t\tvalue += card.getValue();\n\t\t\t}\n\t\t}\n\t\tvalue += calculateAce(value, aces);\n\n\t\treturn value;\n\t}", "public int getNumber(){\n return cardNumber;\n }", "public String get(){\n\t\tString s = value%13+1+\"\"+suits[value/13]+\" \";\r\n\t\treturn s;\r\n\t}", "public int highCardVal()\n\t{\n\t\tint value = 0;\n\t\t\n\t\tfor (int i=0; i<MAX_CARDS; i++)\n\t\t\tvalue += hand[i].getValue();\n\t\t\n\t\treturn value;\n\t}", "public double getCardNumber() {\n\t\treturn cardNumber;\n\t}", "public String GetDeckCard(int value){\n return deck.get(value);\n }", "public String GetComputerCard(int value){\n return handComputer.get(value);\n }", "private static final int getNumericValue(final Card card) throws Exception\r\n {\r\n switch (card.getValue())\r\n {\r\n case Two:\r\n return 2;\r\n \r\n case Three:\r\n return 3;\r\n \r\n case Four:\r\n return 4;\r\n \r\n case Five:\r\n return 5;\r\n \r\n case Six:\r\n return 6;\r\n \r\n case Seven:\r\n return 7;\r\n \r\n case Eight:\r\n return 8;\r\n \r\n case Nine:\r\n return 9;\r\n \r\n case Ten:\r\n return 10;\r\n \r\n case Jack:\r\n return 11;\r\n \r\n case Queen:\r\n return 12;\r\n \r\n case King:\r\n return 13;\r\n \r\n case Ace:\r\n return 14;\r\n \r\n default:\r\n throw new Exception(\"Face value not handled here \" + card.getValue().toString());\r\n }\r\n }", "int getMoneyValue();", "int getMoneyValue();", "public int getCardNumber() {\n return cardNumber;\n }", "public String m50420r() {\n try {\n return this.f30729a0.getCardNumber();\n } catch (Exception unused) {\n return this.f30729a0.getText().toString().trim();\n }\n }", "private static int valueAsInt(Card card) {\n String values = new String(Card.validCardValues);\n return values.indexOf(card.getValue());\n }", "public String getCardNo() {\n return cardNo;\n }", "public java.lang.String getCardNo() {\r\n return localCardNo;\r\n }", "public java.lang.String getCardNo() {\r\n return localCardNo;\r\n }", "public int handValue() {\n\t\tint val = 0;\n\t\tfor(Card card: hand) {\n\t\t\tval += card.getValue();\n\t\t}\n\t\tif(val > 21) {\n\t\t\tif(checkOverflow()) {\n\t\t\t\treturn val - 10;\n\t\t\t}\n\t\t\treturn val;\n\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn val;\n\t}", "public int getHighCard() {\r\n return highCard;\r\n }", "public int getValue(){\n return number;\n }", "public int handValue() {\n int handValue = 0;\n for (Card card : cards) {\n switch (((BlackjackCard)card).getRank()) {\n case TWO:\n handValue += 2;\n break;\n case THREE:\n handValue += 3;\n break;\n case FOUR:\n handValue += 4;\n break;\n case FIVE:\n handValue += 5;\n break;\n case SIX:\n handValue += 6;\n break;\n case SEVEN:\n handValue += 7;\n break;\n case EIGHT:\n handValue += 8;\n break;\n case NINE:\n handValue += 9;\n break;\n case TEN:\n handValue += 10;\n break;\n case JACK:\n handValue += 10;\n break;\n case QUEEN:\n handValue += 10;\n break;\n case KING:\n handValue += 10;\n break;\n }\n }\n\n for (int i = 0; i < aceCount; i++) {\n if (handValue < 11) {\n handValue += 11;\n } else {\n handValue += 1;\n }\n }\n\n return handValue;\n }", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "public int getValue();", "public int getValue();", "public String getCardNumber()\r\n {\r\n return cardNumber;\r\n }", "int compareValue(Card c);", "private static final Card.Value getNextValue(final Card card) throws Exception\r\n {\r\n switch (card.getValue())\r\n {\r\n case Two:\r\n return Value.Three;\r\n \r\n case Three:\r\n return Value.Four;\r\n \r\n case Four:\r\n return Value.Five;\r\n \r\n case Five:\r\n return Value.Six;\r\n \r\n case Six:\r\n return Value.Seven;\r\n \r\n case Seven:\r\n return Value.Eight;\r\n \r\n case Eight:\r\n return Value.Nine;\r\n \r\n case Nine:\r\n return Value.Ten;\r\n \r\n case Ten:\r\n return Value.Jack;\r\n \r\n case Jack:\r\n return Value.Queen;\r\n \r\n case Queen:\r\n return Value.King;\r\n \r\n case King:\r\n return Value.Ace;\r\n \r\n case Ace:\r\n return null;\r\n \r\n default:\r\n throw new Exception(\"Face value not handled here \" + card.getValue().toString());\r\n }\r\n }", "public static int suit(int card){\n //check if card is out of bounds\n if(card < 1 || card > 52){\n return 0;\n }\n //subtract 1 from card to include multiples of 13\n //add 1 so that it matches up with the desired output\n return (card - 1) / 13 + 1;\n }", "private String number() {\n switch (this.value) {\n case 1:\n return \"A\";\n case 11:\n return \"J\";\n case 12:\n return \"Q\";\n case 13:\n return \"K\";\n default:\n return Integer.toString(getValue());\n }\n }", "public Integer getRoomcard() {\n return roomcard;\n }", "public String getCardNumber()\n {\n return cardNumber;\n }", "int GetCardValueOfBuild() {\n return cardValueOfBuild;\n }", "public void cardGen(){\n\t\tRandom rand = new Random();\n\t\tint randValue = rand.nextInt(13);\n\t\tcardString = value[randValue] + suit[rand.nextInt(4)];\n\t}", "static Card generateRandomCard()\n {\n Card.Suit suit;\n char val;\n\n int suitSelector, valSelector;\n\n // get random suit and value\n suitSelector = (int) (Math.random() * 4);\n valSelector = (int) (Math.random() * 14);\n\n // pick suit\n suit = Card.Suit.values()[suitSelector];\n\n // pick value\n valSelector++; // put in range 1-14\n switch(valSelector)\n {\n case 1:\n val = 'A';\n break;\n case 10:\n val = 'T';\n break;\n case 11:\n val = 'J';\n break;\n case 12:\n val = 'Q';\n break;\n case 13:\n val = 'K';\n break;\n case 14:\n val = 'X';\n break;\n default:\n val = (char)('0' + valSelector); // simple way to turn n into 'n' \n }\n return new Card(val, suit);\n }", "Integer getValue();", "Integer getValue();", "public String getCardNo() {\n\t\treturn cardNo;\n\t}", "public String GetHumanCard(int value){\n return handHuman.get(value);\n }", "public String displayCard()\n {\n card = \"\";\n \n switch(cardValue)\n {\n case 11:\n card+= \"J\";\n break;\n case 12:\n card+= \"Q\";\n break;\n case 13:\n card+= \"K\";\n break;\n case 14:\n card+= \"A\";\n break; \n default:\n card+= String.valueOf(cardValue); \n break;\n }\n \n switch(cardSuit){\n case 0:\n card+= \" of Clubs\";\n break;\n case 1:\n card+= \" of Diamonds\";\n break;\n case 2:\n card+= \" of Spades\";\n break;\n case 3:\n card+= \" of Hearts\";\n break;\n default:\n break;\n }\n \n return card;\n }", "int getFromValue();", "public int getJackpot(){ return amount; }", "Money getItemValue();", "public java.math.BigDecimal getCardMoney() {\r\n return localCardMoney;\r\n }", "public String toString(){\n String card = null; \n //clubs\n if(suit==1){\n \tcard = \"c\" + Integer.toString(value);\n }\n //diamonds\n if(suit==2){\n \tcard = \"d\" + Integer.toString(value);\n }\n //hearts\n if(suit==3){\n \tcard = \"h\" + Integer.toString(value);\n }\n //spades\n if(suit==4){\n \tcard = \"s\" + Integer.toString(value);\n }\n return card; \n\t}", "private int nobValue() {\n int numberOfCards= cards.length;\n int nValue = 0;\n \n for (int i = 0; i < numberOfCards - 1; i++) {\n char cardRank = cards[i].charAt(0);\n char cardSuit = cards[i].charAt(1);\n char startSuit = cards[numberOfCards - 1].charAt(1);\n \n if (cardRank=='J'&&cardSuit == startSuit) {\n nValue += 1;\n }\n } \n return nValue;\n }", "public int getValue () {\n return value;\n }", "public String getCardNumber() {\n return this.account;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public String getCardNumber() {\n return cardNumber;\n }", "public int getValue()\n {\n return value;\n }", "public int getValue(){\n return value;\n }", "public static double getCardCounter() {\n\t\treturn cardCounter;\n\t}", "public int getJack() {\n return this.JackMoney;\n }", "public int getValue()\r\n {\r\n return value;\r\n }", "static int getCardPointValue(Card card) {\n if (card.errorFlag)\n return -1;\n String values = new String(Card.validCardValues);\n return cardPointValues[values.indexOf(card.getValue())];\n }", "public int getValue() \n {\n return value;\n }", "public int getValue() \n {\n return value;\n }", "public String getCvvNumber();", "public void setAceValue()\n {\n Scanner scanner = new Scanner(System.in); // Create a Scanner object\n System.out.print(\"Do you want the value of the Ace cards to be 1 or 11? \");\n aceValue = scanner.nextInt(); // Read user input\n }", "public char getValue() {\n return value;\n }", "public int getValue() {\r\n return value;\r\n }", "public int getValue() {\n return value_;\n }", "public int CardsOnDeck()\n\t{\n\t\treturn cardNumber;\n\t}", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "private static int suitAsInt(Card card) {\n return card.getSuit().ordinal();\n }", "public int getValue() {\r\n return value;\r\n }", "public char getValue()\n\t{\n\t\treturn value;\n\t}" ]
[ "0.8043214", "0.7811249", "0.7739293", "0.7366592", "0.7304593", "0.72570676", "0.71784556", "0.6992145", "0.6774263", "0.6698647", "0.66808", "0.6655587", "0.65983325", "0.6524373", "0.65098095", "0.64711666", "0.6452075", "0.6439822", "0.64188236", "0.6417608", "0.62601495", "0.62601495", "0.62578434", "0.6255265", "0.6224202", "0.6223919", "0.62126404", "0.62126404", "0.61553866", "0.6149631", "0.61353534", "0.61330783", "0.6127113", "0.6127113", "0.6127113", "0.6127113", "0.6127113", "0.6085409", "0.6085409", "0.6063934", "0.60599715", "0.6052533", "0.6045152", "0.6031658", "0.6018815", "0.6005478", "0.60039383", "0.60021335", "0.59849536", "0.59741974", "0.59741974", "0.59633195", "0.59583074", "0.59577924", "0.5951441", "0.5950763", "0.5939284", "0.5927762", "0.5914231", "0.5908665", "0.5907278", "0.5891178", "0.58837783", "0.58837783", "0.58837783", "0.58837783", "0.58837783", "0.58837783", "0.5880988", "0.5871451", "0.5866895", "0.5865068", "0.5857378", "0.58487946", "0.58421373", "0.58406276", "0.5839797", "0.58374256", "0.5817627", "0.58045745", "0.5801345", "0.5799784", "0.57977605", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785557", "0.5785379", "0.5779566", "0.5778995" ]
0.0
-1
Shows enumeration value in lower case with first letter capitalized
@Override public String toString() { String strSuit = suit.toString().substring(0, 1); strSuit += suit.toString().toLowerCase() .substring(1, suit.toString().length()); return strSuit + value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String out_name(Enum<?> e) {\n return e.name().toLowerCase();\n }", "public static String formatEnumName(String name) {\n String[] words = name.replace('_', ' ').split(\"\\\\s\");\n StringBuilder formatted = new StringBuilder(name.length());\n for (String word : words) {\n formatted.append(word.substring(0, 1).toUpperCase());\n formatted.append(word.substring(1).toLowerCase());\n formatted.append(' ');\n }\n return formatted.toString().trim();\n }", "public String toString() {return name().charAt(0) + name().substring(1).toLowerCase();}", "public ICase retourneLaCase() ;", "public static String enumPatternItemCase()\n {\n read_if_needed_();\n \n return _enum_pattern_item_case;\n }", "public String convertEnum()\n {\n \tswitch (pattern.ordinal())\n \t{\n \tcase 0:\n \t\treturn \"Red Cards\";\n \tcase 1:\n \t\treturn \"Black Cards\";\n \tcase 2:\n \t\treturn \"Hearts\";\n \tcase 3:\n \t\treturn \"Diamonds\";\n \tcase 4:\n \t\treturn \"Clubs\";\n \tcase 5:\n \t\treturn \"Spades\";\n \tcase 6:\n \t\treturn \"Twos\";\n \tcase 7:\n \t\treturn \"Threes\";\n \tcase 8:\n \t\treturn \"Fours\";\n \tcase 9:\n \t\treturn \"Fives\";\n \tcase 10:\n \t\treturn \"Sixes\";\n \tcase 11:\n \t\treturn \"Sevens\";\n \tcase 12:\n \t\treturn \"Eights\";\n \tcase 13:\n \t\treturn \"Nines\";\n \tcase 14:\n \t\treturn \"Tens\";\n \tcase 15:\n \t\treturn \"Jacks\";\n \tcase 16:\n \t\treturn \"Queens\";\n \tcase 17:\n \t\treturn \"Kings\";\n \tcase 18:\n \t\treturn \"Aces\";\n \tcase 19:\n \t\treturn \"Single Digit Primes\";\n \tcase 20:\n \t\treturn \"Pairs\";\n \tcase 21:\n \t\treturn \"Sum of Pairs\";\n \tcase 22:\n \t\treturn \"Incrementing Cards\";\n \tcase 23:\n \t\treturn \"Decrementing Cards\";\n \tdefault:\n \t\treturn \"\";\n \t}\n }", "private void useCapitalLettersFromType(String type, StringBuffer buffer) {\r\n for (int ndx = 0; ndx < type.length(); ndx++) {\r\n char ch = type.charAt(ndx);\r\n if (Character.isUpperCase(ch)) {\r\n buffer.append(Character.toLowerCase(ch));\r\n }\r\n }\r\n }", "public void firstToUpperCase() {\n \n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.NullableBoolean.Enum getCapitalInKind();", "public String asString() {\n\t\t\tString enumName;\n\t\t\tswitch(this) {\n\t\t\tcase INDEX:\n\t\t\t\tenumName = \"index\";\n\t\t\t\tbreak;\n\t\t\tcase NAME:\n\t\t\t\tenumName = \"name\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tenumName = \"unsupported\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn enumName;\n\t\t}", "Caseless getName();", "public XMLString toUpperCase() {\n/* 746 */ return new XMLStringDefault(this.m_str.toUpperCase());\n/* */ }", "public String getCapital() {\n return capital;\n }", "public String asName() {\n return this.name().toLowerCase(Locale.getDefault());\n }", "public static String A(BaseObject obj)\n\t{\t\t\n\t\tString aStr = Format.a(obj);\n\t\treturn aStr.substring(0, 1).toUpperCase();\n\t}", "public void print() {\n toLower();\n }", "@Override\r\n\tpublic String displayElementName(String elementName) {\r\n\t\tString[] words = StringUtils.split(elementName, \"-\");\r\n\t\tList<String> capitalized = new ArrayList<String>();\r\n\t\tfor (String word : words) {\r\n\t\t\tcapitalized.add(StringUtils.capitalize(word));\r\n\t\t}\r\n\t\treturn StringUtils.join(capitalized, \" \");\r\n\t}", "private void switchToUpperCase() {\n for (int i = 0; i < mLetterButtons.length; i++) {\n mLetterButtons[i].setText((mQWERTYWithDot.charAt(i) + \"\").toUpperCase());\n }\n mIsShiftPressed = true;\n\n }", "public static void printUpperCase()\n {\n for(char i = 'A'; i <= 'Z'; i++){\n System.out.print(i + \" \");\n }\n System.out.println();\n }", "public static String enumToCounter(Enum e) {\n\t\treturn e.name();\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 {\n return name.toUpperCase();\n }", "private void switchToLowerCase() {\n for (int i = 0; i < mLetterButtons.length; i++) {\n mLetterButtons[i].setText((mQWERTYWithDot.charAt(i) + \"\").toLowerCase());\n }\n mIsShiftPressed = false;\n }", "public int getCapital() {\n\n return capital;\n }", "default String getTypeName() {\n JdlFieldEnum type = getType();\n return switch (type) {\n case ENUM -> getEnumEntityName()\n .orElseThrow(() -> new IllegalStateException(\"An enum field must have its enum entity name set\"));\n default -> ((\"UUID\".equals(type.name())) ? type.name() : type.toCamelUpper());\n };\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn abbrv;\r\n\t}", "String getAbbr();", "public String getName() {\n return Util.uncapitalize(getCapName());\n }", "public String getEnum() {\n if (model == null)\n return strEnum;\n return model.getEnum();\n }", "public static ActionNameEnum getByLowerValue(String lowerValue) {\n for(ActionNameEnum value : values()) {\n if (value.lowerValue.equals(lowerValue)) {\n return value;\n }\n }\n return UNKNOWN;\n }", "public void setName(String value)\r\n\t{\r\n\r\n\t\tput(HtmlEnum.name.getAttributeName(), value);\r\n\t}", "public String acronym(String phrase) {\n String accrStr = phrase.replaceAll(\"\\\\B.|\\\\P{L}\", \"\").toUpperCase();\n return accrStr;\n }", "public String constant() {\n\t\tString tmp = methodBase().replaceAll(\"([a-z])([A-Z])\",\"$1_$2\");\n\t\treturn tmp.toUpperCase();\n\t}", "public static void printLowerCase()\n {\n for(char i = 'a'; i <= 'z'; i++){\n System.out.print(i + \" \");\n }\n System.out.println();\n }", "@Override\r\n public String toString() {\r\n String prettyName = this.name();\r\n prettyName = prettyName.toLowerCase();\r\n prettyName = Utils.capitalizeFirstLetter(prettyName);\r\n \r\n return prettyName;\r\n }", "public String toString() {\n return _iotaEnum + \" - \" + _value ;\n }", "public static String A(String str)\n\t{\t\t\n\t\tString aStr = Format.a(str);\n\t\treturn aStr.substring(0, 1).toUpperCase();\n\t}", "protected String alterCase(String value) {\n\t\tswitch (getCase()) {\n\t\tcase UPPERCASE:\n\t\t\treturn value.toUpperCase();\n\t\tcase LOWERCASE:\n\t\t\treturn value.toLowerCase();\n\t\tdefault:\n\t\t\treturn value;\n\t\t}\n\t}", "public static String getFieldUpperCase(String name) {\r\n\t\tString aux = name.substring(0, 1);\r\n\t\tString mayus = aux.toUpperCase()+name.substring(1);\r\n\t\treturn mayus;\r\n\t}", "@Override\n public String toString(){\n return super.toString().substring(0,1) + super.toString().substring(1).toLowerCase();\n }", "public boolean isCapital() {\n return getType().isCapital();\n }", "private void toLower() {\n System.out.print(\"ToLower(\");\n text.print();\n System.out.print(\")\");\n }", "public void showNAME() {\r\n\t\tSystem.out.println(getName().toUpperCase());\r\n\t}", "public String getCapName() {\n StringBuilder result = new StringBuilder();\n for (String s : getNameParts()) {\n result.append(Util.capitalize(s));\n }\n return result.toString();\n }", "private static String capName(String name) { return name.substring(0, 1).toUpperCase() + name.substring(1); }", "protected String getEnumeration()\n {\n return enumeration;\n }", "public String getLowerCaseName() {\n\t\treturn getName().toLowerCase();\n\t}", "public String code_to_name (char code) {\n if (code == STOP_CODE) {\r\n return \"Stop\";\r\n } else {\r\n return (String) code_to_name.get((new Character(code)).toString().toUpperCase());\r\n }\r\n }", "public static void set_EnumPatternItemCase(String v) throws RuntimeException\n {\n UmlCom.send_cmd(CmdFamily.javaSettingsCmd, JavaSettingsCmd._setJavaEnumPatternItemCaseCmd, v);\n UmlCom.check();\n \n _enum_pattern_item_case = v;\n \n }", "public String toString(){\n\t\treturn super.toString().toLowerCase();\n\t}", "public String getAcronym();", "private String capital() {\r\n\t\tString out=\"Companies Capital: \\n\\n\";\r\n\t\tint[] temp= tile.getCompanyCapital();\r\n\t\tint square=(int)Math.sqrt(temp.length);\r\n\t\tif(square*square<temp.length) {\r\n\t\t\tsquare++;\r\n\t\t}\r\n\t\tfor(int i=0; i<temp.length;) {\r\n\t\t\tfor(int j=0; j<square; j++) {\r\n\t\t\t\tif(i<temp.length) {\r\n\t\t\t\t\tout=out.concat(String.format(\"%4s\", temp[i]));\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tj=square;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tout=out.concat(\"\\n\");\r\n\t\t}\r\n\t\tout=out.concat(\"\\n\\nAgent Capital: \\n\\n\");\r\n\t\ttemp=tile.getAgentCapital();\r\n\t\tsquare=(int)Math.sqrt(temp.length);\r\n\t\tif(square*square<temp.length) {\r\n\t\t\tsquare++;\r\n\t\t}\r\n\t\tfor(int i=0; i<temp.length;i++) {\r\n\t\t\tfor(int j=0; j<square; j++) {\r\n\t\t\t\tif(i<temp.length) {\r\n\t\t\t\t\tout=out.concat(String.format(\"%4s\", temp[i]));\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tj=square;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tout=out.concat(\"\\n\");\r\n\t\t}\r\n\t\treturn out;\r\n\t}", "public String getCaseName() {\n\t\tStackTraceElement stack[] = (new Throwable()).getStackTrace();\n\t\tint i = stack[1].toString().indexOf(\"(\");\n\t\tString tempStr1 = stack[1].toString().substring(0, i);\n\t\treturn tempStr1.trim();\n\t}", "public String getName() {\n return this.name().toLowerCase(Locale.US);\n }", "public XMLString toUpperCase(Locale locale) {\n/* 715 */ return new XMLStringDefault(this.m_str.toUpperCase(locale));\n/* */ }", "int getUpper();", "@AutoEscape\n public String getStatusName();", "private static String getCamelCasedPropertyName(String propertyName) {\n return propertyName.substring(0, 1).toUpperCase() +\n propertyName.substring(1);\n }", "public String getLowercaseFunction() {\n \t\treturn \"lower\";\n \t}", "public String getElement()\n {\n return \"enum\";\n }", "int upper();", "public void testEnumUsingToString() throws Exception\n {\n assertEquals(\"\\\"c2\\\"\", MAPPER.writeValueAsString(AnnotatedTestEnum.C2));\n }", "public static void switchTest(Enum obj) {\n String className = obj.getClass().getSimpleName();\n //int key = obj.ordinal();\n String res=\"undefined\";\n switch (className) {\n case \"E1\":\n try {\n res=\"it's \"+className+\".\"+((E1)obj).name();\n } catch (Exception e) {\n }\n break;\n case \"E2\":\n try {\n res=\"it's \"+className+\".\"+((E2)obj).name();\n } catch (Exception e) {\n\n }\n break;\n default:\n// try {\n// res=\"It's \"+className+\".\"+((E3)obj).name();\n// } catch (Exception e) {\n//\n// }\n res=\"undefined\";\n } // sw\n System.out.println(res);\n }", "void unsetCapital();", "@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 convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "public String getName() {\n\t\treturn name.toLowerCase();\n\t}", "public static String valueOfOrDefault(String myValue) {\n\t\t String value=myValue.toUpperCase().replaceAll(\"\\\\s\", \"_\");\r\n\t\t for(RegioneItaliana type : RegioneItaliana.class.getEnumConstants()) {\r\n\t\t if(type.name().equalsIgnoreCase(value)) {\r\n\t\t return type.toString();\r\n\t\t }\r\n\t\t }\r\n\t\t return myValue;\r\n\t\t }", "public String getLocalizedName() {\n\t\treturn this.name().toUpperCase();\n\t}", "public java.lang.String getEnumSkillName()\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(ENUMSKILLNAME$8);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String as(NamingConvention convention) {\n switch (convention) {\n case FLAT:\n return flatCase();\n case CAMEL:\n return camelCase();\n case DONER:\n return donerCase();\n case KEBAB:\n return kebabCase();\n case SNAKE:\n return snakeCase();\n case TRAIN:\n return trainCase();\n case PASCAL:\n return pascalCase();\n case UPPER_FLAT:\n return upperFlatCase();\n case CAMEL_SNAKE:\n return camelSnakeCase();\n case PASCAL_SNAKE:\n return pascalSnakeCase();\n case SCREAMING_KEBAB:\n return screamingKebabCase();\n case SCREAMING_SNAKE:\n return screamingSnakeCase();\n default:\n throw new IllegalArgumentException(\n \"The naming convention '\"\n + convention\n + \"', you requested, is currently not supported.\");\n }\n }", "void unsetCapitalInKind();", "public char intToLetter(int val){\n\t\t\t// val is assumed to be an integer < MAXUINT so its unsigned value is the same\n\t\t\t// as the signed representation so we don't need to do any conversion.\n\t\t\treturn ALPHABET[val];\n\t\t}", "private String upperCaseFL(String in) {\n\t\treturn in.substring(0,1).toUpperCase() + in.substring(1,in.length());\n\t}", "public static void upperCaseFirst() {\n\t\tString isExit = \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tString str = bf.toString();\n\t\t\t// str=String.valueOf(str.charAt(0)).toUpperCase()+str.substring(1,\n\t\t\t// str.length());\n\t\t\tSystem.out.println(\"Chuỗi có chữ đầu viết hoa:\\n\"\n\t\t\t\t\t+ String.valueOf(str.charAt(0)).toUpperCase()\n\t\t\t\t\t+ str.substring(1, str.length()));\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit = scan.next().toString();\n\t\t}\n\t}", "String nameLabel();", "public BigDecimal getCAPITAL_AMT() {\r\n return CAPITAL_AMT;\r\n }", "public org.apache.xmlbeans.XmlString xgetEnumSkillName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ENUMSKILLNAME$8);\n return target;\n }\n }", "public void remCamelCaseName(){\n ((MvwDefinitionDMO) core).remCamelCaseName();\n }", "public String getLabel() {\n return name().toLowerCase().replace(\"_\", \"\");\n }", "private String upFirstLetter(){\n\t\tString firstLetter = nameField.substring(0,1);\n\t\tfirstLetter = firstLetter.toUpperCase();\n\t\treturn firstLetter + nameField.substring(1,nameField.length());\n\t}", "private String name() {\n return Strings.concat(Token.DOLLAR, name.string());\n }", "public static void main(String arg[])\r\n\t {\n\t \r\n\t color ob=color.RED;\r\n\t \r\n\t // System.out.println(\"An Enumeration Object:\"+ob);\r\n\t \r\n\t System.out.println(\"Enumeration Objects Ordinal Values:\"+ob.ordinal());\r\n\t }", "public BigDecimal getCAPITALIZE_IN_OUT_AMT() {\r\n return CAPITALIZE_IN_OUT_AMT;\r\n }", "public Capital() {\n\t\tthis.nation = \"korea\";\n\t\tthis.capital = \"seoul\";\n\t}", "public String getUc() {\n return uc;\n }", "public static void printUpperCase() {\n\t\tString isExit= \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tStringBuffer result = new StringBuffer();\n\t\t\tString str = bf.toString();\n\t\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\t\tif (Character.isUpperCase(str.charAt(i))) {\n\t\t\t\t\tresult.append(String.valueOf(str.charAt(i)));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"Chuỗi chữ hoa: \" + result);\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit = scan.next().toString();\n\t\t}\n\t}", "public String test(String x){\r\n\t\treturn x.toUpperCase();\r\n\t}", "public void display() {\n\t\tSystem.out.println(state+\" and its' capital is \"+capital);\n\t}", "private static String capitalize (String input) {\n\n String output = WordUtils.capitalize(input.toLowerCase());\n\n return output;\n }", "public String calculateEnumerationLiteralAsString(Object value,IAttribute attribute)\r\n\t{\r\n\t\tString valueString = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (value == null) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tif (!(value instanceof Identifier<?>)) {\r\n\t\t\t\treturn \"Value not an enumeration literal\";\r\n\t\t\t}\r\n\t\t\tIEnumeration<? extends ILiteral> enumeration = itemCommon.resolveEnumeration(attribute, monitor);\r\n\t\t\tIdentifier<? extends ILiteral> currentIdentifier = (Identifier<? extends ILiteral>) value;\r\n\t\t\tILiteral literal = enumeration.findEnumerationLiteral(currentIdentifier);\r\n\t\t\tvalueString = literal.getName();\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn valueString;\r\n\t}", "public XMLString toLowerCase() {\n/* 702 */ return new XMLStringDefault(this.m_str.toLowerCase());\n/* */ }", "boolean isSetCapitalInKind();", "public void setCamelCaseName(CamelCaseName value){\n ((MvwDefinitionDMO) core).setCamelCaseName(value);\n }", "public String toUpperCase(String in)\n {\n return in;\n }", "boolean isSetCapital();", "public static StatutCivilEnum randomLetter() {\n return VALUES.get(RANDOM.nextInt(SIZE));\n }", "@Override\r\n\tpublic String doSome() {\n\t\treturn super.doSome().toUpperCase();\r\n\t}", "public String getStatusName(int mCode)\r\n\t {\r\n\t\t return MRs[mCode].getStatusName();\r\n\t }", "String getShortName();", "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 }" ]
[ "0.74256194", "0.6678963", "0.65261835", "0.6484679", "0.6289981", "0.62747943", "0.6255845", "0.6238478", "0.62372345", "0.62230396", "0.61936074", "0.6182525", "0.61672753", "0.6095422", "0.6092653", "0.6045336", "0.60422707", "0.6037866", "0.6019482", "0.5993813", "0.59804565", "0.5978442", "0.5957009", "0.5955838", "0.5952317", "0.59377337", "0.5934706", "0.5931798", "0.5917706", "0.58870286", "0.5877794", "0.5863126", "0.5862208", "0.5852629", "0.58446383", "0.58204734", "0.5818911", "0.5812428", "0.58106923", "0.581061", "0.57991743", "0.5778395", "0.5776809", "0.5768317", "0.5754503", "0.5750176", "0.5744646", "0.5742876", "0.5710031", "0.5692798", "0.56702393", "0.5664018", "0.5659864", "0.5658075", "0.56470597", "0.56462187", "0.56297785", "0.5622712", "0.55903137", "0.556372", "0.5562173", "0.5547761", "0.5526424", "0.5525084", "0.5515818", "0.55029494", "0.54973227", "0.54935235", "0.5482158", "0.5478786", "0.5476785", "0.5476073", "0.54726017", "0.5471566", "0.54508823", "0.54487073", "0.5446513", "0.5445627", "0.54380846", "0.5432167", "0.5425139", "0.54109114", "0.538823", "0.53863543", "0.5375659", "0.5365796", "0.5363031", "0.5362061", "0.53559273", "0.5354538", "0.5339507", "0.53360444", "0.532935", "0.53287035", "0.5328352", "0.53282535", "0.5321319", "0.5321258", "0.5320233", "0.5308002", "0.53060216" ]
0.0
-1
Creates an instance of AzureStorageContainer class.
public AzureStorageContainer() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static CloudBlobContainer getContainer() throws Exception {\n\r\n CloudStorageAccount storageAccount = CloudStorageAccount\r\n .parse(storageConnectionString);\r\n\r\n // Create the blob client.\r\n CloudBlobClient blobClient = storageAccount.createCloudBlobClient();\r\n\r\n // Get a reference to a container.\r\n // The container name must be lower case\r\n CloudBlobContainer container = blobClient.getContainerReference(CONTAINER_NAME.toLowerCase());\r\n\r\n return container;\r\n }", "private static CloudBlobContainer getContainer() throws Exception {\n\n CloudStorageAccount storageAccount = CloudStorageAccount.parse(storageConnectionString);\n\n // Create the blob client.\n CloudBlobClient blobClient = storageAccount.createCloudBlobClient();\n // Get a reference to a container.\n // The container name must be lower case\n CloudBlobContainer container = blobClient.getContainerReference(\"sparshdevmobileapp\");\n\n return container;\n }", "T createContainer();", "Container createContainer();", "public StorageConfiguration() {\n }", "public Storage() {\n\n }", "public Container newContainer();", "public StorageConfig() {\n }", "private StorageFacade() {\n }", "public DefaultStorage() {\n }", "public StorageResource() {\n }", "public com.google.longrunning.Operation createAzureClient(\n com.google.cloud.gkemulticloud.v1.CreateAzureClientRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateAzureClientMethod(), getCallOptions(), request);\n }", "public AWSStorageGatewayClient() {\n this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());\n }", "public BlobStorageTokenStore azureBlobStorage() {\n return this.azureBlobStorage;\n }", "public EventProcessorHost(\n final String hostName,\n final String eventHubPath,\n final String consumerGroupName,\n final String eventHubConnectionString,\n final String storageConnectionString,\n final String storageContainerName,\n final String storageBlobPrefix,\n final ScheduledExecutorService executorService) {\n // Would like to check storageConnectionString and storageContainerName here but can't, because Java doesn't allow statements before\n // calling another constructor. storageBlobPrefix is allowed to be null or empty, doesn't need checking.\n this(hostName, eventHubPath, consumerGroupName, eventHubConnectionString,\n new AzureStorageCheckpointLeaseManager(storageConnectionString, storageContainerName, storageBlobPrefix), executorService);\n this.initializeLeaseManager = true;\n this.partitionManagerOptions = new AzureStoragePartitionManagerOptions();\n }", "public abstract FlowNodeStorage instantiateStorage(MockFlowExecution exec, File storageDirectory);", "public AzureInputDataHandler(URI endpoint, String accountName, String accountKey, String containerName) {\n try {\n StorageCredentials storageCredentials = new StorageCredentialsAccountAndKey(accountName, accountKey);\n CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(storageCredentials, endpoint, null, null, null);\n CloudBlobClient cloudBlobClient = cloudStorageAccount.createCloudBlobClient();\n int serverTimeout = cloudBlobClient.getDefaultRequestOptions().getTimeoutIntervalInMs();\n cloudBlobClient.getDefaultRequestOptions().setTimeoutIntervalInMs(10 * 1000);\n _container = cloudBlobClient.getContainerReference(containerName);\n _container.createIfNotExists();\n cloudBlobClient.getDefaultRequestOptions().setTimeoutIntervalInMs(serverTimeout);\n } catch (StorageException e) {\n throw new GroupDocsException(\"Unable to recognize that Account Name/Account Key or container name is invalid.\" + e.getMessage());\n } catch (URISyntaxException e) {\n throw new GroupDocsException(\"Unable to recognize that Account Name/Account Key.\" + e.getMessage());\n }\n }", "public Storage() {\n this(null, DEFAULT_MAX, DEFAULT_MAX_SIZE);\n }", "public Storage(int storageSize) {\n\t\tstorageSpace = new Block[storageSize];\n\t}", "public static void main(String[] args) {\n\n /*\n * From the Azure portal, get your Storage account's name and account key.\n */\n String accountName = SampleHelper.getAccountName();\n String accountKey = SampleHelper.getAccountKey();\n\n /*\n * Use your Storage account's name and key to create a credential object; this is used to access your account.\n */\n StorageSharedKeyCredential credential = new StorageSharedKeyCredential(accountName, accountKey);\n\n /*\n * From the Azure portal, get your Storage account blob service URL endpoint.\n * The URL typically looks like this:\n */\n String endpoint = String.format(Locale.ROOT, \"https://%s.blob.core.windows.net\", accountName);\n\n /*\n * Create a BlobServiceClient object that wraps the service endpoint, credential, policy with service level\n * timeout per call.\n * For this example, we'll set the service timeout to 3 seconds.\n */\n BlobServiceClient storageClient = new BlobServiceClientBuilder()\n .endpoint(endpoint)\n .credential(credential)\n .addPolicy(new ServiceTimeoutPolicy(Duration.ofSeconds(3)))\n .buildClient();\n\n BlobContainerClient blobContainerClient = storageClient.getBlobContainerClient(\"myjavacontainerbasic\" + System.currentTimeMillis());\n\n /*\n * First create the container with the specified timeout. Since create operations are fast, timeout should not\n * exceed the 3 seconds specified above.\n */\n try {\n blobContainerClient.createIfNotExistsWithResponse(new BlobContainerCreateOptions(), null, Context.NONE);\n System.out.println(\"Created\");\n } catch (Exception ex) {\n System.out.println(\"Creation failed due to timeout: \" + ex.getMessage());\n }\n\n BlobClient blobClient = blobContainerClient.getBlobClient(\"myblob\" + System.currentTimeMillis());\n\n //Create a dataset that is guaranteed to take longer than the specified timeout of 3 seconds\n byte[] randomData = getRandomByteArray(16 * Constants.MB);\n InputStream input = new ByteArrayInputStream(randomData);\n ParallelTransferOptions pto = new ParallelTransferOptions().setMaxSingleUploadSizeLong((long) Constants.MB);\n\n /*\n * making the call to upload will fail since we are using a large dataset which will take longer than the\n * specified timeout.\n */\n try {\n blobClient.uploadWithResponse(new BlobParallelUploadOptions(input).setParallelTransferOptions(pto), null, null);\n System.out.println(\"Upload succeeded.\");\n } catch (Exception ex) {\n System.out.println(\"Creation failed due to timeout: \" + ex.getMessage());\n }\n }", "public StorageManager() {\n makeDirectory();\n }", "public StorageManagerImpl()\n {\n if (log.isDebugEnabled())\n {\n log.debug(\"Creating Instance of StorageManagerImpl\");\n }\n storageProxyHolder = new Hashtable();\n\n try\n {\n initializeStorageProxies();\n nRegister();\n }\n catch (Throwable throwable)\n {\n if (log.isErrorEnabled())\n {\n log.error(\"Failed to create StorageManager object\", throwable);\n }\n throwable.printStackTrace();\n }\n }", "@Override\n @POST\n @Path(\"/storages\")\n public Response createStorage() throws Exception {\n URI resourceUri = new URI(\"/1\");\n return Response.created(resourceUri).build();\n }", "public TokenStore withAzureBlobStorage(BlobStorageTokenStore azureBlobStorage) {\n this.azureBlobStorage = azureBlobStorage;\n return this;\n }", "public void createAzureClient(\n com.google.cloud.gkemulticloud.v1.CreateAzureClientRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateAzureClientMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "protected Container createContainer() {\n\treturn new EditorContainer();\n }", "public static <T, S extends Storage<T>> S createStorage(Class<? extends S> storageClass, Class<T> storedObjectsClass, Map<String, ?> parameters) throws IllegalArgumentException, ClassNotFoundException {\n try {\n return MethodInstantiator.callFactoryMethod(storageClass, \"create\", false, true, null, storedObjectsClass, (Object)parameters);\n } catch (ClassCastException e) {\n throw new IllegalArgumentException(e.toString());\n } catch (NoSuchInstantiatorException e) {\n throw new IllegalArgumentException(e.toString());\n } catch (InvocationTargetException e) {\n throw new IllegalArgumentException(e.getCause().toString());\n } \n }", "public Storage(Context context) throws StorageException {\r\n sqlExecutor = new SqlExecutor(context);\r\n }", "public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>\n createAzureClient(com.google.cloud.gkemulticloud.v1.CreateAzureClientRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getCreateAzureClientMethod(), getCallOptions()), request);\n }", "public AccountStorage() {\n accounts = new ConcurrentHashMap<>();\n minerMap = new ConcurrentHashMap<>();\n blockMap = new ConcurrentHashMap<>();\n initAccounts();\n logger.info(\"AccountStorage: New AccountStorage created.\");\n }", "private InternalStorage() {}", "public AWSStorageGatewayClient(AWSCredentials awsCredentials) {\n this(awsCredentials, new ClientConfiguration());\n }", "public GenericContainer(T t){\n obj = t;\n }", "@Deprecated\n SqlElasticPoolOperations.DefinitionStages.WithCreate withStorageCapacity(int storageMB);", "default void createAzureClient(\n com.google.cloud.gkemulticloud.v1.CreateAzureClientRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getCreateAzureClientMethod(), responseObserver);\n }", "interface WithStorageCapacity {\n /**\n * Sets the storage limit for the SQL Azure Database Elastic Pool in MB.\n *\n * @param storageMB storage limit for the SQL Azure Database Elastic Pool in MB\n * @return The next stage of the definition.\n */\n @Deprecated\n SqlElasticPoolOperations.DefinitionStages.WithCreate withStorageCapacity(int storageMB);\n }", "Cloud createCloud();", "public AWSStorageGatewayClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {\n super(adjustClientConfiguration(clientConfiguration));\n \n this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials);\n \n init();\n }", "public AzureDataLakeStoreDataset() {\n }", "TestContainer createTestContainer();", "private StorageSystemConfiguration() {\r\n super(IStorageSystemConfiguration.TYPE_ID);\r\n }", "public AWSStorageGatewayClient(ClientConfiguration clientConfiguration) {\n this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);\n }", "public Translation(ResourceContainer container) {\n this.language = container.language;\n this.project = container.project;\n this.resource = container.resource;\n\n resourceContainerSlug = ContainerTools.makeSlug(language.slug, project.slug, resource.slug);\n }", "public MyTrackContainer(){\n\t}", "ViewContainer createViewContainer();", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_storage);\n\n // [START storage_field_initialization]\n FirebaseStorage storage = FirebaseStorage.getInstance();\n // [END storage_field_initialization]\n\n includesForCreateReference();\n }", "public StorageForm() {\n}", "public AWSStorageGatewayClient(AWSCredentialsProvider awsCredentialsProvider) {\n this(awsCredentialsProvider, new ClientConfiguration());\n }", "public interface IStorageManager {\n\n\tpublic String getStorageType();\n\n\tpublic String getStorageId();\n\n\tpublic void initialize(String configFile) throws Exception;\n}", "public InMemoryKeyValueStorage() {\n this(SEGMENT_IDENTIFIER);\n }", "protected StorageProxy createStorageProxy(int nativeStorageHandle, int status)\n {\n return new StorageProxyImpl(nativeStorageHandle, status);\n }", "public StorageInsightInner withContainers(List<String> containers) {\n this.containers = containers;\n return this;\n }", "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}", "@Test\n public void testGenericStorageSerializationAndStorageFunctions() {\n String serializationFilename = \"TestStorage\";\n\n // Creating the GenericStorage which is under test\n GenericStorage<String, TestObject> storage = new GenericStorage\n (serializationFilename);\n\n // Creating the key we'll use to store the object\n String key = \"Hello\";\n\n // Creating a bogus object to see if it is stored and recovered properly\n TestObject testObj = new TestObject(\"HelloThisIsATest\");\n\n\n // Storing the object\n storage.create(key, testObj);\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n // Trying to serialize the object\n storage.saveStorage();\n\n // Resetting the storage to null\n storage = null;\n storage = new GenericStorage(\"TestStorage\");\n\n // The object shouldn't exist anymore in the storage\n assert(!storage.exists(key));\n\n // The storage should be restored with the serialization\n storage.loadStorage();\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n }", "public StorageUnit beStorageUnit();", "public com.google.longrunning.Operation createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateAzureClusterMethod(), getCallOptions(), request);\n }", "private CreateContainerTask(String containerName) {\n\t\t\tthis.containerName = containerName;\n\t\t}", "public Storage(String filePath) {\n this.filePath = filePath;\n this.ui = new Ui();\n }", "public static SqlVirtualMachineManager authenticate(RestClient restClient, String subscriptionId) {\n return new SqlVirtualMachineManager(restClient, subscriptionId);\n }", "public LargeObjectAvro() {}", "public cloudStorage(Context context,String emotionLabel)\n {\n this.context=context;\n this.emotionLabel=emotionLabel;\n }", "private DataRegionConfiguration createMetastoreDataRegionConfig(DataStorageConfiguration storageCfg) {\n DataRegionConfiguration cfg = new DataRegionConfiguration();\n\n cfg.setName(METASTORE_DATA_REGION_NAME);\n cfg.setInitialSize(storageCfg.getSystemRegionInitialSize());\n cfg.setMaxSize(storageCfg.getSystemRegionMaxSize());\n cfg.setPersistenceEnabled(true);\n cfg.setLazyMemoryAllocation(false);\n\n return cfg;\n }", "public AWSStorageGatewayClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {\n this(awsCredentialsProvider, clientConfiguration, null);\n }", "CreateContainerCmd withAuthConfig(AuthConfig authConfig);", "public Storage() {\n\t\tstorageReader = new StorageReader();\n\t\tstorageWriter = new StorageWriter();\n\t\tdirectoryManager = new DirectoryManager();\n\n\t\tFile loadedDirectory = storageReader.loadDirectoryConfigFile(FILENAME_DIRCONFIG);\n\t\tif (loadedDirectory != null) {\n\t\t\tif (directoryManager.createDirectory(loadedDirectory) == true) {\n\t\t\t\tdirectory = loadedDirectory;\n\t\t\t\tSystem.out.println(\"{Storage} Directory loaded | \" + directory.getAbsolutePath());\n\t\t\t} else { //loaded directory was invalid or could not be created\n\t\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t\t}\n\t\t} else { //directory config file was not found\n\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t}\n\t}", "public AuthStorageSession() { \n }", "public static void containerUsage(com.azure.resourcemanager.AzureResourceManager azure) {\n azure\n .containerGroups()\n .manager()\n .serviceClient()\n .getLocations()\n .listUsage(\"westcentralus\", com.azure.core.util.Context.NONE);\n }", "public void createManagedBlobStoreService(String provider) {\n String cmd = \"jclouds:blobstore-service-create --provider \" + provider + \" --identity \" + identity + \" --credential \" + credential;\n executeCommand(cmd);\n }", "public void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "default void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getCreateAzureClusterMethod(), responseObserver);\n }", "public interface EventHubManagementClient {\n /**\n * Gets the REST client.\n *\n * @return the {@link RestClient} object.\n */\n RestClient restClient();\n\n /**\n * The default base URL.\n */\n String DEFAULT_BASE_URL = \"https://management.azure.com\";\n\n /**\n * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call..\n *\n * @return the subscriptionId value.\n */\n String subscriptionId();\n\n /**\n * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call..\n *\n * @param subscriptionId the subscriptionId value.\n * @return the service client itself\n */\n EventHubManagementClient withSubscriptionId(String subscriptionId);\n\n /**\n * Gets Client API Version..\n *\n * @return the apiVersion value.\n */\n String apiVersion();\n\n /**\n * Sets Client API Version..\n *\n * @param apiVersion the apiVersion value.\n * @return the service client itself\n */\n EventHubManagementClient withApiVersion(String apiVersion);\n\n /**\n * Gets the Operations object to access its operations.\n * @return the Operations object.\n */\n Operations operations();\n\n /**\n * Gets the Namespaces object to access its operations.\n * @return the Namespaces object.\n */\n Namespaces namespaces();\n\n /**\n * Gets the EventHubs object to access its operations.\n * @return the EventHubs object.\n */\n EventHubs eventHubs();\n\n /**\n * Gets the ConsumerGroups object to access its operations.\n * @return the ConsumerGroups object.\n */\n ConsumerGroups consumerGroups();\n\n}", "public AzureWorkloadSqlRestoreRequest() {\n }", "public DiskPoolVolume() {\n }", "public static EmployeeStorageManager getInstance() {\n\t\tif (instance == null) {\n\t\t\tsynchronized (EmployeeStorageManager.class) {\n\t\t\t\tinstance = new EmployeeStorageManager();\n\t\t\t}\n\t\t}\n\t\treturn instance;\n\t}", "public static TagCloud create( TagCloud tagCloud, Plugin plugin )\r\n {\r\n _dao.insert( tagCloud, plugin );\r\n\r\n return tagCloud;\r\n }", "BaseContainerType getBaseContainer();", "public External withStorageAccount(StorageAccount storageAccount) {\n this.storageAccount = storageAccount;\n return this;\n }", "public DatabaseStorage(Context context)\n {\n this.database = new DatabaseStorageHelper(context);\n }", "public UploadManager() {\n }", "public EventProcessorHost(\n final String hostName,\n final String eventHubPath,\n final String consumerGroupName,\n final String eventHubConnectionString,\n final String storageConnectionString,\n final String storageContainerName,\n final String storageBlobPrefix) {\n this(hostName, eventHubPath, consumerGroupName, eventHubConnectionString, storageConnectionString, storageContainerName, storageBlobPrefix,\n (ScheduledExecutorService) null);\n }", "public CD(String aName, int someCapacity, String aType, int usedStorage)\n {\n super(aName, someCapacity, aType, usedStorage);\n }", "public StorageOperation(long streamSegmentId) {\n super();\n setStreamSegmentId(streamSegmentId);\n }", "public AWSStorageGatewayClient(AWSCredentialsProvider awsCredentialsProvider,\n ClientConfiguration clientConfiguration,\n RequestMetricCollector requestMetricCollector) {\n super(adjustClientConfiguration(clientConfiguration), requestMetricCollector);\n \n this.awsCredentialsProvider = awsCredentialsProvider;\n \n init();\n }", "public StorageInsightInner withStorageAccount(StorageAccount storageAccount) {\n this.storageAccount = storageAccount;\n return this;\n }", "public Storage(String filePath) {\n file = new File(filePath);\n try {\n file.getParentFile().mkdir();\n file.createNewFile();\n } catch (IOException e) {\n System.err.println(\"Unable to create file\");\n }\n }", "private TagCacheManager(){\n //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.\n //see 《Effective Java》 2nd\n throw new AssertionError(\"No \" + getClass().getName() + \" instances for you!\");\n }", "public static boolean runSample(AzureResourceManager azureResourceManager, String clientId) {\n final Region region = Region.US_EAST;\n final String storageAccountName = Utils.randomResourceName(azureResourceManager, \"sa\", 8);\n final String vaultName = Utils.randomResourceName(azureResourceManager, \"kv\", 8);\n final String rgName = Utils.randomResourceName(azureResourceManager, \"rg\", 8);\n final String containerName = \"container\";\n final String auditStorageAccountName = Utils.randomResourceName(azureResourceManager, \"sadiag\", 12);\n final String diagnosticSettingName = Utils.randomResourceName(azureResourceManager, \"diag\", 12);\n\n try {\n //============================================================\n // Create a storage account with system assigned managed service identity\n\n StorageAccount storageAccount = azureResourceManager.storageAccounts().define(storageAccountName)\n .withRegion(region)\n .withNewResourceGroup(rgName)\n .withInfrastructureEncryption()\n .withTableAccountScopedEncryptionKey()\n .withQueueAccountScopedEncryptionKey()\n .withSystemAssignedManagedServiceIdentity()\n .create();\n\n //============================================================\n // Create a key vault with purge protection enabled and access policy for managed service identity of storage account\n\n Vault vault = azureResourceManager.vaults().define(vaultName)\n .withRegion(region)\n .withExistingResourceGroup(rgName)\n .defineAccessPolicy() // access policy for this sample client to generate key\n .forServicePrincipal(clientId)\n .allowKeyAllPermissions()\n .attach()\n .defineAccessPolicy() // access policy for storage account managed service identity\n .forObjectId(storageAccount.systemAssignedManagedServiceIdentityPrincipalId())\n .allowKeyPermissions(KeyPermissions.GET, KeyPermissions.WRAP_KEY, KeyPermissions.UNWRAP_KEY)\n .attach()\n .withPurgeProtectionEnabled()\n .create();\n\n Utils.print(vault);\n\n //============================================================\n // Create a key for storage account, RSA 2048, 3072 or 4096\n\n vault.keys().define(\"sakey\")\n .withKeyTypeToCreate(KeyType.RSA)\n .withKeySize(4096)\n .create();\n\n //============================================================\n // Create a diagnostic setting on key vault and save audit logs to storage account\n\n StorageAccount auditStorageAccount = azureResourceManager.storageAccounts().define(auditStorageAccountName)\n .withRegion(region)\n .withExistingResourceGroup(rgName)\n .withSku(StorageAccountSkuType.STANDARD_LRS)\n .create();\n\n azureResourceManager.diagnosticSettings().define(diagnosticSettingName)\n .withResource(vault.id())\n .withStorageAccount(auditStorageAccount.id())\n .withLog(\"AuditEvent\", 90)\n .create();\n\n //============================================================\n // Enable customer-managed key in storage account\n\n storageAccount.update()\n .withEncryptionKeyFromKeyVault(vault.vaultUri(), \"sakey\", null)\n .apply();\n\n Utils.print(storageAccount);\n\n String storageAccountKey = storageAccount.getKeys().iterator().next().value();\n\n //============================================================\n // Create a container and upload a blob\n\n azureResourceManager.storageBlobContainers().defineContainer(containerName)\n .withExistingStorageAccount(rgName, storageAccountName)\n .withPublicAccess(PublicAccess.NONE)\n .create();\n\n BlobClient blobClient = new BlobClientBuilder()\n .connectionString(\n ResourceManagerUtils.getStorageConnectionString(\n storageAccountName, storageAccountKey,\n azureResourceManager.storageAccounts().manager().environment()))\n .containerName(containerName)\n .blobName(\"data.txt\")\n .buildClient();\n blobClient.upload(BinaryData.fromString(\"data\"));\n\n //============================================================\n // Download blob\n\n BinaryData data = blobClient.downloadContent();\n System.out.println(\"blob content: \" + data.toString());\n\n //============================================================\n // Revoke customer-managed key by removing the access policy to the managed service identity of storage account on key vault\n\n vault.update()\n .withoutAccessPolicy(storageAccount.systemAssignedManagedServiceIdentityPrincipalId())\n .apply();\n\n //============================================================\n // Download blob will now fail\n\n // wait some minutes\n ResourceManagerUtils.sleep(Duration.ofMinutes(10));\n try {\n data = blobClient.downloadContent();\n // line above should throw exception\n System.out.println(\"blob content: \" + data.toString());\n return false;\n } catch (HttpResponseException e) {\n System.out.println(\"blob download fails due to: \" + e);\n }\n\n //============================================================\n // Browse audit logs saved in storage account\n\n BlobContainerClient containerClient = new BlobContainerClientBuilder()\n .connectionString(\n ResourceManagerUtils.getStorageConnectionString(\n auditStorageAccountName, auditStorageAccount.getKeys().iterator().next().value(),\n azureResourceManager.storageAccounts().manager().environment()))\n .containerName(\"insights-logs-auditevent\")\n .buildClient();\n\n containerClient.listBlobs().forEach(item -> System.out.println(\"blob name: \" + item.getName()));\n\n } finally {\n try {\n System.out.println(\"Deleting Resource Group: \" + rgName);\n azureResourceManager.resourceGroups().beginDeleteByName(rgName);\n System.out.println(\"Deleted Resource Group: \" + rgName);\n } catch (Exception e) {\n System.out.println(\"Did not create any resources in Azure. No clean up is necessary\");\n }\n }\n\n return true;\n }", "private BlobFromFile() {\n }", "public Storage(String path) throws IOException {\n assert path != null : \"Path for file storage cannot be null.\";\n file = new File(path);\n if (!file.getParentFile().exists()) {\n file.getParentFile().mkdir();\n file.createNewFile();\n }\n }", "public StorageTargetInner withTargetType(StorageTargetType targetType) {\n this.targetType = targetType;\n return this;\n }", "public AltAzController()\n {\n this( 45, 45, 1, 20, 10 );\n }", "public MSACWrapperSdk() {}", "public BlobStorageInternal setContainerUri(String containerUri) {\n this.containerUri = containerUri;\n return this;\n }", "public CommonStorage(Context context) {\r\n this.context = context;\r\n }", "public AzureInputDataHandler(String accountName, String accountKey, String containerName) throws URISyntaxException {\n this(GetEndpoint(accountName), accountName, accountKey, containerName);\n\n }", "public AmazonCloudSearchClient() {\n this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());\n }", "public Storage(String filePath) {\n this.filePath = filePath;\n }", "public Storage(String filePath) {\n this.filePath = filePath;\n }", "public static ArrayQueueADT create() {\n return new ArrayQueueADT();\n }", "@SuppressWarnings({\"deprecation\", \"rawtypes\", \"unchecked\"})\n public static javafx.scene.control.AccordionBuilder<?> create() {\n return new javafx.scene.control.AccordionBuilder();\n }" ]
[ "0.6074796", "0.60450405", "0.5934523", "0.58448666", "0.5601915", "0.5543166", "0.54045945", "0.5289281", "0.5261513", "0.5205695", "0.5195398", "0.51771986", "0.51766044", "0.51158947", "0.5087757", "0.5063495", "0.50542355", "0.50479543", "0.50433785", "0.50385445", "0.5034478", "0.49885458", "0.49038014", "0.4900035", "0.48965234", "0.48785195", "0.4860607", "0.48449647", "0.48332763", "0.47806686", "0.47679916", "0.4765682", "0.47558823", "0.47370297", "0.47297177", "0.46262184", "0.46097326", "0.45927975", "0.45906785", "0.45769677", "0.45458204", "0.45104402", "0.45075914", "0.4504633", "0.45021683", "0.4492826", "0.4491444", "0.44853315", "0.44849458", "0.44589645", "0.44434506", "0.44220775", "0.44188884", "0.44015974", "0.43996143", "0.43872318", "0.4386085", "0.4383688", "0.43794525", "0.43527108", "0.43517408", "0.43430698", "0.4336493", "0.43232015", "0.43120944", "0.4309122", "0.43072897", "0.4292939", "0.42545", "0.42536446", "0.42475295", "0.42438358", "0.42377016", "0.42257404", "0.42232096", "0.42082074", "0.42068323", "0.41943198", "0.41918322", "0.41910297", "0.41723248", "0.41674688", "0.41667774", "0.41655323", "0.41518557", "0.41513637", "0.41511858", "0.41416582", "0.4131358", "0.41295058", "0.4126494", "0.41234365", "0.41208273", "0.4118668", "0.41177323", "0.41016033", "0.40916178", "0.40916178", "0.40905687", "0.40903944" ]
0.83575225
0
Get the sourceResourceId property: Fully qualified ARM url.
public String sourceResourceId() { return this.sourceResourceId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String sourceUri() {\n return this.sourceUri;\n }", "public String getSource() {\n\t\treturn this.uri.toString();\n\t}", "public String getSourceResource() {\r\n\t\treturn requestSource;\r\n\t}", "@Path(\"sourceId/\")\n public SourceResource getSourceIdResource() {\n SourceIdResourceSub resource = resourceContext.getResource(SourceIdResourceSub.class);\n resource.setParent(getEntity());\n return resource;\n }", "public String sourceResourceLocation() {\n return this.sourceResourceLocation;\n }", "public JSONObject SourceResource() {\n JSONObject source = jsonParent.getJSONObject(\"sourceResource\");\n return source;\n }", "public String getResourceId() {\n return this.resourceId;\n }", "public String getResourceId() {\n return this.resourceId;\n }", "public Uri getSourceUri() {\n return sourceUri;\n }", "public String getResourceId();", "public String getResourceUri() {\n return resourceUri;\n }", "public String getSourceUrl() {\n return sourceUrl;\n }", "public URI getSource() {\n return source;\n }", "java.lang.String getResourceUri();", "public int getSourceResId() {\n return sourceResId;\n }", "public String getResourceId() {\n return resourceId;\n }", "public String targetResourceId() {\n return this.targetResourceId;\n }", "public String getDestinationResource() {\r\n\t\treturn destinationSource;\r\n\t}", "public String getResourceId() {\r\n\t\treturn resourceId;\r\n\t}", "public String getResourceId() {\n return this.ResourceId;\n }", "public String getResourceId() {\n\t\treturn resourceId;\n\t}", "public String getResourceId() {\n\t\treturn resourceId;\n\t}", "public String getResourceUrl() {\n\t\treturn resourceUrl;\n\t}", "public String resourceId() {\n return this.resourceId;\n }", "public String resourceId() {\n return this.resourceId;\n }", "public String resourceId() {\n return this.resourceId;\n }", "public String resourceId() {\n return this.resourceId;\n }", "public String resourceId() {\n return this.resourceId;\n }", "public NameValue<String, String> getSourceURL() {\n return getSourceURL(false);\n }", "public String getSourceArn() {\n return this.sourceArn;\n }", "public String getSourceId() {\n return sourceId;\n }", "public String getResourceUrl() {\n return this.resourceUrl;\n }", "public String getResourceLink() {\n\t\treturn resourceLink;\n\t}", "public String getSource() {\n\t\treturn (String) _object.get(\"source\");\n\t}", "public String getSource() {\n return JsoHelper.getAttribute(jsObj, \"source\");\n }", "int getResourceId();", "public EndpointID source() {\r\n\t\treturn source_;\r\n\t}", "public String getResourceurl() {\n return resourceurl;\n }", "@ApiModelProperty(value = \"The source of the data.\")\n public String getSource() {\n return source;\n }", "public URL getSource() {\n return url;\n }", "public abstract String getResUri();", "public String getRequestUrlName() {\n return \"Source\"; // TODO: parameter\n }", "@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:source\")\n public String getSource() {\n return getProperty(SOURCE);\n }", "public Integer getResourceId() {\n return resourceId;\n }", "public String getSource() {\n/* 312 */ return getValue(\"source\");\n/* */ }", "public String sourceUniqueId() {\n return this.sourceUniqueId;\n }", "public long getSourceId() {\n return sourceId_;\n }", "String getSourceUsageURL();", "public long getSourceId() {\n return sourceId_;\n }", "@Schema(description = \"Subscription ID for the event\")\n public UUID getResourceId() {\n return resourceId;\n }", "public String getSourceIdentifier() {\n return sourceIdentifier;\n }", "public String getUrl(final String sourceURL) {\n\n String result = null;\n\n if (sourceURL == null) {\n // if only one URL is configured, \"default URL\" should mean that\n // URL.\n List<String> urls = descriptor().getUrls();\n if (!urls.isEmpty()) {\n result = urls.get(0);\n }\n return result;\n }\n for (String j : descriptor().getUrls()) {\n if (j.equals(sourceURL)) {\n result = j;\n break;\n }\n }\n return result;\n }", "private String getSource() {\n SharedPreferences settings =\n PreferenceManager.getDefaultSharedPreferences(Collect.getInstance().getBaseContext());\n String serverUrl = settings.getString(PreferencesActivity.KEY_SERVER_URL, null);\n String source = null;\n // Remove the protocol\n if(serverUrl.startsWith(\"http\")) {\n \tint idx = serverUrl.indexOf(\"//\");\n \tif(idx > 0) {\n \t\tsource = serverUrl.substring(idx + 2);\n \t} else {\n \t\tsource = serverUrl;\n \t}\n }\n \n return source;\n }", "String artifactSourceId();", "public String getSource() {\n return this.source;\n }", "@JsonProperty(\"source\")\n public Source getSource() {\n return source;\n }", "public int getResourceId() {\n\t\t\treturn resourceId;\n\t\t}", "public java.lang.String getSourceImageUrl() {\n return _courseImage.getSourceImageUrl();\n }", "public String getSource() {\n\n return source;\n }", "public String getSource() {\n Object ref = source_;\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 source_ = s;\n }\n return s;\n }\n }", "public String getSystemId() {\n return this.source.getURI();\n }", "public String getSrcId()\n\t\t{\n\t\t\tElement srcIdElement = XMLUtils.findChild(mediaElement, SRC_ID_ELEMENT_NAME);\n\t\t\treturn srcIdElement == null ? null : srcIdElement.getTextContent();\n\t\t}", "public Number getSrcId() {\r\n return (Number) getAttributeInternal(SRCID);\r\n }", "public String getSource() {\n Object ref = source_;\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 source_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "String resourceGuid();", "@ApiModelProperty(value = \"族谱来源\")\n public String getSource() {\n return source;\n }", "java.lang.String getAssociatedSource();", "public String getId() {\n\t\t\t\t\treturn ContentTypeIdForXML.ContentTypeID_XML + \".source\"; //$NON-NLS-1$;\n\t\t\t\t}", "public String getResourceName() {\n return this.resourceName;\n }", "public String getSource() {\r\n return source;\r\n }", "public String getUri() {\n if (SourceDocumentInformation_Type.featOkTst\n && ((SourceDocumentInformation_Type) jcasType).casFeat_uri == null)\n this.jcasType.jcas.throwFeatMissing(\"uri\", \"org.apache.uima.examples.SourceDocumentInformation\");\n return jcasType.ll_cas.ll_getStringValue(addr,\n ((SourceDocumentInformation_Type) jcasType).casFeatCode_uri);\n }", "public String getSource() {\r\n return Source;\r\n }", "public String getSrc() {\n return (String) attributes.get(\"src\");\n }", "String getSourceID();", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\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 source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\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 source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public Optional<String> getSource() {\n\t\treturn Optional.ofNullable(_source);\n\t}", "public URL getURL()\n/* */ {\n/* 135 */ return ResourceUtils.getResourceAsURL(this, this);\n/* */ }", "public String getIpSource() {\n return getPropertyAsString(IP_SOURCE, \"\");\n }", "public String getResourceName() {\n return resourceName;\n }", "public String getSource() {\n return mSource;\n }", "public URN getResourceURN()\r\n {\r\n return resourceURN;\r\n }", "public java.lang.String getSrcPath() {\n java.lang.Object ref = srcPath_;\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 srcPath_ = s;\n }\n return s;\n }\n }", "public Resource getTargetResource();", "public String getResourceName();", "public String getResourceName() {\n return resourceName;\n }", "public java.lang.Object getSourceID() {\n return sourceID;\n }", "java.lang.String getSrc();", "public String getSourceFileName() {\n\t\tStringIdMsType stringIdType =\n\t\t\tpdb.getTypeRecord(getSourceFileNameStringIdRecordNumber(), StringIdMsType.class);\n\t\tif (stringIdType == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn stringIdType.getString();\n\t}", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\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 source_ = s;\n return s;\n }\n }", "String getResourceName();", "protected String getLocalId(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException {\n Collection<Object> sourceIdValues = getValuesFromAllDependencies(resolutionContext, getPidSourceAttributeId());\n if (sourceIdValues == null || sourceIdValues.isEmpty()) {\n log.error(\"Source attribute {} for connector {} provide no values\", getPidSourceAttributeId(), getId());\n throw new AttributeResolutionException(\"Source attribute \" + getPidSourceAttributeId() + \" for connector \"\n + getId() + \" provided no values\");\n }\n\n if (sourceIdValues.size() > 1) {\n log.warn(\"Source attribute {} for connector {} has more than one value, only the first value is used\",\n getPidSourceAttributeId(), getId());\n }\n\n return sourceIdValues.iterator().next().toString();\n }", "public String getSource();", "public final String getSrcAttribute() {\n return getAttributeValue(\"src\");\n }", "public String getSource(){\n\t\treturn source.getEvaluatedValue();\n\t}" ]
[ "0.7120448", "0.69930464", "0.689941", "0.6885025", "0.6829965", "0.6817238", "0.6790123", "0.6790123", "0.6777356", "0.67756736", "0.65881133", "0.65830934", "0.65752214", "0.6568482", "0.6488338", "0.64865273", "0.6478008", "0.6451986", "0.64398146", "0.6437151", "0.6416364", "0.6416364", "0.64123785", "0.64113206", "0.64113206", "0.64113206", "0.64113206", "0.64113206", "0.64094687", "0.63926333", "0.6369878", "0.63241464", "0.6273789", "0.623065", "0.6194778", "0.61661613", "0.6162694", "0.6137871", "0.61240464", "0.611746", "0.6107653", "0.60826993", "0.6062216", "0.60473436", "0.6045305", "0.60442245", "0.6035091", "0.60045904", "0.60037404", "0.6001467", "0.59784794", "0.5971568", "0.59604746", "0.5944734", "0.5915426", "0.59010977", "0.58930534", "0.5888793", "0.5888498", "0.5885916", "0.588044", "0.5880017", "0.5858231", "0.58544415", "0.58441925", "0.58441925", "0.58441925", "0.5843674", "0.58374184", "0.58255374", "0.58220434", "0.5821851", "0.5820313", "0.58199996", "0.58175266", "0.5799858", "0.57993174", "0.5794498", "0.5793178", "0.5793178", "0.57718104", "0.57655895", "0.5765012", "0.5764083", "0.57598346", "0.5758388", "0.5750987", "0.5749958", "0.574837", "0.57430124", "0.5737336", "0.57329506", "0.5720665", "0.5717242", "0.5716847", "0.57136285", "0.57134575", "0.5705495", "0.5700461" ]
0.79498273
1
Set the sourceResourceId property: Fully qualified ARM url.
public AzureStorageContainer withSourceResourceId(String sourceResourceId) { this.sourceResourceId = sourceResourceId; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String sourceResourceId() {\n return this.sourceResourceId;\n }", "public String sourceResourceId() {\n return this.sourceResourceId;\n }", "public void setSourceId(String source) {\n this.sourceId = sourceId;\n }", "public void setResourceId(String resourceId) {\n this.resourceId = resourceId;\n }", "public void setResourceId(String resourceId) {\n this.resourceId = resourceId;\n }", "public void setResourceId(String resourceId) {\r\n\t\tthis.resourceId = resourceId;\r\n\t}", "void setResourceId(int value);", "public void setResourceId(Integer resourceId) {\n this.resourceId = resourceId;\n }", "public void setResourceId(String resourceId) {\n\t\tthis.resourceId = resourceId;\n\t}", "public void setResourceId(String resourceId) {\n\t\tthis.resourceId = resourceId;\n\t}", "public void setSource(String value) {\n/* 304 */ setValue(\"source\", value);\n/* */ }", "void setResourceID(String resourceID);", "@Path(\"sourceId/\")\n public SourceResource getSourceIdResource() {\n SourceIdResourceSub resource = resourceContext.getResource(SourceIdResourceSub.class);\n resource.setParent(getEntity());\n return resource;\n }", "public void setSourceUrl(String sourceUrl) {\n this.sourceUrl = sourceUrl == null ? null : sourceUrl.trim();\n }", "public void set_source(EndpointID source) {\r\n\t\tsource_ = source;\r\n\t}", "public String sourceUri() {\n return this.sourceUri;\n }", "public Builder setSourceId(long value) {\n bitField0_ |= 0x00000001;\n sourceId_ = value;\n onChanged();\n return this;\n }", "public IOURingRSRCRegister set(IOURingRSRCRegister src) {\n memCopy(src.address(), address(), SIZEOF);\n return this;\n }", "public void setResourceId(String ResourceId) {\n this.ResourceId = ResourceId;\n }", "public void setSourceObjectId(String sourceObjectId) {\n this.sourceObjectId = sourceObjectId;\n }", "public void setResourceUrl(String url) {\n this.resourceUrl = url;\n }", "public void setSourceAttribute(String id) {\n this.sourceAttribute = id;\n }", "public void setSource(String source);", "public void setResource(URI resource) {\n this.resource = resource;\n }", "@com.facebook.react.uimanager.annotations.ReactProp(name = \"src\")\n public void setSource(@javax.annotation.Nullable java.lang.String r4) {\n /*\n r3 = this;\n r0 = 0;\n if (r4 == 0) goto L_0x0017;\n L_0x0003:\n r1 = android.net.Uri.parse(r4);\t Catch:{ Exception -> 0x0021 }\n r2 = r1.getScheme();\t Catch:{ Exception -> 0x0025 }\n if (r2 != 0) goto L_0x0023;\n L_0x000d:\n if (r0 != 0) goto L_0x0017;\n L_0x000f:\n r0 = r3.E();\n r0 = m12032a(r0, r4);\n L_0x0017:\n r1 = r3.f11557g;\n if (r0 == r1) goto L_0x001e;\n L_0x001b:\n r3.x();\n L_0x001e:\n r3.f11557g = r0;\n return;\n L_0x0021:\n r1 = move-exception;\n r1 = r0;\n L_0x0023:\n r0 = r1;\n goto L_0x000d;\n L_0x0025:\n r0 = move-exception;\n goto L_0x0023;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode.setSource(java.lang.String):void\");\n }", "public void setResourceUrl(String resourceUrl) {\n\t\tthis.resourceUrl = resourceUrl;\n\t}", "public void setSourceID(java.lang.Object sourceID) {\n this.sourceID = sourceID;\n }", "public void setSource(Source s)\n\t{\n\t\tsource = s;\n\t}", "public void setSource(String source) {\n _source = source;\n }", "private void setSrcId(int value) {\n \n srcId_ = value;\n }", "@JsonProperty(\"source\")\n public void setSource(Source source) {\n this.source = source;\n }", "public String getResourceId() {\n return this.resourceId;\n }", "public String getResourceId() {\n return this.resourceId;\n }", "public void setSource (String source);", "public void setSource(String source) {\r\n this.source = source;\r\n }", "public void setSourceIdentifier(String sourceIdentifier) {\n this.sourceIdentifier = sourceIdentifier;\n }", "private void setSrcId(int value) {\n \n srcId_ = value;\n }", "public String getSourceResource() {\r\n\t\treturn requestSource;\r\n\t}", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n this.source = source;\n }", "public void setSourceImageUrl(java.lang.String sourceImageUrl) {\n _courseImage.setSourceImageUrl(sourceImageUrl);\n }", "public void setSrc(String startId) {\r\n\t\tsrc = startId;\r\n\t}", "public void setSource(String value) {\n configuration.put(ConfigTag.SOURCE, value);\n }", "public Builder setSrc(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n src_ = value;\n onChanged();\n return this;\n }", "void setSourceRepoUrl(String sourceRepoUrl);", "public LinkedIntegrationRuntimeRbacAuthorization setResourceId(String resourceId) {\n this.resourceId = resourceId;\n return this;\n }", "public String targetResourceId() {\n return this.targetResourceId;\n }", "public void setSourceNode(String sourceNode) {\n this.sourceNode = sourceNode;\n }", "public void setSource(String Source) {\r\n this.Source = Source;\r\n }", "public JSONObject SourceResource() {\n JSONObject source = jsonParent.getJSONObject(\"sourceResource\");\n return source;\n }", "public void setSourcePath(String sourcePath) {\n this.sourcePath = sourcePath;\n }", "public final void setSource(final Integer newSource) {\n this.source = newSource;\n }", "public String sourceResourceLocation() {\n return this.sourceResourceLocation;\n }", "public Uri getSourceUri() {\n return sourceUri;\n }", "public void setSrcId(String srcId)\n\t\t{\n\t\t\tElement srcIdElement = XMLUtils.findChild(mediaElement, SRC_ID_ELEMENT_NAME);\n\t\t\tif (srcId == null || srcId.equals(\"\")) {\n\t\t\t\tif (srcIdElement != null)\n\t\t\t\t\tmediaElement.removeChild(srcIdElement);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (srcIdElement == null) {\n\t\t\t\t\tsrcIdElement = document.createElement(SRC_ID_ELEMENT_NAME);\n\t\t\t\t\tmediaElement.appendChild(srcIdElement);\n\t\t\t\t}\n\t\t\t\tsrcIdElement.setTextContent(srcId);\n\t\t\t}\n\t\t}", "public void setResourceUri(String resourceUri) {\n this.resourceUri = resourceUri;\n }", "private void setTheResource(Node startNode, String resource, Object value)\r\n throws IllegalArgumentException\r\n {\r\n if (!isValidResource(resource))\r\n {\r\n throw new IllegalArgumentException(\"ResourceManager.setResource(): \" +\r\n \"resource '\" + resource + \r\n \"' is not well formed\");\r\n }\r\n\r\n // ensure that the resource value is a string\r\n String stringValue;\r\n if (value instanceof List)\r\n stringValue = ManagerUtils.listToDelimitedString((List) value);\r\n else\r\n stringValue = (String) value;\r\n\r\n setTheResourceRecursive(startNode,\r\n ensureWellFormed(resource),\r\n stringValue);\r\n }", "public void setIpSource(String value) {\n setProperty(IP_SOURCE, value, \"\");\n }", "public void setSrc(String src) {\n attributes.put(\"src\", src);\n }", "public Builder setSource(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n source_ = value;\n onChanged();\n return this;\n }", "void setRenderableSource(Long id, RenderedImage source, int index)\n\tthrows RemoteException;", "public Builder setSrcPath(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n srcPath_ = value;\n onChanged();\n return this;\n }", "public void setSource(String source) {\n this.source = source == null ? null : source.trim();\n }", "public void setSource(String source) {\n this.source = source == null ? null : source.trim();\n }", "@ApiModelProperty(value = \"The source of the data.\")\n public String getSource() {\n return source;\n }", "public void setSource(java.lang.String param) {\r\n localSourceTracker = true;\r\n\r\n this.localSource = param;\r\n\r\n\r\n }", "public String getResourceId();", "public Builder setSource(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n source_ = value;\n onChanged();\n return this;\n }", "public Builder setSource(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n source_ = value;\n onChanged();\n return this;\n }", "void setRenderedSource(Long id, RenderedImage source, int index)\n\tthrows RemoteException;", "public int getSourceResId() {\n return sourceResId;\n }", "public void setSrcId(Number value) {\r\n setAttributeInternal(SRCID, value);\r\n }", "public void setSource(Object o) {\n\t\tsource = o;\n\t}", "public static void setVideoSource(String source){\r\n\r\n editor.putString(\"VideoMode\", source);\r\n editor.commit();\r\n }", "public String getDestinationResource() {\r\n\t\treturn destinationSource;\r\n\t}", "public void setResourceRef(String resourceUri) {\n if (getResourceRef() != null) {\n // Allow usage of URIs relative to the current base reference\n setResourceRef(new Reference(getResourceRef().getBaseRef(),\n resourceUri));\n } else {\n setResourceRef(new Reference(resourceUri));\n }\n }", "public com.autodesk.ws.avro.Call.Builder setTargetObjectUri(java.lang.CharSequence value) {\n validate(fields()[5], value);\n this.target_object_uri = value;\n fieldSetFlags()[5] = true;\n return this; \n }", "public void setResourceName(String resourceName) {\n this.resourceName = resourceName;\n }", "public String getSourceId() {\n return sourceId;\n }", "public Builder setJobIDSource(long value) {\n bitField0_ |= 0x00000008;\n jobIDSource_ = value;\n onChanged();\n return this;\n }", "public String getSourceArn() {\n return this.sourceArn;\n }", "public String getResourceId() {\r\n\t\treturn resourceId;\r\n\t}", "public void setResourceurl(String resourceurl) {\n this.resourceurl = resourceurl == null ? null : resourceurl.trim();\n }", "public String getResourceId() {\n return this.ResourceId;\n }", "@PUT\n @Path(\"/source/{id}\")\n @Consumes(\"application/json;charset=UTF-8\")\n @Produces(\"application/json;charset=UTF-8\")\n @RolesAllowed(Roles.ADMIN)\n @GZIP\n @NoCache\n public SourceVo updateSource(\n @PathParam(\"id\") Integer id,\n SourceVo source) throws Exception {\n\n if (!Objects.equals(id, source.getId())) {\n throw new WebApplicationException(400);\n }\n\n log.info(\"Updating source \" + source);\n return sourceService.updateSource(new Source(source))\n .toVo(DataFilter.get());\n }", "public void setSourceDescription(DataSourceDescription sourceDescription) {\n\t\tthis.sourceDescription = sourceDescription;\n\t}", "public Builder setSrcId(int value) {\n copyOnWrite();\n instance.setSrcId(value);\n return this;\n }", "void setVideoResourceId(@RawRes int resId);", "@objid (\"fddcf86a-595c-4c38-ad3f-c2a660a9497b\")\n void setSource(Instance value);", "public String getResourceId() {\n return resourceId;\n }", "void setRenderableSource(Long id, Long sourceId, int index)\n\tthrows RemoteException;", "public void setSource(edu.umich.icpsr.ddi.FileTxtType.Source.Enum source)\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(SOURCE$30);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SOURCE$30);\n }\n target.setEnumValue(source);\n }\n }", "public interface Source {\n\n /**\n * Set the system identifier for this Source.\n * <p>\n * The system identifier is optional if the source does not get its data\n * from a URL, but it may still be useful to provide one. The application\n * can use a system identifier, for example, to resolve relative URIs and to\n * include in error messages and warnings.\n * </p>\n *\n * @param systemId\n * The system identifier as a URL string.\n */\n public void setSystemId(String systemId);\n\n /**\n * Get the system identifier that was set with setSystemId.\n *\n * @return The system identifier that was set with setSystemId, or null if\n * setSystemId was not called.\n */\n public String getSystemId();\n}", "public String getSourceUrl() {\n return sourceUrl;\n }", "public Builder setAssociatedSource(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n associatedSource_ = value;\n onChanged();\n return this;\n }", "public Builder setSrcId(int value) {\n copyOnWrite();\n instance.setSrcId(value);\n return this;\n }", "public Builder setSourceContext(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n sourceContext_ = value;\n onChanged();\n return this;\n }", "public String getResourceId() {\n\t\treturn resourceId;\n\t}", "public String getResourceId() {\n\t\treturn resourceId;\n\t}", "public void setSource(noNamespace.SourceType source)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().find_element_user(SOURCE$0, 0);\r\n if (target == null)\r\n {\r\n target = (noNamespace.SourceType)get_store().add_element_user(SOURCE$0);\r\n }\r\n target.set(source);\r\n }\r\n }" ]
[ "0.68866706", "0.68866706", "0.63972545", "0.6323735", "0.6323735", "0.63081175", "0.6233019", "0.62195504", "0.6192526", "0.6192526", "0.6159623", "0.6096179", "0.6071099", "0.6042285", "0.60332185", "0.60194993", "0.6017391", "0.5996373", "0.5957562", "0.5929128", "0.5920209", "0.5901823", "0.58966655", "0.588312", "0.5876942", "0.58737385", "0.5857418", "0.5857131", "0.58480006", "0.5847957", "0.58476275", "0.58432627", "0.58432627", "0.58236015", "0.58181316", "0.580434", "0.5791748", "0.57887524", "0.5743115", "0.5743115", "0.57429427", "0.5737302", "0.572438", "0.57136196", "0.56816506", "0.56781983", "0.5675844", "0.56483775", "0.56308824", "0.5625197", "0.5596391", "0.55953676", "0.5571867", "0.556428", "0.5550946", "0.55387455", "0.5510728", "0.55048203", "0.5504426", "0.5499169", "0.5493442", "0.5489504", "0.5489367", "0.5489367", "0.54802996", "0.5476389", "0.54712224", "0.5464164", "0.5464164", "0.54592013", "0.5459009", "0.54348785", "0.5429138", "0.5425124", "0.54218787", "0.5421379", "0.53993666", "0.53991973", "0.5378186", "0.5374436", "0.5369334", "0.53625095", "0.5356904", "0.53565556", "0.535349", "0.5350763", "0.5350151", "0.5348986", "0.53425837", "0.5324886", "0.5322263", "0.5319665", "0.53176355", "0.53089035", "0.53076833", "0.53040516", "0.53032863", "0.53005755", "0.53005755", "0.5300409" ]
0.57467663
38
Get the storageAccountVersion property: Storage account version.
public String storageAccountVersion() { return this.storageAccountVersion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String storageAccount() {\n return this.storageAccount;\n }", "public StorageAccount storageAccount() {\n return this.storageAccount;\n }", "public StorageAccount storageAccount() {\n return this.storageAccount;\n }", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public String storageAccountId() {\n return this.storageAccountId;\n }", "public AzureStorageContainer withStorageAccountVersion(String storageAccountVersion) {\n this.storageAccountVersion = storageAccountVersion;\n return this;\n }", "public Long getVersion() {\n return version;\n }", "public Long getVersion() {\n return version;\n }", "public Long getVersion() {\n return version;\n }", "public Long getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }", "public byte getVersion() {\n return version;\n }", "public Integer getVersion() {\r\n return version;\r\n }", "public Long getVersion() {\n return this.version;\n }", "public Long getVersion() {\n return this.version;\n }", "public Float getVersionNumber() {\n return versionNumber;\n }", "public int getVersion()\n {\n return info.getVersion().intValueExact();\n }", "public long getVersion() {\n return version;\n }", "public long getVersion() {\n return version;\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "public FileStorageAccount getAccount() {\n return account;\n }", "public long getVersion() {\r\n return this.version;\r\n }", "public Integer getVersion() {\n\t\t\n\t\treturn this.version;\n\t}", "public final int getVersion() {\n return version;\n }", "public int getVersion() {\n return this.version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public Integer version() {\n return this.version;\n }", "public Number getVersion() {\n return (Number) getAttributeInternal(VERSION);\n }", "public int getVersionNumber() {\n return versionNumber;\n }", "public String getVersionNumber() {\n return versionNumber;\n }", "public int getRevision()\n {\n return encryptionDictionary.getInt( \"R\", DEFAULT_VERSION );\n }", "public int getVersion() {\n return mVersion;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getExtensionsSchemaVersion() {\n return (java.lang.Integer)__getInternalInterface().getFieldValue(EXTENSIONSSCHEMAVERSION_PROP.get());\n }", "public String getVersion() {\n return _version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "@ApiModelProperty(example = \"36867\", required = true, value = \"The entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. \")\n public Integer getVersion() {\n return version;\n }", "public final String getVersion() {\n return version;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getExtensionsSchemaVersion() {\n return (java.lang.Integer)__getInternalInterface().getFieldValue(EXTENSIONSSCHEMAVERSION_PROP.get());\n }", "public String getVersion() {\n return version;\n }", "public String getVersion()\n {\n return version;\n }", "public String getVersion()\n {\n return version;\n }", "public UuidVersion getVersion() {\n\t\treturn this.version;\n\t}", "public String getVersion() {\r\n return version;\r\n }", "public String getVersion() {\n\t\treturn _version;\n\t}", "public com.google.protobuf.ByteString\n getVersionBytes() {\n java.lang.Object ref = version_;\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 version_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getVersion()\n {\n return version;\n }", "public Version getVersion() {\n return version;\n }", "@java.lang.Override\n public long getVersion() {\n return version_;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return this.version;\n }", "public java.lang.String getVersionNumber() {\n return versionNumber;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getVersionBytes() {\n java.lang.Object ref = version_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n version_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "Integer getVersion();", "public com.google.protobuf.ByteString\n getVersionBytes() {\n\n java.lang.Object ref = version_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b;\n try {\n b = com.google.protobuf.ByteString.copyFrom((String) ref, \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n throw new RuntimeException(\"will never happen\");\n }\n version_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getVersion() {\n\t\treturn version;\n\t}", "public String getVersion () {\n return this.version;\n }", "int getVersion() {\n return mVersion;\n }", "public String getVersion () {\r\n return version;\r\n }", "public com.google.protobuf.ByteString\n getVersionBytes() {\n java.lang.Object ref = version_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n version_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getVersionBytes() {\n java.lang.Object ref = version_;\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 version_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getVersion() {\r\n\t\treturn version;\r\n\t}", "public BigDecimal getVersion() {\n\t\tBigDecimal bd = (BigDecimal) get_Value(\"Version\");\n\t\tif (bd == null)\n\t\t\treturn Env.ZERO;\n\t\treturn bd;\n\t}", "public Float getVersion() { return version; }", "public String getCurrentVersion() {\n return this.currentVersion;\n }", "public int getCurrentVersion() {\n return currentVersion_;\n }", "public java.lang.String getVersion() {\r\n return version;\r\n }", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "@NotNull\n @JsonProperty(\"version\")\n public Long getVersion();", "public int getCurrentVersion() {\n return currentVersion_;\n }", "public final String getContractVersion( ) {\r\n\t\treturn this.contractVersion;\r\n\t}", "public String getDbVersion() {\r\n init();\r\n\r\n return _dbVersion;\r\n }", "public Version getVersion();", "public static String getVersion() {\n return version;\n }", "public static String getVersion() {\n return version;\n }", "public int getVersion() {\n return mServiceVersion;\n }", "public String getProductVersion();", "public long getAssetVersionId() {\r\n return assetVersionId;\r\n }", "public Long getVersionId() {\n return versionId;\n }", "public com.google.protobuf.ByteString\n getVersionBytes() {\n java.lang.Object ref = version_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b;\n try {\n b = com.google.protobuf.ByteString.copyFrom((String) ref, \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n throw new RuntimeException(\"will never happen\");\n }\n version_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getVersion(){\r\n return version;\r\n }" ]
[ "0.61893815", "0.60275733", "0.60275733", "0.59326553", "0.5848152", "0.5815192", "0.5728959", "0.5728959", "0.5728959", "0.5728959", "0.5710245", "0.5710245", "0.5710245", "0.5710245", "0.5710245", "0.5710245", "0.57082605", "0.5675631", "0.5660537", "0.5660537", "0.56569374", "0.56496257", "0.56318086", "0.56318086", "0.5594799", "0.5587653", "0.557694", "0.5570609", "0.5559345", "0.55540866", "0.5546373", "0.5546373", "0.5546373", "0.5546373", "0.5546373", "0.5523583", "0.5482903", "0.54724956", "0.5468725", "0.54529464", "0.5448831", "0.5445462", "0.544198", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.54322857", "0.5427732", "0.5425009", "0.54225475", "0.54183644", "0.54165125", "0.54165125", "0.54156137", "0.54108584", "0.539236", "0.5387883", "0.53878486", "0.53853005", "0.5374555", "0.53731525", "0.53731525", "0.537145", "0.53692794", "0.53670096", "0.53591686", "0.5356063", "0.5352888", "0.5352762", "0.5350176", "0.5342269", "0.53388333", "0.5338029", "0.5332783", "0.5332367", "0.5330017", "0.53272325", "0.53234154", "0.5317601", "0.5315105", "0.5314209", "0.5312626", "0.53084475", "0.5305568", "0.5299144", "0.52990365", "0.52990365", "0.5297785", "0.5293832", "0.52937835", "0.52927035", "0.5291128", "0.5289604" ]
0.8646335
0
Set the storageAccountVersion property: Storage account version.
public AzureStorageContainer withStorageAccountVersion(String storageAccountVersion) { this.storageAccountVersion = storageAccountVersion; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String storageAccountVersion() {\n return this.storageAccountVersion;\n }", "public void setVersion(int version)\n {\n encryptionDictionary.setInt( \"V\", version );\n }", "public final void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\r\n this.version = version;\r\n }", "private void setVersionNumber(int version) {\n versionNumber = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n this.version = version;\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(long version) {\n this.version = version;\n }", "public void setVersion(Integer version) {\n\t\tthis.version = version;\n\t}", "public void setVersion( Integer version ) {\n this.version = version;\n }", "public void setVersion(String version);", "void setVersion(String version);", "void setVersion(String version);", "public void setConfigVersion(java.lang.String configVersion) {\r\n this.configVersion = configVersion;\r\n }", "public void setVersion(int value) {\n this.version = value;\n }", "public void setVersion(final Long version);", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String _version) {\n this._version = _version;\n }", "@SuppressWarnings(\"unused\")\n private void setVersion(final Integer version) {\n this.version = version;\n }", "@SuppressWarnings(\"unused\")\n private void setVersion(final Integer version) {\n this.version = version;\n }", "public void setVersion(String version) {\r\n\t\tthis.version = version;\r\n\t}", "void setVersion(long version);", "public void setCurrentVersion(String currentVersion) {\n this.currentVersion = currentVersion;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(java.lang.String version) {\r\n this.version = version;\r\n }", "public void setManifestVersion() {\n\t\tSharedPreferences.Editor editor = sp.edit();\n\t\teditor.putString(VERSION_KEY, thisVersion);\n\t\teditor.commit();\n\t}", "public void setVersion(String version) {\n\t\tthis.version = version;\n\t}", "public void setVersionNumber(Float versionNumber) {\n this.versionNumber = versionNumber;\n }", "public void setVersion(String value) {\n\t\tthis._version = value;\n\t}", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "public final void setVersion(java.lang.String version)\r\n\t{\r\n\t\tsetVersion(getContext(), version);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "SchemaReference setVersion(String version);", "public void setVersion(String version) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void setVersion(int version) {\n\r\n\t}", "public void setVersion(org.hl7.fhir.String version)\n {\n generatedSetterHelperImpl(version, VERSION$4, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\n }", "public void setVersion(String version)\n {\n this.ver = version;\n }", "public void setFileVersion(int fileVersion) {\r\n\t\tthis.fileVersion = fileVersion;\r\n\t}", "@CompositeValue(ignore=true)\n @XmlAttribute(name=\"version\")\n public void setVersion(Version version)\n {\n versionRange = new VersionRange(version, true, version, true);\n }", "public UpdateBrokerStorageRequest withCurrentVersion(String currentVersion) {\n setCurrentVersion(currentVersion);\n return this;\n }", "public void setVersion(java.math.BigInteger version)\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(VERSION$6, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(VERSION$6);\r\n }\r\n target.setBigIntegerValue(version);\r\n }\r\n }", "public void setVersion(Long version) {\n this.version = version;\n }", "public void setVersion(Long version) {\n this.version = version;\n }", "public void setVersion(Long version) {\n this.version = version;\n }", "public void setVersion(Long version) {\n this.version = version;\n }", "public void setServiceVersion(String serviceVersion);", "public void setVersion(Number value) {\n setAttributeInternal(VERSION, value);\n }", "void setSdkVersion(String sdkVersion) {\n this.sdkVersion = Preconditions.checkNotNull(sdkVersion);\n }", "public final void setVersion(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String version)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.Version.toString(), version);\r\n\t}", "public synchronized void setVersion(final InternationalString newValue) {\n checkWritePermission();\n version = newValue;\n }", "public void setVersion(String version) {\r\n this.version = version == null ? null : version.trim();\r\n }", "public void setVersion(String version) {\n this.version = version == null ? null : version.trim();\n }", "public void setExtensionsSchemaVersion(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(EXTENSIONSSCHEMAVERSION_PROP.get(), value);\n }", "public void setExtensionsSchemaVersion(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(EXTENSIONSSCHEMAVERSION_PROP.get(), value);\n }", "void setVersion(int version) {\n removeOldVersion();\n\n String sql = \"INSERT INTO \" + tableName + \" (\" + VERSION_COL + \") VALUES (?)\";\n\n execute(new ExecuteStatement(sql) {\n @Override\n public void prepare(PreparedStatement statement) throws SQLException {\n statement.setInt(1, version);\n }\n });\n }", "@SuppressWarnings(\"unused\")\n private void setVersion(Long version) {\n this.version = version;\n }", "public void setVersionName(final String versionName) {\n setAttributeValue(ATTRIBUTE_VERSION_NAME, versionName);\n }", "protected void setPersistenceVersion(_Version_ persistenceVersion) {\n $persistenceVersion = persistenceVersion;\n }", "@Override\n\tpublic void setMvccVersion(long mvccVersion) {\n\t\t_userTracker.setMvccVersion(mvccVersion);\n\t}", "public void setVersionNumber(Long versionNumber){\r\n this.versionNumber = versionNumber;\r\n }", "public void setVersionNumber(Long versionNumber){\r\n this.versionNumber = versionNumber;\r\n }", "public void setClassVersion(final long classVersion) {\n \t\tthis.classVersion = classVersion;\n \t}", "public void setSaveVersion(int version)\n {\n saveVersion = version;\n }", "private void setNodeVersion(int nodeVersion) {\n this.nodeVersion = nodeVersion;\r\n }", "public void setVersion( String version )\n {\n this.version = version.toLowerCase( Locale.ENGLISH );\n }", "public void setVersion(int version)\n\t{\n\t\tconferenceInfo.setAttribute(VERSION_ATTR_NAME, Integer.toString(version));\n\t}", "public void setVersionValue(YangEnumeration versionValue)\n throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"version\",\n versionValue,\n childrenNames());\n }", "SchemaReference setVersionUuid(String uuid);", "@SystemApi\n @RequiresPermission(anyOf = {\n Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY,\n Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS\n })\n public void setRuntimePermissionsVersion(@IntRange(from = 0) int version) {\n try {\n mPackageManager.setRuntimePermissionsVersion(version, mContext.getUserId());\n } catch (RemoteException e) {\n throw e.rethrowFromSystemServer();\n }\n }", "public void setVersionPath(final UTF8String versionPath) {\n this.versionPath = versionPath;\n }", "public void setVersionValue(String versionValue) throws JNCException {\n setVersionValue(new YangEnumeration(versionValue, new String[] {\n \"9.5.0\",\n \"10.7.0\",\n }));\n }", "private void setChromeVersion(org.chromium.components.paint_preview.common.proto.PaintPreview.ChromeVersionProto value) {\n value.getClass();\n chromeVersion_ = value;\n bitField0_ |= 0x00000004;\n }", "public void setVersionNumber(String versionNumber) {\n this.versionNumber = versionNumber;\n }", "public void setSchemaVersion(int version) {\n this.SCHEMA_VERSION = version;\n }", "public void setVersionNumber(java.lang.String versionNumber) {\n this.versionNumber = versionNumber;\n }", "public void setVersionId(Long versionId) {\n this.versionId = versionId;\n }", "public void setSchemaVersion(Integer schemaVersion) {\n this.schemaVersion = schemaVersion;\n }", "public void setFaceModelVersion(String FaceModelVersion) {\n this.FaceModelVersion = FaceModelVersion;\n }", "void setApplicationVersion(java.lang.String applicationVersion);", "public void xsetVersion(org.apache.xmlbeans.XmlInteger version)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlInteger target = null;\r\n target = (org.apache.xmlbeans.XmlInteger)get_store().find_element_user(VERSION$6, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.XmlInteger)get_store().add_element_user(VERSION$6);\r\n }\r\n target.set(version);\r\n }\r\n }", "private void setVersion(long value) {\n bitField0_ |= 0x00000002;\n version_ = value;\n }", "public void incrementVersion() {\n this.version += 1;\n }", "public void setPluginVersion(String pluginVersion);", "public void setOrganizationVersion(java.lang.String organizationVersion)\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(ORGANIZATIONVERSION$6, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ORGANIZATIONVERSION$6);\r\n }\r\n target.setStringValue(organizationVersion);\r\n }\r\n }", "public void setStorageVolumeInfo(VPlexStorageVolumeInfo volumeInfo) {\n storageVolumeInfo = volumeInfo;\n }", "public void setVersionName(String versionName) {\n this.versionName = versionName;\n }", "public void setXpeContractVersion(String value) {\n setAttributeInternal(XPECONTRACTVERSION, value);\n }", "public void incrementVersion() {\n this.version++;\n }" ]
[ "0.66304547", "0.6111134", "0.5690452", "0.5671488", "0.5663193", "0.5652311", "0.5652311", "0.56423914", "0.56423914", "0.56423914", "0.56423914", "0.56423914", "0.56423914", "0.5628513", "0.5624613", "0.5622232", "0.56049615", "0.5590721", "0.55693555", "0.55693555", "0.55644894", "0.5524027", "0.5522239", "0.55130136", "0.55130136", "0.5498386", "0.5493724", "0.5493724", "0.5487831", "0.5475745", "0.54709184", "0.54585475", "0.5450327", "0.5450327", "0.5450327", "0.54316", "0.5425464", "0.54216295", "0.5415307", "0.54097694", "0.54096055", "0.53814393", "0.53753024", "0.5373702", "0.5354489", "0.5340755", "0.5325906", "0.5311393", "0.52970934", "0.5266424", "0.52469856", "0.5238234", "0.523398", "0.5200908", "0.5200908", "0.5200908", "0.5200908", "0.51962966", "0.51959693", "0.5191589", "0.5160491", "0.5137563", "0.5134974", "0.51209956", "0.5099535", "0.50956756", "0.5073479", "0.5065035", "0.5041809", "0.5015602", "0.500837", "0.50024694", "0.50024694", "0.49534616", "0.4946598", "0.49444807", "0.49169198", "0.49155012", "0.49093956", "0.48997995", "0.48674253", "0.4862656", "0.48481995", "0.4845642", "0.4837997", "0.483738", "0.4825258", "0.47948086", "0.47943375", "0.4785432", "0.47763455", "0.47693023", "0.47490022", "0.47438693", "0.47425598", "0.4738917", "0.47312537", "0.4726471", "0.47145832", "0.47117364" ]
0.6885689
0
Get the resourceGroup property: Resource group name of Recovery Services Vault.
public String resourceGroup() { return this.resourceGroup; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Schema(description = \"name of the linked resource group, if there is a link\")\n public String getResourceGroupName() {\n return resourceGroupName;\n }", "@Required\n public ResourceGroupResource getResourceGroup() {\n return resourceGroup;\n }", "String resourceGroupName();", "String resourceGroupName();", "String resourceGroupName();", "String resourceGroupName();", "String resourceGroupName();", "public String getGroupName(){\r\n return Validator.unescapeJava(this.groupName);\r\n }", "public String getSGroupName() {\n return sGroupName;\n }", "public String get_servicegroupname() throws Exception {\n\t\treturn this.servicegroupname;\n\t}", "public String getGroup() {\n return groupName;\n }", "java.lang.String getProductGroup();", "public java.lang.String getGroupname() {\n\treturn groupname;\n}", "public String getGroup ()\n {\n return group;\n }", "public String getGroup ()\n {\n return group;\n }", "public String getGroup() {\n return this.group;\n }", "public String getName()\n {\n return groupService.getName(this);\n }", "public String getGroup() {\n return group;\n }", "public String getGroup() {\n return group;\n }", "public String getGroup() {\n\t\treturn group;\n\t}", "public String getGroupKey() {\n return this.GroupKey;\n }", "public java.lang.String getServiceGroupName(){\n return localServiceGroupName;\n }", "public java.lang.String getGroupName() {\n return groupName;\n }", "public String getGroupName() {\n return groupName;\n }", "public String getGroupName() {\n return groupName;\n }", "public String getGroupName() {\n return groupName;\n }", "public String getGroupName()\n {\n return groupName;\n }", "public String getGroupKey() {\n return groupKey;\n }", "public String getGroupName() {\r\n return groupName;\r\n }", "public String getGroupName() {\n return groupName;\n }", "public String getGroupName() {\n return this.GroupName;\n }", "public String getGroupName() {\n\t\treturn groupName;\n\t}", "public String getGroupName();", "@Override\n public String getGroupName(int group) {\n assert 0 <= group && group < groupNames.length;\n \n return groupNames[group];\n }", "public String getSeGrpName() {\n return seGrpName;\n }", "public String getGroupName() {\n\t\t\treturn groupName;\n\t\t}", "public String getGroupKey() {\n StringWriter sw = new StringWriter();\n writeGroupKey(sw);\n return sw.toString();\n }", "public String getGroupUuid() {\n\t\treturn groupUuid;\n\t}", "public String getGroupPrincipalRoot() {\n return groupPrincipalRoot;\n }", "@Override\n\tpublic String getGroup() {\n\t\treturn \"Group_\"+SliceName(stdClass);\n\t}", "public String getGroupName() {\n GitLabGroupInfo groupInfo = getGroupInfo();\n return (groupInfo != null) ? groupInfo.getName() : \"<could not fetch group information>\";\n }", "protected String get_object_name() {\n\t\treturn this.servicegroupname;\n\t}", "public String getGroup() {\n if (overrideGroupKey != null) {\n return overrideGroupKey;\n }\n return getNotification().getGroup();\n }", "public String getGroupRole()\n {\n return this.groupRole;\n }", "public String getSGroupID() {\n return sGroupID;\n }", "public String getGroupname()\n {\n return group2d;\n }", "public String getAutoScalingGroup() {\n return this.autoScalingGroup;\n }", "public static String specifyGroup() {\n return holder.format(\"specifyGroup\");\n }", "public String group() { return group; }", "public String getOverrideGroupKey() {\n return overrideGroupKey;\n }", "@Nullable\n // Safe as we want to provide all getters being public for POJOs\n @SuppressWarnings({\"unused\", \"WeakerAccess\"})\n public final String getGroupName() {\n return groupName;\n }", "public String getGroupValue() {\n return this.GroupValue;\n }", "public String getOriginalName() {\n return group.getName();\n }", "java.lang.String getGroupId();", "java.lang.String getGroupId();", "public String getReaderGroup() {\n return (String)getAttributeInternal(READERGROUP);\n }", "public String getPolicyGroupName() \n {\n return policyGroupName;\n }", "public String getGroupPath() {\n GitLabGroupInfo groupInfo = getGroupInfo();\n return (groupInfo != null) ? groupInfo.getPath() : \"<could not fetch group information>\";\n }", "public final String getBgroup() {\n return String.valueOf(bgroup);\n }", "public String getResourceName() {\n\treturn this.resrcName;\n }", "public String getClGrpId() {\r\n return clGrpId;\r\n }", "public String getLogGroupName() {\n return this.logGroupName;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getBookGroup();", "public String getSeGrpUuid() {\n return seGrpUuid;\n }", "public Group getGroup() {\n return _group;\n }", "String getResourceBundleName() {\n return getPackageName() + \".\" + getShortName();\n }", "public GcGrouperSyncGroup getGcGrouperSyncGroup() {\r\n return gcGrouperSyncGroup;\r\n }", "public String getGroup();", "public java.lang.String getREGION()\n {\n \n return __REGION;\n }", "public String getClGrpId() {\r\n\t\treturn clGrpId;\r\n\t}", "public String getNamePrefix() {\n if ( group==null )\n return super.getNamePrefix();\n else\n return group.getNamePrefix();\n }", "public String getTargetGroup() {\n return targetGroup;\n }", "public String getAgentGroupName () {\n\t\treturn AGENT_GROUP_NAME;\n\t}", "public String getVechicleGroupNamePlaceholder() {\r\n\t\tString VechicleGroupNamePlaceholderText = safeGetAttribute(vehicleNameField.replace(\"vehicle_name\", \"group_name\"), \"placeholder\", SHORTWAIT);\r\n\t\tlog.info(\"get Vechicle Group Name placeholder \");\r\n\t\treturn VechicleGroupNamePlaceholderText;\r\n\t}", "public long getGroup()\r\n { return group; }", "public int getGroup() {\n return group;\n }", "public Optional<String> groupInstanceId() {\n return groupInstanceId;\n }", "public String getFullName() {\n return group + \".\" + name;\n }", "public Group getGroup() {\n return group;\n }", "public String getMainGroup() {\n\t\treturn _mainGroup;\n\t}", "public String getAllowedToUseGroup() {\r\n return this.allowedToUseGroup;\r\n }", "com.google.ads.googleads.v6.resources.AdGroupLabel getAdGroupLabel();", "public String getLocalizedName() {\n return resourceMap.getString(getLocalizationKey());\n }", "java.lang.String getGroup();", "public String getSubFundGroupCode() {\n return subFundGroupCode;\n }", "private String formatGroupName (String groupName) {\n\t\treturn groupName;\n\t}", "@DISPID(10)\r\n\t// = 0xa. The runtime will prefer the VTID if present\r\n\t@VTID(16)\r\n\tjava.lang.String groupName();", "public String getCardgroupSub() {\r\n return (String) getAttributeInternal(CARDGROUPSUB);\r\n }", "String getGroupId();", "String getGroupId();", "public String getCloudWatchLogGroupArn() {\n return this.cloudWatchLogGroupArn;\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; }" ]
[ "0.6907299", "0.6791356", "0.6643724", "0.6643724", "0.6643724", "0.6643724", "0.6643724", "0.6549782", "0.6375448", "0.6330586", "0.6268721", "0.62596136", "0.62405336", "0.62316555", "0.62316555", "0.6210558", "0.6208289", "0.6189037", "0.6189037", "0.6184322", "0.61622304", "0.6160676", "0.6129531", "0.6126415", "0.612033", "0.612033", "0.611899", "0.6108006", "0.6094189", "0.6092864", "0.60754025", "0.60522187", "0.6039083", "0.6012691", "0.6009247", "0.6007056", "0.600246", "0.59679073", "0.59040844", "0.5901095", "0.5870924", "0.5865145", "0.5831771", "0.581391", "0.57674384", "0.5732771", "0.5722548", "0.57059807", "0.5679294", "0.5658931", "0.56260455", "0.56243706", "0.5606448", "0.55884355", "0.55884355", "0.55866194", "0.5565018", "0.5564912", "0.5547548", "0.553927", "0.5528476", "0.5525122", "0.550942", "0.5506809", "0.5472891", "0.5440026", "0.5437199", "0.5417536", "0.54151386", "0.5414257", "0.53976655", "0.53856057", "0.53853536", "0.53835434", "0.53717655", "0.53586435", "0.5351237", "0.53502005", "0.5340929", "0.5333706", "0.5326293", "0.53257006", "0.53169024", "0.53088886", "0.5306802", "0.5303455", "0.5300477", "0.5300335", "0.5291503", "0.5291503", "0.5290935", "0.52884597", "0.52884597", "0.52884597", "0.52884597", "0.52884597", "0.52884597", "0.52884597", "0.52884597", "0.52884597" ]
0.7649839
0
Set the resourceGroup property: Resource group name of Recovery Services Vault.
public AzureStorageContainer withResourceGroup(String resourceGroup) { this.resourceGroup = resourceGroup; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String resourceGroup() {\n return this.resourceGroup;\n }", "@Required\n public ResourceGroupResource getResourceGroup() {\n return resourceGroup;\n }", "public void setGroupname(java.lang.String newGroupname) {\n\tgroupname = newGroupname;\n}", "public void setGroupName(String groupName){\r\n if (this.errorInString(groupName)) {\r\n this.addErrorMessage(0, \"Group name is incorrect.\");\r\n } else {\r\n this.groupName = Validator.escapeJava(groupName);\r\n setValidData(0, true);\r\n }\r\n }", "public void setGroup(String group) {\n if (group != null && group.trim().length() == 0) {\n throw new IllegalArgumentException(\n \"Group name cannot be an empty string.\");\n }\n\n if(group == null) {\n group = Scheduler.DEFAULT_GROUP;\n }\n\n this.group = group;\n this.key = null;\n }", "void setGroupName(String groupName) {\n this.groupName = new String(groupName);\n }", "public void setName(String name) {\n internalGroup.setName(name);\n }", "void setProductGroup(java.lang.String productGroup);", "public void setAuthorizationGroup(\n @Nullable\n final String authorizationGroup) {\n rememberChangedField(\"AuthorizationGroup\", this.authorizationGroup);\n this.authorizationGroup = authorizationGroup;\n }", "public void setGroupName(String newGroupName)\n {\n this.groupName = newGroupName;\n }", "@Schema(description = \"name of the linked resource group, if there is a link\")\n public String getResourceGroupName() {\n return resourceGroupName;\n }", "public void setServiceGroupName(java.lang.String param){\n localServiceGroupNameTracker = true;\n \n this.localServiceGroupName=param;\n \n\n }", "public void setGroup(String group) throws InvalidIDException {\r\n\t\tif (group == null) { return; }\r\n\r\n\t\tif (Arrays.binarySearch(Projects.GROUPS, group) < 0) {\r\n\t\t\tthrow new InvalidIDException(\"Attempt to insert an invalid group.\");\r\n\t\t}\r\n\r\n\t\tif (this.groups == null) { this.groups = new HashSet(); }\r\n\t\r\n\t\tthis.groups.add(group);\r\n\t}", "public static String specifyGroup() {\n return holder.format(\"specifyGroup\");\n }", "public void setGroupName(String GroupName) {\n this.GroupName = GroupName;\n }", "public void setLogGroup(String value)\n {\n logGroup = value;\n }", "public void setGroup(final Group group) {\n this.group = group;\n }", "WithResourceGroup withRegion(String location);", "WithResourceGroup withRegion(String location);", "public void setBookGroup(java.lang.String value);", "public String getSGroupName() {\n return sGroupName;\n }", "public void setGroupName(String name) {\n group.setName(name);\n }", "public String getGroupName() {\n return groupName;\n }", "public void setGroup(UserGroup group) {\n this.group = group;\n }", "public void setName(String name) throws SystemException {\n group.setName(name);\n ModelInputGroupLocalServiceUtil.updateModelInputGroup(group);\n }", "public void set_servicegroupname(String servicegroupname) throws Exception{\n\t\tthis.servicegroupname = servicegroupname;\n\t}", "public String getGroupName(){\r\n return Validator.unescapeJava(this.groupName);\r\n }", "public void setSGroupName(String sGroupName) {\n this.sGroupName = sGroupName;\n }", "public void overrideGroup(String group) {\n this.group = group;\n }", "public void setGroupKey(String GroupKey) {\n this.GroupKey = GroupKey;\n }", "public String getGroupName() {\n return groupName;\n }", "public String getGroupName() {\r\n return groupName;\r\n }", "public String getGroupName() {\n return groupName;\n }", "public String getGroupName() {\n return groupName;\n }", "public String getGroupName()\n {\n return groupName;\n }", "public String getGroupName() {\n return this.GroupName;\n }", "public void setGroupName(String groupName) {\n this.groupName = groupName;\n }", "public void setGroupName(String groupName) {\n this.groupName = groupName;\n }", "public void setGroupName(String groupName) {\r\n this.groupName = groupName == null ? null : groupName.trim();\r\n }", "WithResourceGroup withRegion(Region location);", "WithResourceGroup withRegion(Region location);", "public void setGroupName(java.lang.String groupName) {\n this.groupName = groupName;\n }", "public String getGroupName() {\n\t\treturn groupName;\n\t}", "public void setGroupService(\n com.liferay.portal.service.GroupService groupService) {\n this.groupService = groupService;\n }", "public void setNameGroup(int num)\n\t{\n\t\tsetGroup(_Prefix + HardZone.NAME.toString(), num);\n\t}", "public void setGroup(entity.Group value);", "protected void setResourceName(String resrcName) {\n\tthis.resrcName = resrcName;\n }", "void set(String group, String name, String style);", "public void setGroupName(String groupName) {\n\t\tthis.groupName = groupName;\n\t}", "public void setResourceBundleKey(String string) {\n throw new UnsupportedOperationException(\"Method is not implemented yet...\");\n }", "public void setGroupName(String groupName) {\n\t\t\tthis.groupName = groupName;\n\t\t}", "public String get_servicegroupname() throws Exception {\n\t\treturn this.servicegroupname;\n\t}", "public java.lang.String getServiceGroupName(){\n return localServiceGroupName;\n }", "public void setSpaceGroup(\n final org.edna.mxv1.xsdata.XSDataSpaceGroup spaceGroup) {\n this._spaceGroup = spaceGroup;\n }", "public java.lang.String getGroupName() {\n return groupName;\n }", "public String getGroupName();", "public String getGroupName() {\n\t\t\treturn groupName;\n\t\t}", "String resourceGroupName();", "String resourceGroupName();", "String resourceGroupName();", "String resourceGroupName();", "String resourceGroupName();", "void renameServerStoredContactGroup(ContactGroup group, String newName);", "public void setTargetGroup(String targetGroup) {\n this.targetGroup = targetGroup;\n }", "public void setGroupPrincipalRoot(String val) {\n groupPrincipalRoot = val;\n }", "public Volume volumeGroupRef(String volumeGroupRef) {\n this.volumeGroupRef = volumeGroupRef;\n return this;\n }", "public void setResourcePrincipalRoot(String val) {\n resourcePrincipalRoot = val;\n }", "public void setGcGrouperSyncGroup(GcGrouperSyncGroup gcGrouperSyncGroup) {\r\n this.gcGrouperSyncGroup = gcGrouperSyncGroup;\r\n }", "interface WithResourceGroup {\n /**\n * Specifies resourceGroupName.\n *\n * @param resourceGroupName The name of the resource group to lock.\n * @return the next definition stage.\n */\n WithLevel withExistingResourceGroup(String resourceGroupName);\n }", "public void setOverrideGroupKey(String overrideGroupKey) {\n this.overrideGroupKey = overrideGroupKey;\n groupKey = groupKey();\n }", "public void setLogGroup(int aNewGroup) {\n mLogGroup = aNewGroup;\n }", "void xsetProductGroup(x0401.oecdStandardAuditFileTaxPT1.SAFPTtextTypeMandatoryMax50Car productGroup);", "void deployGroup(String groupJson);", "public void setAutoScalingGroup(String autoScalingGroup) {\n this.autoScalingGroup = autoScalingGroup;\n }", "public void setGroup (int g) throws PPException{\n\t\t// this test is required because it is not tested in Unit_SetGroup(...)\n\t\tif (g < 0)\n\t\t\tthrow new PPException (\"setGroup -> invalid group, must be upper 0\");\n\t\telse\n\t\t\tif (PPNative.Unit_SetGroup (id, g) == -1)\n\t\t\t\tthrow new PPException (\"setGroup -> \"+PPNative.GetError());\n\t}", "@Override\n public String getEntityName() {\n return \"LicenseRoleGroup\";\n }", "public void setDefgrp_name(CArrayFacade<Byte> defgrp_name) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 128;\n\t\t} else {\n\t\t\t__dna__offset = 108;\n\t\t}\n\t\tif (__io__equals(defgrp_name, __io__address + __dna__offset)) {\n\t\t\treturn;\n\t\t} else if (__io__same__encoding(this, defgrp_name)) {\n\t\t\t__io__native__copy(__io__block, __io__address + __dna__offset, defgrp_name);\n\t\t} else {\n\t\t\t__io__generic__copy( getDefgrp_name(), defgrp_name);\n\t\t}\n\t}", "public void setRelatedGroup(RelatedGroup relatedGroup)\r\n\t{\r\n\t\tthis.relatedGroup = relatedGroup;\r\n\t}", "public String getGroup() {\n return groupName;\n }", "public String getOverrideGroupKey() {\n return overrideGroupKey;\n }", "public void setGroupDescription(java.lang.String groupDescription) {\n this.groupDescription = groupDescription;\n }", "@Override\n public String getGroupName(int group) {\n assert 0 <= group && group < groupNames.length;\n \n return groupNames[group];\n }", "public synchronized void setGroupLdap(String groupName) throws AmbariException {\n GroupEntity groupEntity = groupDAO.findGroupByName(groupName);\n if (groupEntity != null) {\n groupEntity.setGroupType(GroupType.LDAP);\n groupDAO.merge(groupEntity);\n } else {\n throw new AmbariException(\"Group \" + groupName + \" doesn't exist\");\n }\n }", "public void setSGroupID(String sGroupID) {\n this.sGroupID = sGroupID;\n }", "public void setReaderGroup(String value) {\n setAttributeInternal(READERGROUP, value);\n }", "public void setGroupcode(java.lang.Integer newGroup) {\n\tgroupcode = newGroup;\n}", "public void setEthnicGroup(String ethnicGroup){\n\t\tthis.ethnicGroup = ethnicGroup;\n\t}", "public void setGroupLocalService(\n com.liferay.portal.service.GroupLocalService groupLocalService) {\n this.groupLocalService = groupLocalService;\n }", "public void setCardgroupSub(String value) {\r\n setAttributeInternal(CARDGROUPSUB, value);\r\n }", "public void setGroupFunction(JSFunction groupFunction) {\r\n this.groupFunction = groupFunction;\r\n }", "void setGroupId(String groupId);", "public void setPolicyGroupName(String policyGroupName)\n {\n \tthis.policyGroupName = policyGroupName;\n }", "public void setGroupValue(String GroupValue) {\n this.GroupValue = GroupValue;\n }", "protected String get_object_name() {\n\t\treturn this.servicegroupname;\n\t}", "public void setContentGroupDescription(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), CONTENTGROUPDESCRIPTION, value);\r\n\t}", "java.lang.String getProductGroup();", "void setResourceID(String resourceID);", "public String getPolicyGroupName() \n {\n return policyGroupName;\n }", "public void setSeGrpName(String seGrpName) {\n this.seGrpName = seGrpName;\n }", "public void subscribeGroup(String subscribedGroup) {\n this.subscribedGroups.add(subscribedGroup);\n \n }" ]
[ "0.6121891", "0.5938587", "0.57397366", "0.5702268", "0.5639146", "0.56356734", "0.5625641", "0.56219083", "0.5537648", "0.55142146", "0.5414958", "0.539285", "0.5334615", "0.5295633", "0.528541", "0.5275282", "0.5268634", "0.5244341", "0.5244341", "0.52322006", "0.5189119", "0.5172807", "0.51707447", "0.51614434", "0.51340586", "0.51312715", "0.5130029", "0.5123332", "0.5118739", "0.5117601", "0.51107925", "0.5109411", "0.50728905", "0.50728905", "0.5059021", "0.503699", "0.50335234", "0.50335234", "0.5012029", "0.49919924", "0.49919924", "0.49613667", "0.49367368", "0.49354565", "0.49291897", "0.49077624", "0.49044928", "0.48990494", "0.48961732", "0.48831633", "0.4879036", "0.48723426", "0.48635837", "0.48577315", "0.48436007", "0.48429844", "0.48396936", "0.48355603", "0.48355603", "0.48355603", "0.48355603", "0.48355603", "0.4832818", "0.48295662", "0.482179", "0.48149973", "0.48096615", "0.4809392", "0.48041412", "0.47852728", "0.47846627", "0.4782434", "0.4782322", "0.47755527", "0.47631484", "0.47619224", "0.47587174", "0.47557685", "0.4740096", "0.47344786", "0.4727399", "0.47137147", "0.46965277", "0.46819973", "0.4669232", "0.4619918", "0.46146414", "0.46035755", "0.4599935", "0.45803192", "0.45746863", "0.45664993", "0.45638284", "0.45620105", "0.45591778", "0.4556414", "0.45496118", "0.45491776", "0.45488477", "0.45415884" ]
0.5857808
2
Get the protectedItemCount property: Number of items backed up in this container.
public Long protectedItemCount() { return this.protectedItemCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Integer getTotalItemCount() {\n return totalItemCount;\n }", "public AzureStorageContainer withProtectedItemCount(Long protectedItemCount) {\n this.protectedItemCount = protectedItemCount;\n return this;\n }", "public int getItemsCount() {\n return items_.size();\n }", "public int getItemsCount() {\n return items_.size();\n }", "public int getItemsCount() {\n return items_.size();\n }", "public int getNumberOfItems() {\r\n return decorItems.size();\r\n }", "public long getNbTotalItems() {\n return nbTotalItems;\n }", "public long getItemCount() {\n\t\treturn this.getSize(data);\n\t}", "public Integer getPageItemCount() {\n return pageItemCount;\n }", "public int size() {\n return nItems;\n }", "public Integer getItemcount() {\n return itemcount;\n }", "public int size()\r\n {\r\n return nItems;\r\n }", "@Override\n\tpublic int numerOfItems() {\n\t\treturn usersDAO.numerOfItems();\n\t}", "public int getTotalItems()\n {\n return totalItems;\n }", "public int size() {\n return numItems;\n }", "public int length() {\n return numberOfItems;\n }", "public int getItemsCount() {\n if (itemsBuilder_ == null) {\n return items_.size();\n } else {\n return itemsBuilder_.getCount();\n }\n }", "int getItemsCount();", "int getItemsCount();", "public int size()\r\n\t{\r\n\t\treturn numItems;\r\n\r\n\t}", "public int length() {\n\n\t\treturn numItems;\n\n\t}", "public int getItemCount() {\n checkWidget();\n return OS.SendMessage(handle, OS.TCM_GETITEMCOUNT, 0, 0);\n }", "public int size() {\r\n if (NumItems > Integer.MAX_VALUE) {\r\n return Integer.MAX_VALUE;\r\n }\r\n return NumItems;\r\n }", "public int size() {\n \treturn numItems;\n }", "@Override\n\tpublic int size() {\n\n\t\treturn this.numOfItems;\n\t}", "public Integer getInterestedInItemsCount();", "public int getSize() {\n synchronized (itemsList) {\n return itemsList.size();\n }\n }", "@Override\n\tpublic int size() {\n\t\treturn numItems;// numItems represents size\n\t}", "@Override\r\n\tpublic int size() {\r\n\t\treturn numItems;\r\n\t}", "@Override\n public int getSize() {\n return this.numItems;\n }", "int getProtectedPodCount();", "public int getBottomNavigationNbItems() {\n\t\treturn bottomNavigation.getItemsCount();\n\t}", "@Nonnegative\n public int getSize()\n {\n return items.size();\n }", "public Long getProcessedItemCount() {\n return this.processedItemCount;\n }", "@Override\n public int getSize() {\n return numItems;\n }", "public int getNumberOfItems() {\n \t\treturn regions.size();\n \t}", "default int countItems() {\n return countItems(StandardStackFilters.ALL);\n }", "public int size(){\n return numItems;\n }", "public int numberOfItems()\n {\n return dessertList.size();\n }", "public int size() {\n return items.size();\n }", "public int getMaxItems()\n {\n return maxItems;\n }", "public int size() {\r\n return items.size();\r\n }", "public int size() {\r\n return items.size();\r\n }", "public int listAmount() {\n return count;\n }", "public int getCount() {\n \t Log.i(TAG, \"getCount() called\");\n return provide.getItemCache().getCount();\n }", "public Integer getCount() {\n\t\treturn count;\n\t}", "public Integer getCount() {\n\t\treturn count;\n\t}", "public Integer getCount() {\n return this.count;\n }", "public int getCount() {\n\t\t\treturn this.count;\n\t\t}", "public Long getImportedItemCount() {\n return this.importedItemCount;\n }", "public int getPurchasedListCount()\r\n\t{\r\n\t\treturn m_purechaseList.size();\r\n\t}", "int getNumItems();", "public NM getNumberOfItemsPerUnit() { \r\n\t\tNM retVal = this.getTypedField(14, 0);\r\n\t\treturn retVal;\r\n }", "public int getSize() {\r\n return list.getItemCount();\r\n }", "public int getItemListLength() {\n\t\treturn inventoryList.size();\n\t}", "public Integer getMaxItems() {\n\t\treturn maxItems;\n\t}", "public int getItems() {\n return items;\n }", "public int size() {\n synchronized (this.base) {\n return this.base.size();\n }\n }", "public Integer getCount() {\n return count;\n }", "public Integer getCount() {\n return count;\n }", "public Integer getCount() {\n return count;\n }", "public Integer getCount() {\n return count;\n }", "public Integer getCount() {\n return count;\n }", "public Integer getCount() {\n return count;\n }", "public int getNumberOfItemObjects() {\r\n\t\treturn itemFileVersions.size();\r\n\t}", "public int getCount() {\n\t\treturn this.count;\n\t}", "public int getCount() {\n\t\treturn this.count;\n\t}", "public synchronized int getCount()\n\t{\n\t\treturn count;\n\t}", "public int getFlammableItemCount() {\n return flammableItemCount;\n }", "public int getAccessCount() {\n return discAccesses;\n }", "public int getItemCount() {\n if (itemBuilder_ == null) {\n return item_.size();\n } else {\n return itemBuilder_.getCount();\n }\n }", "public int getInventorySize() {\r\n\t\treturn items.size();\r\n\t}", "public abstract int getItemCount();", "public int getCount() \r\n\t{\r\n\t\tSystem.out.print(\"The number of book in the Array is \");\r\n\t\treturn numItems;\r\n\t\t\r\n\t}", "public int size() {\n maintain();\n return collection.size();\n }", "public int getCount() {\n\t\treturn Dispatch.get(object, \"Count\").getInt();\n\t}", "public int getCount() {\n return app.getItems().length;\n }", "public int getReaultCount() {\n if (reaultBuilder_ == null) {\n return reault_.size();\n } else {\n return reaultBuilder_.getCount();\n }\n }", "public Long getCount() {\n return this.Count;\n }", "public int getItemCount() {\n\t\treturn _items.size();\n\t}", "public int getCount() {\n\t\t\treturn count;\n\t\t}", "public Integer getCount() {\n return count;\n }", "public int getCount() {\r\n\t\tif(!isValid)\r\n\t\t\treturn -1;\r\n\t\treturn count;\r\n\t}", "public int getTotalCount() {\n return totalCount;\n }", "public int getInventoryLength() {\n return items.length;\n }", "public long getCount() {\r\n return count;\r\n }", "public int getReaultCount() {\n return reault_.size();\n }", "public int getItemCount() {\n\t\treturn itemCount;\n\t}", "public long getCount() {\n return count_;\n }", "public long getCount()\n\t{\n\t\treturn count;\n\t}", "@Override\n public int size() {\n return (totalSize - offset);\n }", "public int size(){ return itemCount;}", "public int getSnapshotSize()throws DataSnapshotException{\r\n \tint backedupCount=0; \r\n \t try {\r\n \t\t// Enumeration names = ss.names();\r\n\t\t\tfor (Enumeration names = ss.names(); names.hasMoreElements();) {\r\n\t\t\t\tnames.nextElement();\r\n\t\t\t\tbackedupCount++;\r\n\t\t\t }\r\n\t\t}catch (SettingsStorageException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\t throw new DataSnapshotException(\"settings store failure\", e);\r\n\t\t}\r\n\t\treturn backedupCount;\r\n }", "public int getCount() {\r\n\t\treturn count;\r\n\t}", "public int getCount() {\r\n\t\treturn count;\r\n\t}", "public long getCount() {\n return count;\n }", "public long getCount() {\n return count;\n }", "public Integer getGoodsBalanceCount() {\n return goodsBalanceCount;\n }", "public Long getCount() {\r\n return count;\r\n }", "public int getInventorySize(){\n return inventory.size();\n }" ]
[ "0.70415944", "0.69993436", "0.680884", "0.680884", "0.6802272", "0.6796758", "0.67068535", "0.66406167", "0.66303396", "0.6600612", "0.65914106", "0.65506476", "0.6544392", "0.65017456", "0.6476313", "0.6464716", "0.6459021", "0.64583975", "0.64583975", "0.6444198", "0.64340043", "0.6383548", "0.63638973", "0.6360189", "0.6348091", "0.63465786", "0.63097066", "0.626862", "0.6260814", "0.62419695", "0.6213298", "0.62035835", "0.6189994", "0.6177016", "0.61551046", "0.6153051", "0.6134916", "0.6112617", "0.610726", "0.60638696", "0.605624", "0.6055847", "0.6055847", "0.6026373", "0.6013924", "0.60114783", "0.60114783", "0.60114294", "0.6008176", "0.60019225", "0.6001693", "0.5979914", "0.5972979", "0.59645057", "0.5963505", "0.5945374", "0.5944883", "0.5944061", "0.59074295", "0.59074295", "0.59074295", "0.59074295", "0.59074295", "0.59074295", "0.5892626", "0.5876193", "0.5876193", "0.58761257", "0.5875708", "0.58726656", "0.586247", "0.5862128", "0.5854645", "0.5852677", "0.58492815", "0.58454174", "0.58419156", "0.5837337", "0.58317393", "0.5829423", "0.58237666", "0.5820825", "0.5813466", "0.58122486", "0.58079743", "0.58067065", "0.5805316", "0.58038896", "0.58008164", "0.57992417", "0.5798556", "0.5776025", "0.5763774", "0.57609636", "0.57609636", "0.57580227", "0.57580227", "0.5752021", "0.5751412", "0.5750401" ]
0.86882615
0
Set the protectedItemCount property: Number of items backed up in this container.
public AzureStorageContainer withProtectedItemCount(Long protectedItemCount) { this.protectedItemCount = protectedItemCount; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Long protectedItemCount() {\n return this.protectedItemCount;\n }", "public void setTotalItemCount(Integer totalItemCount) {\n this.totalItemCount = totalItemCount;\n }", "public void setPageItemCount(Integer pageItemCount) {\n this.pageItemCount = pageItemCount;\n }", "public void setNbTotalItems(long value) {\n this.nbTotalItems = value;\n }", "public void setItemcount(Integer itemcount) {\n this.itemcount = itemcount;\n }", "public void setProcessedItemCount(Long processedItemCount) {\n this.processedItemCount = processedItemCount;\n }", "@attribute(value = \"\", required = false, defaultValue=\"SWT default\")\r\n\tpublic void setVisibleItemCount(Integer count) {\r\n\t\tcombo.setVisibleItemCount(count);\r\n\t}", "public void setFlammableItemCount(int flammableItemCount) {\n this.flammableItemCount = flammableItemCount;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setCount(int newCount) {\r\n\t\tcount = newCount;\r\n\t}", "public void setImportedItemCount(Long importedItemCount) {\n this.importedItemCount = importedItemCount;\n }", "public void setCount(int count)\r\n\t{\r\n\t}", "public void setNumOfMenuItems(int _numOfMenuItems){\n numOfMenuItems = _numOfMenuItems;\n }", "public Integer getItemcount() {\n return itemcount;\n }", "public void adjustItemCount(int direction, int count) throws JposException;", "@Override\n public int getSize() {\n return numItems;\n }", "public int getItemsCount() {\n return items_.size();\n }", "public int getItemsCount() {\n return items_.size();\n }", "public int size() {\n return nItems;\n }", "public int getNumberOfItems() {\r\n return decorItems.size();\r\n }", "public long getNbTotalItems() {\n return nbTotalItems;\n }", "public Integer getTotalItemCount() {\n return totalItemCount;\n }", "@Override\n\tpublic int numerOfItems() {\n\t\treturn usersDAO.numerOfItems();\n\t}", "public int getItemsCount() {\n return items_.size();\n }", "public int size()\r\n {\r\n return nItems;\r\n }", "public void setITEM(int value) {\r\n this.item = value;\r\n }", "@Override\n public int getSize() {\n return this.numItems;\n }", "public Builder setItemStorage(int value) {\n bitField0_ |= 0x00000040;\n itemStorage_ = value;\n onChanged();\n return this;\n }", "public void setItem(@NotNull Usable usable, int i) {\n checkIndex(i);\n\n if (items[i] == null) {\n size++;\n }\n\n items[i] = usable;\n }", "@Override\r\n\tpublic int size() {\r\n\t\treturn numItems;\r\n\t}", "@BindAttribute(name = \"itemsPerPage\")\n\tpublic void setItemsPerPage(int itemsPerPage) {\n\t\tthis.itemsPerPage = itemsPerPage;\n\t}", "public int size() {\n return numItems;\n }", "public void setNumberOfAvailableFiles(int value) {\n this.numberOfAvailableFiles = value;\n }", "public void setItemsQuantity(Integer itemsQuantity) {\r\n this.itemsQuantity = itemsQuantity;\r\n }", "public void setCount() {\n\t\tLinkedListIterator iter = new LinkedListIterator(this.head);\n\t\tint currentSize = 1;\n\t\twhile (iter.hasNext()) {\n\t\t\titer.next();\n\t\t\tcurrentSize++;\n\t\t}\n\t\tthis.size = currentSize;\n\t}", "void updateInitialSortedCount(int sortedCount) {\n this.initialSortedCount = sortedCount;\n }", "public void resetItemCount(int direction) throws JposException;", "public int size() {\n \treturn numItems;\n }", "public int size()\r\n\t{\r\n\t\treturn numItems;\r\n\r\n\t}", "public Integer getPageItemCount() {\n return pageItemCount;\n }", "public int length() {\n return numberOfItems;\n }", "void SetItemNumber(int ItemNumber);", "public Builder setNumOfStorageMessage(int value) {\n \n numOfStorageMessage_ = value;\n onChanged();\n return this;\n }", "public Builder setNumOfStorageMessage(int value) {\n \n numOfStorageMessage_ = value;\n onChanged();\n return this;\n }", "public void setCount(int count) {\r\n this.count = count;\r\n }", "public void setListSize(int value) {\n this.listSize = value;\n }", "public void setCount(int count)\r\n {\r\n this.count = count;\r\n }", "@Override\n\tpublic int size() {\n\t\treturn numItems;// numItems represents size\n\t}", "@Override\n public int getItemCount() {\n return mNumberItems;\n }", "@Override\r\n public void ItemQuantity(int quantity) {\n this.quantity = quantity;\r\n }", "int getProtectedPodCount();", "public Builder setItems(\n int index, int value) {\n ensureItemsIsMutable();\n items_.set(index, value);\n onChanged();\n return this;\n }", "public int getTotalItems()\n {\n return totalItems;\n }", "void setAccessCounter(int cnt);", "int getItemsCount();", "int getItemsCount();", "public void setCount(int count)\n {\n this.count = count;\n }", "@Override\n\tpublic int size() {\n\n\t\treturn this.numOfItems;\n\t}", "public int size(){\n return numItems;\n }", "void setNoOfBuckets(int noOfBuckets);", "public void setDesiredCount(Integer desiredCount) {\n this.desiredCount = desiredCount;\n }", "public void setCount(Integer count) {\r\n this.count = count;\r\n }", "public int getMaxItems()\n {\n return maxItems;\n }", "public int getFlammableItemCount() {\n return flammableItemCount;\n }", "public void setMaxConcurrentAccessCount(String newValue);", "@Override\r\n\tpublic int getMenCount() {\n\t\treturn 5;\r\n\t}", "public void setCounter(int value) { \n\t\tthis.count = value;\n\t}", "public void setChildCount (int childCount) {\n this.childCount = childCount;\n }", "void setNumberOfArtillery(int artillery);", "public void setScannedCount(Integer scannedCount) {\n this.scannedCount = scannedCount;\n }", "public int numberOfItems()\n {\n return dessertList.size();\n }", "public abstract int getItemCount();", "private void setLikesCount(int value) {\n \n likesCount_ = value;\n }", "public int length() {\n\n\t\treturn numItems;\n\n\t}", "public void setCount(int count) {\n this.count = count;\n }", "public void setCount(int count) {\n this.count = count;\n }", "public void setCount(int count) {\n this.count = count;\n }", "public void setCount(int count) {\n this.count = count;\n }", "public void setCount(int count) {\n this.count = count;\n }", "public void resetCounts() {\n // For each item in the RecyclerView\n for(int pos = 0; pos < numItems; pos++) {\n // Reset the count variable of the item\n DataStorage.listInUse.getList().get(pos).reset();\n notifyItemChanged(pos);\n }\n }", "public Integer getInterestedInItemsCount();", "public long getItemCount() {\n\t\treturn this.getSize(data);\n\t}", "public void setRemainingData(int value) {\n this.remainingData = value;\n }", "public void set_count(int value) {\n setUIntBEElement(offsetBits_count(), 16, value);\n }", "public void setCount(final int c) {\n\t\tcount = c;\n\t}", "public static void setCount(int aCount) {\n count = aCount;\n }", "public void setCount(int count){\n\t\tthis.count = count;\n\t}", "void setReplicaCount(String clusterName, ClusterSpec clusterSpec, int replicaLimit);", "public int getItemsCount() {\n if (itemsBuilder_ == null) {\n return items_.size();\n } else {\n return itemsBuilder_.getCount();\n }\n }", "public void setSize(int value) {\n\t\tthis.size = value;\n\t}", "public int getItemCount()\n {\n return Math.min(cats.size(), 5);\n }", "public void setNumberShips(int numberShips);", "public final void setBagCount(int bagCount) {\n if(bagCount < 1) {\n throw new IllegalArgumentException(\n \"bag count must be greater than or equal to one\");\n }\n this.bagCount = bagCount;\n }", "public Builder setNumOfChunks(int value) {\n \n numOfChunks_ = value;\n onChanged();\n return this;\n }", "public void setLength( int length ) { setCapacity( length ); this.length = length; }", "public void setCount(Integer count) {\n this.count = count;\n }", "public void setCount(Integer count) {\n this.count = count;\n }", "public void setCount(Integer count) {\n this.count = count;\n }" ]
[ "0.7371295", "0.6106742", "0.5872875", "0.58551633", "0.56514627", "0.55503863", "0.554048", "0.5409785", "0.53982556", "0.53982556", "0.53982556", "0.5255959", "0.52387923", "0.52252424", "0.5210488", "0.5174071", "0.51708305", "0.514955", "0.5149433", "0.5149433", "0.514161", "0.5139861", "0.5136255", "0.5127886", "0.5115067", "0.51039666", "0.50821775", "0.50190324", "0.50007653", "0.49937263", "0.49923953", "0.4966264", "0.49641287", "0.4963057", "0.49627107", "0.49481133", "0.4947122", "0.49382108", "0.49379885", "0.4930871", "0.49247432", "0.49132589", "0.4909756", "0.49091563", "0.49030322", "0.49030322", "0.48548812", "0.48488155", "0.4832512", "0.48287737", "0.48219743", "0.48205853", "0.4819991", "0.48098058", "0.4802777", "0.4793494", "0.47924957", "0.47924957", "0.47912788", "0.47912225", "0.47902706", "0.47870806", "0.47715378", "0.47653523", "0.47608534", "0.47580647", "0.47524503", "0.47421777", "0.474047", "0.47401443", "0.47363994", "0.47312272", "0.47283566", "0.4725503", "0.47226667", "0.47203997", "0.47203773", "0.47203773", "0.47203773", "0.47203773", "0.47203773", "0.47195578", "0.4709247", "0.4695592", "0.4694907", "0.46892387", "0.46872064", "0.4676224", "0.4665847", "0.46643502", "0.4653262", "0.46522087", "0.46477908", "0.46469983", "0.4643374", "0.46347654", "0.46321815", "0.463054", "0.463054", "0.463054" ]
0.7927125
0
Get the acquireStorageAccountLock property: Whether storage account lock is to be acquired for this container or not.
public AcquireStorageAccountLock acquireStorageAccountLock() { return this.acquireStorageAccountLock; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LockStorage getLockStorage();", "public Lock getLock() {\n return lock;\n }", "public AzureStorageContainer withAcquireStorageAccountLock(AcquireStorageAccountLock acquireStorageAccountLock) {\n this.acquireStorageAccountLock = acquireStorageAccountLock;\n return this;\n }", "public boolean GetIsLock()\n {\n return this._lock;\n }", "public Lock getLock();", "public boolean isLockEnabled() {\r\n\t\treturn lockEnabled;\r\n\t}", "public boolean isLock() {\n return isLock;\n }", "public boolean acquireLock() {\n ValueOperations<String, String> valueOps = redisTemplate.opsForValue();\n boolean result = valueOps.setIfAbsent(lockKey, \"1\");\n // assume that : result == true means fetch the lock.else other server fetch the lock\n if (result == true) {\n long lockLiveTime = Utils.lockKeyLivetimeInMillisecond.get();\n valueOps.set(lockKey, \"2\", lockLiveTime, TimeUnit.MILLISECONDS);\n LOGGER.info(\"fetch redis distribution_lock [{}] suceess,set lock live [{}]ms \", lockKey, lockLiveTime);\n fetch = true;\n }\n return result;\n }", "final public Lock test_get_lock() {\r\n\t\treturn lock_;\r\n\t}", "@Override\n\tpublic Lock getLock() {\n\t\treturn this.lock;\n\t}", "public long getLockStatus() {\r\n return lockStatus;\r\n }", "public String getLockType() {\n return this.lockType;\n }", "public final long lock() {\n explicitlyLocked = true;\n return byteBase.longLockPointer();\n }", "@ManyToOne\n\t@JoinColumn(name=\"LockStatus\", nullable=false)\n\t@Fetch(FetchMode.SELECT)\n\t@NotFound(action=NotFoundAction.IGNORE)\n\tpublic AccessStatus getLockStatus() {\n\t\treturn this.lockStatus;\n\t}", "public Object getLock() {\n return dataLock;\n }", "public Integer getLockFlag() {\n return lockFlag;\n }", "public Integer getLockFlag() {\n return lockFlag;\n }", "public Integer getLockFlag() {\n return lockFlag;\n }", "Lock getLock(String lockName);", "public String getLockId() {\n return lockId;\n }", "public java.lang.String getLocalLock() {\r\n return localLock;\r\n }", "public @NotNull ReentrantLock getLock() {\n return lock;\n }", "protected synchronized Lock acquireLock() {\n\t\tacquireReadLock();\n\t\treturn new Lock();\n\t}", "public ApplicationLockLevel lockLevel() {\n return this.lockLevel;\n }", "public Object getHierarchyLock() {\n return hierarchyLock;\n }", "public final boolean getLocked() {\n return locked;\n }", "public SimpleLock readLock() {\n\n\t\treturn readerLock;\n\t}", "Boolean isConsumeLockEntity();", "@NonNull\r\n public final Object getSeaLock() {\r\n return f_seaLock;\r\n }", "public Lock getLoginInitLock()\n {\n return loginInitLock;\n }", "public LockingMode lockingMode() {\n return lockingMode;\n }", "public abstract ReentrantLock getLock();", "@ReturnsLock(\"RW\")\n public ReadWriteLock getLock() {\n return rwLock;\n }", "public StorageAccount storageAccount() {\n return this.storageAccount;\n }", "public StorageAccount storageAccount() {\n return this.storageAccount;\n }", "public boolean isLockerEnable(){\n return getBooleanValue(KEY_LOCKER_ENABLE);\n }", "public Boolean getLocked() throws NotLoadedException {\n return locked.getValue();\n }", "final Object getLockObject() {\n return timeManager;\n }", "public String getLockUser() {\n return lockUser;\n }", "public boolean isComposerLockAnalyzerEnabled() {\n return composerLockAnalyzerEnabled;\n }", "public final OpLockDetails getOpLock() {\n\t\treturn m_oplock;\n\t}", "public boolean getLocked() {\n\t\treturn isLocked;\n\t}", "protected final Object getTreeLock() {\n return Component.LOCK;\n }", "@Override\n\tpublic LockModeType getLockMode(Object entity) {\n\t\treturn null;\n\t}", "public @Bool boolean getLocked()\n\t\tthrows PropertyNotPresentException;", "protected boolean isLock() {\r\n return Lock.isLock(this.getBlock());\r\n }", "private Object getLockObject(IAnnotationModel annotationModel) {\n if (annotationModel instanceof ISynchronizable) {\n Object lock = ((ISynchronizable) annotationModel).getLockObject();\n if (lock != null) {\n return lock;\n }\n }\n return annotationModel;\n }", "public java.lang.Boolean getStoragePolicySupported() {\r\n return storagePolicySupported;\r\n }", "public int getLockon() {\r\n return lockon;\r\n }", "public String storageAccount() {\n return this.storageAccount;\n }", "Lock getLockByKey(String key);", "public Long getLockNum() {\n return lockNum;\n }", "String getLockOwner();", "protected boolean lockAcquired() {\n if (locked.compareAndSet(false, true)) {\n lastInserts.clear();\n lastInactivations.clear();\n lastUpdateCase = null;\n return true;\n } else\n return false;\n }", "PLock getLock() {\n return getTextBuffer().getLock();\n }", "public java.lang.Boolean getStorageIORMSupported() {\r\n return storageIORMSupported;\r\n }", "void getLock(QName lockQName, String lockToken, long timeToLive);", "public String isLockedFor() {\n return (lockId == null ? \"\" : lockId);\n }", "LockState checkLock(long extLockId) throws LockException {\n try {\n return txnManager.getMS().checkLock(extLockId).getState();\n } catch (TException e) {\n throw new LockException(ErrorMsg.METASTORE_COMMUNICATION_FAILED.getMsg(),\n e);\n }\n }", "public java.lang.String getGlobLock() {\r\n return globLock;\r\n }", "public void setLockEnabled(boolean lockEnabled) {\r\n\t\tthis.lockEnabled = lockEnabled;\r\n\t}", "public interface PreemptiveLock {\n\n /**\n * 尝试获得锁\n * @return 是否成功获得锁\n * @param lock\n */\n boolean getLock(String lock);\n\n /**\n * 释放锁\n * @param lock\n */\n void releaseLock(String lock);\n}", "@NonNull\n public StorageReference getStorage() {\n return getTask().getStorage();\n }", "public boolean isResolveLock() {\n\t\treturn resolveLock;\n\t}", "void acquireActiveEntityReadLock(LockList locks, DataverseName dataverseName, String entityName)\n throws AlgebricksException;", "Lock getComponentAccessTokenLock();", "public boolean getlock()\r\n\t{\r\n\t\tif(cnt > 10)\r\n\t\t{\r\n\t\t\tcnt = 0;\r\n\t\t\treturn unlocked;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean needsStoragePermission();", "public int haveALock() {\n\t\tString status = getField(NMEASentence.STATUS);\n\t\tif (status==null) return NO_INFO_RE_A_LOCK;\n\t\tif ( StringUtil.equalsIgnoreCase(status,\"V\") ) {\n\t\t\treturn DONT_HAVE_A_LOCK;\n\t\t}\n\t\telse if ( StringUtil.equalsIgnoreCase(status,\"A\") ) {\n\t\t\treturn HAVE_A_LOCK;\n\t\t}\n\t\treturn NO_INFO_RE_A_LOCK;\n\t}", "public boolean isLocked() {\r\n return isLocked;\r\n }", "public static ScheduledTaskLock getTaskLock(ScheduledTask task){\r\n\t\treturn task.lock;\r\n\t}", "public boolean isLocked() {\n return isLocked;\n }", "public boolean isLocked() {\n return (lockId == null ? false : true);\n }", "public boolean isLocked() { return RMUtils.boolValue(get(\"Locked\")); }", "public java.lang.String getXlock () {\n\t\treturn xlock;\n\t}", "public LockOnChange getLockOnChangeMode(){\r\n return this.lockOnChangeMode;\r\n }", "public Date getLockTime() {\n\t\treturn lockTime;\n\t}", "public FileStorageAccount getAccount() {\n return account;\n }", "public interface Lock {\n\n boolean acquire();\n\n boolean release();\n}", "public boolean isLocked() {\n return mLocked;\n }", "public boolean isLocked() {\n return mLocked;\n }", "public String storageAccountVersion() {\n return this.storageAccountVersion;\n }", "@Override\n\tpublic boolean isLocked() { The lock file must be manually deleted.\n\t\t//\n\t\treturn lockFile.exists();\n\t}", "protected RowLock getReadLockType() \n {\n\t\treturn(RowLock.RS3);\n }", "public boolean isLocked();", "public CacheKey acquireLock(Vector primaryKey, boolean forMerge) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n // bug 3094912 get must be synchronized as well\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n cacheKey.acquire(forMerge);\n put(cacheKey);\n return cacheKey;\n }\n }\n\n // code removed as key will never be null here, either one will be found or one created\n key.acquire();\n\n return key;\n }", "public boolean sharedLock() throws FileSystemInabilityToLockException {\n \n // get read-only file channel\n try {\n channel = new RandomAccessFile(file, \"r\").getChannel();\n }\n catch (IOException e) {\n logger.debug(\"Unable to lock file (could not open read only file channel)\");\n return false;\n }\n // get shared lock (third argument is true)\n try {\n lock = channel.tryLock(0, Long.MAX_VALUE, true);\n if (lock == null) {\n logger.debug(\"Unable to lock file because there is already a lock active.\");\n return false;\n }\n }\n catch (ClosedChannelException e) {\n logger.debug(\"Unable to lock file because the file channel is closed.\");\n return false;\n }\n catch (OverlappingFileLockException e) {\n logger.debug(\"Unable to lock file because you already have a lock on this file.\");\n return false;\n }\n catch (IOException e) {\n logger.debug(\"Unable to lock file: \" + e.getMessage());\n if(throwExceptionOnUnknownFailure)\n throw new FileSystemInabilityToLockException(e.getMessage(),e);\n else\n return false;\n }\n return true;\n }", "public Map<String, Boolean> getLockedOperations() {\n return this.lockedOperations;\n }", "public @Bool boolean isLocked()\r\n\t\tthrows PropertyNotPresentException;", "public boolean isLocked()\n\t{\n\t\treturn locked;\n\t}", "public LockManager getLockManager(SrvSession sess, TreeConnection tree) {\n \n // Return the file state lock manager\n \n return _lockManager;\n }", "@Override\n public int acquire() {\n final long stamp = allocatorLock.writeLock();\n try {\n return acquire0();\n } finally {\n allocatorLock.unlockWrite(stamp);\n }\n }", "public LockOperation[] getLocks() {\n return locks;\n }", "@Override\n public ActiveLock getLock(Type type, Scope scope) {\n ActiveLock lock = null;\n if (Type.WRITE.equals(type)) {\n try {\n if (!exists()) {\n log.warn(\"Unable to retrieve lock: no item found at '\" + getResourcePath() + \"'\");\n } else if (((Node) item).isLocked()) {\n Lock jcrLock = ((Node) item).getLock();\n lock = new JcrActiveLock(jcrLock);\n DavResourceLocator locator = super.getLocator();\n String lockroot = locator\n .getFactory()\n .createResourceLocator(locator.getPrefix(), locator.getWorkspacePath(), jcrLock.getNode().getPath(),\n false).getHref(false);\n lock.setLockroot(lockroot);\n }\n } catch (AccessDeniedException e) {\n log.error(\"Error while accessing resource lock: \"+e.getMessage());\n } catch (UnsupportedRepositoryOperationException e) {\n log.error(\"Error while accessing resource lock: \"+e.getMessage());\n } catch (RepositoryException e) {\n log.error(\"Error while accessing resource lock: \"+e.getMessage());\n }\n } else {\n lock = super.getLock(type, scope);\n }\n return lock;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isExportLock();", "protected String getLockManagerName() {\n return getName();\n }", "String getLockOrientationPref();", "public Locks acquire() throws Exception {\n\t\t\n\t\tif( DB.getConf().getBoolean(\"locks.disabled\")) return this;\n\t\tSemaphore waitHere = new Semaphore(0);\n\t\tthreadPark.put( lockId, waitHere);\t\n\t\ttry {\n\t\t\tproxy.tell( new RequestLock( this), ActorRef.noSender());\n\t\t\twaitHere.acquire();\n\t\t\tthis.acquired = new Date();\n\t\t} catch(Exception e){\n\t\t\tlog.info( \"Exception while waiting for lock\", e );\n\t\t\tthrow new Exception( \"Failed to get the lock!!\");\n\t\t} finally {\n\t\t\t// thread not parked any more\n\t\t\tthreadPark.remove(lockId);\n\t\t}\n\t\treturn this;\n\t}", "public JobServiceBusAuthentication getAuthentication() {\n return this.authentication;\n }", "boolean isLocked();" ]
[ "0.6449969", "0.6003888", "0.5971392", "0.5910408", "0.58773017", "0.5853716", "0.5790235", "0.5732046", "0.5589428", "0.55805063", "0.5577632", "0.55497104", "0.5495123", "0.54612565", "0.54179996", "0.54168767", "0.54168767", "0.54168767", "0.5398495", "0.53818184", "0.5357528", "0.53090024", "0.5285516", "0.5249863", "0.5238583", "0.5231214", "0.5181571", "0.5173769", "0.51583517", "0.5129812", "0.50926113", "0.5080225", "0.5066172", "0.50628203", "0.50628203", "0.50626796", "0.50523704", "0.50431585", "0.50421304", "0.5030219", "0.50244707", "0.50232834", "0.50145555", "0.50122213", "0.5008875", "0.49997112", "0.49933055", "0.49910772", "0.49563178", "0.49332857", "0.49295083", "0.49287313", "0.49221098", "0.49189413", "0.4904253", "0.48942527", "0.4890226", "0.48888302", "0.48514667", "0.48119563", "0.4804241", "0.4794648", "0.47920102", "0.47612277", "0.47552067", "0.4748184", "0.47462502", "0.4743697", "0.47424152", "0.47417283", "0.47410238", "0.47280085", "0.47266746", "0.47153354", "0.47112888", "0.47046417", "0.46839657", "0.46691108", "0.46673438", "0.46645278", "0.46645278", "0.46555084", "0.4641872", "0.46365294", "0.46337917", "0.46232462", "0.46213335", "0.4611462", "0.46092042", "0.4607487", "0.4597709", "0.45817792", "0.45762348", "0.45727825", "0.45690042", "0.4564646", "0.45611012", "0.45512214", "0.45477661", "0.45399743" ]
0.7944835
0
Set the acquireStorageAccountLock property: Whether storage account lock is to be acquired for this container or not.
public AzureStorageContainer withAcquireStorageAccountLock(AcquireStorageAccountLock acquireStorageAccountLock) { this.acquireStorageAccountLock = acquireStorageAccountLock; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AcquireStorageAccountLock acquireStorageAccountLock() {\n return this.acquireStorageAccountLock;\n }", "public void setLockEnabled(boolean lockEnabled) {\r\n\t\tthis.lockEnabled = lockEnabled;\r\n\t}", "public void SetIsLock(boolean isLock)\n {\n this._lock = isLock;\n }", "@Override\r\n\tpublic void onLock(boolean lock) {\n\t\tthis.lock = lock;\r\n\t}", "LockStorage getLockStorage();", "public boolean acquireLock() {\n ValueOperations<String, String> valueOps = redisTemplate.opsForValue();\n boolean result = valueOps.setIfAbsent(lockKey, \"1\");\n // assume that : result == true means fetch the lock.else other server fetch the lock\n if (result == true) {\n long lockLiveTime = Utils.lockKeyLivetimeInMillisecond.get();\n valueOps.set(lockKey, \"2\", lockLiveTime, TimeUnit.MILLISECONDS);\n LOGGER.info(\"fetch redis distribution_lock [{}] suceess,set lock live [{}]ms \", lockKey, lockLiveTime);\n fetch = true;\n }\n return result;\n }", "public void setGlobLock(java.lang.String globLock) {\r\n this.globLock = globLock;\r\n }", "public void setLockUser(String lockUser) {\n this.lockUser = lockUser == null ? null : lockUser.trim();\n }", "public void setLockOnChangeMode(LockOnChange lockOnChangeMode){\r\n this.lockOnChangeMode = lockOnChangeMode;\r\n }", "@NonNull\n public T setLockOrientation(boolean lockOrientation) {\n mLockOrientation = lockOrientation;\n return (T) this;\n }", "public void setComposerLockAnalyzerEnabled(boolean composerLockAnalyzerEnabled) {\n this.composerLockAnalyzerEnabled = composerLockAnalyzerEnabled;\n }", "public void setResolveLock(boolean resolveLock) {\n\t\tthis.resolveLock = resolveLock;\n\t}", "protected void lock() {\n semaphore = new Semaphore(0);\n try {\n semaphore.acquire();\n }\n catch(InterruptedException e) {\n System.out.println(\"Trouble for request of semaphore acquirement\");\n e.printStackTrace();\n }\n }", "public void setLockId(String lockId) {\n this.lockId = lockId;\n }", "public void setLockStatus(long lockStatus) {\r\n this.lockStatus = lockStatus;\r\n }", "@Pointcut(value = \"@annotation(lock)\", argNames = \"lock\")\n public void lockPointcut(Lock lock) {\n }", "public void lock() {\n\t\tlocked = true;\n\t}", "void lockGranted(LockHandle lockHandle);", "public void setLockFlag(Integer aLockFlag) {\n lockFlag = aLockFlag;\n }", "public void setLockFlag(Integer aLockFlag) {\n lockFlag = aLockFlag;\n }", "public void setLockFlag(Integer aLockFlag) {\n lockFlag = aLockFlag;\n }", "void acquireActiveEntityReadLock(LockList locks, DataverseName dataverseName, String entityName)\n throws AlgebricksException;", "@Override\n public void setLockOwner(Object lockOwner) {\n }", "void acquireMergePolicyReadLock(LockList locks, String mergePolicyName) throws AlgebricksException;", "public void acquireLock() throws LockException {\n\t\tlong[] err = new long[1];\n\t\tDpsHelper dps = null;\n\t\t\n\t\ttry {\n\t\t\tdps = DpsHelperHolder.getDpsHelper();\n\t\t\tdps.dlAcquireLock(id, err);\n\t\t} catch(Exception e) {\n\t\t\t// Either dps cannot be initialized or acquireLock went wrong.\n\t\t\t// An error code of 65534 indicates that this error occurred inside\n\t\t\t// the dps JNI glue layer and not inside the actual lock functions.\n\t\t\tthrow new LockException(65534, e.getMessage());\n\t\t}\n\t\t\n\t\tif (err[0] != 0) {\n\t\t\tthrow new LockException(dps.dlGetLastDistributedLockErrorCode(), \n\t\t\t\t\tdps.dlGetLastDistributedLockErrorString());\n\t\t}\n\t\t\n\t\treturn;\t\n\t}", "public void setLockSchemaCache(boolean aBoolean) {\n\t\tcat.debug(\"Setting lockSchemaCache to: \" + aBoolean);\n\n\t\tif (aBoolean) {\n\t\t\tgrammarPool.lockPool();\n\t\t}\n\t\telse {\n\t\t\tgrammarPool.unlockPool();\n\t\t}\n\t}", "CamelJpaConsumerBindingModel setConsumeLockEntity(Boolean consumeLockEntity);", "public void setLocalLock(java.lang.String localLock) {\r\n this.localLock = localLock;\r\n }", "void acquireActiveEntityWriteLock(LockList locks, DataverseName dataverseName, String entityName)\n throws AlgebricksException;", "Lock getLock(String lockName);", "@Override\n\tpublic void lock(Object entity, LockModeType lockMode, Map<String, Object> properties) {\n\t\t\n\t}", "@Override\n\tpublic void lock(Object entity, LockModeType lockMode) {\n\t\t\n\t}", "public void lockGarage()\n {\n m_bGarageLock = true;\n }", "public void setLockKey( Long lockKey ) {\n this.lockKey = lockKey;\n }", "public void setExportLock(java.lang.Boolean value);", "public LockSync(Lock sharedLock) {\n lock = Objects.requireNonNull(sharedLock);\n }", "@NonNull\n public T setIsSmartLockEnabled(boolean enableCredentials, boolean enableHints) {\n mEnableCredentials = enableCredentials;\n mEnableHints = enableHints;\n return (T) this;\n }", "@Override\n public void extend(int holdSec, LockCallback callback) {\n synchronized (this) {\n if (isUnavailable()) {\n return;\n }\n\n logger.info(\"lock granted: {}\", this);\n setState(LockState.ACTIVE);\n setHoldSec(holdSec);\n setCallback(callback);\n }\n\n notifyAvailable();\n }", "public interface PreemptiveLock {\n\n /**\n * 尝试获得锁\n * @return 是否成功获得锁\n * @param lock\n */\n boolean getLock(String lock);\n\n /**\n * 释放锁\n * @param lock\n */\n void releaseLock(String lock);\n}", "void acquireDatasetReadLock(LockList locks, DataverseName dataverseName, String datasetName)\n throws AlgebricksException;", "public boolean isLockEnabled() {\r\n\t\treturn lockEnabled;\r\n\t}", "@ManyToOne\n\t@JoinColumn(name=\"LockStatus\", nullable=false)\n\t@Fetch(FetchMode.SELECT)\n\t@NotFound(action=NotFoundAction.IGNORE)\n\tpublic AccessStatus getLockStatus() {\n\t\treturn this.lockStatus;\n\t}", "public void lock() {\n\n }", "public void setTmpLock(boolean tmpLock) {\n \t\tthis.tmpLock = tmpLock;\n \t}", "public void openLock(){\n /*Code to send an unlocking signal to the physical device Gate*/\n }", "protected synchronized Lock acquireLock() {\n\t\tacquireReadLock();\n\t\treturn new Lock();\n\t}", "@Override\n public void lock() {\n Preconditions.checkState(connection != null);\n if (!tryLock(lockGetTimeout(), TimeUnit.MILLISECONDS)) {\n Monitoring.increment(errorCounter.name(), (KeyValuePair<String, String>[]) null);\n throw new LockException(String.format(\"[%s][%s] Timeout getting lock.\", id().getNamespace(), id().getName()));\n }\n }", "public synchronized void acquireWakeLock() {\n if (wakeLock == null) {\n PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);\n wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, \"tag\");\n }\n Logger.d(\"PowerLock acquired\");\n wakeLock.acquire();\n }", "public void setLockTime(Date lockTime) {\n\t\tthis.lockTime = lockTime;\n\t}", "void acquireLibraryReadLock(LockList locks, DataverseName dataverseName, String libraryName)\n throws AlgebricksException;", "public Lock getLock();", "public String getLockType() {\n return this.lockType;\n }", "public Lock getLock() {\n return lock;\n }", "public Locks acquire() throws Exception {\n\t\t\n\t\tif( DB.getConf().getBoolean(\"locks.disabled\")) return this;\n\t\tSemaphore waitHere = new Semaphore(0);\n\t\tthreadPark.put( lockId, waitHere);\t\n\t\ttry {\n\t\t\tproxy.tell( new RequestLock( this), ActorRef.noSender());\n\t\t\twaitHere.acquire();\n\t\t\tthis.acquired = new Date();\n\t\t} catch(Exception e){\n\t\t\tlog.info( \"Exception while waiting for lock\", e );\n\t\t\tthrow new Exception( \"Failed to get the lock!!\");\n\t\t} finally {\n\t\t\t// thread not parked any more\n\t\t\tthreadPark.remove(lockId);\n\t\t}\n\t\treturn this;\n\t}", "final public Lock test_get_lock() {\r\n\t\treturn lock_;\r\n\t}", "void getLock(QName lockQName, String lockToken, long timeToLive);", "public void addLock(I_MemoryLock lock);", "public Locks acquire(int millis ) throws Exception {\n\t\tSemaphore waitHere = new Semaphore(0);\n\t\tthreadPark.put( lockId, waitHere);\t\n\t\ttry {\n\t\t\tproxy.tell( new RequestLock( this), ActorRef.noSender());\n\t\t\tboolean success = waitHere.tryAcquire(millis, TimeUnit.MILLISECONDS );\n\t\t\tif( !success) throw new Exception();\n\t\t\tthis.acquired = new Date();\n\t\t} catch(Exception e){\n\t\t\t// I don't hold the lock ...\n\t\t\t// it could happen that there is a second release send for this lock, this should not \n\t\t\t// be a problem\n\t\t\tproxy.tell( new ReleaseLock(lockId), ActorRef.noSender());\n\t\t\t\n\t\t\tlog.info( \"Exception while waiting for lock\", e );\n\t\t\tthrow new Exception( \"Failed to get the lock!!\");\n\t\t\t\n\t\t} finally {\n\t\t\t// thread not parked any more\n\t\t\t\tthreadPark.remove(lockId);\t\t\n\t\t}\n\t\treturn this;\n\t}", "public void acquireLock(double leaseTime, double maxWaitTimeToAquireLock) throws LockException {\n\t\tlong[] err = new long[1];\n\t\tDpsHelper dps = null;\n\t\t\n\t\ttry {\n\t\t\tdps = DpsHelperHolder.getDpsHelper();\n\t\t\tdps.dlAcquireLock(id, leaseTime, maxWaitTimeToAquireLock, err);\n\t\t} catch(Exception e) {\n\t\t\t// Either dps cannot be initialized or acquireLock went wrong.\n\t\t\t// An error code of 65534 indicates that this error occurred inside\n\t\t\t// the dps JNI glue layer and not inside the actual lock functions.\n\t\t\tthrow new LockException(65534, e.getMessage());\n\t\t}\n\t\t\n\t\tif (err[0] != 0) {\n\t\t\tthrow new LockException(dps.dlGetLastDistributedLockErrorCode(), \n\t\t\t\t\tdps.dlGetLastDistributedLockErrorString());\n\t\t}\n\t\t\n\t\treturn;\t\n\t}", "public boolean lockShell(String lockId) {\n if (this.lockId == null) {\n this.lockId = lockId;\n return true;\n }\n\n return false;\n }", "void acquireDataTypeReadLock(LockList locks, DataverseName dataverseName, String datatypeName)\n throws AlgebricksException;", "void acquireDatasetModifyLock(LockList locks, DataverseName dataverseName, String datasetName)\n throws AlgebricksException;", "@Override\n \tpublic void setInputLock(boolean lock) {\n \t\tselector.getSuggestBox().getTextBox().setReadOnly(lock);\n \t}", "public static void setLockManagerActorRef(ActorRef lockManager) {\n\t\tglobalLockManagerActorRef = lockManager;\n\t}", "public final long lock() {\n explicitlyLocked = true;\n return byteBase.longLockPointer();\n }", "public void setAuthLockTime(Date authLockTime) {\n this.authLockTime = authLockTime;\n }", "public void setLock_latency(Long lock_latency) {\n this.lock_latency = lock_latency;\n }", "public void setLocked(boolean locked)\n\t{\n\t\tthis.locked = locked;\n\t}", "@Override\r\n\tpublic void addLockToken(String lt) {\n\t\t\r\n\t}", "public String getLockId() {\n return lockId;\n }", "public boolean lockContainer(\n Transaction t, \n ContainerHandle container, \n boolean waitForLock,\n boolean forUpdate)\n\t\tthrows StandardException \n {\n\t\tObject qualifier = forUpdate ? ContainerLock.CIX : ContainerLock.CIS;\n\n\t\tboolean gotLock = \n lf.lockObject(\n t.getCompatibilitySpace(), t, container.getId(), qualifier,\n waitForLock ? C_LockFactory.TIMED_WAIT : C_LockFactory.NO_WAIT);\n\n\t\tif (gotLock) {\n\t\t\t// look for covering table locks\n\t\t\t// CIS is covered by CX or CS\n\t\t\t// CIX is covered by CX\n\n\t\t\tif (lf.isLockHeld(t.getCompatibilitySpace(), t, container.getId(), ContainerLock.CX) ||\n\t\t\t\t((!forUpdate) && lf.isLockHeld(t.getCompatibilitySpace(), t, container.getId(), ContainerLock.CS))) {\n\n\n\t\t\t\tcontainer.setLockingPolicy(NO_LOCK);\n\t\t\t}\n\t\t}\n\n\t\treturn gotLock;\n\n\t}", "public void setPoolLocked(boolean lockingState){poolLocked=lockingState;}", "public final synchronized void setOpLock(OpLockDetails oplock)\n\t\tthrows ExistingOpLockException {\n\n\t\tif ( m_oplock == null)\n\t\t\tm_oplock = oplock;\n\t\telse\n\t\t\tthrow new ExistingOpLockException();\n\t}", "public void lock() {\r\n super.lock();\r\n }", "public interface Lock {\n\n boolean acquire();\n\n boolean release();\n}", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "protected void acquirePrimaryOperationPermit(\n final IndexShard primary,\n final Request request,\n final ActionListener<Releasable> onAcquired\n ) {\n primary.acquirePrimaryOperationPermit(onAcquired, executor, request, forceExecutionOnPrimary);\n }", "public void setLockNum(Long lockNum) {\n this.lockNum = lockNum;\n }", "Lock getLockByKey(String key);", "void acquireDataverseReadLock(LockList locks, DataverseName dataverseName) throws AlgebricksException;", "@Test\r\n\tpublic final void testSetLock() {\r\n\t\tlistener.setLock();\r\n\t\tassertFalse(\"Listener should be locked\",listener.isLocked());\r\n\t}", "public void lock(final int key, final String entityType, final String userName, final String uuid, final Session session) {\n try {\n\n S_LCK_TBL myLock = new S_LCK_TBL(key, entityType);\n S_LCK_TBL existingLock = (S_LCK_TBL) get(session, S_LCK_TBL.class, myLock);\n\n if (existingLock != null) {\n if (!existingLock.getDbSession().trim().equals(uuid.trim()) && !existingLock.getUserName().trim().equals(userName.trim()))\n throw new RecordInUseException();\n else if (existingLock.getDbSession().trim().equals(uuid.trim()) && existingLock.getUserName().trim().equals(userName.trim()))\n return;\n else if (!existingLock.getDbSession().trim().equals(uuid.trim()) && existingLock.getUserName().trim().equals(userName.trim())) { //sessione appesa/vecchia\n existingLock.markDeleted();\n persistByStatus(existingLock, session);\n }\n }\n\n myLock.setDbSession(uuid);\n myLock.setUserName(userName);\n myLock.markNew();\n persistByStatus(myLock, session);\n\n } catch (HibernateException e) {\n throw new DataAccessException(e);\n }\n }", "public void lockVertexProperties(Agent ag) {\n\tVertex actualVertex = getVertexFor(ag);\n\n\tif(getVertexPropertiesOwner(actualVertex) == ag)\n\t throw new IllegalStateException(\"Try to lock a WhiteBoard\"\n\t\t\t\t\t + \"already locked by me\"); \n\n\telse {\n\t synchronized(actualVertex) {\n\t\twhile(vertexPropertiesLocked(actualVertex)) {\n\t\t \n\t\t try {\n\t\t\tactualVertex.wait();\n\t\t } catch(InterruptedException e) {\n\t\t\tthrow new SimulationAbortError(e);\n\t\t }\n\t\t}\n\t\tlockedVertices.put(actualVertex, ag);\n\t }\n\t}\n }", "public GcpLock createLock(String blob, long timeout, TimeUnit unit) throws InterruptedException {\n return new GcpLock(storage, bucketName, blob, timeout, unit);\n }", "void acquireAdapterReadLock(LockList locks, DataverseName dataverseName, String adapterName)\n throws AlgebricksException;", "public void setLockUserid(String lockUserid) {\n\t\tthis.lockUserid = lockUserid == null ? null : lockUserid.trim();\n\t}", "protected final void lock(boolean writeLock) {\n Lock lock = writeLock ? m_lock.writeLock() : m_lock.readLock();\n lock.lock();\n }", "void lock(Connection con, EnterpriseObject eo, boolean lock)\n throws DataModifiedException {\n try {\n if ((!lock) || (eo == null) || (con.getAutoCommit())) {\n return; // no locking, no revision update\n\n }\n SBR sbr = eo.getSBR();\n String euid = eo.getEUID();\n Integer revisionNumber = sbr.getRevisionNumber();\n lockSBR(con, euid, revisionNumber);\n sbr.setRevisionNumber(sbr.getRevisionNumber().intValue() + 1);\n } catch (ObjectException ex) {\n throw new DataModifiedException(mLocalizer.t(\"OPS523: Could not lock \" +\n \"EnterpriseObject: {0}\", ex));\n } catch (SQLException se) {\n throw new DataModifiedException(mLocalizer.t(\"OPS524: Could not lock \" +\n \"EnterpriseObject: {0}\", se));\n }\n }", "public void lock() {\n islandLocked = true;\n }", "public void setIsLocked(\r\n\t\t\t@Bool Boolean locked);", "public CacheKey acquireLock(Vector primaryKey, boolean forMerge) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n // bug 3094912 get must be synchronized as well\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n cacheKey.acquire(forMerge);\n put(cacheKey);\n return cacheKey;\n }\n }\n\n // code removed as key will never be null here, either one will be found or one created\n key.acquire();\n\n return key;\n }", "public void setSuggestRotationEnabled(boolean suggestRotationEnabled) \n throws LockedException {\n if (isLocked()) {\n throw new LockedException();\n }\n mSuggestRotationEnabled = suggestRotationEnabled;\n if (suggestRotationEnabled && mSuggestedRotationValue == null) {\n mSuggestedRotationValue = new Quaternion();\n }\n \n }", "Lock getComponentAccessTokenLock();", "void acquireFeedPolicyReadLock(LockList locks, DataverseName dataverseName, String feedPolicyName)\n throws AlgebricksException;", "public void lock(View view) {\n \t\n \t// Do not perform lock unless there's a unlocked doc chosen.\n \tif (mObjects.getUnlockedDoc() == null)\n \t\treturn;\n \t\n \ttry {\n\t\t\tmObjects.setWaitingKey(mObjects.getCurrentDocumentKey());\n\t\t\tLockedDocument locked = service.lockDocument(mObjects.getCurrentDocumentKey());\n\t\t\t\n\t\t\t// If expected document is returned.\n\t\t\tif (locked.getKey().equals(mObjects.getCurrentDocumentKey())) {\n\t\t\t\tmObjects.addStatusList(\"Lock retrieved for document.\");\n\t\t\t\tmObjects.setLockedDoc(locked);\n\t\t\t\tsetView(locked);\n\t\t\t} else {\n\t\t\t\t// Otherwise, unlock the locked document.\n\t\t\t\tmObjects.addStatusList(\"Got lock for document which is no longer active. Releasing lock.\");\n\t\t\t\treleaseLock(locked);\n\t\t\t}\n\t\t} catch (InvalidRequest e) {\n\t\t\tToast.makeText(this, \"Error retrieving lock\", Toast.LENGTH_LONG).show();\n\t\t\tmObjects.addStatusList(\"Error retrieving lock: \" + e.getMessage());\n\t\t} catch (LockUnavailable e) {\n\t\t\tToast.makeText(this, \"Lock unavailable...Please wait\", Toast.LENGTH_LONG).show();\n\t\t\tmObjects.addStatusList(\"Lock unavailable...Please wait\");\n\t\t}\n }", "public void setLocked(boolean value) {\n\t\tisLocked = value;\n\t}", "void acquireDatasetCreateIndexLock(LockList locks, DataverseName dataverseName, String datasetName)\n throws AlgebricksException;", "public void setXlock (java.lang.String xlock) {\n\t\tthis.xlock = xlock;\n\t}" ]
[ "0.66581136", "0.60749286", "0.56118697", "0.54700965", "0.5222175", "0.5163634", "0.5124443", "0.510799", "0.51010156", "0.50884813", "0.50882214", "0.5084642", "0.5013334", "0.49807593", "0.49610958", "0.4913178", "0.48920727", "0.48893115", "0.4844648", "0.4844648", "0.4844648", "0.48419374", "0.48332402", "0.47707373", "0.4738968", "0.4734423", "0.47255793", "0.47195056", "0.47153804", "0.47063944", "0.47033408", "0.4685767", "0.4665473", "0.46605936", "0.46599618", "0.46580607", "0.4657488", "0.46571833", "0.4650496", "0.4643579", "0.46389565", "0.46223006", "0.4614008", "0.4606248", "0.45978022", "0.45884028", "0.4586122", "0.45707425", "0.45704466", "0.4560398", "0.45559964", "0.45271376", "0.45223442", "0.45207104", "0.45145795", "0.45082542", "0.45054486", "0.4500673", "0.44994324", "0.44972515", "0.44962156", "0.44773886", "0.4455299", "0.44396842", "0.44396833", "0.44302213", "0.44109005", "0.440362", "0.44008398", "0.43957457", "0.43901405", "0.43827012", "0.43671292", "0.4365513", "0.43644565", "0.4363369", "0.4363369", "0.4363369", "0.43555158", "0.4349569", "0.43440485", "0.4342226", "0.43408173", "0.433936", "0.4338458", "0.43358168", "0.43353596", "0.43306115", "0.43226022", "0.43222794", "0.4320895", "0.4316897", "0.43113208", "0.43098444", "0.43098027", "0.4309271", "0.43023866", "0.43014514", "0.42987132", "0.4296251" ]
0.69975615
0
Main method for testing
public static void main(String[] args) { String[] documents = readDocuments("data/collection.txt"); System.out.println("Shakespeare's Sonnets"); for (int i = 0; i < documents.length; i++) { System.out.println(i + "> " + documents[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void main() {\n MainApp.main(new String[] {});\n }", "public static void main(String[] args) {\n // PUT YOUR TEST CODE HERE\n }", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n GOL_Main.main(args);\n }", "public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }", "public static void main(String[] args) {\r\n// Use for unit testing\r\n }", "public static void main(String[] args) {\r\n // 2. Call your method in various ways to test it here.\r\n }", "@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}", "public static void main() {\n \n }", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n Calculadora_teste.main(args);\n \n }", "public static void main(String[] args) {\n //init\n Client.getLayerIntersectDao().getConfig().getIntersectionFile(null);\n\n //tests\n TestLayers();\n// TestFields();\n// TestObjects();\n// TestDistributions();\n// TestDistributionData();\n// TestDistributionShapes();\n// TestObjNames();\n }", "public static void main()\n\t{\n\t}", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public static void main(String args[]){\n\t\tTestingUtils.runTests();\n\t\t\n\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n Cic.main(args);\n \n }", "@Test\t\n\tpublic void testMain() {\n\n\t\tSystem.out.println(\"hello\");\n\t}", "@org.junit.Test\n public void main() throws Exception {\n DosEquis.main(null);\n }", "@Test\r\n\tpublic void mainTest(){\r\n\t\tMain m = new Main();\r\n\t\tm.main(null);\r\n\t}", "@Test\n public void main() {\n System.out.println(\"main\");\n String[] args = null;\n SaalHelper.main(args);\n }", "public Main() {\n \n \n }", "public static void main() {\n }", "public static void main(){\n\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n SServer.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n RefSystemGUI.main(args);\n }", "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) {\n\t\tSystem.out.println(\"Just testing\");\r\n\t\t//lisää kommenttia\r\n\t\t\r\n\t}", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n CashRegister.main(args);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "@Test\n\tpublic void testMain() {\n\t}", "public static void main(String[] args) {\r\n\t\tSystem.out.println(\"Testing Calculator\");\r\n\t\ttestConstructors();\r\n\t\ttestSetters();\r\n\t\ttestGetters();\r\n\t\ttestToString();\r\n\t}", "public static void main(String[] args) {\n inOrbitDestinationControllerTest();\n// inOrbitReplayControllerTest();\n\n }", "public static void main(String[] args) {\n\n experiment();\n }", "public static void main(String... args) throws Exception {\n //testHelloWorld();\n //testExchange();\n //testParentChild();\n //testLinking();\n //testListener();\n //testParse(\"1\");\n //testOuterInner();\n //testResourceARM();\n //testExecuteAround();\n testExecuteAroundARM();\n }", "public Main() {\r\n\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n LoginRegister.main(args);\n }", "@Test\r\n public void testMain() {\r\n System.out.println(\"main\");\r\n String[] args = null;\r\n Prog4.main(args);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "public static void main(String[] args) {\n \n \n \n \n }", "public Main() {}", "private Main() {\n\n super();\n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args) {\n\t\trun();\n\t\t//runTest();\n\n\t}", "public static void main(String[] args) {\n\t\tTestST st2 = TestST.getInstance();\r\n\t}", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main (String []args){\n }", "public static void main(String[] args) {\n\t\ttestStreamMapReduce();\r\n\t\t//testMethodReference();\r\n\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = new String[]{\"-i\", \"-p\", \"src/test/resources/problems_resp.xml\", \"src/test/resources/context.txt\"};\n PrintStream prev = System.out;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n System.setOut(new PrintStream(bos));\n XpathGenerator.main(args);\n System.setOut(prev);\n System.out.println(bos.toString());\n assertTrue(bos.toString().startsWith(\"/fhir:Bundle[1]\"));\n }", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }", "public static void main(String[] args) {}", "public static void main(String[] args) {}", "public static void main(String[] args)\n {\n try\n {\n TestRunner.run(isuite());\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "@Test\n public void run_main(){\n\n String resource_folder = (new File(\"src/test/resources/\")).getAbsolutePath()+ File.separator ;\n\n String[] args = new String[7];\n args[0] = \"-run\";\n args[1] = resource_folder + \"test_configs/line_ctm.xml\";\n args[2] = \"mytest\";\n args[3] = resource_folder+\"sample_output_request.xml\";\n args[4] = \"temp\";\n args[5] = \"0\";\n args[6] = \"100\";\n\n OTM.main(args);\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tglobalTest();\n//\t\ttimeTest();\n//\t\ttestPrefixSearch();\n//\t\ttestSearch();\n//\t\ttestPrediction();\n//\t\ttestTrieSearch();\n//\t\ttestRebuid();\n//\t\ttest13();\n//\t\ttest14();\n\t}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n WarPlane.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public Main() {\r\n }", "public Main() {\r\n }", "public static void main(String argv[]) {\n \r\n PolicyTest bmt = new PolicyTest();\r\n\r\n bmt.create_minibase();\r\n\r\n // run all the test cases\r\n System.out.println(\"\\n\" + \"Running \" + TEST_NAME + \"...\");\r\n boolean status = PASS;\r\n status &= bmt.test1();\r\n \r\n bmt = new PolicyTest();\r\n bmt.create_minibase();\r\n status &= bmt.test2();\r\n\r\n // display the final results\r\n System.out.println();\r\n if (status != PASS) {\r\n System.out.println(\"Error(s) encountered during \" + TEST_NAME + \".\");\r\n } else {\r\n System.out.println(\"All \" + TEST_NAME + \" completed successfully!\");\r\n }\r\n\r\n }", "public static void main(String[] args) {\n\t\ttest();\n\t}", "public static void main(String[] args) {\n basePath = MatcherTest.class.getClassLoader().getResource(\"\").getPath() + \"/\";\n\n String russianPath = basePath + \"russianArticlesTokenizedShort-2.txt\";\n String ruOriginalPath = basePath + \"newRussianArticles.json\";\n String englishPath = basePath + \"englishArticlesTokenized.txt\";\n String enOriginalPath = basePath + \"englishArticles.txt\";\n\n String titleExpert = basePath + \"titleExpert.json\";\n String expertPath = basePath + \"matchExpert.json\";\n String articlePath = basePath + \"testMatchRussian3.json\";\n\n getRussianTokenized(russianPath);\n getRussianOriginal(ruOriginalPath);\n getEnglishTokenized(englishPath);\n getEnglishOriginal(enOriginalPath);\n// matchTitles(titleExpert);\n// matchArticles(articlePath);\n// matchTest(expertPath, articlePath);\n matchArticlesRussian(articlePath);\n ArticleClass.PlayMusic();\n }", "public Main() {\n\t\tsuper();\n\t}", "@Test\n public void testMain() throws Exception {\n //main function cannot be tested as it is dependant on user input\n System.out.println(\"main\");\n }", "public static void main(String[] args)\r\t{", "public static void main(String[] args) {\n\ttest(tests);\n }", "public static void main(String[] args) {\n \n \n \n\t}", "public static void main(String[] args) {\r\n\t\t// test method\r\n\t\tNewFeatures newFeatures = new NewFeatures();\r\n\t\tnewFeatures.testingArrayList();\r\n\t\tnewFeatures.testingTryCatch();\r\n\t\tnewFeatures.testingNumericValues();\r\n\t\tnewFeatures.testingSwitchWithStringStatemant();\r\n\r\n\t}", "public static void main(String[] args) {\n DatabaseCommunicator test = new DatabaseCommunicator();\n// HashMap<String,LabTest> methods = test.getMethods();\n// System.out.println(methods.get(\"mingi labTest\").getMatrix());\n LabTest labTest = new LabTest();\n ArrayList testData = test.fileReader();\n DatabaseCommunicator.testSendingToDatabase(test, labTest, testData);\n }", "public static void main(String []args){\n\n }", "public static void main(String[] args) {\n new TSL2550Test();\n }", "@Test\r\n public void testMain() {\r\n System.out.println(\"main\");\r\n String[] args = null;\r\n ChessMain.main(args);\r\n // TODO review the generated test code and remove the default call to fail.\r\n \r\n }", "public static void main(String []args){\n }", "public static void main(String []args){\n }", "public static void main(String[] args){\n Api api = Factory.createApi(1);\n api.operation(\"using factory now\");\n\n System.out.println(\"--------------using configuration file to get api--------------\");\n Api api2 = Factory.configToCreateApi();\n api2.operation(\"just a test!\");\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 \r\n\t}", "public static void main(String[] args){\n\t\t\n\t\t\n \t}", "public void testMain() throws ClassNotFoundException, IOException \r\n {\r\n String[] args = new String[1];\r\n args[0] = \"SyntaxTest\";\r\n \r\n System.out.println(\"Filename: SyntaxTest:\\n\");\r\n Rectangle1.main(args);\r\n \r\n\r\n\r\n String[] args2 = new String[1];\r\n args2[0] = \"SimpleInsertionTest\";\r\n \r\n System.out.println(\"\\n\\nFilename: SimpleInsertionTest:\\n\");\r\n Rectangle1.main(args2);\r\n \r\n String[] args3 = new String[1];\r\n args3[0] = \"RegionSearchTest\";\r\n \r\n System.out.println(\"\\n\\nFilename: RegionSearchTest:\\n\");\r\n Rectangle1.main(args3);\r\n \r\n String[] args4 = new String[1];\r\n args4[0] = \"WebCatTests\";\r\n \r\n System.out.println(\"\\n\\nFilename: WebCatTests:\\n\");\r\n Rectangle1.main(args4);\r\n \r\n String[] args5 = new String[1];\r\n args5[0] = \"RemoveTest\";\r\n \r\n System.out.println(\"\\n\\nFilename: RemoveTest:\\n\");\r\n Rectangle1.main(args5);\r\n \r\n String[] args6 = new String[1];\r\n args6[0] = \"MoreCommands\";\r\n \r\n System.out.println(\"\\n\\nFilename: MoreCommands:\\n\");\r\n Rectangle1.main(args6);\r\n \r\n assertEquals(\"RegionSearchTest\", args3[0]);\r\n }", "public static void main(String[] args) {\n \n\n }", "public Main() {\n }", "public static void main(String[] args)\n {\n TestRunner.run(suite());\n }", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"main method\");\n\t\ttest();\n\t\t//RunprogramwithoutObject.test();// no need to create any object of class\n\t\tcover();\n\n\t}", "private Main() {\n }", "public static void main(String[] args) {\n System.out.println(testLibraryParseCardBarCode());\n System.out.println(testLibraryParseRunLibrarianCheckoutBookCommand());\n System.out.println(testLibraryParseRunSubscriberReturnBookCommand());\n System.out.println(testparseBookId());\n System.out.println(testparseRunSubscriberCheckoutBookCommand());\n }", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "private Main() {}", "public static void main(String args[]){\n\t\t\n\t\n\t}", "static void main(String[] args)\n {\n }", "public Main() {\n }", "public Main() {\n }", "public static void main (String args[]) {\n\t\t\n }", "static void main(String[] args) {\n }", "public static void main(String[] args) {\n\t\t\n\t\t\t\n\n\t}", "public static void main(String[] args) {\n \n }", "public static void main(String [] args) {\r\n\t\ttestOne(); //adds items to WH; tests getNumItems method & toString method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestTwo(); //tests getItem(String) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestThree(); //test getItem(Item) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFour(); //tests total cost method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFive(); //this will test the getRefrigeratedItems method\r\n\t\tSystem.out.print(\"\\n\"); \r\n\t\ttestSix(); //tests getTotalCostRefrigerated method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestSeven(); //tests remove method\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Testing basic functions...\");\n\t\tQuiz q = new QuizImpl(1, \"Test quiz\");\n\t\tSystem.out.println(\"Quiz ID: \" + q.getId());\n\t\tSystem.out.println(\"Quiz name: \" + q.getTitle());\n\t\tSystem.out.println(\"Adding questions...\");\n\t\tq.addQuestions();\n\t\tSystem.out.println(\"Printing questions...\");\n\t\tq.printQuestions();\n\t}" ]
[ "0.7799056", "0.77874213", "0.76932955", "0.7666802", "0.7611093", "0.757639", "0.74970156", "0.7496197", "0.7367972", "0.7329825", "0.7298581", "0.72750217", "0.72648335", "0.72605103", "0.72511375", "0.7203502", "0.71987534", "0.71808213", "0.71754104", "0.71677196", "0.71663064", "0.71504873", "0.7145215", "0.7142309", "0.7128713", "0.71065795", "0.7104541", "0.7094157", "0.7087616", "0.708523", "0.70847094", "0.7074023", "0.705991", "0.7059158", "0.7053611", "0.7053339", "0.70447814", "0.7044444", "0.7030803", "0.6984374", "0.6984374", "0.69751215", "0.69725204", "0.69700235", "0.69700235", "0.69700235", "0.69700235", "0.69700235", "0.69700235", "0.69605273", "0.6955118", "0.6946447", "0.6943664", "0.6938533", "0.6934964", "0.6934964", "0.6934677", "0.69337064", "0.69337034", "0.6930846", "0.6930358", "0.6930358", "0.6929049", "0.6928875", "0.69257814", "0.69237477", "0.69221437", "0.69217813", "0.69202733", "0.69184977", "0.6917289", "0.6913173", "0.6907655", "0.6906536", "0.69007033", "0.6898866", "0.6898866", "0.68971646", "0.68879044", "0.68879044", "0.68854517", "0.68848246", "0.68844396", "0.68820757", "0.68802124", "0.68711096", "0.68705666", "0.6861248", "0.6859467", "0.6856089", "0.68490505", "0.6845683", "0.6839457", "0.68332744", "0.68332744", "0.6833168", "0.6825314", "0.6820288", "0.68195957", "0.6819427", "0.6813201" ]
0.0
-1
I think this is the builder pattern
private static SentimentEngine getSentimentEngine() { // Done like this to facilitate replacement later by a more complex engine. return new SimpleSentimentEngine(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Builder() {\n\t\t}", "private Builder() {}", "public static Builder builder(){ return new Builder(); }", "abstract Object build();", "private Builder() {\n }", "private Builder() {\n }", "Object build();", "private Builder()\n {\n }", "public Builder() {}", "public Builder() {}", "public Builder() {}", "public Builder() {\n\t\t}", "public static Object builder() {\n\t\treturn null;\r\n\t}", "public abstract Object build();", "static Builder builder() {\n return new Builder();\n }", "public static Object builder() {\n\t\treturn null;\n\t}", "protected abstract Builder<T> valid();", "Builder makePermanent();", "private Construct(Builder builder) {\n super(builder);\n }", "public Object build();", "private BuilderUtils() {}", "public static abstract interface Builder\n/* */ {\n/* */ public abstract Builder paths(String... paramVarArgs);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder methods(RequestMethod... paramVarArgs);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder params(String... paramVarArgs);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder headers(String... paramVarArgs);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder consumes(String... paramVarArgs);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder produces(String... paramVarArgs);\n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder mappingName(String paramString);\n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder customCondition(RequestCondition<?> paramRequestCondition);\n/* */ \n/* */ \n/* */ \n/* */ public abstract Builder options(RequestMappingInfo.BuilderConfiguration paramBuilderConfiguration);\n/* */ \n/* */ \n/* */ \n/* */ public abstract RequestMappingInfo build();\n/* */ }", "public interface Builder {\r\n public void buildBYD();\r\n public CarProduct getCar();\r\n}", "public Builder() { }", "public Builder(){\n }", "abstract T build();", "public interface Builder<T> {\n\n /**\n * The final function that creates the object built.\n * @return the built object\n */\n T build();\n}", "public interface Builder<T> {\n\n T build();\n\n}", "public static Builder builder ()\n {\n\n return new Builder ();\n\n }", "public Builder() {\n }", "public Builder() {\n }", "public Builder() {\n }", "@FunctionalInterface\n public interface Builder {\n BuildingModel build(int x, int y, int angle, int floor);\n }", "java.lang.String getBuilder();", "private Builder(Context context){ this.context=context;}", "public Leilao builder() {\n\t\treturn this.leilao;\r\n\t}", "public abstract Builder produces(String... paramVarArgs);", "private DataObject(Builder builder) {\n super(builder);\n }", "public abstract Builder zza(String str);", "public void build() {\r\n // TODO\r\n }", "Builder addAbout(Thing.Builder value);", "T2 build();", "public interface SimpleDraweeControllerBuilder\r\n{\r\n\r\n public abstract DraweeController build();\r\n\r\n public abstract SimpleDraweeControllerBuilder setCallerContext(Object obj);\r\n\r\n public abstract SimpleDraweeControllerBuilder setOldController(DraweeController draweecontroller);\r\n\r\n public abstract SimpleDraweeControllerBuilder setUri(Uri uri);\r\n\r\n public abstract SimpleDraweeControllerBuilder setUri(String s);\r\n}", "static Builder newBuilder() {\n return new Builder();\n }", "private SimpleData(Builder builder) {\n super(builder);\n }", "Lighter build();", "public AriBuilder builder() {\n if ( builder == null ) {\n throw new IllegalArgumentException(\"This version has no builder. Library error for :\" + this.name());\n } else {\n return builder;\n }\n }", "public interface Builder<T> {\n /**\n * Builds final object.\n * @return object of type {@link T}\n */\n @SuppressWarnings(\"unused\")\n T create();\n}", "public interface Builder<T extends Serializable> {\n\n /**\n * 生成Invoker中需要的marshaller\n */\n public void makeMarshaller();\n\n /**\n * 生成Invoker中需要的messageProducer\n */\n public void makeMessageProducer();\n\n /**\n * 生成异步请求时请求合并的判断器\n */\n public void makePredicate();\n\n /**\n * 动态Invoker生成方法\n *\n * @return 动态invoker\n */\n public Invoker<T> createDynamic();\n\n /**\n * 静态Invoker生成方法\n *\n * @return 静态invoker\n */\n public Invoker<T> createStatic();\n}", "public void construct(){\n\t\tbuilder.buildPart1();\n\t\tbuilder.buildPart2();\n\t\tbuilder.retrieveResult();\n\t}", "Builder addCopyrightHolder(Person.Builder value);", "private Argument(Builder builder) {\n super(builder);\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "protected abstract Nfa buildInternal();", "T build();", "T build();", "private static Object Stringbuilder() {\n\t\treturn null;\n\t}", "public Builder(Object source) {\n this.source = source;\n }", "public Student build() { \n\t return new Student(this); \n\t }", "static Builder builder() {\n return new SourceContextImpl.Builder();\n }", "public HandlerBuilder but() {\n HandlerBuilder _builder = newHandlerBuilder();\n _builder.m_featureAnySet = m_featureAnySet;\n _builder.m_any = m_any;\n _builder.m_featureCanReadSet = m_featureCanReadSet;\n _builder.m_canRead = m_canRead;\n _builder.m_featureCanWriteSet = m_featureCanWriteSet;\n _builder.m_canWrite = m_canWrite;\n _builder.m_featureChangedSet = m_featureChangedSet;\n _builder.m_changed = m_changed;\n _builder.m_featureMixedSet = m_featureMixedSet;\n _builder.m_mixed = m_mixed;\n _builder.m_featureNameSet = m_featureNameSet;\n _builder.m_name = m_name;\n _builder.m_featureTimestampSet = m_featureTimestampSet;\n _builder.m_timestamp = m_timestamp;\n _builder.m_featureValueSet = m_featureValueSet;\n _builder.m_value = m_value;\n return _builder;\n }", "public GantBuilder ( ) { }", "public Builder() {\n\t\t\tsuper(Defaults.NAME);\n\t\t}", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "private DataModelBuilder() {\n }", "private Command builder(Command command) {\n if (command.getArgCount() == 0) {\n return command; }\n else if (command.getClass().getName().equals(USER_COMMAND)) {\n return createUserCommand(command); }\n else if (command.getClass().getName().equals(LIST_START)) {\n return groupBuilder(new ListBody(), LIST_END); }\n else if (command.getClass().getName().equals(GROUP_START)) {\n command = this.commands.get(0);\n this.commands = this.commands.subList(1, this.commands.size());\n return groupBuilder(command, GROUP_END); }\n else if (this.commands.size() < command.getArgCount()) {\n return new Error(\"Not enough parameters for command \" + command.toString()); }\n else {\n for (int i = 0; i < command.getArgCount(); i++) {\n command.addParameter(getCommandTree());\n }\n return command;\n }\n }", "public Builder() {\n this.obj = new Yhzh();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "public static Builder builder() {\n return new Builder();\n }", "Builder addCreator(Person.Builder value);", "private Builder builder() {\n\n\t\tif (!(message instanceof Builder)) {\n\t\t\tthrow new IllegalStateException(\"Message is not a builder\");\n\t\t}\n\n\t\treturn (Builder) message;\n\n\t}", "public Person build(){\n return new Person(this);\n }", "public abstract Builder consumes(String... paramVarArgs);", "interface Builder {\n /**\n * Add all the routes from the given route configuration object. This method can be called\n * multiple times on a builder. This method is currently one of the few methods where runtime\n * exceptions can occur during Lighter configuration. If the added RouteConfiguration instance\n * contains routes that already exist, this method may throw a {@link IllegalArgumentException}\n * @param configuration The route configuration to add\n * @return self\n */\n Builder addRouter(RouteConfiguration configuration);\n\n /**\n * Add an injection factory representing the application's dependency injection solution. This method\n * should only be called once.\n * @param factory the factory to add\n * @return self\n */\n Builder injectionFactory(InjectionObjectFactory factory);\n\n /**\n * Add a type adaptor factory for serialization and deserialization of data to Java objects. The factory\n * added must be sufficient for all types and media types the application requires. This method should\n * only be called once.\n * @param factory the factory to add\n * @return self\n */\n Builder adapterFactory(TypeAdapterFactory factory);\n\n /**\n * Set the port for the server to bind to.\n * @param port the port\n * @return self\n */\n Builder port(int port);\n\n /**\n * Set the host name for the server to bind to\n * @param hostName the host name\n * @return self\n */\n Builder hostName(String hostName);\n\n /**\n * Show the lighter startup banner. By default, the banner is shown.\n * @param show true to show the banner, false to hide it\n * @return self\n */\n Builder showBanner(boolean show);\n\n /**\n * Add a response transformer that will run for EVERY response generated by lighter. This method\n * can be called multiple times to add multiple transformers. Transformers <strong>are not</strong>\n * guaranteed to run in any order.\n * @param transformer the transformer to be used on responses\n * @return self\n */\n Builder addResponseTransformer(GlobalRequestTransformer transformer);\n\n /**\n * Construct a Lighter instance using the configuration from this builder\n * @return a new Lighter instance\n */\n Lighter build();\n }", "private ReflectionResponse(Builder builder) {\n super(builder);\n }", "public ShBuilderApply () {\n\t\tsuper();\n\t}", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }" ]
[ "0.74355125", "0.74329054", "0.72631747", "0.70374537", "0.69789267", "0.69789267", "0.69727206", "0.6921029", "0.68441176", "0.68441176", "0.68441176", "0.683554", "0.68293536", "0.68246776", "0.6793517", "0.6765059", "0.6748439", "0.6736682", "0.67276984", "0.672058", "0.6701823", "0.6700795", "0.66579384", "0.6643937", "0.66385907", "0.6633943", "0.66260487", "0.6539781", "0.65005326", "0.64666903", "0.64666903", "0.64633715", "0.6429448", "0.6408727", "0.63924605", "0.636726", "0.6352787", "0.6319438", "0.6317689", "0.6312248", "0.6305824", "0.62949264", "0.62880296", "0.6283493", "0.6282695", "0.62798", "0.6244577", "0.6228462", "0.62257576", "0.6225628", "0.6224565", "0.62134075", "0.6191035", "0.6191035", "0.6191035", "0.6191035", "0.6184861", "0.6167193", "0.6167193", "0.61440086", "0.6133043", "0.6121356", "0.6113101", "0.6110324", "0.6106807", "0.6106424", "0.6103323", "0.6103323", "0.6103323", "0.60945964", "0.6091484", "0.6084384", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6081595", "0.6078121", "0.60697925", "0.6066745", "0.6062024", "0.6056114", "0.60517436", "0.6047473", "0.60368115", "0.60368115", "0.60368115", "0.60368115", "0.60368115", "0.60368115", "0.60368115", "0.60368115", "0.60368115", "0.60368115", "0.60368115" ]
0.0
-1
The sentiment score will be positive if the sentiment is positive, negative if negative, and the magnitude will larger the more positive or negative it is.
public abstract double sentimentScore(Message message);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int normalize(int sentimentValue) {\n\t\treturn sentimentValue - 2;\n\t}", "int getAnnotationSentimentValue();", "@Test\n void getSentimentScore() {\n NLPAnalyser np = new NLPAnalyser();\n List<CoreMap> sentences = np.nlpPipeline(\"RT This made my day; glad @JeremyKappell is standing up against #ROC’s disgusting mayor. \"\n + \"Former TV meteorologist Jeremy Kappell suing Mayor Lovely Warren\"\n + \"https://t.co/rJIV5SN9vB (Via NEWS 8 WROC)\");\n assertTrue(np.getSentimentScore(sentences) >= 0 && np.getSentimentScore(sentences) <=4);\n }", "public static int getSentiment(Ticket T){\n\t\tint sentimentScore=0;\r\n\t\tTranscript Trans=new Transcript();\r\n\t\tint positive=0;\r\n\t\tint negative=0;\r\n\t\t//System.out.println(\"Entering Sentiment Score Calculator\");\r\n\t\t//System.out.println(\"WordList Size\"+T.Trans.wordList.size()+\"\\n\");\r\n\t\tfor(int i =0;i <T.Trans.wordList.size();i++){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tfor(int j =0;j< Trans.positiveLexicons.length;j++){\r\n\t\t\t\tif(T.Trans.wordList.get(i)==Trans.positiveLexicons[j]){\r\n\t\t\t\t\tpositive++;\r\n\t\t\t\t\tSystem.out.println(T.Trans.wordList.get(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor(int k=0;k < Trans.negativeLexicons.length;k++){\r\n\t\t\t\tif(T.Trans.wordList.get(i)==Trans.negativeLexicons[k]){\r\n\t\t\t\t\tnegative++;\r\n\t\t\t\t\tSystem.out.println(T.Trans.wordList.get(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(positive > negative){ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Assigning sentimentScore according to the number of positive and negative lexicons.\r\n\t\t\tsentimentScore=3;\r\n\t\t}\r\n\r\n\t\telse if(positive < negative){\r\n\t\t\tsentimentScore=1;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsentimentScore=2;\r\n\t\t}\r\n\t\treturn sentimentScore;\r\n\t}", "@Override\n public DetectSentimentResult detectSentiment(DetectSentimentRequest request) {\n request = beforeClientExecution(request);\n return executeDetectSentiment(request);\n }", "public void SetSentiment(String sentiment) {\n sentiment_ = sentiment;\n }", "public float getNoOfNegativeReviewsMohan(){\n return mohanNegative;\n }", "private void initializeSentimentFeaturesCount() {\n\t\tint count = 0;\n\n\t\t// Number of positive words\n\t\tif (Features.isNumberOfPositiveWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of negative words\n\t\tif (Features.isNumberOfNegativeWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of highly emotional positive words\n\t\tif (Features.isNumberOfHighlyEmoPositiveWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of highly emotional negative words\n\t\tif (Features.isNumberOfHighlyEmoNegativeWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of Capitalized positive words\n\t\tif (Features.isNumberOfCapitalizedPositiveWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of Capitalized Negative Words\n\t\tif (Features.isNumberOfCapitalizedNegativeWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Ratio of Emotional Words\n\t\tif (Features.isRatioOfEmotionalWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of Positive Emoticons\n\t\tif (Features.isNumberOfPositiveEmoticons()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of Negative Emoticons\n\t\tif (Features.isNumberOfNegativeEmoticons()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of \"Neutral\" Emoticons\n\t\tif (Features.isNumberOfNeutralEmoticons()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of \"Joking\" Emoticons\n\t\tif (Features.isNumberOfJokingEmoticons()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number Of Positive Slangs\n\t\tif (Features.isNumberOfPositiveSlangs()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number of Negative Slangs\n\t\tif (Features.isNumberOfNegativeSlangs()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number Of Positive Hashtags\n\t\tif (Features.isNumberOfPositiveHashtags()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Number Of Negative Hashtags\n\t\tif (Features.isNumberOfNegativeHashtags()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Contrast Words Vs Words\n\t\tif (Features.isContrastWordsVsWords()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Contrast Words Vs Hashtags\n\t\tif (Features.isContrastWordsVsHashtags()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Contrast Words Vs Emoticons\n\t\tif (Features.isContrastWordsVsEmoticons()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Contrast Hashtags Vs Hashtags\n\t\tif (Features.isContrastHashtagsVsHashtags()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\t// Contrast Hashtags Vs Emoticons\n\t\tif (Features.isContrastHashtagsVsEmoticons()) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\tSelectBasicFeaturesWindow.setNumberOfSentimentRelatedFeatures(count);\n\t\tSelectBasicFeaturesWindow.countOfSentimentRelatedFeatures.set(count);\n\t}", "boolean hasSentimentAnalysis();", "public ArrayList<Integer> analyze() {\n\t\t//Clears the sentimentValues ArrayList to perform a new analysis.\n\t\tif (this.sentimentValues.size() > 0) {\n\t\t\tthis.sentimentValues = new ArrayList<>();\n\t\t}\n\t\t\n\t\tDocument speechDocument = new Document(this.speech);\t//Create a CoreNLP Document object with speech as input.\n\t\t\n\t\tfor (Sentence sentence : speechDocument.sentences()) {\n\t\t\tint rawSentimentValue = sentence.sentiment().ordinal();\t//Captures the raw, unnormalized sentiment value from sentence.\n\t\t\tthis.sentimentValues.add(normalize(rawSentimentValue));\t//Normalizes the sentiment value and pushes to ArrayList.\n\t\t}\n\t\t\n\t\treturn this.sentimentValues;\n\t}", "@Override\n\t\t\tpublic int compare(Sentence s1, Sentence s2) {\n\t\t\t\tif(s1.getScore() > s2.getScore()) return -1;\n\t\t\t\telse return 1;\n\t\t\t}", "public float getNoOfPositiveReviewsMohan(){\n return mohanPositive;\n }", "public float getNoOfNegativeReviewsAfinn(){\n return afinnNegative;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getScore();", "public int getScore()\n {\n return points + extras;\n }", "Float getScore();", "public int damage(int magnitude) {\n int damage = Math.min(magnitude, health);\n health -= damage;\n System.out.println(actor.getName() + \": \" + health);\n return damage;\n }", "public float getScore(){return score;}", "@Override\n public int compareTo(Score other) {\n return (int) (100 * (this.getAsDouble() - other.getAsDouble()));\n }", "private boolean isPositive() {\n return this._isPositive;\n }", "public boolean isPositive()\n\t{\n\t\treturn _bIsPositive;\n\t}", "public Float getScore() {\n return score;\n }", "public void setMagnitude(int magnitude)\r\n {\r\n this.magnitude = magnitude; \r\n }", "public int getMagnitude()\r\n {\r\n return magnitude;\r\n }", "public double getScore() {\r\n return score;\r\n }", "public int totalScore() {\n return 0;\n }", "private boolean getSentiment(Prediction prediction, String content)\n throws IOException {\n Preconditions.checkNotNull(prediction);\n Preconditions.checkNotNull(content);\n\n Input input = new Input();\n Input.InputInput inputInput = new Input.InputInput();\n inputInput.set(\"csvInstance\", Lists.newArrayList(content));\n input.setInput(inputInput);\n Output result = prediction.hostedmodels().predict(\"414649711441\",\n \"sample.sentiment\", input).execute();\n String outputStr = result.getOutputLabel();\n return outputStr.equals(\"positive\");\n }", "float getScore();", "float getScore();", "public double getScore() {\r\n return mScore;\r\n }", "public float getScore() {\n return score;\n }", "public Short getScore() {\n return score;\n }", "protected int getNegativeOnes() {\n Rating[] ratingArray = this.ratings;\n int negOneCount = 0;\n for(int i = 0; i < ratingArray.length; i++) {\n if(ratingArray[i] != null) {\n if(ratingArray[i].getScore() == -1) negOneCount++;\n }\n }\n return negOneCount;\n }", "public float getNoOfPositiveReviewsAfinn(){\n return afinnPositive;\n }", "public boolean isNegative() {\n return this.negative;\n }", "@Override\n protected float score(BasicStats stats, float termFreq, float docLength) {\n float k1 = (float)1.2;\n float k2 = 750;\n float b = (float)0.75;\n float N = stats.getNumberOfDocuments();\n float df = stats.getDocFreq();\n float qtermFreq = 1;\n float score = (float)Math.log((N - df + 0.5)/df+0.5);\n score*=((k1+1)*termFreq)/(k1*(1-b+b*(docLength/stats.getAvgFieldLength()))+termFreq);\n score*=((k2+1)*qtermFreq)/(k2+qtermFreq);\n return score; }", "public Integer getSpeechThreshold() {\n return this.speechThreshold;\n }", "public int getScore() { return score; }", "protected abstract double relevantScore(Tweet tweet);", "@Override\n public BatchDetectSentimentResult batchDetectSentiment(BatchDetectSentimentRequest request) {\n request = beforeClientExecution(request);\n return executeBatchDetectSentiment(request);\n }", "public Integer getScore() {\r\n return score;\r\n }", "public abstract boolean isPositive();", "public int getScore() {return score;}", "public Integer getScore() {\n return score;\n }", "public boolean isNegative();", "@Override\n\tprotected int calculateScore() {\n\t\treturn Math.abs(playerScore[0] - playerScore[1]);\n\t}", "public float getMagnitude()\n {\n return magnitude;\n }", "public boolean isReviewPositive()\n {\n return (m_nReviewValue == REVIEW_VALUE_POSITIVE) ? true : false ;\n }", "public float getScore() {\r\n\t\treturn score;\r\n\t}", "@Override\n public int getScore() {\n return totalScore;\n }", "public double getNumberOfPredictedPositive() {\n\t\treturn numberOfTruePositives + numberOfFalsePositives;\n\t}", "public void testSpamCategory(){\n\t\t\n\t\tTweetStatus tweetStatus = new TweetStatus();\n\t\tString tweet = \"Call us to get the best deal on vacation to rome\";\n\t\ttweetStatus.setTweetText(tweet);\n\t\tTweetCategoryType tweetCategoryType = naiveBayeClassifier.classify(tweetStatus);\n\t\t\n\t\tAssert.assertEquals(TweetCategoryType.SPAM, tweetCategoryType);\n\t}", "public boolean isSentiment (String lemma){\n boolean sentimentPresent = false;\n \n sentimentPresent = this.keys.contains(lemma);\n\n return sentimentPresent;\n }", "public Double getScore() {\n return this.score;\n }", "public Double getScore() {\n return this.score;\n }", "@Override\n public int getScore() {\n return score;\n }", "float getMagnitude();", "public int getScore() {\n return score;\n }", "@Override\r\n\tpublic double getScore() {\n\t\treturn score;\r\n\t}", "public int getScore() {\r\n return score;\r\n }", "public int getScore() {\r\n return score;\r\n }", "public int getScore() {\r\n return score;\r\n }", "public int getScore(){\r\n\t\treturn score;\r\n\t}", "public int getScore(){\r\n\t\treturn score;\r\n\t}", "public int getScore() {\n return score;\n }", "public int getScore() {\n return score;\n }", "public int getScore(){\n \treturn 100;\n }", "public void addScore(){\n\n // ong nuoc 1\n if(birdS.getX() == waterPipeS.getX1() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX1() + 50){\n score++;\n bl = false;\n }\n\n //ong nuoc 2\n if(birdS.getX() == waterPipeS.getX2() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX2() + 50){\n score++;\n bl = false;\n }\n\n // ong nuoc 3\n if(birdS.getX() == waterPipeS.getX3() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX3() + 50){\n score++;\n bl = false;\n }\n\n }", "public abstract float getScore();", "public int getMagnitude() {\n\t\treturn magnitude;\n\t}", "public void calculateScore() {\n for (Sequence seq: currentSeq) {\n double wordWeight = Retriever.getWeight(seq);\n String token = seq.getToken();\n int size = seq.getRight() - seq.getLeft() + 1;\n int titleCount = getCount(token.toLowerCase(), title.toLowerCase());\n if (titleCount != 0) {\n setMatch(size);\n setTitleContains(true);\n }\n int lowerCount = getCount(token.toLowerCase(), lowerContent);\n if (lowerCount == 0) {\n// scoreInfo += \"Token: \" + token + \" Original=0 Lower=0 WordWeight=\" + wordWeight + \" wordTotal=0\\n\";\n continue;\n }\n int originalCount = getCount(token, content);\n lowerCount = lowerCount - originalCount;\n if (lowerCount != 0 || originalCount != 0) {\n setMatch(size);\n }\n double originalScore = formula(wordWeight, originalCount);\n double lowerScore = formula(wordWeight, lowerCount);\n final double weight = 1.5;\n double addedScore = weight * originalScore + lowerScore;\n// scoreInfo += \"Token: \" + token + \" Original=\" + originalScore + \" Lower=\" + lowerScore +\n// \" WordWeight=\" + wordWeight + \" wordTotal=\" + addedScore + \"\\n\";\n dependencyScore += addedScore;\n }\n currentSeq.clear();\n }", "public long getScore() {\n return score_;\n }", "public long getScore() {\n return score_;\n }", "public String getIsNegative() {\r\n return isNegative;\r\n }", "public float getScore() {\n\t\treturn score;\n\t}", "double getDeltaScore();", "public long getScore() {\n return score_;\n }", "public long getScore() {\n return score_;\n }", "@Override\n public int compareTo(TextTrackScore other) {\n if (this.isWithinRendererCapabilities != other.isWithinRendererCapabilities) {\n return this.isWithinRendererCapabilities ? 1 : -1;\n }\n if (this.preferredLanguageScore != other.preferredLanguageScore) {\n return compareInts(this.preferredLanguageScore, other.preferredLanguageScore);\n }\n if (this.preferredRoleFlagsScore != other.preferredRoleFlagsScore) {\n return compareInts(this.preferredRoleFlagsScore, other.preferredRoleFlagsScore);\n }\n if (this.isDefault != other.isDefault) {\n return this.isDefault ? 1 : -1;\n }\n if (this.hasPreferredIsForcedFlag != other.hasPreferredIsForcedFlag) {\n return this.hasPreferredIsForcedFlag ? 1 : -1;\n }\n if (this.selectedAudioLanguageScore != other.selectedAudioLanguageScore) {\n return compareInts(this.selectedAudioLanguageScore, other.selectedAudioLanguageScore);\n }\n if (preferredRoleFlagsScore == 0 && this.hasCaptionRoleFlags != other.hasCaptionRoleFlags) {\n return this.hasCaptionRoleFlags ? -1 : 1;\n }\n return 0;\n }", "public int getScore(){\n\t\treturn score;\n\t}", "public int getScore(){\n\t\treturn score;\n\t}", "private void scaleToPositive() {\r\n // Obtain min value\r\n double minScalarization = Double.MAX_VALUE;\r\n for (S solution : solutions()) {\r\n if (scalarization.getAttribute(solution) < minScalarization) {\r\n minScalarization = scalarization.getAttribute(solution);\r\n }\r\n }\r\n if (minScalarization < 0) {\r\n // Avoid scalarization values of 0\r\n double eps = 10e-6;\r\n for (S solution : solutions()) {\r\n scalarization.setAttribute(solution, eps + scalarization.getAttribute(solution) + minScalarization);\r\n }\r\n }\r\n }", "Analyzer(String speech) {\n\t\tthis.sentimentValues = new ArrayList<>();\n\t\tthis.speech = speech;\n\n\t}", "@Override\r\n\tpublic double getScore() \r\n\t{\r\n\t\treturn this._totalScore;\r\n\t}", "public boolean isPositive()\n {\n return Native.fpaIsNumeralPositive(getContext().nCtx(), getNativeObject());\n }", "private void normalize(double[] scores, boolean wantSmall) {\n\n // Yes\n double randomLowValue = 0.00001;\n\n if (wantSmall) {\n double min = Double.MAX_VALUE;\n for (double score : scores) {\n if (score < min) min = score;\n }\n\n for (int i = 0; i < scores.length; i++) {\n scores[i] = min / Math.max(scores[i], randomLowValue);\n }\n\n } else {\n double max = Double.MIN_VALUE;\n for (double score : scores) {\n if (score > max) max = score;\n }\n\n if (max == 0) max = randomLowValue;\n for (int i = 0; i < scores.length; i++) {\n scores[i] = scores[i] / max;\n }\n }\n }", "@Override\n public int compare(Sample s1, Sample s2) {\n if (s1.positive_features.size() < s2.positive_features.size())\n return -1;\n else if (s1.positive_features.size() > s2.positive_features.size())\n return +1;\n else {\n for (int i = 0; i < s1.positive_features.size(); i++) {\n int v1 = s1.positive_features.get(i);\n int v2 = s2.positive_features.get(i);\n if (v1 < v2) return -1;\n if (v1 > v2) return +1;\n }\n return 0;\n }\n }", "public double getScoreCutoff() {\n return scoreCutoff;\n }", "public long setAmountNeg() {\n return -amount;\n }", "public int getScore() {\r\n \treturn score;\r\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"NEG\";\n\t}", "public Long getScore() {\n return score;\n }", "public double getNumberOfNegatives() {\n\t\treturn numberOfTrueNegatives + numberOfFalsePositives;\n\t}", "public int score(){\r\n\t\t//to be implemented: should return game score \r\n\t\tfor(int i=0; i<10; i++)\r\n\t\t{\r\n\t\t\tscore= frames.get(i).score();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn score + bonusGame;\r\n\t}", "private int getNegativeCount(){\n return m_NegativeCount;\n }", "private int getPositiveCount(){\n return m_PositiveCount;\n }", "private double weight(){\n return ((double) (m_PositiveCount + m_NegativeCount)) / ((double) m_PositiveCount);\n }", "public double calculateSpecificity() {\n final long divisor = trueNegative + falsePositive;\n if(divisor == 0) {\n return 0.0;\n } else {\n return trueNegative / (double)divisor;\n }\n }", "private void meaningLess(Actor actor) {\n \n }", "public int getScore () {\n return mScore;\n }" ]
[ "0.5968024", "0.57291174", "0.5651946", "0.55279136", "0.5449055", "0.54227006", "0.5357489", "0.5219842", "0.5128748", "0.50912863", "0.5076391", "0.5070985", "0.5057561", "0.5053007", "0.50236374", "0.5006121", "0.50032264", "0.49839956", "0.49801987", "0.49734026", "0.49489456", "0.49413952", "0.49396372", "0.49227175", "0.49088678", "0.48870328", "0.48839948", "0.4877113", "0.4877113", "0.48683023", "0.4867147", "0.48629966", "0.48604494", "0.48563015", "0.48399496", "0.48252442", "0.4824711", "0.48214272", "0.48195592", "0.48104253", "0.48015463", "0.47985905", "0.47984672", "0.47893536", "0.47646508", "0.4763879", "0.4761572", "0.47571674", "0.47554508", "0.47502112", "0.4745105", "0.4742226", "0.47420827", "0.47418866", "0.47418866", "0.47412795", "0.47407386", "0.4737263", "0.47359857", "0.47294807", "0.47294807", "0.47294807", "0.47227716", "0.47227716", "0.4709074", "0.4709074", "0.47074553", "0.4702473", "0.46994266", "0.46988842", "0.46959955", "0.46901047", "0.46901047", "0.46893537", "0.46807092", "0.46778098", "0.4677169", "0.4677169", "0.46751255", "0.46644017", "0.46644017", "0.46633705", "0.46613654", "0.46610218", "0.46598282", "0.46593603", "0.46566886", "0.4652408", "0.46500146", "0.46500117", "0.4644938", "0.4643929", "0.4643256", "0.46432495", "0.46325505", "0.4631068", "0.46297705", "0.46285814", "0.46279535", "0.46262193" ]
0.6127142
0
select some bounds around the node and limit them by the global bounding box
private void jump(INode node, PointD originalPosition) { double windowSize = configurator.maxStepSize.getValue(); double halfWindowSize = windowSize / 2; double minX = Math.max(originalPosition.getX() - halfWindowSize, boundingBox.getMinX()); double minY = Math.max(originalPosition.getY() - halfWindowSize, boundingBox.getMinY()); RectD bounds = new RectD( minX, minY, Math.min(minX + windowSize, boundingBox.getMaxX()) - minX, Math.min(minY + windowSize, boundingBox.getMaxY()) - minY ); Stream .generate(() -> { double x = random.nextDouble() * bounds.getWidth() + bounds.getX(); double y = random.nextDouble() * bounds.getHeight() + bounds.getY(); PointD point = new PointD(x, y); if (configurator.onlyGridPositions.getValue()) { return LayoutUtils.round(point); } else { return point; } }) .filter(position -> !configurator.onlyGridPositions.getValue() || LayoutUtils.overlapFree(position, positions, node, graph)) .limit(configurator.numSamplesForJumping.getValue()) .max(Comparator.comparingDouble(position -> { positions.setValue(node, position); return getAngleForNode(positions, node, graph); })) .ifPresent(pointD -> positions.setValue(node, pointD)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Node getBoundingNode();", "Rectangle getBounds();", "public void setBounds(Rectangle b);", "RectangleLatLng getBounds();", "public int getBound();", "@Override\n public void getLocalBounds(Vector3 min, Vector3 max) {\n\n // Maximum bounds\n max.setX(radius + margin);\n max.setY(halfHeight + margin);\n max.setZ(max.getX());\n\n // Minimum bounds\n min.setX(-max.getX());\n min.setY(-max.getY());\n min.setZ(min.getX());\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 }", "protected Rectangle determineBounds() {\n return getNetTransform().createTransformedShape( _bounds ).getBounds();\n }", "public Rect getBound() {\n return new Rect((int) (x - radius), (int) (y - radius), (int) (x + radius), (int) (y + radius));\n }", "public Rectangle getBounds();", "public Rectangle getBounds();", "Rectangle getBoundingBox(Rectangle rect);", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "private void range(Queue<Point2D> pts, RectHV rect, Node x, RectHV bbox) {\n if (x == null) return;\n if (!bbox.intersects(rect)) return;\n if (rect.contains(x.p)) pts.enqueue(x.p);\n\n range(pts, rect, x.left, calcBBox(x, bbox, true));\n range(pts, rect, x.right, calcBBox(x, bbox, false));\n }", "public ReferencedEnvelope getBounds(){\n if(bounds==null){\n // Create Null envelope\n this.bounds = new ReferencedEnvelope(getCRS());\n // First try to find the BBOX definition in the gisNode directly\n try{\n if(gisNode.hasProperty(INeoConstants.PROPERTY_BBOX_NAME)){\n double[] bbox = (double[])gisNode.getProperty(INeoConstants.PROPERTY_BBOX_NAME);\n this.bounds = new ReferencedEnvelope(bbox[0],bbox[1],bbox[2],bbox[3],crs);\n }else{\n System.err.println(\"No BBox defined in the GeoNeo object\");\n }\n }catch(Exception bbox_e){\n System.err.println(\"Failed to interpret BBOX: \"+bbox_e.getMessage());\n bbox_e.printStackTrace(System.err);\n }\n // Secondly, if bounds is still empty, try find all feature geometries and calculate bounds\n try{\n if(this.bounds.isNull()){\n // Try to create envelope from any data referenced by the gisNode\n for(GeoNode node:getGeoNodes()){\n //TODO: support high dimensions\n this.bounds.expandToInclude(node.getCoords()[0], node.getCoords()[1]);\n }\n }\n }catch(Exception bbox_e){\n System.err.println(\"Failed to interpret BBOX: \"+bbox_e.getMessage());\n bbox_e.printStackTrace(System.err);\n }\n }\n return bounds;\n }", "public GJBox2D boundingBox() {\n\t\tdouble xmin = Double.MAX_VALUE;\n\t\tdouble ymin = Double.MAX_VALUE;\n\t\tdouble xmax = Double.MIN_VALUE;\n\t\tdouble ymax = Double.MIN_VALUE;\n\n\t\t// coordinates of current point\n\t\tdouble x, y;\n\t\t\n\t\t// Iterate on each control point of each segment\n\t\tfor (Segment seg : this.segments) {\n\t\t\tfor (GJPoint2D p : seg.controlPoints()) {\n\t\t\t\t// get current coordinates\n\t\t\t\tx = p.x();\n\t\t\t\ty = p.y();\n\t\t\t\t\n\t\t\t\t// update bounds\n\t\t\t\txmin = Math.min(xmin, x);\n\t\t\t\tymin = Math.min(ymin, y);\n\t\t\t\txmax = Math.max(xmax, x);\n\t\t\t\tymax = Math.max(ymax, y);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// createFromCollection a new GJBox2D with the bounds\n\t\treturn new GJBox2D(xmin, xmax, ymin, ymax);\n\t}", "@Override\r\n\tpublic Rectangle getBound() {\n\t\treturn new Rectangle((int)x, (int)y, (int)width, (int)height);\r\n\t}", "public void computeStoredBounds()\n {\n computeSRectangleBound();\n computeCircleBound();\n }", "public void testFindRangeBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findRangeBounds(dataset);\n }", "public Coords bound(final Coords point)\r\n {\r\n int xx = point.getX();\r\n int yy = point.getY();\r\n if(xx < x)\r\n {\r\n xx = x;\r\n }\r\n if(xx > x + width)\r\n {\r\n xx = x + width;\r\n }\r\n if(yy < y)\r\n {\r\n yy = y;\r\n }\r\n if(yy > y + height)\r\n {\r\n yy = y + height;\r\n }\r\n return new Coords(xx, yy);\r\n }", "public void calculateBoundsAABB() {\n\t\tsuper.minY = 0;\n\t\tradius = 0;\n\t\tmaxY = 0;\n\t\tminX = 999999;\n\t\tmaxX = -999999;\n\t\tmaxZ = -99999;\n\t\tminZ = 99999;\n\t\tfor (int j = 0; j < vertexCount; j++) {\n\t\t\tint x = vertexX[j];\n\t\t\tint y = vertexY[j];\n\t\t\tint z = vertexZ[j];\n\t\t\tif (x < minX) {\n\t\t\t\tminX = x;\n\t\t\t}\n\t\t\tif (x > maxX) {\n\t\t\t\tmaxX = x;\n\t\t\t}\n\t\t\tif (z < minZ) {\n\t\t\t\tminZ = z;\n\t\t\t}\n\t\t\tif (z > maxZ) {\n\t\t\t\tmaxZ = z;\n\t\t\t}\n\t\t\tif (-y > super.minY) {\n\t\t\t\tsuper.minY = -y;\n\t\t\t}\n\t\t\tif (y > maxY) {\n\t\t\t\tmaxY = y;\n\t\t\t}\n\t\t\tint radiusSqr = (x * x) + (z * z);\n\t\t\tif (radiusSqr > radius) {\n\t\t\t\tradius = radiusSqr;\n\t\t\t}\n\t\t}\n\t\tradius = (int) Math.sqrt(radius);\n\t\tminDepth = (int) Math.sqrt((radius * radius) + (super.minY * super.minY));\n\t\tmaxDepth = minDepth + (int) Math.sqrt((radius * radius) + (maxY * maxY));\n\t}", "public Bounds getBounds () { return (bounds); }", "private int[] getBounds(Node node) {\n String[] boundsAttr = (((Element) node).getAttribute(\"bounds\")).replace(\"[\",\"\").split(\"[^0-9]\");\n int[] bounds = new int[boundsAttr.length];\n for (int i = 0; i < boundsAttr.length; i++) {\n bounds[i] = Integer.parseInt(boundsAttr[i]);\n }\n return bounds;\n }", "void addBounds(int x, int y, int width, int height);", "public RMRect getBoundsInside() { return new RMRect(0, 0, getWidth(), getHeight()); }", "private Node getNodeBetweenBounds(Node node, int x, int y) {\n boolean childBetweenBounds = true;\n while (childBetweenBounds) {\n childBetweenBounds = false;\n NodeList nodeList = node.getChildNodes();\n for (int i = 0; i < nodeList.getLength(); i++) {\n if (isBetweenBounds(x, y, getBounds(nodeList.item(i)))) {\n childBetweenBounds = true;\n node = nodeList.item(i);\n break;\n }\n }\n }\n return node;\n }", "public IRectangleBound getClipBound();", "@Override\n\tpublic Rectangle getBound() {\n\t\trectBound.setX(posX+20);\n\t\trectBound.setY(Y_LAND - image.getHeight() +10);\n\t\trectBound.setWidth(image.getWidth()-10);\n\t\trectBound.setHeight(image.getHeight());\n\t\treturn rectBound;\n\t}", "void setBounds(Rectangle rectangle);", "public abstract Regionlike getGridBounds();", "public RMRect bounds() { return new RMRect(x(), y(), width(), height()); }", "public void computeSRectangleBound()\n {\n this.savedSRectangleBound = getSRectangleBound();\n }", "public boolean detectBound(){\n if(posX < 10){\n posX = 10;\n velX = 0;\n accX = 0;\n return true;\n }\n else if(posX > width - 10){\n posX = width - 10;\n velX = 0;\n accX = 0;\n return true;\n }\n if(posY < 10){\n posY = 10;\n velY = 0;\n accY = 0;\n return true;\n }\n else if(posY > height - 10){\n posY = height - 10;\n velY = 0;\n accY = 0;\n return true;\n }\n return false;\n }", "public RMRect getBounds() { return new RMRect(getX(), getY(), getWidth(), getHeight()); }", "private BioMightBoundBoxes setupDefaultBoundBoxes() \r\n\t{\r\n\t\t// Set up the collection to hold the Bounding Boxes\r\n\t\tBioMightBoundBoxes bioBoundBoxes = null;\r\n\t\r\n\t\t// Initialize the position of the bounding box vars\r\n\t\tBigDecimal xPos = new BigDecimal(0.0);\r\n\t\tBigDecimal yPos = new BigDecimal(0.0);\r\n\t\tBigDecimal zPos= new BigDecimal(0.0);\r\n\t\t\r\n\t\t// Set to base 1x1x1 cube\r\n\t\tBigDecimal xVector= new BigDecimal(1.0);\r\n\t\tBigDecimal yVector= new BigDecimal(1.0); \r\n\t\tBigDecimal zVector= new BigDecimal(1.0);\r\n\t\r\n\t\t// Initialize a BoundBox\r\n\t\tBioMightBoundBox bioBoundBox = null;\r\n\t\r\n\t\t// Initialize Connectors \r\n\t\tBioMightConnectors bioMightConnectors = null; \r\n\r\n\t\t// Initialize a Connector \r\n\t\tBioMightConnector bioMightConnector= null;\r\n\t\r\n\t\tdouble circumference = 0.0;\r\n\t\tdouble[] startPos = {0.0, 0.0, 0.0};\r\n\t\tdouble[][] startPoints = null;\r\n\t\r\n\t\t//********************************************************************* \r\n\t\t// LEFT FOOT BOUNDBOX\r\n\t\t// Set up the Bounding Box for the Feet\r\n\t\t// The connector for this will come from the incoming Bound Box\r\n\t\t// Both are defined like and bolt and they lock into position at the\r\n\t\t// interestion of both connectors\r\n\t\t//**********************************************************************\r\n\t\txPos = new BigDecimal(0.0);\r\n\t\tyPos = new BigDecimal(-65.0);\r\n\t\tzPos= new BigDecimal(3.0);\r\n\t\r\n\t\txVector= new BigDecimal(1.0);\r\n\t\tyVector= new BigDecimal(4.0); \r\n\t\tzVector= new BigDecimal(1.0);\r\n\r\n\t\tbioBoundBox = new BioMightBoundBox(xPos, yPos, zPos, xVector, yVector, zVector);\r\n\t\tbioMightConnectors = new BioMightConnectors();\r\n\t\r\n\t\t// Feet Epithelium Connector\r\n\t\tcircumference = 0.3;\r\n\t\tstartPos = getStartPoints(-2.0, -65.0, -1.0);\r\n\t\tstartPoints = BioGraphics.octogonYPlane(startPos, circumference);\r\n\t\tbioMightConnector = new BioMightConnector(startPoints, Constants.FootEpitheliumRef,\"connType\");\r\n\t\tbioMightConnectors.setBioMightConnector(Constants.FootEpitheliumRef, bioMightConnector);\r\n\t\t\r\n\t\t// Associate the connector on the Box\r\n\t\tbioBoundBox.setBioMightConnectors(bioMightConnectors);\r\n\t\t\r\n\t\t// Put the Bounding Box in the collection\r\n\t\tbioBoundBoxes.setBoundingBox(Constants.LeftFootRef, bioBoundBox);\r\n\t\r\n\t\r\n\t\t//********************************************************************* er\r\n\t\t// RIGHT CNEMES BOUNDBOX\r\n\t\t// Set up the Bounding Box for the Foot\r\n\t\t// On a porportioned human, the \r\n\t\t//**********************************************************************\r\n\t\txPos = new BigDecimal(0.0);\r\n\t\tyPos = new BigDecimal(-14.0);\r\n\t\tzPos= new BigDecimal(-3.0);\r\n\t\r\n\t\txVector= new BigDecimal(1.0);\r\n\t\tyVector= new BigDecimal(4.0); \r\n\t\tzVector= new BigDecimal(1.0);\r\n\r\n\t\tbioBoundBox = new BioMightBoundBox(xPos, yPos, zPos, xVector, yVector, zVector);\r\n\t\tbioMightConnectors = new BioMightConnectors();\r\n\t\t\r\n\t\t// Foot Epithelium Connector\r\n\t\tcircumference = 0.3;\r\n\t\tstartPos = getStartPoints(2.0, -65.0, -1.0);\r\n\t\tstartPoints = BioGraphics.octogonYPlane(startPos, circumference);\r\n\t\tbioMightConnector = new BioMightConnector(startPoints, Constants.FootEpitheliumRef,\"connType\");\r\n\t\tbioMightConnectors.setBioMightConnector(Constants.FootEpitheliumRef, bioMightConnector);\r\n\t\r\n\t\t// Associate the connector on the Box\r\n\t\tbioBoundBox.setBioMightConnectors(bioMightConnectors);\r\n\t\t\r\n\t\t// Put the Bounding Box in the collection\r\n\t\tbioBoundBoxes.setBoundingBox(Constants.RightFootRef, bioBoundBox);\r\n\t\r\n\t\t// return the collection that holds both foot bound boxes\r\n\t\treturn (bioBoundBoxes);\r\n\t}", "public void setBounds(Rectangle2D aRect)\n{\n setBounds(aRect.getX(), aRect.getY(), aRect.getWidth(), aRect.getHeight());\n}", "private void updateBoundingBox(Point_dt p) {\n\t\tdouble x = p.x(), y = p.y(), z = p.z();\n\t\tif (m_boundingBoxMin == null) {\n\t\t\tm_boundingBoxMin = new Point_dt(p);\n\t\t\tm_boundingBoxMax = new Point_dt(p);\n\t\t} else {\n\t\t\tif (x < m_boundingBoxMin.x())\n\t\t\t\tm_boundingBoxMin.setX(x);\n\t\t\telse if (x > m_boundingBoxMax.x())\n\t\t\t\tm_boundingBoxMax.setX(x);\n\t\t\tif (y < m_boundingBoxMin.y())\n\t\t\t\tm_boundingBoxMin.setY(y);\n\t\t\telse if (y > m_boundingBoxMax.y())\n\t\t\t\tm_boundingBoxMax.setY(y);\n\t\t\tif (z < m_boundingBoxMin.z())\n\t\t\t\tm_boundingBoxMin.setZ(z);\n\t\t\telse if (z > m_boundingBoxMax.z())\n\t\t\t\tm_boundingBoxMax.setZ(z);\n\t\t}\n\t}", "@Override\n public List<Bound> getBounds() {\n return Collections.unmodifiableList(bounds);\n }", "public LatLngBounds setupBounds(){\n\t\t\n\t\t\n\t\tdouble deltaLat = 0.000015; // correction value\n\t\t\n\t\tLatLng northEast = new LatLng(60.1876397959336 + (2.4 * deltaLat), 24.8207008838576);\n\t\tLatLng southWest = new LatLng(60.1866756699501 + deltaLat, 24.8172971606177);\n\t\t\n\t\t\n\t\t// 60.1866756699501\n\t\treturn new LatLngBounds(southWest, northEast);\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 }", "public Rectangle getBounds(){\r\n return new Rectangle(x, y, w, w);\r\n }", "@Override\n public Rectangle getBounds() {\n return new Rectangle(x,y,64,64);\n }", "private void setBounds(RectProto.Builder builderForValue) {\n this.bounds_ = (RectProto) builderForValue.build();\n this.bitField0_ |= 8;\n }", "@Override\n\tpublic void CheckBounds() {\n\t\t\n\t}", "int getBoundsX();", "public PickBounds() {\n\tbounds = null;\n }", "public void checkBounds(Scope scope) {\n}", "public PickBounds(Bounds boundsObject) {\n\tbounds = boundsObject;\n }", "public Rectangle getBound(){\n \tint x = (int)location.getX();\n \tint y = (int)location.getY();\n \t\n \tif(isExploded == false)\n \t\treturn new Rectangle(x, y, image.getWidth(null), image.getHeight(null));\n \telse\n \t\treturn new Rectangle(x,y, 1,1);\n }", "public Rectangle getBoundsBigger() {\n return new Rectangle(x-32,y-32,128,128);\n }", "public BoundingBox(double minX, double minY, double maxX, double maxY) {\r\n this.setMinX(minX);\r\n this.setMinY(minY);\r\n this.setMaxX(maxX);\r\n this.setMaxY(maxY);\r\n }", "public final BoundingBox getBounds() {\n\t\tif (bounds==null) {\n\t\t\tint srsID =( (Geometry)this.get(0).getDefaultGeometry()).getSRID();\n\t\t\tBoundingBox re = new BoundingBoxImpl(\"\"+srsID);\n\t\t\tfor (SimpleFeature f : this) {\n\t\t\t\tre.include(f.getBounds());\n\t\t\t}\n\t\t\tbounds = re;\n\t\t}\n\t\treturn bounds;\n\t}", "public DeclaredTypeListNode getBounds()throws ClassCastException;", "@External\r\n\t@ClientFunc\r\n\tpublic MetaVar SetBBox(MetaVarVector boxMinVar,MetaVarVector boxMaxVar);", "@Override\n protected void addBounds ()\n {\n ParticleSystemConfig.Layer psconfig = (ParticleSystemConfig.Layer)_config;\n GroupPriority priorityMode = psconfig.priorityMode;\n if (priorityMode == null) {\n _bounds.getCenter(_center);\n }\n super.addBounds();\n\n // add layer bounds to group bounds, if applicable\n if (priorityMode != null) {\n ((ParticleSystem)_parentScope).getGroupBounds(\n priorityMode.group).addLocal(_bounds);\n }\n }", "GridEnvelope getLimits();", "public abstract Rectangle getSnapshotBounds();", "public Rectangle getBounds()\n {\n return new Rectangle ((int)x,(int)y,32,32);\n }", "public BoundsObject getBounds() {\n\t\treturn null;\n\t}", "default Rectangle2D constrainRectangle( Figure f, Rectangle2D r) {\n return translateRectangle(f, r, DIRECTION_NEAREST);\n }", "void provideBounds(DiagramDescription diagram);", "public RMRect getBoundsMarked()\n{\n // Declare bounds marked rect\n RMRect boundsMarked = null;\n \n // If stroke, get stroke marked bounds\n if(getStroke()!=null)\n boundsMarked = getStroke().getBounds(this);\n \n // If fill, get fill marked bounds\n if(getFill()!=null) {\n RMRect b = getFill().getBounds(this);\n boundsMarked = boundsMarked==null? b : boundsMarked.unionRect(b);\n }\n \n // If effect, get effect marked bounds\n if(getEffect()!=null) {\n RMRect b = getEffect().getBounds(this);\n boundsMarked = boundsMarked==null? b : boundsMarked.unionRect(b);\n }\n \n // Return marked bounds\n return boundsMarked!=null? boundsMarked : getBoundsInside();\n}", "private void updateBoundingBox(GM_Object geo) {\r\n double minx_ = 0; double miny_ = 0;\r\n double maxx_ = 0; double maxy_ = 0;\r\n \r\n if ( geo instanceof GM_Point ) {\r\n minx_ = ((GM_Point)geo).getX();\r\n miny_ = ((GM_Point)geo).getY();\r\n maxx_ = ((GM_Point)geo).getX();\r\n maxy_ = ((GM_Point)geo).getY();\r\n } else {\r\n GM_Envelope tmp = geo.getEnvelope();\r\n minx_ = tmp.getMin().getX();\r\n miny_ = tmp.getMin().getY();\r\n maxx_ = tmp.getMax().getX();\r\n maxy_ = tmp.getMax().getY();\r\n }\r\n \r\n if ( minx_ < minx ) minx = minx_;\r\n if ( maxx_ > maxx ) maxx = maxx_;\r\n if ( miny_ < miny ) miny = miny_;\r\n if ( maxy_ > maxy ) maxy = maxy_;\r\n }", "boolean isIncludeBounds();", "public void setInfiniteBoundingbox()\n\t{\n\t\tinf_bb = true;\n\t\tif (transfh != null) {\n\t\t\ttransfh.setInfiniteBoundingbox();\n\t\t}\n\t}", "public Rectangle getBounds() {\n\treturn new Rectangle((int)x,(int)y,32,32);\n\t}", "public RMRect getBoundsMarkedDeep()\n{\n // Get normal marked bounds\n RMRect bounds = getBoundsMarked();\n \n // Iterate over (visible) children and union with their BoundsMarkedDeep (converted to this shape coords)\n for(int i=0, iMax=getChildCount(); i<iMax; i++) { RMShape child = getChild(i);\n if(!child.isVisible()) continue;\n RMRect childBounds = child.getBoundsMarkedDeep();\n childBounds = child.convertRectToShape(childBounds, this);\n bounds.unionEvenIfEmpty(childBounds);\n }\n\n // Return marked bounds\n return bounds;\n}", "public void setBounds(Rectangle2D bounds){\r\n\t\tthis.bounds = bounds;\r\n\t}", "public Rectangle getBounds() {\r\n return new Rectangle(x, y, 55, 51);\r\n }", "@Override\n\tpublic GRectangle getBounds() {\n\t\tif (isEmpty()) {\n\t\t\treturn new GRectangle();\n\t\t} else {\n\t\t\tGPoint p0 = points.get(0);\n\t\t\tdouble minX = p0.getX();\n\t\t\tdouble maxX = minX;\n\t\t\tdouble minY = p0.getY();\n\t\t\tdouble maxY = minY;\n\t\t\tfor (int i = 1; i < size(); i++) {\n\t\t\t\tGPoint p1 = points.get(i);\n\t\t\t\tminX = Math.min(minX, p1.getX());\n\t\t\t\tmaxX = Math.max(maxX, p1.getX());\n\t\t\t\tminY = Math.min(minY, p1.getY());\n\t\t\t\tmaxY = Math.max(maxY, p1.getY());\n\t\t\t}\n\t\t\treturn new GRectangle(minX, maxX, minY, maxY);\n\t\t}\n\t}", "public Rectangle bounds()\n\t{\n\t\treturn (new Rectangle(x, y, 10, 10));\n\t}", "public void computeCircleBound()\n {\n this.savedCircleBound = getCircleBound();\n }", "public void setMovingBounds() {\r\n maxY = this.getParent().getYmax();\r\n minY = this.getParent().getYmin();\r\n maxX = this.getParent().getXmax();\r\n minX = this.getParent().getXmin();\r\n }", "public interface WiresBoundsConstraintControl extends WiresMoveControl {\n\n void setBoundsConstraint(BoundingBox boundingBox);\n\n boolean isOutOfBounds(double dx, double dy);\n\n}", "Collection<? extends Boundary> getIsBoundaryNodeOf();", "public float[] getBounds() {\r\n\t\tfloat[] bounds = {x_ - width_/ 2, x_ + width_ / 2, y_ - height_ / 2, y_ + height_ / 2};\r\n\t\treturn bounds;\r\n\t}", "public void ComputeBounds( Vec3 min, Vec3 max )\r\n\t{\r\n\t\tfor ( int iTempCount = 1; iTempCount <= 3; iTempCount++ )\r\n\t\t{\r\n\t\t\tVec3 tempPoint = m_vertices[iTempCount];\r\n\t\t\t\r\n\t\t\tif ( tempPoint.xCoord < min.xCoord )\r\n\t\t\t{\r\n\t\t\t\tmin.xCoord = tempPoint.xCoord;\r\n\t\t\t}\r\n\t\t\telse if ( tempPoint.xCoord > max.xCoord )\r\n\t\t\t{\r\n\t\t\t\tmax.xCoord = tempPoint.xCoord;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif ( tempPoint.yCoord < min.yCoord )\r\n\t\t\t{\r\n\t\t\t\tmin.yCoord = tempPoint.yCoord;\r\n\t\t\t}\r\n\t\t\telse if ( tempPoint.yCoord > max.yCoord )\r\n\t\t\t{\r\n\t\t\t\tmax.yCoord = tempPoint.yCoord;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif ( tempPoint.zCoord < min.zCoord )\r\n\t\t\t{\r\n\t\t\t\tmin.zCoord = tempPoint.zCoord;\r\n\t\t\t}\r\n\t\t\telse if ( tempPoint.zCoord > max.zCoord )\r\n\t\t\t{\r\n\t\t\t\tmax.zCoord = tempPoint.zCoord;\r\n\t\t\t}\t\t\t\r\n\t\t}\t\t\r\n\t}", "public java.awt.Rectangle getBounds(){\r\n return new java.awt.Rectangle((int)Math.round(x), (int)Math.round(y), (int)Math.round(getWidth()), (int)Math.round(getHeight()));\r\n }", "public abstract Rectangle getSnapshotSquareBounds();", "public RectF getBounds()\n {\n return bounds;\n }", "public Rectangle2D getBounds2D() {\n/* 155 */ if (this.usePrimitivePaint) {\n/* 156 */ Rectangle2D primitiveBounds = this.node.getPrimitiveBounds();\n/* 157 */ if (primitiveBounds == null) {\n/* 158 */ return new Rectangle2D.Double(0.0D, 0.0D, 0.0D, 0.0D);\n/* */ }\n/* 160 */ return (Rectangle2D)primitiveBounds.clone();\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 168 */ Rectangle2D bounds = this.node.getBounds();\n/* 169 */ if (bounds == null) {\n/* 170 */ return new Rectangle2D.Double(0.0D, 0.0D, 0.0D, 0.0D);\n/* */ }\n/* */ \n/* 173 */ AffineTransform at = this.node.getTransform();\n/* 174 */ if (at != null) {\n/* 175 */ bounds = at.createTransformedShape(bounds).getBounds2D();\n/* */ }\n/* 177 */ return bounds;\n/* */ }", "@Override\n\tpublic Rect getHitbox() \n\t{\n\t\treturn _bounds;\n\t}", "public PBounds getBoundsReference() {\n\t\tPBounds bds = super.getBoundsReference();\n\t\tgetUnionOfChildrenBounds(bds);\n\n\t\tcachedChildBounds.setRect(bds);\n\t\tdouble scaledIndent = INDENT/renderCamera.getViewScale();\t\t\n\t\tbds.setRect(bds.getX()-scaledIndent,bds.getY()-scaledIndent,bds.getWidth()+2*scaledIndent,bds.getHeight()+2*scaledIndent);\n\t\t\n\t\treturn bds;\n\t}", "public Rectangle getPlotBounds();", "protected void computeBounds(List<? extends Drawable> outlines, Drawable plane) {\n this.bbox = new BoundingBox3d();\n\n if (plane.getBounds() != null && !plane.getBounds().isReset()) {\n bbox.add(plane.getBounds());\n }\n\n for (Drawable outline : outlines) {\n if (outline.getBounds() != null && !outline.getBounds().isReset()) {\n bbox.add(outline.getBounds());\n }\n }\n }", "public void testBug1766646B() {\n XYBlockRenderer r = new XYBlockRenderer();\n Range range = r.findRangeBounds(null);\n DefaultXYZDataset emptyDataset = new DefaultXYZDataset();\n range = r.findRangeBounds(emptyDataset);\n }", "Range controlLimits();", "private void updateViewBounds() \r\n {\r\n assert !sim.getMap().isEmpty() : \"Visualiser needs simulator whose a map has at least one node\"; \r\n \r\n \r\n viewMinX = minX * zoomFactor;\r\n viewMinY = minY * zoomFactor;\r\n \r\n viewMaxX = maxX * zoomFactor;\r\n viewMaxY = maxY * zoomFactor;\r\n \r\n \r\n double marginLength = zoomFactor * maxCommRange;\r\n \r\n \r\n // Set the size of the component\r\n int prefWidth = (int)Math.ceil( (viewMaxX - viewMinX) + (marginLength * 2) );\r\n int prefHeight = (int)Math.ceil( (viewMaxY - viewMinY) + (marginLength * 2) );\r\n setPreferredSize( new Dimension( prefWidth, prefHeight ) );\r\n \r\n \r\n // Adjust for margin lengths \r\n viewMinX -= marginLength;\r\n viewMinY -= marginLength;\r\n \r\n viewMaxX += marginLength;\r\n viewMaxY += marginLength;\r\n }", "Limits limits();", "public MWC.GenericData.WorldArea getBounds()\r\n\t{\n\t\treturn null;\r\n\t}", "private Node createVirtualWorldBoundsShape() {\n \t\tPoint3d lower = new Point3d();\n \t\tPoint3d upper = new Point3d();\n \t\tmyVirtualWorldBounds.getLower(lower);\n \t\tmyVirtualWorldBounds.getUpper(upper);\n \t\t\n \t\tdouble[] coordinates = { lower.x, lower.y, lower.z, upper.x, lower.y,\n \t\t\t\tlower.z, upper.x, lower.y, upper.z, lower.x, lower.y, upper.z,\n \t\t\t\tlower.x, upper.y, lower.z, upper.x, upper.y, lower.z, upper.x,\n \t\t\t\tupper.y, upper.z, lower.x, upper.y, upper.z };\n \t\t\n \t\tint[] coordinateIndices = { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7,\n \t\t\t\t7, 4, 0, 4, 1, 5, 2, 6, 3, 7 };\n \t\t\n \t\tIndexedLineArray geometry = new IndexedLineArray(\n \t\t\t\tcoordinates.length / 3, IndexedLineArray.COORDINATES,\n \t\t\t\tcoordinateIndices.length);\n \t\t\n \t\tgeometry.setCoordinates(0, coordinates);\n \t\tgeometry.setCoordinateIndices(0, coordinateIndices);\n \t\t\n \t\treturn new Shape3D(geometry);\n \t}", "public Rectangle getBoundingBox() {\n\t\treturn getBounds();\n\t}", "public BoundingBox()\n\t{\n\t\tcenter = new Vector2(0.0, 0.0);\n\t\twidth = 1.0;\n\t\theight = 1.0;\n\t}", "public void getBoundsInParent(Rect outBounds) {\n/* 692 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public Rectangle getBounds() {\r\n return bounds;\r\n }", "@Override\n public GRectangle getBounds() {\n return null;\n }", "private List<Rectangle> getRectanglesToConsiderForBranchingVarCalculation () {\r\n \r\n List<Rectangle> rectanglesToConsider = new ArrayList<Rectangle> ();\r\n \r\n //for every constraint, see if it has rects at the best lp\r\n \r\n for (Map <Double, List<Rectangle>> rectMap: myInfeasibleRectanglesList) {\r\n for (List<Rectangle> rectList : rectMap.values()) { \r\n \r\n rectanglesToConsider.addAll(rectList );\r\n \r\n } \r\n }\r\n \r\n return rectanglesToConsider;\r\n }", "public void addBoundingBox() {\n abstractEditor.drawNewShape(new EBoundingBoxDT());\n }" ]
[ "0.6726267", "0.6600637", "0.6400237", "0.6395376", "0.6369754", "0.6348616", "0.62945074", "0.6265723", "0.6262396", "0.6243867", "0.6243867", "0.623398", "0.62194204", "0.62194204", "0.62194204", "0.62019235", "0.6200483", "0.61987925", "0.61975867", "0.61819607", "0.6166636", "0.61463827", "0.61452824", "0.61222947", "0.61200815", "0.6115317", "0.61147577", "0.6098872", "0.6073008", "0.6056165", "0.6041713", "0.603357", "0.60327035", "0.5985789", "0.5981457", "0.59803486", "0.59787595", "0.5920215", "0.59175944", "0.5911446", "0.5903375", "0.5885324", "0.5876576", "0.5869723", "0.58695847", "0.5858468", "0.58537805", "0.5851317", "0.5847267", "0.58434355", "0.5842198", "0.5841215", "0.58257306", "0.5819348", "0.5809616", "0.580842", "0.580184", "0.5797399", "0.57868063", "0.5781776", "0.57418543", "0.5739104", "0.5736544", "0.5734641", "0.5731372", "0.5715474", "0.57137084", "0.57061774", "0.570427", "0.57008445", "0.5690264", "0.5688932", "0.5677073", "0.56734914", "0.56673664", "0.5663035", "0.5661059", "0.5651342", "0.5650711", "0.5641238", "0.5640475", "0.5638557", "0.5632743", "0.56309503", "0.5630922", "0.56220835", "0.5610879", "0.5603598", "0.5602932", "0.55966115", "0.5591833", "0.5588305", "0.5585759", "0.55815786", "0.5578168", "0.5576701", "0.5561718", "0.55584323", "0.55494505", "0.55447865", "0.55411905" ]
0.0
-1
ammo isn't included in the chat
public String ChatName() { return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void shootGun() {\n\t\tammo--;\n\t}", "public void setAmmo(int ammo) {\n\t\tthis.ammo = ammo;\n\t}", "public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }", "public List<CardPower> pickUpAmmo()throws NoCardAmmoAvailableException {\n List<CardPower> powerups = new ArrayList<>();\n if (position.getCardAmmo() == null){\n throw new NoCardAmmoAvailableException();\n }\n if(position.getCardAmmo()!=null){\n List<Color> ammos = position.getCardAmmo().getAmmo();\n ammos = controlGrabAmmo(ammos);\n ammo.addAll(ammos);\n if(position.getCardAmmo().getCardPower() > 0){\n powerups = new ArrayList<>();\n for(int i=0; i<position.getCardAmmo().getCardPower() && cardPower.size() + i + 1 <= 3; i++)\n powerups.add(game.drawPowerUp());\n cardPower.addAll(powerups);\n }\n game.notifyGrabCardAmmo(this,ammos);\n position.setCardAmmo(null);\n }\n return powerups;\n }", "public static int haveGun() {\n\t\treturn 108;\n\t}", "public boolean isAmmoCard() {\n return ammoCard;\n }", "public void setAmmo(final boolean x) {\n int ammodif = 0;\n switch (Engine.currentWeapon) {\n\n case 2:\n ammodif = maxshotgunAmmo - shotgunAmmo;\n if (x) {\n if (ammodif < 10) {\n shotgunAmmo += ammodif;\n } else {\n shotgunAmmo += 10;\n }\n } else {\n shotgunAmmo--;\n if (shotgunAmmo == 0) {\n shotgunAmmo = 0;\n }\n\n }\n\n break;\n case 3:\n ammodif = maxrifleAmmo - rifleAmmo;\n if (x) {\n if (ammodif < 20) {\n rifleAmmo += ammodif;\n } else {\n rifleAmmo += 20;\n }\n } else {\n rifleAmmo--;\n if (rifleAmmo == 0) {\n rifleAmmo = 0;\n }\n }\n\n break;\n case 4:\n ammodif = maxgranadelauncherAmmo - granadeLauncherAmmo;\n if (x) {\n if (ammodif < 10) {\n granadeLauncherAmmo += ammodif;\n } else {\n granadeLauncherAmmo += 10;\n }\n } else {\n granadeLauncherAmmo--;\n if (granadeLauncherAmmo == 0) {\n granadeLauncherAmmo = 0;\n }\n }\n\n break;\n }\n }", "@Override\r\n\tpublic void canMissile() {\n\t\tSystem.out.println(\"미사일을 발사 할 수 있습니다.\");\r\n\r\n\t}", "public void updateAmmo(){\n if(shots >= 9999)\n shots = 9999;\n ammo.setText(\"x\" + String.format(\"%04d\", shots));\n }", "@Override\n public void onMessageReceived(@NotNull MessageReceivedEvent event) {\n String message = event.getMessage().getContentRaw().toLowerCase();\n Commands commands = Main.getBOT().getCommands();\n\n // When message is intended for bob, check it\n if (message.startsWith(\"!bob\")) {\n commands.evaluateCommand(message.replace(\"!bob \", \"\"), event);\n } else if (message.contains(\"#blamekall\")) {\n event.getChannel().sendMessage(\"NO! BE NICE! GO TO NAUGHTY JAIL!\").queue();\n event.getChannel().sendMessage(\"https://tenor.com/view/bonk-gif-18805247\").queue();\n }\n\n }", "@Override\r\n public void processMessage(INTENT intent, Object... parameters) {\n if(parameters[0] instanceof UUID){\r\n Entity e = EntityManager.getInstance().getEntity((UUID)parameters[0]);\r\n if(e.has(TeamComponent.class)){\r\n teamCaptures[e.get(TeamComponent.class).getTeamNumber() - 1]++;\r\n System.out.println(e.getName() + \" captured the flag for TEAM \" + e.get(TeamComponent.class).getTeamNumber() +\r\n \"\\r\\n\" + \"The score is \" + Arrays.toString(teamCaptures));\r\n if(numCaps == teamCaptures[e.get(TeamComponent.class).getTeamNumber() -1]){\r\n System.out.println(\"******************** WINNER WINNER CHICKEN DINNER ********************\");\r\n MessageManager.getInstance().addMessage(INTENT.WIN_COND_MET);\r\n }\r\n }else{\r\n //requires team component\r\n return;\r\n }\r\n }\r\n }", "@Override\n\tpublic void msgAtBed() {\n\t\t\n\t}", "@Override\n\tpublic void msgGotHungry() {\n\t\t\n\t}", "public boolean addAmmo(String itemname){\n\t\tif(item0.name.equals(itemname))\n\t\t\tif(item0.changeAmmo(1))//So that if we have two of the same item, it will be able to add ammo to both\n\t\t\t\treturn true;\n\t\tif(item1.name.equals(itemname))\n\t\t\treturn item1.changeAmmo(1);\n\t\treturn false;\n\t}", "public int getMineActualAmmo() {\r\n\t\t\r\n\t\t// Code kann nur bei Verwendung von eea verwendet werden, sonst muss er geloescht werden!\r\n\t\t// Auch bei Verwendung von eea muss diese Methode erweitert werden.\r\n\r\n\t\tList<Entity> entities = new ArrayList<Entity>();\r\n\r\n\t\tentities = StateBasedEntityManager.getInstance().getEntitiesByState(Tanks.GAMEPLAYSTATE);\r\n\r\n\t\t//TODO\r\n\r\n\t\treturn -1;\r\n\t}", "public int getMineMaxAmmo() {\r\n\t\t\r\n\t\t// Code kann nur bei Verwendung von eea verwendet werden, sonst muss er geloescht werden!\r\n\t\t// Auch bei Verwendung von eea muss diese Methode erweitert werden.\r\n\r\n\t\tList<Entity> entities = new ArrayList<Entity>();\r\n\r\n\t\tentities = StateBasedEntityManager.getInstance().getEntitiesByState(Tanks.GAMEPLAYSTATE);\r\n\r\n\t\t//TODO\r\n\r\n\t\treturn -1;\r\n\t}", "public boolean hasHealMyChunk() {\n return msgCase_ == 13;\n }", "boolean hasPlayerBag();", "public boolean hasHealMyChunk() {\n return msgCase_ == 13;\n }", "@Override\r\n\tpublic void collisionReaction(GameObject collidedWith)\r\n\t{\r\n\t\tif (\"Enemy\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(30,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\t\tif (\"StarBurst\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"GeneralEnemyBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10,20);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"AimedShot\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(1,5);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\r\n\t\tif (\"Asteroid\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20, 45);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t//DESTROYED ASTEROID CODE! NEEDS TO BE REUSED WITH SHOOTING!\r\n\t\t\tVec2 deathSpot = collidedWith.getPosition();\r\n\r\n\r\n\t\t\tint healthdropNum = 0;\r\n\t\t\twhile(healthdropNum <= 4)\r\n\t\t\t{\r\n\t\t\t\thealthdropNum++;\r\n\t\t\t\tGameObject healthDrop = new HealthDrops();\r\n\t\t\t\thealthDrop.setPosition(deathSpot.getX() + getRandomValue(-5, 5), deathSpot.getY() + getRandomValue(-5, 5));\r\n\t\t\t\tObjectManager.addGameObject(healthDrop);\r\n\r\n\t\t\t}\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tif (\"HealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 1;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 1;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"EnemyHealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 2;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 2;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"HealthPickup\".equals(collidedWith.getName()))\r\n\t\t{\r\n\r\n\t\t\t//System.out.println(\"Score: \" + score);\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth = 100;\r\n\t\t\tSystem.out.println(\"HEALTH RESTORED\");\r\n\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\r\n\t\t}\r\n\t\tif (\"FollowBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10, 30);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (\"BossFollower\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tsetPositionY(165.7f);\r\n\t\t}\r\n\t}", "@Override\n public void showMessage() {\n MessageHandler.getInstance()\n .writeMessage(\"This Base is different! \\n Behold!\");\n Player p = ((RomInntrenger) GameApplication.getInstance()).getClosestPlayer(transform.getGlobalPosition());\n p.getCurrentWeapon().setWeaponBase(cli);\n collider.destroy();\n destroy();\n\n }", "private void othersturn(String otherplayermsg, int commandlength) {\n boolean burn = false;\n // decode variable that came with message\n int varlength = 0;\n for (int n = commandlength + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength = n;\n break;\n }\n }\n String name = otherplayermsg.substring(commandlength + 1, varlength);\n int varlength2 = 0;\n for (int n = varlength + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength2 = n;\n break;\n }\n }\n String cardno = otherplayermsg.substring(varlength + 1, varlength2);\n\n // determining which player just had a turn\n int playernumber = 0;\n for (int n = 0; n < 3; n++)\n if (name.equals(otherNames[n])) {\n playernumber = n;\n break;\n }\n\n if (cardno.equals(\"pickup\")) { // other players picks up pile\n cardcount[playernumber] = cardcount[playernumber] + pile.size();\n pile.clear();\n sh.addMsg(otherNames[playernumber] + \" picked up the pile\");\n } else if (cardno.equals(\"burn\")) { // other player burns the pile\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n if (deck == 0 || cardcount[playernumber] > 3) {\n if (cardcount[playernumber] > 0) cardcount[playernumber]--;\n } else deck--;\n } else if (cardno.equals(\"faceup\")) { // otherplayer plays a faceup card\n int varlength3 = 0;\n for (int n = varlength2 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength3 = n;\n break;\n }\n }\n String cardno2 = otherplayermsg.substring(varlength2 + 1, varlength3);\n if (cardno2.equals(\"multi\")) {\n burn = faceupmulti(otherplayermsg, varlength3, playernumber);\n } else {\n try {\n Card card = new Card(Integer.parseInt(cardno2));\n // adding card to pile\n pile.add(card);\n // burning pile if a 10 is played\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n // removing card from table\n for (int n = 0; n < 3; n++)\n if (faceup[playernumber][n] != null)\n if (faceup[playernumber][n].getNumber() == card.getNumber()) {\n faceup[playernumber][n] = null;\n break;\n }\n } catch (NumberFormatException b) {\n sh.addMsg(\"Otherplayer - variable to Int error: \" + b);\n }\n }\n } else if (cardno.equals(\"facedown\")) { // if player plays one of there face down cards\n int varlength3 = 0;\n for (int n = varlength2 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength3 = n;\n break;\n }\n }\n String cardno2 = otherplayermsg.substring(varlength2 + 1, varlength3);\n if (cardno2.equals(\"pickup\")) {\n for (int n = varlength3 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength2 = n;\n break;\n }\n }\n String cardplayed = otherplayermsg.substring(varlength3 + 1, varlength2);\n int numPlayed = 0;\n try {\n numPlayed = Integer.parseInt(cardplayed);\n } catch (NumberFormatException b) {\n sh.addMsg(\"processTurn - facedown pickup - variable to Int error: \" + b);\n }\n cardcount[playernumber] = cardcount[playernumber] + pile.size() + 1;\n pile.clear();\n sh.addMsg(\n otherNames[playernumber]\n + \" played a \"\n + Card.getCardStringValue(numPlayed)\n + \" and had to picked up the pile\");\n } else {\n try {\n Card card = new Card(Integer.parseInt(cardno2));\n pile.add(card);\n // burning pile if a 10 is played\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n } catch (NumberFormatException b) {\n sh.addMsg(\"Otherplayer - variable to Int error: \" + b);\n }\n }\n carddowncount[playernumber]--;\n } else if (cardno.equals(\"multi\")) { // if more than 1 card is played at a time\n // determining how many card where played\n int varlength3 = 0;\n for (int n = varlength2 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength3 = n;\n break;\n }\n }\n String numPlayedString = otherplayermsg.substring(varlength2 + 1, varlength3);\n // converting string to int for processing\n int numPlayed = 0;\n try {\n numPlayed = Integer.parseInt(numPlayedString);\n } catch (NumberFormatException b) {\n sh.addMsg(\"processTurn - multi - variable to Int error: \" + b);\n }\n for (int n = 0; n < numPlayed; n++) {\n varlength2 = varlength3;\n // determining how many card where played\n varlength3 = 0;\n for (int i = varlength2 + 1; i < otherplayermsg.length(); i++) {\n char extract = otherplayermsg.charAt(i);\n if (extract == (':')) {\n varlength3 = i;\n break;\n }\n }\n String cardnoString = otherplayermsg.substring(varlength2 + 1, varlength3);\n // converting string to int for processing\n try {\n Card card = new Card(Integer.parseInt(cardnoString));\n pile.add(card);\n } catch (NumberFormatException b) {\n sh.addMsg(\"processTurn - multi - variable to Int error: \" + b);\n }\n\n if (deck == 0 || cardcount[playernumber] > 3) {\n if (cardcount[playernumber] > 0) cardcount[playernumber]--;\n } else deck--;\n }\n\n // burning pile if a 10 is played or 4 of a kind\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n\n } else {\n // adding card to pile\n try {\n Card card = new Card(Integer.parseInt(cardno));\n pile.add(card);\n // burning pile if a 10 is played\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burn = true;\n burnPile();\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n } catch (NumberFormatException b) {\n sh.addMsg(\"Otherplayer else - variable to Int error: \" + b);\n }\n if (deck == 0 || cardcount[playernumber] > 3) {\n if (cardcount[playernumber] > 0) cardcount[playernumber]--;\n } else deck--;\n }\n if (!burn) nextTurn();\n displayTable();\n }", "@Override\n public void onObjectMessage(ReceivedObjectMessage message) {\n //ignore the message\n }", "private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "private void checkIfHungry(){\r\n\t\tif (myRC.getEnergonLevel() * 2.5 < myRC.getMaxEnergonLevel()) {\r\n\t\t\tmission = Mission.HUNGRY;\r\n\t\t}\r\n\t}", "@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }", "private static void messageConstructor(){\n msg = \"These are the ammo you can spend.\\n\" +\n \"Every time you select the corresponding color, the quantity will decrease: \\n\";\n\n paymentSB.append(msg);\n if (tmpAmmoInAmmoBox[GeneralInfo.RED_ROOM_ID] > 0) {\n msg = red + \": Red ammo available: \" + tmpAmmoInAmmoBox[GeneralInfo.RED_ROOM_ID] + \"\\n\";\n paymentSB.append(msg);\n responeForAmmo.add(red);\n }\n if (tmpAmmoInAmmoBox[GeneralInfo.BLUE_ROOM_ID] > 0) {\n msg = blue + \": Blue ammo available: \" + tmpAmmoInAmmoBox[GeneralInfo.BLUE_ROOM_ID] + \"\\n\";\n paymentSB.append(msg);\n responeForAmmo.add(blue);\n }\n if (tmpAmmoInAmmoBox[GeneralInfo.YELLOW_ROOM_ID] > 0) {\n msg = yellow + \": Yellow ammo available: \" + tmpAmmoInAmmoBox[GeneralInfo.YELLOW_ROOM_ID] + \"\\n\";\n paymentSB.append(msg);\n responeForAmmo.add(yellow);\n }\n\n for (i = 0; i < tmpAmmoInPowerUp.size(); i++) {\n msg = (i + 1) + \": \" + tmpAmmoInPowerUp.get(i).getName() + \" COLOR: \" + tmpAmmoInPowerUp.get(i).getGainAmmoColor() + \"\\n\";\n paymentSB.append(msg);\n responseForPowerUp.add(Integer.toString(i + 1));\n }\n\n if (!responeForAmmo.isEmpty()) {\n possibleChoice.addAll(responeForAmmo);\n msg = \"Chose a letter R/B/Y \\n\";\n paymentSB.append(msg);\n }\n\n if(!responseForPowerUp.isEmpty()) {\n possibleChoice.addAll(responseForPowerUp);\n msg = \"choose a number from 1 to \" + i + \": \";\n paymentSB.append(msg);\n }\n }", "public boolean gameOver()\r\n {\r\n return enemigos.size() == 10;\r\n }", "@Override\n\tpublic void msgPartsLow() {\n\t\t\n\t}", "public boolean processCommand(Command command) \n {\n wantToQuit = false;\n String commandWord = command.getCommandWord();\n String commandWord2 = command.getSecondWord();\n \n \n if(enemyPresent == true)\n {\n sewers.removeItem(rope); \n if(command.isUnknown()) {\n System.out.println(\"Now is not the time. How would you like to attack, with weapon, laser, fire or shrink?\");\n return false;\n } \n else if(commandWord.equals(\"fire\")){\n int enemyHealth;\n setRand(); \n int damage;\n \n damage = player.useFire();\n currentRoom.setEnemyHealth(damage);\n \n int damageDone = damage;\n \n if(currentRoom.getEnemyHealth() < 0){\n enemyHealth = 0; \n }\n else {\n enemyHealth = currentRoom.getEnemyHealth(); \n }\n \n System.out.println(\"\\n\" + damageDone + \" damage done to enemy with fire spell! Fire level increased!\");\n \n System.out.println(\"Enemy health at \" + enemyHealth + \"!\");\n \n if(currentRoom.getEnemyHealth() > 0)\n {\n int playerHealth;\n player.setHealth(currentRoom.getEnemyDamage());\n \n checkHealth();\n \n if(player.getHealth() < 0)\n {\n playerHealth = 0;\n }\n else{\n playerHealth = player.getHealth();\n }\n \n System.out.println(currentRoom.getEnemyDamage() + \" damage taken! \" + \"Health at \" + playerHealth + \"!\" + \"\\n\");\n \n }\n }\n \n else if(commandWord.equals(\"freeze\")){\n int enemyHealth;\n setRand(); \n int damage;\n \n damage = player.useFreeze();\n currentRoom.setEnemyHealth(damage);\n \n int damageDone = damage;\n \n if(currentRoom.getEnemyHealth() < 0){\n enemyHealth = 0; \n }\n else {\n enemyHealth = currentRoom.getEnemyHealth(); \n }\n \n System.out.println(\"\\n\" + damageDone + \" damage done to enemy with fire spell! Freeze level increased!\" + \"\\n\");\n \n System.out.println(\"Enemy health at \" + enemyHealth + \"!\");\n \n if(currentRoom.getEnemyHealth() > 0)\n {\n int playerHealth;\n player.setHealth(currentRoom.getEnemyDamage());\n \n checkHealth();\n \n if(player.getHealth() < 0)\n {\n playerHealth = 0;\n }\n else{\n playerHealth = player.getHealth();\n }\n \n System.out.println(currentRoom.getEnemyDamage() + \" damage taken! \" + \"Health at \" + playerHealth + \"!\" + \"\\n\");\n \n }\n } \n \n else if(commandWord.equals(\"laser\")){\n int enemyHealth;\n setRand(); \n int damage;\n \n damage = player.useLaser();\n currentRoom.setEnemyHealth(damage);\n \n int damageDone = damage;\n \n if(currentRoom.getEnemyHealth() < 0){\n enemyHealth = 0; \n }\n else {\n enemyHealth = currentRoom.getEnemyHealth(); \n }\n \n System.out.println(\"\\n\" + damageDone + \" damage done to enemy with fire spell! Laser level increased!\" + \"\\n\");\n \n System.out.println(\"Enemy health at \" + enemyHealth + \"!\");\n \n if(currentRoom.getEnemyHealth() > 0)\n {\n int playerHealth;\n player.setHealth(currentRoom.getEnemyDamage());\n \n checkHealth();\n \n if(player.getHealth() < 0)\n {\n playerHealth = 0;\n }\n \n else\n {\n playerHealth = player.getHealth();\n }\n \n System.out.println(currentRoom.getEnemyDamage() + \" damage taken! \" + \"Health at \" + playerHealth + \"!\" + \"\\n\");\n \n }\n }\n \n \n else if(commandWord.equals(\"weapon\")){\n \n \n int enemyHealth;\n setRand();\n \n currentRoom.setEnemyHealth(player.getAttackDamage());\n \n int damageDone = player.getAttackDamage();\n \n if(currentRoom.getEnemyHealth() < 0){\n enemyHealth = 0; \n }\n else {\n enemyHealth = currentRoom.getEnemyHealth(); \n }\n \n System.out.println(\"\\n\" + damageDone + \" damage done to enemy with \" + player.getWeaponName() + \"!\");\n \n System.out.println(\"Enemy health at \" + enemyHealth + \"!\");\n \n if(currentRoom.getEnemyHealth() > 0)\n {\n int playerHealth;\n player.setHealth(currentRoom.getEnemyDamage());\n \n checkHealth();\n \n if(player.getHealth() < 0)\n {\n playerHealth = 0;\n }\n else{\n playerHealth = player.getHealth();\n }\n \n System.out.println(currentRoom.getEnemyDamage() + \" damage taken! \" + \"Health at \" + playerHealth + \"!\" + \"\\n\");\n \n }\n }\n\n else if(commandWord.equals(\"ai\")){\n \n\n if (commandWord2.equals(\"one\"))\n {\n startAi(1);\n }\n else if (commandWord2.equals(\"two\"))\n {\n startAi(2);\n }\n else if (commandWord2.equals(\"three\"))\n {\n startAi(3);\n }\n else if (commandWord2.equals(\"four\"))\n {\n startAi(4);\n }\n else if (commandWord2.equals(\"five\"))\n {\n startAi(5);\n }\n else if (commandWord2.equals(\"six\"))\n {\n startAi(6);\n }\n else if (commandWord2.equals(\"seven\"))\n {\n startAi(7);\n }\n else if (commandWord2.equals(\"eight\"))\n {\n startAi(8);\n }\n else if (commandWord2.equals(\"nine\"))\n {\n startAi(9);\n }\n else if (commandWord2.equals(\"ten\"))\n {\n startAi(10);\n }\n else if (commandWord2.equals(\"eleven\"))\n {\n startAi(11);\n }\n else if(commandWord2.equals(\"all\"))\n {\n startAi(12);\n }\n else\n {\n System.out.println(\"I don't know what you mean...\");\n return false; \n }\n \n }\n else if(commandWord.equals(\"flee\")){\n setRand();\n if(rand <= 8)\n {\n System.out.println(\"Pity, you've been snatched by the monster and killed.\" + \"\\n\");\n alive = false;\n }\n else{\n System.out.println(\"You got away!\");\n enemyPresent = false;\n currentRoom.removeEnemy(); \n }\n }\n \n else if (commandWord.equals(\"use\")){\n useItem(command); \n }\n \n else{\n System.out.println(\"Now is not the time. How would you like to attack, with weapon, laser, fire, shrink, or flee?\"); \n }\n \n if(currentRoom.getEnemyHealth() <= 0)\n {\n System.out.println(\"Enemy vanquished!\" + \"\\n\");\n enemyPresent = false;\n currentRoom.removeEnemy();\n }\n \n \n }\n \n else\n {\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n if (commandWord.equals(\"help\")) {\n printHelp();\n }\n else if(commandWord.equals(\"ai\")){\n \n\n if (commandWord2.equals(\"one\"))\n {\n startAi(1);\n }\n else if (commandWord2.equals(\"two\"))\n {\n startAi(2);\n }\n else if (commandWord2.equals(\"three\"))\n {\n startAi(3);\n }\n else if (commandWord2.equals(\"four\"))\n {\n startAi(4);\n }\n else if (commandWord2.equals(\"five\"))\n {\n startAi(5);\n }\n else if (commandWord2.equals(\"six\"))\n {\n startAi(6);\n }\n else if (commandWord2.equals(\"seven\"))\n {\n startAi(7);\n }\n else if (commandWord2.equals(\"eight\"))\n {\n startAi(8);\n }\n else if (commandWord2.equals(\"nine\"))\n {\n startAi(9);\n }\n else if (commandWord2.equals(\"ten\"))\n {\n startAi(10);\n }\n else if (commandWord2.equals(\"eleven\"))\n {\n startAi(11);\n }\n else if(commandWord2.equals(\"all\"))\n {\n startAi(12);\n }\n else\n {\n System.out.println(\"I don't know what you mean...\");\n return false; \n }\n \n }\n else if (commandWord.equals(\"go\")) {\n goRoom(command);\n }\n \n else if (commandWord.equals(\"take\")){\n player.pickUpWeapon(command);\n player.pickUpItem(command);\n }\n else if(commandWord.equals(\"health\")){\n System.out.println(\"Health is at: \" + player.getHealth());\n }\n else if(commandWord.equals(\"drop\"))\n {\n player.dropWeapon(command);\n }\n else if(commandWord.equals(\"boss\"))\n {\n currentRoom = throneRoomEntrance; \n }\n else if (commandWord.equals(\"use\")){\n useItem(command); \n }\n else if (commandWord.equals(\"open\")){\n openChest(command);\n }\n else if (commandWord.equals(\"quit\")) {\n wantToQuit = quit(command);\n }\n else if (commandWord.equals(\"inventory\")){\n player.printInventory();\n }\n else if (commandWord.equals(\"name\")){\n Scanner reader = new Scanner(System.in);\n System.out.println(\"Enter a name: \");\n name = reader.next();\n player.setName(name);\n reader.close();\n System.out.println(\"New name is: \" + name);\n player.getName();\n \n }\n }\n \n return wantToQuit;\n }", "public boolean shoot() {\n if (!isReloading && System.currentTimeMillis() - previousShotTime > shootInterval * 1000 && ammoRemaining > 0) {\n\n previousShotTime = System.currentTimeMillis();\n\n ammoRemaining--;\n audioPlayer.setSpatial(holder);\n audioPlayer.playOnce();\n // score -= 50;\n Vec2 angle = Vec2\n .Vector2FromAngleInDegrees(transform.getGlobalRotation().getAngleInDegrees() - 90 + (Math.random() * spread * 2 - spread));\n\n Vec2 spawnPosition = transform.getWorldPosition();\n\n Projectile p = new Projectile(spawnPosition,\n Vec2\n .Vector2FromAngleInDegrees(\n transform.getGlobalRotation().getAngleInDegrees() - 90 + (Math.random() * spread * 2 - spread)),\n new Sprite(projectilePath));\n p.setSpeed(speed);\n p.setSource(holder);\n p.getCollider().addInteractionLayer(\"Block\");\n p.getCollider().addInteractionLayer(\"Hittable\");\n p.getCollider().addInteractionLayer(\"Walk\");\n p.setOnCollisionListener(other -> {\n if (other.getGameObject() instanceof Player && other.getGameObject() != holder) {\n Player player = (Player) other.getGameObject();\n player.hit(alteredDmg);\n if (GameEngine.DEBUG) {\n System.out.println(\"Bullet Hit \" + other.getName());\n }\n p.destroy();\n\n// player.destroy();\n } else if (other.getGameObject() instanceof Enemy) {\n Enemy e = ((Enemy) other.getGameObject());\n e.hit(alteredDmg);\n if (!e.isAlive()) { // CHeck if enemy survived\n ((Player) p.getSource()).killedEnemy();\n }\n p.destroy();\n } else if (other.getTag() == \"Block\") {\n p.destroy();\n }\n\n });\n return true;\n } else if(ammoRemaining <= 0){\n reloadWeapon();\n return false;\n }else\n return false;\n }", "@Override\r\n\tpublic void recieveHit() {\n\t\tif(armour <= 0) {\r\n\t\t\tSystem.out.println(\"Enemy Destroyed\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble calculateHitDamage = shot * basicDamage;\r\n\t\t\tif(calculateHitDamage == armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy Armour Destroyed!!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage > armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy is Dead!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage < armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy not detroyed!! \\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Current Enemy life: \"+ armour);\r\n\t\t}\r\n\t}", "public boolean immobilises(Pokemon poke) {\n BattleField field = poke.getField();\n if (field.getRandom().nextDouble() <= 0.25) {\n field.showMessage(poke.getName() + \" is paralysed! It can't move!\");\n return true;\n }\n return false;\n }", "@Override\n public void handleMessage(Message msg) {\n sendEmptyMessageDelayed(0, 3000);\n if (resClient.getSendBufferFreePercent() <= 0.05) {\n Toast.makeText(StreamingActivity.this, \"sendbuffer is full,netspeed is low!\", Toast.LENGTH_SHORT).show();\n }\n }", "public void addAmmo (double amount) {\n\t\t\n\t\tcurrentAmmo = Math.min(maxAmmo, currentAmmo + amount);\n\t}", "public void sendDataToAMQ(){\n\t\t\r\n\t\tList<String> msg = new ArrayList<>();\r\n\t\tif(offsetfollower < (prototype.followerDrivingInfo.meetingLocation - 500)) {\r\n\t\t\toffsetleader += prototype.leaderDrivingInfo.speed;\r\n\t\t\toffsetfollower += prototype.followerDrivingInfo.speed;\r\n\t\t\tmsg.add(\"<carName TestCar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (+offsetleader) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\r\n\t\t\tmsg.add(\"<carName Camcar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (offsetfollower) +\" segmentPosY> <carSpeed \" + (prototype.followerDrivingInfo.speed)+\" carSpeed>\");\t\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\toffsetleader += prototype.leaderDrivingInfo.speed;\r\n\t\t\toffsetfollower += prototype.leaderDrivingInfo.speed ;\r\n\t\t\tmsg.add(\"<carName TestCar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (+offsetleader) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\t\r\n\t\t\tmsg.add(\"<carName Camcar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (offsetfollower) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\r\n\r\n\t\t}\r\n for(int i = 0; i < msg.size();i++)\r\n {\r\n \tamqp.sendMessage(msg.get(i));\r\n }\r\n// \t}\r\n }", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "public void increaseVolume() {\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.INCREASE_VOLUME));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.INCREASE_VOLUME) {\n isIncreasingVolume = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n };\n }", "private boolean allowsInstantMessage()\n {\n for(ChatTransport tr : transportMenuItems.keySet())\n {\n if(tr.allowsInstantMessage())\n {\n return true;\n }\n }\n\n return false;\n }", "@Override\n public void onMessage(MessageEvent event) throws InterruptedException, Exception {\n \n String message = Colors.removeFormattingAndColors(event.getMessage());\n \n if (message.startsWith(Global.commandPrefix)&&!message.matches(\"([ ]{0,}\"+Global.commandPrefix+\"{1,}[ ]{0,}){1,}\")){\n \n String command = message.split(Global.commandPrefix)[1];\n String[] cmdSplit = command.split(\" \");\n \n if (cmdSplit[0].equalsIgnoreCase(\"blackjack\")&&!GameUtils.areGamesBlocked(event.getChannel().getName())){\n \n String gameChan = event.getChannel().getName();\n \n if (!GameListener.activeGame.contains(new String[] {gameChan, \"blackjack\", \"long\"})){\n \n int minBet = 10;\n String options = null;\n \n // OPTIONS FOR THE GAME\n if (cmdSplit.length>1&&cmdSplit.length<=3){\n for (int i=1;i<cmdSplit.length;i++){\n \n if (cmdSplit[i].matches(\"[0-9]+\")){\n minBet = Integer.parseInt(cmdSplit[i]);\n }\n \n else if(cmdSplit[i].matches(\"\\\\-[0-9\\\\.]+\")){\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"The minimum bet must be a non-negative integer\");\n return;\n }\n \n else if(cmdSplit[i].matches(\"[a-z]+\")){\n if (cmdSplit[i].equalsIgnoreCase(\"multi\")||cmdSplit[i].equalsIgnoreCase(\"single\")){\n options = cmdSplit[i];\n }\n else{\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"Unknown option. Available options include 'Single' and 'Multi'\");\n return;\n }\n }\n }\n }\n else if (cmdSplit.length>3){\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"BlackJack accepts at most 2 options\");\n }// END OPTIONS PARSING\n \n \n if (GameListener.scores.getScore(event.getUser().getNick())<minBet){\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"You don't have enough money to play blackjack with a minimum bet of $\"+minBet);\n }\n else{\n \n GameListener.activeGame.add(gameChan, \"blackjack\", \"long\");//Lets add the game to the array well after the input checks\n \n int key=(int) (Math.random()*100000+1);\n int counter = 1; // Current player number, as Wheatley (dealer) is 0, starts at 1\n int prev = 0;\n int busted = 0; // Number of people who've busted their hand\n boolean running = true;\n \n ArrayList<String> users = new ArrayList<>();\n users.add(event.getBot().getNick()); // BOT is user 0\n users.add(event.getUser().getNick()); // Any other users are added after the dealer/bot\n \n if (options!=null){\n if (options.equalsIgnoreCase(\"multi\")){\n event.getBot().sendIRC().message(gameChan,event.getUser().getNick()+\" wants to play blackjack, type !dealmein to join\");\n MultiplayerArrayGetQueue getPlayers = new MultiplayerArrayGetQueue(event,\"dealmein\",25,maxUsers-2);\n getPlayers.setScoringRequirements(GameListener.scores,minBet);\n users.addAll(getPlayers.getPlayers());\n }\n }\n \n \n QueueTime gameUpdater = new QueueTime(event,time,key);\n Thread t = new Thread(gameUpdater);\n gameUpdater.giveT(t);\n t.start();\n \n DeckOfCards deck = new DeckOfCards();\n deck.shuffle();\n ArrayList<CardHand> hands = new ArrayList<>();\n \n for (int i=0;i<users.size();i++){\n hands.add(new CardHand(users.get(i))); // Bot is user 0\n }\n \n // DEAL CARDS TO ALL PLAYERS AND DEALER\n for (int i=0;i<2;i++){\n for (int j=0;j<hands.size();j++){\n hands.get(j).addCard(deck.dealCard());\n }\n }// END DEALING\n \n if (hands.size()>2){ // MASK HANDS WHEN THERE ARE MULTIPLE PLAYERS IN ONE CHANNEL\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev = counter;\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n \n WaitForQueue queue = new WaitForQueue(event.getBot());\n \n while (running){\n \n MessageEvent currentEvent = queue.waitFor(MessageEvent.class);\n String currentMessage = Colors.removeFormattingAndColors(currentEvent.getMessage());\n String currentChan = currentEvent.getChannel().getName();\n \n if (currentMessage.equalsIgnoreCase(Integer.toString(key))){\n \n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(hands.get(counter).getPlayer())){\n users.remove(i);\n break;\n }\n }\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn will be skipped and they will be dealt out next hand due to inactivity\");\n counter++;\n \n if (users.size()>1&&counter<hands.size()){\n if (hands.size()>2){ // HIDE YOUR HAND IF THERES MORE THAN JUST TWO PLAYERS (PLAYER AND BOT)\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n if (prev!=counter){\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev=counter;\n }\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n }\n \n key=(int) (Math.random()*100000+1);\n gameUpdater.interrupt();\n gameUpdater = new QueueTime(event,time,key);\n t = new Thread(gameUpdater);\n gameUpdater.giveT(t);\n t.start();\n\n }\n else if(currentChan.equalsIgnoreCase(gameChan)){\n if (hands.get(counter).getPlayer().equalsIgnoreCase(currentEvent.getUser().getNick())){\n if (currentMessage.equalsIgnoreCase(\"h\")||currentMessage.equalsIgnoreCase(\"s\")){\n \n if (currentMessage.equalsIgnoreCase(\"h\")){\n hands.get(counter).addCard(deck.dealCard());\n \n if (hands.get(counter).getBlackjackHandValue()>21){\n event.getBot().sendIRC().message(gameChan, \"You have BUSTED! \"+hands.get(counter).getPlayer()+\"'s hand was \" +hands.get(counter).toColoredString() + \"Total: \"+hands.get(counter).getBlackjackHandValue());\n counter++;\n busted++;\n }\n }// END HIT\n \n else if (currentMessage.equalsIgnoreCase(\"s\")){\n counter++;\n }// END STAY\n \n if (counter<hands.size()){ // SHOW THE PLAYER THEIR HAND\n if (hands.size()>2){ // HIDE YOUR HAND IF THERES MORE THAN JUST TWO PLAYERS (PLAYER AND BOT)\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n if (prev!=counter){\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev=counter;\n }\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n }// END CURRENT HAND DISPLAY\n \n key=(int) (Math.random()*100000+1);\n gameUpdater.interrupt();\n gameUpdater = new QueueTime(event,time,key);\n t = new Thread(gameUpdater);\n gameUpdater.giveT(t);\n t.start();\n \n }\n \n else if (currentMessage.equalsIgnoreCase(\"!dealmeout\")){\n boolean removed = false;\n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(currentEvent.getUser().getNick())){\n users.remove(i);\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt out of the next hand\");\n break;\n }\n }\n if (removed)\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You're is not currently an active player in this game\");\n }// END REMOVE USER FROM CURRENT GAME\n \n \n \n else if (currentMessage.equalsIgnoreCase(\"!fuckthis\")||currentMessage.equalsIgnoreCase(\"i give up\")){\n if (hands.size()==2){\n currentEvent.respond(\"You have given up. \" + Global.mainNick + \"'s hand was \"+hands.get(getHandByPlayer(hands, event.getBot().getNick())).toColoredString() + \"Total: \"+hands.get(getHandByPlayer(hands, event.getBot().getNick())).getBlackjackHandValue());\n queue.close();\n break;\n }\n else{\n currentEvent.respond(\"You have given up. \");\n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(currentEvent.getUser().getNick())){\n users.remove(i);\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt out of the next hand\");\n break;\n }\n }\n }\n }\n }\n else if (currentMessage.equalsIgnoreCase(\"!dealmein\")){\n if (users.size()<maxUsers){\n users.add(currentEvent.getUser().getNick());\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt into the next hand\");\n }\n else{\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"Current game is full, please wait till another user leaves\");\n }\n }// END ADD USER TO GAME\n else if (currentMessage.equalsIgnoreCase(\"!dealmeout\")){\n boolean removed = false;\n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(currentEvent.getUser().getNick())){\n users.remove(i);\n removed = true;\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt out of the next hand\");\n break;\n }\n }\n if (!removed)\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You're not currently an active player in this game\");\n }// END REMOVE USER FROM CURRENT GAME\n }\n \n // Wheatley's Move\n if (counter>=hands.size()){\n counter = 0;\n if (busted < (hands.size()-1)){\n while (hands.get(counter).getBlackjackHandValue()<17||(hands.get(counter).isBlackjackHandSoft()&&hands.get(counter).getBlackjackHandValue()==17)){\n hands.get(counter).addCard(deck.dealCard());\n event.getBot().sendIRC().message(gameChan,Global.mainNick+\" hits: \"+hands.get(counter).toMaskedString());\n }\n if (hands.get(counter).getBlackjackHandValue()>21){\n event.getBot().sendIRC().message(gameChan, Global.mainNick+\" has BUSTED! \"+Global.mainNick+\"'s hand was \" +hands.get(counter).toColoredString() + \"Total: \"+hands.get(counter).getBlackjackHandValue());\n }\n }\n busted = 0;\n }// END WHEATLEY'S MOVE\n \n // Wheatley is the last player to go, if he's done, then all players are done\n if (counter == 0){\n \n ArrayList<Integer> winner = new ArrayList<>();\n {\n int i=0;\n while (winner.size()<1&&i<hands.size()){\n if (hands.get(i).getBlackjackHandValue()<=21)\n winner.add(i);\n i++;\n }\n }\n \n for (int i=0; i<hands.size();i++)\n System.out.println(hands.get(i).getPlayer());\n \n for (int i=0;i<hands.size();i++){ // START SCORING\n \n if (hands.get(i).getBlackjackHandValue()<=21){\n \n if (hands.get(i).getBlackjackHandValue()>hands.get(winner.get(0)).getBlackjackHandValue()){//|| hands.get(winningHand).getBlackjackHandValue()>21){\n winner.clear();\n winner.add(i);\n }\n \n else if (hands.get(i).getBlackjackHandValue()==hands.get(winner.get(0)).getBlackjackHandValue()){\n//if hands are equal to 21, player with blackjack wins\n// if both have blackjack, dealer wins, if neither are the dealer, winnings are split\n \n if (hands.get(i).isHandBlackjack()&&!hands.get(winner.get(0)).isHandBlackjack()){\n winner.clear();\n winner.add(i);\n }\n else if (hands.get(i).isHandBlackjack()&&hands.get(winner.get(0)).isHandBlackjack()){\n if(hands.get(i).getPlayer().equalsIgnoreCase(event.getBot().getNick())||hands.get(winner.get(0)).getPlayer().equalsIgnoreCase(event.getBot().getNick())){\n winner.clear();\n winner.add(0);\n }\n else{\n winner.add(i);\n }\n }\n else if (hands.get(i).getPlayer().equalsIgnoreCase(event.getBot().getNick())||hands.get(winner.get(0)).getPlayer().equalsIgnoreCase(event.getBot().getNick())){\n winner.clear();\n winner.add(0);\n }\n else if (!winner.contains(i)){\n winner.add(i);\n }\n }\n }\n }// END SCORING\n \n double multiplier=1;\n if (hands.get(winner.get(0)).isHandBlackjack()&&!hands.get(winner.get(0)).getPlayer().equalsIgnoreCase(event.getBot().getNick()))\n multiplier=1.5;\n \n int earnings = (int) ((minBet*(hands.size()-1) * multiplier) / winner.size());\n \n for (int i=0;i<winner.size();i++){\n event.getBot().sendIRC().message(gameChan,hands.get(winner.get(i)).getPlayer()+\" has won! The winning hand was \"+ hands.get(winner.get(i)).toColoredString()+\"totaling \"+hands.get(winner.get(i)).getBlackjackHandValue()+\" and earning $\"+earnings+\", everyone else has lost $\"+minBet);\n GameListener.scores.addScore(hands.get(winner.get(i)).getPlayer(),earnings);\n }\n \n//subtract bet from all players scores, winners included\n//add all losses/bets into winning pool, split by number of winners evenly\n\n // SUBTRACT BET FROM ALL USERS BUT THE WINNER\n for (int i=0;i<hands.size();i++){\n if(!winner.contains(i)){\n \n if (i==0)\n GameListener.scores.subtractScore(hands.get(i).getPlayer(),(int) (minBet*(1.5*winner.size())));\n else\n GameListener.scores.subtractScore(hands.get(i).getPlayer(),minBet);\n }\n }// END UPDATE ALL USERS SCORES BUT THE WINNER\n \n for (int i=0;i<users.size();i++){\n if(GameListener.scores.getScore(users.get(i))<minBet){\n event.getBot().sendIRC().message(currentEvent.getChannel().getName(),users.get(i)+\" does not have enough money to cover the current bet and will not be dealt in this round\");\n users.remove(i);\n i--;\n }\n }// End cleaning user array\n\n \n // ONLY CONTINUE IF MORE THAN THE DEALER ARE PLAYING\n if (users.size()>1){\n counter=1;\n deck = new DeckOfCards();\n deck.shuffle();\n hands.clear();\n \n // CREATE HANDS\n for (int i=0;i<users.size();i++){\n hands.add(new CardHand(users.get(i)));\n }// END CREATE HANDS\n \n // DEAL CARDS\n for (int i=0;i<2;i++){\n for (int j=0;j<hands.size();j++){\n hands.get(j).addCard(deck.dealCard());\n }\n }// END DEAL CARDS\n \n if (hands.size()>2){ // HIDE YOUR HAND IF THERES MORE THAN JUST TWO PLAYERS (PLAYER AND BOT)\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n if (prev!=counter){\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev=counter;\n }\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n }// END NEXT HAND START\n else if(users.isEmpty()||users.size()==1){\n event.getBot().sendIRC().message(gameChan,\"Looks like nobody is around, Thanks for playing BlackJack! Come again soon!\");\n running = false;\n queue.close();\n }\n } // ENDS AFTER WHEATLEY'S MOVE\n }\n GameListener.activeGame.remove(gameChan,\"blackjack\"); //updated current index of the game\n }\n }\n else\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"Game Currently running in this channel\");\n }\n }\n }", "@Override\n public void collide(ScreenObject other) {\n switch (other.getType()) {\n case ASTEROID:\n hp -= other.dealDamage();\n break;\n case ENEMY:\n hp -= other.dealDamage();\n break;\n case ENEMYBULLET:\n hp -= other.dealDamage();\n break;\n case MACGUFFIN:\n macguffinsCollected++;\n break;\n case PORT:\n if (macguffinsCollected >= level.getMacguffinCount()\n && boundingCircle.contains(other.getPosition())) {\n Gdx.app.log(\"Ship\", \"level over\");\n //ends level\n }\n break;\n }\n }", "void broadCastMessageLocal(Message message) {\n/* 1691 */ if (this.creatures != null)\n/* 1692 */ for (Iterator<Creature> it = this.creatures.iterator(); it.hasNext(); ) {\n/* */ \n/* 1694 */ Creature creature = it.next();\n/* 1695 */ if (!creature.getCommunicator().isInvulnerable()) {\n/* 1696 */ creature.getCommunicator().sendMessage(message);\n/* */ }\n/* */ } \n/* */ }", "public int magicMissile();", "public void checkItem() {\n Entity t = BombermanGame.checkCollisionItem(this.rectangle);\n if (t instanceof SpeedItem) {\n speed ++;\n ((SpeedItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof FlameItem) {\n flame = true;\n ((FlameItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof BombItem) {\n max_bomb ++;\n ((BombItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof Portal) {\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n }", "public void hasHeartPower(){\n shipVal.setHealth(shipVal.getHealth()+1);\n updateHearts(new ImageView(cacheHeart));\n score_val += 1000;\n }", "protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }", "static int bukkitToneAmount() { return 25; }", "public static void checkQueue(){\n if(Duel.getLobby().getQueue().size() >= 2){\n Duel.getGameManager().startingAGame();\n// for(Player player : Bukkit.getOnlinePlayers()){\n// if(Lobby.getQueue().get(0).equals(player.getUniqueId()) || Lobby.getQueue().get(1).equals(player.getUniqueId())){\n// Duel.getGameManager().startingAGame();\n// }\n// for(UUID uuid : Lobby.getQueue()){\n// Duel.getGameManager().startingAGame();\n// }\n }\n }", "private boolean allowsSmsMessage()\n {\n for(ChatTransport tr : transportMenuItems.keySet())\n {\n if(tr.allowsSmsMessage())\n return true;\n }\n\n return false;\n }", "public static void sendNormalMOTD(Player target) {\n boolean somethingSent = false;\n\n //Send motd title\n if (motd.has(\"title\")) {\n target.sendMessage(ChatColor.translateAlternateColorCodes('&', motd.getString(\"title\")));\n somethingSent = true;\n }\n\n //Send priority messages\n if (motd.has(\"priority\")) {\n String[] priority = new String[motd.getJSONArray(\"priority\").length()];\n for (int i = 0; i < priority.length; i++) {\n priority[i] = ChatColor.GOLD + \" > \" + ChatColor.translateAlternateColorCodes('&', motd.getJSONArray(\"priority\").getString(i));\n }\n target.sendMessage(priority);\n somethingSent = true;\n }\n\n //send a few random daily's\n if (motd.has(\"normal\") && !motd.getJSONArray(\"normal\").isEmpty()) {\n Random r = new Random();\n int totalNormalMessages;\n\n if (motdNormalCount > motd.getJSONArray(\"normal\").length()) {\n totalNormalMessages = motd.getJSONArray(\"normal\").length();\n } else {\n totalNormalMessages = motdNormalCount;\n }\n\n String[] normalMessages = new String[totalNormalMessages];\n JSONArray used = new JSONArray();\n int itemNum = r.nextInt(motd.getJSONArray(\"normal\").length());\n normalMessages[0] = ChatColor.GREEN + \" > \" + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', motd.getJSONArray(\"normal\").getString(itemNum));\n used.put(itemNum);\n\n for (int i = 1; i < totalNormalMessages; i++) {\n while (used.toList().contains(itemNum)) {\n itemNum = r.nextInt(motd.getJSONArray(\"normal\").length());\n }\n normalMessages[i] = ChatColor.GREEN + \" > \" + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', motd.getJSONArray(\"normal\").getString(itemNum));\n }\n\n target.sendMessage(normalMessages);\n somethingSent = true;\n }\n\n }", "private void sendMessagetoRespectivePlayer(int num) {\n Message msg1;\n if(flag == \"player1\"){\n prevP1 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p1Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p1Handler.obtainMessage(4);\n }\n else{\n msg1 = p1Handler.obtainMessage(5);\n }\n p1Handler.sendMessage(msg1);\n }\n else{\n prevP2 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p2Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p2Handler.obtainMessage(4);\n }\n else{\n msg1 = p2Handler.obtainMessage(5);\n }\n p2Handler.sendMessage(msg1);\n }\n }", "@Override\r\n\tpublic String[] getNPCMessages() {\n\t\treturn null;\r\n\t}", "public void beforeSendingeGainChatRequest();", "private boolean noMessage() {\n\t\treturn nbmsg==0;\n\t}", "@Test\n void checkAmmoResources() {\n ArrayList<Player> array = new ArrayList<>();\n AlphaGame game = new AlphaGame(1, array, false, 5);\n RealPlayer rp = new RealPlayer('b', \"rp\");\n rp.setPlayerPosition(Board.getSpawnpoint('b'));\n array.add(rp);\n char[] cost = new char[3];\n cost[0] = 'b';\n cost[1] = 'r';\n\n assertTrue(rp.checkAmmoResources(cost));\n\n cost[0] = 'b';\n cost[1] = 'b';\n\n assertFalse(rp.checkAmmoResources(cost));\n }", "public static void sendRequirementMessages(Player player) {\n\t\tfor (int i = 1; i < 310; i++)\n\t\t\tinter(player, i, \"\");\n\t\tplayer.getInterfaceManager().sendInterface(275);\n\t\tinter(player, 1, \"<col=FF0000><shad=000000>Distinction cape requirements</col>\");\n\n\t\tinter(player, 10, \"<col=046DB3><shad=000000><u>Max cape requirements</u></col>\");\n\t\tinter(player, 11, (isWorthyMaxCape(player) ? \"<str>\" : \"\")+\"Every stat level 99\");\n\t\tinter(player, 12, (isWorthyMaxCape(player) ? \"<col=1BD12A><shad=000000>You are worthy enough to claim this cape!</col>\"\n\t\t\t\t\t\t: \"<col=ff0000><shad=000000>You are not worthy enough to claim this cape!\"));\n\n\t\tinter(player, 14, \"<col=046DB3><shad=000000><u>Completionist cape requirements</u></col>\");\n\t\tinter(player, 15, ((isMaxed(player) && player.getSkills().getLevelForXp(Skills.DUNGEONEERING) == 120) ? \"<str>\" : \"\")+\"Every stat level 99 & 120 Dungeoneering\");\n\t\tinter(player, 16, (player.isKilledQueenBlackDragon() ? \"<str>\" : \"\")+\"Killed the Queen Black Dragon\");\n\t\tinter(player, 17, (player.isCompletedFightCaves() ? \"<str>\" : \"\")+\"Completed the Fight Caves minigame\");\n\t\tinter(player, 18, (player.isCompletedFightKiln() ? \"<str>\" : \"\")+\"Completed the Fight Kiln minigame\");\n\t\tinter(player, 19, (player.isKilledCulinaromancer() ? \"<str>\" : \"\")+\"Completed the Recipe for Disaster minigame\");\n\t\tinter(player, 20, (player.getQuestManager().completedQuest(Quests.NOMADS_REQUIEM) ? \"<str>\" : \"\")+\"Completed the Nomad's mini-quest\");\n\t\tinter(player, 21, (isWorthyCompCape(player) ? \"<col=1BD12A><shad=000000>You are worthy enough to claim this cape!</col>\"\n\t\t\t\t\t\t: \"<col=ff0000><shad=000000>You are not worthy enough to claim this cape!\"));\n\n\t\tinter(player, 23, \"<col=046DB3><shad=000000><u>Completionist cape (t) requirements</u></col>\");\n\t\tinter(player, 24, ((isWorthyCompCape(player)) ? \"<str>\" : \"\")+\"Have completed all of the above\");\n\t\tinter(player, 25, ((player.getOresMined() >= 5000) ? \"<str>\" : \"\")+\"Mine a total of 5'000 ores (\"+Utils.getFormattedNumber(player.getOresMined())+\")\");\n\t\tinter(player, 26, ((player.getBarsSmelt() >= 5000) ? \"<str>\" : \"\")+\"Smith a total of 5'000 bars (\"+Utils.getFormattedNumber(player.getBarsSmelt())+\")\");\n\t\tinter(player, 27, ((player.getLogsChopped() >= 5000) ? \"<str>\" : \"\")+\"Chop a total of 5'000 logs (\"+Utils.getFormattedNumber(player.getLogsChopped())+\")\");\n\t\tinter(player, 28, ((player.getLogsBurned() >= 5000) ? \"<str>\" : \"\")+\"Burn a total of 5'000 logs (\"+Utils.getFormattedNumber(player.getLogsBurned())+\")\");\n\t\tinter(player, 29, ((player.getLapsRan() >= 1000) ? \"<str>\" : \"\")+\"Complete a total of 1'000 agility laps (\"+Utils.getFormattedNumber(player.getLapsRan())+\")\");\n\t\tinter(player, 30, ((player.getBonesOffered() >= 5000) ? \"<str>\" : \"\")+\"Offer a total of 5'000 bones (\"+Utils.getFormattedNumber(player.getBonesOffered())+\")\");\n\t\tinter(player, 31, ((player.getPotionsMade() >= 5000) ? \"<str>\" : \"\")+\"Make a total of 5'000 potions (\"+Utils.getFormattedNumber(player.getPotionsMade())+\")\");\n\t\tinter(player, 32, ((player.getTimesStolen() >= 5000) ? \"<str>\" : \"\")+\"Steal a total of 5'000 times (\"+Utils.getFormattedNumber(player.getTimesStolen())+\")\");\n\t\tinter(player, 33, ((player.getItemsMade() >= 5000) ? \"<str>\" : \"\")+\"Craft a total of 5'000 items (\"+Utils.getFormattedNumber(player.getItemsMade())+\")\");\n\t\tinter(player, 34, ((player.getItemsFletched() >= 5000) ? \"<str>\" : \"\")+\"Fletch a total of 5'000 items (\"+Utils.getFormattedNumber(player.getItemsFletched())+\")\");\n\t\tinter(player, 35, ((player.getCreaturesCaught() >= 3000) ? \"<str>\" : \"\")+\"Catch a total of 3'000 creatures (\"+Utils.getFormattedNumber(player.getCreaturesCaught())+\")\");\n\t\tinter(player, 36, ((player.getFishCaught() >= 5000) ? \"<str>\" : \"\")+\"Catch a total of 5'000 fish (\"+Utils.getFormattedNumber(player.getFishCaught())+\")\");\n\t\tinter(player, 37, ((player.getFoodCooked() >= 5000) ? \"<str>\" : \"\")+\"Cook a total of 5'000 food (\"+Utils.getFormattedNumber(player.getFoodCooked())+\")\");\n\t\tinter(player, 38, ((player.getProduceGathered() >= 3000) ? \"<str>\" : \"\")+\"Farm a total of 3'000 produce (\"+Utils.getFormattedNumber(player.getProduceGathered())+\")\");\n\t\tinter(player, 39, ((player.getPouchesMade() >= 2500) ? \"<str>\" : \"\")+\"Infuse a total of 2'500 pouches (\"+Utils.getFormattedNumber(player.getPouchesMade())+\")\");\n\t\tinter(player, 40, ((player.getMemoriesCollected() >= 5000) ? \"<str>\" : \"\")+\"Harvest a total of 5'000 memories (\"+Utils.getFormattedNumber(player.getMemoriesCollected())+\")\");\n\t\tinter(player, 41, ((player.getRunesMade() >= 5000) ? \"<str>\" : \"\")+\"Runecraft a total of 5'000 runes (\"+Utils.getFormattedNumber(player.getRunesMade())+\")\");\n\t\tinter(player, 42, ((isWorthyCompCapeT(player)) ? \"<col=1BD12A><shad=000000>You are worthy enough to claim this cape!</col>\"\n\t\t\t\t\t\t: \"<col=ff0000><shad=000000>You are not worthy enough to claim this cape!\"));\n\t}", "public void playHoomans() {\r\n System.out.println(\"Thanks for killing each other, human!\");\r\n }", "@Override\n public void applyEffect(Battle battle, Cell cell, Account player, int activeTime) {\n /* if (activeTime != -1)\n return;\n ManaItemBuff manaItemBuff = new ManaItemBuff(player, 1);\n manaItemBuff.setTurnCounter(-5);\n manaItemBuff.castBuff();\n player.getOwnBuffs().add(manaItemBuff);*/\n }", "public void handleEvent(PlayerPosition event)\r\n {\r\n if(m_active)\r\n {\r\n String name = m_botAction.getPlayerName(event.getPlayerID());\r\n\r\n if(event.isInSafe())\r\n {\r\n int ship = m_botAction.getPlayer(event.getPlayerID()).getShipType();\r\n int freq = m_botAction.getPlayer(event.getPlayerID()).getFrequency();\r\n boolean delayExceeded = true;\r\n\r\n if(delaySeconds > 0)\r\n {\r\n long currentTime = System.currentTimeMillis();\r\n\r\n if(m_entryTimes.containsKey(name))\r\n {\r\n long entryTime = m_entryTimes.get(name);\r\n int delta = (int)(currentTime - entryTime);\r\n\r\n if(!enableMS) {\r\n // Do the delay in seconds.\r\n delta /= Tools.TimeInMillis.SECOND;\r\n }\r\n\r\n if(delta < delaySeconds)\r\n {\r\n delayExceeded = false;\r\n }\r\n else\r\n {\r\n m_entryTimes.remove(name);\r\n }\r\n }\r\n else\r\n {\r\n m_entryTimes.put(name, currentTime);\r\n delayExceeded = false;\r\n }\r\n }\r\n\r\n if(delayExceeded)\r\n {\r\n if(specPlayer)\r\n {\r\n m_botAction.spec(event.getPlayerID());\r\n m_botAction.spec(event.getPlayerID());\r\n\r\n if(!speccedMsg.equalsIgnoreCase(\"none\")) {\r\n if(speccedSound != 0)\r\n m_botAction.sendArenaMessage(name + \" \" + speccedMsg, speccedSound);\r\n else\r\n m_botAction.sendArenaMessage(name + \" \" + speccedMsg);\r\n }\r\n }\r\n\r\n if(changeShip && ship != targetShip)\r\n {\r\n m_botAction.setShip(event.getPlayerID(), targetShip);\r\n\r\n if(!shipChgMsg.equalsIgnoreCase(\"none\")) {\r\n if(shipSound != 0)\r\n m_botAction.sendArenaMessage(name + \" \" + shipChgMsg, shipSound);\r\n else\r\n m_botAction.sendArenaMessage(name + \" \" + shipChgMsg);\r\n }\r\n\r\n }\r\n\r\n if(changeFreq && freq != targetFreq)\r\n {\r\n m_botAction.setFreq(event.getPlayerID(), targetFreq);\r\n\r\n if(!freqChgMsg.equalsIgnoreCase(\"none\")) {\r\n if(freqSound != 0)\r\n m_botAction.sendArenaMessage(name + \" \" + freqChgMsg, freqSound);\r\n else\r\n m_botAction.sendArenaMessage(name + \" \" + freqChgMsg);\r\n }\r\n }\r\n }\r\n }\r\n else if(delaySeconds > 0)\r\n {\r\n m_entryTimes.remove(name);\r\n }\r\n }\r\n }", "public void run() \n\t\t\t{\n\t\t\t\tif (Math.abs(player.getLocation().getX() - playerLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getY() - playerLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getZ() - playerLoc.getZ()) > 1)\n\t\t\t\t{\n\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot move while bandaging!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString name = player.getCustomName();\n\t\t\t\tif (name == null)\n\t\t\t\t\tname = player.getName();\n\t\t\t\t\n\t\t\t\t//Check that the recipient is still in roughly the same location\n\t\t\t\t//Skip if self-heal\n\t\t\t\tif (!player.equals(recipient))\n\t\t\t\t\tif (Math.abs(recipient.getLocation().getX() - recipientLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getY() - recipientLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getZ() - recipientLoc.getZ()) > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot bandage your patient while they are moving!\");\n\t\t\t\t\t\trecipient.sendMessage(ChatColor.YELLOW + name + \" cannot bandage you while you are moving!\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Remove item from player's inventory.\n\t \t\tplayer.getInventory().removeItem(new ItemStack(Material.getMaterial(item.toUpperCase()), 1));\n\t \t\tplayer.updateInventory();\n\t \t\t\t\n\t \t\t//Heal the other player.\n\t \t\trecipient.setHealth(recipient.getHealth() + amountToHeal);\n\n\t \t\t//Award experience.\n\t \t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n\t \t\t\n\t \t\tif (!prof.isPracticeFatigued(profession))\n\t \t\t\taddExperience(player, profession, config.getInt(\"healing.\" + item + \".exp\"));\n\t \t\t\t\n\t \t\t//Notify both parties.\n\t \t\tif (!player.equals(recipient))\n\t \t\t{\t \t\t\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged \" + recipient.getName() + \"'s wounds.\");\n\t \t\t\trecipient.sendMessage(ChatColor.YELLOW + player.getName() + \" bandaged your wounds.\");\n\t \t\t}\n\t \t\telse\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged your wounds.\");\n\t\t\t }", "public OctopusCollectedMsg() {\n super(DEFAULT_MESSAGE_SIZE);\n amTypeSet(AM_TYPE);\n }", "static boolean getMauled(){\n\t\t\tif (Person.player.inventory.contains(Item.repellent)) //if you have the goose repellent...\n\t\t\t\treturn (MainFile.getRandomNumber(240) == 12); //drastically lowers your chance of being mauled.\n\t\t\treturn (MainFile.getRandomNumber(20) == 12);//generates a random number for if you don't have it, and if it's 12 you get mauled\n\t\t}", "public boolean checkIfPlayerHoldsExplosive () { return noOfExplosives > 0; }", "private static boolean musicCommands(CommandContext context, Guild guild, Command invoked, TextChannel channel, Member invoker) {\n if ((invoked instanceof IMusicCommand || invoked instanceof AkinatorCommand) // the hate is real\n && guild.getId().equals(BotConstants.FREDBOAT_HANGOUT_ID)\n && guild.getJDA().getSelfUser().getId().equals(BotConstants.MUSIC_BOT_ID)) {\n if (!channel.getId().equals(\"174821093633294338\") // #spam_and_music\n && !channel.getId().equals(\"217526705298866177\") // #staff\n && !invoker.getUser().getId().equals(\"203330266461110272\")//Cynth\n && !invoker.getUser().getId().equals(\"81011298891993088\")) { // Fre_d\n context.deleteMessage();\n context.replyWithName(\"Please don't spam music commands outside of <#174821093633294338>.\",\n msg -> CentralMessaging.restService.schedule(() -> CentralMessaging.deleteMessage(msg),\n 5, TimeUnit.SECONDS));\n return true;\n }\n }\n return false;\n }", "private void sendCustomMessage(String message, String alli) {\n String frontA = \"V\" + alli;\n String gobbleDeGuck = \"<ID 0><CLR><WIN 0 0 287 31><POS 0 0><SL><S S><BL N><CS 3><GRN><T>\";\n String mid = message;\n String ender = \"</T>\";\n String sendableMsgString = frontA + gobbleDeGuck + mid + ender;\n //\n sendRawMessage(sendableMsgString);\n }", "@Override\n\tprotected String getHurtSound() {\n\t\treturn \"mob.creeper.say\";\n\t}", "public void handleBuyEggCommand(){\n if(Aquarium.money >= EGGPRICE) {\n Aquarium.money -= EGGPRICE;\n Aquarium.egg++;\n }\n }", "private boolean isFull() {\n\t\treturn nbmsg==getSize();\n\t}", "@Override\r\n\tprotected boolean canDropLoot() {\r\n\t\treturn false;\r\n\t}", "private void subtractPlayerMissile() {\n this.playerMissile -= 1;\n }", "@Override\n \tpublic boolean interactFirst(EntityPlayer player) //interact : change back when Forge updates\n \t{\n \t\tif (gunner != null && (gunner instanceof EntityPlayer) && gunner != player)\n \t\t{\n \t\t\treturn true;\n \t\t}\n \t\tif (!worldObj.isRemote)\n \t\t{\n \t\t\tif (gunner == player)\n \t\t\t{\n \t\t\t\tmountGun(player, false);\n \t\t\t\tPacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 100, dimension, PacketMGMount.buildMGPacket(player, this, false));\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\tif (FlansModPlayerHandler.getPlayerData(player).mountingGun != null && !FlansModPlayerHandler.getPlayerData(player).mountingGun.isDead)\n \t\t\t{\n \t\t\t\treturn true;\n \t\t\t}\n \n \t\t\tmountGun(player, true);\n \t\t\tPacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 100, dimension, PacketMGMount.buildMGPacket(player, this, true));\n \t\t\tif (ammo == null)\n \t\t\t{\n \t\t\t\tint slot = findAmmo(player);\n \t\t\t\tif (slot >= 0)\n \t\t\t\t{\n \t\t\t\t\tammo = player.inventory.getStackInSlot(slot);\n \t\t\t\t\tplayer.inventory.setInventorySlotContents(slot, null);\n \t\t\t\t\treloadTimer = type.reloadTime;\n \t\t\t\t\tworldObj.playSoundAtEntity(this, type.reloadSound, 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 0.8F));\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t}\n \t\treturn true;\n \t}", "@Override\r\n\tpublic void action() {\n\t\tMessageTemplate mt=MessageTemplate.or(MessageTemplate.MatchContent(\"comida\"), MessageTemplate.MatchContent(\"bebida\"));\r\n ACLMessage msg = myAgent.receive(mt);\r\n if(msg!=null){\r\n \tif(msg.getContent().compareTo(\"comida\")==0){\r\n \t\tif(Comida>=5){\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"Si\");\r\n System.out.println(myAgent.getLocalName()+\":Si, gracias tengo hambre todavia\"); \r\n myAgent.send(reply);\r\n Comida=Comida-5;\r\n \t\t}\r\n \t\telse{\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"No\");\r\n System.out.println(myAgent.getLocalName()+\":No gracias\"); \r\n myAgent.send(reply);\r\n \t\t} \r\n \t}\r\n \telse if(msg.getContent().compareTo(\"bebida\")==0){\r\n \t\tif(Bebida>=5){\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"Si\");\r\n System.out.println(myAgent.getLocalName()+\":Si, gracias tengo sed todavia\"); \r\n myAgent.send(reply);\r\n Bebida=Bebida-5;\r\n \t\t}\r\n \t\telse{\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"No\");\r\n System.out.println(myAgent.getLocalName()+\":No gracias\"); \r\n myAgent.send(reply);\r\n \t\t} \r\n \t}\r\n }\r\n if (Comida==0 && Bebida==0){\r\n \tmyAgent.doDelete();\r\n }\r\n\t}", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "private boolean checkDadBot(MessageReceivedEvent event) {\n String message = event.getMessage().getContentDisplay();\n\n // Ignore messages that are too short or long to be funny\n if (message.length() < 5 || message.length() > 40)\n return false;\n\n String name = null;\n\n if (message.toLowerCase(Locale.ROOT).startsWith(\"i'm \"))\n name = message.substring(4);\n else if (message.toLowerCase(Locale.ROOT).startsWith(\"im \"))\n name = message.substring(3);\n\n if (name != null && Math.random() < Setting.DAD_BOT_CHANCE) {\n event.getMessage().reply(\"Hi \" + name + \", I'm StatsBot!\").queue();\n return true;\n }\n\n return false;\n }", "private void busquets() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -25;\n\t\tint yInit = -10;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit *selfPerception.getSide().value());\n\t\t\n\t\twhile (commander.isActive()) {\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\tstate = State.ATTACKING;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\t//if(closer)\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public boolean canReceiveItem(Player character) {\n boolean canPick = true;\n Item item = character.items.get(character.getItemOwned2().getName());\n double totalWeight = items.getTotalWeight() + item.getWeight();\n if(totalWeight > maxWeight) {\n canPick = false;\n }\n return canPick; \n }", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public void updateAmmunition() {\n amountOfAmmoText.setText(\"Ammunition: \" + game.getPlayerComponent().getActiveWeapon().getMagazineCounter());\n }", "@Override\n\tprotected boolean isRegisterGameMessage()\n\t{\n\t\treturn false;\n\t}", "@Test\r\n\tpublic void testDamageInAmpedRange() throws TooManyAttachmentsException \r\n\t{\r\n\t\tWeapon w = new Pistol();\r\n\t\tassertEquals(0, w.getDamage(26));\r\n\t\tw = new Scope(w);\r\n\t\tassertEquals(7, w.getDamage(26));\r\n\t}", "boolean hasSendPlayerName();", "@Override\r\n public void onHit(int damage){\n if(box2body != null){\r\n hp -= damage;\r\n screen.getGameManager().get(\"Sounds/orc-34-hit.wav\", Sound.class).play();\r\n if(this.hp <= 0) {\r\n screen.bodiesToDelete.add(box2body);\r\n deleteFlag = true;\r\n screen.spawnedCreatures.remove(this);\r\n screen.getGameManager().get(\"Sounds/orc-32-death.wav\", Sound.class).play();\r\n\r\n //Award Experience\r\n screen.getPlayer().awardExperience(this.experienceValue);\r\n screen.getPlayer().increaseKillCount();\r\n }\r\n }\r\n //Attack player when damaged\r\n //Prevents player from sniping monsters using Wander AI\r\n if(currentState != State.ATTACKING){\r\n Vector2 orcPosition = new Vector2(box2body.getPosition().x, box2body.getPosition().y);\r\n Vector2 playerPosition = new Vector2(screen.getPlayer().box2body.getPosition().x, screen.getPlayer().box2body.getPosition().y);\r\n\r\n currentState = State.HASBEENATTACKED;\r\n velocity = new Vector2(playerPosition.x - orcPosition.x, playerPosition.y - orcPosition.y);\r\n box2body.setLinearVelocity(velocity.scl(speed));\r\n }\r\n }", "public abstract void audioMessage(Message m);", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "static private void TalkTo() {\n if (BSChristiansen.getCurrentRoom() == currentRoom) {\n System.out.println(BSChristiansen.getDescription() + \", yet he still gives you good advice:\\n\");\n System.out.println(BSChristiansen.getDialog(0));\n System.out.println(\"\");\n woundedSurvivor();\n } else if (mysteriousCrab.getCurrentRoom() == currentRoom && inventory.getInventory().containsKey(\"Shroom\")) {\n System.out.println(mysteriousCrab.getDescription() + \"\\n\" + mysteriousCrab.getDialog(0));\n } else {\n System.out.println(\"There is nobody to communicate with in this Room\");\n }\n\n }", "@Override\n public String getMessage(int player) {\n if (player == 0) {\n return \"Player\";\n }\n return \"CPU\";\n }", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public int shoot()\n {\n if(availableAmmo > 0)\n {\n System.out.println(\"Pew Pew\");\n availableAmmo--; \n damageCaused = randomDamageGenerator.nextInt(450);\n return damageCaused;\n }\n else return -1;\n }", "@Override\n public void onTextMessage(ReceivedTextMessage message) {\n //ignore the message\n }", "public void NPSShot()\n\t{\n\t\t//can only occur if a friendly missile and \n\t\t//a NPS are spawned\n\t\tif(gameObj[2].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint nps = new Random().nextInt(gameObj[2].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[2].remove(nps);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 500;\n\t\t\tSystem.out.println(\"A player misile has struck a NPS! +500 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An NPS and a friendly missile are not spawned\");\n\t}", "public void powerOn() { //power_on\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.ON));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.ON) {\n isTurningOn = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }", "boolean hasUnReceived();", "protected final boolean anyMsg() {\n\t\tDoorPulseCriterion dpc = new DoorPulseCriterion(this.getPulse() - 1);\n\t\treturn this.existMessage(dpc);\n\t}", "public void asteroidShot()\n\t{\n\t\t//collision can only occur if at least 1 asteroid\n\t\t//and one missile are currently spawned\n\t\tif(gameObj[0].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 100;\n\t\t\tSystem.out.println(\"A friendly missile has struck an asteroid! +100 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An asteroid and a friendly missile are not spawned\");\n\t}", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "public boolean hasDamage() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "public void addAmmo(Color ammo) {\n this.ammo.add(ammo);\n }", "public void checkBombs(final Integer tile){\n if(bombs_location.contains(tile)){\n if(invulnerable){\n showTimedAlertDialog(\"PHEW!\", \"Your GODMODE saved your life\", 5);\n invulnerable = false;\n return;\n }\n invulnerable = false;\n Lejos.makeSound_Boom();\n hp = hp-1;\n DrawHP();\n bombs_location.remove(tile);\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n MultiplayerManager.getInstance().SendMessage(\"bomb_remove \" + revertTile(tile).toString());\n }\n }, 1000);\n if(hp==0){\n onLose();\n }\n showTimedAlertDialog(\"PWNED!\", \"You just stepped on a mine\", 3);\n }\n }" ]
[ "0.5987843", "0.5699547", "0.56804955", "0.56626004", "0.56508195", "0.56400853", "0.56210107", "0.56071717", "0.5584513", "0.5583543", "0.5583465", "0.5569838", "0.55419", "0.5522955", "0.5503981", "0.54847443", "0.54714245", "0.5470685", "0.5451312", "0.54258525", "0.54187065", "0.54027474", "0.53948873", "0.53927994", "0.53842294", "0.5359953", "0.5354551", "0.53536505", "0.5353164", "0.5334014", "0.53293115", "0.53107744", "0.5310212", "0.5306519", "0.53013706", "0.52732325", "0.5269654", "0.5251566", "0.523619", "0.5229985", "0.5229894", "0.5225843", "0.5220079", "0.52166855", "0.5215845", "0.52117693", "0.5209364", "0.5206029", "0.5200687", "0.5197365", "0.51921237", "0.519143", "0.51863354", "0.51746154", "0.5170146", "0.51697177", "0.5148429", "0.5144952", "0.514174", "0.5137923", "0.5127604", "0.5126701", "0.5125946", "0.51246405", "0.51234597", "0.51184", "0.5115164", "0.5113532", "0.51093864", "0.51061505", "0.5104571", "0.51029146", "0.5101881", "0.51018", "0.5100965", "0.5096", "0.5091385", "0.50895125", "0.508782", "0.50836504", "0.5077253", "0.50767034", "0.50764936", "0.50759107", "0.50759107", "0.50758594", "0.5073018", "0.50712806", "0.5070783", "0.5066504", "0.5066042", "0.5064061", "0.50609326", "0.5057475", "0.50566316", "0.5054858", "0.5052217", "0.5051033", "0.5051033", "0.5051011", "0.50495005" ]
0.0
-1
returns the base printname for cloning purposes
public String GetBaseCritName() { return CritName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic String getPrintName() {\n\t\treturn null;\r\n\t}", "public String getBaseName() {\n return baseName;\n }", "public String getPrinterName() {\n return \"Printer Name is: \" + name;\n }", "public String getPrintTitle();", "private String printName() {\n \t\treturn GPSFilterTextUtils.printName( this.getResources(), this.area.getName() );\n \t}", "@Override\n\tprotected void print() {\n\t\tSystem.out.println(\"-----------\"+this.getName()+\"\");\n\t}", "public String getStd_Base();", "@Internal(\"Represented as part of archiveName\")\n public String getBaseName() {\n return baseName;\n }", "@Override\r\n\tpublic String getPrintLabel() {\n\t\treturn null;\r\n\t}", "public String defaultname()\n {\n String newname = \"Stamp\"+Integer.toString(id);\n return newname;\n }", "public String getBase()\n {\n return base;\n }", "@Override\n public String getBase() {\n return base;\n }", "@Override\r\n public String getBaseName() {\r\n if (baseName == null) {\r\n final int idx = getPath().lastIndexOf(SEPARATOR_CHAR);\r\n if (idx == -1) {\r\n baseName = getPath();\r\n } else {\r\n baseName = getPath().substring(idx + 1);\r\n }\r\n }\r\n\r\n return baseName;\r\n }", "String getPname();", "@Override\n public String toString() {\n return internalName;\n }", "String getPName();", "public String getCurrentPrintJob()\n {\n return printerSimulator.getCurrentPrintJob();\n }", "@Override\n public String toString() {\n if (\"WB\".equals(name))\n {\n return name;\n }\n return super.toString();\n }", "public String getName(){\n \treturn this.name().replace(\"_\", \" \");\n }", "public String getPrint_optr(){\r\n\t\treturn this.print_optr ;\r\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \": \" + super.toString();\r\n\t}", "public String toString(){\n\t\tString abbrv = this.name().substring(0,1);\t\t\n\t\treturn abbrv;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s\", getName());\n\t}", "public static void printName() {\n\t\t\n\t\tSystem.out.println(staName); \t// static only accepts static\n\t}", "@ Override\n public final String toString() {\n return getName ( ) ;\n }", "public String toString() {\n \n TmpStringBuffer = new StringBuffer(1000);\n TmpStringBuffer.append(this.getClass().getName());\n \n return TmpStringBuffer.toString();\n \n }", "public String toString() {\n \n TmpStringBuffer = new StringBuffer(1000);\n TmpStringBuffer.append(this.getClass().getName());\n \n return TmpStringBuffer.toString();\n \n }", "public String toString() {\n \n TmpStringBuffer = new StringBuffer(1000);\n TmpStringBuffer.append(this.getClass().getName());\n \n return TmpStringBuffer.toString();\n \n }", "public String toString() {\n \n TmpStringBuffer = new StringBuffer(1000);\n TmpStringBuffer.append(this.getClass().getName());\n \n return TmpStringBuffer.toString();\n \n }", "String getObjectName();", "public synchronized String print() {\r\n return super.print();\r\n }", "public String toString() {\n\n\t\treturn Utilities.cutHeadAtLast(this.getClass().getName(), '.');\n\t}", "protected String getPatchName(Patch p) {\n if (patchNameSize == 0)\n return (\"-\");\n try {\n return new String(p.sysex, patchNameStart, patchNameSize, \"US-ASCII\");\n } catch (UnsupportedEncodingException ex) {\n return \"-\";\n }\n }", "public String toString() { \n\n TmpStringBuffer = new StringBuffer(1000);\n TmpStringBuffer.append(this.getClass().getName());\n \n return TmpStringBuffer.toString();\n \n }", "public String getFullName() {\n return proteinIdentifier.getFullName() + \"_\" + chainId;\n }", "public java.lang.String getPrimaryPrintIndicator(){\n return localPrimaryPrintIndicator;\n }", "protected static String getFilename(String base) {\n //return Integer.toHexString(base.hashCode()) + \".map\";\n return base + \".map\";\n }", "public void printString() {\n\t\tSystem.out.println(name);\n\t\t\n\t\t\n\t}", "protected String tmpname() {\n\t\tsynchronized ( OsLib.class ) {\n\t\t\treturn TMP_PREFIX+(tmpnames++)+TMP_SUFFIX;\n\t\t}\n\t}", "public String getName()\r\n \t{\n \t\treturn (explicit ? (module.length() > 0 ? module + \"`\" : \"\") : \"\")\r\n \t\t\t\t+ name + (old ? \"~\" : \"\"); // NB. No qualifier\r\n \t}", "public String toString() {\r\n if (typeSystemNode!=null) {\t// kann null sein z.B. bei PIDLs\r\n return typeSystemNode.getAbsoluteName() + \" \" + name;\r\n }\r\n else {\r\n return name;\r\n }\r\n }", "public void printAnnuaireName() {\n\t\t\n\t}", "@Override\n public String getName() {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"9f48d6b7-640e-4370-9625-0cdc9bbeef0b\");\n return name == null ? super.getName() : name;\n }", "BaseComponent getComponentName();", "public String getStartName() {// TODO remove\n\t\treturn this.getClass().getSimpleName();\n\t}", "public String binaryName() {\n return fullName();\n }", "@Override\n public String getDeriverName() {\n Object ref = deriverName_;\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 deriverName_ = s;\n return s;\n }\n }", "@Override\n\tpublic String toString() {\n\t\treturn name + \"_\" + num;\n\t}", "public abstract String getRawName();", "@Override//overring a library function\n public String toString() {\n return shape + \" \" + name;//toString() is called everytime printing is done\n }", "public String toString()\r\n/* 67: */ {\r\n/* 68:253 */ return getClass().getName();\r\n/* 69: */ }", "public String toString() {\n String stringName = \"\";\n stringName = getName();\n return stringName;\n }", "public String toString() {\n return (isRelative() ? \"\" : \"(not relative)\") + getName() + \": \" +\n getClassName();\n }", "public String toString() {return name;}", "default public String strandInfo() {\n\t\treturn this.getClass().getName();\n\t}", "String getBaseQueueName();", "@Override\n\tpublic String toString() {\n\t\treturn NAME;\n\t}", "public String getDefaultFileName() {\n return \"output\" + mProcCount + extension;\n }", "java.lang.String getInstanceName();", "public String getName() {\n\treturn (super.getName() + \".\" + stream.getName());\n }", "public void dump(String prefix) {\n System.out.print(toString(prefix));\n System.out.println(\" \"+name);\n }", "public String toString()\n{\n StringBuffer sb = new StringBuffer(getClass().getSimpleName()).append(' ');\n if(getName()!=null) sb.append(getName()).append(' ');\n sb.append(getFrame().toString());\n return sb.toString();\n}", "public String getNiceName()\n {\n String name = getBuildFile().getName();\n\n return Utility.replaceBadChars(name);\n }", "public String toString()\r\n\t{\r\n\t\treturn getName();\r\n\t}", "public java.lang.String getCurrentName() {\n java.lang.Object ref = currentName_;\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 currentName_ = s;\n return s;\n }\n }", "public java.lang.String toString(){\n\t\treturn name;\n\t}", "public String newHumanName() {\n return String.format(\"%s %s\", newName(4, 6), newName(4, 8));\n }", "public String toString() {\n\t\treturn getName();\r\n\t}", "String process_name () throws BaseException;", "public String print() {\n return print(new StringBuffer()).toString();\n }", "String getOutputName();", "public String getBaseImageName() {\n return this.getPokemonInfo().getBaseImageName();\n }", "@Override\n public com.google.protobuf.ByteString\n getDeriverNameBytes() {\n Object ref = deriverName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n deriverName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@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 }", "public static String powName(double base) {\n\t\tif (base == Math.E)\n\t\t\treturn \"exp\";\n\t\telse\n\t\t\treturn \"\" + MathUtil.format(base) + \"^\";\n\t}", "public String getInternalName();", "public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}", "public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}", "protected String getFullPatchName(Patch p) {\n return getManufacturerName() + \" | \" + getModelName() + \" | \"\n + p.getType() + \" | \" + getSynthName() + \" | \" + getPatchName(p);\n }", "@DISPID(73)\r\n\t// = 0x49. The runtime will prefer the VTID if present\r\n\t@VTID(71)\r\n\tjava.lang.String name();", "private String toBaseString(final Object o) {\n return o.getClass().getName() + \"@\" + Integer.toHexString(System.identityHashCode(o));\n }", "public String toString() {\n return name();\n }", "@Override public String toString() {\r\n\t\tif(getID()<0) return new String(String.format(\"%s\", getName()));\r\n\t\treturn new String(String.format(\"%02d - %s\", getID() , getName()));\r\n\t}", "public static void printInfoAboutCloneName() {\n System.err.println(\n \"The name of the clone should start with vb- for VirtualBox clones, with kvm- for KVM clones, and with amazon- for Amazon clones.\");\n }", "public String toString() {\n\t\treturn getName();\n\t}", "public String toString()\n\t\t{\n\t\t\treturn name + \"\\t\" + characterName;\n\t\t}", "public String mo12985l_() {\n return getClass().getName();\n }", "private String getUniqueNodeName() {\n return String.format(\"N%d\", uniqueNode++);\n }", "private String name() {\r\n return cls.getSimpleName() + '.' + mth;\r\n }", "public java.lang.String getCurrentName() {\n java.lang.Object ref = currentName_;\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 currentName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n\tpublic String getName() {\n\t\treturn name + instanceName;\n\t}", "public static String baseTypeName(final AbstractVO vo) {\n ExternalType _baseType = DddAbstractVOExtensions.baseType(vo);\n boolean _equals = Objects.equal(_baseType, null);\n if (_equals) {\n return null;\n } else {\n ExternalType _baseType_1 = DddAbstractVOExtensions.baseType(vo);\n return _baseType_1.getName();\n }\n }", "@Override\n public String toString() {\n return getClass().getSimpleName() + \"[\" + _name + \"]\";\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn getName();\r\n\t}", "public String getDeriverName() {\n Object ref = deriverName_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n deriverName_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getBName() {\n\t\tif (getAbsoluteName)\n\t\t\treturn absoluteName;\n\t\telse\n\t\t\treturn shortName;\n\t}", "String getSymbolicName();", "public String Name() {\t\t\r\n\t\treturn BrickFinder.getDefault().getName();\r\n\t}", "@Override \n public String toString() {\n return getName() + \"(\" + getClass().getName() + \")\";\n }", "@Override\r\n public String toString() {\n return getClass().getName() + \"@\" + Integer.toHexString(super.hashCode());\r\n }", "@Override\n public String toString(){\n\n return this.getClass().getSimpleName();\n }" ]
[ "0.70857996", "0.64415544", "0.6350474", "0.62159634", "0.61344516", "0.6114211", "0.6095232", "0.6093808", "0.60662663", "0.60239315", "0.5913721", "0.5886344", "0.58720374", "0.58506906", "0.58477795", "0.5843964", "0.584113", "0.58083105", "0.57681715", "0.5757987", "0.57375985", "0.57339615", "0.57295203", "0.57261735", "0.57237506", "0.5710486", "0.5710486", "0.5710486", "0.5710486", "0.571015", "0.5705937", "0.5702575", "0.56971", "0.5691577", "0.5687129", "0.5677867", "0.56675035", "0.56644195", "0.5659605", "0.5654275", "0.5643156", "0.5631399", "0.5629335", "0.56262785", "0.562576", "0.5617709", "0.56154627", "0.5598799", "0.55973214", "0.55956787", "0.5594445", "0.5586807", "0.55674636", "0.5566167", "0.55642575", "0.5562087", "0.5560806", "0.5560159", "0.5557402", "0.5546425", "0.5543996", "0.5540205", "0.55294615", "0.55264133", "0.5523862", "0.5523067", "0.55215317", "0.5521483", "0.5519302", "0.55172026", "0.55120856", "0.55105734", "0.5502514", "0.55020577", "0.54933596", "0.549279", "0.5488017", "0.5488017", "0.5487836", "0.54843783", "0.54822063", "0.54802793", "0.54725164", "0.5471393", "0.5470245", "0.5470161", "0.54699075", "0.54665154", "0.5465286", "0.54631555", "0.5455717", "0.54545176", "0.54533005", "0.54503864", "0.5447018", "0.54443944", "0.54434425", "0.5441654", "0.5440452", "0.54365593", "0.543558" ]
0.0
-1
ammunition only ever takes up one critical slot
public int NumCrits() { return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequiresLock(\"SeaLock\")\r\n protected void invalidate_internal() {\n }", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "synchronized void endCriticalUse(){\nSC = false;\nJeton=false;\n\nif (procId==0){\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\tsendTo(0, sm);\n}else{\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\tsendTo(1, sm);\n}\n\n}", "public void unleash() {\n\t\tlocked = false;\n\t\tfloat percent = framesAccelerated/60.0f;\n\t\tif (percent > 1) percent = 2 - percent;\n\t\tif (percent < 0) percent = 0;\n\t\t\n\t\tif (player.aiControlled()) {\n\t\t\tpercent = AIcontroller.randomStartBoost();\n\t\t}\n\t\t\n\t\tspeed = MAX_SPEED * percent;\n\t}", "@RequiresLock(\"SeaLock\")\r\n protected void dependentInvalidAction() {\r\n // by default do nothing\r\n }", "public void unsetCriticalAbateValue() throws JNCException {\n delete(\"critical-abate\");\n }", "public void act()\n {\n // if (claimer ==null){\n // this.setClaim(false);\n //}\n if(claimer == null){\n setClaim(false);\n }\n if (energy>0){\n \n removeEnergy(decayRate);\n\n }\n else {\n // getWorld().removeObject(this);\n\n }\n \n //check the energy decay\n //change size and weight\n //\n }", "private void fullRepaired() { //full life\n this.active = true;\n this.damageState = DamageState.FULL;\n }", "public Object reduce_lock() {\n \t\tthis.lock.lock();\n switch(this.lockState){\n case WLT:\n \t\t while(this.lockState==State.WLT){\n \t\t\t try{\t\t \n \t\t\t\t this.available.await();\n \t\t }catch(InterruptedException i){}\n \t\t }\n this.lockState = State.RLC;\t\n \t\t\tbreak;\n \t\t\tcase RLT_WLC:\n \t\t\t this.lockState=State.RLT;\n \t\t\tbreak;\n \t\t\tcase WLC:\n \t\t\t this.lockState=State.RLC;\n \t\t\tbreak;\n \t\t\tdefault: \n logger.log(Level.SEVERE,\"reduce : Lock incoherent :\"+lockState+\".\");\n break;\n \t\t}\n //busy = true; \n logger.log(Level.INFO,\"I was <b>reduced</b> to \"+this.lockState+\".\");\n \t\tthis.lock.unlock();\n \t\treturn obj;\n \t}", "public void resetOccupied(){\n \t\toccupiedSeconds = 0;\n \t}", "public abstract void unlock();", "public abstract void unschedule();", "protected void beforeUnlockWaitingForBooleanCondition() {\n }", "private void notEligibleForRealMin() {\n eligibleForRealMin = false;\n }", "@Override\n\tpublic void unLock() {\n\t\t\n\t}", "boolean UnlockedEscapeTheIsland() {\n if (allMissions.missionStatus.get(\"Escape the island\") == true) {\n return false;\n }\n return true;\n }", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "private static int runStateOf(int c) { return c & ~CAPACITY; }", "void updateOccupancy() {\n\t\toccupied = !occupied;\n\t}", "protected void interrupted() {\n \tRobotMap.gearIntakeRoller.set(0);\n }", "public void addDeActiveness(){\n deActiveInARow +=1;\n }", "synchronized void askForCritical() {\n\nSC=true;\n\nwhile(!Jeton){\n\ttry{\nthis.wait();\n\t}catch( InterruptedException ie ){\n\t\t\n\t}\n}\n}", "public void onExemptChanged(AppStateTracker sender) {\n updateAllJobs();\n unblockAllUnrestrictedAlarms();\n }", "@Override\n\tprotected void unLockNbr() {\n\t\t\n\t}", "public void crunch(){\n cpuBurstTime--;\n rem--;\n }", "@Override\n\tprotected void onInterruption() throws SimControlException {\n\t\t\n\t}", "public void repair(){\n if(health < 9) {\n this.health++;\n }\n }", "public void playerHasInvincibility() {\n\t\tthis.state = canBeKilled;\n\t}", "public void unsetCriticalActionValue() throws JNCException {\n delete(\"critical-action\");\n }", "public void initialExecutionResourcesExhausted() {\n \n \t\t// if (this.environment.getExecutingThread() != Thread.currentThread()) {\n \t\t// throw new ConcurrentModificationException(\n \t\t// \"initialExecutionResourcesExhausted must be called from the task that executes the user code\");\n \t\t// }\n \n \t\t// Construct a resource utilization snapshot\n \t\tfinal long timestamp = System.currentTimeMillis();\n \t\t// Get CPU-Usertime in percent\n \t\tThreadMXBean threadBean = ManagementFactory.getThreadMXBean();\n \t\tlong userCPU = (threadBean.getCurrentThreadUserTime() / NANO_TO_MILLISECONDS) * 100\n \t\t\t/ (timestamp - this.startTime);\n \n \t\t// collect outputChannelUtilization\n \t\tfinal Map<ChannelID, Long> channelUtilization = new HashMap<ChannelID, Long>();\n \t\tlong totalOutputAmount = 0;\n \t\tfor (int i = 0; i < this.environment.getNumberOfOutputGates(); ++i) {\n \t\t\tfinal OutputGate<? extends Record> outputGate = this.environment.getOutputGate(i);\n \t\t\tfor (int j = 0; j < outputGate.getNumberOfOutputChannels(); ++j) {\n \t\t\t\tfinal AbstractOutputChannel<? extends Record> outputChannel = outputGate.getOutputChannel(j);\n \t\t\t\tchannelUtilization.put(outputChannel.getID(),\n \t\t\t\t\tLong.valueOf(outputChannel.getAmountOfDataTransmitted()));\n \t\t\t\ttotalOutputAmount += outputChannel.getAmountOfDataTransmitted();\n \t\t\t}\n \t\t}\n \t\tlong totalInputAmount = 0;\n \t\tfor (int i = 0; i < this.environment.getNumberOfInputGates(); ++i) {\n \t\t\tfinal InputGate<? extends Record> inputGate = this.environment.getInputGate(i);\n \t\t\tfor (int j = 0; j < inputGate.getNumberOfInputChannels(); ++j) {\n \t\t\t\tfinal AbstractInputChannel<? extends Record> inputChannel = inputGate.getInputChannel(j);\n \t\t\t\tchannelUtilization.put(inputChannel.getID(),\n \t\t\t\t\tLong.valueOf(inputChannel.getAmountOfDataTransmitted()));\n \t\t\t\ttotalInputAmount += inputChannel.getAmountOfDataTransmitted();\n \n \t\t\t}\n \t\t}\n \t\tBoolean force = null;\n \n \t\tif (this.environment.getInvokable().getClass().isAnnotationPresent(Stateful.class)\n \t\t\t&& !this.environment.getInvokable().getClass().isAnnotationPresent(Stateless.class)) {\n \t\t\t// Don't checkpoint statefull tasks\n \t\t\tforce = false;\n \t\t} else {\n \t\t\t// look for a forced decision from the user\n \t\t\tForceCheckpoint forced = this.environment.getInvokable().getClass().getAnnotation(ForceCheckpoint.class);\n \t\t\tif (forced != null) {\n \t\t\t\tforce = forced.checkpoint();\n \t\t\t}\n \t\t}\n \t\tfinal ResourceUtilizationSnapshot rus = new ResourceUtilizationSnapshot(timestamp, channelUtilization, userCPU,\n \t\t\tforce, totalInputAmount, totalOutputAmount);\n \n \t\t// Notify the listener objects\n \t\tfinal Iterator<ExecutionListener> it = this.registeredListeners.iterator();\n \t\twhile (it.hasNext()) {\n \t\t\tit.next().initialExecutionResourcesExhausted(this.environment.getJobID(), this.vertexID, rus);\n \t\t}\n \n \t\t// Finally, propagate event to the job manager\n \t\tthis.taskManager.initialExecutionResourcesExhausted(this.environment.getJobID(), this.vertexID, rus);\n \t}", "protected void wash() throws InterruptedException {\n\t\t// Lock hatch\n\t\tmyMachine.setLock(true);\n\n\t\tpreWash();\n\t\tmainWash();\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\trinse();\n\t\t}\n\t\tcentrifuge();\n\t\t// Unlock\n\t\tmyMachine.setLock(false);\n\t}", "@Override\n\tprotected void interrupted() {\n\t\tmyLowerArm.set(0.0);\n\t\t\n\t}", "protected void interrupted() {\n \tRobotMap.feedMotor1.set(0);\n \tRobotMap.shootAgitator.set(0);\n }", "private void cancelHeavyLifting()\n {\n }", "private void releaseAirfield() {\n\t\tlandedAirfield.setOccupied(false);\n\t}", "public void ejectTicket(){if(this.inProgress()){this.currentTicket=null;}}", "private boolean UpdateWithoutCarriedBlock()\r\n {\r\n if ( rand.nextInt(20) == 0 )\r\n {\r\n int i = MathHelper.floor_double( ( posX - 3D ) + rand.nextDouble() * 6D );\r\n int j = MathHelper.floor_double( posY - 1D + rand.nextDouble() * 7D );\r\n int k = MathHelper.floor_double( ( posZ - 3D ) + rand.nextDouble() * 6D );\r\n \r\n int l1 = worldObj.getBlockId( i, j, k );\r\n\r\n if ( CanPickUpBlock( i, j, k ) )\r\n {\r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderBlockCollectAuxFXID, i, j, k, l1 + ( worldObj.getBlockMetadata( i, j, k ) << 12 ) );\r\n\t\t \r\n setCarried( worldObj.getBlockId( i, j, k ) );\r\n setCarryingData( worldObj.getBlockMetadata( i, j, k ) );\r\n worldObj.setBlockToAir( i, j, k );\r\n }\r\n }\r\n else if ( worldObj.provider.dimensionId == 1 )\r\n {\r\n \t// Endermen in the end without a block in hand will eventually teleport back to the overworld\r\n \t\r\n \t\tif ( rand.nextInt( 9600 ) == 0 )\r\n \t\t{\r\n \t\t\t// play dimensional travel effects\r\n \t\t\t\r\n int i = MathHelper.floor_double( posX );\r\n int j = MathHelper.floor_double( posY ) + 1;\r\n int k = MathHelper.floor_double( posZ );\r\n \r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderChangeDimensionAuxFXID, i, j, k, 0 );\r\n\t\t \r\n setDead();\r\n \r\n return false;\r\n \t\t}\r\n }\r\n \r\n return true;\r\n }", "public boolean isUnlocked() {\n return !isSolid;\n }", "public void markCriticalAbateDelete() throws JNCException {\n markLeafDelete(\"criticalAbate\");\n }", "public void collision() {\n\t\tcapacity = 0;\n\t\tcolor = ColorUtil.YELLOW;\n\t}", "void unsetSingleBetMinimum();", "public void reduceHealth() {\n\t}", "public void unlockExclusiveAndTakeWriteLock()\n {\n long s = initiateExclusiveLockRelease();\n long n = nextSeq( s ) - EXL_MASK + CNT_UNIT;\n unconditionallySetState( n );\n }", "private boolean doMASCCheckFor(Mounted masc, Vector<Report> vDesc, HashMap<Integer, CriticalSlot> vCriticals) {\n if (masc != null) {\n boolean bFailure = false;\n int nRoll = Compute.d6(2);\n\n usedMASC = true;\n Report r = new Report(2365);\n r.subject = getId();\n r.addDesc(this);\n r.add(masc.getName());\n vDesc.addElement(r);\n r = new Report(2370);\n r.subject = getId();\n r.indent();\n r.add(getMASCTarget());\n r.add(nRoll);\n\n if (nRoll < getMASCTarget()) {\n // uh oh\n bFailure = true;\n r.choose(false);\n vDesc.addElement(r);\n\n if (((MiscType) (masc.getType())).hasSubType(MiscType.S_SUPERCHARGER)) {\n if (masc.getType().hasFlag(MiscType.F_MASC)) {\n masc.setHit(true);\n masc.setMode(\"Off\");\n }\n // do the damage - engine crits\n int hits = 0;\n int roll = Compute.d6(2);\n r = new Report(6310);\n r.subject = getId();\n r.add(roll);\n r.newlines = 0;\n vDesc.addElement(r);\n if (roll <= 7) {\n // no effect\n r = new Report(6005);\n r.subject = getId();\n r.newlines = 0;\n vDesc.addElement(r);\n } else if ((roll >= 8) && (roll <= 9)) {\n hits = 1;\n r = new Report(6315);\n r.subject = getId();\n r.newlines = 0;\n vDesc.addElement(r);\n } else if ((roll >= 10) && (roll <= 11)) {\n hits = 2;\n r = new Report(6320);\n r.subject = getId();\n r.newlines = 0;\n vDesc.addElement(r);\n } else if (roll == 12) {\n hits = 3;\n r = new Report(6325);\n r.subject = getId();\n r.newlines = 0;\n vDesc.addElement(r);\n }\n for (int i = 0; (i < 12) && (hits > 0); i++) {\n CriticalSlot cs = getCritical(LOC_CT, i);\n if ((cs.getType() == CriticalSlot.TYPE_SYSTEM) && (cs.getIndex() == SYSTEM_ENGINE)) {\n vCriticals.put(new Integer(LOC_CT), cs);\n hits--;\n }\n }\n } else {\n // do the damage.\n // random crit on each leg, but MASC is not destroyed\n for (int loc = 0; loc < locations(); loc++) {\n if (locationIsLeg(loc) && (getHittableCriticals(loc) > 0)) {\n CriticalSlot slot = null;\n do {\n int slotIndex = Compute.randomInt(getNumberOfCriticals(loc));\n slot = getCritical(loc, slotIndex);\n } while ((slot == null) || !slot.isHittable());\n vCriticals.put(new Integer(loc), slot);\n }\n }\n }\n // failed a PSR, check for stalling\n doCheckEngineStallRoll(vDesc);\n } else {\n r.choose(true);\n vDesc.addElement(r);\n }\n return bFailure;\n }\n return false;\n }", "public void interrupted() {\n\t\taccumulatorController.systems.getAccumulatorMotors().setSpeed(0);\n\t\taccumulatorController.setState(AccumulatorState.IDLE);\n\t}", "public void unlock(){\n logger.log(Level. INFO,\"unlock() \"+lockState+\".\");\n this.lock.lock();\n logger.log(Level. INFO,\"unlock taking mutex :\"+lockState+\".\");\n switch(this.lockState){\n \t\t\tcase RLT:\n \t\t\tlockState = State.RLC;\n \t\t\tbreak;\n \t\t\tcase WLT:\n \t\t\tlockState = State.WLC;\n \t\t\tcase RLT_WLC:\n \t\t\tlockState = State.WLC;\t\n break;\n default:\n logger.log(Level.WARNING,\"Unlock with : \"+lockState+\".\");\n break;\n \t\t}\n this.available.signal();\t\n logger.log(Level.WARNING,\"SIGNAL\");\n this.lock.unlock();\n \t}", "private static void m200a() {\r\n Object obj = AuthTask.f155a;\r\n synchronized (obj) {\r\n try {\r\n obj.notify();\r\n } catch (Exception e) {\r\n }\r\n }\r\n }", "@KeepForSdk\n public void release() {\n if (this.zzm.decrementAndGet() < 0) {\n Log.e(\"WakeLock\", String.valueOf(this.zze).concat(\" release without a matched acquire!\"));\n }\n String zza = zza(null);\n synchronized (this.zza) {\n if (this.zzi) {\n int i;\n Integer[] numArr = (Integer[]) this.zzj.get(zza);\n if (numArr != null) {\n if (numArr[0].intValue() == 1) {\n this.zzj.remove(zza);\n i = 1;\n } else {\n numArr[0] = Integer.valueOf(numArr[0].intValue() - 1);\n }\n }\n i = 0;\n }\n if (!this.zzi) {\n }\n }\n zza(0);\n }", "protected abstract void ceaseHelper();", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\t//if (Settings.motorAAngle == -90) Settings.motorAAngle = -95;\n\n\t\tMotor.A.rotateTo(Settings.motorAAngle, true);\n\n\t\twhile (Motor.A.isMoving() && !Motor.A.isStalled() && !suppressed);\t\t\t\n\t\t\n\t\tMotor.A.stop();\n\t}", "private void abandonTileImprovementPlan() {\n if (tileImprovementPlan != null) {\n if (tileImprovementPlan.getPioneer() == getAIUnit()) {\n tileImprovementPlan.setPioneer(null);\n }\n tileImprovementPlan = null;\n }\n }", "private void m72697hn() {\n int size = this.aep.size() - this.aes;\n if (size > 0) {\n this.aev = true;\n for (int i = 0; i < size; i++) {\n this.aep.remove(0);\n }\n }\n }", "@Override\n public void unInvoke() {\n final Environmental item = affected;\n if (item == null)\n return;\n final Room room = CMLib.map().roomLocation(item);\n if ((canBeUninvoked()) && (room != null))\n room.showHappens(CMMsg.MSG_OK_VISUAL, item, L(\"<S-YOUPOSS> flaming sword is consumed!\"));\n super.unInvoke();\n if ((canBeUninvoked()) && (room != null)) {\n room.recoverRoomStats();\n item.destroy();\n }\n }", "@Test\r\n\tpublic void testFillChargingNonlinear_HighInitialSoC_ExhaustiveDesiredCapacity() {\n\t\tSimulation.verbosity = 0;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\t// Charge until soc=0.9\r\n\t\tdouble initialSoC = 0.9;\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\t\r\n\t\tdouble desiredCapacity = 0.1;\r\n\t\twhile (desiredCapacity <= car.getMissingCapacity()) {\r\n\t\t\t\r\n\t\t\tcar.setCurrentPlan(new double[96]);\r\n\t\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 96, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\t\tstartTimeSeconds);\r\n\t\t\t\r\n\r\n\t\t\tdouble plannedCapacity = schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds);\r\n\t\t\t//System.out.println(\"desiredCapacity=\" + desiredCapacity + \"Ah, plannedCapacity=\" + plannedCapacity);\r\n\t\t\t\r\n\t\t\tassertEquals(desiredCapacity, plannedCapacity, 1e-2);\r\n\t\t\tdesiredCapacity+=0.1;\r\n\t\t}\r\n\t\t\r\n\t}", "public void invalidate() {\n for (int i = 0; true; i = (2 * i + 1) & 63) {\n synchronized (this) {\n this.listener = null;\n this.sema = null;\n if (!deliveryPending || (Thread.currentThread().getId() == id)) {\n return;\n }\n }\n if (i == 0) {\n Thread.yield();\n } else {\n if (i > 3) Log.finer(Log.FAC_NETMANAGER, \"invalidate spin {0}\", i);\n try {\n Thread.sleep(i);\n } catch (InterruptedException e) {\n }\n }\n }\n }", "protected void aq() {\n Object object = this.li;\n synchronized (object) {\n if (this.lz != null) {\n this.lp.unregisterReceiver(this.lz);\n this.lz = null;\n }\n return;\n }\n }", "public void unlockSimcard() {\n // if sim is locked by Pin , need to unlock it\n Xlog.d(TAG,\"unlockSimcard() ,mITelephony \" + mITelephony);\n try {\n if (mITelephony != null) {\n int simState = FeatureOption.MTK_GEMINI_SUPPORT ?\n (mITelephonyEx.getSimIndicatorState(mSlotId))\n : (mITelephony.getSimIndicatorState());\n if (PhoneConstants.SIM_INDICATOR_LOCKED == simState) {\n mCellConnMgr.handleCellConn(mSlotId, GeminiUtils.PIN1_REQUEST_CODE);\n Xlog.d(TAG,\"Data enable check change request pin , mSlotId \" + mSlotId);\n }\n }\n } catch (RemoteException e) {\n Xlog.e(TAG, \"RemoteException\");\n } catch (NullPointerException ex) {\n Xlog.e(TAG, \"NullPointerException\");\n }\n \n }", "public void deleteBarrier() {\n if(stater == 3) return;\n stater = 3;\n }", "public void onUnblock();", "public void unlock() {\n islandLocked = false;\n }", "@Override\r\n\tpublic boolean unlockIt() {\n\t\treturn false;\r\n\t}", "private boolean tryAcc(int ticket) {\n int old = trackStatus[ticket].availablePermits();\n boolean r = trackStatus[ticket].tryAcquire();\n if (DEBUG) System.err.printf(\"Train: %d\\tTried: %d=%b:%d->%d\\n\", this.id, ticket, r, old, (trackStatus[ticket].availablePermits()));\n return r;\n }", "@Override\n public void syncState() {\n scheduledCounter.check();\n }", "private void updatePlayerClaim(){\n if(chestProgressLevel!=1){\n return; //the chest isnt unlocked!\n }\n\n //count the total players, and the players who unlocked it.\n int totalPlayers = 0;\n int unlockedPlayers = 0;\n for(JuggernautPlayer player: JuggernautGame.getInstance().getPlayers()){\n if(!player.isSurvivor() || !player.isAlive()){\n continue; //they be dead, they dont count! (Juggy also doesnt count, he doesnt get to unlock items)\n }\n totalPlayers++; //+1 total players\n if(player.isSurvivor() && player.getChestBonus(chestID)>=level){\n unlockedPlayers++; //they unlocked it, +1 unlocked players\n }\n }\n\n //all players unlocked it\n if(totalPlayers<=unlockedPlayers && chestProgressLevel==1){\n //lock the chest before respawning.\n lockChest();\n new BukkitRunnable() {\n\n int timeTillRespawn = 3; //3 seconds to respawn a chest\n @Override\n public void run() {\n //runs every second\n for(JuggernautPlayer jp : JuggernautGame.getInstance().getAllPeople()){\n //check if the player is in the radius of the chest (ignore Y)\n if(SkyMathHelper.isInRadius(location, jp.getPlayer().getLocation(), nametagRadius, false)) {\n //show them the hologram. Update if they already have the hologram active.\n //If this chest will not respawn, we tell them \"Good Luck!\" instead of the respawning message.\n if (jp.getLoadedEntities().containsKey(armorstandResetChestID)) {\n if(level==getMaxLevel()){\n jp.updateHologram(armorstandResetChestID, \"\\u00A76Good Luck!\");\n }else {\n jp.updateHologram(armorstandResetChestID, \"\\u00A76Respawning in \" + timeTillRespawn);\n }\n } else {\n if(level==getMaxLevel()) {\n jp.displayHologram(location.getX(), location.getY() + armorstandProgressbarHeight, location.getZ(), \"\\u00A76Good Luck!\", armorstandResetChestID);\n }else{\n jp.displayHologram(location.getX(), location.getY() + armorstandProgressbarHeight, location.getZ(), \"\\u00A76Respawning in \" + timeTillRespawn, armorstandResetChestID);\n }\n }\n }else{\n //they arent in range, so we remove this entity for them\n jp.removeEntities(armorstandResetChestID);\n }\n }\n\n //check if its time to respawn.\n if(timeTillRespawn--<=0){\n //its time! respawn the chest!\n respawnChest();\n for(JuggernautPlayer jp: JuggernautGame.getInstance().getPlayers()){\n //remove the countdown armorstand for all players\n jp.removeEntities(armorstandResetChestID);\n }\n this.cancel(); //cancel this runnable, we no longer need it.\n return;\n }\n }\n }.runTaskTimer(Juggernaut.pluginInstance, 0L, 20L); //every 20 ticks (1s)\n }else{\n //not all players unlocked the item yet. Lets indicate how many did.\n String emptyDisplayText = unlockedPlayers + \"/\" + totalPlayers + \" Claimed\";\n for(JuggernautPlayer JP: JuggernautGame.getInstance().getPlayers()){\n if(!SkyMathHelper.isInRadius(location, JP.getPlayer().getLocation(), nametagRadius, false)){\n //they arent in the radius, so we remove their armorstand again (if they had it).\n if(JP.getLoadedEntities().containsKey(this.armorstandClaimProgressID)) {\n JP.removeEntities(armorstandClaimProgressID);\n }\n continue;\n }\n\n //generate the color of the display text we need to show them. green if they claimed it, otherwise red.\n String displayText;\n if(JP.getChestBonus(chestID)>=level){\n displayText = \"\\u00A72\" + emptyDisplayText;\n }else{\n displayText = \"\\u00A7c\" + emptyDisplayText;\n }\n\n //update, or show the hologram to them.\n if(JP.getLoadedEntities().containsKey(this.armorstandClaimProgressID)){\n JP.updateHologram(armorstandClaimProgressID, displayText);\n }else{\n JP.displayHologram(this.location.getX(), this.location.getY()+this.armorstandClaimProgressHeight, this.location.getZ(), displayText, armorstandClaimProgressID);\n }\n }\n }\n }", "public void acaba() \n\t\t{\n\t\t\tsigo2 = false;\n\t\t}", "@Test\r\n\tpublic void testFillChargingNonlinear_EmptyCar_ExhaustiveDesiredCapacity() {\n\t\tSimulation.verbosity = 0;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\tdouble desiredCapacityInterval = 1; \r\n\t\t\r\n\t\tdouble desiredCapacity = desiredCapacityInterval;\r\n\t\twhile (desiredCapacity <= car.getMaxCapacity()) {\r\n\t\t\t\r\n\t\t\t//System.out.println(\"desiredCapacity=\" + desiredCapacity);\r\n\t\t\tcar.setCurrentPlan(new double[96]);\r\n\t\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 96, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\t\tstartTimeSeconds);\r\n\t\t\t\r\n\t\t\tassertEquals(desiredCapacity, schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-2);\r\n\t\t\tdesiredCapacity += desiredCapacityInterval;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void act()\n {\n if (health == 0)\n {\n this.remove();\n }\n }", "public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}", "protected void unLockItems() throws NbaBaseException {\n Iterator it = getMatchingWorkItems().iterator();\n NbaDst nbaDst; \n\t\t//NBA213 deleted code\n\t\t//process transactions\n\t\twhile (it.hasNext()) {\n\t\t\tnbaDst = (NbaDst) it.next();\n\t\t\tunlockWork(getUser(), nbaDst); //NBA213\n\t\t}\n\t\tit = getCaseWorkItems().values().iterator();\n\t\t//process cases\n\t\twhile (it.hasNext()) {\n\t\t\tnbaDst = (NbaDst) it.next();\n\t\t\tunlockWork(getUser(), nbaDst); //NBA213\n\t\t}\n\t\t//NBA213 deleted code\n }", "protected void interrupted() {\n \tRobot.claw.setClawMotor(0);\n }", "public void acquire() {\r\n return;\r\n }", "public void unlockAdd(){\n\t\tthis.canAdd = true;\n\t}", "@Override\n public void unlock(int myId) {\n Y = -1; \n flag[myId] = false;\n \n }", "public void clearFreeSlots() {\n AvailableSlots.clear();\n }", "@Override\n public void bankrupt() {\n this.mortgaged = false;\n }", "public static void playerEffectivelyEndsBattlePhase() {\r\n for (int index = 1; index <= 5; index++){\r\n SummonedMonster MonsterCPU = SummonedMonster.getNthSummonedMonster(index, false);\r\n if (MonsterCPU.isExisting) {\r\n MonsterCPU.canStillAttackThisTurn = false;\r\n }\r\n }\r\n endAttack(false);\r\n }", "void unsetMultipleBetMinimum();", "private void unscheduleSlice() {\n nextSliceRunTime = Double.MAX_VALUE;\n timer.cancel();\n }", "void collide() {\n for (Target t : this.helicopterpieces) {\n if (!t.isHelicopter && ((t.x == this.player.x && t.y == this.player.y)\n || (t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected--;\n t.isCollected = true;\n }\n if (t.isHelicopter && this.collected == 1\n && ((t.x == this.player.x && t.y == this.player.y) || (t.isHelicopter\n && this.collected == 1 && t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected = 0;\n this.helicopter.isCollected = true;\n }\n }\n }", "boolean equip(MyInt counter)\n\t{\n\t\treturn false;\n\t}", "private void subtractEnemyMissile() {\n this.enemyMissile -= 1;\n }", "@Override\n public void unlock() {\n }", "public void resetFuelWarning();", "protected abstract void scheduleSuspicions();", "private void d() {\n Queue<c> queue;\n Queue<c> queue2 = queue = i;\n synchronized (queue2) {\n long l2 = System.currentTimeMillis();\n Iterator iterator = i.iterator();\n while (iterator.hasNext()) {\n if (l2 - ((c)iterator.next()).a < 60000L) continue;\n iterator.remove();\n }\n if (i.size() >= 15) {\n for (int i2 = 0; i2 < 5; ++i2) {\n i.remove();\n }\n }\n return;\n }\n }", "public void sogutucuyuAc(){\n\t\tif(!(durum==true)){\n\t\t\tdurum = true;\n\t\t\tnotifyObservers();\n\t\t}\n\t\telse {\n\t\t\tnotifyObservers();\n\t\t}\n\t}", "public abstract void zeroAP();", "protected void interrupted() {\n\t\tRobot.cubeCollector.setCubeCollector(ControlMode.PercentOutput, 0);\n\t}", "@Override\n public void onRemoval() {\n try {\n if (eOutputHatches != null) {\n for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) {\n hatch_elemental.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) {\n hatch_elemental.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_OutputData hatch_data : eOutputData) {\n hatch_data.id = -1;\n hatch_data.q = null;\n }\n for (GT_MetaTileEntity_Hatch_InputData hatch_data : eInputData) {\n hatch_data.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) {\n hatch.getBaseMetaTileEntity().setActive(false);\n }\n for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) {\n hatch.getBaseMetaTileEntity().setActive(false);\n }\n }\n cleanOutputEM_EM();\n if (ePowerPass && getEUVar() > V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) {\n explodeMultiblock();\n }\n } catch (Exception e) {\n if (DEBUG_MODE) {\n e.printStackTrace();\n }\n }\n }", "public boolean isAcquired() {\r\n return false;\r\n }", "@Override\n\tpublic void unlock() {\n\t\t\n\t}", "protected void leaveCriticSection(RDVariable rdv, RDThread rdt) {\n\t\t/*\n\t\t * unlock the explicit lock\n\t\t */\n\n\t\trdv.raceAvoidLock.unlock();\n\n\t\tif (DEBUG)\n\t\t\tRaceDetector.printDebug(\" explicit lock (\"\n\t\t\t\t\t+ System.identityHashCode(rdv) + \") unlocked \"\n\t\t\t\t\t+ Thread.currentThread() + \" (critic)\");\n\t}", "public abstract boolean isExclusive();", "private void reclaimSpace(int space)\r\n/* 269: */ {\r\n/* 270:295 */ assert (space >= 0);\r\n/* 271:296 */ this.availableSharedCapacity.addAndGet(space);\r\n/* 272: */ }", "void unsetPoolRaces();", "public void takeAvailable() {\n\t\tavailable = false;\n\t}", "public void leave() throws InterruptedException {\n inship.clear();\n // your code here\n\n }", "public static void cpuEffectivelyEndsBattlePhase() {\r\n endAttack(false);\r\n Game.proceedToNextPhase();\r\n }", "public void unAssignSeat(int seatId){\n seat[seatId-1].unAssign();\n numEmptySeat++;\n }", "public void mo42332a() {\n this.f36204P.cancel();\n mo42330e();\n }", "public boolean isUnblockable();" ]
[ "0.6131251", "0.61260396", "0.6079337", "0.59858066", "0.5947715", "0.5830227", "0.5806132", "0.57402843", "0.5727257", "0.5674507", "0.5614685", "0.56083304", "0.5579825", "0.55742925", "0.55557597", "0.55329734", "0.5531468", "0.5524861", "0.5503468", "0.55000615", "0.5493003", "0.5492117", "0.5468972", "0.5454246", "0.5451159", "0.54402494", "0.5418005", "0.541009", "0.5402731", "0.5383352", "0.53787667", "0.537512", "0.5370387", "0.5367777", "0.5361798", "0.53617245", "0.5360095", "0.53494096", "0.5330131", "0.53291935", "0.5327523", "0.5319896", "0.5309818", "0.5308698", "0.53078175", "0.5305552", "0.53029674", "0.52983963", "0.5297297", "0.5289657", "0.5283907", "0.52683747", "0.52622986", "0.5260539", "0.525537", "0.5248832", "0.52366394", "0.5230064", "0.52288306", "0.52174777", "0.52173704", "0.52109057", "0.520271", "0.51956284", "0.51923615", "0.5189628", "0.5189367", "0.51864654", "0.51859003", "0.5180838", "0.5175755", "0.51748276", "0.5174258", "0.5172186", "0.51704544", "0.51694036", "0.5168677", "0.5161124", "0.5157781", "0.51564044", "0.5148297", "0.514718", "0.51468205", "0.5144473", "0.51431036", "0.51331204", "0.513182", "0.5128861", "0.5123292", "0.51226544", "0.51185787", "0.51153165", "0.511218", "0.5111499", "0.510967", "0.51089716", "0.51079786", "0.51075965", "0.5098894", "0.5096683", "0.5095954" ]
0.0
-1
this returns 0 because ammo is handled by the CV much differently
@Override public int NumCVSpaces() { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getMineActualAmmo() {\r\n\t\t\r\n\t\t// Code kann nur bei Verwendung von eea verwendet werden, sonst muss er geloescht werden!\r\n\t\t// Auch bei Verwendung von eea muss diese Methode erweitert werden.\r\n\r\n\t\tList<Entity> entities = new ArrayList<Entity>();\r\n\r\n\t\tentities = StateBasedEntityManager.getInstance().getEntitiesByState(Tanks.GAMEPLAYSTATE);\r\n\r\n\t\t//TODO\r\n\r\n\t\treturn -1;\r\n\t}", "public int getMineMaxAmmo() {\r\n\t\t\r\n\t\t// Code kann nur bei Verwendung von eea verwendet werden, sonst muss er geloescht werden!\r\n\t\t// Auch bei Verwendung von eea muss diese Methode erweitert werden.\r\n\r\n\t\tList<Entity> entities = new ArrayList<Entity>();\r\n\r\n\t\tentities = StateBasedEntityManager.getInstance().getEntitiesByState(Tanks.GAMEPLAYSTATE);\r\n\r\n\t\t//TODO\r\n\r\n\t\treturn -1;\r\n\t}", "public static int getEnemyLives(){\n return 1 + currentLvl * 2;\n\n }", "@Override\n\tpublic float desireability() {\n\t\tAgentSpace agentSpace = Blackboard.inst().getSpace(AgentSpace.class, _obj.getName());\n\t\tMap<String,FoodEntry> map = agentSpace.getScentMemories().getFirst();\n\t\tif (map == null || map.size() == 0) { \n\t\t\t// we don't smell anything\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tAgentSpace space = Blackboard.inst().getSpace(AgentSpace.class, _obj.getName());\n\t\tBoundedEntry bounded = space.getBounded(Variable.energy);\n\t\tfloat pct = bounded.getValue() / bounded.getMax();\n\t\treturn 1 - (pct*pct);\n\t}", "public int shoot()\n {\n if(availableAmmo > 0)\n {\n System.out.println(\"Pew Pew\");\n availableAmmo--; \n damageCaused = randomDamageGenerator.nextInt(450);\n return damageCaused;\n }\n else return -1;\n }", "int getMinigameDefenseChancesLeft();", "@Override\n\tpublic int getMetricInternal() {\n// Util.runToAddressNoLimit(0, 0, 0x3d702, 0x3e77f);\n// missed_ = curGb.readMemory(curGb.pokemon.fightAttackMissedAddress);\n// System.out.println(\"missed: \" + missed_);\n\n\t\tEflUtil.runToAddressNoLimit(0, 0, curGb.pokemon.fightBattleCommand0a);\n\t\tint crit = curGb.readMemory(curGb.pokemon.fightCriticalHitAddress);\n\t\tint missed = curGb.readMemory(curGb.pokemon.fightAttackMissedAddress);\n//\t\tSystem.out.println(\"EflCheckMoveDamage crit: \" + crit + \" missed: \" + missed);\n\t\tif (missed != 0 || criticalHit != (crit != 0))\n\t\t return Integer.MIN_VALUE;\n\t\tif (thrashAdditionalTurns > 0 && curGb.readMemory(curGb.pokemon.thrashNumTurnsAddress) < thrashAdditionalTurns) {\n\t\t\tSystem.out.println(\"caught bad thrash \"+ curGb.readMemory(curGb.pokemon.thrashNumTurnsAddress));\n return Integer.MIN_VALUE;\n\t\t}\n\t\tif (PokemonUtil.isGen2()) {\n\t\t\tint effectMissed = curGb.readMemory(curGb.pokemon.fightEffectMissedAddress);\n\t\t\tif (this.effectMiss != (effectMissed != 0))\n\t\t\t return Integer.MIN_VALUE;\n\t\t}\n\t\tint dmg = Util.getMemoryWordBE(curGb.pokemon.fightCurDamageAddress);\n// System.out.println(\"EflCheckMoveDamage dmg: \" + dmg);\n\t\tif (dmg < minDamage || dmg > maxDamage)\n return Integer.MIN_VALUE;\n//\t\t\tSystem.out.println(crit+\" \"+missed+\" \"+effectMissed+\" \"+dmg);\n//\t\tSystem.out.println(\"atk: \"+atk+\", def: \"+def+\", pow: \"+pow+\", lvl: \"+lvl);\n//\t\tSystem.out.println(\"max damage: \"+maxdmg+\", dmg: \"+dmg);\n\t\treturn negateOutputDamage ? -dmg : dmg;\n\t}", "private double enemyKills()\n {\n return (double)enemyResult.shipsLost();\n }", "public int getRunicCharge(ItemStack itemstack) {\n \tif ((itemstack.hasTagCompound()) && (itemstack.stackTagCompound.hasKey(\"upgrade\")) && (itemstack.stackTagCompound.getInteger(\"upgrade\") == 2)) {\n \t\treturn (this.armorType == 0) ? 12 : ((this.armorType == 1) ? 36 : ((this.armorType == 2) ? 24 : 12 )); //TODO 84 total, TBA\n \t }\n \treturn (this.armorType == 0) ? 8 : ((this.armorType == 1) ? 24 : ((this.armorType == 2) ? 16 : 8 )); //56 total\n \t\n\t}", "public int mortgage() {\n\t\treturn 0;\n\t}", "int getMana();", "public int getDmg(){\r\n return enemyDmg;\r\n }", "public void setAmmo(int ammo) {\n\t\tthis.ammo = ammo;\n\t}", "public int getEquippedWeaponDamage() {\n return 0;\n }", "int getSoilMoistureLevel(int soilMoistureMM);", "int getSuperEffectiveChargeAttacksUsed();", "public void setAmmo(final boolean x) {\n int ammodif = 0;\n switch (Engine.currentWeapon) {\n\n case 2:\n ammodif = maxshotgunAmmo - shotgunAmmo;\n if (x) {\n if (ammodif < 10) {\n shotgunAmmo += ammodif;\n } else {\n shotgunAmmo += 10;\n }\n } else {\n shotgunAmmo--;\n if (shotgunAmmo == 0) {\n shotgunAmmo = 0;\n }\n\n }\n\n break;\n case 3:\n ammodif = maxrifleAmmo - rifleAmmo;\n if (x) {\n if (ammodif < 20) {\n rifleAmmo += ammodif;\n } else {\n rifleAmmo += 20;\n }\n } else {\n rifleAmmo--;\n if (rifleAmmo == 0) {\n rifleAmmo = 0;\n }\n }\n\n break;\n case 4:\n ammodif = maxgranadelauncherAmmo - granadeLauncherAmmo;\n if (x) {\n if (ammodif < 10) {\n granadeLauncherAmmo += ammodif;\n } else {\n granadeLauncherAmmo += 10;\n }\n } else {\n granadeLauncherAmmo--;\n if (granadeLauncherAmmo == 0) {\n granadeLauncherAmmo = 0;\n }\n }\n\n break;\n }\n }", "public int checkNoOfExplosivesPlayerHolds () { return noOfExplosives; }", "public float capacidadeTotal() {\r\n float toneladas = 0;\r\n\r\n for (int i = 0; i < numNavios; i++) {\r\n if (navios[i] instanceof Petroleiro) {\r\n Petroleiro petroleiro = (Petroleiro) navios[i];\r\n toneladas = toneladas + petroleiro.getCapacidadeCarga();\r\n } else if (navios[i] instanceof PortaContentores) {\r\n PortaContentores portaContentores = (PortaContentores) navios[i];\r\n toneladas = toneladas + portaContentores.getMaxContentores() * 10;\r\n }\r\n }\r\n return toneladas;\r\n }", "public int score()\n {\n if (this.score != Integer.MIN_VALUE)\n return this.score;\n\n this.score = 0;\n if (!this.safe)\n return 0;\n\n // End game bonus\n int bonus = this.d.size() * Math.max(0, (this.L - 3 * this.b.shots)) * 3;\n this.score = (this.d.size() * 100) + ((this.NE - this.e.size()) * 10) + (this.e.size() == 0 ? bonus : 0);\n\n // value:\n return this.score;\n }", "int getMaxMana();", "private int getEnemyGunFireRate()\n\t{\n\t\tfloat rate = 115 - (GameState._playerScore * .2f);\n\t\tif (rate < 20)\n\t\t{\n\t\t\trate = 20;\n\t\t}\n\t\treturn (int)rate;\n\t}", "private int currentCapacity(){\n int total = 0;\n \n for(int i = Elevator.MIN_FLOOR; i <= Elevator.MAX_FLOOR; i++){\n total += destinedPassengers[i];\n }\n \n return total;\n }", "public int getHealthGain();", "public int getSelectedWeaponDamage() {\n return 0;\n }", "private void subtractEnemyMissile() {\n this.enemyMissile -= 1;\n }", "public void updateAmmunition() {\n amountOfAmmoText.setText(\"Ammunition: \" + game.getPlayerComponent().getActiveWeapon().getMagazineCounter());\n }", "int getMPValue();", "public int getDamage() {\n //TODO\n return 1;\n }", "public int getLivesRemaining();", "@Override\n public int status() {\n if (currentLoad <= maxLoad && currentLoad >= 0.6 * maxLoad) return GOOD;\n if (currentLoad < 0.6 * maxLoad && currentLoad >= 0.1 * maxLoad) return CHECK;\n else return BAD;\n }", "public int getExperienceGained() {\r\n return experienceGained;\r\n }", "public static long mass () { return mass;}", "@Override\n public double getMass() {\n return 0;\n }", "public int getEquippedWeaponWeight() {\n return 0;\n }", "@Override\n\tpublic int calculateDamage() \n\t{\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}", "int getCurrentHP();", "public int obtenirArmure() {\n\t\treturn this.armure;\n\t}", "public double promedioAlum(){\n setProm((getC1() + getC2() + getC3() + getC4()) / 4);\n return getProm();\n }", "public int getBaseMana()\r\n {\r\n return mBaseMana;\r\n }", "public double getMana() {\n return classData.getMana(level);\n }", "public static int GetMills() {\r\n return (int) System.currentTimeMillis() - StartUpTimeMS;\r\n }", "int steamPerDurability();", "public int getDamage() {\n \t\treturn damage + ((int) 0.5*level);\n \t}", "public int getAtomicMass()\n\t{\n\t\treturn protons+neutrons;\n\t}", "@Override\n\tpublic int getMaxEnergyStored() {\n\t\treturn 0;\n\t}", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "public int calcMaxLife() {\n\t\treturn 10;\r\n\t}", "public int getDamageTaken() {\n return this.damageTaken;\n }", "public int getRemainingEnemies(){\n return mNumberOfEnemies - (mEnemyIndex + 1);\n }", "public int act1Cost()\r\n {\r\n return 1;\r\n }", "public void reduceHealth(int ammo_damage){\n this.health -= ammo_damage;\n }", "private static int experienceTally(int playerExperience, int monsterExperience){\r\n int totalExperience;\r\n totalExperience = playerExperience + monsterExperience;\r\n return totalExperience;\r\n }", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "public double aire() {\n\t\treturn 0;\n\t}", "public static int totalSupply() {\n return totalSupplyGet();\n }", "public int getAtomicMass() {\r\n\t\treturn protons + neutrons;\r\n\t}", "public int getDamage () {\n\t\treturn (this.puissance + stuff.getDegat());\n\t}", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "public int getMobCap()\r\n/* 24: */ {\r\n/* 25:41 */ return this.f;\r\n/* 26: */ }", "public int totalGemValue() {\r\n\t\ttotal = 0;\r\n\t\ttotal += gemPile[0];\r\n\t\ttotal += gemPile[1] * 2;\r\n\t\ttotal += gemPile[2] * 3;\r\n\t\ttotal += gemPile[3] * 4;\r\n\t\treturn total;\r\n\t}", "public int getLevel(){\n \t\treturn (strength + intelligence + stamina + Math.abs(charm) + Math.abs(cuteness))/5;\n \t}", "public int score() {\n\t\tint result = 0;\n\t\tArrayList<Tile> a = g.getQueue();\n\t\tCollections.reverse(a);\n\t\tint index = 0;\n\t\twhile (a.get(index) == null)\n\t\t\tindex++;\n\t\tfor (int i = index; i < a.size() - 1; i++) {\n\t\t\tif (a.get(i) == null)\n\t\t\t\tcontinue;\n\t\t\tint cmp = a.get(i).compareTo(a.get(i + 1));\n\t\t\tresult -= cmp;\n\t\t}\n\t\treturn result;\n\t}", "public static int consumedPower(){\n int consumedPower = 0;\n for (ElectricalHomeDevice device : allTrunedOnDevices){\n consumedPower += device.getDevicePower();\n }\n return consumedPower;\n }", "public java.lang.Integer getGroundcnt() throws java.rmi.RemoteException;", "public int computeDamageTo(Combatant opponent) { return 0; }", "public short getSiegeWeaponDamage();", "private static int maxHealth(int health){\r\n int mHealth = 0;\r\n mHealth = health + 5;\r\n return mHealth; \r\n }", "public int getManaIncreasePerLevel() {\r\n if (_index == 3 || _index == 11 || _index == 6 || _index == 14) {\r\n // Acolytes, High Priests, Druids, or High Druids\r\n return 1;\r\n } else if (isSpellCaster()) {\r\n return 2;\r\n }\r\n return 0;\r\n }", "public int totalScore() {\n return 0;\n }", "public int getOccupancy() {\r\n return teamRed.getSize() + teamBlue.getSize();\r\n }", "@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 int getHealthCost();", "public int getAmmount() {\r\n return ammount;\r\n }", "public int magicMissile();", "public double getCurrentFuel();", "public void calibrated() {\n weaponDamage = weaponDamage + 10;\r\n }", "@Override\n\tpublic double getAttack() {\n\t\treturn 0;\n\t}", "public double progress() {\n if (damage <= 0) {\n return damage;\n }\n double n = noise.nextValue();\n damage = damage + (k * damage * damage) + l + n;\n return damage;\n }", "int range() {\n\t\treturn mpg * fuelcap;\n\t}", "public int getMpUsed() {\n if (getLastStep() != null) {\n return getLastStep().getMpUsed();\n }\n return 0;\n }", "int getBonusHP();", "double fuelneeded(int miles) {\n\t\treturn (double) miles / mpg;\n\t}", "public void addAmmo (double amount) {\n\t\t\n\t\tcurrentAmmo = Math.min(maxAmmo, currentAmmo + amount);\n\t}", "public int getInstabilityScore();", "public int getFuelCapacity() {\r\n return fuelCapacity;\r\n }" ]
[ "0.7376756", "0.6908925", "0.6400199", "0.6397247", "0.6284707", "0.6211691", "0.62116843", "0.6148518", "0.61304224", "0.6098353", "0.6073918", "0.6068305", "0.60584366", "0.6020802", "0.6018135", "0.5994435", "0.59705764", "0.59594303", "0.59054655", "0.5902032", "0.5901588", "0.58941257", "0.58828765", "0.58823013", "0.58714104", "0.58646196", "0.58584607", "0.5853178", "0.5846645", "0.5836108", "0.58262306", "0.5814742", "0.58144504", "0.58077776", "0.57995075", "0.57726115", "0.5765916", "0.5764025", "0.57574403", "0.5755987", "0.574912", "0.5748494", "0.57427436", "0.57414836", "0.5741288", "0.57383025", "0.5736062", "0.5736062", "0.5736062", "0.5736062", "0.5736062", "0.5736062", "0.57333577", "0.5733069", "0.57260567", "0.57200664", "0.5717266", "0.5713921", "0.5712584", "0.5712584", "0.5712584", "0.5712584", "0.5712584", "0.5712584", "0.5712584", "0.5709611", "0.57073945", "0.5700951", "0.5696134", "0.5695057", "0.5695057", "0.5695057", "0.5695057", "0.5695057", "0.56931245", "0.5692747", "0.5690002", "0.56826854", "0.5673844", "0.5667601", "0.56610805", "0.56592804", "0.5657686", "0.56535447", "0.5645629", "0.5644807", "0.563776", "0.5635235", "0.5633495", "0.5631237", "0.5629503", "0.56237835", "0.56235075", "0.56230354", "0.56166416", "0.5615722", "0.5615233", "0.56150275", "0.56134653", "0.5610981", "0.56103575" ]
0.0
-1
Only certain types of ammo comes in less or more than one ton lots but we'll have to set this regardless
public double GetTonnage() { if( LotSize != CurLotSize ) { double TonsPerShot = Tonnage / (double) LotSize; return CommonTools.RoundFractionalTons( TonsPerShot * (double) CurLotSize ); } return Tonnage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean checkGreedyEnergy() {\r\n return myTotal.get(2) < 10 || (myTotal.get(2) < 13 && myTotal.get(2) <= enTotal.get(2));\r\n }", "public void setAmmo(final boolean x) {\n int ammodif = 0;\n switch (Engine.currentWeapon) {\n\n case 2:\n ammodif = maxshotgunAmmo - shotgunAmmo;\n if (x) {\n if (ammodif < 10) {\n shotgunAmmo += ammodif;\n } else {\n shotgunAmmo += 10;\n }\n } else {\n shotgunAmmo--;\n if (shotgunAmmo == 0) {\n shotgunAmmo = 0;\n }\n\n }\n\n break;\n case 3:\n ammodif = maxrifleAmmo - rifleAmmo;\n if (x) {\n if (ammodif < 20) {\n rifleAmmo += ammodif;\n } else {\n rifleAmmo += 20;\n }\n } else {\n rifleAmmo--;\n if (rifleAmmo == 0) {\n rifleAmmo = 0;\n }\n }\n\n break;\n case 4:\n ammodif = maxgranadelauncherAmmo - granadeLauncherAmmo;\n if (x) {\n if (ammodif < 10) {\n granadeLauncherAmmo += ammodif;\n } else {\n granadeLauncherAmmo += 10;\n }\n } else {\n granadeLauncherAmmo--;\n if (granadeLauncherAmmo == 0) {\n granadeLauncherAmmo = 0;\n }\n }\n\n break;\n }\n }", "public void tensionRangeCheck(){\n if(motor.get() < 0){\n if(Bottom_Limit_Switch.get() | tenPot.pidGet()> tenPotMAX ){\n motor.set(0.0);\n }\n }else if(motor.get() > 0){\n if(Top_Limit_Switch.get() | tenPot.pidGet()< tenPotMIN){\n motor.set(0.0);\n }\n }\n }", "public void setAmmo(int ammo) {\n\t\tthis.ammo = ammo;\n\t}", "public boolean lowQuantity(){\r\n if(getToolQuantity() < 40)\r\n return true;\r\n return false;\r\n }", "static boolean getMauled(){\n\t\t\tif (Person.player.inventory.contains(Item.repellent)) //if you have the goose repellent...\n\t\t\t\treturn (MainFile.getRandomNumber(240) == 12); //drastically lowers your chance of being mauled.\n\t\t\treturn (MainFile.getRandomNumber(20) == 12);//generates a random number for if you don't have it, and if it's 12 you get mauled\n\t\t}", "private boolean caughtTwenty(){\n\t\treturn (theTrainer.getPokedex().size() >= 20);\n\t}", "private void checkIfHungry(){\r\n\t\tif (myRC.getEnergonLevel() * 2.5 < myRC.getMaxEnergonLevel()) {\r\n\t\t\tmission = Mission.HUNGRY;\r\n\t\t}\r\n\t}", "private void setArmor() {\n\n if (VersionChecker.currentVersionIsUnder(12, 2)) return;\n if (!ConfigValues.mobCombatSettingsConfig.getBoolean(MobCombatSettingsConfig.ELITE_ARMOR)) return;\n\n eliteMob.getEquipment().setItemInMainHandDropChance(0);\n eliteMob.getEquipment().setHelmetDropChance(0);\n eliteMob.getEquipment().setChestplateDropChance(0);\n eliteMob.getEquipment().setLeggingsDropChance(0);\n eliteMob.getEquipment().setBootsDropChance(0);\n\n if (hasCustomArmor) return;\n\n if (!(eliteMob instanceof Zombie || eliteMob instanceof PigZombie ||\n eliteMob instanceof Skeleton || eliteMob instanceof WitherSkeleton)) return;\n\n eliteMob.getEquipment().setBoots(new ItemStack(Material.AIR));\n eliteMob.getEquipment().setLeggings(new ItemStack(Material.AIR));\n eliteMob.getEquipment().setChestplate(new ItemStack(Material.AIR));\n eliteMob.getEquipment().setHelmet(new ItemStack(Material.AIR));\n\n if (eliteMobLevel >= 12)\n if (ConfigValues.mobCombatSettingsConfig.getBoolean(MobCombatSettingsConfig.ELITE_HELMETS))\n eliteMob.getEquipment().setHelmet(new ItemStack(Material.LEATHER_HELMET));\n\n if (eliteMobLevel >= 14)\n eliteMob.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS));\n\n if (eliteMobLevel >= 16)\n eliteMob.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));\n\n if (eliteMobLevel >= 18)\n eliteMob.getEquipment().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));\n\n if (eliteMobLevel >= 20)\n if (ConfigValues.mobCombatSettingsConfig.getBoolean(MobCombatSettingsConfig.ELITE_HELMETS))\n eliteMob.getEquipment().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));\n\n if (eliteMobLevel >= 22)\n eliteMob.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));\n\n if (eliteMobLevel >= 24)\n eliteMob.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));\n\n if (eliteMobLevel >= 26)\n eliteMob.getEquipment().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));\n\n if (eliteMobLevel >= 28)\n if (ConfigValues.mobCombatSettingsConfig.getBoolean(MobCombatSettingsConfig.ELITE_HELMETS))\n eliteMob.getEquipment().setHelmet(new ItemStack(Material.IRON_HELMET));\n\n if (eliteMobLevel >= 30)\n eliteMob.getEquipment().setBoots(new ItemStack(Material.IRON_BOOTS));\n\n if (eliteMobLevel >= 32)\n eliteMob.getEquipment().setLeggings(new ItemStack(Material.IRON_LEGGINGS));\n\n if (eliteMobLevel >= 34)\n eliteMob.getEquipment().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));\n\n if (eliteMobLevel >= 36)\n eliteMob.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));\n\n if (eliteMobLevel >= 38)\n if (ConfigValues.mobCombatSettingsConfig.getBoolean(MobCombatSettingsConfig.ELITE_HELMETS))\n eliteMob.getEquipment().setHelmet(new ItemStack(Material.DIAMOND_HELMET));\n\n if (eliteMobLevel >= 40)\n eliteMob.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));\n\n if (eliteMobLevel >= 42)\n eliteMob.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));\n\n }", "@Override\n public void adjustTypeAttributes() {\n this.getSpecialData().addAttribute(SharedMonsterAttributes.maxHealth, 20.0);\n }", "private void randomizePowers(EliteMobProperties eliteMobProperties) {\n\n if (hasCustomPowers) return;\n if (eliteMobTier < 1) return;\n\n int availableDefensivePowers = 0;\n int availableOffensivePowers = 0;\n int availableMiscellaneousPowers = 0;\n int availableMajorPowers = 0;\n\n if (eliteMobTier >= 1) availableDefensivePowers = 1;\n if (eliteMobTier >= 2) availableOffensivePowers = 1;\n if (eliteMobTier >= 3) availableMiscellaneousPowers = 1;\n if (eliteMobTier >= 4) availableMajorPowers = 1;\n if (eliteMobTier >= 5) availableDefensivePowers = 2;\n if (eliteMobTier >= 6) availableOffensivePowers = 2;\n if (eliteMobTier >= 7) availableMiscellaneousPowers = 2;\n if (eliteMobTier >= 8) availableMajorPowers = 2;\n\n //apply defensive powers\n applyPowers((HashSet<ElitePower>) eliteMobProperties.getValidDefensivePowers().clone(), availableDefensivePowers);\n\n //apply offensive powers\n applyPowers((HashSet<ElitePower>) eliteMobProperties.getValidOffensivePowers().clone(), availableOffensivePowers);\n\n //apply miscellaneous powers\n applyPowers((HashSet<ElitePower>) eliteMobProperties.getValidMiscellaneousPowers().clone(), availableMiscellaneousPowers);\n\n //apply major powers\n applyPowers((HashSet<ElitePower>) eliteMobProperties.getValidMajorPowers().clone(), availableMajorPowers);\n\n MinorPowerPowerStance minorPowerStanceMath = new MinorPowerPowerStance(this);\n MajorPowerPowerStance majorPowerPowerStance = new MajorPowerPowerStance(this);\n\n }", "private boolean isSelectedArmyForceBigEnough() {\n return selectedArmyForce.getTotalPower() >= selectedTerritoryByPlayer.getArmyThreshold();\n }", "public void timePasses() {\r\n\t\tfor(Meter a: appMeters){\r\n\t\t\t//incremnts electric use each timepPasses as the fridge is always on\r\n\t\t\tif (a.getType().equals(\"Electric\")){\r\n\t\t\t\ta.incrementConsumed();\r\n\t\t}\r\n\t}\r\n\t}", "public boolean checkIfPlayerHoldsExplosive () { return noOfExplosives > 0; }", "public void setSkillEnable(int healthPointMax){\n if(healthPointMax >= 200000){\n if(skill1.getEnable() == false){\n setSkillPending(0);\n skill1.setEnable(true);\n skill1.setCanUse(true);\n }\n if(skill2.getEnable() == false){\n setSkillPending(1);\n skill2.setEnable(true);\n skill2.setCanUse(true);\n }\n if(skill3.getEnable() == false){\n setSkillPending(2);\n skill3.setEnable(true);\n skill3.setCanUse(true);\n }\n if(skill4.getEnable() == false){\n setSkillPending(3);\n skill4.setEnable(true);\n skill4.setCanUse(true);\n }\n }\n else if(healthPointMax >= 50000){\n if(skill1.getEnable() == false){\n setSkillPending(0);\n skill1.setEnable(true);\n skill1.setCanUse(true);\n }\n if(skill2.getEnable() == false){\n setSkillPending(1);\n skill2.setEnable(true);\n skill2.setCanUse(true);\n }\n if(skill3.getEnable() == false){\n setSkillPending(2);\n skill3.setEnable(true);\n skill3.setCanUse(true);\n }\n }\n else if(healthPointMax >= 10000){\n if(skill1.getEnable() == false){\n setSkillPending(0);\n skill1.setEnable(true);\n skill1.setCanUse(true);\n }\n if(skill2.getEnable() == false){\n setSkillPending(1);\n skill2.setEnable(true);\n skill2.setCanUse(true);\n }\n }\n else if(healthPointMax >= 500){\n if(skill1.getEnable() == false){\n setSkillPending(0);\n skill1.setEnable(true);\n skill1.setCanUse(true);\n }\n }\n }", "public void addAmmo (double amount) {\n\t\t\n\t\tcurrentAmmo = Math.min(maxAmmo, currentAmmo + amount);\n\t}", "public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }", "public void specialize(){\n\tdefense *= .6;\n\tattRating *= 1.4;\n\tif ( attRating > 2.0){\n\t attRating = 2.0;\n\t}\n }", "private boolean checkGreedyIronCurtain() {\r\n return (myself.health < 30 || enTotal.get(0) >= 8 || opponent.isIronCurtainActive || this.myTotal.get(0) < this.enTotal.get(0));\r\n }", "private static boolean checkIfNeedMore(int[] costToPayToCheck){\n boolean result = false;\n List<PowerUpLM> copyOfPowerUpLMList = copyOf(tmpAmmoInPowerUp);\n\n if(costToPayToCheck[GeneralInfo.RED_ROOM_ID] > 0){\n result = true;\n }\n else{\n tmpAmmoInAmmoBox[GeneralInfo.RED_ROOM_ID] = 0;\n for(PowerUpLM power: copyOfPowerUpLMList){\n if(power.getGainAmmoColor().equals(AmmoType.RED))\n tmpAmmoInPowerUp.remove(power);\n }\n }\n\n if(costToPayToCheck[GeneralInfo.BLUE_ROOM_ID] > 0){\n result = true;\n }\n else{\n tmpAmmoInAmmoBox[GeneralInfo.BLUE_ROOM_ID] = 0;\n for(PowerUpLM power: copyOfPowerUpLMList){\n if (power.getGainAmmoColor().equals(AmmoType.BLUE))\n tmpAmmoInPowerUp.remove(power);\n }\n }\n\n if(costToPayToCheck[GeneralInfo.YELLOW_ROOM_ID] > 0){\n result = true;\n }\n else{\n tmpAmmoInAmmoBox[GeneralInfo.YELLOW_ROOM_ID] = 0;\n for(PowerUpLM power: copyOfPowerUpLMList){\n if(power.getGainAmmoColor().equals(AmmoType.YELLOW))\n tmpAmmoInPowerUp.remove(power);\n }\n }\n\n return result;\n }", "private boolean canBuy(BuildingType x) {\r\n return gameDetails.buildingsStats.get(x).price <= myself.energy;\r\n }", "private static Loot choosespecialedition() {\r\n final List<Loot> suitableLoot = new ArrayList<Loot>();\r\n // FIND ALL LOOT TYPES\r\n for (final Location loc : i.location) {\r\n if (loc.renting() == null) {\r\n continue;\r\n }\r\n for (final AbstractItem<? extends AbstractItemType> l : loc.lcs().loot) {\r\n if (!(l instanceof Loot)) {\r\n continue;\r\n }\r\n // Temporary, maybe put special edition definition into an xml\r\n // file. -XML\r\n if (l.id().equals(\"LOOT_CEOPHOTOS\") || l.id().equals(\"LOOT_CEOLOVELETTERS\")\r\n || l.id().equals(\"LOOT_CEOTAXPAPERS\") || l.id().equals(\"LOOT_INTHQDISK\")\r\n || l.id().equals(\"LOOT_CORPFILES\") || l.id().equals(\"LOOT_JUDGEFILES\")\r\n || l.id().equals(\"LOOT_RESEARCHFILES\") || l.id().equals(\"LOOT_PRISONFILES\")\r\n || l.id().equals(\"LOOT_CABLENEWSFILES\") || l.id().equals(\"LOOT_AMRADIOFILES\")\r\n || l.id().equals(\"LOOT_SECRETDOCUMENTS\") || l.id().equals(\"LOOT_POLICERECORDS\")) {\r\n continue;\r\n }\r\n suitableLoot.add((Loot) l);\r\n }\r\n }\r\n for (final Squad sq : i.squad) {\r\n for (final AbstractItem<? extends AbstractItemType> l : sq.loot()) {\r\n if (!(l instanceof Loot)) {\r\n continue;\r\n }\r\n // Temporary, maybe put special edition definition into an xml\r\n // file. -XML\r\n if (l.id().equals(\"LOOT_CEOPHOTOS\") || l.id().equals(\"LOOT_CEOLOVELETTERS\")\r\n || l.id().equals(\"LOOT_CEOTAXPAPERS\") || l.id().equals(\"LOOT_INTHQDISK\")\r\n || l.id().equals(\"LOOT_CORPFILES\") || l.id().equals(\"LOOT_JUDGEFILES\")\r\n || l.id().equals(\"LOOT_RESEARCHFILES\") || l.id().equals(\"LOOT_PRISONFILES\")\r\n || l.id().equals(\"LOOT_CABLENEWSFILES\") || l.id().equals(\"LOOT_AMRADIOFILES\")\r\n || l.id().equals(\"LOOT_SECRETDOCUMENTS\") || l.id().equals(\"LOOT_POLICERECORDS\")) {\r\n continue;\r\n }\r\n suitableLoot.add((Loot) l);\r\n }\r\n }\r\n if (suitableLoot.size() == 0) {\r\n return new Loot(\"LOOT_DIRTYSOCK\");\r\n }\r\n // PICK ONE\r\n do {\r\n ui().text(\"Do you want to run a special edition?\").bold().add();\r\n int y = 'a';\r\n for (final Loot l : suitableLoot) {\r\n ui(R.id.gcontrol).button(y++).text(l.toString()).add();\r\n }\r\n ui(R.id.gcontrol).button(10).text(\"Not in this month's Liberal Guardian\").add();\r\n final int c = getch();\r\n if (c == 10) {\r\n return null;\r\n }\r\n if (c >= 'a') {\r\n final Loot rval = suitableLoot.get(c - 'a');\r\n for (final Squad sq : i.squad) {\r\n sq.loot().remove(rval);\r\n }\r\n for (final Location loc : i.location) {\r\n loc.lcs().loot.remove(rval);\r\n }\r\n return rval;\r\n }\r\n } while (true);\r\n }", "public void pay(List<Color> ammoToPay, List<CardPower> powerUp) throws InsufficientAmmoException {\n List <Color> tmp = null;\n List <CardPower> tmpPU = null;\n if(ammoToPay != null && !ammoToPay.isEmpty() && ammoToPay.get(0)!=Color.ANY) {\n tmp = new ArrayList<>(ammoToPay);\n tmpPU = new ArrayList<>();\n if (powerUp != null && !powerUp.isEmpty())\n for (int i = 0; i < powerUp.size(); i++) {\n if (tmp.contains(powerUp.get(i).getColor())) {\n tmp.remove(powerUp.get(i).getColor());\n tmpPU.add(powerUp.get(i));\n }\n }\n if (!ammo.containsAll(tmp)) throw new InsufficientAmmoException();\n else {\n for (Color ammor : tmp) {\n ammo.remove(ammor);\n }\n for (CardPower cp : tmpPU) {\n cardPower.remove(cp);\n }\n }\n }\n else if(!ammoToPay.isEmpty() && ammoToPay.get(0) == Color.ANY && powerUp != null && !powerUp.isEmpty())\n cardPower.remove(powerUp.get(0));\n\n }", "public void activateMushroomEffect(MushroomType mushroomType) {\n if (new ItemStack(mushroomType.getItem()).is(ModTags.ForgeItems.MUSHROOMS_POISONOUS)) {\n this.addEffect(new MobEffectInstance(MobEffects.POISON, 200));\n }\n }", "private int mobLimitPlacer(){\n if (gameWorld == GameWorld.NORMAL) return\n Api.getConfigManager().getWorldMobLimit();\n else return\n Api.getConfigManager().getNetherMobLimit();\n }", "public void awardMedals(){\n ArrayList<Competeable> podium = new ArrayList<>();\n Competeable winningAthletes = event.get(0);\n while( podium.size() < 3){\n for (Competeable competitor : event) {\n if(competitor.getSkillLevel() > winningAthletes.getSkillLevel())\n winningAthletes = competitor;\n }\n podium.add(winningAthletes);\n event.remove(winningAthletes);\n }\n podium.get(0).addMedal(MedalType.GOLD);\n podium.get(1).addMedal(MedalType.SILVER);\n podium.get(2).addMedal(MedalType.BRONZE);\n }", "public boolean nearMaxRescue() {\n double water = this.waterLevel;\n double no = (this.configuration.getMaximalLimitLevel()\n - this.configuration.getMaximalNormalLevel()) / 2;\n if (water > this.configuration.getMaximalLimitLevel()\n || water > this.configuration.getMaximalLimitLevel() - no) {\n return true;\n } else if (water < this.configuration.getMinimalLimitLevel()\n || water < this.configuration.getMinimalLimitLevel() + no) {\n\n return true;\n }\n return false;\n }", "public void checkItem() {\n Entity t = BombermanGame.checkCollisionItem(this.rectangle);\n if (t instanceof SpeedItem) {\n speed ++;\n ((SpeedItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof FlameItem) {\n flame = true;\n ((FlameItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof BombItem) {\n max_bomb ++;\n ((BombItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof Portal) {\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n }", "@Test\n public final void testBiggerThanMin() {\n for (ArrayList<TradeGood> planetsGoods : goods) {\n for (TradeGood good : planetsGoods) {\n assertTrue(good.getPrice() > good.type.mtl);\n }\n }\n }", "@Override\n public boolean isMage() {\n return true;\n }", "public void reduceHealth(int ammo_damage){\n this.health -= ammo_damage;\n }", "private void checkBattleTypes(boolean entityLeft) {\n if (localBattle == null && entityLeft && (localBattle.getSideA().isEmpty() || localBattle.getSideB().isEmpty())) {\n return;\n }\n\n float percentage = 0.0f;\n if (sillyMusicCount == 0 && battleMusicCount == 0) {\n percentage = 0.0f;\n } else if (battleMusicCount == 0) {\n percentage = 100.0f;\n } else {\n percentage = 100.0f * (float) sillyMusicCount / (float) (sillyMusicCount + battleMusicCount);\n }\n\n if (percentage >= (float) getConfig().getSillyMusicThreshold()) {\n if (battleMusic.isPlaying()) {\n if (!battleMusic.isPlayingSilly() && battleMusic.hasSillyMusic()) {\n stopMusic(false);\n playSillyMusic();\n }\n } else if (battleMusic.hasSillyMusic()) {\n playSillyMusic();\n }\n } else {\n if (battleMusic.isPlaying()) {\n if (battleMusic.isPlayingSilly() && battleMusic.hasBattleMusic()) {\n stopMusic(false);\n playBattleMusic();\n }\n } else if (battleMusic.hasBattleMusic()) {\n playBattleMusic();\n }\n }\n }", "@Override\n protected void adjustTypeAttributes() {\n this.getSpecialData().addAttribute(SharedMonsterAttributes.maxHealth, 20.0);\n this.getSpecialData().multAttribute(SharedMonsterAttributes.movementSpeed, 1.2);\n }", "@Test\r\n\tpublic void testDamageInAmpedRange() throws TooManyAttachmentsException \r\n\t{\r\n\t\tWeapon w = new Pistol();\r\n\t\tassertEquals(0, w.getDamage(26));\r\n\t\tw = new Scope(w);\r\n\t\tassertEquals(7, w.getDamage(26));\r\n\t}", "@Override\n protected void dropFewItems(boolean hit, int looting) {\n super.dropFewItems(hit, looting);\n if (hit && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + looting) > 0)) {\n Item drop = null;\n switch (this.rand.nextInt(5)) {\n case 0:\n drop = Items.gunpowder;\n break;\n case 1:\n drop = Items.sugar;\n break;\n case 2:\n drop = Items.spider_eye;\n break;\n case 3:\n drop = Items.fermented_spider_eye;\n break;\n case 4:\n drop = Items.speckled_melon;\n break;\n }\n if (drop != null) {\n this.dropItem(drop, 1);\n }\n }\n }", "@Override\r\n\tprotected boolean canDropLoot() {\r\n\t\treturn false;\r\n\t}", "private boolean canIBuyLevels(int levels){\n return (this.level + levels < 10);\n }", "@Test\n void maxQuality() {\n Item[] items = new Item[]{\n new Item(\"Aged Brie\", 10, 50),\n new Item(\"Backstage passes to a TAFKAL80ETC concert\", 5, 49),\n new Item(\"Aged Brie\", 10, 40)\n };\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n for (Item item : app.items) {\n assertTrue(50 >= item.quality, \"Quality shouldn't overtake its max capacity\");\n }\n }", "public boolean isFullySupplied()\n {\n boolean isFull = !model.needsFuel() || (model.maxFuel == fuel);\n isFull &= (model.maxAmmo == ammo);\n return isFull;\n }", "public boolean areAllAtLeast(int level) {\r\n for (int i = 0; i < SKILL_NAME.length; i++) {\r\n if (!ENABLED_SKILLS[i]) {\r\n continue;\r\n }\r\n // TODO CONSTRUCTION\r\n if (Objects.equals(SKILL_NAME[i], \"Construction\")) {\r\n continue;\r\n }\r\n if (getStaticLevel(i) < level) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public void setMaxHealth() {\n\t\tthis.maxHealth *= level / 10;\n\t}", "public boolean isSuperGiant(){\r\n\t\tboolean flag = false;\r\n\t\tif ((getMass() >100) && (getSize()>100)){\r\n\t\t\tflag = true;\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "public void fill() throws NoAmmoException {\n if (this.ammoStorage <= 0) {\n throw new NoAmmoException();\n } else {\n int ammoNeeded = overallAmmoNeeded();\n\n if (this.ammoStorage < ammoNeeded) {\n // fill priority jets\n for (Jet jet : this.aircrafts) {\n if (jet.isPriority() && jet.needsAmmo()) {\n this.ammoStorage = jet.refillAmmo(this.ammoStorage);\n }\n }\n\n // fill non-priority jets\n // if still has ammo\n if (this.ammoStorage > 0) {\n for (Jet jet : this.aircrafts) {\n if (jet.needsAmmo()) {\n this.ammoStorage = jet.refillAmmo(this.ammoStorage);\n }\n }\n }\n } else {\n for (Jet jet : this.aircrafts) {\n if (jet.needsAmmo()) {\n this.ammoStorage = jet.refillAmmo(this.ammoStorage);\n }\n }\n }\n }\n }", "private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "public boolean canSpawnMore() {\n for(int e: enemiesLeft) {\n if(e > 0) {\n return true;\n }\n }\n\n return false;\n }", "protected boolean IsHighExplosive()\r\n {\r\n \t// Wrapper function to make code a little cleaner.\r\n // isInvulnerable() is wrongly named and instead represents the specific\r\n // skull type the wither has launched\r\n \t\r\n \treturn isInvulnerable();\r\n }", "boolean bulletGrow(Tester t) {\n return t.checkExpect(this.bullet2.grow(), 4) && t.checkExpect(this.bullet4.grow(), 8);\n }", "public boolean immobilises(Pokemon poke) {\n BattleField field = poke.getField();\n if (field.getRandom().nextDouble() <= 0.25) {\n field.showMessage(poke.getName() + \" is paralysed! It can't move!\");\n return true;\n }\n return false;\n }", "private void setHealth() {\n eliteMob.setHealth(maxHealth = (maxHealth > 2000) ? 2000 : maxHealth);\n }", "@Test\n public final void testSmallerThanMax() {\n for (ArrayList<TradeGood> planetsGoods : goods) {\n for (TradeGood good : planetsGoods) {\n assertTrue(good.getPrice() < good.type.mhl);\n }\n }\n }", "public boolean addAmmo(String itemname){\n\t\tif(item0.name.equals(itemname))\n\t\t\tif(item0.changeAmmo(1))//So that if we have two of the same item, it will be able to add ammo to both\n\t\t\t\treturn true;\n\t\tif(item1.name.equals(itemname))\n\t\t\treturn item1.changeAmmo(1);\n\t\treturn false;\n\t}", "public String getMonsterDropsLoot() {\r\n String res;\r\n Random gen = new Random();\r\n if (gen.nextInt(100) > 75) {\r\n int tmp = gen.nextInt(items.size());\r\n player.addToInventory(items.get(tmp));\r\n res = \"You search the corpse and loot a \" + items.get(tmp).getName() + System.lineSeparator();\r\n } else {\r\n res = \"You find nothing of value on the corpse.\" + System.lineSeparator();\r\n }\r\n return res;\r\n }", "public boolean getHasSpecialLoot() {\n return this.hasNormalLoot;\n }", "private boolean checkGreedyWinRate() {\r\n return myTotal.get(0) > enTotal.get(0)+2 && (myself.health > 50 || myself.health > opponent.health);\r\n }", "@Override\n public boolean CanArmor() {\n return false;\n }", "public void lastChanceGas()\n {\n System.out.print( \"Tank capacity: \" );\n int capacity = scan.nextInt();\n System.out.print( \"Gage reading: \" );\n int gage = scan.nextInt();\n System.out.print( \"Miles per gallon: \" );\n int mpg = scan.nextInt();\n double gasLeft = capacity * ( gage * 0.01 );\n double milesDriveable = gasLeft * mpg;\n if ( milesDriveable >= 200 )\n {\n System.out.println( \"Safe to Proceed!\" );\n }\n else\n {\n System.out.println( \"Get Gas!\" );\n }\n\n }", "public static boolean isMaxed(Player player) {\n\t\tif (player.getSkills().getLevelForXp(Skills.ATTACK) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.STRENGTH) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.DEFENCE) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.RANGE) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.PRAYER) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.MAGIC) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.RUNECRAFTING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.HITPOINTS) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.AGILITY) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.HERBLORE) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.THIEVING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.CRAFTING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FLETCHING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.SLAYER) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.HUNTER) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.MINING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.SMITHING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FISHING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.COOKING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FIREMAKING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.WOODCUTTING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FARMING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.CONSTRUCTION) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.SUMMONING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.DUNGEONEERING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.DIVINATION) >= 99)\n\t\treturn true;\n\treturn false;\n\t}", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "public void checkPrize()\n {\n for(PrizeMulti prize : prizes.getPrizes())\n {\n if(prize.isActive())\n {\n if (((locX - prize.getX()) * (locX - prize.getX()) + (locY - prize.getY()) * (locY - prize.getY())) <= 35 * 35) {\n if (prizeOwn == null)\n {\n status.setUsePrize(true);\n prize.deActive();\n prizeOwn = prize;\n if (prize.getType().equals(\"Health\")) {\n stamina += (stamina / 10);\n }\n if (prize.getType().equals(\"Power2\")) {\n canonPower *= 2;\n }\n if (prize.getType().equals(\"Power3\")) {\n canonPower *= 3;\n }\n if (prize.getType ().equals (\"Laser\")) {\n setBulletType (\"Laser\");\n }\n\n if (prize.getType ().equals (\"Protect\")) {\n setProtection (true);\n }\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Thread.sleep(10000);\n prizeOwn = null;\n if (prize.getType().equals(\"Power2\")) {\n canonPower /= 2;\n }\n if (prize.getType().equals(\"Power3\")) {\n canonPower /= 3;\n }\n if (prize.getType ().equals (\"Laser\")) {\n setBulletType (\"Normal\");\n }\n Thread.sleep (5000);\n if (prize.getType ().equals (\"Protect\")) {\n setProtection (false);\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }).start();\n }\n }\n }\n }\n }", "int getMinigameDefenseChancesLeft();", "private void generateLoot( Integer lootLevel ){\n }", "public boolean canProtectPieces() {\r\n\t\treturn (cityCards.stream().anyMatch(c -> (c.isSmallGods() && !c.isDisabled())\r\n\t\t\t\t&& money >= PROTECTION_COST)); \r\n\t}", "private boolean canTakeBandanaFrom(Unit other) {\n return getCalories() >= (2 * other.getCalories());\n }", "public void updateAmmo(){\n if(shots >= 9999)\n shots = 9999;\n ammo.setText(\"x\" + String.format(\"%04d\", shots));\n }", "@Override\n public boolean isStealthOn() {\n // Try to find a Mek Stealth system.\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_STEALTH)) {\n if (mEquip.curMode().equals(\"On\")) {\n // Return true if the mode is \"On\"\n return true;\n }\n }\n }\n // No Mek Stealth or system inactive. Return false.\n return false;\n }", "public boolean hasBust() {\n\t\treturn this.hand.countValue().first() > 21;\n\t}", "public boolean mustUsePowerUpsToPay(List<Color> price) {\n if (!price.isEmpty() && price != null) {\n if (ammo != null && !ammo.isEmpty()) {\n if (price.get(0) == Color.ANY)\n return false;\n else {\n for (int i = 0; i < ammo.size(); i++)\n price.remove(ammo.get(i));\n if (price.isEmpty())\n return false;\n else\n return true;\n }\n }\n else\n return true;\n }\n return false;\n }", "public static void main(String[] args) {\n int currentLimit = 45 ; // try 45 , 65 ,90\n\n if (currentLimit >70 ) {\n System.out.println(\" you are speeding more than 70 --POINT TAKEN !! \");\n } else if (currentLimit > 60 ) {\n //System.out.println(\"your speed is less thank 70 but more than 60 \");\n System.out.println(\"your are speeding more than 60 and less than 70 -- WARNING TAKEN\");\n } else {\n System.out.println(\"KEEP DRIVING\");\n }\n\n\n }", "protected void testLessThanMaxLots () throws OutsideMaxLotsException\n {\n if (lots.size() >= MAX_LOTS)\n throw new OutsideMaxLotsException();\n }", "@Override\n public int maxHealth() {\n return 25;\n }", "public void setTension(double power){\n int T_limit = 0;\n int L_limit = 0;\n if(tenPot.pidGet() < tenPotMAX && !Bottom_Limit_Switch.get()){\n L_limit = -1;\n }\n if(tenPot.pidGet() > tenPotMIN && !Top_Limit_Switch.get()){\n T_limit = 1;\n }\n if(power <= T_limit && power >= L_limit){\n motor.set(power);\n }else if(power > T_limit){\n motor.set(T_limit);\n }else if(power < L_limit){\n motor.set(L_limit);\n }\n }", "@Override\n\tpublic float desireability() {\n\t\tAgentSpace agentSpace = Blackboard.inst().getSpace(AgentSpace.class, _obj.getName());\n\t\tMap<String,FoodEntry> map = agentSpace.getScentMemories().getFirst();\n\t\tif (map == null || map.size() == 0) { \n\t\t\t// we don't smell anything\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tAgentSpace space = Blackboard.inst().getSpace(AgentSpace.class, _obj.getName());\n\t\tBoundedEntry bounded = space.getBounded(Variable.energy);\n\t\tfloat pct = bounded.getValue() / bounded.getMax();\n\t\treturn 1 - (pct*pct);\n\t}", "public void checkForNewPowers () {\n Power[] powers = Power.values(); \n\t\tfor (Power power : powers) {\n\t\t SuperPower superPower = power.getSuperPower();\n\t\t superPower.awardIfQualified(this);\n\t\t}\n }", "public boolean canBecombo(){\n \treturn price <5;\n }", "public void specialize()\n {\n\tdef -= 200;\n\tdmg += 0.5;\n\tcounter += 1;\n }", "public void move1(Pokemon enemy){\n int randCrit = (int)(22 * Math.random()+1);\n boolean crit = false;\n boolean superEffective = false;\n boolean reduced = false;\n boolean moveHit = true;\n\n //CHANGE ATTACK TO FALSE IF MOVE DOES NO DAMAGE<<<<<<<<<<<<<\n boolean attack = true;\n //CHANGE TYPE TO TYPE OF MOVE POWER AND ACCURACY<<<<<<<<<<<<<\n String type = \"Dark\";\n int power = 70;\n int accuracy = 100;\n\n //DO NOT CHANGE BELOW THIS\n int damage = ((CONSTANT * power * ( getAtt() / enemy.getDef() )) /50);\n if(randCrit == CONSTANT){\n damage = damage * 2;\n crit = true;\n }\n if(checkSE(type,enemy.getType())){\n damage = damage * 2;\n superEffective = true;\n }\n if(checkNVE(type, enemy.getType())){\n damage = damage / 2;\n reduced = true;\n }\n if(attack && hit(accuracy)){\n enemy.lowerHp(damage);\n }\n else{\n if(hit(accuracy)){\n //DO STATUS EFFECT STUFF HERE (ill figure out later)\n }\n\n }\n lowerM1PP();\n }", "@Override\n public boolean check(RealPlayer realPlayer) {\n for (Map.Entry<Resource, Integer> entry : productionPowerInput.entrySet()) {\n if (entry.getValue() > realPlayer.getPersonalBoard().getSpecificResourceCount(entry.getKey().getResourceType()))\n return false;\n }\n return true;\n }", "public boolean isBust() {\n\t\tif(handValue() > 21) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean use(ActivePokemon p, Battle b) {\n boolean maxPotion = new MaxPotion().use(p, b);\n boolean fullHeal = new FullHeal().use(p, b);\n return maxPotion || fullHeal;\n }", "public int checkNoOfExplosivesPlayerHolds () { return noOfExplosives; }", "public boolean isAmmoCard() {\n return ammoCard;\n }", "private void setMaxHealth(EliteMobProperties eliteMobProperties) {\n double defaultMaxHealth = eliteMobProperties.getDefaultMaxHealth();\n this.maxHealth = (eliteMobLevel * CombatSystem.PER_LEVEL_POWER_INCREASE * defaultMaxHealth + defaultMaxHealth);\n eliteMob.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(maxHealth);\n }", "public void move3(Pokemon enemy){\n boolean crit = false;\n boolean superEffective = false;\n boolean reduced = false;\n boolean moveHit = true;\n int randCrit = (int)(22 * Math.random()+1);\n\n //CHANGE ATTACK TO FALSE IF MOVE DOES NO DAMAGE<<<<<<<<<<<<<\n boolean attack = false;\n //CHANGE TYPE TO TYPE OF MOVE POWER AND ACCURACY<<<<<<<<<<<<<\n String type = \"Normal\";\n int power = 0;\n int accuracy = 100;\n\n //DO NOT CHANGE BELOW THIS\n int damage = ((CONSTANT * power * ( getAtt() / enemy.getDef() )) /50);\n if(randCrit == CONSTANT){\n damage = damage * 2;\n crit = true;\n }\n if(checkSE(type,enemy.getType())){\n damage = damage * 2;\n superEffective = true;\n }\n if(checkNVE(type, enemy.getType())){\n damage = damage / 2;\n reduced = true;\n }\n if(attack && hit(accuracy)){\n enemy.lowerHp(damage);\n }\n else{\n if(hit(accuracy)){\n //DO STATUS EFFECT STUFF HERE (ill figure out later)\n }\n }\n lowerM3PP();\n }", "private void checkMineralCollisions() {\n\t\t//check collisions with silver\n\t\tint len = silverBlocks.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tSilver silver = silverBlocks.get(i);\n\t\t\ttry {\n\t\t\t\tif(OverlapTester.overlapRectangles(silver.bounds, player.bounds)) {\n\t\t\t\t\tsilverComplete ++;\n\t\t\t\t\tsilverBlocks.remove(i);\n\t\t\t\t\tlen = silverBlocks.size();\n\t\t\t\t\tcash += 10;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {}\n\t\t}\n\t\t\n\t\t//check collisions with gold\n\t\tlen = goldBlocks.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tGold gold = goldBlocks.get(i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(OverlapTester.overlapRectangles(gold.bounds, player.bounds)) {\n\t\t\t\t\tgoldComplete ++;\n\t\t\t\t\tgoldBlocks.remove(i);\n\t\t\t\t\tlen = goldBlocks.size();\n\t\t\t\t\tcash += 50;\n\t\t\t\t} \n\t\t\t} catch (Exception e) {}\n\t\t}\n\t\t\n\t\t//check collisions with diamonds\n\t\tlen = diamondBlocks.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tDiamond diamond = diamondBlocks.get(i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(OverlapTester.overlapRectangles(diamond.bounds, player.bounds)) {\n\t\t\t\t\tdiamondComplete ++;\n\t\t\t\t\tdiamondBlocks.remove(i);\n\t\t\t\t\tlen = diamondBlocks.size();\n\t\t\t\t\tcash += 150;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {}\n\t\t}\n\t}", "boolean checkFireEnergy(AbstractFirePokemon pokemon);", "public void specialEffect() {\n if (getDefense() > 0) {\n setDefense(0);\n setCurrentHealth(currentHealth + 50);\n }\n\n }", "private void multi(EntityManager manager) {\r\n if (manager.getAmmo(4) == 0 && !testMode) {\r\n changeGuns(0, manager);\r\n manager.outOfAmmo();\r\n return;\r\n }\r\n\r\n float newRotationR = rotationZ - 90;\r\n float newRotationL = rotationZ + 90;\r\n float newRotationD = rotationZ + 180;\r\n\r\n float leftX = (float) Math.sin(Math.toRadians(newRotationL));\r\n float leftY = (float) -Math.cos(Math.toRadians(newRotationL));\r\n\r\n float rightX = (float) Math.sin(Math.toRadians(newRotationR));\r\n float rightY = (float) -Math.cos(Math.toRadians(newRotationR));\r\n\r\n float downX = (float) Math.sin(Math.toRadians(newRotationD));\r\n float downY = (float) -Math.cos(Math.toRadians(newRotationD));\r\n\r\n Shot leftshot = new Shot(shotTexture, getX() + forwardX, getY() + forwardY, leftX * 100, leftY * 100, 150, 1.5f, 0, 1, 0, true, 200, false);\r\n\r\n Shot rightshot = new Shot(shotTexture, getX() + forwardX, getY() + forwardY, rightX * 100, rightY * 100, 150, 1.5f, 0, 0, 1, true, 200, false);\r\n\r\n Shot upshot = new Shot(shotTexture, getX() + forwardX, getY() + forwardY, forwardX * 100, forwardY * 100, 150, 1.5f, 1, 0, 0, true, 200, false);\r\n\r\n Shot downshot = new Shot(shotTexture, getX() + forwardX, getY() + forwardY, downX * 100, downY * 100, 150, 1.5f, 1, 1, 0.82f, true, 200, false);\r\n\r\n manager.addEntity(leftshot);\r\n manager.addEntity(rightshot);\r\n manager.addEntity(upshot);\r\n manager.addEntity(downshot);\r\n if (!testMode) manager.updateAmmo(4, -1, false);\r\n manager.shotFired(4);\r\n }", "public void checkLevel(){\n if(score<50){\n level = 1;\n asteroidsMaxNumber = 5;\n }\n if(score>50 && level == 1){\n level = 2;\n asteroidsMaxNumber = 7;\n }\n if(score>100 && level == 2){\n level = 3;\n asteroidsMaxNumber = 10;\n }\n if(score>200 && level == 3){\n level = 4;\n asteroidsMaxNumber = 13;\n }\n if(score>350 && level == 4){\n level = 5;\n asteroidsMaxNumber = 15;\n }\n }", "protected boolean checkLoad() {\n\t\treturn size <= maxThreshold;\n\t\t//return (size >= minThreshold || size <= minCapacity) && size <= maxThreshold;\n\t}", "public boolean canBecombo(){\n \treturn super.getPrice() <4;\n }", "public boolean enoughSpaceToBuy(Player p, int numGoods) {\n // check size of cargoArr\n return numGoods <= p.getShip().numOpenSlots();\n }", "public void causeFoodExhaustion(float debug1) {\n/* 1797 */ if (this.abilities.invulnerable) {\n/* */ return;\n/* */ }\n/* */ \n/* 1801 */ if (!this.level.isClientSide) {\n/* 1802 */ this.foodData.addExhaustion(debug1);\n/* */ }\n/* */ }", "public List<CardPower> pickUpAmmo()throws NoCardAmmoAvailableException {\n List<CardPower> powerups = new ArrayList<>();\n if (position.getCardAmmo() == null){\n throw new NoCardAmmoAvailableException();\n }\n if(position.getCardAmmo()!=null){\n List<Color> ammos = position.getCardAmmo().getAmmo();\n ammos = controlGrabAmmo(ammos);\n ammo.addAll(ammos);\n if(position.getCardAmmo().getCardPower() > 0){\n powerups = new ArrayList<>();\n for(int i=0; i<position.getCardAmmo().getCardPower() && cardPower.size() + i + 1 <= 3; i++)\n powerups.add(game.drawPowerUp());\n cardPower.addAll(powerups);\n }\n game.notifyGrabCardAmmo(this,ammos);\n position.setCardAmmo(null);\n }\n return powerups;\n }", "public boolean hasArmedMASCAndSuperCharger() {\n boolean hasMASC = false;\n boolean hasSuperCharger = false;\n for (Mounted m : getEquipment()) {\n if (!m.isDestroyed() && !m.isBreached() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_MASC) && m.curMode().equals(\"Armed\") && m.getType().hasSubType(MiscType.S_SUPERCHARGER)) {\n hasSuperCharger = true;\n }\n if (!m.isDestroyed() && !m.isBreached() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_MASC) && m.curMode().equals(\"Armed\") && !m.getType().hasSubType(MiscType.S_SUPERCHARGER)) {\n hasMASC = true;\n }\n }\n return hasMASC && hasSuperCharger;\n }", "boolean monkeyBusiness(Monkey[] monkeys) {\n boolean allSmiles;\n int smiles = 0;\n for(Monkey monkey: monkeys) {\n if(monkey.smile) {\n smiles++;\n }\n }\n allSmiles = smiles >= (double) monkeys.length / 2;\n return allSmiles;\n }", "public void clear() {\n for (int i = 0; i < if_you_items.length; i++) {\n if_you_items[i].setEnabled(true);\n }\n for (int i = 0; i < then_we_items.length; i++) {\n then_we_items[i].setEnabled(true);\n }\n non_promised_ministries.clear();\n non_promised_ministries.addAll(all_ministries);\n // if not at war, can't ask/offer peace\n if (game.getDiplomacy().getDiplomaticState(game.getTurn(), faction) != C.DS_WAR) {\n if_you_items[IfYouWill.PEACE.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.PEACE.ordinal()].setEnabled(false);\n }\n if (faction > C.HOUSE5) { // non-house\n non_promised_ministries.clear();\n if_you_items[IfYouWill.TECH.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.TECH.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n return;\n }\n // search for promised votes and ministries in pending contracts of sender\n for (Contract con : game.getDiplomacy().getSentContracts()) {\n for (Term term : con.getTerms()) {\n if (term.getDonor() == game.getTurn()) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n if (term.getDonor() == faction) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n }\n }\n // search for promised votes and ministries for sender and for receiver\n // those that are made with sender\n if (game.getRegency().getVotes()[game.getTurn()][Regency.CANDIDATE_IDX] > -1\n || game.getRegency().getVotes()[faction][Regency.CANDIDATE_IDX] == game.getTurn()) {\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n }\n int[] promises = game.getDiplomacy().getMinistryPromises(game.getTurn());\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] > -1) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n promises = game.getDiplomacy().getMinistryPromises(faction);\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] == game.getTurn()) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n if (non_promised_ministries.isEmpty()) {\n then_we_items[ThenWeWill.MINISTRY.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.MINISTRY.ordinal()].setEnabled(false);\n }\n }", "public void takeDamage(double num) {\r\n \r\n int damage = (int)Math.round(num);\r\n this.health -= damage;\r\n this.state=this.color+16;\r\n if (damage <= 5) {\r\n if (this.playerNum == 1)\r\n this.positionX -= 40;\r\n else \r\n this.positionX += 40;\r\n }\r\n else if (this.playerNum == 1)\r\n this.positionX -= damage * 6;\r\n else\r\n this.positionX += damage * 6;\r\n \r\n }", "private void greedyEnemySpawner(float enemyCap, IEnemyService spawner, World world, GameData gameData) {\r\n while (enemyCap >= MEDIUM_ENEMY_COST) {\r\n\r\n if (enemyCap >= MEDIUM_ENEMY_COST + BIG_ENEMY_COST) {\r\n spawnBigAndMediumEnemy(spawner, world, gameData);\r\n enemyCap -= MEDIUM_ENEMY_COST + BIG_ENEMY_COST;\r\n\r\n } else if (enemyCap >= BIG_ENEMY_COST) {\r\n spawnBigEnemy(spawner, world, gameData);\r\n enemyCap -= BIG_ENEMY_COST;\r\n\r\n } else {\r\n spawnMediumEnemy(spawner, world, gameData);\r\n enemyCap -= MEDIUM_ENEMY_COST;\r\n }\r\n }\r\n }", "private void calculateCrit(Monster target, MonsterParts part, Weapon weapon, double motionValue) throws InvalidPartException {\n \n if (target.isWeakness(part)) {\n if (Math.random() < (Math.abs((weapon.getAffinity() + weaknessExploit)/100.0)) && (weapon.getAffinity() + weaknessExploit) < 0) {\n critDamage -= weapon.getAttack()/weapon.getInflation() * 0.25 * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n }\n if (Math.random() < ((weapon.getAffinity() + weaknessExploit)/100.0) && (weapon.getAffinity() + weaknessExploit) > 0) {\n critDamage += weapon.getAttack()/weapon.getInflation() * (0.25 + critBoost/100.0) * weapon.getRawSharpness() *target.getPartMultiplierRaw(part, weapon) * motionValue;\n if (criticalElement) {\n elementalCritDamage += weapon.getElementStatusDmg()/10 * 0.25 * weapon.getElementalSharpness() * target.getPartMultiplierElemental(part, weapon);\n }\n }\n } else {\n if (Math.random() < (Math.abs(weapon.getAffinity()/100.0)) && weapon.getAffinity() < 0) {\n critDamage -= weapon.getAttack()/weapon.getInflation() * 0.25 * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n }\n if (Math.random() < (weapon.getAffinity()/100.0) && weapon.getAffinity() > 0) {\n critDamage += weapon.getAttack()/weapon.getInflation() * (0.25 + critBoost/100.0) * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n if (criticalElement) {\n elementalCritDamage += weapon.getElementStatusDmg()/10 * 0.25 * weapon.getElementalSharpness() * target.getPartMultiplierElemental(part, weapon);\n }\n }\n }\n\n }", "@SuppressWarnings(\"deprecated\")\n protected void durability(Player p, EntityDamageEvent event, Boolean armorDamage) {\n this.p = p;\n //foreach players armor\n //if any armor is below N durability, output warning message\n int x = 0;\n\n for (ItemStack armorItem : p.getInventory().getArmorContents()) {\n if (armorItem == null) continue;\n if (armorItem.getDurability() == 0) continue; //this armor piece took no damage\n if (armorItem.getDurability() > 0\n && f.getInt(\"minimum-durability\") >= armorItem.getType().getMaxDurability() - armorItem.getDurability()) {\n String s = String.format(ChatColor.RED + \"[WARNING]: %s has too little duration left!\\nDuration left: %d\\n\", WordUtils.capitalize(armorItem.getType().toString().toLowerCase().replace(\"_\", \" \")), calcLeftDurability(armorItem));\n p.sendMessage(s);\n }\n }\n }", "private boolean checkGreedyDefense() {\r\n return enTotal.get(2)+1 < myTotal.get(2) && enTotal.get(0)+1 < myTotal.get(0);\r\n }" ]
[ "0.63473946", "0.6289316", "0.6254407", "0.6063038", "0.5991585", "0.59613097", "0.58447206", "0.5833726", "0.5739304", "0.57295716", "0.5718021", "0.5668171", "0.5643365", "0.56398064", "0.56376815", "0.55845046", "0.5567403", "0.5558565", "0.5525118", "0.5497878", "0.5462221", "0.5455574", "0.5416992", "0.5408175", "0.54054874", "0.53984594", "0.5392743", "0.53906184", "0.5379793", "0.53778094", "0.53747153", "0.53713447", "0.5368495", "0.5353714", "0.53523594", "0.5340612", "0.53404015", "0.5338926", "0.5316399", "0.52766526", "0.5275692", "0.52688915", "0.52662635", "0.52498895", "0.52433944", "0.52424157", "0.5242272", "0.52398664", "0.52365273", "0.5232024", "0.5226006", "0.52226424", "0.5218768", "0.5215015", "0.52107716", "0.52092266", "0.5203055", "0.5202242", "0.5199115", "0.51980454", "0.5197564", "0.5195035", "0.5190491", "0.51903623", "0.51833916", "0.51829314", "0.5180743", "0.5167018", "0.5163036", "0.51532656", "0.5151145", "0.5138972", "0.5127797", "0.5126806", "0.51265925", "0.5125753", "0.5120802", "0.51166296", "0.5111114", "0.510823", "0.5104037", "0.509166", "0.5090148", "0.50894934", "0.508636", "0.50861365", "0.50847024", "0.50812936", "0.5077688", "0.50765455", "0.5074787", "0.5072765", "0.50684226", "0.5067348", "0.5066471", "0.5065571", "0.5064165", "0.5063814", "0.50624746", "0.5061158", "0.50599384" ]
0.0
-1
return the cost of the item
public double GetCost() { if( LotSize != CurLotSize ) { double CostPerShot = Cost / (double) LotSize; return CommonTools.RoundFractionalTons( CostPerShot * (double) CurLotSize ); } return Cost; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getCost();", "double getCost();", "@Pure\n\tdouble getCost();", "int getCost();", "int getCost();", "int getCost();", "@Override\r\n\tpublic double cost() {\n\t\treturn this.cost;\r\n\t}", "@Override\n\tpublic double cost() {\n\t\tdouble price = good.cost();\n\t\treturn price+price/2;\n\t}", "public double getCost() {\t\t \n\t\treturn cost;\n\t}", "public int getCost(){\r\n\t\treturn this.cost;\r\n\t}", "@Override\r\n public int getCost() {\r\n return cost;\r\n }", "public double getCost() {\n\t\t\n\t\tdouble cost = 0;\n\t\t\n\t\tif (Objects.equals(Size, \"small\"))\n\t\t\tcost = 7.00;\n\t\telse if (Objects.equals(Size, \"medium\"))\n\t\t\tcost = 9.00;\n\t\telse if (Objects.equals(Size, \"large\"))\n\t\t\tcost = 11.00;\n\t\t\n\t\tcost += (Cheese - 1)*1.50;\n\t\tcost += Ham*1.50;\n\t\tcost += Pepperoni*1.50;\n\t\t\n\t\treturn cost;\t\t\n\t}", "public abstract double getCost();", "public double getCost()\r\n\t{\treturn this.cost;\t}", "public double getCost() {\r\n\t \treturn(cost);\r\n\t}", "public double getCost() {\r\n return cost;\r\n }", "public int getCost() {\n\t\treturn (int) Math.round(weight*price_per_pound);\n\t\t\n\t}", "public double cost()\n\t{\n\t\treturn (price * weight);\n\t}", "@Override\n public double getCost() {\n return cost;\n }", "public double getCost() {\n return quantity*ppu;\n\n }", "public double getCost() {\r\n\t\treturn cost;\r\n\t}", "@Override\n public double cost()\n {\n return this.price * this.number;\n }", "public int getCost() {\n \t\treturn cost;\n \t}", "@Override\n\tpublic double getCost() {\n\t\treturn price * weight; // cost = price of the candy * weight of candies\n\t}", "public int getCost()\n {\n return cost;\n }", "public double getCost() {\n return cost;\n }", "public double getCost() {\n return cost;\n }", "public int getCost() {\n return cost;\n }", "public int getCost() {\n return cost;\n }", "public double cost()\n\t{\n\t\treturn _dblCost;\n\t}", "public int getCost() {\n return cost;\n }", "public double cost() {\n\t\t\n\t\treturn 150.00;\n\t}", "public double getCost() {\n\t\treturn this.cost;\n\t}", "public double getCost() {\n\t\treturn this.cost;\n\t}", "public double getCost() {\n\t\treturn cost;\n\t}", "public float totalCost() {\n\t\tttCost = 0;\n\t\tfor (int i = 0; i < itemsOrdered.size(); i++) {\n\t\t\tttCost += itemsOrdered.get(i).getCost();\n\t\t}\n\t\treturn ttCost;\n\t}", "public Number getCost()\r\n {\r\n return (m_cost);\r\n }", "public double getCost() {\n\n\t\treturn cost;\n\t}", "public abstract int getCost();", "public abstract int getCost();", "public abstract int getCost();", "double getTotalCost();", "public Integer getCost() {\r\n\t\treturn cost;\r\n\t}", "@Override\n public int getCost() {\n return iceCreamPrice + topPrice;\n }", "public double getcost() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn room.getcost() + cost;\r\n\t}", "public Integer getCost() {\n return cost;\n }", "public int getCost() {\n\t\treturn cost;\n\t}", "public int getCost(){\n return this.cost;\n }", "public double getCost(){\n return cost;\n }", "public float getCost() {\r\n\t\treturn this.cost.floatValue();\r\n\t}", "@Override\n public int getCost() {\n\n\n //return cost converted to int\n return (int) cost;\n }", "public double getCost() {\n\t\treturn 1.25;\n\t}", "public double getCost()\n\t{\n\t\treturn 0.9;\n\t}", "public BigDecimal getCost() {\r\n return cost;\r\n }", "public int cost() {\n\t\treturn value;\n\t}", "public double calculateCost(Purchase purchase);", "@Test\n\tpublic void getCostForItem() {\n\t\tfinal BasketItemImpl bi = new BasketItemImpl();\n\t\tbi.addBasketItem(\"banana\", 2);\n\t\tbi.addBasketItem(\"lemon\", 3);\n\n\t\tfinal int fc = bi.getAllBasketItems().get(\"banana\");\n\t\tassertTrue(Integer.compare(2, fc) == 0);\n\n\t}", "public BigDecimal getCost() {\n return this.cost;\n }", "@Override\r\n\tpublic double getCost() {\n\t\treturn this.cost_of_icecream;\r\n\t}", "public double getTotalCost() {\r\n\t\treturn cost;\r\n\t}", "public float totalCost() {\r\n float total = 0;\r\n for (int i=0; i<numItems; i++) {\r\n total += cart[i].getPrice();\r\n }\r\n return total;\r\n }", "@Override\r\n\tpublic double getCost() {\r\n\t\tdouble total = 0;\r\n\t\t\r\n\t\tfor(Product p: parts) {\r\n\t\t\ttotal += p.getCost();\r\n\t\t}\r\n\t\t\r\n\t\treturn total;\r\n\t}", "public double getCost() {\r\n\t\t\r\n\t\tif (super.getSize() == \"Small\") { totalCost = 2.00; }\r\n\t\t\r\n\t\tif (super.getSize() == \"Medium\") { totalCost = 2.50; }\r\n\t\t\r\n\t\tif (super.getSize() == \"Large\") { totalCost = 3.00; }\r\n\t\t\r\n\t\treturn totalCost;\r\n\t}", "@Override\n\tpublic double cost() {\n\t\treturn 2.19;\n\t}", "public double getCost() {\n return price;\n }", "public double getTotalCost() {\r\n return totalCost;\r\n }", "public double cost() {\n return roomType.cost() + COST;\n }", "public int getCost() {\n/* 69 */ return this.cost;\n/* */ }", "@Pure\n\tdouble getEstimatedCost();", "public double getCosts();", "public double getCost() \n { \n return super.getCost() +22;\n }", "@Override\n public double getCost() {\n\t return 13;\n }", "@Override\n public int getCost() {\n int price = (int) Math.round(this.weight * this.pricePerLbs); //get the price of the cookies in the form of an int\n return price; //return the price\n\n }", "@Override\n public double getCost() {\n /**\n * @return the cost of Ice Cream\n */\n // TODO Auto-generated method stub\n return this.cost;\n }", "public String getCost() {\n return cost;\n }", "public float getTotalCost() {\n return this.totalCost;\n }", "@Override\n\tpublic double cost() {\n\t\treturn Double.parseDouble(rateOfLatte);\n\t}", "public double getCost() {\n return this.product.getPrice() * quanity;\n }", "public double getTotal() {\n return totalCost;\n }", "@GetMapping(\"/{id}/cost\")\n\tpublic Double getItemCost(@PathVariable Long id) {\n\t\treturn itemService.getItemCost(id);\n\t}", "public int getCost()\r\n\t{\n\t\treturn 70000;\r\n\t}", "public String getCost() {\n\t\tString t = doc.get(\"cost\");\n\n\t\tif (t == null) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\treturn t;\n\t\t}\n\t}", "public int totalCost()\n {\n int cost = 0;\n for (DessertItem item : dessertList) {\n cost += item.getCost();\n }\n return cost;\n }", "public int get_cost() {\n return (int)getUIntElement(offsetBits_cost(), 16);\n }", "public Number getActualCost()\r\n {\r\n return (m_actualCost);\r\n }", "public CostInfo getCostInfo();", "public double calcCost() {\n if (pizzaSize.equals(\"small\")) {\n return 10.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n\n }\n else if (pizzaSize.equals(\"medium\")) {\n return 12.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n }\n else {\n return 14.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n }\n }", "@Override\r\n\tpublic double getCost() {\n\t\treturn 0;\r\n\t}", "public int selectedCost()\r\n {\r\n if (selectedIndex == -1) //nothing selected\r\n return 0;\r\n \r\n return dummyList.get(selectedIndex).cost();\r\n }", "@NotNull\n public BigDecimal getCost() {\n return cost;\n }", "@Override\n\tpublic double cost() {\n\t\treturn medicalRecord.cost() + 4.88;\n\t}", "@Override\n\tpublic double cost() {\n\t\treturn water.cost()+10;\n\t}", "public double getTotalCost() {\n cost = spr.calculateCost();\n return cost;\n }", "public Money getCost(){\r\n return this.cost;\r\n }", "@Override \r\n public double getPaymentAmount() \r\n { \r\n return getQuantity() * getPricePerItem(); // calculate total cost\r\n }", "public float getCost()\r\n/* 13: */ {\r\n/* 14:10 */ return this.costFromStart + this.estimatedCostToGoal;\r\n/* 15: */ }", "public double calcCost() {\n // $2 per topping.\n double cost = 2 * (this.cheese + this.pepperoni + this.ham);\n // size cost\n switch (this.size) {\n case \"small\":\n cost += 10;\n break;\n case \"medium\":\n cost += 12;\n break;\n case \"large\":\n cost += 14;\n break;\n default:\n }\n return cost;\n }", "public double getCost() {\n\t\treturn costOverride > 0 ? costOverride : getDefaultCost();\n\t}", "@Override\n public double getCost() {\n if (lunch != null && dinner != null) {\n return lunch.getCost() + dinner.getCost();\n }\n return 0;\n }", "@Override\n public int getCost() {\n\treturn 0;\n }", "@Override public double getCosto(){\n double d = 190.00;\n return d;\n }" ]
[ "0.8238948", "0.8238948", "0.8053952", "0.8033242", "0.8033242", "0.8033242", "0.79712266", "0.79342264", "0.7932334", "0.792491", "0.792444", "0.7916955", "0.7894079", "0.7868785", "0.78635836", "0.784681", "0.7825445", "0.7819919", "0.781798", "0.780999", "0.78097916", "0.7805256", "0.78037256", "0.779805", "0.77917266", "0.7784491", "0.7784491", "0.77815664", "0.77815664", "0.77727705", "0.7769243", "0.77546334", "0.77448964", "0.77448964", "0.7738833", "0.77336967", "0.77150935", "0.7714546", "0.77133054", "0.77133054", "0.77133054", "0.7700892", "0.76947665", "0.7690917", "0.7676537", "0.7670015", "0.7655762", "0.76524144", "0.7640267", "0.76315975", "0.76135874", "0.75983655", "0.7588598", "0.7576922", "0.7542869", "0.7526755", "0.7518982", "0.7515694", "0.7505648", "0.7496514", "0.7495509", "0.7494989", "0.7466592", "0.7450865", "0.74394673", "0.7436631", "0.74099475", "0.74038255", "0.7397682", "0.73961383", "0.73944235", "0.73825794", "0.7377537", "0.73570144", "0.7352761", "0.73524153", "0.7337416", "0.7288453", "0.72702557", "0.72553676", "0.7233201", "0.7233184", "0.7231887", "0.72304344", "0.72007847", "0.7198262", "0.7189421", "0.71871036", "0.7185575", "0.71749425", "0.71744025", "0.7142074", "0.7133224", "0.71290934", "0.7128524", "0.71229297", "0.71209025", "0.7120106", "0.7109677", "0.7096653", "0.70903707" ]
0.0
-1
BV will not change for this item, so just return the normal value
public double GetCurOffensiveBV( boolean UseRear, boolean UseTC, boolean UseAES, boolean UseRobotic ) { return GetOffensiveBV(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected V getValue() {\n return this.value;\n }", "public ArmCurrency getOriginalVATAmount() {\n ArmCurrency rtnVal = this.itemOriginalVat;\n if (isReturn && rtnVal != null) {\n rtnVal = rtnVal.multiply( -1).round();\n }\n return (rtnVal);\n }", "@Override\n public int getValue() {\n return super.getValue();\n }", "@Override\n\t\tpublic V getValue() {\n\t\t\treturn v;\n\t\t}", "protected abstract T getNormalFlagValue();", "V getValue() {\n return value;\n }", "public V valor() {\n return value;\n }", "@Override\n\t\tpublic V getValue(){\n\t\t\treturn value;\n\t\t}", "Money getItemValue();", "protected Item func_146068_u() { return Item.func_150899_d(0); }", "@Override\n public V getValue() {\n return m_value;\n }", "public Object getInternalValue()\n {\n return m_internalValue;\n }", "public abstract V getValue();", "public ArmCurrency getActualVATAmount() {\n ArmCurrency rtnVal = vat;\n if (isReturn && rtnVal != null) {\n rtnVal = rtnVal.multiply( -1).round();\n }\n return (rtnVal);\n }", "public int value() { \n return this.value; \n }", "@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}", "@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}", "@Override\n public T getItemVO() {\n return this.itemVO;\n }", "@Override\r\n\t\t\tpublic Object getValue() {\n\t\t\t\treturn null;\r\n\t\t\t}", "public Object getValue() { return _value; }", "Integer getBusinessValue();", "@Override\r\n public Object getValue() {\r\n return value;\r\n }", "public Object getValue() { return this.value; }", "TemplateModel getValue();", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V value()\n\t\t{\n\t\t\treturn _value;\n\t\t}", "public T getRawValue(){\n return mValue;\n }", "@Override\n \tpublic IValue getValue() {\n \t\treturn this;\n \t}", "default V get() {\n V item = orElseNull();\n if ( item == null )\n throw new IllegalArgumentException(\"No item at the targeted position!\");\n return item;\n }", "@Override\n public Object getValue()\n {\n return value;\n }", "public int value(){\n return this.value;\n }", "@Override\n public double getValue() {\n return 0;\n }", "@Override\r\n\tpublic Integer getValue() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Value apprise() {\n\t\treturn null;\n\t}", "@Override\n public N value() {\n return value;\n }", "public Integer newValue(){\n\t\treturn 0;\r\n\t}", "V getValue();", "V getValue();", "V getValue();", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public Object getValue(){\n \treturn this.value;\n }", "public MessageRequestOfAnimalModelNuLtuh91 getValue() {\n return localValue;\n }", "public MessageRequestOfAnimalModelNuLtuh91 getValue() {\n return localValue;\n }", "public MessageRequestOfAnimalModelNuLtuh91 getValue() {\n return localValue;\n }", "public V getValue() {\r\n\t\treturn value;\r\n\t}", "public Value getValue(){\n return this.value;\n }", "public int getValue(){\n return this.value;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic V getValue() {\n\t\t\n\t\tif (!valueSet) {\n\t\t\t// If the value has not been set this instance has recently been de-serialized\n\t\t\t\n\t\t\tif (valueIsSerializable) {\n\t\t\t\t// The original value was serializable and will thus have been been de-serialized too\n\t\t\t\tvalue = serializableValue;\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// The original value was NOT serializable so we need to generate it from the raw \n\t\t\t\t// submitted value again.\n\t\t\t\t\n\t\t\t\t// A converter may not be serializable either, so we obtain a new instance as well.\n\t\t\t\t// TODO: Maybe test if converter is serializable and if so keep a reference\n\t\t\t\tConverter converter = RequestParameterProducer.getConverter(requestParameter, targetType);\n\t\t\t\t\n\t\t\t\tObject convertedValue;\n\t\t\t\tif (converter != null) {\n\t\t\t\t\tconvertedValue = converter.getAsObject(getContext(), getViewRoot(), submittedValue);\n\t\t\t\t} else {\n\t\t\t\t\tconvertedValue = submittedValue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvalue = (V) convertedValue;\n\t\t\t}\n\t\t\t\n\t\t\tvalueSet = true;\n\t\t}\n\t\t\n\t\treturn value;\n\t}", "public abstract Object getValue();", "public abstract Object getValue();", "public abstract Object getValue();", "public V getValue();", "@Override\n public int value() {\n return 0;\n }", "public String getItemValue() {\n return itemValue;\n }", "public org.omg.uml.behavioralelements.commonbehavior.Instance getValue();", "int getAssetValue();", "public abstract Object getDecisionValue();", "public abstract Value getValue();", "@Override\n\tpublic Integer getV() {\n\t\treturn this.v;\n\t}", "public V getCValue();", "public V getValue() {\n\t\treturn value;\n\t}", "public V getValue() {\n\t\treturn value;\n\t}", "public S getValue() { return value; }", "protected E value(Position<Item<E>> p) {\n return p.getElement().getValue();\n }", "public V get() {\n return value;\n }", "public int getValue() {\n/* 450 */ return this.value;\n/* */ }", "@Override\n\tpublic String getValue() {\n\t\treturn PushyView.c.getValue();\n\t}", "@Override\n\tpublic Object getValue() {\n\t\treturn null;\n\t}", "public double getValue() {\n return 0.05;\n }", "protected Object doGetValue() {\n\t\treturn value;\n\t}", "public int getValue() \n {\n return value;\n }", "synchronized byte getCurrentValueLo()\n {\n return (byte)getCurrentValue();\n }", "@Override\n public double getValue()\n {\n return value;\n }", "public int getValue(){\n return value;\n }", "@Override\n\tpublic float value() {\n\t\treturn currnet().value();\n\t}", "public int value() \n {\n return value;\n }", "protected T getValue0() {\n\t\treturn value;\n\t}", "public final Object getValue()\n {\n return m_Value;\n }", "@Override\r\n\t\tpublic long getValue() {\n\t\t\treturn -1;\r\n\t\t}", "public Entity getValue() {\r\n\t\t\treturn value;\r\n\t\t}", "@SuppressWarnings(\"unchecked\")\n public <V> V getValue() {\n return (V) this.value;\n }", "public int getValue() \n {\n return value;\n }", "public Object getValue()\r\n {\r\n return this.value;\r\n }", "public V getValue()\r\n\t\t{\r\n\t\t\treturn val;\r\n\t\t}", "public Object getValue()\n {\n\treturn value;\n }", "@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}", "@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}", "public A getValue() { return value; }", "public abstract int getInfraredValue();", "protected CompoundValue getCompoundValue() {\n return accessor.getValue(this);\n }", "public BigDecimal getConvertedProductQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedProductQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public\t\tString\t\tgetValue()\n\t\t{\n\t\treturn(\"\" + getNormalizedValue());\n\t\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic V getValue() {\n\n\t\tif (!valueSet) {\n\t\t\t// If the value has not been set this instance has recently been de-serialized.\n\n\t\t\tif (valueIsSerializable) {\n\t\t\t\t// The original value was serializable and will thus have been been de-serialized too.\n\t\t\t\tsetValue(serializableValue);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// The original value was NOT serializable so we need to generate it from the raw submitted value again.\n\t\t\t\tsetValue((V) coerceValues(type, getConvertedValues(getContext(), param, \"param\", submittedValues, type)));\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t}", "public int value() {\n return this.value;\n }", "@Override\n\tpublic T somme() {\n\t\treturn val;\n\t}", "private byte getValue() {\n\t\treturn value;\n\t}", "public BigDecimal getConvertedShrinkQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedShrinkQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}" ]
[ "0.6490702", "0.638209", "0.628346", "0.62298596", "0.6221059", "0.61899614", "0.61569536", "0.6120374", "0.61037785", "0.60555756", "0.6053516", "0.60244155", "0.59951866", "0.5988546", "0.5983581", "0.59697366", "0.59697366", "0.5962308", "0.5961704", "0.5947348", "0.5944077", "0.5931061", "0.59239835", "0.591726", "0.5908027", "0.5908027", "0.5901834", "0.59014726", "0.5899867", "0.5899748", "0.5892022", "0.5890554", "0.58720785", "0.5867855", "0.58659077", "0.5861192", "0.58447945", "0.58445394", "0.58445394", "0.58445394", "0.5842549", "0.5842549", "0.5842549", "0.5842549", "0.58391106", "0.5831365", "0.5831365", "0.5831365", "0.5823933", "0.5823491", "0.5812832", "0.5809672", "0.5794764", "0.5794764", "0.5794764", "0.5790781", "0.57883227", "0.577277", "0.5771224", "0.57599163", "0.57587385", "0.57489675", "0.5748046", "0.5743979", "0.5720425", "0.5720425", "0.5719651", "0.5712197", "0.5707188", "0.570029", "0.56982094", "0.56968826", "0.56956345", "0.5693612", "0.56870306", "0.56820583", "0.56700486", "0.5662724", "0.5661892", "0.56473887", "0.5636511", "0.5635856", "0.5622706", "0.5619243", "0.5616505", "0.56095606", "0.5606057", "0.5604515", "0.5602278", "0.5602242", "0.5602242", "0.5598285", "0.5596744", "0.5593186", "0.5576986", "0.5566687", "0.55472755", "0.55462134", "0.55362815", "0.5534027", "0.553352" ]
0.0
-1
some ammo can explode and CASE is needed
public boolean IsExplosive() { return Explosive; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private com.mytechia.robobo.framework.hri.emotion.Emotion mappingEmotions(Emotion emotion){\n switch(emotion)\n {\n case Normal:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.NORMAL;\n case Happy:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.HAPPY;\n case Angry:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.ANGRY;\n case Laughing:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.LAUGHING;\n case Smyling:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.SMYLING;\n case Surprised:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.SURPRISED;\n case Sad:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.SAD;\n case In_Love:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.IN_LOVE;\n case Embarrased:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.EMBARRASED;\n default:\n return com.mytechia.robobo.framework.hri.emotion.Emotion.NORMAL;\n }\n\n }", "public boolean interpreta(String com[]){\n\t\tint i, contv = 0, j;\n\t\tchar tok;\n\t\tString aux;\n\t\t\n\t\tfor(i = 0 ; i < com.length && com[i] != null; i++){\n\t\t\tcom[i]=com[i].trim();\n\t\t\tcom[i]=com[i].trim();\n\t\t\tcom[i]=com[i].replace(\"fimenquanto\",\"#\");\n\t\t\tcom[i]=com[i].replace(\"fimse\",\"*\");\n\t\t\tcom[i]=com[i].replace(\"else\",\",\");\n\t\t\tcom[i]=com[i].replace(\"se\",\".\");\n\t\t\tcom[i]=com[i].replace(\"op\",\"$\");\n\t\t\tcom[i]=com[i].replace(\":\",\"[\");//Para chamar a funcao abacaxi:\n\t\t\tcom[i]=com[i].replace(\"{\",\"+\");\n\t\t\tcom[i]=com[i].replace(\"}\",\"-\");\n\t\t\tcom[i]=com[i].replace(\"end\",\":\");//Fim do ELSE\n\t\t\tcom[i]=com[i].replace(\"enquanto\",\"@\");\n\t\t\tcom[i]=com[i].replace(\"imprime\",\"%\");\n\t\t\tcom[i]=com[i].replace(\"le\",\"?\");\n\t\t}\n\t\tboolean baleado=false;\n\t\tint salvaFuncao = 0, jaEntrou = 1;\n\t\tMate mat = new Mate();\n\n\t\tfor(i = 0; i < (com.length - 1) && com[i] != null; ++i){\n\t\t\ttok = com[i].charAt(0);\n\t\t\taux = com[i].substring(1);\n\t\t\taux = aux.trim();\n\t\t\t\n\t\t\tswitch(tok){//Caso IF\n\t\t\t\tcase '.':\n\t\t\t\t\tbaleado = Logico.funcaoSe(var, aux, 2);\n\t\t\t\t\tif(baleado == false){\n\t\t\t\t\t\ti = Logico.linha(com, i);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase ',': //Caso ELSE IF\n\t\t\t\t\tif(baleado){\n\t\t\t\t\t\ti = Logico.linha(com, i);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*': \t//fim if\n\t\t\t\t\tbreak;\n\t\t\t\tcase ':': //fim ELSE\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '$': \t//criar variavel\n\t\t\t\t\tString[] nova = aux.split(\"=\");\n\t\t\t\t\tString nok = new String();\n\t\t\t\t\tnova[1] = nova[1].trim();\n\t\t\t\t\tnok = nova[1].substring(0);\n\t\t\t\t\t//double valor = Mate.soma(nova[1], var);\n\t\t\t\t\tint jaka,contador;\n\t\t\t\t\tdouble value;\n\t\t\t\t\tchar jui = ' ';\n\t\t\t\t\tfor(jaka=0,contador=0; jaka < nok.length(); ++jaka){\n\t\t\t\t\t\tjui = nova[1].charAt(jaka);\n\t\t\t\t\t\tif(jui == '+' || jui == '-' || jui == '*' || jui == '/')\n\t\t\t\t\t\t\tcontador++;\n\t\t\t\t\t}\n\t\t\t\t\tif(contador > 0){\n\t\t\t\t\t\tvalue = mat.calcula(nok, 0, var);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tvalue = Mate.soma(nova[1], var);\n\t\t\t\t\t}\n\t\t\t\t\tnova[0] = nova[0].trim();\n\t\t\t\t\tvar.atlVar( nova[0] , value);\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '@':\t//while\n\t\t\t\t\tif(Logico.funcaoSe(var, aux, 1) == true){\n\t\t\t\t\t\tlaco.push(i);\n\t\t\t\t\t}else{\n\t\t\t\t\t\ti = Logico.linha(com, i);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '#':\t//fim while\n\t\t\t\t\tif(laco.vazio() == true){\n\t\t\t\t\t\t//if(com[laco.pop()].charAt(0) == '@'){\n\t\t\t\t\t\t\ti = (laco.pop() - 1);\n\t\t\t\t\t\t//}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase '[': //Onde está a FUNCAO. Necessário guardar essa posicao\n\t\t\t\t\tsalvaFuncao = i;\n\t\t\t\t\tString[] nome = aux.split(\";\");\n\t\t\t\t\tnome[0] = nome[0].trim();\n\t\t\t\t\t//System.out.println(\"NOME = \"+nome[0]);\n\t\t\t\t\ti = Logico.achaFuncao(com, i, nome[0]);\n\t\t\t\t\tjaEntrou++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\tjaEntrou--;\n\t\t\t\t\tif(jaEntrou == 0)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\ti = salvaFuncao;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\treturn true;\n\t\t\t\tcase '%':\t//imprime\n\t\t\t\t\taux = aux.trim();\n\t\t\t\t\tImp.imprime(aux, var);\n\t\t\t\t\tbreak;\n\n\t\t\t\t\t\n\t\t\t\tcase '?':\t//scaner leitur\n\t\t\t\t\tdouble get = scan.nextDouble();\n\t\t\t\t\tvar.atlVar(aux, get);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public void parseData() {\n ArrayList<String> id = new ArrayList<>();\n id.add(\"Spawn.Name\");\n id.add(\"Spawn.Velocity\");\n id.add(\"Spawn.Spread\");\n id.add(\"Spawn.Count\");\n id.add(\"Spawn.Data\");\n id.add(\"Spawn.Grenade.Timer\");\n\n //gathers all the relevant data to the weapon\n HashMap<String, String> toBeParsed = new HashMap<>();\n\n for (String aCase : id) {\n if (mweplist.contains(mwep + \".\" + usecase + \".\" + aCase)) {\n toBeParsed.put(aCase, mweplist.getString(mwep + \".\" + usecase + \".\" + aCase));\n }\n }\n\n //creates a data hashmap that's to be sent to the execution method\n HashMap<String, Object> data = new HashMap<>();\n\n //creates a path id for parsing the data and an enable/disable switch\n String cases;\n boolean enable = true;\n\n //parse spawn entity\n cases = id.get(0);\n if(toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n EntityType.valueOf(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n }\n }else {\n sender.sendMessage(ChatColor.RED + \"Missing \" + cases);\n enable = false;\n }\n\n //parse entity velocity\n cases = id.get(1);\n if(toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n Double.parseDouble(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED+\"Invalid \"+cases);\n enable = false;\n }\n }else {\n data.put(cases, 0D);\n }\n\n //parse entity spread\n cases = id.get(2);\n if(toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n Double.parseDouble(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED+\"Invalid \"+cases);\n enable = false;\n }\n }else {\n data.put(cases, 0D);\n }\n\n //parse entity count\n cases = id.get(3);\n if(toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n (int) Double.parseDouble(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n }\n }else{\n sender.sendMessage(ChatColor.RED + \"Missing \" + cases);\n enable = false;\n }\n\n //parse entity nbt data\n cases = id.get(4);\n if(toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n toBeParsed.get(cases));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED+\"Invalid \"+cases);\n enable = false;\n }\n }else{\n data.put(cases, \"{}\");\n }\n\n //parse grenade timer\n cases = id.get(5);\n if(toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n (long) Double.parseDouble(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED+\"Invalid \"+cases);\n enable = false;\n }\n }else {\n data.put(cases, 0L);\n }\n\n //sends the parsed data and executes it\n if(enable) {\n executeMwep(data);\n }else{\n data.clear();\n }\n\n //clears the data getting hashmap\n toBeParsed.clear();\n }", "@Override\n public void parseData() {\n ArrayList<String> id = new ArrayList<>();\n id.add(\"Effect.Other.Sphere.Type\");\n id.add(\"Effect.Other.Sphere.Amplifier\");\n id.add(\"Effect.Other.Sphere.Duration\");\n id.add(\"Effect.Other.Sphere.Particles\");\n id.add(\"Effect.Other.Sphere.Icon\");\n id.add(\"Effect.Other.Sphere.Radius\");\n id.add(\"Effect.Other.Sphere.Ray.Particle\");\n id.add(\"Effect.Other.Sphere.Ray.Density\");\n id.add(\"Effect.Other.Sphere.Hit.Particle\");\n id.add(\"Effect.Other.Sphere.Hit.Density\");\n id.add(\"Effect.Other.Sphere.Filter.Tag.Exclude\");\n id.add(\"Effect.Other.Sphere.Filter.Tag.Include\");\n\n //gathers all the relevant data to the weapon\n HashMap<String, String> toBeParsed = new HashMap<>();\n\n for (String aCase : id) {\n if (mweplist.contains(mwep + \".\" + usecase + \".\" + aCase)) {\n toBeParsed.put(aCase, mweplist.getString(mwep + \".\" + usecase + \".\" + aCase));\n }\n }\n\n //creates a data hashmap that's to be sent to the execution method\n HashMap<String, Object> data = new HashMap<>();\n\n //creates a path id for parsing the data and an enable/disable switch\n String cases;\n boolean enable = true;\n\n //parse potion type\n cases = id.get(0);\n if (toBeParsed.containsKey(cases)) {\n try {\n //splits up potion effects and allows you to spawn multiple\n ArrayList<PotionEffectType> potioneffects = new ArrayList<>();\n String[] effects = toBeParsed.get(cases).split(\",\");\n\n for (String effect : effects) {\n potioneffects.add(PotionEffectType.getByName(effect));\n }\n\n data.put(cases, potioneffects);\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n }\n } else {\n sender.sendMessage(ChatColor.RED + \"Missing \" + cases);\n enable = false;\n\n }\n\n //parse amplifier\n cases = id.get(1);\n if (toBeParsed.containsKey(cases)) {\n try {\n //splits up potion amplifiers and allows you to use multiple\n ArrayList<Integer> amplifier = new ArrayList<>();\n String[] effects = toBeParsed.get(cases).split(\",\");\n\n for (String effect : effects) {\n amplifier.add((int) Double.parseDouble(effect));\n }\n\n data.put(cases, amplifier);\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, 0);\n }\n\n //parse duration\n cases = id.get(2);\n if (toBeParsed.containsKey(cases)) {\n try {\n //splits up potion duration and allows you to use multiple\n ArrayList<Integer> duration = new ArrayList<>();\n String[] effects = toBeParsed.get(cases).split(\",\");\n\n for (String effect : effects) {\n duration.add((int) Double.parseDouble(effect));\n }\n\n data.put(cases, duration);\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n }\n } else {\n sender.sendMessage(ChatColor.RED + \"Missing \" + cases);\n enable = false;\n }\n\n //parse particles\n cases = id.get(3);\n if (toBeParsed.containsKey(cases)) {\n try {\n //splits up potion duration and allows you to use multiple\n ArrayList<Boolean> particles = new ArrayList<>();\n String[] effects = toBeParsed.get(cases).split(\",\");\n\n for (String effect : effects) {\n particles.add(Boolean.parseBoolean(effect));\n }\n\n data.put(cases, particles);\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n }\n } else {\n sender.sendMessage(ChatColor.RED + \"Missing \" + cases);\n enable = false;\n }\n\n //parse icon\n cases = id.get(4);\n if (toBeParsed.containsKey(cases)) {\n try {\n //splits up potion duration and allows you to use multiple\n ArrayList<Boolean> icon = new ArrayList<>();\n String[] effects = toBeParsed.get(cases).split(\",\");\n\n for (String effect : effects) {\n icon.add(Boolean.parseBoolean(effect));\n }\n\n data.put(cases, icon);\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n }\n } else {\n sender.sendMessage(ChatColor.RED + \"Missing \" + cases);\n enable = false;\n }\n\n //parse sphere radius\n cases = id.get(5);\n if (toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n Double.parseDouble(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, 10D);\n }\n\n //parse ray particles\n cases = id.get(6);\n if (toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n Particle.valueOf(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, null);\n }\n\n //parse ray density\n cases = id.get(7);\n if (toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n (int) Double.parseDouble(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, 1);\n }\n\n //parse hit particles\n cases = id.get(8);\n if (toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n Particle.valueOf(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, null);\n\n }\n\n //parse hit density\n cases = id.get(9);\n if (toBeParsed.containsKey(cases)) {\n try {\n data.put(cases,\n (int) Double.parseDouble(toBeParsed.get(cases)));\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, 1);\n\n }\n\n //parse exclusion tags\n cases = id.get(10);\n if (toBeParsed.containsKey(cases)) {\n try {\n //splits up potion effects and allows you to spawn multiple\n String[] effects = toBeParsed.get(cases).split(\",\");\n\n ArrayList<String> strings = new ArrayList<>(Arrays.asList(effects));\n\n data.put(cases, strings);\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, null);\n }\n\n //parse inclusion tags\n cases = id.get(11);\n if (toBeParsed.containsKey(cases)) {\n try {\n //splits up potion effects and allows you to spawn multiple\n String[] effects = toBeParsed.get(cases).split(\",\");\n\n ArrayList<String> strings = new ArrayList<>(Arrays.asList(effects));\n\n data.put(cases, strings);\n } catch (Exception e) {\n sender.sendMessage(ChatColor.RED + \"Invalid \" + cases);\n enable = false;\n\n }\n } else {\n data.put(cases, null);\n }\n\n //sends the parsed data and executes it\n if (enable) {\n executeMwep(data);\n } else {\n data.clear();\n }\n\n //clears the data getting hashmap\n toBeParsed.clear();\n }", "public void handleNumbers() {\n // TODO handle \"one\", \"two\", \"three\", etc.\n }", "private void selectFunctionality() {\n if (text.equals(\"1\") || text.contains(\"senast\")) {\n intent = new Intent(this, LatestCallsActivity.class);\n startActivity(intent);\n } else if (text.equals(\"2\") || text.contains(\"favor\")) {\n intent = new Intent(this, ContactGridActivity.class);\n startActivity(intent);\n } else if (text.equals(\"3\") || text.contains(\"med\") || text.contains(\"inkorg\") || text.contains(\"sm\")) {\n intent = new Intent(this, SMS_Activity.class);\n startActivity(intent);\n } else if (text.equals(\"4\") || text.contains(\"bok\") || text.contains(\"kontakt\")) {\n words = text.split(\" \");\n if (words.length > 1) {\n intent = new Intent(this, ContactGridActivity.class);\n intent.putExtra(\"initial_letter\", words[1].charAt(0));\n startActivity(intent);\n } else {\n intent = new Intent(this, ContactBookActivity.class);\n startActivity(intent);\n }\n\n }\n\n }", "private String[] condicionGeneral(String condicion) {\n String retorno[] = new String[2];\n try {\n String[] simbolos = {\"<=\", \">=\", \"==\", \"!=\", \"<\", \">\"};\n String simbolo = \"0\";\n\n if (condicion.length() > 3) {\n condicion = condicion.substring(1, condicion.length());\n for (int i = 0; i < simbolos.length; i++) {//selecciona el simbolo de la condicion\n if (condicion.contains(simbolos[i])) {\n simbolo = simbolos[i];\n break;\n }\n }\n if (simbolo.equals(\"0\")) {\n retorno[0] = \"0\";\n retorno[1] = \"mala construcción de la sentencia.\";\n } else {\n String var[] = condicion.split(simbolo);\n if (var.length == 2) {\n if (esNumero(var[0])) {\n if (esNumero(var[1])) {\n retorno[0] = \"1\";\n retorno[1] = \"\";\n } else {\n if (var[1].matches(\"[a-zA-Z]*\")) { //comprueba que solo contenga letas \n byte aux = 0;\n\n for (int i = 0; i < codigo.size(); i++) {\n if (var[1].equals(codigo.get(i).toString())) {\n aux++;\n }\n }\n if (aux > 0) {\n retorno[0] = \"1\";\n retorno[1] = \"\";\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"no se reconoce la variable \" + var[1] + \".\";\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n }\n } else {\n if (var[0].matches(\"[a-zA-Z]*\")) { //comprueba que solo contenga letras \n byte aux = 0;\n for (int i = 0; i < codigo.size(); i++) {\n if (var[0].equals(codigo.get(i).toString())) {\n aux++;\n }\n }\n if (aux > 0) {\n if (esNumero(var[1])) {\n retorno[0] = \"1\";\n retorno[1] = \"\";\n } else {\n if (var[0].matches(\"[a-zA-Z]*\")) { //comprueba que solo contenga letas \n aux = 0;\n\n for (int i = 0; i < codigo.size(); i++) {\n if (var[1].equals(codigo.get(i).toString())) {\n aux++;\n }\n }\n if (aux > 0) {\n retorno[0] = \"1\";\n retorno[1] = \"\";\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"no se reconoce la variable \" + var[1] + \".\";\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"no se reconoce la variable \" + var[0] + \".\";\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n\n\n\n } catch (Exception e) {\n System.out.println(\"Error en condicion \" + e.getClass());\n } finally {\n return retorno;\n }\n }", "static int type_of_mov(String passed){\n\t\tif(passed.charAt(4)=='M' && general_registers.contains(passed.charAt(6)))\n\t\t\treturn 2;\n\t\telse if(passed.charAt(6)=='M' && general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(general_registers.contains(passed.charAt(6)) && general_registers.contains(passed.charAt(4)))\n\t\t\treturn 3;\n\t\telse\n\t\t\treturn 0;\n\t}", "private String m1032a(String str, int i) {\n String[] split = this.f682B.split(\"\\\\*\")[i].split(MiPushClient.ACCEPT_TIME_SEPARATOR);\n if (str.equals(\"lac\")) {\n return split[0];\n }\n if (str.equals(\"cellid\")) {\n return split[1];\n }\n if (str.equals(\"signal\")) {\n return split[2];\n }\n return null;\n }", "static void m60215a(C13940a aVar, String str, Object obj) {\n if (aVar != null) {\n if (obj instanceof String[]) {\n String[] strArr = (String[]) obj;\n aVar.mo44055a(str, strArr[0], strArr[1]);\n } else if (obj instanceof C13966b) {\n C13966b bVar = (C13966b) obj;\n bVar.mo44232a(aVar.mo44052a(str, bVar.f41051c));\n } else if (obj instanceof List) {\n C13940a a = aVar.mo44051a(str);\n if (a != null) {\n List list = (List) obj;\n for (int i = 0; i < list.size(); i++) {\n m60215a(a, (String) null, list.get(i));\n }\n a.mo44053a();\n }\n } else {\n aVar.mo44054a(str, obj);\n }\n }\n }", "private static String [] specificInfoAmmoPointToDraw(AmmoPointLM ammoPointLM) throws NullPointerException{\n if(ammoPointLM == null){\n throw new NullPointerException(\"The parameter should not be null.\");\n }\n String[] stringsToReturn = new String[2];\n if(ammoPointLM.getAmmoCard() == null){\n for(int i=0; i < 2; i++) {\n stringsToReturn[i] = EMPTY_LINE_INSIDE_SQUARE;\n }\n }\n else{\n stringsToReturn[0] = lineInsideSquareWithBlankAtTheEnd(\"AmmoCard:\");\n stringsToReturn[1]= \"\";\n List<AmmoType> ammoInAmmoCard = ammoPointLM.getAmmoCard().getAmmo();\n for(int i=0; i < ammoInAmmoCard.size(); i++){\n AmmoType ammo = ammoInAmmoCard.get(i);\n if(ammo == AmmoType.RED){\n stringsToReturn[1] += \"r\";\n }\n if(ammo == AmmoType.BLUE){\n stringsToReturn[1] += \"b\";\n }\n if(ammo == AmmoType.YELLOW){\n stringsToReturn[1] += \"y\";\n }\n //if this ammo is not the last of the list\n if(i < ammoInAmmoCard.size()-1) {\n stringsToReturn[1] += \",\";\n }\n }\n if(ammoPointLM.getAmmoCard().hasPowerup()){\n stringsToReturn[1] += \",PwUp\";\n }\n stringsToReturn[1] = lineInsideSquareWithBlankAtTheEnd(stringsToReturn[1]);\n }\n return stringsToReturn;\n }", "private static String[] populateBlueMoonGeneral(String[] generalInventory){\r\n generalInventory[0] = \"Healing Potion\";\r\n generalInventory[1] = \"Greater Healing Potion\";\r\n return generalInventory;\r\n }", "public String parseItemChoice() {\n\t\tSystem.out.println(\"What would you like to do?\");\n\t\tSystem.out.println(\"Equip/Unequip Weapon\\t(W)\");\n\t\tSystem.out.println(\"Equip/Unequip Armor\\t(A)\");\n\t\tSystem.out.println(\"Use Potion\\t(P)\");\n\t\tSystem.out.println(\"Back\\t(B)\");\n\t\tString res = parseString().toUpperCase();\n\t\tboolean isValid = false;\n\t\twhile(!isValid) {\n\t\t\tswitch(res) {\n\t\t\tcase \"W\":\n\t\t\tcase \"A\":\n\t\t\tcase \"P\":\n\t\t\tcase \"B\":\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprintErrorParse();\n\t\t\t\tres = parseString().toUpperCase();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t\t\n\t}", "public String pid_011C(String str){\n\nString standar=\"Unknow\";\n switch(str.charAt(1)){\n case '1':{standar=\"OBD-II as defined by the CARB\";break;} \n case '2':{standar=\"OBD as defined by the EPA\";break;}\n case '3':{standar=\"OBD and OBD-II\";break;}\n case '4':{standar=\"OBD-I\";break;}\n case '5':{standar=\"Not meant to comply with any OBD standard\";break;}\n case '6':{standar=\"EOBD (Europe)\";break;}\n case '7':{standar=\"EOBD and OBD-II\";break;}\n case '8':{standar=\"EOBD and OBD\";break;}\n case '9':{standar=\"EOBD, OBD and OBD II\";break;}\n case 'A':{standar=\"JOBD (Japan)\";break;}\n case 'B':{standar=\"JOBD and OBD II\";break;} \n case 'C':{standar=\"JOBD and EOBD\";break;}\n case 'D':{standar=\"JOBD, EOBD, and OBD II\";break;} \n default: {break;} \n }\n \n return standar;\n}", "static int type_of_ana(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "public void cases(BareBones bb, String str){\r\n\r\n if(str.indexOf(\"clear\") != -1){\r\n bb.clearParser(str);\r\n }\r\n else{\r\n if(str.indexOf(\"incr\") != -1){\r\n bb.incrParser(str);\r\n }\r\n else{\r\n if(str.indexOf(\"decr\") != -1){\r\n bb.decrParser(str);\r\n }\r\n }\r\n }\r\n }", "String tomar_decisiones(String decision);", "public Archangel buscarPower(String pow){\n\tboolean val = false;\n Archangel angel = null;\n\tfor(int i =0;i<arch.length && !val;i++){\n\t\tif(arch[i]!=null){\n\t\tif(arch[i].getPower().equalsIgnoreCase(pow)){\n\t\t\tangel = arch[i];\n\t\t\tval = true;\n\t\t}\n\t}\n\t\t\telse{\n\t\t\tval=true;\n\t\t}\n\t}\n\nreturn angel;\n\n}", "public void fixmetestPositiveStringArray() {\n\n fail(\"Array conversions not implemented yet.\");\n\n Object value;\n final String[] stringArray = {};\n final String[] stringArray1 = { \"abc\" };\n final String[] stringArray2 = { \"abc\", \"de,f\" };\n\n value = LocaleConvertUtils.convert(\"\", stringArray.getClass());\n checkStringArray(value, stringArray);\n value = LocaleConvertUtils.convert(\" \", stringArray.getClass());\n checkStringArray(value, stringArray);\n value = LocaleConvertUtils.convert(\"{}\", stringArray.getClass());\n checkStringArray(value, stringArray);\n value = LocaleConvertUtils.convert(\"{ }\", stringArray.getClass());\n checkStringArray(value, stringArray);\n\n value = LocaleConvertUtils.convert(\"abc\", stringArray.getClass());\n checkStringArray(value, stringArray1);\n value = LocaleConvertUtils.convert(\"{abc}\", stringArray.getClass());\n checkStringArray(value, stringArray1);\n value = LocaleConvertUtils.convert(\"\\\"abc\\\"\", stringArray.getClass());\n checkStringArray(value, stringArray1);\n value = LocaleConvertUtils.convert(\"{\\\"abc\\\"}\", stringArray.getClass());\n checkStringArray(value, stringArray1);\n value = LocaleConvertUtils.convert(\"'abc'\", stringArray.getClass());\n checkStringArray(value, stringArray1);\n value = LocaleConvertUtils.convert(\"{'abc'}\", stringArray.getClass());\n checkStringArray(value, stringArray1);\n\n value = LocaleConvertUtils.convert(\"abc 'de,f'\", stringArray.getClass());\n checkStringArray(value, stringArray2);\n value = LocaleConvertUtils.convert(\"{abc, 'de,f'}\", stringArray.getClass());\n checkStringArray(value, stringArray2);\n value = LocaleConvertUtils.convert(\"\\\"abc\\\",\\\"de,f\\\"\", stringArray.getClass());\n checkStringArray(value, stringArray2);\n value = LocaleConvertUtils.convert(\"{\\\"abc\\\" 'de,f'}\", stringArray.getClass());\n checkStringArray(value, stringArray2);\n value = LocaleConvertUtils.convert(\"'abc' 'de,f'\", stringArray.getClass());\n checkStringArray(value, stringArray2);\n value = LocaleConvertUtils.convert(\"{'abc', \\\"de,f\\\"}\", stringArray.getClass());\n checkStringArray(value, stringArray2);\n\n }", "private String m9532a(int i) {\n String str = \"embeded_ad\";\n return i != 1 ? i != 2 ? (i == 5 || i != 9) ? str : \"draw_ad\" : \"interaction\" : \"banner_ad\";\n }", "public String e_(ItemStack paramamj)\r\n/* 14: */ {\r\n/* 15:19 */ if (paramamj.getDamage2() == 1) {\r\n/* 16:20 */ return \"item.charcoal\";\r\n/* 17: */ }\r\n/* 18:22 */ return \"item.coal\";\r\n/* 19: */ }", "String processing();", "public void Mini_Parser(){\n Lista_ER Nuevo=null;\n String Nombre=\"\";\n String Contenido=\"\";\n ArrayList<String> tem = new ArrayList<String>();\n //este boleano sirve para concatenar la expresion regular\n int Estado=0;\n for (int x = 0; x < L_Tokens.size(); x++) {\n switch(Estado){\n //ESTADO 0\n case 0:\n //Conjuntos\n if(L_Tokens.get(x).getLexema().equals(\"CONJ\")){\n if(L_Tokens.get(x+1).getLexema().equals(\":\")){\n if(L_Tokens.get(x+2).getDescripcion().equals(\"Identificador\")){\n //Son conjuntos \n Nombre=L_Tokens.get(x+2).getLexema();\n Estado=1;\n x=x+4;\n }\n }\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Identificador\")){\n //pasaa estado de expresion regular\n Nombre=L_Tokens.get(x).getLexema();\n Estado=2;\n }\n break;\n \n case 1:\n //ESTADO 1\n //Concatena los conjuntos\n if(L_Tokens.get(x).getDescripcion().equals(\"Identificador\")){\n if(L_Tokens.get(x+1).getDescripcion().equals(\"Tilde\")){\n Contenido=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n x=x+2;\n Estado=0;\n }\n \n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Digito\")){\n if(L_Tokens.get(x+1).getDescripcion().equals(\"Tilde\")){\n Contenido=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n x=x+2;\n Estado=0;\n }\n \n }\n for(int i=6;i<=37;i++){\n if(L_Tokens.get(x).getID()==i){\n if(L_Tokens.get(x+1).getDescripcion().equals(\"Tilde\")){\n Contenido=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n x=x+2;\n Estado=0;\n }\n \n }\n }\n //conjunto sin llaves\n if(L_Tokens.get(x).getLexema().equals(\";\")){\n if(L_Tokens.get(x-1).getLexema().equals(\",\")){\n }else{\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n Estado=0;\n Contenido=\"\";\n\n }\n }else{\n Contenido+=L_Tokens.get(x).getLexema();\n }\n \n\n break;\n case 2:\n //ESTADO 2\n if(L_Tokens.get(x).getLexema().equals(\"-\")){\n if(L_Tokens.get(x+1).getLexema().equals(\">\")){\n //se mira que es expresion regular\n \n Lista_ER nuevo=new Lista_ER(L_Tokens.get(x-1).getLexema());\n Nuevo=nuevo;\n L_Tokens_ER.add(nuevo);\n x++;\n Estado=3;\n }\n }\n if(L_Tokens.get(x).getLexema().equals(\":\")){\n //se mira que es lexema\n Estado=4;\n }\n break;\n case 3: \n //ESTADO 3\n //Concatenacion de Expresion Regular\n \n //System.out.println(\"---------------------------------\"+ L_Tokens.get(x).getLexema());\n if(L_Tokens.get(x).getDescripcion().equals(\"Punto\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Barra Vetical\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Interrogacion\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Asterisco\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Signo Mas\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Lexema de Entrada\")){ \n String tem1='\"'+L_Tokens.get(x).getLexema()+'\"';\n Nuevo.setER(tem1);\n \n }\n if(L_Tokens.get(x).getLexema().equals(\"{\")){ \n String tem1=\"\";\n if(L_Tokens.get(x+2).getLexema().equals(\"}\")){\n tem1=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n Nuevo.setER(tem1);\n }\n }\n if(L_Tokens.get(x).getLexema().equals(\";\")){\n Estado=0;\n }\n break;\n case 4:\n// System.out.println(L_Tokens.get(x).getLexema());\n Contenido=L_Tokens.get(x+1).getLexema();\n L_Tokens_Lex.add(new Lista_LexemasE(L_Tokens.get(x-2).getLexema(), Contenido));\n Estado=0;\n \n break;\n }//fin switch\n }//Fin for\n }", "@Override\n public MapperEmissionList call() {\n MapperEmissionList EmissionList = new MapperEmissionList();\n String[] splited = value.split(\"\\\\s+\");\n for (int ii=0; ii<splited.length; ii++) {\n splited[ii] = splited[ii].replaceAll(\"[^\\\\w]\", \"\");\n EmissionList.add(\n new MapperEmission(splited[ii] , 1) // emit the pair (ii-th character,1)\n );\n }\n return EmissionList;\n }", "boolean testShipExplode(Tester t) {\n return t.checkExpect(this.ship1.explode(), this.mt)\n && t.checkExpect(this.ship3.explode(), this.mt);\n }", "private int decide_type(String prod_name_str) {\n\n // initialize int type variable\n int type_array = -1;\n\n /* check condition to display product items */\n if(prod_name_str.equals(\"ONE MODULAR CONCEALED METAL BOX\")\n || prod_name_str.equals(\"ONE MODULAR CONCEALED BOX\")\n || prod_name_str.equals(\"ONE MODULAR SURFACE BOX\")){\n type_array = R.array.Surface_Boxes_Modules;\n } else if(prod_name_str.equals(\"DIYA CONCEAL BOX\")){\n type_array = R.array.Diya_Conceal_Box_Type;\n } else if(prod_name_str.equals(\"CHARM CONCEALED BOARD\")){\n type_array = R.array.Charm_board_array;\n }else if(prod_name_str.equals(\"JUNCTION BOX\")) {\n type_array = R.array.Junction_box;\n } else if(prod_name_str.equals(\"Wire Clip\")){\n type_array = R.array.wire_clip_sizes;\n } else if(prod_name_str.equals(\"FLAT CASING CLIP\") || prod_name_str.equals(\"ROUND CASING CLIP\")){\n type_array = R.array.casing_clip_size;\n } else if(prod_name_str.equals(\"GOLD DBS\")){\n type_array = R.array.gold_nano_dbs_modules;\n } else if(prod_name_str.equals(\"GOLD METAL ENCLOSURE\")){\n type_array = R.array.gold_metal_enclosure_modules;\n } else if(prod_name_str.equals(\"NANO DBS\")){\n type_array = R.array.gold_nano_dbs_modules;\n } else if(prod_name_str.equals(\"AC BOX\")){\n type_array = R.array.ac_box_types;\n } else if(prod_name_str.equals(\"DBS\")){\n type_array = R.array.dbs_board;\n } else if(prod_name_str.equals(\"DIYA DBS\")){\n type_array = R.array.diya_dbs_modules;\n } else if(prod_name_str.equals(\"DIYA PLUS DBS(METAL BACK)\")){\n type_array = R.array.diya_dbs_modules;\n } else if(prod_name_str.equals(\"MCB BOX METAL BLACK\")){\n type_array = R.array.mcb_box;\n } else if(prod_name_str.equals(\"MCB BOX PLASTIC BLACK\")){\n type_array = R.array.mcb_box;\n } else if(prod_name_str.equals(\"LX SURFACE BOX\")){\n type_array = R.array.LX_SURFACE_BOX_POSITION;\n } else if(prod_name_str.equals(\"LX MODULAR GANG BOX\")){\n type_array = R.array.LX_GANG_BOX_POSITION;\n } else if(prod_name_str.equals(\"50X20(2 INCHES) SUITABLE FOR ALL CASING\")){\n type_array = R.array.casing_Accessories_type_1;\n } else if(prod_name_str.equals(\"38X20(1.5 INCHES) SUITABLE FOR ALL CASING\")){\n type_array = R.array.Casing_Accessories_type_2;\n } else if(prod_name_str.equals(\"20MM(0.5 INCHES)\")){\n type_array = R.array.Casing_Accessories_type_3;\n } else if(prod_name_str.equals(\"20MM(20X12 BOX TYPE) SUITABLE FOR ALL BOX TYPE CASING(0.5 INCHES)\")) {\n type_array = R.array.Casing_Accessories_type_4;\n } else if(prod_name_str.equals(\"22MM(SUITABLE FOR 22MM AND 25X12 CASING 3.4 INCHES)\")){\n type_array = R.array.Casing_Accessories_type_5;\n } else if(prod_name_str.equals(\"25MM(SUITABLE FOR 25MM AND 32X12 CASING 1 INCHES)\")){\n type_array = R.array.Casing_Accessories_type_6;\n } else if(prod_name_str.equals(\"30X15(SUITABLE FOR 30X15 CASING 1 INCHES)\")){\n type_array = R.array.Casing_Accessories_type_7;\n } else if(prod_name_str.equals(\"25X16(3.4 INCHES)\")){\n type_array = R.array.Casing_Accessories_type_8;\n } else if(prod_name_str.equals(\"SQUARE BOX\")) {\n type_array = R.array.casing_accessories_square_box_badshah;\n } else if(prod_name_str.equals(\"JUNCTION BOX\")){\n type_array = R.array.Casing_Accessories_Junction_type_9;\n } else if(prod_name_str.equals(\"30X15 J.BOX\")){\n type_array = R.array.Casing_Accessories_Junction_type_10;\n } else if(prod_name_str.equals(\"ROUND BLOCK\")){\n type_array = R.array.Casing_Accessories_ROUND_BLOCK;\n } else if(prod_name_str.equals(\"DIYA JUNCTION BOX\")){\n type_array = R.array.Casing_Accessories_Junction_type_11;\n } else if(prod_name_str.equals(\"DOCTOR\")){\n type_array = R.array.DOCTOR;\n } else if(prod_name_str.equals(\"REDUCER\")){\n type_array = R.array.Casing_Accessories_REDUCER;\n } else if(prod_name_str.equals(\"TEJAS SQUARE BOX\")){\n type_array = R.array.casing_Accessories_Tejas_Square;\n } else if(prod_name_str.equals(\"MULTICORE INDUSTRIAL CABLE 2 CORE\") ){\n type_array = R.array.MULTICORE_CABLE_TYPES;\n } else if(prod_name_str.equals(\"MULTICORE INDUSTRIAL CABLE 3 CORE\")){\n type_array = R.array.MULTICORE_CABLE_TYPES;\n }else if(prod_name_str.equals(\"MULTICORE INDUSTRIAL CABLE 4 CORE\")){\n type_array = R.array.MULTICORE_CABLE_TYPES;\n } else if(prod_name_str.equals(\"MULTICORE INDUSTRIAL CABLE 2 CORE\") ){\n type_array = R.array.MULTICORE_CABLE_TYPES;\n } else if(prod_name_str.equals(\"MULTICORE INDUSTRIAL CABLE 3 CORE\")){\n type_array = R.array.MULTICORE_CABLE_TYPES;\n }else if(prod_name_str.equals(\"MULTICORE INDUSTRIAL CABLE 4 CORE\")){\n type_array = R.array.MULTICORE_CABLE_TYPES;\n } else if(prod_name_str.equals(\"TELEPHONE PAIR AND SWITCHBOARD CABLES 0.51 MM\")){\n type_array = R.array.TELEPHONE_AND_SWITCH_TYPE1;\n } else if(prod_name_str.equals(\"TELEPHONE PAIR AND SWITCHBOARD CABLES 0.41 MM\")){\n type_array = R.array.TELEPHONE_AND_SWITCH_TYPE2;\n } else if(prod_name_str.equals(\"3 CORE FLAT SUBMERSIBLE CABLES\")){\n type_array = R.array.FLAT_3_CORE_TYPES;\n } else if(prod_name_str.equals(\"COAXIAL CABLES(CCS)\")){\n type_array =R.array.COAXIAL_CABLE_TYPES;\n } else if(prod_name_str.equals(\"CC TV CABLE SPECIAL PARALLEL\")){\n type_array = R.array.CC_TV_SPECIAL_TYPE;\n } else if(prod_name_str.equals(\"CC TV CABLE ROUND\")){\n type_array = R.array.CC_TV_ROUND_CABLE_TYPE;\n } else if(prod_name_str.equals(\"LAN CABLE COMPUTER CABLE\")) {\n type_array = R.array.LAN_CABLE_TYPE;\n } else if(prod_name_str.equals(\"EXHAUST FAN RAPID\")){\n type_array = R.array.EXHAUST_FAN_SUB_TYPE_RAPID;\n } else if(prod_name_str.equals(\"EXHAUST FAN KRETA\")){\n type_array = R.array.EXHAUST_FAN_SUB_TYPE_KRETA;\n } else if(prod_name_str.equals(\"EXHAUST FAN SWIFT\")){\n type_array = R.array.EXHAUST_FAN_SUB_TYPE_SWIFT;\n } else if(prod_name_str.equals(\"Casing and Caping Tejas\")){\n type_array = R.array.casing_tejas;\n } else if(prod_name_str.equals(\"Casing and Caping Classy\")){\n type_array = R.array.casing_calssy;\n } else if(prod_name_str.equals(\"Casing and Caping Nano\")){\n type_array = R.array.casing_nano;\n } else if(prod_name_str.equals(\"Casing and Caping Diya\")){\n type_array = R.array.casing_diya;\n } else if(prod_name_str.equals(\"Casing and Caping Glory\")){\n type_array = R.array.casing_glory;\n } else if(prod_name_str.equals(\"Casing and Caping Viraj\")){\n type_array = R.array.casing_viraj;\n } else if(prod_name_str.equals(\"Casing and Caping Lords\")){\n type_array = R.array.casing_lords;\n } else if(prod_name_str.equals(\"Casing and Caping Pressfit Box Type\")){\n type_array = R.array.casing_boxtype;\n } else if(prod_name_str.equals(\"Casing and Caping Pressfit Galaxy\")){\n type_array = R.array.casing_galaxy;\n } else if(prod_name_str.equals(\"Casing and Caping Pressfit Gold\")){\n type_array = R.array.casing_gold;\n } else if(prod_name_str.equals(\"Casing and Caping New\")){\n type_array = R.array.casing_trunking;\n }else if(prod_name_str.equals(\"Casing and Caping Pressfit\")){\n type_array = R.array.casing_pressfit_list;\n } else if(prod_name_str.equals(\"Casing and Caping Royal\")){\n type_array = R.array.casing_royal;\n } else if(prod_name_str.equals(\"Casing and Caping Lexi\")){\n type_array = R.array.casing_lexi;\n } else if(prod_name_str.equals(\"NANO GANG BOX\")){\n type_array = R.array.Nano_gang_box;\n } else if(prod_name_str.equals(\"NANO PLUS GANG BOX\")){\n type_array = R.array.Nano_plus_gang_box;\n } else if(prod_name_str.equals(\"ECHO GANG BOX\")){\n type_array = R.array.echo_gang_box_list;\n } else if(prod_name_str.equals(\"GOLD GANG BOX\")){\n type_array = R.array.gold_gang_box;\n }\n return type_array;\n }", "public static String BeforeSplitStrategyHints(Player Gamer, Player Dealer){\n\t\tString ReturnString = \"\";\n\t\tif(Gamer.Hand[0].getValue() == 1 && Gamer.Hand[1].getValue() == 1){\n\t\t\t// Pair of Aces\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if((Gamer.Hand[0].getValue() == 2 && Gamer.Hand[1].getValue() == 2) \n\t\t\t|| (Gamer.Hand[0].getValue() == 3 && Gamer.Hand[1].getValue() == 3)){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 4 && Gamer.Hand[1].getValue() == 4){\n\t\t\tif(Dealer.Score >= 5 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 5 && Gamer.Hand[1].getValue() == 5){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 6 && Gamer.Hand[1].getValue() == 6){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 7 && Gamer.Hand[1].getValue() == 7){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t ReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 8 && Gamer.Hand[1].getValue() == 8){\n\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 9 && Gamer.Hand[1].getValue() == 9){\n\t\t\tif((Dealer.Score >= 2 && Dealer.Score <= 6) || (Dealer.Score >= 8 && Dealer.Score <= 9)){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 10 && Gamer.Hand[1].getValue() == 10){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\treturn ReturnString;\n\t}", "static void perform_ana(String passed){\n\t\tint type = type_of_ana(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tana_with_reg(passed);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tana_with_mem(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "private final boolean m134904a(EventMessage abVar, String str) {\n Drama drama;\n if (abVar.f96689m != null) {\n String valueOf = String.valueOf(abVar.f96689m.longValue());\n Theater a = StaticProperty.f99549a.mo120385a();\n if (!TextUtils.equals(valueOf, (a == null || (drama = a.getDrama()) == null) ? null : drama.getId())) {\n String abVar2 = abVar.toString();\n C32569u.m150513a((Object) abVar2, C6969H.m41409d(\"G6C95D014AB1DAE3AF50F974DBCF1CCE47D91DC14B878E2\"));\n VideoXOnlineLog.f101073b.mo121420a(\"(filterMsg) drama_id 不匹配, \" + str + \" , 消息 : {}\", abVar2);\n return true;\n }\n }\n if (abVar.f96690n == null) {\n return false;\n }\n Integer num = abVar.f96690n;\n int value = FilterType.EventFilter.getValue();\n if (num != null && num.intValue() == value) {\n MqttLinkedHashMap<String> gVar = f97548e;\n String str2 = abVar.f96685i;\n C32569u.m150513a((Object) str2, C6969H.m41409d(\"G6C95D014AB1DAE3AF50F974DBCE0D5D26797EA13BB\"));\n if (gVar.mo118727a(str2)) {\n String abVar3 = abVar.toString();\n C32569u.m150513a((Object) abVar3, C6969H.m41409d(\"G6C95D014AB1DAE3AF50F974DBCF1CCE47D91DC14B878E2\"));\n VideoXOnlineLog.f101073b.mo121420a(\"(filterMsg) eventFilterMap 已经存在消息,过滤, \" + str + \" , 消息 : {}\", abVar3);\n return true;\n }\n } else {\n Integer num2 = abVar.f96690n;\n int value2 = FilterType.BulletFilter.getValue();\n if (num2 != null && num2.intValue() == value2) {\n MqttLinkedHashMap<String> gVar2 = f97547d;\n String str3 = abVar.f96685i;\n C32569u.m150513a((Object) str3, C6969H.m41409d(\"G6C95D014AB1DAE3AF50F974DBCE0D5D26797EA13BB\"));\n if (gVar2.mo118727a(str3)) {\n String abVar4 = abVar.toString();\n C32569u.m150513a((Object) abVar4, C6969H.m41409d(\"G6C95D014AB1DAE3AF50F974DBCF1CCE47D91DC14B878E2\"));\n VideoXOnlineLog.f101073b.mo121420a(\"(filterMsg) bulletFilterMap 已经存在消息, 过滤, \" + str + \" , 消息 : {}\", abVar4);\n return true;\n }\n }\n }\n return false;\n }", "public String[] camposDivididos(){\r\nString[] args=column().split(\"[,]\");\r\nreturn args;\r\n //return Arrays.toString(args);\r\n}", "private static String[] checkInput(String input) throws Exception{\n String[] in = input.trim().split(\" \");\n\n if(in.length == 0){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(CommandEnum.getCommandEnumFrom(in[0]) == null){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(isSpecificCommandENum(in[0],BYE)){\n return in;\n }\n if(isSpecificCommandENum(in[0],TERMINATE)){\n return in;\n }\n\n if(in.length < MIN_PARAM){\n throw new CommandException(ExceptionEnum.LESS_INPUT_EXCEPTION);\n }\n\n if(in.length > MAX_PARAM){\n throw new CommandException(ExceptionEnum.EXTRA_INPUT_EXCEPTION);\n }\n\n //check input value\n for(int i = 1; i < in.length; i++){\n try{\n Integer.parseInt(in[i]);\n }catch(NumberFormatException e){\n throw new CommandException(ExceptionEnum.INVALID_INPUT_EXCEPTION);\n }\n }\n\n return in;\n }", "static List<Intervall> handleInput(String input) {\n\t\tList<Intervall> listIntervall = new ArrayList<>();\n\t\tif (input.length() > 0) {\n\t\t\tString[] inputArray = input.split(\" \");\n\n\t\t\tfor (String s : inputArray) {\n\t\t\t\tString sTrimmed = s.substring(1, s.length() - 1);\n\t\t\t\tString[] inputValues = sTrimmed.split(\",\");\n\t\t\t\tlistIntervall.add(new Intervall(Integer.parseInt(inputValues[0]), Integer.parseInt(inputValues[1])));\n\t\t\t}\n\t\t}\n\t\treturn listIntervall;\n\t}", "static int type_of_sub(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "boolean testShipExplodeAcc(Tester t) {\n return t.checkExpect(this.ship1.explodeAcc(0, 0), this.mt)\n && t.checkExpect(this.ship12.explodeAcc(10, 20), this.mt);\n }", "public void tokenizeAndParse(){\n StringTokenizer st1 = new StringTokenizer(Strinput, \" \");\n while (st1.hasMoreTokens()){\n String temp = st1.nextToken();\n if(!temp.equals(\"Rs\")&&!temp.equals(\"Ri\")){\n melody.add(Integer.decode(temp.substring(0,2)));\n }\n\n }\n\n }", "private static void parse(String[] command, Player p, RoomManager rm, ItemManager im, ArrayList<Item> a, Bear bear) {\n\t\t\t\n\t\tif(command.length == 2) {\t\t\t\n\t\t\tswitch(command[0]) {\n\t\t\tcase \"go\":\t\t\t\t\n\t\t\t\tswitch(command[1]) {\n\t\t\t\tcase \"clearing\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[0]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"bears\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[1]);\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"grotto\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[2]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"cave\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[3]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"storage\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[5]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"passageway\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[7]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outside\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[2]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"tunnel\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[3]);\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"enter\":\n\t\t\t\t\n\t\t\t\tif(hasItem(a,im,1)) {\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[8]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\nIt seems something magical is required to travel through this portal.\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"swim\":\t\t\t\n\t\t\t\tswitch(command[1]) {\n\t\t\t\t\n\t\t\t\t// sets description depending on which way you enter the rooms\n\t\t\t\tcase \"pond\":\n\t\t\t\t\t\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[7]);\t\t\t\t\n\t\t\t\t\trm.rooms[7].setShortDesc(\"swimming in the pond, you found a small cave entrance underwater and explore it\\n\");\n\t\t\t\t\trm.rooms[7].setLongDesc(\"Upon entering the cave from the tunnel in the pond, you enter a small room \\ninside of a larger cave complex.\"\n\t\t\t\t\t\t\t+ \" You can see a larger cavern through a tunnel off \\nthe left as well as the remains of a fire. \\n\"\n\t\t\t\t\t\t\t+ \"\\ngo through tunnel\\n\"\n\t\t\t\t\t\t\t+ \"swim in water\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"water\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[2]);\n\t\t\t\t\trm.rooms[7].setShortDesc(\"As you come to the end of the passageway, you find yourself in a small room\\n\");\n\t\t\t\t\trm.rooms[7].setLongDesc(\"You enter into the small room from the passageway leading away from the cavern.\"\n\t\t\t\t\t\t\t+ \" In front \\nof you is what appears to be the remains of a fire pit, and to your right is a a pool of water \\n\"\n\t\t\t\t\t\t\t+ \"\\ngo through tunnel\\n\"\n\t\t\t\t\t\t\t+ \"swim in water\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"climb\":\n\t\t\t\t\n\t\t\t\t// Separate key words to denote traveling direction in certain rooms\n\t\t\t\tswitch(command[1]) {\n\t\t\t\tcase \"down\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[3]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"plateau\":\n\t\t\t\t\tp.setCurrentRoom(rm.rooms[4]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"sit\":\n\t\t\t\t\n\t\t\t\t// victory condition / if you gave bear a fish, you dont die\n\t\t\t\tif(bear.getHungry()){\n\t\t\t\t\tSystem.out.println(\"\\nYou have died.\");\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\nThe bears sit next to you as they eat the fish.\\n\");\n\t\t\t\t\tSystem.out.println(\"You have won the game and befriended the bears!\\n\");\n\t\t\t\t}\n\t\t\t\tb = false;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"give\":\n\t\t\t\t\n\t\t\t\t// make bear not hungry\n\t\t\t\tbear.setHungry(false);\n\t\t\t\tbear.setFriendly(true);\n\t\t\t\tremoveItem(a,im);\n\t\t\t\trm.rooms[1].setLongDesc(\"the Mama Bear feasts upon the fish as her cubs approach you to play.\"\n\t\t\t\t\t\t+ \"\\n\\nsit and play\\n\"\n\t\t\t\t\t\t+ \"go towards grotto\"\n\t\t\t\t\t\t+ \"\");\n\t\t\t\tbreak;\n\t\t\tcase \"use\":\t\t\t\t\n\t\t\t\tfish(a,im);\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"check\":\n\t\t\t\tprintInventory(im, a);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"craft\":\n\t\t\t\tcraftItem(a,im,4,5,6);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"open\":\n\t\t\t\tswitch(command[1]) {\n\t\t\t\t\tcase \"basket\":\n\t\t\t\t\t\ta.add(im.allItems[4]);\n\t\t\t\t\t\tSystem.out.println(im.allItems[4].getLongDesc());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"cabinet\":\n\t\t\t\t\t\ta.add(im.allItems[5]);\n\t\t\t\t\t\tSystem.out.println(im.allItems[5].getLongDesc());\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// exit clause\n\t\t\tcase \"teleport\":\n\t\t\t\tb = false;\t\n\t\t\t\tbreak;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// goodbye statement\n\t\t\tif(b == false) {\n\t\t\t\tSystem.out.println(\"Fare thee well, Traveler\");\n\t\t\t} else {\n\t\t\t\tprintRoom(p, a, im, rm);\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"please enter a valid command.\");\n\t\t}\n\t}", "protected String[] arrayParser(String item){\n return item.replaceAll(\"\\\\{|\\\\}|\\\\[|\\\\]|(\\\\d+\\\":)|\\\"|\\\\\\\\\", \"\").split(\",\");\n }", "static int type_of_mvi(String passed){\n\t\tif(passed.charAt(4)!='M')\n\t\t\treturn 1;\n\t\telse if(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "private List<String> getCombo(boolean isCustomer){\n List<String> isi = new ArrayList<>();\n String[] daftar = new String[datas.size()];\n for (String data : datas) {\n daftar = data.split(\";\");\n if (isCustomer) isi.add(daftar[1]);\n else isi.add(daftar[0]);\n }\n return isi;\n}", "public static String enemigos(){\n int numeroEnemigo; //variables locales a utilizar\n String enemigoSeleccionado;\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n \n numeroEnemigo= (numeroAleatorio.nextInt(3)+1);\n //comparando los enemigos disponibles\n switch(numeroEnemigo){\n case 1:{\n enemigoSeleccionado= \"Dark_Wolf\";\n\t\t puntosDeVidaEnemigo=150;\n return enemigoSeleccionado;//retornando a enemigo Dark\n }\n case 2:{\n enemigoSeleccionado= \"Dragon\";\n\t\t puntosDeVidaEnemigo=155;\n return enemigoSeleccionado;//retornando a enemigo Dragon\n }\n default:{\n enemigoSeleccionado= \"Migthy_Golem\";\n\t\t puntosDeVidaEnemigo=160;\n return enemigoSeleccionado;//retornando a enemigo Golem \n }\n } \n }", "private static int getCommaBehind(AnalyzedTokenReadings[] tokens, List<Integer> verbs, int start, int end) {\n if(verbs.size() == 1) {\n if(isSeparator(tokens[verbs.get(0) + 1].getToken())) {\n return -1;\n }\n return verbs.get(0);\n } else if(verbs.size() == 2) {\n if(isSpecialPair(tokens, verbs.get(0), verbs.get(1))) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1)) {\n return -1;\n }\n return verbs.get(1);\n } else if(verbs.get(0) + 1 == verbs.get(1)) {\n if(isTwoCombinedVerbs(tokens[verbs.get(0)], tokens[verbs.get(1)])) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1) || isKonAfterVerb(tokens, verbs.get(1), end)) {\n return -1;\n }\n return verbs.get(1);\n }\n } else if(verbs.get(0) + 2 == verbs.get(1)) {\n if(isThreeCombinedVerbs(tokens, verbs.get(0), verbs.get(1))) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1)) {\n return -1;\n }\n return verbs.get(1);\n }\n }\n if(isPar(tokens[verbs.get(0)]) || isPerfect(tokens, verbs.get(0), verbs.get(1))\n || isInfinitivZu(tokens, verbs.get(1)) || isSpecialInf(tokens, verbs.get(0), verbs.get(1), start)) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1)) {\n return -1;\n }\n return verbs.get(1);\n }\n } else if(verbs.size() == 3) {\n if(isTwoPlusCombinedVerbs(tokens, verbs.get(0), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n } else if(verbs.get(0) + 2 == verbs.get(2)) {\n if(verbs.get(0) + 1 == verbs.get(1) && isThreeCombinedVerbs(tokens, verbs.get(0), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n }\n } else if(verbs.get(0) + 3 == verbs.get(2) && isFourCombinedVerbs(tokens, verbs.get(0), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n } else if(tokens[verbs.get(2)].hasPosTagStartingWith(\"VER:MOD:\")\n && isSpecialPair(tokens, verbs.get(0), verbs.get(1))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n }\n if(isPerfect(tokens, verbs.get(0), verbs.get(1), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(1);\n }\n }\n return verbs.get(0);\n }", "static SexType checkSex(String data){\n if(data.contains(\"M\"))\n return SexType.MALE;\n else\n return SexType.FEMALE;\n }", "private static boolean m1034a(int i, String str, Object... objArr) {\n if (!f1188c) {\n return false;\n }\n if (str == null) {\n str = \"null\";\n } else if (!(objArr == null || objArr.length == 0)) {\n str = String.format(Locale.US, str, objArr);\n }\n switch (i) {\n case 0:\n Log.i(f1187b, str);\n return true;\n case 1:\n Log.d(f1187b, str);\n return true;\n case 2:\n Log.w(f1187b, str);\n return true;\n case 3:\n Log.e(f1187b, str);\n return true;\n case 5:\n Log.i(f1186a, str);\n return true;\n default:\n return false;\n }\n }", "@Override \n\tpublic void caseAOpExpr(AOpExpr node){\n\t\tExpressionType expType = (ExpressionType) nodeTypes.get(node.getOp()); \n\t\tswitch (expType){\n\t\t\tcase AND :\n\t\t\tcreateShortCircuitAnd(node);\n\t\t\t\tbreak;\n\t\t\tcase OR :\n\t\t\tcreateShortCircuiteOR(node);\n\t\t\t\tbreak;\n\t\t\tcase ADD :\n\t\t\t\tType left = nodeTypes.get(node.getLeft()); \n\t\t\t\tif (left == Type.STRING_TYPE){\n\t\t\t\t\tthis.createStringConcat(node);\n\t\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\tdefault : \n\t\t\t\tsuper.caseAOpExpr(node); \n\t\t}\n\t}", "void convertWordToMorse(String word) {\n StringBuilder sb = new StringBuilder();\n for (char letter: word.toCharArray()) {\n String strLetter = Character.toString(letter);\n sb.append(morseMap.get(strLetter));\n }\n String morse = sb.toString();\n if (dictionary.get(morse)==null) {\n dictionary.put(morse, new ArrayList<>());\n }\n dictionary.get(morse).add(word);\n }", "static void perform_mvi(String passed){\n\t\tint type = type_of_mvi(passed);\n\t\tif(type==1)\n\t\t\tmvi_to_reg(passed);\n\t\telse if(type==2)\n\t\t\tmvi_to_mem(passed);\n\t}", "private static String[] sepInst(String inst){\n\n String[] separated = new String[3];\n separated[0] = inst.substring(0, inst.indexOf(' '));\n if(-1 == inst.indexOf(',')){//enters if when only one variable\n separated[1] = inst.substring(inst.indexOf(' ')+1, inst.length());\n }else{//enters else when only when two variables\n separated[1] = inst.substring(inst.indexOf(' ')+1, inst.indexOf(','));\n separated[2] = inst.substring(inst.indexOf(',')+2, inst.length());\n }//end ifelse\n\n return separated;\n }", "private void processIdentificator() {\r\n\t\tString identificator = generateString();\r\n\r\n\t\tif (identificator.equals(Constants.AND_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.AND_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.XOR_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.XOR_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.OR_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.OR_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.NOT_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.NOT_STRING);\r\n\r\n\t\t} else if (identificator.equals(trueString)) {\r\n\t\t\ttoken = new Token(TokenType.CONSTANT, true);\r\n\r\n\t\t} else if (identificator.equals(falseString)) {\r\n\t\t\ttoken = new Token(TokenType.CONSTANT, false);\r\n\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.VARIABLE, identificator.toUpperCase());\r\n\t\t}\r\n\t}", "private static boolean special_optimization(String a)\n {\n int sum = 0;\n for(int x = 0; x < a.length(); x++)\n {\n sum += (find_value(\"\"+a.charAt(x)));\n }\n if(sum <= library.return_uppervalue() && sum >= library.return_lowervalue())\n return false;\n return true;\n }", "@Override\n public void execute() {\n\n String value=\"\";\n ////System.out.println(expCtx.printBlock().printExtra().arrayCall().getText());\n boolean chh = false;\n try {\n chh = expCtx.printBlock().printExtra().expression().assignmentExpression().assignment().additiveExpression().multiplicativeExpression().unaryExpression().unaryExpressionNotPlusMinus().postfixExpression().primary().arrayCall()!=null;\n }catch (NullPointerException e){\n\n }\n if (expCtx.printBlock().printExtra().arrayCall()!=null\n ||chh){\n //System.out.println(\"FOUND ARRAY\");\n List<Integer> matchList = new ArrayList<Integer>();\n Pattern regex = Pattern.compile(\"\\\\[(.*?)\\\\]\");\n //System.out.println(expCtx.printBlock().getText());\n Matcher regexMatcher = regex.matcher(expCtx.printBlock().getText());\n List<Integer> dummy = null;\n while (regexMatcher.find()) {//Finds Matching Pattern in String\n //System.out.println(\"IN MATCHER\");\n //System.out.println(ClypsCustomVisitor.testingExpression(regexMatcher.group(1).trim(), dummy, expCtx.start.getLine()));\n matchList.add(Integer.parseInt(ClypsCustomVisitor.testingExpression(regexMatcher.group(1).trim(), dummy, expCtx.start.getLine())));//Fetching Group from String\n }\n value = ClypsCustomVisitor.testingExpression(expCtx.printBlock().getText(), matchList, expCtx.start.getLine());\n //System.out.println(value);\n }else {\n //System.out.println(\"NOT ARRAY\");\n List<Integer> dummy = null;\n value = ClypsCustomVisitor.testingExpression(expCtx.printBlock().getText(), dummy, expCtx.start.getLine());\n //System.out.println(value);\n }\n\n if (value.contains(\"\\\"\")&&value.matches(\".*[a-zA-Z]+.*\")&&value.matches(\".*[0-9]+.*\")){\n //System.out.println(\"WE IN\");\n String[] temp = value.split(\"\\\\+\");\n ArrayList<String> store = new ArrayList<>();\n for (int i = 0;i<temp.length;i++){\n try {\n store.add(new Expression(temp[i]).eval().toPlainString());\n }catch (NullPointerException e){\n store.add(temp[i]);\n }\n }\n String send=\"\";\n for (String i:store){\n //System.out.println(i);\n send=send.concat(i);\n }\n //System.out.println(\"WE OUT\");\n //System.out.println(send);\n\n send=send.replaceAll(\"\\\"\",\"\").replaceAll(\"\\\\+\",\"\");\n ////System.out.println(\"ACTUAL PRINT\");\n if (expCtx.printHead().getText().contains(\"ln\"))\n System.out.println(send);\n else\n System.out.print(send);\n }else {\n //System.out.println(\"YEP\");\n //CAUTION: REPLACES ALL + SIGNS\n value=value.replaceAll(\"\\\"\",\"\").replaceAll(\"\\\\+\",\"\");\n ////System.out.println(\"ACTUAL PRINT\");\n if (expCtx.printHead().getText().contains(\"ln\"))\n System.out.println(value);\n else\n System.out.print(value);\n }\n\n\n\n\n\n }", "public void mo44054a(String str, Object obj) {\n if (this.f41052d == null) {\n this.f41052d = new ArrayList(this.f41051c != null ? 2 : 1);\n }\n if (this.f41051c != null) {\n this.f41052d.add(str);\n }\n int i = 0;\n if (obj instanceof byte[]) {\n byte[] bArr = (byte[]) obj;\n ArrayList arrayList = new ArrayList(bArr.length);\n int length = bArr.length;\n while (i < length) {\n arrayList.add(Byte.valueOf(bArr[i]));\n i++;\n }\n this.f41052d.add(arrayList);\n } else if (obj instanceof boolean[]) {\n boolean[] zArr = (boolean[]) obj;\n ArrayList arrayList2 = new ArrayList(zArr.length);\n int length2 = zArr.length;\n while (i < length2) {\n arrayList2.add(Boolean.valueOf(zArr[i]));\n i++;\n }\n this.f41052d.add(arrayList2);\n } else if (obj instanceof short[]) {\n short[] sArr = (short[]) obj;\n ArrayList arrayList3 = new ArrayList(sArr.length);\n int length3 = sArr.length;\n while (i < length3) {\n arrayList3.add(Short.valueOf(sArr[i]));\n i++;\n }\n this.f41052d.add(arrayList3);\n } else if (obj instanceof char[]) {\n char[] cArr = (char[]) obj;\n ArrayList arrayList4 = new ArrayList(cArr.length);\n int length4 = cArr.length;\n while (i < length4) {\n arrayList4.add(Character.valueOf(cArr[i]));\n i++;\n }\n this.f41052d.add(arrayList4);\n } else if (obj instanceof int[]) {\n int[] iArr = (int[]) obj;\n ArrayList arrayList5 = new ArrayList(iArr.length);\n int length5 = iArr.length;\n while (i < length5) {\n arrayList5.add(Integer.valueOf(iArr[i]));\n i++;\n }\n this.f41052d.add(arrayList5);\n } else if (obj instanceof long[]) {\n long[] jArr = (long[]) obj;\n ArrayList arrayList6 = new ArrayList(jArr.length);\n int length6 = jArr.length;\n while (i < length6) {\n arrayList6.add(Long.valueOf(jArr[i]));\n i++;\n }\n this.f41052d.add(arrayList6);\n } else if (obj instanceof float[]) {\n float[] fArr = (float[]) obj;\n ArrayList arrayList7 = new ArrayList(fArr.length);\n int length7 = fArr.length;\n while (i < length7) {\n arrayList7.add(Float.valueOf(fArr[i]));\n i++;\n }\n this.f41052d.add(arrayList7);\n } else if (obj instanceof double[]) {\n double[] dArr = (double[]) obj;\n ArrayList arrayList8 = new ArrayList(dArr.length);\n int length8 = dArr.length;\n while (i < length8) {\n arrayList8.add(Double.valueOf(dArr[i]));\n i++;\n }\n this.f41052d.add(arrayList8);\n } else {\n this.f41052d.add(obj);\n }\n }", "String convert(String msg) {\n for (int i = 0; i < msg.length(); i++) {\n if (msg.charAt(i) < 65 || msg.charAt(i) > 90) {\n throw new EnigmaException(\"Illegal input\");\n }\n }\n int index = 0;\n String result = \"\";\n while (index < msg.length()) {\n int num = msg.charAt(index) - 65;\n if (manyRotors[4].atNotch() && !manyRotors[3].atNotch()) {\n manyRotors[4].advance();\n manyRotors[3].advance();\n } else if (manyRotors[3].atNotch()) {\n manyRotors[4].advance();\n manyRotors[3].advance();\n manyRotors[2].advance();\n } else manyRotors[4].advance();\n for (int i = manyRotors.length - 1; i > 0; i--) {\n num = manyRotors[i].convertForward(num);\n }\n for (int i = 0; i < manyRotors.length; i++) {\n num = manyRotors[i].convertBackward(num);\n }\n result += String.valueOf((char) (num + 65));\n index++;\n }\n return result;\n //return null;\n // FIXME\n }", "private void validSyntaxis(char[] fun){\n\t\tString valores = \"(a+/*-^\";\n\t\tString valores1 =\"(+/*-^\";\n\t\tString operadores =\"+/*-^\";\n\t\tString valores2 =\"(+-yzxuvwlmnjkpstc123456789e0ai\";\n\t\t//String valores2 =\"(+-xyzstc123456789e0ai\";\n\t\t//String valores3 =\"x1234567890\";\n\t\tString valores3 =\"x1234567890\";\n\t\tString valores4 =\"1234567890\";\n\t\tint pos = fun.length-1;\n\n\t\tif(pos == 0){\n\t\t\tif(valores2.indexOf(fun[pos]) == -1)\n\t\t\t\tcont++;\n\t\t\telse\n\t\t\t\tif(valores2.indexOf(fun[pos]) == 0)\n\t\t\t\t\tcont2++;\n\n\t\t}\n\n\t\telse if(pos >= 1){\n\t\t\tchar aux = fun[pos];\n\t\t\tchar aux2 = fun[pos-1];\n\n\t\t\t//Caracter 'a','A'\n\t\t\tif(aux == 'a'){\n\t\t\t\tif(valores1.indexOf(aux2) == -1 && aux2 != 't')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'i' || aux == 'e'){\n\t\t\t\tif(aux2 != 's' && valores1.indexOf(aux2) == -1)\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 's'){\n\t\t\t\tif(aux2 != 'c' && valores.indexOf(aux2) == -1 && aux2 != 'b' && aux2 != 'o')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'c'){\n\t\t\t\tif(aux2 != 's' && valores.indexOf(aux2) == -1 && aux2 != 'e')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 't'){\n\t\t\t\tif(aux2 != 'r' && valores.indexOf(aux2) == -1 && aux2 != 'o')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'o'){\n\t\t\t\tif(aux2 != 'c')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'b'){\n\t\t\t\tif(aux2 != 'a')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'n'){\n\t\t\t\tif(aux2 != 'i' && aux2 != 'a')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'x'){\n\t\t\t\tif(valores4.indexOf(aux2) != -1)\n\t\t\t\t\tcont++;\n\n\t\t\t}\n\n\n\t\t\telse if(aux == 'h'){\n\t\t\t\tif(aux2 != 'n' && aux2 != 's' && aux2 != 'c' && aux2 != 't')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'r'){\n\t\t\t\tif(aux2 != 'q')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '.'){\n\t\t\t\t\n\t\t\t\tif(valores4.indexOf(aux2) == -1)\n\t\t\t\t\tcont++;\n\n\t\t\t\tboolean existe = false;\n\t\t\t\tint i = pos;\n\t\t\t\twhile(operadores.indexOf(fun[i]) == -1 && i > 0){\n\t\t\t\t\tif(existe && fun[i] == '.'){\n\t\t\t\t\t\tcont++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(fun[i] == '.')\n\t\t\t\t\t\texiste = true;\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if(aux == 'q'){\n\t\t\t\tif(aux2 != 's')\n\t\t\t\t\tcont++;\n\t\t\t\tif(pos > 1)\n\t\t\t\t\tif(fun[pos-2] == 'o' || fun[pos-2] == 'b' || fun[pos-2] == 'c' || fun[pos-2] == 'a')\n\t\t\t\t\t\tcont++;\n\t\t\t}\n\t\t\n\t\t\telse if(valores3.indexOf(aux) != -1){\n\t\t\t\tif(valores1.indexOf(aux2) == -1 && aux2 != '(' && valores4.indexOf(aux2) == -1 && aux2 != '.')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '('){\n\t\t\t\tcont2++;\n\t\t\t\tif(aux2 != 'n' && aux2 != 's' && aux2 != 'c' && aux2 != 't' && aux2 != 'h' && valores1.indexOf(aux2) == -1)\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == ')'){\n\t\t\t\tcont2--;\n\t\t\t\tif(valores3.indexOf(aux2) == -1 && aux2 != ')')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '+' || aux == '-'){\n\t\t\t\tif(valores3.indexOf(aux2) == -1 && aux2 != ')' && aux2 != '(' && aux2 != '^')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '/' || aux == '*' || aux == '^'){\n\t\t\t\tif(valores3.indexOf(aux2) == -1 && aux2 != ')')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\tif((aux2 == '/' || aux2 == '*' || aux2 == '^') && pos == 1)\n\t\t\t\tcont++;\n\t\t}\n\n\t\tif(cont > 0 || cont2 != 0)\n\t\t\tthis.setBackground(Color.RED);\n\t\telse\n\t\t\tthis.setBackground(Color.GREEN);\n\t}", "public Map<String, Object> processArgs(String[] args)\n {\n for (int ii=0; ii<args.length; ii++) {\n String token = args[ii];\n char firstC = token.charAt(0);\n if (firstC != '-' && firstC != '+') {\n return null;\n }\n // look up the token\n token = token.substring(1);\n String type = _meta.get(token);\n if (type == null) {\n return null;\n }\n\n // most types expect a following token - check\n Object argument = null;\n if (StringArg.equals(type) || ListArg.equals(type) || IntegerArg.equals(type)) {\n if (args.length < ii+2) {\n return null;\n }\n if (firstC != '-') {\n // these types all expect a - in front of the token\n return null;\n }\n argument = args[ii+1];\n ii++;\n }\n if (DoubleListArg.equals(type)) {\n if (args.length < ii+3) {\n return null;\n }\n if (firstC != '-') {\n return null;\n }\n String[] a2 = new String[2];\n a2[0] = args[ii+1];\n a2[1] = args[ii+2];\n argument = a2;\n ii += 2;\n }\n\n Object old;\n if (StringArg.equals(type)) {\n old = _result.put(token, argument);\n if (old != null) {\n return null;\n }\n }\n else if (ListArg.equals(type)) {\n List<String> oldList = (List<String>)_result.get(token);\n if (oldList == null) {\n oldList = new ArrayList<String>();\n _result.put(token, oldList);\n }\n oldList.add((String)argument);\n }\n else if (DoubleListArg.equals(type)) {\n List<String[]> oldList = (List<String[]>)_result.get(token);\n if (oldList == null) {\n oldList = new ArrayList<String[]>();\n _result.put(token, oldList);\n }\n oldList.add((String[])argument);\n }\n else if (IntegerArg.equals(type)) {\n Integer val = Integer.parseInt((String)argument);\n old = _result.put(token, val);\n if (old != null) {\n return null;\n }\n }\n else if (FlagArgFalse.equals(type) || FlagArgTrue.equals(type)) {\n // note that we always have a default value for flag args\n Boolean val = (firstC == '-');\n _result.put(token, val);\n }\n }\n\n return _result;\n }", "private static int m106811b(List<Aweme> list, String str) {\n if (list == null) {\n return 0;\n }\n for (Aweme aweme : list) {\n if (aweme != null && aweme.getAuthor() != null && C23472a.m77066a(aweme.getAuthor().getUid(), str)) {\n return aweme.getEnterpriseType();\n }\n }\n return 0;\n }", "public String processMessage() throws ICANException {\n String aSegment;\n HL7Group aGroup;\n HL7Message aInMess = new HL7Message(mHL7Message);\n HL7Segment aInMSHSegment = new HL7Segment(aInMess.getSegment(\"MSH\"));\n HL7Segment aOutMSHSegment = processMSHToUFD();\n if (mEnvironment.indexOf(\"TEST\") >= 0) {\n String aSendingApp = aOutMSHSegment.get(HL7_23.MSH_3_sending_application);\n if (aSendingApp.indexOf(\".TEST\") >= 0) {\n aOutMSHSegment.set(HL7_23.MSH_3_sending_application, aSendingApp.substring(0, aSendingApp.length() - 5));\n }\n }\n HL7Message aOutMess = new HL7Message(aOutMSHSegment.getSegment());\n\n if(aInMess.isEvent(\"A01, A02, A03, A08, A11, A12, A13, A21, A22, A28, A31\")) {\n aOutMess.append(processEVNToUFD());\n aOutMess.append(processPIDToUFD());\n aOutMess.append(processNK1s_ToUFD());\n aOutMess.append(processPV1ToUFD());\n aOutMess.append(processPV2ToUFD());\n aOutMess.append(processOBXs_ToUFD());\n aOutMess.append(processAL1s_ToUFD());\n aOutMess.append(processDG1s_ToUFD());\n aOutMess.append(processDRGToUFD());\n aOutMess.append(processPR1s_ToUFD());\n aOutMess.append(processGT1s_ToUFD());\n aOutMess.append(processInsuranceToUFD());\n aOutMess.append(processCSC_ZsegmentsToUFD());\n\n } else if (aInMess.isEvent(\"A17\")) {\n aOutMess.append(processEVNToUFD().getSegment());\n aOutMess.append(processA17GroupToUFD(1));\n aOutMess.append(processA17GroupToUFD(2));\n\n } else if (aInMess.isEvent(\"A34\")) {\n aOutMess.append(processEVNToUFD().getSegment());\n aOutMess.append(processPIDToUFD().getSegment());\n aOutMess.append(processMRGToUFD().getSegment());\n }\n if (aOutMess.getMessage().length() > 0) {\n aOutMess.append(setupZBX(\"MESSAGE\", \"SOURCE_ID\", aInMSHSegment.get(HL7_23.MSH_10_message_control_ID)));\n }\n return aOutMess.getMessage();\n }", "private String[] Asignacion(String texto) {\n String[] retorno = new String[2];\n try {\n retorno = texto.split(\"=\");\n if (retorno.length == 2) {\n if (retorno[0].toLowerCase().contains(\"int\")) {\n if (retorno[0].contains(\"int\")) {\n if (retorno[0].startsWith(\"int\")) {\n String aux[] = retorno[0].split(\"int\");\n if (aux.length == 2) {\n retorno[0] = \"1\";//aceptacion\n retorno[1] = aux[1];//nombre variable\n } else {\n retorno[0] = \"0\";//error\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n } else {\n retorno[0] = \"0\";//error\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"se encuentra mal escrito el int.\";\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"no se encontro la palabra reservada int.\";\n }\n } else {\n retorno[0] = \"0\";\n retorno[1] = \"mala construcción de la sentencia.\";\n }\n } catch (Exception e) {\n System.out.println(\"Error en Asignacion \" + e.getClass());\n } finally {\n return retorno;\n }\n }", "public float[][] valunitSeparate(String[] data, String ps) {\n int eq=0,i;\n int u=0,sum=0;\n String units[],values[];\n String unknown;\n int un[];\n float[][] val = new float[3][2];\n un = new int[3]; //stores integer values corresponding to each var\n units = new String[3];\n values = new String[3];\n\n for(i=0;i<3;i++) {\n units[i] = \"\";\n values[i] = \"\";\n }\n\n for(i=0;i<3;i++) {\n for(int j=0;j<data[i].length();j++) {\n String c = \"\";\n c=c+data[i].charAt(j);\n if(Pattern.matches(\"[0-9]*\\\\.?[0-9]*\",c)) {\n values[i] = values[i]+c;\n } else {\n units[i] = units[i]+c;\n }\n }\n }\n\n unknown = ai.unknownFnd(ps); //contains the unknown var\n\n for (i=0;i<3;i++) {\n if (Objects.equals(units[i], \"m/ssq\"))\n un[i] = 3;\n else if (Objects.equals(units[i], \"s\"))\n un[i] = 4;\n else if(Objects.equals(units[i], \"m\"))\n un[i] = 5;\n else if (Objects.equals(units[i], \"m/s\")) {\n if (Objects.equals(unknown, \"u\"))\n un[i] = 1;\n else if (Objects.equals(unknown, \"v\"))\n un[i] = 2;\n else\n un[i] = 2;\n }\n }\n\n for (i=0;i<3;i++) {\n val[i][0] = Float.parseFloat(values[i]);\n val[i][1] = un[i];\n }\n\n return (val);\n }", "public static String convertOrarioToFascia(String data) {\n String[] data_splitted = data.split(\" \");\n String orario = data_splitted[1];\n String[] ora_string = orario.split(\":\");\n Integer ora = Integer.parseInt(ora_string[0]);\n if(ora<12){\n return \"prima\";\n }else{\n return \"seconda\";\n }\n }", "private String[] parseSMSBody(String smsBody) {\n if (smsBody.contains(SMS_KEY_OPERATION_SUM)) {\n String[] resultData1 = smsBody.split(\" po \");\n String part01 = resultData1[0].split(SMS_KEY_OPERATION_SUM)[1].trim().replace(\" \", \"\");\n String value = part01.replaceAll(\"[A-Za-z]\", \"\");\n String currency = part01.replaceAll(\"[^A-Za-z]\", \"\");\n String description = resultData1[1].split(SMS_KEY_AMOUNT_LEFT)[0];\n String cardPattern = getCardNumber();\n String accountPattern = getAccountNumber();\n String descriptionResult;\n if (description.contains(cardPattern)) {\n descriptionResult = description.split(cardPattern)[1].trim();\n } else {\n descriptionResult = description.split(accountPattern)[1].trim();\n }\n\n\n String[] currencyArray = getContext().getResources().getStringArray(R.array.report_activity_currency_spinner);\n if (!value.isEmpty() && !currency.isEmpty() && Utils.isNumber(value) && Arrays.asList(currencyArray).contains(currency)) {\n\n return new String[]{value, currency, descriptionResult};\n }\n\n\n }\n return new String[]{\"\", \"\", \"\"};\n }", "private void getEachElementOfTheLine() {\n int nbOfComa = 0;\n String idItemCraft = \"\";\n ArrayList<String> idItemNeeded = new ArrayList<>();\n ArrayList<String> quantityItemNeeded = new ArrayList<>();\n boolean isFinished = false;\n for (int c = 0; c < line.length() && !isFinished; c++) {\n switch (nbOfComa) {\n\n case 2:\n quantityItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == '.') {\n isFinished = true;\n } else if (line.charAt(c + 1) == ';') {\n nbOfComa = 1;\n c++;\n }\n break;\n\n case 1:\n idItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == ',') {\n nbOfComa++;\n c++;\n }\n break;\n\n case 0:\n idItemCraft = idItemCraft + line.charAt(c);\n if (line.charAt(c + 1) == ';') {\n nbOfComa++;\n c++;\n }\n break;\n\n default:\n break;\n }\n }\n this.idItemCraft = idItemCraft;\n this.idItemNeeded = idItemNeeded;\n this.quantityItemNeeded = quantityItemNeeded;\n }", "public String[] processString(String sMath){\n String s1 = \"\", elementMath[];\r\n sMath = sMath.trim();\r\n sMath = sMath.replaceAll(\"\\\\s+\",\" \"); // chuan hoa sMath\r\n for (int i=0; i<sMath.length(); i++){\r\n char c = sMath.charAt(i);\r\n if (!isOperator(c)) s1 = s1 + c;\r\n else s1 = s1 + \" \" + c + \" \";\r\n }\r\n s1 = s1.trim();\r\n s1 = s1.replaceAll(\"\\\\s+\",\" \"); // chuan hoa s1\r\n elementMath = s1.split(\" \"); //tach s1 thanh cac phan tu\r\n return elementMath;\r\n }", "public void HandleLejos(Integer old_position, Integer new_position){\n int compare = new_position-old_position;\n switch (compare){\n case(1):\n Lejos.Right();\n Lejos.TimeToBombSound = TIME_STRAIGHT+TIME_SIDE*2;\n break;\n case(-1):\n Lejos.Left();\n Lejos.TimeToBombSound = TIME_STRAIGHT+TIME_SIDE*2;\n break;\n case(-10):\n Lejos.Forward();\n Lejos.TimeToBombSound = TIME_STRAIGHT;\n break;\n case(10):\n Lejos.Back();\n Lejos.TimeToBombSound = TIME_STRAIGHT;\n break;\n case(-9):\n Lejos.ForwardRight();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n case(9):\n Lejos.BackLeft();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n case(-11):\n Lejos.ForwardLeft();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n case(11):\n Lejos.BackRight();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n }\n checkBombs(new_position);\n }", "public void splitData(String fullData){\n\t\t\n\t\tDictionary<String> strings = new Dictionary<>();\n\t\tDictionary<Float> floats = new Dictionary<>();\n\t\tDictionary<Boolean> booleans = new Dictionary<>();\n\t\t\n\t\tList<String> lines = new ArrayList<>(Arrays.asList(fullData.split(\"\\n\")));\n\t\t\n\t\tString[] labels = lines.get(0).split(\",\");\n\t\tlines.remove(0);\n\t\t\n\t\tfor(String line: lines){\n\t\t\tString[] data = line.split(\",\");\n\t\t\t\n\t\t\tfor(int i=0;i<data.length;i++){\n\t\t\t\t\n\t\t\t\t//placeholder since current data has no actual booleans\n\t\t\t\tif(labels[i].equals(\"autoBaselineGroup\") || labels[i].equals(\"autoGear\") || labels[i].equals(\"Did Climb\") || labels[i].equals(\"died\") || labels[i].equals(\"defense\")){\n\t\t\t\t\tif(data[i].equals(\"1\")){\n\t\t\t\t\t\tbooleans.add(labels[i], true);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tbooleans.add(labels[i], false);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//check what type it is\n\t\t\t\tSystem.out.println(number);\n\t\t\t\ttry{\n\t\t\t\t\tswitch(labels[i]){\n\t\t\t\t\tcase \"Round\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"Date and Time Of Match\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"UUID\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"end\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfloats.add(labels[i], Float.parseFloat(data[i]));\n\t\t\t\t\tcontinue;\n\t\t\t\t} catch(NumberFormatException e){\n\t\t\t\t\t//not an int, check for bool\n\t\t\t\t\t\n\t\t\t\t\tif(data[i].toLowerCase().contains(\"true\")){\n\t\t\t\t\t\tbooleans.add(labels[i], true);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(data[i].toLowerCase().contains(\"false\")){\n\t\t\t\t\t\tbooleans.add(labels[i], false);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//must be string\n\t\t\t\t\tdata[i] = \"\\n\\t\"+data[i];\n\t\t\t\t\tdata[i] = data[i].replace(\"|c\", \",\").replace(\"|n\", \"\\n\\t\").replace(\"||\", \"|\").replace(\"|q\", \"\\\"\").replace(\"|;\", \":\");\n\t\t\t\t\tstrings.add(labels[i], data[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint matchNum = getMatchNum(line, labels);\n\t\t\t\n\t\t\tMatch r = new Match(number, matchNum, \"TIME\");\n\t\t\tr.setData(strings, floats, booleans);\n\t\t\tmatches.add(r);\n\t\t\t\n\t\t\tstrings = new Dictionary<>();\n\t\t\tfloats = new Dictionary<>();\n\t\t\tbooleans = new Dictionary<>();\n\t\t}\n\t}", "public static int equipmentAction(String str)\n {\n if (str.equalsIgnoreCase(\"A\") || str.equalsIgnoreCase(\"Armor\"))\n {\n return 1;\n }\n else \n {\n return 2;\n }\n }", "private Vector<String> separateSubs(){\n Vector<String> subs = new Vector<String>();\n StringTokenizer st = new StringTokenizer(masterSubs, \",\");\n\n while(st.hasMoreTokens()){\n subs.add(st.nextToken().toLowerCase());\n }\n\n return subs;\n\t\t\n\t}", "private void splitWord(String wordField) {\n wordsArray = new String[wordField.length()];\n wordsArray = wordField.split(\", *\");\n System.out.println(\"chk1: wordsArray: \" + Arrays.toString(wordsArray));\n //wordMap(words);\n for (int i = 0; i < wordsArray.length; i++) {\n wordsArray[i] = wordsArray[i].toUpperCase();\n wordMap.put(\"word\" + i, new Word(wordsArray[i]));//convert each word to upperCase and add it to wordMap\n }\n\n }", "private static List<Tuple<JsonValue, JsonValue>> parseEffect(JsonValue code, JsonValue payload){\n\t ArrayList<Tuple<JsonValue, JsonValue>> result = new ArrayList<>();\n\t if(code != null && !code.isNull()){\n\t if(code.isString()){\n\t if(payload != null && !payload.isNull()){\n\t result.add(new Tuple<>(code, payload));\n\t } else {\n\t result.add(new Tuple<>(code, null));\n\t }\n\t } else {\n\t addEffectArray(result, code.asArray(), (payload != null)? payload.asArray() : null);\n\t }\n\t }\n\t return result;\n\t}", "static private int ejercicio4(String stringEjemplo){\n\n if (stringEjemplo.contentEquals(\"uno\")){\n return 1;\n }\n if (stringEjemplo.contentEquals(\"dos\")) {\n return 2;\n }\n if (stringEjemplo.contentEquals(\"tres\")){\n return 3;\n }\n if (stringEjemplo.contentEquals(\"cuatro\")){\n return 4;\n }\n if (stringEjemplo.contentEquals(\"cinco\")){\n return 5;\n }\n return -1;\n }", "public String getInternalValueFromInternalValues(String str,String type) {\n\t\tString r = \"\";\n\t\tString[] values = str.split(getOrConcatenatorSplitter());\n\t\tfor (int v = 0; v < values.length; v++) {\n\t\t\tif (values[v].contains(getValueConcatenator())) {\n\t\t\t\tString prefix = values[v].split(getValueConcatenator())[0] + getValueConcatenator();\n\t\t\t\tEntityObject eo = getEntityObject(prefix);\n\t\t\t\tif (eo!=null && (type.length()==0 || eo.getType().equals(type))) {\n\t\t\t\t\tr = values[v];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}", "private static String enemies(double nextInt) {\n\t\treturn null;\n\t}", "public static int complexAction(String str)\n {\n if (str.equalsIgnoreCase(\"Play\") || str.equalsIgnoreCase(\"Start\") || str.equalsIgnoreCase(\"Begin\"))\n {\n return 1;\n }\n else if (str.equalsIgnoreCase(\"Pause\"))\n {\n return 2;\n }\n else if (str.equalsIgnoreCase(\"QUIT\"))\n {\n return 3;\n }\n else\n { return 0;} \n }", "@Override\n public void invoke(SimpleAssetsOperational simpleAssetsOperational, AnalysisContext context) {\n String des = simpleAssetsOperational.getDes();\n if (StringUtils.isBlank(des)) {\n ++index;\n return;\n }\n\n String replace2 = des.replace(\"\\n\", \"\");\n String replace = replace2.replace(\" \", \"\");\n switch (index) {\n case 0:\n break;\n case 1:\n break;\n case 2:\n // 单位名称:定远县分公司 填表人员姓名:吴松 联系方式:18955083799\n break;\n case 3:\n //手工网点总数量\n String var111 = replace.replace(\"个\",\"\");\n if (StringUtils.isNotBlank(var111)){\n int i = Integer.parseInt(var111);\n Result.手工网点总数量 += i;\n }\n break;\n case 4:\n //手工网点人员 人员数量1人的手工网点数量: 11 ;人员数量2人的手工网点数量 0 人员数量1人的手工网点数量:11;人员数量2人的手工网点数量0\n String[] strings = replace.split(\";\");\n for (String info : strings) {\n if (info.contains(\"人员数量1人的手工网点数量\")) {\n String replace1 = info.replace(\":\", \"\");\n String 人员数量1人的手工网点数量 = replace1.replace(\"人员数量1人的手工网点数量\", \"\");\n if (StringUtils.isNotBlank(人员数量1人的手工网点数量)) {\n int i1 = Integer.parseInt(人员数量1人的手工网点数量.replace(\"个\",\"\"));\n Result.人员数量1人的手工网点数量 += i1;\n }\n } else if (info.contains(\"人员数量2人的手工网点数量\")) {\n String replace1 = info.replace(\":\", \"\");\n String 人员数量2人的手工网点数量 = replace1.replace(\"人员数量2人的手工网点数量\", \"\");\n if (StringUtils.isNotBlank(人员数量2人的手工网点数量)) {\n int i1 = Integer.parseInt(人员数量2人的手工网点数量.replace(\"个\",\"\"));\n Result.人员数量2人的手工网点数量 += i1;\n }\n }\n }\n break;\n case 5:\n //设备配备 (PC/手机/PDA) 配置PC的手工网点数量: 2 ;配置手机以及PDA的手工网点数量: 9\n String[] stringss = replace.split(\";\");\n for (String info : stringss) {\n if (info.contains(\"配置PC的手工网点数量\")) {\n String replace1 = info.replace(\":\", \"\");\n String 配置PC的手工网点数量 = replace1.replace(\"配置PC的手工网点数量\", \"\");\n if (StringUtils.isNotBlank(配置PC的手工网点数量)) {\n int i1 = Integer.parseInt(配置PC的手工网点数量.replace(\"个\",\"\"));\n Result.配置PC的手工网点数量 += i1;\n }\n } else if (info.contains(\"配置手机以及PDA的手工网点数量\")) {\n String replace1 = info.replace(\":\", \"\");\n String 配置手机以及PDA的手工网点数量 = replace1.replace(\"配置手机以及PDA的手工网点数量\", \"\");\n if (StringUtils.isNotBlank(配置手机以及PDA的手工网点数量)) {\n int i1 = Integer.parseInt(配置手机以及PDA的手工网点数量.replace(\"个\",\"\"));\n Result.配置手机以及PDA的手工网点数量 += i1;\n }\n }\n }\n break;\n case 6:\n //满足作业需求程度:五星■ 四星□ 三星□ 二星□ 一星□\n //(备注:在所选星数后面涂黑■,星数越多,说明程度越大或评价越高,以下均是如此)\n //满足管理需求程度:五星■ 四星□ 三星□ 二星□ 一星□;\n //从不使用的功能包括: ;\n //建议完善的功能包括: ;\n //建议补充的功能包括: ;\n String[] split = replace.split(\";\");\n if (split.length >= 4) {\n int length = split[0].length();\n int index = split[0].indexOf(\"如此\");\n String 选项1 = split[0].substring(0, index);\n String 选项2 = split[0].substring(index, length);\n String 星 = xuanxing(选项1);\n HashMap<String, Integer> pc满足作业需求程度 = Result.pc满足作业需求程度;\n if (pc满足作业需求程度.containsKey(星)) {\n Integer integer = pc满足作业需求程度.get(星);\n pc满足作业需求程度.put(星, ++integer);\n } else {\n pc满足作业需求程度.put(星, 1);\n }\n\n Result.pc满足作业需求程度 = pc满足作业需求程度;\n 星 = xuanxing(选项2);\n HashMap<String, Integer> pc满足管理需求程度 = Result.pc满足管理需求程度;\n if (pc满足管理需求程度.containsKey(星)) {\n Integer integer = pc满足管理需求程度.get(星);\n pc满足管理需求程度.put(星, ++integer);\n } else {\n pc满足管理需求程度.put(星, 1);\n }\n Result.pc满足管理需求程度 = pc满足管理需求程度;\n // -------2\n String s2 = split[1];\n String var2 = s2.replace(\"从不使用的功能包括:\", \"\");\n if (StringUtils.isNotBlank(var2)) {\n Result.PC端从不使用的功能包括.add(var2);\n }\n\n // -------3\n String s3 = split[2];\n String var3 = s3.replace(\"建议完善的功能包括:\", \"\");\n if (StringUtils.isNotBlank(var3)) {\n Result.PC端建议完善的功能包括.add(var3);\n }\n\n // -------2\n String s4 = split[3];\n String var4 = s4.replace(\"建议补充的功能包括:\", \"\");\n if (StringUtils.isNotBlank(var4)) {\n Result.PC端建议补充的功能包括.add(var4);\n }\n } else {\n throw new NullPointerException();\n }\n\n\n break;\n case 7:\n //满足作业需求程度:五星■ 四星□ 三星□ 二星□ 一星□;\n //满足管理需求程度:五星■ 四星□ 三星□ 二星□ 一星□;\n //从不使用的功能包括: ;\n //建议完善的功能包括: ;\n //建议补充的功能包括: ;\n\n String[] split8 = replace.split(\";\");\n if (split8.length >= 5) {\n String 星 = xuanxing(split8[0]);\n HashMap<String, Integer> 手机满足作业需求程度 = Result.手机满足作业需求程度;\n if (手机满足作业需求程度.containsKey(星)) {\n Integer integer = 手机满足作业需求程度.get(星);\n 手机满足作业需求程度.put(星, ++integer);\n } else {\n 手机满足作业需求程度.put(星, 1);\n }\n Result.手机满足作业需求程度 = 手机满足作业需求程度;\n // 2\n 星 = xuanxing(split8[1]);\n HashMap<String, Integer> 手机满足管理需求程度 = Result.手机满足管理需求程度;\n if (手机满足管理需求程度.containsKey(星)) {\n Integer integer = 手机满足管理需求程度.get(星);\n 手机满足管理需求程度.put(星, ++integer);\n } else {\n 手机满足管理需求程度.put(星, 1);\n }\n Result.手机满足管理需求程度 = 手机满足管理需求程度;\n // -------3\n String s2 = split8[2];\n String var2 = s2.replace(\"从不使用的功能包括:\", \"\");\n if (StringUtils.isNotBlank(var2)) {\n Result.手机端从不使用的功能包括.add(var2);\n }\n\n // -------3\n String s3 = split8[3];\n String var3 = s3.replace(\"建议完善的功能包括:\", \"\");\n if (StringUtils.isNotBlank(var3)) {\n Result.手机建议完善的功能包括.add(var3);\n }\n\n // -------2\n String s4 = split8[4];\n String var4 = s4.replace(\"建议补充的功能包括:\", \"\");\n if (StringUtils.isNotBlank(var4)) {\n Result.手机端建议补充的功能包括.add(var4);\n }\n } else {\n throw new NullPointerException();\n }\n break;\n case 8:\n // 操作过程中系统提示的消息易于理解程度:\n //五星■ 四星□ 三星□ 二星□ 一星□;\n String 星 = xuanxing(replace);\n HashMap<String, Integer> 操作过程中系统提示的消息易于理解程度 = Result.操作过程中系统提示的消息易于理解程度;\n if (操作过程中系统提示的消息易于理解程度.containsKey(星)) {\n int var = 操作过程中系统提示的消息易于理解程度.get(星);\n 操作过程中系统提示的消息易于理解程度.put(星, ++var);\n } else {\n 操作过程中系统提示的消息易于理解程度.put(星, 1);\n }\n Result.操作过程中系统提示的消息易于理解程度 = 操作过程中系统提示的消息易于理解程度;\n break;\n case 9:\n //系统出现问题后,系统给出相应问题诊断的符合程度:\n //五星■ 四星□ 三星□ 二星□ 一星□;\n String 星10 = xuanxing(replace);\n HashMap<String, Integer> 系统出现问题后系统给出相应问题诊断的符合程度 = Result.系统出现问题后系统给出相应问题诊断的符合程度;\n if (系统出现问题后系统给出相应问题诊断的符合程度.containsKey(星10)) {\n int var = 系统出现问题后系统给出相应问题诊断的符合程度.get(星10);\n 系统出现问题后系统给出相应问题诊断的符合程度.put(星10, ++var);\n } else {\n 系统出现问题后系统给出相应问题诊断的符合程度.put(星10, 1);\n }\n Result.系统出现问题后系统给出相应问题诊断的符合程度 = 系统出现问题后系统给出相应问题诊断的符合程度;\n break;\n case 10:\n //系统帮助对解决问题的帮助程度:\n //五星■ 四星□ 三星□ 二星□ 一星□;\n String 星11 = xuanxing(replace);\n HashMap<String, Integer> 系统帮助对解决问题的帮助程度 = Result.系统帮助对解决问题的帮助程度;\n if (系统帮助对解决问题的帮助程度.containsKey(星11)) {\n int var = 系统帮助对解决问题的帮助程度.get(星11);\n 系统帮助对解决问题的帮助程度.put(星11, ++var);\n } else {\n 系统帮助对解决问题的帮助程度.put(星11, 1);\n }\n Result.系统帮助对解决问题的帮助程度 = 系统帮助对解决问题的帮助程度;\n\n break;\n case 11:\n //用户手册等文档对解决问题的帮助程度:\n //五星■ 四星□ 三星□ 二星□ 一星□;\n String 星12 = xuanxing(replace);\n HashMap<String, Integer> 用户手册等文档对解决问题的帮助程度 = Result.用户手册等文档对解决问题的帮助程度;\n if (用户手册等文档对解决问题的帮助程度.containsKey(星12)) {\n int var = 用户手册等文档对解决问题的帮助程度.get(星12);\n 用户手册等文档对解决问题的帮助程度.put(星12, ++var);\n } else {\n 用户手册等文档对解决问题的帮助程度.put(星12, 1);\n }\n Result.用户手册等文档对解决问题的帮助程度 = 用户手册等文档对解决问题的帮助程度;\n break;\n case 12:\n //PC端操作界面友好程度:五星■ 四星□ 三星□ 二星□ 一星□;\n //APP操作界面友好程度: 五星■ 四星□ 三星□ 二星□ 一星□;\n String[] s_13 = replace.split(\";\");\n int lenght = s_13.length;\n if (lenght >= 2) {\n String PC端操作界面友好程度 = s_13[0];\n HashMap<String, Integer> pc端操作界面友好程度 = Result.PC端操作界面友好程度;\n String var = xuanxing(PC端操作界面友好程度);\n if (pc端操作界面友好程度.containsKey(var)) {\n int _v = pc端操作界面友好程度.get(var);\n pc端操作界面友好程度.put(var, ++_v);\n } else {\n pc端操作界面友好程度.put(var, 1);\n }\n Result.PC端操作界面友好程度 = pc端操作界面友好程度;\n\n String APP操作界面友好程度 = s_13[1];\n HashMap<String, Integer> 手机端操作界面友好程度 = Result.手机端操作界面友好程度;\n String var1 = xuanxing(APP操作界面友好程度);\n if (手机端操作界面友好程度.containsKey(var1)) {\n int _v = 手机端操作界面友好程度.get(var1);\n 手机端操作界面友好程度.put(var1, ++_v);\n } else {\n 手机端操作界面友好程度.put(var1, 1);\n }\n Result.手机端操作界面友好程度 = 手机端操作界面友好程度;\n\n } else {\n throw new NullPointerException();\n }\n break;\n case 13:\n //系统容易使用的程度:五星■ 四星□ 三星□ 二星□ 一星□;\n //若感觉到复杂,优化建议: ;\n String[] s_14 = replace.split(\";\");\n int lenght14 = s_14.length;\n if (lenght14 >= 2) {\n String ss = s_14[0];\n HashMap<String, Integer> 系统容易使用的程度 = Result.系统容易使用的程度;\n String var = xuanxing(ss);\n if (系统容易使用的程度.containsKey(var)) {\n int _v = 系统容易使用的程度.get(var);\n 系统容易使用的程度.put(var, ++_v);\n } else {\n 系统容易使用的程度.put(var, 1);\n }\n Result.系统容易使用的程度 = 系统容易使用的程度;\n\n String 优化建议 = s_14[1];\n Result.操作的复杂性建议.add(优化建议.replace(\"若感觉到复杂,优化建议:\", \"\"));\n\n } else {\n throw new NullPointerException();\n }\n break;\n case 14:\n //完成具体任务时的操作简洁程度(操作步骤少):\n //五星■ 四星□ 三星□ 二星□ 一星□;\n //若感觉到操作步骤过多,优化建议: ;\n String[] s_15 = replace.split(\";\");\n int lenght15 = s_15.length;\n if (lenght15 >= 2) {\n String ss = s_15[0];\n HashMap<String, Integer> 操作简洁程度 = Result.操作简洁程度;\n String var = xuanxing(ss);\n if (操作简洁程度.containsKey(var)) {\n int _v = 操作简洁程度.get(var);\n 操作简洁程度.put(var, ++_v);\n } else {\n 操作简洁程度.put(var, 1);\n }\n Result.系统容易使用的程度 = 操作简洁程度;\n\n String 优化建议 = s_15[1];\n Result.操作的复杂性步骤过多建议.add(优化建议.replace(\"若感觉到操作步骤过多,优化建议:\", \"\"));\n\n } else {\n System.out.println(\"解析异常15\");\n }\n break;\n case 15:\n //常见故障名称(或类型): ;\n //系统平均每个月出现的故障次数: 1 次;\n //系统故障时平均持续时间:\n //30分钟内■ 1小时内□ 2小时内□ 2小时以上□;\n //对业务的影响程度:五星□ 四星□ 三星□ 二星□ 一星□;\n //(备注:星数越多,说明影响程度越大)\n //若有影响,请简要说明:\n String[] s_16 = replace.split(\";\");\n if (s_16.length >= 5) {\n String s1 = s_16[0];\n Result.常见故障.add(s1.replace(\"常见故障名称(或类型):\", \"\"));\n\n String s2 = s_16[1];\n String replace1 = s2.replace(\"系统平均每个月出现的故障次数:\", \"\");\n String 次 = replace1.replace(\"次\", \"\");\n if (StringUtils.isNotBlank(次)){\n int i1 = 0;\n if (次.contains(\"-\")){\n i1 = Integer.parseInt(次.split(\"-\")[0]);\n }else {\n i1 = Integer.parseInt(次);\n }\n Result.平均系统出现故障次数 += i1;\n }\n\n\n String s3 = s_16[2];\n String xuanxiaoshi = xuanxiaoshi(s3);\n if (Result.系统故障时平均持续时间.containsKey(xuanxiaoshi)) {\n int count = Result.系统故障时平均持续时间.get(xuanxiaoshi);\n Result.系统故障时平均持续时间.put(xuanxiaoshi,++count);\n }else {\n Result.系统故障时平均持续时间.put(xuanxiaoshi,1);\n }\n\n String s4 = s_16[3];\n String xing = xuanxing(s4);\n if (Result.对业务的影响程度.containsKey(xing)) {\n int count = Result.对业务的影响程度.get(xing);\n Result.对业务的影响程度.put(xing,++count);\n }else {\n Result.对业务的影响程度.put(xing,1);\n }\n\n String s5 = s_16[4];\n Result.影响说明.add(s5.replace(\"(备注:星数越多,说明影响程度越大)若有影响,请简要说明:\", \"\"));\n\n }\n break;\n case 16:\n //系统运行前手工作业效率: 10 分钟/每件(普通包裹)\n //系统运行前手工作业效率: 5 分钟/每件(信函)\n //系统运行前手工作业效率: 3 分钟/每件(报刊);\n //系统运行后作业效率: 8 分钟/每件(普通包裹)\n //系统运行后作业效率: 4 分钟/每件(信函)\n //系统运行后作业效率: 3 分钟/每件(报刊)。\n String[] s_17 = replace.split(\";\");\n if (s_17.length >= 2){\n String[] s_var = s_17[0].split(\")\");\n if (s_var.length >= 3){\n // 1\n String replace1 = s_var[0].replace(\"系统运行前手工作业效率:\", \"\");\n String replace3 = replace1.replace(\"分钟/每件(普通包裹\", \"\");\n double result = 0;\n if (StringUtils.isNotBlank(replace3)){\n result = Double.parseDouble(replace3);\n }\n if (Result.人员效率.containsKey(\"普通包裹\")) {\n Double var = Result.人员效率.get(\"普通包裹\");\n Result.人员效率.put(\"普通包裹\",result+var);\n }else {\n Result.人员效率.put(\"普通包裹\",result);\n }\n //2\n replace1 = s_var[1].replace(\"系统运行前手工作业效率:\", \"\");\n replace3 = replace1.replace(\"分钟/每件(信函\", \"\");\n double result1 = 0;\n if (StringUtils.isNotBlank(replace3)){\n result1 = Double.parseDouble(replace3);\n }\n if (Result.人员效率.containsKey(\"信函\")) {\n Double var = Result.人员效率.get(\"信函\");\n Result.人员效率.put(\"信函\",result1+var);\n }else {\n Result.人员效率.put(\"信函\",result1);\n }\n //3\n replace1 = s_var[2].replace(\"系统运行前手工作业效率:\", \"\");\n replace3 = replace1.replace(\"分钟/每件(报刊\", \"\");\n double result3 = 0;\n if (StringUtils.isNotBlank(replace3)){\n result3 = Double.parseDouble(replace3);\n }\n if (Result.人员效率.containsKey(\"报刊\")) {\n Double var = Result.人员效率.get(\"报刊\");\n Result.人员效率.put(\"报刊\",result3+var);\n }else {\n Result.人员效率.put(\"报刊\",result3);\n }\n }\n\n\n s_var = s_17[1].split(\")\");\n if (s_var.length >= 3){\n // 1\n String replace1 = s_var[0].replace(\"系统运行后作业效率:\", \"\");\n String replace3 = replace1.replace(\"分钟/每件(普通包裹\", \"\");\n double result4 = 0;\n if (StringUtils.isNotBlank(replace3)){\n result4 = Double.parseDouble(replace3);\n }\n if (Result.人员效率.containsKey(\"系统运行后普通包裹\")) {\n Double var = Result.人员效率.get(\"系统运行后普通包裹\");\n Result.人员效率.put(\"系统运行后普通包裹\",result4+var);\n }else {\n Result.人员效率.put(\"系统运行后普通包裹\",result4);\n }\n //2\n\n replace1 = s_var[1].replace(\"系统运行后作业效率:\", \"\");\n replace3 = replace1.replace(\"分钟/每件(信函\", \"\");\n double result5 = 0;\n if (StringUtils.isNotBlank(replace3)){\n result5 = Double.parseDouble(replace3);\n }\n if (Result.人员效率.containsKey(\"系统运行后信函\")) {\n Double var = Result.人员效率.get(\"系统运行后信函\");\n Result.人员效率.put(\"系统运行后信函\",result5+var);\n }else {\n Result.人员效率.put(\"系统运行后信函\",result5);\n }\n //3\n replace1 = s_var[2].replace(\"系统运行后作业效率:\", \"\");\n replace3 = replace1.replace(\"分钟/每件(报刊\", \"\");\n double result6 = 0;\n if (StringUtils.isNotBlank(replace3)){\n result6 = Double.parseDouble(replace3);\n }\n if (Result.人员效率.containsKey(\"系统运行后报刊\")) {\n Double var = Result.人员效率.get(\"系统运行后报刊\");\n Result.人员效率.put(\"系统运行后报刊\",result6+var);\n }else {\n Result.人员效率.put(\"系统运行后报刊\",result6);\n }\n }\n\n\n }\n break;\n case 17:\n //您对系统的总体评价:五星■ 四星□ 三星□ 二星□ 一星□;\n //简要评价说明:\n String[] s_18 = replace.split(\";\");\n int lenght18 = s_18.length;\n if (lenght18 >= 2) {\n String ss = s_18[0];\n HashMap<String, Integer> 总体评价 = Result.总体评价;\n String var = xuanxing(ss);\n if (总体评价.containsKey(var)) {\n int _v = 总体评价.get(var);\n 总体评价.put(var, ++_v);\n } else {\n 总体评价.put(var, 1);\n }\n Result.总体评价 = 总体评价;\n\n String 优化建议 = s_18[1];\n\n Result.总体评价说明.add(优化建议.replace(\"简要评价说明:\", \"\"));\n\n } else {\n throw new NullPointerException();\n }\n break;\n case 18:\n //意见建议\n Result.意见建议.add(replace);\n break;\n default:\n }\n ++index;\n }", "private String mayorTurno(ABBTurnosTDA a){\t\t\n\t\tif(a.hijoDer().arbolVacio())\n\t\t\treturn a.turno();\n\t\telse\n\t\t\treturn mayorTurno(a.hijoDer());\n\t}", "boolean mo25263a(String str, String str2, boolean z, int i, int i2, int i3, boolean z2, C4619b bVar, boolean z3);", "static String stringMultiplier( String word , int multiplier) {\n\t\tString largeWord = \"\"; \n\t\tfor (int i = 1; i <= multiplier; i++ ) {\n\t\t\tlargeWord += (word + \" \"); \n\t\t}\n\t\treturn largeWord;\n\t}", "public static String Rule3(String para_word) {\n\t\tint last = para_word.length();\r\n\r\n\t\tswitch (para_word.charAt(last - 2)) {\r\n\t\tcase 'a':\r\n\t\t\tif (endsWith(\"ational\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"ational\", \"ate\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"tional\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"tional\", \"tion\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\tcase 'c':\r\n\r\n\t\t\tif (endsWith(\"enci\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"enci\", \"ence\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"anci\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"anci\", \"ance\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tcase 'e':\r\n\t\t\tif (endsWith(\"izer\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"izer\", \"ize\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\tcase 'l':\r\n\t\t\tif (endsWith(\"bli\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"bli\", \"ble\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"alli\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"alli\", \"al\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"entli\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"entli\", \"ent\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"eli\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"eli\", \"e\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"ousli\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"ousli\", \"ous\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\tcase 'o':\r\n\t\t\tif (endsWith(\"ization\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"ization\", \"ize\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"ation\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"ation\", \"ate\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"ator\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"ator\", \"ate\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tcase 's':\r\n\t\t\tif (endsWith(\"alism\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"alism\", \"al\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"iveness\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"iveness\", \"ive\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"fulness\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"fulness\", \"ful\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"ousness\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"ousness\", \"ous\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tcase 't':\r\n\t\t\tif (endsWith(\"aliti\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"aliti\", \"al\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"iviti\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"iviti\", \"ive\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (endsWith(\"biliti\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"biliti\", \"ble\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tcase 'g':\r\n\t\t\tif (endsWith(\"logi\", para_word)) {\r\n\t\t\t\tpara_word = transformS(\"logi\", \"log\", para_word);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn para_word;\r\n\t}", "private void parseInternalMQL(final String str, final String setmqlbits, final String mqlbits, SelectMQLState state) throws MQLException\r\n\t\t{\r\n\t\t\tthis.mql=str;\r\n\t\t\tfinal StringBuilder curr=new StringBuilder(\"\");\r\n\t\t\tint pdepth=0;\r\n\t\t\tWhereClause wheres = new WhereClause();\r\n\t\t\tthis.wheres=wheres;\r\n\t\t\tString[] varer = new String[2];\r\n\t\t\tWhereComp\twcomp = new WhereComp();\r\n\t\t\tfor(int i=0;i<=mqlbits.length();i++)\r\n\t\t\t{\r\n\t\t\t\tfinal char c=(i==mqlbits.length())?' ':mqlbits.charAt(i);\r\n\t\t\t\tswitch(state)\r\n\t\t\t\t{\r\n\t\t\t\tcase STATE_SELECT0: // select state\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// we just got a name symbol, so go to state 1 and expect AS or FROM or ,\r\n\t\t\t\t\t\t\t\twhat.add(new WhatBit(WhereComp.parseHS(curr.toString()),curr.toString()));\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_SELECT1;\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\twhat.add(new WhatBit(WhereComp.parseHS(curr.toString()),curr.toString()));\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected , in Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_SELECT1: // expect AS or FROM or ,\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(curr.toString().equals(\"FROM\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_FROM0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tif(curr.toString().equals(\"AS\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_AS0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected select string in Malformed mql: \"+str);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_SELECT0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected , in Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_UPDATE0: // update what start\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// we just got the update set\r\n\t\t\t\t\t\t\t\tupdate=cleanTermQuotes(curr);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_UPDATE1;\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_UPDATE1: // update set\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(!curr.toString().equalsIgnoreCase(\"SET\"))\r\n\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Expected SET (not '\"+curr+\"') in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_SET0;\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_SET1: // expect =\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c=='=')\r\n\t\t\t\t\t\tstate=SelectMQLState.STATE_SET2;\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(!Character.isWhitespace(c))\r\n\t\t\t\t\t\tthrow new MQLException(\"Expected = (not '\"+c+\"') in Malformed mql: \"+str);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_SET0: // get the key\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvarer[0] = curr.toString().toUpperCase().trim();\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_SET1;\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif((curr.length()>0)&&(c=='='))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvarer[0] = curr.toString().toUpperCase().trim();\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_SET2;\r\n\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif((curr.length()==0)&&((!Character.isLetter(c))))\r\n\t\t\t\t\t\tthrow new MQLException(\"Expected KEY (not '\"+c+\"') in Malformed mql: \"+str);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_SET2: // get the new value\r\n\t\t\t\t{\r\n\t\t\t\t\tfinal char lc=(i>=setmqlbits.length())?' ':setmqlbits.charAt(i);\r\n\t\t\t\t\tif(Character.isWhitespace(c)\r\n\t\t\t\t\t||(i==mqlbits.length()-1)\r\n\t\t\t\t\t||((c=='\\'')||(c=='\\\"')||(c=='`')))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(!Character.isWhitespace(lc))\r\n\t\t\t\t\t\t\t\t\tcurr.append(lc);\r\n\t\t\t\t\t\t\t\tString currStr = curr.toString().trim();\r\n\t\t\t\t\t\t\t\tfinal int x = currStr.toLowerCase().indexOf(\"select:\");\r\n\t\t\t\t\t\t\t\tif((x==0)||((x==1)&&(!Character.isLetter(curr.charAt(0)))))\r\n\t\t\t\t\t\t\t\t\tcurrStr = currStr.toUpperCase();\r\n\t\t\t\t\t\t\t\tvarer[1] = currStr;\r\n\t\t\t\t\t\t\t\tsets.add(varer);\r\n\t\t\t\t\t\t\t\tvarer = new String[2];\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTCOMMAORWHEREOREND;\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(lc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\tif(!Character.isWhitespace(lc))\r\n\t\t\t\t\t\t\tcurr.append(lc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(lc);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_EXPECTCOMMAORWHEREOREND: // expect comma, where, or valid end\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c)||(c==',')||(c==';'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Expected '\"+curr.toString()+\"' in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tif(curr.toString().equals(\";\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTNOTHING;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tif(!curr.toString().equals(\"WHERE\"))\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Expected WHERE in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_SET0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_AS0: // as name\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c)\r\n\t\t\t\t\t||(c==','))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(curr.toString().equals(\"FROM\"))\r\n\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected FROM in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tif(curr.toString().equals(\"AS\"))\r\n\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected AS in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_AS1; // expect from or , ONLY\r\n\t\t\t\t\t\t\t\t\twhat.get(what.size()-1).second = curr.toString();\r\n\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected , in Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_AS1: // expect FROM or , only\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(curr.toString().equals(\"FROM\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_FROM0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected name string in Malformed mql: \"+str);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_SELECT0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected , in Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_FROM0: // from state\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c)||(c==','))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(curr.toString().equals(\"WHERE\"))\r\n\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected WHERE in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfroms.add(WhereComp.parseHS(curr.toString()));\r\n\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\tif(c!=',')\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTWHEREOREND; // now expect where\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_FROM1;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ( in Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_FROM1: // from () state\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\tpdepth++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==')')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(pdepth==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfroms.add(WhereComp.parseHS(curr.toString()));\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTWHEREOREND; // expect where\r\n\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t\tpdepth--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_EXPECTWHEREOREND: // expect where clause\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c)||(c==',')||(c==';'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Expected '\"+curr.toString()+\"' in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tif(curr.toString().equals(\";\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTNOTHING;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tif(!curr.toString().equals(\"WHERE\"))\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Expected WHERE in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\tif(c==',')\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_FROM0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_WHERE0: // initial where state\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c)\r\n\t\t\t\t\t||(\"<>!=\".indexOf(c)>=0))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\twcomp=new WhereComp();\r\n\t\t\t\t\t\t\t\tif((wheres.lhs!=null)\r\n\t\t\t\t\t\t\t\t||(wheres.parent!=null))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfinal WhereClause newClause = new WhereClause();\r\n\t\t\t\t\t\t\t\t\tnewClause.prev=wheres;\r\n\t\t\t\t\t\t\t\t\twheres.next=newClause;\r\n\t\t\t\t\t\t\t\t\twheres=newClause;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\twheres.lhs=wcomp;\r\n\t\t\t\t\t\t\t\twcomp.lhs = WhereComp.parseHS(curr.toString());\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tif(!Character.isWhitespace(c))\r\n\t\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE1; // now expect comparator\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHEREEMBEDLEFT0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ( in Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==')')\r\n\t\t\t\t\t\tthrow new MQLException(\"Unexpected ) in Malformed mql: \"+str);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_WHEREEMBEDLEFT0:\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfinal WhereClause priorityClause = new WhereClause();\r\n\t\t\t\t\t\t\tif((wheres.lhs!=null)\r\n\t\t\t\t\t\t\t||(wheres.parent!=null)\r\n\t\t\t\t\t\t\t||(wheres.conn!=null))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tfinal WhereClause dummyClause = new WhereClause();\r\n\t\t\t\t\t\t\t\twheres.next=dummyClause;\r\n\t\t\t\t\t\t\t\tdummyClause.prev=wheres;\r\n\t\t\t\t\t\t\t\twheres=dummyClause;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tpriorityClause.child=wheres;\r\n\t\t\t\t\t\t\twheres.parent=priorityClause;\r\n\t\t\t\t\t\t\twheres=priorityClause;\r\n\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE0; // expect lhs of a comp\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t\tpdepth++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==')')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(pdepth==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\twcomp=new WhereComp();\r\n\t\t\t\t\t\t\tif((wheres.lhs!=null)\r\n\t\t\t\t\t\t\t||(wheres.parent!=null)\r\n\t\t\t\t\t\t\t||(wheres.conn!=null))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tfinal WhereClause newClause = new WhereClause();\r\n\t\t\t\t\t\t\t\twheres.next=newClause;\r\n\t\t\t\t\t\t\t\tnewClause.prev=wheres;\r\n\t\t\t\t\t\t\t\twheres=newClause;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\twheres.lhs=wcomp;\r\n\t\t\t\t\t\t\twcomp.lhs = WhereComp.parseHS(curr.toString());\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE1; // expect connector or endofclause\r\n\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t\tpdepth--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(Character.isWhitespace(c) && (curr.length()==0))\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\tcurr.append(c);\r\n\t\t\t\t\t\tif((curr.length()<8)\r\n\t\t\t\t\t\t&&(!\"SELECT:\".startsWith(curr.toString())))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfinal WhereClause priorityClause = new WhereClause();\r\n\t\t\t\t\t\t\tif((wheres.lhs!=null)\r\n\t\t\t\t\t\t\t||(wheres.parent!=null)\r\n\t\t\t\t\t\t\t||(wheres.conn!=null))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tfinal WhereClause dummyClause = new WhereClause();\r\n\t\t\t\t\t\t\t\twheres.next=dummyClause;\r\n\t\t\t\t\t\t\t\tdummyClause.prev=wheres;\r\n\t\t\t\t\t\t\t\twheres=dummyClause;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tpriorityClause.child=wheres;\r\n\t\t\t\t\t\t\twheres.parent=priorityClause;\r\n\t\t\t\t\t\t\twheres=priorityClause;\r\n\t\t\t\t\t\t\ti=mqlbits.lastIndexOf('(',i);\r\n\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE0; // expect lhs of a comp\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_WHERE1: // expect comparator\r\n\t\t\t\t{\r\n\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(!Character.isWhitespace(c))\r\n\t\t\t\t\t\t\tcurr.append(c);\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\tboolean saveC = false;\r\n\t\t\t\t\t\tboolean done=false;\r\n\t\t\t\t\t\tif(\"<>!=\".indexOf(c)>=0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(\"<>!=\".indexOf(curr.charAt(0))>=0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t\t\tdone=curr.length()>=2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+c+\"' in Malformed mql: \"+str);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\tif(!Character.isWhitespace(c))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(\"<>!=\".indexOf(curr.charAt(0))>=0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tsaveC=true;\r\n\t\t\t\t\t\t\t\tdone=true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tdone=true;\r\n\t\t\t\t\t\tif(done)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tswitch((curr.length()==0)?'\\0':curr.charAt(0))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcase '=':\r\n\t\t\t\t\t\t\t\tif(curr.length()==1)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.EQ;\r\n\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tswitch(curr.charAt(1))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tcase '>':\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.GTEQ;\r\n\t\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tcase '<':\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.LTEQ;\r\n\t\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+curr+\"' in Malformed mql: \"+str);\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\tbreak;\r\n\t\t\t\t\t\t\tcase '!':\r\n\t\t\t\t\t\t\t\tif(curr.toString().equals(\"!=\"))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.NEQ;\r\n\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+curr+\"' in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase '<':\r\n\t\t\t\t\t\t\t\tif(curr.length()==1)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.LT;\r\n\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tswitch(curr.charAt(1))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tcase '>':\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.NEQ;\r\n\t\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tcase '=':\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.LTEQ;\r\n\t\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+curr+\"' in Malformed mql: \"+str);\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\tbreak;\r\n\t\t\t\t\t\t\tcase '>':\r\n\t\t\t\t\t\t\t\tif(curr.length()==1)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.GT;\r\n\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tswitch(curr.charAt(1))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tcase '=':\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.GTEQ;\r\n\t\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tcase '<':\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\twcomp.comp=WhereComparator.NEQ;\r\n\t\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+curr+\"' in Malformed mql: \"+str);\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\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfinal WhereComparator comp = (WhereComparator)CMath.s_valueOf(WhereComparator.class, curr.toString());\r\n\t\t\t\t\t\t\t\t\tif(comp != null)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\twcomp.comp=comp;\r\n\t\t\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE2; // now expect RHS\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+curr+\"' in Malformed mql: \"+str);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(saveC)\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_WHERE2: // where rhs of clause\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Character.isWhitespace(c)||(c==';'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isTermProperlyEnded(curr))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\twcomp.rhs = WhereComp.parseHS(curr.toString());\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tif(c==';')\r\n\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTNOTHING;\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTCONNOREND;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif((curr.length()>0)\r\n\t\t\t\t\t&&((curr.charAt(0)=='\\'')\r\n\t\t\t\t\t\t||(curr.charAt(0)=='\\\"')\r\n\t\t\t\t\t\t||(curr.charAt(0)=='`')))\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==')')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ): Malformed mql: \"+str);\r\n\t\t\t\t\t\twcomp.rhs = WhereComp.parseHS(curr.toString());\r\n\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\twhile(wheres.prev!=null)\r\n\t\t\t\t\t\t\twheres=wheres.prev;\r\n\t\t\t\t\t\tif(wheres.child==null)\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ): Malformed mql: \"+str);\r\n\t\t\t\t\t\twheres=wheres.child;\r\n\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTCONNOREND;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==';')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ; in Malformed mql: \"+str);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\twcomp.rhs = WhereComp.parseHS(curr.toString());\r\n\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTNOTHING;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()==0)\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHEREEMBEDRIGHT0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ( in Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_WHEREEMBEDRIGHT0:\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\tpdepth++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(c==')')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(pdepth==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\twcomp.rhs = WhereComp.parseHS(curr.toString());\r\n\t\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTCONNOREND; // expect connector or endofclause\r\n\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\t\t\tpdepth--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase STATE_EXPECTCONNOREND: // expect connector or endofclause\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c==';')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstate=SelectMQLState.STATE_EXPECTNOTHING;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif(Character.isWhitespace(c) || (c=='('))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(curr.length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(curr.toString().equals(\"AND\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\twheres.conn = WhereConnector.AND;\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE0;\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tif(curr.toString().equals(\"OR\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\twheres.conn = WhereConnector.OR;\r\n\t\t\t\t\t\t\t\tstate=SelectMQLState.STATE_WHERE0;\r\n\t\t\t\t\t\t\t\tcurr.setLength(0);\r\n\t\t\t\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+curr.toString()+\"': Malformed mql: \"+str);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\tif(c=='(')\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ): Malformed mql: \"+str);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\tif((c==')') && (curr.length()==0))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twhile(wheres.prev!=null)\r\n\t\t\t\t\t\t\twheres=wheres.prev;\r\n\t\t\t\t\t\tif(wheres.child==null)\r\n\t\t\t\t\t\t\tthrow new MQLException(\"Unexpected ): Malformed mql: \"+str);\r\n\t\t\t\t\t\twheres=wheres.child;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurr.append(c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(!Character.isWhitespace(c))\r\n\t\t\t\t\t\tthrow new MQLException(\"Unexpected '\"+c+\"': Malformed mql: \"+str);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif((state != SelectMQLState.STATE_EXPECTNOTHING)\r\n\t\t\t&&(state != SelectMQLState.STATE_EXPECTWHEREOREND)\r\n\t\t\t&&(state != SelectMQLState.STATE_EXPECTCOMMAORWHEREOREND)\r\n\t\t\t&&(state != SelectMQLState.STATE_EXPECTCONNOREND))\r\n\t\t\t\tthrow new MQLException(\"Unexpected end of clause in state \"+state.toString()+\" in mql: \"+str);\r\n\t\t\t// finally, parse the aggregators\r\n\t\t\tfor(final WhatBit W : this.what)\r\n\t\t\t{\r\n\t\t\t\tfinal String[] w=W.what();\r\n\t\t\t\tif(w.length<2)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tW.aggregator=(MQLClause.AggregatorFunctions)CMath.s_valueOf(MQLClause.AggregatorFunctions.class, w[0]);\r\n\t\t\t\tif(W.aggregator != null)\r\n\t\t\t\t\tW.first=Arrays.copyOfRange(W.first, 1, W.first.length);\r\n\t\t\t}\r\n\t\t}", "@Test\n void multiConstruct() {\n var multicons = \"(define conCar_a (cons 1 2))(define conCar_b (cons 3 conCar_a))(define conCar_c (cons conCar_b 4))(define conCar_d (cons conCar_b conCar_c))\";\n Main.parseInputString(multicons);\n assertEquals(\"(3 1 . 2)\", Main.parseInputString(\"(display (car conCar_d)) \"));\n }", "private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }", "int mo5866a(State state, String... strArr);", "private static String getItemRarity(String[] itemSlot){\r\n String rarity = \"\";\r\n if(itemSlot[0].equals(\"Leather Helmet\")){\r\n leatherHelmet LeatherHelmet = new leatherHelmet();\r\n rarity = LeatherHelmet.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Leather Chest Plate\")){\r\n leatherChestPlate LeatherChestPlate = new leatherChestPlate();\r\n rarity = LeatherChestPlate.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Leather Boots\")){\r\n leatherBoots LeatherBoots = new leatherBoots();\r\n rarity = LeatherBoots.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Leather Gloves\")){\r\n leatherGloves LeatherGloves = new leatherGloves();\r\n rarity = LeatherGloves.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Iron Boots\")){\r\n ironBoots IronBoots = new ironBoots();\r\n rarity = IronBoots.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Iron Helmet\")){\r\n ironHelmet IronHelmet = new ironHelmet();\r\n rarity = IronHelmet.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Iron Chest Plate\")){\r\n ironChestPlate IronChestPlate = new ironChestPlate();\r\n rarity = IronChestPlate.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Iron Gloves\")){\r\n ironGloves IronGloves = new ironGloves();\r\n rarity = IronGloves.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Short Sword\")){\r\n shortSword ShortSword = new shortSword();\r\n rarity = ShortSword.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Long Sword\")){\r\n longSword LongSword = new longSword();\r\n rarity = LongSword.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Great Sword\")){\r\n greatSword GreatSword = new greatSword();\r\n rarity = GreatSword.getRarity();\r\n return rarity;\r\n }else if(itemSlot[0].equals(\"Heaven Smiting Devil Slayer Sword\")){\r\n heavenSmitingDevilSlayerSword Honger = new heavenSmitingDevilSlayerSword();\r\n rarity = Honger.getRarity();\r\n return rarity;\r\n }\r\n return rarity;\r\n }", "private void testStringArray() {\n\t\tMessage message = Message.createMessage(getId(), \"Triggers\");\n\t\tString array[] = { \"Gimme\", \"a\", \"break\", \"dude\" };\n\t\tmessage.setPayload(array);\n\t\tsend(message);\n\t}", "public String parseStringMsg(String msg){\n String parsedMsg = msg;\n //Make second mthd w/o second param\n //replacements is like Variable:Replacement i.e. PLAYERTRADESENTTO:playerReceiver.getName()\n return parsedMsg;\n }", "private String process(String str) {\r\n\t\t\tArrayList a = new ArrayList();\r\n\t\t\tArrayList b = new ArrayList();\r\n\t\t\tchar[] qq = str.toCharArray();\r\n\t\t\tfor (int i = 0; i < qq.length; i++) { \r\n\t\t\t\tif (((int)qq[i])==159 || ((int)qq[i])==143) a.add(i);\r\n\t\t\t if (((int)qq[i])==150) b.add(i);\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < a.size(); i++) {\r\n\t\t\t\tstr = str.replace(str.charAt(Integer.valueOf(a.get(i).toString())), '\\\"');\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < b.size(); i++) {\r\n\t\t\t\tstr = str.replace(str.charAt(Integer.valueOf(b.get(i).toString())), '-');\r\n\t\t\t}\r\n\t\t\treturn str;\r\n\t\t}", "public final boolean mo29357a(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {\n switch (i) {\n case 2:\n String o = mo29925o();\n parcel2.writeNoException();\n parcel2.writeString(o);\n break;\n case 3:\n List q = mo29927q();\n parcel2.writeNoException();\n parcel2.writeList(q);\n break;\n case 4:\n String p = mo29926p();\n parcel2.writeNoException();\n parcel2.writeString(p);\n break;\n case 5:\n zzaei J = mo29915J();\n parcel2.writeNoException();\n zzfo.m30221a(parcel2, (IInterface) J);\n break;\n case 6:\n String m = mo29923m();\n parcel2.writeNoException();\n parcel2.writeString(m);\n break;\n case 7:\n String x = mo29929x();\n parcel2.writeNoException();\n parcel2.writeString(x);\n break;\n case 8:\n recordImpression();\n parcel2.writeNoException();\n break;\n case 9:\n mo29916a(Stub.m22186a(parcel.readStrongBinder()));\n parcel2.writeNoException();\n break;\n case 10:\n mo29919c(Stub.m22186a(parcel.readStrongBinder()));\n parcel2.writeNoException();\n break;\n case 11:\n boolean C = mo29913C();\n parcel2.writeNoException();\n zzfo.m30223a(parcel2, C);\n break;\n case 12:\n boolean F = mo29914F();\n parcel2.writeNoException();\n zzfo.m30223a(parcel2, F);\n break;\n case 13:\n Bundle extras = getExtras();\n parcel2.writeNoException();\n zzfo.m30226b(parcel2, extras);\n break;\n case 14:\n mo29918b(Stub.m22186a(parcel.readStrongBinder()));\n parcel2.writeNoException();\n break;\n case 15:\n IObjectWrapper B = mo29912B();\n parcel2.writeNoException();\n zzfo.m30221a(parcel2, (IInterface) B);\n break;\n case 16:\n zzaar videoController = getVideoController();\n parcel2.writeNoException();\n zzfo.m30221a(parcel2, (IInterface) videoController);\n break;\n case 19:\n zzaea l = mo29922l();\n parcel2.writeNoException();\n zzfo.m30221a(parcel2, (IInterface) l);\n break;\n case 20:\n IObjectWrapper A = mo29911A();\n parcel2.writeNoException();\n zzfo.m30221a(parcel2, (IInterface) A);\n break;\n case 21:\n IObjectWrapper n = mo29924n();\n parcel2.writeNoException();\n zzfo.m30221a(parcel2, (IInterface) n);\n break;\n case 22:\n mo29917a(Stub.m22186a(parcel.readStrongBinder()), Stub.m22186a(parcel.readStrongBinder()), Stub.m22186a(parcel.readStrongBinder()));\n parcel2.writeNoException();\n break;\n default:\n return false;\n }\n return true;\n }", "public interface IOperatorSIMString {\n /**\n * To distinguish the processing SIM string situations.\n * SIMTOUIM tag replaces SIM to UIM\n * UIMSIM tag replaces SIM to UIM/SIM\n * DELSIM tag replaces SIM to \"\" or a white space.\n */\n public enum SIMChangedTag {\n SIMTOUIM, UIMSIM, DELSIM\n };\n\n /**\n * Get the string with SIM or UIM according to Operator\n * @param sourceStr the source string\n * @param slotId the slot Id\n * @param simChangedTag the needed changed Tag. If none, set the value to -1.\n *\n * @internal\n */\n String getOperatorSIMString(String sourceStr, int slotId, SIMChangedTag simChangedTag,\n Context context);\n}", "String getOne_or_more();", "protected void map(Object key, Text value, Context context) throws IOException, InterruptedException {\r\n\r\n\t\tif (value.toString().contains(\"Marque\")){ // pour ne pas prendre en compte la première ligne (en-tête)\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tString line = value.toString(); \r\n\t\tline = line.replaceAll(\"\\\\u00a0\",\" \");\r\n\t\t\r\n\t\tString[] splitted_line = line.split(\",\"); \r\n\r\n\t\t// Gestion colonne marque\r\n\t\tString marque;\r\n\t\tString[] splitted_space = splitted_line[1].split(\"\\\\s+\"); \r\n\t\tmarque = splitted_space[0];\r\n\r\n\t\tmarque = marque.replace(\"\\\"\", \"\");\r\n\r\n\t\t// Gestion colonne Malus/Bonus\r\n String malus_bonus = splitted_line[2];\r\n\r\n\t\tmalus_bonus = malus_bonus.replaceAll(\" \", \"\").replace(\"€1\", \"\").replace(\"€\", \"\").replace(\"\\\"\", \"\");\r\n\r\n\t\tif (malus_bonus.equals(\"150kW(204ch)\") || malus_bonus.equals(\"100kW(136ch)\"))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (malus_bonus.length() == 1){\r\n\t\t\tmalus_bonus=\"0\"; \r\n\t\t} \r\n\r\n\t\t// Gestion colonne cout energie\r\n String cout;\r\n \t cout = splitted_line[4];\r\n\t\tString[] cout_splitted = cout.split(\" \");\r\n\t\tif(cout_splitted.length == 2){ // ex : |967,€]\r\n\t\t\tcout = cout_splitted[0];\r\n\t\t} else if(cout_splitted.length == 3){ // ex : [1,005,€]\r\n\t\t\tcout= cout_splitted[0] + cout_splitted[1];\r\n\t\t}\r\n\r\n\t\t// Gestion colonne Rejet CO2\r\n\t\tString rejet = splitted_line[3];\r\n\r\n\t\tint malus_bonus_int = Integer.parseInt(malus_bonus);\r\n\t\tint rejet_int = Integer.parseInt(rejet);\r\n\t\tint cout_int = Integer.parseInt(cout);\r\n\t\r\n\t\t// couple clé/valeurs\r\n\t\tString new_value = String.valueOf(malus_bonus_int) + \"|\" + String.valueOf(rejet_int) + \"|\" + String.valueOf(cout_int);\r\n\t\t\r\n context.write(new Text(marque), new Text(new_value));\r\n\t}", "private static String m37640a(String str, String str2, int i) {\n if (i == 2 || i == 4) {\n try {\n if (!TextUtils.isEmpty(str2)) {\n return str2;\n }\n } catch (Throwable unused) {\n }\n }\n return str;\n }", "public static int turnoEnemigo(String enemigoRecibido){\n String enemigo; //variables locales a utilizar\n int ataqueEnemigo;\n Random aleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n int inferior;\n int superior;\n \n enemigo=enemigoRecibido;//recibiendo al enemigo elegido por la funcion enemigos\n //comparando con los enemigos disponibles\n switch(enemigo){\n case \"Dark_Wolf\":{\n //ejecutando acciones del enemigo Dark\n inferior=10+nivel;\n superior=10+nivel+10;\n ataqueEnemigo=(aleatorio.nextInt(superior-inferior+1)+inferior);\n return ataqueEnemigo;//retornando el ataque de Dark\n }\n case \"Dragon\":{\n inferior=15+nivel; //ejecutando acciones del enemigo Dragon\n superior=15+nivel+10;\n ataqueEnemigo=(aleatorio.nextInt(superior-inferior+1)+inferior);\n return ataqueEnemigo; //retornando ataque del enemigo Dragon\n }\n default:{\n inferior=25+nivel; //ejecutando acciones del enemigo Golem\n superior=25+nivel+10;\n ataqueEnemigo=(aleatorio.nextInt(superior-inferior+1)+inferior);\n return ataqueEnemigo; //retornando ataque del enemigo Golem\n }\n }\n }", "protected String comprobarConsumoEnergetico(Letra letra){\r\n if(getConsumoEnergetico() == Letra.A | getConsumoEnergetico() == Letra.B | getConsumoEnergetico() == Letra.C \r\n | getConsumoEnergetico() == Letra.D | getConsumoEnergetico() == Letra.E | getConsumoEnergetico() == Letra.F){\r\n return \"Consumo energetico correcto; letra correcta\";\r\n }\r\n else{\r\n return \"Consumo energetico incorrecto; letra erronea\";\r\n }\r\n}", "@Test void testCaseExpressionDialect1() {\n sql(\"case x when 2, 4 then 3 ^when^ then 5 else 4 end\")\n .fails(\"(?s)Encountered \\\"when then\\\" at .*\");\n }", "public static void m134567a(Intent intent, Intent intent2, Scene scene, Scene scene2) {\n SupportedBusiness[] values;\n for (SupportedBusiness supportedBusiness : SupportedBusiness.values()) {\n intent2.putExtra(supportedBusiness.intentKey, m134566a(supportedBusiness).mo103788a(intent.getStringExtra(supportedBusiness.intentKey), scene, scene2));\n }\n }", "String invade(short... s) {\n\t\treturn \"many\";\n\t}", "@Test\n public void testCaseNumberSplit() {\n String caseNumber1 = \"NTN-57930\";\n String[] parts1 = caseNumber1.split( \"-\" );\n //String[] parts2 = caseNumber2.split(\"-\");\n //String[] parts3 = caseNumber3.split(\"-\");\n System.out.println( parts1.length );\n //System.out.println( parts2.length);\n //System.out.println( parts3.length);\n if (parts1.length > 2) {\n System.out.println( parts1[0] );\n String case1 = caseNumber1.substring( caseNumber1.indexOf( caseNumber1.split( \"-\" )[0] ), caseNumber1.indexOf( caseNumber1.split( \"-\" )[2] ) - 1 );\n System.out.println( case1 );\n } else {\n String case1 = caseNumber1;\n System.out.println( case1 );\n }\n }", "public void Expresstion_generator_based_on_difficulty() {\n\t\tString Difficulty = getIntent().getStringExtra(\"Difficulty\");\n\t\tif (Difficulty == null) {\n\t\t\tDifficulty = getPreferences(MODE_PRIVATE).getString(\n\t\t\t\t\t\"WhatDifficulty\", \"\");\n\t\t}\n\t\tif (Difficulty.equals(\"novice\")) {\n\t\t\tnovice();\n\t\t} else if (Difficulty.equals(\"easy\")) {\n\t\t\teasy();\n\t\t} else if (Difficulty.equals(\"medium\")) {\n\t\t\tmedium();\n\t\t} else if (Difficulty.equals(\"guru\")) {\n\t\t\tguru();\n\t\t}\n\t}", "private String[] Transposicion(String texto) {\n String retorno[] = new String[2];\n retorno[0] = \"1\";\n retorno[1] = \"\";\n texto = texto.toLowerCase();\n try {//evalua si hay transposicion en el while\n if (texto.contains(\"w\") && texto.contains(\"h\") && texto.contains(\"i\") && texto.contains(\"l\") && texto.contains(\"e\")) {\n if (!texto.equals(\"while\") && texto.length() == 5) {\n retorno[0] = \"0\";\n retorno[1] = \"Lexico: Transposicion de caracteres en sentencia while.\";\n }\n } else {//evalua si hay transposicion en el if\n if (texto.contains(\"i\") && texto.contains(\"f\")) {\n if (!texto.equals(\"if\") && texto.length() == 2) {\n retorno[0] = \"0\";\n retorno[1] = \"Lexico: Transposicion de caracteres en sentencia if.\";\n }\n } else {//evalua si hay transposicion en el int\n if (texto.contains(\"i\") && texto.contains(\"n\") && texto.contains(\"t\")) {\n if (!texto.equals(\"int\") && texto.length() == 3) {\n retorno[0] = \"0\";\n retorno[1] = \"Lexico: Transposicion de caracteres en sentencia int.\";\n }\n } else {//evalua si hay transposicion en el for\n if (texto.contains(\"f\") && texto.contains(\"o\") && texto.contains(\"r\")) {\n if (!texto.equals(\"for\") && texto.length() == 3) {\n retorno[0] = \"0\";\n retorno[1] = \"Lexico: Transposicion de caracteres en sentencia for.\";\n }\n } else {//evalua si hay transposicion en el do while\n if (texto.contains(\"d\") && texto.contains(\"o\")) {\n if (!texto.equals(\"do\") && texto.length() == 2) {\n retorno[0] = \"0\";\n retorno[1] = \"Lexico: Transposicion de caracteres en sentencia do.\";\n }\n }\n }\n }\n }\n }\n } catch (Exception e) {\n System.out.println(\"Error en metodo de Transposicion\");\n } finally {\n return retorno;\n }\n }", "public String overLoadingMeth(String huruf) {\n for (int i = 0; i < normalword.length; i++) {\n for (int j = 0; j < 10; j++) {\n if (huruf.equalsIgnoreCase(normalword[i])) {\n valuenum = num[i];\n } else if (huruf.equalsIgnoreCase(normalword[i])) {\n valuenum = num[i];\n } else if (huruf.equalsIgnoreCase(normalword[i] + \" belas\")) {\n valuenum = num[1] + num[i];\n } else if (huruf.equalsIgnoreCase(normalword[i] + \" puluh\")) {\n valuenum = num[i] + num[0];\n } else if (huruf.equalsIgnoreCase(normalword[i] + \" puluh \" + normalword[j])) {\n valuenum = num[i] + num[j];\n } else if (huruf.equalsIgnoreCase(\"Seratus\")) {\n valuenum = num[1] + num[0] + num[0];\n }\n }\n }\n return valuenum;\n }", "public void mo34874a(String str) {\n Class<C9780c> cls = C9780c.class;\n boolean[] a = m45645a();\n try {\n C9780c.m45630a(this.f25962b, System.currentTimeMillis(), this.f25961a);\n a[1] = true;\n InstabugSDKLogger.m46622d(cls, \"Features fetched successfully\");\n a[2] = true;\n JSONObject jSONObject = new JSONObject(str);\n a[3] = true;\n boolean optBoolean = jSONObject.optBoolean(\"crash_reporting\", true);\n a[4] = true;\n this.f25962b.mo34866a(Feature.CRASH_REPORTING, optBoolean);\n a[5] = true;\n boolean optBoolean2 = jSONObject.optBoolean(\"push_notifications\", true);\n a[6] = true;\n this.f25962b.mo34866a(Feature.PUSH_NOTIFICATION, optBoolean2);\n a[7] = true;\n boolean optBoolean3 = jSONObject.optBoolean(\"white_label\", true);\n a[8] = true;\n this.f25962b.mo34866a(Feature.WHITE_LABELING, optBoolean3);\n a[9] = true;\n boolean optBoolean4 = jSONObject.optBoolean(\"in_app_messaging\", true);\n a[10] = true;\n this.f25962b.mo34866a(Feature.IN_APP_MESSAGING, optBoolean4);\n a[11] = true;\n boolean optBoolean5 = jSONObject.optBoolean(\"multiple_attachments\", true);\n a[12] = true;\n this.f25962b.mo34866a(Feature.MULTIPLE_ATTACHMENTS, optBoolean5);\n String str2 = com.instabug.library.model.State.KEY_USER_STEPS;\n a[13] = true;\n boolean optBoolean6 = jSONObject.optBoolean(str2, true);\n a[14] = true;\n this.f25962b.mo34866a(Feature.TRACK_USER_STEPS, optBoolean6);\n a[15] = true;\n boolean optBoolean7 = jSONObject.optBoolean(\"repro_steps\", true);\n a[16] = true;\n this.f25962b.mo34866a(Feature.REPRO_STEPS, optBoolean7);\n String str3 = com.instabug.library.model.State.KEY_CONSOLE_LOG;\n a[17] = true;\n boolean optBoolean8 = jSONObject.optBoolean(str3, true);\n a[18] = true;\n this.f25962b.mo34866a(Feature.CONSOLE_LOGS, optBoolean8);\n a[19] = true;\n boolean optBoolean9 = jSONObject.optBoolean(\"ibg_log\", true);\n a[20] = true;\n this.f25962b.mo34866a(Feature.INSTABUG_LOGS, optBoolean9);\n a[21] = true;\n boolean optBoolean10 = jSONObject.optBoolean(com.instabug.library.model.State.KEY_USER_DATA, true);\n a[22] = true;\n this.f25962b.mo34866a(Feature.USER_DATA, optBoolean10);\n a[23] = true;\n boolean optBoolean11 = jSONObject.optBoolean(\"surveys\", true);\n a[24] = true;\n this.f25962b.mo34866a(Feature.SURVEYS, optBoolean11);\n String str4 = BugEntry.COLUMN_VIEW_HIERARCHY;\n a[25] = true;\n boolean optBoolean12 = jSONObject.optBoolean(str4, true);\n a[26] = true;\n this.f25962b.mo34866a(Feature.VIEW_HIERARCHY, optBoolean12);\n a[27] = true;\n boolean optBoolean13 = jSONObject.optBoolean(\"user_events\", true);\n a[28] = true;\n this.f25962b.mo34866a(Feature.USER_EVENTS, optBoolean13);\n a[29] = true;\n boolean optBoolean14 = jSONObject.optBoolean(\"disclaimer_text\", false);\n a[30] = true;\n this.f25962b.mo34866a(Feature.DISCLAIMER, optBoolean14);\n a[31] = true;\n boolean optBoolean15 = jSONObject.optBoolean(com.instabug.library.model.State.KEY_SESSIONS_PROFILER, true);\n a[32] = true;\n this.f25962b.mo34866a(Feature.SESSION_PROFILER, optBoolean15);\n a[33] = true;\n boolean optBoolean16 = jSONObject.optBoolean(\"feature_requests\", true);\n a[34] = true;\n this.f25962b.mo34866a(Feature.FEATURE_REQUESTS, optBoolean16);\n a[35] = true;\n boolean optBoolean17 = jSONObject.optBoolean(\"vp_customizations\", false);\n a[36] = true;\n this.f25962b.mo34866a(Feature.VP_CUSTOMIZATION, optBoolean17);\n a[37] = true;\n SDKCoreEventPublisher.post(new SDKCoreEvent(\"features\", Feature.VALUE_FETCHED));\n a[38] = true;\n } catch (JSONException e) {\n a[39] = true;\n InstabugSDKLogger.m46624e(cls, \"Something went wrong while parsing fetching features request's response\", e);\n a[40] = true;\n }\n a[41] = true;\n }", "protected ActivityDTO m10241a(String... strArr) {\n try {\n return this.f8958a.f8975c.a(this.f8958a.f8973a.mo3316c(), strArr[0]);\n } catch (Exception e) {\n return null;\n }\n }" ]
[ "0.54060745", "0.5099665", "0.49691078", "0.49686787", "0.49589077", "0.49127376", "0.48846433", "0.4860086", "0.48526555", "0.4815425", "0.47709516", "0.47696084", "0.4753003", "0.47505355", "0.47498786", "0.4719675", "0.47034895", "0.46797356", "0.4676954", "0.46662897", "0.46606234", "0.46596554", "0.46566713", "0.46517587", "0.46394658", "0.46333358", "0.46320927", "0.46145284", "0.46111426", "0.46004894", "0.45889446", "0.45864347", "0.45837212", "0.45737085", "0.4572393", "0.4571567", "0.456538", "0.45652345", "0.45624635", "0.4554943", "0.4550702", "0.45402235", "0.45314196", "0.45306513", "0.45228857", "0.45200425", "0.45130354", "0.45070988", "0.45069954", "0.4504156", "0.44827488", "0.44795018", "0.4476997", "0.44764748", "0.44641855", "0.44589353", "0.44575706", "0.445118", "0.44491243", "0.4448858", "0.44485387", "0.44381666", "0.44339126", "0.44325554", "0.4430364", "0.44278488", "0.44260418", "0.4419518", "0.44165558", "0.4414966", "0.44125605", "0.44088522", "0.44088155", "0.440176", "0.43880096", "0.4385407", "0.438245", "0.43813244", "0.43793544", "0.4378653", "0.43764657", "0.4371053", "0.43678585", "0.43667424", "0.43647036", "0.4364049", "0.43635908", "0.43572623", "0.4354853", "0.4354137", "0.43540725", "0.43508172", "0.43501824", "0.43496215", "0.43485057", "0.43430495", "0.43422905", "0.43419397", "0.43400258", "0.43384033", "0.4336026" ]
0.0
-1
Ammunition can never be armored
@Override public boolean CanArmor() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void isASRRejection(long ms);", "@Test\n\tpublic void testArmingBypassed() {\n\t\tSet<String> armed = addressesOf(addContactSensor(true, false));\n\t\tSet<String> bypassed = addressesOf(addMotionSensor(true, true));\n\t\tstageArmingBypassed(SecuritySubsystemCapability.ALARMMODE_ON, armed, bypassed);\n\n\t\talarm.bind(context);\n\t\tassertArmingBypassed(armed, bypassed);\n\t}", "@Override\n public boolean eJ() {\n Object object = this.AR;\n synchronized (object) {\n double d;\n long l = System.currentTimeMillis();\n if (this.AP < (double)this.AO && (d = (double)(l - this.AQ) / (double)this.AN) > 0.0) {\n this.AP = Math.min((double)this.AO, d + this.AP);\n }\n this.AQ = l;\n if (this.AP >= 1.0) {\n this.AP-=1.0;\n return true;\n }\n z.W(\"Excessive \" + this.AS + \" detected; call ignored.\");\n return false;\n }\n }", "public boolean isAmmunition() {\r\n return ammunition;\r\n }", "private boolean decideIfEventShouldBeReportedAsAFailure() {\n \tint value = new Random().nextInt(100);\n \tif (value < TARGET_SUCCESS_RATE) {\n \t\treturn false;\n \t} else {\n \treturn true;\n \t}\n }", "boolean needToAim(double angle);", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\t//if (Settings.motorAAngle == -90) Settings.motorAAngle = -95;\n\n\t\tMotor.A.rotateTo(Settings.motorAAngle, true);\n\n\t\twhile (Motor.A.isMoving() && !Motor.A.isStalled() && !suppressed);\t\t\t\n\t\t\n\t\tMotor.A.stop();\n\t}", "protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }", "public void antiderivative () {\n antiderivative(0.0);\n }", "public Boolean IsAbnormally() {\n Random r = new Random();\n int k = r.nextInt(100);\n //1%\n if (k <= 1) {\n abnormally++;\n return true;\n }\n return false;\n }", "public final boolean aow() {\n return false;\n }", "public boolean getMiss(int a)\r\n\t{\r\n\t\tif(Math.random()>(((double)a/(vlr+a))))\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "private void antiguedad() {\n\t\tint anti1, anti2, anti3;\n\t\tanti1 = socio1.antiguedad();\n\t\tanti2 = socio2.antiguedad();\n\t\tanti3 = socio3.antiguedad();\n\n\t\tif (anti1 > anti2 && anti1 > anti3) {\n\t\t\tSystem.out.println(\"El socio con mayor antiguedad es: \" + socio1.socio());\n\t\t} else {\n\t\t\tif (anti2 > anti3) {\n\t\t\t\tSystem.out.println(\"El socio con mayor antiguedad es: \" + socio2.socio());\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"El socio con mayor antiguedad es: \" + socio3.socio());\n\t\t\t}\n\n\t\t}\n\n\t}", "@Override\n\tpublic boolean takeControl() {\n\t\treturn (Math.abs(Motor.A.getTachoCount() - Settings.motorAAngle) > 5 || (Motor.A.getTachoCount() == 0 && Settings.motorAAngle == -90));\n\t}", "public abstract void anticipate();", "@Test\n\tpublic void testArming() {\n\t\tModel contact = addContactSensor(true, false);\n\t\tstageArming(SecuritySubsystemCapability.ALARMMODE_ON, addressesOf(contact));\n\n\t\talarm.bind(context);\n\t\tassertArming(addressesOf(contact));\n\t}", "public boolean isArmed() { return other.isArmed(); }", "boolean validConsecutiveMotion(IMotion m1);", "@Test\n\tpublic void testArming() {\n\t\tPhoton photon = new Photon();\n\t\t\n\t\t// Verify that it's initial arming turn is 0.\n\t\tassertEquals(photon.getArmingTurn(), 0);\n\t\t\n\t\t// Set armingType to STANDARD\n\t\tassertTrue(photon.setStandard());\n\n\t\t// Verify arming type is STANDARD\n\t\tassertEquals(photon.getArmingType(), WeaponArmingType.STANDARD);\n\n\t\t// First round of arming, with proper energy\n\t\tassertTrue(photon.arm(2));\n\t\t\n\t\t// Second round of arming, improper energy.\n\t\tassertFalse(photon.arm(1));\n\t\t\n\t\t// Second round of arming, proper energy.\n\t\tassertTrue(photon.arm(2));\n\t\t\n\t\t// Verify that the weapon is armed.\n\t\tassertTrue(photon.isArmed());\n\t\t\n\t\t// Try to arm an already armed weapon.\n\t\tassertTrue(photon.arm(2));\n\t\t\n\t\t// Set arming to OVERLOAD, this is legal\n\t\tassertTrue(photon.setOverload());\n\t\t\n\t\t// Set arming to PROXIMITY, this is NOT legal.\n\t\tassertFalse(photon.setProximity());\n\t\t\n\t\t// Verify that the photons have been armed with 4 points of energy.\n\t\tassertEquals(photon.getArmingEnergy(), 6, 0.24);\n\t\t\n\t\t// Reset the photon\n\t\tphoton.reset();\n\t\t\n\t\t// Verify that default values are in place.\n\t\tassertEquals(photon.getArmingTurn(), 0);\n\t\tassertFalse(photon.isArmed());\n\t\tassertEquals(photon.getArmingType(), WeaponArmingType.STANDARD);\n\t}", "void negarAnalise();", "public abstract boolean esComestible();", "public void testContinuity() {\n double endtime = 2 * racetrack.getPerimeter() / racetrack.getVelocity();\n double rotationEpsilon = 0.000000001;\n double bounds = velocity * dt + rotationEpsilon;\n continuity(racetrack, 0, endtime, dt, bounds);\n }", "public final boolean aox() {\n return false;\n }", "public Boolean shouldAbandon() {\n return false;\n }", "public void setAmmunition(boolean value) {\r\n this.ammunition = value;\r\n }", "public boolean containsAAAMneumonics() {\n\t\tswitch(this) {\n\t\t\n\t\tcase NOP -> \t{return true;}\n\t\tcase DECI -> \t{return true;}\n\t\tcase DECO -> \t{return true;}\n\t\tcase STRO -> \t{return true;}\n\t\tcase CHARI -> \t{return true;}\n\t\tcase CHARO -> \t{return true;}\n\t\t\n//\t\tcase RETn\n\t\t\n\t\tcase ADDSP -> \t{return true;}\n\t\tcase SUBSP -> \t{return true;}\n\t\t\n\t\tdefault -> {return false;}\n\t\t\n\t\t}\n\t\t\n\t}", "private Proof impossibility(Expression a, Expression b) {\n Proof axm1 = axm1(a, b); //a -> b -> a\n Proof contra = contra(b, a); //(b -> a) -> (!a -> !b)\n return implTrans(axm1, contra);//a -> !a -> !b\n }", "private boolean shouldApply() {\n return nextRandomInt() >= unappliedJobCutoff;\n }", "public Boolean IsIOtrminate() {\n Random r = new Random();\n int k = r.nextInt(100);\n //20%\n if (k <= 20) {\n return true;\n }\n return false;\n }", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedElseAbort_ShouldAbort1() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToTechnologyAverage, link, travelTimeOnLink);\n\t}", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedThenTechnologyAverageElseAbort_ShouldAbort() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToAverageTable, link, travelTimeOnLink);\n\t}", "public void acaba() \n\t\t{\n\t\t\tsigo2 = false;\n\t\t}", "double getMissChance();", "private boolean noImpedingPredecessors(\r\n\t\t\tfinal List<Rule> sequence) {\r\n\t\t\r\n\t\tboolean result = true;\r\n\t\tfor (int i=1; i<sequence.size(); i++) {\r\n\t\t\tRule ri = sequence.get(i);\r\n\t\t\tboolean localResult = true;\r\n\t\t\tfinal Pair<Boolean, List<String>> \r\n\t\t\truleRes = this.ruleSequence.getRuleResult(i, ri.getName(), ApplicabilityConstants.NO_IMPEDING_PREDECESSORS);\r\n\t\t\tif (ruleRes != null) {\r\n\t\t\t\tlocalResult = ruleRes.first.booleanValue();\r\n\t\t\t} \r\n\t\t\telse {\r\n\t\t\t\tfor (int j=0; j<i; j++) {\r\n\t\t\t\t\tRule rj = sequence.get(j);\r\n\t\t\t\t\tfinal SimpleExcludePair excludePair = makeExcludePair();\r\n\t\t\t\t\tif(!asymParallelIndependentByCPA(excludePair, rj, j, ri, i)) {\t\t\t\t\t\r\n\t\t\t\t\t\tlocalResult = false;\r\n\t\t\t\t\t\tsetRuleResult(i, ri.getName(), false, ApplicabilityConstants.NO_IMPEDING_PREDECESSORS, rj.getName());\t\r\n\t\t\t\t\t\tbreak; // evntl. weiter machen!\r\n\t\t\t\t\t} \r\n\t\t\t\t\texcludePair.dispose();\r\n\t\t\t\t}\r\n\t\t\t\tif (localResult) {\r\n\t\t\t\t\tsetRuleResult(i, ri.getName(), true, ApplicabilityConstants.NO_IMPEDING_PREDECESSORS, \"\");\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\t// rewrite result only if localResult is FALSE\r\n\t\t\tif (!localResult) {\r\n\t\t\t\tresult = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!result) {\r\n\t\t\tsetApplicabilityResult(false, ApplicabilityConstants.NO_IMPEDING_PREDECESSORS);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public boolean getSoundAmbience() { return soundAmbience; }", "private void raiseIgnorable(double higher, double lower) {\n this.eatable *= lower;\n this.playable *= lower;\n this.ignorable *= higher;\n }", "@Override\n public boolean isMonotonic() {\n return false;\n }", "@Test\n\t\tpublic void noApplyGoal() {\n\t\t\tassertFailure(\" ;H; ;S; x∈{1,2} ;; {1}⊆S |- 3=3\");\n\t\t}", "public boolean mo9235as() {\n return false;\n }", "public boolean consumeImpulse()\n {\n\treturn modelStep();\n }", "@Override\n public void checkEffect()\n {\n age(1);\n\n if (!suspended)\n suspend();\n }", "public boolean Simbolo(){\n return (Mayuscula() || Minuscula());\n\n }", "public boolean avanti();", "private boolean isDisqualified(Application a) {\n\t if( Float.parseFloat(a.getStudent().getGpa()) < 3.0f) {\n\t a.setScore(Application.SCORE_DISQUALIFIED);\n\t a.setDisqualReason(\"Reported GPA too low\");\n\t return true;\n\t }\n /*\n //Eliminate students who are unable to serve all year\n\t //EDIT getServeAllYear() when appropriate field is added to application\n\t if(a.getApprenticeshipInfo().getServeAllYear().equals(\"No\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n a.setDisqualReason(\"Students must be able to serve in DLA all year\");\n return true\t\t\n }\n\t \n\t //Eliminate students who do not meet project requirements\n\t //EDIT getMeetRequirements() when field is added to application\n\t if(a.getApprenticeshipInfo().getMeetRequirements().equals(\"No\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Students must meet project requirements\");\n\t\treturn true;\n\t }\n\t \n\t //Eliminate students in DLA in the past year\n\t //EDIT getGraduateStudent() when field is added to student application\n\t if(a.getApprenticeshipInfo().getGraduateStudent().equals(\"Yes\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Graduate students are ineligible\");\n\t\treturn true;\n\t }\n\t \n\t //PLACEHOLDER\n\t //Eliminate MS/BS students in MS year\n\t //MS/BS students would be eliminated as graduate students above\n\t //However, if separation is required, it can be done here\n\t \n\t //PLACEHOLDER\n\t //Eliminate students not in College of Engineering\n\t //Currently, these students shouldn't be able to apply as their\n\t //majors would not show up under the student application\n\t //majors list\n\t //If this functionality is changed in the future, the following\n\t //can be used to eliminate them, modify getEngineering() when added\n\t //if(a.getStudent.getEngineering.equals(\"No\")){\n // a.setScore(Application.SCORE_DISQUALIFIED);\n\t // a.setDisqualReason(\"Students not in College of Engineering and Applied Science are ineligible\");\n\t //return true;\n\t //}\n\t \n\t //Eliminate graduate students\n\t if(a.getApprenticeshipInfo().getServed().equals(\"Yes\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Students who served in the DLA in the past year are ineligible\");\n\t\treturn true;\n\t }\n\t \n\t */\n\t return false;\n\t}", "default public boolean getSoundness() {\n if (getValidity()) {\n for (Proposition premise : getPremises()) {\n if (!premise.determineTruth()) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedElseAbort_ShouldAbort2() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToAverageTable, link, travelTimeOnLink);\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}", "private AbsTime(boolean t)\n {\n if (!t) {\n itsValue = ASAP_CODE;\n } else {\n itsValue = NEVER_CODE;\n }\n }", "boolean precondition(Skill castSkill, Creature performer, Creature target) {\n/* 76 */ return false;\n/* */ }", "public void moverArriba() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, 1));\n }", "public Boolean isTransmissionEffective() { return random.nextDouble() < transmissionProb; }", "private void notEligibleForRealMin() {\n eligibleForRealMin = false;\n }", "@Ignore\n\t@Test\n\tpublic void testaMediaDeZeroLance() {\n\t\tLeilao leilao = new Leilao(\"Iphone 7\");\n\n//\t\tcriaAvaliador();\n\t\tleiloeiro.avalia(leilao);\n\n\t\t// validacao\n\t\tassertEquals(0, leiloeiro.getValorMedio(), 0.0001);\n\t}", "@Override\n public void bankrupt() {\n this.mortgaged = false;\n }", "@Override\n\tpublic void activity() {\n\t\tSystem.out.println(\"relaxing\");\n\t}", "public void sogutucuyuAc(){\n\t\tif(!(durum==true)){\n\t\t\tdurum = true;\n\t\t\tnotifyObservers();\n\t\t}\n\t\telse {\n\t\t\tnotifyObservers();\n\t\t}\n\t}", "public void testNotApply() {\n\t\tthis.recordReturn(this.one, this.one.canApply(), true);\n\t\tthis.recordReturn(this.two, this.two.canApply(), false);\n\t\tthis.replayMockObjects();\n\t\tassertFalse(\"Should not be able to apply if one change can not be applied\", this.aggregate.canApply());\n\t\tthis.verifyMockObjects();\n\t}", "public boolean isGoal() {\n return humming() = 0;\n }", "@Override\n\tpublic void canTakeOff() {\n\t\tSystem.out.println(\"I CANNOT TAKE OFF UNLESS YA JUMP ME OVER SOMMAT\");\n\t}", "public abstract boolean isPositive();", "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"mammals are making noise\");\n\t}", "@Model\n\tprotected double advanceTimeInvincible(double dt){\n\t\treturn Math.max(0, getTimeInvincible() - dt);\n\t}", "public boolean mo1531a() {\n if (Math.abs(this.f15728e - 1.0f) < 0.01f) {\n if (Math.abs(this.f15729f - 1.0f) < 0.01f) {\n return false;\n }\n }\n return true;\n }", "boolean canFall();", "protected void setTimeInvincible(double time){\n\t\tassert(time >= 0);\n\t\tthis.time_invincible = time;\n\t}", "private void reinforcementPhase(Player p) \n\t{\n\t\tint armyNum = map.calculateArmyNum(p);\n\t\tp.setArmies(armyNum);\n\t\tp.reinforce();\n\t}", "private boolean m223a() {\n if (!at.d(this.f82006a)) {\n if (at.f(this.f82006a) && !c()) {\n return true;\n }\n if ((at.g(this.f82006a) && !b()) || at.h(this.f82006a)) {\n return true;\n }\n }\n return false;\n }", "@Override\n\tpublic boolean execute() {\n\t\t// Runs the motors so they expel the ball for EXPEL_TIME seconds\n\t\tif (System.currentTimeMillis() - begin < EXPEL_TIME) {\n\t\t\taccumulatorController.systems.getAccumulatorMotors().setSpeed(ACCUMULATOR_POWER);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public void mo1334a() {\n m18896a(true);\n }", "protected boolean asEaten() {\n return false;\n }", "boolean disruption() {\n disruption_seed = disruption_seed * 1103515245 + 12345;\n long disruption_director = (disruption_seed / 65536) % 32768;//The bits considered is changed so that c4 is unique\n int disruption_director1 = (int) ((disruption_director >> 4) & 7);\n\n switch (disruption_director1) /* Check the randomness of the pseudo random generator */ {\n case 0 -> zero++;\n case 1 -> one++;\n case 2 -> two++;\n case 3 -> three++;\n case 4 -> four++;\n case 5 -> five++;\n case 6 -> six++;\n case 7 -> seven++;\n default -> other++;\n }\n\n if (/*(disruption_director == 0)||(disruption_director == 1)||(disruption_director == 2)||(disruption_director == 3)||*/(disruption_director == 4) || (disruption_director == 5) || (disruption_director == 6) || (disruption_director == 7)) /* Disrupt 50% of the time */ {\n System.out.printf(\"Disruption %d \\n\", disruption_director);\n //Sleep(100);\n return false;\n } else {\n return true;\n }\n }", "public boolean isAtmo() {\n return atmo;\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 public void imprime(){\n System.out.println(\" ----- Arbol Splay ----- \");\n imprimeAS(super.getRaiz());\n }", "public boolean isGoal() {\n return hamming() == 0;\n }", "public boolean isGoal() {\n return hamming() == 0;\n }", "public boolean isGoal() {\n return hamming() == 0;\n }", "public boolean isGoal() {\n return hamming() == 0;\n }", "public boolean isGoal() {\n return hamming() == 0;\n }", "public boolean isGoal() {\n return hamming() == 0;\n }", "@Override\n public boolean isAIEnabled() {\n return false;\n }", "public Boolean IsInterrupt() {\n Random r = new Random();\n int k = r.nextInt(100);\n //10%\n if (k <= 10) {\n return true;\n }\n return false;\n }", "double effective_aoa () {\n if (current_part == strut)\n return current_part.aoa;\n else if (// false && // DEBUG aft problems...\n current_part == stab && stab_aoa_correction) {\n // stab is in downwash from main wing and sees some down stream.\n double wing_Cl0 = 0.4; // very typical, true for Aquila, NACA 3412 63-412 etc\n // the following is from \"General aviation aicraft design, Appendix C1\"\n double wing_Cl = wing.cl;\n double div = Math.PI * wing.span/wing.chord;\n double corrected_aoa = craft_pitch * (1 - 2 * wing_Cl / div) - \n 2 * wing_Cl0 / div - wing.aoa + current_part.aoa;\n // double correction = corrected_aoa - (current_part.aoa + craft_pitch);\n // System.out.println(\"-- correction: \" + correction);\n return Math.min(aoa_max, Math.max(aoa_min, corrected_aoa));\n } else\n return Math.min(aoa_max, Math.max(aoa_min, current_part.aoa + craft_pitch));\n }", "@Test\n public void testAutocorrelation()\n {\n IDoubleArray M = null;\n IDoubleArray observable = null;\n IDoubleArray timepoints = null;\n MarkovModelUtilities instance = new MarkovModelUtilities();\n IDoubleArray expResult = null;\n IDoubleArray result = instance.autocorrelation(M, observable, timepoints);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static void devidebyzero_mitigation() {\n\t\tint b = 0;\n\t\tint c = 10;\n\t\tint a = 0;\n\t\tif(b!=0) {\n\t\t a = c/b;\n\t\t}\n\t\tSystem.out.println(\"The value of a in mitigationstrategy Example = \" +a);\n\t}", "public void excavate();", "public void accomplishGoal() {\r\n isAccomplished = true;\r\n }", "protected boolean canSampleAlongCurve() { return false; }", "@Test\n\tpublic void testStarvation() {\n\t\t// |xxx|\n\t\t// | x |\n\t\tWorld world = loadWorld(\"starvation.txt\");\n\t\t\n\t\tassertThat(physics.advance(world, 1, 1), is(false));\n\t}", "private void doEpsilon(){\n\t\tcurrentState = \"q0\";\n\t}", "public boolean isGoal() {\n return hamming == 0;\n }", "public void act1()\r\n {\r\n super.act1();\r\n isPhasing = !isPhasing;\r\n }", "@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }", "@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }", "public boolean isGoal() {\n\t\treturn hamming == 0;\n\t}", "boolean canSnowFallOn();", "public boolean use(int value){durability -= value; if(durability == 0) return true; return false;}", "private boolean canTakeBandanaFrom(Unit other) {\n return getCalories() >= (2 * other.getCalories());\n }", "public abstract void zeroAP();", "@Test\n void checkNoEffectMove() {\n assertTrue(abilities.checkCanMove(turn, board.getCellFromCoords(0, 1)));\n abilities.doMove(turn, board.getCellFromCoords(0, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(0, 1));\n }", "@Test\n\tpublic void testWarm_DetailedThenTechnologyAverageElseAbort_FallbackNotNeeded() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.tryDetailedThenTechnologyAverageElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\tMap<Pollutant, Double> warmEmissions = emissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFull, link, travelTimeOnLink);\n\n\t\tdouble expectedValue = 30.34984742; // = 200m * 151.7492371 g/km\n\t\tAssert.assertEquals( expectedValue, warmEmissions.get(Pollutant.CO2_TOTAL ), MatsimTestUtils.EPSILON );\n\t}" ]
[ "0.61762255", "0.61607003", "0.6061006", "0.59609455", "0.58393824", "0.57929593", "0.57041746", "0.56837124", "0.56753314", "0.55709845", "0.5562885", "0.5561603", "0.5546941", "0.552557", "0.55158335", "0.5493775", "0.54737043", "0.54712844", "0.54693913", "0.54642624", "0.540689", "0.5389161", "0.5384712", "0.53695273", "0.5364245", "0.5356409", "0.53562015", "0.53560597", "0.53408223", "0.5324628", "0.5306879", "0.5298945", "0.52903533", "0.5284227", "0.5271543", "0.5268318", "0.5263908", "0.5257114", "0.5251648", "0.52429026", "0.52357334", "0.5209473", "0.52053434", "0.51807874", "0.51798666", "0.5169382", "0.5155215", "0.5155092", "0.5151502", "0.5148852", "0.5148361", "0.51449186", "0.51437896", "0.5135724", "0.51349056", "0.51303256", "0.5127795", "0.5124026", "0.5113461", "0.51094836", "0.5093931", "0.5084623", "0.5080308", "0.50758624", "0.5074761", "0.5073817", "0.50727284", "0.5065891", "0.5064869", "0.50643814", "0.5063285", "0.50617146", "0.5061255", "0.505704", "0.5047558", "0.5047558", "0.5047558", "0.5047558", "0.5047558", "0.5047558", "0.5043361", "0.50425905", "0.503832", "0.503805", "0.5037739", "0.5033246", "0.5030102", "0.5028836", "0.50243133", "0.5023174", "0.5020794", "0.5020592", "0.5017407", "0.5017407", "0.50159806", "0.5011523", "0.50107306", "0.50102985", "0.50095254", "0.5006559", "0.5001626" ]
0.0
-1
First Time Creating Database
@Override public void onCreate(SQLiteDatabase db) { String createTableStatement = "CREATE TABLE " + pass_store + " (SID INTEGER PRIMARY KEY AUTOINCREMENT, " + column_url + " TEXT, " + column_password + " TEXT, " + column_status + " BOOLEAN )"; db.execSQL(createTableStatement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Database createDatabase();", "public void dbCreate() {\n Logger.write(\"INFO\", \"DB\", \"Creating database\");\n try {\n if (!Database.DBDirExists())\n Database.createDBDir();\n dbConnect(false);\n for (int i = 0; i < DBStrings.createDB.length; i++)\n execute(DBStrings.createDB[i]);\n } catch (Exception e) {\n Logger.write(\"FATAL\", \"DB\", \"Failed to create databse: \" + e);\n }\n }", "private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }", "private void createDatabase() throws Exception{\n Statement stm = this.con.createStatement();\n stm.execute(\"CREATE DATABASE IF NOT EXISTS \" + database +\n \" DEFAULT CHARACTER SET utf8 COLLATE utf8_persian_ci\");\n }", "private void createDatabase() throws SQLException\r\n {\r\n myStmt.executeUpdate(\"create database \" + dbname);\r\n }", "public void initDb() {\n String createVac = \"create table if not exists vacancies(id serial primary key,\"\n + \"name varchar(1500) NOT NULL UNIQUE, url varchar (1500), description text, dateVac timestamp);\";\n try (Statement st = connection.createStatement()) {\n st.execute(createVac);\n } catch (SQLException e) {\n LOG.error(e.getMessage());\n }\n }", "private void initDatabase() {\n\n String sql = \"CREATE TABLE IF NOT EXISTS books (\\n\"\n + \"\tISBN integer PRIMARY KEY,\\n\"\n + \"\tBookName text NOT NULL,\\n\"\n + \" AuthorName text NOT NULL, \\n\"\n + \"\tPrice integer\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(urlPath);\n Statement stmt = conn.createStatement()) {\n System.out.println(\"Database connected\");\n stmt.execute(sql);\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public static void createDataBase() {\n final Configuration conf = new Configuration();\n\n addAnnotatedClass(conf);\n\n conf.configure();\n new SchemaExport(conf).create(true, true);\n }", "public static void createDatabase() throws SQLException {\n\t\tSystem.out.println(\"DROP database IF EXISTS project02;\");\n\t\tstatement = connection.prepareStatement(\"DROP database IF EXISTS project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"CREATE database project02;\");\n\t\tstatement = connection.prepareStatement(\"CREATE database project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"USE project02;\");\n\t\tstatement = connection.prepareStatement(\"USE project02;\");\n\t\tstatement.executeUpdate();\n\t}", "public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public static void SetupDB() {\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS User(email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS FriendList(ID INTEGER PRIMARY KEY, email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS Category(ID INTEGER PRIMARY KEY,name TEXT);\");\n\t}", "public void createDB(){\r\n\t\t\r\n\t\t Connection connection = null;\r\n\t try\r\n\t {\r\n\t // create a database connection\r\n\t connection = DriverManager.getConnection(\"jdbc:sqlite:project.sqlite\");\r\n\t Statement statement = connection.createStatement();\r\n\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\r\n\t statement.executeUpdate(\"drop table if exists task\");\r\n\t statement.executeUpdate(\"create table task (taskId integer primary key asc, description string, status string, createDate datetime default current_timestamp)\");\r\n\t statement.executeUpdate(\"insert into task values(1, 'leo', 'Active', null)\");\r\n\t statement.executeUpdate(\"insert into task values(2, 'yui', 'Complete', null)\");\r\n\t }\r\n\t catch(SQLException ex){\r\n\t \tthrow new RuntimeException(ex);\r\n\t }\r\n\t\t\r\n\t}", "@Before\n public void createDatabase() {\n dbService.getDdlInitializer()\n .initDB();\n kicCrud = new KicCrud();\n }", "private static void initializeDatabase()\n\t{\n\t\tResultSet resultSet = dbConnect.getMetaData().getCatalogs();\n\t\tStatment statement = dbConnect.createStatement();\n\t\t\n\t\tif (resultSet.next())\n\t\t{\n\t\t\tstatement.execute(\"USE \" + resultSet.getString(1));\n\t\t\tstatement.close();\n\t\t\tresultSet.close();\n\t\t\treturn; //A database exists already\n\t\t}\n\t\tresultSet.close();\n\t\t//No database exists yet, create it.\n\t\t\n\t\tstatement.execute(\"CREATE DATABASE \" + dbName);\n\t\tstatement.execute(\"USE \" + dbName);\n\t\tstatement.execute(createTableStatement);\n\t\tstatement.close();\n\t\treturn;\n\t}", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "DataBase createDataBase();", "public static void createDatabase() throws ArcException {\n\t\tcreateDatabase(userWithRestrictedRights);\t\t\n\t}", "public void creatDataBase(String dbName);", "private void setupDatabase() {\r\n\t\tDatabaseHelperFactory.init(this);\r\n\t\tdatabase = DatabaseHelperFactory.getInstance();\r\n\t}", "public void createDataBase() throws IOException{\n \n \tboolean dbExist = checkDataBase();\n \t\n \n \tif(dbExist){\n \t\t//do nothing - database already exists\n \t\tLog.d(\"Database Check\", \"Database Exists\");\n\n \t}else{\n \t\tLog.d(\"Database Check\", \"Database Doesn't Exist\");\n \t\tthis.close();\n \t\t//By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n \tthis.getReadableDatabase();\n \tthis.close();\n \ttry {\n \t\t\tcopyDataBase();\n \t\t\tLog.d(\"Database Check\", \"Database Copied\");\n \n \t\t} catch (IOException e) {\n \t\tLog.d(\"I/O Error\", e.toString());\n\n \t\tthrow new Error(\"Error copying database\");\n \t}\n \tcatch (Exception e) { \n \t\tLog.d(\"Exception in createDatabase\", e.toString());\n \t\t\n \t}\n \t}\n \n }", "public void createDatabase() throws IOException{\r\n\r\n boolean dbDoesExist = checkDatabase();\r\n if(!dbDoesExist)\r\n {\r\n // Create or open db if db is not connected\r\n this.getReadableDatabase();\r\n try{\r\n createNewDB();\r\n }catch (IOException e){\r\n throw new Error(\"DB Copy Failed\");\r\n }\r\n }\r\n }", "@Override\n\t\tpublic void onCreate(SQLiteDatabase database) {\n\t\t\tcreateTable(database);\n\n\t\t}", "public void dbCreate() throws IOException\n {\n boolean dbExist = dbCheck();\n\n if(!dbExist)\n {\n //By calling this method an empty database will be created into the default system patt\n //of the application so we can overwrite that db with our db.\n this.getReadableDatabase(); // create a new empty database in the correct path\n try\n {\n //copy the data from the database in the Assets folder to the new empty database\n copyDBFromAssets();\n }\n catch(IOException e)\n {\n throw new Error(\"Error copying database\");\n }\n }\n }", "public static void createDB(String name) {\n\t\ttry {\n\t\t\tString Query = \"CREATE DATABASE \" + name;\n\t\t\tStatement st = conexion.createStatement();\n\t\t\tst.executeUpdate(Query);\n\t\t\tSystem.out.println(\"DB creada con exito!\");\n\n\t\t\tJOptionPane.showMessageDialog(null, \"Se ha creado la DB \" + name + \"de forma exitosa.\");\n\t\t} catch (SQLException ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t\tSystem.out.println(\"Error creando la DB.\");\n\t\t}\n\t}", "public Database()\r\n\t{\r\n\t\tinitializeDatabase();\r\n\t\t\r\n\t}", "public void createNewSchema() throws SQLException {\n ResultSet resultSet = databaseStatement.executeQuery(\"select count(datname) from pg_database\");\n int uniqueID = 0;\n if(resultSet.next()) {\n uniqueID = resultSet.getInt(1);\n }\n if(uniqueID != 0) {\n uniqueID++;\n databaseStatement.executeQuery(\"CREATE DATABASE OSM\"+uniqueID+\";\");\n }\n }", "void createDb(String dbName);", "public void createDatabase() throws IOException {\n boolean dbExists = checkDatabase();\n\n if (dbExists) {\n // Do nothing - database already exists\n } else {\n // By calling this method an empty database will be created into the\n // default system path of our application so we are going to be able\n // to overwrite the database with our database.\n this.getReadableDatabase();\n\n try {\n copyDatabase();\n } catch (IOException e) {\n throw new Error(\"Error copying database\");\n }\n }\n }", "public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }", "public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }", "protected void setupDB() {\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database started\");\n\t\tlog.info(\"ddl: db-config.xml\");\n\t\tlog.info(\"------------------------------------------\");\n\t\ttry {\n\t\t\tfinal List<String> lines = Files.readAllLines(Paths.get(this.getClass()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getClassLoader()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getResource(\"create-campina-schema.sql\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toURI()), Charset.forName(\"UTF-8\"));\n\n\t\t\tfinal List<String> statements = new ArrayList<>(lines.size());\n\t\t\tString statement = \"\";\n\t\t\tfor (String string : lines) {\n\t\t\t\tstatement += \" \" + string;\n\t\t\t\tif (string.endsWith(\";\")) {\n\t\t\t\t\tstatements.add(statement);\n\t\t\t\t\tstatement = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry (final Connection con = conManager.getConnection(Boolean.FALSE)) {\n\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(\"DROP SCHEMA IF EXISTS campina\")) {\n\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t}\n\t\t\t\tfor (String string : statements) {\n\t\t\t\t\tlog.info(\"Executing ddl: \" + string);\n\t\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(string)) {\n\t\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tthrow new IllegalStateException(\"Could not setup db\", e);\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tlog.error(\"Could not setup database\", e);\n\t\t\tthrow new IllegalStateException(\"ddl file load failed\", e);\n\t\t}\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database finished\");\n\t\tlog.info(\"------------------------------------------\");\n\t}", "private void setupDatabase() throws SQLException {\n\t\tdb.open(\"localhost\", 3306, \"wow\", \"greeneconomyapple\");\n\t\tdb.use(\"auctionscan\");\n\t}", "private Connection createDatabase() {\n\t\tSystem.out.println(\"We are creating a database\");\n\t\ttry (\n\t\t\t\t// Step 1: Allocate a database \"Connection\" object\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:\" + PORT_NUMBER + \"/\", \n\t\t\t\t\t\t\"root\", \"root\"); // MySQL\n\t\t\t\t// Step 2: Allocate a \"Statement\" object in the Connection\n\t\t\t\tStatement stmt = conn.createStatement();\n\t\t\t\t) {\n\t\t\t// Step 3 - create our database\n\t\t\tString sql = \"CREATE DATABASE IF NOT EXISTS experiences\";\n\t\t\tstmt.execute(sql);\n\t\t\treturn conn;\n\t\t\t\n\n\t\t} catch(SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null; }\n\t}", "public FakeDatabase() {\n\t\t\n\t\t// Add initial data\n\t\t\n//\t\tSystem.out.println(authorList.size() + \" authors\");\n//\t\tSystem.out.println(bookList.size() + \" books\");\n\t}", "void go() {\n\t\tthis.conn = super.getConnection();\n\t\tcreateCustomersTable();\n\t\tcreateBankersTable();\n\t\tcreateCheckingAccountsTable();\n\t\tcreateSavingsAccountsTable();\n\t\tcreateCDAccountsTable();\n\t\tcreateTransactionsTable();\n\t\tcreateStocksTable();\n\t\tif(createAdminBanker) addAdminBanker();\n\t\tSystem.out.println(\"Database Created\");\n\n\t}", "private void setupDatabase()\n {\n try\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }\n catch (ClassNotFoundException e)\n {\n simpleEconomy.getLogger().severe(\"Could not load database driver.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n\n try\n {\n connection = DriverManager\n .getConnection(String.format(\"jdbc:mysql://%s/%s?user=%s&password=%s\",\n simpleEconomy.getConfig().getString(\"db.host\"),\n simpleEconomy.getConfig().getString(\"db.database\"),\n simpleEconomy.getConfig().getString(\"db.username\"),\n simpleEconomy.getConfig().getString(\"db.password\")\n ));\n\n // Loads the ddl from the jar and commits it to the database.\n InputStream input = getClass().getResourceAsStream(\"/ddl.sql\");\n try\n {\n String s = IOUtils.toString(input);\n connection.createStatement().execute(s);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n input.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n catch (SQLException e)\n {\n simpleEconomy.getLogger().severe(\"Could not connect to database.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n }", "private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}", "public void createDataBase() throws IOException {\n boolean dbExist = checkDataBase();\n\n if (dbExist) {\n\n } else {\n this.getReadableDatabase();\n try {\n copyDataBase();\n } catch (IOException e) {\n Log.e(\"tle99 - create\", e.getMessage());\n }\n }\n }", "public void createDB() {\n String url = \"jdbc:sqlite:stats.db\";\n Statement stmt = null;\n try (Connection conn = DriverManager.getConnection(url)) {\n stmt = conn.createStatement();\n String query = \"CREATE TABLE IF NOT EXISTS games \"\n + \"(ownships int, \"\n + \"ownremaining int, \"\n + \"aiships int,\"\n + \"airemaining int, \"\n + \"turns int)\";\n\n stmt.executeUpdate(query);\n\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase database) {\n\t\tcreateTables(database);\n\t}", "public void createNewDB(String DB_Name) {\n //SQL statement\n String query = \"CREATE database if NOT EXISTS \" + DB_Name;\n\n try {\n //Connection\n stmt = con.createStatement();\n //Execute statement\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Database \" + DB_Name + \" created--\");\n } catch (SQLException ex) {\n //Handle SQL exceptions\n System.out.println(\"\\n--Statement did not execute--\");\n ex.printStackTrace();\n }\n }", "public void createDatabase(String dbName, String owner) throws Exception;", "public void createDB(String filename) throws SQLException {\n //System.out.printf(\"Connecting to the database %s.%n\", filename);\n /* \n * Connect to the database (file). If the file does not exist, create it.\n */\n Connection db_connection = DriverManager.getConnection(SQLITEDBPATH + filename);\n this.createTables(db_connection);\n this.initTableCities(db_connection);\n this.initTableTeams(db_connection);\n //System.out.printf(\"Connection to the database has been established.%n\");\n db_connection.close();\n //System.out.printf(\"Connection to the database has been closed.%n\");\n }", "long createDatabase(long actor, String nameToDisplay, long proteinDBType, long sizeInBytes, boolean bPublic, boolean bReversed, ExperimentCategory category);", "private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }", "@Override\r\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tFormDAO.createTable(db);\r\n//\t\tCreate table ENumber\r\n\t\tENumberDAO.createTable(db);\r\n\t\t\r\n\r\n\t}", "public void createDatabase() throws IOException {\n boolean dbExist = checkDataBase();\n// if(dbExist) {\n// Log.d(\"E\", \"Database exists.\");\n// try {\n// copyDataBase();\n// } catch (IOException e) {\n// Log.e(\"Error\", e.getMessage());\n// }\n// } else {\n// try {\n// copyDataBase();\n// } catch (IOException e) {\n// Log.e(\"Error1\", e.getMessage());\n// }\n// }\n\n if (!dbExist) {\n this.getReadableDatabase();\n this.close();\n try {\n //Copy the database from assests\n copyDataBase();\n Log.e(TAG, \"createDatabase database created\");\n } catch (IOException mIOException) {\n throw new Error(\"ErrorCopyingDataBase\");\n }\n }\n\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(DATABASE_CREATE);\n }", "@Override\n\tpublic Database createDatabase(Type type) throws FSException {\n\t\treturn new DummyDatabase();\n\t}", "public Database initDB() {\n Database db = new Database(\"dataBase.db\");\n\n// db.insertData(\"1 Dragos Dinescu [email protected] 0744522600 Digi 10-12-2020\");\n// db.insertData(\"2 Adelina Mirea [email protected] 0733651320 Orange 14-10-2020\");\n// db.insertData(\"3 Radu Sorostinean [email protected] 0733723321 Digi 1-10-2020\");\n// db.insertData(\"4 Andrei Brasoveanu [email protected] 0732341390 Vodafone 12-11-2020\");\n return db;\n\n //db.deleteFromDB();\n //db.updateDB(\"1 alex radu [email protected] 022256926 orange 10/08/2010\");\n }", "public void createDatabase(String sDBName) throws SQLException{\n\t\tloadDriver();\n\t\tConnection conn = DriverManager.getConnection(protocol + dbName\n + \";create=true\", new Properties());\n\t\tcloseJDBCResources(conn);\t\t\n\t}", "@Override\n public void onCreate(SQLiteDatabase _db) {\n _db.execSQL(DATABASE_CREATE);\n }", "public void create() {\n\t\t\tdb.execSQL(AGENCYDB_CREATE+\".separete,.import agency.txt agency\");\n\t\t\tdb.execSQL(STOPSDB_CREATE+\".separete,.import stop_times.txt stop_times\");\n\t\t\t\n\t\t\t// Add 2 agencies for testing\n\t\t\t\n\t\t\t\n\t\t\tdb.setVersion(DATABASE_VERSION);\n\t\t}", "void createDatabaseOnDevice() throws IOException {\n boolean databaseExists = checkIfDatabaseOnDevice();\n\n if (!databaseExists) {\n this.getReadableDatabase();\n\n try {\n copyDatabaseToDevice();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public void createTable() {\n\t\tString QUERY = \"CREATE TABLE person (id INT PRIMARY KEY, name VARCHAR(32) NOT NULL, phoneNumber VARCHAR(18) NOT NULL)\";\n\t\ttry (Connection con = DriverManager.getConnection(URL, USER, PASSWORD);\n\t\t\t\tStatement stmt = con.createStatement();) {\n\t\t\tstmt.executeUpdate(QUERY);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"SQL Exception\");\n\t\t}\n\n\t}", "@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(DATABASE_CREATE);\n }", "@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase) {\n String sql = \"drop table \" + MelodyData.CreateDB._TABLENAME;\n sqLiteDatabase.execSQL(AccompanimentData.CreateDB._CREATE);\n sqLiteDatabase.execSQL(MelodyData.CreateDB._CREATE);\n }", "public void createDatabase(String databaseName)\n\t{\n\t\tclearConnection();\n\t\ttry\n\t\t{\n\t\t\tStatement createDatabaseStatement = databaseConnection.createStatement();\n\t\t\t\n\t\t\tint result = createDatabaseStatement.executeUpdate(\"CREATE DATABASE IF NOT EXISTS \" + databaseName + \";\");\n\t\t}\n\t\tcatch (SQLException currentSQLError)\n\t\t{\n\t\t\tdisplaySQLErrors(currentSQLError);\n\t\t}\n\t}", "private void createTables() {\n\n\t\tAutoDao.createTable(db, true);\n\t\tAutoKepDao.createTable(db, true);\n\t\tMunkaDao.createTable(db, true);\n\t\tMunkaEszkozDao.createTable(db, true);\n\t\tMunkaKepDao.createTable(db, true);\n\t\tMunkaTipusDao.createTable(db, true);\n\t\tPartnerDao.createTable(db, true);\n\t\tPartnerKepDao.createTable(db, true);\n\t\tProfilKepDao.createTable(db, true);\n\t\tSoforDao.createTable(db, true);\n\t\tTelephelyDao.createTable(db, true);\n\t\tPushMessageDao.createTable(db, true);\n\n\t}", "@Override\n //\n public void onCreate(SQLiteDatabase db)\n {\n db.execSQL(DATABASE_CREATE);\n }", "private void initDB() {\n dataBaseHelper = new DataBaseHelper(this);\n }", "public PostDatabase() {\r\n\ttry {\r\n\t Class.forName(DRIVER);\r\n\t db = DriverManager.getConnection(URI);\r\n\t Statement create = db.createStatement();\r\n\t create.execute(\"CREATE TABLE IF NOT EXISTS posts ( id INTEGER PRIMARY KEY, author TEXT, date INTEGER, isPublic INTEGER, content TEXT );\");\r\n\t} catch (ClassNotFoundException e) {\r\n\t System.err.println(\"Caught exception while attempting to use database driver: \" + e.getMessage());\r\n\t} catch (SQLException e) {\r\n\t System.err.println(\"Caught exception while doing something to the database: \" + e.getMessage());\r\n\t}\r\n }", "public void generateDB() {\n\t\t// Database tables creation\n\t\tcreateTables();\n\n\t\t// Try catch estructure in case there is an exception during the data\n\t\t// insertion\n\t\ttry {\n\t\t\t// Create an admin user\n\t\t\tadminUser = new User(\"admin\", \"1234\", \"admin\", \"admin\", \"admin\", 1);\n\n\t\t\t// Create some default players\n\t\t\tString p1DateString = \"1988-05-12\";\n\t\t\tString p2DateString = \"1985-02-05\";\n\t\t\tString p3DateString = \"1987-06-24\";\n\t\t\tString p4DateString = \"1992-02-05\";\n\t\t\tDate p1Date = sdf.parse(p1DateString);\n\t\t\tDate p2Date = sdf.parse(p2DateString);\n\t\t\tDate p3Date = sdf.parse(p3DateString);\n\t\t\tDate p4Date = sdf.parse(p4DateString);\n\t\t\tp1 = new Player(\"Marcelo\", \"Vieira\", p1Date, 174);\n\t\t\tp2 = new Player(\"Cristiano\", \"Ronaldo\", p2Date, 185);\n\t\t\tp3 = new Player(\"Lionel\", \"Messi\", p3Date, 170);\n\t\t\tp4 = new Player(\"Neymar\", \"Silva\", p4Date, 175);\n\n\t\t\t// Create some default teams\n\t\t\tString t1DateString = \"1902-03-6\";\n\t\t\tString t2DateString = \"1985-02-05\";\n\t\t\tDate t1Date = sdf.parse(t1DateString);\n\t\t\tDate t2Date = sdf.parse(t2DateString);\n\t\t\tList<Player> t1Players = formatPlayers(getPlayersByTeamId(REAL_MADRID));\n\t\t\tList<Player> t2Players = formatPlayers(getPlayersByTeamId(BARCELONA));\n\t\t\tt1 = new Team(t1Players, \"Real Madrid C.F.\", \"Zinedine Zidane\", \"Madrid\", t1Date);\n\t\t\tt2 = new Team(t2Players, \"FC Barcelona\", \"Luis Enrique\", \"Barcelona\", t2Date);\n\n\t\t\t// Create some default stats\n\t\t\ts1 = new Stats(1, 1, 6, 15);\n\t\t\ts2 = new Stats(3, 1, 8, 18);\n\n\t\t\t// Create some default matches\n\t\t\tString m1DateString = \"2017-01-20\";\n\t\t\tString m2DateString = \"2017-03-06\";\n\t\t\tDate m1Date = sdf.parse(m1DateString);\n\t\t\tDate m2Date = sdf.parse(m2DateString);\n\t\t\tm1 = new Match(t2, t1, s1, m1Date, \"Alfonso Alvarez Izq\");\n\t\t\tm2 = new Match(t1, t2, s2, m2Date, \"Carlos Clos Gomez\");\n\n\t\t\t// Fill the database tables only if they are empty\n\t\t\tif (!usersFilled()) {\n\t\t\t\tinsertUser(adminUser);\n\t\t\t}\n\t\t\tif (!playersFilled()) {\n\t\t\t\tinsertPlayer(p1, REAL_MADRID);\n\t\t\t\tinsertPlayer(p2, REAL_MADRID);\n\t\t\t\tinsertPlayer(p3, BARCELONA);\n\t\t\t\tinsertPlayer(p4, BARCELONA);\n\t\t\t}\n\t\t\tif (!teamsFilled()) {\n\t\t\t\tinsertTeam(t1);\n\t\t\t\tinsertTeam(t2);\n\t\t\t}\n\t\t\tif (!matchesFilled() && !statsFilled()) {\n\t\t\t\tinsertStat(s1);\n\t\t\t\tinsertMatch(m1);\n\t\t\t\tinsertStat(s2);\n\t\t\t\tinsertMatch(m2);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void initDB(){\n gistHelper = new GistSQLiteHelper(mainActivity, \"GistsDB\", null, 1);\n db = gistHelper.getWritableDatabase();\n }", "private void initialize() {\n if (databaseExists()) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n int dbVersion = prefs.getInt(SP_KEY_DB_VER, 1);\n if (DATABASE_VERSION != dbVersion) {\n File dbFile = mContext.getDatabasePath(DBNAME);\n if (!dbFile.delete()) {\n Log.w(TAG, \"Unable to update database\");\n }\n }\n }\n if (!databaseExists()) {\n createDatabase();\n }\n }", "public boolean initializeDatabase() {\n try {\n initializeCategory();\n initializeExpense();\n initializeIncome();\n initializeBalance();\n initializeUser();\n } catch (Throwable t) {\n\n System.out.println(t.getMessage());\n return false;\n }\n return true;\n }", "@POST\n @Produces({\"application/json\"})\n public String createDb() throws WebApplicationException {\n HibernateEntityManager emAdm = PersistenceManager.getInstance().getEntityManagerAdmin();\n SQLQuery qCreate = emAdm.getSession().createSQLQuery(\"CREATE DATABASE test_jeff template=postgis\");\n try{\n qCreate.executeUpdate();\n }catch(SQLGrammarException e){\n System.out.println(\"Error !!\" + e.getSQLException());\n emAdm.close();\n return e.getSQLException().getLocalizedMessage();\n }\n emAdm.close();\n Map properties = new HashMap();\n //change the connection string to the new db\n properties.put(\"hibernate.connection.url\", \"jdbc:postgresql_postGIS://192.168.12.36:5432/test_jeff\");\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"dataPU\", properties); \n return \"Yeah\";\n }", "public static LocalDatabase dbSetup(String name)\n\t{\n\t\tLocalDatabase local = new LocalDatabase(name);\n\t\tlocal.loadDriver();\n\t\tlocal.openConnection();\n\t\tlocal.createTablePersons();\n\t\tlocal.createTableListenings();\n\t\tlocal.createTableRecordings();\n\t\tlocal.closeConnection();\n\t\treturn local;\n\t}", "public Database() {\n if (init) {\n\n //creating Transaction data\n Transaction transactionOne\n = new Transaction(1, \"Debit\", \"Spar Grocery\", 54.68,1);\n\n transactionDB.add(transactionOne);\n\n // Creating an Account data\n Account accountOne = new Account(1, 445, 111111111, \"Savings\",\n 1250.24, transactionDB);\n\n accountDB.add(accountOne);\n\n //creating withdrawal data\n Withdrawal withdrawalOne = new Withdrawal(1, 64422545, 600.89);\n withdrawalDB.add(withdrawalOne);\n\n //creating transfer data\n Transfer transferOne = new Transfer(1, 25252525, 521.23);\n transferDB.add(transferOne);\n\n //creating lodgement data\n Lodgement lodgementOne = new Lodgement(1, 67766666, 521.23);\n lodgementDB.add(lodgementOne);\n\n //add Customer data \n Customer customerOne\n = new Customer(1, \"Darth Vader\", \"[email protected]\",\n \"Level 5, Suit Dark\", \"darkSideIsGoodStuff\",\n accountDB, withdrawalDB, transferDB, lodgementDB);\n\n customerDB.add(customerOne);\n\n init = false;\n }\n }", "@Override\n public void onCreate(SQLiteDatabase database) {\n database.execSQL(DATABASE_CREATE);\n }", "@Override\n public void onCreate(SQLiteDatabase database) {\n database.execSQL(DATABASE_CREATE);\n }", "private void createSchema() throws Exception\n {\n LOG.info(\"Creating schema\");\n HibernateUtil.currentSession();\n }", "public void connectAndCreateDB() {\n\t\tString connectionURL = \"jdbc:derby://localhost:1527/DerbyBPI;create=true\";\n\t //String connectionURL = \"jdbc:derby:DerbyBPI;create=true\";\n\t //String connectionURL = \"jdbc:derby://localhost:1527/\"+dbName+\";create=true\";\n\t// String connectionURL = \"jdbc:derby://ORCDatabase:1527/\"+dbName+\";create=true\";\n\n try {\t \n\t\tClass.forName(driver).newInstance(); \n System.out.println(driver + \" loaded. \");\n \n } catch(java.lang.ClassNotFoundException e) {\n System.err.print(\"ClassNotFoundException: \");\n System.err.println(e.getMessage());\n System.out.println(\"\\n >>> Please check your CLASSPATH variable <<<\\n\");\n } catch (InstantiationException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t} catch (IllegalAccessException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\n\n\t// Create (if needed) and connect to the database\n \n\t\ttry {\n\t\t\t\n\t\t\tconn = DriverManager.getConnection(connectionURL);\n\t\t\tSystem.out.println(\"******* Connected to database \" + dbName);\t \n\t\t\t\n\t\t\tif (this.tablesExist() == true) {\n\t\t\t\tthis.deleteAllTable();\n\t\t\t\tthis.createTables();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.createTables();\n\t\t\t}\n\n\t\t \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\n \n \n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tLog.v(\"open onCreate\", \"Creating all the tables\");\n\n\t\ttry {\n\t\t\n\t\t\tdb.execSQL(CREATE_TABLE1);\n\t\t} catch (SQLiteException ex) {\n\t\t\tLog.v(\"open exception caught\", ex.getMessage());\n\n\t\t}\n\t}", "public void createNewDatabase(String dbName) {\r\n\t\t// connects to given database - relative path points to inside project folder\r\n\t\ttry {\r\n\t\t\tConnection conn = this.connect(dbName);\t\t\t\t\t\t// open connection\r\n\t\t\tif (conn != null) {\r\n\t\t\t\tDatabaseMetaData meta = conn.getMetaData();\r\n\t\t\t\tSystem.out.println(\"The driver name is \" + meta.getDriverName());\r\n\t\t\t\tSystem.out.println(\"A new database has been created.\");\r\n\t\t\t}\r\n\t\t\tconn.close(); \t\t\t\t\t\t\t\t\t\t\t\t// close connection\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "private void createNewDatabase() throws ConnectException {\n try (Connection sqlConnection = connect()) {\n if (sqlConnection != null) {\n sqlConnection.getMetaData();\n sqlConnection.close();\n }\n\n } catch (SQLException e) {\n LOGGER.error(\"Error when trying to create new database: {}\\n{}\", e.getMessage(), e);\n }\n }", "private static void createDatabase(String restrictedUser) throws ArcException {\n\t\tGenericPreparedStatementBuilder query;\n\n\t\t// clean database\n\t\tquery = new GenericPreparedStatementBuilder();\n\t\tquery.append(\"DROP SCHEMA IF EXISTS \" + DataObjectService.ARC_METADATA_SCHEMA + \" CASCADE;\");\n\t\tquery.append(\"DROP SCHEMA IF EXISTS \" + testSandbox1 + \" CASCADE;\");\n\t\tquery.append(\"DROP SCHEMA IF EXISTS public CASCADE;\");\n\t\tUtilitaireDao.get(0).executeRequest(c, query);\n\t\t\n\t\tBddPatcher patcher=new BddPatcher();\n\t\tpatcher.getProperties().setGitCommitId(newVersion);\n\t\tpatcher.getProperties().setDatabaseRestrictedUsername(userWithRestrictedRights);\n\n\t\t// metadata schema creation\n\t\tpatcher.bddScript(c);\n\t\t// sandbox schema creation\n\t\tpatcher.bddScript(c, testSandbox1, testSandbox2, testSandbox8);\n\t\t\n\t}", "@Before\n public void initDb() {\n mDatabase = Room.inMemoryDatabaseBuilder(InstrumentationRegistry.getContext(),\n ToDoDatabase.class).build();\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS person (personid integer primary key autoincrement, username varchar(20), password varchar(20))\");\n\n\t}", "private void CreatTable() {\n String sql = \"CREATE TABLE IF NOT EXISTS \" + TABLE_NAME\n + \" (name varchar(30) primary key,password varchar(30));\";\n try{\n db.execSQL(sql);\n }catch(SQLException ex){}\n }", "@Override\n public void onCreate( SQLiteDatabase db) {\n try {Log.i(\"55555555\",\"ONCreat\");\n db.execSQL(DATABASE_CREATE);\n }\n catch(SQLException e)\n {\n e.printStackTrace();\n }\n }", "private Database() throws SQLException, ClassNotFoundException {\r\n Class.forName(\"org.postgresql.Driver\");\r\n con = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/postgres\", \"postgres\", \"kuka\");\r\n }", "public static void initDB() {\r\n\t\tboolean ok = false;\r\n\t\ttry(Connection c = DriverManager.getConnection(\"jdbc:hsqldb:file:burst_db\", \"SA\", \"\")) {\r\n\t\t\tString testSQL = \"select count(*) from TB_USERS;\";\r\n\t\t\ttry(PreparedStatement s = c.prepareStatement(testSQL)) {\r\n\t\t\t\ttry(ResultSet rs = s.executeQuery()) {\r\n\t\t\t\t\trs.next();\r\n\t\t\t\t\tSystem.out.println(\"There are \"+rs.getInt(1)+\" known users.\");\r\n\t\t\t\t\tok = true;\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t//Don't panic, table doesn't exist\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t//Panic! Cannot connect to DB\r\n\t\t}\r\n\t\t\r\n\t\tif(!ok) {\r\n\t\t\tSystem.out.println(\"Creating Database\");\r\n\t\t\t\r\n\t\t\ttry(Connection c = DriverManager.getConnection(\"jdbc:hsqldb:file:burst_db\", \"SA\", \"\")) {\r\n\t\t\t\tString createSQL = \"create table TB_USERS (USERID varchar(255),BURSTADDRESS varchar(255), BURSTNUMERIC varchar(255));\";\r\n\t\t\t\ttry(Statement s = c.createStatement()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\ts.execute(createSQL);\r\n\t\t\t\t\t\tok = true;\r\n\t\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}", "public void createAndPopulateDatabase(ArrayList<MenuItem> food, ArrayList<MenuItem> bev) throws SQLException\r\n {\r\n createDatabase();\r\n connectToDatabase();\r\n createTables();\r\n populateTables(food, bev);\r\n }", "private void createDatabase() {\n String parentPath = mContext.getDatabasePath(DBNAME).getParent();\n String path = mContext.getDatabasePath(DBNAME).getPath();\n\n File file = new File(parentPath);\n if (!file.exists()) {\n if (!file.mkdir()) {\n Log.w(TAG, \"Unable to create database directory\");\n return;\n }\n }\n\n InputStream is = null;\n OutputStream os = null;\n try {\n is = mContext.getAssets().open(DBNAME);\n os = new FileOutputStream(path);\n\n byte[] buffer = new byte[1024];\n int length;\n while ((length = is.read(buffer)) > 0) {\n os.write(buffer, 0, length);\n }\n os.flush();\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putInt(SP_KEY_DB_VER, DATABASE_VERSION);\n editor.commit();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (os != null) {\n try {\n os.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n public boolean onCreate() {\n Log.e(TAG,\"onCreate\");\n DatabaseHelper.createDatabase(getContext(), new AppDb());\n return true;\n }", "@Override\r\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tcreateDataTable(db);\r\n\t\tcreateTableNote(db);\r\n\t}", "private static void doCreate(SQLiteDatabase db) {\r\n Logger.info(Logger.Type.GHOST_SMS, \"*** execute doCreate\");\r\n final Version version = new Version(VERSION_1, Names.GHOST_SMS, DateTimeUtils.currentDateWithoutSeconds());\r\n Versions.insert(db, version);\r\n doUpgrade(db, version.version);\r\n }", "private void setupDBs()\n {\n\t mSetupDBTask = new SetupDBTask(this);\n\t\tmSetupDBTask.execute((Void[])null);\n }", "private Database() throws SQLException {\n con = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:MusicAlbums\", \"c##dba\", \"sql\");\n }", "public static void main(String[] args) throws IOException {\n\t\t\tSystem.out.println(\"Creating tables...\");\n\t\t\tDerbyDatabase db = new DerbyDatabase();\n\t\t\tdb.createTables();\n\t\t\t\n\t\t\tSystem.out.println(\"Loading initial data...\");\n\t\t\tdb.loadInitialData();\n\t\t\t\n\t\t\tSystem.out.println(\"Library DB successfully initialized!\");\n\t\t}", "@Override\n\t\tpublic void onCreate(SQLiteDatabase db) {\n\t\t\ttry {\n\t\t\t\tdb.execSQL(TABLE_CREATE);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString sql = \"CREATE TABLE IF NOT EXISTS user(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, phn TEXT,pwd TEXT,loc TEXT,yield text,soil text)\";\n\t\tdb.execSQL(sql);\n\t\tString sql1 = \"CREATE TABLE IF NOT EXISTS cropdet(id INTEGER PRIMARY KEY AUTOINCREMENT, cname TEXT, month TEXT,soil TEXT,prec TEXT)\";\n\t\tdb.execSQL(sql1);\n\n\t}", "public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }", "public void bootstrapDatabase() throws Exception {\n\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString c_tableApp = \"create table if not exists \"+Contants.TABLE_NAME_APP+\"(id integer primary key autoincrement,packagNname varchar,classTableData text)\";\n\t\tString c_tableUser = \"create table if not exists \"+Contants.TABLE_NAME_USER+\"(id integer primary key autoincrement,classTableData text)\";\n\t\tdb.execSQL(c_tableApp);\n\t\tdb.execSQL(c_tableUser);\n\t}", "protected void createTable() throws Exception {\n startService();\n assertEquals(true, sqlDbManager.isReady());\n\n Connection conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, \"testtable\"));\n assertTrue(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n assertTrue(sqlDbManager.tableExists(conn, \"testtable\"));\n sqlDbManager.logTableSchema(conn, \"testtable\");\n assertFalse(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n }", "public Database(Context context)\n\t{\n\t\t/* Instanciation de l'openHelper */\n\t\tDBOpenHelper helper = new DBOpenHelper(context);\n\t\t\n\t\t/* Load de la database */\n\t\t//TODO passer en asynchrone pour les perfs\n\t\tmainDatabase = helper.getWritableDatabase();\n\t\t\n\t\t/* DEBUG PRINT */\n\t\tLog.i(\"info\", \"Database Loading Suceeded\");\n\t}" ]
[ "0.80304235", "0.79829556", "0.77069634", "0.7702506", "0.7699672", "0.7598459", "0.759321", "0.757035", "0.7550693", "0.7539468", "0.749423", "0.74455905", "0.7413429", "0.7390367", "0.7361162", "0.7336579", "0.7323002", "0.73070943", "0.729925", "0.7270507", "0.72704077", "0.725795", "0.72514063", "0.72364944", "0.7235043", "0.7218153", "0.72094595", "0.72083277", "0.71671045", "0.71621084", "0.713964", "0.713964", "0.71392024", "0.71356374", "0.71217585", "0.7038972", "0.7026751", "0.7026606", "0.69984007", "0.6989378", "0.69645", "0.69474417", "0.6930915", "0.691625", "0.6908681", "0.6897345", "0.6864493", "0.68562114", "0.6830082", "0.6823776", "0.68196076", "0.68133026", "0.68066955", "0.68037015", "0.6781603", "0.6766903", "0.67570114", "0.67553735", "0.6744875", "0.6730332", "0.67264897", "0.67184705", "0.6705127", "0.67045563", "0.66990983", "0.66940856", "0.66887504", "0.66778964", "0.66741467", "0.66735476", "0.663039", "0.6628821", "0.6628821", "0.66250986", "0.66242754", "0.661109", "0.66088855", "0.660796", "0.66021067", "0.65858346", "0.65834135", "0.65755713", "0.6569609", "0.65679336", "0.65532964", "0.65497404", "0.6547713", "0.65413064", "0.6538207", "0.6536465", "0.653439", "0.65215987", "0.6513173", "0.6512396", "0.65051544", "0.65032035", "0.64935404", "0.6485613", "0.6470995", "0.64661634", "0.64659816" ]
0.0
-1
On Version Upgrade eg. Adding New Parameters Etc.
@Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void upgrade() {\n log.trace(\">upgrade\");\n if (Float.compare(LATEST_VERSION, getVersion()) != 0) {\n // Does nothing currently\n data.put(VERSION, new Float(LATEST_VERSION));\n }\n log.trace(\"<upgrade\");\n }", "@Override\n\t\t\t\t\tpublic void onUpdateFound(boolean newVersion, String whatsNew) {\n\t\t\t\t\t}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Override\n public void onNewVersionDetected(int newVersion) {\n Log.e(\"\", \"new version \" + newVersion);\n\n }", "public abstract void upgrade();", "@Override\n\tpublic boolean upgrade() {\n\t\treturn true;\n\t}", "@Override\n public void onUpgrade(DbManager db, int oldVersion, int newVersion) {\n }", "public abstract void doUpgrade();", "@Override\n\t\t\t\t\tpublic void onUpgrade(DbManager db, int oldVersion, int newVersion) {\n\t\t\t\t\t}", "@Override\n public void onUpgrade(DbManager db, int oldVersion, int newVersion) {\n }", "public void onVersionChanged(String oldVersion, String newVersion);", "@Override\n public void checkVersion() {\n }", "@Override\n public void onUpgrade(DbManager db, int oldVersion, int newVersion) {\n }", "@Override\r\n\tpublic void setVersion(int version) {\n\r\n\t}", "@Override\n public void onNoNewVersionDetected() {\n\n }", "public void onUpdateFound(final String newVersion);", "@Override\n\tpublic void setMethodVersion() {\n\t\tthis.version=\"app3.5\";\n\t}", "void onUpgradeInfo(UpgradeEntity upgradeEntity);", "@Override\n public void onMapVersionSet() {\n\n }", "private static void doUpgrade(SQLiteDatabase db, Integer oldVersion) {\r\n Logger.info(Logger.Type.GHOST_SMS, \"****** last version [%s]: %s\", Names.GHOST_SMS, oldVersion);\r\n if (CURRENT_VERSION.equals(oldVersion)) {\r\n return;\r\n } else if (VERSION_1.equals(oldVersion)) {\r\n upgradeFrom_1_to_2(db);\r\n }\r\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public void reDownloadDB(String newVersion)\n {\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "@Override\n\tpublic void onConfigurationUpdate() {\n\t}", "protected abstract String upgradeSql(int oldVersion, int newVersion);", "public void cmdUpgrade(User teller) {\n exit(7, \"Deploying version update at the request of {0}. I''ll be right back!\", teller);\n }", "public void init() {\r\n\t\tdbVersion = new DBVersion( getDefaultDatabase(), progress, upgradeFile.versionTableName, upgradeFile.logTableName );\r\n\t}", "private void doUpgrade() {\n // implement the database upgrade here.\n }", "@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVer, int newVer) {\n\r\n\t}", "protected abstract void declareVersions();", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "public void setVersion(String version);", "public void incrementVersion() {\n this.version++;\n }", "public void postInstallHook() {\n }", "@Override\n public int getVersion() {\n return 0;\n }", "void setVersion(String version);", "void setVersion(String version);", "void setVersion(long version);", "public void setVersion(long param){\n \n // setting primitive attribute tracker to true\n \n if (param==java.lang.Long.MIN_VALUE) {\n localVersionTracker = false;\n \n } else {\n localVersionTracker = true;\n }\n \n this.localVersion=param;\n \n\n }", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n String upgradeQuery = \"ALTER TABLE NOTES ADD COLUMN DATE TEXT\";\n String fillcolumnQuery = \"UPDATE NOTES SET DATE = 'Jan 27 2018'\";\n if(oldVersion==1 && newVersion==2) {\n db.execSQL(upgradeQuery);\n db.execSQL(fillcolumnQuery);\n }\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void onInstalled() {\n }", "@Override\n public int getVersion() {\n return 3;\n }", "public interface UpgradeListener {\n\tpublic void upgradeSpawned(int x, int y, String color, String MPID);\n\n\tpublic void upgradePickedUp(int PosAtList, String MPID);\n}", "public void checkForUpdate(String currentVersion);", "@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tSystem.out.println(\"the database is onupgrade\");\n\t}", "@Override\r\n public void setMaxVersions(int parseInt) {\n\r\n }", "public void incrementVersion() {\n this.version += 1;\n }", "@Override\n public boolean shouldProceedToUpgrade(String newVersion, String previousVersion) {\n return VersionComparator.isAfter(newVersion, previousVersion);\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.ver = version;\n }", "@Override\n \tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n \n \t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "@Override\n public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {\n\n }", "public void preInstallHook() {\n }", "@Override\n public String getDatabaseProductVersion() {\n return \"1.0\";\n }", "public void willbeUpdated() {\n\t\t\n\t}", "@Override\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void uppdate() {\n\t\t\n\t}", "@Override\n\tpublic void uppdate() {\n\t\t\n\t}", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public int getVersion() { return 1; }", "@Override\n\tpublic void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) {\n\t\ttry {\n\t\t\t// Added in version 2 the user table\n\t\t\tif (oldVersion < 2) {\n\t\t\t\tTableUtils.createTable(connectionSource, User.class);\n\t\t\t}\n\t\t\t// Added in version 3 the locator table\n\t\t\tif (oldVersion < 3) {\n\t\t\t\tTableUtils.createTable(connectionSource, Locator.class);\n\t\t\t}\n\t\t\t//Added in version 4 the column suggestUnlock in the place table\n\t\t\tif(oldVersion < 4) {\n\t\t\t\tgetPlaceDao();\n\t\t\t\tplaceDao.executeRaw(\"ALTER TABLE 'place' ADD COLUMN suggestUnlock BOOLEAN;\");\n\t\t\t}\n\t\t\tif(oldVersion < 5) {\n\t\t\t\tgetPlaceDao();\n\t\t\t\tplaceDao.executeRaw(\"ALTER TABLE 'place' ADD COLUMN defaultLocatorID INT;\");\n\t\t\t\tgetLocatorDao();\n\t\t\t\tlocatorDao.executeRaw(\"ALTER TABLE 'locator' ADD COLUMN notifyOnEntry BOOLEAN;\");\n\t\t\t\tgetLocatorDao();\n\t\t\t\tlocatorDao.executeRaw(\"ALTER TABLE 'locator' ADD COLUMN notifyOnExit BOOLEAN;\");\n\t\t\t}\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setUpgradeSubversion(Long UpgradeSubversion) {\n this.UpgradeSubversion = UpgradeSubversion;\n }", "@Override\r\n public void onUpgrade( SQLiteDatabase db, int oldVersion, int newVersion ) {\r\n\r\n }", "@Override\n\tpublic void setCheckOlderVersion(boolean paramBoolean)\n\t{\n\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "@Override\r\n public void onUpgrade(SQLiteDatabase db,\r\n int oldVersion,\r\n int newVersion)\r\n {\n }", "public void setVersion(String version) {\r\n\t\tthis.version = version;\r\n\t}", "@Override\r\n\tpublic String getVersion() {\r\n\t\treturn \"1.0.5\";\r\n\t}", "@Override\n\tpublic void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) {\n\n\t}", "@Override\r\n\t\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\t\r\n\t\t}", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n \n }", "@Override\n\n //\n public void onUpgrade(SQLiteDatabase db, int oldVersion,\n int newVersion) {\n\n }", "@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int VersionAnterior, int VersionNueva) {\n\t\t\n\t}", "@Override\n public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldv, int newv)\n {\n }", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n {\n if(newVersion > oldVersion){\n try {\n this.dbCreate();\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }", "@Override\r\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\r\n\r\n }", "@Override\n public void cUFWRevision(String value) {\n }", "private void setLevelAndVersionFor(Object newContextObject, SBase parent) {\n\t\tif (newContextObject instanceof SBase) {\n\t\t\tSBase sb = (SBase) newContextObject;\n\t\t\t// Level and version will be -1 if not set, so we don't\n\t\t\t// have to check.\n\t\t\tsb.setLevel(parent.getLevel());\n\t\t\tsb.setVersion(parent.getVersion());\n\t\t}\n\t}", "public void upgrade(){\n\n //upgrade stats\n this.setLevel(this.getLevel() + 1);\n this.setMaxHealth(this.getMaxHealth() + 500);\n this.setHealth(this.getHealth() + 500);\n this.maxCapacity += 20;\n\n }", "protected void onUpdate() {\r\n\r\n\t}", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n }", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n }", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n }", "@Override\n public void onUpgrade( SQLiteDatabase db, int oldVersion, int newVersion )\n {\n }", "@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t\r\n\t}", "@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n\t{\n\t\t\n\t}", "@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n\t{\n\t\t\n\t}", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion,\n int newVersion)\n {\n }", "@Override\r\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\r\n\t}" ]
[ "0.67265517", "0.6696736", "0.6678774", "0.6537166", "0.6529547", "0.6485667", "0.6443911", "0.64418876", "0.6437799", "0.6368527", "0.63413996", "0.6306851", "0.6284071", "0.62688625", "0.62565094", "0.62513053", "0.6224447", "0.61094934", "0.6075127", "0.6072519", "0.6059837", "0.6044634", "0.60076827", "0.60047305", "0.5978242", "0.59683794", "0.59535104", "0.5891391", "0.5855492", "0.58200306", "0.5817885", "0.58151364", "0.5805319", "0.5802759", "0.57944", "0.57814306", "0.57814306", "0.5779205", "0.57602966", "0.57578784", "0.57549465", "0.5750856", "0.5732926", "0.5730962", "0.5730559", "0.5729669", "0.5722917", "0.57191926", "0.5717979", "0.5717962", "0.56952405", "0.5693471", "0.56804377", "0.56804377", "0.56471014", "0.56466085", "0.56394666", "0.56255853", "0.56243575", "0.56231827", "0.56231827", "0.56200194", "0.5610582", "0.56054896", "0.55990434", "0.55990434", "0.5598736", "0.5595738", "0.5591885", "0.5585124", "0.55808544", "0.55808544", "0.55808544", "0.557674", "0.5569215", "0.5567975", "0.5563664", "0.5555898", "0.55546224", "0.55445504", "0.5540657", "0.5538386", "0.5524243", "0.5523639", "0.5519542", "0.5511931", "0.5511733", "0.55094445", "0.55075395", "0.55075395", "0.55075395", "0.55043364", "0.5496209", "0.5496209", "0.5496209", "0.5496209", "0.5496209", "0.5493536", "0.5493536", "0.5491144", "0.5488325" ]
0.0
-1
If the file name already exists within the current directory, throws FileExistsException Otherwise, does nothing
public void checkMakeFile(String name) throws FileExistsException { Iterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement); if (toCheck != null) { for (Position<FileElement> fe : toCheck ) { if (fe.toString().equals(name)) { throw new FileExistsException(name); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public MethodOutcome fileAlreadyExistsOutcome() {\n return new MethodOutcome(MethodOutcome.Type.THROWS_EXCEPTION, IOException.class);\n }", "private static void addFile(File filedir) throws Exception {\n String fileName = getFileNameInput();\n File newFile = new File(filedir.toString() + \"\\\\\" + fileName);\n boolean fileAlreadyExists = newFile.exists();\n if (fileAlreadyExists) {\n throw new FileAlreadyExistsException(\"File already exists in current directory.\");\n } else {\n try {\n if (newFile.createNewFile()) {\n System.out.println(\"File created successfully\");\n } else {\n System.out.println(\"Something went wrong, please try again.\");\n }\n } catch (IOException e) {\n throw new IOException(e.getMessage());\n }\n }\n }", "@SuppressWarnings(\"ResultOfMethodCallIgnored\")\r\n private static void fileExists(String filepath) throws IOException {\r\n File file = new File(filepath + filePath);\r\n if (!file.exists()) {\r\n file.createNewFile();\r\n }\r\n }", "public static void insurePathToFileExists(String filename) {\r\n insurePathToFileExists(new File(filename));\r\n }", "public static void insurePathToFileExists(File f) {\r\n File p = f.getParentFile();\r\n //System.out.println(\"uu.iPE: parent of \"+filename+\" is \"+parent);\r\n\r\n if (!p.exists()) {\r\n // parent doesn't exist, create it:\r\n if (!p.mkdirs()) {\r\n throw new IllegalStateException(\"Unable to make directory \" + p.getPath());\r\n } // endif -- second mkdir unsuc\r\n } // endif -- parent exists\r\n }", "public static void fileExists(String fileName)throws FileNotFoundException{\r\n File file=new File(fileName);\r\n if(!file.exists()){\r\n throw new FileNotFoundException(file.getName());\r\n }\r\n }", "void putFile(String filename, byte[] file) throws FileAlreadyExistsException;", "@Test\n public void testMakeFileFileExists() {\n FileTree myTree = new FileTree();\n String file = \"file1\";\n boolean result = false;\n try {\n myTree.makeFile(file);\n myTree.makeFile(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n result = true;\n }\n assertTrue(result);\n\n }", "private static void checkFileName(final String configId, final String fileName, File configurationDirectory)\r\n throws AlreadyExistException {\r\n File[] files = configurationDirectory.listFiles();\r\n for (int i = 0; i < files.length; i++) {\r\n String name = files[i].getName();\r\n if (name.endsWith(fileName)) {\r\n if (name.equals(\"successful_\" + fileName) || name.equals(\"failed_\" + fileName)\r\n || name.equals(\"successful_failed_\" + fileName) || name.equals(fileName)) {\r\n String message =\r\n \"A content file '\" + fileName + \"' for the configuration with id \" + configId\r\n + \" already exists on Depositor.\";\r\n LOG.error(message);\r\n throw new AlreadyExistException(message);\r\n }\r\n }\r\n }\r\n }", "@Override\n public boolean exists(File file) {\n\treturn false;\n }", "boolean dealWithFileOverwrite(String filename);", "private boolean cancelBecauseFileExist(File f) {\r\n\t\tif (f.exists()) {\r\n\t\t\tint res = JOptionPane.showInternalConfirmDialog(getContentPane(), \"The file \" + f.getName() + \" already exists. Do you want to replace the existing file?.\", \"File already exists\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null);\r\n\t\t\tif (res == JOptionPane.NO_OPTION) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tf.delete();\r\n\t\treturn false;\r\n\t}", "@Test\n public void testHasFileTrue() {\n FileTree myTree = new FileTree();\n String file = \"file1\";\n try {\n myTree.makeFile(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertTrue(myTree.hasFile(file));\n }", "private void ensureFile(File destFile) {\n\t\tif (destFile.exists()) {\n\t\t\tLog.i(\"[\" + destFile.getName() + \"]\"\n\t\t\t\t\t+ \" has already exsited, previous content cleared\");\n\t\t}\n\n\t\ttry {\n\t\t\tdestFile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void isFileExistOrCreatIt(String fileName) {\n if (!fileName.endsWith(\".json\")){\n throw new IllegalArgumentException(\"Invalid file name\");\n }\n File file = new File(\"src//main//resources\"+\"//\"+fileName);\n if(!file.exists()){\n try{\n file.createNewFile();\n }catch (IOException e){\n e.printStackTrace();\n }\n\n }\n }", "@Test\n public void testFileInDirectoryFileExists() {\n\n File file1 = new File(\"file1\");\n parent.storeFile(file1);\n assertTrue(parent.fileInDirectory(\"file1\"));\n }", "boolean fileExists(String path) throws IOException;", "abstract public boolean exists( String path )\r\n throws Exception;", "private static void checkHistoryDirectory()\n throws FileNotFoundException {\n Path path = Paths.get(HISTORY_FILE_PATH); //creates Path instance\n try {\n Files.createDirectories(Paths.get(DIRECTORY));\n Files.createFile(path); //creates file at specified location\n } catch (IOException e) {\n readHistoryData();\n }\n }", "public void testCreateFileSuccess() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n String fileCreationId = filePersistence.createFile(VALID_FILELOCATION, FILENAME);\r\n assertTrue(\"fileCreationId shouldn't be null or empty\", fileCreationId != null\r\n && fileCreationId.trim().length() != 0);\r\n filePersistence.closeFile(fileCreationId);\r\n filePersistence.deleteFile(VALID_FILELOCATION, FILENAME);\r\n }", "private boolean checkFileExists(String fPath) {\n\t\tFile file = new File(fPath);\n\t\treturn file.exists();\n\t}", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameFileIntoExistingDirectory() throws Exception {\n assumeRenameSupported();\n\n Path src = path(\"/test/olddir/file\");\n createFile(src);\n Path dst = path(\"/test/new/newdir\");\n fs.mkdirs(dst);\n rename(src, dst, true, false, true);\n Path newFile = path(\"/test/new/newdir/file\");\n if (!fs.exists(newFile)) {\n String ls = ls(dst);\n LOG.info(ls(path(\"/test/new\")));\n LOG.info(ls(path(\"/test/hadoop\")));\n fail(\"did not find \" + newFile + \" - directory: \" + ls);\n }\n assertTrue(\"Destination changed\",\n fs.exists(path(\"/test/new/newdir/file\")));\n }", "boolean doesFileExist(String date)\n throws FlooringMasteryPersistenceException;", "public void addfile() {\n\t\tString name;\r\n\t\tSystem.out.println(\"Enter the file name you want to add\");\r\n Scanner sc = new Scanner(System.in);\r\n name = sc.nextLine();\r\n try {\r\n \t\tFile file = new File(\"g:\\\\LockedMe\\\\\"+name);\r\n \t\tif(file.createNewFile()) {\r\n \t\t\tSystem.out.println(\"New file created\");\r\n \t\t}\r\n \t\telse {\r\n \t\t\tif(file.exists())\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"file already exists\");\r\n \t\t\t}\r\n \t\t\telse\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"file does not exist\");\r\n \t\t\t}\r\n \t\t}\r\n }\r\n catch(Exception e)\r\n {\r\n \t e.printStackTrace();\r\n }\r\n\t}", "@Test\n public void testFileInDirectoryFileDoesNotExists() {\n\n assertFalse(parent.fileInDirectory(\"file1\"));\n }", "private static boolean fileExists(String filename) {\n return new File(filename).exists();\n }", "private static void checkFilePath(String filePath) {\n File file = new File(filePath);\n try {\n if (!file.getParentFile().exists()) {\n file.getParentFile().mkdirs();\n }\n if (!file.exists()) {\n file.createNewFile();\n }\n file.createNewFile();\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n }", "public String checkDuplicates(String path)\n\t{\n\t\tFile file = new File(path);\n\n\t\t//If this file has already been created\n\t\tif(duplicates.containsKey(file))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint append = duplicates.get(file).size();\n\t\n\t\t\t\tLinkedList<File> newVal = duplicates.get(file);\n\n\t\t\t\t//create new filename\n\t\t\t\tFile newFile = File.createTempFile(file.getName().substring(0, file.getName().length()-4), \".csv\", new File(aida.getConfigValue(\"aida_dir\")));\n\t\t\t\tnewFile.deleteOnExit();\n\t\n\t\t\t\tnewVal.add(newFile);\n\t\n\t\t\t\t//store record of this file in the duplicates hashmap\n\t\t\t\tduplicates.put(file, newVal);\n\t\t\t\t\n\t\t\t\tfile = newFile;\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t\taida.logAdd(\"!Duplicate file could not be created\");\n\t\t\t\taida.logAdd(\"!\"+e.getMessage());\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tduplicates.put(file, new LinkedList<File>());\n\t\t}\n\n\t\t//return the (possibly renamed) filename\n\t\treturn file.getAbsolutePath();\n\t}", "public boolean exists(String name) throws IOException;", "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 }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameFileToSelf() throws Throwable {\n if (!renameSupported()) return;\n Path filepath = path(\"test/file\");\n createFile(filepath);\n //HDFS expects rename src, src -> true\n rename(filepath, filepath, true, true, true);\n //verify the file is still there\n assertIsFile(filepath);\n }", "private boolean existsRotationFile(String clearName, int numberRotation, String extension, Path parent){\n Path newFile = getPathRotationFile(clearName, numberRotation, extension, parent);\n return Files.exists(newFile, LinkOption.NOFOLLOW_LINKS);\n }", "private void ensureNameExists(String name) throws BadFileException {\n\t\tif (name.equals(\"OuterWalls\") || boardItemMap.containsKey(name)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthrow new BadFileException(name + \" name does not exist yet\");\r\n\t}", "private boolean fileExists(Path p) {\n\t\treturn Files.exists(p);\n\t}", "public boolean exist(String fileName) throws DataAccessException;", "public void handleExistenceOfOutputFile(String outFileName) {\n if (!forceOverwrite)\n throwValidationException(\"File \\\"\" + outFileName\n + \"\\\" already exists. Use -f / --force-overwrite option to overwrite it.\", false);\n }", "public static boolean logExiste(String nomeArquivo) throws InterruptedException{\n\t\tFile file = new File(nomeArquivo);\n\t\tif(!file.exists()){\n\t\t\tSystem.out.print(\"\\nNenhum contrato cadastrado.\");\n\t\t\tThread.sleep(3000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean checkExistFile(String aFilePath) {\n\t\treturn eDao.checkExistFile(aFilePath);\n\t}", "private boolean fileNameExists(String fileName) {\n return inputOutputStream.hexists(Constants.DIR_METADATA_BYTES, fileName.getBytes());\n }", "public boolean create() {\n boolean operation = false;\n try {\n File file = new File( fileName );\n file.createNewFile();\n\n if ( this.open() == false ) {\n throw new Exception(\"File created but still has issues opening the file\");\n } else {\n writeFirstLine(\"\");\n }\n\n operation = true;\n } catch( Exception error ) {\n System.out.println(error.toString());\n operation = false;\n }\n\n return operation;\n }", "@SuppressWarnings(\"TailRecursion\")\n // As long as the specified path does not contain files with names matching a random UUID value,\n // recursive calls should not happen.\n private static File createFileUnderPath(Path path) {\n var fileName = UUID.randomUUID().toString();\n var result = new File(path.toFile(), fileName);\n if (result.exists()) {\n return createFileUnderPath(path);\n }\n try {\n result.createNewFile();\n return result;\n } catch (IOException e) {\n throw Exceptions.newIllegalStateException(e,\n \"Could not create a temporary file in %s.\",\n path.toAbsolutePath());\n }\n }", "public static boolean createFileIfNotExists(String path, SourceType sourceType) throws IOException {\n return getFileSystemBySourceType(sourceType).createNewFile(new Path(path));\n }", "private boolean doesFileExist(String qualifiedFileName) throws FileNotFoundException {\n\t\t\n\t\t// First get a path object to where the file is.\n\t\t\n\t\tPath inWhichFolder = Paths.get(qualifiedFileName);\n\t\t\n\t\tboolean isFilePresent = (Files.exists(inWhichFolder) && Files.isReadable(inWhichFolder) && !Files.isDirectory(inWhichFolder));\n\t\t\n\t\tif (!isFilePresent) {\n\t\t\tthrow new FileNotFoundException(String.format(\"The file you specified '%s' does not exist or cannot be found!\", qualifiedFileName));\n\t\t\t\n\t\t}\n\t\t\n\t\t// If we're here then we should have a file that can be opened and read.\n\t\t\n\t\treturn isFilePresent;\n\t\t\n\t}", "public static void existeFichero(){\n File fichero = new File(\"config.ser\");\n\n try{\n\n if (fichero.exists()) {\n recuperarFecha();\n }\n else {\n fichero.createNewFile();\n }\n }catch(IOException ex){\n System.out.println(\"Excepcion al crear el fichero: \" + ex);\n }\n\n }", "@Override\n\tpublic boolean exists() {\n\t\treturn Files.exists(this.path);\n\t}", "void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n System.out.println(\"File already exists.\"); //exists\n }\n //Error check\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "private void checkIfLocationExists() {\n try {\n File file = new File(saveLocation);\n if(!file.exists()) file.mkdirs();\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n }\n }", "private boolean exists(String pathName)\n {\n if(new File(pathName).exists())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private boolean isAlreadyExist(String name, String extension) {\n if (extension.equals(\"\")) {\n if (isSameNameExist(tree.getRoot(), name, true, extension)) {\n SC.warn(\"Folder is already exist\");\n if (\"yellow\".equals(leftLayout.getBackgroundColor())) {\n leftLayout.setBackgroundColor(\"white\");\n }\n return true;\n }\n } else {\n if (isSameNameExist(tree.getRoot(), name, false, extension)) {\n SC.warn(\"File is already exist\");\n if (\"yellow\".equals(leftLayout.getBackgroundColor())) {\n leftLayout.setBackgroundColor(\"white\");\n }\n return true;\n }\n }\n return false;\n }", "private boolean existsFile(File testFile) {\n\t\tif (testFile.exists()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\tpublic synchronized boolean exists(String key) {\n\t\treturn getFile(key).exists();\n\t}", "private void checkAndDeleteFile(String resultLogFileName) {\n\t\t// check whether a file was written\n\t\tfinal File f = new File(resultLogFileName);\n\t\t// The true result log file name has attached time stamps!\n\t\tFile parentDirectory = f.getParentFile();\n\t\tString[] files = parentDirectory.list(new FilenameFilter() {\n\t\t\tpublic boolean accept(File dir, String name) {\n\t\t\t\tif(name.startsWith(f.getName())) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tAssert.assertNotSame(\"No log file was created.\", 0, files.length);\n\t\tFile realF = new File(parentDirectory, files[0]);\n\t\tAssert.assertTrue(\"Created file is empty.\", realF.length() > 0);\n\n\t\t// remove file again\n\t\tif(realF.exists()) {\n\t\t\trealF.delete();\n\t\t}\n\t}", "private void checkFileCreation(String name) throws IOException {\n byte[] buff = \"some bytes\".getBytes();\n writeFile(name, buff);\n assertTrue(Arrays.equals(buff, readFile(name, buff.length)));\n }", "@Override\n\tpublic boolean pathExists(String path) {\n\t\treturn false;\n\t}", "private static Path createTempFile(String folderName) throws IOException {\n while (true) {\n String fileName = UUID.randomUUID().toString();\n Path filePath = Paths.get(folderName + \"/\" + fileName);\n\n if (Files.notExists(filePath)) {\n Files.createFile(filePath);\n return filePath;\n }\n }\n }", "@Override\n\tpublic boolean isExist(String name) {\n\t\treturn false;\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 }", "@Override\r\n\tpublic boolean isExist() {\n\t\treturn false;\r\n\t}", "public String createFile(String name) {\t\t\n\t\tString filename = this.path + name;\n\t\tFile file = new File(filename);\n\t\t\n\t\ttry {\n\t\t\tif (file.createNewFile()) {\n\t\t System.out.println(\"Created file '\" + filename + \"'.\");\n\t\t \n\t\t // Add file to files list\n\t\t\t\tthis.files.add(name);\t\n\t\t\t\t\n\t\t } else {\n\t\t \t// Null filename to report it was NOT created\n\t\t\t\tfilename = null;\n\t\t System.out.println(\"ERROR - File name already exists!\");\n\t\t }\n\t\t} catch(IOException e) {\n\t\t\t// Null filename to report it was NOT created\n\t\t\tfilename = null;\n\t\t e.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\treturn filename;\n\t}", "private File createDirectoryIfNotExisting( String dirName ) throws HarvesterIOException\n {\n \tFile path = FileHandler.getFile( dirName );\n \tif ( !path.exists() )\n \t{\n \t log.info( String.format( \"Creating directory: %s\", dirName ) );\n \t // create path:\n \t if ( !path.mkdir() )\n \t {\n \t\tString errMsg = String.format( \"Could not create necessary directory: %s\", dirName );\n \t\tlog.error( errMsg );\n \t\tthrow new HarvesterIOException( errMsg );\n \t }\n \t}\n \t\n \treturn path;\n }", "private static void searchFile(File fileDir) throws Exception {\n String fileName = getFileNameInput();\n File targetFile = new File(fileDir.toString() + \"\\\\\" + fileName);\n boolean fileExists = targetFile.exists();\n if (fileExists) {\n System.out.println(\"File is found on current directory.\");\n } else {\n throw new FileNotFoundException(\"No such file on current directory.\");\n }\n }", "public static boolean alreadyExistCheck(String filePath) {\n File f = new File(filePath);\n return f.exists() && !f.isDirectory();\n }", "private boolean checkFileExists(String file) {\n boolean exist = false;\n File tmpFile = new File(\"./levels/\" + file);\n if (tmpFile.exists()) {\n // file exists\n exist = true;\n }\n return exist;\n }", "@Override\r\n\tpublic boolean renameFile(String oldFileName, String newFileName) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\r\n\r\n\t}", "public static boolean createFile() throws IOException {\n String bytes = \"\";\n byte[] write = bytes.getBytes(); //Salva i bytes della stringa nel byte array\n if(!fileName.exists()){\n Path filePath = Paths.get(fileName.toString()); //Converte il percorso in stringa\n Files.write(filePath, write); // Creare il File\n Main.log(\"File \\\"parametri\\\" creato con successo in \" + fileName.toString());\n return true;\n }\n return false;\n }", "public boolean fileExists(Context context, String filename)\r\n{\r\n File file = context.getFileStreamPath(filename);\r\n if(file == null || !file.exists())\r\n {\r\n return false;\r\n }\r\nreturn true;\r\n}", "@Test\n public void CreateFile() throws Exception {\n createFile(\"src\\\\TestSuite\\\\SampleFiles\\\\supervisor.xlsx\",\n readTemplateXLSX(\"src\\\\TestSuite\\\\SampleFiles\\\\template_supervisor.xlsx\"));\n File file = new File(\"src\\\\TestSuite\\\\SampleFiles\\\\supervisor.xlsx\");\n Assert.assertTrue(file.exists());\n }", "public boolean fileExists(String name){\r\n try{\r\n new BufferedReader(new FileReader(\"../profiles/\" + name + \".profile\"));\r\n return true;\r\n }\r\n catch(FileNotFoundException e){\r\n return false;\r\n }\r\n }", "public static void makeNewFile(File root, String name) {\n File directory = new File(root, name);\n try {\n if (!directory.createNewFile()) {\n throw new IOException(\"Could not create \" + name + \", file already exists\");\n }\n } catch (IOException e) {\n throw new UncheckedIOException(\"Failed to create file: \" + name, e);\n }\n }", "public abstract boolean doesExist();", "private boolean isFileExist() {\n File check_file = getFilesDir();\n File[] file_check_array = check_file.listFiles();\n for (File current : file_check_array) {\n boolean user_file = isValidName(current.getName());\n if (user_file) {\n return true;\n }\n }\n return false;\n }", "private File createDestinationFile() {\n\t\tSystem.out.print(\"Please enter the name of the output file that will be created to hold the modified/correct inventory: \");\n\t\tString fileName = sc.nextLine();\n\t\tFile file = new File(fileName);\n\t\twhile (file.exists()) {\n\t\t\tSystem.out.println(\"----->A file with the name of \\\"\" + fileName + \"\\\" [size = \" + file.length() + \" bytes; path = \" + file.getAbsolutePath() + \"] already exists.<-----\");\n\t\t\tSystem.out.print(\"Please input a new file name: \");\n\t\t\tfileName = sc.nextLine();\n\t\t\tfile = new File(fileName);\n\t\t}\n\t\treturn file;\n\t}", "private static void checkFridgeDataDirectory() throws FileNotFoundException, InvalidDateException,\n InvalidQuantityException, EmptyDescriptionException,\n RepetitiveFoodIdentifierException, InvalidFoodCategoryException, InvalidFoodLocationException {\n Path path = Paths.get(DATA_FILE_PATH); //creates Path instance\n try {\n Files.createDirectories(Paths.get(DIRECTORY));\n Files.createFile(path); //creates file at specified location\n } catch (IOException e) {\n readFridgeData();\n }\n }", "@Override\n public MethodOutcome destinationFileExistsSrcIsFileOutcome() {\n return new MethodOutcome(MethodOutcome.Type.RETURNS_FALSE);\n }", "boolean exists(String path) throws IOException;", "public void createFile (String filePath){\n try{\n File newFile = new File(filePath);\n if(newFile.createNewFile()){\n System.out.println(\"File created: \"+newFile.getName());\n } else {\n System.out.println(\"File already exists.\");\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "public static File checkDescriptorFileExist(File descriptor) throws IllegalArgumentException {\n if (!descriptor.exists()) {\n throw new IllegalArgumentException(descriptor.getAbsolutePath() + \" does not exist\");\n }\n if (!descriptor.isFile()) {\n throw new IllegalArgumentException(descriptor.getAbsolutePath() + \" is not a file\");\n }\n if (!descriptor.canRead()) {\n throw new IllegalArgumentException(descriptor.getAbsolutePath() + \" is not readable\");\n }\n \n return descriptor;\n }", "@Override\n protected void createFile(String directoryName, String fileNamePrefix) {\n }", "public boolean fileExists(String fileName){\n\t\t\tboolean exists = false;\n\t\t\ttry{\n\t \t FileInputStream fin = openFileInput(fileName);\n\t\t\t\tif(fin == null){\n\t\t\t\t\texists = false;\n\t\t\t\t}else{\n\t\t\t\t\texists = true;\n\t\t\t\t\tfin.close();\n\t\t\t\t}\n\t\t\t}catch (Exception je) {\n\t\t //Log.i(\"ZZ\", \"AppDelegate:fileExists ERROR: \" + je.getMessage()); \n\t\t exists = false;\n\t\t\t}\n\t\t\treturn exists;\n\t\t}", "@Test\n public void checkIfNewFilenameAlreadyExists(){\n Music randomMusicCD1 = new Music(\"Random CD 1\", \"11/12/1993\",\"Rock\",\"Jack\",12,100);\n DiscFile<Music> randomMusicFile1 = new DiscFile<Music>(randomMusicCD1, randomMusicCD1.getTitle(), randomMusicCD1.getFullDetails(), \"randomcCD1\");\n\n Music randomMusicCD2 = new Music(\"Random CD 2\", \"08/05/2004\",\"Pop\",\"Ben\",8,70);\n DiscFile<Music> randomMusicFile2 = new DiscFile<Music>(randomMusicCD2, randomMusicCD1.getTitle(), randomMusicCD2.getFullDetails(), \"randomCD2\");\n\n boolean actual = rename.renameFile(\"tomsmith\",\"badboymusic\");\n assertTrue(actual);\n }", "private boolean validateFile(JTextField fileTF,\n Component parentComp) {\n if (fileTF.getText().trim().length() == 0)\n {\n JOptionPane.showMessageDialog(parentComp,\n \"Please enter a file name in the file field\",\n \"No File Name\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n String text = fileTF.getText().trim();\n File file = new File(text);\n if (!file.exists())\n {\n JOptionPane\n .showMessageDialog(\n parentComp,\n \"The file you entered does not exist. Please enter a valid file name\",\n \"Incorrect File Name\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n return true;\n }", "@Test\n public void testGetFile() {\n FileTree myTree = new FileTree();\n String file = \"file1\";\n try {\n myTree.makeFile(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n try {\n assertEquals(myTree.getFile(file).getName(), \"file1\");\n } catch (NotFileException e) {\n fail(\"file could not be found\");\n }\n }", "static void createNew() \r\n\t {\n boolean flag = false;\r\n Scanner file = new Scanner(System.in);\r\n System.out.println(\"Enter a new file name\");\r\n String newfilename = file.next();\r\n File createfile = new File(\"D:\\\\java_project\\\\\"+newfilename+\".txt\");\r\n try\r\n\t\t {\r\n\t\t flag = createfile.createNewFile();\r\n\t\t System.out.println(\"flag value\" + flag);\r\n\t\t if(!flag)\r\n\t\t {\r\n\t\t \t System.out.println(\"Same file name already exisy\" + createfile.getPath());\r\n\t\t } \r\n\t\t else \r\n\t\t {\r\n\t\t \t System.out.println(\"file is created sucessfully\" + createfile.getPath() + \" created \");\r\n\t\t }\r\n\t\t } \r\n\t\t catch (IOException ioe) \r\n\t\t {\r\n\t\t System.out.println(\"Error while Creating File in Java\" + ioe);\r\n\t\t }\r\n\t\t \r\n\t\t \t }", "public boolean existFile(String fileName) {\r\n\t\treturn new File(fileName).exists();\r\n\t}", "private boolean isExistingFile(String filename, String[] array)\n\t{\n\t\tfor (String temp : array)\n\t\t{\n\t\t\tif (temp.equals(filename) == true)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Test\n public void testMakeFile() {\n FileTree myTree = new FileTree();\n String file = \"file1\";\n try {\n myTree.makeFile(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n try {\n assertEquals(myTree.getFile(file).getName(), \"file1\");\n } catch (NotFileException e) {\n fail(\"file could not be found\");\n }\n }", "@Override\r\n\t\t\tpublic Boolean call() throws Exception {\n\t\t\t\tS3FileHandle updated = fileHandleDao.createFile(fh);\r\n\t\t\t\ttoDelete.add(updated.getId());\r\n\t\t\t\treturn true;\r\n\t\t\t}", "public abstract boolean modelFileExists(String filename);", "public final boolean fileExists() {\n\t if ( m_fileStatus == FileStatus.FileExists || m_fileStatus == FileStatus.DirectoryExists)\n\t return true;\n\t return false;\n\t}", "@Test\n public void testHasDirectory() {\n FileTree myTree = new FileTree();\n String[] file = {\"file1\"};\n try {\n myTree.mkdir(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertTrue(myTree.hasDirectory(\"file1\"));\n }", "public void testCreateFileFilePersistenceException() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n try {\r\n filePersistence.createFile(VALID_FILELOCATION, DIRNAME);\r\n fail(\"if an exception occurs while performing the operation, throw FilePersistenceException\");\r\n } catch (FilePersistenceException e) {\r\n // good\r\n }\r\n try {\r\n filePersistence.createFile(VALID_FILELOCATION, READONLYFILENAME);\r\n fail(\"if an exception occurs while performing the operation, throw FilePersistenceException\");\r\n } catch (FilePersistenceException e) {\r\n // good\r\n }\r\n }", "@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 }", "private static boolean isValidCreate(String pFilePath) {\n\t\tassert pFilePath != null;\n\t\tFile f = new File(pFilePath);\n\t\treturn f.exists();\n\t}", "public boolean addFile(File sourceFile) {\n String filename = sourceFile.getName();\n File destFile = null;\n String codeExtension = null;\n boolean replacement = false;\n\n // if the file appears to be code related, drop it\n // into the code folder, instead of the data folder\n if (filename.toLowerCase().endsWith(\".o\") ||\n filename.toLowerCase().endsWith(\".a\") ||\n filename.toLowerCase().endsWith(\".so\")) {\n\n //if (!codeFolder.exists()) codeFolder.mkdirs();\n prepareCodeFolder();\n destFile = new File(codeFolder, filename);\n\n } else {\n for (String extension : getExtensions()) {\n String lower = filename.toLowerCase();\n if (lower.endsWith(\".\" + extension)) {\n destFile = new File(this.folder, filename);\n codeExtension = extension;\n }\n }\n if (codeExtension == null) {\n prepareDataFolder();\n destFile = new File(dataFolder, filename);\n }\n }\n\n // check whether this file already exists\n if (destFile.exists()) {\n Object[] options = { _(\"OK\"), _(\"Cancel\") };\n String prompt = I18n.format(_(\"Replace the existing version of {0}?\"), filename);\n int result = JOptionPane.showOptionDialog(editor,\n prompt,\n _(\"Replace\"),\n JOptionPane.YES_NO_OPTION,\n JOptionPane.QUESTION_MESSAGE,\n null,\n options,\n options[0]);\n if (result == JOptionPane.YES_OPTION) {\n replacement = true;\n } else {\n return false;\n }\n }\n\n // If it's a replacement, delete the old file first,\n // otherwise case changes will not be preserved.\n // http://dev.processing.org/bugs/show_bug.cgi?id=969\n if (replacement) {\n boolean muchSuccess = destFile.delete();\n if (!muchSuccess) {\n Base.showWarning(_(\"Error adding file\"),\n I18n.format(_(\"Could not delete the existing ''{0}'' file.\"), filename),\n\t\t\t null);\n return false;\n }\n }\n\n // make sure they aren't the same file\n if ((codeExtension == null) && sourceFile.equals(destFile)) {\n Base.showWarning(_(\"You can't fool me\"),\n _(\"This file has already been copied to the\\n\" +\n \"location from which where you're trying to add it.\\n\" +\n \"I ain't not doin nuthin'.\"), null);\n return false;\n }\n\n // in case the user is \"adding\" the code in an attempt\n // to update the sketch's tabs\n if (!sourceFile.equals(destFile)) {\n try {\n Base.copyFile(sourceFile, destFile);\n\n } catch (IOException e) {\n Base.showWarning(_(\"Error adding file\"),\n I18n.format(_(\"Could not add ''{0}'' to the sketch.\"), filename),\n\t\t\t e);\n return false;\n }\n }\n\n if (codeExtension != null) {\n SketchCode newCode = new SketchCode(destFile, codeExtension);\n\n if (replacement) {\n replaceCode(newCode);\n\n } else {\n insertCode(newCode);\n sortCode();\n }\n setCurrentCode(filename);\n editor.header.repaint();\n if (editor.untitled) { // TODO probably not necessary? problematic?\n // Mark the new code as modified so that the sketch is saved\n current.setModified(true);\n }\n\n } else {\n if (editor.untitled) { // TODO probably not necessary? problematic?\n // If a file has been added, mark the main code as modified so\n // that the sketch is properly saved.\n code[0].setModified(true);\n }\n }\n return true;\n }", "private File createNewFile(String prefix){\n if(prefix==null || \"\".equalsIgnoreCase(prefix)){\n prefix=\"IMG_\";\n }\n File newDirectory = new File(Environment.getExternalStorageDirectory()+\"/mypics/\");\n if(!newDirectory.exists()){\n if(newDirectory.mkdir()){\n Log.d(mContex.getClass().getName(), newDirectory.getAbsolutePath()+\" directory created\");\n }\n }\n File file = new File(newDirectory,(prefix+ System.currentTimeMillis()+\".jpg\"));\n if(file.exists()){\n //this wont be executed\n file.delete();\n try {\n file.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return file;\n }", "boolean hasFileName();", "boolean hasFileName();", "public boolean createNewFile(File file) throws IOException {\n if (\"/probes/.ready\".equals(file.getPath())) {\n return true;\n }\n return file.createNewFile();\n }", "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 touch(String name) throws FileExistsException\n\t{\n\t\tcheckMakeFile(name);\n\t\tFileElement add = new FileElement(name, false);\n\t\tfileSystem.addChild(currentFileElement, add);\n\t}" ]
[ "0.6848694", "0.6750128", "0.67309684", "0.66965294", "0.6624252", "0.656458", "0.65523344", "0.64794767", "0.63517976", "0.63200295", "0.628772", "0.6278257", "0.6237214", "0.6147892", "0.60901517", "0.60380924", "0.60276604", "0.60241485", "0.6019731", "0.59528375", "0.5932046", "0.5919665", "0.5910819", "0.5881885", "0.5880564", "0.5876688", "0.58245564", "0.581029", "0.5800663", "0.5797012", "0.5796294", "0.5772995", "0.57667875", "0.57569647", "0.5755013", "0.57547015", "0.57272923", "0.572471", "0.5723902", "0.5707885", "0.57057875", "0.56998163", "0.569874", "0.5698448", "0.56956184", "0.5695085", "0.5679396", "0.5662058", "0.565073", "0.56495374", "0.56482804", "0.5620647", "0.56158143", "0.5605828", "0.55925566", "0.5584043", "0.55752367", "0.5558656", "0.5557879", "0.5555818", "0.5553027", "0.55470747", "0.55369335", "0.5535688", "0.55331093", "0.5529435", "0.5528872", "0.5524541", "0.55185515", "0.5514995", "0.5513151", "0.5504217", "0.54916966", "0.5490589", "0.54748905", "0.54660714", "0.54636115", "0.54564315", "0.5453696", "0.54533297", "0.5450864", "0.544974", "0.5445149", "0.5436379", "0.5432751", "0.54202896", "0.5414476", "0.54141057", "0.5411833", "0.5395206", "0.53888905", "0.53814113", "0.53731936", "0.53694093", "0.53688306", "0.5356022", "0.5356022", "0.5351333", "0.5350089", "0.5348984" ]
0.6757272
1
Prints all the children of the current directory
public String ls() { String toReturn = ""; Iterable<Position<FileElement>> kids = fileSystem.children(currentFileElement); if (kids == null) return "Nothing to list"; { for (Position<FileElement> fe : kids) { toReturn += fe.toString() + ", "; } } return toReturn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void print(){\n for(int i = 0; i < rootDir.length; i++){\n System.out.println(rootDir[i]);\n }\n }", "private void printTree(File directory, int level, Environment env) {\n\t\tfor (int i = 0; i < level; i++) {\n\t\t\tenv.write(\" \"); // shift output\n\t\t}\n\n\t\tif (directory.isDirectory()) {\n\t\t\tenv.writeln(\"[\" + directory.getName() + \"]\");\n\t\t\t\n\t\t\t\n\t\t\tFile[] children = directory.listFiles();\n\t\t\t\n\t\t\tif(children != null) {\n\t\t\t\tfor (File file : children) {\n\t\t\t\t\tprintTree(file, level + 1, env);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tenv.writeln(directory.getName()); // print file name\n\t\t}\n\t}", "public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getValue());\n\t\t}\n\t}", "private void listDirectories (Directory currentDirectory) {\n currentDirectory.printSubDirectories(\"DIRS : \");\n }", "public String recursivelyTraverse(IDirectory currentDir) {\r\n ArrayList<DirectoryTreeNode> contents =\r\n ((Directory) currentDir).getContents();\r\n ArrayList<IDirectory> subDirectories =\r\n ((Directory) currentDir).getSubDirectories();\r\n String resultList = \"\";\r\n\r\n if (contents.isEmpty()) {\r\n return resultList + \"\\n\";\r\n } else {\r\n // prints the names of the sub directories and the files\r\n for (DirectoryTreeNode content : contents) {\r\n resultList += content.getName() + \"\\n\";\r\n }\r\n resultList += \"\\n\";\r\n for (IDirectory subDir : subDirectories) {\r\n resultList += subDir.getName() + \":\\n\";\r\n resultList += this.recursivelyTraverse(subDir);\r\n }\r\n resultList += \"\\n\";\r\n }\r\n return resultList;\r\n }", "public String printFromDirectory(IDirectory currentDir) {\r\n // Create a result variable to store the names of the contents of the\r\n // directory\r\n String result = \"\";\r\n\r\n // Get all the sub directories in currentDir\r\n ArrayList<IDirectory> subDirectories = new ArrayList<>();\r\n subDirectories = currentDir.getSubDirectories();\r\n // Get all the files in the directory\r\n ArrayList<IFile> files = new ArrayList<>();\r\n files = currentDir.getFiles();\r\n\r\n // Add names of the sub directories to the result\r\n for (IDirectory subDir : subDirectories) {\r\n result += subDir.getName() + \"\\n\";\r\n }\r\n // Add names of the files in the directory to the result\r\n for (IFile file : files) {\r\n result += file.getName() + \"\\n\";\r\n }\r\n\r\n // Return the names of all the contents\r\n return result;\r\n }", "public void printAllPaths() {\n\n if (root == null) System.out.println(\"No paths for you!\");\n else {\n printPaths(root.left, root.element.toString());\n printPaths(root.right, root.element.toString());\n }\n }", "@Override\n public void printAllSubFilesAndFolders(String folderPath) {\n Path file = new File(folderPath).toPath();\n // boolean exists = Files.exists(file); // Check if the file exists\n boolean isDirectory = Files.isDirectory(file); // Check if it's a directory\n boolean isFile = Files.isRegularFile(file); // Check if it's a regular file\n if (isDirectory) {\n System.out.println(\"cd \"+file+\" %d\");\n System.out.println( System.getProperty(file.toString()));\n } else if (isFile) {\n System.out.println(\"dir\");\n }\n }", "public String recursivePrinting(String[] arguments, FileSystem dirTree,\r\n IDirectory currentDir) {\r\n List<String> newArguments =\r\n Arrays.asList(arguments).subList(1, arguments.length);\r\n String resultList = \"\";\r\n\r\n for (String path : newArguments) {\r\n String recursiveResult =\r\n this.recursiveLS(dirTree, path, currentDir) + \"\\n\";\r\n if (toPrint) {\r\n resultList = resultList + path + \":\\n\" + recursiveResult;\r\n resultList = resultList.trim() + \"\\n\\n\";\r\n }\r\n }\r\n return resultList;\r\n }", "public static void printTree(Directory currentDirectory, String spacing)\r\n {\r\n for(Directory subDirectory: currentDirectory.getListOfSubDirectories())\r\n { \r\n System.out.println(spacing + subDirectory.getName());\r\n printTree(subDirectory, spacing + \"\\t\");\r\n } \r\n }", "public List<IDirectory> getAllChildDir() {\n return this.children;\n }", "@Override\r\npublic void Display(int depth) {\n\tSystem.out.println(\"-\"+depth);\r\n children.forEach(com->com.Display(depth+2));\r\n }", "public static void printListFilesRecursive(String startDir) {\n File dir = new File(startDir);\n File[] files = dir.listFiles();\n\n if (files != null && files.length > 0) {\n for (File file : files) {\n //Check if the file is a directory\n if (file.isDirectory()) {\n System.out.println(\"-- \" + file.getName());\n printListFilesRecursive(file.getAbsolutePath());\n } else {\n System.out.println(file.getName());\n }\n }\n }\n }", "public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}", "public void printDirectory() {\n System.out.println(\"Inventory:\");\n for (Ingredient i : stock.keySet()) {\n System.out.printf(\"%s, %d\\n\", i.getName(), stock.get(i));\n }\n System.out.println(\"Menu:\");\n int drink_number = 1;\n for (Drink d : drinks.keySet()) {\n\n System.out.printf(\"%d, %s, $%.2f, %b\\n\", drink_number++, d.getName(), d.getPrice(), inStock(d));\n }\n }", "public void printFileNames() {\n DirectoryResource dr = new DirectoryResource();\n for (File f : dr.selectedFiles()) {\n System.out.println(f);\n }\n }", "public void dumpChildren ()\r\n {\r\n dumpChildren(0);\r\n }", "public static void display(Node root){\r\n String str = \"[\"+root.data+\"] -> \";\r\n for(Node child : root.children){\r\n str += child.data + \", \";\r\n }\r\n System.out.println(str + \" . \");\r\n \r\n for(int i=0; i<root.children.size(); i++){\r\n Node child = root.children.get(i);\r\n display(child);\r\n }\r\n }", "public void printTree() {\n printTreeHelper(root);\n }", "private static void listar(Path a){\n File dir = new File(a.toString());\n if(dir.isDirectory()){\n String[] dirContents = dir.list();\n for(int i =0; i < dirContents.length; i++){\n System.out.println(dirContents[i]);\n }\n }\n }", "public void printTree() {\r\n printTree(overallRoot, 0);\r\n }", "public static String printTree()\r\n {\r\n String result = \"\";\r\n for (String s: tree.toArrayList())\r\n result = result + \" \" + s;\r\n return result;\r\n }", "private static void listChildren(Path p, List<String> list)\n throws IOException {\n for (Path c : p.getDirectoryEntries()) {\n list.add(c.getPathString());\n if (c.isDirectory()) {\n listChildren(c, list);\n }\n }\n }", "public void recursiveList(String path) {\n Directory tDir = Directory.getDir(path);\n if (tDir == null) {\n str += \"Error: the input path \" + path + \" does not exist!\\n\";\n } else if (tDir.getSubContent().isEmpty()) {\n str += tDir.getName() + \"\\n\";\n } else {\n str += tDir.getName() + \":\";\n indentation += \"\\t\";\n for (int i = 0; i < tDir.getSubContent().size(); i++) {\n str += indentation;\n recursiveList(tDir.getSubContent().get(i).getAbsolutePath());\n }\n indentation = indentation.substring(0, indentation.length() - 1);\n }\n }", "public void printAll() {\n\t\tNode node = root;\n\t\twhile (node != null) {\n\t\t\tSystem.out.println(node.data);\n\t\t\tnode = node.left;\n\t\t}\n\t}", "public void printTreeNodes(){\n logger.trace(\"Name: \"+this.getName());\n for(int i=0;i<this.getChildCount();i++){\n SearchBaseNode node = (SearchBaseNode) this.getChildAt(i);\n node.printTreeNodes();\n }\n }", "public void printAllPaths(TreeNode root){\n ArrayList<Integer> path = new ArrayList<>();\n ArrayList<ArrayList<Integer>> result = new ArrayList<>();\n System.out.println(printAllPathsofTree(root, path, result));\n }", "public String nonrecursivePrinting(String[] arguments, FileSystem dirTree,\r\n IDirectory currentDir) {\r\n String resultList = \"\";\r\n for (String path : arguments) {\r\n resultList = resultList + path + \":\\n\";\r\n resultList += this.nonrecursiveLS(dirTree, path, currentDir) + \"\\n\";\r\n }\r\n return resultList;\r\n }", "public void print() {\n\n if (root == null) // If the root does not exist, then we cannot print anything\n {\n System.out.println(\"The head does not exist \");\n return;\n }\n\n directory Fileptr = root;\n while (Fileptr != null) {\n System.out.print(Fileptr.a);\n System.out.print(\" ( Available Space \" + Fileptr.availableSpace + \" ) \" + \" ----> \");\n Fileptr = Fileptr.forward;\n }\n System.out.print(\" NULL \\n\");\n }", "private static void listarDirectorio(String directorio) {\n\t\tFile f = new File(directorio);\n\t\tFile[] ficheros = f.listFiles();\n\t\tSystem.out.printf(\"CURRENT DIRECTORY: %s%n\", directorio);\n\t\tfor (int i = 0; i < ficheros.length; i++) {\n\t\t\t// es fichero\n\t\t\tif (ficheros[i].isFile()) {\n\t\t\t\tSystem.out.printf(\"-- FILE %s%n\", \n\t\t\t\t\t\tficheros[i].getName());\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < ficheros.length; i++) {\n\t\t\t// es directorio\n\t\t\tif (ficheros[i].isDirectory()) {\n\t\t\t\tSystem.out.printf(\"-- DIR %s%n\", \n\t\t\t\t\t\tficheros[i].getName());\n\t\t\t}\n\t\t}\n\t}", "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void displayDirectoryList() {\r\n //-----------------------------------\r\n String appDirecotry = APP_INSTANCE.getAppDirectory();\r\n\r\n //-----------------------------------\r\n\r\n System.out.println(\"/// FILE LIST OF DIRECTORY: \"+appDirecotry);\r\n System.out.println(\"/// ------------------ START OF DIRECTORY FILES LIST -------------------\");\r\n\r\n //-----------------------------------\r\n getCurrentDirectoryFiles(appDirecotry).forEach(listItemFile-> {\r\n intProperty = (intProperty +1 );\r\n System.out.println(\"/// [\"+intProperty+\"] \"+listItemFile.getName());\r\n });\r\n\r\n //-----------------------------------\r\n System.out.println(\"/// ------------------- END OF DIRECTORY FILES LIST --------------------\");\r\n }", "public void printRoot(){\n for(String temp : root){\n System.out.println(temp);\n }\n }", "public void printTree(){ \n System.out.format(\"The suffix tree for S = %s is: %n\",this.text); \n this.print(0, this.root); \n }", "public String printTree() {\n printSideways();\n return \"\";\n }", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "private static void showFiles(File[] files) {\n\t\t for (File file : files) {\r\n\t\t if (file.isDirectory()) {\r\n\t\t // System.out.println(\"Directory: \" + file.getName());\r\n\t\t showFiles(file.listFiles()); // Calls same method again.\r\n\t\t } else {\r\n\t\t // System.out.println(\"File: \" + file.getName());\r\n\t\t }\r\n\t\t }\r\n\t\t\r\n\t}", "public void printLDR() {\n if(!empty()) {\n printLDRNodes(root);\n System.out.println();\n }\n }", "public void printTree() {\r\n\t\tif (isEmpty())\r\n\t\t\tSystem.out.println(\"Empty tree\");\r\n\t\telse\r\n\t\t\tprintTree(root);\r\n\t}", "public void printAction() {\n this.folderList.get(currentFolder).printIt();\n }", "public void printPath() {\n System.out.print(\"Path: \");\n for (int i = 0; i < parents.size(); i++) {\n Cell cell = parents.get(i);\n System.out.print(\" (\" + cell.x + \",\" + cell.y + \") \");\n }\n System.out.println(\"\\nVisited cells: \" + visitedCells);\n System.out.println(\"Length of Path: \" + parents.size());\n }", "static void printTree(AbstractNode root) throws IOException {\n if (root == null) {\n return;\n }\n System.out.println(root.toString());\n if(root.getTypeNode() == 0) {\n ConscellNode nextNode = (ConscellNode)root;\n printTree(nextNode.getFirst());\n printTree(nextNode.getNext());\n }\n }", "public void print_root(){\r\n\t\tfor(int id = 0; id < label.length; id++){\r\n\t\t\tSystem.out.printf(\"\"%d \"\", find(id));\r\n\t\t}\r\n\t\tSystem.out.printf(\"\"\\n\"\");\r\n\t}", "public void printLRD() {\n if(!empty()){\n printLRDNodes(root);\n System.out.println();\n }\n }", "public void printAllRootToLeafPaths(){\n\t\tint[] path = new int[256];\n\t\tBinaryTreeNode root = null;\n\t\tprintAllRootToLeafPaths(root ,path,0);\n\t}", "public void printDLR() {\n if(!empty()) {\n printDLRNodes(root);\n System.out.println();\n }\n }", "static void printPaths(Node node)\n\t{\n\t\tint path[] = new int[1000];\n\t\tprintPathsRecursive(node, path, 0);\n\t}", "private void printAllPaths(final Node root, final Stack<Node> stack){\n if(root == null){\n return;\n }\n stack.push(root);\n if(root.getLeft()==null && root.getRight()==null){\n stack.display();\n stack.pop();\n return;\n }\n printAllPaths(root.getLeft(), stack);\n printAllPaths(root.getRight(), stack);\n\n //Once right subTree is processed, remove its parent\n stack.pop();\n }", "public static void dir(String currentPath){}", "public static void viewDirectory(String inputDirectory) {\n File directory = new File(inputDirectory);\n //check if it is a directory \n if (directory.isDirectory()) {\n //check if the directory has children \n if (directory.listFiles().length == 0) {\n System.out.println(\"Sorry, directory is empty!\");\n } //separate files and print [Folder] or [File]\n else {\n String listFiles[] = directory.list();\n System.out.println(\"Following are files in the directory \" + inputDirectory + \" :\\n \");\n for (String listFile : listFiles) {\n File allFiles = new File(listFile);\n System.out.println(\"-> \" + allFiles);\n }\n }\n } else {\n System.out.println(\"Invalid directory or path\");\n }\n }", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem.out.println(root.element);\n\t\t\n\t\tif(root.right != null) {\n\t\t\tprintOut(root.right);\n\t\t}\n\t}", "public String recursiveLS(FileSystem dirTree, String path,\r\n IDirectory currentDir) {\r\n\r\n Directory toLsDir =\r\n (Directory) this.getDirectoryFromPath(dirTree, path, currentDir);\r\n String result = \"\";\r\n // get resulting string using helper function\r\n // check if the path given is valid\r\n if (toPrint && (!toLsDir.getSubDirectories().isEmpty()\r\n || !toLsDir.getFiles().isEmpty())) {\r\n result += this.recursivelyTraverse(toLsDir);\r\n } else if (!toPrint) {\r\n System.out.println(\"Error: Cannot access path \" + path + \"\\n\");\r\n }\r\n\r\n return result;\r\n }", "public void prettyPrintTree() {\r\n\t\tSystem.out.print(\"prettyPrintTree starting\");\r\n\t\tfor (int i = 0; i <= this.getTreeDepth(); i++) {\r\n\t\t\tprettyPrintTree(root, 0, i);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public static void listarDirectorios(File directorio) {\n if (!directorio.isDirectory()) {//bolean si no se trata de un directorio sino de un archivo\n System.out.println(directorio.getName());//dame su nombre\n } else {\n String[] dirs = directorio.list(); //list() devuelve un tab[] de strings con nombres de cada directorio dentro de directorio\n\n for (String dir : dirs) { //File(String parent, String child)\n File f = new File(directorio.getAbsolutePath(),dir);//directorio.getAbsolutePath() vendria a ser el directorio, dir el archivo dentro(hijo)\n System.out.println(f.getName());\n if (f.isDirectory()) {\n listarDirectorios(f);\n }\n }\n\n }\n }", "public void print()\r\n {\r\n print(root);\r\n }", "public void print() {\n\t\tprint(root);\n\t}", "public void listFilesAndFilesSubDirectories(String directoryName) throws IOException{\n File directory = new File(directoryName);\n //get all the files from a directory\n System.out.println(\"List of Files and file subdirectories in: \" + directory.getCanonicalPath());\n File[] fList = directory.listFiles();\n for (File file : fList){\n if (file.isFile()){\n System.out.println(file.getAbsolutePath());\n } else if (file.isDirectory()){\n listFilesAndFilesSubDirectories(file.getAbsolutePath());\n }\n }\n }", "public void testGetChildren() throws IOException {\n FileObject fobj = getFileObject(testFile);\n FileObject parent = fobj.getParent();\n parent = parent.createFolder(\"parent\");\n File pFile = getFile(parent);\n for (int i = 0; i < 10; i++) {\n assertTrue(new File(pFile, \"file\" + i).createNewFile());\n assertTrue(new File(pFile, \"fold\" + i).mkdir());\n }\n monitor.reset();\n FileObject[] children = parent.getChildren();\n //20 x children, 1 x File.listFiles \n monitor.getResults().assertResult(21, StatFiles.ALL);\n monitor.getResults().assertResult(21, StatFiles.READ);\n //second time\n monitor.reset();\n children = parent.getChildren();\n monitor.getResults().assertResult(0, StatFiles.ALL);\n }", "static void viewFiles()\r\n\t {\n\t\t File directoryPath = new File(\"D:\\\\java_project\");\r\n\t File filesList[] = directoryPath.listFiles();\r\n System.out.println(\"List of files and directories in the specified directory:\");\r\n\t for(File file : filesList) \r\n\t {\r\n\t System.out.println(\"File name: \"+file.getName());\r\n\t System.out.println(\"File path: \"+file.getAbsolutePath());\r\n\t System.out.println(\"Size :\"+file.getTotalSpace());\r\n\t System.out.println(\"last time file is modified :\"+new Date(file.lastModified()));\r\n System.out.println(\" \");\r\n\t }\r\n }", "public void printTree(){\n if(root!=null) // มี node ใน tree\n {\n super.printTree(root); // ปริ้นโดยส่ง node root ไป static fn\n }\n else\n {\n System.out.println(\"Empty tree!!!\");\n }\n }", "public void dumpTree() {\n\t\tsendMessage(\"/g_dumpTree\", new Object[] { 0, 0 });\n\t}", "public static void Java_tree(File dir, int depth, String sort_method, int initialDepth) {\n // TODO: print file tree\n File[] fileList = sortFileList(dir.listFiles(), sort_method);\n depth--;\n\n if (fileList != null && fileList.length != 0) {\n for (File file : fileList) {\n if (dir == currentDirectory) {\n System.out.println(file.getName());\n } else {\n String output = \"|-\" + file.getName();\n for (int i = 0; i < (initialDepth - depth - 1); i++) {\n output = \" \" + output;\n }\n System.out.println(output);\n }\n\n if (depth > 0 && file.isDirectory()) {\n Java_tree(file, depth, sort_method, initialDepth);\n }\n }\n }\n\n }", "public void printNodes() {\n\t\tprintNodes(root);\n\n\t}", "public void printTree( )\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tSystem.out.println( \"Empty tree\" );\r\n\t\telse\r\n\t\t\tprintTree( root );\r\n\t}", "public void printTree(SortingField field)\n {\n if(this instanceof File){\n System.out.println(this.getName());\n return;\n }\n ((Folder)this).sortList(field);\n //now the list is sorted according to the field given\n\n //printing the tree\n ((Folder) this).print(\"\");\n }", "@Override\r\n\tpublic String ShowListCMD() {\n\t\treturn \"dir\";\r\n\t}", "void printLevel()\r\n\t {\r\n\t int h = height(root);\r\n\t int i;\r\n\t for (i=1; i<=h+1; i++)\r\n\t printGivenLevel(root, i);\r\n\t }", "void printLevelOrder() {\n TreeNode2 nextLevelRoot = this;\n while (nextLevelRoot != null) {\n TreeNode2 current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n System.out.print(current.val + \" \");\n if (nextLevelRoot == null) {\n if (current.left != null)\n nextLevelRoot = current.left;\n else if (current.right != null)\n nextLevelRoot = current.right;\n }\n current = current.next;\n }\n System.out.println();\n }\n }", "public void printPath(){\n\t\tListIterator<Path> listIterator =temp.listIterator();\n\t\twhile(listIterator.hasNext()){\n\t\t\tSystem.out.print(listIterator.next().getPos()+\" \");\n\t\t}\n\t}", "private static void listarDirectorio2(String directorio) {\n\t\tFile f = new File(directorio);\n\t\tFile[] ficheros = f.listFiles();\n\t\tSystem.out.printf(\"DIRECTORY: %s%n\", directorio);\n\t\tfor (int i = 0; i < ficheros.length; i++) {\n\t\t\t// es fichero\n\t\t\tif (ficheros[i].isFile()) {\n\t\t\t\tSystem.out.printf(\"-- FILE %s%n\", \n\t\t\t\t\t\tficheros[i].getName());\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < ficheros.length; i++) {\n\t\t\t// es directorio\n\t\t\tif (ficheros[i].isDirectory()) {\n\t\t\t\tSystem.out.printf(\"-- DIR %s%n\", \n\t\t\t\t\t\tficheros[i].getName());\n\t\t\t\t//System.out.println(\"\");\n\t\t\t\t//listarDirectorio2(ficheros[i].getPath());\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < ficheros.length; i++) {\n\t\t\t// explora nuevos directorios\n\t\t\tif (ficheros[i].isDirectory()) {\t\t\t\t\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tlistarDirectorio2(ficheros[i].getPath());\n\t\t\t}\n\t\t}\n\t}", "public void showDirPath(String[] list);", "public String[] listChildren()\n/* */ {\n/* 519 */ int childCount = getChildCount();\n/* 520 */ String[] outgoing = new String[childCount];\n/* 521 */ for (int i = 0; i < childCount; i++) {\n/* 522 */ outgoing[i] = getChild(i).getName();\n/* */ }\n/* 524 */ return outgoing;\n/* */ }", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "static void walkTheDir(){ \n\t try (Stream<Path> paths = Files.walk(Paths.get(\"/ownfiles/tullverketCert/source\"))) {\n\t \t paths\n\t \t .filter(Files::isRegularFile)\n\t \t //.forEach(System.out::println);\n\t \t .forEach( e ->{\n\t \t \t\tSystem.out.println(e);\n\t \t \t\tSystem.out.println(e.getParent());\n\t \t \t\t\n\t \t \t});\n\t \t \n \t}catch (Exception e) { \n\t System.out.println(\"Exception: \" + e); \n\t } \n\t }", "@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }", "@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }", "@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }", "public void printLaptops(){\n\t\tSystem.out.println(\"Root is: \"+vertices.get(root));\n\t\tSystem.out.println(\"Edges: \");\n\t\tfor(int i=0;i<parent.length;i++){\n\t\t\tif(parent[i] != -1){\n\t\t\t\tSystem.out.print(\"(\"+vertices.get(parent[i])+\", \"+\n\t\t\tvertices.get(i)+\") \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t\t}", "public static void main(String[] args) { String dirname = \"/home/diego/IdeaProjects/JAVAStuff/src/tmp/dirTest.txt\";\n// File d = new File(dirname);\n// d.mkdirs();\n//\n File file = null;\n String[] paths;\n\n try {\n file = new File(\"/home/diego/IdeaProjects/JAVAStuff/src\");\n paths = file.list();\n\n for(String s: paths) {\n System.out.println(s);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "private List<String> getChildren(String path, boolean watch)\n throws KeeperException, InterruptedException {\n return zk.getChildren(path, watch);\n }", "private static void console (String path) {\n boolean ERROR = false;\n while (true) {\n if (!ERROR) {\n System.out.println(\"Directory: \" + path);\n\n System.out.println(\"====================================\");\n long startTime = System.currentTimeMillis();\n DirectoryData root = hashmap.get(path);\n System.out.println(\"Directories in hashmap: \" + hashmap.size());\n System.out.println(\"Time taken to get data: \" + (System.currentTimeMillis() - startTime) + \"ms\");\n System.out.println(\"====================================\");\n\n System.out.println(\"Inside: \");\n\n if (root.getFileList().size() == 0) {\n System.out.println(\"(Empty Directory)\");\n }\n\n String leftAlignFormat = \"|%-1s | %-100s | %-10s |%n\";\n\n System.out.format(\"+---+------------------------------------------------------------------------------------------------------+------------+%n\");\n System.out.format(\"| | Name | Size |%n\");\n System.out.format(\"+---+------------------------------------------------------------------------------------------------------+------------+%n\");\n\n for (FileData subFile : root.getFileList()) {\n if (subFile.isDirectory()) {\n if (hashmap.get(subFile.getFullPath()) == null)\n System.out.format(leftAlignFormat, \" d\", subFile.getFilename(),\n size_string(null));\n else\n System.out.format(leftAlignFormat, \" d\", subFile.getFilename(),\n size_string(hashmap.get(subFile.getFullPath()).getSize()));\n } else {\n System.out.format(leftAlignFormat, \" -\", subFile.getFilename(),\n size_string(subFile.getSize()));\n }\n }\n System.out.format(\"+---+------------------------------------------------------------------------------------------------------+------------+%n\");\n }\n\n ERROR = false;\n\n System.out.print(\"\\n> \");\n Scanner in = new Scanner(System.in);\n String next_dir = in.nextLine();\n String next_path = path;\n\n if (next_dir.equals(\"..\")) {\n String[] path_arr = next_path.split(\"\\\\\\\\\");\n next_path = String.join(\"\\\\\", Arrays.copyOfRange(path_arr, 0, path_arr.length-1));\n\n if (path.charAt(path.length()-2) == ':') {\n System.out.println(\"Directory: \" + path);\n System.out.println(\"Already in root\");\n //path = TraversalConsole.path;\n ERROR = true;\n continue;\n }\n\n if (next_path.charAt(next_path.length()-1) == ':')\n next_path += '\\\\';\n\n if (!hashmap.containsKey(next_path)) {\n System.out.println(\"Directory: \" + path + \"\\\\\");\n System.out.println(\"Already in root\");\n ERROR = true;\n continue;\n } else {\n path = next_path;\n continue;\n }\n }\n\n if (path.charAt(path.length() - 1) != '\\\\') {\n next_path += \"\\\\\" + next_dir;\n } else {\n next_path += next_dir;\n }\n\n if (next_dir.equals(\"exit\")) {\n break;\n }\n\n if (hashmap.containsKey(next_path)) {\n path = next_path;\n continue;\n } else {\n System.out.println(\"Wrong Input or [\" + next_dir + \"] is a file\");\n ERROR = true;\n continue;\n }\n }\n }", "public void print(){\n inorderTraversal(this.root);\n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "private static void iteratorFilePath(File file){\n while(file.isDirectory()){\n for(File f : file.listFiles()){\n System.out.println(f.getPath());\n iteratorFilePath(f);\n }\n break;\n }\n }", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "public static void showListOfDirectory(String filePath) {\n File f1 = new File(filePath);\n if (f1.isDirectory()) {\n System.out.println(\"Directory: \" + filePath);\n String[] arr = f1.list();\n for (int i = 0; i < arr.length; i++) {\n File f = new File(filePath + \"/\" + arr[i]);\n if (f.isDirectory()) {\n System.out.println(arr[i] + \" is a directory\");\n } else {\n System.out.println(arr[i] + \" is a file\");\n }\n }\n } else {\n System.out.println(\"It is not a directory\");\n }\n }", "public void printTree(T root) {\n List<TreeLine> treeLines = buildTreeLines(root);\n printTreeLines(treeLines);\n if(flush) outStream.flush();\n }", "@Override\n public void traverse()\n {\n System.out.print(\"DFS Tree: \");\n DFSHelper(root);\n System.out.println();\n }", "public String listPath(List<String> arg) {\n String output = \"\";\n for (int path = 0; path < arg.size(); path++) {\n Directory tDir = Directory.getDir(arg.get(path));\n if (tDir == null) {\n output +=\n \"Error: The input path \" + arg.get(path) + \" doesn't exist!\\n\\n\";\n } else if (tDir.isFile) {\n output += tDir.getName();\n } else {\n for (int j = 0; j < tDir.getSubContent().size(); j++) {\n if (!tDir.getSubContent().get(j).isFile) {\n output += tDir.getSubContent().get(j).getName();\n Directory dir = tDir.getSubContent().get(j);\n if (!dir.getSubContent().isEmpty()) {\n output += \" : \";\n for (int k = 0; k < tDir.getSubContent().get(j).getSubContent()\n .size(); k++) {\n if (k != tDir.getSubContent().get(j).getSubContent().size()\n - 1) {\n output += tDir.getSubContent().get(j).getSubContent().get(k)\n .getName() + \", \";\n } else {\n output += tDir.getSubContent().get(j).getSubContent().get(k)\n .getName() + \"\\n\";\n }\n }\n } else {\n output += \"\\n\";\n }\n } else {\n output += tDir.getSubContent().get(j).getName() + \"\\n\";\n }\n }\n }\n }\n return output;\n }", "public List<FileNode> getChildren() {\r\n return this.children;\r\n }", "public static String printDFS(final List<DFSTreeNode> nodes) {\n if(nodes == null || nodes.size() <= 0)\n return \"\";\n \n String print = \"\";\n \n List<DFSTreeNode> sorted = new ArrayList<>(nodes);\n List<DFSTreeNode> visited = new ArrayList<>();\n Stack<DFSTreeNode> parents = new Stack<>();\n \n // Find the root node and push it in parents\n sorted.sort(new Comparator<DFSTreeNode>(){\n @Override\n public int compare(DFSTreeNode o1, DFSTreeNode o2) {\n return o1.compareTo(o2);\n }\n });\n DFSTreeNode root = sorted.get(0);\n parents.push(root);\n while(!parents.isEmpty()) {\n DFSTreeNode currNode = parents.pop();\n if(!visited.contains(currNode)) {\n visited.add(currNode);\n print += currNode.printStart(nodes,visited);\n print += currNode.printBeforeChildren(nodes,visited);\n }\n \n // Find all children\n List<DFSTreeNode> children = sorted.stream().filter(n -> n.isChildOf(currNode))\n .collect(Collectors.toList());\n // To indicate if we have already visited all children of the current node\n boolean noMoreChildren = true;\n for(DFSTreeNode child : children){\n // If child was already visited, skip it\n if(visited.contains(child)) continue;\n // If not visited, push it to parents stack together with currNode\n parents.push(currNode);\n parents.push(child);\n // Set noMoreChildren to false if we are going deeper\n noMoreChildren = false;\n // Break as we don't want to visit any siblings until we've completed the current line of descendants\n break;\n }\n \n // If no more children for the current node, close the node\n if(noMoreChildren) {\n print += currNode.printAfterChildren(nodes,visited);\n print += currNode.printEnd(nodes,visited);\n }\n }\n return print;\n }", "private static List<Integer> printTree(Tree tree, List values){\n int height = heightOfTree(tree);\n\n for(int i=1;i<=height;i++) {\n System.out.println(\"\");\n printTreeInLevel(tree, i, values);\n }\n return values;\n}", "public void printInOrder() {\n printInOrderHelper(root);\n }", "public void printSideways() {\n if (overallRoot == null) {\n System.out.println(\"empty tree\");\n } else {\n printSideways(overallRoot, 0);\n }\n }", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "@VisibleForTesting\r\n protected static void dumpTreeRecursively(PrintWriter out,\r\n StringBuilder prefix, Iterable<SnapshotAndINode> subs) {\r\n if (subs != null) {\r\n for(final Iterator<SnapshotAndINode> i = subs.iterator(); i.hasNext();) {\r\n final SnapshotAndINode pair = i.next();\r\n prefix.append(i.hasNext()? DUMPTREE_EXCEPT_LAST_ITEM: DUMPTREE_LAST_ITEM);\r\n pair.inode.dumpTreeRecursively(out, prefix, pair.snapshot);\r\n prefix.setLength(prefix.length() - 2);\r\n }\r\n }\r\n }", "@Override\n public String toString() {\n return \"ls [PATH ...]:\\n\" + \"\\tList the contents.\\n\" + \"\\tNote:\\n\"\n + \"\\t1.If no PATH given, print contents of current directory.\\n\"\n + \"\\t2.If PATH specifies a directory, print its contents(file or \"\n + \"directory).\\n\" + \"\\t3.If PATH specifies a file, print its name.\";\n }", "public String pwd()\n\t{\n\t\tStringBuilder toPrint = new StringBuilder(\"\");\n\t\tStackLinked<String> theStack = new StackLinked<>();\n\t\tPosition<FileElement> current = currentFileElement;\n\t\tdo {\n\t\t\ttheStack.push(\"/\" + current.getValue().toString());\n\t\t\tcurrent = fileSystem.parent(current);}\n\t\twhile (fileSystem.parent(current) != null);\n\t\twhile (theStack.size() > 0)\n\t\t{\n\t\t\ttoPrint.append(theStack.pop());\n\t\t}\n\t\treturn toPrint.toString();\n\t}", "public void printSortedList() {\n if (root == null) {\n System.out.print(\"Empty Tree.\");\n return;\n } else {\n LNRTraversal(root);\n }\n }" ]
[ "0.7602099", "0.68889016", "0.6783531", "0.6734723", "0.66721404", "0.64841145", "0.64034826", "0.6336371", "0.6317314", "0.62527645", "0.62388057", "0.61805165", "0.6156174", "0.61553764", "0.615265", "0.6147484", "0.613802", "0.61091566", "0.6077291", "0.60708773", "0.60257894", "0.60154104", "0.6015364", "0.59969693", "0.59957063", "0.5953741", "0.5913735", "0.5910291", "0.5877342", "0.5872517", "0.5843398", "0.58356124", "0.58204424", "0.5786167", "0.5785831", "0.57357436", "0.5690626", "0.566197", "0.56581044", "0.563859", "0.5631", "0.561209", "0.55873173", "0.5537024", "0.55357635", "0.5534765", "0.55289465", "0.5525063", "0.5490618", "0.54820025", "0.5469709", "0.54649293", "0.5461565", "0.54582703", "0.5458178", "0.5456123", "0.5454802", "0.5452044", "0.5450612", "0.5449579", "0.5446214", "0.54412895", "0.54392165", "0.5438937", "0.5436558", "0.5421949", "0.54152405", "0.5412351", "0.5408071", "0.53816086", "0.53625095", "0.5356779", "0.53537023", "0.5345582", "0.53410417", "0.53395176", "0.53395176", "0.53395176", "0.53386194", "0.5337769", "0.5336319", "0.5335677", "0.53189677", "0.53151876", "0.5297131", "0.52971226", "0.52851325", "0.52831036", "0.5282391", "0.5269771", "0.52685046", "0.526304", "0.5262923", "0.52626", "0.5259981", "0.52596265", "0.52363837", "0.5219897", "0.5219489", "0.5213683" ]
0.59594095
25
Add new file child node to current directory Throw exception if already exists
public void touch(String name) throws FileExistsException { checkMakeFile(name); FileElement add = new FileElement(name, false); fileSystem.addChild(currentFileElement, add); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addFileToNode(DefaultMutableTreeNode node, FileInfo givenFile){\r\n\t\t//check that there are files in this folder\r\n\t\t// replace existing file if one is present with the same name\r\n\t\tif(!node.isLeaf()){\r\n\t\t\tFileInfo index = (FileInfo) node.getFirstChild();\r\n\t\t\t//look through all the files\r\n\t\t\twhile(index != null){\r\n\t\t\t\t//if it's already there\r\n\t\t\t\tif((index.toString()).equals(givenFile.toString())){\r\n\t\t\t\t\t//FileInfo temp = (FileInfo)index.getPreviousSibling();\r\n\t\t\t\t\t//remove the old file\t\r\n\t\t\t\t\tindex.removeFromParent();\r\n\t\t\t\t\t//index = temp;\r\n\t\t\t\t}\r\n\t\t\t\t//move on to the next index\r\n\t\t\t\tindex = (FileInfo) index.getNextSibling();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//add it to the node\r\n\t\tnode.add(givenFile);\r\n\t\tif(parentTree != null)\r\n\t\t\tparentTree.nodeStructureChanged(node);\r\n\t}", "void addFile(RebaseJavaFile jf)\n{\n if (file_nodes.contains(jf)) return;\n\n file_nodes.add(jf);\n jf.setRoot(this);\n}", "public void addChild(FileNode child) {\r\n child.setParent(this);\r\n children.add(child);\r\n childNum++;\r\n }", "public void addChildFile(IFile child) {\n childFiles.add(child);\n }", "private void addChild(final INode node, final int insertionPoint) {\r\n if (children == null) {\r\n children = new ArrayList<INode>(DEFAULT_FILES_PER_DIRECTORY);\r\n }\r\n node.setParent(this);\r\n children.add(-insertionPoint - 1, node);\r\n\r\n if (node.getGroupName() == null) {\r\n node.setGroup(getGroupName());\r\n }\r\n }", "private void insertToFile (PQNode node) throws Exception{\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n nodes.add(node);\n\n storeToFile(file,nodes, false);\n }", "public void addChild(DirectoryNode node) throws FullDirectoryException, NotADirectoryException {\n if(isFile)\n throw new NotADirectoryException(\"Error: This node is a file\");\n if(left != null && middle != null && right != null)\n throw new FullDirectoryException(\"This directory is full\");\n if(left == null)\n left = node;\n else if(middle == null)\n middle = node;\n else if(right == null)\n right = node;\n }", "public void addChildAt(int index, FileNode child) {\r\n child.setParent(this);\r\n this.children.add(index, child);\r\n childNum++;\r\n }", "private TreeItem<String> addNewItem(Path path) {\n TreeItem<String> mostCorrespondingParent = findMostCorrespondingParentFor(path);\n TreeItem<String> newChildTreeItem;\n if (buildPathForNode(mostCorrespondingParent) != null) {\n Path newChildPath;\n if (mostCorrespondingParent != rootNode) {\n Path mostCorrespondingParentPath = getNodeAbsolutePath(mostCorrespondingParent);\n newChildPath = extractChildPath(path, mostCorrespondingParentPath);\n } else {\n newChildPath = path;\n }\n newChildTreeItem = new TreeItem<>(newChildPath.toString(), new ImageView(FileTreeItem.FileType.FILE.getImage()));\n } else {\n newChildTreeItem = new TreeItem<>(path.toString(), new ImageView(FileTreeItem.FileType.FILE.getImage()));\n }\n mostCorrespondingParent.getChildren().add(newChildTreeItem);\n sortChildren(mostCorrespondingParent);\n return extractFileNameToLeaf(newChildTreeItem);\n }", "public void addFile(String name, IDirectory parent) {\r\n // Create a new file\r\n File newFile = new File(name, (Directory) parent);\r\n ((Directory) parent).addItem(newFile);\r\n }", "public void insertNewIntoDirectory(int position, FileSystem file) {\r\n\tList<FileSystem> list = this.getDir().getList(); \r\n\tlist.add(position, file);\r\n}", "public void addFiletoNode(DefaultMutableTreeNode pnode,\n\t\t\t\t\tEllowFile pfile) {\n\t\t\t\tcurrentFiles++;\n\t\t\t\tdesktopPane.setDialogProgress(\n\t\t\t\t\t\t(int) (currentFiles / totalFiles * 100),\n\t\t\t\t\t\t\"Refreshing Workspace\", \"Scanning Projects\");\n\t\n\t\t\t\tif (pfile.isDirectory()){\n\t\t\t\t\tfor (File file : pfile.listFiles())\n\t\t\t\t\t\tif (file.isDirectory())\n\t\t\t\t\t\t\tscanFile(file,pfile, pnode);\n\t\t\t\t\tfor (File file : pfile.listFiles())\n\t\t\t\t\t\tif (!file.isDirectory())\n\t\t\t\t\t\t\tscanFile(file,pfile, pnode);\n\t\t\t\t}\n\t\t\t}", "@Override\n public void addSingleFile(FileInfo file) {\n }", "public void add(FileSystemEntry entry);", "public void addChild(IDirectory child) {\n children.add(child);\n }", "private void populateNewChildDirectory(DirectoryEntry newEntry) {\n try (ClusterStream stream = new ClusterStream(fileSystem,\n FileAccess.Write,\n newEntry.getFirstCluster(),\n 0xffffffff)) {\n // First is the self-referencing entry...\n DirectoryEntry selfEntry = new DirectoryEntry(newEntry);\n selfEntry.setName(FileName.SelfEntryName);\n selfEntry.writeTo(stream);\n // Second is a clone of our self entry (i.e. parent) - though dates\n // are odd...\n DirectoryEntry parentEntry = new DirectoryEntry(getSelfEntry());\n parentEntry.setName(FileName.ParentEntryName);\n parentEntry.setCreationTime(newEntry.getCreationTime());\n parentEntry.setLastWriteTime(newEntry.getLastWriteTime());\n parentEntry.writeTo(stream);\n } catch (IOException e) {\n throw new dotnet4j.io.IOException(e);\n }\n }", "public boolean addChild(INode node, final boolean setModTime,\r\n final Snapshot latest) throws NSQuotaExceededException {\r\n final int low = searchChildren(node.getLocalNameBytes());\r\n if (low >= 0) {\r\n return false;\r\n }\r\n\r\n if (isInLatestSnapshot(latest)) {\r\n return replaceSelf4INodeDirectoryWithSnapshot()\r\n .addChild(node, setModTime, latest);\r\n }\r\n addChild(node, low);\r\n if (setModTime) {\r\n // update modification time of the parent directory\r\n updateModificationTime(node.getModificationTime(), latest);\r\n }\r\n return true;\r\n }", "public void newFile(int temp) {\n if(!doesExist(temp)){\n System.out.println(\"The Directory does not exist \");\n return;\n }\n\n directory nodeptr = root;\n for(int count = 0; count < temp; count++) {\n nodeptr = nodeptr.forward;\n }\n int space = nodeptr.f.createFile(nodeptr.count);\n nodeptr.count++;\n nodeptr.availableSpace = 512 - space;\n\n }", "public void add(File file) {\n\t\tthis.content.add(file);\n\t\tif(file.getParent() != null) {\n\t\t\tfile.getParent().content.remove(file);\n\t\t}\n\t\tfile.setParent(this);\n\t}", "protected final void addFileId(int index, int fileid) {\n getChildIds().add(index, fileid);\n getBTreeMetaData().setDirty(this);\n }", "private void clickCreateDirOrFile(SubMenuItem item, TreeNode node, List<Long> refIdList) {\n String title = \"New \" + item.getFileName();\n String fileName = item.getFileName();\n String msg = \"Please enter the \" + fileName;\n if (!item.isDirectory()) {\n title += \" file\";\n msg += \" file name (.\" + item.getExtension() + \")\";\n } else {\n msg += \" name\";\n }\n SC.askforValue(title, msg, new ValueCallback() {\n @Override\n public void execute(String value) {\n TreeNode selectedNode = node;\n if (selectedNode == null) {\n selectedNode = treeGrid.getSelectedRecord();\n }\n\n if (value != null && !\"\".equals(value)) {\n VMDirectory targetDir = new VMDirectory();\n VMFile file = new VMFile();\n if (item.isDirectory) {\n targetDir.setName(value);\n } else {\n file.setExtension(Extension.getByCode(item.getExtension()));\n file.setName(value);\n }\n VMDirectory dir;\n if (tree.isEmpty()) {\n dir = new VMDirectory();\n dir.setId(rootId);\n } else if (!treeGrid.anySelected()) {\n dir = new VMDirectory();\n dir.setId(rootId);\n if (!checkSameName(tree.getChildren(tree.find(\"/\")), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n } else if (((FileTreeNode) selectedNode).getResource() instanceof VMFile) {\n TreeNode parentNode = tree.getParent(selectedNode);\n if (\"/\".equals(tree.getPath(parentNode))) {\n dir = new VMDirectory();\n dir.setId(rootId);\n if (!checkSameName(tree.getChildren(tree.find(\"/\")), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n } else {\n dir = (VMDirectory) ((FileTreeNode) parentNode).getResource();\n if (!checkSameName(tree.getChildren(parentNode), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n }\n\n } else {\n dir = (VMDirectory) ((FileTreeNode) selectedNode).getResource();\n if (!checkSameName(tree.getChildren(selectedNode), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n }\n if (item.isDirectory) {\n ZGCreateDirCommand createDirCommand = new ZGCreateDirCommand(editResourceService, viewHandler, dir.getId(), targetDir);\n createDirCommand.addCommandListener(new CommandListener() {\n\n @Override\n public void undoEvent() {\n treeGrid.deselectAllRecords();\n fileTreeNodeFactory.removeVMResource(createDirCommand.getFileId());\n fileTreeNodeFactory.refresh(editorTabSet, tree, tabRegs);\n treeGrid.sort();\n treeGrid.redraw();\n }\n\n @Override\n public void redoEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createDirCommand.getParentId()), createDirCommand.getDirectory(),\n createDirCommand.getFileId(), true);\n }\n\n @Override\n public void executeEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createDirCommand.getParentId()), createDirCommand.getDirectory(),\n createDirCommand.getFileId(), true);\n }\n\n @Override\n public void bindEvent() {\n viewHandler.clear();\n registerRightClickEvent();\n }\n\n });\n\n CompoundCommand c = new CompoundCommand();\n c.append(createDirCommand);\n manager.execute(c.unwrap());\n } else {\n List<Long> tmpRefIdlist = refIdList;\n if (tmpRefIdlist == null && selectedNode != null) {\n tmpRefIdlist = new ArrayList<Long>();\n tmpRefIdlist.add(((FileTreeNode) selectedNode).getResource().getId());\n\n }\n\n ZGCreateFileCommand createFileCommand = new ZGCreateFileCommand(editResourceService, viewHandler, dir.getId(), file, tmpRefIdlist);\n createFileCommand.addCommandListener(new CommandListener() {\n\n @Override\n public void undoEvent() {\n treeGrid.deselectAllRecords();\n fileTreeNodeFactory.removeVMResource(createFileCommand.getFileId());\n fileTreeNodeFactory.refresh(editorTabSet, tree, tabRegs);\n treeGrid.sort();\n treeGrid.redraw();\n }\n\n @Override\n public void redoEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n }\n\n @Override\n public void executeEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n }\n\n @Override\n public void bindEvent() {\n viewHandler.clear();\n registerRightClickEvent();\n }\n });\n CompoundCommand c = new CompoundCommand();\n c.append(createFileCommand);\n manager.execute(c.unwrap());\n }\n if (dir.getId() != rootId) {\n tree.openFolder(treeGrid.getSelectedRecord());\n }\n } else if (value != null) {\n SC.warn(\"<br>Name field is empty\");\n }\n\n }\n\n });\n }", "public void newFolderButtonClicked() {\n TreePath[] paths = _fileSystemTree.getSelectionPaths();\r\n List selection = getSelectedFolders(paths);\r\n if (selection.size() > 1 || selection.size() == 0)\r\n return; // should never happen\r\n \r\n File parent = (File) selection.get(0);\r\n \r\n final ResourceBundle resourceBundle = FolderChooserResource.getResourceBundle(Locale.getDefault());\r\n String folderName = JOptionPane.showInputDialog(_folderChooser, resourceBundle.getString(\"FolderChooser.new.folderName\"),\r\n resourceBundle.getString(\"FolderChooser.new.title\"), JOptionPane.OK_CANCEL_OPTION | JOptionPane.QUESTION_MESSAGE);\r\n \r\n if (folderName != null) {\r\n File newFolder = new File(parent, folderName);\r\n boolean success = newFolder.mkdir();\r\n \r\n TreePath parentPath = paths[0];\r\n boolean isExpanded = _fileSystemTree.isExpanded(parentPath);\r\n if (!isExpanded) { // expand it first\r\n _fileSystemTree.expandPath(parentPath);\r\n }\r\n \r\n LazyMutableTreeNode parentTreeNode = (LazyMutableTreeNode) parentPath.getLastPathComponent();\r\n BasicFileSystemTreeNode child = BasicFileSystemTreeNode.createFileSystemTreeNode(newFolder, _folderChooser);\r\n // child.setParent(parentTreeNode);\r\n if (success) {\r\n parentTreeNode.clear();\r\n int insertIndex = _fileSystemTree.getModel().getIndexOfChild(parentTreeNode, child);\r\n if (insertIndex != -1) {\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).insertNodeInto(child, parentTreeNode, insertIndex);\r\n ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).nodeStructureChanged(parentTreeNode);\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).addPath(parentPath, insertIndex, child);\r\n }\r\n }\r\n TreePath newPath = parentPath.pathByAddingChild(child);\r\n _fileSystemTree.setSelectionPath(newPath);\r\n _fileSystemTree.scrollPathToVisible(newPath);\r\n }\r\n }", "public abstract void addChild(Node node);", "private void addFolder(){\n }", "void createNode(String path);", "@Override\n public boolean add(T parent, T child) {\n boolean result = false;\n if (this.root == null) {\n this.root = new Node<>(parent);\n this.root.add(new Node<>(child));\n result = true;\n this.modCount++;\n } else if (findBy(parent).isPresent()) {\n findBy(parent).get().add(new Node<>(child));\n result = true;\n this.modCount++;\n }\n return result;\n }", "abstract void addNewSourceDirectory(final File targetDirectory);", "protected final void addFileId(int fileId) {\n getChildIds().add(fileId);\n getBTreeMetaData().setDirty(this);\n }", "@Test\r\n public void moveToFileWithSameName() {\r\n currentDirectory.addNewFile(\"file\");\r\n Dir dirWithFile = currentDirectory.getSubDirectoryByName(\"child\");\r\n File fileWithContents = dirWithFile.getFileByName(\"file\");\r\n fileWithContents.setContent(\"content\");\r\n command.executeCommand(\"file\", \"child/file\", root, currentDirectory);\r\n File fileInRoot = currentDirectory.getFileByName(\"file\");\r\n // content in file in root is removed\r\n assertTrue(fileInRoot.getContents().equals(\"\"));\r\n }", "private void addFileToTarGz(TarArchiveOutputStream tOut, String path, String base) throws IOException {\n File f = new File(path);\n String entryName = base + f.getName();\n TarArchiveEntry tarEntry = new TarArchiveEntry(f, entryName);\n tOut.putArchiveEntry(tarEntry);\n Platform.runLater(() -> fileLabel.setText(\"Processing \" + f.getPath()));\n\n if (f.isFile()) {\n FileInputStream fin = new FileInputStream(f);\n IOUtils.copy(fin, tOut);\n fin.close();\n tOut.closeArchiveEntry();\n } else {\n tOut.closeArchiveEntry();\n File[] children = f.listFiles();\n if (children != null) {\n for (File child : children) {\n addFileToTarGz(tOut, child.getAbsolutePath(), entryName + \"/\");\n }\n }\n }\n }", "private static void addFile(File filedir) throws Exception {\n String fileName = getFileNameInput();\n File newFile = new File(filedir.toString() + \"\\\\\" + fileName);\n boolean fileAlreadyExists = newFile.exists();\n if (fileAlreadyExists) {\n throw new FileAlreadyExistsException(\"File already exists in current directory.\");\n } else {\n try {\n if (newFile.createNewFile()) {\n System.out.println(\"File created successfully\");\n } else {\n System.out.println(\"Something went wrong, please try again.\");\n }\n } catch (IOException e) {\n throw new IOException(e.getMessage());\n }\n }\n }", "@Test\r\n public void moveToDirWithSameName() {\r\n Dir sameName = new Dir(\"child\", \"/\");\r\n currentDirectory.addNewDirectory(sameName);\r\n command.executeCommand(\"/parent/child/\", \"/\", root, currentDirectory);\r\n currentDirectory = currentDirectory.getSubDirectoryByName(\"child\");\r\n // check child directory with file is in root\r\n assertTrue(currentDirectory.getFileByName(\"file\") != null);\r\n }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameDirToSelf() throws Throwable {\n assumeRenameSupported();\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path child = new Path(parentdir, \"child\");\n createFile(child);\n\n rename(parentdir, parentdir, false, true, true);\n //verify the child is still there\n assertIsFile(child);\n }", "protected void addSibling(File s) \r\n \t //@ requires DedicatedFile(?fileID, ?parentFile, ?activeState, ?siblist, ?info) &*& valid_id(s);\r\n \t /*@ ensures DedicatedFile(fileID, parentFile, activeState, ?newSibList, info)\r\n \t \t\t&*& newSibList == (length(siblist) < MAX_SIBLINGS ? append(siblist, cons(s, nil)) : siblist)\r\n \t \t\t&*& length(siblist) < MAX_SIBLINGS ? mem(s, newSibList) == true : true; @*/\r\n \t{\r\n\t\t\r\n\t\t////@ open DedicatedFile(fileID, parentFile, activeState, siblist, info); // auto\r\n\t\t////@ open MasterFile(fileID, parentFile, activeState, siblist, ?info2); // auto\r\n\t\tsuper.addSibling(s);\r\n\t\t////@ close MasterFile(fileID, parentFile, activeState, (length(siblist) < MAX_SIBLINGS ? append(siblist, cons(s, nil)) : siblist), info2); // auto\r\n\t\t////@ close DedicatedFile(fileID, parentFile, activeState, (length(siblist) < MAX_SIBLINGS ? append(siblist, cons(s, nil)) : siblist), info);\r\n\t}", "private void addChild(Content child) {\n/* 238 */ this.tail.setNext(this.document, child);\n/* 239 */ this.tail = child;\n/* */ }", "public static void insurePathToFileExists(File f) {\r\n File p = f.getParentFile();\r\n //System.out.println(\"uu.iPE: parent of \"+filename+\" is \"+parent);\r\n\r\n if (!p.exists()) {\r\n // parent doesn't exist, create it:\r\n if (!p.mkdirs()) {\r\n throw new IllegalStateException(\"Unable to make directory \" + p.getPath());\r\n } // endif -- second mkdir unsuc\r\n } // endif -- parent exists\r\n }", "public void add(File toAdd, boolean alsoRemove)\n \tthrows Exception {\n \t\tValidate.notNull(toAdd, \"File toAdd must not be null!\");\n \t\t\n \t\tfinal File root = db.getWorkDir();\n \t\tfinal String toAddCanon = toAdd.getCanonicalPath();\n \t\tfinal String rootCanon = root.getCanonicalPath();\n \t\t\n \t\tValidate.isTrue(toAddCanon.startsWith(rootCanon),\n \t\t\t\t\"File toAdd must be within repository {0} but is {1}!\", root, toAdd);\n \n \t\tfinal ObjectWriter ow = new ObjectWriter(db);\n \t\tfinal DirCache dc = DirCache.lock(db);\n \t\tfinal DirCacheBuilder edit = dc.builder();\n \t\tfinal TreeWalk tw = new TreeWalk(db);\n \t\ttw.reset();\n \t\tif (toAddCanon.equals(rootCanon))\n \t\t\ttw.setFilter(TreeFilter.ALL);\n \t\telse\n \t\t\ttw.setFilter(PathFilter.create(toAddCanon.substring(\n \t\t\t\t\trootCanon.length() + 1).replace('\\\\', '/')));\n \t\ttw.addTree(new DirCacheBuildIterator(edit));\n \t\ttw.addTree(new FileTreeIterator(root));\n \t\twhile (tw.next()) {\n \t\t\tfinal DirCacheBuildIterator i;\n \t\t\tfinal FileTreeIterator d;\n \t\t\tfinal DirCacheEntry e;\n \t\t\t\n \t\t\tif (tw.getRawMode(0) == 0) {\n \t\t\t\t// Entry doesn't yet exist in the index. If its an ignored\n \t\t\t\t// path name, skip over the entry.\n \t\t\t\t//\n \t\t\t\tfinal File f = new File(root, tw.getPathString());\n \t\t\t\tif (ignores.isIgnored(f))\n \t\t\t\t\tcontinue;\n \t\t\t}\n \n \t\t\tif (tw.isSubtree()) {\n \t\t\t\t// The index doesn't allow trees directly, we need to\n \t\t\t\t// recurse and process only leaf nodes.\n \t\t\t\t//\n \t\t\t\ttw.enterSubtree();\n \t\t\t\tcontinue;\n \t\t\t}\n \n \t\t\ti = tw.getTree(0, DirCacheBuildIterator.class);\n \t\t\td = tw.getTree(1, FileTreeIterator.class);\n \n \t\t\tif (tw.getRawMode(0) == 0) {\n \t\t\t\te = new DirCacheEntry(tw.getRawPath());\n \t\t\t\tedit.add(e);\n \n \t\t\t} else if (tw.getRawMode(1) == 0) {\n \t\t\t\t// Entry is no longer in the directory, but is still in the\n \t\t\t\t// index. If we aren't supposed to process removals, keep\n \t\t\t\t// the entry in the cache.\n \t\t\t\t//\n \t\t\t\tif (!alsoRemove)\n \t\t\t\t\tedit.add(i.getDirCacheEntry());\n \t\t\t\tcontinue;\n \n \t\t\t} else if (FileMode.SYMLINK.equals(tw.getFileMode(0))) {\n \t\t\t\t// Entry exists as a symlink. We can't process that in Java.\n \t\t\t\t//\n \t\t\t\tedit.add(i.getDirCacheEntry());\n \t\t\t\tcontinue;\n \n \t\t\t} else {\n \t\t\t\te = i.getDirCacheEntry();\n \t\t\t\tedit.add(e);\n \t\t\t}\n \n \t\t\tfinal FileMode mode = d.getEntryFileMode();\n \t\t\tif (FileMode.GITLINK.equals(mode)) {\n \t\t\t\t// TODO: FileTreeIterator doesn't implement objectId right\n \t\t\t\t// for a GITLINK yet.\n \t\t\t\t//\n \t\t\t\te.setLength(0);\n \t\t\t\te.setLastModified(0);\n \t\t\t\te.setObjectId(d.getEntryObjectId());\n \n \t\t\t} else if (e.getLength() != d.getEntryLength()\n \t\t\t\t\t|| !timestampMatches(e, d)) {\n \t\t\t\tfinal File f = new File(root, tw.getPathString());\n \t\t\t\te.setLength((int) d.getEntryLength());\n \t\t\t\te.setLastModified(d.getEntryLastModified());\n \t\t\t\te.setObjectId(ow.writeBlob(f));\n \t\t\t}\n \t\t\te.setFileMode(mode);\n \t\t}\n \t\tif (!edit.commit())\n \t\t\tthrow new IOException(\"Can't update index\");\n \t}", "public void add(File file) throws IOException {\n File realFile = new File(Main.CWD, file.getName());\n File rmStage = new File(REMOVAL, file.getName());\n if (rmStage.exists()) {\n rmStage.delete();\n }\n if (realFile.exists()) {\n if (curAndCWDIdentical(file, realFile)) {\n File stagingFile = new File(INDEX, file.getName());\n if (stagingFile.exists()) {\n stagingFile.delete();\n }\n } else {\n File resultingFile = new File(INDEX, file.getName());\n if (!resultingFile.exists()) {\n resultingFile.createNewFile();\n }\n String content = Utils.readContentsAsString(realFile);\n Utils.writeContents(resultingFile, content);\n }\n }\n }", "@Test\n public void testFileInDirectoryFileExists() {\n\n File file1 = new File(\"file1\");\n parent.storeFile(file1);\n assertTrue(parent.fileInDirectory(\"file1\"));\n }", "public void addChild(XMLElement child)\n/* */ {\n/* 398 */ if (child == null) {\n/* 399 */ throw new IllegalArgumentException(\"child must not be null\");\n/* */ }\n/* 401 */ if ((child.getLocalName() == null) && (!this.children.isEmpty())) {\n/* 402 */ XMLElement lastChild = (XMLElement)this.children.lastElement();\n/* */ \n/* 404 */ if (lastChild.getLocalName() == null) {\n/* 405 */ lastChild.setContent(lastChild.getContent() + \n/* 406 */ child.getContent());\n/* 407 */ return;\n/* */ }\n/* */ }\n/* 410 */ child.parent = this;\n/* 411 */ this.children.addElement(child);\n/* */ }", "public void addUniqueFileIdentifier( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), UNIQUEFILEIDENTIFIER, value);\r\n\t}", "@Override\n protected NodeInfo createDirectoryEntry(NodeInfo parentEntry, Path dir) throws IOException {\n return drive.createFolder(parentEntry.getId(), toFilenameString(dir));\n }", "public static boolean createRootFile(String parentPath, String name) {\n File dir = new File(parentPath + File.separator + name);\n\n if (dir.exists())\n return false;\n\n try {\n if (!readReadWriteFile())\n RootTools.remount(parentPath, \"rw\");\n\n execute(\"touch \" + getCommandLineString(dir.getAbsolutePath()));\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "private void createFileHierarchie() throws IOException {\r\n\t\tlog.debug(\"START: SBIWebServer.createFileHierarchie\");\r\n\t\t// Create logs directory if not exist\r\n\t\tPath logPath = Paths.get(DEFAULT_LOG_LOCATION);\r\n\t\tif (!Files.exists(logPath)) {\r\n\t\t\tFiles.createDirectory(Paths.get(DEFAULT_LOG_LOCATION));\r\n\t\t\tlog.debug(\"Directory \"+DEFAULT_LOG_LOCATION+\" created\");\r\n\t\t}else {\r\n\t\t\tlog.debug(\"Directory \"+DEFAULT_LOG_LOCATION+\" already exists\");\r\n\t\t}\r\n\t\t\r\n\t\t// Create default server.xml\r\n\t\tPath serverConfigPath = Paths.get(CONFIG_SERVER_LOCATION);\r\n\t\tif (!Files.exists(serverConfigPath)) {\r\n\t\t\tXmlServerConfig xml = ConfigurationFactory.createDefaultXmlServerConfig();\r\n\t\t\ttry {\r\n\t\t\t\tXmlHelper.storeXml(xml, new File(CONFIG_SERVER_LOCATION));\r\n\t\t\t\tlog.debug(\"File \"+CONFIG_SERVER_LOCATION+\" created\");\r\n\t\t\t} catch (JAXBException e) {\r\n\t\t\t\tlog.error(\"Cannot store \"+CONFIG_SERVER_LOCATION,e);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tlog.debug(\"File \"+CONFIG_SERVER_LOCATION+\" already exists\");\r\n\t\t}\r\n\t\tlog.debug(\"END: SBIWebServer.createFileHierarchie\");\r\n\t}", "public void addNodeInto(MutableTreeNode newChild, MutableTreeNode parent) {\n int index = parent.getChildCount();\n if (newChild != null && newChild.getParent() == parent) {\n index -= 1;\n }\n insertNodeInto(newChild, parent, index);\n }", "@Override\n public void childAdded(Node child) {\n }", "@Override\n\tpublic void addChild(Node node) {\n\t\t\n\t}", "@Test\n public void testHasFileTrue() {\n FileTree myTree = new FileTree();\n String file = \"file1\";\n try {\n myTree.makeFile(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertTrue(myTree.hasFile(file));\n }", "private static void createTree(TreeItem<FilePath> rootItem) throws IOException {\n\n try (DirectoryStream<Path> directoryStream = Files\n .newDirectoryStream(rootItem.getValue().getPath())) {\n\n for (Path path : directoryStream) {\n TreeItem<FilePath> newItem = new TreeItem<FilePath>(new FilePath(path));\n newItem.setExpanded(true);\n\n rootItem.getChildren().add(newItem);\n\n if (Files.isDirectory(path)) {\n createTree(newItem);\n }\n }\n } catch (AccessDeniedException ignored) {\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public static void createNode (PsiDirectory parentDirectory, VNode vNode) throws IOException {\r\n\t\tString name = mungeNamespace(vNode.getName());\r\n\t\tPsiDirectory contentDirectory = parentDirectory.createSubdirectory(name);\r\n\t\tPsiFile contentFile = contentDirectory.createFile(\".content.xml\");\r\n\t\twriteNodeContent(contentFile, vNode);\r\n\t}", "public void touchOne(File inFile)\n {\n mFiles.add(inFile);\n }", "public static void add(String parent, String child, node tree){\n\t\ttree = names.get(parent);\r\n\t\tnode tmp = new node(child);\r\n\t\tnames.put(child, tmp);\t\r\n\t\ttree.children.add(tmp);\r\n\t}", "@Test\n public void testMakeFileFileExists() {\n FileTree myTree = new FileTree();\n String file = \"file1\";\n boolean result = false;\n try {\n myTree.makeFile(file);\n myTree.makeFile(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n result = true;\n }\n assertTrue(result);\n\n }", "public void addRecursively(File aResourceFile) {\n\t\tif (!aResourceFile.exists()) {\n\t\t\tignoredReferences.put(aResourceFile.getPath(), \"does not exists\");\n\t\t\treturn;\n\t\t}\n\t\tif (!aResourceFile.isDirectory()) {\n\t\t\taddFile(aResourceFile);\n\t\t\treturn;\n\t\t}\n\t\tfor (File tempFile : aResourceFile.listFiles()) {\n\t\t\taddRecursively(tempFile);\n\t\t}\n\t}", "@NonNull\n\t\tBuilder addFile(@NonNull Path path);", "@Override\n public synchronized boolean create(Path file)\n {\n File f = file.toFile(root);\n if (file.isRoot()) {\n return false;\n }\n File parent = file.parent().toFile(root);\n parent.mkdirs();\n\n try {\n return f.createNewFile();\n } catch (IOException e) {\n \te.printStackTrace();\n return false;\n }\n }", "public void addFileType( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), FILETYPE, value);\r\n\t}", "@Override\r\n protected void addPath(File path, int depth) throws SAXException {\r\n List<ZipEntry> contents = new ArrayList<ZipEntry>();\r\n if (depth > 0) {\r\n ZipFile zipfile = null;\r\n try {\r\n zipfile = new ZipFile(path, Charset.forName(\"UTF-8\"));\r\n Enumeration<? extends ZipEntry> entries = zipfile.entries();\r\n while (entries.hasMoreElements()) contents.add((ZipEntry)entries.nextElement());\r\n } catch (ZipException e) {\r\n throw new SAXException(e);\r\n } catch (IOException e) {\r\n throw new SAXException(e);\r\n } finally {\r\n if (zipfile != null) {\r\n try {\r\n zipfile.close();\r\n } catch (IOException e) {\r\n }\r\n }\r\n } // finally\r\n } // if depth > 0\r\n startNode(DIR_NODE_NAME, path);\r\n processZipEntries(contents, \"\", depth);\r\n endNode(DIR_NODE_NAME);\r\n }", "TreeNode addChild(TreeNode node);", "public void add(Directory subDir) {\n\t\tthis.content.add(subDir);\n\t\tif(subDir.getParent() != null) {\n\t\t\tsubDir.getParent().content.remove(subDir);\n\t\t}\n\t\tsubDir.setParent(this);\n\t}", "@NonNull\n\t\tBuilder addFile(@NonNull String path);", "public void addChild(Node child){\n children.add(child);\n }", "protected void append_child(AstNode child) throws Exception {\r\n\t\tif (child == null)\r\n\t\t\tthrow new IllegalArgumentException(\"Invalid child: null\");\r\n\t\telse {\r\n\t\t\tif (child instanceof AstNodeImpl)\r\n\t\t\t\t((AstNodeImpl) child).set_parent(this);\r\n\t\t\tthis.children.add(child);\r\n\t\t\tthis.update_location(); /* automatically update */\r\n\t\t}\r\n\t}", "public void create(int temp) {\n\n directory newFile = new directory();\n newFile.a = temp;\n\n directory FilePtr;\n\n\n if (root == null) {\n root = newFile;\n root.forward = null;\n root.back = null;\n return;\n }\n\n FilePtr = root;\n\n while (FilePtr.forward != null) {\n FilePtr = FilePtr.forward;\n }\n FilePtr.forward = newFile;\n FilePtr = FilePtr.forward;\n FilePtr.forward = null;\n\n return;\n\n }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameChildDirForbidden() throws Exception {\n assumeRenameSupported();\n\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path childFile = new Path(parentdir, \"childfile\");\n createFile(childFile);\n //verify one level down\n Path childdir = new Path(parentdir, \"childdir\");\n rename(parentdir, childdir, false, true, false);\n //now another level\n fs.mkdirs(childdir);\n Path childchilddir = new Path(childdir, \"childdir\");\n rename(parentdir, childchilddir, false, true, false);\n }", "public edu.umich.icpsr.ddi.FileTypeType addNewFileType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTypeType target = null;\n target = (edu.umich.icpsr.ddi.FileTypeType)get_store().add_element_user(FILETYPE$8);\n return target;\n }\n }", "public void addSiblingAfterNode(Node siblingNode, String nodeToAdd) throws Exception {\n if (siblingNode == null || nodeToAdd == null)\n return;\n if (fileContents == null) {\n fileContents = convertFileToStringArray(m_file);\n }\n\n Integer endTagLineNumber = getEndTagLineNumber(siblingNode);\n\n String endLine = fileContents[endTagLineNumber - 1];\n String newLine = endLine + getIndentation(siblingNode) + nodeToAdd + FILE_NEW_LINE;\n if (bDebug) {\n System.out.println(\"Old line: \" + endLine);\n System.out.println(\"New line: \" + newLine);\n }\n fileContents[endTagLineNumber - 1] = newLine;\n\n }", "public String addFile(String fn)\n\t{\n\t\tString intfn= sysdir + File.separator + fn;\n\t\tsynchronized( syncFiles ) // get Intermediate-Data access for the key \n\t\t{\n\t\t\twhile( syncFileswait )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsyncFiles.wait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tsyncFileswait= true;\n\t\t\t\n\t\t\tfiles.put(fn, intfn);\n\t\t\t\n\t\t\tsyncFileswait= false;\n\t\t\tsyncFiles.notifyAll();\n\t\t}\n\t\t\n\t\treturn intfn;\n\t}", "private void updateToFile(PQNode node) throws Exception{\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n int replaceIndex = node.getPqIndex()-bufStart;\n\n nodes.set(replaceIndex,node);\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n storeToFile(file,nodes, false);\n }", "public void createGroup() {\n\t\tString name = JOptionPane\n\t\t\t\t.showInputDialog(\"Please Enter a new group name:\");\n\t\tif (name.equals(\"\"))\n\t\t\treturn;\n\n\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent();\n\t\tEllowFile pfile = (EllowFile) node.getUserObject(), file;\n\t\tif (pfile.isDirectory()) {\n\t\t\tfile = new EllowFile(pfile.getAbsolutePath() + \"\\\\\\\\\" + name);\n\t\t\tfile.mkdirs();\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t} else {\n\t\t\tfile = new EllowFile(pfile.getParent() + \"\\\\\\\\\" + name);\n\t\t\tfile.mkdirs();\n\t\t\tnode = ((DefaultMutableTreeNode) node.getParent());\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\n\t\t\tnode.getChildCount());\n\t\t}\n\t\tfile.parentProject = pfile.parentProject;\n\t\tpfile.parentProject.rebuild();\n\t\tmodel.nodeChanged(root);\n\t}", "private void insertChild(K key, Node child) {\r\n\r\n // binary search for correct index\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int child_indexing;\r\n\r\n // to check if the key is already in there and get the correct index after using collections.binarySearch\r\n if (correct_place >= 0) {\r\n child_indexing = correct_place + 1;\r\n } else {\r\n child_indexing = -correct_place - 1;\r\n }\r\n\r\n if (correct_place >= 0) {\r\n keys.add(child_indexing, key);\r\n children.add(child_indexing, child);\r\n } else {\r\n keys.add(child_indexing, key);\r\n children.add(child_indexing + 1, child);\r\n }\r\n }", "public void addChild(Node node){\n children.add(node);\n \n }", "void appendChild(Object child);", "public edu.umich.icpsr.ddi.FileContType addNewFileCont()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileContType target = null;\n target = (edu.umich.icpsr.ddi.FileContType)get_store().add_element_user(FILECONT$2);\n return target;\n }\n }", "private FSDataOutputStream createNewFile() throws Exception {\n\t\tlogger.traceEntry();\n\t\tPath newFile = new Path(rootDirectory, \"dim_\" + System.currentTimeMillis() + \".json\");\n\t\tlogger.debug(\"Creating file \" + newFile.getName());\n\t\tFSDataOutputStream dataOutputStream = null;\n\n\t\tif (!hadoopFileSystem.exists(newFile)) {\n\t\t\tdataOutputStream = hadoopFileSystem.create(newFile);\n\t\t} else {\n\t\t\tdataOutputStream = hadoopFileSystem.append(newFile);\n\t\t}\n\n\t\tdataOutputStreams.clear();\n\t\tdataOutputStreams.add(dataOutputStream);\n\t\tlogger.traceExit();\n\t\treturn dataOutputStream;\n\t}", "public void addChild(WSLNode node) {children.addElement(node);}", "public void addFile(Path inputFile) throws IOException {\n\t\taddFile(inputFile, this.index);\n\t}", "@Override\n\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n\t\t\t\tPath resolve = target.resolve(source.relativize(dir));\n\t\t\t\tFile resolve_file = resolve.toFile();\n\n\t\t\t\tif (resolve_file.exists() == false) {\n\t\t\t\t\tFiles.createDirectory(resolve);\n\t\t\t\t} else {\n\t\t\t\t\t// delete old data in sub-directories\n\t\t\t\t\t// without deleting the directory\n\t\t\t\t\tArrays.asList(resolve_file.listFiles()).forEach(File::delete);\n\t\t\t\t}\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}", "public void addNodeToLastInsertedNode(Node node, int level) throws NoPreviousInsertedNodeException, LevelException {\n\t\tNode currentNode = this.lastInsertedNodes.get(level - 1);\n\n\t\tif(currentNode == null)\n\t\t\tthrow new NullPointerException(\"NoPreviousInsertedNodeException\");\n\n\t\tif (!(currentNode instanceof Folder)){\n\t\t\tthrow new NullPointerException(\"Last inserted is not a folder\");\n\t\t}\n\n\t\t//Update the swing view first because it will send the needed exceptions\n\t\tesv.addNodeToLastInsertedNode(node, level);\n\n\t\t//Update internal representation of tree\n\t\tFolder parent = (Folder)currentNode;\n\t\tparent.addChild(node);\n\t\tnode.setParent(parent);\n\n\t\t//Update lastInserted HashMap\n\t\tthis.lastInsertedNodes.put(level, node);\n\t}", "public void add(File file) {\n\t\tfiles.add(file);\n\t}", "private void uploadLocalDocument(){\t\t\n\t\tif(getFileChooser(JFileChooser.FILES_ONLY).showOpenDialog(this)==JFileChooser.APPROVE_OPTION){\n\t\t\tNode node = null;\n\t\t\ttry {\n\t\t\t\tnode = alfrescoDocumentClient.addFileFromParent(getTreeSelectedAlfrescoKey(), getFileChooser().getSelectedFile());\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\t\n\t\t\t//Node node = alfrescoManager.addFileFromParent(getTreeSelectedAlfrescoKey(), getFileChooser().getSelectedFile());\t\t\n\t\t\tif(node!=null){\n\t\t\t\tgetDynamicTreePanel().getChildFiles(getTreeSelectedDefaultMutableNode());\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"El documento se ha subido correctamente.\");\n\t\t\t}\n\t\t\telse\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Error al subir el documento.\");\n\t\t}\n\t\t//el boton solo esta activo si un directorio esta seleccionado en el arbol directorios\n\t\t//se abre un filechooser y se elije un documento\n\t\t//solo se sube a alfresco, no se asocia automaticamente\n\t\t//se enviara la instancia de File() con el fichero seleccionado\n\t\t//se crea el fichero en alfresco, se recupera el nodo y se añade a la tabla actual (se hace de nuevo la peticion a getChildFiles())\n\t}", "private static void checkHistoryDirectory()\n throws FileNotFoundException {\n Path path = Paths.get(HISTORY_FILE_PATH); //creates Path instance\n try {\n Files.createDirectories(Paths.get(DIRECTORY));\n Files.createFile(path); //creates file at specified location\n } catch (IOException e) {\n readHistoryData();\n }\n }", "public void addPath(File path) throws IllegalArgumentException {\r\n File[] PathFiles;\r\n if (path.isDirectory() == true) {\r\n \tPathFiles = path.listFiles();\r\n for (int i=0; i<PathFiles.length; i++) {\r\n \tFile currentfile = PathFiles[i];\r\n if (currentfile.isDirectory()) {\r\n \tdirectory_queue.enqueue(currentfile);\r\n \taddPath(currentfile);\r\n }\r\n }\r\n } else {\r\n throw new IllegalArgumentException(\"Can't resolve the directory path \" + path);\r\n }\r\n }", "private void clickCreateChildModel(FMEditor fmEditor, VMFile file) {\n ClickHandler clickHandler = new ClickHandler() {\n\n @Override\n public void onClick(MenuItemClickEvent event) {\n List<DrawRect> drawRects = fmEditor.nodeManager.getSelectDrawRect();\n FMDrawNode drawNode = fmEditor.getDrawRectMap().get(drawRects.get(0).hashCode());\n FMNode node = drawNode.getFmNode();\n\n editResourceService.getDirId(file.getId(), new AsyncCallback<Long>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(Long dirID) {\n VMFile childModelFile = new VMFile();\n childModelFile.setExtension(Extension.FM);\n String fileName = file.getName() + \"_child\";\n\n editResourceService.getResources(dirID, new AsyncCallback<List<VMResource>>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(List<VMResource> result) {\n // check duplicate file name under same directory and set file name\n childModelFile.setName(checkDuplicateName(result, fileName, childModelFile.getExtension(), 0));\n ZGCreateFileCommand createFileCommand = new ZGCreateFileCommand(editResourceService, viewHandler, dirID, childModelFile, null);\n createFileCommand.addCommandListener(new CommandListener() {\n\n @Override\n public void undoEvent() {\n treeGrid.deselectAllRecords();\n fileTreeNodeFactory.removeVMResource(createFileCommand.getFileId());\n fileTreeNodeFactory.refresh(editorTabSet, tree, tabRegs);\n treeGrid.sort();\n treeGrid.redraw();\n }\n\n @Override\n public void redoEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n }\n\n @Override\n public void executeEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n // set node reference\n editResourceService.getFileContent(createFileCommand.getFileId(), new AsyncCallback<byte[]>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(byte[] result) {\n BinaryResourceImpl r = new BinaryResourceImpl();\n ByteArrayInputStream bi = new ByteArrayInputStream(result);\n EPackage.Registry.INSTANCE.put(FMPackage.eNS_URI, FMPackage.eINSTANCE);\n\n FMRoot root = null;\n try {\n r.load(bi, EditOptions.getDefaultLoadOptions());\n root = (FMRoot) r.getContents().get(0);\n } catch (IOException e) {\n SC.warn(e.getMessage());\n }\n String refFileName = childModelFile.getName() + \".\" + childModelFile.getExtensionStr();\n CompoundCommand cmd = FMEditorCommandProvider.getInstance().setReferenceNode(node, createFileCommand.getFileId(),\n root.getNode().getName(), refFileName, root.getId());\n fmEditor.getEditManager().execute(cmd.unwrap());\n drawNode.getDrawRect().setTitle(node.getName() + \":\" + node.getRefName() + \"\\n(\" + refFileName + \")\");\n\n selectRootNode(editorTabSet.getSelectedTab());\n }\n });\n }\n\n @Override\n public void bindEvent() {\n viewHandler.clear();\n registerRightClickEvent();\n }\n });\n CompoundCommand c = new CompoundCommand();\n c.append(createFileCommand);\n manager.execute(c.unwrap());\n }\n });\n }\n });\n }\n };\n fmEditor.addCreateChildModelHandler(clickHandler);\n }", "public void testPathWithSpace () throws Throwable {\n final Path base = selected.resolve(getName());\n try {\n Files.createDirectory(base);\n\n final Path file1 = base.resolve(\" file1\");\n Files.createFile(file1);\n assertTrue(Files.isRegularFile(file1));\n\n final Path file2 = base.resolve(\"file2 \");\n Files.createFile(file2);\n assertTrue(Files.isRegularFile(file2));\n\n final Path file3 = base.resolve(\" file3 \");\n Files.createFile(file3);\n assertTrue(Files.isRegularFile(file3));\n }\n finally {\n Files.walkFileTree(base, Utils.DELETE_FILE_VISITOR);\n }\n }", "public void addChild(BTreeNode<E> newChild) {\n\t\tint index = 0;\n\t\tfor (BTreeNode<E> node : children) {\n\t\t\tif (node == null || cmp.compare(newChild.getData(0), node.data.get(0)) > 0) {\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t\tchildren.add(index, newChild);\n\t\tnewChild.parent = this;\n\t}", "public void createFile(String ext) throws IOException {\n\t\tString name = JOptionPane\n\t\t\t\t.showInputDialog(\"Please Enter a new file name:\");\n\t\tif (name == null)\n\t\t\treturn;\n\n\t\t// get the current selected node and the file attached to it\n\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent();\n\t\tEllowFile pfile = (EllowFile) node.getUserObject();\n\t\tEllowFile file;\n\n\t\tif (pfile.isDirectory()) {\n\t\t\tfile = new EllowFile(pfile.getAbsolutePath() + \"\\\\\\\\\" + name + \".\"\n\t\t\t\t\t+ ext);\n\t\t\tfile.createNewFile();\n\t\t\tfile.parentProject = pfile.parentProject;\n\t\t\t// use insert node instead of add to update the tree without\n\t\t\t// reloading it, which cause the tree to be reset\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t} else {\n\t\t\tfile = new EllowFile(pfile.getParent() + \"\\\\\\\\\" + name + \".\" + ext);\n\t\t\tfile.createNewFile();\n\t\t\tfile.parentProject = pfile.parentProject;\n\t\t\tnode = ((DefaultMutableTreeNode) node.getParent());\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t}\n\t\t// save the project to the file, and the file to the project, for later\n\t\t// reference\n\t\tpfile.parentProject.rebuild();\n\t\tmodel.nodeChanged(root);\n\n\t\t/*\n\t\t * if (ext.equals(ProjectDefault.EXT_NOTE))\n\t\t * desktopPane.createFrameNote(file);\n\t\t */\n\t\tdesktopPane.openFile(file);\n\t}", "private void createNode() throws Exception {\n try {\n _curator.create().creatingParentsIfNeeded().forPath(_zkPath, new byte[0]);\n } catch (KeeperException.NodeExistsException e) {\n // Don't care\n }\n }", "public void insertOtherNode(String key,String value) {\n Log.v(\"insert\", value);\n String filename = key;\n String string = value;\n String hashedKey=\"\";\n Log.v(\"Created \" + hashedKey, \"with value \" + string + \"Before hash \" + filename);\n FileOutputStream outputStream;\n try {//Context.MODE_PRIVATE\n System.out.println(filename);\n System.out.println(context);\n outputStream = context.openFileOutput(filename, Context.MODE_PRIVATE);\n outputStream.write(string.getBytes());\n outputStream.flush();\n outputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n Log.e(TAG, \"File write failed\");\n }\n\n\n }", "@Override\n\tpublic FileModel add(FileModel c) {\n\t\treturn fm.save(c);\n\t}", "public boolean addChild(INode node) {\r\n final int low = searchChildren(node.getLocalNameBytes());\r\n if (low >= 0) {\r\n return false;\r\n }\r\n addChild(node, low);\r\n return true;\r\n }", "@Test\n public void testHasDirectory() {\n FileTree myTree = new FileTree();\n String[] file = {\"file1\"};\n try {\n myTree.mkdir(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertTrue(myTree.hasDirectory(\"file1\"));\n }", "void insertChild(K key, Node child) {\r\n\t\t\tint loc = Collections.binarySearch(keys, key);\r\n\t\t\tint childIndex = loc >= 0 ? loc + 1 : -loc - 1;\r\n\t\t\tif (loc >= 0) {\r\n\t\t\t\tchildren.set(childIndex, child);\r\n\t\t\t} else {\r\n\t\t\t\tkeys.add(childIndex, key);\r\n\t\t\t\tchildren.add(childIndex + 1, child);\r\n\t\t\t}\r\n\t\t}", "public void addNode(Node node){subNodes.add(node);}", "public void addFile(final String file);", "public void addFile(FileDiffFile file) {\n \t\tfiles.add(file);\n \t}", "public void add(Node<E> child) {\n this.children.add(child);\n }", "public void insertChild(XMLElement child, int index)\n/* */ {\n/* 422 */ if (child == null) {\n/* 423 */ throw new IllegalArgumentException(\"child must not be null\");\n/* */ }\n/* 425 */ if ((child.getLocalName() == null) && (!this.children.isEmpty())) {\n/* 426 */ XMLElement lastChild = (XMLElement)this.children.lastElement();\n/* 427 */ if (lastChild.getLocalName() == null) {\n/* 428 */ lastChild.setContent(lastChild.getContent() + \n/* 429 */ child.getContent());\n/* 430 */ return;\n/* */ }\n/* */ }\n/* 433 */ child.parent = this;\n/* 434 */ this.children.insertElementAt(child, index);\n/* */ }", "public static void touch(File f) throws IOException {\n if(f.exists())\n return;\n \n File parent = f.getParentFile();\n if(parent != null)\n parent.mkdirs();\n\n try {\n f.createNewFile();\n } catch(IOException failed) {\n // Okay, createNewFile failed. Let's try the old way.\n FileOutputStream fos = null;\n try {\n fos = new FileOutputStream(f);\n } catch(IOException ioe) {\n ioe.initCause(failed);\n throw ioe;\n } finally {\n if(fos != null) {\n try {\n fos.close();\n } catch(IOException ignored) {}\n }\n }\n }\n }", "public static int link(String existingFilepath, String newFilepath) throws Exception {\n\n // Find index node for the already existing file path, new file will have the same index node number.\n IndexNode indexNode = new IndexNode();\n short indexNodeNumber = findIndexNode(existingFilepath, indexNode);\n\n // File following existing filepath doesn't exist\n if (indexNodeNumber == -1) {\n process.errno = ENOENT;\n return -1;\n }\n\n // Cannot create a hard link to the directory\n if ((indexNode.getMode() & S_IFMT) == S_IFDIR) {\n process.errno = EISDIR;\n return -1;\n }\n\n return createDirectoryEntryWithIndexNodeNumber(newFilepath, indexNodeNumber, indexNode.getNlink() + 1);\n }" ]
[ "0.71449137", "0.70891213", "0.70224065", "0.67290884", "0.66561943", "0.6561695", "0.6555385", "0.6372927", "0.6359078", "0.62846464", "0.6238431", "0.62292445", "0.61485404", "0.61215186", "0.6051992", "0.60272884", "0.5971541", "0.596792", "0.5967294", "0.59532684", "0.59510034", "0.5886831", "0.5857267", "0.58425385", "0.5823981", "0.5775774", "0.5763125", "0.57550097", "0.57399005", "0.57384264", "0.5728209", "0.5724748", "0.57210904", "0.5662821", "0.56045896", "0.55977327", "0.5577872", "0.55729395", "0.5563841", "0.5540238", "0.550718", "0.54998714", "0.5497752", "0.5488991", "0.54846317", "0.54820037", "0.5467007", "0.546313", "0.5456745", "0.5443734", "0.5439254", "0.5436789", "0.54357857", "0.5430769", "0.5425621", "0.54242116", "0.53911763", "0.53884774", "0.53873825", "0.538222", "0.53805125", "0.53723323", "0.53667283", "0.5348814", "0.534725", "0.53463703", "0.5345736", "0.53416187", "0.53230476", "0.53020465", "0.52969354", "0.52843595", "0.52792627", "0.5279126", "0.52705866", "0.52621955", "0.52514744", "0.52501756", "0.5246923", "0.5242656", "0.5239992", "0.52369493", "0.5236284", "0.5226729", "0.52073413", "0.52043885", "0.51992995", "0.5188972", "0.5184608", "0.5184384", "0.51841927", "0.51820827", "0.51807415", "0.51802236", "0.5178848", "0.5175997", "0.5165403", "0.51650655", "0.5161771", "0.5157911" ]
0.5425552
55
Add new directory child node to current directory Throw exception if already exists
public void mkdir(String name) throws FileExistsException { checkMakeFile(name); FileElement add = new FileElement(name, true); fileSystem.addChild(currentFileElement, add); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addChild(DirectoryNode node) throws FullDirectoryException, NotADirectoryException {\n if(isFile)\n throw new NotADirectoryException(\"Error: This node is a file\");\n if(left != null && middle != null && right != null)\n throw new FullDirectoryException(\"This directory is full\");\n if(left == null)\n left = node;\n else if(middle == null)\n middle = node;\n else if(right == null)\n right = node;\n }", "public void addChild(IDirectory child) {\n children.add(child);\n }", "private void populateNewChildDirectory(DirectoryEntry newEntry) {\n try (ClusterStream stream = new ClusterStream(fileSystem,\n FileAccess.Write,\n newEntry.getFirstCluster(),\n 0xffffffff)) {\n // First is the self-referencing entry...\n DirectoryEntry selfEntry = new DirectoryEntry(newEntry);\n selfEntry.setName(FileName.SelfEntryName);\n selfEntry.writeTo(stream);\n // Second is a clone of our self entry (i.e. parent) - though dates\n // are odd...\n DirectoryEntry parentEntry = new DirectoryEntry(getSelfEntry());\n parentEntry.setName(FileName.ParentEntryName);\n parentEntry.setCreationTime(newEntry.getCreationTime());\n parentEntry.setLastWriteTime(newEntry.getLastWriteTime());\n parentEntry.writeTo(stream);\n } catch (IOException e) {\n throw new dotnet4j.io.IOException(e);\n }\n }", "private void addChild(final INode node, final int insertionPoint) {\r\n if (children == null) {\r\n children = new ArrayList<INode>(DEFAULT_FILES_PER_DIRECTORY);\r\n }\r\n node.setParent(this);\r\n children.add(-insertionPoint - 1, node);\r\n\r\n if (node.getGroupName() == null) {\r\n node.setGroup(getGroupName());\r\n }\r\n }", "@Test\r\n public void moveToDirWithSameName() {\r\n Dir sameName = new Dir(\"child\", \"/\");\r\n currentDirectory.addNewDirectory(sameName);\r\n command.executeCommand(\"/parent/child/\", \"/\", root, currentDirectory);\r\n currentDirectory = currentDirectory.getSubDirectoryByName(\"child\");\r\n // check child directory with file is in root\r\n assertTrue(currentDirectory.getFileByName(\"file\") != null);\r\n }", "private TreeItem<String> addNewItem(Path path) {\n TreeItem<String> mostCorrespondingParent = findMostCorrespondingParentFor(path);\n TreeItem<String> newChildTreeItem;\n if (buildPathForNode(mostCorrespondingParent) != null) {\n Path newChildPath;\n if (mostCorrespondingParent != rootNode) {\n Path mostCorrespondingParentPath = getNodeAbsolutePath(mostCorrespondingParent);\n newChildPath = extractChildPath(path, mostCorrespondingParentPath);\n } else {\n newChildPath = path;\n }\n newChildTreeItem = new TreeItem<>(newChildPath.toString(), new ImageView(FileTreeItem.FileType.FILE.getImage()));\n } else {\n newChildTreeItem = new TreeItem<>(path.toString(), new ImageView(FileTreeItem.FileType.FILE.getImage()));\n }\n mostCorrespondingParent.getChildren().add(newChildTreeItem);\n sortChildren(mostCorrespondingParent);\n return extractFileNameToLeaf(newChildTreeItem);\n }", "@Override\n protected NodeInfo createDirectoryEntry(NodeInfo parentEntry, Path dir) throws IOException {\n return drive.createFolder(parentEntry.getId(), toFilenameString(dir));\n }", "private void addFileToNode(DefaultMutableTreeNode node, FileInfo givenFile){\r\n\t\t//check that there are files in this folder\r\n\t\t// replace existing file if one is present with the same name\r\n\t\tif(!node.isLeaf()){\r\n\t\t\tFileInfo index = (FileInfo) node.getFirstChild();\r\n\t\t\t//look through all the files\r\n\t\t\twhile(index != null){\r\n\t\t\t\t//if it's already there\r\n\t\t\t\tif((index.toString()).equals(givenFile.toString())){\r\n\t\t\t\t\t//FileInfo temp = (FileInfo)index.getPreviousSibling();\r\n\t\t\t\t\t//remove the old file\t\r\n\t\t\t\t\tindex.removeFromParent();\r\n\t\t\t\t\t//index = temp;\r\n\t\t\t\t}\r\n\t\t\t\t//move on to the next index\r\n\t\t\t\tindex = (FileInfo) index.getNextSibling();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//add it to the node\r\n\t\tnode.add(givenFile);\r\n\t\tif(parentTree != null)\r\n\t\t\tparentTree.nodeStructureChanged(node);\r\n\t}", "public boolean addChild(INode node, final boolean setModTime,\r\n final Snapshot latest) throws NSQuotaExceededException {\r\n final int low = searchChildren(node.getLocalNameBytes());\r\n if (low >= 0) {\r\n return false;\r\n }\r\n\r\n if (isInLatestSnapshot(latest)) {\r\n return replaceSelf4INodeDirectoryWithSnapshot()\r\n .addChild(node, setModTime, latest);\r\n }\r\n addChild(node, low);\r\n if (setModTime) {\r\n // update modification time of the parent directory\r\n updateModificationTime(node.getModificationTime(), latest);\r\n }\r\n return true;\r\n }", "public void addChild(FileNode child) {\r\n child.setParent(this);\r\n children.add(child);\r\n childNum++;\r\n }", "@Override\n public boolean add(T parent, T child) {\n boolean result = false;\n if (this.root == null) {\n this.root = new Node<>(parent);\n this.root.add(new Node<>(child));\n result = true;\n this.modCount++;\n } else if (findBy(parent).isPresent()) {\n findBy(parent).get().add(new Node<>(child));\n result = true;\n this.modCount++;\n }\n return result;\n }", "private void addFolder(){\n }", "public void addDirectory(String name, IDirectory parent) {\r\n Directory newDir = new Directory(name, (Directory) parent);\r\n ((Directory) parent).addItem(newDir);\r\n }", "Directory createAsDirectory() {\n return getParentAsExistingDirectory().findOrCreateChildDirectory(name);\n }", "public void insertNewIntoDirectory(int position, FileSystem file) {\r\n\tList<FileSystem> list = this.getDir().getList(); \r\n\tlist.add(position, file);\r\n}", "public void newFolderButtonClicked() {\n TreePath[] paths = _fileSystemTree.getSelectionPaths();\r\n List selection = getSelectedFolders(paths);\r\n if (selection.size() > 1 || selection.size() == 0)\r\n return; // should never happen\r\n \r\n File parent = (File) selection.get(0);\r\n \r\n final ResourceBundle resourceBundle = FolderChooserResource.getResourceBundle(Locale.getDefault());\r\n String folderName = JOptionPane.showInputDialog(_folderChooser, resourceBundle.getString(\"FolderChooser.new.folderName\"),\r\n resourceBundle.getString(\"FolderChooser.new.title\"), JOptionPane.OK_CANCEL_OPTION | JOptionPane.QUESTION_MESSAGE);\r\n \r\n if (folderName != null) {\r\n File newFolder = new File(parent, folderName);\r\n boolean success = newFolder.mkdir();\r\n \r\n TreePath parentPath = paths[0];\r\n boolean isExpanded = _fileSystemTree.isExpanded(parentPath);\r\n if (!isExpanded) { // expand it first\r\n _fileSystemTree.expandPath(parentPath);\r\n }\r\n \r\n LazyMutableTreeNode parentTreeNode = (LazyMutableTreeNode) parentPath.getLastPathComponent();\r\n BasicFileSystemTreeNode child = BasicFileSystemTreeNode.createFileSystemTreeNode(newFolder, _folderChooser);\r\n // child.setParent(parentTreeNode);\r\n if (success) {\r\n parentTreeNode.clear();\r\n int insertIndex = _fileSystemTree.getModel().getIndexOfChild(parentTreeNode, child);\r\n if (insertIndex != -1) {\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).insertNodeInto(child, parentTreeNode, insertIndex);\r\n ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).nodeStructureChanged(parentTreeNode);\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).addPath(parentPath, insertIndex, child);\r\n }\r\n }\r\n TreePath newPath = parentPath.pathByAddingChild(child);\r\n _fileSystemTree.setSelectionPath(newPath);\r\n _fileSystemTree.scrollPathToVisible(newPath);\r\n }\r\n }", "abstract void addNewSourceDirectory(final File targetDirectory);", "public void add(Directory subDir) {\n\t\tthis.content.add(subDir);\n\t\tif(subDir.getParent() != null) {\n\t\t\tsubDir.getParent().content.remove(subDir);\n\t\t}\n\t\tsubDir.setParent(this);\n\t}", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameDirToSelf() throws Throwable {\n assumeRenameSupported();\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path child = new Path(parentdir, \"child\");\n createFile(child);\n\n rename(parentdir, parentdir, false, true, true);\n //verify the child is still there\n assertIsFile(child);\n }", "public abstract void addChild(Node node);", "public void addNodeInto(MutableTreeNode newChild, MutableTreeNode parent) {\n int index = parent.getChildCount();\n if (newChild != null && newChild.getParent() == parent) {\n index -= 1;\n }\n insertNodeInto(newChild, parent, index);\n }", "public void addSubdirectory(Directory newdir) {\n\t\tgetSubdirectories().add(newdir);\n\t}", "private void clickCreateDirOrFile(SubMenuItem item, TreeNode node, List<Long> refIdList) {\n String title = \"New \" + item.getFileName();\n String fileName = item.getFileName();\n String msg = \"Please enter the \" + fileName;\n if (!item.isDirectory()) {\n title += \" file\";\n msg += \" file name (.\" + item.getExtension() + \")\";\n } else {\n msg += \" name\";\n }\n SC.askforValue(title, msg, new ValueCallback() {\n @Override\n public void execute(String value) {\n TreeNode selectedNode = node;\n if (selectedNode == null) {\n selectedNode = treeGrid.getSelectedRecord();\n }\n\n if (value != null && !\"\".equals(value)) {\n VMDirectory targetDir = new VMDirectory();\n VMFile file = new VMFile();\n if (item.isDirectory) {\n targetDir.setName(value);\n } else {\n file.setExtension(Extension.getByCode(item.getExtension()));\n file.setName(value);\n }\n VMDirectory dir;\n if (tree.isEmpty()) {\n dir = new VMDirectory();\n dir.setId(rootId);\n } else if (!treeGrid.anySelected()) {\n dir = new VMDirectory();\n dir.setId(rootId);\n if (!checkSameName(tree.getChildren(tree.find(\"/\")), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n } else if (((FileTreeNode) selectedNode).getResource() instanceof VMFile) {\n TreeNode parentNode = tree.getParent(selectedNode);\n if (\"/\".equals(tree.getPath(parentNode))) {\n dir = new VMDirectory();\n dir.setId(rootId);\n if (!checkSameName(tree.getChildren(tree.find(\"/\")), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n } else {\n dir = (VMDirectory) ((FileTreeNode) parentNode).getResource();\n if (!checkSameName(tree.getChildren(parentNode), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n }\n\n } else {\n dir = (VMDirectory) ((FileTreeNode) selectedNode).getResource();\n if (!checkSameName(tree.getChildren(selectedNode), value, item.isDirectory, item.getExtension())) {\n SC.warn(\"This item already contains a child item with that name.\");\n return;\n }\n }\n if (item.isDirectory) {\n ZGCreateDirCommand createDirCommand = new ZGCreateDirCommand(editResourceService, viewHandler, dir.getId(), targetDir);\n createDirCommand.addCommandListener(new CommandListener() {\n\n @Override\n public void undoEvent() {\n treeGrid.deselectAllRecords();\n fileTreeNodeFactory.removeVMResource(createDirCommand.getFileId());\n fileTreeNodeFactory.refresh(editorTabSet, tree, tabRegs);\n treeGrid.sort();\n treeGrid.redraw();\n }\n\n @Override\n public void redoEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createDirCommand.getParentId()), createDirCommand.getDirectory(),\n createDirCommand.getFileId(), true);\n }\n\n @Override\n public void executeEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createDirCommand.getParentId()), createDirCommand.getDirectory(),\n createDirCommand.getFileId(), true);\n }\n\n @Override\n public void bindEvent() {\n viewHandler.clear();\n registerRightClickEvent();\n }\n\n });\n\n CompoundCommand c = new CompoundCommand();\n c.append(createDirCommand);\n manager.execute(c.unwrap());\n } else {\n List<Long> tmpRefIdlist = refIdList;\n if (tmpRefIdlist == null && selectedNode != null) {\n tmpRefIdlist = new ArrayList<Long>();\n tmpRefIdlist.add(((FileTreeNode) selectedNode).getResource().getId());\n\n }\n\n ZGCreateFileCommand createFileCommand = new ZGCreateFileCommand(editResourceService, viewHandler, dir.getId(), file, tmpRefIdlist);\n createFileCommand.addCommandListener(new CommandListener() {\n\n @Override\n public void undoEvent() {\n treeGrid.deselectAllRecords();\n fileTreeNodeFactory.removeVMResource(createFileCommand.getFileId());\n fileTreeNodeFactory.refresh(editorTabSet, tree, tabRegs);\n treeGrid.sort();\n treeGrid.redraw();\n }\n\n @Override\n public void redoEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n }\n\n @Override\n public void executeEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n }\n\n @Override\n public void bindEvent() {\n viewHandler.clear();\n registerRightClickEvent();\n }\n });\n CompoundCommand c = new CompoundCommand();\n c.append(createFileCommand);\n manager.execute(c.unwrap());\n }\n if (dir.getId() != rootId) {\n tree.openFolder(treeGrid.getSelectedRecord());\n }\n } else if (value != null) {\n SC.warn(\"<br>Name field is empty\");\n }\n\n }\n\n });\n }", "public void add(FileSystemEntry entry);", "protected void append_child(AstNode child) throws Exception {\r\n\t\tif (child == null)\r\n\t\t\tthrow new IllegalArgumentException(\"Invalid child: null\");\r\n\t\telse {\r\n\t\t\tif (child instanceof AstNodeImpl)\r\n\t\t\t\t((AstNodeImpl) child).set_parent(this);\r\n\t\t\tthis.children.add(child);\r\n\t\t\tthis.update_location(); /* automatically update */\r\n\t\t}\r\n\t}", "public String createDirectory(String parentID, String new_directory) throws CloudStorageNotEnoughSpace {\n File newFile = new File();\n newFile.setTitle(new_directory);\n newFile.setMimeType(\"application/vnd.google-apps.folder\");\n newFile.setParents(Arrays.asList(new ParentReference().setId(parentID)));\n\n try {\n File insertedFile = drive.files().insert(newFile).execute();\n return insertedFile.getId();\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n\n }", "void addFile(RebaseJavaFile jf)\n{\n if (file_nodes.contains(jf)) return;\n\n file_nodes.add(jf);\n jf.setRoot(this);\n}", "public void addChildAt(int index, FileNode child) {\r\n child.setParent(this);\r\n this.children.add(index, child);\r\n childNum++;\r\n }", "public static ASMTreeNode generateTreePath(ASMTreeNode parent, List<String> dirPath, ClassNode cn, DefaultTreeModel model) {\n\t\tASMTreeNode ret = null;\n\t\twhile (dirPath.size() > 0) {\n\t\t\tString section = dirPath.get(0);\n\t\t\tASMTreeNode node;\n\t\t\t// Create child if it doesn't exist.\n\t\t\tif ((node = parent.getChild(section)) == null) {\n\t\t\t\tASMTreeNode newDir = ret = new ASMTreeNode(section, dirPath.size() == 1 ? cn : null);\n\t\t\t\tparent.addChild(section, newDir);\n\t\t\t\tparent.add(newDir);\n\t\t\t\t// update model\n\t\t\t\tmodel.nodesWereInserted(parent, new int[] { parent.getIndex(newDir) });\n\t\t\t\tnode = newDir;\n\t\t\t}\n\t\t\tparent = node;\n\t\t\tdirPath.remove(0);\n\t\t}\n\t\treturn ret;\n\t}", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameChildDirForbidden() throws Exception {\n assumeRenameSupported();\n\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path childFile = new Path(parentdir, \"childfile\");\n createFile(childFile);\n //verify one level down\n Path childdir = new Path(parentdir, \"childdir\");\n rename(parentdir, childdir, false, true, false);\n //now another level\n fs.mkdirs(childdir);\n Path childchilddir = new Path(childdir, \"childdir\");\n rename(parentdir, childchilddir, false, true, false);\n }", "TreeNode addChild(TreeNode node);", "private void insertChild(K key, Node child) {\r\n\r\n // binary search for correct index\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int child_indexing;\r\n\r\n // to check if the key is already in there and get the correct index after using collections.binarySearch\r\n if (correct_place >= 0) {\r\n child_indexing = correct_place + 1;\r\n } else {\r\n child_indexing = -correct_place - 1;\r\n }\r\n\r\n if (correct_place >= 0) {\r\n keys.add(child_indexing, key);\r\n children.add(child_indexing, child);\r\n } else {\r\n keys.add(child_indexing, key);\r\n children.add(child_indexing + 1, child);\r\n }\r\n }", "public static void add(String parent, String child, node tree){\n\t\ttree = names.get(parent);\r\n\t\tnode tmp = new node(child);\r\n\t\tnames.put(child, tmp);\t\r\n\t\ttree.children.add(tmp);\r\n\t}", "private static void doCreateDir() {\n String newDir = \"new_dir\";\n boolean success = (new File(newDir)).mkdir();\n\n if (success) {\n System.out.println(\"Successfully created directory: \" + newDir);\n } else {\n System.out.println(\"Failed to create directory: \" + newDir);\n }\n\n // Create a directory; all non-existent ancestor directories are\n // automatically created.\n newDir = \"c:/export/home/jeffreyh/new_dir1/new_dir2/new_dir3\";\n success = (new File(newDir)).mkdirs();\n\n if (success) {\n System.out.println(\"Successfully created directory: \" + newDir);\n } else {\n System.out.println(\"Failed to create directory: \" + newDir);\n }\n\n }", "public String addDirectory(String dir)\n\t{\n\t\tString dirn= this.sysdir + File.separator + dir;\n\t\tFile f= new File(dirn);\n\t\tif( !f.exists() )\n\t\t\tf.mkdirs();\n\t\t\n\t\tsynchronized( syncFiles ) // get Intermediate-Data access for the key \n\t\t{\n\t\t\twhile( syncFileswait )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsyncFiles.wait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tsyncFileswait= true;\n\t\t\t\n\t\t\tfiles.put(dir, dirn);\n\t\t\t\n\t\t\tsyncFileswait= false;\n\t\t\tsyncFiles.notifyAll();\n\t\t}\n\t\t\n\t\treturn dirn;\n\t}", "public void addDirectory(FileDiffDirectory directory) {\n \t\tthis.directories.add(directory);\n \t}", "public void addFile(String name, IDirectory parent) {\r\n // Create a new file\r\n File newFile = new File(name, (Directory) parent);\r\n ((Directory) parent).addItem(newFile);\r\n }", "public void addChildFile(IFile child) {\n childFiles.add(child);\n }", "public void addNodeToLastInsertedNode(Node node, int level) throws NoPreviousInsertedNodeException, LevelException {\n\t\tNode currentNode = this.lastInsertedNodes.get(level - 1);\n\n\t\tif(currentNode == null)\n\t\t\tthrow new NullPointerException(\"NoPreviousInsertedNodeException\");\n\n\t\tif (!(currentNode instanceof Folder)){\n\t\t\tthrow new NullPointerException(\"Last inserted is not a folder\");\n\t\t}\n\n\t\t//Update the swing view first because it will send the needed exceptions\n\t\tesv.addNodeToLastInsertedNode(node, level);\n\n\t\t//Update internal representation of tree\n\t\tFolder parent = (Folder)currentNode;\n\t\tparent.addChild(node);\n\t\tnode.setParent(parent);\n\n\t\t//Update lastInserted HashMap\n\t\tthis.lastInsertedNodes.put(level, node);\n\t}", "void createNode(String path);", "void insertChild(K key, Node child) {\r\n\t\t\tint loc = Collections.binarySearch(keys, key);\r\n\t\t\tint childIndex = loc >= 0 ? loc + 1 : -loc - 1;\r\n\t\t\tif (loc >= 0) {\r\n\t\t\t\tchildren.set(childIndex, child);\r\n\t\t\t} else {\r\n\t\t\t\tkeys.add(childIndex, key);\r\n\t\t\t\tchildren.add(childIndex + 1, child);\r\n\t\t\t}\r\n\t\t}", "private static void createTree(TreeItem<FilePath> rootItem) throws IOException {\n\n try (DirectoryStream<Path> directoryStream = Files\n .newDirectoryStream(rootItem.getValue().getPath())) {\n\n for (Path path : directoryStream) {\n TreeItem<FilePath> newItem = new TreeItem<FilePath>(new FilePath(path));\n newItem.setExpanded(true);\n\n rootItem.getChildren().add(newItem);\n\n if (Files.isDirectory(path)) {\n createTree(newItem);\n }\n }\n } catch (AccessDeniedException ignored) {\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Test\n public void testMkdirOneDirectoryRelativePathOneDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"directory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1\"), true);\n }", "public void addChild(XMLElement child)\n/* */ {\n/* 398 */ if (child == null) {\n/* 399 */ throw new IllegalArgumentException(\"child must not be null\");\n/* */ }\n/* 401 */ if ((child.getLocalName() == null) && (!this.children.isEmpty())) {\n/* 402 */ XMLElement lastChild = (XMLElement)this.children.lastElement();\n/* */ \n/* 404 */ if (lastChild.getLocalName() == null) {\n/* 405 */ lastChild.setContent(lastChild.getContent() + \n/* 406 */ child.getContent());\n/* 407 */ return;\n/* */ }\n/* */ }\n/* 410 */ child.parent = this;\n/* 411 */ this.children.addElement(child);\n/* */ }", "public final void addDirectory(Path dir) {\n\t\t// enable trace for registration\n this.trace = true;\n register(dir);\n }", "@Override\n\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n\t\t\t\tPath resolve = target.resolve(source.relativize(dir));\n\t\t\t\tFile resolve_file = resolve.toFile();\n\n\t\t\t\tif (resolve_file.exists() == false) {\n\t\t\t\t\tFiles.createDirectory(resolve);\n\t\t\t\t} else {\n\t\t\t\t\t// delete old data in sub-directories\n\t\t\t\t\t// without deleting the directory\n\t\t\t\t\tArrays.asList(resolve_file.listFiles()).forEach(File::delete);\n\t\t\t\t}\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}", "private void createDir(){\n\t\tPath path = Path.of(this.dir);\n\t\ttry {\n\t\t\tFiles.createDirectories(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void createDirectory(SrvSession sess, TreeConnection tree, FileOpenParams params)\n throws IOException {\n\n // Access the database context\n\n DBDeviceContext dbCtx = (DBDeviceContext) tree.getContext();\n\n // Check if the database is online\n \n if ( dbCtx.getDBInterface().isOnline() == false)\n throw new DiskOfflineException( \"Database is offline\");\n \n // Get, or create, a file state for the new path. Initially this will indicate that the directory\n // does not exist.\n \n FileState fstate = getFileState(params.getPath(), dbCtx, false);\n if ( fstate != null && fstate.fileExists() == true)\n throw new FileExistsException(\"Path \" + params.getPath() + \" exists\");\n\n // If there is no file state check if the directory exists\n \n if ( fstate == null) {\n\n // Create a file state for the new directory\n \n fstate = getFileState(params.getPath(), dbCtx, true);\n \n // Get the file details for the directory\n \n if ( getFileDetails(params.getPath(), dbCtx, fstate) != null)\n throw new FileExistsException(\"Path \" + params.getPath() + \" exists\");\n }\n\n // Find the parent directory id for the new directory\n \n int dirId = findParentDirectoryId(dbCtx,params.getPath(),true);\n if ( dirId == -1)\n throw new IOException(\"Cannot find parent directory\");\n \n // Create the new directory entry\n \n try {\n\n // Get the directory name\n \n String[] paths = FileName.splitPath(params.getPath());\n String dname = paths[1];\n\n // Check if the directory name is too long\n \n if ( dname != null && dname.length() > MaxFileNameLen)\n throw new FileNameException(\"Directory name too long, \" + dname);\n \n // If retention is enabled check if the file is a temporary folder\n \n boolean retain = true;\n \n if ( dbCtx.hasRetentionPeriod()) {\n \n // Check if the file is marked delete on close\n \n if ( params.isDeleteOnClose())\n retain = false;\n }\n \n // Set the default NFS file mode, if not set\n \n if ( params.hasMode() == false)\n params.setMode(DefaultNFSDirMode);\n\n // Make sure the create directory option is enabled\n \n if ( params.hasCreateOption( WinNT.CreateDirectory) == false)\n throw new IOException( \"Create directory called for non-directory\");\n \n // Use the database interface to create the new file record\n \n int fid = dbCtx.getDBInterface().createFileRecord(dname, dirId, params, retain);\n\n // Indicate that the path exists\n \n fstate.setFileStatus( FileStatus.DirectoryExists);\n \n // Set the file id for the new directory\n \n fstate.setFileId(fid);\n \n // If retention is enabled get the expiry date/time\n \n if ( dbCtx.hasRetentionPeriod() && retain == true) {\n RetentionDetails retDetails = dbCtx.getDBInterface().getFileRetentionDetails(dirId, fid);\n if ( retDetails != null)\n fstate.setRetentionExpiryDateTime(retDetails.getEndTime());\n }\n \n // Check if the file loader handles create directory requests\n \n if ( fid != -1 && dbCtx.getFileLoader() instanceof NamedFileLoader) {\n \n // Create the directory in the filesystem/repository\n \n NamedFileLoader namedLoader = (NamedFileLoader) dbCtx.getFileLoader();\n namedLoader.createDirectory(params.getPath(), fid);\n }\n }\n catch (Exception ex) {\n Debug.println(ex);\n }\n }", "@Test\n public void testMkdirOneDirectoryAbsolutePathOneDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"/directory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1\"), true);\n }", "long addEntry(DirectoryEntry newEntry) {\n // Unlink an entry from the free list (or add to the end of the existing\n // directory)\n long pos;\n if (freeEntries.size() > 0) {\n pos = freeEntries.get(0);\n freeEntries.remove(0);\n } else {\n pos = endOfEntries;\n endOfEntries += 32;\n }\n // Put the new entry into it's slot\n dirStream.position(pos);\n newEntry.writeTo(dirStream);\n // Update internal structures to reflect new entry (as if read from\n // disk)\n entries.put(pos, newEntry);\n handleAccessed(true);\n return pos;\n }", "public void addFolder(String name, int index) {\n\t\tDefaultTreeModel model = (DefaultTreeModel) getModel();\n\t\tTreeNode root = (TreeNode) model.getRoot();\n\t\tif (index > root.getChildCount() || index < 0){\n\t\t\tindex = root.getChildCount();\n\t\t}\n\t\tmodel.insertNodeInto(new TreeNode(name, root.getNodeOption(), index, true), root, index);\n\t\tsetCellRenderer(new TreeRenderer());\n\t\tmodel.reload();\n\n\t\tscrollRowToVisible(index + 1);\n\t}", "@Override\n public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n if (!this.sourceDirectory.equals(dir)) {\n // Create this directory in the target and make it our current target.\n Path newDirectory = this.currentTargetDirectory.resolve(dir.getFileName());\n boolean didCreate = newDirectory.toFile().mkdir();\n Assert.assertTrue(didCreate);\n logger.output(\"Created directory: \" + newDirectory);\n this.currentTargetDirectory = newDirectory;\n }\n return FileVisitResult.CONTINUE;\n }", "public void addChild(Node newChild) {\r\n\t\t\tchildren.reset();\r\n\t\t\t\r\n\t\t\tnewChild.setParent(this);\r\n\r\n\t\t\tif (children.size() == 0)\r\n\t\t\t\tchildren.add(newChild);\r\n\t\t\telse if (children.get().getData(0).getKey().compareTo(newChild.getData(0).getKey()) > 0) \r\n\t\t\t\tchildren.insert(newChild);\r\n\t\t\telse {\r\n\t\t\t\twhile (children.hasNext()) {\r\n\t\t\t\t\tif (children.next().getData(0).getKey().compareTo(newChild.getData(0).getKey()) > 0) break;\r\n\t\t\t\t}\r\n\t\t\t\tif (children.get().getData(0).getKey().compareTo(newChild.getData(0).getKey()) > 0) \r\n\t\t\t\t\tchildren.insert(newChild);\r\n\t\t\t\telse\r\n\t\t\t\t\tchildren.add(newChild);\r\n\t\t\t}\r\n\t\t}", "private void register(Path dir) throws IOException {\n\t\tWatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);\n\t\tif (trace) {\n\t\t\tPath prev = keys.get(key);\n\t\t\tif (prev == null) {\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\tlogger.debug(String.format(\"register: %s\\n\", dir));\n\t\t\t} else {\n\t\t\t\tif (!dir.equals(prev)) {\n\t\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\t\tlogger.debug(String.format(\"update: %s -> %s\\n\", prev, dir));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tkeys.put(key, dir);\n\t}", "public void addNodeToSelectedNode(Node node) throws NoSelectedNodeException {\n\t\tif (!(this.selectedNode instanceof Folder)){\n\t\t\tesv.showPopupError(\"Can only add a folder to another folder\");\n\t\t\treturn;\n\t\t}\n\n\t\t//Update the swing view first because it will send the needed exceptions\n\t\tesv.addNodeToSelectedNode(node);\n\n\t\t//Update internal representation of tree\n\t\tFolder parent = (Folder)this.selectedNode;\n\t\tparent.addChild(node);\n\t\tnode.setParent(parent);\n\n\t\t//Update lastInserted HashMap\n\t\tthis.lastInsertedNodes.clear();\n\t\tthis.lastInsertedNodes.put(0, node);\n\t}", "public void pushDirectory(Directory directory) {\r\n directoryStack.push(directory);\r\n }", "public void add(int d) {\n // if empty tree, new node is root\n if (root == null) {\n root = new Node(d);\n }\n // if non-empty tree, insert for completeness\n else {\n // go down the left branch of tree until a leaf is reached\n \n // check if leaf has a right sibling, if not, add to right, else go back one node and see if the node's right sibling has children\n // if right sibling \n \n // add to its left child\n\n }\n }", "@Test\n public void testHasDirectory() {\n FileTree myTree = new FileTree();\n String[] file = {\"file1\"};\n try {\n myTree.mkdir(file);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertTrue(myTree.hasDirectory(\"file1\"));\n }", "public void add(DirectoryComponent item) {\r\n\t\tthis.DirectoryList.add(item);\r\n\r\n\t}", "@Override\n public boolean add(E parent, E child) {\n Node tmp;\n boolean isAdded = true;\n\n if (parent == null || child == null) {\n isAdded = false;\n }\n //Add root and his child.\n if (root == null) {\n root = new Node(parent);\n root.children.add(new Node(child));\n } else {\n tmp = serchNode(parent, root);\n tmp.children.add(new Node(child));\n isAdded = true;\n\n }\n\n return isAdded;\n }", "@Test\r\n public void moveChildToParent() {\r\n command.executeCommand(\"/parent/child/\", \"/\", root, currentDirectory);\r\n assertTrue(root.getDirectoryByAbsolutePath(\"/child\") != null);\r\n }", "public void addChild(WSLNode node) {children.addElement(node);}", "public void newFolder ()\n {\n newNode(null);\n }", "public void addChild(BTreeNode<E> newChild) {\n\t\tint index = 0;\n\t\tfor (BTreeNode<E> node : children) {\n\t\t\tif (node == null || cmp.compare(newChild.getData(0), node.data.get(0)) > 0) {\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t\tchildren.add(index, newChild);\n\t\tnewChild.parent = this;\n\t}", "public void addChild(Node child){\n children.add(child);\n }", "private void appendBreadcrumb(Context context, ExternalFileInfo newFolder) {\n int currentCrumb = -1;\n if (mBreadcrumbBarLayout.getChildCount() > 0) {\n // Find the current folder's crumb in the bar\n if (mCurrentFolder != null && mCurrentRoot != null) {\n currentCrumb = findBreadcrumb(mCurrentFolder);\n } else {\n // In the root folder, so current crumb is the first child\n currentCrumb = 0;\n }\n // Check if the next crumb (right) corresponds to the new folder\n if (currentCrumb >= 0) {\n if (currentCrumb + 1 < mBreadcrumbBarLayout.getChildCount()) {\n boolean clearToRight = true;\n LinearLayout crumb = (LinearLayout) mBreadcrumbBarLayout.getChildAt(currentCrumb + 1);\n Object tag = crumb.getTag();\n if (tag != null && tag instanceof ExternalFileInfo) {\n ExternalFileInfo file = (ExternalFileInfo) tag;\n if (file.getUri().equals(newFolder.getUri())) {\n // New folder is already in breadcrumb bar\n clearToRight = false;\n }\n }\n if (clearToRight) {\n // let's rebuild bread crumb bar from scratch, since it can be a\n // non-immediate child\n rebuildBreadcrumbBar(getContext(), newFolder);\n }\n } else {\n // let's rebuild bread crumb bar from scratch, since it can be a\n // non-immediate child\n rebuildBreadcrumbBar(getContext(), newFolder);\n }\n setCurrentBreadcrumb(currentCrumb + 1);\n }\n }\n if (currentCrumb < 0) {\n // Current crumb could not be found or bar is not built, try (re)building the bar\n rebuildBreadcrumbBar(context, null);\n // Create a new crumb and add to end of bar\n createBreadcrumb(context, newFolder, -1);\n\n setCurrentBreadcrumb(-1);\n }\n }", "protected void addChild(PafDimMember childNode) throws PafException {\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// Create a new ArrayList of child nodes, if this is the first child\r\n\t\t\tif (children == null) \r\n\t\t\t\tchildren = new ArrayList<PafDimMember>();\r\n\t\t\t\r\n\t\t\t// Set parent of child node to current PafBaseMember node\r\n\t\t\tchildNode.parent = this;\r\n\r\n\t\t\t// Add child node to PafBaseTree\r\n\t\t\tchildren.add(childNode);\r\n\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// throw Paf Exception\r\n\t\t\tString errMsg = \"Java Exception: \" + ex.getMessage();\r\n\t\t\tlogger.error(errMsg);\r\n\t\t\tPafException pfe = new PafException(errMsg, PafErrSeverity.Error, ex);\t\r\n\t\t\tthrow pfe;\r\n\t\t}\r\n\t}", "void appendChild(Object child);", "public void newFile(int temp) {\n if(!doesExist(temp)){\n System.out.println(\"The Directory does not exist \");\n return;\n }\n\n directory nodeptr = root;\n for(int count = 0; count < temp; count++) {\n nodeptr = nodeptr.forward;\n }\n int space = nodeptr.f.createFile(nodeptr.count);\n nodeptr.count++;\n nodeptr.availableSpace = 512 - space;\n\n }", "private void insertToFile (PQNode node) throws Exception{\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n nodes.add(node);\n\n storeToFile(file,nodes, false);\n }", "@Test\n public void testMkdirOneDirectoryAbsolutePathMultipleDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"/directory1\", \"/directory1/subDirectory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"A already exists or a path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1/subDirectory1\"), true);\n }", "@Override\n\tpublic boolean addModuleDirectory(String path)\n\t{\n\t\tpath = path.replace(\"~\", System.getProperty(\"user.home\"));\n\t\tSystem.out.println(\"Path: \" + path);\n\t\tFile newDir = new File(path);\n\n\t\tif (newDir.exists() && newDir.isDirectory()) {\n\t\t\tmoduleDirectories.add(newDir);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "@Override\n\tpublic void addChild(Node node) {\n\t\t\n\t}", "public Node appendNode(Node node);", "@Test\n public void testMkdirMultipleDirectoriesRelativePathOneDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"directory1\", \"directory2\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 or directory2 already exists or the path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1\"), true);\n assertEquals(myTree.hasDirectory(\"/directory2\"), true);\n }", "public void addChild(Node node){\n children.add(node);\n \n }", "private void createNode() throws Exception {\n try {\n _curator.create().creatingParentsIfNeeded().forPath(_zkPath, new byte[0]);\n } catch (KeeperException.NodeExistsException e) {\n // Don't care\n }\n }", "public void addChild(Node child)\n\t{\n\t\tchild.parent = this;\n\t\t//if (!children.contains(child))\n\t\t//{\t\n\t\tchildren.add(child);\n\t\t//children.get(children.indexOf(child)-1).setBro(child);\n\t\t//}\n\t}", "@Test\n public void testMkdirOneDirectoryRelativePathMultipleDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"directory1\", \"directory1/subDirectory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"A already exists or a path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1/subDirectory1\"), true);\n }", "private void addChild(Content child) {\n/* 238 */ this.tail.setNext(this.document, child);\n/* 239 */ this.tail = child;\n/* */ }", "private TypeNode addNode (String parentName, TypeDescription childTypeMetadata) \n {\t\n // Find \"parent\" node\n if (parentName != null && parentName.trim().length() == 0) {\n parentName = null;\n }\n TypeNode nodeParent = null;\n if (parentName != null) {\n nodeParent = (TypeNode) _nodesHashtable.get(parentName);\n }\n \n // Find \"child\" node\n String childName = childTypeMetadata.getName();\n \tTypeNode node = (TypeNode) _nodesHashtable.get(childName);\n\n \t// System.err.println(\" parentName: \" + parentName + \" ; childName: \" + childName);\n \n // NEW type definition ?\n \tif ( node == null ) {\t\t\n \t\t// Not found \"child\". NEW type definition.\n \t\tif ( nodeParent == null ) {\n // Parent is NEW\n // TOP has null parent\n if (parentName != null) {\n TypeDescription typeParent = getBuiltInType(parentName);\n if (typeParent != null) {\n // Built-in Type as Parent\n nodeParent = addNode (typeParent.getSupertypeName(), typeParent);\n // Trace.trace(\" -- addNode: \" + childName + \" has New Built-in Parent: \" + parentName);\n } else { \n \t\t\t// NEW parent also.\n // \"parentName\" is FORWARD Reference Node\n \t\t\tnodeParent = insertForwardedReferenceNode(_rootSuper, parentName); \n // Trace.trace(\" -- addNode: \" + childName + \" has New FORWARD Parent: \" + parentName);\n }\n }\n \t\t}\n \t\t// System.out.println(\" -- addNode: New child\");\t\t\n \t\treturn insertNewNode (nodeParent, childTypeMetadata);\n \t}\n \t\n //\n // childTypeMetadata is ALREADY in Hierarchy\n //\n \n \t// This node can be a Forwarded Reference type\n \tif (node.getObject() == null) {\n \t\t// Set Object for type definition\n \t\t// Reset label.\n \t\t// Trace.trace(\"Update and define previously forwarded reference type: \"\n \t\t//\t\t+ node.getLabel() + \" -> \" + parentName);\n // Need to \"remove\" and \"put\" back for TreeMap (no modification is allowed ?)\n node.getParent().removeChild(node);\n \t\tnode.setObject(childTypeMetadata);\n node.setLabel(childTypeMetadata.getName());\n node.getParent().addChild(node);\n \n // Remove from undefined types\n // Trace.trace(\"Remove forward ref: \" + childTypeMetadata.getName());\n _undefinedTypesHashtable.remove(childTypeMetadata.getName());\n \t}\n \t\n \tif (parentName == null) {\n \t\t// NO Parent\n if (childTypeMetadata.getName().compareTo(UIMA_CAS_TOP) != 0) {\n Trace.err(\"??? Possible BUG ? parentName==null for type: \"\n + childTypeMetadata.getName());\n }\n \t\treturn node;\n \t}\n \t\n \t// Found \"child\".\n \t// This node can be the \"parent\" of some nodes \n \t// and it own parent is \"root\" OR node of \"parentName\".\n \tif ( node.getParent() == _rootSuper ) {\n \t\t// Current parent is SUPER which may not be the right parent\n \t\t// if \"node\" has a previously forward referenced parent of some type.\n \t\t// Find the real \"parent\".\n \t\tif ( nodeParent != null ) {\n \t\t // Parent node exists. \n \t\t\tif ( nodeParent != _rootSuper ) {\n \t\t\t // Move \"node\" from \"root\" and put it as child of \"nodeParent\"\n \t\t\t\t// Also, remove \"node\" from \"root\"\n \t\t\t // _rootSuper.getChildren().remove(node.getLabel());\n // System.out.println(\"B remove\");\n \t\t\t if (_rootSuper.removeChild(node) == null) {\n System.out.println(\"??? [.addNode] Possible BUG 1 ? cannot remove \"\n + node.getLabel() + \" from SUPER\");\n System.out.println(\" node: \" + ((Object)node).toString()); \n Object[] objects = _rootSuper.getChildrenArray();\n for (int i=0; i<objects.length; ++i) {\n System.out.println(\" \" + objects[i].toString()); \n } \n }\n // System.out.println(\"E remove\");\n \t\t\t} else {\n \t\t\t\t// \"nodeParent\" is \"SUPER\".\n \t\t\t\treturn node;\n \t\t\t}\n \t\t} else {\n \t\t\t// NEW parent\n\t\t\t\t// Remove \"node\" from \"SUPER\" and insert it as child of \"nodeParent\"\n\t\t\t // _rootSuper.getChildren().remove(node);\n if (_rootSuper.removeChild(node) == null) {\n System.err.println(\"??? [.addNode] Possible BUG 2 ? cannot remove \"\n + node.getLabel() + \" from SUPER\");\n }\t\t\t \n TypeDescription typeParent = getBuiltInType(parentName);\n if (typeParent != null) {\n // Built-in Type as Parent\n nodeParent = addNode (typeParent.getSupertypeName(), typeParent);\n // Trace.trace(\" -- addNode 2: \" + childName + \" has New Built-in Parent: \" + parentName);\n } else { \n \t\t\t // It is a NEW parent and this parent is forwarded reference (not defined yet). \n \t\t\t // Insert this parent as child of \"SUPER\"\n \t\t\t\tnodeParent = insertForwardedReferenceNode(_rootSuper, parentName);\n // Trace.trace(\" -- addNode 2: \" + childName + \" has New FORWARD Parent: \" + parentName);\n }\n \t\t}\t\t\t\t\n \t\tTypeNode tempNode;\n \t\tif ( (tempNode = nodeParent.insertChild(node)) != null && tempNode != node) {\n \t\t\t// Duplicate Label\n Trace.err(\"Duplicate Label 1\");\n// \t\t\tnode.setShowFullName(true);\n \t\t\tif (node.getObject() != null) {\n \t\t\t\tnode.setLabel(((TypeDescription)node.getObject()).getName());\n \t\t\t}\t\t\t\t\n \t\t\tnodeParent.insertChild(node);\n \t\t}\n \t} else if ( node.getParent() != null ) {\n \t //\n \t //\tERROR !!!\n \t\t// \"duplicate definition\" or \"have different parents\"\n \t //\n \t \n \t // \"nodeParent\" should be non-null and be the same as \"node.getParent\"\n \t // In this case, it is duplicate definition\n \t if ( nodeParent != null ) {\n \t if (nodeParent == node.getParent()) {\n \t\t\t\t// Error in descriptor\n \t\t // Duplicate definition\n \t\t\t\t// System.err.println(\"[TypeSystemHierarchy - addNode] Duplicate type: child=\" + childName + \" ; parent =\" + parentName);\n \t } else {\n \t // Error: \"node\" has different parents\n \t // Both parents are registered\n \t\t\t\tSystem.err.println(\"[TypeSystemHierarchy - addNode] Different registered parents: child=\" + childName \n \t\t\t\t + \" ; old node.getParent() =\" + node.getParent().getLabel()\n \t\t\t\t + \" ; new parent =\" + parentName);\n \t }\n \t } else {\n \t // Error \n // Error: \"node\" has different parents\n // Old parent is registered\n \t // New parent is NOT registered\n \t\t\tSystem.err.println(\"[TypeSystemHierarchy - addNode] Different parents: child=\" + childName \n \t\t\t + \" ; old registered node.getParent() =\" + node.getParent().getLabel()\n \t\t\t + \" ; new NON-registered parent =\" + parentName);\n \t }\n \t return null; // ERROR\n \n \t} else {\n \t\t//\n \t // Program BUG !!!\n \t\t// since Parent of \"registered\" node cannot be null.\n // if (childTypeMetadata.getName().compareTo(UIMA_CAS_TOP) != 0) {\n System.err.println(\"[TypeSystemHierarchy - addNode] Program BUG !!! (node.getParent() == null): child=\" + childName + \" ; parent =\" + parentName);\n return null;\n // }\n \t}\n \t\t\n \treturn node;\n }", "public void add (K key) {\n\t\tthis.root = this.addRecursively(root,key);\n\t}", "public static void set_root_child_name(String name) {\n\t\tDefaultMutableTreeNode cdir=new DefaultMutableTreeNode(name);\r\n\t\t\r\n\t\troot.add(cdir);\r\n\t\t\r\n//\t\tcurrent_node.add(cdir);\r\n\t\t//JTree ftp_dir_tree = new JTree(root);\r\n\t\t\r\n\t}", "private void createNewDirectory() {\n getMainWindow().addWindow(\n new TextInputDialog(\n \"Create Directory\",\n \"Create Directory\",\n \"New Folder\",\n new TextInputDialog.Callback() {\n public void onDialogResult(boolean happy, String newDirectory) {\n if ( happy\n && isValidFile(newDirectory)) {\n try {\n // Verzeichnis anlegen\n File newDir = getFile(newDirectory);\n if (!newDir.exists()) {\n newDir.mkdir(0755);\n }\n // Prüfen, ob das Verzeichnis angelegt wurde\n if (newDir.exists()) {\n loadXtreemFSData();\n showNotification(\"Success\", \"Directory \" + newDirectory + \" created.\", Notification.TYPE_TRAY_NOTIFICATION, null);\n }\n else {\n showNotification(\"Error\", \"Directory \" + newDirectory + \" could not be created.\", Notification.TYPE_WARNING_MESSAGE, null);\n }\n } catch (IOException e) {\n showNotification(\"Error\", e.toString(), Notification.TYPE_ERROR_MESSAGE, e);\n }\n }\n }\n }));\n }", "public void addNode(Node node){subNodes.add(node);}", "@Test\n public void testMove() throws Exception {\n allow(path, privilegesFromNames(new String[] {\n Privilege.JCR_ADD_CHILD_NODES,\n Privilege.JCR_NODE_TYPE_MANAGEMENT}));\n try {\n move(childNPath, destPath);\n fail(\"Move requires addChildNodes and removeChildNodes privilege.\");\n } catch (AccessDeniedException e) {\n // success.\n }\n }", "@Test\r\n public void testAppendChild_getChilds() {\r\n System.out.println(\"appendChild\");\r\n ConfigNode configNode = new ConfigNode(testLine);\r\n \r\n ConfigNode childNode1 = new ConfigNode(testLine);\r\n configNode.appendChild(childNode1);\r\n ConfigNode childNode2 = new ConfigNode(testLine);\r\n configNode.appendChild(childNode2);\r\n \r\n List<ConfigNode> childs = configNode.getChilds();\r\n assertEquals(childNode1, childs.get(0));\r\n assertEquals(childNode2, childs.get(1));\r\n }", "public static Node addAsChild(final Node node, final String xPath, final Element newNode) throws Exception {\r\n Node parent = selectSingleNode(node, xPath);\r\n assertNotNull(\"No node for xpath found [\" + xPath + \"]\", parent);\r\n // inserts at end of list\r\n parent.insertBefore(newNode, null);\r\n return node;\r\n }", "@Override\n public void childAdded(Node child) {\n }", "@Test\n public void testMkdirMultipleDirectoriesAbsolutePathOneDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"/directory1\", \"/directory2\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 or directory2 already exists or the path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1\"), true);\n assertEquals(myTree.hasDirectory(\"/directory2\"), true);\n }", "public void addChild(Node childnode)\n {\n children.add(childnode);\n }", "private static void addDirectoryToLibraryPath(String dir) throws IOException {\n try {\n Field field = ClassLoader.class.getDeclaredField(\"usr_paths\");\n field.setAccessible(true);\n String[] paths = (String[]) field.get(null);\n for (String path: paths) {\n if (dir.equals(path)) {\n return;\n }\n }\n String[] tmp = new String[paths.length + 1];\n System.arraycopy(paths, 0, tmp, 0, paths.length);\n tmp[paths.length] = dir;\n field.set(null, tmp);\n } catch (IllegalAccessException e) {\n throw new IOException(\"Failed to get permissions to set library path.\");\n } catch (NoSuchFieldException e) {\n throw new IOException(\"Failed to get field handle to set library path.\");\n }\n }", "ClassPath add(ClassPathElement element);", "public boolean addChild(INode node) {\r\n final int low = searchChildren(node.getLocalNameBytes());\r\n if (low >= 0) {\r\n return false;\r\n }\r\n addChild(node, low);\r\n return true;\r\n }", "private final <N extends INodeDirectory> N replaceSelf(final N newDir) {\r\n final INodeDirectory parent = getParent();\r\n Preconditions.checkArgument(parent != null, \"parent is null, this=%s\", this);\r\n parent.replaceChild(this, newDir);\r\n return newDir;\r\n }", "void insert(K key, V value) {\r\n\r\n\r\n Node child = getChild(key);\r\n child.insert(key, value);\r\n // to check if the child is overloaded\r\n if (child.isOverflow()) {\r\n Node sibling = child.split();\r\n insertChild(sibling.getFirstLeafKey(), sibling);\r\n }\r\n\r\n // if the node is full then it requires to split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n\r\n }", "public void createChild (GenericTreeNode<String> daddy)\r\n\t{\r\n\t\t\tList < GenericTreeNode<String> > child= daddy.getChildren();\r\n\t\t\r\n\t\tif (daddy.getData().equalsIgnoreCase(\"next.CommonProfile.Dashboard_SI\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Admin.Admin_Principal\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Client.Client_Principal\"));\t\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Member.Member_Principal\"));\t\r\n\t\t}\r\n\t\telse if (daddy.getData().equalsIgnoreCase(\"next.CommonProfile.Dashboard_SU\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\t//child.add(new GenericTreeNode<String>(\"next.CommonProfile.DashboardPrincipal\"));\t\r\n\t\t}\r\n\t\telse if (daddy.getData().equalsIgnoreCase(\"next.Admin.Admin_Principal\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.CommonProfile.PersonalInfo\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.CommonProfile.Products\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Admin.Business_Rules\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.view.support.CustomList\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t}\r\n\t\telse if (daddy.getData().equalsIgnoreCase(\"next.view.support.CustomList\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.MapsFunctionality\"));\r\n\t\t\t\r\n\t\t}else if (daddy.getData().equalsIgnoreCase(\"next.SupportFunctionality.MapsFunctionality\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tdaddy.setChildren(child);\r\n\t\t for (GenericTreeNode<String> node : daddy.getChildren()) {\r\n\t\t\t createChild (node);\r\n\t }\r\n\t}", "public void create(int temp) {\n\n directory newFile = new directory();\n newFile.a = temp;\n\n directory FilePtr;\n\n\n if (root == null) {\n root = newFile;\n root.forward = null;\n root.back = null;\n return;\n }\n\n FilePtr = root;\n\n while (FilePtr.forward != null) {\n FilePtr = FilePtr.forward;\n }\n FilePtr.forward = newFile;\n FilePtr = FilePtr.forward;\n FilePtr.forward = null;\n\n return;\n\n }", "public void add(Node<E> child) {\n this.children.add(child);\n }", "public Directory(String name) {\n super(name);\n this.parent = null;\n }", "public void add(K key, V value) {\n Node<K,V> node = root, parent = null;\n int cmp = -1;\n\n while (node != null) {\n cmp = key.compareTo(node.key);\n parent = node;\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n node.value = value;\n return;\n }\n }\n\n Node<K,V> new_node = new Node<>(key, value);\n if (parent == null) {\n root = new_node;\n } else if (cmp < 0) {\n parent.left = new_node;\n } else {\n parent.right = new_node;\n }\n }" ]
[ "0.70142174", "0.6689088", "0.66367555", "0.6529625", "0.6361221", "0.6291162", "0.6271071", "0.6267874", "0.6207514", "0.6180977", "0.6167495", "0.6090451", "0.6056203", "0.6028376", "0.5994834", "0.59827274", "0.59670097", "0.59485215", "0.5929456", "0.5913058", "0.58955324", "0.58570695", "0.5850783", "0.57422507", "0.5740499", "0.5735801", "0.5727791", "0.5725584", "0.57010686", "0.5694921", "0.5681344", "0.56809634", "0.56781185", "0.5671533", "0.56445426", "0.5640634", "0.5632138", "0.56244653", "0.56171995", "0.5603184", "0.5596184", "0.5594677", "0.5587749", "0.556352", "0.55507773", "0.55503976", "0.5529578", "0.5517537", "0.5514061", "0.5483698", "0.5478395", "0.5476948", "0.5472598", "0.54719174", "0.5470677", "0.5470261", "0.5460015", "0.54552644", "0.5453825", "0.5451242", "0.5448977", "0.544539", "0.5443577", "0.544185", "0.54410565", "0.54389834", "0.5438483", "0.54360306", "0.5435629", "0.5432601", "0.5421983", "0.5415173", "0.5414233", "0.53926605", "0.5386671", "0.538622", "0.53828394", "0.5361667", "0.53552145", "0.53489256", "0.53432816", "0.5341535", "0.5340515", "0.5338138", "0.53163016", "0.53116536", "0.5306818", "0.52997476", "0.529721", "0.52928174", "0.5288108", "0.52871335", "0.52816224", "0.52762645", "0.5274085", "0.52731436", "0.5269058", "0.52610195", "0.52577937", "0.52547294", "0.5250685" ]
0.0
-1
Print full path name of current directory starting with root
public String pwd() { StringBuilder toPrint = new StringBuilder(""); StackLinked<String> theStack = new StackLinked<>(); Position<FileElement> current = currentFileElement; do { theStack.push("/" + current.getValue().toString()); current = fileSystem.parent(current);} while (fileSystem.parent(current) != null); while (theStack.size() > 0) { toPrint.append(theStack.pop()); } return toPrint.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String formatRootPathForDisplay(File root) {\n\t\t\tString s = root.getPath();\n\t\t\treturn s.length() > 1 && s.endsWith(\"\\\\\") ? s.substring(0, s.length() - 1) : s;\n\t\t}", "public static String findCurrentDirectory() {\n\t\tString absolutePath = new File(\"\").getAbsolutePath();\n\t return absolutePath;\n\t}", "public String getPath() {\n String result = \"\";\n Directory curDir = this;\n // Keep looping while the current directories parent exists\n while (curDir.parent != null) {\n // Create the full path string based on the name\n result = curDir.getName() + \"/\" + result;\n curDir = (Directory) curDir.getParent();\n }\n // Return the full string\n result = \"/#/\" + result;\n return result;\n }", "public static String rootDir()\n {\n read_if_needed_();\n \n return _root;\n }", "String rootPath();", "public String getRootPath() {\n return root.getPath();\n }", "Path getRootPath();", "public String getCurrentPath() {\n\t\treturn \"\";\n\t}", "public String toString() {\r\n return fileSystem.getCurrentDirectory().toString();\r\n }", "public static String getBaseDir() {\r\n Path currentRelativePath = Paths.get(System.getProperty(\"user.dir\"));\r\n return currentRelativePath.toAbsolutePath().toString();\r\n }", "@Override\n\tpublic String getDirName() {\n\t\treturn StringUtils.substringBeforeLast(getLocation(), \"/\");\n\t}", "public void print(){\n for(int i = 0; i < rootDir.length; i++){\n System.out.println(rootDir[i]);\n }\n }", "public String getProjectRootDirectory() {\r\n\t\treturn getTextValue(workspaceRootText);\r\n\t}", "protected String getRootName() {\r\n\t\treturn ROOT_NAME;\r\n\t}", "public String getPath()\n\t{\n\t\tString previousPath = File.separator;\n\t\t\n\t\t//if there is a parent\n\t\tif(getParentDirectory() != null)\n\t\t{\n\t\t\t//write over the previous path with the parent's path and a slash\n\t\t\t// /path/to/parent\n\t\t\tpreviousPath = getParentDirectory().getPath() + File.separator;\n\t\t}\n\t\t//else- no parent, this is the root \"/\"\n\t\t\n\t\t//add the name, /path/to/parent/thisdir \n\t\treturn previousPath + getName();\t\t\n\t}", "public static String getCurrentPath() {\n File file = new File(\"\");\n return file.getAbsolutePath();\n }", "public String getPath(IDirectory currentNode) {\r\n if (currentNode == null) {\r\n // this directory does not exist\r\n return \"File system is empty\";\r\n } else if (currentNode.equals(this.rootDir)) {\r\n // this directory is the root\r\n return \"/\";\r\n } else {\r\n // Initialize the full path with the currentDirectory name\r\n String fullPath = \"/\" + currentNode.getName();\r\n // Get the parent directory of currentDirectory\r\n Directory parent = (Directory) currentNode.getParentDirectory();\r\n\r\n // Loop until parent is not the root\r\n while (!parent.equals(this.rootDir)) {\r\n // Update fullPath with the parent directory's name\r\n fullPath = parent.getName() + fullPath;\r\n fullPath = \"/\" + fullPath;\r\n // Set parent to the parent directory of the parent\r\n parent = (Directory) parent.getParentDirectory();\r\n }\r\n // Return the full path of the currentDirectory\r\n return fullPath;\r\n }\r\n }", "public String getRootPath() {\r\n return rootPath;\r\n }", "FsPath baseDir();", "public synchronized static String getCurrentDirectory() {\n if (currentDirectory == null)\n currentDirectory = canon(System.getProperty(\"user.home\"));\n return currentDirectory;\n }", "String getInstallRoot();", "public String getRoot();", "public String getCurrentPath() {\n\t\treturn DataManager.getCurrentPath();\n\t}", "@Override\r\n\tpublic String getRootDir() {\t\t\r\n\t\treturn Global.USERROOTDIR;\r\n\t}", "private static void findPath()\r\n {\r\n String temp_path = System.getProperty(\"user.dir\");\r\n char last = temp_path.charAt(temp_path.length() - 1);\r\n if(last == 'g')\r\n {\r\n path = \".\";\r\n }\r\n else\r\n {\r\n path = \"./bag\";\r\n }\r\n \r\n }", "public static void dir(String currentPath){}", "public String getRootName() {\n\t\treturn rootName;\n\t}", "java.lang.String getDirName();", "public String processPWD() {\n System.out.println(\"Le dossier courant est : \" + currentDir);\n ps.println(\"257 \" + currentDir + \" is the CWD\");\n return \"257 \" + currentDir + \" is the CWD\";\n }", "protected String getBaseDir(Element root) {\n\t\tString basedir = root.getAttribute(\"basedir\");\n\n\t\tif (basedir.length() == 0) {\n\t\t\t// No base dir defined\n\t\t\treturn null;\n\t\t}\n\n\t\tif (new File(basedir).isAbsolute()) {\n\t\t\t// An absolute base dir defined\n\t\t\treturn basedir;\n\t\t} else {\n\t\t\t// Append the current working directory to the relative base dir\n\t\t\treturn new File(System.getProperty(\"user.dir\"), basedir)\n\t\t\t\t\t.getAbsolutePath();\n\t\t}\n\t}", "@Override\r\n public String getBaseName() {\r\n if (baseName == null) {\r\n final int idx = getPath().lastIndexOf(SEPARATOR_CHAR);\r\n if (idx == -1) {\r\n baseName = getPath();\r\n } else {\r\n baseName = getPath().substring(idx + 1);\r\n }\r\n }\r\n\r\n return baseName;\r\n }", "public String getWorkDirectory(){\n String wd = \"\";\n try {\n wd = new File(\"test.txt\").getCanonicalPath().replace(\"/test.txt\",\"\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n return wd;\n }", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public static String sActivePath() \r\n\t{\r\n\t\tString activePath = null;\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\tactivePath = new java.io.File(\"\").getCanonicalPath();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn activePath;\r\n\t}", "private String getInitialDirectory() {\n String lastSavedPath = controller.getLastSavePath();\n\n if (lastSavedPath == null) {\n return System.getProperty(Constants.JAVA_USER_HOME);\n }\n\n File lastSavedFile = new File(lastSavedPath);\n\n return lastSavedFile.getAbsoluteFile().getParent();\n }", "public java.lang.String getCurrentPath() {\n java.lang.Object ref = currentPath_;\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 currentPath_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String printFromDirectory(IDirectory currentDir) {\r\n // Create a result variable to store the names of the contents of the\r\n // directory\r\n String result = \"\";\r\n\r\n // Get all the sub directories in currentDir\r\n ArrayList<IDirectory> subDirectories = new ArrayList<>();\r\n subDirectories = currentDir.getSubDirectories();\r\n // Get all the files in the directory\r\n ArrayList<IFile> files = new ArrayList<>();\r\n files = currentDir.getFiles();\r\n\r\n // Add names of the sub directories to the result\r\n for (IDirectory subDir : subDirectories) {\r\n result += subDir.getName() + \"\\n\";\r\n }\r\n // Add names of the files in the directory to the result\r\n for (IFile file : files) {\r\n result += file.getName() + \"\\n\";\r\n }\r\n\r\n // Return the names of all the contents\r\n return result;\r\n }", "public java.lang.String getCurrentPath() {\n java.lang.Object ref = currentPath_;\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 currentPath_ = s;\n return s;\n }\n }", "String getDir();", "public static String getWorkingDirectory() {\n // Since System.getProperty(\"user.dir\") and user.home etc. can be confusing\n // and I haven't quite figured out if they really are reliable on all systems,\n // I chose a little more complicated approach. This is exactly the same\n // like if a file is created relatively, like new File(\"testfile.txt\"), which\n // would be relative to the working directory.\n\n File f = new File(\".\");\n\n try {\n return addPathSeparator(f.getCanonicalPath());\n } catch (IOException e) {\n return null;\n }\n }", "public String fullFileName () {\n\t\tif (directory == null || directory.equals(\"\"))\n\t\t\treturn fileName;\n\t\telse\n\t\t\treturn directory + File.separator + fileName;\t//add a '\\' in the path\n\t}", "public final String path() {\n return string(preparePath(concat(path, SLASH, name)));\n }", "public String getPath() {\n\t\treturn this.baseDir.getAbsolutePath();\n\t}", "public String getPath()\n {\n StringBuilder buff = new StringBuilder();\n Resource r = this;\n while(r != null)\n {\n if(r.getId() != 1)\n {\n buff.insert(0, r.getName());\n }\n r = r.getParent();\n if(r != null || this.getId() == 1)\n {\n buff.insert(0, '/');\n }\n }\n return buff.toString();\n }", "@Override\n\tpublic String toString() {\n\t\treturn getFullPath();\n\t}", "public static File getRootDirectory() {\n\t\treturn ROOT_DIRECTORY;\n\t}", "public final String ping() {\n\t\tlog.debug(\"I'm here \\\"\" + workDir + \"\\\"\");\n\t\treturn configRootDir;\n\t}", "public static void setRootDir() {\n for(int i = 0; i < rootDir.length; i++){\n Character temp = (char) (65 + i);\n Search.rootDir[i] = temp.toString() + \":\\\\\\\\\";\n }\n }", "public String describeRoot();", "java.io.File getBaseDir();", "java.lang.String getRoot();", "public String getPathAsString() {\n if (list.isEmpty()) {\n return \"\";\n }\n StringBuilder buf = new StringBuilder();\n\n for (String dir : list) {\n buf.append(dir);\n buf.append(pathSeparator());\n }\n return buf.substring(0, buf.length() - 1); // remove the trailing pathSeparator...\n }", "public static String getRootFolderName() {\n\n return rootFolderName;\n }", "public static String getBasePath() {\n String basePath;\n if (new File(\"../../MacOS/JavaApplicationStub\").canExecute()) {\n basePath = \"../../../..\";\n } else {\n basePath = \".\";\n }\n return basePath;\n }", "public static String sBasePath() \r\n\t{\r\n\t\tif(fromJar) \r\n\t\t{\r\n\t\t\tFile file = new File(System.getProperty(\"java.class.path\"));\r\n\t\t\tif (file.getParent() != null)\r\n\t\t\t{\r\n\t\t\t\treturn file.getParent().toString();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn new java.io.File(\"\").getCanonicalPath();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public static String getWorkingDirectory() {\r\n try {\r\n // get working directory as File\r\n String path = DBLIS.class.getProtectionDomain().getCodeSource()\r\n .getLocation().toURI().getPath();\r\n File folder = new File(path);\r\n folder = folder.getParentFile().getParentFile(); // 2x .getParentFile() for debug, 1x for normal\r\n\r\n // directory as String\r\n return folder.getPath() + \"/\"; // /dist/ for debug, / for normal\r\n } catch (URISyntaxException ex) {\r\n return \"./\";\r\n }\r\n }", "public String getDir();", "public File getRootDir() {\r\n\t\treturn rootDir;\r\n\t}", "public String getProgramHomeDirName() {\n return pathsProvider.getProgramDirName();\n }", "String getPathName();", "String getPathName();", "String getRootAlias();", "@Override\n public String getCurrentDirectory() {\n return (String) gemFileState.get(STATE_SYNC_DIRECTORY);\n }", "private void printSketchFolder() {\n File sketchFolder = sketch.getFolder();\n System.out.println(\"++++++++++sketch folder: [\" + sketchFolder.getAbsolutePath() + \"]\");\n }", "public String getPath() {\n\t\treturn pfDir.getPath();\n\t}", "public String path(File f) {\r\n int sep = f.toString().lastIndexOf(\"\\\\\");\r\n return f.toString().substring(0, sep);\r\n }", "public String getPathName()\n {\n return getString(\"PathName\");\n }", "public final String getCanonicalPath()\n {\n return FileUtilities.getCanonicalPath(getLocalFile());\n }", "public String getAppPathname();", "public File getRootDir() {\n return rootDir;\n }", "public String getPathName();", "public String getPathName()\n \t{\n \t\tif ( arcname!=null )\n \t\t\treturn arcname + ARC_SEPARATOR + pathname;\n \t\treturn pathname;\n \t}", "VirtualDirectory getRootContents();", "private static String getFileRoot(String file) {\r\n \treturn file.substring(0, file.indexOf('.'));\r\n }", "protected String path() {\n return path(getName());\n }", "String getDirectoryPath();", "public String getLocalBasePath() {\n\t\treturn DataManager.getLocalBasePath();\n\t}", "public String getFullTreePathString()\n throws OculusException;", "public static String getCurrentFolderPath(){\n\t\treturn currentFolderPath;\n\t}", "private String getDicDir() {\n\t\tString wDir = null;\n\n\t\tif (System.getProperties().containsKey(\"root\")) {\n\t\t\twDir = System.getProperty(\"root\");\n\t\t}\n\n\t\tif ((wDir == null || wDir.isEmpty()) && CPlatform.isMacOs())\n\t\t\twDir = new File(CPlatform.getUserHome(), \"Library/Spelling\")\n\t\t\t\t\t.getAbsolutePath();\n\n\t\tif (wDir == null || wDir.isEmpty())\n\t\t\twDir = \"/home/ff/projects/hunspell\";\n\t\treturn wDir;\n\t}", "private static String returnDiretorioPai(Path a){\n return a.getParent().toString();\n }", "public boolean currentDirectoryIsOnRoot() {\n\t\treturn getCurrentDirectory().equals(getVirtualRoot());\n\t}", "public String getRelativePath() {\n if (repository == null) {\n return name;\n } else {\n StringBuffer b = new StringBuffer();\n repository.getRelativePath(b);\n b.append(name);\n return b.toString();\n }\n }", "DiscDirectoryInfo getRoot();", "public String getRootFolder() {\n return m_RootFolder;\n }", "public String getCurrentProfiledir()\r\n {\r\n String res = null, aux = \"\";\r\n File dir;\r\n Vector<String> profiles = getProfiledirs();\r\n\r\n for (Enumeration<String> e = profiles.elements(); e.hasMoreElements();)\r\n {\r\n aux = e.nextElement();\r\n dir = new File(aux + File.separator + _lockFile);\r\n if (dir.exists())\r\n {\r\n res = aux + File.separator;\r\n }\r\n }\r\n return res;\r\n }", "public String getPathName() {\n if (pathName == null) {\n if (isWindows()) {\n for (String key : getEnv().keySet()) {\n if (key.toLowerCase(Locale.getDefault()).equals(\"path\")) { // NOI18N\n pathName = key.substring(0, 4);\n return pathName;\n }\n }\n }\n pathName = \"PATH\"; // NOI18N\n }\n return pathName;\n }", "public String getBaseDirectory()\n {\n return m_baseDirectory;\n }", "String getFullWorkfileName();", "public String getAbsPath();", "public String getIndexDirectoryString() {\n File indexDir = this.getIndexDirectory();\n return indexDir != null ? indexDir.getAbsolutePath() : null;\n }", "public URL getRootDirURL() {\n\t\treturn null;\n\t}", "private void listDirectories (Directory currentDirectory) {\n currentDirectory.printSubDirectories(\"DIRS : \");\n }", "private void logInfo(){\n var f = new java.io.File(\".\");\n try {\n logger.info(\".=\" + f.getCanonicalPath());\n } catch (IOException e) {\n logger.error(\"Cannot get canonical path of .\");\n }\n logger.info(\"user.dir=\" + System.getProperty(\"user.dir\"));\n logger.info(\"isMacOSX = \"+ String.valueOf(isMacOSX()));\n }", "public static String getFileName() {\n File base = new File(\"C:/Users/Steve/IdeaProjects/MiniJavaCompiler/samples/clean/\");\n File file = new File(inputFile);\n String relativePath = base.toURI().relativize(file.toURI()).getPath();\n return relativePath;\n }", "File getRootDir() {\n\t\treturn rootDirFile;\n\t}", "public String getPath()\n\t{\n\t\treturn letter + \":/\";\n\t}", "public static String getToolchainRootPath(MakeConfiguration conf) {\n String rootPath = getToolchainExecPath(conf);\n\n int i = rootPath.length() - 2; // Last entry is '/', so skip it.\n while(i >= 0 && '/' != rootPath.charAt(i)) {\n --i;\n }\n\n return rootPath.substring(0, i+1);\n }", "public String getRoot() {\n\t\treturn null;\n\t}" ]
[ "0.74257874", "0.69712746", "0.6916307", "0.6862887", "0.68288505", "0.6772075", "0.6716262", "0.66737235", "0.6673562", "0.66636926", "0.65510976", "0.6540911", "0.6528916", "0.64800066", "0.644543", "0.6348151", "0.6325765", "0.6263269", "0.62107015", "0.6178859", "0.613284", "0.6131142", "0.612627", "0.61160064", "0.6087245", "0.60740685", "0.6063987", "0.6045121", "0.60323787", "0.60102504", "0.60099566", "0.5978934", "0.5976312", "0.5976312", "0.5972238", "0.59417444", "0.59272844", "0.59271467", "0.5909264", "0.58890426", "0.58805877", "0.58646905", "0.58632916", "0.58233035", "0.58175814", "0.5811544", "0.581131", "0.57983816", "0.57761604", "0.5776031", "0.5743341", "0.5737744", "0.5728613", "0.5720902", "0.5716677", "0.5712163", "0.5709677", "0.5705673", "0.57022333", "0.5701756", "0.5697303", "0.5697303", "0.5692256", "0.5688094", "0.567566", "0.56583035", "0.56573", "0.56464326", "0.5643878", "0.56298995", "0.56163245", "0.56148356", "0.56123734", "0.5611387", "0.5606037", "0.5605341", "0.5600812", "0.5595618", "0.55903316", "0.558623", "0.5578526", "0.55367297", "0.5531829", "0.55297035", "0.55260104", "0.55205727", "0.5516589", "0.5500194", "0.54906785", "0.549048", "0.54871845", "0.54854786", "0.5485182", "0.54830515", "0.54804486", "0.54782164", "0.54762566", "0.5471671", "0.54710984", "0.54669076" ]
0.66038257
10
Changes directory to specified name of new directory If the current directory doesn't have a child directory with this name, throws
public void cd(String name) throws NoSuchDirectoryException { Iterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement); if (toCheck != null) { for (Position<FileElement> fe : toCheck ) { if (fe.toString().equals(name) && fe.getValue().isDirectory() ) { currentFileElement = fe; } } } else {throw new NoSuchDirectoryException();} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void moveToDirWithSameName() {\r\n Dir sameName = new Dir(\"child\", \"/\");\r\n currentDirectory.addNewDirectory(sameName);\r\n command.executeCommand(\"/parent/child/\", \"/\", root, currentDirectory);\r\n currentDirectory = currentDirectory.getSubDirectoryByName(\"child\");\r\n // check child directory with file is in root\r\n assertTrue(currentDirectory.getFileByName(\"file\") != null);\r\n }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameDirToSelf() throws Throwable {\n assumeRenameSupported();\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path child = new Path(parentdir, \"child\");\n createFile(child);\n\n rename(parentdir, parentdir, false, true, true);\n //verify the child is still there\n assertIsFile(child);\n }", "public boolean changeDirectory(String newDir){\n\t\tthis.currentDir = newDir;\n\t\treturn true;\n\t}", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameChildDirForbidden() throws Exception {\n assumeRenameSupported();\n\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path childFile = new Path(parentdir, \"childfile\");\n createFile(childFile);\n //verify one level down\n Path childdir = new Path(parentdir, \"childdir\");\n rename(parentdir, childdir, false, true, false);\n //now another level\n fs.mkdirs(childdir);\n Path childchilddir = new Path(childdir, \"childdir\");\n rename(parentdir, childchilddir, false, true, false);\n }", "public static void renameDirectory(String inputFile, String newDirName) {\n File file = new File(inputFile);\n if (file.isDirectory()) {\n File newName = new File(file.getParent() + \"/\" + newDirName);\n //use renameTo() and check its return value\n if (file.renameTo(newName)) {\n System.out.println(\"Directory has been renamed to \" + newDirName);\n } else {\n System.out.println(\"Error in renaming the directory.\");\n }\n } else {\n System.out.println(\"Invalid file path or No such directory exists\");\n }\n }", "private void renameDirectory() {\n ProjectDirectory dir = (ProjectDirectory) viewer.getSelectedNode();\n String oldName = dir.toFile().getName();\n String newName = (String)\n JOptionPane.showInputDialog(\n viewer,\n \"Enter the new name of the directory:\",\n \"Rename directory\",\n JOptionPane.PLAIN_MESSAGE,\n null,\n null,\n oldName\n );\n \n if (newName != null && !oldName.equals(newName)) {\n if (!dir.changeName(newName)) {\n JOptionPane.showMessageDialog(\n viewer,\n \"Could not rename selected file!\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE\n );\n } else {\n viewer.refresh();\n }\n }\n \n }", "public void changeCurrentDirectory(String newDirectory) {\n currentDirectory = newDirectory;\n }", "public synchronized static void setCurrentDirectory(File newDirectory) {\n if (newDirectory == null) // this can actually happen\n currentDirectory = canon(System.getProperty(\"user.home\"));\n else\n currentDirectory = canon(newDirectory.getAbsolutePath());\n }", "@Override\r\n\tpublic boolean renameFolder(String oldDirName, String newDirName) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\r\n\r\n\t}", "private final <N extends INodeDirectory> N replaceSelf(final N newDir) {\r\n final INodeDirectory parent = getParent();\r\n Preconditions.checkArgument(parent != null, \"parent is null, this=%s\", this);\r\n parent.replaceChild(this, newDir);\r\n return newDir;\r\n }", "private static void doCreateDir() {\n String newDir = \"new_dir\";\n boolean success = (new File(newDir)).mkdir();\n\n if (success) {\n System.out.println(\"Successfully created directory: \" + newDir);\n } else {\n System.out.println(\"Failed to create directory: \" + newDir);\n }\n\n // Create a directory; all non-existent ancestor directories are\n // automatically created.\n newDir = \"c:/export/home/jeffreyh/new_dir1/new_dir2/new_dir3\";\n success = (new File(newDir)).mkdirs();\n\n if (success) {\n System.out.println(\"Successfully created directory: \" + newDir);\n } else {\n System.out.println(\"Failed to create directory: \" + newDir);\n }\n\n }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameFileIntoExistingDirectory() throws Exception {\n assumeRenameSupported();\n\n Path src = path(\"/test/olddir/file\");\n createFile(src);\n Path dst = path(\"/test/new/newdir\");\n fs.mkdirs(dst);\n rename(src, dst, true, false, true);\n Path newFile = path(\"/test/new/newdir/file\");\n if (!fs.exists(newFile)) {\n String ls = ls(dst);\n LOG.info(ls(path(\"/test/new\")));\n LOG.info(ls(path(\"/test/hadoop\")));\n fail(\"did not find \" + newFile + \" - directory: \" + ls);\n }\n assertTrue(\"Destination changed\",\n fs.exists(path(\"/test/new/newdir/file\")));\n }", "Directory createAsDirectory() {\n return getParentAsExistingDirectory().findOrCreateChildDirectory(name);\n }", "public void run(State state) throws IllegalNumberOfArgumentsException,\r\n InvalidPathException {\r\n String[] parameters = state.getParameters();\r\n if (parameters.length == 0) {\r\n throw new IllegalNumberOfArgumentsException(\r\n \"Mkdir requires a path to a directory to create.\");\r\n }\r\n // make a new directory for each path parameter\r\n for (String path : parameters) {\r\n path = State.cleanDirectoryPath(path);\r\n // get the name of the new directory and the path to its parent\r\n String[] separatedPath = state.separatePathName(path);\r\n String name = separatedPath[0];\r\n String parentPath = separatedPath[1];\r\n if (name.matches(\"/*\")) {\r\n throw new InvalidPathException(path);\r\n }\r\n try {\r\n // check that the name and parent's path are valid\r\n if (name.matches(State.ILLEGAL_CHARACTERS) || name\r\n .substring(0, name.length() - 1).contains(\"/\")) {\r\n throw new IllegalNameException(name);\r\n }\r\n // get the parent directory\r\n Directory parentDir = Navigate.navigateToDirectory(state, parentPath);\r\n //System.out.println(\"parent data: \" + parentDir.getData());\r\n //System.out.println(\"name: \" + name);\r\n String newPath = parentDir.getData() + name;\r\n // check that this file does not already exist\r\n if (parentDir.getChild(newPath) == null) {\r\n // create the new directory\r\n parentDir.addChild(name);\r\n state.addMessage(\"Created directory: \" + newPath + \"\\n\");\r\n } else {\r\n state.addMessage(newPath + \" already exists\\n\");\r\n }\r\n } catch (InvalidPathException e) {\r\n state.addMessage(\"Could not add directory \" + path + \" because \"\r\n + parentPath + \" does not exist.\\n\");\r\n } catch (IllegalNameException e) {\r\n state.addMessage(\"Could not add directory \" + path\r\n + \" because it contains illegal characters.\\n\");\r\n }\r\n }\r\n }", "public void setAndCreateDirPath(String dirname) {\r\n\t File newPath = new File(dirname); \r\n\t \r\n\t if(!newPath.isDirectory()) {\r\n\t\t newPath.mkdirs();\r\n\t }\r\n\t \r\n\t directory = newPath;\r\n }", "public static boolean renameRootTarget(String path, String oldname, String name) {\n File file = new File(path + File.separator + oldname);\n File newf = new File(path + File.separator + name);\n\n if (name.length() < 1)\n return false;\n\n try {\n if (!readReadWriteFile())\n RootTools.remount(path, \"rw\");\n\n execute(\"mv \" + getCommandLineString(file.getAbsolutePath()) + \" \"\n + getCommandLineString(newf.getAbsolutePath()));\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "public String changeDir(final String path) {\n if(path.equals(\".\")) {\n return path;\n }\n\n // Parent directory\n if(path.equals(\"..\")) {\n if(globalFileManager.getCurrentDir().getParent() != null) {\n globalFileManager.setCurrentDir(globalFileManager.getCurrentDir().getParent());\n return path;\n }\n }\n\n // Go to the root\n if(path.equals(\"/\")) {\n globalFileManager.setCurrentDir(globalFileManager.getRoot());\n return path;\n }\n\n File f;\n String[] paths;\n if(path.startsWith(\"/\")) {\n f = globalFileManager.getRoot();\n paths = path.substring(1).split(\"/\");\n } else {\n f = globalFileManager.getCurrentDir();\n paths = path.split(\"/\");\n }\n\n for(String p : paths) {\n f = f.getChildren().get(p);\n if(f == null || !f.isDirectory()) throw new BadPathException(\"Wrong path specified.\");\n globalFileManager.setCurrentDir(f);\n }\n return path;\n }", "private void populateNewChildDirectory(DirectoryEntry newEntry) {\n try (ClusterStream stream = new ClusterStream(fileSystem,\n FileAccess.Write,\n newEntry.getFirstCluster(),\n 0xffffffff)) {\n // First is the self-referencing entry...\n DirectoryEntry selfEntry = new DirectoryEntry(newEntry);\n selfEntry.setName(FileName.SelfEntryName);\n selfEntry.writeTo(stream);\n // Second is a clone of our self entry (i.e. parent) - though dates\n // are odd...\n DirectoryEntry parentEntry = new DirectoryEntry(getSelfEntry());\n parentEntry.setName(FileName.ParentEntryName);\n parentEntry.setCreationTime(newEntry.getCreationTime());\n parentEntry.setLastWriteTime(newEntry.getLastWriteTime());\n parentEntry.writeTo(stream);\n } catch (IOException e) {\n throw new dotnet4j.io.IOException(e);\n }\n }", "public void addDirectory(String name, IDirectory parent) {\r\n Directory newDir = new Directory(name, (Directory) parent);\r\n ((Directory) parent).addItem(newDir);\r\n }", "public Directory(String name) {\n super(name);\n this.parent = null;\n }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameRootDirForbidden() throws Exception {\n assumeRenameSupported();\n rename(path(\"/\"),\n path(\"/test/newRootDir\"),\n false, true, false);\n }", "@Override\r\n\tpublic boolean copyFolder(String path, String dirName, String newDirName) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\r\n\t}", "public String createDirectory(String parentID, String new_directory) throws CloudStorageNotEnoughSpace {\n File newFile = new File();\n newFile.setTitle(new_directory);\n newFile.setMimeType(\"application/vnd.google-apps.folder\");\n newFile.setParents(Arrays.asList(new ParentReference().setId(parentID)));\n\n try {\n File insertedFile = drive.files().insert(newFile).execute();\n return insertedFile.getId();\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n\n }", "private void prepareFolder(String name, String newFolderName) {\n }", "public void addSubdirectory(Directory newdir) {\n\t\tgetSubdirectories().add(newdir);\n\t}", "@Test\n public void testCdRelativePathOneAway() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"directory2\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2\", myTree.pwd());\n }", "private void changeDirectory(String directory) {\r\n try {\r\n File file = path.searchByPath(directory);\r\n if (file instanceof Directory) {\r\n // Change the directory.\r\n fileSystem.setCurrentDirectory((Directory) file);\r\n } else {\r\n // TextFile is not a directory.\r\n this.setError(directory + \" is a path to TextFile\");\r\n }\r\n } catch (InvalidPathException e) {\r\n // Path to specified directory is not found.\r\n this.setError(directory + \" is not a path to Directory\");\r\n }\r\n }", "public void createDirectory(SrvSession sess, TreeConnection tree, FileOpenParams params)\n throws IOException {\n\n // Access the database context\n\n DBDeviceContext dbCtx = (DBDeviceContext) tree.getContext();\n\n // Check if the database is online\n \n if ( dbCtx.getDBInterface().isOnline() == false)\n throw new DiskOfflineException( \"Database is offline\");\n \n // Get, or create, a file state for the new path. Initially this will indicate that the directory\n // does not exist.\n \n FileState fstate = getFileState(params.getPath(), dbCtx, false);\n if ( fstate != null && fstate.fileExists() == true)\n throw new FileExistsException(\"Path \" + params.getPath() + \" exists\");\n\n // If there is no file state check if the directory exists\n \n if ( fstate == null) {\n\n // Create a file state for the new directory\n \n fstate = getFileState(params.getPath(), dbCtx, true);\n \n // Get the file details for the directory\n \n if ( getFileDetails(params.getPath(), dbCtx, fstate) != null)\n throw new FileExistsException(\"Path \" + params.getPath() + \" exists\");\n }\n\n // Find the parent directory id for the new directory\n \n int dirId = findParentDirectoryId(dbCtx,params.getPath(),true);\n if ( dirId == -1)\n throw new IOException(\"Cannot find parent directory\");\n \n // Create the new directory entry\n \n try {\n\n // Get the directory name\n \n String[] paths = FileName.splitPath(params.getPath());\n String dname = paths[1];\n\n // Check if the directory name is too long\n \n if ( dname != null && dname.length() > MaxFileNameLen)\n throw new FileNameException(\"Directory name too long, \" + dname);\n \n // If retention is enabled check if the file is a temporary folder\n \n boolean retain = true;\n \n if ( dbCtx.hasRetentionPeriod()) {\n \n // Check if the file is marked delete on close\n \n if ( params.isDeleteOnClose())\n retain = false;\n }\n \n // Set the default NFS file mode, if not set\n \n if ( params.hasMode() == false)\n params.setMode(DefaultNFSDirMode);\n\n // Make sure the create directory option is enabled\n \n if ( params.hasCreateOption( WinNT.CreateDirectory) == false)\n throw new IOException( \"Create directory called for non-directory\");\n \n // Use the database interface to create the new file record\n \n int fid = dbCtx.getDBInterface().createFileRecord(dname, dirId, params, retain);\n\n // Indicate that the path exists\n \n fstate.setFileStatus( FileStatus.DirectoryExists);\n \n // Set the file id for the new directory\n \n fstate.setFileId(fid);\n \n // If retention is enabled get the expiry date/time\n \n if ( dbCtx.hasRetentionPeriod() && retain == true) {\n RetentionDetails retDetails = dbCtx.getDBInterface().getFileRetentionDetails(dirId, fid);\n if ( retDetails != null)\n fstate.setRetentionExpiryDateTime(retDetails.getEndTime());\n }\n \n // Check if the file loader handles create directory requests\n \n if ( fid != -1 && dbCtx.getFileLoader() instanceof NamedFileLoader) {\n \n // Create the directory in the filesystem/repository\n \n NamedFileLoader namedLoader = (NamedFileLoader) dbCtx.getFileLoader();\n namedLoader.createDirectory(params.getPath(), fid);\n }\n }\n catch (Exception ex) {\n Debug.println(ex);\n }\n }", "@Test\n public void testCdUpOneWithDotDot() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\" , \"/directory2/directory3\", \n \"/directory2/directory3/directory4\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"/directory2/directory3/directory4\");\n myTree.cd(\"..\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2/directory3\", myTree.pwd());\n }", "abstract void addNewSourceDirectory(final File targetDirectory);", "public static void set_root_child_name(String name) {\n\t\tDefaultMutableTreeNode cdir=new DefaultMutableTreeNode(name);\r\n\t\t\r\n\t\troot.add(cdir);\r\n\t\t\r\n//\t\tcurrent_node.add(cdir);\r\n\t\t//JTree ftp_dir_tree = new JTree(root);\r\n\t\t\r\n\t}", "public void moveDirectory(String source, String target) throws IOException{\n Path sourceFilePath = Paths.get(PWD.getPath()+\"/\"+source);\n Path targetFilePath = Paths.get(PWD.getPath()+\"/\"+target);\n //using builtin move function which uses Paths\n Files.move(sourceFilePath,targetFilePath);\n }", "@Test\r\n public void moveChildToParent() {\r\n command.executeCommand(\"/parent/child/\", \"/\", root, currentDirectory);\r\n assertTrue(root.getDirectoryByAbsolutePath(\"/child\") != null);\r\n }", "public static void createDirectory(String srcDir, String nameDir) {\n try {\n Path path = Paths.get(srcDir + \"/\" + nameDir);\n\n Files.createDirectories(path);\n System.out.println(\"Directory is created\");\n } catch (IOException e) {\n System.err.println(\"ERROR CREATION! \" + e.getMessage());\n }\n\n }", "private void createDir(){\n\t\tPath path = Path.of(this.dir);\n\t\ttry {\n\t\t\tFiles.createDirectories(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void createDirectory(Path path, Path destPath) {\n String rootLocation = destPath.toString();\n int index;\n if(firstTime) {\n firstTime = false;\n index = path.toFile().getPath().lastIndexOf(\"\\\\\")+1;//index where cur directory name starts\n rootFolder = path.toFile().getPath().substring(index);\n }\n else {\n index = path.toFile().getPath().indexOf(rootFolder);\n }\n\n String folderName= path.toFile().getPath().substring(index);\n Path newDirPath = Paths.get(rootLocation + DOUBLE_BKW_SLASH +folderName);\n try {\n Path newDir = Files.createDirectory(newDirPath);\n } catch(FileAlreadyExistsException e){\n // the directory already exists.\n e.printStackTrace();\n } catch (IOException e) {\n //something else went wrong\n e.printStackTrace();\n }\n }", "public static boolean createRootdir(String parentPath, String name) {\n File dir = new File(parentPath + File.separator + name);\n if (dir.exists())\n return false;\n\n try {\n if (!readReadWriteFile())\n RootTools.remount(parentPath, \"rw\");\n\n execute(\"mkdir \" + getCommandLineString(dir.getAbsolutePath()));\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "private void handleCwd(String args) {\n String filename = currDirectory;\n\n // go one level up (cd ..)\n if (args.equals(\"..\")) {\n int ind = filename.lastIndexOf(fileSeparator);\n if (ind > 0) {\n filename = filename.substring(0, ind);\n }\n }\n\n // if argument is anything else (cd . does nothing)\n else if ((args != null) && (!args.equals(\".\"))) {\n filename = filename + fileSeparator + args;\n }\n\n // check if file exists, is directory and is not above root directory\n File f = new File(filename);\n\n if (f.exists() && f.isDirectory() && (filename.length() >= root.length())) {\n currDirectory = filename;\n sendMsgToClient(\"250 The current directory has been changed to \" + currDirectory);\n } else {\n sendMsgToClient(\"550 Requested action not taken. File unavailable.\");\n }\n }", "public static boolean moveCopyRoot(String old, String newDir) {\n try {\n if (!readReadWriteFile())\n RootTools.remount(newDir, \"rw\");\n\n execute(\"cp -fr \" + getCommandLineString(old) + \" \"\n + getCommandLineString(newDir));\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "private void createDirectoryIfNeeded(String directoryName)\n\t{\n\t\tFile theDir = new File(directoryName);\n\n\t\t// if the directory does not exist, create it\n\t\tif (!theDir.exists())\n\t\t{\n\t\t\t//System.out.println(\"creating directory: \" + directoryName);\n\t\t\ttheDir.mkdir();\n\t\t}\n\t}", "@Test\n public void testCdRelativePathMultiAway() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\" , \"/directory2/directory3\", \n \"/directory2/directory3/directory4\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"directory2/directory3/directory4\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2/directory3/directory4\", myTree.pwd());\n }", "@Test\n public void testCdAbsolutePathOneAway() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"/directory2\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2\", myTree.pwd());\n }", "private void recallLastDir(String name) {\r\n\t\tString lastDir = prefs.get( PREFS_KEY+name , null ) ;\r\n\t\tif ( lastDir==null ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tFile last = new File( lastDir ) ;\r\n\t\tif ( last.exists() && last.isDirectory() ) {\r\n\t\t\tsetCurrentDirectory( last );\r\n\t\t}\r\n\t}", "public Directory(IDirectory parentDirectory, String name) {\n super(name);\n this.parent = parentDirectory;\n }", "private File createDirectoryIfNotExisting( String dirName ) throws HarvesterIOException\n {\n \tFile path = FileHandler.getFile( dirName );\n \tif ( !path.exists() )\n \t{\n \t log.info( String.format( \"Creating directory: %s\", dirName ) );\n \t // create path:\n \t if ( !path.mkdir() )\n \t {\n \t\tString errMsg = String.format( \"Could not create necessary directory: %s\", dirName );\n \t\tlog.error( errMsg );\n \t\tthrow new HarvesterIOException( errMsg );\n \t }\n \t}\n \t\n \treturn path;\n }", "public Directory(String dirName) {\n setDirName(dirName);\n }", "public Builder setDirName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n dirName_ = value;\n onChanged();\n return this;\n }", "@Test\n public void testMkdirOneDirectoryRelativePathOneDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"directory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1\"), true);\n }", "@Override\n protected NodeInfo createDirectoryEntry(NodeInfo parentEntry, Path dir) throws IOException {\n return drive.createFolder(parentEntry.getId(), toFilenameString(dir));\n }", "private void setLastDir( String name, File last ) {\r\n\t\tif ( last.isDirectory() ) {\r\n\t\t\tprefs.put( PREFS_KEY+name, last.getAbsolutePath() );\r\n\t\t} else {\r\n\t\t\tprefs.put( PREFS_KEY+name, last.getParentFile().getAbsolutePath());\r\n\t\t}\r\n\t}", "public void newFolderButtonClicked() {\n TreePath[] paths = _fileSystemTree.getSelectionPaths();\r\n List selection = getSelectedFolders(paths);\r\n if (selection.size() > 1 || selection.size() == 0)\r\n return; // should never happen\r\n \r\n File parent = (File) selection.get(0);\r\n \r\n final ResourceBundle resourceBundle = FolderChooserResource.getResourceBundle(Locale.getDefault());\r\n String folderName = JOptionPane.showInputDialog(_folderChooser, resourceBundle.getString(\"FolderChooser.new.folderName\"),\r\n resourceBundle.getString(\"FolderChooser.new.title\"), JOptionPane.OK_CANCEL_OPTION | JOptionPane.QUESTION_MESSAGE);\r\n \r\n if (folderName != null) {\r\n File newFolder = new File(parent, folderName);\r\n boolean success = newFolder.mkdir();\r\n \r\n TreePath parentPath = paths[0];\r\n boolean isExpanded = _fileSystemTree.isExpanded(parentPath);\r\n if (!isExpanded) { // expand it first\r\n _fileSystemTree.expandPath(parentPath);\r\n }\r\n \r\n LazyMutableTreeNode parentTreeNode = (LazyMutableTreeNode) parentPath.getLastPathComponent();\r\n BasicFileSystemTreeNode child = BasicFileSystemTreeNode.createFileSystemTreeNode(newFolder, _folderChooser);\r\n // child.setParent(parentTreeNode);\r\n if (success) {\r\n parentTreeNode.clear();\r\n int insertIndex = _fileSystemTree.getModel().getIndexOfChild(parentTreeNode, child);\r\n if (insertIndex != -1) {\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).insertNodeInto(child, parentTreeNode, insertIndex);\r\n ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).nodeStructureChanged(parentTreeNode);\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).addPath(parentPath, insertIndex, child);\r\n }\r\n }\r\n TreePath newPath = parentPath.pathByAddingChild(child);\r\n _fileSystemTree.setSelectionPath(newPath);\r\n _fileSystemTree.scrollPathToVisible(newPath);\r\n }\r\n }", "void setDirectory(File dir);", "public void renameTree(String oldName, String newName) throws DuplicateNameException;", "public void setCurrentDirectory(File dir) {\r\n\tif (dir == null) dir = new File(System.getProperty(\"user.home\"));\r\n\r\n\tdir = makeAbsolute(dir);\r\n\r\n\t/**\r\n\t * Note that we compare literal paths, not canonical\r\n\t * paths. If they want the chooser to represent the\r\n\t * files at the end of a different route to the same\r\n\t * place, that's perfectly legitimate. See NextStep\r\n\t * for e.g.\r\n\t */\r\n\tif (curDir == null || !curDir.equals(dir)) {\r\n\t invalidateCache();\r\n\t File oldDir = curDir;\r\n\t curDir = dir;\r\n\t firePropertyChange(\"currentDirectory\", oldDir, dir);\r\n\t fireContentsChanged();\r\n\t}\r\n }", "public int mkdirs(String callingPkg, String path) throws RemoteException;", "@Override\n public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n if (!this.sourceDirectory.equals(dir)) {\n // Create this directory in the target and make it our current target.\n Path newDirectory = this.currentTargetDirectory.resolve(dir.getFileName());\n boolean didCreate = newDirectory.toFile().mkdir();\n Assert.assertTrue(didCreate);\n logger.output(\"Created directory: \" + newDirectory);\n this.currentTargetDirectory = newDirectory;\n }\n return FileVisitResult.CONTINUE;\n }", "protected void changeDirection(Direction newDir)\n {\n // Change direction.\n myDir = newDir;\n }", "private void createNewDirectory() {\n getMainWindow().addWindow(\n new TextInputDialog(\n \"Create Directory\",\n \"Create Directory\",\n \"New Folder\",\n new TextInputDialog.Callback() {\n public void onDialogResult(boolean happy, String newDirectory) {\n if ( happy\n && isValidFile(newDirectory)) {\n try {\n // Verzeichnis anlegen\n File newDir = getFile(newDirectory);\n if (!newDir.exists()) {\n newDir.mkdir(0755);\n }\n // Prüfen, ob das Verzeichnis angelegt wurde\n if (newDir.exists()) {\n loadXtreemFSData();\n showNotification(\"Success\", \"Directory \" + newDirectory + \" created.\", Notification.TYPE_TRAY_NOTIFICATION, null);\n }\n else {\n showNotification(\"Error\", \"Directory \" + newDirectory + \" could not be created.\", Notification.TYPE_WARNING_MESSAGE, null);\n }\n } catch (IOException e) {\n showNotification(\"Error\", e.toString(), Notification.TYPE_ERROR_MESSAGE, e);\n }\n }\n }\n }));\n }", "private static void makeDirPath(String targetAddr) {\n\t\tString parentPath = PathUtil.getImgBasePath() + targetAddr;\r\n\t\tFile dirPath = new File(parentPath);\r\n\t\tif (!dirPath.exists()) {\r\n\t\t\tdirPath.mkdirs();\r\n\t\t}\r\n\t}", "private void createFolder(String myFilesystemDirectory) {\n\r\n File file = new File(myFilesystemDirectory);\r\n try {\r\n if (!file.exists()) {\r\n //modified \r\n file.mkdirs();\r\n }\r\n } catch (SecurityException e) {\r\n Utilidades.escribeLog(\"Error al crear carpeta: \" + e.getMessage());\r\n }\r\n }", "@NonNull\n Completable renameFolder(@NonNull String oldName, @NonNull String newName);", "private void createDirectory(String path) throws IOException {\n\t\tfinal Path p = Paths.get(path);\n\t\tif (!fileExists(p)) {\n\t\t\tFiles.createDirectory(p);\n\t\t}\n\t}", "@Test\n public void testCdAbsolutePathMultiDeepToOneDeep() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\" , \"/directory2/directory3\", \n \"/directory2/directory3/directory4\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"/directory2/directory3/directory4\");\n myTree.cd(\"/directory2/directory3\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2/directory3\", myTree.pwd());\n }", "public boolean makeDirectory( String directory, FileType type );", "@Test\n public void testCdRelativePathMultiDeepToOneDeeper() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\" , \"/directory2/directory3\", \n \"/directory2/directory3/directory4\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"/directory2/directory3\");\n myTree.cd(\"directory4\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2/directory3/directory4\", myTree.pwd());\n }", "@Override\r\n public void executeCommand(ArrayList<String> arguments) {\r\n // if there is arguments\r\n if (arguments.size() > 0) {\r\n if (arguments.get(0).equals(\"..\")) {\r\n // get the parentDirectory\r\n Directory parent = fileSystem.getCurrentDirectory().getParentDir();\r\n // set the currentDirectory as previous directory\r\n if (parent != null) {\r\n fileSystem.setCurrentDirectory(parent);\r\n }\r\n } else if (arguments.get(0).equals(\".\")) {\r\n // Does nothing\r\n } else {\r\n // change the directory to the given Directory\r\n changeDirectory(arguments.get(0));\r\n }\r\n } else {\r\n this.setError(\"Given a Directory to change.\");\r\n }\r\n }", "public void createDirectory() {\r\n\t\tpath = env.getProperty(\"resources\") + \"/\" + Year.now().getValue() + \"/\";\r\n\t\tFile file = new File(path);\r\n\t\tif (!file.exists())\r\n\t\t\tfile.mkdirs();\r\n\t}", "public void mkdir(String name) throws FileExistsException\n\t{\n\t\tcheckMakeFile(name);\n\t\tFileElement add = new FileElement(name, true);\n\t\tfileSystem.addChild(currentFileElement, add);\n\t}", "private void setLabtainersDir() throws IOException{\n String newLabtainersPath = LabtainersDirTextfield.getText();\n \n // check if labtainers path exist\n if(new File(newLabtainersPath).isDirectory()){\n pathValidLabel.setVisible(false);\n \n FileOutputStream out = new FileOutputStream(iniFile);\n writeValueToINI(out, \"labtainersPath\", newLabtainersPath);\n\n labtainerPath = newLabtainersPath;\n updateLabtainersPath();\n \n LabtainersDirDialog.setVisible(false);\n }\n else{\n pathValidLabel.setVisible(true);\n } \n }", "private void makeDir(String targetDir){\n\t\tchar letter = 'A';\n\t\tnew File(targetDir + \"\\\\Sorted Music\").mkdir();\n\t\t\n\t\tfor (int i = 0; i < 26; i++){\n\t\t\tnew File(targetDir + \"\\\\Sorted Music\\\\\" + letter).mkdir();\n\t\t\tletter++;\n\t\t}\n\t}", "@Test\n public void testCdAbsolutePathMultiAway() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\" , \"/directory2/directory3\", \n \"/directory2/directory3/directory4\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"/directory2/directory3/directory4\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2/directory3/directory4\", myTree.pwd());\n }", "public void changePath(String newPath){\n this.path=newPath;\n }", "public void updateLabtainersPath(){\n labsPath = new File(labtainerPath + File.separator + \"labs\");\n labChooser.setCurrentDirectory(labsPath); \n }", "private String nextStepToDirectory(File currentDir, File targetDir) {\n String fileName = targetDir.getAbsolutePath();\n // Removes the current directory path from the target's path\n fileName = fileName.replace(currentDir.getAbsolutePath(), \"\");\n if (fileName.startsWith(File.separator)) {\n fileName = fileName.substring(1);\n }\n if (fileName.contains(File.separator)) {\n // Keeps only the first directory's name in the path\n fileName = fileName.substring(0, fileName.indexOf(File.separator));\n }\n return fileName;\n }", "@Test\n public void testMkdirOneDirectoryAbsolutePathOneDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"/directory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 already exists or the path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1\"), true);\n }", "private static void createDirectory(Path path) throws IOException {\n\t\ttry {\n\t\t\tFiles.createDirectory(path);\n\t\t} catch (FileAlreadyExistsException e) {\n\t\t\tif (!Files.isDirectory(path)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}", "@Test\n\tpublic void Directories() {\n\t\t\n\t\tString dirs = \"test/one/two/\";\n\t\tFile d = new File(dirs);\n\t\td.mkdirs();\n\t\tAssert.assertTrue(d.exists());\n\t\t\n\t\t//Cleanup\n\t\tif(d.delete()) {\n\t\t\td = new File(\"test/one\");\n\t\t\tif(d.delete()) {\n\t\t\t\td = new File(\"test\");\n\t\t\t\td.delete();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static void dir(String currentPath){}", "public static native void mkdirs(String path, int mode) throws IOException;", "@Test\r\n public void moveToFileWithSameName() {\r\n currentDirectory.addNewFile(\"file\");\r\n Dir dirWithFile = currentDirectory.getSubDirectoryByName(\"child\");\r\n File fileWithContents = dirWithFile.getFileByName(\"file\");\r\n fileWithContents.setContent(\"content\");\r\n command.executeCommand(\"file\", \"child/file\", root, currentDirectory);\r\n File fileInRoot = currentDirectory.getFileByName(\"file\");\r\n // content in file in root is removed\r\n assertTrue(fileInRoot.getContents().equals(\"\"));\r\n }", "@Test\n public void testMkdirOneDirectoryRelativePathMultipleDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"directory1\", \"directory1/subDirectory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"A already exists or a path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1/subDirectory1\"), true);\n }", "public void copy(String name, String oldPath, String newPath);", "private DirectoryObjects getDirectory(String path, DirectoryObjects current) {\n\t\tif (path.lastIndexOf(\"/\") == 0) {\n\t\t\treturn current;// done\n\t\t} else {\n\t\t\t// parse directories...\n\t\t\tArrayList<String> direcs = new ArrayList<>();\n\t\t\tString temp = path;\n\t\t\tboolean cont = true;\n\t\t\ttemp = temp.substring(1);\n\t\t\twhile (temp.length() > 1 && cont) {\n\n\t\t\t\t// add the substring to the list of directories that need to be\n\t\t\t\t// checked and/or created\n\t\t\t\tdirecs.add(temp.substring(0, temp.indexOf(\"/\")));\n\t\t\t\t// if there are more \"/\"s left, repeat\n\t\t\t\tif (temp.contains(\"/\")) {\n\t\t\t\t\ttemp = temp.substring(temp.indexOf(\"/\") + 1);\n\t\t\t\t}\n\t\t\t\t// else break out of the loop\n\t\t\t\telse {\n\t\t\t\t\tcont = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// do one last check to see if there are any extra characters left\n\t\t\tif (temp.length() > 0) {\n\t\t\t\t// there is still something left\n\t\t\t\tdirecs.add(temp);\n\t\t\t}\n\n\t\t\t// go through each directory, checking if it exists. if not, create\n\t\t\t// the directory and repeat.\n\t\t\tDirectoryObjects l = current;\n\n\t\t\tfor (String p : direcs) {\n\n\t\t\t\tif (l.getDirectoryByName(p) != null) {\n\t\t\t\t\tl = l.getDirectoryByName(p);\n\t\t\t\t} else {\n\t\t\t\t\t// instead of creating a new directory, we just throw an\n\t\t\t\t\t// exception\n\t\t\t\t\treturn l;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn l;\n\n\t\t}\n\n\t}", "public void addChild(DirectoryNode node) throws FullDirectoryException, NotADirectoryException {\n if(isFile)\n throw new NotADirectoryException(\"Error: This node is a file\");\n if(left != null && middle != null && right != null)\n throw new FullDirectoryException(\"This directory is full\");\n if(left == null)\n left = node;\n else if(middle == null)\n middle = node;\n else if(right == null)\n right = node;\n }", "public void mkdirP(String dirPath) {\n\n\t\t// check if you need to go anywhere further\n\t\tif (dirPath.lastIndexOf(\"/\") == 0) {\n\t\t\treturn;// done\n\t\t} else {\n\t\t\t// parse directories...\n\t\t\tArrayList<String> direcs = new ArrayList<>();\n\t\t\tString temp = dirPath;\n\t\t\tboolean cont = true;\n\t\t\ttemp = temp.substring(1);\n\t\t\twhile (temp.length() > 1 && cont) {\n\n\t\t\t\t// add the substring to the list of directories that need to be\n\t\t\t\t// checked and/or created\n\t\t\t\tdirecs.add(temp.substring(0, temp.indexOf(\"/\")));\n\t\t\t\t// if there are more \"/\"s left, repeat\n\t\t\t\tif (temp.contains(\"/\")) {\n\t\t\t\t\ttemp = temp.substring(temp.indexOf(\"/\") + 1);\n\t\t\t\t}\n\t\t\t\t// else break out of the loop\n\t\t\t\telse {\n\t\t\t\t\tcont = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// do one last check to see if there are any extra characters left\n\t\t\tif (temp.length() > 0) {\n\t\t\t\t// there is still something left\n\t\t\t\tdirecs.add(temp);\n\t\t\t}\n\n\t\t\t// go through each directory, checking if it exists. if not, create\n\t\t\t// the directory and repeat.\n\t\t\tDirectoryObjects current = directory;\n\n\t\t\tfor (String p : direcs) {\n\n\t\t\t\tif (current.getDirectoryByName(p) != null) {\n\t\t\t\t\tcurrent = current.getDirectoryByName(p);\n\t\t\t\t} else {\n\t\t\t\t\tcurrent.getSubdirectories().add(new DirectoryObjects(p));\n\t\t\t\t\tcurrent = current.getDirectoryByName(p);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "private void moveToFinal(String imageName, String sourceDirectory,\n\t\t\t\tString destinationDirectory) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\ttry {\n\n\t\t\t\tFile afile = new File(sourceDirectory + imageName);\n\t\t\t\tFile bfile = new File(destinationDirectory + imageName);\n\t\t\t\tif (afile.renameTo(bfile)) {\n\t\t\t\t\tSystem.out.println(\"File is moved successful!\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"File is failed to move!\");\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}", "private void createFolder(String name, String path, Long id) {\n VMDirectory newDir = new VMDirectory();\n newDir.setName(name);\n editResourceService.createDir(id, name, new AsyncCallback<Long>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.say(caught.getMessage());\n }\n\n @Override\n public void onSuccess(Long result) {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, id), newDir, result, true);\n folderPath_idMap.put(path, result);\n fileTreeNodeFactory.refresh(editorTabSet, tree, tabRegs);\n treeGrid.sort();\n treeGrid.redraw();\n }\n });\n }", "public void setDir(String dir) {\n // Do this before setting the value\n boolean dirChanged = dir != null && !dir.equals(this.getDir());\n this.dir = Paths.get(dir);\n if(dirChanged) {\n this.dirChanged();\n }\n }", "public static boolean renameRootTarget(RootFile before, RootFile after) {\n File file = new File(before.getParent() + File.separator + before.getName());\n File newf = new File(after.getParent() + File.separator + after.getName());\n\n if (after.getName().length() < 1)\n return false;\n\n try {\n if (!readReadWriteFile())\n RootTools.remount(before.getPath(), \"rw\");\n\n execute(\"mv \" + getCommandLineString(file.getAbsolutePath()) + \" \"\n + getCommandLineString(newf.getAbsolutePath()));\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "@Test\n public void testCdRelativePathOneDeepToMultiDeep() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\" , \"/directory2/directory3\", \n \"/directory2/directory3/directory4\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"directory2\");\n myTree.cd(\"directory3/directory4\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2/directory3/directory4\", myTree.pwd());\n }", "@PostMapping(\"/renamefolder\")\n public String renameFolder(@RequestParam String currentPath, @RequestParam(name = \"renamedFolder\") String directory, @RequestParam(name = \"newFolderName\") String newFolderName, RedirectAttributes redirectAttributes) {\n logger.log(Level.INFO, \"Renaming folder...\");\n if(uiCommandService.renameFile(directory, newFolderName)) {\n redirectAttributes.addFlashAttribute(\"success_messages\",\"[Successfully renamed \" + new File(directory).getName() + \" to \" + newFolderName + \"!]\");\n logger.log(Level.INFO, \"Finished renaming folder!\");\n } else {\n redirectAttributes.addFlashAttribute(\"error_messages\", \"[\"+ newFolderName +\" already exists!]\");\n logger.log(Level.INFO, \"Renaming interrupted\");\n }\n return \"redirect:/imageview?location=\" + currentPath.replace(\"\\\\\", \"/\");\n }", "private void createLocalFolder(File newFolder) {\n\n if (!newFolder.exists()) {\n newFolder.mkdirs();\n //TODO: what if the folder can't be created?\n PieLogger.trace(this.getClass(), \"Folder created!\");\n } else {\n PieLogger.debug(this.getClass(), \"Folder exits already?!\");\n }\n }", "@Test\n public void testMkdirOneDirectoryAbsolutePathMultipleDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"/directory1\", \"/directory1/subDirectory1\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"A already exists or a path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1/subDirectory1\"), true);\n }", "@Test\n public void testCdAbsolutePathOneDeepToMultiDeep() {\n FileTree myTree = new FileTree();\n String[] path1 = {\"directory2\" , \"/directory2/directory3\", \n \"/directory2/directory3/directory4\"};\n try {\n myTree.mkdir(path1);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"The directories could not be made.\");\n }\n try {\n myTree.cd(\"directory2\");\n myTree.cd(\"/directory2/directory3/directory4\");\n } catch (NotDirectoryException e) {\n fail(\"Could not change to the directory\");\n }\n assertEquals(\"/directory2/directory3/directory4\", myTree.pwd());\n }", "public static boolean createRootFile(String parentPath, String name) {\n File dir = new File(parentPath + File.separator + name);\n\n if (dir.exists())\n return false;\n\n try {\n if (!readReadWriteFile())\n RootTools.remount(parentPath, \"rw\");\n\n execute(\"touch \" + getCommandLineString(dir.getAbsolutePath()));\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "@Test\n public void testMkdirMultipleDirectoriesRelativePathOneDeep() {\n FileTree myTree = new FileTree();\n String[] path = {\"directory1\", \"directory2\"};\n try {\n myTree.mkdir(path);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"directory1 or directory2 already exists or the path is invalid.\");\n }\n assertEquals(myTree.hasDirectory(\"/directory1\"), true);\n assertEquals(myTree.hasDirectory(\"/directory2\"), true);\n }", "@Override\n\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n\t\t\t\tPath resolve = target.resolve(source.relativize(dir));\n\t\t\t\tFile resolve_file = resolve.toFile();\n\n\t\t\t\tif (resolve_file.exists() == false) {\n\t\t\t\t\tFiles.createDirectory(resolve);\n\t\t\t\t} else {\n\t\t\t\t\t// delete old data in sub-directories\n\t\t\t\t\t// without deleting the directory\n\t\t\t\t\tArrays.asList(resolve_file.listFiles()).forEach(File::delete);\n\t\t\t\t}\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}", "public void mkdir(String path) throws SystemException;", "private void setUpDirectories() {\r\n\t\tFile creation = new File(\"Creations\");\r\n\t\tFile audio = new File(\"Audio\");\r\n\t\tFile quiz = new File(\"Quiz\");\r\n\t\tFile temp = new File(\"Temp\");\r\n\r\n\t\tif (!creation.isDirectory()) {\r\n\t\t\tcreation.mkdir();\r\n\t\t}\r\n\t\tif (!audio.isDirectory()) {\r\n\t\t\taudio.mkdir();\r\n\t\t}\r\n\t\tif (!quiz.isDirectory()) {\r\n\t\t\tquiz.mkdir();\r\n\t\t}\r\n\t\tif (!temp.isDirectory()) {\r\n\t\t\ttemp.mkdir();\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args){\nFile from = new File(\"d:/prac/shubha.txt\");\r\n//rename and change the file and folder\r\nFile to = new File(\"d:/prac/Sub1/shubha.txt\");\r\n//Rename\r\nif (from.renameTo(to))\r\nSystem.out.println(\"Successfully Moved the file\");\r\nelse\r\nSystem.out.println(\"Error while moving the file\");\r\n}" ]
[ "0.6975805", "0.6963803", "0.66689783", "0.65526646", "0.6480391", "0.64651054", "0.6429315", "0.63442266", "0.6343012", "0.633613", "0.62055355", "0.61427635", "0.61133766", "0.6075952", "0.60227555", "0.6009326", "0.6000873", "0.5963595", "0.5935294", "0.5924341", "0.5859555", "0.5804192", "0.5768387", "0.57663834", "0.5732459", "0.57272226", "0.56979406", "0.5645057", "0.5613445", "0.5577376", "0.5555542", "0.55460113", "0.5521641", "0.55035794", "0.5503228", "0.54899144", "0.5460423", "0.54596514", "0.543183", "0.54105836", "0.53861815", "0.5373341", "0.53690076", "0.5368191", "0.5331864", "0.53218246", "0.5321336", "0.5301949", "0.5295849", "0.52886844", "0.527984", "0.527532", "0.52725446", "0.5253941", "0.52258575", "0.52177453", "0.5217419", "0.5182802", "0.5182049", "0.5168724", "0.5162119", "0.5154192", "0.5153589", "0.51519436", "0.5148527", "0.5146115", "0.5140151", "0.5139322", "0.51125914", "0.51124996", "0.5095795", "0.5078287", "0.5077646", "0.50723094", "0.5068799", "0.5064417", "0.505476", "0.5054352", "0.5050584", "0.504854", "0.50432706", "0.5042701", "0.5033303", "0.50296557", "0.5020262", "0.5017864", "0.4999997", "0.49996814", "0.4997643", "0.49908498", "0.498456", "0.4981456", "0.49786243", "0.49751353", "0.4965213", "0.49616408", "0.4958483", "0.4953213", "0.49495548", "0.49443206" ]
0.6195604
11
Removes the file "name" from the currentDirectory Throws if "name" refers to a directory or doesn't exist
public void rm(String name) throws IsDirectoryException, NoSuchFileException { Iterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement); if (toCheck != null) { for (Position<FileElement> fe : toCheck ) { if (fe.toString().equals(name) && fe.getValue().isDirectory() ) { throw new IsDirectoryException(); } if (fe.toString().equals(name) && fe.getValue().isDirectory() == false) { fileSystem.remove(fe); } } } else {throw new NoSuchFileException();} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void delete(String name) {\n File f = new File(name);\n if (f.exists()) {\n f.delete();\n }\n }", "private static void removeFromWorking(String fileName) {\n for (File file : WORKING_DIR.listFiles()) {\n if (!file.isDirectory()) {\n if (file.getName().equals(fileName)) {\n file.delete();\n break;\n }\n }\n }\n }", "private void deleteFile() {\n\t\tFile dir = getFilesDir();\n\t\tFile file = new File(dir, FILENAME);\n\t\tfile.delete();\n\t}", "public void delete_file(String file_name) throws Exception{\n\t\tFile file = new File(file_name);\n\t\tif (file.exists() && file.isFile()) file.delete();\n\t\telse if(file.isDirectory()){\n\t\t\tfor(File f : file.listFiles()){\n\t\t\t\tdelete_file(f.getAbsolutePath());\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "private static void removeFile(File fileDir) throws Exception {\n String fileName = getFileNameInput();\n File fileToRemove = new File(fileDir.toString() + \"\\\\\" + fileName);\n boolean fileRemoved = fileToRemove.delete();\n if (fileRemoved) {\n System.out.println(\"File removed successfully.\");\n } else {\n throw new FileNotFoundException(\"No such file under current directory.\");\n }\n }", "public void rmdir(String name) \n\t\t\tthrows NoSuchDirectoryException, IsFileException, DirectoryNotEmptyException\n\t{\n\t\tIterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement);\n\t\tif (toCheck != null)\n\t\t{\n\t\t\tfor (Position<FileElement> fe : toCheck )\n\t\t\t{\n\t\t\t\tif (fe.toString().equals(name) && fe.getValue().isDirectory() == false)\n\t\t\t\t{\n\t\t\t\t\tthrow new IsFileException();\n\t\t\t\t}\n\t\t\t\telse if (fe.toString().equals(name) && fe.getValue().isDirectory())\n\t\t\t\t{\n\t\t\t\t\tif (fileSystem.remove(fe) == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new DirectoryNotEmptyException();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {throw new NoSuchDirectoryException();}\n\t}", "public static void doRemove(String fileName) {\n Stage fromSave = Utils.readObject(STAGED_FILES,\n Stage.class);\n HashSet<String> stagedFiles = fromSave.getStagedFiles();\n Commit currHead = Utils.readObject(TREE_DIR, Tree.class).\n getCurrHead();\n if (stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (stagedFiles.contains(fileName) && !currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (!stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n if (!Utils.filesSet(WORKING_DIR).contains(fileName)) {\n File removedFile = Utils.join(STAGE_RM_DIR, fileName);\n try {\n removedFile.createNewFile();\n } catch (IOException ignored) {\n return;\n }\n String contents = currHead.getBlobs().get(fileName).\n getContents();\n Utils.writeContents(removedFile, contents);\n } else {\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n }\n } else {\n System.out.println(\"No reason to remove the file.\");\n System.exit(0);\n }\n }", "public void delete( String name) throws PhileNotFoundException {\n\t\tif (!fileList.containsKey(name)) {\n\t\t\tthrow new PhileNotFoundException(\"File doesn't exist\");\n\t\t}\n\t\telse {\n\t\t\tPhile phile = fileList.get(name);\n\t\t\tfileList.remove(name);\n\t\t\ttotalNumberOfFiles--;\n\t\t\tif (openFiles.contains(phile)) {\n\t\t\t\topenFiles.remove(phile);\n\t\t\t\tnumberOfOpenFiles--;\n\t\t\t}\n\t\t}\n }", "@Override\r\n\tpublic void remFile(String path) {\n\t\t\r\n\t}", "private static void deleteFile(String fileName) {\n\t\tFile f = new File(fileName);\n\n\t\t// Make sure the file or directory exists and isn't write protected\n\t\tif (!f.exists())\n\t\t\treturn;\n\t\t// throw new IllegalArgumentException(\"Delete: no such file or directory: \" + fileName);\n\n\t\tif (!f.canWrite())\n\t\t\tthrow new IllegalArgumentException(\"Delete: write protected: \"\n\t\t\t\t\t+ fileName);\n\n\t\t// If it is a directory, make sure it is empty\n\t\tif (f.isDirectory()) {\n\t\t\tString[] files = f.list();\n\t\t\tif (files.length > 0)\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Delete: directory not empty: \" + fileName);\n\t\t}\n\n\t\t// Attempt to delete it\n\t\tboolean success = f.delete();\n\n\t\tif (!success)\n\t\t\tthrow new IllegalArgumentException(\"Delete: deletion failed\");\n\t}", "public void deleteImgFromDirectory1(String fileName) {\n File f = new File(fileName);\r\n\r\n // Mi assicuro che il file esista\r\n if (!f.exists()) {\r\n throw new IllegalArgumentException(\"Il File o la Directory non esiste: \" + fileName);\r\n }\r\n\r\n // Mi assicuro che il file sia scrivibile\r\n if (!f.canWrite()) {\r\n throw new IllegalArgumentException(\"Non ho il permesso di scrittura: \" + fileName);\r\n }\r\n\r\n // Se è una cartella verifico che sia vuota\r\n if (f.isDirectory()) {\r\n String[] files = f.list();\r\n if (files.length > 0) {\r\n throw new IllegalArgumentException(\"La Directory non è vuota: \" + fileName);\r\n }\r\n }\r\n\r\n // Profo a cancellare\r\n boolean success = f.delete();\r\n\r\n // Se si è verificato un errore...\r\n if (!success) {\r\n throw new IllegalArgumentException(\"Cancellazione fallita\");\r\n }\r\n }", "@Override\r\n\tpublic void remDir(String path) {\n\t\t\r\n\t}", "public static void remove(File file) throws IOException {\n\t\tif (!file.exists())\n\t\t\treturn;\n\t\tif (file.isDirectory()) {\n\t\t\tFile[] files = file.listFiles();\n\t\t\tfor (File f : files)\n\t\t\t\tremove(f);\n\t\t}\n\t\tif (!file.delete())\n\t\t\tthrow new IOException(\"Can't delete the file \\\"\"\n\t\t\t\t\t+ file.getAbsolutePath() + \"\\\"\");\n\t}", "private void deleteFile(java.io.File file) {\n if (file.isDirectory()) {\n for (java.io.File f : file.listFiles()) \n deleteFile(f);\n }\n \n if (!file.delete())\n try {\n throw new FileNotFoundException(\"Failed to delete file: \" + file.getName());\n } catch (FileNotFoundException e) {\n System.err.println(\"Delete of file \" + file.getAbsolutePath() + \" failed\");\n e.printStackTrace();\n }\n }", "private void delete(File file) {\n if (file.isDirectory()) {\n cleanDirectory(file);\n }\n file.delete();\n }", "public static void deleteFolder(String name) {\n File dir = new File(Environment.getExternalStorageDirectory() + name);\n if (dir.isDirectory()) {\n dir.delete();\n }\n }", "private static void deleteFileOrDir(File file)\n {\n if (file.isDirectory())\n {\n File[] childs = file.listFiles();\n for (int i = 0;i < childs.length;i++)\n {\n deleteFileOrDir(childs[i]);\n }\n }\n file.delete();\n }", "public void remove(File file) throws IOException {\n String fileName = file.getName();\n File realFile = new File(INDEX, fileName);\n boolean isStaged = realFile.exists();\n Commit curCommit = getHeadCommit();\n if (isStaged) {\n realFile.delete();\n }\n HashMap<String, Blob> filesInHeadCommit = curCommit.getFile();\n boolean trackedByCurrCommit = filesInHeadCommit.containsKey(fileName);\n if (trackedByCurrCommit) {\n if (file.exists()) {\n file.delete();\n }\n String content = filesInHeadCommit.get(fileName).getContent();\n File fileInRemovingStage = new File(REMOVAL, fileName);\n if (!fileInRemovingStage.exists()) {\n fileInRemovingStage.createNewFile();\n }\n Utils.writeContents(fileInRemovingStage, content);\n }\n if (!isStaged && !trackedByCurrCommit) {\n System.out.println(\"No reason to remove the file.\");\n System.exit(0);\n }\n\n }", "private void clean(Path path) throws IOException {\n if (Files.exists(path)) {\n Files.walkFileTree(path, new SimpleFileVisitor<>() {\n public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n\n public FileVisitResult postVisitDirectory(Path path, IOException exception) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n });\n }\n }", "public void removeFile(String filename){\r\n\t\t//take it out of the input node\r\n\t\tFileInfo f = (FileInfo) input.getFirstChild();\r\n\t\t//go through all the files of the input node\r\n\t\twhile(f != null){\r\n\t\t\t//check the file\r\n\t\t\tif(filename.equals(f.toString())){\r\n\t\t\t\t\t//remove the node\r\n\t\t\t\t\tf.removeFromParent();\r\n\t\t\t\t\t//notify the tree that the node\r\n\t\t\t\t\t//...has changed\r\n\t\t\t\t\tif(parentTree != null)\r\n\t\t\t\t\t\tparentTree.nodeStructureChanged(input);\r\n\t\t\t}\r\n\t\t\t//check the rest of the files\r\n\t\t\tf = (FileInfo)f.getNextSibling();\r\n\t\t}\r\n\t\t\r\n\t\t//take it out of the output note\r\n\t\tf = (FileInfo) output.getFirstChild();\r\n\t\t\r\n\t\twhile(f != null){\r\n\t\t\tif(filename.equals(f.toString())){\r\n\t\t\t\tf.removeFromParent();\r\n\t\t\t\tif(parentTree != null)\r\n\t\t\t\t\tparentTree.nodeStructureChanged(output);\r\n\t\t\r\n\t\t\t}\r\n\t\t\tf = (FileInfo)f.getNextSibling();\r\n\t\t}\r\n\t\t\r\n\t}", "public static void deleteFile()\n\t{\n\t\t//Variable Declaration\n\t\tString fileName;\n\t\tScanner obj = new Scanner(System.in);\n\t\t\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter file name to delete:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Deleting the file\n\t\tboolean isDeleted = FileManager.deleteFile(folderpath, fileName);\n\t\t\n\t\tif(isDeleted)\n\t\t\tSystem.out.println(\"File deleted successfully\");\n\t\telse\n\t\t\tSystem.out.println(\"File not found! Enter valid file name.\");\n\t}", "public void deleteFile(File f);", "public static void clearFile(File fileName)\r\n {\r\n try \r\n {\r\n FileWriter fw = new FileWriter(fileName);\r\n fw.write(\"\");\r\n\r\n fw.close();\r\n }\r\n catch(IOException ioe)\r\n {\r\n //Output error message \r\n System.out.println(ioe); \r\n }\r\n }", "private void cleanFile(IFile file) {\n \t\tlog(\" Cleaning build directory for \" + file.getName());\n \t\t\n \t\tString buildDir = getBuildDirectory(file);\n \t\t// Check the build directory and try to create it\n \t\tFile buildDirFile = new File(buildDir);\n \t\tif (buildDirFile.exists()) {\n \t\t\tFile[] files = buildDirFile.listFiles();\n \t\t\tfor (File f : files) {\n \t\t\t\ttry {\n \t\t\t\t\tf.delete();\n \t\t\t\t\tlog(\" - \" + f.getName());\n \t\t\t\t} catch (Exception _) {\n \t\t\t\t\tlog(\" > Failed: \" + f.getName());\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public int remove(String pathname) throws YAPI_Exception\n {\n byte[] json = new byte[0];\n String res;\n json = sendCommand(String.format(Locale.US, \"del&f=%s\",pathname));\n res = _json_get_key(json, \"res\");\n //noinspection DoubleNegation\n if (!(res.equals(\"ok\"))) { throw new YAPI_Exception( YAPI.IO_ERROR, \"unable to remove file\");}\n return YAPI.SUCCESS;\n }", "void deleteFile(FsPath path);", "public void delete_File(){\n context.deleteFile(Constant.FILE_NAME);\n }", "public void removeFromFile(String pathName, String removeFile) throws IOException{\n FileInputStream fis = new FileInputStream(pathName);\n\n Scanner reader = new Scanner(fis);\n StringBuilder dataKept = new StringBuilder();\n\n while(reader.hasNextLine()){\n String data = reader.nextLine().trim();\n\n if ( !data.equals(removeFile) ){\n dataKept.append(data).append(\"\\n\");\n }\n }\n\n FileWriter fl = new FileWriter(pathName);\n fl.write(\"\");\n FileOutputStream out = new FileOutputStream(pathName);\n out.write(dataKept.toString().trim().getBytes());\n fl.close();\n out.close();\n fis.close();\n }", "public void removeByname(java.lang.String name)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public static void deleteFile(File file){\r\n if(file.isFile()){\r\n file.delete();\r\n return;\r\n }\r\n if(file.isDirectory()){\r\n File[] childFile = file.listFiles();\r\n if(childFile == null || childFile.length == 0){\r\n file.delete();\r\n return;\r\n }\r\n for(File f : childFile){\r\n deleteFile(f);\r\n }\r\n file.delete();\r\n }\r\n }", "protected void remove(String filename) throws IOException {\n\t\tthrow new IOException( \"not implemented\" ); //TODO map this to the FileSystem\n\t}", "public static boolean deleteFileRoot(String path) {\n try {\n if (!readReadWriteFile())\n RootTools.remount(path, \"rw\");\n\n if (new File(path).isDirectory()) {\n execute(\"rm -f -r \" + getCommandLineString(path));\n } else {\n execute(\"rm -r \" + getCommandLineString(path));\n }\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "public synchronized void deleteRepository(String currentUser, String name) throws IOException {\n\n\t\tif (isAnonymousUser(currentUser)) {\n\t\t\tthrow new UserAccessException(\"Anonymous user not permitted to delete repository\");\n\t\t}\n\n\t\tvalidateUser(currentUser);\n\n\t\tRepository rep = repositoryMap.get(name);\n\t\tif (rep == null) {\n\t\t\treturn;\n\t\t}\n\n\t\trep.delete(currentUser);\n\n\t\tFile f = new File(rootDirFile, NamingUtilities.mangle(name));\n\t\tif (!FileUtilities.deleteDir(f)) {\n\t\t\tthrow new IOException(\"Failed to remove directory for \" + f.getAbsolutePath());\n\t\t}\n\n\t\trepositoryMap.remove(name);\n\t}", "private static void addToStageRemoval(String fileName) {\n File stagedFile = Utils.join(WORKING_DIR, fileName);\n File dest = Utils.join(STAGE_RM_DIR, fileName);\n Utils.copy(stagedFile, dest);\n }", "private int handleUnlink(String name) {\n\t\tboolean succeeded = ThreadedKernel.fileSystem.remove(name);\n\t\t//if the file was not removed return error\n\t\tif(!succeeded)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}", "public void unsetFileName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FILENAME$0, 0);\n }\n }", "public String clean(String file_name)\n\t{\n\t\treturn file_name;\n\t}", "public static void deleteFile(String inputFile){\n File file = new File(inputFile);\n //validate the file\n if(file.isFile()){\n try{\n if(file.delete())\n System.out.println(\"File \"+inputFile+\" has been deleted.\");\n else\n System.out.println(\"Error in deleting the file.\");\n }catch(Exception e){\n e.printStackTrace();\n }\n }else{\n System.out.println(\"Invalid file path.\");\n }\n }", "private void clearFiles() {\r\n File file = new File(\"test_files/upload\");\r\n File[] files = file.listFiles();\r\n for (File delFile : files) {\r\n delFile.delete();\r\n }\r\n file = new File(\"test_files/stress.jar\");\r\n file.delete();\r\n }", "public static void deletaArquivo(String nomeArquivo){\n\t\tboolean logExiste = false;\n\t\t\n\t\tFile file = new File(nomeArquivo);\n\t\tlogExiste = file.exists();\n\t\t\n\t\tif(logExiste){\n\t\t\tfile.delete();\n\t\t}\n\t}", "private void clearClipsDirectory(){\n /* Citation : http://helpdesk.objects.com.au/java/how-to-delete-all-files-in-a-directory#:~:text=Use%20the%20listFiles()%20method,used%20to%20delete%20each%20file. */\n File directory = new File(Main.CREATED_CLIPS_DIRECTORY_PATH);\n File[] files = directory.listFiles();\n if(files != null){\n for(File file : files){\n if(!file.delete()) System.out.println(\"Failed to remove file \" + file.getName() + \" from \" + Main.CREATED_CLIPS_DIRECTORY_PATH);\n }\n }\n }", "public static void delete(File file) throws IOException {\n String method = \"delete() - \";\n if ((file != null) && (file.exists())) {\n if (file.isDirectory()) {\n if (file.list().length == 0) {\n file.delete();\n }\n else {\n String files[] = file.list();\n for (String current : files) {\n File fileToDelete = new File(file, current);\n delete(fileToDelete);\n if (file.list().length == 0) {\n file.delete();\n }\n }\n }\n }\n else {\n file.delete();\n }\n }\n else {\n throw new IOException(method \n + \"The input file is null or does not exist.\");\n }\n }", "public static void delete(File file) {\n\n\t\tif (file.isDirectory()) {\n\n\t\t\t// directory is empty, then delete it\n\t\t\tif (file.list().length == 0) {\n\n\t\t\t\tfile.delete();\n\t\t\t\t// System.out.println(\"Directory is deleted : \" +\n\t\t\t\t// file.getAbsolutePath());\n\n\t\t\t} else {\n\n\t\t\t\t// list all the directory contents\n\t\t\t\tString files[] = file.list();\n\n\t\t\t\tfor (String temp : files) {\n\t\t\t\t\t// construct the file structure\n\t\t\t\t\tFile fileDelete = new File(file, temp);\n\n\t\t\t\t\t// recursive delete\n\t\t\t\t\tdelete(fileDelete);\n\t\t\t\t}\n\n\t\t\t\t// check the directory again, if empty then delete it\n\t\t\t\tif (file.list().length == 0) {\n\t\t\t\t\tfile.delete();\n\t\t\t\t\t// System.out.println(\"Directory is deleted : \" +\n\t\t\t\t\t// file.getAbsolutePath());\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// if file, then delete it\n\t\t\tfile.delete();\n\t\t\t// System.out.println(\"File is deleted : \" +\n\t\t\t// file.getAbsolutePath());\n\t\t}\n\t}", "@Override\n public void removeDirectory(File directory, boolean recursive) throws FileNotFoundException, IOException {\n }", "private static boolean deleteFileOrDirectory(String absoluteName) {\n\t\tString[] subnames = absoluteName.split(\"/\");\r\n\t\tint blockNumber = 0;\r\n\t\tint pos = 0;\r\n\r\n\t\twhile(pos < subnames.length)\r\n\t\t{\r\n\t\t if (pos + 1 == subnames.length)\r\n\t\t {\r\n\t\t \tint tmpBlockNumber;\r\n\t\t \tFileSystem.blockUsage tmpBlockType = FileSystem.blockUsage.INVALID;\r\n\t\t \tint backBlockNumber = -1;\r\n\t\t \tdo {\r\n \t\ttmpBlockNumber = fileSystem[blockNumber].getDirectoryStructure().checkifDirOrFileExistsInSpecifiedBlockAndGetLink(subnames[pos]);\r\n \t\tif (tmpBlockNumber != -1 || fileSystem[blockNumber].getDirectoryStructure().getFrwd() == 0)\r\n \t\t{\r\n \t\t\tif (tmpBlockNumber != -1)\r\n \t\t\t{\r\n \t\t\t\ttmpBlockType = fileSystem[blockNumber].getDirectoryStructure().checkifDirOrFileExistsInSpecifiedBlockAndGetType(subnames[pos]);\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tbackBlockNumber = blockNumber;\r\n \t\t\tblockNumber = fileSystem[blockNumber].getDirectoryStructure().getFrwd();\r\n \t\t}\r\n \t}while (true);\r\n\t\t \t\r\n\t\t \tif (tmpBlockNumber == -1)\r\n\t\t \t{\r\n\t\t \t\tSystem.out.println(\"File or directory doesn't exists in the file system \" + subnames[pos]);\r\n\t\t \t\treturn false;\r\n\t\t \t}\r\n\t\t \telse\r\n\t\t \t{\r\n\t\t \t\tif ((fileSystem[tmpBlockNumber].getBlockUsageType() == blockUsage.DIRECTORY) && (!fileSystem[tmpBlockNumber].getDirectoryStructure().IsDirectoryEmpty()))\r\n\t\t \t\t{\r\n\t\t \t\t\tSystem.out.println(\"Directory requested to delete not empty\");\r\n\t\t \t\t\treturn false;\r\n\t\t \t\t}\r\n\t\t \t\telse if (fileSystem[tmpBlockNumber].getBlockUsageType() == blockUsage.USERDATA)\r\n\t\t \t\t{\r\n\t\t \t\t\tint frwdTmpBlockNumber = fileSystem[tmpBlockNumber].getUserData().getForward();\r\n\t\t \t\t\twhile (frwdTmpBlockNumber != 0)\r\n\t\t \t\t\t{\r\n\t\t \t\t\t\tint tmpFrwdBlockNumber = frwdTmpBlockNumber;\r\n\t\t \t\t\t\tfrwdTmpBlockNumber = fileSystem[tmpFrwdBlockNumber].getUserData().getForward();\r\n\t\t \t\t\t\tresetBlock(tmpFrwdBlockNumber);\r\n\t\t \t\t\t}\r\n\t\t \t\t}\r\n\t\t \t\tresetBlock(tmpBlockNumber);\r\n\t\t \t\tfileSystem[blockNumber].getDirectoryStructure().deleteAnEntryInDirectoryContents(subnames[pos]);\r\n\t\t \t\tif (backBlockNumber != -1)\r\n\t\t \t\t{\r\n\t\t \t\t\tif (fileSystem[blockNumber].getDirectoryStructure().IsDirectoryEmpty())\r\n\t\t \t\t\t{\r\n\t\t \t\t\t\tfileSystem[backBlockNumber].getDirectoryStructure().setFrwd(0);\r\n\t\t \t\t\t\tresetBlock(blockNumber);\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 else\r\n\t\t {\r\n\t\t \tint tmpBlockNumber;\r\n\t\t \tdo {\r\n \t\ttmpBlockNumber = fileSystem[blockNumber].getDirectoryStructure().checkifDirExistsInSpecifiedBlock(subnames[pos]);\r\n \t\tif (tmpBlockNumber != -1 || fileSystem[blockNumber].getDirectoryStructure().getFrwd() == 0)\r\n \t\t{\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tblockNumber = fileSystem[blockNumber].getDirectoryStructure().getFrwd();\r\n \t\t}\r\n \t}while (true);\r\n\t\t \tif (tmpBlockNumber == -1)\r\n\t\t \t{\r\n\t\t \t\tSystem.out.println(\"Sub Directory \" + subnames[pos] + \" doesn't exists in the file system \");\r\n\t\t \t\treturn false;\r\n\t\t \t}\r\n\t\t \tblockNumber = tmpBlockNumber;\r\n\t\t }\r\n\t\t pos ++;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void deleteImage(Context context, String name) {\n ContextWrapper cw = new ContextWrapper(context);\n String name_ = AppConfig.RECIPE_BOOK_FOLDER_NAME; //Folder name in device android/data/\n File directory = cw.getDir(name_, Context.MODE_PRIVATE);\n try {\n File f = new File(directory, name + \".png\");\n if (f.exists()) {\n f.delete();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static void deleteDir(File file) {\n\t\tFile[] contents = file.listFiles();\n\t\tif (contents != null) {\n\t\t\tfor (File f : contents) {\n\t\t\t\tdeleteDir(f);\n\t\t\t}\n\t\t}\n\t\tfile.delete();\n\t}", "public void deleteDefault(File file)\n\t{\n\t\ttry {\n\t\t\tFileUtils.deleteDirectory(file);\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}", "abstract public void remove( String path )\r\n throws Exception;", "@Test\n public void filesByNameDeleteTest() throws ApiException {\n String name = null;\n api.filesByNameDelete(name);\n\n // TODO: test validations\n }", "public void clean()\r\n {\r\n // DO NOT TOUCH\r\n // System.out.println(unzipedFilePath);\r\n\r\n // only clean if there was a successful unzipping\r\n if (success)\r\n {\r\n // only clean if the file path to remove matches the zipped file.\r\n if (unzippedFilePath.equals(zippedFilePath.substring(0,\r\n zippedFilePath.length() - 4)))\r\n {\r\n // System.out.println(\"to be implmented\");\r\n for (File c : outputDir.listFiles())\r\n {\r\n // System.out.println(c.toString());\r\n if (!c.delete())\r\n {\r\n System.out.println(\"failed to delete\" + c.toString());\r\n }\r\n }\r\n outputDir.delete();\r\n outputDir = null;\r\n }\r\n }\r\n }", "public static void delete(String source) {\n Path directory = Paths.get(source);\n try {\n Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs)\n throws IOException {\n Files.delete(file);\n return CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(final Path file, final IOException e) {\n return handleException(e);\n }\n\n private FileVisitResult handleException(final IOException e) {\n e.printStackTrace(); // replace with more robust error handling\n return TERMINATE;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(final Path dir, final IOException e)\n throws IOException {\n if (e != null) {\n return handleException(e);\n }\n Files.delete(dir);\n return CONTINUE;\n }\n });\n } catch (IOException ex) {\n Logger.getLogger(FolderManager.class.getName()).log(Level.SEVERE, null, ex);\n delete(source);\n }\n }", "public static void clear(final String filename) throws IOException {\n\t\tif (!new File(SAVES_FOLDER + filename).delete()) {\n\t\t\tthrow new IOException();\n\t\t}\n\t}", "protected synchronized void delete()\n {\n if (this.file.exists())\n {\n this.file.delete();\n }\n }", "public void deleteFileByName(String nomFichier) throws IOException {\n\t\tif (nomFichier != null && !nomFichier.isEmpty()) {\n\t\t\tPath target = Paths.get(folder_photo + nomFichier);\n\t\t\tFiles.deleteIfExists(target);\n\t\t}\n\n\t}", "private void deleteFile(String oldPic) {\n\n\n File fileDir = new File(oldPic);\n if (fileDir.exists()) {\n \n fileDir.delete();\n }\n\n }", "protected void deleteTmpDirectory(File file) {\n\t\tif (file.exists() && file.canWrite()) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tFile[] files = file.listFiles();\n\t\t\t\tfor (File child : files) {\n\t\t\t\t\tif (child.isDirectory()) {\n\t\t\t\t\t\tdeleteTmpDirectory(child);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "private void removePolicyContextDirectory(){\n\tString directoryName = getContextDirectoryName();\n\tFile f = new File(directoryName);\n\tif(f.exists()){\n\n // WORKAROUND: due to existence of timestamp file in given directory\n // for SE/EE synchronization\n File[] files = f.listFiles();\n if (files != null && files.length > 0) {\n for (int i = 0; i < files.length; i++) {\n files[i].delete();\n }\n }\n //WORKAROUND: End \n\n\t if (!f.delete()) {\n String defMsg = \"Failure removing policy context directory: \"+directoryName;\n String msg=localStrings.getLocalString(\"pc.file_delete_error\", defMsg);\n\t\tlogger.log(Level.SEVERE,msg);\n\t\tthrow new RuntimeException(defMsg);\n\t } else if(logger.isLoggable(Level.FINE)){\n\t\tlogger.fine(\"JACC Policy Provider: Policy context directory removed: \"+directoryName);\n\t }\n\n File appDir = f.getParentFile();\n // WORKAROUND: due to existence of timestamp file in given directory\n // for SE/EE synchronization\n File[] fs = appDir.listFiles();\n if (fs != null && fs.length > 0) {\n boolean hasDir = false;\n for (int i = 0; i < fs.length; i++) {\n if (fs[i].isDirectory()) {\n hasDir = true;\n break;\n }\n }\n if (!hasDir) {\n for (int i = 0; i < fs.length; i++) {\n fs[i].delete();\n }\n }\n }\n //WORKAROUND: End \n\n File[] moduleDirs = appDir.listFiles();\n if (moduleDirs == null || moduleDirs.length == 0) {\n if (!appDir.delete()) {\n String defMsg = \"Failure removing policy context directory: \" + appDir;\n String msg = localStrings.getLocalString(\"pc.file_delete_error\", defMsg);\n\t\t logger.log(Level.SEVERE,msg);\n\t\t throw new RuntimeException(defMsg);\n }\n }\n\t}\n }", "public static void deleteFileOrDirectory(KVFile file) {\n if (file.isDirectory()) {\n String[] children = file.list();\n for (String aChildren : children) {\n if (new KVFile(file, aChildren).isDirectory() && !aChildren.equals(\"PreinstalledMaps\") && !aChildren.equals(\"Maps\")) {\n deleteFileOrDirectory(new KVFile(file, aChildren));\n } else {\n new KVFile(file, aChildren).delete();\n }\n }\n }\n }", "public void remove(ResourceLocation name) {\n data.remove(name.toString());\n }", "public boolean deleteFile(String fileName) {\n File file = new File(FILES_PATH + \"/\" + fileName);\n if (file == null || !file.exists() || file.isDirectory())\n return false;\n return file.delete();\n }", "public void remove(final String name) {\r\n\t\tremove(names.indexOf(name));\r\n\t}", "public void deleteFile(String filePath){\n File myFile = new File(filePath);\n if (myFile.exists()) {\n myFile.delete();\n System.out.println(\"File successfully deleted.\");\n } else {\n System.out.println(\"File does not exists\");\n }\n }", "public static void deletePath(Path path) throws IOException {\n if (!Files.isDirectory(path) || Files.list(path).count() == 0) { Files.deleteIfExists(path); }\n else {\n try (Stream<Path> files = Files.list(path)) {\n files.forEach(p -> {\n try { deletePath(p); }\n catch (IOException e) { e.printStackTrace(); }\n });\n Files.delete(path);\n }\n }\n }", "public void deleteFile() {\n String newName = playerList.getSelectionModel().getSelectedItem();\n File user = new File(\"SaveData\\\\UserData\\\\\" + newName + \".txt\");\n if (user.delete()) {\n input.setStyle(\"-fx-border-color: default\");\n playerList.getItems().remove(newName);\n\n MAIN_MENU_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n\n } else {\n ERROR_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n input.setStyle(\"-fx-border-color: red\");\n }\n }", "public void deleteFile() {\n\t\tif (JOptionPane.showConfirmDialog(desktopPane,\n\t\t\t\t\"Are you sure? this action is permanent!\") != JOptionPane.YES_OPTION)\n\t\t\treturn;\n\n\t\tEllowFile file = null;\n\t\tTreePath paths[] = getSelectionModel().getSelectionPaths();\n\t\tif (paths == null)\n\t\t\treturn;\n\t\tfor (TreePath path : paths) {\n\t\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) path\n\t\t\t\t\t.getLastPathComponent();\n\t\t\tfile = (EllowFile) node.getUserObject();\n\t\t\tEllowynProject project = file.parentProject;\n\t\t\tfile.deleteAll();\n\t\t\tif (!file.isProjectFile && project != null)\n\t\t\t\tproject.rebuild(); // don't rebuild the project if the project\n\t\t\t\t\t\t\t\t\t// itself is deleted\n\t\t\tdesktopPane.closeFrames(file);\n\t\t\tmodel.removeNodeFromParent(node);\n\t\t}\n\t}", "public static final void delete(final File file)\n\t{\n\t\tif (file.isDirectory())\n\t\t{\n\t\t\tfor (final String temp : file.list())\n\t\t\t{\n\t\t\t\tdelete(new File(file, temp));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfile.delete();\n\t\t}\n\t}", "void remove(String name) throws Exception;", "boolean deleteFile(File f);", "private void actionRemoveFile ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//---- Get currently selected file index in the combo box\r\n\t\t\tint index = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t//---- Remove the file from the project by its index\r\n\t\t\tDataController.scenarioRemoveFile(index);\r\n\r\n\t\t\thelperDisplayProjectFiles();\r\n\t\t\thelperDisplaySamplesCombobox();\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "public boolean remove() {\n\t\t\n\t\tMainTerminal terminal = MainTerminal.get();\n\t\tif(this.exists())\n\t\t{\n\t\t\tif(this.isDirectory())\n\t\t\t\tterminal.execute(\"rmdir \" + this.path);\n\t\t\telse\n\t\t\t\tterminal.execute(\"rm --force \" + path);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private void recallLastDir(String name) {\r\n\t\tString lastDir = prefs.get( PREFS_KEY+name , null ) ;\r\n\t\tif ( lastDir==null ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tFile last = new File( lastDir ) ;\r\n\t\tif ( last.exists() && last.isDirectory() ) {\r\n\t\t\tsetCurrentDirectory( last );\r\n\t\t}\r\n\t}", "public void removeFromStagingArea(String path, String file) {\r\n\t\tdebugPrintLocalln(\"removeFromStagingArea()\");\r\n\t\ttry {\r\n\t\t\tnew File(path + sep + file).delete();\r\n\t\t} catch(Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\tdebugPrintLocalln(\"Remove From Staging completed\");\r\n\t}", "public void remove(String name);", "public synchronized void cleanup() {\n\t\tString[] children = mStorageDirectory.list();\n\t\tif (children != null) { // children will be null if the directory does\n\t\t\t\t\t\t\t\t// not exist.\n\t\t\tfor (int i = 0; i < children.length; i++) { // remove too small file\n\t\t\t\tFile child = new File(mStorageDirectory, children[i]);\n\t\t\t\tif (!child.equals(new File(mStorageDirectory, NOMEDIA))\n\t\t\t\t\t\t&& child.length() <= MIN_FILE_SIZE_IN_BYTES) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void deleteMoreFile() {\n\t\tFile outfile = new File(outFileString);\n\t\tFile files[] = outfile.listFiles();\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\tString name = files[i].getAbsolutePath();\n\t\t\tif ((!name.contains(\"SICG\")) && (!name.contains(\"AndroidManifest.xml\"))) {\n\t\t\t\tDirDelete delete = new DirDelete();\n\t\t\t\tdelete.deleteDir(files[i]);\n\t\t\t}\n\t\t}\n\t}", "public void removeLevel(String name) {\n levels.remove(name);\n }", "public static native boolean remove(String path) throws IOException;", "public static boolean rm(final String fileName) {\n return new File(fileName).delete();\n }", "public static void clearFile(String filename) {\n PrintWriter pw = null;\n try {\n pw = new PrintWriter(filename);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n pw.close();\n }", "private void removeSource(String sourceName) {\n\t\t\n\t}", "@Override\n\tpublic void delete()\n\t{\n\t\tcachedContent = null;\n\t\tFile outputFile = getStoreLocation();\n\t\tif ((outputFile != null) && outputFile.exists())\n\t\t{\n\t\t\tif (Files.remove(outputFile) == false)\n\t\t\t{\n\t\t\t\tlog.error(\"failed to delete file: \" + outputFile.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t}", "public synchronized void removeFile(@Nonnull final VirtualFile file) {\n final HistoryEntry entry = getEntry(file);\n if (entry != null) {\n removeEntry(entry);\n }\n }", "public static String cleanFilePath(String path) {\r\n if (path.endsWith(\"/\")) {\r\n path = path.substring(0, path.length() - 1);\r\n }\r\n return path;\r\n }", "public void deleteMapName(String name){\n\t\tLinkedList<String> names=new LinkedList<String>();\n\t\t\n\t\tboolean present = false;\n\t\tFileReader r;\n\t\ttry {\n\t\t\tr = new FileReader (\"mapRecords.txt\");\n\t\t\tBufferedReader b = new BufferedReader (r);\n\t\t\tString s=b.readLine();\n\t\t\t\n\t\t\twhile(s!=null){\n\t\t\t\tif(s.equals(name))\n\t\t\t\t\tpresent =true; \n\t\t\t\t\n\t\t\t\tnames.add(s);\n\t\t\t\ts=b.readLine();\n\t\t\t\t\n\t\t\t}\n\n\t\t\tr.close();\n\t\t\tb.close();\n\t\t\t\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found\");\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Can't read file\");\n\t\t}\n\t\t\n\n\t\tif (present){\n\t\t\tnames.remove(name);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFileWriter w= new FileWriter(new File(\"mapRecords.txt\"));\n\t\t\t\tfor (String n: names){\n\t\t\t\t\tw.write(n+\"\\n\");\n\t\t\t\t\tw.write(System.lineSeparator())\t;\n\t\t\t\t}\t\n\t\t\t\tw.flush();\n\t\t\t\tw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t//e.printStackTrace();\n\t\t\t\tSystem.out.println(\"Can't write to the file\");\n\t\t\t}\n\t\t}\n\t\telse //there is nothing to remove the file is not present \n\t\t\treturn;\n\t\t\n\t}", "private void deleteFile(@Nonnull File file) throws IOException {\n Files.delete(file.toPath());\n }", "public static void delete(String filename) \n throws IOException {\n if ((filename != null) && (!filename.isEmpty())) {\n delete(new File(filename));\n }\n }", "void deleteCoverDirectory() {\n\n try {\n\n Log.i(\"Deleting Covr Directory\", cover_directory.toString());\n FileUtils.deleteDirectory(cover_directory);\n } catch (IOException e) {\n\n }\n\n }", "private void deleteDirectory(Path path) throws IOException {\n if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) {\n try (DirectoryStream<Path> entries = Files.newDirectoryStream(path)) {\n for (Path entry : entries) {\n deleteDirectory(entry);\n }\n }\n }\n Files.delete(path);\n }", "public static boolean delete(String name) {\n\t\ttry {\n\t\t\tdeleteDirectory(new File(\"save/\" + name));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\tSystem.out.println(\"[Info] Map \" + name + \" deleted\");\n\t\treturn true;\n\t}", "@Test\r\n public void moveToFileWithSameName() {\r\n currentDirectory.addNewFile(\"file\");\r\n Dir dirWithFile = currentDirectory.getSubDirectoryByName(\"child\");\r\n File fileWithContents = dirWithFile.getFileByName(\"file\");\r\n fileWithContents.setContent(\"content\");\r\n command.executeCommand(\"file\", \"child/file\", root, currentDirectory);\r\n File fileInRoot = currentDirectory.getFileByName(\"file\");\r\n // content in file in root is removed\r\n assertTrue(fileInRoot.getContents().equals(\"\"));\r\n }", "void deleteStoryDirectory() {\n\n try {\n\n Log.i(\"Deleting StoryDirectory\", story_directory.toString());\n FileUtils.deleteDirectory(story_directory);\n } catch (IOException e) {\n\n }\n\n }", "public void removeOriginalFilename(java.lang.String value) {\r\n\t\tBase.remove(this.model, this.getResource(), ORIGINALFILENAME, value);\r\n\t}", "void remove(String name);", "void remove(String name);", "private static boolean deleteFile(String fileName) {\n File f = new File(fileName);\n\n // Make sure the file or directory exists and isn't write protected\n// if (!f.exists())\n// throw new IllegalArgumentException(\n// \"Delete: no such file or directory: \" + fileName);\n//\n// if (!f.canWrite())\n// throw new IllegalArgumentException(\"Delete: write protected: \"\n// + fileName);\n\n // If it is a directory, make sure it is empty\n// if (f.isDirectory()) {\n// String[] files = f.list();\n// if (files.length > 0)\n// throw new IllegalArgumentException(\n// \"Delete: directory not empty: \" + fileName);\n// }\n\n // Attempt to delete it\n boolean success = f.delete();\n\n// if (!success)\n// throw new IllegalArgumentException(\"Delete: deletion failed\");\n return success;\n }", "public void EliminarArchivo()//Método que eliminar un archivo\n {\n JFileChooser fichero = new JFileChooser();//Creamos objeto de la clase JFileChooser\n fichero.showOpenDialog(null);//Abrimos la ventana para seleccionar el archivo\n File archivo = fichero.getSelectedFile();//En objeto File asignamos el objeto fichero a renombrar\n\n if (archivo.delete())//Si se eliminó correctamente, muestra le mensaje\n {\n JOptionPane.showMessageDialog(null, \"Archivo correctamente eliminado\");\n } else//Si no, muestra el mensaje\n {\n JOptionPane.showMessageDialog(null, \"El archivo no ha podido ser eliminado\");\n }\n }", "public HttpResponse doRemoveScript(StaplerRequest res, StaplerResponse rsp, @QueryParameter(\"name\") String name) throws IOException {\n \t\tcheckPermission(Hudson.ADMINISTER);\n \n \t\t// remove the file\n \t\tFile oldScript = new File(getScriptDirectory(), name);\n \t\toldScript.delete();\n \n \t\t// remove the meta information\n \t\tScriptlerConfiguration cfg = getConfiguration();\n \t\tcfg.removeScript(name);\n \t\tcfg.save();\n \n \t\treturn new HttpRedirect(\"index\");\n \t}", "public static void clearFile() {\n if (data.delete())\n data = new File(\"statistics.data\");\n }", "public void removeImage(Image image) {\n\t\tFile file = new File(image.getByteOrpart());\n\n\tif(file.delete()){\n\t\t\tSystem.out.println(file.getName() + \" is deleted!\");\n\t}else{\n\t\t\tSystem.out.println(\"Delete operation is failed.\");\n\t\t}\n\t\t\n\t}" ]
[ "0.7174625", "0.70642823", "0.6889217", "0.6631869", "0.6614861", "0.6594878", "0.6572267", "0.6510752", "0.63726395", "0.63694644", "0.6169391", "0.61398333", "0.6063596", "0.60617733", "0.60494965", "0.60192424", "0.5999878", "0.5988149", "0.59590495", "0.5955164", "0.59189016", "0.59159786", "0.58990175", "0.5889372", "0.5885002", "0.5877116", "0.58690816", "0.5840345", "0.5814118", "0.58063143", "0.57910025", "0.57697827", "0.57635313", "0.5749178", "0.5746953", "0.5745375", "0.57412285", "0.5731521", "0.57245195", "0.5719753", "0.57157713", "0.57031196", "0.56894433", "0.56867623", "0.5685316", "0.56835604", "0.5681755", "0.56718534", "0.5670736", "0.5661299", "0.5652826", "0.5644652", "0.56344277", "0.5633131", "0.5613844", "0.5610525", "0.5605969", "0.56050885", "0.56023055", "0.55972", "0.55916554", "0.5579469", "0.55769306", "0.5575497", "0.5570347", "0.55654347", "0.55542237", "0.55505425", "0.5549228", "0.5540642", "0.5534976", "0.5529997", "0.5520089", "0.55161417", "0.5508088", "0.5493911", "0.5475332", "0.54596364", "0.54565", "0.54552567", "0.5451734", "0.54383785", "0.5430157", "0.5413759", "0.54130363", "0.5410595", "0.5409089", "0.54008126", "0.5379043", "0.53763163", "0.5375268", "0.53733706", "0.5363979", "0.53591174", "0.53591174", "0.53547114", "0.5323073", "0.53224844", "0.5317019", "0.5316355" ]
0.7483324
0
Removes the directory "name" from the currentDirectory Throws if "name" refers to a file or doesn't exist
public void rmdir(String name) throws NoSuchDirectoryException, IsFileException, DirectoryNotEmptyException { Iterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement); if (toCheck != null) { for (Position<FileElement> fe : toCheck ) { if (fe.toString().equals(name) && fe.getValue().isDirectory() == false) { throw new IsFileException(); } else if (fe.toString().equals(name) && fe.getValue().isDirectory()) { if (fileSystem.remove(fe) == false) { throw new DirectoryNotEmptyException(); } } } } else {throw new NoSuchDirectoryException();} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void rm(String name) throws IsDirectoryException, NoSuchFileException\n\t{\n\t\tIterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement);\n\t\tif (toCheck != null)\n\t\t{\n\t\t\tfor (Position<FileElement> fe : toCheck )\n\t\t\t{\n\t\t\t\tif (fe.toString().equals(name) && fe.getValue().isDirectory() )\n\t\t\t\t{\n\t\t\t\t\tthrow new IsDirectoryException();\n\t\t\t\t}\n\t\t\t\tif (fe.toString().equals(name) && fe.getValue().isDirectory() == false)\n\t\t\t\t{\n\t\t\t\t\tfileSystem.remove(fe);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {throw new NoSuchFileException();}\n\t}", "private static void removeFromWorking(String fileName) {\n for (File file : WORKING_DIR.listFiles()) {\n if (!file.isDirectory()) {\n if (file.getName().equals(fileName)) {\n file.delete();\n break;\n }\n }\n }\n }", "public static void deleteFolder(String name) {\n File dir = new File(Environment.getExternalStorageDirectory() + name);\n if (dir.isDirectory()) {\n dir.delete();\n }\n }", "@Override\r\n\tpublic void remDir(String path) {\n\t\t\r\n\t}", "private void delete(String name) {\n File f = new File(name);\n if (f.exists()) {\n f.delete();\n }\n }", "private void deleteDirectory(Path path) throws IOException {\n if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) {\n try (DirectoryStream<Path> entries = Files.newDirectoryStream(path)) {\n for (Path entry : entries) {\n deleteDirectory(entry);\n }\n }\n }\n Files.delete(path);\n }", "@Override\n public void removeDirectory(File directory, boolean recursive) throws FileNotFoundException, IOException {\n }", "public synchronized void deleteRepository(String currentUser, String name) throws IOException {\n\n\t\tif (isAnonymousUser(currentUser)) {\n\t\t\tthrow new UserAccessException(\"Anonymous user not permitted to delete repository\");\n\t\t}\n\n\t\tvalidateUser(currentUser);\n\n\t\tRepository rep = repositoryMap.get(name);\n\t\tif (rep == null) {\n\t\t\treturn;\n\t\t}\n\n\t\trep.delete(currentUser);\n\n\t\tFile f = new File(rootDirFile, NamingUtilities.mangle(name));\n\t\tif (!FileUtilities.deleteDir(f)) {\n\t\t\tthrow new IOException(\"Failed to remove directory for \" + f.getAbsolutePath());\n\t\t}\n\n\t\trepositoryMap.remove(name);\n\t}", "private static void deleteFileOrDir(File file)\n {\n if (file.isDirectory())\n {\n File[] childs = file.listFiles();\n for (int i = 0;i < childs.length;i++)\n {\n deleteFileOrDir(childs[i]);\n }\n }\n file.delete();\n }", "private static void deleteDir(File file) {\n\t\tFile[] contents = file.listFiles();\n\t\tif (contents != null) {\n\t\t\tfor (File f : contents) {\n\t\t\t\tdeleteDir(f);\n\t\t\t}\n\t\t}\n\t\tfile.delete();\n\t}", "private void removePolicyContextDirectory(){\n\tString directoryName = getContextDirectoryName();\n\tFile f = new File(directoryName);\n\tif(f.exists()){\n\n // WORKAROUND: due to existence of timestamp file in given directory\n // for SE/EE synchronization\n File[] files = f.listFiles();\n if (files != null && files.length > 0) {\n for (int i = 0; i < files.length; i++) {\n files[i].delete();\n }\n }\n //WORKAROUND: End \n\n\t if (!f.delete()) {\n String defMsg = \"Failure removing policy context directory: \"+directoryName;\n String msg=localStrings.getLocalString(\"pc.file_delete_error\", defMsg);\n\t\tlogger.log(Level.SEVERE,msg);\n\t\tthrow new RuntimeException(defMsg);\n\t } else if(logger.isLoggable(Level.FINE)){\n\t\tlogger.fine(\"JACC Policy Provider: Policy context directory removed: \"+directoryName);\n\t }\n\n File appDir = f.getParentFile();\n // WORKAROUND: due to existence of timestamp file in given directory\n // for SE/EE synchronization\n File[] fs = appDir.listFiles();\n if (fs != null && fs.length > 0) {\n boolean hasDir = false;\n for (int i = 0; i < fs.length; i++) {\n if (fs[i].isDirectory()) {\n hasDir = true;\n break;\n }\n }\n if (!hasDir) {\n for (int i = 0; i < fs.length; i++) {\n fs[i].delete();\n }\n }\n }\n //WORKAROUND: End \n\n File[] moduleDirs = appDir.listFiles();\n if (moduleDirs == null || moduleDirs.length == 0) {\n if (!appDir.delete()) {\n String defMsg = \"Failure removing policy context directory: \" + appDir;\n String msg = localStrings.getLocalString(\"pc.file_delete_error\", defMsg);\n\t\t logger.log(Level.SEVERE,msg);\n\t\t throw new RuntimeException(defMsg);\n }\n }\n\t}\n }", "private void recallLastDir(String name) {\r\n\t\tString lastDir = prefs.get( PREFS_KEY+name , null ) ;\r\n\t\tif ( lastDir==null ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tFile last = new File( lastDir ) ;\r\n\t\tif ( last.exists() && last.isDirectory() ) {\r\n\t\t\tsetCurrentDirectory( last );\r\n\t\t}\r\n\t}", "protected void deleteTmpDirectory(File file) {\n\t\tif (file.exists() && file.canWrite()) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tFile[] files = file.listFiles();\n\t\t\t\tfor (File child : files) {\n\t\t\t\t\tif (child.isDirectory()) {\n\t\t\t\t\t\tdeleteTmpDirectory(child);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "private static boolean deleteDirectory(final File path) {\r\n if (path.exists()) {\r\n final File[] files = path.listFiles();\r\n for (int i = 0; i < files.length; i++) {\r\n if (files[i].isDirectory()) {\r\n deleteDirectory(files[i]);\r\n }\r\n else {\r\n files[i].delete();\r\n }\r\n }\r\n }\r\n return (path.delete());\r\n }", "public void delete_file(String file_name) throws Exception{\n\t\tFile file = new File(file_name);\n\t\tif (file.exists() && file.isFile()) file.delete();\n\t\telse if(file.isDirectory()){\n\t\t\tfor(File f : file.listFiles()){\n\t\t\t\tdelete_file(f.getAbsolutePath());\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "public void cd(String name) throws NoSuchDirectoryException\n\t{\n\t\tIterable<Position<FileElement>> toCheck = fileSystem.children(currentFileElement);\n\t\tif (toCheck != null)\n\t\t{\n\t\t\tfor (Position<FileElement> fe : toCheck )\n\t\t\t{\n\t\t\t\tif (fe.toString().equals(name) && fe.getValue().isDirectory() )\n\t\t\t\t{\n\t\t\t\t\tcurrentFileElement = fe;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {throw new NoSuchDirectoryException();}\n\t}", "void deleteDirectory(String path, boolean recursive) throws IOException;", "public void deleteDir() throws Exception\n{\n if(_repo!=null) _repo.close(); _repo = null;\n _gdir.delete();\n _gdir.setProp(GitDir.class.getName(), null);\n}", "public boolean remove() {\n\t\t\n\t\tMainTerminal terminal = MainTerminal.get();\n\t\tif(this.exists())\n\t\t{\n\t\t\tif(this.isDirectory())\n\t\t\t\tterminal.execute(\"rmdir \" + this.path);\n\t\t\telse\n\t\t\t\tterminal.execute(\"rm --force \" + path);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static void delete(File file) {\n\n\t\tif (file.isDirectory()) {\n\n\t\t\t// directory is empty, then delete it\n\t\t\tif (file.list().length == 0) {\n\n\t\t\t\tfile.delete();\n\t\t\t\t// System.out.println(\"Directory is deleted : \" +\n\t\t\t\t// file.getAbsolutePath());\n\n\t\t\t} else {\n\n\t\t\t\t// list all the directory contents\n\t\t\t\tString files[] = file.list();\n\n\t\t\t\tfor (String temp : files) {\n\t\t\t\t\t// construct the file structure\n\t\t\t\t\tFile fileDelete = new File(file, temp);\n\n\t\t\t\t\t// recursive delete\n\t\t\t\t\tdelete(fileDelete);\n\t\t\t\t}\n\n\t\t\t\t// check the directory again, if empty then delete it\n\t\t\t\tif (file.list().length == 0) {\n\t\t\t\t\tfile.delete();\n\t\t\t\t\t// System.out.println(\"Directory is deleted : \" +\n\t\t\t\t\t// file.getAbsolutePath());\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// if file, then delete it\n\t\t\tfile.delete();\n\t\t\t// System.out.println(\"File is deleted : \" +\n\t\t\t// file.getAbsolutePath());\n\t\t}\n\t}", "protected void deleteDirectory(String oneDir) {\n \n File[] listOfFiles;\n File cleanDir;\n\t\n cleanDir = new File(oneDir);\n if (!cleanDir.exists()) {// Nothing to do. Return; \n\t return;\n\t}\n listOfFiles = cleanDir.listFiles();\n if(listOfFiles != null) { \n for(int countFiles = 0; countFiles < listOfFiles.length; countFiles++) { \n if (listOfFiles[countFiles].isFile()) {\n listOfFiles[countFiles].delete();\n } else { // It is a directory\n String nextCleanDir = cleanDir + separator + listOfFiles[countFiles].getName();\n\t\t File newCleanDir = new File(nextCleanDir);\n deleteDirectory(newCleanDir.getAbsolutePath());\n } \n }// End for loop\n } // End if statement \n cleanDir.delete();\n }", "private void deleteFile() {\n\t\tFile dir = getFilesDir();\n\t\tFile file = new File(dir, FILENAME);\n\t\tfile.delete();\n\t}", "void deleteStoryDirectory() {\n\n try {\n\n Log.i(\"Deleting StoryDirectory\", story_directory.toString());\n FileUtils.deleteDirectory(story_directory);\n } catch (IOException e) {\n\n }\n\n }", "@Test\n\tpublic void removeUnneededDirectory() throws IOException {\n\t\tfinal Path targetDir = _temp.toPath().resolve(\"target\");\n\t\tfinal Path fsTargetDir = targetDir.resolve(DIR_FIRSTSPIRIT_5);\n\t\tfinal Path installerTar = new File(getClass().getResource(TEST_INSTALLER_TAR_GZ).getFile()).toPath();\n\t\tServerInstaller.decompressInstaller(targetDir, installerTar);\n\t\tassertTrue(fsTargetDir.toFile().exists(), DIR_FIRSTSPIRIT_5 + \" dir should exist\");\n\n\t\t// test\n\t\tServerInstaller.removeUnneededDirectory(targetDir);\n\n\t\t// verify\n\t\tassertFalse(fsTargetDir.toFile().exists(), DIR_FIRSTSPIRIT_5 + \" dir should have been deleted\");\n\t}", "private void cleanDirectory(File dir) {\n File[] files= dir.listFiles();\n if (files!=null && files.length>0) {\n for (File file: files) {\n delete(file);\n }\n }\n }", "public static boolean deleteFileRoot(String path) {\n try {\n if (!readReadWriteFile())\n RootTools.remount(path, \"rw\");\n\n if (new File(path).isDirectory()) {\n execute(\"rm -f -r \" + getCommandLineString(path));\n } else {\n execute(\"rm -r \" + getCommandLineString(path));\n }\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "public void removeFolder(File path){\n if (path.isDirectory()){\n String subdirectories[] = path.list();\n for(String subdirectory: subdirectories){\n File file = new File(path.getPath()+\"\\\\\"+subdirectory);\n LOG.info(\"file.getAbsolutePath(): \"+file.getPath());\n if (file.isFile()){\n boolean isDeleted = file.delete();\n if (isDeleted){\n LOG.success(\"file was delete, path: \"+file.getPath());\n }else{\n LOG.error(\"file does not delete, path: \"+file.getPath());\n }\n }else{\n removeFolder(file);\n boolean folderIsDelete = file.delete();\n if (folderIsDelete){\n LOG.success(\"folder was delete, path: \"+file);\n }else{\n LOG.error(\"folder does not delete, path: \"+file);\n }\n }\n }\n }else {\n LOG.info(\"file.getAbsolutePath(): \"+path.getPath());\n }\n }", "void deleteCoverDirectory() {\n\n try {\n\n Log.i(\"Deleting Covr Directory\", cover_directory.toString());\n FileUtils.deleteDirectory(cover_directory);\n } catch (IOException e) {\n\n }\n\n }", "private static void deleteDirectory(File directory) {\r\n File[] files = directory.listFiles();\r\n for (int i = 0; i < files.length; i++) {\r\n if (files[i].isDirectory()) {\r\n deleteDirectory(files[i]);\r\n } else {\r\n files[i].delete();\r\n }\r\n }\r\n // Now that the directory is empty. Delete it.\r\n directory.delete();\r\n }", "public static void deleteDirectory(String path) throws KubernetesPluginException {\n Path pathToBeDeleted = Paths.get(path);\n if (!Files.exists(pathToBeDeleted)) {\n return;\n }\n try {\n Files.walk(pathToBeDeleted)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .forEach(File::delete);\n } catch (IOException e) {\n throw new KubernetesPluginException(\"Unable to delete directory: \" + path, e);\n }\n\n }", "private void clean(Path path) throws IOException {\n if (Files.exists(path)) {\n Files.walkFileTree(path, new SimpleFileVisitor<>() {\n public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n\n public FileVisitResult postVisitDirectory(Path path, IOException exception) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n });\n }\n }", "public void deleteImgFromDirectory1(String fileName) {\n File f = new File(fileName);\r\n\r\n // Mi assicuro che il file esista\r\n if (!f.exists()) {\r\n throw new IllegalArgumentException(\"Il File o la Directory non esiste: \" + fileName);\r\n }\r\n\r\n // Mi assicuro che il file sia scrivibile\r\n if (!f.canWrite()) {\r\n throw new IllegalArgumentException(\"Non ho il permesso di scrittura: \" + fileName);\r\n }\r\n\r\n // Se è una cartella verifico che sia vuota\r\n if (f.isDirectory()) {\r\n String[] files = f.list();\r\n if (files.length > 0) {\r\n throw new IllegalArgumentException(\"La Directory non è vuota: \" + fileName);\r\n }\r\n }\r\n\r\n // Profo a cancellare\r\n boolean success = f.delete();\r\n\r\n // Se si è verificato un errore...\r\n if (!success) {\r\n throw new IllegalArgumentException(\"Cancellazione fallita\");\r\n }\r\n }", "private static void removeFile(File fileDir) throws Exception {\n String fileName = getFileNameInput();\n File fileToRemove = new File(fileDir.toString() + \"\\\\\" + fileName);\n boolean fileRemoved = fileToRemove.delete();\n if (fileRemoved) {\n System.out.println(\"File removed successfully.\");\n } else {\n throw new FileNotFoundException(\"No such file under current directory.\");\n }\n }", "public static void delete(String source) {\n Path directory = Paths.get(source);\n try {\n Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs)\n throws IOException {\n Files.delete(file);\n return CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(final Path file, final IOException e) {\n return handleException(e);\n }\n\n private FileVisitResult handleException(final IOException e) {\n e.printStackTrace(); // replace with more robust error handling\n return TERMINATE;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(final Path dir, final IOException e)\n throws IOException {\n if (e != null) {\n return handleException(e);\n }\n Files.delete(dir);\n return CONTINUE;\n }\n });\n } catch (IOException ex) {\n Logger.getLogger(FolderManager.class.getName()).log(Level.SEVERE, null, ex);\n delete(source);\n }\n }", "private static boolean deleteFileOrDirectory(String absoluteName) {\n\t\tString[] subnames = absoluteName.split(\"/\");\r\n\t\tint blockNumber = 0;\r\n\t\tint pos = 0;\r\n\r\n\t\twhile(pos < subnames.length)\r\n\t\t{\r\n\t\t if (pos + 1 == subnames.length)\r\n\t\t {\r\n\t\t \tint tmpBlockNumber;\r\n\t\t \tFileSystem.blockUsage tmpBlockType = FileSystem.blockUsage.INVALID;\r\n\t\t \tint backBlockNumber = -1;\r\n\t\t \tdo {\r\n \t\ttmpBlockNumber = fileSystem[blockNumber].getDirectoryStructure().checkifDirOrFileExistsInSpecifiedBlockAndGetLink(subnames[pos]);\r\n \t\tif (tmpBlockNumber != -1 || fileSystem[blockNumber].getDirectoryStructure().getFrwd() == 0)\r\n \t\t{\r\n \t\t\tif (tmpBlockNumber != -1)\r\n \t\t\t{\r\n \t\t\t\ttmpBlockType = fileSystem[blockNumber].getDirectoryStructure().checkifDirOrFileExistsInSpecifiedBlockAndGetType(subnames[pos]);\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tbackBlockNumber = blockNumber;\r\n \t\t\tblockNumber = fileSystem[blockNumber].getDirectoryStructure().getFrwd();\r\n \t\t}\r\n \t}while (true);\r\n\t\t \t\r\n\t\t \tif (tmpBlockNumber == -1)\r\n\t\t \t{\r\n\t\t \t\tSystem.out.println(\"File or directory doesn't exists in the file system \" + subnames[pos]);\r\n\t\t \t\treturn false;\r\n\t\t \t}\r\n\t\t \telse\r\n\t\t \t{\r\n\t\t \t\tif ((fileSystem[tmpBlockNumber].getBlockUsageType() == blockUsage.DIRECTORY) && (!fileSystem[tmpBlockNumber].getDirectoryStructure().IsDirectoryEmpty()))\r\n\t\t \t\t{\r\n\t\t \t\t\tSystem.out.println(\"Directory requested to delete not empty\");\r\n\t\t \t\t\treturn false;\r\n\t\t \t\t}\r\n\t\t \t\telse if (fileSystem[tmpBlockNumber].getBlockUsageType() == blockUsage.USERDATA)\r\n\t\t \t\t{\r\n\t\t \t\t\tint frwdTmpBlockNumber = fileSystem[tmpBlockNumber].getUserData().getForward();\r\n\t\t \t\t\twhile (frwdTmpBlockNumber != 0)\r\n\t\t \t\t\t{\r\n\t\t \t\t\t\tint tmpFrwdBlockNumber = frwdTmpBlockNumber;\r\n\t\t \t\t\t\tfrwdTmpBlockNumber = fileSystem[tmpFrwdBlockNumber].getUserData().getForward();\r\n\t\t \t\t\t\tresetBlock(tmpFrwdBlockNumber);\r\n\t\t \t\t\t}\r\n\t\t \t\t}\r\n\t\t \t\tresetBlock(tmpBlockNumber);\r\n\t\t \t\tfileSystem[blockNumber].getDirectoryStructure().deleteAnEntryInDirectoryContents(subnames[pos]);\r\n\t\t \t\tif (backBlockNumber != -1)\r\n\t\t \t\t{\r\n\t\t \t\t\tif (fileSystem[blockNumber].getDirectoryStructure().IsDirectoryEmpty())\r\n\t\t \t\t\t{\r\n\t\t \t\t\t\tfileSystem[backBlockNumber].getDirectoryStructure().setFrwd(0);\r\n\t\t \t\t\t\tresetBlock(blockNumber);\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 else\r\n\t\t {\r\n\t\t \tint tmpBlockNumber;\r\n\t\t \tdo {\r\n \t\ttmpBlockNumber = fileSystem[blockNumber].getDirectoryStructure().checkifDirExistsInSpecifiedBlock(subnames[pos]);\r\n \t\tif (tmpBlockNumber != -1 || fileSystem[blockNumber].getDirectoryStructure().getFrwd() == 0)\r\n \t\t{\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tblockNumber = fileSystem[blockNumber].getDirectoryStructure().getFrwd();\r\n \t\t}\r\n \t}while (true);\r\n\t\t \tif (tmpBlockNumber == -1)\r\n\t\t \t{\r\n\t\t \t\tSystem.out.println(\"Sub Directory \" + subnames[pos] + \" doesn't exists in the file system \");\r\n\t\t \t\treturn false;\r\n\t\t \t}\r\n\t\t \tblockNumber = tmpBlockNumber;\r\n\t\t }\r\n\t\t pos ++;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void clearClipsDirectory(){\n /* Citation : http://helpdesk.objects.com.au/java/how-to-delete-all-files-in-a-directory#:~:text=Use%20the%20listFiles()%20method,used%20to%20delete%20each%20file. */\n File directory = new File(Main.CREATED_CLIPS_DIRECTORY_PATH);\n File[] files = directory.listFiles();\n if(files != null){\n for(File file : files){\n if(!file.delete()) System.out.println(\"Failed to remove file \" + file.getName() + \" from \" + Main.CREATED_CLIPS_DIRECTORY_PATH);\n }\n }\n }", "void deleteTagDirectory() {\n\n try {\n\n Log.i(\"Deleting Tag Directory\", tag_directory.toString());\n FileUtils.deleteDirectory(tag_directory);\n } catch (IOException e) {\n\n }\n\n }", "public void removeLevel(String name) {\n levels.remove(name);\n }", "public static void deleteDirectory(String inputDirectory) {\n File directory = new File(inputDirectory);\n //check if it is a directory\n if (directory.isDirectory()) {\n //check if the directory has children\n if (directory.listFiles().length == 0) {\n directory.delete();\n System.out.println(\"Directory is deleted: \"\n + directory.getAbsolutePath());\n } else {\n //ask user whether he wants to delete the directory\n System.out.println(\"The chosen directory contains few files.\");\n viewDirectory(inputDirectory);\n System.out.println(\"Do you really want to delete the whole directory: \\n 1.Yes\\n 2.No\");\n Scanner userInput = new Scanner(System.in);\n String userRes = userInput.nextLine();\n if (userRes.equalsIgnoreCase(\"yes\") || userRes.equalsIgnoreCase(\"1\")) {\n //delete files inside the directory one by one\n deleteFilesInsideDirectory(directory);\n //delete parent directory\n directory.delete();\n if (!directory.exists()) {\n System.out.println(\"Directory has been deleted.\");\n } else {\n System.out.println(\"Deletion failed\");\n }\n } else if (userRes.equalsIgnoreCase(\"no\") || userRes.equalsIgnoreCase(\"2\")) {\n System.out.println(\"Delete directory request cancelled by user.\");\n } else {\n deleteDirectory(inputDirectory);\n }\n }\n } else {\n System.out.println(\"Invalid path or directory.\");\n }\n }", "private void delete(File file) {\n if (file.isDirectory()) {\n cleanDirectory(file);\n }\n file.delete();\n }", "public static void deletePath(Path path) throws IOException {\n if (!Files.isDirectory(path) || Files.list(path).count() == 0) { Files.deleteIfExists(path); }\n else {\n try (Stream<Path> files = Files.list(path)) {\n files.forEach(p -> {\n try { deletePath(p); }\n catch (IOException e) { e.printStackTrace(); }\n });\n Files.delete(path);\n }\n }\n }", "private void deleteDir(File fileDir)\n {\n try\n {\n FileHelper.deleteDir(fileDir);\n }\n catch (Exception e)\n {\n // ignore\n }\n }", "public static void doRemove(String fileName) {\n Stage fromSave = Utils.readObject(STAGED_FILES,\n Stage.class);\n HashSet<String> stagedFiles = fromSave.getStagedFiles();\n Commit currHead = Utils.readObject(TREE_DIR, Tree.class).\n getCurrHead();\n if (stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (stagedFiles.contains(fileName) && !currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (!stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n if (!Utils.filesSet(WORKING_DIR).contains(fileName)) {\n File removedFile = Utils.join(STAGE_RM_DIR, fileName);\n try {\n removedFile.createNewFile();\n } catch (IOException ignored) {\n return;\n }\n String contents = currHead.getBlobs().get(fileName).\n getContents();\n Utils.writeContents(removedFile, contents);\n } else {\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n }\n } else {\n System.out.println(\"No reason to remove the file.\");\n System.exit(0);\n }\n }", "public static String cleanDirectoryPath(String path) {\r\n if (!path.endsWith(\"/\")) {\r\n path += \"/\";\r\n }\r\n return path;\r\n }", "public void removeByname(java.lang.String name)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public static void deleteDir(File dir) {\n\t if (dir.isDirectory()) {\n\t String[] children = dir.list();\n\t for (int i=0; i<children.length; i++) {\n\t File file = new File(dir, children[i]);\n\t log.info(\"Deleting file:\" + file.toString());\n\t file.delete();\n\t }\n\t }\n\t }", "public void clearDirectory(File directory) {\n if (directory.exists()) {\n for (File file : directory.listFiles()) {\n file.delete();\n }\n }\n }", "public synchronized void cleanup() {\n\t\tString[] children = mStorageDirectory.list();\n\t\tif (children != null) { // children will be null if the directory does\n\t\t\t\t\t\t\t\t// not exist.\n\t\t\tfor (int i = 0; i < children.length; i++) { // remove too small file\n\t\t\t\tFile child = new File(mStorageDirectory, children[i]);\n\t\t\t\tif (!child.equals(new File(mStorageDirectory, NOMEDIA))\n\t\t\t\t\t\t&& child.length() <= MIN_FILE_SIZE_IN_BYTES) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void deleteFileOrDirectory(KVFile file) {\n if (file.isDirectory()) {\n String[] children = file.list();\n for (String aChildren : children) {\n if (new KVFile(file, aChildren).isDirectory() && !aChildren.equals(\"PreinstalledMaps\") && !aChildren.equals(\"Maps\")) {\n deleteFileOrDirectory(new KVFile(file, aChildren));\n } else {\n new KVFile(file, aChildren).delete();\n }\n }\n }\n }", "void remove(long directoryId, String userName);", "public static boolean deleteDirectory(File path) {\n\t\tif (path.exists()) {\n\t\t\tFile[] files = path.listFiles();\n\t\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\t\tif (files[i].isDirectory()) {\n\t\t\t\t\tdeleteDirectory(files[i]);\n\t\t\t\t} else {\n\t\t\t\t\tfiles[i].delete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (path.delete());\n\t}", "public static void deleteFolder(String path){\n List<CMSFile> files = CMSFile.find(\"name like '\" + path + \"%'\").fetch();\n for (CMSFile file: files){\n if (file.data != null && file.data.exists()) {\n file.data.getFile().delete();\n }\n file.delete();\n }\n }", "public static boolean deleteDirectory(File dir) {\n \n\t\tif (dir == null) { \n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tFile candir;\n try {\n candir = dir.getCanonicalFile();\n } catch (IOException e) {\n return false;\n }\n \n // a symbolic link has a different canonical path than its actual path,\n // unless it's a link to itself\n if (!candir.equals(dir.getAbsoluteFile())) {\n // this file is a symbolic link, and there's no reason for us to\n // follow it, because then we might be deleting something outside of\n // the directory we were told to delete\n return false;\n }\n \n // now we go through all of the files and subdirectories in the\n // directory and delete them one by one\n File [] files = candir.listFiles();\n \n if (files != null) {\n for (int i = 0; i < files.length; i++) {\n File file = files[i];\n \n // in case this directory is actually a symbolic link, or it's\n // empty, we want to try to delete the link before we try\n // anything\n boolean deleted = file.delete();\n \n if (!deleted) {\n // deleting the file failed, so maybe it's a non-empty\n // directory\n if (file.isDirectory()) {\n \tdeleteDirectory(file);\n }\n \n // otherwise, there's nothing else we can do\n }\n }\n }\n \n // now that we tried to clear the directory out, we can try to delete it\n // again\n return dir.delete(); \n }", "private boolean deleteDir(File dir) {\r\n if (dir.isDirectory()) {\r\n \r\n //Borra todos los ficheros del directorio\r\n String[] children = dir.list();\r\n for (int i=0; i<children.length; i++) {\r\n boolean success = deleteDir(new File(dir, children[i]));\r\n if (!success) {\r\n return false;\r\n }\r\n }\r\n }\r\n \r\n //Ahora que el directorio está vacío, se puede borrar\r\n return dir.delete();\r\n }", "private void emptyDirectory(File dir){\n\n for (File file : Objects.requireNonNull(dir.listFiles())){\n if (file.isDirectory())\n {\n emptyDirectory(file);\n }\n file.delete();\n }\n }", "void removeIndexDir(String indexDirPath) throws IOException {\n File indexDir = new File(indexDirPath);\n if (indexDir.exists())\n FileUtils.deleteDirectory(indexDir);\n }", "public static void delTree(File file) {\r\n File[] files = file.listFiles();\r\n if (files != null) { \r\n for (int i = 0; i < files.length; i++) {\r\n if (files[i].isDirectory()) {\r\n delTree(files[i]);\r\n }\r\n }\r\n }\r\n files = file.listFiles();\r\n if (files != null) {\r\n for (int i = 0; i < files.length; i++) {\r\n files[i].delete();\r\n }\r\n }\r\n }", "@Override\r\n\tpublic boolean removeFolder(String path) throws FileSystemUtilException {\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\tconnect();\r\n\t\t\tString rmDirCmd = \"rm -fr \"+path;\t\t\t\r\n\t\t\tint x = executeSimpleCommand(rmDirCmd);\r\n\t\t\tif(x!=0)\r\n\t\t\t{\r\n\t\t\t\tlogger.info(\"Folder remove failed, may be file path is not correct or privileges are not there\");\r\n\t\t\t\tthrow new FileSystemUtilException(\"EL0699\");\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}catch(FileSystemUtilException e)\r\n\t\t{\r\n\t\t disconnect();\r\n\t\t\tthrow new FileSystemUtilException(e.getErrorCode(),e.getException());\r\n\t\t}catch(Exception e)\r\n\t\t{\r\n\t\t\tthrow new FileSystemUtilException(\"F00002\",e);\r\n\t\t}\r\n\r\n\t}", "public static void remove(File file) throws IOException {\n\t\tif (!file.exists())\n\t\t\treturn;\n\t\tif (file.isDirectory()) {\n\t\t\tFile[] files = file.listFiles();\n\t\t\tfor (File f : files)\n\t\t\t\tremove(f);\n\t\t}\n\t\tif (!file.delete())\n\t\t\tthrow new IOException(\"Can't delete the file \\\"\"\n\t\t\t\t\t+ file.getAbsolutePath() + \"\\\"\");\n\t}", "public static void cleanDirectory(File dir) {\n if (dir.isDirectory()) {\n for (File f : dir.listFiles()) {\n cleanDirectory( f );\n }\n }\n dir.delete();\n }", "private void deleteFile(java.io.File file) {\n if (file.isDirectory()) {\n for (java.io.File f : file.listFiles()) \n deleteFile(f);\n }\n \n if (!file.delete())\n try {\n throw new FileNotFoundException(\"Failed to delete file: \" + file.getName());\n } catch (FileNotFoundException e) {\n System.err.println(\"Delete of file \" + file.getAbsolutePath() + \" failed\");\n e.printStackTrace();\n }\n }", "private static void deleteFile(String fileName) {\n\t\tFile f = new File(fileName);\n\n\t\t// Make sure the file or directory exists and isn't write protected\n\t\tif (!f.exists())\n\t\t\treturn;\n\t\t// throw new IllegalArgumentException(\"Delete: no such file or directory: \" + fileName);\n\n\t\tif (!f.canWrite())\n\t\t\tthrow new IllegalArgumentException(\"Delete: write protected: \"\n\t\t\t\t\t+ fileName);\n\n\t\t// If it is a directory, make sure it is empty\n\t\tif (f.isDirectory()) {\n\t\t\tString[] files = f.list();\n\t\t\tif (files.length > 0)\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Delete: directory not empty: \" + fileName);\n\t\t}\n\n\t\t// Attempt to delete it\n\t\tboolean success = f.delete();\n\n\t\tif (!success)\n\t\t\tthrow new IllegalArgumentException(\"Delete: deletion failed\");\n\t}", "public void delete( String name) throws PhileNotFoundException {\n\t\tif (!fileList.containsKey(name)) {\n\t\t\tthrow new PhileNotFoundException(\"File doesn't exist\");\n\t\t}\n\t\telse {\n\t\t\tPhile phile = fileList.get(name);\n\t\t\tfileList.remove(name);\n\t\t\ttotalNumberOfFiles--;\n\t\t\tif (openFiles.contains(phile)) {\n\t\t\t\topenFiles.remove(phile);\n\t\t\t\tnumberOfOpenFiles--;\n\t\t\t}\n\t\t}\n }", "private static void deleteTempFolder(String folderName) throws IOException {\n Path tempFolderPath = Paths.get(folderName);\n\n if (Files.exists(tempFolderPath) && Files.isDirectory(tempFolderPath)) {\n Files.walk(tempFolderPath)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .forEach(File::delete);\n }\n }", "public static void deleteFile(File file){\r\n if(file.isFile()){\r\n file.delete();\r\n return;\r\n }\r\n if(file.isDirectory()){\r\n File[] childFile = file.listFiles();\r\n if(childFile == null || childFile.length == 0){\r\n file.delete();\r\n return;\r\n }\r\n for(File f : childFile){\r\n deleteFile(f);\r\n }\r\n file.delete();\r\n }\r\n }", "protected boolean cleanUpDir(File dir) {\n if (dir.isDirectory()) {\n LOG.info(\"Cleaning up \" + dir.getName());\n String[] children = dir.list();\n for (String string : children) {\n boolean success = cleanUpDir(new File(dir, string));\n if (!success)\n return false;\n }\n }\n // The directory is now empty so delete it\n return dir.delete();\n }", "public void clean()\r\n {\r\n // DO NOT TOUCH\r\n // System.out.println(unzipedFilePath);\r\n\r\n // only clean if there was a successful unzipping\r\n if (success)\r\n {\r\n // only clean if the file path to remove matches the zipped file.\r\n if (unzippedFilePath.equals(zippedFilePath.substring(0,\r\n zippedFilePath.length() - 4)))\r\n {\r\n // System.out.println(\"to be implmented\");\r\n for (File c : outputDir.listFiles())\r\n {\r\n // System.out.println(c.toString());\r\n if (!c.delete())\r\n {\r\n System.out.println(\"failed to delete\" + c.toString());\r\n }\r\n }\r\n outputDir.delete();\r\n outputDir = null;\r\n }\r\n }\r\n }", "@TestFor(issues = \"TW-42737\")\n public void test_directory_remove() throws Exception {\n CommitPatchBuilder patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.createFile(\"dir/file\", new ByteArrayInputStream(\"content\".getBytes()));\n patchBuilder.createFile(\"dir2/file\", new ByteArrayInputStream(\"content\".getBytes()));\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Create dir with file\"));\n patchBuilder.dispose();\n\n RepositoryStateData state1 = myGit.getCurrentState(myRoot);\n\n patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.deleteDirectory(\"dir\");\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Delete dir\"));\n patchBuilder.dispose();\n\n RepositoryStateData state2 = myGit.getCurrentState(myRoot);\n\n List<ModificationData> changes = myGit.getCollectChangesPolicy().collectChanges(myRoot, state1, state2, CheckoutRules.DEFAULT);\n then(changes).hasSize(1);\n then(changes.get(0).getChanges()).extracting(\"fileName\", \"type\").containsOnly(Tuple.tuple(\"dir/file\", VcsChange.Type.REMOVED));\n }", "public static void deleteDirectory(File dir) {\n\t\tif (dir.isDirectory()) {\n\t\t\t//directory is empty, then delete it\n\t\t\tif (dir.list().length == 0) {\n\t\t\t\tdir.delete();\n\t\t\t} else {\n\t\t\t\t//list all the directory contents\n\t\t\t\tString[] subFiles = dir.list();\n\t\t\t\tfor (int i = 0; i < subFiles.length; i++) {\n\t\t\t\t\t//construct the file structure\n\t\t\t\t\tFile fileDelete = new File(dir, subFiles[i]);\n\t\t\t\t\t//recursive delete\n\t\t\t\t\tdeleteDirectory(fileDelete);\n\t\t\t\t}\n\t\t\t\t//check the directory again, if empty then delete it\n\t\t\t\tif (dir.list().length == 0) {\n\t\t\t\t\tdir.delete();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tdir.delete();\n\t\t}\n\t}", "private static boolean deleteDirectory(File directory) {\n\t if(directory.exists()){\n\t File[] files = directory.listFiles();\n\t if(null!=files){\n\t for(int i=0; i<files.length; i++) {\n\t if(files[i].isDirectory()) {\n\t deleteDirectory(files[i]);\n\t }\n\t else {\n\t files[i].delete();\n\t }\n\t }\n\t }\n\t }\n\t return(directory.delete());\n\t}", "private static boolean deleteDir(File dir) {\n\n if (dir.isDirectory()) {\n String[] children = dir.list();\n for (int i=0; i<children.length; i++) {\n boolean success = deleteDir(new File(dir, children[i]));\n if (!success) {\n return false;\n }\n }\n }\n\n // The directory is now empty so now it can be smoked\n return dir.delete();\n }", "public void cleanDirs() {\n\t\tfor (File f : files) {\n\t\t\tFileUtils.deleteDir(f.toString());\n\t\t}\n\t}", "public static void cleanDirectory(final ContextualLogger logger, Path start) throws IOException {\n if (!start.toFile().exists()) {\n boolean didMake = start.toFile().mkdir();\n Assert.assertTrue(didMake);\n }\n // We need the directory to be a directory (as we don't want to follow symlinks anywhere in this delete operation).\n Assert.assertTrue(start.toFile().isDirectory());\n // We don't want to delete the starting directory, but we do want to delete everything in it.\n Files.walkFileTree(start, new FileVisitor<Path>() {\n @Override\n public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n // Do nothing.\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n // This clearly can't be the start.\n Assert.assertFalse(start.equals(file));\n // Delete the file.\n Files.delete(file);\n logger.output(\"Deleted file \" + file);\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n logger.error(\"visitFileFailed: \\\"\" + file + \"\\\"\");\n throw exc;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {\n if (null == exc) {\n // Make sure that this isn't the starting directory.\n if (!start.equals(dir)) {\n Files.delete(dir);\n logger.output(\"Deleted directory \" + dir);\n }\n } else {\n throw exc;\n }\n return FileVisitResult.CONTINUE;\n }\n }\n );\n }", "public void deleteTmpDirectory() {\n\t\tdeleteTmpDirectory(tmpDir);\n\t}", "public void deleteImage(Context context, String name) {\n ContextWrapper cw = new ContextWrapper(context);\n String name_ = AppConfig.RECIPE_BOOK_FOLDER_NAME; //Folder name in device android/data/\n File directory = cw.getDir(name_, Context.MODE_PRIVATE);\n try {\n File f = new File(directory, name + \".png\");\n if (f.exists()) {\n f.delete();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public boolean clearDataDir(String path) {\n logger.info(\"clearDataDir is called, and processing.\");\n logger.info(\"Status report before remove data directory.\");\n IndexManager.statusReport();\n ArrayList<File> dataDirs = getDataDirectories();\n if (path.equals(\"*\")) {\n int size = dataDirs.size();\n for (int i = size - 1; i >= 0; i--) {\n Path removed_path = this.dataDirectories.remove(i).toPath();\n unWatchDir(removed_path);\n }\n if (dataDirs.size() == 0) {\n IndexManager indexManager = new IndexManager();\n indexManager.deleteIndex();\n return true;\n } else {\n logger.warning(\"Remove all data directory error. Cannot clear all directory.\");\n return false;\n }\n } else {\n Iterator<File> fileIterator = dataDirs.iterator();\n Path dir_path;\n Path file_path = Paths.get(path);\n //Iterate through a list of paths, If matched, remove.\n while (fileIterator.hasNext()) {\n dir_path = Paths.get(fileIterator.next().getAbsolutePath());\n if (dir_path.equals(file_path)) { //If it is matched.\n fileIterator.remove(); //remove the path that is matched.\n //Report to a terminal.\n logger.fine(\"Following path has been removed: \" + dir_path);\n IndexManager.statusReport(); //Log\n unWatchDir(file_path);\n return true;\n }\n }\n logger.info(\"No directory match.\");\n IndexManager.statusReport();\n return false;\n }\n }", "final private static boolean removeTemporaryDirectory(File directory) {\n //System.out.println(\"removeDirectory \" + directory);\n\n if (directory == null)\n return false;\n final File sdirectory = directory;\n\n Boolean b = (Boolean)AccessController.doPrivileged(\n new java.security.PrivilegedAction() {\n public Object run() {\n if (!sdirectory.exists())\n return new Boolean(true);\n if (!sdirectory.isDirectory())\n return new Boolean(false);\n String[] list = sdirectory.list();\n // Some JVMs return null for File.list() when the\n // directory is empty.\n if (list != null) {\n for (int i = 0; i < list.length; i++) {\n File entry = new File(sdirectory, list[i]);\n if (entry.isDirectory())\n {\n if (!removeTemporaryDirectory(entry))\n return new Boolean(false);\n }\n else\n {\n if (!entry.delete())\n return new Boolean(false);\n }\n }\n }\n return new Boolean(sdirectory.delete());\n }\n });\n if (b.booleanValue())\n {\n return true;\n }\n else return false;\n }", "public static void deleteDirectory(String directory){\n\t\tlog.info(\"Removing \" + directory + \" directory\");\n\t\tFile tempDir = new File(directory);\n\t\tdeleteDirectory(tempDir);\n\t\tlog.info(\"Finished removing directory\");\n\t}", "public static void deleteDirectory(File directory) {\n // LOG.debug(\"ics.core.io.FileUtils.deleteDirectory(): Deleting directory \"\n // + directory.toString());\n File[] files = directory.listFiles();\n for (int n = 0; n < files.length; n++) {\n File nextFile = files[n];\n\n // if it's a directory, delete sub-directories and files before\n // removing the empty directory\n if (nextFile.isDirectory() == true) {\n deleteDirectory(nextFile);\n } else {\n nextFile.delete(); // otherwise just delete the file\n // LOG.debug(\"ics.core.io.FileUtils.deleteDirectory(): Deleting file \"\n // + nextFile.toString());\n }\n }\n\n // finally, delete the specified directory\n if (directory.delete() == false) {\n LOG.warn(\"ics.core.io.FileUtils.deleteDirectory(): Unable to delete \"\n + directory.toString());\n }\n }", "@Override\n\tpublic boolean delete() {\n\t\tboolean result = false;\n\t\ttry{\n\t\t\tif (this.exists()) {\n\t\t\t\tif (this.isDirectory()) {\n\t\t\t\t\tif (this.listFiles() != null) {\n\t\t\t\t\t\tfor (java.io.File file : this.listFiles()) {\n\t\t\t\t\t\t\tif (file.isDirectory()) ((File) file).delete();\n\t\t\t\t\t\t\telse if (file.isFile()) super.delete();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tsuper.delete();\n\t\t\t\t} else if (this.isFile()) super.delete();\n\t\t\t}\n\t\t\t\n\t\t\tresult = true;\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn result;\n\t}", "public static boolean removeDirectory(File directory) {\n\t\r\n\t\t if (directory == null)\r\n\t\t return false;\r\n\t\t if (!directory.exists())\r\n\t\t return true;\r\n\t\t if (!directory.isDirectory())\r\n\t\t return false;\r\n\t\r\n\t\t String[] list = directory.list();\r\n\t\r\n\t\t // Some JVMs return null for File.list() when the\r\n\t\t // directory is empty.\r\n\t\t if (list != null) {\r\n\t\t for (int i = 0; i < list.length; i++) {\r\n\t\t File entry = new File(directory, list[i]);\r\n\t\r\n\t\t // System.out.println(\"\\tremoving entry \" + entry);\r\n\t\r\n\t\t if (entry.isDirectory())\r\n\t\t {\r\n\t\t if (!removeDirectory(entry))\r\n\t\t return false;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t if (!entry.delete())\r\n\t\t return false;\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\r\n\t\t return directory.delete();\r\n\t}", "private void cleanFile(IFile file) {\n \t\tlog(\" Cleaning build directory for \" + file.getName());\n \t\t\n \t\tString buildDir = getBuildDirectory(file);\n \t\t// Check the build directory and try to create it\n \t\tFile buildDirFile = new File(buildDir);\n \t\tif (buildDirFile.exists()) {\n \t\t\tFile[] files = buildDirFile.listFiles();\n \t\t\tfor (File f : files) {\n \t\t\t\ttry {\n \t\t\t\t\tf.delete();\n \t\t\t\t\tlog(\" - \" + f.getName());\n \t\t\t\t} catch (Exception _) {\n \t\t\t\t\tlog(\" > Failed: \" + f.getName());\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public static final void delete(final File file)\n\t{\n\t\tif (file.isDirectory())\n\t\t{\n\t\t\tfor (final String temp : file.list())\n\t\t\t{\n\t\t\t\tdelete(new File(file, temp));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfile.delete();\n\t\t}\n\t}", "public boolean folderCleaner(String folderPath, Boolean ifDeleteSubdirs, Boolean ifDeleteFiles, Boolean ifDeleteRoot, Boolean ifPrompt) throws IOException { \n folderPath = folderPath.replace(\"\\\\\", \"/\");\n if(folderPath.endsWith(\"/\")) { folderPath = folderPath.substring(0, folderPath.length() - 1); }\n File dir = new File(folderPath);\n String how = \"\", action = null;\n Boolean success = false;\n Boolean current = false;\n if (dir.exists() && dir.isDirectory()) { \n try{ \n success = true;\n String[] children = dir.list();\n if(children.length > 0) {\n action = \"CLEANED\";\n for (int i = 0; i < children.length; i++) {\n File child = new File(dir, children[i]);\n if(child.isDirectory()){ if(ifDeleteSubdirs) { FileUtils.forceDelete(child); } if(ifPrompt && ifDeleteSubdirs) {System.out.print(\"DIRECTORY \");} }\n else { if(ifDeleteFiles) { FileUtils.forceDelete(child); } if(ifPrompt && ifDeleteFiles) {System.out.print(\" FILE \");} }\n \n current = !child.exists();\n success = success && current;\n if(current) { how = \" DELETED: \\\"\"; } else { how = \"NOT DELETED: \\\"\"; }\n if(ifPrompt && current) System.out.print(how + child.getAbsolutePath() + \"\\n\");\n }\n }\n // THE DIRECTORY IS EMPTY - DELETE IT IF REQUIRED\n if (ifDeleteRoot) { FileUtils.forceDelete(dir); success = success && !dir.exists(); action = \"DELETED\"; }\n if(ifPrompt && (!action.equals(null))) {\n if (success) { \n System.out.println(\"\\n\" + \"FULLY \" + action + \" DIRECTORY: \\\"\" + folderPath.substring(folderPath.lastIndexOf(\"/\") + 1, folderPath.length()) + \"\\\"\\n\");\n } else {\n System.out.println(\"\\n\" + \"NOT FULLY \" + action + \" DIRECTORY: \\\"\" + folderPath.substring(folderPath.lastIndexOf(\"/\") + 1, folderPath.length()) + \"\\\"\\n\");\n }\n }\n } catch (Exception e) {} \n }\n return success;\n }", "private static void doDeleteEmptyDir(String dir) {\n\n boolean success = (new File(dir)).delete();\n\n if (success) {\n System.out.println(\"Successfully deleted empty directory: \" + dir);\n } else {\n System.out.println(\"Failed to delete empty directory: \" + dir);\n }\n\n }", "private Step deleteLocalWorkingDir() {\n return stepBuilderFactory.get(STEP_DELETE_LOCAL_WORK_DIR)\n .tasklet(deleteLocalWorkingDir)\n .build();\n }", "public static boolean delete(String name) {\n\t\ttry {\n\t\t\tdeleteDirectory(new File(\"save/\" + name));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\tSystem.out.println(\"[Info] Map \" + name + \" deleted\");\n\t\treturn true;\n\t}", "public static String getDir(String name) {\n\t\tint s = name.lastIndexOf(FILE_SEP);\n\t\treturn s == -1 ? null : name.substring(0, s);\n\t}", "private void loadDirectoryUp() {\n\t\tString s = pathDirsList.remove(pathDirsList.size() - 1);\n\t\t// path modified to exclude present directory\n\t\tpath = new File(path.toString().substring(0,\n\t\t\t\tpath.toString().lastIndexOf(s)));\n\t\tfileList.clear();\n\t}", "private void emptyTestDirectory() {\n // Delete the files in the /tmp/QVCSTestFiles directory.\n File tempDirectory = new File(TestHelper.buildTestDirectoryName(TEST_SUBDIRECTORY));\n File[] files = tempDirectory.listFiles();\n if (files != null) {\n for (File file : files) {\n if (file.isDirectory()) {\n File[] subFiles = file.listFiles();\n for (File subFile : subFiles) {\n if (subFile.isDirectory()) {\n File[] subSubFiles = subFile.listFiles();\n for (File subSubFile : subSubFiles) {\n subSubFile.delete();\n }\n }\n subFile.delete();\n }\n }\n file.delete();\n }\n }\n }", "public boolean removeCompany(String name) {\r\n\t\tfor (int i = 0; i < companyDirectory.size(); i++) {\r\n\t\t\tif (companyDirectory.get(i).getName().equals(name)) {\r\n\t\t\t\tcompanyDirectory.remove(i);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean clean() {\n\t\tboolean result = false;\n\n\t\ttry{\n\t\t\tif (this.exists()) {\n\t\t\t\tif (this.listFiles() != null) {\n\t\t\t\t\tfor (java.io.File file : this.listFiles()) {\n\t\t\t\t\t\t((File) file).delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult = true;\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn result;\n\t}", "public static void deleteDirectory( File directory ) throws IOException\n {\n if ( !directory.exists() )\n {\n return;\n }\n\n if ( !isSymlink( directory ) )\n {\n cleanDirectory( directory );\n }\n\n if ( !directory.delete() )\n {\n throw new IOException( I18n.err( I18n.ERR_17004_UNABLE_DELETE_DIR, directory ) );\n }\n }", "public static void delete(File file) throws IOException {\n String method = \"delete() - \";\n if ((file != null) && (file.exists())) {\n if (file.isDirectory()) {\n if (file.list().length == 0) {\n file.delete();\n }\n else {\n String files[] = file.list();\n for (String current : files) {\n File fileToDelete = new File(file, current);\n delete(fileToDelete);\n if (file.list().length == 0) {\n file.delete();\n }\n }\n }\n }\n else {\n file.delete();\n }\n }\n else {\n throw new IOException(method \n + \"The input file is null or does not exist.\");\n }\n }", "private void deleteWorkingRoot(WorkUnit workUnit, boolean copy) {\n\n // Construct folder name (will be copy or not)\n String folderToDelete = format(\"%s%s\", workUnit.root, (copy ? \"_copy\" : \"\"));\n\n // 7. Clean work directory\n MigrationHistory history = historyMgr.startStep(workUnit.migration,\n StepEnum.CLEANING, format(\"Remove %s\", folderToDelete));\n\n // Sanity check\n if (!StringUtils.isBlank(folderToDelete) && folderToDelete.contains(\"20\") && folderToDelete.contains(\"_\")) {\n\n try {\n\n if (isWindows) {\n // FileUtils.deleteDirectory(new File(folderToDelete));\n // JBU : Fails occassionally on windows with file lock issue\n // FileUtils.deleteDirectory(new File(folderToDelete));\n // JBU : Fails on windows not able to delete a large number of files?..\n String gitCommand = format(\"rd /s /q %s\", folderToDelete);\n execCommand(workUnit.commandManager, Shell.formatDirectory(applicationProperties.work.directory), gitCommand);\n\n } else {\n // Seems to work ok on linux. Keeping Java command for the moment\n FileSystemUtils.deleteRecursively(new File(folderToDelete));\n }\n\n historyMgr.endStep(history, StatusEnum.DONE, null);\n } catch (Exception exc) {\n LOG.error(\"Failed deleteDirectory: \", exc);\n historyMgr.endStep(history, StatusEnum.FAILED, exc.getMessage());\n }\n\n } else {\n LOG.error(\"Failed deleteDirectory: Badly formed delete path\");\n historyMgr.endStep(history, StatusEnum.FAILED, \"Badly formed delete path\");\n }\n }", "public static final void deleteDirectory(File directory) throws IOException {\n if (!directory.exists()) {\n return;\n }\n\n cleanDirectory(directory);\n\n if (!directory.delete()) {\n throw new IOException(\"Unable to delete directory \" + directory + \".\");\n }\n }", "private synchronized static void deleteParents(File file) {\n if (file == null) {\n return;\n }\n\n File tmp = file;\n\n for (int i = 0; i < directoryLevels; i++) {\n File directory = tmp.getParentFile();\n File[] files = directory.listFiles();\n\n // Only delete empty directories\n if (files.length != 0) {\n break;\n }\n\n directory.delete();\n tmp = directory;\n }\n }", "public void deleteDefault(File file)\n\t{\n\t\ttry {\n\t\t\tFileUtils.deleteDirectory(file);\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}", "@Override\n public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException{\n if (e == null) {\n Files.deleteIfExists(dir);\n }\n return FileVisitResult.CONTINUE;\n }", "public int remove(String pathname) throws YAPI_Exception\n {\n byte[] json = new byte[0];\n String res;\n json = sendCommand(String.format(Locale.US, \"del&f=%s\",pathname));\n res = _json_get_key(json, \"res\");\n //noinspection DoubleNegation\n if (!(res.equals(\"ok\"))) { throw new YAPI_Exception( YAPI.IO_ERROR, \"unable to remove file\");}\n return YAPI.SUCCESS;\n }" ]
[ "0.7544898", "0.66567403", "0.65870893", "0.6410504", "0.63709486", "0.6208937", "0.6083008", "0.60785216", "0.6065324", "0.6031468", "0.59682053", "0.59289485", "0.58594465", "0.5848219", "0.5843619", "0.5812143", "0.5787979", "0.5778303", "0.5771718", "0.5753137", "0.57530993", "0.57217765", "0.57001114", "0.56972873", "0.5692379", "0.56780726", "0.5673469", "0.56570035", "0.5649536", "0.56447583", "0.56414413", "0.5638042", "0.56115687", "0.56109834", "0.5598095", "0.5593163", "0.55924094", "0.5588108", "0.55734897", "0.55622995", "0.55564123", "0.5546198", "0.5544744", "0.55215347", "0.55193174", "0.5517809", "0.5514458", "0.5509292", "0.5486209", "0.5480307", "0.54697484", "0.54622805", "0.54450077", "0.5428811", "0.5412856", "0.5406348", "0.5393413", "0.5386685", "0.5384482", "0.53823775", "0.5378088", "0.5372214", "0.53712684", "0.53708947", "0.5367105", "0.5363665", "0.5361433", "0.5351687", "0.5343945", "0.5331794", "0.5319641", "0.53154147", "0.5307471", "0.53064394", "0.5288111", "0.52723515", "0.52702445", "0.5265262", "0.52630675", "0.5257099", "0.52534366", "0.52515846", "0.52379036", "0.52151555", "0.52073926", "0.51895654", "0.51859343", "0.5183898", "0.51776284", "0.5176866", "0.51593226", "0.51585525", "0.51579314", "0.51472557", "0.5132576", "0.51284283", "0.51215404", "0.5118761", "0.5118372", "0.51170677" ]
0.717407
1
Pretty print the tree rooted at currentDirectory using preOrder traversal
public void tree() { Iterable<Position<FileElement>> toPrint = fileSystem.PreOrder(); for (Position<FileElement> p : toPrint) { int depth = fileSystem.getDepth(p); for (int i = 0; i < depth; i++) { System.out.print(" "); } System.out.println(p.getValue()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }", "public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }", "public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public void printPreOrder() {\n if (root == null) {\n System.out.println(\"\");\n } else {\n Node x = root;\n System.out.print(x.key);\n if (x.left != null) x.left.preOrderPrint();\n if (x.right != null) x.right.preOrderPrint();\n System.out.println();\n }\n }", "public void prettyPrintTree() {\r\n\t\tSystem.out.print(\"prettyPrintTree starting\");\r\n\t\tfor (int i = 0; i <= this.getTreeDepth(); i++) {\r\n\t\t\tprettyPrintTree(root, 0, i);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}", "static void preorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n System.out.println(\" \" + indent + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n }", "static void preorderPrint(TreeNode node) {\n if (node == null)\n return;\n\n System.out.print(\" \" + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next());\n }\n }", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "private void _printPreorder(IntTreeNode root) {\n if (root != null) {\n System.out.print(\" \" + root.data);\n _printPreorder(root.left);\n _printPreorder(root.right);\n }\n }", "public static void printPreOrder(Node treeRoot) {\r\n\t\tif (treeRoot == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.print(treeRoot.root + \", \");\r\n\t\tprintPreOrder(treeRoot.left);\r\n\t\tprintPreOrder(treeRoot.right);\r\n\t}", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "public void printTree() {\r\n printTree(overallRoot, 0);\r\n }", "private void _printPreorder(IntTreeNode root) {\r\n if (root != null) {\r\n System.out.print(\" \" + root.data);\r\n _printPreorder(root.left);\r\n _printPreorder(root.right);\r\n }\r\n }", "void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }", "private void printPreorder(IntTreeNode root) {\n if (root != null) {\n System.out.print(\" \" + root.data);\n printPreorder(root.left);\n printPreorder(root.right);\n }\n }", "public void printTreePreOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n System.out.print(node.item + \" \");\n printTreePreOrder(node.left);\n printTreePreOrder(node.right);\n\n }", "public void printIterativePreorderTraversal() {\r\n\t\tprintIterativePreorderTraversal(rootNode);\r\n\t}", "private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\n\t}", "public void printInOrder() {\n printInOrderHelper(root);\n }", "public void printTree() {\n printTreeHelper(root);\n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "public String printTree() {\n printSideways();\n return \"\";\n }", "public void preOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(localRoot.data+\" \");\r\n\t\t\tpreOrder(localRoot.leftChild);\r\n\t\t\tpreOrder(localRoot.rightChild);\r\n\t\t}\r\n\t}", "private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}", "public String preorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn preorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "private void traversePreOrder(BinaryNode<AnyType> curr, int indent) {\n\t\tfor(int i = 0; i < indent; i++) {\n\t\t\tSystem.out.print(\"\\t\");\n\t\t}\n\t\tSystem.out.println(curr.element);\n\t\tfor (int i = 0; i < curr.duplicate.size(); i++) {\n\t\t\tSystem.out.println(curr.duplicate.get(i).element);\n\t\t}\n\t\tif (curr.left != null) {\n\t\t\ttraversePreOrder(curr.left, indent + 1);\n\t\t}\n\n\t\tif (curr.right != null) {\n\t\t\ttraversePreOrder(curr.right, indent + 1);\n\t\t}\n\t}", "protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "public static void preorderTraversal(Node root)\r\n {\r\n if (root == null) {\r\n return;\r\n }\r\n \r\n System.out.print(root.data + \" \");\r\n preorderTraversal(root.left);\r\n preorderTraversal(root.right);\r\n }", "private void printTree(File directory, int level, Environment env) {\n\t\tfor (int i = 0; i < level; i++) {\n\t\t\tenv.write(\" \"); // shift output\n\t\t}\n\n\t\tif (directory.isDirectory()) {\n\t\t\tenv.writeln(\"[\" + directory.getName() + \"]\");\n\t\t\t\n\t\t\t\n\t\t\tFile[] children = directory.listFiles();\n\t\t\t\n\t\t\tif(children != null) {\n\t\t\t\tfor (File file : children) {\n\t\t\t\t\tprintTree(file, level + 1, env);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tenv.writeln(directory.getName()); // print file name\n\t\t}\n\t}", "public void preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\n }", "protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}", "void preOrderPrint(Node root, boolean recursion)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrderPrint(root.left, true);\n\t\tpreOrderPrint(root.right, true);\n\t}", "private void preOrder(Node root) {\r\n\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (preOrderCount < 20) {\r\n\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + preOrderCount);\r\n\t\t\tpreOrderCount++;\r\n\t\t\tpreOrder(root.getlChild());\r\n\t\t\tpreOrder(root.getrChild());\r\n\t\t}\r\n\r\n\t}", "public void printLevelOrder() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tSystem.out.println(\"Empty Tree\");\r\n\t\t} else {\r\n\t\t\tQueueLi<BinaryNode<AnyType>> q = new QueueLi<>();\r\n\t\t\tBinaryNode<AnyType> currentNode;\r\n\t\t\tq.enqueue(root);\r\n\t\t\twhile (!q.isEmpty()) {\r\n\t\t\t\tcurrentNode = q.dequeue();\r\n\t\t\t\tif (currentNode.left != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.left);\r\n\t\t\t\t} // if\r\n\t\t\t\tif (currentNode.right != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.right);\r\n\t\t\t\t} // if\r\n\t\t\t\tSystem.out.print(currentNode.element + \" \");\r\n\t\t\t} // while\r\n\t\t} // else\r\n\t}", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public void preorder()\r\n {\r\n preorder(root);\r\n }", "public static void printTree(Directory currentDirectory, String spacing)\r\n {\r\n for(Directory subDirectory: currentDirectory.getListOfSubDirectories())\r\n { \r\n System.out.println(spacing + subDirectory.getName());\r\n printTree(subDirectory, spacing + \"\\t\");\r\n } \r\n }", "public static void preOrder(Node root) {\n if (root == null)\n return;\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n\n }", "public void preOrderTraversal() {\n beginAnimation();\n treePreOrderTraversal(root);\n stopAnimation();\n\n }", "public void preOrder(Node root) {\n if (root != null) {\n System.out.print(root.getData() + \" \");\n preOrder(root.getLeftChild());\n preOrder(root.getRightChild());\n }\n }", "public void preorder()\n {\n preorder(root);\n }", "public void preorder()\n {\n preorder(root);\n }", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "public void printPreOrder(Node currNode){\n if (currNode != null){\n System.out.print(currNode.val+ \", \");\n printInOrder(currNode.left);\n printInOrder(currNode.right);\n }\n }", "void printPreorder(Node node) {\n if (node == null)\n return;\n\n /* first print data of node */\n System.out.print(node.key + \" \");\n\n /* then recur on left sutree */\n printPreorder(node.left);\n\n /* now recur on right subtree */\n printPreorder(node.right);\n }", "public static String printTree()\r\n {\r\n String result = \"\";\r\n for (String s: tree.toArrayList())\r\n result = result + \" \" + s;\r\n return result;\r\n }", "void printPostorder() { \n\t\tprintPostorder(root);\n\t}", "public void print(){\n inorderTraversal(this.root);\n }", "public void preOrder(TreeNode root){\n\t\t//Change place of temp\n\t\tSystem.out.println(root.toString());\n\t\tif(root.getLeft()!= null){\n\t\t\tpreOrder(root.getLeft());\n\t\t}\n\t\tif(root.getMiddle()!=null){\n\t\t\tpreOrder(root.getMiddle());\n\t\t}\n\t\tif(root.getRight()!= null){\n\t\t\tpreOrder(root.getRight());\n\t\t}\n\t}", "@Override\n public String print() {\n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n \n System.out.print(\"In ascending order: \");\n for (int i=0; i<inorderTraverse.size(); i++) {\n System.out.print(inorderTraverse.get(i)+\" \");\n }\n System.out.println(\"\");\n return \"\";\n }", "void printLevelOrder() {\n TreeNode2 nextLevelRoot = this;\n while (nextLevelRoot != null) {\n TreeNode2 current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n System.out.print(current.val + \" \");\n if (nextLevelRoot == null) {\n if (current.left != null)\n nextLevelRoot = current.left;\n else if (current.right != null)\n nextLevelRoot = current.right;\n }\n current = current.next;\n }\n System.out.println();\n }\n }", "void preOrder(Node node) \n { \n if (node != null) \n { \n System.out.print(node.key + \" \"); \n preOrder(node.left); \n preOrder(node.right); \n } \n }", "private void preOrderPrint() {\n System.out.print(\" \" + key);\n if (left != null) left.preOrderPrint();\n if (right != null) right.preOrderPrint();\n }", "public void preorder() {\n\t\tpreorder(root);\n\t}", "public void inOrderPrint()\r\n\t{\r\n\t\tif(root != null)\r\n\t\t\troot.inOrderPrint();\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Empty\");\r\n\t}", "private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }", "private void preorderHelper(TreeNode<T> node){\n if(node == null)\n return;\n\n System.out.printf(\"%s \" , node.data);\n preorderHelper(node.leftNode);\n preorderHelper(node.rightNode);\n }", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void dumpTree() {\n\t\tsendMessage(\"/g_dumpTree\", new Object[] { 0, 0 });\n\t}", "public static void preOrder(TreeNode node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }", "private String traversePreOrder(BinaryNode<T> root) {\n preOrderTrav += root.getData() + \" -> \";\n if (root.getLeftNode() != null) { // traverse left\n traversePreOrder(root.getLeftNode());\n }\n if (root.getRightNode() != null) { // traverse right\n traversePreOrder(root.getRightNode());\n }\n return preOrderTrav;\n }", "public void printTree(SortingField field)\n {\n if(this instanceof File){\n System.out.println(this.getName());\n return;\n }\n ((Folder)this).sortList(field);\n //now the list is sorted according to the field given\n\n //printing the tree\n ((Folder) this).print(\"\");\n }", "public void printInorder() {\r\n System.out.print(\"inorder:\");\r\n printInorder(overallRoot);\r\n System.out.println();\r\n }", "private void preorderLeftOnly(Node root) {\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n if (root.left != null)\r\n preorderLeftOnly(root.left);\r\n }", "private void showTree(EarleyParser.Node root,int level, String previous) {\n\t\tSystem.out.print(level);\n\t\tfor(int i = 0; i <= level; i++)\n\t\t\tSystem.out.print(\" \");\n\t\tSystem.out.println(root.text);\n\t\tString cur = root.text;\n\t\twhile(graph.containsVertex(cur)) {\n\t\t\tcur = cur + \" \";\n\t\t}\n\n\t\tgraph.addVertex(cur);\n\t\tif(previous != null) {\n\t\t\tgraph.addEdge(edgeid++, previous, cur);\n\t\t}\n\t\tfor(EarleyParser.Node sibling : root.siblings) {\n\t\t\tshowTree(sibling, level+1, cur);\n\t\t}\n\t}", "public void preOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tSystem.out.println(root);\n\t\t\tpreOrderTraversal(root.getLeftChild());\n\t\t\tpreOrderTraversal(root.getRightChild());\n\t\t}\n\t}", "public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "public void printTree() {\r\n\t\tif (isEmpty())\r\n\t\t\tSystem.out.println(\"Empty tree\");\r\n\t\telse\r\n\t\t\tprintTree(root);\r\n\t}", "private String preorderTraverse(BinarySearchTree curr, StringBuffer treeAsString){\r\n\t\t\r\n\t\t//Get node\r\n\t\ttreeAsString.append(curr.getRoot().toString() + \" \");\r\n\t\t\r\n\t\t//Get leftChild\r\n\t\tif(curr.getLeftChild() != null){\r\n\t\t\tpreorderTraverse(curr.getLeftChild(), treeAsString);\r\n\t\t}\r\n\t\t\r\n\t\t//get rightChild\r\n\t\tif(curr.getRightChild() != null){\r\n\t\t\tpreorderTraverse(curr.getRightChild(), treeAsString);\r\n\t\t}\r\n\t\t\r\n\t\t//return\r\n\t\treturn treeAsString.toString();\r\n\t}", "public static void Java_tree(File dir, int depth, String sort_method, int initialDepth) {\n // TODO: print file tree\n File[] fileList = sortFileList(dir.listFiles(), sort_method);\n depth--;\n\n if (fileList != null && fileList.length != 0) {\n for (File file : fileList) {\n if (dir == currentDirectory) {\n System.out.println(file.getName());\n } else {\n String output = \"|-\" + file.getName();\n for (int i = 0; i < (initialDepth - depth - 1); i++) {\n output = \" \" + output;\n }\n System.out.println(output);\n }\n\n if (depth > 0 && file.isDirectory()) {\n Java_tree(file, depth, sort_method, initialDepth);\n }\n }\n }\n\n }", "public String makeTree() {\r\n // Create a stack to store the files/directories in the tree\r\n Stack<DirectoryTreeNode> itemStack = new Stack<>();\r\n // Initialize a string variable to store the tree diagram\r\n String tree = \"\";\r\n // Push the root directory into the stack\r\n itemStack.push(this.rootDir);\r\n\r\n // Loop through the items in the Stack until all the items have been\r\n // traversed (this is similar to the pre-order traversal of the tree)\r\n while (!itemStack.isEmpty()) {\r\n // Get the item on the top of the stack and store it in current\r\n DirectoryTreeNode current = (DirectoryTreeNode) itemStack.pop();\r\n // Get the number of tabs required in the output for this item\r\n int numTabs = this.getNumberOfAncestors((E) current);\r\n // Get the string of tabs needed to put before current's name\r\n String tabs = this.getNumberOfTabs(numTabs);\r\n // Add the required number of tabs, the current item's of name and a\r\n // newline\r\n tree += tabs + current.getName() + \"\\n\";\r\n\r\n // Check if current is a Directory (in which case it may have\r\n // sub directories and files)\r\n if (current instanceof Directory) {\r\n // Get the list of files and directories of current directory\r\n ArrayList<DirectoryTreeNode> contents =\r\n ((Directory) current).getContents();\r\n // Loop through the contents of current and add them to the stack\r\n for (int i = contents.size() - 1; i >= 0; i--) {\r\n itemStack.add(contents.get(i));\r\n }\r\n }\r\n }\r\n // Return the generated tree diagram\r\n return tree;\r\n }", "public void printInorder() {\n System.out.print(\"inorder:\");\n printInorder(overallRoot);\n System.out.println();\n }", "public void treeOrder ()\n {\n treeOrder (root, 0);\n }", "public void printSortedList() {\n if (root == null) {\n System.out.print(\"Empty Tree.\");\n return;\n } else {\n LNRTraversal(root);\n }\n }", "public static void preorder(Node root){\n\t\tif(root != null){\n\t\t\tSystem.out.println(root.toString());\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t}\n\t}", "public static String printTree()\n {\n \tString tree = \"\";\n ArrayList<String> letters = converter.toArrayList();\n for(int i = 0; i < letters.size(); i++)\n {\n tree += letters.get(i);\n if(i + 1 < letters.size())\n \t tree += \" \";\n }\n \n return tree;\n }", "public static void preOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tSystem.out.print(node.value + \" \");\n\t\tpreOrder(node.left);\n\t\tpreOrder(node.right);\t\n\t}", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "void printZigZagTraversal() {\n\n\t\t// if null then return\n\t\tif (rootNode == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// declare two stacks\n\t\tStack<ZNode> currentLevel = new Stack<>();\n\t\tStack<ZNode> nextLevel = new Stack<>();\n\n\t\t// push the root\n\t\tcurrentLevel.push(rootNode);\n\t\tboolean leftToRight = true;\n\n\t\t// check if stack is empty\n\t\twhile (!currentLevel.isEmpty()) {\n\n\t\t\t// pop out of stack\n\t\t\tZNode node = currentLevel.pop();\n\n\t\t\t// print the data in it\n\t\t\tSystem.out.print(node.data + \" \");\n\n\t\t\t// store data according to current\n\t\t\t// order.\n\t\t\tif (leftToRight) {\n\t\t\t\tif (node.leftChild != null) {\n\t\t\t\t\tnextLevel.push(node.leftChild);\n\t\t\t\t}\n\n\t\t\t\tif (node.rightChild != null) {\n\t\t\t\t\tnextLevel.push(node.rightChild);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (node.rightChild != null) {\n\t\t\t\t\tnextLevel.push(node.rightChild);\n\t\t\t\t}\n\n\t\t\t\tif (node.leftChild != null) {\n\t\t\t\t\tnextLevel.push(node.leftChild);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentLevel.isEmpty()) {\n\t\t\t\tleftToRight = !leftToRight;\n\t\t\t\tStack<ZNode> temp = currentLevel;\n\t\t\t\tcurrentLevel = nextLevel;\n\t\t\t\tnextLevel = temp;\n\t\t\t}\n\t\t}\n\t}", "public void printTree( )\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tSystem.out.println( \"Empty tree\" );\r\n\t\telse\r\n\t\t\tprintTree( root );\r\n\t}", "public void preOrder() {\n preOrder(root);\n }", "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public void preOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n preOrderTraverseTree(focusNode.leftChild);\n\n preOrderTraverseTree(focusNode.rightChild);\n\n }\n }", "private void preorderTraverseForToString(Node node) {\n\t\tif (node == null)\n\t\t\treturn;\n\n\t\tthis.order += node + \"\\n\";\n\n\t\t// walk trough left sub-tree\n\t\tpreorderTraverseForToString(node.left);\n\t\t// walk trough right sub-tree\n\t\tpreorderTraverseForToString(node.right);\n\t}", "private void prettyPrintTree(Node root, int curLevel, int desiredLevel) {\r\n\t\tif (root == null) {\r\n\t\t\tif (curLevel == desiredLevel) {\r\n\t\t\t\tSystem.out.print(\"<> \");\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tprettyPrintTree(root.getlChild(), curLevel + 1, desiredLevel);\r\n\t\tif (curLevel == desiredLevel) {\r\n\t\t\tSystem.out.print(\"<\" + root.getData() + \"> \");\r\n\t\t}\r\n\t\tprettyPrintTree(root.getrChild(), curLevel + 1, desiredLevel);\r\n\t}", "public static String printTree(Tree t) {\n\tStringWriter sw = new StringWriter();\n\tPrintWriter pw = new PrintWriter(sw);\n\tTreePrint tp = new TreePrint(\"penn\", \"markHeadNodes\", tlp);\n\ttp.printTree(t, pw);\n\treturn sw.toString();\n }", "private void _printInorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printInorder(root.left);\r\n System.out.print(\" \" + root.data);\r\n _printInorder(root.right);\r\n }\r\n }", "public void preorderTraverseTree(Node focusNode) {\n\n\t\tif (focusNode != null) {\n\n\t\t\tSystem.out.print(focusNode.data + \" \");\n\n\t\t\tpreorderTraverseTree(focusNode.left);\n\t\t\tpreorderTraverseTree(focusNode.right);\n\n\t\t}\n\n\t}", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public static void printTree(Node head) {\r\n System.out.println(\"Binary Tree:\");\r\n printInOrder(head, 0, \"H\", 17);\r\n System.out.println();\r\n }" ]
[ "0.7535496", "0.7449991", "0.7388696", "0.7388696", "0.7314519", "0.72482085", "0.71984655", "0.71575165", "0.70331734", "0.7008216", "0.6953659", "0.69163734", "0.68668604", "0.6826947", "0.68135357", "0.68094015", "0.67969275", "0.67896354", "0.6779093", "0.67653257", "0.6750627", "0.6744135", "0.67413485", "0.67335963", "0.67321515", "0.67221993", "0.6706381", "0.67020583", "0.6700566", "0.66923696", "0.6690575", "0.66710985", "0.6666031", "0.6646497", "0.6620649", "0.66030544", "0.65796685", "0.65324837", "0.6524327", "0.65235084", "0.65201366", "0.65194666", "0.6513764", "0.65121007", "0.6501671", "0.6487667", "0.6472452", "0.6472452", "0.647112", "0.647112", "0.6468607", "0.6465065", "0.6432669", "0.64008677", "0.63807756", "0.6378757", "0.63782156", "0.63655424", "0.6364263", "0.6359303", "0.6355067", "0.63479626", "0.63383514", "0.63170856", "0.6316325", "0.6310366", "0.6305189", "0.6302386", "0.62939966", "0.62871706", "0.62866056", "0.6283947", "0.6280635", "0.6280483", "0.6272273", "0.62689096", "0.62664413", "0.62643397", "0.6260777", "0.6254671", "0.6244474", "0.62394845", "0.62368995", "0.6235981", "0.6235828", "0.6228407", "0.6225029", "0.6222312", "0.62185466", "0.6216824", "0.621562", "0.62101936", "0.61891687", "0.61889136", "0.61813176", "0.617711", "0.61443216", "0.61420316", "0.6140782", "0.61311644" ]
0.7729624
0
Create (and eventually set up) Jetty's HttpClient:
private void doHandshake()throws Exception { HttpClient httpClient = new HttpClient(); // Here set up Jetty's HttpClient, for example: // httpClient.setMaxConnectionsPerDestination(2); httpClient.start(); // Prepare the transport Map<String, Object> options = new HashMap<String, Object>(); ClientTransport transport = new LongPollingTransport(options, httpClient); // Create the BayeuxClient ClientSession client = new BayeuxClient("http://localhost:8080/childrenguard-server/cometd", transport); client.handshake(null,new ClientSessionChannel.MessageListener() { public void onMessage(ClientSessionChannel channel, Message message) { System.out.println("fail to connect to server."); if (message.isSuccessful()) { System.out.println(message); // Here handshake is successful } } }); // Here set up the BayeuxClient, for example: //client.getChannel(Channel.META_CONNECT).addListener(new ClientSessionChannel.MessageListener() { }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static HttpClient createClient() {\n return HttpClients.createMinimal();\n }", "public static final DefaultHttpClient createHttpClient() {\n\t\treturn createHttpClient(3);\n\t}", "private DefaultHttpClient createHttpClient()\n throws IOException\n {\n XCapCredentialsProvider credentialsProvider\n = new XCapCredentialsProvider();\n credentialsProvider.setCredentials(\n AuthScope.ANY,\n new UsernamePasswordCredentials(getUserName(), password));\n\n return HttpUtils.getHttpClient(\n null , null, uri.getHost(), credentialsProvider);\n }", "public DefaultHttpClientImpl() {\n SchemeRegistry schemeRegistry = new SchemeRegistry();\n schemeRegistry.register(new Scheme(\n \"http\", PlainSocketFactory.getSocketFactory(), 80));\n\n schemeRegistry.register(new Scheme(\n \"https\", SSLSocketFactory.getSocketFactory(), 443));\n conman = new ThreadSafeClientConnManager(params, schemeRegistry);\n }", "public static HttpClient Factory() {\n\t\treturn httpclient;\n\t}", "public interface HttpClientFactory {\n CloseableHttpClient newHttpClient();\n}", "private HttpClient() {\n\t}", "public interface HttpClient {\n\n\torg.apache.http.client.HttpClient getClient();\n\n\tString fetch(URI uri) throws IOException;\n\n\tvoid init() throws KeyManagementException, NoSuchAlgorithmException;\n}", "public static Object httpClient() {\n return new Object();\n// return HttpClient.newBuilder()\n// .version(HttpClient.Version.HTTP_1_1)\n// .followRedirects(HttpClient.Redirect.NORMAL)\n// .connectTimeout(Duration.ofSeconds(300))\n// .build();\n }", "private CloseableHttpAsyncClient createHttpClient() {\n RequestConfig.Builder requestConfigBuilder = RequestConfig.custom()\n .setConnectTimeout(Timeout.ofMilliseconds(DEFAULT_CONNECT_TIMEOUT_MILLIS))\n .setResponseTimeout(Timeout.ofMilliseconds(DEFAULT_RESPONSE_TIMEOUT_MILLIS));\n if (requestConfigCallback != null) {\n requestConfigBuilder = requestConfigCallback.customizeRequestConfig(requestConfigBuilder);\n }\n\n try {\n final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create()\n .setSslContext(SSLContext.getDefault())\n // See https://issues.apache.org/jira/browse/HTTPCLIENT-2219\n .setTlsDetailsFactory(new Factory<SSLEngine, TlsDetails>() {\n @Override\n public TlsDetails create(final SSLEngine sslEngine) {\n return new TlsDetails(sslEngine.getSession(), sslEngine.getApplicationProtocol());\n }\n })\n .build();\n\n final PoolingAsyncClientConnectionManager connectionManager = PoolingAsyncClientConnectionManagerBuilder.create()\n .setMaxConnPerRoute(DEFAULT_MAX_CONN_PER_ROUTE)\n .setMaxConnTotal(DEFAULT_MAX_CONN_TOTAL)\n .setTlsStrategy(tlsStrategy)\n .build();\n\n HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClientBuilder.create()\n .setDefaultRequestConfig(requestConfigBuilder.build())\n .setConnectionManager(connectionManager)\n .setTargetAuthenticationStrategy(DefaultAuthenticationStrategy.INSTANCE)\n .disableAutomaticRetries();\n if (httpClientConfigCallback != null) {\n httpClientBuilder = httpClientConfigCallback.customizeHttpClient(httpClientBuilder);\n }\n\n final HttpAsyncClientBuilder finalBuilder = httpClientBuilder;\n return AccessController.doPrivileged((PrivilegedAction<CloseableHttpAsyncClient>) finalBuilder::build);\n } catch (NoSuchAlgorithmException e) {\n throw new IllegalStateException(\"could not create the default ssl context\", e);\n }\n }", "private static HttpClient getNewHttpClient(){\n HttpParams params = new BasicHttpParams();\n return new DefaultHttpClient(params);\n }", "public HttpClient(String host, int port)\n\t{\n\t\tsuper(host, port);\n\t\tclient = new org.apache.commons.httpclient.HttpClient();\n\t}", "private HttpClient prepareHttpClient() {\n\t\tHttpClientParams htcParams = new HttpClientParams();\n\t\tmHttpClient = new HttpClient();\n\t\thtcParams.setConnectionManagerTimeout(300000);\n\t\thtcParams.setSoTimeout(300000);\n\t\tmHttpClient.setParams(htcParams);\n\t\treturn mHttpClient;\n\t}", "@Bean\n public HttpClient httpClient() {\n return new HttpClient(multiThreadedHttpConnectionManager());\n }", "@Bean\n\tpublic HttpClient httpClient() {\n\t\treturn new HttpClient(this.multiThreadedHttpConnectionManager);\n\t}", "private CloseableHttpClient getHttpClient() {\n return HttpClients.custom()\n .setConnectionManager(httpClientConnectionManager)\n .setConnectionManagerShared(true)\n .build();\n }", "private DefaultHttpClient createHttpsClient() throws HttpException {\n DefaultHttpClient client = new DefaultHttpClient();\n SSLContext ctx = null;\n X509TrustManager tm = new TrustAnyTrustManager();\n try {\n ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(null, new TrustManager[] { tm }, null);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new HttpException(\"Can't create a Trust Manager.\", e);\n }\n SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n client.getConnectionManager().getSchemeRegistry().register(new Scheme(\"https\", 443, ssf));\n return client;\n }", "private void initialize(){\n if(uri != null)\n httpUriRequest = getHttpGet(uri);\n httpClient = HttpClients.createDefault();\n }", "protected HttpClient getHttpClient( ) {\r\n\t\treturn httpClient;\r\n\t}", "private HttpProxy createHttpServerConnection() {\n\n final HttpProxy httpProxy = httpConnectionFactory.create();\n\n // TODO: add configurable number of attempts, instead of looping forever\n boolean connected = false;\n while (!connected) {\n LOGGER.debug(\"Attempting connection to HTTP server...\");\n connected = httpProxy.connect();\n }\n\n LOGGER.debug(\"Connected to HTTP server\");\n\n return httpProxy;\n }", "@BeforeClass\n public static void createClient() {\n client = HttpClients.createDefault();\n }", "protected RestClient()\n\t{\n\t\tclient = new HttpClient();\n\t\tclient.setIdleTimeout(3000000);\n\t\t// for possible future use:\n\t\t//exchange_get = new ContentExchange()\n\t\t{\n\t\t\t// define the callback method to process the response when you get it back\n\t\t\t// protected void onResponseComplete() throws IOException\n\t\t\t// {\n\t\t\t// super.onResponseComplete();\n\t\t\t// int responseStatus = this.getStatus();\n\n\t\t\t// do something with the response content\n\t\t\t//System.out.println(\"Response status: \" + responseStatus);\n\t\t\t//System.out.println(this.getResponseContent());\n\t\t\t//\t }\n\t\t};\n\t}", "public HttpConnector(){\n super();\n }", "public HttpClient build() {\n\t\tCloseableHttpClient httpClient = httpClientBuilder.build();\n\t\treturn new ApacheHttpClient(this.configuration, httpClient);\n\t}", "@Before\n public void buildClient() {\n BasicCookieStore cookieStore = new BasicCookieStore();\n\n // Build Apache Http Client to execute requests\n this.httpClient = HttpClientBuilder.create()\n .setDefaultCookieStore(cookieStore)\n .setRedirectStrategy(new LaxRedirectStrategy())\n .build();\n }", "public void setHttpClient( HttpClient req ) {\r\n\tclient=req;\r\n }", "private static HttpClient getHttpClient() {\n if (mHttpClient == null) {\n mHttpClient = new DefaultHttpClient();\n final HttpParams params = mHttpClient.getParams();\n HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT);\n HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT);\n ConnManagerParams.setTimeout(params, HTTP_TIMEOUT);\n }\n return mHttpClient;\n }", "public static Client getHttpClient() {\r\n return c;\r\n }", "static Http1Client create() {\n return create(Http1ClientConfig.create());\n }", "public PublishingClientImpl() {\n this.httpClientSupplier = () -> HttpClients.createDefault();\n this.requestBuilder = new PublishingRequestBuilderImpl();\n }", "public static HttpClient createConnection(String hostname, int port, String username, String password, FileSystemOptions fileSystemOptions) throws FileSystemException\n {\n HttpClient client;\n try\n {\n client = new HttpClient(new MultiThreadedHttpConnectionManager());\n final HostConfiguration config = new HostConfiguration();\n config.setHost(hostname, port);\n\n if (fileSystemOptions != null)\n {\n String proxyHost = HttpFileSystemConfigBuilder.getInstance().getProxyHost(fileSystemOptions);\n int proxyPort = HttpFileSystemConfigBuilder.getInstance().getProxyPort(fileSystemOptions);\n\n if (proxyHost != null && proxyPort > 0)\n {\n config.setProxy(proxyHost, proxyPort);\n }\n }\n\n client.setHostConfiguration(config);\n\n if (username != null)\n {\n final UsernamePasswordCredentials creds =\n new UsernamePasswordCredentials(username, password);\n client.getState().setCredentials(null, hostname, creds);\n }\n\n client.executeMethod(new HeadMethod());\n }\n catch (final Exception exc)\n {\n throw new FileSystemException(\"vfs.provider.http/connect.error\", new Object[]{hostname}, exc);\n }\n\n return client;\n }", "public static HttpClient getHttpClient() {\n HttpClient httpClient = new DefaultHttpClient();\n final HttpParams params = httpClient.getParams();\n HttpConnectionParams.setConnectionTimeout(params,\n HTTP_REQUEST_TIMEOUT_MS);\n HttpConnectionParams.setSoTimeout(params, HTTP_REQUEST_TIMEOUT_MS);\n ConnManagerParams.setTimeout(params, HTTP_REQUEST_TIMEOUT_MS);\n return httpClient;\n }", "private OkHttpClient Create() {\n final OkHttpClient.Builder baseClient = new OkHttpClient().newBuilder()\n .connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS)\n .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)\n .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS);\n\n // If there's no proxy just create a normal client\n if (appProps.getProxyHost().isEmpty()) {\n return baseClient.build();\n }\n\n final OkHttpClient.Builder proxyClient = baseClient\n .proxy(new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(appProps.getProxyHost(), Integer.parseInt(appProps.getProxyPort()))));\n\n if (!appProps.getProxyUsername().isEmpty() && !appProps.getProxyPassword().isEmpty()) {\n\n Authenticator proxyAuthenticator;\n String credentials;\n\n credentials = Credentials.basic(appProps.getProxyUsername(), appProps.getProxyPassword());\n\n // authenticate the proxy\n proxyAuthenticator = (route, response) -> response.request().newBuilder()\n .header(\"Proxy-Authorization\", credentials)\n .build();\n proxyClient.proxyAuthenticator(proxyAuthenticator);\n }\n return proxyClient.build();\n\n }", "public HttpComponentsClientHttpRequest(HttpClient httpClient, HttpUriRequest httpRequest)\r\n/* 25: */ {\r\n/* 26:54 */ this.httpClient = httpClient;\r\n/* 27:55 */ this.httpRequest = httpRequest;\r\n/* 28: */ }", "public HttpClientWrapper(String url, String user, String pwd, String proxyDns, int proxyPort) {\n this.url = url;\n if ( user == null && pwd == null ) {\n this.creds = null;\n } else if ( user != null && pwd != null ) {\n this.creds = new UsernamePasswordCredentials(user, pwd);\n } else {\n throw new DBCException(\"user / pwd either both null or both not null: \" + user + \" - \" + pwd);\n }\n if ( (proxyDns == null && proxyPort == 0) || (proxyDns != null && proxyPort > 0) ) {\n // ok\n } else {\n throw new DBCException(\"proxyDns / proxyPort either both null/0 or both not null/>0: \" + proxyDns + \" - \" + proxyPort);\n }\n\n this.requestConfig = RequestConfig.custom().setConnectionRequestTimeout(5000).build();\n\n SSLContext sslContext = buildSSLContext();\n SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new HostnameVerifier() {\n @Override\n public boolean verify(String hostname, SSLSession session) {\n LOG.info(\"accepting SSLConnection for host: {}, port: {}\", session.getPeerHost(), session.getPeerPort());\n return true;\n }\n });\n\n ConnectionConfig connectionConfig = ConnectionConfig.custom().setCharset(Charset.forName(UTF_8)).build();\n PlainConnectionSocketFactory plainSF = PlainConnectionSocketFactory.getSocketFactory();\n\n RegistryBuilder<ConnectionSocketFactory> regBuilder = RegistryBuilder.<ConnectionSocketFactory> create();\n Registry<ConnectionSocketFactory> registry = regBuilder.register(\"http\", plainSF).register(\"https\", sslsf).build();\n\n PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);\n connectionManager.setMaxTotal(200);\n connectionManager.setDefaultMaxPerRoute(100);\n connectionManager.setValidateAfterInactivity(10000); // good value for the check interval?\n connectionManager.setDefaultConnectionConfig(connectionConfig);\n\n HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();\n httpClientBuilder.setConnectionManager(connectionManager);\n\n if ( proxyDns != null ) {\n // add one step proxy support\n HttpHost proxy = new HttpHost(proxyDns, proxyPort);\n DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);\n httpClientBuilder.setRoutePlanner(routePlanner);\n }\n\n this.client = httpClientBuilder.build();\n this.idleConnectionMonitorThread = new IdleConnectionMonitorThread(connectionManager);\n new Thread(null, this.idleConnectionMonitorThread, \"IdleConn\").start();\n }", "private HttpClientInfra() {}", "protected HttpClient getClient() {\n if (client == null) {\n synchronized (this) {\n if (client == null) {\n client = new DefaultHttpClient(conman, params);\n }\n }\n }\n\n return client;\n }", "public static final DefaultHttpClient createHttpClient(int retryCount) {\n\t\tHttpParams params = new BasicHttpParams();\n\t\tHttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\n\t\tHttpProtocolParams.setContentCharset(params, HTTP.UTF_8);\n\t\t// HttpProtocolParams.setUseExpectContinue(params, true);\n\t\t// Turn off stale checking. Our connections break all the time anyway,\n\t\t// and it's not worth it to pay the penalty of checking every time.\n\t\tHttpConnectionParams.setStaleCheckingEnabled(params, false);\n\n\t\t// Default connection and socket timeout of 30 seconds. Tweak to taste.\n\t\tHttpConnectionParams.setConnectionTimeout(params, 15 * 1000);\n\t\tHttpConnectionParams.setSoTimeout(params, 20 * 1000);\n\t\tHttpConnectionParams.setSocketBufferSize(params, 8192);\n\n\t\tHttpClientParams.setRedirecting(params, true);\n\n\t\tConnManagerParams.setTimeout(params, 5 * 1000);\n\t\tConnManagerParams.setMaxConnectionsPerRoute(params,\n\t\t\t\tnew ConnPerRouteBean(50));\n\t\tConnManagerParams.setMaxTotalConnections(params, 200);\n\n\t\t// Sets up the http part of the service.\n\t\tfinal SchemeRegistry supportedSchemes = new SchemeRegistry();\n\n\t\t// Register the \"http\" protocol scheme, it is required\n\t\t// by the default operator to look up socket factories.\n\t\tfinal SocketFactory sf = PlainSocketFactory.getSocketFactory();\n\t\tsupportedSchemes.register(new Scheme(\"http\", sf, 80));\n\t\tsupportedSchemes.register(new Scheme(\"https\", SSLSocketFactory\n\t\t\t\t.getSocketFactory(), 443));\n\t\tfinal ThreadSafeClientConnManager ccm = new ThreadSafeClientConnManager(\n\t\t\t\tparams, supportedSchemes);\n\t\tDefaultHttpClient httpClient = new DefaultHttpClient(ccm, params);\n\t\thttpClient\n\t\t\t\t.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(\n\t\t\t\t\t\tretryCount, true));\n\t\t// Add gzip header to requests using an interceptor\n\t\thttpClient.addRequestInterceptor(new GzipHttpRequestInterceptor());\n\t\t// Add gzip compression to responses using an interceptor\n\t\thttpClient.addResponseInterceptor(new GzipHttpResponseInterceptor());\n\n\t\treturn httpClient;\n\t}", "public BasicHttpClientConnectionManager(Lookup<ConnectionSocketFactory> socketFactoryRegistry, HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory) {\n/* 137 */ this(socketFactoryRegistry, connFactory, null, null);\n/* */ }", "public HttpClient httpClient() {\n return httpClient;\n }", "public HttpClientHelper() {\n defaultHeaders.put(\"Content-Type\", \"application/json\");\n defaultHeaders.put(\"Accept-Encoding\", \"gzip\");\n\n //postDefaultHeaders.put(\"Content-Type\", \"application/json\");\n //postDefaultHeaders.put(\"Content-Encoding\", \"gzip\");\n\n String key = MessageFormat.format(\"{0}#{1}\", UserUtil.getUserUuid(), UserUtil.getUserId());\n\n //postDefaultHeaders.put(\"X-CLIENT-KEY\", key);\n defaultHeaders.put(\"X-CLIENT-KEY\", key);\n client.setTimeout(3000);\n }", "@Provides\n @Singleton\n Client provideHttpClient(Environment environment, PermissionsAppConfig config) {\n HttpClientConfiguration httpClientConfiguration = new HttpClientConfiguration();\n httpClientConfiguration.setTimeout(Duration.milliseconds(7000));\n\n HttpClientBuilder clientBuilder = new HttpClientBuilder(environment);\n clientBuilder.using(httpClientConfiguration);\n\n JerseyClientBuilder builder = new JerseyClientBuilder(environment);\n builder.setApacheHttpClientBuilder(clientBuilder);\n\n Client client = builder.build(\"jerseyClient\");\n client.register(ClientCorrelationIdFilter.class, 1);\n client.register(JerseyLoggingFilter.class, 2);\n return client;\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public CloseableHttpClient build() {\n\t\tCloseableHttpClient httpClient = httpClientBuilder.build();\n\t\treturn httpClient;\n\t}", "public static final DefaultHttpClient createHttpClient(String proxyUri,\n\t\t\tint port) {\n\t\t// Shamelessly cribbed from AndroidHttpClient\n\t\tHttpParams params = new BasicHttpParams();\n\t\tHttpHost host = new HttpHost(proxyUri, port);\n\t\tparams.setParameter(ConnRouteParams.DEFAULT_PROXY, host);\n\n\t\tHttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\n\t\tHttpProtocolParams.setContentCharset(params, HTTP.UTF_8);\n\t\t// HttpProtocolParams.setUseExpectContinue(params, true);\n\t\t// Turn off stale checking. Our connections break all the time anyway,\n\t\t// and it's not worth it to pay the penalty of checking every time.\n\t\tHttpConnectionParams.setStaleCheckingEnabled(params, false);\n\n\t\t// Default connection and socket timeout of 30 seconds. Tweak to taste.\n\t\tHttpConnectionParams.setConnectionTimeout(params, 10 * 1000);\n\t\tHttpConnectionParams.setSoTimeout(params, 20 * 1000);\n\t\tHttpConnectionParams.setSocketBufferSize(params, 8192);\n\n\t\tHttpClientParams.setRedirecting(params, true);\n\n\t\tConnManagerParams.setTimeout(params, 5 * 1000);\n\t\tConnManagerParams.setMaxConnectionsPerRoute(params,\n\t\t\t\tnew ConnPerRouteBean(50));\n\t\tConnManagerParams.setMaxTotalConnections(params, 200);\n\n\t\t// Sets up the http part of the service.\n\t\tfinal SchemeRegistry supportedSchemes = new SchemeRegistry();\n\n\t\t// Register the \"http\" protocol scheme, it is required\n\t\t// by the default operator to look up socket factories.\n\t\tfinal SocketFactory sf = PlainSocketFactory.getSocketFactory();\n\t\tsupportedSchemes.register(new Scheme(\"http\", sf, 80));\n\t\tsupportedSchemes.register(new Scheme(\"https\", SSLSocketFactory\n\t\t\t\t.getSocketFactory(), 443));\n\t\tfinal ThreadSafeClientConnManager ccm = new ThreadSafeClientConnManager(\n\t\t\t\tparams, supportedSchemes);\n\t\tDefaultHttpClient httpClient = new DefaultHttpClient(ccm, params);\n\t\thttpClient\n\t\t\t\t.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(\n\t\t\t\t\t\t3, true));\n\t\t// Add gzip header to requests using an interceptor\n\t\thttpClient.addRequestInterceptor(new GzipHttpRequestInterceptor());\n\t\t// Add gzip compression to responses using an interceptor\n\t\thttpClient.addResponseInterceptor(new GzipHttpResponseInterceptor());\n\n\t\treturn httpClient;\n\t}", "protected WebTestArtifact makeHttpRequest(String resource)\r\n {\r\n return new WebTestArtifact(resource);\r\n }", "public HttpClient getHttpClient() {\n return appContext.getHttpClient();\n }", "public HttpClientUrlConnection(String urlString, HttpClient client)\n throws IOException {\n this(LockssUrlConnection.METHOD_GET, urlString, client, null);\n }", "public CachetClient(String url) {\n baseUrl = url;\n client = ClientBuilder.newClient();\n target = client.target(baseUrl);\n }", "public JsonHttpChannel() {\n this.defaultConstructor = new JsonHttpEventFactory();\n }", "ApacheHttpClientBuilder getApacheHttpClientBuilder();", "private void setupHttpConnectionStuff() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n try {\n final File httpCacheDir = new File(getCacheDir(), \"http\");\n HttpResponseCache.install(httpCacheDir, TEN_MEGABYTES);\n } catch (IOException ioe) {\n Log.e(Constants.LOG_TAG, \"Could not install http cache on this device.\");\n }\n }\n }", "public BitbucketServiceFactory() {\n this.httpClient = HttpClient::create;\n }", "protected WebTestArtifact makeHttpRequest(String resource, String httpMethod)\r\n {\r\n return new WebTestArtifact(resource, httpMethod);\r\n }", "private HttpServerBuilder(Vertx vertx) {\n\n this.vertx = vertx;\n }", "private final static void setup() {\r\n\r\n supportedSchemes = new SchemeRegistry();\r\n\r\n // Register the \"http\" and \"https\" protocol schemes, they are\r\n // required by the default operator to look up socket factories.\r\n SocketFactory sf = PlainSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"http\", sf, 80));\r\n sf = SSLSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"https\", sf, 80));\r\n\r\n // prepare parameters\r\n HttpParams params = new BasicHttpParams();\r\n HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\r\n HttpProtocolParams.setContentCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUseExpectContinue(params, true);\r\n HttpProtocolParams.setHttpElementCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUserAgent(params, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0\");\r\n defaultParameters = params;\r\n }", "private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {\n return new DefaultHttpDataSourceFactory(userAgent, bandwidthMeter);\n }", "public TestState httpClient(HttpClient httpClient) {\n this.httpClient = httpClient;\n return this;\n }", "public WeChatPayHttpComponentsClient(final String apiBasePath, final HttpClient httpClient) {\n checkNotEmpty(apiBasePath, \"apiBasePath\");\n checkNotNull(httpClient, \"httpClient\");\n\n this.basePath = apiBasePath;\n this.httpClient = httpClient;\n }", "private void httpSetup() {\n OkHttpClient client = new OkHttpClient.Builder()\n .readTimeout(5, TimeUnit.SECONDS)\n .writeTimeout(5, TimeUnit.SECONDS)\n .build();\n\n retrofit = new Retrofit.Builder()\n .baseUrl(BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .client(client)\n .build();\n\n service = retrofit.create(ValidatorAPI.class);\n }", "public HttpConnector(JsonSystem system) {\r\n super(system);\r\n }", "public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }", "protected HTTPConnection getConnectionToURL(URL url) throws ProtocolNotSuppException\r\n {\r\n\r\n HTTPConnection con = new HTTPConnection(url);\r\n con.setDefaultHeaders(new NVPair[] { new NVPair(\"User-Agent\", \"Mozilla/4.5\")});\r\n con.setDefaultAllowUserInteraction(false);\r\n\r\n if (proxyRequired)\r\n {\r\n con.addBasicAuthorization(proxyRealm, proxyName, proxyPswd);\r\n }\r\n\r\n return (con);\r\n }", "public HttpServlet() {\r\n\t\tsuper();\r\n\t}", "private static void createCouchbaseClient() {\n LOGGER.debug(\"Creating Couchbase Client\");\n String bucket = CONFIG.getString(\"couchbase.bucket\");\n String[] hosts = CONFIG.getString(\"couchbase.host\").split(\";\");\n String port = CONFIG.getString(\"couchbase.port\");\n String base = CONFIG.getString(\"couchbase.base\");\n\n List<URI> uris = new ArrayList<>();\n for (final String host : hosts) {\n uris.add(URI.create(\"http://\" + host + \":\" + port + \"/\" + base));\n }\n try {\n tapClient = new TapClient(uris, bucket, \"\");\n } catch (Exception ex) {\n LOGGER.error(\"Caught exception trying to connect to Couchbase\", ex);\n }\n }", "private ResourceClient( ResourceConfigurationBase<?> theConfiguration, String theContractRoot, String theContractVersion, String theUserAgent, HttpClient theClient, JsonTranslationFacility theJsonFacility ) {\r\n\t\tPreconditions.checkNotNull( theConfiguration, \"need a configuration object so we can get our endpoint\" );\r\n \tPreconditions.checkArgument( !Strings.isNullOrEmpty( theContractRoot ), \"need a contract root\" );\r\n \tPreconditions.checkArgument( theContractRoot.startsWith( \"/\" ), \"the contract root '%s' must be a reference from the root (i.e. start with '/')\", theContractRoot );\r\n \tPreconditions.checkArgument( !Strings.isNullOrEmpty( theContractVersion ), \"need a version for contract root '%s'\", theContractRoot );\r\n \tPreconditions.checkArgument( ContractVersion.isValidVersion( theContractVersion), \"the version string '%s' for contract root '%s' is not valid\", theContractVersion, theContractRoot );\r\n\t\tPreconditions.checkArgument( !Strings.isNullOrEmpty( theUserAgent ), \"need a user agent for this client\" );\r\n\r\n\t\t// lets make sure the configuration is valid\r\n\t\ttheConfiguration.validate();\r\n\t\t\r\n\t\t// now let's start preparing the client\r\n\t\tendpoint = new HttpEndpoint( theConfiguration.getEndpoint( ) ); // this will do validation on the endpoint \r\n\t\tcontractRoot = theContractRoot; \r\n\t\tcontractVersion = theContractVersion;\r\n\t\tuserAgent = theUserAgent;\r\n\t\t\r\n\t\t// use the client if sent in, but create a working one otherwise\r\n\t\tif( theClient == null ) {\r\n\t\t\ttry {\r\n\t\t\t SslContextFactory sslContextFactory = null;\r\n\t\r\n\t\t\t if( endpoint.isSecure( ) ) {\r\n\t\t\t \tif( theConfiguration.getAllowUntrustedSsl() ) {\r\n\t\t\t \t\t// so we need SSL communication BUT we don't need to worry about it being valid, likley\r\n\t\t\t \t\t// because the caller is self-cert'ing or in early development ... we may need to do \r\n\t\t\t \t\t// more here mind you\r\n\t\t\t \t\t\r\n\t\t\t\t \t// the following code was based https://code.google.com/p/misc-utils/wiki/JavaHttpsUrl\r\n\t\t\t\t \t// if we were to look into mutual SSL and overall key handling, I probably want to\r\n\t\t\t\t \t// take a closer look\r\n\t\t\t\t \t\r\n\t\t\t\t \t// We need to create a trust manager that essentially doesn't except/fail checks\r\n\t\t\t\t\t final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\r\n\t\t\t\t\t \t// this was based on the code found here:\r\n\t\t\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void checkClientTrusted(X509Certificate[] chain,\r\n\t\t\t\t\t\t\t\t\tString authType) throws CertificateException {\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void checkServerTrusted(X509Certificate[] chain,\r\n\t\t\t\t\t\t\t\t\tString authType) throws CertificateException {\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic X509Certificate[] getAcceptedIssuers() {\r\n\t\t\t\t\t\t\t\treturn null;\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\t // then we need to create an SSL context that uses lax trust manager \r\n\t\t\t\t\t SSLContext sslContext = SSLContext.getInstance( \"SSL\" );\r\n\t\t\t\t\t\tsslContext.init( null, trustAllCerts, new java.security.SecureRandom() );\r\n\t\r\n\t\t\t\t\t\t// and finally, create the SSL context that\r\n\t\t\t\t\t\tsslContextFactory = new SslContextFactory();\r\n\t\t\t\t\t\tsslContextFactory.setSslContext( sslContext );\r\n\t\t\t \t} else {\r\n\t\t\t \t\t// TODO: this needs to be tested against \r\n\t\t\t \t\t//\t\t a) real certs with real paths that aren't expired\r\n\t\t\t \t\t//\t\t b) real certs with real paths that are expired\r\n\t\t\t \t\tsslContextFactory = new SslContextFactory( );\r\n\t\t\t \t}\r\n\t\t\t\t\thttpClient = new HttpClient( sslContextFactory );\r\n\t\t\t } else {\r\n\t\t\t\t\thttpClient = new HttpClient( );\r\n\t\t\t }\r\n\t\t\t httpClient.setFollowRedirects( false ); // tales doesn't have redirects (at least not yet)\r\n\t\t\t httpClient.setStrictEventOrdering( true ); // this seems to fix an odd issue on back-to-back calls to the same service on \r\n\t\t\t\thttpClient.start( );\r\n\t\t\t displayClientConfiguration( httpClient );\r\n\t\t\t} catch (NoSuchAlgorithmException | KeyManagementException e) {\r\n\t\t\t\tthrow new IllegalStateException( \"unable to create the resource client due to a problem setting up SSL\", e );\r\n\t\t\t} catch (Exception e ) {\r\n\t\t\t\tthrow new IllegalStateException( \"unable to create the resource client due to the inability to start the HttpClient\", e );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\thttpClient = theClient;\r\n\t\t}\r\n\t\thttpClient.setUserAgentField( new HttpField( HttpHeader.USER_AGENT, theUserAgent ) );\r\n\r\n\t\tif( theJsonFacility == null ) {\r\n\t\tjsonFacility = new JsonTranslationFacility( new DataContractTypeSource( ) );\r\n\t\t} else {\r\n\t\t\tjsonFacility = theJsonFacility;\r\n\t\t}\r\n\t\t\r\n\t\tjsonParser = new JsonParser( );\r\n\t\t\r\n\t\t// now that we have the json facility, let's \r\n\t\t// get the adapter for the result type\r\n\t\tJavaType type = new JavaType( ResourceResult.class );\r\n\t\tJsonTypeMap typeMap = jsonFacility.generateTypeMap( type ); // TODO: technically I can, if I have the type of the result, now do the full thing (need to have a field for it)\r\n\t\tresultTypeAdapter = new TypeFormatAdapter( \r\n\t\t\t\ttype,\r\n\t\t\t\ttypeMap.getReflectedType().getName(),\r\n \t\t\tnew JsonObjectToObjectTranslator( typeMap ),\r\n \t\t\tnew ObjectToJsonObjectTranslator( typeMap ) );\t\t\t\t\r\n\t}", "public static final DefaultHttpClient createHttpClient(int retryCount,\n\t\t\tint timeout) {\n\t\tHttpParams params = new BasicHttpParams();\n\t\tHttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\n\t\tHttpProtocolParams.setContentCharset(params, HTTP.UTF_8);\n\t\t// HttpProtocolParams.setUseExpectContinue(params, true);\n\t\t// Turn off stale checking. Our connections break all the time anyway,\n\t\t// and it's not worth it to pay the penalty of checking every time.\n\t\tHttpConnectionParams.setStaleCheckingEnabled(params, false);\n\n\t\t// Default connection and socket timeout of 30 seconds. Tweak to taste.\n\t\tHttpConnectionParams.setConnectionTimeout(params, timeout);\n\t\tHttpConnectionParams.setSoTimeout(params, timeout);\n\t\tHttpConnectionParams.setSocketBufferSize(params, 8192);\n\n\t\tHttpClientParams.setRedirecting(params, true);\n\n\t\tConnManagerParams.setTimeout(params, timeout);\n\t\tConnManagerParams.setMaxConnectionsPerRoute(params,\n\t\t\t\tnew ConnPerRouteBean(50));\n\t\tConnManagerParams.setMaxTotalConnections(params, 200);\n\n\t\t// Sets up the http part of the service.\n\t\tfinal SchemeRegistry supportedSchemes = new SchemeRegistry();\n\n\t\t// Register the \"http\" protocol scheme, it is required\n\t\t// by the default operator to look up socket factories.\n\t\tfinal SocketFactory sf = PlainSocketFactory.getSocketFactory();\n\t\tsupportedSchemes.register(new Scheme(\"http\", sf, 80));\n\t\tsupportedSchemes.register(new Scheme(\"https\", SSLSocketFactory\n\t\t\t\t.getSocketFactory(), 443));\n\t\tfinal ThreadSafeClientConnManager ccm = new ThreadSafeClientConnManager(\n\t\t\t\tparams, supportedSchemes);\n\t\tDefaultHttpClient httpClient = new DefaultHttpClient(ccm, params);\n\t\thttpClient\n\t\t\t\t.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(\n\t\t\t\t\t\tretryCount, true));\n\t\t// Add gzip header to requests using an interceptor\n\t\t// httpClient.addRequestInterceptor(new GzipHttpRequestInterceptor());\n\t\t// Add gzip compression to responses using an interceptor\n\t\t// httpClient.addResponseInterceptor(new GzipHttpResponseInterceptor());\n\n\t\treturn httpClient;\n\t}", "public BasicHttpClientConnectionManager buildBasicHttpClientConnectionManager()\n/* */ {\n/* 61 */ BasicHttpClientConnectionManager connectionManager = new BasicHttpClientConnectionManager();\n/* 62 */ return connectionManager;\n/* */ }", "public WeChatPayHttpComponentsClient(final HttpClient httpClient) {\n checkNotNull(httpClient, \"httpClient\");\n\n this.basePath = WeChatPayClient.BASE_PATH;\n this.httpClient = httpClient;\n }", "public BasicHttpClientConnectionManager(Lookup<ConnectionSocketFactory> socketFactoryRegistry, HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory, SchemePortResolver schemePortResolver, DnsResolver dnsResolver) {\n/* 113 */ this(new DefaultHttpClientConnectionOperator(socketFactoryRegistry, schemePortResolver, dnsResolver), connFactory);\n/* */ }", "public TestHttpServer (HttpCallback cb) throws IOException {\n this (cb, 1, 10, 0);\n }", "private void init() throws IOReactorException {\n IOReactorConfig ioReactorConfig = IOReactorConfig.custom()\n .setIoThreadCount(Runtime.getRuntime().availableProcessors())\n .setConnectTimeout(BaseConstants.TIMEOUT_SECONDS * 1000)\n .setSoTimeout(BaseConstants.TIMEOUT_SECONDS * 1000)\n .build();\n\n // Create a custom I/O reactort\n ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(ioReactorConfig);\n PoolingNHttpClientConnectionManager connManager = new PoolingNHttpClientConnectionManager(ioReactor);\n // Configure total max or per route limits for persistent connections\n // that can be kept in the pool or leased by the connection manager.\n connManager.setMaxTotal(100);\n connManager.setDefaultMaxPerRoute(100);\n\n HttpAsyncClientBuilder clientBuilder = HttpAsyncClients.custom();\n RequestConfig.Builder requestConfig = RequestConfig.custom();\n // 连接超时,连接建立时间\n requestConfig.setConnectTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n // 请求超时,数据传输过程中数据包之间间隔的最大时间\n requestConfig.setSocketTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n // 使用连接池来管理连接,从连接池获取连接的超时时间\n requestConfig.setConnectionRequestTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n clientBuilder.setConnectionManager(connManager);\n clientBuilder.setDefaultRequestConfig(requestConfig.build());\n httpclient = clientBuilder.build();\n }", "public DefaultHttpRequest() {\n }", "private static OkHttpClient getOkHttpClient() {\n OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder()\n .addInterceptor(new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request original = chain.request();\n\n Request.Builder requestBuilder = original.newBuilder()\n .method(original.method(), original.body());\n\n addAdditionalHttpHeaders(requestBuilder);\n addParleyHttpHeaders(requestBuilder);\n\n Request request = requestBuilder.build();\n return chain.proceed(request);\n }\n })\n .connectTimeout(30, TimeUnit.SECONDS)\n .readTimeout(30, TimeUnit.SECONDS)\n .writeTimeout(30, TimeUnit.SECONDS);\n\n applySslPinning(okHttpClientBuilder);\n\n return okHttpClientBuilder.build();\n }", "private HttpClient getTemplateServerClient(String remoteSource) throws IOException {\n\n SocketFactory factory = (SocketFactory)mSocketFactories.get(remoteSource);\n\n if (factory == null) {\n\n int port = 80;\n String host = remoteSource.substring(TEMPLATE_LOAD_PROTOCOL.length());\n\n int portIndex = host.indexOf(\"/\");\n \n if (portIndex >= 0) {\n host = host.substring(0,portIndex); \n }\n String hostPort = host; \n portIndex = host.indexOf(\":\");\n if (portIndex >= 0) {\n try {\n port = Integer.parseInt(host.substring(portIndex+1));\n }\n catch (NumberFormatException nfe) {\n System.out.println(\"Invalid port number specified\");\n }\n host = host.substring(0,portIndex);\n }\n factory = new PooledSocketFactory(new PlainSocketFactory(InetAddress.getByName(host), \n port, 5000));\n \n if (factory != null) {\n mSocketFactories.put(hostPort, factory);\n }\n }\n return new HttpClient(factory);\n }", "@Override\n protected HttpContext createHttpContext()\n {\n HttpContext context = new BasicHttpContext();\n context.setAttribute(ClientContext.AUTHSCHEME_REGISTRY,\n getAuthSchemes());\n context.setAttribute(ClientContext.COOKIESPEC_REGISTRY,\n getCookieSpecs());\n context.setAttribute(ClientContext.CREDS_PROVIDER,\n getCredentialsProvider());\n return context;\n }", "public TankOkHttpClient() {\n try {\n\n final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n\n @Override\n public X509Certificate[] getAcceptedIssuers() {\n return null;\n }\n\n @Override\n public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}\n\n @Override\n public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}\n } };\n\n // Setup SSL to accept all certs\n final SSLContext sslContext = SSLContext.getInstance(\"SSL\");\n sslContext.init(null, trustAllCerts, null);\n sslSocketFactory = sslContext.getSocketFactory();\n\n // Setup Cookie manager\n cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);\n CookieHandler.setDefault(cookieManager);\n okHttpClient.setCookieHandler(cookieManager);\n\n okHttpClient.setConnectTimeout(30000, TimeUnit.MILLISECONDS);\n okHttpClient.setReadTimeout(30000, TimeUnit.MILLISECONDS); // Socket-timeout\n okHttpClient.setFollowRedirects(true);\n okHttpClient.setFollowSslRedirects(true);\n\n okHttpClient.setSslSocketFactory(sslSocketFactory);\n okHttpClient.setHostnameVerifier(new HostnameVerifier() {\n\n @Override\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }\n });\n\n } catch (Exception e) {\n LOG.error(\"Error setting accept all: \" + e, e);\n }\n }", "public HttpEntity openHttpEntity(URL url) throws IOException {\r\n Logger.getLogger(TargetAuthenticationStrategy.class).setLevel(Level.ERROR);\r\n Logger.getLogger(RequestTargetAuthentication.class).setLevel(Level.ERROR);\r\n DefaultHttpClient httpclient = new DefaultHttpClient();\r\n\r\n for (Cookie cookie : cookies) {\r\n httpclient.getCookieStore().addCookie(cookie);\r\n }\r\n\r\n httpclient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);\r\n\r\n if (socketTimeout > -1) {\r\n httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);\r\n }\r\n if (connectionTimeout > -1) {\r\n httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);\r\n }\r\n\r\n String domain = this.domain;\r\n String username = this.username;\r\n String password = this.password;\r\n if (serviceAccountPropertiesFileName != null) {\r\n Properties serviceAccountProperties = new Properties();\r\n if (new File(serviceAccountPropertiesFileName).exists()) {\r\n serviceAccountProperties.load(new FileReader(serviceAccountPropertiesFileName));\r\n } else {\r\n try {\r\n serviceAccountProperties.load(this.getClass().getResourceAsStream(serviceAccountPropertiesFileName));\r\n } catch (Exception e) {\r\n }\r\n }\r\n domain = serviceAccountProperties.getProperty(\"http.serviceaccount.domain\", domain);\r\n username = serviceAccountProperties.getProperty(\"http.serviceaccount.username\", username);\r\n password = serviceAccountProperties.getProperty(\"http.serviceaccount.password\", password);\r\n }\r\n\r\n if (username != null && password != null) {\r\n String decryptedPassword = password;\r\n try {\r\n decryptedPassword = new StringEncrypter().decrypt(password);\r\n } catch (Exception e) {\r\n }\r\n NTCredentials creds = new NTCredentials(username, decryptedPassword, getCanonicalHostName()[0], domain);\r\n httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, creds);\r\n httpclient.getAuthSchemes().unregister(AuthPolicy.SPNEGO);\r\n httpclient.getAuthSchemes().unregister(AuthPolicy.KERBEROS);\r\n }\r\n HttpHost target = new HttpHost(url.getHost(), url.getPort(), url.getProtocol());\r\n HttpContext localContext = new BasicHttpContext();\r\n HttpGet httpGet = new HttpGet(url.getFile());\r\n HttpResponse httpResponse = httpclient.execute(target, httpGet, localContext);\r\n this.lastStatusLine = httpResponse.getStatusLine();\r\n lastCookies = httpclient.getCookieStore().getCookies();\r\n\r\n return httpResponse.getEntity();\r\n }", "public HttpGetSocket(SocketHandler h)\r\n {\r\n super(h);\r\n }", "public DefaultHttpRequestBuilder (final DefaultHttpClient client) {\r\n\t\tif (client == null) {\r\n\t\t\tthrow new NullPointerException (\"client cannot be null\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.client = client;\r\n\t}", "public interface HttpClientable {\n\n void get(String url);\n\n void get(String url, ParamStore params);\n\n void get(String url, ParamStore params, String tag);\n\n void post(String url, SparseArray<String> params);\n\n void post(String url, SparseArray<String> params, String tag);\n\n void upload(String url, HashMap<String, Object> params);\n\n void upload(String url, HashMap<String, Object> params, String tag);\n\n void download(String url);\n\n void download(String url, String tag);\n\n void cancelAll();\n\n void cancel(String tag);\n\n}", "public BasicHttpClientConnectionManager(HttpClientConnectionOperator httpClientConnectionOperator, HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory) {\n/* 126 */ this.connectionOperator = (HttpClientConnectionOperator)Args.notNull(httpClientConnectionOperator, \"Connection operator\");\n/* 127 */ this.connFactory = (connFactory != null) ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;\n/* 128 */ this.expiry = Long.MAX_VALUE;\n/* 129 */ this.socketConfig = SocketConfig.DEFAULT;\n/* 130 */ this.connConfig = ConnectionConfig.DEFAULT;\n/* 131 */ this.isShutdown = new AtomicBoolean(false);\n/* */ }", "public ApplicationHostService(HttpContext httpContext, NewRelicClient client)\n {\n super(httpContext, client);\n }", "private final static HttpRequest createRequest() {\r\n\r\n HttpRequest req = new BasicHttpRequest\r\n (\"GET\", \"/\", HttpVersion.HTTP_1_1);\r\n //(\"OPTIONS\", \"*\", HttpVersion.HTTP_1_1);\r\n\r\n return req;\r\n }", "public HttpServerConfiguration() {\n this.sessionsEnabled = true;\n this.connectors = new ArrayList<HttpConnectorConfiguration>();\n this.sslConnectors = new ArrayList<HttpSslConnectorConfiguration>();\n this.minThreads = 5;\n this.maxThreads = 50;\n }", "public HttpRequestHandler(final String host) {\n domain = host;\n }", "public okhttp3.OkHttpClient getHttpClientInstance() {\r\n return configuration.getHttpClientInstance();\r\n }", "public HttpRequest(URL url) throws IOException {\r\n this(url.openConnection());\r\n }", "@Override\n\tpublic synchronized void initialize(OperatorContext context) throws Exception {\n\t\tsuper.initialize(context);\n\n // Construct a new Jest client according to configuration via factory\n JestClientFactory factory = new JestClientFactory();\n factory.setHttpClientConfig(new HttpClientConfig\n .Builder(hostName + \":\" + hostPort)\n .multiThreaded(true)\n .build());\n \n client = factory.getObject();\n\t}", "public void httpclient(String url){\n\t\t\r\n\t\t\r\n\t\tString httpUrl =BASIC_URL+url;\r\n\t\t\r\n\t\tSystem.out.println(httpUrl);\r\n\t\t\r\n\t\tHttpGet method =new HttpGet(httpUrl);\r\n\t\t\r\n\t\tmethod.setHeader(\"Content-Type\",\"application/json\");\r\n\t\tmethod.setHeader(\"charset\",\"UTF-8\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\tCloseableHttpResponse res =client.execute(method,context);\r\n\r\n\t\t AuthState targetAuthState = context.getTargetAuthState();\r\n\t\t System.out.println(\"Target auth state: \" + targetAuthState.getState());\r\n\t\t System.out.println(\"Target auth scheme: \" + targetAuthState.getAuthScheme());\r\n\t\t System.out.println(\"Target auth credentials: \" + targetAuthState.getCredentials());\r\n\t\t\t\r\n\t\t HttpEntity ent =res.getEntity();\r\n\t\t \r\n\t\t if (ent != null) { \r\n System.out.println(\"Response content length: \" + ent.getContentLength()); \r\n System.out.println(ent+\"3214242423\");\r\n \r\n System.out.println(EntityUtils.toString(ent));\r\n } \r\n\t\t \r\n\t\t} catch (IOException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "protected BaseAHCBasedNetworkClient(CONFIG config,\n AsyncHttpClient ahc)\n {\n _config = config;\n _mapper = config.getJsonMapper();\n _ahc = ahc;\n }", "public static Client createClient() {\n JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();\n provider.setAnnotationsToUse(new Annotations[]{Annotations.JACKSON});\n\n ClientConfig config = new ClientConfig(provider);\n //Allow delete request with entity\n config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);\n //It helps to handle cookies\n config.property(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE);\n //Allow PATCH\n config.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);\n\n Logger logger = Logger.getLogger(\"Client\");\n Feature feature = new LoggingFeature(logger, Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY,\n null);\n\n //Allow self trusted certificates\n SSLContext sslcontext;\n try {\n sslcontext = SSLContext.getInstance(\"TLS\");\n sslcontext.init(null, new TrustManager[]{new X509TrustManager() {\n public void checkClientTrusted(X509Certificate[] arg0, String arg1) {\n }\n\n public void checkServerTrusted(X509Certificate[] arg0, String arg1) {\n }\n\n public X509Certificate[] getAcceptedIssuers() {\n return new X509Certificate[0];\n }\n }}, new java.security.SecureRandom());\n } catch (KeyManagementException | NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n\n return ClientBuilder\n .newBuilder()\n .withConfig(config)\n .sslContext(sslcontext)\n .build()\n .register(feature)\n .register(MultiPartFeature.class);\n }", "HttpProxy(final Integer port,\n final Integer securePort,\n final Integer socksPort,\n final Integer directLocalPort,\n final Integer directLocalSecurePort,\n final String directRemoteHost,\n final Integer directRemotePort) {\n\n this.port = port;\n this.securePort = securePort;\n this.socksPort = socksPort;\n this.directLocalPort = directLocalPort;\n this.directLocalSecurePort = directLocalSecurePort;\n this.directRemoteHost = directRemoteHost;\n this.directRemotePort = directRemotePort;\n\n hasStarted = SettableFuture.create();\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n ChannelFuture httpChannel = createHTTPChannel(port, securePort);\n ChannelFuture httpsChannel = createHTTPSChannel(securePort);\n ChannelFuture socksChannel = createSOCKSChannel(socksPort, port);\n ChannelFuture directChannel = createDirectChannel(directLocalPort, directRemoteHost, directRemotePort);\n ChannelFuture directSecureChannel = createDirectSecureChannel(directLocalSecurePort, directRemoteHost, directRemotePort);\n\n if (httpChannel != null) {\n // create system wide proxy settings for HTTP CONNECT\n proxyStarted(port, false);\n }\n if (socksChannel != null) {\n // create system wide proxy settings for SOCKS\n proxyStarted(socksPort, true);\n }\n hasStarted.set(\"STARTED\");\n\n waitForClose(httpChannel);\n waitForClose(httpsChannel);\n waitForClose(socksChannel);\n waitForClose(directChannel);\n waitForClose(directSecureChannel);\n } catch (Exception ie) {\n logger.error(\"Exception while running proxy channels\", ie);\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }\n }).start();\n\n try {\n // wait for proxy to start all channels\n hasStarted.get();\n } catch (Exception e) {\n logger.debug(\"Exception while waiting for proxy to complete starting up\", e);\n }\n }", "public HttpTrafficGenerator() {\n\n\t\tworker = new Thread(this, \"HttpTrafficGenerator\");\n\t\ttry {\n\t\t\twebsite = new URL(\"http://google.com\");\n\t\t} catch (MalformedURLException e) {\n\t\t\tthrow new IllegalStateException(\"Internal error\", e);\n\t\t}\n\t}", "public static HTTPClient GetHttpClient(String sessionID, URL documentBase) throws MalformedURLException{\n HTTPClient hc = new HTTPClient();\n hc.setSessionId(sessionID);\n // represent the path portion of the URL as a file\n URL url = documentBase;\n File file = new File(url.getPath());\n // get the parent of the file\n String parentPath = file.getParent();\n // construct a new url with the parent path \n URL parentUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), fixParentPath(parentPath));\n hc.setBase(parentUrl);\n return hc;\n }", "private void setHttpclientProxy(DefaultHttpClient httpClient) {\r\n Proxy proxy = ProxyProvider.getProxy();\r\n String proxyUser = ProxyProvider.getProxyUserName();\r\n String proxyPwd = ProxyProvider.getProxyUserPassword();\r\n // set by other components like tSetProxy\r\n if (proxy != null) {\r\n\r\n final HttpHost httpHost = new HttpHost(((InetSocketAddress) proxy.address()).getHostName(),\r\n ((InetSocketAddress) proxy.address()).getPort());\r\n // Sets usage of HTTP proxy\r\n httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpHost);\r\n\r\n // Sets proxy authentication, if credentials were provided\r\n // TODO Because the proxy of get accesToken can't support authentication. remove this ?\r\n if (proxyUser != null && proxyPwd != null) {\r\n httpClient.getCredentialsProvider().setCredentials(new AuthScope(httpHost),\r\n new UsernamePasswordCredentials(proxyUser, proxyPwd));\r\n }\r\n\r\n }\r\n\r\n }", "private OkHttpClient createClient(){\n HttpLoggingInterceptor logging = new HttpLoggingInterceptor();\n logging.setLevel(HttpLoggingInterceptor.Level.BODY);\n return new OkHttpClient.Builder()\n .addInterceptor(logging)\n .readTimeout(30, TimeUnit.SECONDS)\n .writeTimeout(30, TimeUnit.SECONDS)\n .build();\n }", "private WebTestArtifact(String resource, String httpMethod)\r\n {\r\n HttpURLConnection connection = null;\r\n\r\n try\r\n {\r\n // Create the connection (using some sensible defaults)...\r\n URL url = new URL(AbstractTestServerSetup._URL_PREFIX + resource);\r\n connection = (HttpURLConnection) url.openConnection();\r\n connection.setRequestMethod(httpMethod);\r\n connection.setDoOutput(true);\r\n connection.setReadTimeout(5000);\r\n connection.connect();\r\n\r\n // Read the response...\r\n StringBuilder sb = new StringBuilder();\r\n BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));\r\n\r\n String line;\r\n while ((line = br.readLine()) != null)\r\n {\r\n sb.append(line);\r\n }\r\n\r\n this.responseCode = connection.getResponseCode();\r\n this.response = sb.toString();\r\n }\r\n catch (MalformedURLException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n catch (IOException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n finally\r\n {\r\n // Make sure the connection is always cleanly taken down.\\\r\n if (connection != null) connection.disconnect();\r\n }\r\n }", "public static AsyncHttpServer createProxyHttpServer(final NioEventloop primaryEventloop,\n\t final HttpClientImpl httpClient) {\n\t\treturn new AsyncHttpServer(primaryEventloop, new AsyncHttpServlet() {\n\t\t\t@Override\n\t\t\tpublic void serveAsync(HttpRequest request, final ResultCallback<HttpResponse> callback) {\n\t\t\t\thttpClient.getHttpResultAsync(HttpRequest.get(REDIRECT_ADDRESS + request.getUrl().getPath()), 1000,\n\t\t\t\t\t\tnew ResultCallback<HttpResponse>() {\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onResult(final HttpResponse result) {\n\t\t\t\t\t\t\t\tHttpResponse res = HttpResponse.create(result.getCode());\n\t\t\t\t\t\t\t\tres.body(encodeAscii(\"FORWARDED: \" + decodeAscii(result.getBody())));\n\t\t\t\t\t\t\t\tcallback.onResult(res);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onException(Exception exception) {\n\t\t\t\t\t\t\t\tcallback.onException(exception);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "@Provides\n @Singleton\n OkHttpClient provideOkHttpClient() {\n OkHttpClient client = new OkHttpClient();\n return client;\n }", "public TestHttpServer (HttpCallback cb, int threads, int cperthread)\n throws IOException {\n this (cb, threads, cperthread, 0);\n }" ]
[ "0.722009", "0.7015862", "0.68510276", "0.6819384", "0.67843246", "0.67748064", "0.6722789", "0.6713689", "0.65962064", "0.65805036", "0.6566783", "0.65261465", "0.6480919", "0.64414006", "0.64104307", "0.6407213", "0.6328126", "0.6316086", "0.6314708", "0.61748654", "0.6137443", "0.60994035", "0.6078607", "0.60708106", "0.6056511", "0.6048953", "0.60403657", "0.60045004", "0.5985246", "0.59765214", "0.59597987", "0.5905751", "0.5901731", "0.5894974", "0.5888196", "0.5882779", "0.5858953", "0.58557296", "0.5841319", "0.58260554", "0.58040893", "0.575823", "0.57034564", "0.5687511", "0.5660541", "0.5655544", "0.5611746", "0.5606603", "0.5588615", "0.55856776", "0.5578268", "0.55758965", "0.55720335", "0.5570568", "0.5565899", "0.55588776", "0.55581176", "0.5540771", "0.55278456", "0.55226785", "0.5521115", "0.5512293", "0.5496801", "0.5489441", "0.5487659", "0.54728925", "0.5472071", "0.54658705", "0.5449473", "0.5438189", "0.54364574", "0.54324824", "0.54230565", "0.5416413", "0.53906536", "0.53698444", "0.53630614", "0.53502977", "0.53469056", "0.5341282", "0.5340588", "0.53265405", "0.531531", "0.530974", "0.53018403", "0.52978593", "0.52972305", "0.5287412", "0.52827036", "0.5279893", "0.52678365", "0.52625287", "0.52624124", "0.52579546", "0.5254113", "0.5250944", "0.5248869", "0.52437097", "0.5239408", "0.5237926", "0.5236981" ]
0.0
-1
/ renamed from: me.iwf.photopicker.event.OnPhotoClickListener
public interface OnPhotoClickListener { void onClick(View view, int i, boolean z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onClick(View v, Photo photo);", "void onPhotoTap(View view, float x, float y);", "@Override\n public void onClick(View v) {\n handlePhoto();\n }", "public interface OnImageSingleClickListener {\n void onImageSingleClick(int position, String path, PhotoView photoView, ImageViewer imageViewer);\n}", "public static interface OnPhotoTapListener {\n\n /**\n * A callback to receive where the user taps on a photo. You will only receive a callback if\n * the user taps on the actual photo, tapping on 'whitespace' will be ignored.\n *\n * @param view - View the user tapped.\n * @param x - where the user tapped from the of the Drawable, as percentage of the\n * Drawable width.\n * @param y - where the user tapped from the top of the Drawable, as percentage of the\n * Drawable height.\n */\n void onPhotoTap(View view, float x, float y);\n }", "@Override\n public void onItemClicked(View itemView, Photo photo) {\n\n }", "public void onLongClick(View v, Photo photo);", "@OnClick(R.id.hinhanh_dangtin)\n void ChooseImage(View v) {\n onPickPhoto(v);\n }", "@Override\r\n\t\t\tpublic void handleEvent(final Event event) {\r\n\t\t\t\tonSelectPhoto();\r\n\t\t\t}", "private void setupPictureClickListener() {\n if(!picture.hasOnClickListeners()) {\n picture.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent fullscreenViewerIntent = new Intent(getApplicationContext(), ImageViewerFullScreenActivity.class);\n fullscreenViewerIntent.putExtra(CACHE_FILE_NAME, photoURL.substring(0, photoURL.lastIndexOf(\".\")));\n fullscreenViewerIntent.putExtra(\"username\", getIntent().getStringExtra(\"username\"));\n startActivity(fullscreenViewerIntent);\n }\n });\n } \n }", "public void onChangePhotoClicked(View v) {\n\t\tdisplayDialog(DartCalDialogFragment.DIALOG_ID_PHOTO_PICKER);\n\t}", "public interface OnItemClickListener {\r\n /**\r\n * Handles click events for a particular photo within the list.\r\n *\r\n * @param v ImageView containing the photo.\r\n * @param photo Photo object from the list.\r\n */\r\n public void onClick(View v, Photo photo);\r\n\r\n /**\r\n * Handles long click events for a particular photo within the list.\r\n *\r\n * @param v ImageView containing the photo.\r\n * @param photo Photo object from the list.\r\n */\r\n public void onLongClick(View v, Photo photo);\r\n }", "public interface TakePhotoListener {\n void onTake(PictureSelectorActivity.PicItem picItem);\n}", "@OnClick(R.id.gallery_button)\n protected void onPickFromGaleryClicked() {\n EasyImage.openGallery(this);\n }", "public void OnPhotos (View View)\n {\n \tIntent intent = new Intent(this, EditPhotos.class);\n \tintent.putExtra(EXTRA_URI, uri);\n \t\tstartActivity(intent);\n }", "@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tdoTakePhoto();\r\n\t\t\t\t\timagePopupWindow.dismiss();\r\n\t\t\t\t}", "public void onGallery();", "@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tdoPickPhotoFromGallery();\r\n\t\t\t\t\timagePopupWindow.dismiss();\r\n\t\t\t\t}", "public interface OnGridImageSelectedListener{\n void onGridImageSelected(Photo photo, int activityNumber);\n }", "@Override\n public void onItemClick(Photo photo) {\n Intent intent = new Intent(activity, FullScreenPhotoActivity.class);\n intent.putExtra(\"photoUrls\", urls);\n activity.startActivity(intent);\n }", "public void onImageClick(View view) {\n Intent photo_picker = new Intent(Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n photo_picker.setType(\"image/jpeg\");\n startActivityForResult(photo_picker,PHOTO_PICK);\n }", "public void clickPhoto(MouseEvent event) {\n\t\t//System.out.println(\"clicked!\");\n\t\tObservableList<ImageView> images;\n\t\timages = PhotoListDisplay.getSelectionModel().getSelectedItems();\n\t\tfor(ImageView img: images) {\n\t\t\tPhoto p = AccessibleUsersList.masterUserList.userLoggedIn.selectedAlbum.getPhotoFromImage(img);\n\t\t\t//System.out.println(\"path is: \" + p.getPathToPhoto());\n\t\t\t//System.out.println(AccessibleUsersList.masterUserList.userLoggedIn.selectedAlbum.getAlbum());\n\t\t\tOldCaptionText.setText(p.getCaption());\n\t\t\t\n\t\t}\n\t\t\n\t\tObservableList<ImageView> image;\n\t\timage = PhotoListDisplay.getSelectionModel().getSelectedItems();\n\t\t\n\t\tif(image.isEmpty() == true) {\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\talert.setTitle(\"Error!\");\n\t\t\talert.setHeaderText(\"No Photo Selected\");\n\t\t\talert.setContentText(\"No photo selected. Failed to display image.\");\n\t\t\talert.showAndWait();\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tImageView img = (ImageView) PhotoListDisplay.getSelectionModel().getSelectedItem();\n\t\t\n\t\t//test that you got the right image!\n\t\tPhoto p = AccessibleUsersList.masterUserList.userLoggedIn.selectedAlbum.getPhotoFromImage(img);\n\t\t\n\t\t\n\t\t//sets the caption of the photo\n\t\tPhotoCaptionDisplay.setText(p.getCaption());\n\t\t\n\t\t//displays the photo\n\t\tcurrPhotoIndex = listOfPhotos.indexOf(img);\n\t\t//System.out.println(currPhotoIndex);\n\t\tImageView newimg = new ImageView();\n\t\tnewimg.setImage(img.getImage());\n\t\tnewimg.setFitWidth(480);\n\t\tnewimg.setFitHeight(330);\n\t\tdisplayedPhoto.clear();\n\t\tdisplayedPhoto = FXCollections.observableArrayList();\n\t\tdisplayedPhoto.add(newimg);\n\t\tDisplayedImage.setItems(displayedPhoto);\n\t\t\n\t\t//List the tags for the specific Photo\n\t\tArrayList<Tag> listTags = p.getTags();\n\t\ttagObsList = FXCollections.observableList(listTags);\n\t\tTagListDisplay.setItems(tagObsList);\n\t\t\n\t\t//List the date of the photo\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tString dateformat = sdf.format(p.lastModifiedDate);\n\t\tlastModifiedDate.setText(dateformat);\n\t\t\n\t\tnewTagName.setText(\"\");\n\t\tnewTagValue.setText(\"\");\n\t\t\n\t\ttagNameLabel.setVisible(false);\n \ttagValueLabel.setVisible(false);\n \tsubmitNewTagButton.setVisible(false);\n \tcancelNewTagButton.setVisible(false);\n \tnewTagName.setVisible(false);\n \tnewTagValue.setVisible(false);\n\t}", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n Intent galleryIntent = new Intent(Intent.ACTION_PICK,\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n // Start the Intent\n startActivityForResult(galleryIntent, RESULT_LOAD_IMG);\n return false;\n }", "@Override\n public void onClick(View v) {\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n photoPickerIntent.setType(\"image/*\");\n startActivityForResult(photoPickerIntent, SELECT_PHOTO);\n }", "public interface ImageClickedListener {\n void onImageClicked(int position);\n}", "@Override\n public void onClick(View v) {\n if (current_photo < petPhotoUrlList.size()-1) {\n current_photo++;\n imageView.setImageBitmap(photoList[current_photo]);\n }\n else{\n current_photo=0;\n imageView.setImageBitmap(photoList[current_photo]);\n }\n }", "@Override\n public void onClick(View v) {\n\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n photoPickerIntent.setType(\"image/*\");\n startActivityForResult(photoPickerIntent, TAKE_PICTURE);\n dialog.dismiss();\n }", "public void onClick(DialogInterface dialog, int which) {\n switch (which){\n case 0:\n Alog.pon(\"LISTENER\");\n listener.onDialogAlbumPhotoClick();\n break;\n case 1:listener.onDialogTakePhotoClick();\n break;\n }\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tLog.e(\"open gallery\", \"opencamera\");\n\n\t\t\t\t\topenImagechooseAlertDialog();\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tLog.e(\"open gallery\", \"opencamera\");\n\n\t\t\t\t\topenImagechooseAlertDialog();\n\t\t\t\t}", "public interface ZYPhotoSelect {\n void onSelect(ZYPhoto photo);\n}", "@Override\n public void onClick(View v) {\n openGallery();\n }", "@Override\n\t\t\tpublic void onClick(View v){\n\t\t\t\tIntent i = new Intent(CapturePhotoActivity.this, RemoteImageGalleryActivity.class);\n\t\t\t\t//i.putExtra(\"Photo file name\", fileStringUri);\n\t\t\t\tstartActivity(i);\n\t\t\t}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n switch (which) {\n case 0:\n listener.onPickCamera();\n break;\n case 1:\n listener.onPickGallery();\n break;\n }\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, getString(R.string.photo_selector)), RESULT_PHOTO_OK);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, getString(R.string.photo_selector)), RESULT_PHOTO_OK);\n }", "private void onClickPhotoThumbnail(View view) {\r\n int photoId = (int) view.getTag(R.integer.tag_event_photo);\r\n EventPhoto photo = DatabaseManager.getInstance().getDatabase().eventPhotoDao().findById(photoId);\r\n\r\n if (!isEditingPhotos) {\r\n Intent intent = new Intent(this, ViewPhotoActivity.class);\r\n intent.putExtra(ViewPhotoActivity.EXTRA_PHOTO, photo.uri);\r\n startActivity(intent);\r\n return;\r\n }\r\n\r\n new ActionConfirmationFragment(this, this)\r\n .setTitle(getString(R.string.event_confirmation_delete_photo))\r\n .setMessage(getString(R.string.action_confirmation_cannot_be_undone))\r\n .setRequestID(REQUEST_CONFIRMATION_DELETE_PHOTO)\r\n .show(getSupportFragmentManager(), null);\r\n\r\n lastPressedPhoto = view;\r\n }", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\topenGallery(5);\n\t\t\t\t\t\t}", "public void activityCallback(int requestCode, int resultCode, Intent data) {\n\n Log.d(TAG,\"callback called. request code: \" + requestCode + \" result code: \" + resultCode);\n if (requestCode == REQUEST_TAKE_PHOTO && resultCode == Activity.RESULT_OK) {\n Bitmap imageBitmap = null;\n try {\n imageBitmap = MediaStore.Images.Media.getBitmap(context.getContentResolver(), Uri.fromFile(photoFile));\n } catch (IOException e) {\n e.printStackTrace();\n }\n ImageView mImageView = new ImageView(context);\n mImageView.setImageBitmap(imageBitmap);\n photoLayout.addView(mImageView);\n photoLayout.invalidate();\n photoLayout.refreshDrawableState();\n }\n\n\n\n }", "@Override\n public void onClick(View v) {\n thumbnail.handleClick();\n }", "@Subscribe\n public void handlePhotoGalleryPageSelected(OnPhotoGalleryPhotoSelect event) {\n displayPhoto(event.getPhotoDisplayInfo());\n }", "@Override\n public void onClick(View v) {\n\n ((CreateDocketActivityPart2) activity).openGalleryForPickingImage(position);\n }", "public ViewHolder(@NonNull View itemView) {\r\n super(itemView);\r\n bookPhoto = itemView.findViewById(R.id.book_gallery_photo);\r\n bookPhoto.setOnClickListener(new View.OnClickListener() {\r\n @Override\r\n public void onClick(View v) {\r\n Log.i(TAG, \"bookPhoto.onClick()\");\r\n Photo photo = getItem(getAdapterPosition());\r\n if (onItemClickListener != null) {\r\n Log.i(TAG, \"onItemClickListener.onClick(photo)\");\r\n onItemClickListener.onClick(v, photo);\r\n }\r\n }\r\n });\r\n bookPhoto.setOnLongClickListener(new View.OnLongClickListener() {\r\n @Override\r\n public boolean onLongClick(View v) {\r\n Photo photo = getItem(getAdapterPosition());\r\n if (onItemClickListener != null) {\r\n onItemClickListener.onLongClick(v, photo);\r\n return true;\r\n }\r\n return false;\r\n }\r\n });\r\n }", "public void onImageGalleryClicked(View v){\n //invoke the image gallery using an implicit intent\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n\n //decides where to store pictures\n File pictureDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n String pictureDirectoryPath = pictureDirectory.getPath();\n\n //gets URI representation\n Uri data = Uri.parse(pictureDirectoryPath);\n\n //sets the data and type of media to look for\n photoPickerIntent.setDataAndType(data,\"image/*\");\n startActivityForResult(photoPickerIntent, Image_Gallery_Request);\n }", "private void selectImage() {\n final CharSequence[] options = { \"Take Photo\", \"Choose from Gallery\",\"Cancel\" };\n AlertDialog.Builder builder = new AlertDialog.Builder(EventsActivity.this);\n\n builder.setTitle(\"Search Events By Photo\");\n\n builder.setItems(options, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int item) {\n if(options[item].equals(\"Take Photo\")){\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (intent.resolveActivity(getPackageManager()) != null) {\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n\n }\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(context,\n \"com.example.android.fileprovider\",\n photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(intent, 1);\n }\n }\n }\n else if(options[item].equals(\"Choose from Gallery\")) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select File\"),2);\n }\n else if(options[item].equals(\"Cancel\")) {\n dialog.dismiss();\n }\n }\n });\n builder.show();\n }", "@OnClick(R.id.add_photo_layout)\n public void onClickAddPhoto() {\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.setType(\"image/*\");\n startActivityForResult(Intent.createChooser(intent, getString(R.string.choose_image_from)), 8);\n }", "@Override\n public void onClick(View v) {\n chooseImage();\n }", "@Override\n public void onClick(View v) {\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n //Where do we want to find the data\n File pictureDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n //Get the name of the directory\n String pictureDirectoryPath = pictureDirectory.getPath();\n //Get a URI representation of the Path because this is what android needs to deal with\n Uri data = Uri.parse(pictureDirectoryPath);\n //Set the data (where we want to look for this media) and the type (what media do we want to look for).Get all image types\n photoPickerIntent.setDataAndType(data, \"image/*\");\n //We invoke the image gallery and receive something from it\n if (photoPickerIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(photoPickerIntent, IMAGE_GALLERY_REQUEST);\n }\n\n }", "@Override\n public void onClick(View v) {\n dispatchTakePictureIntent();\n }", "@Override\n\tprotected void onPhotoTaked(String photoPath) {\n\t\t\n\t}", "@Override\n public void onLongPress(MotionEvent e) {\n if (null != mLongClickListener) {\n mLongClickListener.onLongClick(getImageView());\n }\n }", "public void onImageClick(View v) {\n\t\t// Send an intent to PhotoActivity\n\t\tIntent intent = new Intent(getBaseContext(), PhotoActivity.class);\n\t\t\n\t\t// Get the bitmap of the image that was clicked and send that as an extra\n\t\tBitmap bitmap = ((BitmapDrawable)((ImageView) v).getDrawable()).getBitmap();\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\tbitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); \n\t\tbyte[] b = baos.toByteArray();\n\n\t\tintent.putExtra(\"image\", b);\n\n\t\tstartActivity(intent);\n\t}", "@Override\n public void onClick(View v) {\n Intent photoPickerIntent = new Intent();\n photoPickerIntent.setType(\"image/*\");\n photoPickerIntent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(photoPickerIntent, GALLERY_REQUEST);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(CJ_BXBQ_XCKP_edit.this, SelectPicActivity.class);\n startActivityForResult(intent, TO_SELECT_PHOTO);\n }", "@Override\n\t\tpublic void onImageClick(ADInfo info, int position, View imageView) {\n\t\t}", "@Override\r\n\t\t\tpublic boolean onLongClick(View v) {\n\t\t\t\tIntent galleryIntent = new Intent(Intent.ACTION_PICK);\r\n\t\t\t\tgalleryIntent.setType(\"image/*\");\r\n\t\t\t\tstartActivityForResult(Intent.createChooser(galleryIntent, \"Choose your Avatar\"), TAKE_AVATAR_GALLERY_REQUEST);\r\n\t\t\t\treturn true;\r\n\t\t\t}", "public void onClick(DialogInterface dialog, int id) {\n takePhoto();\n }", "public interface ImageSelectClicked {\n void clickImage(int position);\n}", "public interface PosterClickListener {\n\n void onPosterClicked(int position, ImageView view);\n}", "@Override\n protected void initEvents() {\n super.initEvents();\n picture1.setOnClickListener(this);\n picture2.setOnClickListener(this);\n }", "@Override\n public void onPhotoTap(View view, float x, float y) {\n finish();\n overridePendingTransition(0, 0);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tselectImageMethod();\n\t\t\t}", "@SuppressLint(\"RestrictedApi\")\n private void setUpAddPhoto() {\n mAddPhotoView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n MenuBuilder menuBuilder = new MenuBuilder(EditStudentInfo.this);\n new MenuInflater(EditStudentInfo.this).inflate(R.menu.menu_photo, menuBuilder);\n MenuPopupHelper menuPopupHelper = new MenuPopupHelper(EditStudentInfo.this,\n menuBuilder, mAddPhotoView);\n menuPopupHelper.setForceShowIcon(true);\n menuBuilder.setCallback(new MenuBuilder.Callback() {\n // Create a menu for the user to choose between taking a new photo and\n // choosing a photo from their photo gallery\n @Override\n public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item) {\n switch (item.getItemId()) {\n case R.id.photo_gallery_action:\n Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT);\n galleryIntent.setType(\"image/*\");\n startActivityForResult(galleryIntent, PICK_PHOTO_GALLERY);\n break;\n case R.id.camera_action:\n launchCamera();\n break;\n default:\n throw new IllegalArgumentException(\"Invalid menu item selected\");\n }\n return true;\n }\n @Override\n public void onMenuModeChange(MenuBuilder menu) {\n\n }\n });\n menuPopupHelper.show();\n }\n });\n }", "public void onPickImage(View view) {\n ImagePicker.pickImage(this, \"Select your image:\");\r\n }", "private void addEventPhoto(EventPhoto photo) {\r\n LinearLayout layoutPhotos = findViewById(R.id.layoutPhotos);\r\n\r\n LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(\r\n LinearLayout.LayoutParams.WRAP_CONTENT,\r\n LinearLayout.LayoutParams.MATCH_PARENT\r\n );\r\n params.setMargins(0, 0, 15, 0);\r\n\r\n Bitmap thumbnailPhoto = ThumbnailGenerator.generate(this, photo.uri, thumbnailSize, thumbnailSize);\r\n\r\n ImageView image = new ImageView(this);\r\n image.setImageBitmap(thumbnailPhoto);\r\n image.setLayoutParams(params);\r\n image.setTag(R.integer.tag_event_photo, photo.uid);\r\n image.setOnClickListener(new View.OnClickListener() {\r\n @Override\r\n public void onClick(View view) {\r\n onClickPhotoThumbnail(view);\r\n }\r\n });\r\n\r\n layoutPhotos.addView(image);\r\n }", "@Override\n public void onClick(View v) {\n Intent i = PhotoPageActivity\n .newIntent(getActivity(), mItem.getPhotoPageUri());\n startActivity(i);\n }", "void onPhotoError();", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tIntent galleryIntent = new Intent(getApplicationContext(),\n\t\t\t\t\t\t\tImageGalleryActivity.class);\n\t\t\t\t\tgalleryIntent.putExtra(\"code\", sourceCode);\n\t\t\t\t\tgalleryIntent.putExtra(\"recipeId\",\n\t\t\t\t\t\t\tString.valueOf(currentRecipe.getRecipeId()));\n\t\t\t\t\tstartActivity(galleryIntent);\n\t\t\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tDialogImage dialog = DialogImage\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.newInstance(place.gallery\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(index_id_dialog)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString());\n\t\t\t\t\t\t\t\t\t\t\t\t\tdialog.show(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetFragmentManager(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTools.TAG_DIALOG_IMAGE);\n\t\t\t\t\t\t\t\t\t\t\t\t}", "@SuppressLint(\"ShowToast\")\n @Override\n public void onClick(View v) {\n if (v.getId() == R.id.uploaded_img || v.getId() == R.id.img_upload_button) {\n // This opens the gallery and gets the selected image for our app\n Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(galleryIntent, RESULT_LOAD_IMAGE);\n }\n if (v.getId() == R.id.confirm_upload_button) {\n if (selectedImageUri != null) {\n UploadToFirebase();\n }\n else {\n Toast toast = Toast.makeText(getApplicationContext(), \"No photo selected\", Toast.LENGTH_SHORT);\n toast.show();\n }\n }\n if (v.getId() == R.id.close_button) {\n openHomeActivity();\n }\n }", "@Override\n public void onClick(View v) {\n OpenGallery();\n adapter.updateImageList(uploadedImages);\n }", "private void dispatchGetPictureFromGalleryIntent() {\n Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n if (pickPhoto.resolveActivity(getContext().getPackageManager()) != null) {\n this.startActivityForResult(pickPhoto, PICK_IMAGE);\n }\n }", "@Override\n\t\tpublic void onClick(View v) { Intent galleryIntent = new Intent(Intent.ACTION_PICK,\n\t\t\t\t\tandroid.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n\t\t\t// Start the Intent\n\t\t\tstartActivityForResult(\n\t\t\t\t\tIntent.createChooser(galleryIntent, \"Select Picture\"), REQUEST_CODE);\n\t\t}", "public interface ImageEditNavListener {\n public void onClick(View view, String type);\n}", "private void dispatchGalleryIntent() {\n Intent pickPhoto = new Intent(Intent.ACTION_PICK,\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n pickPhoto.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivityForResult(pickPhoto, REQUEST_CHOOSE_PHOTO_NUM);\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n if (options[which].equals(\"Take Photo\")) {\n\n checkAndroidVersion();\n\n\n } else if (options[which].equals(\"Choose from Gallery\")) {\n Intent intent1 = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent1.addCategory(Intent.CATEGORY_OPENABLE);\n intent1.setType(\"image/*\");\n startActivityForResult(intent1, REQUEST_OPEN_RESULT_CODE);\n\n }\n// else if(options[which].equals(\"Cancel\"))\n// {\n// dialog.dismiss();\n// }\n\n }", "private void onPhotoPickerItemSelected(int button) {\n switch (button) {\n case CAMERA_OPTION:\n // camera\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Construct temporary image path and name to save the taken\n // photo\n try {\n mPhotoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n ex.printStackTrace();\n }\n if (mPhotoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n BuildConfig.APPLICATION_ID,\n mPhotoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n }\n startActivityForResult(intent, REQUEST_CODE_CAMERA_PERMISSION);\n break;\n case GALLERY_OPTION:\n //gallery:\n try {\n mPhotoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n ex.printStackTrace();\n }\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n photoPickerIntent.setType(\"image/*\");\n startActivityForResult(photoPickerIntent, REQUEST_CODE_GALLERY);\n }\n }", "@RequiresApi(api = Build.VERSION_CODES.N)\n @Override\n public void onClick(View view) {\n Dialog cameraOrGallery = Utils.getBasicDialog(PrescriptionActivity.this, R.layout.dialog_camera_or_gallery);\n cameraOrGallery.getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n cameraOrGallery.getWindow().setBackgroundDrawable(ContextCompat.getDrawable(PrescriptionActivity.this, R.drawable.rounded_corners));\n cameraOrGallery.getWindow().setGravity(Gravity.CENTER);\n cameraOrGallery.show();\n\n cameraOrGallery.findViewById(R.id.prescription_use_camera).setOnClickListener(view1 -> {\n // ask for permission\n letUserUseTheCamera();\n // getCameraAccessPermission();\n cameraOrGallery.dismiss();\n\n //upload the image\n //return to activity\n });\n cameraOrGallery.findViewById(R.id.prescription_use_gallery).setOnClickListener(view1 -> {\n letUserChooseImage();\n cameraOrGallery.dismiss();\n });\n }", "public void onClick(View v) {\n if (photoGallery.size() != 0) {\n switch (v.getId()) {\n case R.id.btnUpload:\n task.execute(new String[] { \"http://localhost:9091/PhotoServer/sends\" });\n case R.id.btnCaption:\n File source = new File(currentPhotoPath);\n String[] split_str2 = currentPhotoPath.split(\"_\");\n String fin = split_str2[0] + \"_\" + split_str2[1] + \"_\" + split_str2[2] + \"_\" + caption.getText() + \"_\" + split_str2[4] + \"_\" + split_str2[5] + \"_\" + split_str2[6];\n File destination = new File(fin);\n source.renameTo(destination);\n photoGallery = photoGallery = populateGallery(minDate, maxDate, \"\", min_long, max_long, min_lat, max_lat);\n\n break;\n case R.id.btnLeft:\n --currentPhotoIndex;\n break;\n case R.id.btnRight:\n ++currentPhotoIndex;\n break;\n default:\n break;\n }\n if (currentPhotoIndex < 0)\n currentPhotoIndex = 0;\n if (currentPhotoIndex >= photoGallery.size())\n currentPhotoIndex = photoGallery.size() - 1;\n if (photoGallery.size() != 0) {\n currentPhotoPath = photoGallery.get(currentPhotoIndex);\n String[] split_str = currentPhotoPath.split(\"_\");\n timestamp.setText(split_str[1]);\n caption.setText(split_str[3]);\n lat_text.setText(split_str[4]);\n long_text.setText(split_str[5]);\n caption.invalidate();\n timestamp.invalidate();\n }\n Log.d(\"phpotoleft, size\", Integer.toString(photoGallery.size()));\n Log.d(\"photoleft, index\", Integer.toString(currentPhotoIndex));\n displayPhoto(currentPhotoPath);\n\n }\n }", "public void clickPickImage(View view) {\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n photoPickerIntent.setType(\"image/*\");\n startActivityForResult(photoPickerIntent, 10);\n }", "@Override\n public void onSingleTapUp(int x, int y) {\n if (mAppBridge != null) {\n if (mAppBridge.onSingleTapUp(x, y)) {\n return;\n }\n }\n\n MediaItem item = mModel.getMediaItem(0);\n if (item == null || item == mScreenNailItem) {\n // item is not ready or it is camera preview, ignore\n return;\n }\n\n boolean clickCenter = false;\n boolean clickRefocus = false;\n int w = mPhotoView.getWidth();\n int h = mPhotoView.getHeight();\n int iconMargin = mPhotoView.getIconMargin();\n int supported = item.getSupportedOperations();\n boolean playVideo = ((supported & MediaItem.SUPPORT_PLAY) != 0);\n boolean unlock = ((supported & MediaItem.SUPPORT_UNLOCK) != 0);\n boolean goBack = ((supported & MediaItem.SUPPORT_BACK) != 0);\n boolean launchCamera = ((supported & MediaItem.SUPPORT_CAMERA_SHORTCUT) != 0);\n // determine if the point is at center (1/6) of the photo view.\n // (The position of the \"play\" icon is at center (1/6) of the photo)\n clickCenter = (Math.abs(x - w / 2) * 12 <= w) && (Math.abs(y - h / 2) * 12 <= h);\n //clickRefocus = (Math.abs(x - w / 2) * 12 <= w) && (Math.abs(y - h / 2 - iconMargin) * 12 <= h);\n\n if (playVideo && clickCenter) {\n /* SPRD:Bug474646 Add Drm feature,modify bug old 394118,Video File is Drm need to dispaly a toast @{ */\n final MediaItem itemDrm = item;\n AlertDialog.OnClickListener onClickListener = new AlertDialog.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // TODO Auto-generated method stub\n playVideo(mActivity, itemDrm);\n }\n };\n if (!SomePageUtils.getInstance().checkPressedIsDrm(mActivity, itemDrm, onClickListener,\n null, null, false)) {\n /* SPRD:474646 Add Drm feature,Drm feature end @} */\n if (mSecureAlbum == null) {\n playVideo(mActivity, item);\n } else {\n mActivity.getStateManager().finishState(this);\n }\n /* @} */\n }\n } else if (goBack) {\n onBackPressed();\n } else if (unlock) {\n Intent intent = new Intent(mActivity, GalleryActivity.class);\n intent.putExtra(GalleryActivity.KEY_DISMISS_KEYGUARD, true);\n mActivity.startActivity(intent);\n } else if (launchCamera) {\n launchCamera();\n } else {\n toggleBars();\n }\n }", "public void changePhoto(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "private void selectImage() {\n final CharSequence[] items = {\"Take Photo\", \"Choose from Library\",\n \"Cancel\"};\n\n AlertDialog.Builder builder = new AlertDialog.Builder(Timetable.this);\n builder.setTitle(\"Add Photo!\");\n builder.setItems(items, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int item) {\n if (items[item].equals(\"Take Photo\")) {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(intent, REQUEST_CAMERA);\n } else if (items[item].equals(\"Choose from Library\")) {\n Intent intent = new Intent(\n Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n intent.setType(\"image/*\");\n startActivityForResult(\n Intent.createChooser(intent, \"Select File\"),\n SELECT_FILE);\n } else if (items[item].equals(\"Cancel\")) {\n dialog.dismiss();\n }\n }\n });\n builder.show();\n }", "private void invokeGetPhoto() {\n // invoke the image gallery using an implicit intent.\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n // Show only images, no videos or anything else\n photoPickerIntent.setType(\"image/*\");\n photoPickerIntent.setAction(Intent.ACTION_GET_CONTENT);\n // Always show the chooser (if there are multiple options available)\n startActivityForResult(Intent.createChooser(photoPickerIntent, \"Choose a picture\"), REQUEST_IMAGE_CAPTURE);\n }", "private void deletePressedPhoto() {\r\n if (lastPressedPhoto == null)\r\n return;\r\n\r\n int photoId = (int) lastPressedPhoto.getTag(R.integer.tag_event_photo);\r\n\r\n LinearLayout layoutPhotos = findViewById(R.id.layoutPhotos);\r\n layoutPhotos.removeView(lastPressedPhoto);\r\n\r\n EventPhoto photo = DatabaseManager.getInstance().getDatabase().eventPhotoDao().findById(photoId);\r\n DatabaseManager.getInstance().getDatabase().eventPhotoDao().deleteById(photo.uid);\r\n showToast(getString(R.string.event_photo_removed), Toast.LENGTH_SHORT);\r\n disablePhotoEditing();\r\n }", "@Override\n public void onClick(View view) {\n Intent gallery_intent=new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(gallery_intent,RESULT_LOAD_IMAGE);//Paasing intentobject and an integer value\n\n }", "public void changePic(View v){\n //Intent gallery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);\n //startActivityForResult(gallery,PICK_IMAGE);\n new AlertDialog.Builder(ProfileModify.this)\n .setIcon(android.R.drawable.ic_dialog_alert)\n .setTitle(\"Choose\")\n .setItems(Choose, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if(which == 0) {\n Intent iGallery = new Intent(Intent.ACTION_PICK,MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(iGallery,PICK_GALLERY);\n }\n else {\n Intent iCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if(iCamera.resolveActivity(getPackageManager()) != null){\n startActivityForResult(iCamera,REQUEST_IMAGE_CAPTURE);\n }\n }\n }\n }).create().show();\n }", "@Override\n public void onClick(View v) {\n Intent i = new Intent(\n Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(i, SELECTED_PICTURE);\n }", "@Override\n public void imageFromGallery() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select picture\"), PICK_IMAGE);\n }", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent,\n \"Select Picture\"), IMG_RESULT);\n\n }", "@Override\n \t\t\tpublic void onClick(View v) {\n \t\t\t\tNoteEditView.this.addPicture();\n \t\t\t}", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n Intent pickIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n pickIntent.setType(\"image/*\");\n Intent chooserIntent = Intent.createChooser(intent, \"Select Image\");\n chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] {pickIntent});\n startActivityForResult(chooserIntent,PICK_IMAGE_REQUEST);\n }", "private void loadPhotosClicked() {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"image/jpeg\");\n intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);\n\n startActivityForResult(Intent.createChooser(intent, \"Choose Photos\"), RQS_OPEN_PHOTO_TREE);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent,\n \"Select Picture\"), SELECT_PICTURE);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n ((MainActivity) getActivity()).startActivityForResult(\n Intent.createChooser(intent, \"Select Picture\"),\n MainActivity.GALLERY_CODE);\n\n }", "private void setPhotoAttcher() {\n\n }", "@Override\r\n public void onClick(View v) {\n mPhotoImage.setVisibility(View.GONE);\r\n mCameraButton.setVisibility(View.VISIBLE);\r\n mGallaryButton.setVisibility(View.VISIBLE);\r\n mCameraButton.setEnabled(true);\r\n mGallaryButton.setEnabled(true);\r\n mConfirmButton.setEnabled(false);\r\n mPhotoframeText.setText(R.string.upload_photo_label);\r\n }", "@Override\n public void onClick(View v) {\n mListener.onDialogCameraClick(ImageChooserDialogFragment.this);\n // Dismiss the dialog fragment.\n dismiss();\n }", "public interface OnItemClickListener {\n public void OnItemClick(int albumId);\n}", "@Override\r\n public void onClick(View view) {\n permission();\r\n pickImage();\r\n\r\n }" ]
[ "0.78242636", "0.7628958", "0.7572948", "0.7393481", "0.7295968", "0.71898305", "0.7185074", "0.71696824", "0.7137492", "0.7073428", "0.6894558", "0.68262076", "0.68173945", "0.67829245", "0.67710286", "0.6762498", "0.6698892", "0.6677614", "0.66509414", "0.66356325", "0.6622958", "0.66146684", "0.6597884", "0.65797853", "0.65123", "0.65094036", "0.6501401", "0.6492199", "0.64866185", "0.64866185", "0.64754325", "0.64453715", "0.64449364", "0.6432486", "0.6432005", "0.6432005", "0.64204913", "0.6414152", "0.640995", "0.6409432", "0.6397622", "0.6392055", "0.6384259", "0.6377556", "0.6365309", "0.63568115", "0.63436264", "0.6333732", "0.6330579", "0.63104564", "0.6298061", "0.62867177", "0.6281692", "0.628008", "0.6255098", "0.62540203", "0.62235904", "0.61990047", "0.61472195", "0.614567", "0.61456084", "0.61445785", "0.61405563", "0.61370784", "0.6123041", "0.6118745", "0.6117798", "0.61054844", "0.6091848", "0.6083886", "0.60768515", "0.6076779", "0.60727346", "0.60644084", "0.60519356", "0.6022708", "0.6018687", "0.6013056", "0.60117656", "0.60067713", "0.6001626", "0.6000244", "0.59963304", "0.5994539", "0.59905857", "0.5980781", "0.59798235", "0.5976094", "0.59700036", "0.59643716", "0.5960658", "0.5959267", "0.59480435", "0.59459263", "0.5945512", "0.5935202", "0.59346634", "0.5927354", "0.5923251", "0.5917813" ]
0.7471549
3
int[] idades = new int[];
public static void main(String[] args) { Object[] contas = new Object[5]; Object cc1 = new ContaCorrente(22, 11); contas[0]=cc1; Object cc2 = new ContaPoupanca(22, 98); contas[1]=cc2; Object ref = contas[1]; System.out.println(((Conta) cc2).getNumero()); System.out.println(((Conta) ref).getNumero()); Cliente clienteNormal = new Cliente(); clienteNormal.setNome("Flavio"); Cliente clienteVip = new Cliente(); clienteVip.setNome("Romulo"); Object[] refs = new Object[5]; refs[0] = clienteNormal; refs[1] = clienteVip; System.out.println(((Cliente) refs[1]).getNome()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TumpukanInteger(int kapasitas){\r\n elemen = new int[kapasitas];\r\n }", "public ulsinArray(int length) {\n intArr = new int[length];\n }", "int[] getInts();", "int[] mo56160d();", "int[] mo56159c();", "public Integer[] createArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = (int)(value.length*Math.random());\n }\n\n return value;\n }", "public void set(int[] ai);", "int[] mo12208a(int i);", "int[] toArray();", "Array() {\n\t\tarray = new int[0];\n\t}", "private static int[] arrayInitializer(int length) {\n int[] myArray = new int[length];\n Random rand = new Random();\n for (int i = 0; i < length; i++) {\n myArray[i] = rand.nextInt(1000);\n }\n return myArray;\n }", "FunWithArrays(int size){\r\n\t\tnumbers = new int[size];\r\n\t}", "static int[] populateArray(int lenght) {\n\t\tint[] A = new int[lenght];\n\t\t\n\t\tfor(int i=0; i < A.length; i++) {\n\t\t\tA[i] = (int)(Integer.MAX_VALUE * Math.random());\n\t\t}\n\t\t\n\t\treturn A;\n\t}", "public int[] getIntList();", "private static int[] createArray() {\n\t\trnd = new Random();\r\n\t\trandomArray = new int[8];\r\n\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\trandomArray[i] = rnd.nextInt(45);\r\n\t\t}\r\n\t\treturn randomArray;\r\n\t}", "Array(int[] n) {\n\t\tarray = n;\n\t}", "void mo12207a(int[] iArr);", "public int[] getArray() {\n\t\treturn array;\n\t}", "public void setArr(int[] arr){ this.arr = arr; }", "public static IntegerVarArray make(int[] buffer) {\n\t\treturn new IntegerVarArray(buffer);\n\t}", "private final int[] initializeInstanceVariable() {\n\t\tint n = 10;\n\t\tint[] temp = new int[n];\n\t\tfor (int i = 0; i < n; i++) {temp[i] = i;}\n\t\treturn temp;\n\t}", "public int[] getArray() {\r\n\t\treturn array;\r\n\t}", "public static int[] volteaArrayInt(int array[]) {\n int aux[] = new int[array.length];\n int cont = aux.length;\n for (int n : array) {\n aux[--cont] = n;\n }\n return aux;\n }", "Main(int citizens)\n {\n\n this.citizens = citizens;\n rank = new int[citizens];\n id = new int[citizens];\n for (int i = 0; i < citizens; i++){\n\n rank[i] = 1;\n id[i] = i;\n }\n }", "public int[] numbers();", "@Override\n\tpublic int[] toArray() {\n\t\treturn null;\n\t}", "private int[] createArrays(int size) {//creating method, using variable \"SIZE\"\n\t\tint [] array = new int[size];\n\t\treturn array;\n\t}", "public int[] getArray() {\r\n return array;\r\n }", "public static int[] volteaArrayInt(int[]array) { \n \n int[] aux = new int [array.length];\n \n for(int i = 0 ; i < array.length; i++){\n aux[array.length - i - 1] = array[i];\n }\n return aux;\n }", "public static int[] getIDs() {\n int[] res = new int[crossbows.length];\n for (int i = 0; i < crossbows.length; i++) {\n res[i] = (int)crossbows[i][0];\n }\n return res;\n }", "public abstract int[] toIntArray();", "Array createArray();", "public ArrayListInt(int cantidadDeNumerosDelArray)\n {\n numerosEnteros = new int[cantidadDeNumerosDelArray];\n tamañoDelArray = cantidadDeNumerosDelArray;\n }", "static int [] GerarAleatorio()\n {\n Random gerar = new Random();\n int [] Aleatorio = new int [pergu]; // Cria um Vetor com o tamanho de quantidade de perguntas\n \n \n int pos1, pos2, auxilio; \n \n for (int i = 0; i < Aleatorio.length; i++) \n {\n Aleatorio[i] = i ; // preenche o vetor\n }\n \n for (int i = 0; i < 1000; i++) //Quantidade de vezes que as perguntas serão embaralhadas \n {\n pos1 = gerar.nextInt(Aleatorio.length);\n pos2 = gerar.nextInt(Aleatorio.length);\n //troca \n auxilio = Aleatorio[pos1]; //guarda o valor da posição 1\n \n Aleatorio [pos1] = Aleatorio[pos2]; //troca o valor de 1 para 2\n Aleatorio[pos2] = auxilio; //troca o valor de 2 para o valor que estava na 1\n }\n \n \n return Aleatorio; \n }", "public static int[] getID()\n {\n \n String TableData[][]= getTableData();\n int row=getRowCount();\n int ID[]=new int[row];\n for (int i=0;i<TableData.length;i++)\n {\n ID[i]= Integer.parseInt(TableData[i][0]);//converts the data into integer as it was in string\n }\n return ID; //returnd ID array\n }", "public Integer[] createSortedArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = i;\n }\n\n return value;\n }", "public C0902id[] newArray(int i) {\n return new C0902id[i];\n }", "public void SetVector(int[] v){ this.vector=v;}", "public int[] toArray() \n {\n \treturn arrayCopy(state);\n }", "public static int[] check() {\r\n //---- instance of 'intArray' ----\r\n int[] intArray = new int[10];\r\n\r\n //---- set value to intArray[i] ----\r\n for(int i = 0; i < intArray.length; i++) {\r\n intArray[i] = i * 2;\r\n }// for\r\n\r\n //---- return to 'main()' ----\r\n return intArray;\r\n }", "private void setIntArr(int[] intArr) {\r\n this.intArr = intArr;\r\n\r\n }", "public static int[] generaValoresAleatorios() {\n\t\treturn new Random().ints(100, 0, 1000).toArray();\n\t}", "public int[] _iArray(int res_id) {\n\t\treturn mContext.getResources().getIntArray(res_id);\n\t}", "int[] retrieveAllData();", "public static void main(String[] args) {\n int[] someInts2 = new int[3];\n// int[] someInts3 = new int[1, 2, 3,];\n int[] someInts4 = {1, 2, 3,};\n\n// someInts1 = {1, 2, 3};\n someInts2[0] = 1;\n// System.out.println(someInts2[0]);\n// System.out.println(someInts2[1]);\n// int aInt = someInts4[2];\n// System.out.println(aInt);\n System.out.println(someInts4.length);\n\n }", "int[] getValues()\n {\n return values_;\n }", "Array(int x) {\n\t\tarray = new int[x];\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tarray[i] = 0; // make each index 0\n\t\t}\n\t}", "public java.lang.Object[] getIdsAsArray()\r\n {\r\n return (ids == null) ? null : ids.toArray();\r\n }", "private static int[] createArray(int n) {\n\t \tint[] array = new int[n];\n\t \tfor(int i=0; i<n; i++){\n\t \t\tarray[i] = (int)(Math.random()*10);\n\t \t}\n\t\t\treturn array;\n\t\t}", "public IntArrayProcessor(int[] array)\n {\n integers = array;\n }", "public void incrementarArreglo() {\n int tamanio_actual = top + 1; // variable tamaño actual le asignamos el valor de la cima + 1\r\n int[] new_array = new int[tamanio_actual * 2]; // al nuevo arreglo le asignamos el tamaño actual multiplicado por 2\r\n for(int i=0; i<tamanio_actual; i++){ \r\n new_array[i] = array[i]; // ciclo para ir asignando los valores existentes al nuevo arreglo\r\n }\r\n array = new_array; //referenciamos al nuevo arreglo\r\n capacidad = new_array.length; // variable capacidad le damos el valor de la longitud del nuevo arreglo\r\n }", "public static int[] m22363a() {\n return (int[]) f17665d.clone();\n }", "public int[] getAllId(int id) {\n int[] ids = new int[50];\n int i = 0;\n String sql= \"select * from photo where id_annonce = \"+id;\n Cursor cursor = this.getReadableDatabase().rawQuery(sql, null);\n if (cursor.moveToFirst())\n do {\n ids[i] = cursor.getInt(cursor.getColumnIndex(\"id_photo\"));\n i++;\n }while (cursor.moveToNext());\n cursor.close();\n return ids;\n }", "public int[] generarSecuencia(int cantidad){\n int secuencia[]= new int[cantidad];\n\n for(int i=0;i<cantidad;i++){\n secuencia[i]= randRange(1,8);\n }\n return secuencia;\n }", "public static int[] volteaArray(int array[]){\r\n int array2[] = new int[array.length];\r\n \r\n for (int i = 0; i<array.length; i++){\r\n array2[(9-i)]=array[i];\r\n }\r\n \r\n return array2;\r\n }", "public int[] getIDs(){\r\n\t\tint[] id = new int[Config.MAX_CLIENTS];\r\n\t\tfor(int i=0; i< Config.MAX_CLIENTS;i++){\r\n\t\t\tid[i] = clients[i].getID();\r\n\t\t}\r\n\t\treturn id;\r\n\t}", "public int[] initializingArray(int size) {\n\t\tint [] array = createArrays(size);\n\t\tfor(int i = 0;i < array.length; i++) {\n\t\t\tarray[i] = rand.nextInt(10);\n\t\t}\n\t\treturn array;\n\t}", "public Integer[] createInverseSortedArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = defaultLaenge - i;\n }\n\n return value;\n }", "public int[] toIntArray()\r\n {\r\n int[] a = new int[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = (Integer) vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "public IntegerList(int size)\n {\n list = new int[size];\n }", "void assignSize (int size) {\n array = new int[size];\n }", "OrderedIntList ()\r\n\t{\r\n\t\tarray = new int[10];\r\n\t}", "public Generator() {\n identificationNumbers = new int[100][31];\n }", "public int[] getArray(){\n return this.sortArray;\n }", "public static int[] createRandomIntArray(int length) {\n\n int[] arr = new int[length];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = (int)(Math.random() * 1000 + 1);\n }\n return arr;\n }", "public void testCrearArrayNoEspecificado(int size) {\n\t\tint[] array = new int[size]; //tempLocal = 1\n\t}", "@Override\n\tpublic void actualizarIds(JSONArray array) {\n\n\t}", "public DArray (int max)\n // constructor\n {\n theArray = new long[max];\n // create array\n nElems = 0;\n }", "public void testCrearArrayEspecificado(int size) {\n\t\tint[] array = new int[size]; //tempLocal = size : size >=1\n\t}", "public void init(int[] a){\n this.array = a;\n moves = 0; \n }", "public static int[] makeArray( Random random){\n\t\tint[] arr = new int[10];\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tarr[i] = random.nextInt(200);\n\t\treturn arr;\n\t}", "void setPosiblesValores(int[] valores);", "public ArrayIns(int max) // constructor\r\n {\r\n a = new long[max]; // create the array\r\n nElems = 0; // no items yet\r\n }", "public Set(){\n setSet(new int[0]);\n }", "public short[] get_entries_id() {\n short[] tmp = new short[11];\n for (int index0 = 0; index0 < numElements_entries_id(0); index0++) {\n tmp[index0] = getElement_entries_id(index0);\n }\n return tmp;\n }", "public void setArray(int[] array) {\r\n this.array = array;\r\n }", "public static IntegerVarArray make(int count) {\n\t\treturn new IntegerVarArray(count);\n\t}", "public static int[] toArray(Collection<Integer> a) {\n assert (a != null);\n int[] ret = new int[a.size()];\n int i = 0;\n for (int e : a)\n ret[i++] = e;\n return ret;\n }", "public static int[] m22366a() {\n return (int[]) f17668c.clone();\n }", "public native int[] __intArrayMethod( long __swiftObject, int[] arg );", "public static Integer[] prepareRandomIntegerArray(int size) {\n\t\tInteger[] array = new Integer[size];\n\t\tfor (int j = 0; j < size; j++) {\n\t\t\tarray[j] = (int) ((Math.random() * 1000000));\n\t\t}\n\t\treturn array;\n\t}", "public int[] fillDatabase()\n {\n int [] db = new int [20];\n \n \n for (int i = 0; i < db.length; i++)\n {\n db[i] = new java.util.Random().nextInt(25);\n }\n return db;\n }", "static public int[] toArray(IntArray array){\r\n final int[] result = new int[array.getLength()];\r\n for (int i = 0; i < array.getLength(); i++) {\r\n result[i] = array.getData(i);\r\n }\r\n return result;\r\n }", "@Override\n\tpublic Object[] getIds() {\n\t\treturn null;\n\t}", "public int[] getIntArray() {\r\n\t\t\r\n\t\treturn (value.getIntArray());\r\n\t}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default int[] asIntArray() {\n \n return notSupportedCast(\"int[]\");\n }", "public List<Pair<Integer, Integer>> getArray(){\n return qtadePorNum;\n }", "public static int[] constructor(int n) {\r\n int v[] = new int[n];\r\n\r\n for (int i = 0; i < v.length; i++) {\r\n int dato = (int) (Math.random() * 20);\r\n v[i] = dato;\r\n }\r\n return v;\r\n }", "public int [] covertirInt(String [] a) {\n\t\n\t\n\t int [] temporal = new int [a.length-1];\n\t\n\t\n\t for (int i =0; i<temporal.length;i++) {\n\t \n\t\t temporal[i]=Integer.parseInt(a[i+1]);\n\t }\n \n \n\t return temporal;\n\t\n}", "public int[] convert(){\r\n int[] arreglo = new int[cedula.length()];\r\n for(int i=0; i<cedula.length(); i++){\r\n // convierte los char en int\r\n arreglo[i] = Character.getNumericValue(cedula.charAt(i));\r\n }\r\n return arreglo;\r\n }", "int[] export();", "public FirstFind(int n) {\n id = new int[n];\n count = n;\n for (int i = 0; i < n; i++) id[i] = i;\n }", "public void makeArray() {\r\n for (int i = 0; i < A.length; i++) {\r\n A[i] = i;\r\n }\r\n }", "public static void main(String args[]){\n int Array_List[]= new int[]{1,2,3,4,5,6,7,8,9,10};\n\n }", "public void ordenaArray(){\t\t\n\t\tCollections.sort(anos, new Comparator<Integer>(){\n\t\t\t@Override\n\t\t\tpublic int compare(Integer ano1, Integer ano2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn ano1.compareTo(ano2);\n\t\t\t}\n\t\t});\n\t}", "public static void generator(){\n int vector[]= new int[5];\r\n vector[10]=20;\r\n }", "public static void main(String[] args) {\nint[] a= new int[10];\nfor(int i=0;i<10;i++) {\na[i]=i;\n}\nfor(int i=0;i<10;i++) {\n\tSystem.out.println(a[i]);\n}\n\n}", "private List<Integer> toList(int[] array) {\n List<Integer> list = new LinkedList<Integer>();\n for (int item : array) {\n list.add(item);\n }\n return list;\n }", "public void inicializarArrays(){\n for(int i=0;i<=10;i++){\n dni[i] = 0;\n nombre[i] = \"\";\n apellido[i] = \"\";\n direccion[i] = \"\";\n telefono[i] = \"\";\n fNacimiento[i] = \"\";\n }\n }", "private void setSet(int[] set){\n this.set = set;\n }", "public static void intercambiar(int []Grado1, int ii, int jj){\nint aux=Grado1[ii];\nGrado1[ii]= Grado1[jj];\nGrado1[jj]=aux;\n}" ]
[ "0.69701076", "0.6672672", "0.66588837", "0.6484588", "0.64610887", "0.6458903", "0.6390784", "0.63458914", "0.6314455", "0.6283087", "0.62791014", "0.6222218", "0.62103736", "0.61997586", "0.61955583", "0.6178472", "0.6117336", "0.6107577", "0.610598", "0.6063208", "0.6062775", "0.60569525", "0.6052592", "0.60495764", "0.603719", "0.60033494", "0.60012865", "0.5991766", "0.59686023", "0.59496266", "0.5948432", "0.59380585", "0.5925137", "0.59005016", "0.586917", "0.58495617", "0.5826441", "0.58146536", "0.5812649", "0.57897186", "0.5784343", "0.5778423", "0.5758994", "0.5749961", "0.57299924", "0.5727883", "0.5725478", "0.572238", "0.5717567", "0.570632", "0.5699667", "0.56977195", "0.569718", "0.568703", "0.5673535", "0.56700623", "0.5660548", "0.56602895", "0.56583405", "0.5652898", "0.5641544", "0.5641028", "0.5639237", "0.5634942", "0.5630744", "0.56289625", "0.5623115", "0.561245", "0.5606287", "0.56043756", "0.55987287", "0.5596342", "0.5594833", "0.55945814", "0.5593607", "0.5585995", "0.5581673", "0.55726177", "0.5564617", "0.5557335", "0.55526704", "0.55511343", "0.554417", "0.5540843", "0.5538621", "0.5534368", "0.55019385", "0.54971224", "0.54954916", "0.54876494", "0.54810005", "0.5480454", "0.54767823", "0.546328", "0.5458347", "0.5458192", "0.545653", "0.5455526", "0.5436705", "0.5428882", "0.541748" ]
0.0
-1
TestVO vo = sqlSessionTemplate.selectOne("tripnote_test.selectTest");
public int insertMember(MemberVO vo) { int row = mapper.insertMember(vo); // logger.info(vo.toString()); return row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TCpySpouse selectOneByExample(TCpySpouseExample example);", "List<PayLogInfoPo> selectByExample(PayLogInfoPoExample example);", "SysNotice selectOneByExample(SysNoticeExample example);", "List<ProcRecInvoice> selectByExample(ProcRecInvoiceExample example);", "@Override\n\tpublic Object selectOne2(Object p_idx) {\n\t\t\n\t\tPlayVo vo = session.selectOne(\"play.select_play\",p_idx); \n//\t\tSystem.out.println(vo.getP_idx());\n//\t\tSystem.out.println(vo.getP_rts());\n//\t\tSystem.out.println(vo.getP_rts());\n\t\t\n\t\t\n\t\treturn vo;\n\t}", "@Test\n public void selectById(){\n User user=iUserDao.selectById(\"158271202\");\n System.out.println(user.toString());\n }", "List<TCpySpouse> selectByExample(TCpySpouseExample example);", "DashboardGoods selectOneByExample(DashboardGoodsExample example);", "Visituser selectOneByExample(VisituserExample example);", "List<TbComEqpModel> selectByExample(TbComEqpModelExample example);", "List<LoginRecordDO> selectByExample(LoginRecordDOExample example);", "ZhuangbeiInfo selectOneByExample(ZhuangbeiInfoExample example);", "List<UcOrderGuestInfo> selectByExample(UcOrderGuestInfoExample example);", "PaasCustomAutomationRecord selectByPrimaryKey(Integer id);", "List<GoodsPo> selectByExample(GoodsPoExample example);", "List<RepaymentPlanInfoUn> selectByExample(RepaymentPlanInfoUnExample example);", "List<AutoAssessDetail> selectByExample(AutoAssessDetailExample example);", "List<PaasCustomAutomationRecord> selectByExample(PaasCustomAutomationRecordExample example);", "@Test\n public void retriveByIdTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(1);\n assertNotNull(servizio,\"Should return true if return Servizio 1\");\n }", "@Test\n public void selectById() {\n }", "List<TbInvCategory> selectByExample(UTbInvCategoryExample example);", "IceApp selectByPrimaryKey(Long id);", "List<AliUserInfoDO> selectByExample(AliUserInfoDOExample example);", "List<NjProductTaticsRelation> selectByExample(NjProductTaticsRelationExample example);", "@Override\n\tpublic SCsVo sselcetOne(int index) throws SQLException {\n\t\treturn sqlSession.selectOne(\"yes.as_selectOne\", index);\n\t}", "List<SrHotelRoomInfo> selectByExample(SrHotelRoomInfoExample example);", "Tourst selectByPrimaryKey(String id);", "TCpySpouse selectByPrimaryKey(Integer id);", "PineAlarm selectOneByExample(PineAlarmExample example);", "List<SysNotice> selectByExample(SysNoticeExample example);", "@Test\n\tpublic void testFindUserById() throws Exception {\n\t\tSqlSession sqlSession = factory.openSession();\n\t\tUser user = sqlSession.selectOne(\"com.wistron.meal.user.findUserById\",3);\n\t\tSystem.out.println(user);\n\t\tsqlSession.close();\n\t\t\n\t}", "@Test\n public void testProcessSelect() throws Exception {\n\n try {\n String sql = \"select * from ts_task limit 1\";\n ResponseDataDtoV1 resp = textService.processSelect(sql, \"J\");\n System.out.println(\"res: succ \" + JSONFmtUtil.formatJsonConsole(JSONFastJsonUtil.objectToJson(resp)));\n } catch (Exception e) {\n System.out.println(\"res: error \" + e);\n e.printStackTrace();\n }\n\n }", "@Override\r\npublic List<Possalesdetail> selectByExample(PossalesdetailExample example) {\n\treturn possalesdetail.selectByExample(example);\r\n}", "List<TestEntity> selectByExample(TestEntityExample example);", "@Override\r\n\tpublic String selectTest() {\n\t\tString retVal = \"\";\r\n\t\t\r\n\t\tMybatisTestVo vo = mapper.selectTest();\r\n\t\t\r\n\t\tSystem.out.println(\"vo number : \" + vo.getMemberNo());\r\n\t\tSystem.out.println(\"vo name : \" + vo.getMemberName());\r\n\t\t\r\n\t\tretVal = vo.getMemberName();\r\n\t\t\r\n\t\treturn retVal;\r\n\t}", "Ltsprojectpo selectByPrimaryKey(Long id);", "@Test\n public void test2(){\n String sql = \"select order_id orderID, order_name orderName, order_date orderDate from order_table where order_id = ?\";\n Order order = getOrder(sql, 4);\n System.out.println(order);\n }", "NjOrderWork2 selectByPrimaryKey(String id);", "TestEntity selectByPrimaryKey(Integer id);", "List<PmKeyDbObj> selectByExample(PmKeyDbObjExample example);", "List<OrderDetail> selectByExample(OrderDetailExample example);", "List<TbaDeliveryinfo> selectByExample(TbaDeliveryinfoCriteria example);", "public test_user getTestUserById() {\r\n return testUserDAO.selectByPrimaryKey(1);\r\n }", "List<SvcStoreBeacon> selectByExample(SvcStoreBeaconExample example);", "List<TCar> selectByExample(TCarExample example);", "List<SmsEmployeeTeam> selectByExample(SmsEmployeeTeamExample example);", "PrescriptionVerifyRecordDetail selectByPrimaryKey(String id);", "List<Ltsprojectpo> selectByExample(LtsprojectpoExample example);", "List<TbExpressTrace> selectByExample(TbExpressTraceExample example);", "List<ShopAccount> selectByExample(ShopAccountExample example);", "List<NeeqCompanyAccountingFirmOnline> selectByExample(NeeqCompanyAccountingFirmOnlineExample example);", "List<ComplainNoteDO> selectByExample(ComplainNoteDOExample example);", "List selectByExample(PaymentTradeExample example);", "SysType selectByPrimaryKey(Integer id);", "public o selectById(long id);", "List<JzAct> selectByExample(JzActExample example);", "List<Basicinfo> selectByExample(BasicinfoCriteria example);", "AppStandard selectById(String id);", "List<PurchasePayment> selectByExample(PurchasePaymentExample example);", "TbSerdeParams selectOneByExample(TbSerdeParamsExample example);", "List<TblBTSSysFunctionDO> selectByExample(TblBTSSysFunctionDOExample example);", "List<UserPonumberGoods> selectByExample(UserPonumberGoodsExample example);", "List<RegsatUser> selectByExample(RegsatUserExample example);", "@Override\n\tpublic TestPoEntity selectById(Integer pk) {\n\t\treturn null;\n\t}", "List<SwmsStockOutRecordDetail> selectByExample(SwmsStockOutRecordDetailExample example);", "List<UserInfoUserinfo> selectByExample(UserInfoUserinfoExample example);", "List<Transaction> selectByExample(TransactionExample example);", "public interface ITestUserService {\n\n TestUserVo selectByPrimaryKey(Long id);\n}", "List<CmstTransfdevice> selectByExample(CmstTransfdeviceExample example);", "List<Tourst> selectByExample(TourstExample example);", "List<Tipologia> selectByExample(TipologiaExample example);", "SwipersDO selectByPrimaryKey(Integer id);", "public Triplet selectSingle(int id) throws DAOException;", "List<UUser> selectByExample(UUserExample example);", "List<SysId> selectByExample(SysIdExample example);", "List<SmsCleanBagLine> selectByExample(SmsCleanBagLineExample example);", "List<Notifiction> selectByExample(NotifictionExample example);", "EtpBase selectByPrimaryKey(String id);", "LitemallUserFormid selectOneByExample(LitemallUserFormidExample example);", "TempletLink selectByPrimaryKey(String id);", "TbFreightTemplate selectByPrimaryKey(Long id);", "@Override\n\tpublic Object selectOne(Object pt_idx) {\n\t\t\n\t\tPartyVo vo = session.selectOne(\"party.select_one_party\",pt_idx);\n\t\t\n\t\treturn vo;\n\t}", "Ad selectOneByExample(AdExample example);", "List<PublicDoctorNotice> selectByExample(PublicDoctorNoticeExample example);", "List<Movimiento> selectByExample(MovimientoExample example);", "List<Drug_OutWarehouse> selectByExample(Drug_OutWarehouseExample example);", "List<SysTeam> selectByExample(SysTeamExample example);", "List<CliStaffProject> selectByExample(CliStaffProjectExample example);", "List<MedicalOrdersExecutePlan> selectByExample(MedicalOrdersExecutePlanExample example);", "List<CxBasStaff> selectByExample(CxBasStaffExample example);", "List<UserOperateProject> selectByExample(UserOperateProjectExample example);", "List<NjOrderWork2> selectByExample(NjOrderWork2Example example);", "List<BasicInfoPrecursorProcessType> selectByExample(BasicInfoPrecursorProcessTypeExample example);", "List<SurveystatusPkey> selectByExample(SurveystatusPkeyExample example);", "List<TbSnapshot> selectByExample(TbSnapshotExample example);", "List<PineAlarm> selectByExample(PineAlarmExample example);", "@Override\n\tpublic List<TestDTO> getTest() {\n\t\t\n\t\t\n\t\treturn sessionTemplate.selectList(\"get_test\");\n\t}", "TestEnum selectByPrimaryKey(String id);", "List<TSubjectInfo> selectByExample(TSubjectInfoExample example);", "List<ClOrderInfo> selectByExample(ClOrderInfoExample example);", "ComplainNoteDO selectByPrimaryKey(Long id);" ]
[ "0.7176131", "0.661703", "0.6557233", "0.65056247", "0.6504089", "0.64846903", "0.641263", "0.6399761", "0.6396022", "0.6384737", "0.6362829", "0.633049", "0.63237613", "0.6322953", "0.63206834", "0.6293734", "0.6291435", "0.6290559", "0.62779146", "0.62747383", "0.6265793", "0.6265652", "0.6244299", "0.6241628", "0.6238244", "0.6234213", "0.62200695", "0.6219779", "0.6216336", "0.6212983", "0.62117845", "0.62026316", "0.62023634", "0.61707586", "0.61618143", "0.6160132", "0.61512864", "0.6150097", "0.61438733", "0.61328965", "0.6113791", "0.61121756", "0.61111504", "0.61060774", "0.6098796", "0.6088825", "0.60869366", "0.60837525", "0.6075042", "0.607082", "0.6065591", "0.6065305", "0.6060088", "0.6045391", "0.60351324", "0.6031201", "0.6030508", "0.60129064", "0.5997221", "0.5995521", "0.59938675", "0.5991604", "0.5988725", "0.59864336", "0.5972322", "0.5970074", "0.5968694", "0.5964684", "0.5952461", "0.5948954", "0.5945104", "0.5939976", "0.5926956", "0.59243584", "0.5914802", "0.5912855", "0.5911399", "0.59085995", "0.59062386", "0.59057844", "0.59038824", "0.58982086", "0.58969474", "0.5890824", "0.588707", "0.5884131", "0.5877704", "0.5874507", "0.5874044", "0.5872677", "0.5872457", "0.5872125", "0.58710325", "0.5870072", "0.58670616", "0.58447385", "0.5841563", "0.583928", "0.5834728", "0.5823809", "0.58235013" ]
0.0
-1
Takes filename and number of clusters as input from user. And while total clusters is not equal to required number of clusters, we merge two and finally it prints the clusters and jacard coeefficient for output set.
public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter file name"); String file = sc.nextLine(); fileRead(file); System.out.println("Enter required number of clusters"); reqNoOfClusters =Integer.parseInt(sc.nextLine()); makeInitialDistanceMatrix(); while(totalCluster != reqNoOfClusters) { mergeNext(); } printClusters(); double jac = getJaccard(); System.out.println("Jaccard coefficient = "+jac); // double rand = getRand(); // System.out.println("rand = "+rand); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int run(String[] args) throws Exception {\n\t\t\n\t\tint zipNumLines = -1;\n\n\t\tList<String> otherArgs = new ArrayList<String>();\n\t\tJob job = new Job(getConf(), \"merge-clusters\");\n\t\tConfiguration conf = job.getConfiguration();\n\t\tfor (int i = 0; i < args.length; ++i) {\n\t\t\ttry {\n\t\t\t\tif (\"--zip-num-output\".equals(args[i])) {\n\t\t\t\t\tzipNumLines = Integer.parseInt(args[++i]);\n\t\t\t\t} else if (\"--max-map-attempts\".equals(args[i])) {\n\t\t\t\t\tconf.setInt(\"mapred.map.max.attempts\",Integer.parseInt(args[++i]));\n\t\t\t\t} else {\n\t\t\t\t\totherArgs.add(args[i]);\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException except) {\n\t\t\t\tSystem.out.println(\"ERROR: Integer expected instead of \"\n\t\t\t\t\t\t+ args[i]);\n\t\t\t\treturn printUsage();\n\t\t\t} catch (ArrayIndexOutOfBoundsException except) {\n\t\t\t\tSystem.out.println(\"ERROR: Required parameter missing from \"\n\t\t\t\t\t\t+ args[i - 1]);\n\t\t\t\treturn printUsage(); // exits\n\t\t\t}\n\t\t}\n\n\t\t// Make sure there are at least 3 parameters left: split target input input ...\n\t\tif (otherArgs.size() < 3) {\n\t\t\tSystem.out.println(\"ERROR: Wrong number of parameters: \"\n\t\t\t\t\t+ otherArgs.size() + \" instead of 2.\");\n\t\t\treturn printUsage();\n\t\t}\n\n\t\tMergeClusterRangesInputFormat.setSplitPath(conf, otherArgs.get(0));\n\t\tFileOutputFormat.setOutputPath(job, new Path(otherArgs.get(1)));\n\t\tString[] clusters = new String[otherArgs.size() - 2];\n\t\tfor(int i = 2; i < otherArgs.size(); i++) {\n\t\t\tclusters[i-2] = otherArgs.get(i);\n\t\t}\n\t\tMergeClusterRangesInputFormat.setClusterPaths(conf, clusters);\n\t\t\n\t\tjob.setInputFormatClass(MergeClusterRangesInputFormat.class);\n\t\tjob.setJarByClass(MergeClusterRangesJob.class);\n\n\t\tjob.setMapperClass(SimpleTextMapper.class);\n\n\t\tjob.setOutputKeyClass(Text.class);\n\t\tjob.setOutputValueClass(Text.class);\t\t\n\t\t\n\t\tif(zipNumLines != -1) { \n\t\t\tSystem.err.format(\"INFO: zipnum count: %d\\n\",zipNumLines);\n\t\t\tZipNumOutputFormat.setZipNumLineCount(conf, zipNumLines);\n\t\t}\n\t\tjob.setOutputFormatClass(ZipNumOutputFormat.class);\n\n\t\tjob.setNumReduceTasks(0);\n\n\t\treturn (job.waitForCompletion(true) ? 0 : 1);\n\t}", "public static void main(String[] args) throws IOException{\n Scanner f = new Scanner(System.in);\n //BufferedReader f = new BufferedReader(new FileReader(\"uva.in\"));\n //BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n while(true) {\n int C = f.nextInt();\n int R = f.nextInt();\n if(C == 0 && R == 0) {\n break;\n }\n HashMap<String,Integer> getIndex = new HashMap<>();\n for(int i = 0; i < C; i++) {\n getIndex.put(f.next(),i);\n }\n int[] leaderIds = new int[C];\n int[] groupSizes = new int[C];\n for(int i = 0; i < C; i++) {\n leaderIds[i] = i;\n groupSizes[i] = 1;\n }\n for(int i = 0; i < R; i++) {\n int p = getIndex.get(f.next());\n int q = getIndex.get(f.next());\n if(root(leaderIds,p) != root(leaderIds,q)) {\n union(leaderIds,groupSizes,p,q);\n }\n }\n int max = 0;\n for(int i = 0; i < C; i++) {\n int p = root(leaderIds,i);\n max = Math.max(max,groupSizes[p]);\n }\n out.println(max);\n }\n f.close();\n out.close();\n }", "public void mergefiles()\n {\n LinkedHashMap<String, Integer> count = new LinkedHashMap<>();\n for(int i=0;i<files_temp.size();i++)\n {\n \t\t\n //System.out.println(\"here in merge files for\");\n \t//int index = files_temp.get(i).lastIndexOf(\"\\\\\");\n\t\t\t//System.out.println(index);\n \tSystem.out.println(files_temp.get(i));\n File file = new File(files_temp.get(i)+\"op.txt\");\n Scanner sc;\n try {\n //System.out.println(\"here in merge files inside try\");\n sc = new Scanner(file);\n sc.useDelimiter(\" \");\n while(sc.hasNextLine())\n {\n //System.out.println(\"Inwhile \");\n List<String> arr = new ArrayList<String>();\n arr=Arrays.asList(sc.nextLine().replaceAll(\"[{} ]\", \"\").replaceAll(\"[=,]\", \" \").split(\" \"));\n //System.out.println(arr.get(0));\n for(int j=0;j<arr.size()-1;j=j+2) \n {\n System.out.println(arr.get(j));\n if(arr.get(j).length()!=0 && arr.get(j+1).length()!=0)\n {\n if (count.containsKey(arr.get(j))) \n {\n int c = count.get(arr.get(j));\n count.remove(arr.get(j));\n count.put(arr.get(j),c + Integer.valueOf(arr.get(j+1)));\n }\n else \n {\n count.put(arr.get(j),Integer.valueOf(arr.get(j+1)));\n }\n }\n }\n }\n }\n catch(Exception E) \n {\n System.out.println(E);\n }\n }\n //System.out.println(count);\n count.entrySet()\n .stream()\n .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))\n .forEachOrdered(x -> sorted.put(x.getKey(), x.getValue()));\n System.out.println(sorted);\n PrintWriter writer;\n\t\ttry {\n\t\t\twriter = new PrintWriter(\"results.txt\", \"UTF-8\");\n\t\t\tIterator it = sorted.entrySet().iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tMap.Entry pairs = (Map.Entry) it.next();\n\t\t\t\t\twriter.println(pairs.getValue() + \" : \" + pairs.getKey());\n\t\t\t\t\tthis.result.println(pairs.getValue() + \" : \" + pairs.getKey());\n\t\t\t}\n\t\t writer.close();\n\t\t}\n catch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n }", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "public static void main(String[] args) throws IOException{\n\t\t\r\n\t\tBufferedReader label = new BufferedReader(new FileReader(\"C:/PISTON/gold_standard.txt\"));\r\n\t\tBufferedReader label2 = new BufferedReader(new FileReader(\"C:/PISTON/gold_standard.txt\"));\r\n\t\tBufferedReader table = new BufferedReader(new FileReader(\"C:/PISTON/LDAGibbs_284_TopicProbabilities.txt\"));\r\n\t\tBufferedReader table2 = new BufferedReader(new FileReader(\"C:/PISTON/LDAGibbs_284_TopicProbabilities.txt\"));\r\n\t\tBufferedWriter output = new BufferedWriter(new FileWriter(\"C:/PISTON/assigned_class.txt\"));\r\n\r\n\t\tint label_loop = 0;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tString line = label.readLine();\r\n\t\t\tif(line == null) break;\r\n\t\t\tlabel_loop++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tString [] new_label = new String [label_loop];\r\n\t\t\r\n\t\tfor(int i=0; i<label_loop; i++){\r\n\t\t\t\r\n\t\t\tString line = label2.readLine();\r\n\t\t\tnew_label[i] = line;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint table_loop = 0;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tString line = table.readLine();\r\n\t\t\tif(line == null) break;\r\n\t\t\ttable_loop++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tString [] new_table = new String [table_loop];\r\n\t\tString [] assigned_label = new String [table_loop];\r\n\t\t\r\n\t\tfor(int i=0; i<table_loop; i++){\r\n\t\t\t\r\n\t\t\tString line = table2.readLine();\r\n\t\t\tnew_table[i] = line;\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tfor(int i=0; i<table_loop; i++){\r\n\t\t\t\r\n\t\t\tint temp = 0;\r\n\t\t\t\r\n\t\t\tString [] split_topic = new_table[i].split(\"\\t\");\r\n\t\t\t\r\n\t\t\tfor(int j=0; j<label_loop; j++){\r\n\t\t\t\t\r\n\t\t\t\tif(split_topic[3].equals(new_label[j])){\r\n\r\n\t\t\t\t\ttemp = 1;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(temp==1){\r\n\t\t\t\t\r\n\t\t\t\tassigned_label[i] = \"T\";\r\n\t\t\t\toutput.flush();\r\n\t\t\t\toutput.write(assigned_label[i]+\"\\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\tassigned_label[i] = \"F\";\r\n\t\t\t\toutput.flush();\r\n\t\t\t\toutput.write(assigned_label[i]+\"\\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tlabel.close();\r\n\t\tlabel2.close();\r\n\t\ttable.close();\r\n\t\ttable2.close();\r\n\t\toutput.close();\r\n\t\t\r\n\t\tSystem.out.println(\"Process finished.\");\t\r\n\t\t\r\n\t}", "public static void main(String[] args) throws IOException,MasterNotRunningException, ZooKeeperConnectionException, URISyntaxException{\nString file1= args[0].substring(2, args[0].length()); \nString file2= args[1].substring(2, args[1].length()); \nint Kjion = Integer.parseInt(args[2].substring(6, 7)); \nint jionK = Integer.parseInt(args[2].substring(9, 10));\nString ostr = args[3].substring(4, args[3].length()); \nString astr[] = ostr.split(\",\");\n\nint osum=astr.length;\nint rsum = 0;\nint ssum = 0;\nint [] rnum = new int[20];\nint [] snum = new int[20];\n\nfor(int i=0; i<astr.length ; i++ )\n{\nif((astr[i].substring(0,1)).equals(\"R\")){\nrnum[rsum]=Integer.parseInt(astr[i].substring(1,astr[i].length()));\nrsum++;\n}\n}\nfor(int j=0; j<astr.length ; j++ )\n{\nif((astr[j].substring(0,1)).equals(\"S\")){\nsnum[ssum]=Integer.parseInt(astr[j].substring(1,astr[j].length()));\nssum++;\n}\n}\n//data to buffer\nConfiguration conf = new Configuration();\nFileSystem fs = FileSystem.get(URI.create(file1), conf);\nFSDataInputStream in_stream = fs.open(new Path(file1));\nBufferedReader in = new BufferedReader(new InputStreamReader(in_stream));\n\nConfiguration conf3 = new Configuration();\nFileSystem fs3 = FileSystem.get(URI.create(file1), conf3);\nFSDataInputStream in_stream3 = fs3.open(new Path(file1));\nBufferedReader in3 = new BufferedReader(new InputStreamReader(in_stream3));\n\nConfiguration conf2 = new Configuration();\nFileSystem fs2 = FileSystem.get(URI.create(file2), conf2);\nFSDataInputStream in_stream2 = fs2.open(new Path(file2));\nBufferedReader in2 = new BufferedReader(new InputStreamReader(in_stream2));\n\n\n/*start put file1 data to hashtable ht\n@s all data of file1 \n@s2 all data of file2\n@aline make sure zhe clom sums \n*/\n\nString s;\nString s2; \nString aline[]=in3.readLine().split(\"\\\\|\");\nHashtable ht = new Hashtable();\nString linkstr=\"\";\nString oldstr=\"\";\nwhile ((s=in.readLine())!=null) {\n\t\n\taline=s.split(\"\\\\|\");\n\toldstr=\"\";\n\tlinkstr=\"\";\n\t\n\t if(ht.containsKey(aline[Kjion]))\n\t{\n\t\toldstr = ht.get(aline[Kjion]).toString();\n\t\n\t}\n\n\tfor(int k=0; k<rsum; k++)\n\t{\n\n\t\tif(linkstr==\"\")\n\t\t{linkstr=aline[rnum[k]];}\n\t\telse\n\t\t{linkstr=linkstr+\"&\"+aline[rnum[k]];}\n\t}\n\n\tif(oldstr!=\"\"){\n\tlinkstr = oldstr+\"|\"+linkstr;}\n\t\n\t\n\tht.put(aline[Kjion],linkstr);\n\n}\n// start write\n\n Logger.getRootLogger().setLevel(Level.WARN);\n\n // create table descriptor\n String tableName= \"result\";\n HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));\n\n // create column descriptor\n HColumnDescriptor cf = new HColumnDescriptor(\"res\");\n htd.addFamily(cf);\n\n // configure HBase\n Configuration configuration = HBaseConfiguration.create();\n HBaseAdmin hAdmin = new HBaseAdmin(configuration);\n\n if (hAdmin.tableExists(tableName)) {\n System.out.println(\"Table already exists\");\n\thAdmin.disableTable(tableName);\n\thAdmin.deleteTable(tableName);\n\tSystem.out.println(\"The old Table has delete!\");\n }\n \n hAdmin.createTable(htd);\n System.out.println(\"table \"+tableName+ \" created successfully\");\n \n hAdmin.close();\n\nHTable table = new HTable(configuration,tableName);\n\n/*start join ht join s2\n@splitstr every one in R\n@flaght the is or not same of R\n@aline make sure zhe clom sums the max same is 1000\n@htsum the same num of all\n*/\n\n\nString pri;\nString []splitstr = new String[1000];\nHashtable flaght = new Hashtable();\nint htsum = 0;\nString flagstr=\"\";\n\nwhile ((s2=in2.readLine())!=null) {\naline=s2.split(\"\\\\|\");\nif(ht.containsKey(aline[jionK]))\n{\n\t\n\n\tsplitstr=(ht.get(aline[jionK])).toString().split(\"\\\\|\");\n\nfor(int l=0 ; l<splitstr.length ; l++ ){\n\n\tif(flaght.containsKey(aline[jionK]))\n\t{\n\thtsum = Integer.parseInt(flaght.get(aline[jionK]).toString());\n\t}\n\telse\n\t{\n\thtsum = 0;\n\t}\n\n\tif(htsum==0)\n\t{flagstr=\"\";}\n\telse\n\t{flagstr=\".\"+Integer.toString(htsum);}\n\t\n\tfor(int y=0;y<rsum;y++)\n\t{\n\t\tPut put = new Put(aline[jionK].getBytes());\n \t\tput.add(\"res\".getBytes(),(\"R\"+Integer.toString(rnum[y])+flagstr).getBytes(),splitstr[l].split(\"&\")[y].getBytes());\n \t\ttable.put(put);}\n\n\tfor(int z=0;z<ssum;z++){\n\n\t\tPut put2 = new Put(aline[jionK].getBytes());\n\t\tput2.add(\"res\".getBytes(),(\"S\"+Integer.toString(snum[z])+flagstr).getBytes(),aline[z].getBytes());\n \t\ttable.put(put2);}\n\thtsum = htsum+1;\n\tflaght.put(aline[jionK],Integer.toString(htsum));\n\t\n}\t\t\n \t\t\n\n\n\n}\n\n\n}\n\ntable.close();\nSystem.out.println(\"put successfully\");\nin.close();\nfs.close();\n\n}", "public VCFManager(String inputVcf_file,NaivePedcaPlotter n) throws FileNotFoundException, InterruptedException {\n\t\tSystem.out.println(\"cluster 1 size:\"+n.LENGTH_OF_CLUSTER_ONE_CONTIGS+\" cluster 2 size:\"+n.LENGTH_OF_CLUSTER_TWO_CONTIGS);\n\t\tploestPlotter=n;\n\t\tFile pilonOutFolder = new File(outputFileRoot);\n\t\tpilonOutFolder.mkdirs();\n\t\tvcfExtractor(inputVcf_file);\n\t}", "public void displayResults() {\n\t\tcreateCluster();\n\t\tassignClusterID();\n\t\tSystem.out.println(iterations);\n\t\tWriter writer;\n\t\ttry {\n\t\t\twriter = new FileWriter(\"/Users/saikalyan/Documents/ClusterResult_kmeans.txt\");\n\t\t\tfor (int key : labelsMap.keySet()) {\n\t\t\t\tclusterResultsList.add(clusterIdMap.get(labelsMap.get(key)));\n\t\t\t\twriter.write(String.valueOf(clusterIdMap.get(labelsMap.get(key))));\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t\tSystem.out.println(key + \" : \" + clusterIdMap.get(labelsMap.get(key)));\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tExternalValidator extValidation = new ExternalValidator(count, groundTruthList, clusterResultsList);\n\n\t\tfloat res = extValidation.getCoefficient();\n\t\tSystem.out.println(\"Rand Index------------\" + res);\n\n\t\tfloat jaccard = extValidation.getJaccardCoeff();\n\t\tSystem.out.println(\"Jaccard co-efficient------------\" + jaccard);\n\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString short_1_A_Path = args[0];\n\t\tString short_1_B_Path = args[1];\n\t\tString OutPutPath = args[2];\n\t\tString DataSetName = args[3];\n\t\ttry {\n\t\t\tint Num=0;\n\t\t\tString readtemp1=\"\";\n\t\t\tString readtemp2=\"\";\n\t\t\tint Short1_NumLeft=0;\n\t\t\tint Short1_NumRight=0;\n\t\t\tString encoding = \"utf-8\";\n\t\t\tFile file1 = new File(short_1_A_Path);\n\t\t\tFile file2 = new File(short_1_B_Path);\n\t\t\tif (file1.exists()&&file2.exists()) {\n\t\t\t\tInputStreamReader read1 = new InputStreamReader(new FileInputStream(file1), encoding);\n\t\t\t\tInputStreamReader read2 = new InputStreamReader(new FileInputStream(file2), encoding);\n\t\t\t\tBufferedReader bufferedReader1 = new BufferedReader(read1);\n\t\t\t\tBufferedReader bufferedReader2 = new BufferedReader(read2);\n\t\t\t\twhile ((bufferedReader1.readLine())!=null && (bufferedReader2.readLine())!= null)\n\t\t\t\t{\n\t\t\t\t\t//The second line.\n readtemp1=bufferedReader1.readLine();\n readtemp2=bufferedReader2.readLine();\t\t\t\t\t\t\n\t\t\t\t //Write left.\n\t\t\t\t\tFileWriter writer1 = new FileWriter(OutPutPath + DataSetName+\".left.fasta\",true);\n\t\t\t\t\twriter1.write(\">\"+(Short1_NumLeft++)+\"\\n\"+readtemp1+\"\\n\");\n\t\t\t\t\twriter1.close();\n\t\t\t\t\t//Write right.\t\n\t\t\t\t\tFileWriter writer2 = new FileWriter(OutPutPath + DataSetName+\".right.fasta\",true);\n\t\t\t\t\twriter2.write(\">\"+(Short1_NumRight++)+\"\\n\"+readtemp2+\"\\n\");\n\t\t\t\t\twriter2.close();\n\t\t\t\t\t//Write all.\t\n\t\t\t\t\tFileWriter writer3 = new FileWriter(OutPutPath + DataSetName+\".fasta\", true);\n\t\t\t\t\twriter3.write(\">\"+(Num)+\"\\n\"+readtemp1 +\"\\n\"+\">\"+(Num)+\"\\n\"+readtemp2+\"\\n\");\n\t\t\t\t\twriter3.close();\n\t\t\t\t\t//The third line.\n\t\t\t\t\tbufferedReader1.readLine();\n\t\t\t\t\tbufferedReader2.readLine();\n\t\t\t\t //The fourth line.\n\t\t\t\t\tbufferedReader1.readLine();\n\t\t\t\t\tbufferedReader2.readLine();\n\t\t\t\t}\n\t\t\t\tbufferedReader1.close();\n\t\t\t\tbufferedReader2.close();\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tSystem.out.println(\"File is not exist!\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error liaoxingyu\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void printClusters() {\n\t\tint count = 0;\n\t\tdouble[][] matrix = null;\n\t\tfor(String s:allClusters) {\n\t\t\tcount++;\n\t\t\tSystem.out.println(s);\n\t\t\tString points[] = s.split(\",\");\n\t\t\tmatrix = new double[points.length][cols];\n\t\t\tint k=0;\n\t\t\tfor(String p:points) {\n\t\t\t\tresultClusters.put(Integer.parseInt(p), count);\n\t\t\t\tArrayList<Double> features = geneAttributes.get(Integer.parseInt(p));\n\t\t\t\tdouble[] arr = new double[cols];\n\t\t\t\tfor(int i=0;i<features.size();i++)\n\t\t\t\t\tarr[i] = features.get(i);\n\t\t\t\tmatrix[k++] = arr;\n\t\t\t}\n\t\t\tpca_list.add(matrix);\n\t\t}\n\t\tPlot plot = new Plot((ArrayList<double[][]>) pca_list, \"HAC\");\n\t\tplot.plot();\n\t}", "public static void main(String[] args) throws IOException{\n Tree tree = new Tree(new DoubleString(0, \"M\"));\n \n for(int x = 0; x < fileCount; x ++) {\n \t//inserts every line from every input file into the tree\n \tBufferedReader input = new BufferedReader(new FileReader(x + \".txt\"));\n \t\n \tfor(int y = 0; y < 5; y ++) {\n \t\tinput.readLine();\n \t}\n \t\n \tString line = input.readLine();\n \t\n \twhile(line != null) {\n \t\tif(line.contains(\"----\")) {\n \t\t\tbreak;\n \t\t}\n \t\t\n \t\ttree.insert(new DoubleString(Double.parseDouble(betweenPipes(line, 3).trim().substring(0, betweenPipes(line, 3).trim().length() - 1)), betweenPipes(line, 2).trim()));\n \t\tline = input.readLine();\n \t}\n \t\n \tinput.close();\n }\n \n //converts the tree into an array and sorts the array\n DoubleString[] array = Tree.toArray(tree);\n DoubleString.sort(array, true);\n //creates (or overwrites, if it's already created) the output file\n PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(\"output.txt\")));\n output.println(\"[hide=\" + format + \" stats)][code]Combined usage for \" + format + \" stats)\\n\" + \n \t\t\"+ ---- + ------------------ + ------- +\\n\" + \n \t\t\"| Rank | Pokemon | Percent |\\n\" + \n \t\t\"+ ---- + ------------------ + ------- +\");\n \n for(int i = 0; i < array.length; i ++) {\n \t//divides every stat from the array by the number of months and prints it into the output file\n \tarray[i].divideEquals(fileCount);\n \toutput.print(\"| \");\n \tString rank = i + \"\";\n \t\n \twhile(rank.length() < 3) {\n \t\trank = ' ' + rank;\n \t}\n \t\n \toutput.print(rank + \" | \");\n \tString name = array[i].toString();\n \t\n \twhile(name.length() < 19) {\n \t\tname = name + ' ';\n \t}\n \t\n \toutput.print(name + \"| \");\n \tString integer = (array[i].getNumber() + \"\").substring(0, (array[i].getNumber() + \"\").indexOf('.'));\n \tString fraction = (array[i].getNumber() + \"000\").substring((array[i].getNumber() + \"\").indexOf('.')).substring(0, 4);\n \t\n \twhile(integer.length() < 2) {\n \t\tinteger = ' ' + integer;\n \t}\n \t\n \toutput.println(integer + fraction + \"% |\");\n }\n \n //line of code I have to include to prevent weird things\n output.close();\n\t}", "public void writeClusters(List<Cluster> clusters)\n {\n deleteAllFileFolders();\n \n \n // root elements\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"ClusterInfo\");\n doc.appendChild(rootElement);\n Element numClusters=doc.createElement(\"NumOfClusters\");\n numClusters.appendChild(doc.createTextNode(clusters.size()+\"\"));\n rootElement.appendChild(numClusters); \n// Element clusterelem=doc.createElement(\"cluster\");\n int attribCnt=1;\n \n String writeText = \"\";\n for (Cluster cluster : clusters) {\n \n Element clusterelem=doc.createElement(\"cluster\");\n rootElement.appendChild(clusterelem);\n// Attr attr=doc.createAttribute(\"id\");\n// attr.setValue(\"\"+attribCnt++);\n// clusterelem.setAttributeNode(attr);\n clusterelem.setAttribute(\"id\", \"\"+attribCnt++);\n \n Index Firstindex = cluster.getFirstIndex();\n List<Index> indexes = cluster.getIndexLists();\n double rSpec = ((Double) Firstindex.getMeanRGB().get(0)).doubleValue();\n double gSpec = ((Double) Firstindex.getMeanRGB().get(1)).doubleValue();\n double bSpec = ((Double) Firstindex.getMeanRGB().get(2)).doubleValue();\n \n Element rspec=doc.createElement(\"rspec\");\n rspec.appendChild(doc.createTextNode(rSpec+\"\"));\n clusterelem.appendChild(rspec);\n \n Element gspec=doc.createElement(\"gspec\");\n gspec.appendChild(doc.createTextNode(gSpec+\"\"));\n clusterelem.appendChild(gspec);\n \n Element bspec=doc.createElement(\"bspec\");\n bspec.appendChild(doc.createTextNode(bSpec+\"\"));\n clusterelem.appendChild(bspec);\n \n \n String fileNames = \"\\n\\t\\t\";\n for (Index index : indexes) {\n fileNames += index.getFilePath() + \";\\n\\t\\t\";\n }\n// String record = \"@\" + rSpec + \":\" + gspec + \":\" + bspec + \":\" + fileNames + \"#\";\n// writeText += record;\n \n Element imgSrc=doc.createElement(\"ImageSrc\");\n imgSrc.appendChild(doc.createTextNode(fileNames+\"\"));\n clusterelem.appendChild(imgSrc);\n \n }\n \n WriteXML(doc);\n }", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException, SQLException, ClassNotFoundException\n\t{\n\t if (args.length != 4)\n\t {\n\t System.err.println(\"Needs 4 args\");\n\t\t return; \n\t }\n\t \n String dir = args[0];\n\t\tint minTokens = Integer.parseInt(args[1]);\n\t\tString outFolder = args[2];\n\t\tString outFilename = args[3];\n\t\t\n\t\tfinal long startTime = System.currentTimeMillis();\n\t\t\n\t\t// make a list of all files \n\t\tFile folder = new File(dir);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tList<File> files = new ArrayList<File>(Arrays.asList(listOfFiles));\n\t\tSystem.out.println(String.format(\"%d files in dir %s\", files.size(), dir));\n\n\t\t// configure CPD\n\t\tCPDConfiguration config = new CPDConfiguration();\n\t\tconfig.setLanguage(LanguageFactory.createLanguage(\"Java\"));\n\t\tconfig.setMinimumTileSize(minTokens);\n\t\tconfig.setEncoding(\"UTF-8\");\n\t\tconfig.setRenderer(new CSVRenderer());\n\t\t/* Has no effect\n\t\tconfig.setIgnoreAnnotations(true);\n\t\tconfig.setIgnoreIdentifiers(true);\n\t\tconfig.setIgnoreLiterals(true);*/\n\t\t\n\t\tStringBuilder dupOut = new StringBuilder();\n\t\tStringBuilder errOut = new StringBuilder();\n\t\tint totalCnt = 0;\n\t\tArrayList<Match> matchList = new ArrayList<>();\n\n\t\tfor(File file: files)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tmatchList.clear();\n\t\t\t\t\n\t\t\t\t// run CPD on this file\n\t\t\t\tCPD cpd = new CPD(config);\n\t\t\t\tcpd.add(file);\n\t\t\t\tcpd.go();\n\t\t\t\t\n\t\t\t\t// collect results\n\t\t\t\tIterator<Match> it = cpd.getMatches();\n\t\t\t\twhile(it.hasNext())\n\t\t\t\t{\n\t\t\t\t\tMatch m = it.next();\n\t\t\t\t\tmatchList.add(m);\n\t\t\t\t}\n\t\t\t\tif (!matchList.isEmpty()) // write to output\n\t\t\t\t{\n\t\t\t\t\tString csv = config.getRenderer().render(cpd.getMatches());\n\t\t\t\t\tdupOut.append(csv.substring(csv.indexOf('\\n') + 1)); // remove header\n\t\t\t\t\ttotalCnt += matchList.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\terrOut.append(file.getName() + \",\" + e.getMessage() + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// write output to files\n\t\ttry\n\t\t{\n\t\t\tString name = folder.getName();\n\t\t\tnew FileReporter(new File(outFolder,outFilename)).report(dupOut.toString()); //name + \"-cpd\" + minTokens + \".csv\"\n\t\t\tnew FileReporter(new File(outFolder,name + \"-cpd\" + minTokens + \"-err.csv\")).report(errOut.toString());\n\t\t} catch (ReportException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Total nr of dups found \" + totalCnt);\n\t\t\n\t\tfinal long endTime = System.currentTimeMillis();\n\t\tSystem.out.println(\"Total execution time in s: \" + (endTime - startTime)/1000 );\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tHashMap<String,Integer> hm = new HashMap<String,Integer>();\n\t\tint index = 1;\n\t\ttry {\n\t\t\t\n\t\t\tint[][] adjmatrix = new int[760][760];\n\t\t\t\n\t\t\tfor(int i=1;i<=750;i++)\n\t\t\t{\n\t\t\t\tfor(int j=1;j<=750;j++)\n\t\t\t\t{\n\t\t\t\t\tadjmatrix[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tFile file2 = new File(\"/home/swijal/Desktop/social/kavanamutual.txt\");\n\t\t\tFileReader fileReader2 = new FileReader(file2);\n\t\t\tBufferedReader bufferedReader2 = new BufferedReader(fileReader2);\n\t\t\t\n\t\t\tFile fout = new File(\"/home/swijal/Desktop/social/kavana_mapping_out.txt\");\n\t\t\tFileOutputStream fos = new FileOutputStream(fout);\n\t\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));\n\t\t\t\n\t\t\tFile fout1 = new File(\"/home/swijal/Desktop/social/adjmat_kavana.txt\");\n\t\t\tFileOutputStream fos1 = new FileOutputStream(fout1);\n\t\t\tBufferedWriter bw1 = new BufferedWriter(new OutputStreamWriter(fos1));\n\t\t\t\n\t\t\tFile file = new File(\"/home/swijal/Desktop/social/numbering_kavana.txt\");\n\t\t\tFileReader fileReader = new FileReader(file);\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tString line;\n\t\t\tString friend1 = \"\";\n\t\t\tString friend2 = \"\";\n\n\t\t\t//numbering\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tif(!hm.containsKey(line))\n\t\t\t\t{\n\t\t\t\t\thm.put(line, index);\n\t\t\t\t\tbw.write(line+\", \"+index);\n\t\t\t\t\tbw.newLine();\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(hm.size());\n\t\t\t//adj matrix\n\t\t\twhile ((line = bufferedReader2.readLine()) != null) {\n\t\t\t\tfriend1 = \"\";\n\t\t\t\tfriend2 = \"\";\n\t\t\t\t\n\t\t\t\tString[] ar=line.split(\",\");\n\t\t\t\t\n\t\t\t\tfriend1 = ar[0];\n\t\t\t\tfriend2 = ar[1];\n\t\t\t\tSystem.out.println(friend1 +\" : \"+ friend2);\n\t\t\t\tint p=0,q=0;\n\t\t\t\t\n\t\t\t\tif(hm.containsKey(friend1))\n\t\t\t\t\tp = hm.get(friend1);\n\t\t\t\t\n\t\t\t\tif(hm.containsKey(friend2))\n\t\t\t\t\tq = hm.get(friend2);\n\t\t\t\t\n\t\t\t\tadjmatrix[p][q] = 1;\n\t\t\t\tadjmatrix[q][p] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i=1;i<=750;i++)\n\t\t\t{\n\t\t\t\tbw1.newLine();\n\t\t\t\tfor(int j=1;j<=750;j++)\n\t\t\t\t{\n\t\t\t\t\tbw1.write(adjmatrix[i][j]+\",\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*for(int i=0;i<750;i++)\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tfor(int j=0;j<750;j++)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(adjmatrix[i][j]+ \" \");\n\t\t\t\t}\n\t\t\t}*/\n\t\t\tfileReader2.close();\n\t\t\tfileReader.close();\n\t\t\tbw.close();\n\t\t\tbw1.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public static void extractKCoreAndConnectedComponent(double threshold) throws IOException, ParseException, Exception {\n String[] prefixYesNo = {\"yes\", \"no\"};\n for (String prefix : prefixYesNo) {\n\n // Get the number of clusters\n int c = getNumberClusters(RESOURCES_LOCATION + prefix + \"_graph.txt\");\n\n // Get the number of nodes inside each cluster\n List<Integer> numberNodes = getNumberNodes(RESOURCES_LOCATION + prefix + \"_graph.txt\", c);\n\n PrintWriter pw_cc = new PrintWriter(new FileWriter(RESOURCES_LOCATION + prefix + \"_largestcc.txt\")); //open the file where the largest connected component will be written to\n PrintWriter pw_kcore = new PrintWriter(new FileWriter(RESOURCES_LOCATION + prefix + \"_kcore.txt\")); //open the file where the kcore will be written to\n\n // create the array of graphs\n WeightedUndirectedGraph[] gArray = new WeightedUndirectedGraph[c];\n for (int i = 0; i < c; i++) {\n System.out.println();\n System.out.println(\"Cluster \" + i);\n\n gArray[i] = new WeightedUndirectedGraph(numberNodes.get(i) + 1);\n\n // Put the nodes,\n NodesMapper<String> mapper = new NodesMapper<String>();\n gArray[i] = addNodesGraph(gArray[i], i, RESOURCES_LOCATION + prefix + \"_graph.txt\", mapper);\n\n //normalize the weights\n gArray[i] = normalizeGraph(gArray[i]);\n\n AtomicDouble[] info = GraphInfo.getGraphInfo(gArray[i], 1);\n System.out.println(\"Nodes:\" + info[0]);\n System.out.println(\"Edges:\" + info[1]);\n System.out.println(\"Density:\" + info[2]);\n\n // extract remove the edges with w<t\n gArray[i] = SubGraphByEdgesWeight.extract(gArray[i], threshold, 1);\n\n // get the largest CC and save to a file\n WeightedUndirectedGraph largestCC = getLargestCC(gArray[i]);\n saveGraphToFile(pw_cc, mapper, largestCC.in, i);\n\n // Get the inner core and save to a file\n WeightedUndirectedGraph kcore = kcore(gArray[i]);\n saveGraphToFile(pw_kcore, mapper, kcore.in, i);\n }\n\n pw_cc.close();\n pw_kcore.close();\n }\n }", "public void mergeClusters(int[] newCluster) {\n\t\tint i, j, k;\n\t\tif (cluster == null)\n\t\t\treturn;\n\t\ti = 0;\n\t\tfor (j = 0; j < nNodes; j++) {\n\t\t\tk = newCluster[cluster[j]];\n\t\t\tif (k > i)\n\t\t\t\ti = k;\n\t\t\tcluster[j] = k;\n\t\t}\n\t\tnClusters = i + 1;\n\t\tdeleteClusteringStats();\n\t}", "private void CompareTwoFiles() {\n GetCharactersFromProject prog1Char;\r\n KGram prog1KGram;\r\n HashKGram prog1HashKGram;\r\n FingerPrint prog1FingerPrint;\r\n ArrayList<Integer> fingerprintProg1 = null;\r\n\r\n GetCharactersFromProject prog2Char;\r\n KGram prog2KGram;\r\n HashKGram prog2HashKGram;\r\n FingerPrint prog2FingerPrint;\r\n ArrayList<Integer> fingerprintProg2 = null;\r\n\r\n //for the first file\r\n try {\r\n prog1Char = new GetCharactersFromProject(filepath1);\r\n prog1KGram = new KGram(prog1Char.getCharacters());\r\n prog1HashKGram = new HashKGram(prog1KGram.ReturnProcessedKGram());\r\n prog1FingerPrint = new FingerPrint(prog1HashKGram.ReturnProcessedHashes());\r\n fingerprintProg1 = prog1FingerPrint.ReturnFingerPrint();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n //this is for the second file\r\n try {\r\n prog2Char = new GetCharactersFromProject(filepath2);\r\n prog2KGram = new KGram(prog2Char.getCharacters());\r\n prog2HashKGram = new HashKGram(prog2KGram.ReturnProcessedKGram());\r\n prog2FingerPrint = new FingerPrint(prog2HashKGram.ReturnProcessedHashes());\r\n fingerprintProg2 = prog2FingerPrint.ReturnFingerPrint();\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n //this is for jaccard index. Jaccard index will be the basis of similarity\r\n float numSimilarity = 0;\r\n boolean isSimilarEncounter = false;\r\n int sizeFingerprint1 = fingerprintProg1.size();\r\n int sizeFingerprint2 = fingerprintProg2.size();\r\n\r\n for (Integer integer : fingerprintProg1) {\r\n\r\n for (Integer value : fingerprintProg2) {\r\n\r\n\r\n if ((integer.intValue() == value.intValue()) && !isSimilarEncounter) {\r\n numSimilarity++;\r\n isSimilarEncounter = true;\r\n }\r\n\r\n }\r\n\r\n\r\n isSimilarEncounter = false;\r\n }\r\n\r\n SimilarityScore = (numSimilarity / (sizeFingerprint1 + sizeFingerprint2 - numSimilarity));\r\n }", "public static void main(String[] args) throws IOException {\n final ConfigurationObject config = ConfigurationObject.getInstance();\n final String inputFile = config.getInFile(PART, QUESTION), outputFile = config.getOutFile(PART, QUESTION);\n\n final int[] numClusters = { 2, 4, 8, 16, 32, 64, 128 };\n for (int i = 0; i < numClusters.length; i++) {\n final double compressionRatio =\n Kmeans.compressionRatio(inputFile, outputFile + \".min.\" + numClusters[i]) * 100.0;\n\n final double loss = Kmeans.loss(inputFile, outputFile + \".min.\" + numClusters[i]) * 100.0;\n\n System.out.println(\n String.format(\"Using %d clusters, the compression ratio was: %.5f%%%nWith a %.5f%% data loss\",\n numClusters[i], compressionRatio, loss));\n }\n\n }", "public static void main(String[] args) throws IOException\n {\n int numFiles = 13;\n for(int curFileIndex = 0; curFileIndex < numFiles; curFileIndex++)\n {\n String inputOutputNumber = \"\"+curFileIndex;\n if(inputOutputNumber.length()==1)\n inputOutputNumber = \"0\" + inputOutputNumber;\n long startTime = System.nanoTime();\n String fileName = \"Coconut-tree\".toLowerCase() + \"-testcases\";\n String pathToHackerrankTestingFolder = \"/Users/spencersharp/Desktop/HackerrankTesting/\";\n BufferedReader f = new BufferedReader(new FileReader(pathToHackerrankTestingFolder + fileName + \"/input/input\"+inputOutputNumber+\".txt\"));\n PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(pathToHackerrankTestingFolder + fileName + \"/testOutput/testOutput\"+inputOutputNumber+\".txt\")));\n //Comment the end comment after this line\n \n /*\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter writer = new PrintWriter(new BufferedOutputStream(System.out));\n */\n String output = \"\"; //Write all output to this string\n\n //Code here\n String line = f.readLine();\n StringTokenizer st = new StringTokenizer(line);\n \n int n = Integer.parseInt(st.nextToken());\n int v = Integer.parseInt(st.nextToken());\n int t = Integer.parseInt(st.nextToken())-1;\n \n //TreeSet<Double> vals = new TreeSet<Double>();\n \n double minEV = 0.0;\n \n int numPickedSoFar = 0;\n \n double total = 0.0;\n \n for(int i = 0; i < n; i++)\n {\n st = new StringTokenizer(f.readLine());\n \n int p = Integer.parseInt(st.nextToken());\n int c = Integer.parseInt(st.nextToken());\n int fallChance = Integer.parseInt(st.nextToken());\n \n double ev = ((c*v)*(((100-fallChance))/100.0))-(p*(fallChance/100.0));\n \n if(ev > 0.0)\n {\n if(numPickedSoFar < t)\n {\n if(ev < minEV || minEV == 0.0)\n minEV = ev;\n total += ev;\n numPickedSoFar++;\n }\n else if(ev > minEV)\n {\n //out.println(\"ELSE\"+minEV);\n total -= minEV;\n minEV = ev;\n total += ev;\n }\n }\n //out.println(total);\n }\n \n writer.println(total);\n \n writer.close();\n //Code here\n \n //Use open comment before this line\n long endTime = System.nanoTime();\n\n long totalTime = endTime - startTime;\n\n double totalTimeInSeconds = ((double)totalTime)/1000000000;\n\n if(totalTimeInSeconds >= 4.0)\n out.println(\"TIME LIMIT EXCEEDED\");\n else\n {\n boolean isTestOutputCorrect = true;\n BufferedReader correctOutputReader = new BufferedReader(new FileReader(pathToHackerrankTestingFolder + fileName + \"/output/output\"+inputOutputNumber+\".txt\"));\n BufferedReader testOutputReader = new BufferedReader(new FileReader(pathToHackerrankTestingFolder + fileName + \"/testOutput/testOutput\"+inputOutputNumber+\".txt\"));\n String correctOutputLine;\n String testOutputLine;\n\n while((correctOutputLine=correctOutputReader.readLine())!=null && (testOutputLine=testOutputReader.readLine())!=null)\n {\n Double d1 = Double.parseDouble(correctOutputLine);\n Double d2 = Double.parseDouble(correctOutputLine);\n if(Math.abs(d1-d2) > 0.0001)\n {\n isTestOutputCorrect = false;\n break;\n }\n }\n\n if(isTestOutputCorrect)\n out.println(\"TEST \" + inputOutputNumber + \" CORRECT - TIME: \" + totalTimeInSeconds);\n else\n out.println(\"TEST \" + inputOutputNumber + \" INCORRECT - TIME: \" + totalTimeInSeconds);\n }\n }\n //Use close comment after this line\n \n }", "public static void main(String[] args) {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry {\n\t\t\tString[] arr = br.readLine().split(\" \");\n\t\t\tint N = Integer.parseInt(arr[0]);\n\t\t\tint M = Integer.parseInt(arr[1]);\n\n\t\t\tArrayList<Integer>[] adlist = (ArrayList<Integer>[]) new ArrayList[N + 1];\n\t\t\tfor (int i = 1; i <= N; i++)\n\t\t\t\tadlist[i] = new ArrayList<Integer>();\n\t\t\tfor (int i = 0; i < M; i++) {\n\t\t\t\tString[] arr1 = br.readLine().split(\" \");\n\t\t\t\tint a = Integer.parseInt(arr1[0]);\n\t\t\t\tint b = Integer.parseInt(arr1[1]);\n\t\t\t\tadlist[b].add(a);\n\t\t\t}\n\t\t\tint[] num = new int[N + 1];\n\t\t\tfor (int i = 1; i <= N; i++) {\n\t\t\t\tint[] c = new int[N + 1];\n\t\t\t\tconnectedCom = 0;\n\t\t\t\tdfs(i, adlist, c);\n\t\t\t\tnum[i] = connectedCom;\n\t\t\t}\n\t\t\tint max = 0;\n\t\t\tfor (int i = 1; i <= N; i++) {\n\t\t\t\tif (max < num[i])\n\t\t\t\t\tmax = num[i];\n\t\t\t}\n\t\t\tfor (int i = 1; i <= N; i++) {\n\t\t\t\tif (num[i] == max)\n\t\t\t\t\tSystem.out.print(i + \" \");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void knnCSV(Map<String, Integer> map, String output)\r\n\t\t\tthrows IOException {\r\n\r\n\t\tFileWriter fw = null;\r\n\t\tFile[] files = null;\r\n\r\n\t\tfiles = folder.listFiles();\r\n\t\tfw = new FileWriter(\"src/\" + output, false);\r\n\r\n\t\tfor (File file : files) {\r\n\r\n\t\t\tString fileName = file.getName();\r\n\t\t\tMap<Map<String, Integer>, Integer> wordFreqClass = documents\r\n\t\t\t\t\t.get(fileName);\r\n\t\t\tInteger classification = ERROR;\r\n\r\n\t\t\t// Assign class to file\r\n\t\t\tfor (Integer type : wordFreqClass.values()) {\r\n\t\t\t\tclassification = type;\r\n\t\t\t}\r\n\r\n\t\t\t// Create a temporary map of all words and counts in each test file\r\n\t\t\tMap<String, Integer> tempMap = new HashMap<String, Integer>();\r\n\t\t\tFileReader fr = new FileReader(file);\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\ttry {\r\n\t\t\t\tString line = br.readLine();\r\n\t\t\t\twhile (line != null) {\r\n\t\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(line);\r\n\t\t\t\t\twhile (tokenizer.hasMoreTokens()) {\r\n\t\t\t\t\t\tString word = tokenizer.nextToken();\r\n\t\t\t\t\t\tif (tempMap.containsKey(word)) {\r\n\t\t\t\t\t\t\ttempMap.put(word, tempMap.get(word) + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttempMap.put(word, 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tline = br.readLine();\r\n\t\t\t\t}\r\n\t\t\t} catch (FileNotFoundException fNFE) {\r\n\t\t\t\tfNFE.printStackTrace();\r\n\t\t\t} catch (IOException iOE) {\r\n\t\t\t\tiOE.printStackTrace();\r\n\t\t\t} finally {\r\n\t\t\t\tbr.close(); // Close BufferedReader\r\n\t\t\t}\r\n\r\n\t\t\t// Print value of words in tempMap for each word in fullMap\r\n\t\t\t// separated by commas\r\n\t\t\tIterator<HashMap.Entry<String, Integer>> entries = map.entrySet()\r\n\t\t\t\t\t.iterator();\r\n\t\t\twhile (entries.hasNext()) {\r\n\t\t\t\tHashMap.Entry<String, Integer> entry = entries.next();\r\n\t\t\t\tString word = entry.getKey();\r\n\t\t\t\tif (tempMap.containsKey(word)) {\r\n\t\t\t\t\tfw.write(tempMap.get(word).toString());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfw.write(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (entries.hasNext()) {\r\n\t\t\t\t\tfw.write(\",\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfw.write(\",\");\r\n\t\t\t\t\tfw.write(classification.toString());\r\n\t\t\t\t\tfw.write(\"\\r\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfw.close();\r\n\r\n\t}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in); //assign size of input\n System.out.println(\"enter the number of elements\");\n String str = sc.nextLine();\n int N = Integer.parseInt(str);\n\n int[] arr = new int[N];\n\n for (int i = 0; i < N; i++) { //assign values of input\n System.out.println(\"enter element \" + (i + 1));\n String str2 = sc.nextLine();\n int number = Integer.parseInt(str2);\n\n arr[i] = number;\n }\n\n //find cluster count\n int clusterCount = 0;\n\n for (int h = 0; h < N - 1; h++) {\n if (arr[h] == arr[h + 1]) {\n int count = h + 1;\n while (arr[h] == arr[count]) {\n count++;\n }\n h = count;\n clusterCount++;\n }\n } //output \n System.out.println(clusterCount);\n\n }", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "public static void main(String[] args) throws IOException {\n File file = new File(args[0]);\r\n //FileOutputStream f = new FileOutputStream(\"prat_dfs_data2.txt\");\r\n //System.setOut(new PrintStream(f));\r\n BufferedReader reader = new BufferedReader(new FileReader(file));\r\n String line;\r\n line = reader.readLine();\r\n int nodecount = 0;\r\n HashMap <String , Integer> nodeMap = new HashMap <String , Integer>(); \r\n while ((line = reader.readLine()) != null ) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n if (!nodeMap.containsKey(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"))){\r\n nodeMap.put(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"), nodecount);\r\n nodecount++;\r\n }\r\n }\r\n reader.close();\r\n Vertex adjList[] = new Vertex[nodecount];\r\n Vertex sortVer[] = new Vertex[nodecount];\r\n for(int it = 0; it < nodecount; it++){\r\n adjList[it] = new Vertex(it);\r\n }\r\n nodeMap.forEach((k, v) -> adjList[v].val = k);\r\n File file2 = new File(args[1]);\r\n BufferedReader reader2 = new BufferedReader(new FileReader(file2));\r\n line = reader2.readLine();\r\n while ((line = reader2.readLine()) !=null) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n String source = data[0].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n String target = data[1].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n\r\n int weight = Integer.parseInt(data[2]);\r\n Vertex current = adjList[nodeMap.get(source)];\r\n Vertex newbie = new Vertex(nodeMap.get(target));\r\n current.countN++;\r\n current.co_occur += weight;\r\n if (adjList[nodeMap.get(source)].next == null){\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n else{\r\n current.next.prev = newbie;\r\n newbie.next = current.next;\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n Vertex current1 = adjList[nodeMap.get(target)];\r\n Vertex newbie1 = new Vertex(nodeMap.get(source));\r\n current1.co_occur += weight;\r\n current1.countN++;\r\n if (current1.next == null){\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n else{\r\n current1.next.prev = newbie1;\r\n newbie1.next = current1.next;\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n }\r\n reader2.close();\r\n \r\n for(int it = 0; it < nodecount; it++){\r\n sortVer[it] = new Vertex(adjList[it].id);\r\n sortVer[it].val = adjList[it].val;\r\n sortVer[it].co_occur = adjList[it].co_occur;\r\n }\r\n if (args[2].equals(\"average\")){\r\n double countdeg = 0;\r\n for(int it = 0; it<nodecount; it++){\r\n countdeg+= (double) adjList[it].countN;\r\n }\r\n countdeg = countdeg / (double) (nodecount);\r\n System.out.printf(\"%.2f\", countdeg);\r\n System.out.println();\r\n //long toc= System.nanoTime();\r\n //System.out.println((toc- startTime)/1000000000.0);\r\n }\r\n \r\n if(args[2].equals(\"rank\")){\r\n Graph.mergesort(sortVer, 0, nodecount-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n System.out.print(sortVer[0].val);\r\n for(int kk=1; kk<nodecount; kk++){\r\n System.out.print(\",\" + sortVer[kk].val.toString());\r\n }\r\n System.out.println();\r\n }\r\n if(args[2].equals(\"independent_storylines_dfs\")){\r\n boolean visited[] = new boolean[nodecount];\r\n int ind = 0;\r\n ArrayList<ArrayList<Vertex>> comps = new ArrayList<ArrayList<Vertex>>();\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n visited[it1] = false;\r\n }\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n if (visited[it1] == false){\r\n ArrayList<Vertex> temp = new ArrayList<Vertex>();\r\n Graph.dfs(it1, visited, ind, adjList, temp);\r\n ind++;\r\n Graph.mergesort2(temp, 0, temp.size()-1);\r\n comps.add(temp);\r\n }\r\n }\r\n Graph.mergesort3(comps, 0, comps.size()-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n for(int a1 = 0; a1 < ind; a1++){\r\n System.out.print(comps.get(a1).get(0).val);\r\n for(int j1 = 1; j1<comps.get(a1).size(); j1++){\r\n System.out.print(\",\" + comps.get(a1).get(j1).val);\r\n }\r\n System.out.println();\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n\r\n\t\tint[] l1 = {1,5,9,10,20};\r\n\r\n\t\tint[] l2 = {2,4,5,6,7,9,15};\r\n\r\n\t\tint[] l3 = {3,8,13,15,22};\r\n\r\n\t\t// Required: Test your mergeklists() over l1, l2, l3,\r\n\t\t// Complete the code here.\r\n\r\n\t\tint size = (l1.length -1) + (l2.length -1) + (l3.length -1);\r\n\r\n\t\tint[] arry = \tmergeklists(l1,l2,l3,size);\r\n\r\n\t\tfor (int i = 0; i < size; i++){\r\n\t\t\tSystem.out.println(arry[i]);\r\n\t\t}\r\n\t}", "private static void outputenrichment(String szoutfile,String[] files,double[][] tallyoverlaplabel, \n double[] tallylabel, double[] dsumoverlaplabel,Color theColor,\n boolean bcolscaleheat,String szstateorder,String sztitle, int noffset,\n String szlabelmapping,char chorder, boolean bprintimage,\n boolean bstringlabels, HashMap hmIndexToLabel) throws IOException\n {\n\n\tHashMap hmlabelExtend = makeLabelMapping(szlabelmapping);\n\n\tdouble dsumlabel = 0;\n\tfor (int ni = 0; ni < tallylabel.length; ni++)\n {\n\t dsumlabel += tallylabel[ni];\n\t}\n\n NumberFormat nf5 = NumberFormat.getInstance();\n nf5.setMaximumFractionDigits(5);\n\tnf5.setGroupingUsed(false);\n\tnf5.setMinimumFractionDigits(5);\n\n NumberFormat nf10 = NumberFormat.getInstance();\n nf10.setMaximumFractionDigits(10);\n\tnf10.setGroupingUsed(false);\n\tnf10.setMinimumFractionDigits(10);\n\n\tSystem.out.println(\"Writing to file \"+szoutfile+\".txt\");\n\tPrintWriter pw = new PrintWriter(new FileWriter(szoutfile+\".txt\"));\n\n\tpw.print(\"State (\"+szstateorder+\" order)\\tGenome %\");\n\tfor (int nfile = 0; nfile < files.length; nfile++)\n\t{\n\t pw.print(\"\\t\"+files[nfile]);\n\t}\n\tpw.println();\n\n\n\tdouble[][] heatmapfold;\n\n\n\tif (bcolscaleheat)\n\t{\n\t heatmapfold = new double[tallyoverlaplabel[0].length][tallyoverlaplabel.length+1];\n\t}\n\telse\n\t{\n\t heatmapfold = new double[tallyoverlaplabel[0].length][tallyoverlaplabel.length];\n\t}\n\n\tint numelim = 0;\n\n\tfor (int nstate = 0; nstate < tallyoverlaplabel[0].length; nstate++)\n\t{\n\t if (tallylabel[nstate] > 0)\n\t {\n\t\tif (bstringlabels)\n\t\t{\n\t\t pw.print(hmIndexToLabel.get(\"\"+nstate));\n\t\t}\n\t\telse\n\t\t{\n\t\t pw.print(nstate+noffset);\n String szsuffix;\n\n if ((szsuffix = (String) hmlabelExtend.get(\"\"+chorder+(nstate+noffset)))!=null)\n\t\t {\n\t \t pw.print(\"_\"+szsuffix);\n\t }\n\t\t}\n\n\t\tif (bcolscaleheat)\n\t\t{\n\t\t //only include genome % if scaling by column\n\t\t heatmapfold[nstate][0] =100*(tallylabel[nstate]/dsumlabel); //first column is heatmap\n\t\t pw.print(\"\\t\"+nf5.format(heatmapfold[nstate][0]));\n\t\t}\n\t\tfor (int nfile = 0; nfile < tallyoverlaplabel.length; nfile++)\n\t {\n\t\t //numerator is fraction of total of category in state while denominator is total fraction state is\n\t double dfold = (tallyoverlaplabel[nfile][nstate]/dsumoverlaplabel[nfile])/\n\t (tallylabel[nstate]/dsumlabel);\n\t\t if (bcolscaleheat)\n\t\t {\n\t\t heatmapfold[nstate][nfile+1] = dfold;\n\t\t }\n\t\t else\n\t\t {\n\t\t heatmapfold[nstate][nfile] = dfold;\n\t\t }\n\t\t pw.print(\"\\t\"+nf5.format(dfold));\n\t\t}\n\t\tpw.println();\n\t }\n\t else\n\t {\n\t\tnumelim++;\n\t }\n\t}\n\tpw.print(\"Base\\t100\");\n for (int nfile = 0; nfile < tallyoverlaplabel.length; nfile++)\n\t{\n\t pw.print(\"\\t\"+nf10.format(100*(dsumoverlaplabel[nfile]/dsumlabel)));\n\t}\n\tpw.println();\n\tpw.close();\n\n\tString[] rowlabels;// = new String[tallyoverlaplabel[0].length];\n\tif (numelim > 0)\n\t{\n\t double[][] heatmapreduce = new double[heatmapfold.length-numelim][heatmapfold[0].length];\n\t rowlabels = new String[heatmapreduce.length];\n\t int nkeepindex = 0;\n\t for (int nstate = 0; nstate < tallyoverlaplabel[0].length; nstate++)\n\t {\n if (tallylabel[nstate] > 0)\n\t {\n\t\t for (int ncol = 0; ncol < heatmapfold[nstate].length; ncol++)\n\t\t {\n\t\t heatmapreduce[nkeepindex][ncol] = heatmapfold[nstate][ncol];\n\t\t }\n\n\t\t if (bstringlabels)\n\t\t {\n\t\t rowlabels[nkeepindex] = (String) hmIndexToLabel.get(\"\"+nstate);\n\t\t }\n\t\t else\n\t\t {\n\t\t rowlabels[nkeepindex] = \"\"+(nstate+noffset);\n\t\t }\n\t\t nkeepindex++;\n\t }\n\t }\n\t heatmapfold = heatmapreduce;\n\t}\n\telse\n\t{\n\t rowlabels = new String[tallyoverlaplabel[0].length];\n\t if (bstringlabels)\n\t {\n\t for (int ni = 0; ni < rowlabels.length; ni++)\n\t {\n\t rowlabels[ni] = (String) hmIndexToLabel.get(\"\"+ni);\n\t }\n\t }\n\t else\n\t {\n\t for (int ni = 0; ni < rowlabels.length; ni++)\n\t {\n\t\t rowlabels[ni] = \"\"+(ni+noffset);\n\t }\n\t }\n\t}\n\n\n\tif (!bstringlabels)\n\t{\n\t for (int ni = 0; ni < rowlabels.length; ni++)\n\t {\n\t String szsuffix;\n\t if ((szsuffix = (String) hmlabelExtend.get(\"\"+chorder+rowlabels[ni]))!=null)\n {\n \t rowlabels[ni] = rowlabels[ni]+\"_\"+szsuffix;\n\t }\n\t }\n\t}\n\n\tif (bcolscaleheat)\n\t{\n\t for (int nfile = 0; nfile < heatmapfold[0].length; nfile++)\n\t {\t \n\t double dmaxval = Double.NEGATIVE_INFINITY;\n\t double dminval = Double.POSITIVE_INFINITY;\n\n\t for (int nstate = 0; nstate < heatmapfold.length; nstate++)\n\t {\n\t if (heatmapfold[nstate][nfile] > dmaxval)\n\t\t {\n\t\t dmaxval = heatmapfold[nstate][nfile];\n\t\t }\n\n\t if (heatmapfold[nstate][nfile] < dminval)\n\t\t {\n\t\t dminval = heatmapfold[nstate][nfile];\n\t\t }\n\t }\n\t\n\t for (int nstate = 0; nstate < heatmapfold.length; nstate++)\n\t {\n\t\t heatmapfold[nstate][nfile] =(heatmapfold[nstate][nfile]-dminval)/dmaxval;\n\t }\n\t }\n\t}\n\n\tString[] collabels = new String[heatmapfold[0].length];\n\tif (bcolscaleheat)\n\t{\n\t collabels[0] = \"Genome %\";\n\t}\n\n\tfor (int ni = 0; ni < files.length; ni++)\n\t{\n\t int nfirstindex = files[ni].indexOf('.');\n\t if (nfirstindex == -1)\n\t {\n\t if (bcolscaleheat)\n\t {\n\t collabels[ni+1] = files[ni];\n\t }\n\t else\n\t {\n\t collabels[ni] = files[ni];\n\t }\n\t }\n\t else\n\t {\n\t String szsub = files[ni].substring(0,nfirstindex);\n\n\t if (bcolscaleheat)\n\t {\n\t collabels[ni+1] = szsub;\n\t }\n\t else\n\t {\n\t collabels[ni] = szsub;\n\t }\n\t }\n\t}\n\n\n\tif (bprintimage)\n\t{\n\t makeEnrichmentHeatMap(heatmapfold, collabels, rowlabels,szoutfile,theColor,sztitle,\n\t\t\t\t \"Category\",\"State (\"+szstateorder+\" order)\");\n\t}\n }", "public void printCorefChains(PrintWriter out, boolean printSingletons)\n{\n for (Integer cur : clusters.keySet()) {\n TreeMap<Integer, Integer> cluster = clusters.get(cur);\n if (cluster.keySet().size() > 1 || printSingletons) {\n for (Integer k : cluster.keySet()) {\n out.print(k + \" \");\n }\n out.print(\"\\n\");\n }\n }\n}", "void unionTreeCoreset(int k,int n_1,int n_2,int d, Point[] setA,Point[] setB, Point[] centres, MTRandom clustererRandom) {\n\t\t//printf(\"Computing coreset...\\n\");\n\t\t//total number of points\n\t\tint n = n_1+n_2;\n\n\t\t//choose the first centre (each point has the same probability of being choosen)\n\t\t\n\t\t//stores, how many centres have been choosen yet\n\t\tint choosenPoints = 0; \n\t\t\n\t\t//only choose from the n-i points not already choosen\n\t\tint j = clustererRandom.nextInt(n-choosenPoints); \n\n\t\t//copy the choosen point\n\t\tif(j < n_1){\n\t\t\t//copyPointWithoutInit(&setA[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setA[j].clone();\n\t\t} else {\n\t\t\tj = j - n_1;\n\t\t\t//copyPointWithoutInit(&setB[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setB[j].clone();\n\t\t}\n\t\ttreeNode root = new treeNode(setA,setB,n_1,n_2, centres[choosenPoints],choosenPoints); //??\n\t\tchoosenPoints = 1;\n\t\t\n\t\t//choose the remaining points\n\t\twhile(choosenPoints < k){\n\t\t\tif(root.cost > 0.0){\n\t\t\t\ttreeNode leaf = selectNode(root, clustererRandom);\n\t\t\t\tPoint centre = chooseCentre(leaf, clustererRandom);\n\t\t\t\tsplit(leaf,centre,choosenPoints);\n\t\t\t\t//copyPointWithoutInit(centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = centre;\n\t\t\t} else {\n\t\t\t\t//create a dummy point\n\t\t\t\t//copyPointWithoutInit(root.centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = root.centre;\n\t\t\t\tint l;\n\t\t\t\tfor(l=0;l<root.centre.dimension;l++){\n\t\t\t\t\tcentres[choosenPoints].coordinates[l] = -1 * 1000000;\n\t\t\t\t}\n\t\t\t\tcentres[choosenPoints].id = -1;\n\t\t\t\tcentres[choosenPoints].weight = 0.0;\n\t\t\t\tcentres[choosenPoints].squareSum = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\tchoosenPoints++;\n\t\t}\n\n\t\t//free the tree\n\t\tfreeTree(root);\n\n\t\t//recalculate clustering features\n\t\tint i;\n\t\tfor(i=0;i<n;i++){\n\t\t\t\t\n\t\t\tif(i < n_1) {\n\t\t\t\t\n\t\t\t\tint index = setA[i].centreIndex;\n\t\t\t\tif(centres[index].id != setA[i].id){\n\t\t\t\t\tcentres[index].weight += setA[i].weight;\n\t\t\t\t\tcentres[index].squareSum += setA[i].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setA[i].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setA[i].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tint index = setB[i-n_1].centreIndex;\n\t\t\t\tif(centres[index].id != setB[i-n_1].id){\n\t\t\t\t\tcentres[index].weight += setB[i-n_1].weight;\n\t\t\t\t\tcentres[index].squareSum += setB[i-n_1].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setB[i-n_1].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setB[i-n_1].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n SortedMap<String, File> consensuses = new TreeMap<String, File>();\n SortedMap<String, File> descriptors = new TreeMap<String, File>();\n SortedMap<String, File> votes = new TreeMap<String, File>();\n Stack<File> files = new Stack<File>();\n files.add(new File(\"descriptors\"));\n while (!files.isEmpty()) {\n File file = files.pop();\n String filename = file.getName();\n if (file.isDirectory()) {\n files.addAll(Arrays.asList(file.listFiles()));\n } else if (filename.endsWith(\"-consensus\")) {\n consensuses.put(filename, file);\n } else if (filename.endsWith(\"-votes\")) {\n votes.put(filename, file);\n } else if (filename.endsWith(\"-serverdesc\")) {\n descriptors.put(filename, file);\n }\n }\n System.out.println(\"We found \" + consensuses.size()\n + \" consensus files, \" + votes.size() + \" vote files, and \"\n + descriptors.size() + \" server descriptor files.\");\n\n /* Parse consensuses in an outer loop and the referenced votes and\n * descriptors in inner loops. Write the results to disk as soon as\n * we can to avoid keeping many things in memory. */\n SortedMap<String, String> bandwidthAuthorities =\n new TreeMap<String, String>();\n bandwidthAuthorities.put(\"27B6B5996C426270A5C95488AA5BCEB6BCC86956\",\n \"ides\");\n bandwidthAuthorities.put(\"80550987E1D626E3EBA5E5E75A458DE0626D088C\",\n \"urras\");\n bandwidthAuthorities.put(\"D586D18309DED4CD6D57C18FDB97EFA96D330566\",\n \"moria1\");\n bandwidthAuthorities.put(\"ED03BB616EB2F60BEC80151114BB25CEF515B226\",\n \"gabelmoo\");\n bandwidthAuthorities.put(\"49015F787433103580E3B66A1707A00E60F2D15B\",\n \"maatuska\");\n BufferedWriter bw = new BufferedWriter(new FileWriter(\n \"bandwidth-comparison.csv\"));\n bw.write(\"validafter,fingerprint,nickname,category,\"\n + \"descriptorbandwidth,consensusbandwidth\");\n for (String bandwidthAuthority : bandwidthAuthorities.values()) {\n bw.write(\",\" + bandwidthAuthority + \"bandwidth\");\n }\n bw.write(\"\\n\");\n for (File consensusFile : consensuses.values()) {\n System.out.println(\"Parsing consensus \" + consensusFile.getName());\n BufferedReader brC = new BufferedReader(new FileReader(\n consensusFile));\n String lastRLine = null, lastSLine = null;\n String consensusTimestamp = consensusFile.getName().substring(0,\n \"YYYY-MM-DD-hh-mm-ss\".length());\n Map<String, Map<String, String>> measuredBandwidthsByDirSource =\n new HashMap<String, Map<String, String>>();\n\n /* Parse votes first, if we have them, and extract measured\n * bandwidths. */\n String votesFilename = consensusTimestamp + \"-votes\";\n if (votes.containsKey(votesFilename)) {\n BufferedReader brV = new BufferedReader(new FileReader(\n votes.get(votesFilename)));\n String lineV;\n Map<String, String> measuredBandwidths = null;\n while ((lineV = brV.readLine()) != null) {\n if (lineV.startsWith(\"dir-source \")) {\n String dirSource = lineV.split(\" \")[2];\n measuredBandwidths = new HashMap<String, String>();\n measuredBandwidthsByDirSource.put(dirSource,\n measuredBandwidths);\n } else if (lineV.startsWith(\"r \")) {\n lastRLine = lineV;\n } else if (lineV.startsWith(\"w \") &&\n lineV.contains(\" Measured=\")) {\n String fingerprint = Hex.encodeHexString(Base64.\n decodeBase64(lastRLine.split(\" \")[2] + \"=\"));\n String measuredBandwidth = lineV.substring(lineV.indexOf(\n \" Measured=\") + \" Measured=\".length()).split(\" \")[0];\n measuredBandwidths.put(fingerprint, measuredBandwidth);\n }\n }\n brV.close();\n }\n\n /* Parse referenced server descriptors to learn about exit policies\n * and reported bandwidths. */\n String descriptorsFilename = consensusTimestamp + \"-serverdesc\";\n Map<String, String> parsedDescriptors =\n new HashMap<String, String>();\n if (descriptors.containsKey(descriptorsFilename)) {\n BufferedReader brD = new BufferedReader(new FileReader(\n descriptors.get(descriptorsFilename)));\n Set<String> defaultRejects = new HashSet<String>();\n /* Starting with 0.2.1.6-alpha, ports 465 and 587 were allowed\n * in the default exit policy again (and therefore removed\n * from the default reject lines). */\n Set<String> optionalRejects = new HashSet<String>();\n String lineD, address = null, fingerprint = null,\n descriptorBandwidth = null;\n boolean defaultPolicy = false, comparePolicies = true;\n while ((lineD = brD.readLine()) != null) {\n if (lineD.startsWith(\"router \")) {\n address = lineD.split(\" \")[2];\n defaultRejects.clear();\n defaultRejects.addAll(Arrays.asList((\"0.0.0.0/8:*,\"\n + \"169.254.0.0/16:*,127.0.0.0/8:*,192.168.0.0/16:*,\"\n + \"10.0.0.0/8:*,172.16.0.0/12:*,$IP:*,*:25,*:119,\"\n + \"*:135-139,*:445,*:563,*:1214,*:4661-4666,*:6346-6429,\"\n + \"*:6699,*:6881-6999\").split(\",\")));\n optionalRejects.clear();\n optionalRejects.addAll(Arrays.asList(\n \"*:465,*:587\".split(\",\")));\n fingerprint = null;\n descriptorBandwidth = null;\n defaultPolicy = false;\n comparePolicies = true;\n } else if (lineD.startsWith(\"opt fingerprint \") ||\n lineD.startsWith(\"fingerprint \")) {\n fingerprint = lineD.substring(lineD.startsWith(\"opt \") ?\n \"opt fingerprint\".length() : \"fingerprint\".length()).\n replaceAll(\" \", \"\").toLowerCase();\n } else if (lineD.startsWith(\"bandwidth \")) {\n descriptorBandwidth = lineD.split(\" \")[3];\n } else if (lineD.startsWith(\"reject \") && comparePolicies) {\n String rejectPattern = lineD.substring(\"reject \".\n length());\n if (defaultRejects.contains(rejectPattern)) {\n defaultRejects.remove(rejectPattern);\n } else if (optionalRejects.contains(rejectPattern)) {\n optionalRejects.remove(rejectPattern);\n } else if (rejectPattern.equals(address + \":*\")) {\n defaultRejects.remove(\"$IP:*\");\n } else {\n comparePolicies = false;\n }\n } else if (lineD.startsWith(\"accept \") && comparePolicies) {\n if (defaultRejects.isEmpty() &&\n lineD.equals(\"accept *:*\")) {\n defaultPolicy = true;\n }\n comparePolicies = false;\n } else if (lineD.equals(\"router-signature\")) {\n if (address != null && fingerprint != null &&\n descriptorBandwidth != null) {\n parsedDescriptors.put(fingerprint, descriptorBandwidth + \",\"\n + (defaultPolicy ? \"1\" : \"0\"));\n }\n }\n }\n brD.close();\n }\n\n /* Parse r, s, and w lines from the consensus. */\n String lineC, validAfter = null;\n while ((lineC = brC.readLine()) != null) {\n if (lineC.startsWith(\"valid-after \")) {\n validAfter = lineC.substring(\"valid-after \".length());\n } else if (lineC.startsWith(\"r \")) {\n lastRLine = lineC;\n } else if (lineC.startsWith(\"s \")) {\n lastSLine = lineC;\n } else if (lineC.startsWith(\"w \")) {\n String[] parts = lastRLine.split(\" \");\n String nickname = parts[1];\n String fingerprint = Hex.encodeHexString(Base64.decodeBase64(\n parts[2] + \"=\"));\n String descriptor = Hex.encodeHexString(Base64.decodeBase64(\n parts[3] + \"=\"));\n boolean exitFlag = lastSLine.contains(\" Exit\");\n boolean guardFlag = lastSLine.contains(\" Guard\");\n String consensusBandwidth = lineC.substring(lineC.indexOf(\n \" Bandwidth=\") + \" Bandwidth=\".length()).split(\" \")[0];\n\n /* Look up whether we parsed this descriptor before. */\n boolean parsedDescriptor = false, defaultPolicy = false;\n String descriptorBandwidth = null;\n if (parsedDescriptors.containsKey(fingerprint)) {\n String parseResults = parsedDescriptors.get(fingerprint);\n parsedDescriptor = true;\n defaultPolicy = parseResults.endsWith(\"1\");\n descriptorBandwidth = parseResults.split(\",\")[0];\n }\n\n /* Write everything we know about this relay to disk. */\n String category = null;\n if (guardFlag && exitFlag && defaultPolicy) {\n category = \"Guard & Exit (default policy)\";\n } else if (!guardFlag && exitFlag && defaultPolicy) {\n category = \"Exit (default policy)\";\n } else if (guardFlag && exitFlag && !defaultPolicy) {\n category = \"Guard & Exit (non-default policy)\";\n } else if (!guardFlag && exitFlag && !defaultPolicy) {\n category = \"Exit (non-default policy)\";\n } else if (guardFlag && !exitFlag) {\n category = \"Guard\";\n } else if (!guardFlag && !exitFlag) {\n category = \"Middle\";\n }\n bw.write(validAfter + \",\" + fingerprint + \",\" + nickname + \",\"\n + category + \",\" + (parsedDescriptor ? descriptorBandwidth\n : \"NA\") + \",\" + consensusBandwidth);\n for (String bandwidthAuthority :\n bandwidthAuthorities.keySet()) {\n if (measuredBandwidthsByDirSource.containsKey(\n bandwidthAuthority) && measuredBandwidthsByDirSource.get(\n bandwidthAuthority).containsKey(fingerprint)) {\n bw.write(\",\" + measuredBandwidthsByDirSource.get(\n bandwidthAuthority).get(fingerprint));\n } else {\n bw.write(\",NA\");\n }\n }\n bw.write(\"\\n\");\n }\n }\n brC.close();\n }\n bw.close();\n }", "void exec2(DeletedDirectoryEntry entry, String outdir, String file) throws Exception {\r\n\r\n byte[] buffer = new byte[fat32.getBytesPerSector()];\r\n\r\n //\r\n // startClusterHigh を見つける\r\n //\r\n if (!entry.resolveStartCluster(id3v2MatchingStrategy) || !entry.isStartClusterValid()) {\r\nSystem.err.println(\"start cluster not found: \" + file);\r\n return;\r\n }\r\n int startCluster = entry.getStartCluster();\r\n\r\n //\r\n // 連続しているクラスターを書き出す\r\n // 途切れたら次の使われていないところ\r\n //\r\n \r\n File output = new File(outdir, file);\r\n OutputStream os = new FileOutputStream(output);\r\n\r\nSystem.err.println(entry.getName() + \": \" + entry.getStartCluster() + \", \" + entry.length());\r\n\r\n long rest = entry.length();\r\n\r\n\r\nouter:\r\n for (int cluster = 0; cluster < fat32.getLastCluster(); cluster++) {\r\n int targetCluster = startCluster + cluster;\r\nSystem.err.print(\"cluster: \" + targetCluster);\r\n\r\n\r\n // 途切れたら次の使われていないところ\r\n\r\n if (fat32.isUsing(targetCluster)) {\r\nSystem.err.println(\" has used, skip\");\r\n//int restClusters = (int) ((rest + (fat32.getBytesPerCluster() - 1)) / fat32.getBytesPerCluster());\r\n//System.err.println(\"rest: \" + rest + \" / \" + entry.length() + \", \" + restClusters + \" clusters: \" + file);\r\n continue;\r\n }\r\n\r\n // 1 クラスタの書き出し\r\n\r\n for (int sector = 0; sector < fat32.getSectorsPerCluster(); sector++) {\r\n int targetSector = fat32.getSector(targetCluster) + sector;\r\n fat32.readSector(buffer, targetSector);\r\n if (rest > fat32.getBytesPerSector()) {\r\n os.write(buffer, 0, fat32.getBytesPerSector());\r\n rest -= fat32.getBytesPerSector();\r\n } else {\r\n os.write(buffer, 0, (int) rest);\r\n rest -= rest;\r\n break outer;\r\n }\r\n }\r\nSystem.err.println(\" salvaged: \" + (entry.length() - rest) + \"/\" + entry.length());\r\n }\r\n\r\nSystem.err.println(\" salvaged, finish: \" + (entry.length() - rest) + \"/\" + entry.length());\r\n\r\n\r\n os.flush();\r\n os.close();\r\n output.setLastModified(entry.lastModified());\r\n \r\n }", "public String Km() throws Exception {\n int x = 0;\n System.out.println(x+\" hlikiaaaaaa\");\n ΑrffCreator gen = new ΑrffCreator();\n\t\t\tgen.ArffGenerator();\n\t\t\t\n\t\t\tSimpleKMeans kmeans = new SimpleKMeans();\n\t \n\t\t\tkmeans.setSeed(2);\n\t \n\t\t\t//important parameter to set: preserver order, number of cluster.\n\t\t\tkmeans.setPreserveInstancesOrder(true);\n\t\t\tkmeans.setNumClusters(2);\n\t \n\t\t\tBufferedReader datafile = readDataFile(\"E:\\\\Users\\\\Filippos\\\\Documents\\\\NetBeansProjects\\\\MapsCopy\\\\mytext.arff\"); \n\t\t\tInstances data = new Instances(datafile);\n\t \n\t \n\t\t\tkmeans.buildClusterer(data);\n\t \n\t\t\t// This array returns the cluster number (starting with 0) for each instance\n\t\t\t// The array has as many elements as the number of instances\n\t\t\tint[] assignments = kmeans.getAssignments();\n int noNoobs=-1;\n\t\t\t//int i=0;\n\t\t\tint g = assignments.length;\n String studentsLvl = \"\";\n String quizAns = \"\";\n int clusterResult;\n\t\t\t/*----------------------------------------->xeirokinitos upologismos<----------------------------------------\n \n /*for(int clusterNum : assignments) {\n if(i==x){\n noNoobs = assignments[i];\n System.out.println(\"to \"+g+\"o einai \"+ clusterNum+\"= \"+x+\" o cluster EINAI PROXORIMENOS\");\n\t\t\t\t}\t\n if(i==g-1) {\n \n if(assignments[i] == noNoobs){\n studentsLvl = \"advanced\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS\"+assignments[i]);\n \n }\n else{\n studentsLvl = \"beginner\";\n System.out.println(\"DEN PAEI POY8ENA ETSI\") ; \n }\n \n\t\t\t i++;\n\t\t\t}\n ---------------------------------------------------------------------------------------------------------*/\n /*upologizw thn euklideia apostash twn telikwn cluster cendroids apo to shmeio 0,0 \n auto pou apexei perissotero apo to kentro twn a3onwn , 8a einai to cluster advanced epeidi oso megaluterh hlikia \n kai kalutero scor sto preliminary test , toso pio advanced. Ka8w h logiki einai oti enas pio megalos kai diavasmenos ma8hths\n kaluteros apo enan pio pio mikro kai e3isou diavasmeno ma8hth h enan sunmoliko alla ligotero diavasmeno\n ----------------------------------------------------------------------------------------------------------*/\n \n //1 vazw ta teleutaia clusterCendroids se ena instance\t\t\t\n\t\t\tInstances clusterCendroid = kmeans.getClusterCentroids();\n //ta metatrepw se string\n\t\t\tString cluster0 = (clusterCendroid.firstInstance()).toString();\n\t\t\tString cluster1 = (clusterCendroid.lastInstance()).toString();\n\t\t\tSystem.out.println(cluster0+\"++++++++++++++++\"+cluster1);\n\t\t\t\n //2 spaw to ka8e string sto \",\" gt einai tis morfhs cluster0=\"x0,y0\" cluster1=\"x1,y1\"\n\t\t\tString[] parts = cluster0.split(\",\");\n\t\t\tString partx0 = parts[0]; // 004\n\t\t\tString party0 = parts[1]; // 034556\n\t\n\t\t\tSystem.out.println(partx0+\" || \"+party0);\n \n //3 Metatrepw ta String se double metavlites gia na epitrepontai oi pra3eis\n\t\t\tdouble clusterDx0 = Double.parseDouble(partx0);\n\t\t\tdouble clusterDy0 = Double.parseDouble(party0);\n\t\t\tSystem.out.println(clusterDx0+clusterDy0);\n\t\t\t\n //epanalamvanoume thn diadikasia apo to vhma 2\n\t\t\tString[] parts1 = cluster1.split(\",\");\n\t\t\tString partx1 = parts1[0]; // 004\n\t\t\tString party1 = parts1[1]; // 034556\n\t\t\t\n\t\t\tSystem.out.println(partx1+\" || \"+party1);\n\t\t\t\n \n double clusterDx1 = Double.parseDouble(partx1);\n\t\t\tdouble clusterDy1 = Double.parseDouble(party1);\n\t\t\t//System.out.println(clusterDx1+clusterDy2);\n //ypologizw thn euklidia apostasi twn 2 shmeivn ws pros to 0,0\n\t\t\tdouble popo = Math.sqrt((Math.pow(clusterDx0,2)+Math.pow(clusterDy0,2)));\n\t\t\tdouble popo2 = Math.sqrt((Math.pow(clusterDx1,2)+Math.pow(clusterDy1,2)));\n \n\t\t\tif (Math.max(popo, popo2)==popo) {\n \n clusterResult=0;\n\t\t\t\tSystem.out.println(\"0=advanced -- \"+popo+\"--1=begginer \"+popo2);\n\t\t\t}\n\t\t\telse {\n clusterResult=1;\n\t\t\t\tSystem.out.println(\"1=advanced -- \"+popo2+\"--0=begginer \"+popo);\n\t\t\t}\n\t\t\tSystem.out.println(popo+\"||\"+popo2+\"||\");\n \n if (assignments[data.numInstances()-1]==clusterResult){\n studentsLvl = \"advanced\";\n quizAns = \"yes\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS \"+assignments[data.numInstances()-1]);\n }\n else{\n quizAns = \"no\";\n studentsLvl = \"beginner\";\n System.out.println(\"MPAINEI STOUS MH PROXORIMENOUS \"+assignments[data.numInstances()-1]) ; \n }\n \n coursequizs lev = new coursequizs();\n lev.studentLevel(studentsLvl,quizAns);\n \n System.out.println(Arrays.toString(assignments));\n return \"home.jsf\";\n\t\t}", "private void combineClusters(int index1,int index2)\n\t{\n\t\tVector <Integer> cluster1 = (Vector<Integer>)clusters.elementAt(index1);\n\t\tVector <Integer> cluster2 = (Vector<Integer>)clusters.elementAt(index2);\n\t\tVector <Integer> cluster3 = new Vector<Integer>(cluster1);\n\t\tcluster3.addAll(cluster2);\n\t\tclusters.add(cluster3);\n\t\tclusters.removeElementAt(index1);\n\t\t\n\t\t//take into account shift in indices after removal of first element\n\t\tif(index2 < index1)\n\t\t\tclusters.removeElementAt(index2);\n\t\telse\n\t\t\tclusters.removeElementAt(index2-1);\n\t\t\n\t\n\t}", "public static void main(String[] args){\n FileClass.readInputFile(\"robots.mat\");\n\n FileClass fileClass = new FileClass();\n\n ArrayList<ArrayList<Point>> robotsList = fileClass.allRobots;\n\n for (ArrayList<Point> robots : robotsList) {\n robots.get(0).isAwake = true;\n }\n\n ArrayList<ArrayList<Point>> inputPoints = fileClass.allInput;\n ArrayList<ArrayList<Point[]>> obstaclesList = fileClass.allObstacles;\n\n ArrayList<String> lines = new ArrayList<String>();\n\n\n for(int i = 0; i < inputPoints.size(); i++){\n MAT mat = new MAT();\n\n ArrayList<Point> pointsList = inputPoints.get(i);\n Point[] points = pointsList.toArray(new Point[pointsList.size()]);\n\n mat.setAllVisible(points, obstaclesList.get(i));\n\n int robots = robotsList.get(i).size();\n\n mat.initialiseTable(points.length);\n mat.genFloydTable1(points);\n mat.genFloydTable2(points);\n mat.meanDistanceRobots(points, robots);\n\n KMeans kmeans = new KMeans();\n kmeans.doKMeans(NUM_CLUSTERS, robots, robotsList.get(i));\n ArrayList<Point> clusteredPoints = kmeans.getPoints();\n// for (Point p : robotsList.get(i)) System.out.println(p);\n// for (Point p : clusteredPoints) {\n// System.out.println(p + \" belongs to cluster \" + p.getCluster());\n// }\n Point[] robotClusteredPoints = new Point[clusteredPoints.size()];\n int index = 0;\n for (Point p : clusteredPoints) points[index++].setCluster(p.getCluster());\n// for (Point p : clusteredPoints) robotClusteredPoints[index++] = p;\n ArrayList<Cluster> clusters = kmeans.clusters;\n\n String sol = (i+1) + \": \";\n\n sol += mat.buildPathScheduleKMeans(points, robots, clusters.size(), clusters);\n\n lines.add(sol);\n\n if(i==29) break;\n }\n\n FileClass.writeOutputFile(lines, \"output.txt\");\n\n\n //write solution to file\n //FileClass.writeOutputFile(inputPoints, \"out.txt\");\n /*\n\n Point[] points = new Point[2];\n points[0] = new Point(-1.0, -1.0, true);\n points[1] = new Point(4.0, 4.0,true);\n\n Point[] points2 = new Point[5];\n points2[0] = new Point(0.0,1.0, true);\n points2[1] = new Point(2.0,0.0, true);\n points2[2] = new Point(3.0,5.0, true);\n points2[3] = new Point(6.0,2.0, true);\n points2[4] = new Point(9.0,0.0, true);\n\n Point[] obstacles1 = new Point[14];\n obstacles1[0] = new Point(1.0, 6.0);\n obstacles1[1] = new Point(1.0, 1.0);\n obstacles1[2] = new Point(5.0, 1.0);\n obstacles1[3] = new Point(5.0, 5.0);\n obstacles1[4] = new Point(3.0, 5.0);\n obstacles1[5] = new Point(3.0, 3.0);\n obstacles1[6] = new Point(4.0, 3.0);\n obstacles1[7] = new Point(4.0, 2.0);\n obstacles1[8] = new Point(2.0, 2.0);\n obstacles1[9] = new Point(2.0, 6.0);\n obstacles1[10] = new Point(6.0, 6.0);\n obstacles1[11] = new Point(6.0, 0.0);\n obstacles1[12] = new Point(0.0, 0.0);\n obstacles1[13] = new Point(0.0, 6.0);\n\n\n Point[] obstacles2 = new Point[4];\n obstacles2[0] = new Point(8.0, 1.0);\n obstacles2[1] = new Point(4.0, 1.0);\n obstacles2[2] = new Point(4.0, 4.0);\n obstacles2[3] = new Point(5.0, 2.0);\n\n Point[] obstacles3 = new Point[4];\n obstacles3[0] = new Point(1.0, 2.0);\n obstacles3[1] = new Point(1.0, 4.0);\n obstacles3[2] = new Point(3.0, 4.0);\n obstacles3[3] = new Point(3.0, 2.0);\n\n ArrayList<Point[]> obstacles = new ArrayList<Point[]>();\n ArrayList<Point[]> anotherObstacles = new ArrayList<Point[]>();\n obstacles.add(obstacles1);\n anotherObstacles.add(obstacles2);\n anotherObstacles.add(obstacles3);*/\n/*\n MAT alg = new MAT();\n//\n Point[] all_points = new Point[16];\n int index = 0;\n for (Point point : points) {\n all_points[index++] = point;\n }\n for (Point[] obstacle : obstacles) {\n for (Point p : obstacle) {\n all_points[index++] = p;\n }\n }\n\n\n alg.setAllVisible(all_points, obstacles);\n\n for (Point p : all_points) {\n System.out.println(\"*** Visible from point \" + p.toString() + \"***\");\n ArrayList<Point> visible = p.visible;\n for (Point point : visible) {\n System.out.println(point.toString() + \", \");\n }\n }\n\n alg.initialiseTable(16);\n alg.genFloydTable1(all_points);\n alg.genFloydTable2(all_points);\n\n// alg.print_table(all_points);\n alg.visitAll(all_points, 2);*/\n/*\n System.out.println(\"\");\n System.out.println(\"***** QUESTION 3 *****\");\n MAT alg2 = new MAT();\n Point[] all_points2 = new Point[13];\n int index2 = 0;\n for (Point point : points2) {\n all_points2[index2++] = point;\n }\n for (Point[] obstacle : anotherObstacles) {\n for (Point p : obstacle) {\n all_points2[index2++] = p;\n }\n }\n\n alg2.setAllVisible(all_points2, anotherObstacles);\n\n for (Point p : all_points2) {\n System.out.println(\"*** Visible from point \" + p.toString() + \"***\");\n ArrayList<Point> visible = p.visible;\n for (Point point : visible) {\n System.out.print(point.toString() + \", \");\n }\n System.out.println(\"\");\n }\n\n alg2.initialiseTable(13);\n alg2.genFloydTable1(all_points2);\n alg2.genFloydTable2(all_points2);\n\n// alg.print_table(all_points);\n alg2.visitAll(all_points2, 5);*/\n }", "public static void main(String[] args) throws IOException {\n\t\tInput in = new Input(\"input.txt\", 2 * 1024);\r\n\t\tPrintWriter out = new PrintWriter(\"output.txt\");\r\n\r\n\t\tint n = in.nextInt();\r\n\t\t\r\n\t\tfVal = new int[n];\r\n\t\tfPos = new int[n];\r\n\t\t\r\n\t\tfor (int i = 0; i < n; ++i) {\r\n\t\t\tfVal[i] = in.nextInt();\r\n\t\t\tfPos[i] = i;\r\n\t\t}\r\n\t\t\r\n\t\tsVal = new int[n];\r\n\t\tsPos = new int[n];\r\n\r\n\t\tfor (int i = 0; i < n; ++i) {\r\n\t\t\tsVal[i] = in.nextInt();\r\n\t\t\tsPos[i] = i;\r\n\t\t}\r\n\t\t\r\n\t\tbuf = new int[n / 2 + 1];\r\n\t\ttmp = new int[n / 2 + 1];\r\n\t\t\r\n\t\tsortsVal(0, n - 1);\r\n\t\tsortfVal(0, n - 1);\r\n\t\t\r\n\t\tfor (int i = 0; i < n; ++i)\r\n\t\t\tif (fVal[i] != sVal[i]) {\r\n\t\t\t\tout.println(-1);\r\n\t\t\t\tout.close();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < n; ++i)\r\n\t\t\tfVal[i] = sPos[i];\r\n\t\t\t\r\n\t\tsortfPos(0, n - 1);\r\n\t\t\r\n\t\tanswer = 0;\r\n\t\t\r\n\t\tmerge(fVal, 0, n - 1);\r\n\t\t\t\r\n\t\tout.println(answer);\t\r\n\t\t\r\n\t\tout.close();\r\n\t}", "@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }", "public void clustering(String dataFile) throws IOException, InterruptedException{\n\t\t\n\t\tSequenceReader reader;\n\t\tif(dataFile.equals(\"-\"))\n\t\t\treader = SequenceReader.getReader(System.in);\n\t\telse\n\t\t\treader = SequenceReader.getReader(dataFile);\n\t\tSequence seq;\n\t\tString format=\"\";\n\t\tif(print){\n\t\t\tif(reader instanceof FastaReader)\n\t\t\t\tformat=\"fasta\";\n\t\t\telse if (reader instanceof FastqReader)\n\t\t\t\tformat=\"fastq\";\n\t\t\telse \n\t\t\t\tformat=\"out\";\n\t\t\t\n\t\t\tfor(int i=0;i<nSamples;i++){\t\t\n\t\t\t\tstreamToFile[i] = SequenceOutputStream.makeOutputStream(barCodesLeft.get(i).getName()+\".\" +format);\n\t\t\t}\n\t\t\tstreamToFile[nSamples] = SequenceOutputStream.makeOutputStream(\"unknown\"+\".\" +format);\n\n\t\t}\n\n\t\tSequence s5, s3;\n\t\tfinal double[] \tlf = new double[nSamples], //left-forward\n\t\t\t\tlr = new double[nSamples],\t//left-reversed\n\t\t\t\trr = new double[nSamples], //right-reversed\n\t\t\t\trf = new double[nSamples]; //right-forward\n\t\t\n\t\tSWGAlignment \talignmentLF = new SWGAlignment(),\n\t\t\t\t\t\talignmentLR = new SWGAlignment(),\n\t\t\t\t\t\talignmentRF = new SWGAlignment(),\n\t\t\t\t\t\talignmentRR = new SWGAlignment();\n\n\t\tSWGAlignment \tbestLeftAlignment = new SWGAlignment(),\n\t\t\t\t\t\tbestRightAlignment = new SWGAlignment();\n\n\n\n\t\twhile ((seq = reader.nextSequence(Alphabet.DNA())) != null){\n\t\t\tif(seq.length() < barcodeLen*4){\n\t\t\t\tSystem.err.println(\"Ignore short sequence \" + seq.getName());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//alignment algorithm is applied here. For the beginning, Smith-Waterman local pairwise alignment is used\n\n\t\t\ts5 = seq.subSequence(0, SCAN_WINDOW);\n\t\t\ts3 = Alphabet.DNA.complement(seq.subSequence(seq.length()-SCAN_WINDOW,seq.length()));\n\n\n\n\t\t\tdouble bestScore = 0.0;\n\t\t\tdouble distance = 0.0; //distance between bestscore and the runner-up\n\t\t\t\n\t\t\tint bestIndex = nSamples;\n\n\t\t\tfor(int i=0;i<nSamples; i++){\n\t\t\t\tSequence barcodeLeft = barCodesLeft.get(i);\n\t\t\t\tSequence barcodeRight = barCodesRight.get(i); //rc of right barcode sequence\n\n\t\t\t\n\t\t\t\talignmentLF = SWGAlignment.align(s5, barcodeLeft);\n\t\t\t\talignmentLR = SWGAlignment.align(s3, barcodeLeft);\n\t\t\t\talignmentRF = SWGAlignment.align(s5, barcodeRight);\n\t\t\t\talignmentRR = SWGAlignment.align(s3, barcodeRight);\n\t\t\t\t\n\t\t\t\tlf[i] = alignmentLF.getIdentity()/(float)Math.max(barcodeLeft.length(),alignmentLF.getLength());\n\t\t\t\tlr[i] = alignmentLR.getIdentity()/(float)Math.max(barcodeLeft.length(),alignmentLR.getLength());\n\t\t\t\trf[i] = alignmentRF.getIdentity()/(float)Math.max(barcodeRight.length(),alignmentRF.getLength());\n\t\t\t\trr[i] = alignmentRR.getIdentity()/(float)Math.max(barcodeRight.length(),alignmentRR.getLength());\n\t\t\t\t\n\n\t\t\t\tdouble myScore = 0.0;\n\t\t\t\tif(twoends){\n\t\t\t\t\tmyScore = Math.max(lf[i] + rr[i] , lr[i] + rf[i])/2;\n\t\t\t\t}\n\t\t\t\telse{\t\n\t\t\t\t\tmyScore = Math.max(Math.max(lf[i], lr[i]), Math.max(rf[i], rr[i]));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (myScore > bestScore){\n\t\t\t\t\t//LOG.info(\"Better score=\" + myScore);\n\t\t\t\t\tdistance = myScore-bestScore;\n\t\t\t\t\tbestScore = myScore;\t\t\n\t\t\t\t\tbestIndex = i;\n\t\t\t\t\tif(twoends){\n\t\t\t\t\t\tif(lf[i] + rr[i] > lr[i] + rf[i]){\n\t\t\t\t\t\t\tbestLeftAlignment = alignmentLF;\n\t\t\t\t\t\t\tbestRightAlignment = alignmentRR;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tbestLeftAlignment = alignmentLR;\n\t\t\t\t\t\t\tbestRightAlignment = alignmentRF;\n\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\tif(myScore==lf[i] || myScore==rr[i]){\n\t\t\t\t\t\t\tbestLeftAlignment = alignmentLF;\n\t\t\t\t\t\t\tbestRightAlignment = alignmentRR;\n\t\t\t\t\t\t}else if(myScore==lr[i] || myScore==rf[i]){\n\t\t\t\t\t\t\tbestLeftAlignment = alignmentLR;\n\t\t\t\t\t\t\tbestRightAlignment = alignmentRF;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if((bestScore-myScore) < distance){\n\t\t\t\t\tdistance=bestScore-myScore;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tString retval=\"\";\n\t\t\tDecimalFormat twoDForm = new DecimalFormat(\"#.##\");\n\t\t\tif(bestScore < SCORE_THRES || distance < DIST_THRES ){\n\t\t\t\t//LOG.info(\"Unknown sequence \" + seq.getName());\n\t\t\t\tretval = \"unknown:\"+Double.valueOf(twoDForm.format(bestScore))+\":\"+Double.valueOf(twoDForm.format(distance))+\"|0-0:0-0|\";\n\t\t\t\tseq.setName(retval + seq.getName());\n\n\t\t\t\tif(print){\n\t\t\t\t\tseq.print(streamToFile[nSamples]);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if the best (sum of both ends) alignment in template sequence is greater than in complement\n\t\t\telse {\n//\t\t\t\tLOG.info(\"Sequence \" + seq.getName() + \" might belongs to sample \" + barCodesLeft.get(bestIndex).getName() + \" with score=\" + bestScore);\n\t\t\t\tif(bestIndex<nSamples){\n\t\t\t\t\tretval = barCodesLeft.get(bestIndex).getName()+\":\"+Double.valueOf(twoDForm.format(bestScore))+\":\"+Double.valueOf(twoDForm.format(distance))+\"|\";\n\t\t\t\t\tint s1 = bestLeftAlignment.getStart1(),\n\t\t\t\t\t\te1 = bestLeftAlignment.getStart1()+bestLeftAlignment.getSequence1().length-bestLeftAlignment.getGaps1(),\n\t\t\t\t\t\te2 = seq.length()-1-bestRightAlignment.getStart1(),\n\t\t\t\t\t\ts2 = seq.length()-1-(bestRightAlignment.getStart1()+bestRightAlignment.getSequence1().length-bestRightAlignment.getGaps1());\n\t\t\t\t\tretval += s1+\"-\"+e1+\":\"+s2+\"-\"+e2+\"|\";\n\t\t\t\t\tseq.setName(retval + seq.getName());\n\t\t\t\t\t\n\t\t\t\t\tif(script && processes[bestIndex]!=null && processes[bestIndex].isAlive())\n\t\t\t\t\t\tseq.print(streamToScript[bestIndex]);\n\t\t\t\t\tif(print)\n\t\t\t\t\t\tseq.print(streamToFile[bestIndex]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(seq.getName());\n\t\t\tprintAlignment(bestLeftAlignment);\n\t\t\tSystem.out.println();\n\t\t\tprintAlignment(bestRightAlignment);\n\t\t\tSystem.out.println(\"\\n==================================================================================\\n\");\n\t\t}\n\n\t\tSystem.out.println(\"Done all input\");\n\t\tfor (int i = 0; i < nSamples;i++){\n\t\t\tif(script && processes[i]!=null && processes[i].isAlive()){\n\t\t\t\tstreamToScript[i].close();\n\t\t\t\tprocesses[i].waitFor();\n\t\t\t}\n\t\t\tif(print)\n\t\t\t\tstreamToFile[i].close();\n\t\t}\n\t\tif(print)\n\t\t\tstreamToFile[nSamples].close();\n\t\tSystem.out.println(\"Done every thing\");\n\t\treader.close();\n\t}", "public display() {\n initComponents();\n //Start Flag\n \t \n \t try \n \t {\n \t\tWordCount.main();\n \t\tWordCount2.main();\n\t\tWordCount_list.main();\n \t } \n \t catch (Exception e1) {e1.printStackTrace();}\n \t \n \t String t1=\"\";\n \t String t2=\"\";\n \t String t3=\"\";\n \t int flag=0;\n \t String FILENAME = \"output/part-r-00000\";\t \n \t String FILENAME2 = \"output3/part-r-00000\";\t\t\t \t \n \t String FILENAME3 = \"output2/part-r-00000\";\t\t\t \t \t \n \t BufferedReader br = null;\n \t FileReader fr = null;\n \t BufferedReader br2 = null;\n \t FileReader fr2 = null;\n \t BufferedReader br3 = null;\n \t FileReader fr3 = null;\t\t\t \t \n \t \t\n \t try {\n \t\t\tfr = new FileReader(FILENAME);\n \t\t\tbr = new BufferedReader(fr);\n \t\t\tbr = new BufferedReader(new FileReader(FILENAME));\n \t\t\tString sCurrentLine=\"\";\n \t\t\twhile ((sCurrentLine = br.readLine()) != null)\n \t\t\t{\t\t\t\t\n \t\t\t\tString[] parts = sCurrentLine.split(\"\t\");\n \t\t\t\tString part1 = parts[0]; // IP\n \t\t\t\tString part2 = parts[1];//Date\n \t\t\t\t//System.out.println(sCurrentLine);\n \t\t\t\t//System.out.println(\"1\");\n \t\t\t if(part2.length()>20)\n \t\t\t {\n \t\t\t fr2 = new FileReader(FILENAME2);\n \t\t\t \tbr2 = new BufferedReader(fr2);\n \t\t\t \tbr2 = new BufferedReader(new FileReader(FILENAME2));\n \t\t\t \tString sCurrentLine2=\"\";\n \t\t\t \twhile ((sCurrentLine2 = br2.readLine()) != null)\n \t\t\t \t\t{\n \t\t\t \t\t\tString[] pts = sCurrentLine2.split(\"\t\");\n \t\t\t \t\t\tString pt1 = pts[0]; //Hash \n \t\t\t \t\t\tString pt2 = pts[1]; //IP\n \t\t\t \t\t\t//System.out.println(\"2\");\n \t\t\t if(pt2.equals(part1))\n \t\t\t {\n \t\t\t \tfr3 = new FileReader(FILENAME3);\n \t\t\t \t\t\t \tbr3 = new BufferedReader(fr3);\n \t\t\t \t\t\t \tbr3 = new BufferedReader(new FileReader(FILENAME3));\n \t\t\t \t\t\t \tString sCurrentLine3=\"\";\n \t\t\t \t\t\t \twhile ((sCurrentLine3 = br3.readLine()) != null)\n \t\t\t \t\t\t \t\t{\n \t\t\t \t\t\t \t\t\tString[] prts = sCurrentLine3.split(\"\t\");\n \t\t\t \t\t\t \t\t\tString prt1 = prts[0]; //Hash \n \t\t\t \t\t\t \t\t\tString prt2 = prts[1]; //Date\n \t\t\t \t\t\t \t\t\t//System.out.println(\"3\");\n \t\t\t \t\t\t \t\t\tif(prt2.length()==part2.length())\n \t\t\t \t\t\t \t\t\t{\t\n \t\t\t \t\t\t \t\t\t\tSystem.out.println(\"SPAM Detected\");\n \t\t\t \t\t\t \t\t\t\tdisplay.append(\"SPAM Detected \\n\");\n \t\t\t \t\t\t \t\t\t\tt1=prt1;\n \t\t\t \t\t\t \t\t\t\tt2=prt2;\n \t\t\t \t\t\t \t\t\t\tt3=pt2;\n \t\t\t \t\t\t \t\t\t\tdisplay.append(t1+\" \"+t2+\" \"+t3+\" \\n\");\n \t\t\t \t\t\t \t\t\t\tSystem.out.println(t1+\" \"+t2+\" \"+t3+\" \");\n \t\t\t \t\t\t \t\t\t\tflag=1;\t\t\t \t\t\t \t\t\t\t\n \t\t\t \t\t\t \t\t\t\tbreak;\n \t\t\t \t\t\t \t\t\t}\t\t\t \t\t\t \t\t\n \t\t\t \t\t\t \t\t}\t\t\t\t\t \t\t\n \t\t\t \t\t\t \tif(flag==1)\n \t\t\t \t\t\t\t\tbreak;\n \t\t\t }\n \t\t\t }\n \t\t\t }\n \t\t\t}\t\t\t \n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t} finally {\n \t\t\ttry {\n \t\t\t\tif (br != null)\n \t\t\t\t\tbr.close();\n \t\t\t\tif (fr != null)\n \t\t\t\t\tfr.close();\n\n \t\t\t} catch (IOException ex) {\n\n \t\t\t\tex.printStackTrace();\n \t\t\t}\n \t\t}\n \n \n//End Flag \n }", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "void combine(int mode) {\n if (mode == 0) {\n\n if (localHeap.peekValue().doubleValue() != globalHeap.peekValue().doubleValue()) {\n System.out.println(\"shit!\");\n }\n combineCluster(localHeap.peek(), mode);\n\n\n\n } else {\n if (localHeap.size() > 0) {\n combineCluster(localHeap.peek(), mode);\n }\n }\n\n }", "public static void main(String args[]) throws IOException{\n\t\t\n\t\t\n\t\tfor (int fold = 0; fold<10; fold++) {\n\t\t\t//triples_result(\"holders_\"+fold, \"test_holders_\"+fold+\"_result\"); //file, result_file\n\t\t\t//sentence_triples_word(\"holders_\"+fold, \"holders_gold_\"+fold, 0, \"holders_\"+fold); //crf_output\n\t\t\t\n\t\t\ttriples_result(\"holders_full_t_\"+fold, \"test_holders_t_\"+fold+\"_result\"); //file, result_file\n\t\t\tsentence_triples_hard_word(\"holders_\"+fold, \"holders_gold_\"+fold, 0, \"holders_t_\"+fold); //crf_output\n\n\t\t\t\n\t\t\tholder_triples = new LinkedList<Triples>();\n\t\t\tholder_prob = new LinkedList<Double>();\n\t\t\tgold_holders = new HashMap<String, Entries>();\n\n\t\t}\n\t\t\n\n\t\t\n\t\tfor (int fold = 0; fold<10; fold++) {\n\t\t\ttriples_result(\"targets_full_t_\"+fold, \"test_targets_t_\"+fold+\"_result\"); //file, result_file\n\t\t\tsentence_triples_hard_word(\"targets_\"+fold, \"targets_gold_\"+fold, 0, \"targets_t_\"+fold); //crf_output\n\t\t\t\n\t\t\tholder_triples = new LinkedList<Triples>();\n\t\t\tholder_prob = new LinkedList<Double>();\n\t\t\tgold_holders = new HashMap<String, Entries>();\n\n\t\t}\n\n\t\t\n\n\t\t\n\t\t//triples_result(\"targets_0\", \"test_targets_0_result\"); //file, result_file\n\t\t//sentence_triples_word(\"targets_0\", \"targets_gold_0\", 0, \"targets_0\"); //crf_output\n\t\t\n\t\t//triples_result(\"targets_1\", \"test_targets_1_result\"); //file, result_file\n\t\t//sentence_triples_word(\"targets_1\", \"targets_gold_1\", 1, \"targets_1\"); //crf_output\n\t}", "public static void main(String[] args) throws IOException{\n\t\tintersections = new HashMap<Integer,LatLong>();\n\t\t/*nodeIDs = new ArrayList<Integer>();\n\t\tnodeCoordinates = new ArrayList<LatLong>();*/\n\t\t\n\t\tString intersectionsFileName = \"data/CENTRELINE_INTERSECTION_WGS84.csv\";\n\t\tScanner input = new Scanner(new File(intersectionsFileName));\n\t\t//System.out.println(\"intersection\");\n\t\t//System.out.println(input.hasNextLine());\n\t\tString[] throwout = input.nextLine().split(\",\");\n\t\twhile (input.hasNextLine()){\n\t\t\tString[] line = input.nextLine().split(\",\");\n\t\t\tLatLong l = new LatLong(Double.parseDouble(line[16]), Double.parseDouble(line[15]));\n\t\t\t\n\t\t\tInteger data = Integer.parseInt(line[0]);\n\t\t\t\n\t\t\tintersections.put(data,l);\n\t\t\t\n\t\t\t/*nodeIDs.add(data);\n\t\t\tnodeCoordinates.add(l);*/\n\t\t\t\n\t\t}\n\t\tinput.close();\n\t\t\n\t\t\n\t\t//Create graph based on centreline data, which tells us which nodes/intersections are connected\n\t\tG = new Graph();\n\t\tString centrelineFileName = \"data/CENTRELINE_WGS84.csv\";\n\t\tinput = new Scanner(new File(centrelineFileName));\n\n\t\tthrowout = input.nextLine().split(\",\");\n\t\twhile (input.hasNextLine()){\n\t\t\tString[] line = input.nextLine().split(\",\");\n\t\t\tInteger fnode = Integer.parseInt(line[11]);\n\t\t\tInteger tnode = Integer.parseInt(line[12]);\n\t\t\t\n\t\t\t//Look up corresponding lat/long points\n\t\t\tdouble fnodeLat = intersections.get(fnode).getLatitude();\n\t\t\tdouble fnodeLon = intersections.get(fnode).getLongitude();\n\t\t\tdouble tnodeLat = intersections.get(tnode).getLatitude();\n\t\t\tdouble tnodeLon = intersections.get(tnode).getLongitude();\n\t\t\t\n\t\t\tG.addEdge(fnode, fnodeLat, fnodeLon, tnode, tnodeLat, tnodeLon);\n\t\t}\n\t\tinput.close();\n\t\t\n\t\t\n\t\t//Import bike parking on street\n\t\tbikeParkingCoordinates = new ArrayList<LatLong>();\n\t\tbikeParkingNodeIDs = new ArrayList<Integer>();\n\t\tbikeNodes = new HashMap<Integer, LatLong>();\n\t\tString bikeParkingOnStreetFileName = \"data/BICYCLE_PARKING_ON_STREET_WGS84.csv\";\n\t\tinput = new Scanner(new File(bikeParkingOnStreetFileName));\n\t\tSystem.out.println(\"hello\" + \"\\n\" + \"Testing Client.java\" +\"\\n\");\n\t\t//System.out.println(input.hasNextLine());\n\t\tthrowout = input.nextLine().split(\",\");\n\t\t\n\t\twhile (input.hasNextLine()){\n\t\t\tString[] line = input.nextLine().split(\",\");\n\t\t\tLatLong l = new LatLong(Double.parseDouble(line[6]), Double.parseDouble(line[5]));\n\t\t\t\n\t\t\t//Find intersection closest to bike parking\n\t\t\tInteger bpNodeID = PathCalculation.closestIntersection(l, intersections);\n\t\t\tbikeParkingNodeIDs.add(bpNodeID);\n\t\t\tbikeParkingCoordinates.add(intersections.get(bpNodeID));\n\t\t\t\n\t\t\t//System.out.println(l + \" \" + intersections.get(bpNodeID));\n\t\t\t\n\t\t\tbikeNodes.put(bpNodeID, intersections.get(bpNodeID));\n\t\t\t\n\t\t\t\n\t\t}\n\t\tinput.close();\n\t\t\n\t\t\n\t\t\n\t\t/*for (Integer e : bikeNodes.keySet()){\n\t\t\tSystem.out.println(e);\n\t\t}*/\n\t\t\n\t\t\n\t\t//Ask user for beginning and end address\n\t\tString userString = null; //for storage of user's desired input\n\t\t\n\t\tScanner s = new Scanner(new File(\"data/testData.txt\")); //Data file with addresses, source and destination\n\t\tint n = 1; // Test case number\n\t\twhile(s.hasNextLine()){\n\t\t\tBoolean INvalidinput = true; // used for while loop, loop while the input is not good\n\t\t\t\n\t\t\tLatLong StartCoords = new LatLong(0,0);\n\t\t\tLatLong EndCoords = new LatLong(0,0);\n\t\t\tAddresses.init();\n\t\t\twhile(INvalidinput){\n\t\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Testing case: \" + n);\n\t\t\t\tuserString = s.nextLine();\n\t\t\t\tStartCoords = Addresses.getLatLong(userString);\n\t\t\t\tINvalidinput = false; // essentially if it GETS one it's valid. OTHERWISE it will throw an exception\n\t\t\t\t}\n\t\t\t\tcatch(InvalidStreetException | NumberFormatException e){\n\t\t\t\t\tSystem.out.println(\"INVALID STREET: \" + userString + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(StringIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tINvalidinput = true;\n\t\t\twhile(INvalidinput){\n\t\t\t\ttry{\n\t\t\t\tuserString = s.nextLine();\n\t\t\t\tEndCoords = Addresses.getLatLong(userString);\n\t\t\t\tINvalidinput = false; // essentially if it GETS one it's valid. OTHERWISE it will throw an exception\n\t\t\t\t}\n\t\t\t\tcatch(InvalidStreetException | NumberFormatException e){\n\t\t\t\t\tSystem.out.println(\"INVALID STREET\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(StringIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Call path calculation --> should return list of lat/long points given two lat/long points and a graph\n\t\t\t\n\t\t/*\tInteger source = 30075902;\n\t\t\tInteger destination = 13469577;\n\t\t*/\n\t\t\tInteger source = PathCalculation.closestIntersection(StartCoords, intersections);\n\t\t\tInteger destination = PathCalculation.closestIntersection(EndCoords, intersections);\n\t\t\t\n\t\t\t/*Integer source = nodeIDs.get(nodeCoordinates.indexOf(StartCoords));\n\t\t\tInteger destination = nodeIDs.get(nodeCoordinates.indexOf(EndCoords));*/\n\t\t\t\n\t\t\t//Determine bike parking location by finding shortest path\n\t\t\t\t\t//Integer chosenBikeParkingNodeID = PathCalculation.closestBikeParking(destination, bikeParkingLocations);\n\t\t\t\n\t\t\tBreadthFirstSearch bfsDestinationToBikeParking = new BreadthFirstSearch(G, destination);\n\t\t\tInteger closestDistance = Integer.MAX_VALUE;\n\t\t\tInteger closestBPNodeID = 0;\n\t\t\t\n\t\t\tfor (Integer bpNodeID : bikeNodes.keySet()){\n\t\t\t\tInteger distance = bfsDestinationToBikeParking.distTo(bpNodeID);\n\t\t\t\tif (distance < closestDistance){\n\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\tclosestBPNodeID = bpNodeID;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*for (Integer e : bfsDestinationToBikeParking.getDistTo().keySet()){\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t\t\t*/\n\t\t\t//Get path from bpNodeID to destination in array list\n\t\t\tArrayList<Integer> destToBP = bfsDestinationToBikeParking.pathToArray(closestBPNodeID); //path from dest --> BP\n\t\t\t\n\t\t\t//Get path from source to bpNodeID in array list\n\t\t\tBreadthFirstSearch bfsSourceToBikeParking = new BreadthFirstSearch(G, source);\n\t\t\tArrayList<Integer> sourceToBP = bfsSourceToBikeParking.pathToArray(closestBPNodeID);\n\t\t\t//create final path in nodeId's\n\t\t\tArrayList<Integer> finalPath = new ArrayList<Integer>();\n\t\t\t\n\t\t\tfor (int i = 0; i < sourceToBP.size(); i++){\n\t\t\t\tfinalPath.add(sourceToBP.get(i));\n\t\t\t}\n\t\t\t//want path from BP to dest, so reverse array list:\n\t\t\tfor (int i = destToBP.size() - 1; i < 0; i++){\n\t\t\t\tfinalPath.add(destToBP.get(i));\n\t\t\t}\t\t\n\t\t\t\n\t\t\t//create array list of lat/long points:\n\t\t\tArrayList<LatLong> finalLatLongPath = new ArrayList<LatLong>();\n\t\t\tfor (int i = 0; i < finalPath.size(); i++){\n\t\t\t\tfinalLatLongPath.add(intersections.get(finalPath.get(i)));\n\t\t\t}\n\t\t\t\n\t\t\tfor (LatLong e : finalLatLongPath){\n\t\t\t\t//System.out.print(e + \", \");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Test case \" +n + \" passed.\" + \"\\n\");\n\t\t\tn++;\n\t\t}\n\t\t\n//\t\tDesktop d = Desktop.getDesktop();\n//\t\ttry {\n//\t\t\td.browse(new URI(\"https://jsfiddle.net/rmLtu9t7/6/\"));\n//\t\t} catch (URISyntaxException e1) {\n//\t\t\tSystem.out.println(\"Invalid Website URL\");\n//\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\t\t\t\n\t\t\tReader.init(System.in);\n\t\t int x=Reader.nextInt();\n\t\t int y=Reader.nextInt();\n\t\t LabUnion1 obj1=new LabUnion1();\n\t\t LabUnion1 obj2=new LabUnion1();\n\t\t LabUnion1 curr1=obj1.header;\n\t\t LabUnion1 curr2=obj2.header;\n\t\t System.out.println(curr1.getLink());\n\t\t for(int i=0;i<x;i++)\n\t\t {\n\t\t \t int n=Reader.nextInt();\n\t\t \t System.out.println(1);\n\t\t \t LabUnion1 element=new LabUnion1(n);\n\t\t \t curr1.setLink(element);\n\t\t \t curr1=curr1.link; \n\t\t }\n\t\t for(int j=0;j<y;j++)\n\t\t {\n\t\t \t int n=Reader.nextInt();\n\t\t \t LabUnion1 element=new LabUnion1(n);\n\t\t \t curr2.setLink(element);\n\t\t \t curr2=curr2.link; \n\t\t }\n\t\t \n\t\t \n\t\t \n\t\t LabUnion1 z=obj1.MergeSort(obj1,obj2);\n\t\t obj1.display();\n\t\t System.out.println(z.comp);\n\t\t \n\t\t}", "public static void main(String[] args) throws InterruptedException {\r\n\r\n\t\tString clustercfg = \"\";\r\n\t\tString ddlfile = \"\";\r\n\t\tString line = null;\r\n\t\tString wordLeft = \"\"; // left side of catalog eqs\r\n\t\tString wordRight = \"\"; // right side of catalog eqs\r\n\r\n\t\t// ArrayList to store the node information\r\n\t\t// ArrayList<DBNode> nodeAL = new ArrayList<DBNode>();\r\n\t\tint nodeCount = 1; // for use in getting values for nodes\r\n\t\tint temp = 0;\r\n\r\n\t\tString nodeDriver = \"\";\r\n\t\tString nodeHostName = \"\";\r\n\t\tString nodeUserName = \"\";\r\n\t\tString nodePassword = \"\";\r\n\r\n\t\t/*\r\n\t\t * switch for scanning catalogs. -1 = nothing 0 = driver, 1=hostname,\r\n\t\t * 2=username, 3=passwd\r\n\t\t *\r\n\t\t */\r\n\r\n\t\tFileReader fr;\r\n\t\tBufferedReader br;\r\n\r\n\t\t// int numnodes = 0;\r\n\r\n\t\tif (args.length > 1) {\r\n\t\t\tclustercfg = args[0];\r\n\t\t\tddlfile = args[1];\r\n\r\n\t\t\ttry {\r\n\t\t\t\tfr = new FileReader(clustercfg);\r\n\t\t\t\tbr = new BufferedReader(fr);\r\n\r\n\t\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\t\t// System.out.println(line);\r\n\r\n\t\t\t\t\tif (numnodes == -1) {\r\n\t\t\t\t\t\tprocessCatalogLine(line);\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t// System.out.println(line);\r\n\r\n\t\t\t\t\t\tfor (int x = 0; x < line.length(); x++) {\r\n\t\t\t\t\t\t\t// System.out.println(wordLeft);\r\n\t\t\t\t\t\t\t// System.out.println(temp);\r\n\t\t\t\t\t\t\t// System.out.println(\"node\" + nodeCount +\r\n\t\t\t\t\t\t\t// \"driver=\");\r\n\r\n\t\t\t\t\t\t\tif (wordLeft.equals(\"node\" + nodeCount + \".driver=\")) {\r\n\t\t\t\t\t\t\t\tnodeDriver = nodeDriver + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else if (wordLeft.equals(\"node\" + nodeCount + \".hostname=\")) {\r\n\t\t\t\t\t\t\t\tnodeHostName = nodeHostName + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else if (wordLeft.equals(\"node\" + nodeCount + \".username=\")) {\r\n\t\t\t\t\t\t\t\tnodeUserName = nodeUserName + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else if (wordLeft.equals(\"node\" + nodeCount + \".passwd=\")) {\r\n\t\t\t\t\t\t\t\tnodePassword = nodePassword + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\twordLeft = wordLeft + line.charAt(x);\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\r\n\t\t\t\t\tif (temp == 4) {\r\n\r\n\t\t\t\t\t\tDBNode newNode = new DBNode(nodeDriver, nodeHostName, nodeUserName, nodePassword);\r\n\r\n\t\t\t\t\t\tnodeAL.add(newNode);\r\n\r\n\t\t\t\t\t\tnodeDriver = \"\";\r\n\t\t\t\t\t\tnodeHostName = \"\";\r\n\t\t\t\t\t\tnodeUserName = \"\";\r\n\t\t\t\t\t\tnodePassword = \"\";\r\n\t\t\t\t\t\tnodeCount++;\r\n\t\t\t\t\t\ttemp = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// System.out.println(wordLeft);\r\n\t\t\t\t\twordLeft = \"\";\r\n\t\t\t\t\t// catalog = -1;\r\n\t\t\t\t} // end of while\r\n\r\n\t\t\t\t// String tname = \"\";\r\n\r\n\t\t\t\treadDDL(ddlfile);\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * String derp =\r\n\t\t\t\t * \"CREATE TABLE BOOKS(isbn char(14), title char(80), price decimal)\"\r\n\t\t\t\t * ;\r\n\t\t\t\t * \r\n\t\t\t\t * System.out.println(derp); System.out.print(\"herr drr: \");\r\n\t\t\t\t * System.out.println(parseTname(derp));\r\n\t\t\t\t */\r\n\r\n\t\t\t\tdoThread();\r\n\r\n\t\t\t\tif (successful) {\r\n\t\t\t\t\trunCatalog();\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"File not found\");\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Argument insufficient\");\r\n\t\t}\r\n\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public static void main(String[] args) throws NumberFormatException, IOException\r\n {\n\r\n String graph = args[0];\r\n String cliqueset = args[1];\r\n String edge_set = args[2];\r\n int batch_size = Integer.parseInt(args[3]); // batch count in\r\n // incremental computation\r\n String out_file = args[4];\r\n\r\n \r\n\r\n Graph G = new Graph(graph, 1); // for adjacency list format\r\n\r\n\r\n LineNumberReader lnr = new LineNumberReader(new FileReader(new File(edge_set)));\r\n lnr.skip(Long.MAX_VALUE);\r\n int lines = lnr.getLineNumber() + 1;\r\n lnr.close();\r\n\r\n CliqueSet = new HashSet[2];\r\n\r\n BufferedReader cbr = new BufferedReader(new FileReader(cliqueset));\r\n String line;\r\n\r\n CliqueSet[0] = new HashSet<>();\r\n CliqueSet[1] = new HashSet<>();\r\n\r\n // adding the existing cliqueset to a container. Each clique is stored\r\n // as a string of vertex ids sorted\r\n while ((line = cbr.readLine()) != null)\r\n {\r\n\r\n TreeSet<Integer> T = new TreeSet<Integer>();\r\n StringBuilder sb = new StringBuilder();\r\n for (String s : line.split(\"\\\\s+\"))\r\n {\r\n T.add(Integer.parseInt(s));\r\n }\r\n //for (int v : T)\r\n //{\r\n // sb.append(v + \" \");\r\n //}\r\n \r\n String cliquestring = T.toString().replace(\"[\", \"\").replace(\"]\", \"\").replace(\",\", \"\");\r\n /* Computing signature of the clique */\r\n CliqueSet[0].add(cliquestring);\r\n\r\n }\r\n System.out.println(\"Intial CliqueSet Reading Complete!!\");\r\n cbr.close();\r\n\r\n int id = 0;\r\n int index = 0;\r\n boolean eof_flag = false;\r\n\r\n BufferedReader ebr = new BufferedReader(new FileReader(edge_set));\r\n\r\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(out_file, true)));\r\n\r\n out.println();\r\n out.println(\"Algorithm-Baseline-TTT\");\r\n out.println(\"Total Number - (new + subsumed)\\t Computation time(ms)\");\r\n out.println();\r\n out.close();\r\n \r\n int turn = 1;\r\n\r\n while (true)\r\n {\r\n index = 0;\r\n id++;\r\n\r\n while (index < batch_size)\r\n {\r\n if ((line = ebr.readLine()) != null)\r\n {\r\n int u = Integer.parseInt(line.split(\" \")[0]);\r\n int v = Integer.parseInt(line.split(\" \")[1]);\r\n G.addEdge(u, v);\r\n index++;\r\n }\r\n else\r\n {\r\n eof_flag = true;\r\n break;\r\n }\r\n }\r\n\r\n System.out.println(\"Updating graph complete!!\");\r\n\r\n System.out.println(\"Maximal Clique Computation start!!\");\r\n long t1 = System.currentTimeMillis();\r\n new TTT_Baseline(G, turn);\r\n long compute_time = System.currentTimeMillis() - t1;\r\n System.out.println(\"Maximal Clique Computation end!!\");\r\n\r\n System.out.println(\"Symmetric Difference Computation start!!\");\r\n long t2 = System.currentTimeMillis();\r\n /* computing the symmetric difference */\r\n Set<String> symmetricDiff = new HashSet<>(CliqueSet[1-turn]);\r\n symmetricDiff.addAll(CliqueSet[turn]);\r\n //Set<String> tmp = new HashSet<>(CliqueSet[id - 1]);\r\n HashSet<String> tmp1 = SetOperations.intersect(CliqueSet[1-turn], CliqueSet[turn]);\r\n //tmp.retainAll(CliqueSet[turn];\r\n symmetricDiff.removeAll(tmp1);\r\n System.out.println(\"Symmetric Difference Computation end!!\");\r\n turn = 1 - turn;\r\n CliqueSet[turn].clear();\r\n\r\n long symdiff_time = System.currentTimeMillis() - t2;\r\n\r\n long total_time = compute_time + symdiff_time;\r\n \r\n out = new PrintWriter(new BufferedWriter(new FileWriter(out_file, true)));\r\n\r\n out.println(symmetricDiff.size() + \"\\t\" + total_time);\r\n out.close();\r\n System.out.println(id + \": \" + symmetricDiff.size() + \"\\t\" + total_time);\r\n if (eof_flag)\r\n break;\r\n\r\n }\r\n\r\n ebr.close();\r\n\r\n }", "public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }", "public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\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\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\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\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\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\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args)throws Exception {\n\t\tSystem.setIn(new FileInputStream(\"src/data/exam1695.txt\"));\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\t\r\n\t\tN = sc.nextInt();\r\n\t\tmap = new int[N][N];\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tString tmp = sc.next();\r\n\t\t\tchar ch[] = tmp.toCharArray();\r\n\t\t\tfor (int j = 0; j < ch.length; j++) {\r\n\t\t\t\tmap[i][j] = Integer.parseInt(String.valueOf(ch[j]));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tfor (int j = 0; j < N; j++) {\r\n\t\t\t\tif(map[i][j] == 1) {\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\tdfs(i, j, index+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsize = new int[100];\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tfor (int j = 0; j < N; j++) {\r\n\t\t\t\tif(map[i][j] != 0) {\r\n\t\t\t\t\tsize[map[i][j]]++;\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(index);\r\n\t\tint tmp, mid;\r\n\t\tfor (int i = 0; i < size.length; i++) {\r\n\t\t\tmid = i;\r\n\t\t\tfor (int j = 0; j < size.length; j++) {\r\n\t\t\t\tif(size[mid] < size[j]) {\r\n\t\t\t\t\ttmp = size[mid];\r\n\t\t\t\t\tsize[mid] = size[j];\r\n\t\t\t\t\tsize[j] = tmp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < size.length; i++) {\r\n\t\t\tif(size[i] != 0) {\r\n\t\t\t\tSystem.out.println(size[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int[] is : map) {\r\n\t\t\tSystem.out.println(Arrays.toString(is));\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException {\n\n\t\tif (args.length < 4) {\n\n\t\t\tSystem.out.println(\"usage : java program graph clique_set edge_set batch_size out_file\");\n\t\t\tSystem.out.println(\"graph: represented as set of edges in a txt file\");\n\t\t\tSystem.out.println(\"clique_set: set of all maximal cliques of graph in a text file\");\n\t\t\tSystem.out.println(\"edge_set: edges to be added: text file\");\n\t\t\tSystem.out.println(\"batch_size: number of edges in a batch\");\n\t\t\tSystem.out.println(\"out_file: the file to store the output data\");\n\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\tString graph = args[0];\n\t\tString edge_set = args[1];\n\t\tint batch_size = Integer.parseInt(args[2]); // batch count in\n\t\t\t\t\t\t\t\t\t\t\t\t\t// incremental computation\n\t\tString out_file = args[3];\n\n\t\tspacecost = 0;\n\t\t\n\t\tmaxDegree = 0;\n\n\t\tG = new Graph(graph, 1); // input file is in adjacency list format\n\t\t// G = new Graph(graph); //input file is list of edges\n\t\tSystem.out.println(\"Graph reading done\");\n\n\t\tspacecost += G.getSize();\n\n\t\tString line;\n\n\t\tbitsetsize = 0;\n\t\t\n\t\t// System.out.println(\"Reading cliques done\");\n\t\t// System.out.println(\"size of the cliqueset : \" + CliqueSet.size());\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(out_file, true)));\n\t\tout.println();\n\t\tout.println(\"SymDiff-2\");\n\n\t\tout.println(\"#iteration,batch_size,#new,#sub,total_num,size_new,size_sub,total_size-edges,size-new-nodes,size-new-edges,total-size-nodes,new_time,sub_time,total_time,other_time,space in mb, # of max cliques\");\n\t\tout.close();\n\t\tint mb = 1024 * 1024;\n\n\t\tBufferedReader br1 = new BufferedReader(new FileReader(edge_set));\n\t\tint count = 0;\n\t\tboolean eof_flag = false;\n\t\tint index = 0;\n\t\t\n\t\tlong cumulative_time = 0L;\n\t\tlong new_cumulative_time = 0L;\n\t\tlong sub_cumulative_time = 0L;\n\t\t\n\t\tlargeCliqueCount = 0;\n\t\t\n\t\tint total_batch_size = 0;\n\n\t\twhile (true) {\n\n\t\t\tindex = 0;\n\t\t\tcount++;\n\t\t\t\n\t\t\tSet<int[]> batch = new HashSet<>();\n\t\t\t\n\t\t\t//we consider batch size to be the 3*log_2(maxDegree)\n\t\t\t\n\t\t\t//batch_size = 3 * MathOperations.log2(maxDegree);\n\t\t\t\n\t\t\t//if(batch_size == 0)\n\t\t\t//\tbatch_size += 1;\n\t\t\t\n\t\t\t//for now set batch size 1\n\t\t\t//int batch_size = 1;\n\t\t\t\n\t\t\t//total_batch_size += batch_size;\n\n\t\t\twhile (index < batch_size) {\n\t\t\t\tif ((line = br1.readLine()) != null) {\n\t\t\t\t\tbatch.add(new int[] {Integer.parseInt(line.split(\"\\\\s+\")[0]), Integer.parseInt(line.split(\"\\\\s+\")[1])});\n\t\t\t\t\tindex++;\n\t\t\t\t} else {\n\t\t\t\t\teof_flag = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tout = new PrintWriter(new BufferedWriter(new FileWriter(out_file, true)));\n\n\t\t\tsubSize = 0;\n\t\t\tnew SymDiff_noCliqueStore(batch);\n\n\n\t\t\tlong total_number = ncliqueCount + subCliqueCount;\n\t\t\tlong total_size = ncliqueSizes + subSize;\n\t\t\tlong total_size_in_nodes = newCliqueSizeInNodes + subCliqueSizeInNodes;\n\n\t\t\tif(count%10000 == 0)\n\t\t\t\tSystem.out.println(count + \": batch-size: \" + batch_size + \" new: \" + ncliqueCount + \" sub: \" + subCliqueCount + \" time: \" + recompute_time + \"other_time: \" + other_time + \" total edges: \" + total_batch_size);\n\n\t\t\tlong sc = ((spacecost + spacecost2 + spacecost3) * 4 / mb) + (bitsetsize / (8 * mb))\n\t\t\t\t\t+ (Cdel.size() * 8 / mb);\n\n\t\t\tlong for_storing_cliques = (bitsetsize / (8 * mb));\n\n\t\t\tlong for_cdel = (Cdel.size() * 8 / mb);\n\n\t\t\t// spacecost = (instance.totalMemory() - instance.freeMemory())/mb;\n\n\t\t\tlong new_time = recompute_time - sub_time;\n\t\t\t\n\t\t\tcumulative_time += recompute_time;\n\t\t\t\n\t\t\tnew_cumulative_time += new_time;\n\t\t\tsub_cumulative_time += sub_time;\n\n\t\t\tout.println(count + \",\" + batch_size + \",\" + ncliqueCount + \",\" + subCliqueCount + \",\" + total_number + \",\" + ncliqueSizes + \",\" + subSize + \",\" + total_size + \",\" + newCliqueSizeInNodes + \",\" + subCliqueSizeInNodes + \",\"\n\t\t\t\t\t+ total_size_in_nodes + \",\" + new_time + \",\" + sub_time + \",\" + recompute_time + \",\" + other_time + \",\" + cumulative_time + \",\" + sc + \",\"\n\t\t\t\t\t+ for_storing_cliques + \",\" + for_cdel);\n\t\t\tout.close();\n\t\t\t\n\t\t\t//if((total_batch_size > 17000000) || eof_flag){\n\t\t\t//\tSystem.out.println(\"number of edges inserted: \" + total_batch_size);\n\t\t\t//\tSystem.out.println(\"total cumulative time: \" + cumulative_time);\n\t\t\t//\tSystem.out.println(\"new cumulative time: \" + new_cumulative_time);\n\t\t\t//\tSystem.out.println(\"sub cumulative time: \" + sub_cumulative_time);\n\t\t\t//\tbreak;\n\t\t\t//}\n\n\t\t\tif(cumulative_time >= 7200000)\n\t\t\t\tbreak;\n\n\t\t\tif (eof_flag)\n\t\t\t\tbreak;\n\t\t\t\n\n\t\t\t// if (20 == count)\n\t\t\t// break;\n\t\t}\n\t\tbr1.close();\n\n\t}", "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 }", "protected void printClusters(List<Cluster> clusters) {\n ListIterator<Cluster> i = clusters.listIterator();\n while (i.hasNext()) {\n System.out.print(\"----cluster \" + i.nextIndex() + \" : \");\n System.out.println(i.next());\n }\n System.out.println(\"----\");\n }", "public static void main(String[] args) {\n\t\t//Variables\n\t\tint chunkSize = Integer.parseInt(args[1]);\n\t\tint numThreads = Integer.parseInt(args[2]);\n\t\tBufferedReader br = null;\n\t\tReadFromFile rf = new ReadFromFile();\n\t\tArrayList<String> filesInFolder = inputValidation(args);\n\n\t\t//Delete the output folder if it exists\n\t\tFile dirName = new File(\"output\");\n\t\tFile[] files = dirName.listFiles();\n\n\t\t//check if output/ already exists. If exists check for files and delete them\n\t\ttry {\n\t\t\tif (dirName.isDirectory()) {\n\t\t\t\t//Check if files are in folder that need to be deleted\n\t\t\t\tif (files != null) {\n\t\t\t\t\t//delete files in folder\n\t\t\t\t\tfor (File f : files) {\n\t\t\t\t\t\tf.delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Delete the directory before before starting new run of program\n\t\t\t\tdirName.delete();\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Cannot delete output directory, please try again!\");\n\t\t\tSystem.exit(2);\n\t\t}\n\n\t\t//for loop to open and read each individual file\n\t\tfor (String file : filesInFolder) {\n\t\t\ttry {\n\n\t\t\t\tFileReader reader = new FileReader(directoryName + \"\\\\\" + file);\n\t\t\t\tbr = new BufferedReader(reader);\n\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\trf.readFromFile(chunkSize, br, numThreads, file);\n\n\t\t}\n\n\t\t//Call getResults method to start process of combining chunk files\n\t\tgetResults();\n\t\t//Call writeResults method to write results file\n\t\twriteResults();\n\n\t\t//close any streams\n\t\ttry {\n\t\t\tbr.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"br did not close!\");\n\t\t}\n\t}", "public void Synchronize(){\n\t\tfor(int i=0; i<centers.size(); i++){\n\t\t\tHashSet<Integer> datasets = centers.get(i);\n\t\t\tfor(int j=0; j<centers.size(); j++){\n\t\t\t\tif(j!=i){\n\t\t\t\t\tHashSet<Integer> other = centers.get(j);\n\t\t\t\t\tfor (Iterator iterator = other.iterator(); iterator\n\t\t\t\t\t\t\t.hasNext();) {\n\t\t\t\t\t\tInteger data = (Integer) iterator.next();\n\t\t\t\t\t\tif(!datasets.contains(data)){\n\t\t\t\t\t\t\tSystem.out.println(data + \" \" + (j+1) + \" \" + (i+1));\n\t\t\t\t\t\t\tdatasets.add(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"done\");\n\t}", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n int n = Integer.parseInt(f.readLine());\n HashSet<String> res = new HashSet<>();\n for(int i = 0; i < n; i++) {\n StringTokenizer st = new StringTokenizer(f.readLine());\n int k = Integer.parseInt(st.nextToken());\n int b = -Integer.parseInt(st.nextToken());\n if(k == 0) {\n continue;\n }\n if(k < 0) {\n k = -k;\n b = -b;\n }\n int gcd = gcd(k, Math.abs(b));\n k /= gcd;\n b /= gcd;\n res.add(b+\"/\"+k);\n }\n out.println(res.size());\n f.close();\n out.close();\n }", "@Test\r\n public void testMerge() throws Exception {\r\n// List<ISpectrum> spectra = ClusteringTestUtilities.readConsensusSpectralItems();\r\n//\r\n// List<ICluster> list = ClusterUtilities.asClusters(spectra);\r\n// IClusteringEngine engine = new ClusteringEngineFactory().getClusteringEngine();\r\n// for (ICluster sc : list) {\r\n// engine.addClusters(sc);\r\n// }\r\n// for (int i = 0; i < Defaults.getNumberReclusteringPasses(); i++) {\r\n// if (!engine.processClusters())\r\n// break;\r\n// }\r\n// // we have solved for these\r\n// List<ICluster> found = (List<ICluster>) engine.getClusters();\r\n//\r\n//\r\n// final ISimilarityChecker similarityChecker = new FrankEtAlDotProduct(Defaults.getFragmentIonTolerance(), Defaults.getNumberComparedPeaks());\r\n// final List<ICluster> newClusters = ClusterUtilities.mergeClusters(found, similarityChecker, 1);\r\n//\r\n// // because we just did this in the engine we expect little further merging\r\n// Assert.assertEquals(newClusters.size(), found.size());\r\n\r\n\r\n }", "public static void main(String[] args) {\n\t\tint a[] = { 9, 3, 6, 4, 7, 2, 1 }; // size=7\n\t\tint b[] = { 14, 3, 2, 6, 9, 7 }; //size =6\n\t\tint c[] = {24,23,12,13,7,6,7,2}; // size=8\n\t\tint d[] = new int[a.length + b.length+c.length];\n\t\t\n\t\t\n\t\t\n\t//merging\n\t\t\n\t\t\n\t\t\n\t\tfor (int i = 0; i < a.length; i++) \n\t{ \n\t\t\td[i] = a[i];\n\n\t}\n\t\tint k = 0;\n\t\tfor (int j = a.length; j < a.length+b.length; j++) \n\t{\n\t\t\td[j] = b[k];\n\t\t\tk = k + 1;\n\n\t}\n int m=0;\n\t\tfor (int l = a.length+b.length; l < d.length; l++)\n\t{\n\t\t d[l]=c[m];\t\n\t\t m=m+1;\n\n\t}\n\t\t//merging print statement\n\t\tfor (int i =0;i < d.length; i++)\n\t\t{\n\t\t\t /// System.out.print(d[i]+\" \");\n\t\t}\n\t\t\n\t\t \n\t\t//duplicate checking\n\t\tfor (int i =0;i < d.length; i++)\n\t\t\t\n\t\t{\n\t\t\tfor (int j =i+1;j < d.length; j++)\t\n\t\t\t{\n\t\t\t\tif(d[i]==d[j])\n\t\t\t\t{\n\t\t\t\t\td[j]=0;\n\t\t\t\t}\n\t\t\t\tif (d[i] > d[j])\n\n\t\t\t\t{ // sorting swap logic\n\t\t\t\t\t//int temp; \n\t\t\t\t\t//temp = d[i]; \n\t\t\t\t//\td[i] = d[j]; \n\t\t\t\t//\td[j] = temp;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\td[i] = d[i] + d[j];\n\t\t\t\t\td[j] = d[i] - d[j];\n\t\t\t\t\td[i] = d[i] - d[j];\n\n\t\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\t\n\t\t\n\t} //removing the finding duplicates\n\t\tfor (int h =0;h < d.length; h++)\n\t\t{\n\t\t\tif(d[h]!=0)\n\t\t\t{\n\t\t\t\tSystem.out.print(d[h]+\" \");\n\t\t\t}\n\t\t}\n\n}", "public static void main(String[] args) {\n\t\t\n\t\tInteger k = 5;\n\t\t\n\t\tProcess model = new Process();\n\t\ttry {\n\t\t\tmodel.loadData(\"./datas/UserVector.txt\");\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\tEntry<Integer[], Double> ret = model.cluster(k);\n\t\tInteger[] ret_label = ret.getKey();\n\t\tInteger[] cnt = new Integer[31];\n\t\tfor(Integer i=0; i<=30; ++i)cnt[i] = 0;\n\t\tfor(Integer i=0; i<30; ++i)\n\t\t{\n\t\t\tcnt[ ret_label[i] ] ++;\n\t\t\tSystem.out.print((i+1) + \":\" + ret_label[i] + \" \");\n\t\t\tif(i%5==4)System.out.println();\n\t\t}\n\t\tfor(Integer i=0; i<k; ++i)System.out.println(i + \":\" + cnt[i]);\n\t}", "public static void main(String args[]) throws IOException{\n\t\tString filename=null;\n\t\tString outfileNoS=\"CorpusOutputNoS.txt\";\n\t\tString outfileS=\"CorpusOutputS.txt\";\n\t\tString outfileT=\"CorpusOutputT.txt\";\n\t\tString str;\n\t\t\n\t\tFile out1= new File(outfileNoS);\n\t\twriter1= new FileWriter(out1);\n\t\t\n\t\tFile out2= new File(outfileS);\n\t\twriter2= new FileWriter(out2);\n\t\t\n\t\tFile out3= new File(outfileT);\n\t\twriter3= new FileWriter(out3);\n\t\t\n\t\tString given=null; \n\t\tif(args.length>0)\n\t\t\tfilename=args[0];\n\t\t\n\t\tcorpusTokens = new ArrayList<String>();\n\t\tcorpusUnigramCount = new HashMap<String, Integer>();\n\t\tcorpusBigramCount = new HashMap<String, Integer>();\n\t\tcorpusBigramProb= new HashMap<String,Double>();\n\t\tcorpusNumOfBigrams=0;\n\t\t\n\t\tScanner in = new Scanner(new File(filename));\n\t\t\n//----------------------------------CORPUS BEGIN-------------------------\n\t\t//finds unigram and Bigram count in Corpus and display it\n\t\tcorpusNumOfBigrams=findBigramCount(in,corpusTokens,corpusUnigramCount,corpusBigramCount);\n\t\t\n\t\t//Find corpus Bigram Prob and display it\n\t\tfindBigramProb(corpusUnigramCount,corpusBigramCount,corpusBigramProb,corpusTokens,corpusNumOfBigrams);\n\t\t\n\t\tint V= corpusUnigramCount.size();\n\n\t\t//display details of corpus\n\t\tstr=String.valueOf(corpusNumOfBigrams)+\"\\n\"; //number of Bigrams\n\t\tstr+=String.valueOf(corpusBigramCount.size())+\"\\n\";//Unique Bigram count \n\t\tstr+=String.valueOf(V)+\"\\n\";//Unique Unigram count \n\t\tstr+= String.valueOf(corpusTokens.size())+\"\\n\";//Total count\n\t\tstr+=\"\\n\";\n\t\twriter1.write(str);\n\t\t\n\t\tdisplayCount1(corpusUnigramCount);\n\t\tdisplayCount1(corpusBigramCount);\n\t\tdisplayProb1(corpusBigramProb);\n\t\t\n\t\t\n//-----------------------------------CORPUS END--------------------------------\n\n//-------------------------Add-one Smoothing begins--------------------\n\t\t\n\t\tfindBigramProbSmoothing(corpusBigramCount,V);\n\t\tdisplayProb2(bigramProbS);\n//----------------------Add-one smoothing ends--------------------------\n\t\t\n//-------------------Good-Turing Discounting Begins-------------------------\n\t\t\n\t\t//finds the initial bucket count using the bigram count before smoothing \n\t\tdoBucketCount(corpusBigramCount);\n\t\t\n\t\tstr=bucketCountT.size()+\"\\n\\n\";\n\t\twriter3.write(str);\n\t\tdisplayBucketCount3();\n\t\t\n\t\t//finding new Counts with Good Turing discounting\n\t\tfindBigramCountsTuring();\n\t\t\n\t\t\n\t\t//finding bigram probabilities with Good Turing discounting\n\t\tfindBigramProbTuring();\n\t\tdisplayProb3(bigramProbT);\n\t\t\n//--------------------Good-Turing Discounting Ends-------------------------\n\t\twriter1.close();\n\t\twriter2.close();\n\t\twriter3.close();\n\t}", "public static void main(String args[]) throws Exception {\n\n String sourceFile = args[0]; //source file has supervised SRL tags\n String targetFile = args[1]; //target file has supervised SRL tags\n String alignmentFile = args[2];\n String sourceClusterFilePath = args[3];\n String targetClusterFilePath = args[4];\n String projectionFilters = args[5];\n double sparsityThresholdStart = Double.parseDouble(args[6]);\n double sparsityThresholdEnd = Double.parseDouble(args[6]);\n\n\n Alignment alignment = new Alignment(alignmentFile);\n HashMap<Integer, HashMap<Integer, Integer>> alignmentDic = alignment.getSourceTargetAlignmentDic();\n\n final IndexMap sourceIndexMap = new IndexMap(sourceFile, sourceClusterFilePath);\n final IndexMap targetIndexMap = new IndexMap(targetFile, targetClusterFilePath);\n ArrayList<String> sourceSents = IO.readCoNLLFile(sourceFile);\n ArrayList<String> targetSents = IO.readCoNLLFile(targetFile);\n\n System.out.println(\"Projection started...\");\n DependencyLabelsAnalyser dla = new DependencyLabelsAnalyser();\n for (int senId = 0; senId < sourceSents.size(); senId++) {\n if (senId % 100000 == 0)\n System.out.print(senId);\n else if (senId % 10000 == 0)\n System.out.print(\".\");\n\n Sentence sourceSen = new Sentence(sourceSents.get(senId), sourceIndexMap);\n Sentence targetSen = new Sentence(targetSents.get(senId), targetIndexMap);\n int maxNumOfProjectedLabels = dla.getNumOfProjectedLabels(sourceSen, alignmentDic.get(senId));\n double trainGainPerWord = (double) maxNumOfProjectedLabels/targetSen.getLength();\n\n if (trainGainPerWord >= sparsityThresholdStart && trainGainPerWord< sparsityThresholdEnd) {\n dla.analysSourceTargetDependencyMatch(sourceSen, targetSen, alignmentDic.get(senId),\n sourceIndexMap, targetIndexMap, projectionFilters);\n }\n }\n System.out.print(sourceSents.size() + \"\\n\");\n dla.writeConfusionMatrix(\"confusion_\"+sparsityThresholdStart+\"_\"+sparsityThresholdEnd+\".out\", sourceIndexMap, targetIndexMap);\n }", "public static void main(String[] args){\n\n // Create file\n File file = new File(inputfileName);\n\n try {\n BufferedReader in = new BufferedReader(new FileReader(file.getAbsoluteFile()));\n try {\n\n //Read the first 3 lines\n String string1 = in.readLine();\n String string2 = in.readLine();\n String string3 = in.readLine();\n //Ignore an empty string\n in.readLine();\n\n String[] mn = string1.split(\" \");\n String[] sc = string2.split(\" \");\n\n //Initialize m, n, lineNumber, colmn, condition\n m = Integer.parseInt(mn[0]);\n n = Integer.parseInt(mn[1]);\n lineNumber = Integer.parseInt(sc[0]);\n colmn = Integer.parseInt(sc[1]);\n condition = Integer.parseInt(string3);\n\n //Validation of basic parameters\n validation(m, n, condition, lineNumber, colmn);\n\n //----------------------We alternately read all the matrices------------------------\n for (int i = 0; i < m; i++){\n String matrixStr = \"\";\n for (int j = 0; j < n; j++){\n matrixStr += in.readLine() + \" \";\n }\n in.readLine();\n\n int[] tmpIntArray = strToIntArr(matrixStr.trim().split(\" \"));\n\n if(i == 0){\n rezult = getFirstResultString(tmpIntArray);\n continue;\n }else {\n multiplication(matrixStr);\n }\n }\n\n //The desired number\n int rezultValue = rezult[colmn - 1];\n\n //Check the result of the last multiplication\n if(rezultValue >= condition){\n write((rezultValue % condition) + \"\");\n }else {\n write(rezultValue + \"\");\n }\n //---------------------------------------------------------------------------------\n } finally {\n in.close();\n }\n } catch(IOException e) {\n throw new RuntimeException(e);\n }\n }", "void exec3(DeletedDirectoryEntry entry, String outdir, String file) throws Exception {\r\n\r\n byte[] buffer = new byte[fat32.getBytesPerCluster()]; \r\n\r\n //\r\n // startClusterHigh を見つける\r\n //\r\n if (!entry.resolveStartCluster(id3v2MatchingStrategy) || !entry.isStartClusterValid()) {\r\nSystem.err.println(\"start cluster not found: \" + file);\r\n return;\r\n }\r\n int startCluster = entry.getStartCluster();\r\n\r\n //\r\n // 連続しているクラスターを書き出す\r\n // 途切れたら次の使われていないところ\r\n //\r\n\r\nSystem.err.println(entry.getName() + \": \" + entry.getStartCluster() + \", \" + entry.length());\r\n\r\n int block = 0;\r\n boolean continued = false;\r\nouter:\r\n for (int cluster = 0; cluster < fat32.getLastCluster(); cluster++) {\r\n int targetCluster = startCluster + cluster;\r\nSystem.err.print(\"cluster: \" + targetCluster);\r\n\r\n // 途切れたら次の使われていないところ\r\n\r\n if (fat32.isUsing(targetCluster)) {\r\nSystem.err.println(\" has used, skip\");\r\n continued = false;\r\n continue;\r\n } else {\r\n if (continued == false) {\r\n continued = true;\r\n block++;\r\nSystem.err.println(\" block: \" + block);\r\n }\r\n fat32.readCluster(buffer, targetCluster);\r\nif (block > 1) {\r\n System.err.println(\"\\n\" + StringUtil.getDump(buffer, 128));\r\n}\r\n }\r\n\r\nSystem.err.println();\r\n }\r\n\r\n }", "public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "@Test public void testWithSegmentation() throws IOException\n {\n final File inDir = tempDir.toFile();\n final File outDir = tempDir.toFile();\n // Copy HDD file.\n try(final Reader r = DDNExtractorTest.getETVEGLLHDD2016H1CSVReader())\n {\n try(final FileWriter w = new FileWriter(new File(inDir, ETVSimpleDriverNBulkInputs.INPUT_FILE_HDD)))\n { cpReaderToWriter(r, w); }\n }\n // Copy sample household data file.\n try(final Reader r = ETVParseTest.getNBulkSH2016H1CSVReader())\n {\n try(final FileWriter w = new FileWriter(new File(inDir, ETVSimpleDriverNBulkInputs.INPUT_FILE_NKWH)))\n { cpReaderToWriter(r, w); }\n }\n // Copy valve logs (from compressed to uncompressed form in, in this case).\n try(final Reader r = HDDUtil.getGZIPpedASCIIResourceReader(ETVParseTest.class, ETVParseTest.VALVE_LOG_SAMPLE_DIR + \"/2d1a.json.gz\"))\n {\n try(final FileWriter w = new FileWriter(new File(inDir, \"3015.json\")))\n { cpReaderToWriter(r, w); }\n }\n // Create (trivial) grouping...\n try(final Reader r = new StringReader(\"5013,3015\"))\n {\n try(final FileWriter w = new FileWriter(new File(inDir, OTLogActivityParse.LOGDIR_PATH_TO_GROUPING_CSV)))\n { cpReaderToWriter(r, w); }\n }\n\n // Ensure no old result files hanging around...\n final File basicResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_BASIC);\n basicResultFile.delete(); // Make sure no output file.\n assertFalse(\"output file should not yet exist\", basicResultFile.isFile());\n final File basicFilteredResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_FILTERED_BASIC);\n basicFilteredResultFile.delete(); // Make sure no output file.\n assertFalse(\"output filtered file should not yet exist\", basicFilteredResultFile.isFile());\n final File segmentedResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_SEGMENTED);\n segmentedResultFile.delete(); // Make sure no output file.\n assertFalse(\"output segmented file should not yet exist\", segmentedResultFile.isFile());\n final File summaryResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_MULITHOUSEHOLD_SUMMARY);\n summaryResultFile.delete(); // Make sure no output file.\n assertFalse(\"output summary file should not yet exist\", summaryResultFile.isFile());\n // Do the computation...\n ETVSimpleDriverNBulkInputs.doComputation(inDir, outDir);\n // Check results.\n assertTrue(\"output file should now exist\", basicResultFile.isFile());\n assertTrue(\"output filtered file should now exist\", basicFilteredResultFile.isFile());\n assertTrue(\"output segmented file should now exist\", segmentedResultFile.isFile());\n assertTrue(\"output summary file should now exist\", summaryResultFile.isFile());\n final String expected =\n \"\\\"house ID\\\",\\\"slope energy/HDD\\\",\\\"baseload energy\\\",\\\"R^2\\\",\\\"n\\\",\\\"efficiency gain if computed\\\"\\n\" +\n \"\\\"5013\\\",1.5532478,1.3065631,0.62608224,156,\\n\";\n final String actualBasic = new String(Files.readAllBytes(basicResultFile.toPath()), \"ASCII7\");\n assertEquals(expected, actualBasic);\n final String actualFilteredBasic = new String(Files.readAllBytes(basicFilteredResultFile.toPath()), \"ASCII7\");\n assertEquals(expected, actualFilteredBasic);\n final String expectedS =\n \"\\\"house ID\\\",\\\"slope energy/HDD\\\",\\\"baseload energy\\\",\\\"R^2\\\",\\\"n\\\",\\\"efficiency gain if computed\\\"\\n\" +\n \"\\\"5013\\\",1.138506,5.764153,0.24607657,10,1.9855182\\n\";\n final String actualSegmented = new String(Files.readAllBytes(segmentedResultFile.toPath()), \"ASCII7\");\n//System.out.println(actualSegmented);\n assertEquals(expectedS, actualSegmented);\n final String expectedSummary =\n ETVHouseholdGroupSimpleSummaryStatsToCSV.headerCSV + '\\n' +\n \"1,1,10,0.24607657,0.0,1.138506,0.0,1.9855182,0.0\\n\";\n final String actualSummary = new String(Files.readAllBytes(summaryResultFile.toPath()), \"ASCII7\");\nSystem.out.println(actualSummary);\n assertEquals(expectedSummary, actualSummary);\n // TODO: verify textual report if any?\n }", "void exec1(DeletedDirectoryEntry entry, String outdir, String file) throws Exception {\r\n\r\n byte[] buffer = new byte[fat32.getBytesPerSector()];\r\n\r\n boolean incomplete = false;\r\n\r\n //\r\n // startClusterHigh を見つける\r\n //\r\n\r\n if (!entry.resolveStartCluster(id3v2MatchingStrategy) || !entry.isStartClusterValid()) {\r\nSystem.err.println(\"start cluster not found: \" + file);\r\n return;\r\n }\r\n int startCluster = entry.getStartCluster();\r\n\r\n //\r\n // 連続しているクラスターを書き出す\r\n // 途切れたら終わり\r\n //\r\n \r\n File output = new File(outdir, file);\r\n OutputStream os = new FileOutputStream(output);\r\n\r\nSystem.err.println(entry.getName() + \": \" + entry.getStartCluster() + \", \" + entry.length());\r\n\r\n long rest = entry.length();\r\n\r\n\r\nouter:\r\n for (int cluster = 0; cluster < fat32.getLastCluster(); cluster++) {\r\n int targetCluster = startCluster + cluster;\r\nSystem.err.print(\"cluster: \" + targetCluster);\r\n\r\n\r\n // 途切れたら終わり\r\n\r\n if (fat32.isUsing(targetCluster)) {\r\nSystem.err.println(\" has used, skip\");\r\nint restClusters = fat32.getRequiredClusters(rest);\r\nSystem.err.println(\"rest: \" + file + \": \" + restClusters + \" clusters, \" + rest + \" / \" + entry.length());\r\n incomplete = true;\r\nSystem.err.println(\"salvage, not continued: \" + file + \": \" + (entry.length() - rest) + \" / \" + entry.length());\r\n break outer;\r\n }\r\n\r\n\r\n // 1 クラスタの書き出し\r\n\r\n for (int sector = 0; sector < fat32.getSectorsPerCluster(); sector++) {\r\n int targetSector = fat32.getSector(targetCluster) + sector;\r\n fat32.readSector(buffer, targetSector);\r\n if (rest > fat32.getBytesPerSector()) {\r\n os.write(buffer, 0, fat32.getBytesPerSector());\r\n rest -= fat32.getBytesPerSector();\r\n } else {\r\n os.write(buffer, 0, (int) rest);\r\n rest -= rest;\r\n break outer;\r\n }\r\n }\r\nSystem.err.println(\" salvaged: \" + (entry.length() - rest) + \" / \" + entry.length());\r\n }\r\n\r\nSystem.err.println(\"salvage finished: \" + (entry.length() - rest) + \"/\" + entry.length());\r\n\r\n\r\n os.flush();\r\n os.close();\r\n output.setLastModified(entry.lastModified());\r\n\r\n // 途切れたら incomplete を付ける\r\n \r\n if (incomplete) {\r\n output.renameTo(new File(outdir, file + \".\" + \"incomplete\"));\r\n }\r\n }", "public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in=new BufferedReader(new InputStreamReader(System.in));\n\t\tint tc=Integer.parseInt(in.readLine());\n\t\tfor(int t=1;t<=tc;t++) {\n\t\t\tint answer=0;\n\t\t\tn=Integer.parseInt(in.readLine());\n\t\t\tm=Integer.parseInt(in.readLine());\n\t\t\tmap1=new boolean[n+1][n+1];\n\t\t\tmap2=new boolean[n+1][n+1];\n\t\t\t\n\t\t\tfor(int i=0;i<m;i++) {\n\t\t\t\tStringTokenizer token=new StringTokenizer(in.readLine());\n\t\t\t\tint from=Integer.parseInt(token.nextToken());\n\t\t\t\tint to=Integer.parseInt(token.nextToken());\n\t\t\t\tmap1[from][to]=true;\n\t\t\t\tmap2[to][from]=true;\n\t\t\t}\n\t\t\tfor(int i=1;i<=n;i++) {\n\t\t\t\tv1=new boolean[n+1];\n\t\t\t\tv2=new boolean[n+1];\n\t\t\t\tnum1=0;\n\t\t\t\tnum2=0;\n\t\t\t\tdfs1(i);\n\t\t\t\tdfs2(i);\n\t\t\t\tif(num1+num2==n-1)answer++;\n\t\t\t}\n\t\t\tSystem.out.println(\"#\"+t+\" \"+answer);\n\t\t\t\n\t\t}\n\t}", "private static void k_means_online(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n //writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "void mainOutput(int[][] matrixCID, int[][] valuesChunk, int SLOC, int TCL, int refactoredSize, float PR, String fileName){\n\t\tif(output){\t\n\t\t\tString outputName = \"Results-\";\n\t\t\tif(verbose)\n\t\t\t\toutputName = \"VerboseResults-\";\n\t\t\tString[] temp = fileName.split(\"\\\\\\\\\");\n\t\t\ttemp = temp[temp.length-1].split(\"\\\\.nw\");\n\t\t\toutputName += temp[0] + \".tsv\";\n\t\t\ttry {\n\t\t\t\tsetOutput(outputName);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(verbose){\n\t\t\t//print out full table\n\t\t\tdisplayValues(matrixCID);\n\t\t\tSystem.out.println(\"--------------------------------------------------------------\");\n\t\t\tSystem.out.println(\"Initial Size:\\t\\t\" + SLOC + \"\\t|S|\");\n\t\t\tSystem.out.println(\"Total Clone Length:\\t\" + TCL + \"\\tTCL\");\n\t\t\tSystem.out.println(\"Refactored Size:\\t\" + refactoredSize + \"\\t|S'|\");\n\t\t\tSystem.out.println(\"Percent Refactored:\\t\" + PR + \"\\tPR\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"|S|\\tTCL\\t|S'|\\tPR\");\n\t\t\tSystem.out.println(SLOC + \"\\t\" + TCL + \"\\t\" + refactoredSize + \"\\t\" + PR);\n\t\t}\n\t\t\n\t\tif(calc){\n\t\t\tSystem.out.println(\"--------------------------------------------------------------\");\n\t\t\tshowCalculation(valuesChunk, SLOC, TCL, matrixCID);\n\t\t\tSystem.out.println(\"--------------------------------------------------------------\");\n\t\t}\n\t\t\n\t\tresetOutput();\n\t}", "public static void main(String[] args) throws Exception\n {\n if (args.length==0 || args[0].equals(\"-h\")){\n System.err.println(\"Tests: call as $0 org1=g1.fa,org2=g2.fa annot.txt 5ss-motif 5ss-boundary 3ss-motif 3ss-boundary\");\n System.err.println(\"Outputs splice site compositions.\");\n System.exit(9);\n }\n \n int arg_idx=0;\n String genome_fa_list = args[arg_idx++];\n String annotation_file = args[arg_idx++];\n int donor_motif_length = Integer.parseInt(args[arg_idx++]);\n int donor_boundary_length = Integer.parseInt(args[arg_idx++]);\n int acceptor_motif_length = Integer.parseInt(args[arg_idx++]);\n int acceptor_boundary_length = Integer.parseInt(args[arg_idx++]);\n\n AnnotatedGenomes annotations = new AnnotatedGenomes();\n List<String> wanted_organisms = annotations.readMultipleGenomes(genome_fa_list);\n annotations.readAnnotations(annotation_file); \n \n SpliceSiteComposition ss5[] = new SpliceSiteComposition[wanted_organisms.size()];\n SpliceSiteComposition ss3[] = new SpliceSiteComposition[wanted_organisms.size()];\n \n for (int org_idx=0; org_idx<wanted_organisms.size(); org_idx++)\n {\n String org = wanted_organisms.get(org_idx);\n System.out.println(\"#SSC organism \"+org);\n \n SpliceSiteComposition don = ss5[org_idx] = new SpliceSiteComposition(donor_motif_length, donor_boundary_length, true);\n SpliceSiteComposition acc = ss3[org_idx] = new SpliceSiteComposition(acceptor_motif_length, acceptor_boundary_length, false);\n\n for (GenePred gene: annotations.getAllAnnotations(org))\n {\n don.countIntronSites(gene);\n acc.countIntronSites(gene);\n\n } // for gene \n \n //don.reportStatistics(System.out);\n //acc.reportStatistics(System.out);\n don.writeData(System.out);\n acc.writeData(System.out);\n \n } // for org\n }", "public void printCluster(PrintStream outs)\n {\n for (String upNode : getLiveNodes().split(\"\\\\s+\"))\n {\n if (upNode.length() > 0)\n {\n outs.println(String.format(\"%-21s up\", upNode));\n }\n }\n \n for (String downNode : getUnreachableNodes().split(\"\\\\s+\"))\n {\n if (downNode.length() > 0)\n {\n outs.println(String.format(\"%-21s down\", downNode));\n }\n }\n }", "public static void main(String[] args)throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n int testCases = Integer.parseInt(br.readLine());\r\n //loop through all test cases\r\n for(int q = 0; q < testCases; q++){\r\n int iterator = 0;\r\n //initilize variables\r\n size = new ArrayList<Integer>();position = new ArrayList<Integer>();network = new HashMap<String, Integer>();\r\n int relationships = Integer.parseInt(br.readLine());\r\n //loop through all relationships\r\n for(int v = 0; v < relationships; v++){\r\n String[] people = br.readLine().split(\" \");\r\n String person1 = people[0]; String person2 = people[1];\r\n //add two people to the netword and union their roots\r\n if(!network.containsKey(person1)){network.put(person1, iterator); position.add(iterator++); size.add(1);}\r\n if(!network.containsKey(person2)){network.put(person2, iterator); position.add(iterator++); size.add(1);}\r\n union(person1,person2);\r\n //print output\r\n System.out.println(size.get(find(person1)));\r\n }\r\n }\r\n }", "protected final void go(CommandLine options)\r\n {\r\n final File outputDir = (File) getOption(options, \"output\", null);\r\n final File descriptors = (File) getOption(options, \"algorithms\", new File(\"algorithms\"));\r\n \r\n super.config.setDefaultValue(ConfigConstants.ATTR_CLUSTERS_ONLY, new Boolean(options.hasOption(\"co\")));\r\n super.config.setDefaultValue(ConfigConstants.ATTR_DEFAULT_PROCESSID, options.getOptionValue(\"algorithm\"));\r\n super.config.setDefaultValue(ConfigConstants.ATTR_OUTPUT_FORMAT, \r\n options.hasOption(\"json\") ? ControllerContext.RESULTS_TO_JSON :\r\n options.hasOption(\"xml\") ? ControllerContext.RESULTS_TO_XML : null);\r\n \r\n final boolean verbose = options.hasOption(\"verbose\");\r\n if (verbose)\r\n {\r\n logger.setLevel(Level.DEBUG);\r\n }\r\n \r\n if (outputDir != null && !outputDir.exists())\r\n {\r\n logger.info(\"Creating output folder: \" + outputDir.getAbsolutePath());\r\n if (!outputDir.mkdirs())\r\n {\r\n logger.error(\"Could not create output folder: \" + outputDir.getAbsolutePath());\r\n return;\r\n }\r\n }\r\n \r\n if (outputDir == null)\r\n {\r\n logger.warn(\"Output directory not specified, clustering without saving the result.\");\r\n }\r\n \r\n // Initialize processes.\r\n final ControllerContext context;\r\n try\r\n {\r\n context = initializeContext(descriptors);\r\n }\r\n catch (Exception e)\r\n {\r\n getLogger().fatal(\"Could not initialize clustering algorithms. Inspect log files.\", e);\r\n return;\r\n }\r\n \r\n final String processId = config.getString(ConfigConstants.ATTR_DEFAULT_PROCESSID);\r\n if (processId == null || !context.getController().getProcessIds().contains(processId))\r\n {\r\n if (processId == null)\r\n {\r\n getLogger().fatal(\"Provide the identifier of a clustering algorithm to use.\");\r\n }\r\n else\r\n {\r\n getLogger().fatal(\"This clustering algorithm is not available: \" + processId);\r\n }\r\n return;\r\n }\r\n \r\n // Collect files to process.\r\n final String [] unprocessed = options.getArgs();\r\n final ArrayList files = new ArrayList();\r\n \r\n for (int i = 0; i < unprocessed.length; i++)\r\n {\r\n final File file = new File(unprocessed[i]);\r\n if (!file.exists())\r\n {\r\n logger.warn(\"File does not exist, skipping: \" + file);\r\n continue;\r\n }\r\n \r\n if (file.isDirectory())\r\n {\r\n final File [] subfiles = file.listFiles(new FileFilter()\r\n {\r\n public boolean accept(File subfile)\r\n {\r\n return (subfile.isFile() && subfile.canRead());\r\n }\r\n });\r\n files.addAll(Arrays.asList(subfiles));\r\n }\r\n else\r\n {\r\n files.add(file);\r\n }\r\n }\r\n \r\n // Run batch clustering.\r\n try\r\n {\r\n if (files.isEmpty())\r\n {\r\n getLogger().warn(\"Empty list of input files. Provide files and/or directories as program arguments.\");\r\n }\r\n \r\n for (Iterator i = files.iterator(); i.hasNext();)\r\n {\r\n final File f = (File) i.next();\r\n logger.info(\"Processing file: \" + f.getName());\r\n \r\n OutputStream outputStream = null;\r\n InputStream inputStream = null;\r\n try\r\n {\r\n inputStream = new FileInputStream(f);\r\n if (outputDir != null)\r\n {\r\n outputStream = new FileOutputStream(new File(outputDir, f.getName()));\r\n }\r\n else\r\n {\r\n outputStream = new ByteArrayOutputStream();\r\n }\r\n \r\n final String processName = config.getRequiredString(ConfigConstants.ATTR_DEFAULT_PROCESSID);\r\n final String outputProcessName = null;\r\n final boolean clustersOnly = config.getRequiredBoolean(ConfigConstants.ATTR_CLUSTERS_ONLY);\r\n ProcessingUtils.cluster(context.getController(), getLogger(), inputStream, outputStream, processName, outputProcessName, clustersOnly);\r\n }\r\n catch (IOException e)\r\n {\r\n if (outputStream != null) outputStream.close();\r\n if (inputStream != null) inputStream.close();\r\n }\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n getLogger().fatal(\"Unhandled program error occurred.\", e);\r\n }\r\n \r\n getLogger().info(\"Finished.\");\r\n }", "public static void main(String[] args) {\n Path inputRatingsPath = new Path(args[0]); //movieid, userid, rating (text files)\n Path job1OutputPath = new Path(\"/user/hduser/partialResults\"); \n Path partialDistancesPath = new Path(\"/user/hduser/partialResults/part-*\"); //member_nonMember \\t partialDistance (sequence files)\n Path candidateMoviesPath = new Path(\"/user/hduser/partialResults/candidateMovies-*\"); //candidateMovieId, nonMemberUserId_rating (text files)\n Path userSimilaritiesPath = new Path(\"/user/hduser/userSimilarities\"); //similarity of each group member to his friends (text files)\n Path finalScoresPath = new Path(args[1]); //movieId \\t outputScore\n \n int numReduceTasks = 56; //defaultValue\n if (args.length == 3) {\n numReduceTasks = Integer.parseInt(args[2]);\n }\n \n final float friendsSimThresh = 0.8f;\n \n String groupFilePath = \"/user/hduser/group.txt\"; //one-line csv file with user ids (text file)\n \n if (args.length < 2 || args.length > 3) {\n System.err.println(\"Incorrect input. Example usage: hadoop jar ~/GroupRecs/MultiUser.jar inputPath outputPath [numReduceTasks]\");\n return;\n }\n \n //JOB 1//\n JobClient client = new JobClient();\n JobConf conf = new JobConf(gr.forth.ics.isl.grouprecsmr.multiuser.MultiUserMain.class);\n \n try {\n FileSystem fs = FileSystem.get(conf);\n if (fs.exists(job1OutputPath)) {\n fs.delete(job1OutputPath, true);\n }\n if (fs.exists(userSimilaritiesPath)) {\n fs.delete(userSimilaritiesPath, true);\n }\n if (fs.exists(finalScoresPath)) {\n fs.delete(finalScoresPath, true);\n }\n } catch (IOException ex) {\n Logger.getLogger(MultiUserMain.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n conf.setJobName(\"Multi-user approach - Job 1\");\n System.out.println(\"Starting Job 1 (Multi-user approach)...\");\n\n conf.setMapOutputKeyClass(VIntWritable.class);\n conf.setMapOutputValueClass(Text.class);\n\n conf.setOutputKeyClass(Text.class);\n conf.setOutputValueClass(ByteWritable.class);\n\n conf.setInputFormat(TextInputFormat.class);\n //conf.setOutputFormat(TextOutputFormat.class);\n conf.setOutputFormat(SequenceFileOutputFormat.class);\n SequenceFileOutputFormat.setOutputCompressionType(conf,\tSequenceFile.CompressionType.BLOCK);\n\n FileInputFormat.setInputPaths(conf, inputRatingsPath); //user ratings\n FileOutputFormat.setOutputPath(conf, job1OutputPath); //partial distances\n \n MultipleOutputs.addNamedOutput(conf, \"candidateMovies\", SequenceFileOutputFormat.class,VIntWritable.class, Text.class); //movieId, userId_rating\n\n conf.setMapperClass(gr.forth.ics.isl.grouprecsmr.job1.Job1Mapper.class);\t\t\n conf.setReducerClass(gr.forth.ics.isl.grouprecsmr.job1.Job1Reducer.class);\n\n conf.setNumReduceTasks(numReduceTasks);\n\n try {\n DistributedCache.addCacheFile(new URI(groupFilePath), conf); // group\t\n } catch (URISyntaxException e1) {\n System.err.println(e1.toString());\n }\n \n conf.setInt(\"mapred.task.timeout\", 6000000);\n \n client.setConf(conf);\n RunningJob job;\n try {\n job = JobClient.runJob(conf);\t\n job.waitForCompletion();\n } catch (Exception e) {\n System.err.println(e);\n }\n \n \n \n //JOB 2//\n System.out.println(\"Starting Job 2 (Multi-user approach)...\");\n JobClient client2 = new JobClient();\n JobConf conf2 = new JobConf(gr.forth.ics.isl.grouprecsmr.multiuser.MultiUserMain.class);\n\n conf2.setJobName(\"Multi-user approach - Job 2\");\n\n conf2.setMapOutputKeyClass(Text.class); //user pair (member_nonMember), where nonMember is in friends\n conf2.setMapOutputValueClass(ByteWritable.class);//similarity part unsquared\n \n conf2.setOutputKeyClass(Text.class); //user pair (member_nonMember), where nonMember is in friends\n conf2.setOutputValueClass(DoubleWritable.class);//similarity\n\n conf2.setInputFormat(SequenceFileInputFormat.class);\n //conf2.setInputFormat(TextInputFormat.class);\n conf2.setOutputFormat(TextOutputFormat.class);\n //conf2.setOutputFormat(SequenceFileOutputFormat.class);\n //SequenceFileOutputFormat.setOutputCompressionType(conf2, SequenceFile.CompressionType.BLOCK);\n\n FileInputFormat.setInputPaths(conf2, partialDistancesPath); //Job 1 output\n FileOutputFormat.setOutputPath(conf2, userSimilaritiesPath); //Job 2 output (similarity of each group member to his friends)\n\n conf2.setMapperClass(IdentityMapper.class);\t\t\n conf2.setReducerClass(gr.forth.ics.isl.grouprecsmr.job2.Job2ReducerMulti.class);\n\n int numSimilaritiesPartitions = numReduceTasks;\n conf2.setNumReduceTasks(numSimilaritiesPartitions);\n\n conf2.setFloat(\"friendsSimThreshold\", friendsSimThresh);\n \n conf2.setInt(\"mapred.task.timeout\", 6000000);\n conf2.set(\"io.sort.mb\", \"500\");\n \n client2.setConf(conf2);\n RunningJob job2;\n try {\n job2 = JobClient.runJob(conf2);\t\n job2.waitForCompletion();\n } catch (Exception e) {\n System.err.println(e);\n }\n \n //JOB 3//\n System.out.println(\"Starting Job 3 (Multi-user approach)...\");\n JobClient client3 = new JobClient();\n JobConf conf3 = new JobConf(gr.forth.ics.isl.grouprecsmr.multiuser.MultiUserMain.class);\n\n conf3.setJobName(\"Multi-user approach - Job 3\");\n\n conf3.setMapOutputKeyClass(VIntWritable.class);\n conf3.setMapOutputValueClass(Text.class);\n \n conf3.setOutputKeyClass(VIntWritable.class);\n conf3.setOutputValueClass(DoubleWritable.class);\n\n conf3.setInputFormat(SequenceFileInputFormat.class);\n //conf3.setInputFormat(TextInputFormat.class);\n conf3.setOutputFormat(TextOutputFormat.class);\n //conf3.setOutputFormat(SequenceFileOutputFormat.class);\n //SequenceFileOutputFormat.setOutputCompressionType(conf3,SequenceFile.CompressionType.BLOCK);\n \n \n try {\n DistributedCache.addCacheFile(new URI(groupFilePath), conf3);\n } catch (URISyntaxException ex) {\n System.err.println(\"Could not add group file to distributed cache. \"+ex);\n }\n for (int i = 0; i < numSimilaritiesPartitions; i++) { \n String reduceId = String.format(\"%05d\", i); //5-digit int with leading\n try {\n DistributedCache.addCacheFile(new URI(userSimilaritiesPath.toString()+\"/part-\"+reduceId), conf3);\n } catch (URISyntaxException ex) {\n System.err.println(\"Could not add similarities files to distributed cache. \"+ex);\n }\n \n }\n \n FileInputFormat.setInputPaths(conf3, candidateMoviesPath); //Job 1 output (candidate movies)\n FileOutputFormat.setOutputPath(conf3, finalScoresPath); //Job 3 output (movie \\t outputScore)\n\n// conf3.setMapperClass(IdentityMapper.class);\t\t\n conf3.setMapperClass(gr.forth.ics.isl.grouprecsmr.job3.Job3MapperMulti.class); //filtering out ratings from non-Friends\n conf3.setReducerClass(gr.forth.ics.isl.grouprecsmr.job3.Job3ReducerMulti.class);\n \n conf3.setInt(\"mapred.task.timeout\", 6000000);\n conf3.set(\"io.sort.mb\", \"500\");\n\n conf3.setNumReduceTasks(numReduceTasks);\n \n client3.setConf(conf3);\n RunningJob job3;\n try {\n job3 = JobClient.runJob(conf3);\t\n job3.waitForCompletion();\n } catch (Exception e) {\n System.err.println(e);\n }\n }", "public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(new File(\"D:\\\\data.txt\")) ,\"GBK\") );\n\t\tint[] nums = {0};\n\t\tList<List<Integer>> z=subsetsWithDup(nums);\n\t\tfor(List<Integer> t:z){\n\t\t\tfor(int x: t)\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\tSystem.out.println();\n\t\t}\n\t\treader.close();\n\t}", "private void mergeSort(int amtFiles, String outputFile) throws IOException {\n // Base case\n if (amtFiles > 1) {\n for (int i = 1; i <= amtFiles; i += 2) {\n\n if (i <= amtFiles - 1) {\n try (Scanner file1 = new Scanner(Paths.get(outputFile + i + \".txt\"));\n Scanner file2 = new Scanner(Paths.get(outputFile + (i + 1) + \".txt\"));\n BufferedWriter writer = Files.newBufferedWriter(Paths.get(outputFile + \".txt\"),\n StandardCharsets.UTF_8);) {\n merge(file1, file2, writer);\n\n } // close the Scanner and BufferedWriter\n // Replace a file\n Files.move(Paths.get(outputFile + \".txt\"), Paths.get(outputFile + ((i + 1) / 2) + \".txt\"),\n StandardCopyOption.REPLACE_EXISTING);\n } else {\n Files.move(Paths.get(outputFile + i + \".txt\"), Paths.get(outputFile + ((i + 1) / 2) + \".txt\"),\n StandardCopyOption.REPLACE_EXISTING);\n } // end of if\n } // end of for\n\n amtFiles = (amtFiles / 2) + (amtFiles % 2);\n mergeSort(amtFiles, outputFile);\n } // end of if\n }", "public void CreateCsv1(int[][]a,int[] b,int[][] c,String C)throws IOException{\r\n int [][] sample = new int[a.length][b.length*2]; \r\n try( PrintWriter writer = new PrintWriter(new File(C))){ \r\n StringBuilder sb = new StringBuilder();\r\n \r\n for( int i =0;i<a.length;i++){\r\n for( int j =0;j<(b.length);j++){\r\n\r\n sample[i][j*2+1] =c[i][b[j]]; \r\n sample[i][j*2]= a[i][j]-c[i][b[j]];\r\n \r\n }\r\n }\r\n \r\n for( int i =0;i<sample.length;i++){\r\n for( int j =0;j<sample[0].length;j++){\r\n if(j%2==0){\r\n \r\n for( int k=j-1;k>=0;k--){\r\n sample[i][j] -= sample[i][k];\r\n }\r\n \r\n }\r\n }\r\n }\r\n\r\n for( int i =0;i<b.length;i++){\r\n sb.append(\"Start\").append(\",\").append(\"Job\").append(b[i]+1).append(',');//.append(\"End\").append(\",\");\r\n }\r\n sb.append(\"\\n\");\r\n for( int i =0;i<a.length;i++){\r\n\r\n for(int j=0;j<sample[i].length;j++){ \r\n sb.append(sample[i][j]).append(',');\r\n\r\n \r\n \r\n }\r\n sb.append(\"\\n\");\r\n }\r\n writer.write(sb.toString());\r\n }\r\n \r\n catch(FileNotFoundException e){\r\n System.out.println(e.getMessage());\r\n }\r\n \r\n}", "public static void main(/*final*/ String[] args) throws Exception {\n\n args = new String[] {\n //\"third.csv\",\n //\"first.html\",\n// \"union.csv2\",\n// \"union2.csv2\",\n// \"union3.csv2\",\n// \"union4.csv2\",\n// \"programmatic1.csv\",\n// \"programmatic2.csv\"\n \"first-ext.htmls\",\n \"second-ext.csv\"\n };\n\n if (args.length == 0) {\n System.err.println(\"Usage: java RecordMerger file1 [ file2 [...] ]\");\n System.exit(1);\n }\n\n\n\n// final Table t1 = new DataTable(\"ID\",\"A\",\"B\",\"C\");\n// final Table t2 = new DataTable(\"ID\",\"d\",\"e\",\"f\");\n// IntStream.rangeClosed(0,9999).forEach(v-> {\n// t1.insert(v,\"a\"+v, \"b\"+v, \"c\"+v);\n// t2.insert(9999-v,\"d\"+v, \"e\"+v, \"f\"+v);\n// });\n//\n//\n// Tables.save(t1,\"data/massive1.csv\");\n// Tables.save(t2,\"data/massive2.csv\");\n//\n//\n// System.exit(0);\n\n\n\n // your code starts here.\n try {\n\n if (!System.getProperties().containsKey(DEBUG))\n System.out.println(\"TableMerger: Run with -Ddebug to print table & rows\\n\");\n\n List<Optional<? extends Table>> tables =\n Arrays.stream(args).map(file -> DATA_DIR + file).map(Tables::newTable).collect(Collectors.toList());\n\n if (tables.size() == 0) {\n System.err.println(\"No table read\");\n }\n\n //skip over possibly empty tables...\n int index = 0;\n while (!tables.get(index).isPresent()) {\n index++;\n if (index==tables.size())\n throw new Exception(\"No supported tables found.\");\n }\n\n Table combined = tables.get(index).get();\n if (System.getProperties().containsKey(DEBUG))\n System.out.println(combined);\n\n for (int i = index; i < args.length; i++) {\n if (tables.get(i).isPresent()) {\n combined = combined.merge(tables.get(i).get());\n if (System.getProperties().containsKey(DEBUG))\n System.out.println(tables.get(i).get());\n }\n }\n\n if (System.getProperties().containsKey(DEBUG))\n System.out.println(combined);\n\n Tables.save(combined, DATA_DIR + FILENAME_COMBINED);\n } catch (Exception e) {\n System.out.print(\"Error while merging\" + e.getMessage());\n }\n }", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "public static void main(String[] args) throws Exception{\n\t\t\n\t\tSystem.out.println(\"Clustering started\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tArrayList<SyntacticCluster> clusters = (ArrayList<SyntacticCluster>) MinerUtil\n\t\t\t\t.deserialize(\"all_cluster\", false);\n\t\t//ArrayList<SyntacticCluster> allList = allCluster.doClustering();\n\n\t\tArrayList<SemanticCluster> semanticClusterList = new SemanticClusteringer().doClustering(clusters);\n\t\tfor (SemanticCluster semC : semanticClusterList) {\n\t\t\tfor (ICluster clus : semC.getUnits()) {\n\t\t\t\tSyntacticCluster synC = (SyntacticCluster) clus;\n\t\t\t\tsynC.doInnerClustering();\n\t\t\t\t// System.out.print(\"\");\n\t\t\t}\n\t\t\t// System.out.print(\"\");\n\t\t}\n\t\tSystem.out.println(\"Clustering finished\");\n\t\tLogger.log2(semanticClusterList, \"syntactic_semantic_clustering\");\n\t\t\n\t\tCloneSets sets = semanticClusterList.get(0).getUnits().get(0).getCloneSets().get(0).getCloneSets();\n\t\t\n\t\tMinerUtil.serialize(semanticClusterList, \"semantic_clusters\", false);\n\t\tMinerUtil.serialize(sets, \"sets\", false);\n\t\t//ConsoleFormatter.displayClusters(clustersByTopic);\n\t}", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\twhile(input.hasNext()) {\n\t\t\tString player1 = input.nextLine();\n\t\t\tString player2 = input.nextLine();\n\t\t\tString com = input.nextLine();\n\t\t\tint check = input.nextInt();\n\t\t\tint[][] one = new int[3][3];\n\t\t\tint[][] two = new int[3][3];\n\t\t\tString[] split1 = player1.split(\" \");\n\t\t\tString[] split2 = player2.split(\" \");\n\t\t\tString[] split3 = com.split(\" \");\n\t\t\tint total = 0;\n\t\t\tint countA = 0;\n\t\t\tint countB = 0;\n\t\t\tfor(int i = 0; i < split3.length; i++) {\n\t\t\t\ttotal += Integer.parseInt(split3[i]);\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tint count = 0;\n\t\t\t\tfor(int j = 0; j < 3; j++) {\n\t\t\t\t\tone[i][j] = Integer.parseInt(split1[3*i+j]);\n\t\t\t\t\tcount += one[i][j];\n\t\t\t\t}\n\t\t\t\tif(count == total) {\n\t\t\t\t\tcountA++;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tint count = 0;\n\t\t\t\tfor(int j = 0; j < 3; j++) {\n\t\t\t\t\ttwo[i][j] = Integer.parseInt(split2[3*i+j]);\n\t\t\t\t\tcount += two[i][j];\n\t\t\t\t}\n\t\t\t\tif(count == total) {\n\t\t\t\t\tcountB++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tint count = 0;\n\t\t\t\tfor(int j = 0; j < 3; j++) {\n\t\t\t\t\tone[j][i] = Integer.parseInt(split1[3*i+j]);\n\t\t\t\t\tcount += one[j][i];\n\t\t\t\t}\n\t\t\t\tif(count == total) {\n\t\t\t\t\tcountA++;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tint count = 0;\n\t\t\t\tfor(int j = 0; j < 3; j++) {\n\t\t\t\t\ttwo[j][i] = Integer.parseInt(split2[3*i+j]);\n\t\t\t\t\tcount += two[j][i];\n\t\t\t\t}\n\t\t\t\tif(count == total) {\n\t\t\t\t\tcountB++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tint count = 0;\n\t\t\t\tfor(int j = 0; j < 3; j++) {\n\t\t\t\t\tone[i][j] = Integer.parseInt(split1[3*i+j]);\n\t\t\t\t\tif(j == 2) {\n\t\t\t\t\t\tcount += one[i][i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count == total) {\n\t\t\t\t\tcountA++;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tint count = 0;\n\t\t\t\tfor(int j = 0; j < 3; j++) {\n\t\t\t\t\ttwo[i][j] = Integer.parseInt(split2[3*i+j]);\n\t\t\t\t\tif(j == 2) {\n\t\t\t\t\t\tcount += two[i][i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count == total) {\n\t\t\t\t\tcountB++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(countA == countB) {\n\t\t\t\tSystem.out.println(\"Draw\");\n\t\t\t}\n\t\t\tif(countA > countB) {\n\t\t\t\tSystem.out.println(\"Player1 wins\");\n\t\t\t}\n\t\t\tif(countA < countB) {\n\t\t\t\tSystem.out.println(\"Player2 wins\");\n\t\t\t}\n\t\t\tinput.nextLine();\n\t\t\tif(check == -1) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}", "public File cluster() throws IOException, InterruptedException {\n Runtime r = Runtime.getRuntime();\n Process p = r.exec(mclExecutablePath + \" \" + fileName + \" -o \" + fileName + \".I20\");\n p.waitFor();\n clusterResultFile = new File(fileName + \".I20\");\n return clusterResultFile;\n }", "public static void main(String[] args) {\n\t\ttry {\n\t\t\t//Get all sequenced phage in cluster\n\t\t\tJsonArray clusterData;\n\t\t\tif (CLUSTER.chars().allMatch(Character::isLetter))\n\t\t\t\tclusterData = PhagesDB.getCluster(CLUSTER).get(\"phage_set\").getAsJsonArray();\n\t\t\telse clusterData = PhagesDB.getSubCluster(CLUSTER).get(\"phage_set\").getAsJsonArray();\n\t\t\tIterator<JsonElement> iter = clusterData.iterator();\n\t\t\tArrayList<String> phageInCluster = new ArrayList<>();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tphageInCluster.add(iter.next().getAsString());\n\t\t\t}\n\t\t\tList<String> sequenced = new ArrayList<>();\n\t\t\tfor (String phage : phageInCluster) {\n\t\t\t\tJsonObject data = PhagesDB.getPhage(phage);\n\t\t\t\tif (data.get(\"seq_finished\").getAsBoolean()) \n\t\t\t\t\tsequenced.add(phage);\n\t\t\t}\n\t\t\t\n\t\t\t//Blast FASTA file from phage in cluster\n\t\t\tsequenced.removeIf(name -> Arrays.asList(IN_BLACK_LIST).contains(name));\n\t\t\tString toBLAST = INITIAL_PHAGE.length() == 0 ? sequenced.get(0) : INITIAL_PHAGE;\n\t\t\tString alignments = PhagesDB.locallyBLAST(PhagesDB.downloadPhageFASTA(toBLAST));\n\t\t\tSystem.out.println(toBLAST);\n\t\t\tsequenced.remove(toBLAST);\n\t\t\t\n\t\t\t//Find all sequence matches >= 18 between the BLASTed phage and another in the cluster\n\t\t\tScanner sequenceFinder = new Scanner(alignments);\n\t\t\tsequenceFinder.useDelimiter(\"\\n\");\n\t\t\tList<Primer> possibilities = new ArrayList<>();\n\t\t\tString line = sequenceFinder.next();\n\t\t\twhile (possibilities.size() == 0 && sequenceFinder.hasNext()) {\n\t\t\t\tif (line.startsWith(\">\")) {\n\t\t\t\t\tString name = null;\n\t\t\t\t\tfor (String phage : sequenced) {\n\t\t\t\t\t\tif (line.contains(phage)) {\n\t\t\t\t\t\t\tname = phage;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (name != null) {\n\t\t\t\t\t\tsequenced.remove(name);\n\t\t\t\t\t\tString sequence = \"\";\n\t\t\t\t\t\tint beginning = 0;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tif (line.contains(\"Score\")) {\n\t\t\t\t\t\t\t\tif (sequence.length() >= MIN_PRIMER_LENGTH) \n\t\t\t\t\t\t\t\t\tpossibilities.add(new Primer(sequence, beginning));\n\t\t\t\t\t\t\t\tsequence = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (line.startsWith(\"Query\")) {\n\t\t\t\t\t\t\t\tString matches = sequenceFinder.next();\n\t\t\t\t\t\t\t\tint start = line.indexOf(\" \", line.indexOf(\" \") + 1);\n\t\t\t\t\t\t\t\tbeginning = Integer.parseInt(line.substring(line.indexOf(\" \") + 1, start));\n\t\t\t\t\t\t\t\tfor (int i = start + 1; i < matches.length(); i++) {\n\t\t\t\t\t\t\t\t\tif (matches.charAt(i) == '|')\n\t\t\t\t\t\t\t\t\t\tsequence += line.charAt(i);\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tif (sequence.length() >= MIN_PRIMER_LENGTH)\n\t\t\t\t\t\t\t\t\t\t\tpossibilities.add(new Primer(sequence, beginning));\n\t\t\t\t\t\t\t\t\t\tsequence = \"\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (sequenceFinder.hasNext()) line = sequenceFinder.next();\n\t\t\t\t\t\t} while(!line.startsWith(\">\") && sequenceFinder.hasNext());\n\t\t\t\t\t\tif (sequence.length() >= MIN_PRIMER_LENGTH) \n\t\t\t\t\t\t\tpossibilities.add(new Primer(sequence, beginning));\n\t\t\t\t\t}\n\t\t\t\t\telse line = sequenceFinder.next();\n\t\t\t\t}\n\t\t\t\telse line = sequenceFinder.next();\n\t\t\t}\n\t\t\tsequenceFinder.close();\n\t\t\t\n\t\t\tSystem.out.println(sequenced);\n\t\t\tSystem.out.println(possibilities.size());\n\t\t\tSystem.out.println(possibilities);\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tHashtable<Integer, ArrayList<Primer>> completePrimers = new Hashtable<>();\n\t\t\t\n\t\t\t//For each primer, if they exist, return every substring >= 18 present in every member of the cluster\n\t\t\tfor (Primer p : possibilities) {\n\t\t\t\tStringBuilder primerBuilder = new StringBuilder(p.getSequence());\n\t\t\t\tString primerResults = PhagesDB.locallyBLAST(p.getSequence());\n\t\t\t\tScanner primerAnalyzer = new Scanner(primerResults);\n\t\t\t\tprimerAnalyzer.useDelimiter(\"\\n\");\n\t\t\t\tArrayList<String> sequencedCopy = new ArrayList<>(sequenced);\n\t\t\t\twhile(sequencedCopy.size() > 0 && primerAnalyzer.hasNext()) {\n\t\t\t\t\tif (line.startsWith(\">\")) {\n\t\t\t\t\t\tString name = null;\n\t\t\t\t\t\tfor (String phage : sequencedCopy) {\n\t\t\t\t\t\t\tif (line.contains(phage)) {\n\t\t\t\t\t\t\t\tname = phage;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (name != null) {\n\t\t\t\t\t\t\tsequencedCopy.remove(name);\n\t\t\t\t\t\t\tint queryEnd = 0;\n\t\t\t\t\t\t\tboolean firstQuery = false;\n\t\t\t\t\t\t\tboolean started = false;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tif (line.contains(\"Score\")) {\n\t\t\t\t\t\t\t\t\tif (started) break;\n\t\t\t\t\t\t\t\t\telse started = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (line.startsWith(\"Query\")) {\n\t\t\t\t\t\t\t\t\tint queryStart = Integer.parseInt(line.substring(line.indexOf(\" \") + 1, line.indexOf(\" \", line.indexOf(\" \") + 1)));\n\t\t\t\t\t\t\t\t\tif (!firstQuery) {\n\t\t\t\t\t\t\t\t\t\tfirstQuery = true;\n\t\t\t\t\t\t\t\t\t\tif (queryStart > 1) {\n\t\t\t\t\t\t\t\t\t\t\tfor (int i = 0; i < queryStart; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tprimerBuilder.setCharAt(i, '_');\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\tqueryEnd = Integer.parseInt(line.substring(line.lastIndexOf(\" \") + 1));\n\t\t\t\t\t\t\t\t\tString matches = primerAnalyzer.next();\n\t\t\t\t\t\t\t\t\tint start = line.indexOf(\" \", line.indexOf(\" \") + 1);\n\t\t\t\t\t\t\t\t\twhile (line.charAt(start) == ' ')\n\t\t\t\t\t\t\t\t\t\tstart++;\n\t\t\t\t\t\t\t\t\tfor (int i = start; i < matches.length(); i++) {\n\t\t\t\t\t\t\t\t\t\tif (matches.charAt(i) != '|')\n\t\t\t\t\t\t\t\t\t\t\tprimerBuilder.setCharAt((i - start) + queryStart - 1, '_');\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\tif (primerAnalyzer.hasNext()) line = primerAnalyzer.next();\n\t\t\t\t\t\t\t} while(!line.startsWith(\">\") && primerAnalyzer.hasNext());\n\t\t\t\t\t\t\tif (queryEnd < primerBuilder.length()) {\n\t\t\t\t\t\t\t\tfor (int i = queryEnd; i < primerBuilder.length(); i++)\n\t\t\t\t\t\t\t\t\tprimerBuilder.setCharAt(i, '_');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse line = primerAnalyzer.next();\n\t\t\t\t\t}\n\t\t\t\t\telse line = primerAnalyzer.next();\n\t\t\t\t}\n\t\t\t\tprimerAnalyzer.close();\n\t\t\t\tString sequence = \"\";\n\t\t\t\tif (sequencedCopy.size() <= MAX_MISSED || MAX_MISSED == -1) {\n\t\t\t\t\tfor (int i = 0; i < primerBuilder.length(); i++) {\n\t\t\t\t\t\tif (primerBuilder.charAt(i) == '_') {\n\t\t\t\t\t\t\tif (sequence.length() > MIN_PRIMER_LENGTH) {\n\t\t\t\t\t\t\t\tSystem.out.println(sequence);\n\t\t\t\t\t\t\t\tif (completePrimers.containsKey(sequencedCopy.size()))\n\t\t\t\t\t\t\t\t\tcompletePrimers.get(sequencedCopy.size()).add(new Primer(sequence, p.getStart() + i - sequence.length()));\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tArrayList<Primer> newPrimers = new ArrayList<>();\n\t\t\t\t\t\t\t\t\tnewPrimers.add(new Primer(sequence, p.getStart() + i - sequence.length()));\n\t\t\t\t\t\t\t\t\tcompletePrimers.put(sequencedCopy.size(), newPrimers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsequence = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse sequence += primerBuilder.charAt(i);\n\t\t\t\t\t}\n\t\t\t\t\tif (sequence.length() > MIN_PRIMER_LENGTH) {\n\t\t\t\t\t\tSystem.out.println(sequence);\n\t\t\t\t\t\tif (completePrimers.containsKey(sequencedCopy.size()))\n\t\t\t\t\t\t\tcompletePrimers.get(sequencedCopy.size()).add(new Primer(sequence, p.getStart() + primerBuilder.length() - sequence.length()));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tArrayList<Primer> newPrimers = new ArrayList<>();\n\t\t\t\t\t\t\tnewPrimers.add(new Primer(sequence, p.getStart() + primerBuilder.length() - sequence.length()));\n\t\t\t\t\t\t\tcompletePrimers.put(sequencedCopy.size(), newPrimers);\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\tSystem.out.println(completePrimers);\n\t\t\t\n\t\t\t//For each primer, verify there are no false positives\n\t\t\tfor (Integer count : completePrimers.keySet()) {\n\t\t\t\tcompletePrimers.get(count).removeIf(primer -> {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn !safePrimer(primer.getSequence());\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tSystem.out.println(completePrimers);\n\t\t\t\n\t\t\tHashtable<Integer, ArrayList<Primer>> checkedPrimers = new Hashtable<>();\n\t\t\t\n\t\t\t//Eliminate primers with bad sequences\n\t\t\tfor (Integer count : completePrimers.keySet()) {\n\t\t\t\tfor (Primer primer : completePrimers.get(count)) {\n\t\t\t\t\tString sequence = primer.getSequence();\n\t\t\t\t\tboolean goodGC = goodGC(sequence);\n\t\t\t\t\tboolean goodEnd = goodEnd(sequence);\n\t\t\t\t\tboolean goodRuns = goodRuns(sequence);\n\t\t\t\t\tboolean goodRepeats = goodRepeats(sequence);\n\t\t\t\t\tif (goodGC && goodEnd && goodRuns && goodRepeats) {\n\t\t\t\t\t\tif (checkedPrimers.containsKey(count))\n\t\t\t\t\t\t\tcheckedPrimers.get(count).add(primer);\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tArrayList<Primer> newPrimers = new ArrayList<>();\n\t\t\t\t\t\t\tnewPrimers.add(primer);\n\t\t\t\t\t\t\tcheckedPrimers.put(count, newPrimers);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tint start = primer.getStart();\n\t\t\t\t\t\tSystem.out.println(\"Failed: \" + sequence);\n\t\t\t\t\t\twhile ((!goodGC || !goodEnd) && sequence.length() > 18) {\n\t\t\t\t\t\t\tif ((sequence.endsWith(\"g\") || sequence.endsWith(\"c\")) && (!goodEnd || (goodEnd && goodEnd(sequence.substring(0, sequence.length() - 1))))) \n\t\t\t\t\t\t\t\tsequence = sequence.substring(0, sequence.length() - 1);\n\t\t\t\t\t\t\telse if (sequence.startsWith(\"g\") || sequence.startsWith(\"c\")) {\n\t\t\t\t\t\t\t\tsequence = sequence.substring(1, sequence.length());\n\t\t\t\t\t\t\t\tstart++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse break;\n\t\t\t\t\t\t\tgoodGC = goodGC(sequence);\n\t\t\t\t\t\t\tgoodEnd = goodEnd(sequence);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgoodRuns = goodRuns(sequence);\n\t\t\t\t\t\tgoodRepeats = goodRepeats(sequence);\n\t\t\t\t\t\tif (goodGC && goodEnd && goodRuns && goodRepeats && safePrimer(sequence)) {\n\t\t\t\t\t\t\tSystem.out.println(\"Saved: \" + sequence);\n\t\t\t\t\t\t\tif (checkedPrimers.containsKey(count))\n\t\t\t\t\t\t\t\tcheckedPrimers.get(count).add(new Primer(sequence, start));\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tArrayList<Primer> newPrimers = new ArrayList<>();\n\t\t\t\t\t\t\t\tnewPrimers.add(new Primer(sequence, start));\n\t\t\t\t\t\t\t\tcheckedPrimers.put(count, newPrimers);\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\t\n\t\t\tSystem.out.println(checkedPrimers);\n\t\t\t\n\t\t\t//Find primer pairings which would result in a good amplicon length\n\t\t\tArrayList<ForRevPair> pairs = new ArrayList<>();\n\t\t\tInteger[] keys = checkedPrimers.keySet().toArray(new Integer[0]);\n\t\t\tArrays.sort(keys);\n\t\t\t\n\t\t\tfor (int i = 0; i < keys.length; i++) {\n\t\t\t\tfor (int j = 0; j <= i; j++) {\n\t\t\t\t\tfor (int k = 0; k < checkedPrimers.get(keys[i]).size(); k++) {\n\t\t\t\t\t\tfor (int l = k + 1; l < checkedPrimers.get(keys[j]).size(); l++) {\n\t\t\t\t\t\t\tif (checkedPrimers.get(keys[i]).get(k).getStart() < checkedPrimers.get(keys[j]).get(l).getStart()) {\n\t\t\t\t\t\t\t\tint distance = checkedPrimers.get(keys[j]).get(l).getStart() - (checkedPrimers.get(keys[i]).get(k).getStart() + checkedPrimers.get(keys[i]).get(k).getSequence().length());\n\t\t\t\t\t\t\t\tif (distance >= MIN_AMPLICON_LENGTH && distance <= MAX_AMPLICON_LENGTH) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(keys[j] + \" \" + keys[i]);\n\t\t\t\t\t\t\t\t\tpairs.add(new ForRevPair(checkedPrimers.get(keys[i]).get(k).getSequence(), checkedPrimers.get(keys[j]).get(l).getSequence(), distance));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tint distance = checkedPrimers.get(keys[i]).get(k).getStart() - (checkedPrimers.get(keys[j]).get(l).getStart() + checkedPrimers.get(keys[j]).get(l).getSequence().length());\n\t\t\t\t\t\t\t\tif (distance >= MIN_AMPLICON_LENGTH && distance <= MAX_AMPLICON_LENGTH) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(keys[j] + \" \" + keys[j]);\n\t\t\t\t\t\t\t\t\tpairs.add(new ForRevPair(checkedPrimers.get(keys[i]).get(k).getSequence(), checkedPrimers.get(keys[j]).get(l).getSequence(), distance));\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\tif (pairs.size() > 5)\n\t\t\t\tSystem.out.println((new ArrayList<ForRevPair>(pairs)).subList(0, 5));\n\t\t\telse System.out.println(pairs);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br= new BufferedReader(new FileReader(\"C-small-attempt7.in\"));\n\t\t//BufferedReader br= new BufferedReader(new FileReader(\"A-large-practice(2).in\"));\n\t\t\n\t\t// TODO WRITER\n\t\tPrintWriter pw = new PrintWriter(\"Dijkstra.txt\", \"UTF-8\");\n\t\tint T=Integer.parseInt(br.readLine());\n\t\t\n\t\t\n\t\tfor(int i = 0; i < T; i++){\n\t\t\tString[] tab =br.readLine().split(\" \");\n\t\t\tint L = Integer.parseInt(tab[0]);\n\t\t\t//int X=Integer.parseInt(tab[1].length()>2 ? tab[1].substring(tab[1].length()-2) : tab[1]);\n\t\t\tlong X=Long.parseLong(tab[1]);\n\t\t\tString str = br.readLine();\n\t\n\t\t\t\n\t\t\t\t\n\t\t\tString a=\"NO\";\n\t\t\tchar current = '1';\n\t\t\tboolean minus = false;\n\t\t\tint finish=0;\n\t\t\tfor(long j=0; j<X*L; j++){\n\t\t\t\tchar temp = str.charAt((int)(j%L));\n\t\t\t\t\n\t\t\t\tif(current==temp){\n\t\t\t\t\tcurrent='1';\n\t\t\t\t\tminus = !minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='1')current=temp;\n\t\t\t\telse if(current=='i'&&temp=='j') current='k';\n\t\t\t\telse if(current=='i'&&temp=='k'){\n\t\t\t\t\tcurrent='j';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&temp=='i'){\n\t\t\t\t\tcurrent='k';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&temp=='k') current='i';\n\t\t\t\telse if(current=='k'&&temp=='i') current='j';\n\t\t\t\telse if(current=='k'&&temp=='j'){\n\t\t\t\t\tcurrent='i';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(current=='i'&&finish==0){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&finish==1){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\t\t\t\t}\n\t\t\t\telse if(current=='k'&&finish==2){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t//&&X%2==1 &&X%4==2 ||(current!='1'&&finish==3)\n\t\t\tif((current=='1'&&!minus&&finish==3))a=\"YES\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"current \"+(minus?\"-\":\"\")+current+\" finish \"+finish +\" X \"+X);//+\" str: \"+str);\n\t\n\t\t\tSystem.out.print(\"Case #\"+(i+1)+\": \"+a+\"\\n\");\n\t\t\tpw.write(\"Case #\"+(i+1)+\": \"+a+\"\\n\");\n\n\t\t}\n\t\tpw.close();\n\t}", "public double approximateJaccard(String file1, String file2) {\r\n\t\tint file1Col=-1,file2Col=-1;\r\n\t\tdouble count = 0;\r\n\t\tfor (int i = 0; i < docarray.length; i++)\r\n\t\t{\r\n\t\t\tif (docarray[i].equals(file1)) \r\n\t\t\t\tfile1Col = i;\r\n\t\t\tif (docarray[i].equals(file2)) \r\n\t\t\t\tfile2Col = i;\r\n\t\t}\r\n\t\tfor (int i = 0; i < numPermutations; i++) \r\n\t\t{\r\n\t\t\tif (minHash[i][file1Col] == minHash[i][file2Col])\r\n\t\t\t\tcount = count + 1;\r\n\t\t}\r\n\t\treturn count / numPermutations;\r\n\t}", "static void getResults2(String root) throws IOException {\n\t\tint k = 1;\n\t\twhile (k <= 1) {\n\t\t\tint j = 1;\n\t\t\tString line;\n\t\t\tString multi = \"\";\n\t\t\tSystem.out.println(\"M\" + k);\n\n\t\t\twhile (j <= 10) {\n\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(new File(root\n\t\t\t\t\t\t+ \"M1/M1.1/Testbeds-\" + j + \"/Generated/PSL//test/Precision/multi.txt\")));\n\n\t\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\t\tmulti += line;\n\t\t\t\t\tSystem.out.print(line + \",\");\n\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\"\\n\");\n\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t}", "private Map<String, Cluster> readFile(String labelPath, String dataPath, String phase) {\n\t\tSystem.out.println(\"read the \" + phase + \" file ..... \");\n\n\t\t// read the label file\n\t\tSystem.out.println(\"Reading label from file \" + phase + \".label \");\n\t\tList<String> classRecords = IOUtils.readFile(labelPath);\n\t\tdocumentClass = new HashMap<String, String>();\n\t\tdocumentListClass = new HashMap<String,ArrayList<String>>();\n\n\t\tfor (int i = 0; i < classRecords.size(); i++) {\n\t\t\tString record = classRecords.get(i);\n\t\t\tdocumentClass.put((i + 1) + \"\", record);\n\n\t\t\tboolean contain = documentListClass.containsKey(record);\n\t\t\tif(!contain){\n\t\t\t\tdocumentListClass.put(record, new ArrayList<String>()) ;\n\t\t\t}\n\t\t\tdocumentListClass.get(record).add((i+1)+\"\");\n\t\t}\n\n\t\t// read the document\n\t\tSystem.out.println(\"Reading document from file \" + phase + \".data \");\n\t\tList<String> dataRecords = IOUtils.readFile(dataPath);\n\t\tdocumentsCount = new HashMap<String, Document>();\t\t\n\n\t\tfor (String record : dataRecords) {\n\t\t\tString[] elements = record.split(\" \");\n\t\t\tString documentID = elements[0];\n\t\t\tString wordID = elements[1];\n\t\t\tint wordCount = Integer.parseInt(elements[2]);\n\n\t\t\tboolean contain = documentsCount.containsKey(documentID);\n\t\t\tif (!contain) {\n\t\t\t\tdocumentsCount.put(documentID, new Document(documentID));\n\t\t\t}\n\n\t\t\tdocumentsCount.get(documentID).add(wordID, wordCount);\n\t\t}\t\t\n\n\t\t// put the documents with the same cluster ID into the cluster\n\t\tSystem.out.println(\"put the documents with the same cluster ID into the cluster\");\n\t\tMap<String, Cluster> clusters = new HashMap<String, Cluster>();\n\t\tfor (String documentID : documentClass.keySet()) {\n\t\t\tString clusterID = documentClass.get(documentID);\n\n\t\t\tboolean contain = clusters.containsKey(clusterID);\n\t\t\tif (!contain) {\n\t\t\t\tclusters.put(clusterID, new Cluster(clusterID));\n\t\t\t}\n\n\t\t\t// put the document into cluster\n\t\t\tDocument document = documentsCount.get(documentID);\n\t\t\tclusters.get(clusterID).addDocument(document);\n\t\t}\n\n\t\t// when in training phase, calculate the probability and frequence\n\t\tif (phase.equals(\"training\")) {\n\t\t\tSystem.out.println(\"calculate the training probability\");\n\n\t\t\t// generate the word count of cluster\n\t\t\tfor (int index = 1; index <= 20; index++) {\n\t\t\t\tSystem.out.println(\"calculate the cluster \"+ index);\n\t\t\t\t// fill the word count\n\t\t\t\t// clusters.get(clusterID).fillWordCounts();\n\n\t\t\t\t// calculate the bernoulli probability\n\t\t\t\tclusters.get(Integer.toString(index)).calculateBernoulliProbability();\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn clusters;\n\t}", "public static void main(String[] args) throws IOException {\n sc = new Reader();\n //out = new Printer(\"./src/answer.txt\");\n out = new Printer();\n int testCases, n, m, k;\n long c;\n long[][] matrix, rsum, csum, oddLastCalc, evenLastCalc;\n// boolean flag;\n testCases = sc.nextInt();\n while (testCases-- > 0) {\n n = sc.nextInt();\n m = sc.nextInt();\n k = sc.nextInt();\n matrix = new long[n][m];\n rsum = new long[n+1][m+1];\n csum = new long[n+1][m+1];\n oddLastCalc = new long[n][m];\n evenLastCalc = new long[n][m];\n c = 0l;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n matrix[i][j] = sc.nextLong();\n oddLastCalc[i][j] = matrix[i][j];\n if(matrix[i][j]>=k)\n c++;\n }\n }\n\n for (int i = 0; i < n; i++) {\n rsum[i][m-1] = matrix[i][m-1];\n }\n for (int i = 0; i < m; i++) {\n csum[n-1][i] = matrix[n-1][i];\n }\n for (int i = 0; i < n; i++) {\n for (int j = m-2; j >=0; j--) {\n rsum[i][j] = rsum[i][j+1] + matrix[i][j];\n }\n }\n for (int i = 0; i < m; i++) {\n for (int j = n-2; j >=0; j--) {\n csum[j][i] = csum[j+1][i] + matrix[j][i];\n }\n }\n PRINT.ArrayMatrix(rsum);\n PRINT.ArrayMatrix(csum);\n System.out.println(\"-------------------------------------------------------\");\n\n for (int size = 2; size <= n; size++) {\n// flag = false;\n for (int i = n-size; i >= 0; i--) {\n for (int j = m - size; j >= 0; j--) {\n if(size%2==0){\n evenLastCalc[i][j] = matrix[i][j]\n + oddLastCalc[i+1][j+1]\n + csum[i+1][j] - csum[i+size][j]\n + rsum[i][j+1] - rsum[i][j+size];\n if(1.0*evenLastCalc[i][j]/(size*size)<k){\n// flag = true;\n break;\n }\n } else {\n oddLastCalc[i][j] = matrix[i][j]\n + evenLastCalc[i+1][j+1]\n + csum[i+1][j] - csum[i+size][j]\n + rsum[i][j+1] - rsum[i][j+size];\n if(1.0*oddLastCalc[i][j]/(size*size)<k){\n// flag = true;\n break;\n }\n }\n System.out.println(size + \"\\t\" + i + \"\\t\" + j);\n PRINT.ArrayMatrix(oddLastCalc);\n PRINT.ArrayMatrix(evenLastCalc);\n System.out.println(\"-------------------------------------------------------\");\n c++;\n }\n// if(flag)\n// break;\n }\n }\n System.out.println(c);\n }\n\n out.close();\n }", "public static void main(String[] args) \n\t{\n\t\ttry\n\t\t{\n\t\t\tScanner inFile = new Scanner(new FileReader(args[0]));\n\t\t\tBufferedWriter outFile = new BufferedWriter(new FileWriter(args[1]));\t\t\n\t\t\t\n\t\t\tif(args.length < 1) \n\t\t {\n\t\t System.out.println(\"Error to open file\");\n\t\t System.exit(1);\n\t\t }\n\t\t\t\n\t\t\tint numNodes = inFile.nextInt();\n\t\t\t\t\t\n\t\t\tgraphColoring graphColor = new graphColoring(numNodes);\n\t\t\tint i, j;\n\t\t\n\t\t\twhile(inFile.hasNext())\n\t\t\t{\n\t\t\t \ti = inFile.nextInt();\n\t\t \tj = inFile.nextInt();\n\t\t \tgraphColor.loadMatrix(i, j);\n\t\t \tNode newNode = new Node(i, j);\n\t\t \t\n\t\t\t}\n\t\t\tgraphColor.constructNodeList();\n\t\t\tgraphColor.printNodeList(outFile);\n\t\t\tgraphColor.newColor = 0;\n\t\t\tgraphColor.printMatrix(outFile);\n\t\t\t\n\t\t\twhile(graphColor.findUncolorNode())\n\t\t\t{\n\t\t\t\tgraphColor.newColor++; \n\t\t\t\n\t\t\t\tNode current = graphColor.listHead.next;\n\t\t\t\t\n\t\t\t\twhile(current != null)\n\t\t\t\t{\n\t\t\t\t\tif(current.color == 0 && graphColor.checkAdjacent(current.ID, graphColor.newColor) == 0)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tgraphColor.adjacencyMatrix[current.ID][current.ID] = graphColor.newColor;\n\t\t\t\t\t\tcurrent.color = graphColor.newColor;\n\t\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\toutFile.write(\"Number of colors used is: \" + graphColor.newColor + \"\\n\");\n\n\t\t\t\n\t\t\tgraphColor.printNodeList(outFile);\n\t\t\tgraphColor.printMatrix(outFile);\n\t\t\t\n\t\t\tinFile.close();\n\t\t\toutFile.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "static public void main(String[] args) throws IOException{\n\t\tString sample = \"h19x24\";\n\t\tString parentFolder = \"/media/kyowon/Data1/Dropbox/fCLIP/new24/\";\t\t\n\t\tString bedFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.bed\";\n\t\tString dbFasta = \"/media/kyowon/Data1/RPF_Project/genomes/hg19.fa\";\n\t\tString parameterFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.param\";\n\t\t\n\t\tString trainOutFileName = parentFolder + sample + \".train.csv\";\n\t\tString arffTrainOutFileName = parentFolder + sample + \".train.arff\";\n\t\t\n\t\tString cisOutFileName = parentFolder + sample + \".csv\";\n\t\tString transOutFileNameM = parentFolder + sample + \".pair.M.csv\";\n\t\tString transOutFileNameU = parentFolder + sample + \".pair.U.csv\";\n\t\tString transControlOutFileNameM = parentFolder + sample + \".pair.M.AntiSense.csv\";\n\t\tString transControlOutFileNameU = parentFolder + sample + \".pair.U.AntiSense.csv\";\n\t\tString rmskBed = \"/media/kyowon/Data1/fCLIP/Data/cat.rmsk.bed\";\n\t\tString siControlBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siControl_R1_Aligned_Sorted.bed\";\n\t\tString siKDDroshaBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDrosha_R1_Aligned_Sorted.bed\";\n\t\tString siKDDicerBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDicer_R1_Aligned_Sorted.bed\";\n\t\t\n\t\tString cisBed5pFileName = cisOutFileName + \".5p.bed\";\n\t\tString cisBed3pFileName = cisOutFileName + \".3p.bed\";\n\t\t\n\t\tdouble unpairedScoreThreshold = 0.25; \n\t\tdouble pairedScoreThreshold = unpairedScoreThreshold/5;\n\t//\tdouble motifScoreThreshold = 0.15;\n\t\t\n\t\tint num3pPaired = 10;\n\t\tint num5pPaired = 20;\n\t\t\n\t\tString filteredTransOutFileName = transOutFileNameM + \".filtered.csv\";\n\t\t\n\t\tint blatHitThreshold = 100000000;\n\t\tint transPairSeqLength = FCLIP_Scorer.getFlankingNTNumber() *2 + 80;\n\t\t\n\t\tZeroBasedFastaParser fastaParser = new ZeroBasedFastaParser(dbFasta);\n\t\tMirGff3FileParser mirParser = new MirGff3FileParser(\"/media/kyowon/Data1/fCLIP/genomes/hsa_hg19.gff3\");\n\t\tAnnotationFileParser annotationParser = new AnnotationFileParser(\"/media/kyowon/Data1/fCLIP/genomes/hg19.refFlat.txt\");\n\t\tFCLIP_ScorerTrainer.train(parameterFileName, bedFileName, mirParser, annotationParser);\n\t\t\n\t\ttrain(trainOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\t\trunCis(cisOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\n\t\tScoredPositionOutputParser.generateBedFromCsv(cisOutFileName, cisBed5pFileName, cisBed3pFileName, false); // for fold change..\n\t//\tScoredPositionOutputParser.generateFastaForMotif(cisOutFileName, cisOutFileName + \".5p.motif.fa\", cisOutFileName + \".3p.motif.fa\",cisOutFileName + \".motif.m\", \"M\");\n\t\t\n\t\trunTrans(transOutFileNameM, transOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, false);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transOutFileNameM, transOutFileNameM + \".5p.motif.fa\", transOutFileNameM + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(transOutFileNameM + \".rmsk.csv\", transOutFileNameM + \".link.txt\");\n\t//\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t///\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\trunTrans(transControlOutFileNameM, transControlOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, true);\t\t\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transControlOutFileNameM, transControlOutFileNameM + \".5p.motif.fa\", transControlOutFileNameM + \".3p.motif.fa\");\n\t//\tGenerateCircosLinkFiles.run(transControlOutFileNameM + \".rmsk.csv\", transControlOutFileNameM + \".link.txt\");\n\t\t//CheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\tfilterTransPairs(transOutFileNameM, filteredTransOutFileName, num3pPaired, num5pPaired);\n\t\tCheckRepeat.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(filteredTransOutFileName, filteredTransOutFileName + \".5p.motif.fa\", filteredTransOutFileName + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(filteredTransOutFileName + \".rmsk.csv\", filteredTransOutFileName + \".link.txt\");\n\t///\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\t\n\t\t// generate background for drosha and dicer..\n\t\t\n\t\t\n\t\t// motif different conditioin?? \n\t\t\n\t\t\t\t\n\t\t//GenerateDepthsForEncodeDataSets.generate(outFileName, outFileName + \".encode.csv\", annotationParser);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry {\n\t\t\tint N = Integer.parseInt(br.readLine());\n\t\t\tint[][] A = new int[N + 1][N + 1];\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tString str = br.readLine();\n\t\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\t\tA[i][j] = str.charAt(j) - 48;\n\t\t\t\t}\n\t\t\t}\n\t\t\tint connectedCompo = 0;\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\t\tif (A[i][j] == 1 && c[i][j] == 0) {\n\t\t\t\t\t\tdfs(i, j, A);\n\t\t\t\t\t\tlist.add(numOfHome);\n\t\t\t\t\t\tnumOfHome = 0;\n\t\t\t\t\t\tconnectedCompo++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(connectedCompo);\n\t\t\tCollections.sort(list); // 정렬을 빼먹어서 틀렸었음!!\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tSystem.out.println(list.get(i));\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"whereami.in\"));\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"whereami.out\")));\n\n //reads in and initializes n and k values\n StringTokenizer st = new StringTokenizer(f.readLine());\n int stringSize = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(f.readLine());\n //initializes variable for input string\n String string = st.nextToken();\n\n //computes all subsequences and adds to set\n subsequence(string, string.length());\n\n boolean[] checks= new boolean[stringSize];\n\n int smallestSize = 0;\n\n for (int i = 0; i < stringSize; i++) {\n checks[i] = true;\n for (String s : subSequences) {\n if (s.length() == i + 1 && numberOccurrences(string, s) != 1) {\n checks[s.length() - 1] = false;\n }\n }\n if (checks[i] == true) {\n smallestSize = i + 1;\n break;\n }\n }\n\n out.println(smallestSize);\n out.close();\n }", "public static void main(String args[]){\n\t\tString indexLocation = \"H:\\\\ukbench\\\\training2\\\\\";\r\n\t\tString searchLocation = \"H:\\\\ukbench\\\\query\\\\\";\r\n\t\t\r\n//\t\tint[] testSizes = {2000};\r\n//\t\tint[] numTreesTests = {3,4,5,6,7,8,9,10};\r\n//\t\tint[] examineTopNResultsTests = {5,10,20};\r\n\t\tint[] testSizes = {10200};\r\n\t\tint[] numTreesTests = {1};//3,4,5,10};\r\n\t\tint[] examineTopNResultsTests = {5,20};\r\n\t\tfor ( int testSize : testSizes ){\r\n\t\t\tfor ( int numTrees : numTreesTests ){\r\n\t\t\t\tfor ( int numResults : examineTopNResultsTests ){\r\n\t\t\t\t\tSystem.out.println(testSize + \", \" + numTrees + \", \" + numResults);\r\n\t\t\t\t\tMultiIndexFinder finder = new MultiIndexFinder(indexLocation,numTrees,testSize/4);\r\n\t\t\t\t\t\r\n\t\t\t\t\tList<FileFilter> filters = new ArrayList<FileFilter>();\r\n\t\t\t\t\tfilters.add(new FileFilter(\".*\\\\.jpg\"));\r\n\t\t\t\t\tFileFinder ffinder = new FileFinder(searchLocation,filters);\r\n\t\t\t\t\tList<File> files = ffinder.getFiles();\r\n\t\t\t\t\tint numRight = 0;\r\n\t\t\t\t\tint numWrong = 0;\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor ( File file : files ){\r\n\t\t\t\t\t\tString foundFile = finder.findBestMatch(file.getAbsolutePath(),numResults);\r\n\t\t\t\t\t\t//System.out.println(\"for \" + file.getAbsolutePath() + \", found \" + foundFile);\r\n\t\t\t\t\t\tif ( !\"\".equals(foundFile) && IndexFinder.isCorrectFile(file.getAbsolutePath(),foundFile) ){\r\n\t\t\t\t\t\t\tnumRight++;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tnumWrong++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\tif ( count >= (testSize *3)/4 ) break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(numRight/(float)(numRight+numWrong));\r\n\t\t\t\t\tSystem.gc();\r\n\t\t\t\t}\r\n\t\t\t\tSystem.gc();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n \r\n int graphSize = Integer.parseInt(args[0]);\r\n HashMap<Integer, List<Integer>> hash = new HashMap<Integer, List<Integer>>();\r\n Random rand = new Random();\r\n for(int i = 0; i < graphSize; i++){\r\n int neighbours = rand.nextInt(5);\r\n \r\n List<Integer> list = hash.get(i);\r\n if(list == null){\r\n hash.put(i, new ArrayList<Integer>());\r\n }\r\n neighbours = neighbours - hash.get(i).size(); \r\n while(neighbours > 0){\r\n \r\n int no = rand.nextInt(graphSize);\r\n \r\n //System.out.println(\"neighbours\");\r\n //System.out.println(i);\r\n //System.out.println(neighbours);\r\n //System.out.println(no);\r\n if(checkPresent(hash.get(i), no) || no == i){\r\n continue;\r\n }\r\n hash.get(i).add(no);\r\n if(hash.get(no) == null){\r\n hash.put(no, new ArrayList<Integer>());\r\n }\r\n hash.get(no).add(i);\r\n neighbours--;\r\n \r\n }\r\n }\r\n try{\r\n PrintWriter writer = new PrintWriter(\"/home/constantine/Desktop/graph.txt\", \"UTF-8\");\r\n for(int i: hash.keySet()){\r\n String toWrite = Integer.toString(i);\r\n List<Integer> list = hash.get(i);\r\n if(list.size() != 0){\r\n toWrite = toWrite + \",\";\r\n }\r\n for(int j = 0; j < list.size(); j++){\r\n if(j == list.size() - 1){\r\n toWrite = toWrite + list.get(j);\r\n } else{\r\n toWrite = toWrite + list.get(j) + \",\";\r\n }\r\n \r\n }\r\n writer.println(toWrite);\r\n }\r\n writer.close();\r\n \r\n } catch (IOException e) {\r\n // do something\r\n }\r\n }", "public static void main(String[] args)\n\t{\n\t\tString fullFile = \"\";\n\t\tint lineAmount = 0;\n\t\ttry\n\t\t{\n\t\t\tBufferedReader br = new BufferedReader(\n\t\t\t\t\tnew FileReader(\"alice.txt\"));\n\t\t\t\n\t\t\tString st = br.readLine();\n\t\t\t//int counter = 0;\n\t\t while (st != null)\n\t\t {\n\t\t \t//fullFile[counter] = st;\n\t\t \tfullFile += st;\n\t\t \t//System.out.println(st);\n\t\t \tst = br.readLine();\n\t\t \tlineAmount++;\n\t\t \t//counter++;\n\t\t }\n\t\t br.close();\n\t\t}\n\t\tcatch(FileNotFoundException ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint processors = Runtime.getRuntime().availableProcessors();\n\t\tSystem.out.println(\"Num of processors: \" + processors);\n\t\t\n\t\tForkJoinPool forkJoinPool = new ForkJoinPool(processors);\n\t\t\n\t\tint x = fullFile.length() / processors;\n\t\t\n//\t\tint count = 0;\n//\t\tint stoppingPointForLastThread = 0;\n\t\t\n//\t\tfor(int i = 0; i < fullFile.length(); i++)\n//\t\t{\n//\t\t\tif(fullFile.charAt(i) == '\\n')\n//\t\t\t{\n//\t\t\t\tcount++;\n//\t\t\t}\n//\t\t\t\n//\t\t\tif(count >= processors)\n//\t\t\t{\n//\t\t\t\tThread t = new Thread( fullFile.substring(\n//\t\t\t\t\t\tstoppingPointForLastThread, i) );\n//\t\t\t\t\n//\t\t\t\tstoppingPointForLastThread = i;\n//\t\t\t\tcount = 0;\n//\t\t\t}\n//\t\t}\n\t\t\n\t\tint divisionOfWork = (lineAmount * 40) / processors;\n\t\t\n//\t\tThread t = new Thread( fullFile.substring(0, \n//\t\t\t\tdivisionOfWork) );\n//\t\tThread t = new Thread( \n//\t\t\t\tfullFile.substring(divisionOfWork, \n//\t\t\t\tdivisionOfWork * 2) );\n\t\t\n\t\t//FORKJOIN\n\t\tAtomicInteger wordCount = new AtomicInteger(0);\n\t\tfor(int i = 0; i < processors; i++)\n\t\t{\n\t\t\tDataParallelThread t = new DataParallelThread( \n\t\t\t\t\tfullFile.substring(divisionOfWork * i, \n\t\t\t\t\tdivisionOfWork + (divisionOfWork * i)) );\n\t\t\t\n\t\t\twordCount.getAndAdd(\n\t\t\t\t\tforkJoinPool.invoke(t).get()\n\t\t\t\t\t);\n\t\t}\n\t\tSystem.out.println(\"Word count of \\\"the\\\" is: \" + \n\t\t\t\twordCount);\n\t\t\n\t\t//THREAD\n\t\tMyThread[] threads = new MyThread[processors];\n\t\tfor(int i = 0; i < processors; i++)\n\t\t{\n\t\t\tMyThread t = new MyThread( \n\t\t\t\t\tfullFile.substring(divisionOfWork * i, \n\t\t\t\t\tdivisionOfWork + (divisionOfWork * i)) );\n\t\t\t\n\t\t\tt.run();\n\t\t\tthreads[i] = t;\n\t\t}\n\t\t\n\t\tint wordCount2 = 0;\n\t\tfor(int i = 0; i < processors; i++)\n\t\t{\n\t\t\twordCount2 += threads[i].WordCount();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Word count of \\\"the\\\" is: \" + \n\t\t\t\t\twordCount2);\n\t\t\n\t\t\n\t\t\n//\t\tint wordCount = 0;\n//\t\tfor(int i = 0; i < processors; i++)\n//\t\t{\n//\t\t\twordCount += forkJoinPool.\n//\t\t}\n\t}", "private void merge(int numRuns, exComparator myComp) throws IOException {\n\t\t// Pass 1 and any following\n\t\t// Read in the partial sorted runs from last pass; Merge; Write out;\n\t\tTupleReader[] mergeReader = new TupleReader[B - 1];\n\t\tint pass = 1;\n\t\tint numRunsToBuild = 0;\n\t\tPriorityQueue<Tuple> tempMerg = new PriorityQueue<Tuple>(myComp);\n\t\tInteger marker = null;\n\t\twhile(true) {\n\t\t\t// last pass: pass-1 , # runs: numRuns;\n\t\t\t// this pass: pass , # runs: numRunsToBuild;\n\t\t\tnumRunsToBuild = numRuns % (B - 1) == 0 ? numRuns / (B - 1) : (numRuns / (B - 1) + 1);\n\t\t\tMap<Tuple, Integer> findReader;\n\t\t\tfor(int i = 0; i < numRunsToBuild; i++) {\n\t\t\t\tfindReader = new HashMap<>();\n\t\t\t\tfor(int j = 0; j < B - 1; j++) {\n\t\t\t\t\tint runIndex = i * (B - 1) + j + 1; // index of the run to be read in last pass, which is (pass - 1)\n\t\t\t\t\tif(runIndex > numRuns) {\n\t\t\t\t\t\tmarker = j;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmergeReader[j] = new TupleReader(tempsubdir + String.valueOf(pass-1) + \"_\" + runIndex);\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tSystem.out.println(\"Pass\" + pass + \",\" + i + \"th Run\");\n\t\t\t\tint numReader = marker == null ? B - 1 : marker;\n\t\t\t\tfor(int k = 0; k < numReader; k++) {\n\t\t\t\t\tTuple temp = mergeReader[k].getNextTuple();\n\t\t\t\t\tif(temp == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\ttempMerg.offer(temp);\n\t\t\t\t\tfindReader.put(temp, k);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tTupleWriter TW;\n\t\t\t\tif(numRunsToBuild == 1) {\n\t\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t\t} else {\n\t\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + pass + \"_\" + String.valueOf(i + 1)));\n\t\t\t\t}\n\t\t\t\twhile(!tempMerg.isEmpty()) {\n\t\t\t\t\tTuple temp = tempMerg.poll();\n\t\t\t\t\tTW.setNextTuple(temp);\n\t\t\t\t\tTuple next = mergeReader[findReader.get(temp)].getNextTuple();\n\t\t\t\t\tif(next != null) {\n\t\t\t\t\t\ttempMerg.offer(next);\n\t\t\t\t\t\tfindReader.put(next, findReader.get(temp));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!TW.bufferEmpty()) {\n\t\t\t\t\tTW.fillFlush(); \n\t\t\t\t}\n\t\t\t\tTW.close();\n\t\t\t\tfor(int k = 0; k < numReader; k++) {\n\t\t\t\t\tmergeReader[k].close();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(numRunsToBuild == 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnumRuns = numRunsToBuild;\n\t\t\tpass++;\n\t\t\tmarker = null;\n\t\t}\n\t}", "private static void k_means_offline(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "public static void main(String[] args)\n {\n System.out.println(\"CompareTD2BU :fileName1 :dirName2 :rootName2 :ext2 :outputNameRoot :gammaMultiplier\");\n// System.out.println(\"CompareTD2BU takes compares a series of vertex communties against a standard community\");\n// System.out.println(\"for the timgraph defined by the\");\n// System.out.println(\"final timgraph arguments (including the input file name and directory).\");\n// System.out.println(\"The first community is given by fileName1 and is the fixed standard against\");\n// System.out.println(\"which all others are compared. The second community is a set formed from\");\n// System.out.println(\"<dirName2><rootName2>*<ext2> so note the dirName2 must end in a slash.\");\n// System.out.println(\"The * is taken to be the values of gamma involved. The last argument\");\n// System.out.println(\"outputNameRoot gives the full directory and name root of the output file.\");\n// \n //First arg chooses first community file\n //String fileName1=\"input/ICtest_psecinputBVNLS.dat\";\n //String fileName1=\"input/ICNS090224npstemppew0020inputELS.dat\";\n //String fileName1=\"input/ICNS090729_psecinputBVNLS.dat\";\n String fileName1=\"input/karateTSEActualVPinputBVNLS.dat\";\n int ano=0;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) fileName1=args[ano].substring(1);\n System.out.println(\"--- Using reference network \"+fileName1);\n\n\n //String dirName2=\"output/IC/PaperTerm/\";\n String dirName2=\"output/karate/\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) dirName2=args[ano].substring(1);\n\n //String rootName2=\"ICNS090729stempt_PapersVCWLG_VP\";\n String rootName2=\"karateTSE_VC_WLG_VP\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) rootName2=args[ano].substring(1);\n\n String ext2 = \"output.vcis\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) ext2=args[ano].substring(1);\n\n System.out.println(\"--- Comparing against networks \"+dirName2+rootName2+\"(gamma)\"+ext2);\n\n //Third arg is output file name\n String rootName3=\"output/karateTSE_actual_WLG_VP\";\n //String rootName3=\"output/ICNS090729stempt_psec_Papers\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) rootName3=args[ano].substring(1);\n System.out.println(\"--- Output to \"+rootName3);\n\n //Third arg is gamma multiplier\n double gammaMultiplier=1.0;\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) gammaMultiplier=Double.parseDouble(args[ano].substring(1));\n System.out.println(\"--- gamma multiplier \"+gammaMultiplier);\n\n\n FindFile ff = new FindFile();\n ff.getFileList(dirName2, rootName2, ext2, true);\n int nf = ff.filelist.length;\n String [] name2Array = new String[nf];\n MutualInformation [] miArray = new MutualInformation[nf];\n double [] gammaArray = new double[nf];\n PrintWriter results = null;\n String outputFile=rootName3+\"_gammaMI.dat\";\n try {results = new PrintWriter(new FileWriter(outputFile));}// eo try\n catch (IOException e){\n System.err.println(\"Problem with output file \"+outputFile+\", \"+e);\n System.exit(1);\n }\n System.out.println(\"--- Opened output file \"+outputFile);\n String sep=\"\\t\";\n results.println(MutualInformation.toStringBasicLabel(sep)+sep+\"gamma\"+sep+MutualInformation.toStringLabel(sep));\n\n for (int f=0; f<nf; f++){\n String fullFileName2=dirName2+ff.filelist[f];\n System.out.println(\"--- Using network two \"+fullFileName2);\n int c0= fullFileName2.lastIndexOf(rootName2)+rootName2.length();\n int c1= fullFileName2.lastIndexOf(ext2);\n String gammaString=fullFileName2.substring(c0, c1);\n double gamma=Double.parseDouble(gammaString)*gammaMultiplier;\n System.out.println(\"--- gamma = \"+gamma);\n \n MutualInformation mi = CompareVertexCommunities.doComparision(fileName1,fullFileName2);\n results.println(mi.toStringBasic(sep)+sep+gamma+sep+mi.toString(sep));\n results.flush();\n miArray[f]= new MutualInformation(mi,false,false);\n name2Array[f]=ff.filelist[f];\n gammaArray[f]=gamma;\n } // eo for\n results.close();\n System.out.println(\"--- Closed output file \"+outputFile);\n }", "public void description() throws Exception {\n PrintWriter pw = new PrintWriter(System.getProperty(\"user.dir\")+ \"/resources/merged_file.txt\"); \n \n // BufferedReader for obtaining the description files of the ontology & ODP\n BufferedReader br1 = new BufferedReader(new FileReader(System.getProperty(\"user.dir\")+ \"/resources/ontology_description\")); \n BufferedReader br2 = new BufferedReader(new FileReader(System.getProperty(\"user.dir\")+ \"/resources/odps_description.txt\")); \n String line1 = br1.readLine(); \n String line2 = br2.readLine(); \n \n // loop is used to copy the lines of file 1 to the other \n if(line1==null){\n\t \tpw.print(\"\\n\");\n\t }\n while (line1 != null || line2 !=null) \n { \n if(line1 != null) \n { \n pw.println(line1); \n line1 = br1.readLine(); \n } \n \n if(line2 != null) \n { \n pw.println(line2); \n line2 = br2.readLine(); \n } \n } \n pw.flush(); \n // closing the resources \n br1.close(); \n br2.close(); \n pw.close(); \n \n // System.out.println(\"Merged\"); -> for checking the code execution\n /* On obtaining the merged file, Doc2Vec model is implemented so that vectors are\n * obtained. And the, similarity ratio of the ontology description with the ODPs \n * can be found using cosine similarity \n */\n \tFile file = new File(System.getProperty(\"user.dir\")+ \"/resources/merged_file.txt\"); \t\n SentenceIterator iter = new BasicLineIterator(file);\n AbstractCache<VocabWord> cache = new AbstractCache<VocabWord>();\n TokenizerFactory t = new DefaultTokenizerFactory();\n t.setTokenPreProcessor(new CommonPreprocessor()); \n LabelsSource source = new LabelsSource(\"Line_\");\n ParagraphVectors vec = new ParagraphVectors.Builder()\n \t\t.minWordFrequency(1)\n \t .labelsSource(source)\n \t .layerSize(100)\n \t .windowSize(5)\n \t .iterate(iter)\n \t .allowParallelTokenization(false)\n .workers(1)\n .seed(1)\n .tokenizerFactory(t) \n .build();\n vec.fit();\n \n //System.out.println(\"Check the file\");->for execution of code\n PrintStream p=new PrintStream(new File(System.getProperty(\"user.dir\")+ \"/resources/description_values\")); //storing the numeric values\n \n \n Similarity s=new Similarity(); //method that checks the cosine similarity\n s.similarityCheck(p,vec);\n \n \n }" ]
[ "0.6023202", "0.5974817", "0.5971047", "0.5887524", "0.58731186", "0.5863829", "0.5802474", "0.5786755", "0.5728521", "0.56097686", "0.55808645", "0.55616605", "0.55390173", "0.5526497", "0.5523453", "0.5519576", "0.54915696", "0.5479819", "0.5477373", "0.5472218", "0.5435305", "0.54165184", "0.5411067", "0.5398878", "0.5389238", "0.5389119", "0.53505105", "0.5349484", "0.5345122", "0.5338598", "0.53289837", "0.5317348", "0.5305222", "0.5302556", "0.52948266", "0.5273867", "0.5267398", "0.5267393", "0.5256405", "0.52510893", "0.52476364", "0.52446395", "0.5242512", "0.52415264", "0.52357", "0.5235294", "0.5225537", "0.52244925", "0.52199864", "0.521791", "0.52145034", "0.52123064", "0.5211689", "0.520194", "0.51934093", "0.51763105", "0.51760346", "0.5173009", "0.5172792", "0.51702094", "0.5159295", "0.51534534", "0.5151612", "0.51487976", "0.5137742", "0.51366955", "0.51328063", "0.51297116", "0.5127148", "0.512181", "0.51180303", "0.5117728", "0.5103873", "0.5103225", "0.5088351", "0.5080538", "0.50784224", "0.50707227", "0.5067628", "0.50508076", "0.5043421", "0.50345194", "0.5033317", "0.5029061", "0.5026756", "0.5017294", "0.50166124", "0.5015574", "0.5014789", "0.5012641", "0.5012523", "0.5006813", "0.5003914", "0.49958423", "0.499362", "0.4989115", "0.497528", "0.4973509", "0.4973174", "0.49725062" ]
0.63448554
0
Reads the file and stores the ground truth and feature attributes
private static void fileRead(String file) { try { BufferedReader br = new BufferedReader(new FileReader(file)); String line = ""; while((line=br.readLine())!=null) { String data[] = line.split("\\t"); int id = Integer.parseInt(data[0]); int groundTruth = Integer.parseInt(data[1]); actualClusters.put(id, groundTruth); ArrayList<Double> temp = new ArrayList<>(); for(int i=2;i<data.length;i++) { temp.add(Double.parseDouble(data[i])); } cols = data.length-2; geneAttributes.put(id, temp); allClusters.add(id+""); totalGenes++; } totalCluster = totalGenes; br.close(); } catch(Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readTrainingFile() {\n\t\ttry {\n\t\t\tFile file = new File(trainingFile);\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\n\t\t\tSystem.out.print(\"Read training data >>>\\t\");\n\t\t\t// read first line to get attribute names\n\t\t\tString line = reader.readLine();\n\t\t\t// find delimiter\n\t\t\tdelimiter = findDelimiter(line);\n\t\t\t// get all attributes\n\t\t\tallAttributes = line.split(delimiter);\n\t\t\t// target attribute is at the last position\n\t\t\tint targetIndex = allAttributes.length - 1;\n\t\t\t\n\t\t\ttrainingTuples = new ArrayList<String[]>();\n\t\t\tclassLabels = new HashSet<String>();\n\t\t\tmapAttrValue = new HashMap<String, Set<String>>();\n\t\t\twhile((line = reader.readLine()) != null) {\n\t\t\t\tif(line.isEmpty() == true) {\n\t\t\t\t\t//if the line is empty\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// read one tuple\n\t\t\t\tString[] tuple = line.split(delimiter);\n\t\t\t\ttrainingTuples.add(tuple);\n\t\t\t\t// add attribute value to mapAttrValue\n\t\t\t\tfor(int i = 0; i < targetIndex; i++) {\n\t\t\t\t\tString attribute = allAttributes[i];\n\t\t\t\t\tString value = tuple[i];\n\t\t\t\t\tSet<String> valueSet = mapAttrValue.get(attribute);\n\t\t\t\t\tif(valueSet == null) {\n\t\t\t\t\t\tvalueSet = new HashSet<String>();\n\t\t\t\t\t\tmapAttrValue.put(attribute, valueSet);\n\t\t\t\t\t}\n\t\t\t\t\tvalueSet.add(value);\n\t\t\t\t}\n\t\t\t\t// get class label\n\t\t\t\tclassLabels.add(tuple[targetIndex]);\n\t\t\t}\t\t\t\n\t\t\treader.close();\n\t\t\tSystem.out.println(\"Complete!\");\t\n\t\t} catch(FileNotFoundException e) {\n\t\t\tSystem.out.println(\"No such file!\");\n\t\t\te.printStackTrace();\n\t\t} catch(IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t}", "private void readFile( String fileName ) throws FileNotFoundException\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile train_file = new File( fileName );\n\t\t\tScanner in;\n\t\t\tin = new Scanner( train_file );\n\n\t\t\tString[] tokens = in.nextLine().trim().split( \"\\\\s+\" ); // Parse the file\n\t\t\tthis.attribute_list.add( new Attribute( 0, \"x0\" ) );\n\n\t\t\tint i = 1;\n\t\t\twhile ( i <= tokens.length )\n\t\t\t{\n\t\t\t\tthis.attribute_list.add( new Attribute( i, tokens[ i - 1 ] ) );\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\twhile ( in.hasNextLine() )\n\t\t\t{\n\t\t\t\ttokens = in.nextLine().trim().split( \"\\\\s+\" );\n\t\t\t\tif ( tokens.length > 1 )\n\t\t\t\t{\n\t\t\t\t\tthis.addTrainData( 0, 1 );\n\n\t\t\t\t\tfor ( i = 1; i < tokens.length; i++ )\n\t\t\t\t\t\tthis.addTrainData( i, Integer.parseInt( tokens[ i - 1 ] ) );\n\n\t\t\t\t\t// Last column would be the class attribute\n\t\t\t\t\tthis.class_data.add_data( Integer.parseInt( tokens[ i - 1 ] ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tin.close();\n\t\t}\n\t\tcatch ( FileNotFoundException e )\n\t\t{\n\t\t\tSystem.out.println( \"Cannot find train file - \" + fileName );\n\t\t\tthrow e;\n\t\t}\n\t}", "public boolean readAttributeFile(File file);", "public TreeNode readDataFile() {\n\t\tdata = new ArrayList<Instance>();\n\t\ttry {\n\t\t\tScanner s = new Scanner(new File(testFile));\n\t\t\t// took these lines from helper-code\n\t\t\tScanner l = new Scanner(s.nextLine());\n\t\t\tfor (int i = 0; l.hasNext(); i++) {\n\t\t\t\tif (!l.next().equals(classifierNames.get(i))) {\n\t\t\t\t\tSystem.err.println(\"This data file does not use the same category names as the training file.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tl.close();\n\t\t\tl = new Scanner(s.nextLine());\n\t\t\tfor (int i = 0; l.hasNext(); i++) {\n\t\t\t\tif (!l.next().equals(attributeNames.get(i))) {\n\t\t\t\t\tSystem.err.println(\"This data file does not match the attributes of the training file.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tl.close();\n\t\t\tSystem.out.println(\"Read attributes \"+attributeNames.toString()+\".\");\n\t\t\treadFile(s,data);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.err.println(\"Training file not found, you should have put tests for this in main.\");\n\t\t\tSystem.err.println(\"Attempted to read \"+testFile+\".\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\tArrayList<Boolean> attrs = new ArrayList<Boolean>();\n\t\tfor (int i = 0; i < attributeNames.size(); i++) {\n\t\t\tattrs.add(false);\n\t\t}\n\t\tTreeNode root = BuildTree(instances, attrs);\n\t\treturn root;\n\t}", "public TreeNode readTrainingFile() {\n\t\t// first, read the training data into some storage location\n\t\ttry {\n\t\t\tScanner s = new Scanner(new File(trainingFile));\n\t\t\t// took these lines from helper-code\n\t\t classifierNames = new ArrayList<String>();\n\t\t for (Scanner l = new Scanner(s.nextLine()); l.hasNext();) {\n\t\t \tclassifierNames.add(l.next());\n\t\t }\n\t\t\tif (attributeNames.size() == 0) {\n\t\t\t\tScanner line = new Scanner(s.nextLine());\n\t\t\t\twhile (line.hasNext()) {\n\t\t\t\t\tattributeNames.add(line.next());\n\t\t\t\t}\n\t\t\t\tline.close();\n\t\t\t}\n\t\t\treadFile(s,instances);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.err.println(\"Training file not found, you should have put tests for this in main.\");\n\t\t\tSystem.err.println(\"Attempted to read \"+trainingFile+\".\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\tsetDefaultNode();\n\t\tArrayList<Boolean> ar = new ArrayList<Boolean>();\n\t\tfor (int i = 0; i < attributeNames.size(); i++) {\n\t\t\tar.add(false);\n\t\t}\n\t\treturn BuildTree(instances, ar);\n\t}", "public void readFromFile() {\n\n\t}", "public void load(final String model_file) throws Exception {\n\t\ttry {\n\t\t\tFileInputStream in = new FileInputStream(model_file);\n\t\t\tGZIPInputStream gin = new GZIPInputStream(in);\n\n\t\t\tObjectInputStream s = new ObjectInputStream(gin);\n\n\t\t\ts.readObject(); //this is the id\n\n\t\t\tsetFeature((String) s.readObject());\n\t\t\tsetInfo((String) s.readObject());\n\n\t\t\tprobs = (HashMap[][]) s.readObject();\n\t\t\t//classnum = s.readInt();\n\t\t\t//classnames = (ArrayList) s.readObject();\n\t\t\tint b, a = s.readInt();\n\t\t\tclassCounts = new double[a];\n\n\t\t\tfor (int i = 0; i < a; i++)\n\t\t\t\tclassCounts[i] = s.readDouble();\n\t\t\ttotalExamplesSeen = s.readDouble();\n\t\t\t//a = s.readInt();\n\t\t\t//header = new int[a];\n\t\t\t//for (int i = 0; i < header.length; i++)\n\t\t\t//\theader[i] = s.readInt();\n\t\t\t//read in saved numbers\n\t\t\ta = s.readInt();\n\t\t\tm_seenNumbers = new double[a][];\n\t\t\tfor (int i = 0; i < a; i++) {\n\t\t\t\tb = s.readInt();\n\t\t\t\tm_seenNumbers[i] = new double[b];\n\t\t\t\tfor (int j = 0; j < b; j++)\n\t\t\t\t\tm_seenNumbers[i][j] = s.readDouble();\n\t\t\t}\n\t\t\t//now for weights\n\t\t\ta = s.readInt();\n\t\t\tm_Weights = new double[a][];\n\t\t\tfor (int i = 0; i < a; i++) {\n\t\t\t\tb = s.readInt();\n\t\t\t\tm_Weights[i] = new double[b];\n\t\t\t\tfor (int j = 0; j < b; j++)\n\t\t\t\t\tm_Weights[i][j] = s.readDouble();\n\t\t\t}\n\n\t\t\ta = s.readInt();\n\t\t\tm_NumValues = new int[a];\n\t\t\tfor (int i = 0; i < a; i++)\n\t\t\t\tm_NumValues[i] = s.readInt();\n\n\t\t\ta = s.readInt();\n\t\t\tm_SumOfWeights = new double[a];\n\t\t\tfor (int i = 0; i < a; i++)\n\t\t\t\tm_SumOfWeights[i] = s.readDouble();\n\n\n\t\t\tm_StandardDev = s.readDouble();\n\t\t\tsetThreshold(s.readDouble());\n\t\t\tisOneClass(s.readBoolean());\n\t\t\tint len = s.readInt();\n\t\t\tfeatureArray = new boolean[len];\n\t\t\tfor (int i = 0; i < featureArray.length; i++) {\n\t\t\t\tfeatureArray[i] = s.readBoolean();\n\t\t\t}\n\t\t\tlen = s.readInt();\n\t\t\tfeatureTotals = new int[len];\n\t\t\tfor (int i = 0; i < featureTotals.length; i++) {\n\t\t\t\tfeatureTotals[i] = s.readInt();\n\t\t\t}\n\n\t\t\tinTraining = s.readBoolean();\n\n\n\t\t\t//read in ngram model\n\t\t\tString name = (String) s.readObject();\n\t\t\t//need to see which type of txt class it is.\n\t\t\ttry {\n\t\t\t\t//need to fix\n\t\t\t\tFileInputStream in2 = new FileInputStream(name);\n\t\t\t\tObjectInputStream s2 = new ObjectInputStream(in2);\n\t\t\t\tString modeltype = new String((String) s2.readObject());\n\t\t\t\ts2.close();\n\t\t\t\tif (modeltype.startsWith(\"NGram\"))\n\t\t\t\t\ttxtclass = new NGram();\n\t\t\t\telse\n\t\t\t\t\ttxtclass = new TextClassifier();\n\n\t\t\t\ttxtclass.setProgress(false);//we dont want to show subclass\n\t\t\t\t// progresses.\n\t\t\t} catch (Exception e2) {\n\t\t\t\ttxtclass = new NGram();\n\t\t\t\ttxtclass.setProgress(false);//we dont want to show subclass\n\t\t\t\t// progresses.\n\t\t\t}\n\n\t\t\ttxtclass.load(name);\n\n\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in nbayes read file:\" + e);\n\t\t}\n\t\t//now that we've loaded, its time to set the flag to true.\n\t\t//hasModel = true;\n\t\t/*for(int i=0;i<MLearner.NUMBER_CLASSES;i++)\n\t\t{\t\n\t\t\tif(classCounts[i]<3)\n\t\t\t\tcontinue;\n\t\t\tfor(int j=0;j<featureArray.length;j++)\n\t\t\t{\n\t\t\t\tif(featureArray[j])\n\t\t\t\t\tSystem.out.println(i+\" \"+j+\" \"+probs[i][j]);\n\t\t\t}\n\t\t}*/\n\t\tRealprobs = new HashMap[MLearner.NUMBER_CLASSES][featureArray.length];\n\t\tsetFeatureBoolean(featureArray);\n\t\tinTraining = true;//easier than saving the work (although should check size fisrt\n\t}", "void readData(String fileName, boolean [] data, String wName){\n\t\tworld = new File(wName);\n\t\tDataProcessing dp = new DataProcessing(fileName, data);\n\t\tdp.findHotspots();\n\n\t\ttempVals = dp.hotspots;\n\t\t\t\n\t\t\t// create randomly permuted list of indices for traversal \n\t\t\tgenPermute(); \n\t\t\t\n\t\t\t// generate greyscale tempVals field image\n\t\t\tderiveImage();\n\n\t}", "public void readData() throws FileNotFoundException {\n this.plane = readPlaneDimensions();\n this.groupBookingsList = readBookingsList();\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 }", "private void setTrainingData() throws IOException {\r\n\t\ttrainIdBodyMap = readInIdBodiesMap(new File(TRAIN_BODIES_CSV_LOCATION));\r\n\t\ttrainStances = readStances(new File(TRAIN_STANCES_CSV_LOCATION));\r\n\r\n\t}", "public void read () throws IOException, ClassNotFoundException {\n BufferedReader reader = FileManager.getReader\n (JerboaProperties.getString(\"KeyFeatureContainer.filename\"));\n double kThreshold = JerboaProperties.getDouble(\"KeyFeatureContainer.keyThreshold\",0.0);\n double fThreshold = JerboaProperties.getDouble(\"KeyFeatureContainer.featureThreshold\",0.0);\n\n String line;\n String[] tokens;\n double x;\n line = reader.readLine();\n tokens = line.split(\"\\\\t\");\n \n sf = Double.parseDouble(tokens[2]);\n\n while ((line = reader.readLine()) != null) {\n tokens = line.split(\"\\\\t\");\n if (tokens.length == 2) {\n if ((! filterKeys) || kTable.containsKey(tokens[0])) {\n x = Double.parseDouble(tokens[1]);\n if (x >= kThreshold)\n kTable.put(tokens[0],x);\n else if (filterKeys)\n kTable.remove(tokens[0]);\n }\n } else {\n x = Double.parseDouble(tokens[1]);\n if (x >= fThreshold) {\n kfTable.put(tokens[0],x);\n fTable.put(tokens[0],Double.parseDouble(tokens[2]));\n }\n }\n }\n }", "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}", "private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}", "private void readAttributes() throws IOException, ClassFormatException {\n final int attributes_count = dataInputStream.readUnsignedShort();\n attributes = new Attribute[attributes_count];\n for (int i = 0; i < attributes_count; i++) {\n attributes[i] = Attribute.readAttribute(dataInputStream, constant_pool);\n }\n }", "@Test\n public void readFile() throws IOException {\n ModelInfo modelInfo = ModelReader.create().load();\n\n }", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n Gson gson = new Gson();\n Type listFeelingType = new TypeToken<ArrayList<Feeling>>(){}.getType();\n recordedFeelings.clear();\n ArrayList<Feeling> tmp = gson.fromJson(reader, listFeelingType);\n recordedFeelings.addAll(tmp);\n fis.close();\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n recordedFeelings = new ArrayList<Feeling>();\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public FeatureData read(Reader r) throws IOException, DataFormatException;", "private static void readArff(String fileName) {\r\n\t\ttry {\r\n\t\t\tFileInputStream stream = new FileInputStream(fileName);\r\n\t\t\tInputStreamReader reader = new InputStreamReader(stream);\r\n\t\t\tBufferedReader buffer = new BufferedReader(reader);\r\n\t\t\t\r\n\t\t\tArrayList<String> tmpColumnName = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tString line;\r\n\t\t\tint userNo = 0; // sequence number of each user\r\n\t\t\tint attributeCount = 0;\r\n\t\t\t\r\n\t\t\tmaxValue = -1;\r\n\t\t\tminValue = 99999;\r\n\t\t\t\r\n\t\t\t// Read attributes:\r\n\t\t\twhile((line = buffer.readLine()) != null && !line.equals(\"TT_EOF\")) {\r\n\t\t\t\tif (line.contains(\"@ATTRIBUTE\")) {\r\n\t\t\t\t\tString name;\r\n\t\t\t\t\t\r\n\t\t\t\t\tline = line.substring(10).trim();\r\n\t\t\t\t\tif (line.charAt(0) == '\\'') {\r\n\t\t\t\t\t\tint idx = line.substring(1).indexOf('\\'');\r\n\t\t\t\t\t\tname = line.substring(1, idx+1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tint idx = line.substring(1).indexOf(' ');\r\n\t\t\t\t\t\tname = line.substring(0, idx+1).trim();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttmpColumnName.add(name);\r\n\t\t\t\t\tattributeCount++;\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.contains(\"@RELATION\")) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.contains(\"@DATA\")) {\r\n\t\t\t\t\t// This is the end of attribute section!\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.length() <= 0) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Set item count to data structures:\r\n\t\t\titemCount = (attributeCount - 1)/2;\r\n\t\t\tcolumnName = new String[attributeCount];\r\n\t\t\ttmpColumnName.toArray(columnName);\r\n\t\t\t\r\n\t\t\tint[] itemRateCount = new int[itemCount+1];\r\n\t\t\trateMatrix = new SparseMatrix(500000, itemCount+1); // Netflix: [480189, 17770]\r\n\t\t\t\r\n\t\t\t// Read data:\r\n\t\t\twhile((line = buffer.readLine()) != null && !line.equals(\"TT_EOF\")) {\r\n\t\t\t\tif (line.length() > 0) {\r\n\t\t\t\t\tline = line.substring(1, line.length() - 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tStringTokenizer st = new StringTokenizer (line, \",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\twhile (st.hasMoreTokens()) {\r\n\t\t\t\t\t\tString token = st.nextToken().trim();\r\n\t\t\t\t\t\tint i = token.indexOf(\" \");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tint movieID, rate;\r\n\t\t\t\t\t\tint index = Integer.parseInt(token.substring(0, i));\r\n\t\t\t\t\t\tString data = token.substring(i+1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (index == 0) { // User ID\r\n\t\t\t\t\t\t\t//int userID = Integer.parseInt(data);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tuserNo++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (data.length() == 1) { // Rate\r\n\t\t\t\t\t\t\tmovieID = index;\r\n\t\t\t\t\t\t\trate = Integer.parseInt(data);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (rate > maxValue) {\r\n\t\t\t\t\t\t\t\tmaxValue = rate;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (rate < minValue) {\r\n\t\t\t\t\t\t\t\tminValue = rate;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t(itemRateCount[movieID])++;\r\n\t\t\t\t\t\t\trateMatrix.setValue(userNo, movieID, rate);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse { // Date\r\n\t\t\t\t\t\t\t// Do not use\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tuserCount = userNo;\r\n\t\t\t\r\n\t\t\t// Reset user vector length:\r\n\t\t\trateMatrix.setSize(userCount+1, itemCount+1);\r\n\t\t\tfor (int i = 1; i <= itemCount; i++) {\r\n\t\t\t\trateMatrix.getColRef(i).setLength(userCount+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println (\"Data File\\t\" + dataFileName);\r\n\t\t\tSystem.out.println (\"User Count\\t\" + userCount);\r\n\t\t\tSystem.out.println (\"Item Count\\t\" + itemCount);\r\n\t\t\tSystem.out.println (\"Rating Count\\t\" + rateMatrix.itemCount());\r\n\t\t\tSystem.out.println (\"Rating Density\\t\" + String.format(\"%.2f\", ((double) rateMatrix.itemCount() / (double) userCount / (double) itemCount * 100.0)) + \"%\");\r\n\t\t\t\r\n\t\t\tstream.close();\r\n\t\t}\r\n\t\tcatch (IOException ioe) {\r\n\t\t\tSystem.out.println (\"No such file: \" + ioe);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean readFile(String filename) {\n\t\ttry {\n\t\t\tScanner input = new Scanner(new File(filename));\n\t\t\tString row = input.nextLine();\n\t\t\tString[] sarr = row.split(\",\");\n\t\t\tString ingredientsWatch = \"\";\n\t\t\t// Gets the String type of ingredients to watch\n\t\t\t// Identify the gender and create the Female or Male object\n\t\t\tif (sarr[0].equals(\"Female\")) {\n\t\t\t\tStringBuilder sBuilder =new StringBuilder();\n\t\t\t\tfor(int j =5;j<sarr.length-1;j++) {\n\t\t\t\t\tsBuilder=sBuilder.append(sarr[j].trim()+\",\");\t\n\t\t\t\t}\n\t\t\t\tsBuilder=sBuilder.append(sarr[sarr.length-1]);\n\t\t\t\tingredientsWatch = sBuilder.toString();\n\t\t\t\tFemale female=new Female(Float.parseFloat(sarr[1]), Float.parseFloat(sarr[2]), \n\t\t\t\t\t\tFloat.parseFloat(sarr[3]), Float.parseFloat(sarr[4]), ingredientsWatch);\n\t\t\t\tNutriByte.person=female;\n\t\t\t}else {\n\t\t\t\tStringBuilder sBuilder =new StringBuilder();\n\t\t\t\tfor(int j =5;j<sarr.length-1;j++) {\t\n\t\t\t\t\tsBuilder=sBuilder.append(sarr[j].trim()+\",\");\n\t\t\t\t}\n\t\t\t\tsBuilder=sBuilder.append(sarr[sarr.length-1]);\n\t\t\t\tingredientsWatch = sBuilder.toString();\n\t\t\t\t// Creates the object using its constructor\n\t\t\t\tMale male=new Male(Float.parseFloat(sarr[1]), Float.parseFloat(sarr[2]), \n\t\t\t\t\t\tFloat.parseFloat(sarr[3]), Float.parseFloat(sarr[4]), ingredientsWatch);\n\t\t\t\tNutriByte.person=male;\n\t\t\t\tinput.close();\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\t\n\t\treturn true;\n\t}", "public static void main(String[] args) \n\t{\n\t\t// Konfiguration\n\t\tTraining training = new Training();\n\t\tint numberOfAttributes = 18;\n\t\tStatisticOutput statisticWriter = new StatisticOutput(\"data/statistics.txt\");\n\t\t\n\t\ttraining.printMessage(\"*** TCR-Predictor: Training ***\");\n\t\t\n\t\ttraining.printMessage(\"Datenbank von Aminosäure-Codierungen wird eingelesen\");\n\t\t// Lies die EncodingDB ein\n\t\tAAEncodingFileReader aa = new AAEncodingFileReader();\n\t\tAAEncodingDatabase db = aa.readAAEncodings(\"data/AAEncodings.txt\");\n\t\ttraining.printMessage(\"Es wurden \" + db.getEncodingDatabase().size() + \" Codierungen einglesen\");\n\t\t\n\t\ttraining.printMessage(\"Trainingsdatensatz wird eingelesen und prozessiert\");\n\t\t// Lies zunächst die gesamten Trainingsdaten ein\n\t\tExampleReader exampleReader = new ExampleReader();\n\t\t\n\t\t// Spalte das Datenset\n\t\tDataSplit dataSplit_positives = new DataSplit(exampleReader.getSequnces(\"data/positive.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_positiv = dataSplit_positives.getDataSet();\n\t\t\n\t\tDataSplit dataSplit_negatives = new DataSplit(exampleReader.getSequnces(\"data/negative.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_negativ = dataSplit_negatives.getDataSet();\n\t\t\n\t\t// Lege Listen für die besten Klassifizierer und deren Evaluation an\n\t\tModelCollection modelCollection = new ModelCollection();\n\t\t\n\t\t/*\n\t\t * \n\t\t * Beginne Feature Selection\n\t\t * \n\t\t */\n\t\tArrayList<String> positivesForFeatureSelection = training.concatenateLists(complete_list_positiv);\n\t\tArrayList<String> negativesForFeatureSelection = training.concatenateLists(complete_list_negativ);\n\t\t\n\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t// Convertiere Daten in Wekas File Format\n\t\tARFFFileGenerator arff = new ARFFFileGenerator();\n\t\tInstances dataSet = arff.createARFFFile(positivesForFeatureSelection, negativesForFeatureSelection, db.getEncodingDatabase());\n\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\n\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) aus\");\n\t\t// Beginne Feature Selection\n\t\tFeatureFilter featureFilter = new FeatureFilter();\n\t\tfeatureFilter.rankFeatures(dataSet, numberOfAttributes);\t\t\t\t\t// Wähle die x wichtigsten Features aus\n\t\tdataSet = featureFilter.getProcessedInstances();\n\t\ttraining.printMessage(\"Ausgewählte Features: \" + featureFilter.getTopResults());\n\n\t\t/*\n\t\t * Führe die äußere Evaluierung fünfmal durch und wähle das beste Modell\n\t\t */\n\t\tfor (int outer_run = 0; outer_run < 5; outer_run++)\n\t\t{\n\t\t\tstatisticWriter.writeString(\"===== Äußere Evaluation \" + (outer_run + 1) + \"/5 =====\\n\\n\");\n\t\t\t\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_positives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_positives.addAll(complete_list_positiv);\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_negatives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_negatives.addAll(complete_list_negativ);\n\t\t\t\n\t\t\t// Lege das erste Fragment beider Listen für nasted-Crossvalidation beiseite\n\t\t\tArrayList<String> outer_List_pos = new ArrayList<String>();\n\t\t\touter_List_pos.addAll(list_positives.get(outer_run));\n\t\t\tlist_positives.remove(outer_run);\n\t\t\t\n\t\t\tArrayList<String> outer_List_neg = new ArrayList<String>();\n\t\t\touter_List_neg.addAll(list_negatives.get(outer_run));\n\t\t\tlist_negatives.remove(outer_run);\n\t\t\t\n\t\t\t// Füge die verbleibende Liste zu einer Zusammen\n\t\t\tArrayList<String> inner_List_pos = training.concatenateLists(list_positives);\n\t\t\tArrayList<String> inner_List_neg = training.concatenateLists(list_negatives);\n\t\t\t\t\n\n\t\t\t/*\n\t\t\t * \n\t\t\t * Ab hier nur noch Arbeiten mit innerer Liste, die Daten zum Evaluieren bekommt Weka vorerst \n\t\t\t * nicht zu sehen!\n\t\t\t * \n\t\t\t */\n\t\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t\t// Convertiere Daten in Wekas File Format\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(inner_List_pos, inner_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes); // Filtere das innere Datenset nach Vorgabe\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\ttraining.printMessage(\"Beginne Gridsearch\");\n\t\t\t// Gridsearch starten\n\t\n\t\t\t\n\t\t\t\n\t\t\tParameterOptimization optimizer = new ParameterOptimization();\n\t\t\tString logFileName = outer_run + \"_\" + numberOfAttributes;\n\t\t\tGridSearch gridSearch = optimizer.performGridSearch(dataSet, logFileName);\n\t\t\ttraining.printMessage(\"Gefundene Parameter [C, gamma]: \" + gridSearch.getValues()); // liefert unter diesen Settings 1.0 und 0.0\n\n\t\t\tSMO sMO = (SMO)gridSearch.getBestClassifier();\n\t\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t * \n\t\t\t * Evaluationsbeginn \n\t\t\t *\n\t\t\t */\n\t\t\ttraining.printMessage(\"Evaluiere die Performance gegen das äußere Datenset\");\n\t\t\ttraining.printMessage(\"Transcodierung des Evaluationsdatensatzes\");\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(outer_List_pos, outer_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\t// Führe Feature-Filtering mit den Einstellungen der GridSearch aus\n\t\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) auf GridSearch-Basis aus\");\n\t\t\t// Beginne Feature Selection\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes);\t // Wähle die x wichtigsten Features aus\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttraining.printMessage(\"Ermittle Performance\");\n\t\t\tEvaluator eval = new Evaluator();\n\t\t\teval.classifyDataSet(sMO, dataSet);\n\t\t\ttraining.printMessage(eval.printRawData());\n\t\t\t\n\t\t\t/*\n\t\t\t * Füge das Modell und die externe Evaulation zur Sammlung hinzu\n\t\t\t */\t\t\t\n\t\t\tmodelCollection.bestClassifiers.add(sMO);\n\t\t\tmodelCollection.evalsOfBestClassifiers.add(eval);\n\t\t\tmodelCollection.listOfNumberOfAttributes.add(numberOfAttributes);\n\t\t\tmodelCollection.listOfFeatureFilters.add(featureFilter);\n\t\t\t\n\t\t\tstatisticWriter.writeString(\"Verwendete Attribute: \" + featureFilter.getTopResults());\n\t\t\tstatisticWriter.writeString(eval.printRawData());\n\t\t\t\n\t\t}\n\t\tstatisticWriter.close();\n\t\t\n\t\t// Wähle das beste aller Modelle aus\n\t\ttraining.printMessage(\"Ermittle die allgemein besten Einstellungen\");\n\t\tModelSelection modelSelection = new ModelSelection();\n\t\tmodelSelection.calculateBestModel(modelCollection);\n\t\t\n\t\ttraining.printMessage(\"Das beste Model: \");\n\t\ttraining.printMessage(modelSelection.getBestEvaluator().printRawData());\n\t\tSystem.out.println(\"------ SMO ------\");\n\t\tfor (int i = 0; i < modelSelection.getBestClassifier().getOptions().length; i++)\n\t\t{\n\t\t\tSystem.out.print(modelSelection.getBestClassifier().getOptions()[i] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n--- Features ---\");\n\t\tSystem.out.println(modelSelection.getBestListOfFeatures().getTopResults());\n\t\t\n\t\t// Schreibe das Modell in eine Datei\n\t\ttraining.printMessage(\"Das beste Modell wird auf Festplatte geschrieben\");\n\t\ttry\n\t\t{\n\t\t\tSerializationHelper.write(\"data/bestPredictor.model\", modelSelection.getBestClassifier());\n\t\t\tSerializationHelper.write(\"data/ranking.filter\", modelSelection.getBestListOfFeatures().getRanking());\n\t\t\tSerializationHelper.write(\"data/components.i\", (modelSelection.getBestListOfFeatures().getProcessedInstances().numAttributes()-1));\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tSystem.err.println(\"Fehler beim Schreiben des Modells auf Festplatte: \" + ex);\n\t\t}\n\t}", "private void readFile(Scanner s, List<Instance> dest) throws FileNotFoundException {\n\t\t// first, read the training data into some storage location\n\t\twhile (s.hasNextLine()) {\n\t\t\tScanner line = new Scanner(s.nextLine());\n\t\t\tif (!line.hasNext()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString result = line.next();\n\t\t\tboolean[] attrs = new boolean[attributeNames.size()];\n\t\t\tfor (int i = 0; line.hasNext(); i++) {\n\t\t\t\tattrs[i] = line.nextBoolean();\n\t\t\t}\n\t\t\t// print\n//\t\t\tSystem.out.print(\"Example \"+result+\" with \");\n//\t\t\tfor (int j = 0; j < attrs.length; j++) {\n//\t\t\t\tSystem.out.print(attrs[j] +\"\\t\");\n//\t\t\t}\n//\t\t\tSystem.out.print(\"\\n\");\n\t\t\t// endprint\n\t\t\tInstance a = new Instance(result,attrs);\n\t\t\tdest.add(a); // finally, add our example\n\t\t\tline.close();\n\t\t}\n\t}", "private void loadInformation(){\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(\"SpaceProgramGaussDistribution.txt\");\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\tString info = \"\";\n\t\t\t\n\t\t\twhile(sc.hasNextLine()){\n\t\t\t\tinfo += sc.nextLine();\n\t\t\t}\n\t\t\t\n\t\t\tString split[] = info.split(\"#\");\n\t\t\t\n\t\t\tfor(int i = 0; i < split.length; i++){\n\t\t\t\tpopulationInfo += split[i]+\"\\n\";\n\t\t\t}\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramGaussDistribution.txt\");\n\t\t}\n\t}", "void readGraphFromFile();", "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 }", "@Override\n public boolean load(String file) {\n try {\n FileInputStream streamIn = new FileInputStream(file);\n ObjectInputStream objectinputstream = new ObjectInputStream(streamIn);\n WGraph_Algo readCase = (WGraph_Algo) objectinputstream.readObject();\n this.ga=null;//initialize the graph\n this.ga=readCase.ga;//take the graph from readCase to this.ga\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "@Override\n\tprotected void readImpl()\n\t{\n\t\t_x = readD();\n\t\t_y = readD();\n\t\t_z = readD();\n\t\t_heading = readD();\n\t}", "public boolean readDataFile();", "public Load(String[] args) {\n\n\t\ttry {\n\t\t\tRandomAccessFile raf = new RandomAccessFile(new File(args[0]), \"rw\");\n\t\t\tthis.sfMap = raf.getChannel();\n\t\t\tthis.stataFile = sfMap.map(FileChannel.MapMode.READ_WRITE, 0, sfMap.size());\n\t\t\tthis.fileHeader = checkVersion(this.stataFile);\n\t\t\tif (this.release >= 113 && this.release <= 115) {\n\t\t\t\tthis.headerData = OldFormats.readHeader(stataFile, fileHeader);\n\t\t\t} else {\n\t\t\t\tthis.headerData = NewFormats.readHeader(stataFile, fileHeader);\n\t\t\t}\n\t\t\tparseHeader();\n\t\t\tif (this.release == 118) {\n\t\t\t\tthis.versionedFile = FileFormats.getVersion(this.sfMap, this.release,\n\t\t\t\t\t\tthis.endian, this.K, (Long) this.headerData.get(3),\n\t\t\t\t\t\tthis.datasetLabel, this.datasetTimeStamp, this.mapOffset);\n\t\t\t} else {\n\t\t\t\tthis.versionedFile = FileFormats.getVersion(this.sfMap, this.release,\n\t\t\t\t\t\tthis.endian, this.K, (Integer) this.headerData.get(3),\n\t\t\t\t\t\tthis.datasetLabel, this.datasetTimeStamp, this.mapOffset);\n\t\t\t}\n\t\t} catch (IOException | DtaCorrupt e) {\n\t\t\tSystem.out.println(String.valueOf(e));\n\t\t}\n\n\t}", "public static void load(Context context) throws IOException {\n // read the file\n String raw = File.readFile(\"vaccine.txt\", context);\n\n // clear the map and load contents of file into the map\n map.clear();\n for (String line : raw.split(\"\\n\")) {\n if (line.equals(\"\")) {\n continue;\n }\n String[] data = line.split(\",\");\n if (data[0].equals(\"\") || data.length != 3) {\n continue;\n }\n map.put(data[0], Boolean.getBoolean(data[1]));\n dateMap.put(data[0], data[2]);\n }\n }", "public int[] readFeature(String featureDefFile) {\n/* 686 */ if (featureDefFile.isEmpty())\n/* 687 */ return null; \n/* 688 */ return FeatureManager.readFeature(featureDefFile);\n/* */ }", "@Test\r\n\tpublic void testBasics() throws FileNotFoundException, IOException {\r\n\t\tBufferedReader r = new BufferedReader(new FileReader(filePath));\r\n\t\tMIKEFileReader reader = new MIKEFileReader(r);\r\n\t\tCrossSection c = reader.getNext();\r\n\t\treader.close();\r\n\t\t/*\r\n\t\tassertEquals(c.getName(), \"Yellowjacket Creek\");\r\n\t\tassertEquals(c.getId(), 1645.920f, 0.0001f);\r\n\t\tassertEquals(c.getPoints().size(), 169);\r\n\t\t*/\r\n\t}", "public static Model loadModel(File f)\n\t{\n\t\ttry\n\t\t{\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(f));\n\n\t\t\tModel m = new Model(f.getPath());\n\t\t\tMaterial cur = null;\n\t\t\tList<Material> mats = new ArrayList<Material>();\n\n\t\t\tString line;\n\t\t\twhile ((line = reader.readLine()) != null)\n\t\t\t{\n\t\t\t\t//Indicates a vertex\n\t\t\t\tif (line.startsWith(\"v \")) \n\t\t\t\t{\n\t\t\t\t\tfloat x = Float.valueOf(line.split(\" \")[1]);\n\t\t\t\t\tfloat y = Float.valueOf(line.split(\" \")[2]);\n\t\t\t\t\tfloat z = Float.valueOf(line.split(\" \")[3]);\n\t\t\t\t\tm.verts.add(new Vector3f(x, y, z));\n\t\t\t\t} \n\t\t\t\t//Indicates a vertex normal\n\t\t\t\telse if (line.startsWith(\"vn \")) \n\t\t\t\t{\n\t\t\t\t\tfloat x = Float.valueOf(line.split(\" \")[1]);\n\t\t\t\t\tfloat y = Float.valueOf(line.split(\" \")[2]);\n\t\t\t\t\tfloat z = Float.valueOf(line.split(\" \")[3]);\n\t\t\t\t\tm.norms.add(new Vector3f(x, y, z));\n\t\t\t\t} \n\t\t\t\t//Indicates a texture coordinate\n\t\t\t\telse if (line.startsWith(\"vt \")) \n\t\t\t\t{\n\t\t\t\t\tfloat x = Float.valueOf(line.split(\" \")[1]);\n\t\t\t\t\tfloat y = Float.valueOf(line.split(\" \")[2]);\n\t\t\t\t\tm.textureCoords.add(new Vector2f(x, y));\n\t\t\t\t} \n\t\t\t\t//Indicates a face\n\t\t\t\telse if (line.startsWith(\"f \")) \n\t\t\t\t{\n\t\t\t\t\t//If face is triangulated\n\t\t\t\t\tif(line.split(\" \").length == 4)\n\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\tVector3f vertexIndices = new Vector3f(\n\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[1].split(\"/\")[0]),\n\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[2].split(\"/\")[0]),\n\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[3].split(\"/\")[0]));\n\n\n\t\t\t\t\t\t//Instantiate as null for scope reasons\n\t\t\t\t\t\tVector3f textureIndices = null;\n\n\t\t\t\t\t\tif(!line.split(\" \")[1].split(\"/\")[1].equals(\"\")&&!(line.split(\" \")[1].split(\"/\")[1].equals(null)))\n\t\t\t\t\t\t\ttextureIndices = new Vector3f(\n\t\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[1].split(\"/\")[1]),\n\t\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[2].split(\"/\")[1]),\n\t\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[3].split(\"/\")[1]));\n\n\t\t\t\t\t\tVector3f normalIndices = new Vector3f(\n\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[1].split(\"/\")[2]),\n\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[2].split(\"/\")[2]),\n\t\t\t\t\t\t\t\tFloat.valueOf(line.split(\" \")[3].split(\"/\")[2]));\n\n\t\t\t\t\t\tFace mf = new Face();\n\n\t\t\t\t\t\t//Instantiate all the arrays\n\t\t\t\t\t\tmf.normals = new Vector3f[3];\n\t\t\t\t\t\tmf.points = new Vector3f[3];\n\n\t\t\t\t\t\t//// SETUP NORMALS ////\n\t\t\t\t\t\tVector3f n1 = m.norms.get((int)normalIndices.x - 1);\n\t\t\t\t\t\tmf.normals[0] = n1;\n\t\t\t\t\t\tVector3f n2 = m.norms.get((int)normalIndices.y - 1);\n\t\t\t\t\t\tmf.normals[1] = n2;\n\t\t\t\t\t\tVector3f n3 = m.norms.get((int)normalIndices.z - 1);\n\t\t\t\t\t\tmf.normals[2] = n3;\n\n\t\t\t\t\t\t//// SETUP VERTICIES ////\n\t\t\t\t\t\tVector3f v1 = m.verts.get((int)vertexIndices.x - 1);\n\t\t\t\t\t\tmf.points[0] = v1;\n\t\t\t\t\t\tVector3f v2 = m.verts.get((int)vertexIndices.y - 1);\n\t\t\t\t\t\tmf.points[1] = v2;\n\t\t\t\t\t\tVector3f v3 = m.verts.get((int)vertexIndices.z - 1);\n\t\t\t\t\t\tmf.points[2] = v3;\n\n\t\t\t\t\t\t//// SETUP TEXTURE COORDS ////\n\t\t\t\t\t\tif(textureIndices!=null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmf.textureCoords = new Vector2f[3];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfloat x1 = m.textureCoords.get((int)textureIndices.x - 1).x;\n\t\t\t\t\t\t\tfloat y1 = 1 - m.textureCoords.get((int)textureIndices.x - 1).y;\n\t\t\t\t\t\t\tVector2f t1 = new Vector2f(x1, y1);\n\t\t\t\t\t\t\tmf.textureCoords[0] = t1;\n\t\t\t\t\t\t\tfloat x2 = m.textureCoords.get((int)textureIndices.y - 1).x;\n\t\t\t\t\t\t\tfloat y2 = 1 - m.textureCoords.get((int)textureIndices.y - 1).y;\n\t\t\t\t\t\t\tVector2f t2 = new Vector2f(x2, y2);\n\t\t\t\t\t\t\tmf.textureCoords[1] = t2;\n\t\t\t\t\t\t\tfloat x3 = m.textureCoords.get((int)textureIndices.z - 1).x;\n\t\t\t\t\t\t\tfloat y3 = 1 - m.textureCoords.get((int)textureIndices.z - 1).y;\n\t\t\t\t\t\t\tVector2f t3 = new Vector2f(x3, y3);\n\t\t\t\t\t\t\tmf.textureCoords[2] = t3;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Set the face's material to the current material\n\t\t\t\t\t\tif(cur != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmf.material = cur;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Tell face to set up AABB\n\t\t\t\t\t\tmf.setUpAABB();\n\n\t\t\t\t\t\tm.faces.add(mf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Indicates a reference to an exterior .mtl file\n\t\t\t\telse if(line.startsWith(\"mtllib \"))\n\t\t\t\t{\n\t\t\t\t\t//The file being referenced by mtllib call\n\t\t\t\t\tFile lib = new File(f.getParentFile()+File.separator+line.split(\" \")[1]);\n\n\t\t\t\t\t//Parse it and add all generated Materials to the mats list\n\t\t\t\t\tmats.addAll(parseMTL(lib, m));\n\t\t\t\t}\n\t\t\t\t//Telling us to use a material\n\t\t\t\telse if(line.startsWith(\"usemtl \"))\n\t\t\t\t{\n\t\t\t\t\tString name = line.split(\" \")[1];\n\n\t\t\t\t\tif(mats!=null)\n\t\t\t\t\t\t//Find material with correct name and use it\n\t\t\t\t\t\tfor(Material material : mats)\n\t\t\t\t\t\t\tif(material.name.equals(name))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcur = material;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\n\t\t\t//Tell model to set up AABB\n\t\t\tm.setUpAABB();\n\t\t\t\n\t\t\t//Remove the first element, because...\n\t\t\tm.faces.remove(0);\n\n\t\t\treturn m;\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "private void loadEnvironment(String filename){\n // Code here to read from the file and set up the environment\n try (BufferedReader br = new BufferedReader(new FileReader(filename))) {\n String line;\n while((line = br.readLine()) != null) {\n String[] values = line.split(\",\");\n String type = values[0].replaceAll(\"[^a-zA-Z0-9]\", \"\"); // remove special characters\n double x = Double.parseDouble(values[1]);\n double y = Double.parseDouble(values[2]);\n switch (type) {\n case \"Zombie\":\n Zombie zombie = new Zombie(x, y);\n this.zombies.put(zombie.getPosition(), zombie);\n break;\n case \"Sandwich\":\n Sandwich sandwich = new Sandwich(x, y);\n this.sandwiches.put(sandwich.getPosition(), sandwich);\n break;\n case \"Player\":\n this.player = new Player(x, y, Integer.parseInt(values[3]));\n break;\n case \"Treasure\":\n this.treasure = new Treasure(x, y);\n break;\n default:\n throw new BagelError(\"Unknown type: \" + type);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public static ParsedData arffFileReader(File file) throws Exception {\n\n ParsedData data;\n String line = null;\n BufferedReader br = new BufferedReader(new FileReader(file));\n\n ArrayList<Attribute> attributes = new ArrayList<>();\n boolean attributeTest = true;\n int attributeNumber = 0;\n ArrayList<String> datasetList = new ArrayList<>();\n String relName = \"\";\n\n int rows = 0;\n int columns = 0;\n\n while ((line = br.readLine()) != null) {\n\n line = line.trim();\n\n if (attributeTest) {\n if(line.startsWith(\"@relation\")){\n relName = line.split(\" \")[1];\n }\n\n if (line.startsWith(\"@attribute\")) {\n attributes.add(parseAttribute(line, attributeNumber));\n attributeNumber++;\n }\n } else {\n String[] instance = parseInstance(line);\n if(instance.length != attributes.size()) {\n System.out.println(\"Skip illegal line: \" + Utils.concatStringArray(instance));\n continue;\n }\n for (int i = 0; i < instance.length; i++) {\n datasetList.add(instance[i]);\n }\n rows++;\n }\n if (line.startsWith(\"@data\")) {\n attributeTest = false;\n }\n\n }\n columns = attributes.size();\n\n String[] datasetArray = new String[datasetList.size()];\n for (int i = 0; i < datasetList.size(); i++) {\n datasetArray[i] = datasetList.get(i);\n }\n\n DataSet dataset = new DataSet(datasetArray, rows, columns);\n data = new ParsedData(dataset, attributes, relName);\n return data;\n\n }", "private void test() throws IOException {\n\t\tdouble wordFreq = 0, probAttr = 0, // overlapped word frequency,\n\t\t\t\t\t\t\t\t\t\t\t// probability of each attribute\n\t\tprobHam, probSpam;// probability of being ham and spam\n\t\tdouble wordAppearInVocab = 0; // whether words in test file appeared in\n\t\t\t\t\t\t\t\t\t\t// all training files\n\t\ttestContent = new String();// content of test file\n\n\t\t/* words in test, spam, ham files */\n\t\tArrayList<String> testWord = new ArrayList<String>();\n\t\tArrayList<String> hamWord = new ArrayList<String>();\n\t\tArrayList<String> spamWord = new ArrayList<String>();\n\t\tString buff;// tmp buffer for file reading\n\t\tBufferedReader in = new BufferedReader(new FileReader(inputTestFile));\n\n\t\t/* assign words */\n\t\twhile ((buff = in.readLine()) != null)\n\t\t\ttestContent += buff;\n\t\tfor (int i = 0; i < testContent.split(\" \").length; i++)\n\t\t\ttestWord.add(testContent.split(\" \")[i]);\n\t\tfor (int i = 0; i < hamContent.split(\" \").length; i++)\n\t\t\thamWord.add(hamContent.split(\" \")[i]);\n\t\tfor (int i = 0; i < spamContent.split(\" \").length; i++)\n\t\t\tspamWord.add(spamContent.split(\" \")[i]);\n\n\t\t/*\n\t\t * calculate the probability of being ham\n\t\t */\n\t\tfor (int i = 0; i < testWord.size(); i++) {\n\t\t\tif (vocabulary.contains(testWord.get(i))) // check whether a word is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// in vocabulary, if\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// not, ignore it\n\t\t\t\twordAppearInVocab++;\n\t\t\tfor (int j = 0; j < hamWord.size(); j++) { // get word frequency of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// words in training\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// files\n\t\t\t\tif (testWord.get(i).equals(hamWord.get(j))) {\n\t\t\t\t\twordFreq++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (wordAppearInVocab != 0) {\n\t\t\t\tprobAttr += java.lang.Math.log((double) (wordFreq + 1) // get\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// probability\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of an\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// attribute\n\t\t\t\t\t\t/ (double) (hamWordCount + vocabLen));\n\t\t\t}\n\t\t\twordFreq = 0;\n\t\t\twordAppearInVocab = 0;\n\t\t}\n\t\tprobHam = java.lang.Math.log(pHam) + probAttr;\n\t\tprobAttr = 0;\n\t\t/*\n\t\t * calculate the probability of being spam\n\t\t */\n\t\tfor (int i = 0; i < testWord.size(); i++) {\n\t\t\tif (vocabulary.contains(testWord.get(i)))\n\t\t\t\twordAppearInVocab++;\n\n\t\t\tfor (int j = 0; j < spamWord.size(); j++) {\n\t\t\t\tif (testWord.get(i).equals(spamWord.get(j))) {\n\t\t\t\t\twordFreq++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif (wordAppearInVocab != 0) {\n\t\t\t\tprobAttr += java.lang.Math.log((double) (wordFreq + 1)\n\t\t\t\t\t\t/ (double) (spamWordCount + vocabLen));\n\t\t\t}\n\t\t\twordFreq = 0;\n\t\t\twordAppearInVocab = 0;\n\t\t}\n\t\tprobSpam = java.lang.Math.log(pSpam) + probAttr;\n\t\tprobAttr = 0;\n\n\t\t/*\n\t\t * output\n\t\t */\n\n\t\t/*\n\t\t * for (int i = 0; i < vocabulary.size(); i++) {\n\t\t * System.out.println(vocabulary.get(i)); } System.out.println(probHam -\n\t\t * probSpam);\n\t\t */\n\t\tif (probHam > probSpam)\n\t\t\tSystem.out.println(\"ham\");\n\t\telse\n\t\t\tSystem.out.println(\"spam\");\n\t}", "public static void main(String args[]) {\n\t\tWeightedInstances tempWeightedInstances = null;\n\t\tString tempFilename = \"src/data/iris.arff\";\n\t\ttry {\n\t\t\tFileReader tempFileReader = new FileReader(tempFilename);\n\t\t\ttempWeightedInstances = new WeightedInstances(tempFileReader);\n\t\t\ttempFileReader.close();\n\t\t} catch (Exception exception1) {\n\t\t\tSystem.out.println(\"Cannot read the file: \" + tempFilename + \"\\r\\n\" + exception1);\n\t\t\tSystem.exit(0);\n\t\t} // Of try\n\n\t\tSystem.out.println(tempWeightedInstances.toString());\n\n\t\ttempWeightedInstances.adjustWeightsTest();\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void readFromFile() throws IOException, ClassNotFoundException {\n\t\ttry {\n\t\t\tInputStream file = new FileInputStream(pathName);\n\n\t\t\tInputStream buffer = new BufferedInputStream(file);\n\n\t\t\tObjectInput input = new ObjectInputStream(buffer);\n\n\t\t\ttagToImg = (Map<String, HashSet<String>>) input.readObject();\n\n\t\t\tinput.close();\n\t\t\tfile.close();\n\t\t} catch (EOFException e) {\n\t\t\ttagToImg = new HashMap<String, HashSet<String>>();\n\t\t} catch (InvalidClassException e) {\n\t\t\tSystem.out.println(\"file doesnt match the type\");\n\t\t}\n\t}", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void loadData()\n\t{\n\t\tString fileName = \"YouthTobaccoUse.csv\"; //file to be read and loaded in\n\t\tScanner input = FileUtils.openToRead(fileName).useDelimiter(\",\");\n\t\tint count = 0;\n\t\tboolean isNewState = false;\n\t\tString state = \"\", measure = \"\", stateAbbr = \"\";\n\t\tdouble percent = 0.0;\n\t\tint stateDate = 0;\n\t\twhile(input.hasNext())\n\t\t{\n\t\t\tString line = input.nextLine();\n\t\t\tint tokenCount = 0;\n\t\t\ttokens[tokenCount] = \"\";\n\t\t\t//each line tokenized\n\t\t\tfor(int i = 0; i < line.length(); i++)\n\t\t\t{\n\t\t\t\tif(line.charAt(i) == ',')\n\t\t\t\t{\n\t\t\t\t\ttokenCount++;\n\t\t\t\t\ttokens[tokenCount] = \"\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\ttokens[tokenCount] += line.charAt(i);\n\t\t\t}\n\t\t\t//loads values into variables, converts String into integers and doubles\n\t\t\tString abbr = tokens[1];\n\t\t\tString name = tokens[2];\n\t\t\tString measureDesc = tokens[5];\n\t\t\tint date = convertInteger(tokens[0]);\n\t\t\tdouble percentage = 0.0;\n\t\t\tif(tokens[10].equals(\"\") == false)\n\t\t\t\tpercentage = convertDouble();\n\t\t\tif(abbr.equals(stateAbbr))\n\t\t\t{\n\t\t\t\tif(measureDesc.equals(\"Smoking Status\") \n\t\t\t\t\t\t\t\t\t|| measureDesc.equals(\"User Status\"))\n\t\t\t\t\tpercent += percentage;\n\t\t\t}\n\t\t\telse\n\t\t\t\tisNewState = true;\n\t\t\tif(isNewState)\n\t\t\t{\n\t\t\t\t//calculates the average values for each state, then adds to \n\t\t\t\t//array list, stored as fields\n\t\t\t\tpercent = (double)(percent/count);\n\t\t\t\tif(state.equals(\"Arizona\") && stateDate == 2017)\n\t\t\t\t\ttobacco.add(new StateTobacco(state, stateAbbr, 3.75, 2017));\n\t\t\t\telse if(state.equals(\"Guam\") == false && count != 0 && count != 1\n\t\t\t\t&& stateAbbr.equals(\"US\") == false)\n\t\t\t\t\ttobacco.add(new StateTobacco(state, stateAbbr, percent, stateDate));\n\t\t\t\tstate = name;\n\t\t\t\tstateAbbr = abbr; \n\t\t\t\tstateDate = date;\n\t\t\t\tisNewState = false;\n\t\t\t\tpercent = 0.0;\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}", "public static void trainingFile(String trainFile, List<Attribute> attributes, List<Instance>instances) {\n\t\tScanner fileScanner = null;\r\n\t\ttry {\r\n\t\t\tfileScanner = new Scanner(new File(trainFile));\r\n\t\t} catch(FileNotFoundException e) {\r\n\t\t\tSystem.err.println(\"Could not find file '\" + trainFile + \r\n\t\t\t\t\t\"'.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\t// Iterate through each line in the file.\r\n\t\tint numOfAtts = -1;\r\n\t\twhile(fileScanner.hasNext()) {\r\n\t\t\tString line = fileScanner.nextLine().trim();\r\n\r\n\t\t\t// Skip blank lines.\r\n\t\t\tif(line.length() == 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t// Use another scanner to parse each word from the line\r\n\t\t\tScanner lineScanner = new Scanner(line);\r\n\t\t\tif (!line.contains(\"//\")) {\r\n\t\t\t\tnumOfAtts = Integer.parseInt(lineScanner.next());\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tlineScanner.close();\r\n\t\t}\r\n\t\tString line = null;\r\n\t\twhile(fileScanner.hasNext()) {\r\n\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\tif(line.length() == 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (!line.contains(\"//\")) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tint count = 0;\r\n\t\t//while(fileScanner.hasNext()) {\r\n\t\twhile (count < numOfAtts) {\r\n\t\t\tif (line.contains(\"//\") || line.length() == 0) {\r\n\t\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tScanner lineScanner = new Scanner(line);\r\n\t\t\tList<String> values = new ArrayList<String>();\r\n\t\t\tString attName = lineScanner.next();\r\n\t\t\twhile (lineScanner.hasNext()) {\r\n\t\t\t\tString value = lineScanner.next();\r\n\t\t\t\tif(!value.equals(\"-\")) {\r\n\t\t\t\t\tvalues.add(value);\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\tAttribute att = new Attribute(attName,values);\r\n\t\t\tattributes.add(att);\r\n\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\tlineScanner.close();\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\twhile(fileScanner.hasNext()) {\r\n\t\t\tif (line.contains(\"//\") || line.length() == 0) {\r\n\t\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t\t//line = fileScanner.nextLine().trim();\r\n\t\t}\r\n\t\tList<String> values = new ArrayList<String>();\r\n\t\twhile(fileScanner.hasNext()) {\r\n\t\t\tif (line.contains(\"//\"))\r\n\t\t\t\tbreak;\r\n\t\t\tif(line.length() == 0) {\r\n\t\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tScanner lineScanner = new Scanner(line);\r\n\t\t\tString label = lineScanner.next();\r\n\t\t\tvalues.add(label);\r\n\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\tlineScanner.close();\r\n\t\t}\r\n\t\tAttribute label = new Attribute (\"label\", values);\r\n\t\tattributes.add(label);\r\n\t\tint numOfInstances = -1;\r\n\t\twhile(fileScanner.hasNext()) {\r\n\t\t\tif(line.length() == 0) {\r\n\t\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tScanner lineScanner = new Scanner(line);\r\n\t\t\tif (!line.contains(\"//\")) {\r\n\t\t\t\tnumOfInstances = Integer.parseInt(lineScanner.next());\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\tlineScanner.close();\r\n\t\t}\r\n\t\tint i = 0;\r\n\t\twhile(fileScanner.hasNext() && i < numOfInstances) {\r\n\t\t\tline = fileScanner.nextLine().trim();\r\n\t\t\tif(line.length() == 0 || line.contains(\"//\")) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tScanner lineScanner = new Scanner(line);\r\n\t\t\tList<String> features = new ArrayList<String>();\r\n\t\t\tString tmp = lineScanner.next();\r\n\t\t\tString instLabel = lineScanner.next();\r\n\t\t\twhile (lineScanner.hasNext()) {\r\n\t\t\t\tfeatures.add(lineScanner.next());\r\n\t\t\t}\r\n\t\t\tfeatures.add(instLabel);\r\n\t\t\tInstance instance = new Instance(numOfAtts,features);\r\n\t\t\tinstances.add(instance);\r\n\t\t\ti++;\r\n\t\t\tlineScanner.close();\r\n\t\t}\r\n\t\tfileScanner.close();\r\n\r\n\t}", "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 void readFile(String filename){\n\t\ttry{\n\t\t\tBufferedReader bf = new BufferedReader(new FileReader(filename));\n\t\t\tString line;\n\t\t\tString[] categories = new String[5];\n\t\t\tline = bf.readLine();\n\t\t\tint[] pointValues = new int[5];\n\t\t\tboolean FJ = false;\n\t\t\t\n\t\t\t// Read the first line\n\t\t\tint index = 0;\n\t\t\tint catnum = 0;\n\t\t\twhile(catnum < 5){\n\t\t\t\tcategories[catnum] = readWord(line, index);\n\t\t\t\tindex += categories[catnum].length();\n\t\t\t\tif(index == line.length()-1){\n\t\t\t\t\tSystem.out.println(\"Error: Too few categories.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t}\n\t\t\t\tfor(int i = 0; i < catnum; i++){\n\t\t\t\t\tif(categories[i].equals(categories[catnum])){\n\t\t\t\t\t\tSystem.out.println(\"Error: Duplicate categories.\");\n\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(catnum < 4)\n\t\t\t\t\tindex += 2;\n\t\t\t\tcatnum++;\n\t\t\t}\n\t\t\tif(index < line.length()-1){\n\t\t\t\tSystem.out.println(\"Error: Too many categories.\");\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t\t\n\t\t\tCategory cat1, cat2, cat3, cat4, cat5, cat6;\n\t\t\tcat1 = new Category(categories[0]);\n\t\t\tcat2 = new Category(categories[1]);\n\t\t\tcat3 = new Category(categories[2]);\n\t\t\tcat4 = new Category(categories[3]);\n\t\t\tcat5 = new Category(categories[4]);\n\t\t\tcat6 = new Category(\"FJ\");\n\n\t\t\t// Read the second line\n\t\t\tline = bf.readLine();\n\t\t\t//System.out.println(line);\n\t\t\tindex = 0;\n\t\t\tint pointnum = 0;\n\t\t\twhile(pointnum < 5){\n\t\t\t\tint point = 0;\n\t\t\t\ttry{\n\t\t\t\t\tpoint = Integer.parseInt(readWord(line, index));\n\t\t\t\t\tindex += (readWord(line, index)).length();\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t\tSystem.out.println(\"Error: point value not integer.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpointValues[pointnum] = point;\n\t\t\t\tfor(int i = 0; i < pointnum; i++){\n\t\t\t\t\tif(pointValues[pointnum] == pointValues[i]){\n\t\t\t\t\t\tSystem.out.println(\"Error: Duplicate point values\");\n\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(pointnum <4)\n\t\t\t\t\tindex += 2;\n\t\t\t\tpointnum++;\n\t\t\t}\n\t\t\tif(index < line.length()-1){\n\t\t\t\tSystem.out.println(\"Error: Too many point values.\");\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t\t\n\t\t\t// Read in the questions\n\t\t\tString q=\"\";\n\t\t\tString a=\"\";\n\t\t\tString category=\"\";\n\t\t\tint point=0;\n\t\t\tint colonNumber = 0;\n\t\t\tQuestion question = new Question(0, \"\", \"\");\n\t\t\t\n\t\t\twhile((line = bf.readLine())!= null && line.length() != 0){\n\t\t\t\tindex = 0;\n\t\t\t\t// New question, initialize all vars\n\t\t\t\tif(line.substring(0,2).equals(\"::\")){\n\t\t\t\t\t// Add the previous question\n\t\t\t\t\tif(question.getPoint() != 0){\n\t\t\t\t\t\tif(category.equals(cat1.getName())){\n\t\t\t\t\t\t\tcat1.addQuestion(question);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(category.equals(cat2.getName())){\n\t\t\t\t\t\t\tcat2.addQuestion(question);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(category.equals(cat3.getName())){\n\t\t\t\t\t\t\tcat3.addQuestion(question);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(category.equals(cat4.getName())){\n\t\t\t\t\t\t\tcat4.addQuestion(question);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(category.equals(cat5.getName())){\n\t\t\t\t\t\t\tcat5.addQuestion(question);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(category.equals(\"FJ\")){\n\t\t\t\t\t\t\tcat6.addQuestion(question);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tSystem.out.println(\"Error: Wrong category name.\");\n\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ta=\"\";\n\t\t\t\t\tq=\"\";\n\t\t\t\t\tcategory=\"\";\n\t\t\t\t\tpoint = 0;\n\t\t\t\t\tindex += 2;\n\t\t\t\t\tcolonNumber = 1;\n\t\t\t\t\tquestion = new Question(0, \"\", \"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If FJ cont'd\n\t\t\t\telse{\n\t\t\t\t\tif(category.equals(\"FJ\")){\n\t\t\t\t\t\twhile(index < line.length()){\n\t\t\t\t\t\t\tswitch(colonNumber){\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tq += readWord(line, index);\n\t\t\t\t\t\t\t\tindex += readWord(line, index).length();\n\t\t\t\t\t\t\t\tquestion.setQuestion(q);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\ta += readWord(line, index);\n\t\t\t\t\t\t\t\tindex += readWord(line, index).length();\n\t\t\t\t\t\t\t\tquestion.setAnswer(a);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error: Format error.\");\n\t\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(colonNumber < 3 && index < line.length()-1 && line.substring(index, index+2).equals(\"::\")){\n\t\t\t\t\t\t\t\tindex+=2;\n\t\t\t\t\t\t\t\tcolonNumber++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// FJ starts\n\t\t\t\tif(readWord(line, index).equals(\"FJ\")){\n\t\t\t\t\tif(FJ){\n\t\t\t\t\t\tSystem.out.println(\"Error: Multiple final jeopardy questions.\");\n\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t}\n\t\t\t\t\tFJ = true;\n\t\t\t\t\tpoint = -100;\n\t\t\t\t\tcategory = \"FJ\";\n\t\t\t\t\tindex += 4;\n\t\t\t\t\tcolonNumber++;\n\t\t\t\t\tif(index < line.length()-1)\n\t\t\t\t\t\tq += readWord(line, index);\n\t\t\t\t\tindex += q.length();\n\t\t\t\t\tindex += 2;\n\t\t\t\t\tif(index < line.length()-1)\n\t\t\t\t\t\ta += readWord(line, index);\n\t\t\t\t\tquestion.setPoint(point);\n\t\t\t\t\tquestion.setAnswer(a);\n\t\t\t\t\tquestion.setQuestion(q);\n\t\t\t\t}\n\t\t\t\t// Other questions\n\t\t\t\telse{\n\t\t\t\t\twhile(index < line.length()){\n\t\t\t\t\t\t//System.out.println(colonNumber);\n\t\t\t\t\t\tswitch(colonNumber){\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tcategory = category + readWord(line, index);\n\t\t\t\t\t\t\tboolean right = false;\n\t\t\t\t\t\t\tfor(int i = 0; i < 5; i++){\n\t\t\t\t\t\t\t\tif(categories[i].equals(category))\n\t\t\t\t\t\t\t\t\tright = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!right){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error: Wrong category.\");\n\t\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tindex += category.length();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tpoint = Integer.parseInt(readWord(line, index));\n\t\t\t\t\t\t\tright = false;\n\t\t\t\t\t\t\tfor(int i = 0; i < 5; i++){\n\t\t\t\t\t\t\t\tif(pointValues[i] == point)\n\t\t\t\t\t\t\t\t\tright = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!right){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error: Wrong point value.\");\n\t\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tindex += readWord(line, index).length();\n\t\t\t\t\t\t\tquestion.setPoint(point);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tq = q + readWord(line, index);\n\t\t\t\t\t\t\tindex += readWord(line, index).length();\n\t\t\t\t\t\t\tquestion.setQuestion(q);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\ta = a+ readWord(line, index);\n\t\t\t\t\t\t\tindex += readWord(line, index).length();\n\t\t\t\t\t\t\tquestion.setAnswer(a);\n\t\t\t\t\t\t\tif(index < line.length()){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error: Format error.\");\n\t\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tSystem.out.println(\"Error: Format error.\");\n\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(colonNumber < 4 && index < line.length()-1 && line.substring(index, index+2).equals(\"::\")){\n\t\t\t\t\t\t\tindex += 2;\n\t\t\t\t\t\t\tcolonNumber++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Add the last question\n\t\t\tif(category.equals(cat1.getName())){\n\t\t\t\tcat1.addQuestion(question);\n\t\t\t}\n\t\t\telse if(category.equals(cat2.getName())){\n\t\t\t\tcat2.addQuestion(question);\n\t\t\t}\n\t\t\telse if(category.equals(cat3.getName())){\n\t\t\t\tcat3.addQuestion(question);\n\t\t\t}\n\t\t\telse if(category.equals(cat4.getName())){\n\t\t\t\tcat4.addQuestion(question);\n\t\t\t}\n\t\t\telse if(category.equals(cat5.getName())){\n\t\t\t\tcat5.addQuestion(question);\n\t\t\t}\n\t\t\telse if(category.equals(\"FJ\")){\n\t\t\t\tcat6.addQuestion(question);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Error: Wrong category name.\");\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t\t\n\t\t\tmCategories.add(cat1);\n\t\t\tmCategories.add(cat2);\n\t\t\tmCategories.add(cat3);\n\t\t\tmCategories.add(cat4);\n\t\t\tmCategories.add(cat5);\n\t\t\tmCategories.add(cat6);\n\t\t\t\n\t\t\tbf.close();\n\t\t}\n\t\t\n\t\tcatch(IOException ioe){\n\t\t\tSystem.out.println(ioe);\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t}", "protected void config_read(String fileParam) {\r\n\t\tFile inputFile = new File(fileParam);\r\n\r\n\t\tif (inputFile == null || !inputFile.exists()) {\r\n\t\t\tSystem.out.println(\"parameter \" + fileParam\r\n\t\t\t\t\t+ \" file doesn't exists!\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t\t// begin the configuration read from file\r\n\t\ttry {\r\n\t\t\tFileReader file_reader = new FileReader(inputFile);\r\n\t\t\tBufferedReader buf_reader = new BufferedReader(file_reader);\r\n\t\t\t// FileWriter file_write = new FileWriter(outputFile);\r\n\r\n\t\t\tString line;\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0); // avoid empty lines for processing ->\r\n\t\t\t\t\t\t\t\t\t\t\t// produce exec failure\r\n\t\t\tString out[] = line.split(\"algorithm = \");\r\n\t\t\t// alg_name = new String(out[1]); //catch the algorithm name\r\n\t\t\t// input & output filenames\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"inputData = \");\r\n\t\t\tout = out[1].split(\"\\\\s\\\"\");\r\n\t\t\tinput_train_name = new String(out[0].substring(1,\r\n\t\t\t\t\tout[0].length() - 1));\r\n\t\t\tinput_test_name = new String(out[1].substring(0,\r\n\t\t\t\t\tout[1].length() - 1));\r\n\t\t\tif (input_test_name.charAt(input_test_name.length() - 1) == '\"')\r\n\t\t\t\tinput_test_name = input_test_name.substring(0,\r\n\t\t\t\t\t\tinput_test_name.length() - 1);\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"outputData = \");\r\n\t\t\tout = out[1].split(\"\\\\s\\\"\");\r\n\t\t\toutput_train_name = new String(out[0].substring(1,\r\n\t\t\t\t\tout[0].length() - 1));\r\n\t\t\toutput_test_name = new String(out[1].substring(0,\r\n\t\t\t\t\tout[1].length() - 1));\r\n\t\t\tif (output_test_name.charAt(output_test_name.length() - 1) == '\"')\r\n\t\t\t\toutput_test_name = output_test_name.substring(0,\r\n\t\t\t\t\t\toutput_test_name.length() - 1);\r\n\r\n\t\t\t// parameters\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"k = \");\r\n\t\t\tnneigh = (new Integer(out[1])).intValue(); // parse the string into\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// a double\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"enn = \");\r\n\t\t\tennNeighbors = (new Integer(out[1])).intValue(); // parse the string\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// integer\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"eta = \");\r\n\t\t\tcleanThreshold = (new Double(out[1])).doubleValue(); // parse the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// string\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// double\r\n\r\n\t\t\tfile_reader.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"IO exception = \" + e);\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "public void readIn() throws FileNotFoundException{\n\t\tScanner sc;\n\t\tif (species.equals(\"Human\")){\n\t\t\tsc= new Scanner(PhenoGeneNetwork.class.getResourceAsStream(\"/GenePhenoEdgeList\"));\t\n\t\t}\t\t\n\t\telse{\n\t\t\tsc= new Scanner(PhenoGeneNetwork.class.getResourceAsStream(\"/GenePhenoEdgeListMouse\"));\t\n\t\t}\n\t\tnodeNameMap = new HashMap<String, CyNode>();\n\t\tproteinNameMap = new HashMap<String, CyNode>();\n\t\tphenotypeNameMap = new HashMap<String, CyNode>();\n\t\twhile (sc.hasNextLine()){\n\t\t\tString line = sc.nextLine();\n\t\t\tString [] nodes = line.split(\"\\t\");\n\t\t\tCyNode node1 = null;\n\t\t\tCyNode node2 = null;\n\t\t\t// for Node1\n\t\t\tif (nodeNameMap.containsKey(nodes[0])){\n\t\t\t\t\n\t\t\t\tnode1 = (CyNode) nodeNameMap.get(nodes[0]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tnode1 = network.addNode();\n\t\t\t\tCyRow attributes = network.getRow(node1);\n\t\t\t\tattributes.set(\"name\", nodes[0]);\n\t\t\t\tnodeNameMap.put(nodes[0], node1);\n\t\t\t\tphenotypeNameMap.put(nodes[0], node1);\t\t\t\t\n\t\t\t}\n\t\t\tif (nodeNameMap.containsKey(nodes[1])){\n\t\t\t\t\n\t\t\t\tnode2 = (CyNode) nodeNameMap.get(nodes[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tnode2 = network.addNode();\n\t\t\t\tCyRow attributes = network.getRow(node2);\n\t\t\t\tattributes.set(\"name\", nodes[1]);\n\t\t\t\tnodeNameMap.put(nodes[1], node2);\n\t\t\t\tproteinNameMap.put(nodes[1], node2);\n\t\t\t}\n\t\t\tif (!network.containsEdge(node1, node2)){\n\t\t\t\t\n\t\t\t\tCyEdge myEdge =network.addEdge(node1, node2, true);\n\t\t\t\tnetwork.getRow(myEdge).set(\"interaction\", \"phenotype\");\n\t\t\t\tnetwork.getRow(myEdge).set(\"name\", nodes[0]+ \" (phenotype) \" +nodes[1]);\n\t\t\t}\n\t\t\t\n\n\n\t\t}\n\n\t\tsc.close();\n\n\t}", "private void loadEnvironment(String filename){\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n String line;\n while ((line = reader.readLine()) != null) {\n String[] info = line.split(\",\");\n String type = info[TYPE_INDEX];\n type = type.replaceAll(\"[^a-zA-Z0-9]\", \"\"); // remove special characters\n Point coordinate = new\n Point(Double.parseDouble(info[POS_X_INDEX]), Double.parseDouble(info[POS_Y_INDEX]));\n\n switch (type) {\n case \"Player\" -> this.player = new Player(coordinate, Integer.parseInt(info[ENERGY_INDEX]));\n case \"Zombie\" -> {\n entityList.add(new Zombie(coordinate, type));\n zombieCounter++;\n }\n case \"Sandwich\" -> {\n entityList.add(new Sandwich(coordinate, type));\n sandwichCounter++;\n }\n case \"Treasure\" -> this.treasure = new Treasure(coordinate, type);\n default -> throw new BagelError(\"Unknown type: \" + type);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n }", "private void fillNCFile() {\n\n List<GradsVariable> vars = gradsDDF.getVariables();\n List<GradsAttribute> attrs = gradsDDF.getAttributes();\n // TODO: ensembles\n List<GradsDimension> dims = gradsDDF.getDimensions();\n Variable v;\n int numZ = 0;\n HashMap<String, Dimension> zDims = new HashMap<>();\n for (GradsDimension dim : dims) {\n String name = getVarName(dim);\n int size = dim.getSize();\n Dimension ncDim = new Dimension(name, size);\n ncFile.addDimension(null, ncDim);\n if (name.equals(ENS_VAR)) {\n v = new Variable(ncFile, null, null, name, DataType.STRING, name);\n v.addAttribute(new Attribute(\"standard_name\", \"ensemble\"));\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Ensemble.toString()));\n List<String> names = gradsDDF.getEnsembleDimension().getEnsembleNames();\n String[] nameArray = new String[names.size()];\n for (int i = 0; i < nameArray.length; i++) {\n nameArray[i] = names.get(i);\n }\n Array dataArray = Array.factory(DataType.STRING, new int[] {nameArray.length}, nameArray);\n v.setCachedData(dataArray, false);\n } else {\n double[] vals = dim.getValues();\n v = new Variable(ncFile, null, null, name, DataType.DOUBLE, name);\n v.addAttribute(new Attribute(CDM.UNITS, dim.getUnit()));\n switch (name) {\n case Y_VAR:\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"latitude\"));\n v.addAttribute(new Attribute(\"standard_name\", \"latitude\"));\n v.addAttribute(new Attribute(\"axis\", \"Y\"));\n sizeY = dim.getSize();\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lat.toString()));\n break;\n case X_VAR:\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"longitude\"));\n v.addAttribute(new Attribute(\"standard_name\", \"longitude\"));\n v.addAttribute(new Attribute(\"axis\", \"X\"));\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lon.toString()));\n sizeX = dim.getSize();\n break;\n case Z_VAR:\n numZ = size;\n zDims.put(name, ncDim);\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"level\"));\n addZAttributes(dim, v);\n break;\n case TIME_VAR:\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"time\"));\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Time.toString()));\n break;\n }\n ArrayDouble.D1 varArray = new ArrayDouble.D1(size);\n for (int i = 0; i < vals.length; i++) {\n varArray.set(i, vals[i]);\n }\n v.setCachedData(varArray, false);\n }\n ncFile.addVariable(null, v);\n }\n if (numZ > 0) {\n GradsDimension zDim = gradsDDF.getZDimension();\n double[] vals = zDim.getValues();\n for (GradsVariable var : vars) {\n int nl = var.getNumLevels();\n if ((nl > 0) && (nl != numZ)) {\n String name = Z_VAR + nl;\n if (zDims.get(name) == null) {\n Dimension ncDim = new Dimension(name, nl);\n ncFile.addDimension(null, ncDim);\n Variable vz = new Variable(ncFile, null, null, name, DataType.DOUBLE, name);\n vz.addAttribute(new Attribute(CDM.LONG_NAME, name));\n vz.addAttribute(new Attribute(CDM.UNITS, zDim.getUnit()));\n addZAttributes(zDim, vz);\n ArrayDouble.D1 varArray = new ArrayDouble.D1(nl);\n for (int i = 0; i < nl; i++) {\n varArray.set(i, vals[i]);\n }\n vz.setCachedData(varArray, false);\n ncFile.addVariable(null, vz);\n zDims.put(name, ncDim);\n }\n }\n }\n }\n for (GradsVariable var : vars) {\n String coords = \"latitude longitude\";\n int nl = var.getNumLevels();\n if (nl > 0) {\n if (nl == numZ) {\n coords = \"level \" + coords;\n } else {\n coords = Z_VAR + nl + \" \" + coords;\n }\n }\n coords = \"time \" + coords;\n if (gradsDDF.getEnsembleDimension() != null) {\n coords = \"ensemble \" + coords;\n }\n v = new Variable(ncFile, null, null, var.getName(), DataType.FLOAT, coords);\n v.addAttribute(new Attribute(CDM.LONG_NAME, var.getDescription()));\n if (var.getUnitName() != null) {\n v.addAttribute(new Attribute(CDM.UNITS, var.getUnitName()));\n }\n v.addAttribute(new Attribute(CDM.FILL_VALUE, (float) gradsDDF.getMissingValue()));\n v.addAttribute(new Attribute(CDM.MISSING_VALUE, (float) gradsDDF.getMissingValue()));\n for (GradsAttribute attr : attrs) {\n if (attr.getVariable().equalsIgnoreCase(var.getName())) {\n // TODO: what to do about a UINT16/32\n if (attr.getType().equalsIgnoreCase(GradsAttribute.STRING)) {\n v.addAttribute(new Attribute(attr.getName(), attr.getValue()));\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.BYTE)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Byte(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.INT16)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Short(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.INT32)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Integer(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.FLOAT32)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Float(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.FLOAT64)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Double(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n }\n }\n }\n ncFile.addVariable(null, v);\n }\n // Global Attributes\n ncFile.addAttribute(null, new Attribute(CDM.CONVENTIONS, \"CF-1.0\"));\n ncFile.addAttribute(null, new Attribute(CDM.HISTORY, \"Direct read of GrADS binary grid into NetCDF-Java 4 API\"));\n String title = gradsDDF.getTitle();\n if ((title != null) && !title.isEmpty()) {\n ncFile.addAttribute(null, new Attribute(\"title\", title));\n }\n for (GradsAttribute attr : attrs) {\n if (attr.getVariable().equalsIgnoreCase(GradsAttribute.GLOBAL)) {\n ncFile.addAttribute(null, new Attribute(attr.getName(), attr.getValue()));\n }\n }\n\n }", "public ArrayList<Instance> read() throws IOException{\n ArrayList<Instance> instances;\n instances = new ArrayList<>();\n String s;\n String[] c;\n Instance i;\n while(reader.ready()){\n s = getInstanceFromFile();\n i = new Instance();\n c = s.split(\",\");\n for(int j = 0; j < c.length - 1; j++)\n i.addFeature(Double.parseDouble(c[j]));\n // The last part of a line is the class label\n // See dataset that is used\n i.setClassification(c[c.length - 1]);\n instances.add(i);\n }\n return instances;\n }", "public Mesh load(String filename)\r\n\t{\r\n\t\tMesh mesh = new Mesh(); mesh.addFileMetaData(filename);\r\n \r\n\t\t//Open file and read in vertices/faces\r\n\t\tScanner sc;\r\n\t\tString line;\r\n\t\t\r\n\t\ttry{\r\n\t\t\tBufferedReader ins = new BufferedReader(new FileReader(filename));\r\n\t\t\tins.readLine(); //ID; always \"nff\"\r\n\t\t\tins.readLine(); //Version\r\n\t\t\t\r\n\t\t\t//We need to move through the header to find the start of the first object\r\n\t\t\t//This will be the first line that contains text that does not start with\r\n\t\t\t//\"viewpos\" or \"viewdir\" (optional features) or \"//\" (comment)\r\n\t\t\twhile(true){\r\n\t\t\t\tline = ins.readLine();\r\n\t\t\t\tsc = new Scanner(line);\r\n\t\t\t\t\r\n\t\t\t\tif(sc.hasNext() == true){\r\n\t\t\t\t\tString token = sc.next();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif((\"viewpos\".equalsIgnoreCase(token) == false) && \r\n\t\t\t\t\t\t\t(\"viewdir\".equalsIgnoreCase(token) == false) &&\r\n\t\t\t\t\t\t\t(\"//\".equals(token.substring(0, 2)) == 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\tsc.close();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsc.close();\r\n\t\t\t\r\n\t\t\t//The rest of the file is filled up with objects\r\n\t\t\twhile(true){\r\n\t\t\t\tsc = new Scanner(line);\r\n\t\t\t\tString name = sc.next();\r\n\t\t\t\tsc.close();\r\n\t\t\t\t\r\n\t\t\t\tsc = new Scanner(ins.readLine());\r\n\r\n\t\t\t\tVector<Point> vertices = new Vector<Point>();\r\n\t\t\t\tVector<Face> faces = new Vector<Face>();\r\n\t\t\t\t\r\n\t\t\t\tint vertexCount = sc.nextInt();\r\n\t\t\t\t\r\n\t\t\t\t//We have vertexCount lines next with 3 floats per line\r\n\t\t\t\twhile(vertexCount > 0){\r\n\t\t\t\t\tsc.close();\r\n\t\t\t\t\tsc = new Scanner(ins.readLine());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(sc.hasNextFloat() == false){\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tfloat x = sc.nextFloat();\r\n\t\t\t\t\t\tfloat y = sc.nextFloat();\r\n\t\t\t\t\t\tfloat z = sc.nextFloat();\r\n\t\t\t\t\t\tvertices.add(new Point(x, y, z));\r\n\t\t\t\t\t\tvertexCount--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsc.close();\r\n\t\t\t\tsc = new Scanner(ins.readLine());\r\n\t\t\t\tint polygonCount = sc.nextInt();\r\n\t\t\t\t\r\n\t\t\t\t//We have polygonCount lines defining the faces\r\n\t\t\t\t//The first int on each line gives the number of\r\n\t\t\t\t//vertices making up that particular face\r\n\t\t\t\t//Then the indexes of those vertices are listed\r\n\t\t\t\twhile(polygonCount > 0){\r\n\t\t\t\t\tsc.close();\r\n\t\t\t\t\tsc = new Scanner(ins.readLine());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(sc.hasNextInt() == false){\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvertexCount = sc.nextInt();\r\n\t\t\t\t\t\tArrayList<Integer> al = new ArrayList<Integer>();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\twhile(vertexCount > 0){\r\n\t\t\t\t\t\t\tal.add(sc.nextInt());\r\n\t\t\t\t\t\t\tvertexCount--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfaces.add(new Face(al));\r\n\t\t\t\t\t\tpolygonCount--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tmesh.addData(vertices, faces, -1, name);\r\n\t\t\t\t\r\n\t\t\t\t//The last thing we need to do is read up to and including\r\n\t\t\t\t//the next object's name or until we reach the end of the file\r\n\t\t\t\t\r\n\t\t\t\twhile((line = ins.readLine()) != null){\r\n\t\t\t\t\tsc.close();\r\n\t\t\t\t\tsc = new Scanner(line);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//The next non-blank line that doesn't start with \"//\" is the start of the next object\r\n\t\t\t\t\tif((sc.hasNext() == true) && (sc.next().substring(0, 2).equals(\"//\") == 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\tsc.close();\r\n\t\t\t\tif(line == null){ //EOF\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null; \r\n\t\t}\r\n\t\t\r\n\t\tmesh.initialize();\r\n \r\n\t\treturn mesh;\r\n\t}", "public GObject(String fileName) throws FileNotFoundException, IOException\n {\n\t BufferedReader reader = null;\n\t try \n\t {\n\t\t File file = new File(fileName); // Get file\n\t\t reader = new BufferedReader(new FileReader(file));\n\t\t \n\t\t int vertexSize = Integer.parseInt(reader.readLine().trim()); \n\t\t vertex = new Point3D [vertexSize];\n\t\t for(int i = 0 ; i < vertexSize ; i ++)\n\t\t {\n\t\t \t\tString [] vertexArray = reader.readLine().split(\" \");\n\t\t \t\tvertex[i] = new Point3D(Double.parseDouble(vertexArray[0]),Double.parseDouble(vertexArray[1]),Double.parseDouble(vertexArray[2]));\n\t\t }\n\t\t \n\t\t reader.readLine(); // Skip a line\n\t\t \n\t\t int faceSize = Integer.parseInt(reader.readLine().trim());\n\t\t face = new Face[faceSize];//Store the faces\n\t\t for(int i = 0 ; i < faceSize ; i++)\n\t\t {\n\t\t \t\tint number_of_faces = Integer.parseInt(reader.readLine().trim());\n\t\t \t\tSystem.out.println(number_of_faces);\n\t\t \t\tString [] index = (reader.readLine().split(\" \"));\n\t\t \t\t\n\t\t \t\tint [] index_v = new int [number_of_faces];\n\t\t \t\t\n\t\t \t\tfor(int j = 0 ; j < index.length; j++)\n\t\t \t\t{\n\t\t \t\t\tindex_v[j] = Integer.parseInt(index[j]);\n\t\t \t\t}\n\t\t \t\tString [] color = reader.readLine().split(\" \");\n\t\t \t\tColor color_v = new Color(Float.parseFloat(color[0]),Float.parseFloat(color[1]),Float.parseFloat(color[2])); // Get the colours\n\t\t \t\tface[i] = new Face(index_v,color_v);\n\t\t \t\tface[i].toString();\n\t\t } \n\t\t} catch (IOException e) \n\t\t{\n\t\t e.printStackTrace();\n\t\t} finally {\n\t\t try \n\t\t {\n\t\t reader.close();\n\t\t } catch (IOException e) \n\t\t {\n\t\t e.printStackTrace();\n\t\t }\n\t\t}\n }", "public void parse(){\n\t\tFile file = new File(fileLocation);\n\n\t\tlong seed = ConfigurationData.DEFAULT_SEED;\n\t\tString outputDest = ConfigurationData.DEFAULT_OUTPUT_DESTINATION;\n\t\tLong tickLength = ConfigurationData.DEFAULT_TICK_LENGTH;\n\t\tint port = ConfigurationData.DEFAULT_PORT;\n\n\t\ttry {\n\n\t\t\tScanner sc = new Scanner(file);\n\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString[] tok = sc.next().split(\"=\");\n\t\t\t\tswitch(tok[0]){\n\t\t\t\tcase \"seed\":\n\t\t\t\t\tseed = Long.parseLong(tok[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outputDestination\":\n\t\t\t\t\toutputDest = tok[1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"tickLength\":\n\t\t\t\t\ttickLength = Long.parseLong(tok[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"port\":\n\t\t\t\t\tport = Integer.parseInt(tok[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsc.close();\n\n\t\t\tconfigurationData = new ConfigurationData(seed, outputDest, tickLength, port);\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\tPrintWriter writer;\n\t\t\ttry {\n\t\t\t\twriter = new PrintWriter(fileLocation, \"UTF-8\");\n\t\t\t\twriter.println(\"seed=\"+seed);\n\t\t\t\twriter.println(\"outputDestination=\"+outputDest);\n\t\t\t\twriter.println(\"tickLength=\"+tickLength);\n\t\t\t\twriter.println(\"port=\"+port);\n\t\t\t\twriter.close();\n\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t} catch (UnsupportedEncodingException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\tconfigurationData = ConfigurationData.makeDefault();\n\t\t\tSystem.out.println(\"Default file created\");\n\t\t}\n\t}", "@Test\n public void testValidFile() throws SetUpException {\n List<VariableWithFeatureEffect> effects = run(new File(TESTDATA, \"valid.csv\"));\n \n assertThat(effects, is(Arrays.asList(new VariableWithFeatureEffect[] {\n new VariableWithFeatureEffect(\"VAR_A\", or(\"VAR_B\", not(\"VAR_C\"))),\n new VariableWithFeatureEffect(\"VAR_B\", False.INSTANCE),\n new VariableWithFeatureEffect(\"VAR_C\", True.INSTANCE)\n })));\n }", "public void Load(String filename)\n\t{\n\t\tTF3D_PARSER PARSER = new TF3D_PARSER();\n\t\tTF3D_Material mat;\n\t\tint BLOCK_ID;\n\t\tString tmp_str;\n\n\t\tSystem.out.println(\"Loading config... \" + filename);\n\t\tBoolean Exist = F3D.AbstractFiles.ExistFile(filename);\n\n\t\tif (!Exist)\n\t\t{\n\t\t\tSystem.out.print(\"Can't load file:\" + filename);\t\t\t\n\t\t}\n\n\t\tPARSER.ParseFile(F3D.AbstractFiles.GetFullPath(filename));\n\n\t\tfor (BLOCK_ID = 0; BLOCK_ID < PARSER.GetBlocksCount(); BLOCK_ID++)\n\t\t{\n\t\t\tPARSER.SetBlock(BLOCK_ID);\n\t\t\tmat = new TF3D_Material();\n\n\t\t\t// get type\n\t\t\ttmp_str = PARSER.GetAs_STRING(\"type\");\n\n\t\t\tif (tmp_str.equalsIgnoreCase(\"MAT_TEXTURE\"))\n\t\t\t{\n\t\t\t\tmat.typ = F3D.MAT_TYPE_TEXTURE;\n\t\t\t}\n\n\t\t\tif (tmp_str.equalsIgnoreCase(\"MAT_SHADER\"))\n\t\t\t{\n\t\t\t\tmat.typ = F3D.MAT_TYPE_SHADER;\n\t\t\t\t// get Shader name\n\t\t\t\tmat.shader_name = PARSER.GetAs_STRING(\"shader\");\n\t\t\t\tmat.shader_id = F3D.Shaders.FindByName(mat.shader_name);\n\t\t\t\tif (mat.shader_id >= 0)\n\t\t\t\t{\n\t\t\t\t\tmat.use_shader = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get name\n\t\t\tmat.name = PARSER.GetAs_STRING(\"name\");\n\n\t\t\t// get material colors deinition\t\t\t \n\n\t\t\tmat.colors.SetDiffuse(PARSER.GetAs_VECTOR4F(\"diffuse\"));\n\t\t\tmat.colors.SetAmbient(PARSER.GetAs_VECTOR4F(\"ambient\"));\n\t\t\tmat.colors.SetSpecular(PARSER.GetAs_VECTOR4F(\"specular\"));\n\t\t\tmat.colors.SetEmissive(PARSER.GetAs_VECTOR4F(\"emissive\"));\n\t\t\tmat.colors.shinisess = PARSER.GetAs_FLOAT(\"shinisess\");\n\t\t\t\n\t\t\tif (mat.colors.shinisess>128.0f)\n\t\t\t{\n\t\t\t\tmat.colors.shinisess=127.0f;\n\t\t\t}\n\t\t\t\n\t\t\t// get texture 0 .. 3\n\t\t\tmat.texture_unit[0].texture_name = PARSER.GetAs_STRING(\"texture_0\");\n\t\t\tmat.texture_unit[1].texture_name = PARSER.GetAs_STRING(\"texture_1\");\n\t\t\tmat.texture_unit[2].texture_name = PARSER.GetAs_STRING(\"texture_2\");\n\t\t\tmat.texture_unit[3].texture_name = PARSER.GetAs_STRING(\"texture_3\");\n\n\t\t\t// get event 0 .. 3\n\t\t\tmat.texture_unit[0].event_name = PARSER.GetAs_STRING(\"event_0\");\n\t\t\tmat.texture_unit[1].event_name = PARSER.GetAs_STRING(\"event_1\");\n\t\t\tmat.texture_unit[2].event_name = PARSER.GetAs_STRING(\"event_2\");\n\t\t\tmat.texture_unit[3].event_name = PARSER.GetAs_STRING(\"event_3\");\n\n\t\t\t// get depthtest\n\t\t\tmat.bDepthTest = PARSER.GetAs_BOOLEAN(\"depthtest\");\n\n\t\t\t// get alphatest\n\t\t\tmat.bAlphaTest = PARSER.GetAs_BOOLEAN(\"alphatest\");\n\n\t\t\t// get faceculling\n\t\t\tmat.bFaceCulling = PARSER.GetAs_BOOLEAN(\"faceculling\");\n\t\t\tF3D.Log.warning(\"Culling\", mat.name + \" \" + mat.bFaceCulling.toString());\n\n\t\t\t// prepare textures\n\t\t\tfor (int t = 0; t < F3D.MAX_TMU; t++)\n\t\t\t{\n\t\t\t\tif (mat.texture_unit[t].texture_name.equals(\"none\"))\n\t\t\t\t{\n\t\t\t\t\tmat.texture_unit[t].bTexture = false;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tBoolean exist = F3D.Textures.Exist(mat.texture_unit[t].texture_name);\n\n\t\t\t\t\tif (exist)\n\t\t\t\t\t{\n\t\t\t\t\t\tmat.texture_unit[t].texture_id = F3D.Textures.FindByName(mat.texture_unit[t].texture_name);\n\t\t\t\t\t\tmat.texture_unit[t].bTexture = true;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tF3D.Log.error(\"TF3D_SurfaceManager\", \"Texture name: '\" + mat.texture_unit[t].texture_name + \"' missing (texture you have to load first !)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (mat.texture_unit[t].event_name.equalsIgnoreCase(\"none\"))\n\t\t\t\t{\n\t\t\t\t\tmat.texture_unit[t].bEvent = false;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tBoolean exist = F3D.MaterialEvents.Exist(mat.texture_unit[t].event_name);\n\n\t\t\t\t\tif (exist)\n\t\t\t\t\t{\n\t\t\t\t\t\tmat.texture_unit[t].event_id = F3D.MaterialEvents.FindByName(mat.texture_unit[t].event_name);\n\t\t\t\t\t\tmat.texture_unit[t].bEvent = true;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tF3D.Log.error(\"TF3D_SurfaceManager\", \"Event name: '\" + mat.texture_unit[t].event_name + \"' missing (events you have to load first !)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.Add(mat);\n\t\t}\n\n\t}", "private void posRead() throws IOException {\n\t\tFile file = new File(fullFileName());\n\t\tString line;\n\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\n\t\tStringBuffer fileText = new StringBuffer();\n\t\twhile((line = reader.readLine()) != null) {\n\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\twhile (st.hasMoreTokens()) {\n \t\tString tokenAndPos = st.nextToken();\n \t\tint slashIndex = tokenAndPos.lastIndexOf('/');\n \t\tif (slashIndex <= 0) throw new IOException(\"invalid data\");\n \t\tString token = tokenAndPos.substring(0,slashIndex);\n \t\tString pos = tokenAndPos.substring(1+slashIndex).intern();\n \t\tint start = this.length();\n \t\tthis.append(token);\n \t\tif (st.hasMoreTokens())\n \t\t\tthis.append(\" \");\n \t\telse\n \t\t\tthis.append(\" \\n\");\n \t\tint end = this.length();\n \t\tSpan span = new Span(start,end);\n \t\tthis.annotate(\"token\", span, new FeatureSet());\n \t\tthis.annotate(\"constit\", span, new FeatureSet(\"cat\", pos));\n \t}\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public static void main(String[] args)\r\n {\r\n //final String INPUT_FILE=\"contact-lenses.arff\";\r\n final String INPUT_FILE=\"adult.merged.arff\";\r\n Instances data;\r\n try {\r\n Reader reader = new FileReader(INPUT_FILE);\r\n data = new Instances(reader);\r\n } catch (Exception e) {\r\n System.out.println(\"Failed to read input file \" + INPUT_FILE + \", exiting\");\r\n return;\r\n }\r\n data.setClassIndex(data.numAttributes()-1);\r\n\r\n System.out.println(\"Acquired data from file \" + INPUT_FILE);\r\n System.out.println(\"Got \" + data.numInstances() + \" instances with \" + data.numAttributes() + \" attributes, class attribute is \" + data.classAttribute().name());\r\n AttributeScoreAlgorithm scorer = new MaxScorer ();\r\n Enumeration<Attribute> atts=(Enumeration<Attribute>)data.enumerateAttributes();\r\n while (atts.hasMoreElements())\r\n {\r\n C45Attribute att=new C45Attribute(atts.nextElement());\r\n System.out.println(\"Score for attribute \" + att.WekaAttribute().name() + \" is \" + scorer.Score(data,att));\r\n }\r\n\r\n List<C45Attribute> candidateAttributes = new LinkedList<C45Attribute>();\r\n Enumeration attEnum = data.enumerateAttributes();\r\n while (attEnum.hasMoreElements())\r\n candidateAttributes.add(new C45Attribute((Attribute)attEnum.nextElement()));\r\n BigDecimal epsilon=new BigDecimal(0.1, DiffPrivacyClassifier.MATH_CONTEXT);\r\n PrivacyAgent agent = new PrivacyAgentBudget(epsilon);\r\n\r\n PrivateInstances privData = new PrivateInstances(agent,data);\r\n privData.setDebugMode(true);\r\n\r\n try {\r\n C45Attribute res=privData.privateChooseAttribute(new MaxScorer(), candidateAttributes,epsilon);\r\n System.out.println(\"Picked attribute \" + res.WekaAttribute().name());\r\n } catch(Exception e) { System.out.println(e.getMessage());}\r\n }", "public static void main(String... args) {\n\n System.out.println(\"File path: \" + args[0]);\n\n try {\n ParsedData data = ArffParser.arffFileReader(new File(args[0]));\n DataSet trainingDataSet = data.getDataset();\n ArrayList<Attribute> attributes = data.getAttributes();\n System.out.println(\"\\n Arff-File successfully loaded! \\n\");\n\n // Select attribute for class attribute\n int numClassAttribute = Integer.parseInt(args[1]);\n Attribute classAttribute = attributes.get(numClassAttribute);\n\n multipleRun(trainingDataSet.transformToWeightedDataSet(),\n attributes,\n classAttribute,\n Integer.parseInt(args[2]),\n Integer.parseInt(args[3]),\n Integer.parseInt(args[4]));\n\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void loadColumnFeatures(String fname, String outputFile) {\n\t\tint totalFeatureCt = 0;\n\t\tint featureNumber = 0;\n\t\tint linesCount = 0;\n\t\tboolean[] goodWeights = new boolean[weights.length];\n\t\ttry {\n\t\t\tBufferedReader matrixReader = new BufferedReader(new FileReader(fname));\n\t\t\tmatrixReader.readLine(); // get first line\n\t\t\t\n\t\t\t//read file\n\t\t\tfor ( ; ; ) {\n\t\t\t\tString line = matrixReader.readLine();\n\t\n\t\t\t\tif (line == null) {\n\t\t\t\t\tmatrixReader.close();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\n\t\t\t\telse {\n\t\t\t\t\tString[] parts = line.split(\" \");\n\t\t\t\t\tdouble tfWordsInContext = 0;\n\t\t\t\t\tdouble ctWordsInContext = 0;\n\t\t\t\t\tint uniqueCount = 0;\n\t\t\t\t\t\n\t\t\t\t\t//place the words from a context into a Hashtable\n\t\t\t\t\tHashtable<Integer, Double> wordsInCurrFeat = new Hashtable<Integer, Double>();\n\t\t\t\t\tfor(int i = 0; i < parts.length; i+=2){\n\t\t\t\t\t\tif(parts.length > 1 && goodWords.get(Integer.parseInt(parts[i]))){\n\t\t\t\t\t\t\twordsInCurrFeat.put(Integer.parseInt(parts[i]), Double.parseDouble(parts[i+1]));\n\t\t\t\t\t\t\tctWordsInContext += Double.parseDouble(parts[i+1]);\n\t\t\t\t\t\t\ttfWordsInContext += wordsCount.get(Integer.parseInt(parts[i]));\n\t\t\t\t\t\t\tuniqueCount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if there are more than 2 words that can be used for training count tp, fp, fn and tn.\n\t\t\t\t\tif(uniqueCount >= 2){\n\t\t\t\t\t\tdouble[] pairCts = getPairCounts(wordsInCurrFeat); // counts found pairs sharing the same feautre\n\t\t\t\t\t\tdouble relShareFeat = pairCts[0]; // tp\n\t\t\t\t\t\tdouble unrelShareFeat = pairCts[1]; // fp\n\t\t\t\t\t\tdouble relNotShareFeat = countRelatedPairsInDifferentContexts(wordsInCurrFeat); // counts all pairs sharing the same feature\n\t\t\t\t\t\t\n\t\t\t\t\t\ttotalFeatureCt ++;\n\n\t\t\t\t\t\tdouble notShareFeat = ctWordsInContext * (legitWords-tfWordsInContext); \n\t\t\t\t\t\t\n\t\t\t\t\t\tdouble truePos = relShareFeat;\n\t\t\t\t\t\tdouble falsePos = unrelShareFeat;\n\t\t\t\t\t\tdouble falseNeg = relNotShareFeat;\n\t\t\t\t\t\tdouble trueNeg = notShareFeat - falseNeg; // pairs unrelated & not sharing feature\n\t\t\t\t\t\t\n\t\t\t\t\t\t//find association\n\t\t\t\t\t\tdouble value = MatrixWeighter.getAssociation(truePos, falsePos, falseNeg, trueNeg, type);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//check for a few common errors\n\t\t\t\t\t\t//shouldn't matter now but factored in during debugging.\n\t\t\t\t\t\t//if(Double.isNaN(value) || Double.isInfinite(value) || trueNeg < 0){\n\t\t\t\t\t\t\tLOGGER.severe(\"Error at feature: \"+featureNumber +\"\\n\" +(long)truePos + \" \" + (long)falsePos + \"\\n\" + (long)falseNeg + \" \" + (long)trueNeg + \"\\n\" + value);\n\t\t\t\t\t\t//}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//set feature weight\n\t\t\t\t\t\tweights[featureNumber] = value;\n\t\t\t\t\t\tgoodWeights[featureNumber] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tgoodWeights[featureNumber] = false;\n\t\t\t\t\t}\n\t\t\t\t\tfeatureNumber++;\n\t\t\t\t}\n\n\t\t\t\t//track progress\n\t\t\t\tlinesCount++;\n\t\t\t\tif(linesCount % 1000 == 0){\n\t\t\t\t\tLOGGER.info(\"Features processed: \" + linesCount);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.warning(e.getMessage());\n\t\t}\n\t\tLOGGER.info(\"Features included: \" + totalFeatureCt);\n\t\t\n\t\t//find average feature weight\n\t\tdouble ave = 0;\n\t\tdouble totalGoodWeights = 0;\n\t\tfor(int i = 0; i < weights.length; i++){\n\t\t\tif(goodWeights[i]){\n\t\t\t\tave += weights[i];\n\t\t\t\ttotalGoodWeights++;\n\t\t\t}\n\t\t}\n\t\tave = ave / totalGoodWeights;\n\t\tif(Double.isNaN(ave)){\n\t\t\tLOGGER.warning(\"Not a number\");\n\t\t}\n\t\tLOGGER.info(\"Average score: \" + ave);\n\t\t\n\t\t//normalize average to 1.0 \n\t\t//print out the new weights into the column weight file.\n\t\ttry{\n\t\t\tBufferedWriter weightsWriter = new BufferedWriter(new FileWriter(outputFile));\n\t\t\tfor(int i = 0; i < weights.length; i++){\n\t\t\t\tif(goodWeights[i]){\n\t\t\t\t\tweights[i] = weights[i]/ave;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tweights[i] = ave;\n\t\t\t\t}\n\t\t\t\tweightsWriter.write(i + \" \" + weights[i] + \"\\n\");\n\t\t\t}\n\t\n\t\t\tweightsWriter.close();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tLOGGER.warning(e.getMessage());\n\t\t}\n\t}", "private void processNewFile(String filename) throws IOException {\n \n /*read posture information from file*/\n Posture posture = new Posture(filename);\n /* keep the predictions made by each activity HMM to later choose the best one*/\n Map<Activity, Prediction> predictions = new EnumMap<Activity, Prediction>(Activity.class);\n Prediction prediction;\n Map.Entry<Activity, Prediction> bestPrediction;\n String predictedActivity;\n int preds[], predictedActivityIndex;\n int frameNumber = FileNameComparator.getFileNumber(filename);\n \n for (Activity activity : Activity.values()) {\n /* make a prediction using an activity's HMM*/\n prediction = predictActivity(activity, posture, filename);\n predictions.put(activity, prediction);\n }\n \n /* select the best prediction */\n bestPrediction = chooseBestPrediction(predictions);\n \n preds = bestPrediction.getValue().getPredictions();\n \n /* check to see if no activity has been detected */\n if (preds[preds.length - 1] == 1) {\n predictedActivity = bestPrediction.getKey().getName();\n predictedActivityIndex = bestPrediction.getKey().getIndex();\n } else {\n predictedActivity = \"no activity\";\n predictedActivityIndex = 0;\n }\n \n \n System.out.println(\"Activity from frame \" + frameNumber + \": \" + predictedActivity);\n \n /* log activity prediction to file */\n appendActivityToFile(frameNumber, predictedActivityIndex, bestPrediction.getValue().getProbability());\n \n \n }", "private static Hashtable<String, TruthInfo> ReadTruth(String path) {\n Hashtable<String, TruthInfo> oTruth = new Hashtable<String, TruthInfo>();\n \n FileReader fr = null;\n BufferedReader bf = null;\n \n try {\n fr = new FileReader(path);\n bf = new BufferedReader(fr);\n String sCadena = \"\";\n\n while ((sCadena = bf.readLine())!=null)\n {\n String []data = sCadena.split(\":::\");\n if (data.length==3) {\n String sAuthorId = data[0];\n if (!oTruth.containsKey(sAuthorId)) {\n TruthInfo info = new TruthInfo();\n info.country = data[1];\n info.gender = data[2];\n oTruth.put(sAuthorId, info);\n }\n }\n }\n } catch (Exception ex) {\n System.out.println(ex.toString());\n } finally {\n if (bf!=null) { try { bf.close(); } catch (Exception ignored) {} }\n if (fr!=null) { try { fr.close(); } catch (Exception ignored) {} }\n }\n \n return oTruth;\n }", "public void readConfigFile() throws IOException {\r\n Wini iniFileParser = new Wini(new File(configFile));\r\n\r\n databaseDialect = iniFileParser.get(DATABASESECTION, \"dialect\", String.class);\r\n databaseDriver = iniFileParser.get(DATABASESECTION, \"driver\", String.class);\r\n databaseUrl = iniFileParser.get(DATABASESECTION, \"url\", String.class);\r\n databaseUser = iniFileParser.get(DATABASESECTION, \"user\", String.class);\r\n databaseUserPassword = iniFileParser.get(DATABASESECTION, \"userPassword\", String.class);\r\n\r\n repositoryName = iniFileParser.get(REPOSITORYSECTION, \"name\", String.class);\r\n\r\n partitions = iniFileParser.get(DEFAULTSECTION, \"partitions\", Integer.class);\r\n logFilename = iniFileParser.get(DEFAULTSECTION, \"logFilename\", String.class);\r\n logLevel = iniFileParser.get(DEFAULTSECTION, \"logLevel\", String.class);\r\n\r\n maxNGramSize = iniFileParser.get(FEATURESSECTION, \"maxNGramSize\", Integer.class);\r\n maxNGramFieldSize = iniFileParser.get(FEATURESSECTION, \"maxNGramFieldSize\", Integer.class);\r\n String featureGroupsString = iniFileParser.get(FEATURESSECTION, \"featureGroups\", String.class);\r\n\r\n if ( databaseDialect == null )\r\n throw new IOException(\"Database dialect not found in config\");\r\n if ( databaseDriver == null )\r\n throw new IOException(\"Database driver not found in config\");\r\n if ( databaseUrl == null )\r\n throw new IOException(\"Database URL not found in config\");\r\n if ( databaseUser == null )\r\n throw new IOException(\"Database user not found in config\");\r\n if ( databaseUserPassword == null )\r\n throw new IOException(\"Database user password not found in config\");\r\n\r\n if (repositoryName == null)\r\n throw new IOException(\"Repository name not found in config\");\r\n\r\n if (partitions == null)\r\n partitions = 250;\r\n if ( logFilename == null )\r\n logFilename = \"FeatureExtractor.log\";\r\n if ( logLevel == null )\r\n logLevel = \"INFO\";\r\n\r\n if ( featureGroupsString != null ) {\r\n featureGroups = Arrays.asList(featureGroupsString.split(\"\\\\s*,\\\\s*\"));\r\n }\r\n if (maxNGramSize == null)\r\n maxNGramSize = 5;\r\n if (maxNGramFieldSize == null)\r\n maxNGramFieldSize = 500;\r\n\r\n }", "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 }", "@SuppressWarnings(\"unchecked\")\n\tprivate void parseMapData(String filename){\n\t\ttry{\n\t\t\tXMLInputFactory inputFactory = XMLInputFactory.newInstance();\n\t\t\tInputStream in = new FileInputStream(filename);\n\t\t\tXMLEventReader eventReader = inputFactory.createXMLEventReader(in);\n\t\t\t\n\t\t\t//Read through the .osm file\n\t\t\twhile(eventReader.hasNext()){\n\n\t\t\t\tXMLEvent event = eventReader.nextEvent();\n\t\t\t\t\n\t\t\t\t//At start of a new tag\n\t\t\t\tif(event.isStartElement()){\n\t\t\t\t\tStartElement startElement = event.asStartElement();\n\t\t\t\t\t\n\t\t\t\t\t//If we have bounds tag\n\t\t\t\t\tif(startElement.getName().getLocalPart() == (BOUNDS)){\n\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Found bounds tag\");\n\t\t\t\t\t\tfloat maxlon = 0,minlat = 0;\n\t\t\t\t\t\tIterator<Attribute> attributes = startElement.getAttributes();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Go through all bounds attributes\n\t\t\t\t\t\twhile(attributes.hasNext()){\n\t\t\t\t\t\t\tAttribute attribute = attributes.next();\n\t\t\t\t\t\t\tif(attribute.getName().toString().equals(MINLAT)) minlat = Float.parseFloat(attribute.getValue());\n\t\t\t\t\t\t\telse if(attribute.getName().toString().equals(MINLON)) minlon = Float.parseFloat(attribute.getValue());\n\t\t\t\t\t\t\telse if(attribute.getName().toString().equals(MAXLAT)) maxlat = Float.parseFloat(attribute.getValue());\n\t\t\t\t\t\t\telse if(attribute.getName().toString().equals(MAXLON)) maxlon = Float.parseFloat(attribute.getValue());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Calculate scaling values for lon and lat to screen coordinates\n\t\t\t\t\t\tfloat latDiff = maxlat-minlat;\n\t\t\t\t\t\tfloat lonDiff = maxlon-minlon;\n\t\t\t\t\t\tscaleLonX = Frame.SIM_WINDOW_LENGTH / lonDiff;\n\t\t\t\t\t\tscaleLatY = -Frame.SIM_WINDOW_LENGTH / latDiff;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//If we have a node tag\n\t\t\t\t\telse if(startElement.getName().getLocalPart() == (NODE)){\n\t\t\t\t\t\tString id = \"\";\n\t\t\t\t\t\tfloat lon = 0, lat = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tIterator<Attribute> attributes = startElement.getAttributes();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Go through all node attributes\n\t\t\t\t\t\twhile(attributes.hasNext()){\n\t\t\t\t\t\t\tAttribute attribute = attributes.next();\n\t\t\t\t\t\t\tif(attribute.getName().toString().equals(ID)) id = attribute.getValue();\n\t\t\t\t\t\t\telse if(attribute.getName().toString().equals(LON)) lon = Float.parseFloat(attribute.getValue());\n\t\t\t\t\t\t\telse if(attribute.getName().toString().equals(LAT)) lat = Float.parseFloat(attribute.getValue());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tNode node = new Node(Math.round(scaleLonX*(lon-minlon)),Math.round(scaleLatY*(lat-maxlat)));\n\t\t\t\t\t\t\n\t\t\t\t\t\tevent = eventReader.nextEvent();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Check if node has any tags\n\t\t\t\t\t\twhile(true){\n\n\t\t\t\t\t\t\tif(event.isStartElement()){\n\t\t\t\t\t\t\t\tstartElement = event.asStartElement();\n\t\t\t\t\t\t\t\t//Does this node have any tags?\n\t\t\t\t\t\t\t\tif(startElement.getName().getLocalPart() == (TAG)){\n\t\t\t\t\t\t\t\t\tattributes = startElement.getAttributes();\n\t\t\t\t\t\t\t\t\t//Go through all tag attributes\n\t\t\t\t\t\t\t\t\twhile(attributes.hasNext()){\n\t\t\t\t\t\t\t\t\t\tAttribute attribute = attributes.next();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//K\n\t\t\t\t\t\t\t\t\t\tif(attribute.getName().toString().equals(K)){\n\t\t\t\t\t\t\t\t\t\t\t//SHOP\n\t\t\t\t\t\t\t\t\t\t\tif(attribute.getValue().toString().equals(SHOP)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added shop\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(SHOP);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.SHOP_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//V\n\t\t\t\t\t\t\t\t\t\telse if(attribute.getName().toString().equals(V)){\n\t\t\t\t\t\t\t\t\t\t\t//CROSSING\n\t\t\t\t\t\t\t\t\t\t\tif(attribute.getValue().toString().equals(CROSSING)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added CROSSING\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(CROSSING);\n\t\t\t\t\t\t\t\t\t\t\t\tnonTargetNodes.add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//SUBWAY ENTRANCE\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(SUBWAY_ENTRANCE)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added SUBWAY_ENTRANCE\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(SUBWAY_ENTRANCE);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.PUBLIC_TRANSPORT.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//BUS STATION\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(BUS_STATION)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added BUS_STATION\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(BUS_STATION);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.PUBLIC_TRANSPORT.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//BUS STOP\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().equals(BUS_STOP)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added BUS_STOP\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(BUS_STOP);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.PUBLIC_TRANSPORT.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//RESTAURANT\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(RESTAURANT)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added RESTAURANT\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(RESTAURANT);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.RESTAURANT_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//CAFE\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(CAFE)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added CAFE\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(CAFE);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.CAFE_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//TOILETS\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(TOILETS)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added Toilet\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(TOILETS);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.TOILET_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//WASTE BIN\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(WASTEBIN)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added WASTE BIN\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(WASTEBIN);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.WASTE_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//FAST FOOD\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(FAST_FOOD)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added FAST_FOOD\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(FAST_FOOD);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.FASTFOOD_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//DOCTORS\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(DOCTORS)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added DOCTORS\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(DOCTORS);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.HEALTH.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//HOSPITAL\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(HOSPITAL)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added HOSPITAL\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(HOSPITAL);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.HEALTH.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//PHARMACY\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(PHARMACY)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added PHARMACY\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(PHARMACY);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.HEALTH.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//LIBRARY\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(LIBRARY)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added LIBRARY\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(LIBRARY);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.STUDY.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//BANK\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(BANK)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added BANK\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(BANK);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.BANK_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//ATM\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(ATM)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(Frame.DEBUG)System.out.println(\"Added BANK\");\n\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(BANK);\n\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.BANK_I.ordinal()).add(node);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//STATION\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(STATION)){\n\t\t\t\t\t\t\t\t\t\t\t\tif(node.getXPos() >= 0 && node.getXPos() < Frame.SIM_WINDOW_LENGTH && \n\t\t\t\t\t\t\t\t\t\t\t\t node.getYPos() >= 0 && node.getYPos() < Frame.SIM_WINDOW_LENGTH)\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\t\tif(Frame.DEBUG)System.out.println(\"Added STATION\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tnode.setTag(STATION);\n\t\t\t\t\t\t\t\t\t\t\t\t\ttargets.get(TargetEnums.PUBLIC_TRANSPORT.ordinal()).add(node);\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}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(event.isEndElement()){\n\t\t\t\t\t\t\t\tEndElement endElement = event.asEndElement();\n\t\t\t\t\t\t\t\t//END NODE\n\t\t\t\t\t\t\t\tif(endElement.getName().getLocalPart() == (NODE)){\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tevent = eventReader.nextEvent();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tnodeMap.put(id, node); //Put our node into the node map\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//If we have a way tag\n\t\t\t\t\telse if(startElement.getName().getLocalPart() == (WAY)){\n\t\t\t\t\t\tLinkedList<Node> nodes = new LinkedList<Node>();\n\t\t\t\t\t\tMapObject mapObject = null;\n\t\t\t\t\t\tboolean ignore = false;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Go through all node references for way\n\t\t\t\t\t\twhile(true){\n\t\t\t\t\t\t\t//Is event a start element?\n\t\t\t\t\t\t\tif(event.isStartElement()){\n\t\t\t\t\t\t\t\tstartElement = event.asStartElement();\n\t\n\t\t\t\t\t\t\t\t//A new node has been detected for the way\n\t\t\t\t\t\t\t\tif(startElement.getName().getLocalPart() == (ND)){\n\t\t\t\t\t\t\t\t\tIterator<Attribute> attributes = startElement.getAttributes();\n\t\t\t\t\t\t\t\t\t//Take the single attribute the node reference\n\t\t\t\t\t\t\t\t\twhile(attributes.hasNext()){\n\t\t\t\t\t\t\t\t\t\tAttribute attribute = attributes.next();\n\t\t\t\t\t\t\t\t\t\tif(attribute.getName().toString().equals(REF)) nodes.add(nodeMap.get(attribute.getValue()));\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//A tag has been detected for the way\n\t\t\t\t\t\t\t\tif(startElement.getName().getLocalPart() == (TAG)){\n\t\t\t\t\t\t\t\t\tIterator<Attribute> attributes = startElement.getAttributes();\n\t\t\t\t\t\t\t\t\t//Take the attribute the tag references\n\t\t\t\t\t\t\t\t\twhile(attributes.hasNext()){\n\t\t\t\t\t\t\t\t\t\tAttribute attribute = attributes.next();\n\t\t\t\t\t\t\t\t\t\t//Value\n\t\t\t\t\t\t\t\t\t\tif(attribute.getName().toString().equals(V)) {\n\t\t\t\t\t\t\t\t\t\t\t//FOOTWAY\n\t\t\t\t\t\t\t\t\t\t\tif(attribute.getValue().toString().equals(FOOTWAY)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(FOOTWAY_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(FOOTWAY_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(FOOTWAY_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//PEDESTRIAN\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(PEDESTRIAN)){\n\t\t\t\t\t\t\t\t\t\t\t\t//AREA\n\t\t\t\t\t\t\t\t\t\t\t\tif(mapObject instanceof Area){\n\t\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(PEDESTRIAN_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(PEDESTRIAN_COLOR);\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\t//WAY\n\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(PEDESTRIAN_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(PEDESTRIAN_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(PEDESTRIAN_COLOR);\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//PARK\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(PARK)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Area();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(PARK_COST);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(PARK_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//WOOD\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(WOOD)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Area();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(WOOD_COST);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(WOOD_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//WATER\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(WATER)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Area();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(WATER_COST);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(WATER_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//STEPS\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(STEPS)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(FOOTWAY_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(FOOTWAY_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(STEPS_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//SERVICE\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(SERVICE)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(SERVICE_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(SERVICE_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(SERVICE_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//CYCLE WAY\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(CYCLEWAY)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(CYCLEWAY_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(CYCLEWAY_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(CYCLEWAY_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//PLATFORM\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(PLATFORM)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(RAILWAY_PLATFORM_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(RAILWAY_PLATFORM_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(RAILWAY_PLATFORM_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//NARROW GAUGE (RAILWAY)\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(NARROW_GAUGE)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(RAILWAY_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(RAILWAY_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(RAILWAY_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//SUBWAY\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(SUBWAY)){\n\t\t\t\t\t\t\t\t\t\t\t\tignore = true;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//EDUCATION\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(EDUCATION)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setTag(EDUCATION);\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\t//Key\n\t\t\t\t\t\t\t\t\t\telse if(attribute.getName().getLocalPart() == (K)){\n\t\t\t\t\t\t\t\t\t\t\t//BUILDING\n\t\t\t\t\t\t\t\t\t\t\tif(attribute.getValue().toString().equals(BUILDING)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Building();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(BUILDING_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(BUILDING_COST);\n\t\t\t\t\t\t\t\t\t\t\t\tignore = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//WATERWAY\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(WATERWAY)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setColor(WATER_COLOR);\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(WATER_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(WATERWAY_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//AREA\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(AREA)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Area();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//BARRIER\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(BARRIER)){\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t\t\t\t\t\t\tmapObject.setCost(BARRIER_COST);\n\t\t\t\t\t\t\t\t\t\t\t\t((Way)mapObject).setWidth(BARRIER_WIDTH);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//AMENITY\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(AMENITY)){\n\t\t\t\t\t\t\t\t\t\t\t\tignore = 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//LANDUSE\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(LANDUSE)){\n\t\t\t\t\t\t\t\t\t\t\t\tignore = 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//MAN MADE\n\t\t\t\t\t\t\t\t\t\t\telse if(attribute.getValue().toString().equals(MAN_MADE)){\n\t\t\t\t\t\t\t\t\t\t\t\tignore = true;\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\t//Is event an end element?\n\t\t\t\t\t\t\telse if(event.isEndElement()){\n\t\t\t\t\t\t\t\tEndElement endElement = event.asEndElement();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//At the end of a Way element? (add way and onwards to next tag)\n\t\t\t\t\t\t\t\tif(endElement.getName().getLocalPart() == (WAY)){\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tevent = eventReader.nextEvent();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(mapObject == null && !ignore){\n\t\t\t\t\t\t\tmapObject = new Way();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(mapObject != null && !ignore) {\n\t\t\t\t\t\t\tmapObject.addNodes(nodes);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Calculate collision and add to collection\n\t\t\t\t\t\t\tif(mapObject instanceof Building){\n\t\t\t\t\t\t\t\t((Building)mapObject).checkTargetsInside(targets);\n\t\t\t\t\t\t\t\tbuildings.add((Building)mapObject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(mapObject instanceof Area){\n\t\t\t\t\t\t\t\tareas.add((Area)mapObject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(mapObject instanceof Way){\n\t\t\t\t\t\t\t\tways.add((Way)mapObject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmapObject.calculateCollision(collisionMatrix);\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\tprogress += 5;\n\t\t\tsetProgress(progress);\n\t\t\tcheckTargetsReachable();\n\t\t\tsetProgress(97);\n\t\t\treadIcons();\n\t\t\tsetProgress(98);\n\t\t\tsetTargetCosts();\n\t\t\tsetProgress(99);\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\tcatch (XMLStreamException e) {\n \t \te.printStackTrace();\n\t\t}\n\t}", "public NFA(File f){readMachineDescription(f);}", "public void loadFeatures() throws IOException {\n final File apiKeyFile = new File(System.getProperty(\"user.home\") + \"/.datarank-api-key\");\n final DataRank dataRank = new DataRank(new DataRankConfiguration(IOUtils.toString(new FileInputStream(apiKeyFile)).trim()));\n final List<FeatureSet> features = DataRankTopicFeatureExtractor.downloadComments(dataRank, \"tide-pods\", 1000);\n FeatureLoader.write(features, \"/tmp/tide-pods.csv\");\n }", "public void loadData() {\n Path path= Paths.get(filename);\n Stream<String> lines;\n try {\n lines= Files.lines(path);\n lines.forEach(ln->{\n String[] s=ln.split(\";\");\n if(s.length==3){\n try {\n super.save(new Teme(Integer.parseInt(s[0]),Integer.parseInt(s[1]),s[2]));\n } catch (ValidationException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }else\n System.out.println(\"linie corupta in fisierul teme.txt\");});\n } catch (IOException e) {\n e.printStackTrace();\n }\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}", "@Test\n\tpublic void testProcessAndLoad() {\n\t\tPreProcessor preProcessor = new PreProcessor();\n\t\tpreProcessor.processFiles(new File(\"res/tests/test1.txt\"));\n\t\tNGramModel actualModel = preProcessor.getNgramModel();\n\t\tactualModel.end();\n\t\t\n\t\tString testFilePath = \"res/bin/test.bin\";\n\t\t\n\t\tFile dir = new File(\"res/bin\");\n\t\tif (!dir.exists()) {\n\t\t\tdir.mkdirs();\n\t\t}\n\t\t\n\t\tpreProcessor.writeToFile(testFilePath);\n\t\t\n\t\tLoader loader = new Loader();\n\t\tNGramModel loadedModel = loader.load(testFilePath);\n\t\tassertEquals(loadedModel.numNgrams(), actualModel.getNgrams().size());\n\t\t\n\t\tfor (Map.Entry<NGram, Integer> current : actualModel.getNgrams().entrySet()) {\n\t\t\tassertEquals((int)current.getValue(), loadedModel.getCount(current.getKey()));\n\t\t}\n\t\t\n\t\tfor (int i = 1; i <= actualModel.maxLength(); i++) {\n\t\t\tassertEquals(loadedModel.numberOfNGramLength(i), actualModel.numberOfNGramLength(i));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < actualModel.topUnigrams().size(); i++) {\n\t\t\tassertEquals(loadedModel.topUnigrams().get(i), actualModel.topUnigrams().get(i));\n\t\t}\n\t\t\n\t\tassertEquals(\n\t\t\tloadedModel.getGoodTuringEstimation().getTotal(),\n\t\t\tactualModel.getGoodTuringEstimation().getTotal());\n\t\t\n\t\tassertEquals(\n\t\t\tloadedModel.getGoodTuringEstimation().getA(),\n\t\t\tactualModel.getGoodTuringEstimation().getA(), 1E-6);\n\t\t\n\t\tassertEquals(\n\t\t\tloadedModel.getGoodTuringEstimation().getB(),\n\t\t\tactualModel.getGoodTuringEstimation().getB(), 1E-6);\n\t}", "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 }", "private void trainFeatures() throws Exception\n\t{\n\t\tdbiterator.setDataSource(DBInstanceIterator.DBSource.FEATURE);\n\t\tSystem.out.println(\"Starting reading Feature Trainingset ..\");\n\t\tPipe serialpipe = getFeaturePipe();\n\t\tInstanceList feature_instances = new InstanceList(serialpipe);\n\t\tSystem.out.println(\"Preprocessing on Feature Trainingset ..\");\n\t\tfeature_instances.addThruPipe(dbiterator);\n\t\tSystem.out.println(\"Feature Training set : \" + feature_instances.size());\n\t\tSystem.out.println(\"Saving preprocessed data ..\");\n\t\tsaveinstances(feature_instances, Train + \"F.bin\");\n\t\tSystem.out.println(\"Saving Features data ..\");\n\t\tfeature_instances.getDataAlphabet().dump(new PrintWriter(new File(Attributes + \"feature.dat\")));\n\t\tClassifierTrainer trainer = new NaiveBayesTrainer();\n\t\tSystem.out.println(\"NaiveBayes Starts Training on Feature training set ..\");\n\t\tClassifier classifier = trainer.train(feature_instances);\n\t\tSystem.out.println(\"Targets labels : \\t\"+classifier.getLabelAlphabet());\n\t\tSystem.out.println(\"Saving Naive Bayes Classifier ..\");\n\t\tsaveModel(classifier, Feature_Train);\n\t\tSystem.out.println(\"Feature classifier saved to : \" + Feature_Train);\n\t}", "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 boolean readState(String _filename) {\r\n\t\treturn readVariables(_filename, stateVariablesList);\r\n\t}", "public void readNetworkFromFile() {\r\n\t\tFileReader fr = null;\r\n\t\t// open file with name given by filename\r\n\t\ttry {\r\n\t\t\ttry {\r\n\t\t\t\tfr = new FileReader (filename);\r\n\t\t\t\tScanner in = new Scanner (fr);\r\n\r\n\t\t\t\t// get number of vertices\r\n\t\t\t\tString line = in.nextLine();\r\n\t\t\t\tint numVertices = Integer.parseInt(line);\r\n\r\n\t\t\t\t// create new network with desired number of vertices\r\n\t\t\t\tnet = new Network (numVertices);\r\n\r\n\t\t\t\t// now add the edges\r\n\t\t\t\twhile (in.hasNextLine()) {\r\n\t\t\t\t\tline = in.nextLine();\r\n\t\t\t\t\tString [] tokens = line.split(\"[( )]+\");\r\n\t\t\t\t\t// this line corresponds to add vertices adjacent to vertex u\r\n\t\t\t\t\tint u = Integer.parseInt(tokens[0]);\r\n\t\t\t\t\t// get corresponding Vertex object\r\n\t\t\t\t\tVertex uu = net.getVertexByIndex(u);\r\n\t\t\t\t\tint i=1;\r\n\t\t\t\t\twhile (i<tokens.length) {\r\n\t\t\t\t\t\t// get label of vertex v adjacent to u\r\n\t\t\t\t\t\tint v = Integer.parseInt(tokens[i++]);\r\n\t\t\t\t\t\t// get corresponding Vertex object\r\n\t\t\t\t\t\tVertex vv = net.getVertexByIndex(v);\r\n\t\t\t\t\t\t// get capacity c of (uu,vv)\r\n\t\t\t\t\t\tint c = Integer.parseInt(tokens[i++]);\r\n\t\t\t\t\t\t// add edge (uu,vv) with capacity c to network \r\n\t\t\t\t\t\tnet.addEdge(uu, vv, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinally { \r\n\t\t\t\tif (fr!=null) fr.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.err.println(\"IO error:\");\r\n\t\t\tSystem.err.println(e);\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "@PostConstruct\n public void loaddata() throws IOException {\n File file = ResourceUtils.getFile(configProvider.getFilePath());\n Reader in = new FileReader(file.getPath());\n Iterable<CSVRecord> records = CSVFormat.RFC4180.withHeader(\n \"locationid\", \"Applicant\", \"FacilityType\", \"cnn\", \"LocationDescription\", \"Address\", \"blocklot\", \"block\", \"lot\",\n \"permit\", \"Status\", \"FoodItems\", \"X\", \"Y\", \"Latitude\", \"Longitude\", \"Schedule\",\n \"dayshours\", \"NOISent\", \"Approved\", \"Received\", \"PriorPermit\", \"ExpirationDate\",\n \"Location\", \"Fire Prevention Districts\", \"Police Districts\",\n \"Supervisor Districts\", \"Zip Codes\", \"Neighborhoods (old)\"\n ).parse(in);\n\n Iterator<CSVRecord> iterator = records.iterator();\n iterator.next();\n // use our own ids because of how atomic integers work, we can't have a 0 for an id, so can't rely on outside sources.\n int i = 0;\n while (iterator.hasNext()) {\n CSVRecord record = iterator.next();\n FoodTruck truck = new FoodTruck(Float.parseFloat(record.get(\"Latitude\")), Float.parseFloat(record.get(\"Longitude\")),\n record.get(\"Address\"), record.get(\"FoodItems\"), ++i);\n //add food truck to datastore\n truckDataStore.addTruck(truck.getId(), truck);\n\n final Rectangle rect = new Rectangle(truck.getLat(), truck.getLon(),\n truck.getLat(), truck.getLon());\n //add food truck location + id to location data store.\n locationDataStore.getSpatialIndex().add(rect, truck.getId());\n }\n }", "public ObjModel(File file) throws FileNotFoundException {\r\n\r\n\t\tvertices = new ArrayList<>();\r\n\t\ttextureCoordinates = new ArrayList<>();\r\n\t\tfaces = new ArrayList<>();\r\n\r\n\t\tScanner scanner = new Scanner(file);\r\n\r\n\t\twhile (scanner.hasNextLine()) {\r\n\t\t\tString[] line = scanner.nextLine().split(\" \");\r\n\t\t\tif (line[0].equals(\"v\")) {\r\n\t\t\t\tfloat x = Float.parseFloat(line[1]);\r\n\t\t\t\tfloat y = Float.parseFloat(line[2]);\r\n\t\t\t\tfloat z = Float.parseFloat(line[3]);\r\n\t\t\t\tvertices.add(new Vector3f(x, y, z));\r\n\t\t\t} else if (line[0].equals(\"vt\")) {\r\n\t\t\t\tfloat x = Float.parseFloat(line[1]);\r\n\t\t\t\tfloat y = Float.parseFloat(line[2]);\r\n\t\t\t\ttextureCoordinates.add(new Vector3f(x, y));\r\n\t\t\t} else if (line[0].equals(\"f\")) {\r\n\t\t\t\tFace face = new Face();\r\n\t\t\t\tfor (int i = 1; i < line.length; i++) {\r\n\t\t\t\t\tString[] sections = line[i].split(\"/\");\r\n\t\t\t\t\tif (sections.length >= 1) {\r\n\t\t\t\t\t\tint vertex = Integer.parseInt(sections[0]);\r\n\t\t\t\t\t\tface.addVertex(vertex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (sections.length >= 2) {\r\n\t\t\t\t\t\tint textureCoordinate = Integer.parseInt(sections[1]);\r\n\t\t\t\t\t\tface.addTextureCoordinate(textureCoordinate);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfaces.add(face);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscanner.close();\r\n\t}", "public void readInput(String fileName){\n\n BufferedReader reader;\n try {\n reader = new BufferedReader(new FileReader(fileName));\n String line = reader.readLine(); //read first line\n int numLine =1; //keep track the number of line\n while (line != null) {\n String[] tokens = line.trim().split(\"\\\\s+\"); //split line into token\n if(numLine==1){ //for the first line\n intersection = Integer.parseInt(tokens[0]); //set the number of intersection\n roadways = Integer.parseInt(tokens[1]); // set the number of roadways\n coor = new Coordinates[intersection];\n g = new Graph(intersection);//create a graph\n line = reader.readLine();\n numLine++;\n }\n else if(numLine>1&&numLine<intersection+2){ //for all intersection\n while(numLine>1&&numLine<intersection+2){\n tokens = line.trim().split(\"\\\\s+\");\n coor[Integer.parseInt(tokens[0])] = new Coordinates(Integer.parseInt(tokens[1]),Integer.parseInt(tokens[2])); //add into coor array to keep track the coor of intersection\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine ==intersection+2){ //skip the space line\n line = reader.readLine();\n numLine++;\n while(numLine<roadways+intersection+3){ // for all the roadways, only include the number of roadways mention in the first line\n tokens = line.trim().split(\"\\\\s+\");\n int fst = Integer.parseInt(tokens[0]);\n int snd = Integer.parseInt(tokens[1]);\n g.addEgde(fst,snd,coor[fst].distTo(coor[snd]));\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine >= roadways+intersection+3)\n break;\n }\n reader.close();\n } catch (FileNotFoundException e){\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void ReadFile (String filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\tScanner input = new Scanner(new FileReader(filename));\n\t\t\tScanner line = new Scanner(input.nextLine());\n\t\t\twhile (input.hasNextLine() || line.hasNext())\n\t\t\t{\n\t\t\t\tPolygon polygon = new Polygon ();\n\t\t\t\twhile (line.hasNextDouble())\n\t\t\t\t{\n\t\t\t\t\tdouble tmpX = line.nextDouble(),\n\t\t\t\t\t\t\ttmpY = line.nextDouble(),\n\t\t\t\t\t\t\ttmpZ = line.nextDouble();\n\t\t\t\t\tpolygon.add(new Vec4(tmpX, tmpY, tmpZ));\n\t\t\t\t}\n\t\t\t\tif (input.hasNextLine())\n\t\t\t\t{\n\t\t\t\t\tline = new Scanner(input.nextLine());\n\t\t\t\t}\n\t\t\t\tobject.add(polygon);\n\t\t\t}\n\t\t\tinput.close();\n\t\t\tline.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Classifier generateBackgroundClassificationModel(Dataset dataset, Properties properties) throws Exception {\n String backgroundFilePath = properties.getProperty(\"backgroundClassifierLocation\") + \"_background_\" + dataset.getName() + \"_classifier_obj\";\n Path path = Paths.get(backgroundFilePath);\n\n //If the classification model already exists, load and return it\n if (Files.exists(path)) {\n FileInputStream streamIn = new FileInputStream(backgroundFilePath);\n ObjectInputStream objectinputstream = new ObjectInputStream(streamIn);\n try {\n Classifier backgroundModel = (Classifier) objectinputstream.readObject();\n objectinputstream.close();\n return backgroundModel;\n }\n catch (Exception ex) {\n System.out.println(\"Error reading Instances from file: \" + dataset.getName() + \" : \" + ex.getMessage());\n return null;\n }\n }\n //Otherwise, generate, save and return it (WARNING - takes time)\n else {\n File folder = new File(properties.getProperty(\"DatasetInstancesFilesLocation\"));\n File[] filesArray = folder.listFiles();\n\n boolean addHeader = true;\n boolean foundDatasets = false;\n for (int i = 0; i < filesArray.length; i++) {\n //for (int i = 0; i < 1; i++) {\n //we're making sure that the analyzed item is both a file AND not generated from the dataset we're currently analyzing\n if (filesArray[i].isFile() && !filesArray[i].getName().contains(dataset.getName()) && filesArray[i].getPath().contains(\".arff\")) {\n addArffFileContentToTargetFile(backgroundFilePath, filesArray[i].getAbsolutePath(), addHeader);\n addHeader = false;\n foundDatasets = true;\n }\n else {\n System.out.println(\"skipping file: \" + filesArray[i].getName());\n }\n }\n if (!foundDatasets) {\n throw new Exception(\"If no background model is trained, please provide additional Datasets at \" + properties.getProperty(\"DatasetInstancesFilesLocation\"));\n }\n //now we load the contents of the ARFF file into an Instances object and train the classifier\n BufferedReader reader = new BufferedReader(new FileReader(backgroundFilePath + \".arff\"));\n //Instances data = new Instances(reader);\n //reader.close();\n\n ArffLoader.ArffReader arffReader = new ArffLoader.ArffReader(reader);\n //Instances structure = arffReader.getStructure();\n Instances data = arffReader.getData();\n\n data.setClassIndex(data.numAttributes() - 1);\n\n //the chosen classifier\n RandomForest classifier = new RandomForest();\n classifier.setNumExecutionSlots(Integer.parseInt(properties.getProperty(\"numOfThreads\")));\n\n classifier.buildClassifier(data);\n\n File file = new File(backgroundFilePath + \".arff\");\n file.delete();\n\n //now we write the classifier to file prior to returning the object\n FileOutputStream out = new FileOutputStream(backgroundFilePath);\n ObjectOutputStream oout = new ObjectOutputStream(out);\n oout.writeObject(classifier);\n oout.flush();\n oout.close();\n\n return classifier;\n }\n }", "public FeatureDictionary(File f) \n\t\tthrows IOException, SAXException, BoxerXMLException {\n\tthis(ParseXML.readFileToElement(f));\n }", "public static void readFileBronze(String filename) throws FileNotFoundException{\n try {\n //Scanners and readers and everything??\n File text = new File(filename);\n Scanner inf = new Scanner(text);\n BufferedReader brTest = new BufferedReader(new FileReader(filename));\n String firstLine = brTest.readLine();\n String[] firstLineArray = new String[4];\n firstLineArray = firstLine.split(\" \");\n\n //Determines rows, cols, elevation, number of instructions.\n r = Integer.parseInt(firstLineArray[0]);\n c = Integer.parseInt(firstLineArray[1]);\n e = Integer.parseInt(firstLineArray[2]);\n n = Integer.parseInt(firstLineArray[3]);\n\n //Initializes map.\n map = new int[r][c];\n inf.nextLine();\n for (int i = 0; i < r; i++){\n for (int j = 0; j < c; j++) {\n map[i][j] = inf.nextInt();\n }\n }\n //System.out.println(inf.nextLine());\n //System.out.println(inf.nextLine());\n\n //Instructions.\n\n instructions = new int[n][3];\n for (int i = 0; i < n; i++){\n inf.nextLine();\n for (int j = 0; j < 3; j++){\n instructions[i][j] = inf.nextInt();\n }\n }\n //Exceptions.\n } catch (FileNotFoundException ex){\n System.out.println(\"Yikes\");\n } catch (IOException ex){\n System.out.println(\"Yikes\");\n }\n }", "@SuppressWarnings(\"resource\")//I ADDED\n\tpublic static CensusData parse(String filename) {\n\t\tCensusData result = new CensusData();\n\t\t\n try {\n BufferedReader fileIn = new BufferedReader(new FileReader(filename));\n \n // Skip the first line of the file\n // After that each line has 7 comma-separated numbers (see constants above)\n // We want to skip the first 4, the 5th is the population (an int)\n // and the 6th and 7th are latitude and longitude (floats)\n // If the population is 0, then the line has latitude and longitude of +.,-.\n // which cannot be parsed as floats, so that's a special case\n // (we could fix this, but noisy data is a fact of life, more fun\n // to process the real data as provided by the government)\n \n String oneLine = fileIn.readLine(); // skip the first line\n\n // read each subsequent line and add relevant data to a big array\n while ((oneLine = fileIn.readLine()) != null) {\n String[] tokens = oneLine.split(\",\");\n if(tokens.length != TOKENS_PER_LINE)\n \tthrow new NumberFormatException();\n int population = Integer.parseInt(tokens[POPULATION_INDEX]);\n if(population != 0)\n \tresult.add(population,\n \t\t\t Float.parseFloat(tokens[LATITUDE_INDEX]),\n \t\t Float.parseFloat(tokens[LONGITUDE_INDEX]));\n }\n\n fileIn.close();\n } catch(IOException ioe) {\n System.err.println(\"Error opening/reading/writing input or output file.\");\n System.exit(1);\n } catch(NumberFormatException nfe) {\n System.err.println(nfe.toString());\n System.err.println(\"Error in file format\");\n System.exit(1);\n }\n return result;\n\t}", "private void getAccuracy() throws IOException {\r\n\t\tFile accuracy = new File(\".\" + _fileName + \"_\" + _level);\r\n\t\tif (! accuracy.exists()) {\r\n\t\t\taccuracy.createNewFile();\r\n\t\t} else {\r\n\r\n\t\t\tFileReader fr = new FileReader(accuracy);\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\tString str;\r\n\t\t\tstr = br.readLine();\r\n\t\t\t_attempts = Integer.parseInt(str);\r\n\t\t\tstr = br.readLine();\r\n\t\t\t_fails = Integer.parseInt(str);\r\n\t\t\tstr = br.readLine();\r\n\t\t\t_highScore = Integer.parseInt(str);\r\n\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n ReadFile trainingFile = new ReadFile(\"input/treino.txt\");\n ReadFile testFile = new ReadFile(\"input/teste.txt\");\n\n // Guarda as series temporais do arquivo de treino em uma lista\n ArrayList<TimeSerie> training = new ArrayList<>();\n while(trainingFile.hasNextLine()) {\n training.add(trainingFile.nextSerie());\n }\n\n // Processa cada linha do arquivo de teste e contabiliza um acerto ou erro\n while(testFile.hasNextLine()) {\n\n }\n }", "public static void main(String[] args) {\n\t\tCreateClassificationData test = new CreateClassificationData(\"originalData/Data.txt\");\n\t}", "public static void main(String[] args) throws Exception {\n int numLinesToSkip = 0;\n String delimiter = \",\"; //这是csv文件中的分隔符\n RecordReader recordReader = new CSVRecordReader(numLinesToSkip,delimiter);\n recordReader.initialize(new FileSplit(new ClassPathResource(\"dataSet20170119.csv\").getFile()));\n\n //Second: the RecordReaderDataSetIterator handles conversion to DataSet objects, ready for use in neural network\n\n /**\n * 这是标签(类别)所在列的序号\n */\n int labelIndex = 0; //5 values in each row of the iris.txt CSV: 4 input features followed by an integer label (class) index. Labels are the 5th value (index 4) in each row\n //类别的总数\n int numClasses = 2; //3 classes (types of iris flowers) in the iris data set. Classes have integer values 0, 1 or 2\n\n //一次读取多少条数据。当数据量较大时可以分几次读取,每次读取后就训练。这就是随机梯度下降\n int batchSize = 2000; //Iris data set: 150 examples total. We are loading all of them into one DataSet (not recommended for large data sets)\n\n DataSetIterator iterator = new RecordReaderDataSetIterator(recordReader,batchSize,labelIndex,numClasses);\n //因为我在这里写的2000是总的数据量大小,一次读完,所以一次next就完了。如果分批的话要几次next\n DataSet allData = iterator.next();\n// allData.\n allData.shuffle();\n SplitTestAndTrain testAndTrain = allData.splitTestAndTrain(0.8); //Use 65% of data for training\n\n DataSet trainingData = testAndTrain.getTrain();\n DataSet testData = testAndTrain.getTest();\n //We need to normalize our data. We'll use NormalizeStandardize (which gives us mean 0, unit variance):\n //数据归一化的步骤,非常重要,不做可能会导致梯度中的几个无法收敛\n DataNormalization normalizer = new NormalizerStandardize();\n normalizer.fit(trainingData); //Collect the statistics (mean/stdev) from the training data. This does not modify the input data\n normalizer.transform(trainingData); //Apply normalization to the training data\n normalizer.transform(testData); //Apply normalization to the test data. This is using statistics calculated from the *training* set\n\n\n final int numInputs = 9202;\n int outputNum = 2;\n int iterations = 1000;\n long seed = 142;\n int numEpochs = 50; // number of epochs to perform\n\n log.info(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(seed)\n .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)\n .iterations(iterations)\n .activation(Activation.SIGMOID)\n .weightInit(WeightInit.ZERO) //参数初始化的方法,全部置零\n .learningRate(1e-3) //经过测试,这里的学习率在1e-3比较合适\n .regularization(true).l2(5e-5) //正则化项,防止参数过多导致过拟合。2阶范数乘一个比率\n .list()\n\n .layer(0, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)\n .activation(Activation.SIGMOID)\n .nIn(numInputs).nOut(outputNum).build())\n .backprop(true).pretrain(false)\n .build();\n\n //run the model\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n model.setListeners(new ScoreIterationListener(100));\n\n\n log.info(\"Train model....\");\n for( int i=0; i<numEpochs; i++ ){\n log.info(\"Epoch \" + i);\n model.fit(trainingData);\n\n //每个epoch结束后立马观察模型估计的效果,方便及早停止\n Evaluation eval = new Evaluation(numClasses);\n INDArray output = model.output(testData.getFeatureMatrix());\n eval.eval(testData.getLabels(), output);\n log.info(eval.stats());\n }\n\n }", "public void read() {\n prepareAdditionalStates();\n materialParameters.clear();\n int level = 0;\n boolean params = false;\n boolean states = false;\n try {\n //scan material text\n for (String line : material.asLines()) {\n //trim line incl comments\n line = trimLine(line);\n //find and load matdef file\n if (line.startsWith(\"Material \") || line.startsWith(\"Material\\t\") && level == 0) {\n parseMaterialProperties(line);\n }\n //start parsing material parameters\n if (line.startsWith(\"MaterialParameters \") || line.startsWith(\"MaterialParameters\\t\") || line.startsWith(\"MaterialParameters{\") && level == 1) {\n params = true;\n }\n //start parsing renderstates\n if (line.startsWith(\"AdditionalRenderState \") || line.startsWith(\"AdditionalRenderState\\t\") || line.startsWith(\"AdditionalRenderState{\") && level == 1) {\n states = true;\n }\n //up a level\n if (line.indexOf(\"{\") != -1) {\n level++;\n }\n //down a level, stop processing parameters/states\n if (line.indexOf(\"}\") != -1) {\n level--;\n if (params) {\n params = false;\n }\n if (states) {\n states = false;\n }\n }\n //try reading parameter\n if (level == 2 && params) {\n int colonIdx = line.indexOf(\":\");\n if (colonIdx != -1) {\n String[] lines = line.split(\":\");\n MaterialProperty prop = new MaterialProperty();\n prop.setName(lines[0].trim());\n if (lines.length > 1) {\n prop.setValue(lines[lines.length - 1].trim());\n }\n materialParameters.put(prop.getName(), prop);\n }\n }\n //try reading state\n if (level == 2 && states) {\n String[] lines = null;\n int colonIdx = line.indexOf(\" \");\n if (colonIdx != -1) {\n lines = line.split(\" \");\n }\n colonIdx = line.indexOf(\"\\t\");\n if (colonIdx != -1) {\n lines = line.split(\"\\t\");\n }\n if (lines != null) {\n MaterialProperty prop = new MaterialProperty();\n String name = lines[0].trim();\n prop.setName(name);\n if (additionalRenderStates.get(name) != null) {\n\n prop.setType(additionalRenderStates.get(name).getType());\n if (lines.length > 1) {\n String value = \"\";\n for (int i = 1; i < lines.length; i++) {\n value += \" \" + lines[i];\n }\n prop.setValue(value.trim());\n } \n additionalRenderStates.put(prop.getName(), prop);\n }\n }\n }\n }\n checkWithMatDef();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n }", "public boolean readState(String _filename, java.net.URL _codebase) {\r\n// return readVariables (_filename, _codebase, stateVariablesList);\r\n\t\treturn readVariables(_filename, stateVariablesList);\r\n\t}", "public void readFromFile() {\n FileInputStream fis = null;\n try {\n //reaad object\n fis = new FileInputStream(file);\n ObjectInputStream ois = new ObjectInputStream(fis);\n TravelAgent travelAgent = (TravelAgent)ois.readObject();\n travelGUI.setTravelAgent(travelAgent);\n ois.close();\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n if (fis != null) {\n try {\n fis.close();\n }\n catch (IOException e2) {\n System.out.println(e2.getMessage());\n }\n }\n return;\n }\n finally {\n if (fis != null) {\n try {\n fis.close();\n }\n catch (IOException e2) {\n System.out.println(e2.getMessage());\n }\n }\n }\n if (fis != null) {\n try {\n fis.close();\n }\n catch (IOException e2) {\n System.out.println(e2.getMessage());\n }\n }\n }", "public boolean writeAttributeFile();", "public abstract void readFromFile( ) throws Exception;", "public void parseDefaults() throws FileNotFoundException,\n\t\t\tIOException {\n\t\t// System.out.println(\"in parse\\t\"+szDefaultFile);\n\t\tString szLine;\n\t\tBufferedReader br;\n\t\ttry {\n\t\t\tString szError = \"\";\n\t\t\tbr = new BufferedReader(new FileReader(szDefaultFile));\n\t\t\twhile ((szLine = br.readLine()) != null) {\n\t\t\t\tStringTokenizer st = new StringTokenizer(szLine, \"\\t\");\n\t\t\t\tif (st.hasMoreTokens()) {\n\t\t\t\t\tString sztype = st.nextToken().trim();\n\n\t\t\t\t\tString szvalue = \"\";\n\t\t\t\t\tif (st.hasMoreTokens()) {\n\t\t\t\t\t\tszvalue = st.nextToken().trim();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!szvalue.equals(\"\")) {\n\t\t\t\t\t\tif ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Use_static_input_to_build_model\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Use_transcription_factor-gene_interaction_data_to_build\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Use_transcription_factor_gene_interaction_data_to_build\"))) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"true\")) {\n\t\t\t\t\t\t\t\tbstaticsearchDEF = true;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"false\")) {\n\t\t\t\t\t\t\t\tbstaticsearchDEF = false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tszError += \"Warning: \" + szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an unrecognized \" + \"value for \"\n\t\t\t\t\t\t\t\t\t\t+ sztype + \" \"\n\t\t\t\t\t\t\t\t\t\t+ \"(expecting true or false)\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Static_Input_Data_File\")\n\t\t\t\t\t\t\t\t|| sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"TF_gene_Interactions_File\")\n\t\t\t\t\t\t\t\t|| sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"TF-gene_Interactions_File\")) {\n\t\t\t\t\t\t\tszStaticFileDEF = szvalue;\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Data_File\")\n\t\t\t\t\t\t\t\t|| sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Expression_Data_File\")) {\n\t\t\t\t\t\t\tszDataFileDEF = szvalue;\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Convergence_Likelihood_%\")) {\n\t\t\t\t\t\t\tdCONVERGENCEDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Minimum_Standard_Deviation\")) {\n\t\t\t\t\t\t\tdMINSTDDEVALDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Saved_Model_File\")) {\n\t\t\t\t\t\t\tszInitFileDEF = szvalue;\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Spot_IDs_included_in_the_data_file\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Spot_IDs_included_in_the_the_data_file\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Spot_IDs_in_the_data_file\"))) {\n\t\t\t\t\t\t\tbspotcheckDEF = (szvalue.equalsIgnoreCase(\"true\"));\n\t\t\t\t\t\t} else if ((sztype.equalsIgnoreCase(\"Normalize_Data\"))\n\t\t\t\t\t\t\t\t|| (sztype.equalsIgnoreCase(\"Transform_Data\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Transform_Data[Log transform data,Linear transform data,Add 0]\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Normalize_Data[Log normalize data,Normalize data,No normalization/add 0]\"))) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tnnormalizeDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t\t\tif ((nnormalizeDEF < 0) || (nnormalizeDEF > 2)) {\n\t\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\t\tszvalue\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" is an invalid argument for Normalize_Data\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\t\t\t\tif (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Log normalize data\")) {\n\t\t\t\t\t\t\t\t\tnnormalizeDEF = 0;\n\t\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Normalize data\")) {\n\t\t\t\t\t\t\t\t\tnnormalizeDEF = 1;\n\t\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"No normalization/add 0\")) {\n\t\t\t\t\t\t\t\t\tnnormalizeDEF = 2;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\t\tszvalue\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" is an invalid argument for Normalize_Data\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Change_should_be_based_on[Maximum-Minimum,Difference From 0]\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Change_should_be_based_on\"))) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Maximum-Minimum\")) {\n\t\t\t\t\t\t\t\tbmaxminDEF = true;\n\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Difference From 0\")) {\n\t\t\t\t\t\t\t\tbmaxminDEF = false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tszError += szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value of \"\n\t\t\t\t\t\t\t\t\t\t+ \"Change_should_be_based_on[Maximum-Minimum,Difference From 0]\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Gene_Annotation_Source\")) {\n\t\t\t\t\t\t\t/*Boolean bProteAll=false;\n\t\t\t\t\t\t\t * try { ndbDEF = Integer.parseInt(szvalue); if\n\t\t\t\t\t\t\t * ((ndbDEF < 0)|| (ndbDEF >= organisms.length)) {\n\t\t\t\t\t\t\t * ndbDEF = 0; } } catch(NumberFormatException ex) {\n\t\t\t\t\t\t\t * boolean bfound = false; int nsource = 0; while\n\t\t\t\t\t\t\t * ((nsource < organisms.length)&&(!bfound)) { if\n\t\t\t\t\t\t\t * (organisms[nsource].equalsIgnoreCase(szvalue)) {\n\t\t\t\t\t\t\t * bfound = true; ndbDEF = nsource; } else {\n\t\t\t\t\t\t\t * nsource++; } }\n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t * if (!bfound) { szError += \"Warning: \"+szvalue\n\t\t\t\t\t\t\t * +\" is an unrecognized \"+\n\t\t\t\t\t\t\t * \"type for Gene Annotation Source\\n\"; } }\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Allow_Path_Merges\")) {\n\t\t\t\t\t\t\tballowmergeDEF = (szvalue.equalsIgnoreCase(\"true\"));\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"TF-gene_Interaction_Source\")) {\n\t\t\t\t\t\t\tint numitems = staticsourceArray.length;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tnstaticsourceDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t\t\tif ((nstaticsourceDEF < 0)\n\t\t\t\t\t\t\t\t\t\t|| (nstaticsourceDEF >= numitems)) {\n\t\t\t\t\t\t\t\t\tnstaticsourceDEF = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\t\t\t\tboolean bfound = false;\n\t\t\t\t\t\t\t\tint nsource = 0;\n\t\t\t\t\t\t\t\twhile ((nsource < numitems) && (!bfound)) {\n\t\t\t\t\t\t\t\t\tif (((String) staticsourceArray[nsource])\n\t\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(szvalue)) {\n\t\t\t\t\t\t\t\t\t\tbfound = true;\n\t\t\t\t\t\t\t\t\t\tnstaticsourceDEF = nsource;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnsource++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!bfound) {\n\t\t\t\t\t\t\t\t\tszError += \"Warning: \"\n\t\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t\t+ \" is an unrecognized \"\n\t\t\t\t\t\t\t\t\t\t\t+ \"type for TF-gene_Interaction_Source\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Cross_Reference_Source\")) {\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * int numitems = defaultxrefs.length; try {\n\t\t\t\t\t\t\t * nxrefDEF = Integer.parseInt(szvalue); if\n\t\t\t\t\t\t\t * ((nxrefDEF < 0)|| (nxrefDEF >= numitems)) {\n\t\t\t\t\t\t\t * nxrefDEF = 0; } } catch(NumberFormatException ex)\n\t\t\t\t\t\t\t * { boolean bfouparseDefaultsnd = false; int nsource = 0; while\n\t\t\t\t\t\t\t * ((nsource < numitems)&&(!bfound)) { if (((String)\n\t\t\t\t\t\t\t * defaultxrefs[nsource]).equalsIgnoreCase(szvalue))\n\t\t\t\t\t\t\t * { bfound = true; nxrefDEF = nsource; } else {\n\t\t\t\t\t\t\t * nsource++; } }\n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t * if (!bfound) { szError += \"Warning: \"+szvalue\n\t\t\t\t\t\t\t * +\" is an unrecognized \"+\n\t\t\t\t\t\t\t * \"type for a Cross_Reference_Source\"; } }\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Gene_Annotation_File\")) {\n\t\t\t\t\t\t\tszGeneAnnotationFileDEF = szvalue;\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Cross_Reference_File\")) {\n\t\t\t\t\t\t\tszCrossRefFileDEF = szvalue;\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_Data_Files(comma delimited list)\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_Data_Files\"))) {\n\t\t\t\t\t\t\tvRepeatFilesDEF = new Vector();\n\t\t\t\t\t\t\tStringTokenizer stRepeatList = new StringTokenizer(\n\t\t\t\t\t\t\t\t\tszvalue, \",\");\n\t\t\t\t\t\t\twhile (stRepeatList.hasMoreTokens()) {\n\t\t\t\t\t\t\t\tvRepeatFilesDEF.add(stRepeatList.nextToken());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_Data_is_from\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_Data_is_from[Different time periods,The same time period]\"))) {\n\t\t\t\t\t\t\tif (szvalue\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Different time periods\")) {\n\t\t\t\t\t\t\t\tballtimeDEF = true;\n\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"The same time period\")) {\n\t\t\t\t\t\t\t\tballtimeDEF = false;\n\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")) {\n\t\t\t\t\t\t\t\tszError += \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t\t+ \"Repeat Data is from it must be either \"\n\t\t\t\t\t\t\t\t\t\t+ \"'Different time periods' or 'The same time period'\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Y-axis_Scale_Factor\")) {\n\t\t\t\t\t\t\tdYaxisDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Scale_Node_Areas_By_The_Factor\")) {\n\t\t\t\t\t\t\tdnodekDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"X-axis_Scale_Factor\")) {\n\t\t\t\t\t\t\tdXaxisDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if ((sztype.equalsIgnoreCase(\"X-axis_scale\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"X-axis_scale_should_be\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"X-axis_scale[Uniform,Based on Real Time]\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"X-axis_scale_should_be[Uniform,Based on Real Time]\"))) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Uniform\")) {\n\t\t\t\t\t\t\t\tbrealXaxisDEF = false;\n\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Based on Real Time\")) {\n\t\t\t\t\t\t\t\tbrealXaxisDEF = true;\n\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")) {\n\t\t\t\t\t\t\t\tszError += \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t\t+ \"X-axis_scale it must be either 'Uniform'\"\n\t\t\t\t\t\t\t\t\t\t+ \"or 'Based on Real Time'.\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Key_Input_X_p-val_10^-X\")) {\n\t\t\t\t\t\t\tdKeyInputXDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Key_Input_Significance_Based_On[\"\n\t\t\t\t\t\t\t\t\t\t+ \"Path Significance Conditional on Split,Path Significance Overall,Split Significance]\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Key_Input_Significance_Based_On[\"\n\t\t\t\t\t\t\t\t\t\t\t\t+ \"Split Significance,Path Significance Conditional on Split,Path Significance Overall]\"))) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tnKeyInputTypeDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t\t\tif ((nKeyInputTypeDEF < 0)\n\t\t\t\t\t\t\t\t\t\t|| (nKeyInputTypeDEF > 2)) {\n\t\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\t\tszvalue\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" is an invalid argument for Key Input Significance Based On\");\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// so code maps to input order\n\t\t\t\t\t\t\t\t\tif (nKeyInputTypeDEF == 0)\n\t\t\t\t\t\t\t\t\t\tnKeyInputTypeDEF = 1;\n\t\t\t\t\t\t\t\t\telse if (nKeyInputTypeDEF == 1)\n\t\t\t\t\t\t\t\t\t\tnKeyInputTypeDEF = 2;\n\t\t\t\t\t\t\t\t\telse if (nKeyInputTypeDEF == 2)\n\t\t\t\t\t\t\t\t\t\tnKeyInputTypeDEF = 0;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\t\t\t\tif (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Split Significance\")) {\n\t\t\t\t\t\t\t\t\tnKeyInputTypeDEF = 0;\n\t\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Path Significance Conditional on Split\")) {\n\t\t\t\t\t\t\t\t\tnKeyInputTypeDEF = 1;\n\t\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Path Significance Overall\")) {\n\t\t\t\t\t\t\t\t\tnKeyInputTypeDEF = 2;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\t\tszvalue\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" is an invalid argument for Key_Input_Significance_Based_On\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Maximum_number_of_paths_out_of_split\")) {\n\t\t\t\t\t\t\tnumchildDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t} else if ((sztype.equalsIgnoreCase(\"Split_Seed\"))\n\t\t\t\t\t\t\t\t|| (sztype.equalsIgnoreCase(\"Random_Seed\"))) {\n\t\t\t\t\t\t\tnSEEDDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Penalized_likelihood_node_penalty\")) {\n\t\t\t\t\t\t\tdNODEPENALTYDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Model_selection_framework\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Model_selection_framework[Penalized Likelihood,Train-Test]\"))) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tint ntempval;\n\t\t\t\t\t\t\t\tntempval = Integer.parseInt(szvalue);\n\t\t\t\t\t\t\t\tif ((ntempval < 0) || (ntempval > 1)) {\n\t\t\t\t\t\t\t\t\tbPENALIZEDDEF = (ninitsearchDEF == 0);\n\t\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\t\tszvalue\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" is an invalid argument for Model_selection_framework\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\t\t\t\tif (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Penalized Likelihood\")) {\n\t\t\t\t\t\t\t\t\tbPENALIZEDDEF = true;\n\t\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Train-Test\")) {\n\t\t\t\t\t\t\t\t\tbPENALIZEDDEF = false;\n\t\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")) {\n\t\t\t\t\t\t\t\t\tszError += \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t\t\t+ \"Model_selection_framework \"\n\t\t\t\t\t\t\t\t\t\t\t+ \"it must be either \"\n\t\t\t\t\t\t\t\t\t\t\t+ \"'Use As Is', 'Start Search From', or 'Do Not Use'\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Delay_path_improvement\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Delay_split_score_%\"))) {\n\t\t\t\t\t\t\tdDELAYPATHDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dDELAYPATHDEF < 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be >= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Merge_path_score_%\")) {\n\t\t\t\t\t\t\tdDMERGEPATHDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dDMERGEPATHDEF < 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be >= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Merge_path_difference_threshold\")) {\n\t\t\t\t\t\t\tdDMERGEPATHDIFFDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dDMERGEPATHDIFFDEF > 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be <= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Delay_split_difference_threshold\")) {\n\t\t\t\t\t\t\tdDELAYPATHDIFFDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dDELAYPATHDIFFDEF > 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be <= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Delete_path_difference_threshold\")) {\n\t\t\t\t\t\t\tdPRUNEPATHDIFFDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dPRUNEPATHDIFFDEF > 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be <= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Main_search_difference_threshold\")) {\n\t\t\t\t\t\t\tdMinScoreDIFFDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dMinScoreDIFFDEF < 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be >= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Prune_path_improvement\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Delete_path_score_%\"))) {\n\t\t\t\t\t\t\tdPRUNEPATHDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dPRUNEPATHDEF < 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be >= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Minimum_score_improvement\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Main_search_score_%\"))) {\n\t\t\t\t\t\t\tdMinScoreDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t\tif (dMinScoreDEF < 0) {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(szvalue\n\t\t\t\t\t\t\t\t\t\t+ \" is an invalid value for \" + sztype\n\t\t\t\t\t\t\t\t\t\t+ \" must be >= 0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype.equalsIgnoreCase(\"Saved_Model\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Saved_Model[Use As Is/Start Search From/Do Not Use]\"))) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tninitsearchDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t\t\tif ((ninitsearchDEF < 0)\n\t\t\t\t\t\t\t\t\t\t|| (ninitsearchDEF > 2)) {\n\t\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\t\tszvalue\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" is an invalid argument for Saved_Model\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Use As Is\")) {\n\t\t\t\t\t\t\t\t\tninitsearchDEF = 0;\n\t\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Start Search From\")) {\n\t\t\t\t\t\t\t\t\tninitsearchDEF = 1;\n\t\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Do Not Use\")) {\n\t\t\t\t\t\t\t\t\tninitsearchDEF = 2;\n\t\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")) {\n\t\t\t\t\t\t\t\t\tszError += \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t\t\t+ \"Saved_Model \"\n\t\t\t\t\t\t\t\t\t\t\t+ \"it must be either \"\n\t\t\t\t\t\t\t\t\t\t\t+ \"'Use As Is', 'Start Search From', or 'Do Not Use'\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Filter_Gene_If_It_Has_No_Static_Input_Data\")) {\n\t\t\t\t\t\t\tbfilterstaticDEF = (szvalue\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"true\"));\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Maximum_Number_of_Missing_Values\")) {\n\t\t\t\t\t\t\tnMaxMissingDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Minimum_Absolute_Log_Ratio_Expression\")) {\n\t\t\t\t\t\t\tdMinExpressionDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Minimum_Correlation_between_Repeats\")) {\n\t\t\t\t\t\t\tdMinCorrelationRepeatsDEF = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Pre-filtered_Gene_File\")) {\n\t\t\t\t\t\t\tszPrefilteredDEF = szvalue;\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Include_Biological_Process\")) {\n\t\t\t\t\t\t\tbpontoDEF = (szvalue.equalsIgnoreCase(\"true\"));\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Include_Molecular_Function\")) {\n\t\t\t\t\t\t\tbfontoDEF = (szvalue.equalsIgnoreCase(\"true\"));\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Include_Cellular_Process\")) {\n\t\t\t\t\t\t\tbcontoDEF = (szvalue.equalsIgnoreCase(\"true\"));\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Only_include_annotations_with_these_evidence_codes\")) {\n\t\t\t\t\t\t\tszevidenceDEF = szvalue;\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Only_include_annotations_with_these_taxon_IDs\")) {\n\t\t\t\t\t\t\tsztaxonDEF = szvalue;\n\t\t\t\t\t\t} else if ((sztype.equalsIgnoreCase(\"Category_ID_File\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Category_ID_Mapping_File\"))) {\n\t\t\t\t\t\t\tszcategoryIDDEF = szvalue;\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"GO_Minimum_number_of_genes\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Minimum_number_of_genes\"))) {\n\t\t\t\t\t\t\tnMinGoGenesDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Minimum_GO_level\")) {\n\t\t\t\t\t\t\tnMinGOLevelDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Minimum_Split_Percent\")) {\n\t\t\t\t\t\t\tdpercentDEF = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Number_of_samples_for_randomized_multiple_hypothesis_correction\")) {\n\t\t\t\t\t\t\tnSamplesMultipleDEF = Integer.parseInt(szvalue);\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Multiple_hypothesis_correction_method_enrichment[Bonferroni,Randomization]\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Multiple_hypothesis_correction_method[Bonferroni,Randomization]\"))) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Bonferroni\")) {\n\t\t\t\t\t\t\t\tbrandomgoDEF = false;\n\t\t\t\t\t\t\t} else if (szvalue\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Randomization\")) {\n\t\t\t\t\t\t\t\tbrandomgoDEF = true;\n\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")) {\n\t\t\t\t\t\t\t\tszError += \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t\t+ \"Correction_Method it must be either 'Bonferroni'\"\n\t\t\t\t\t\t\t\t\t\t+ \"or 'Randomization'.\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"miRNA-gene_Interaction_Source\")) {\n\t\t\t\t\t\t\tmiRNAInteractionDataFile = szvalue;\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"miRNA_Expression_Data_File\")) {\n\t\t\t\t\t\t\tmiRNAExpressionDataFile = szvalue;\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Regulator_Types_Used_For_Activity_Scoring\")) {\n\t\t\t\t\t\t\tif(szvalue.equalsIgnoreCase(\"None\")){\n\t\t\t\t\t\t\t\tcheckStatusTF = false;\n\t\t\t\t\t\t\t\tcheckStatusmiRNA = false;\n\t\t\t\t\t\t\t} else if(szvalue.equalsIgnoreCase(\"TF\")){\n\t\t\t\t\t\t\t\tcheckStatusTF = true;\n\t\t\t\t\t\t\t\tcheckStatusmiRNA = false;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"miRNA\")) {\n\t\t\t\t\t\t\t\tcheckStatusTF = false;\n\t\t\t\t\t\t\t\tcheckStatusmiRNA = true;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"Both\")) {\n\t\t\t\t\t\t\t\tcheckStatusTF = true;\n\t\t\t\t\t\t\t\tcheckStatusmiRNA = true;\n\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")){\n\t\t\t\t\t\t\t\tszError = \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t+ \"Regulator_Types_Used_For_Activity_Scoring it must be either 'None', 'TF'\"\n\t\t\t\t\t\t\t\t\t+ \", 'miRNA' or 'Both'.\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Normalize_miRNA_Data[Log normalize data,Normalize data,No normalization/add 0]\")) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Log normalize data\")) {\n\t\t\t\t\t\t\t\tmiRNATakeLog = true;\n\t\t\t\t\t\t\t\tmiRNAAddZero = false;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"Normalize data\")) {\n\t\t\t\t\t\t\t\tmiRNATakeLog = false;\n\t\t\t\t\t\t\t\tmiRNAAddZero = false;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"No normalization/add 0\")) {\n\t\t\t\t\t\t\t\tmiRNATakeLog = false;\n\t\t\t\t\t\t\t\tmiRNAAddZero = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\tszvalue+ \" is an invalid argument for Normalize_miRNA_Data\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_miRNA_Data_Files(comma delimited list)\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_miRNA_Data_Files\"))) {\n\t\t\t\t\t\t\tmiRNARepeatFilesDEF = new Vector();\n\t\t\t\t\t\t\tStringTokenizer stRepeatList = new StringTokenizer(\n\t\t\t\t\t\t\t\t\tszvalue, \",\");\n\t\t\t\t\t\t\twhile (stRepeatList.hasMoreTokens()) {\n\t\t\t\t\t\t\t\tmiRNARepeatFilesDEF.add(stRepeatList.nextToken());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ((sztype.equalsIgnoreCase(\"Repeat_miRNA_Data_is_from\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_miRNA_Data_is_from[Different time periods,The same time period]\"))) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Different time periods\")) {\n\t\t\t\t\t\t\t\tmiRNAalltimeDEF = true;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"The same time period\")) {\n\t\t\t\t\t\t\t\tmiRNAalltimeDEF = false;\n\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")) {\n\t\t\t\t\t\t\t\tszError += \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t\t+ \"Repeat miRNA Data is from it must be either \"\n\t\t\t\t\t\t\t\t\t\t+ \"'Different time periods' or 'The same time period'\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Filter_miRNA_With_No_Expression_Data_From_Regulators\")) {\n\t\t\t\t\t\t\tfiltermiRNAExp = (szvalue.equalsIgnoreCase(\"true\"));\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Expression_Scaling_Weight\")) {\n\t\t\t\t\t\t\tmiRNAWeight = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Minimum_TF_Expression_After_Scaling\")) {\n\t\t\t\t\t\t\ttfWeight = Double.parseDouble(szvalue);\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Regulator_Score_File\")) {\n\t\t\t\t\t\t\tregScoreFile = szvalue;\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"DECOD_Executable_Path\")) {\n\t\t\t\t\t\t\tdecodPath = szvalue;\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Gene_To_Fasta_Format_file\")) {\n\t\t\t\t\t\t\tfastaFile = szvalue;\n\t\t\t\t\t\t} else if (sztype.equalsIgnoreCase(\"Active_TF_influence\")) {\n\t\t\t\t\t\t\tdProbBindingFunctional = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(szvalue);\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"Setting active TF influence to \"\n\t\t\t\t\t\t\t\t\t\t\t+ dProbBindingFunctional);\n // parseDefault for proteomics panel \n } else if (sztype.equalsIgnoreCase(\"Proteomics_File\")){\n djProteFile=szvalue;\n // parseDefault for relative proteomics weight\n } else if (sztype.equalsIgnoreCase(\"Proteomics_Relative_Weight\")){\n pweight=szvalue;\n } else if ((sztype\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_Prote_Data_Files(comma delimited list)\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_Prote_Data_Files\"))) {\n\t\t\t\t\t\t\tProteRepeatFilesDEF = new Vector();\n\t\t\t\t\t\t\tStringTokenizer stRepeatList = new StringTokenizer(\n\t\t\t\t\t\t\t\t\tszvalue, \",\");\n\t\t\t\t\t\t\twhile (stRepeatList.hasMoreTokens()) {\n\t\t\t\t\t\t\t\tProteRepeatFilesDEF.add(stRepeatList.nextToken());\n\t\t\t\t\t\t\t}\n } else if ((sztype.equalsIgnoreCase(\"Repeat_Prote_Data_is_from\"))\n\t\t\t\t\t\t\t\t|| (sztype\n\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"Repeat_Prote_Data_is_from[Different time periods,The same time period]\"))) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Different time periods\")) {\n\t\t\t\t\t\t\t\tProtealltimeDEF = true;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"The same time period\")) {\n\t\t\t\t\t\t\t\tProtealltimeDEF = false;\n\t\t\t\t\t\t\t} else if (!szvalue.equals(\"\")) {\n\t\t\t\t\t\t\t\tszError += \"WARNING: '\"\n\t\t\t\t\t\t\t\t\t\t+ szvalue\n\t\t\t\t\t\t\t\t\t\t+ \"' is an invalid value for \"\n\t\t\t\t\t\t\t\t\t\t+ \"Repeat Prote Data is from it must be either \"\n\t\t\t\t\t\t\t\t\t\t+ \"'Different time periods' or 'The same time period'\\n\";\n\t\t\t\t\t\t\t}\n } else if (sztype.equalsIgnoreCase(\"Normalize_Prote_Data[Log normalize data,Normalize data,No normalization/add 0]\")) {\n\t\t\t\t\t\t\tif (szvalue.equalsIgnoreCase(\"Log normalize data\")) {\n\t\t\t\t\t\t\t\tproteTakeLog = true;\n\t\t\t\t\t\t\t\tproteAddZero = false;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"Normalize data\")) {\n\t\t\t\t\t\t\t\tproteTakeLog = false;\n\t\t\t\t\t\t\t\tproteAddZero = false;\n\t\t\t\t\t\t\t} else if (szvalue.equalsIgnoreCase(\"No normalization/add 0\")) {\n\t\t\t\t\t\t\t\tproteTakeLog = false;\n\t\t\t\t\t\t\t\tproteAddZero = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\t\tszvalue+ \" is an invalid argument for Normalize_Prote_Data\");\n\t\t\t\t\t\t\t}\n } else if (sztype.equalsIgnoreCase(\"Use Proteomics[No,TF,All]\")){\n if (szvalue.equalsIgnoreCase(\"No\")){\n bProteTF=false;\n bProteAll=false;\n } else if (szvalue.equalsIgnoreCase(\"TF\")){\n bProteTF=true;\n bProteAll=false;\n } else if (szvalue.equalsIgnoreCase(\"All\")){\n bProteAll=true;\n bProteTF=false;\n } else{\n throw new IllegalArgumentException(\n szvalue+\" is not valid\"\n );\n }\n \n } else if (sztype.equalsIgnoreCase(\"PPI File\")){\n djPPIFile=szvalue;\n \n } else if (sztype.equalsIgnoreCase(\"Epigenomic_File\")){\n // parseDefault for epigenomics panel\n djMethyFile=szvalue;\n } else if (sztype.equalsIgnoreCase(\"GTF File\")){\n djMethyGTF=szvalue;\n\t\t\t\t\t\t} else if ((sztype.charAt(0) != '#')) {\n\t\t\t\t\t\t\tszError += \"WARNING: '\" + sztype\n\t\t\t\t\t\t\t\t\t+ \"' is an unrecognized variable.\\n\";\n\t\t\t\t\t\t} \n \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tif (!szError.equals(\"\")) {\n\t\t\t\tthrow new IllegalArgumentException(szError);\n\t\t\t}\n\t\t} catch (FileNotFoundException ex) {\n\t\t}\n\t}", "public void readNetworkFile(String networkFilename)\n\t\tthrows IOException, NumberFormatException {\n\t\tif(DEBUG) System.out.println(\"reading network file from:\"+networkFilename);\n\t\tBufferedReader br = new BufferedReader(new FileReader(networkFilename));\n\t\tString line;\n\t\t// on the first line is the number of following lines that describe vertices\n\t\tint numVariables = -1;\n\t\tif((line = br.readLine()) != null){\n\t\t\tnumVariables = Integer.valueOf(line);\n\t\t}else{\n\t\t\tbr.close();\n\t\t\tthrow new IOException();\n\t\t}\n\t\tif(numVariables<0) {\n\t\t\tbr.close();\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\tfor(int i = 0;i<numVariables;i++){\n\t\t\tif((line = br.readLine()) != null){\n\t\t\t\tString[] tokenized = line.split(\" \");\n\t\t\t\tString variableName = tokenized[0];\n\t\t\t\ttokenized = tokenized[1].split(\",\");//values\n//\t\t\t\tSystem.out.printf(\"var:%s values:\",variableName);\n//\t\t\t\tfor(int q = 0; q < tokenized.length; q++) {\n//\t\t\t\t\tSystem.out.printf(\"%s \", tokenized[q]);\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println();\n\t\t\t\tFactor.addVariable(variableName, new ArrayList<String>(Arrays.asList(tokenized)));\n\t\t\t}else{\n\t\t\t\tbr.close();\n\t\t\t\tthrow new IOException(\"inconsistent network file.\");\n\t\t\t}\n\t\t}\n\t\tbr.close();\n\t}", "private FastVector getAccInstanceAttributes() {\n Attribute x_mean = new Attribute(\"x-axis mean\");\n Attribute x_var = new Attribute(\"x-axis var\");\n Attribute y_mean = new Attribute(\"y-axis mean\");\n Attribute y_var = new Attribute(\"y-axis var\");\n Attribute z_mean = new Attribute(\"z-axis mean\");\n Attribute z_var = new Attribute(\"z-axis var\");\n\n // Declare the class attribute along with its values\n FastVector fvClassVal = new FastVector(2);\n fvClassVal.addElement(\"none\");\n fvClassVal.addElement(\"tap\");\n Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n // Declare the feature vector\n FastVector fvWekaAttributes = new FastVector(7);\n\n fvWekaAttributes.addElement(x_mean);\n fvWekaAttributes.addElement(x_var);\n fvWekaAttributes.addElement(y_mean);\n fvWekaAttributes.addElement(y_var);\n fvWekaAttributes.addElement(z_mean);\n fvWekaAttributes.addElement(z_var);\n fvWekaAttributes.addElement(classAttribute);\n\n// // Declare the numeric attributes\n// Attribute x_var = new Attribute(\"var_x\");\n// Attribute x_var_delta = new Attribute(\"delta_var_x\");\n// Attribute y_var = new Attribute(\"var_y\");\n// Attribute y_var_delta = new Attribute(\"delta_var_y\");\n// Attribute z_var = new Attribute(\"var_z\");\n// Attribute z_var_delta = new Attribute(\"delta_var_z\");\n//\n// // Declare the class attribute along with its values\n// FastVector fvClassVal = new FastVector(3);\n// fvClassVal.addElement(\"none\");\n// fvClassVal.addElement(\"motion\");\n// fvClassVal.addElement(\"tap\");\n// Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n// // Declare the feature vector\n// FastVector fvWekaAttributes = new FastVector(7);\n//\n// fvWekaAttributes.addElement(x_var);\n// fvWekaAttributes.addElement(x_var_delta);\n// fvWekaAttributes.addElement(y_var);\n// fvWekaAttributes.addElement(y_var_delta);\n// fvWekaAttributes.addElement(z_var);\n// fvWekaAttributes.addElement(z_var_delta);\n// fvWekaAttributes.addElement(classAttribute);\n\n return fvWekaAttributes;\n }", "public void readFiles() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t// Open BufferedReader to open connection to tipslocation URL and read file\n\t\t\tBufferedReader reader1 = new BufferedReader(new InputStreamReader(tipsLocation.openStream()));\n\t\t\t\n\t\t\t// Create local variable to parse through the file\n\t String tip;\n\t \n\t // While there are lines in the file to read, add lines to tips ArrayList\n\t while ((tip = reader1.readLine()) != null) {\n\t tips.add(tip);\n\t }\n\t \n\t // Close the BufferedReader\n\t reader1.close();\n\t \n\t \n\t // Open BufferedReader to open connection to factsLocation URL and read file\n\t BufferedReader reader2 = new BufferedReader(new InputStreamReader(factsLocation.openStream()));\n\t \n\t // Create local variable to parse through the file\n\t String fact;\n\t \n\t // While there are lines in the file to read: parses the int that represents\n\t // the t-cell count that is associated with the line, and add line and int to \n\t // tCellFacts hashmap\n\t while ((fact = reader2.readLine()) != null) {\n\t \t\n\t \tint tCellCount = Integer.parseInt(fact);\n\t \tfact = reader2.readLine();\n\t \t\n\t tCellFacts.put(tCellCount, fact);\n\t }\n\t \n\t // Close the second BufferedReader\n\t reader2.close();\n\t \n\t\t} catch (FileNotFoundException e) {\n\t\t\t\n\t\t\tSystem.out.println(\"Error loading files\"); e.printStackTrace();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private boolean readFile() {\n\t\ttry {\n\n\t\t\tDocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();\n\t\t\tDocument doc = docBuilder.parse(cnfFile);\n\n\t\t\t// normalize text representation\n\t\t\tdoc.getDocumentElement().normalize();\n\t\t\tSystem.out.println(\"Root element of the doc is \" + doc.getDocumentElement().getNodeName());\n\t\t\tdoc.getDocumentElement().getAttributeNode(\"version\");\n\n\t\t\tNodeList rootNode = doc.getElementsByTagName(\"SCMS_DATA\");\n\t\t\tif (rootNode.getLength() < 1) {\n\t\t\t\tSystem.out.println(\"ERROR in config data file: there is no SCMS_DATA element\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tString version = rootNode.item(0).getAttributes().getNamedItem(\"version\").getNodeValue();\n\t\t\tfinal String dataVersion = \"0.1\";\n\t\t\tif (!version.equals(dataVersion)) {\n\t\t\t\tSystem.out.println(\"ERROR in config data file: required version is \" + dataVersion);\n\t\t\t\tSystem.out.println(\"Version \" + version + \" is not supported.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tNodeList listOfDevices = doc.getElementsByTagName(\"DEVICE\");\n\t\t\tint totalDevices = listOfDevices.getLength();\n\t\t\tSystem.out.println(\"Total no of devices : \" + totalDevices);\n\n\t\t\tHashMap<String, CnfDevice> devices = new HashMap<>();\n\t\t\tfor (int s = 0; s < listOfDevices.getLength(); s++) {\n\n\t\t\t\tNode node = listOfDevices.item(s);\n\t\t\t\tif (node.getNodeType() == Node.ELEMENT_NODE) {\n\n\t\t\t\t\tString id = node.getAttributes().getNamedItem(\"id\").getNodeValue();\n\t\t\t\t\tString name = node.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\t\tString description = node.getAttributes().getNamedItem(\"description\").getNodeValue();\n\t\t\t\t\tString pi_name = node.getAttributes().getNamedItem(\"PI_Name\").getNodeValue();\n\t\t\t\t\tString pixHor = node.getAttributes().getNamedItem(\"pixHor\").getNodeValue();\n\t\t\t\t\tString pixVer = node.getAttributes().getNamedItem(\"pixVer\").getNodeValue();\n\t\t\t\t\tString location = node.getAttributes().getNamedItem(\"location\").getNodeValue();\n\n\t\t\t\t\tdevices.put(id, new CnfDevice(id, name, description, pi_name,\n\t\t\t\t\t\t\tInteger.valueOf(pixHor), Integer.valueOf(pixVer),location));\n\t\t\t\t}\n\t\t\t}\n\t\t\tcnfData.setDevices(devices);\n\n\t\t\tNodeList listOfViews = doc.getElementsByTagName(\"VIEW\");\n\t\t\tint totalViews = listOfViews.getLength();\n\t\t\tSystem.out.println(\"Total no of views : \" + totalViews);\n\n\t\t\tHashMap<String, CnfView> views = new HashMap<>();\n\t\t\tfor (int s = 0; s < listOfViews.getLength(); s++) {\n\n\t\t\t\tNode node = listOfViews.item(s);\n\n\t\t\t\tif (node.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\tString id = node.getAttributes().getNamedItem(\"id\").getNodeValue();\n\t\t\t\t\tString name = node.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\t\tString description = node.getAttributes().getNamedItem(\"description\").getNodeValue();\n\t\t\t\t\tString pixHor = node.getAttributes().getNamedItem(\"pixHor\").getNodeValue();\n\t\t\t\t\tString pixVer = node.getAttributes().getNamedItem(\"pixVer\").getNodeValue();\n\t\t\t\t\tString asso_device = node.getAttributes().getNamedItem(\"associatedDevice\").getNodeValue();\n\n\t\t\t\t\tElement element = (Element) node;\n\t\t\t\t\tNodeList listOfImages = ((Element) node).getElementsByTagName(\"IMAGE\");\n\t\t\t\t\tElement iElement = (Element) listOfImages.item(0);\n\t\t\t\t\tString[] images = new String[listOfImages.getLength()];\n\t\t\t\t\tfor (int i = 0; i < listOfImages.getLength(); i++) {\n\n\t\t\t\t\t\tNode iNode = listOfImages.item(i);\n\t\t\t\t\t\timages[i] = iNode.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\t\t}\n\n\t\t\t\t\tviews.put(id, new CnfView(id, name, description,\n\t\t\t\t\t\t\tInteger.valueOf(pixHor), Integer.valueOf(pixVer), asso_device, images));\n\t\t\t\t}\n\t\t\t}\n\t\t\tcnfData.setViews(views);\n\n\t\t\tNodeList listOfSections = doc.getElementsByTagName(\"SECTION\");\n\t\t\tint totalSections = listOfSections.getLength();\n\t\t\tSystem.out.println(\"Total no of sections : \" + totalSections);\n\n\t\t\tHashMap<String, CnfSection> sections = new HashMap<>();\n\t\t\tfor (int s = 0; s < totalSections; s++) {\n\t\t\t\tNode node = listOfSections.item(s);\n\n\t\t\t\tif (node.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\tString sectionId = node.getAttributes().getNamedItem(\"sectionId\").getNodeValue();\n\t\t\t\t\tString deviceId = node.getAttributes().getNamedItem(\"deviceId\").getNodeValue();\n\t\t\t\t\tString positionId = node.getAttributes().getNamedItem(\"positionId\").getNodeValue();\n\t\t\t\t\tString vOffset = node.getAttributes().getNamedItem(\"vOffset\").getNodeValue();\n\n\t\t\t\t\t// A section is invalid if the deviceId doesn't exist\n\t\t\t\t\tif (null == cnfData.getDeviceById(deviceId)) {\n\t\t\t\t\t\tSystem.out.println(\"ERROR in SECTION config data: deviceId \" + deviceId + \" sectionId \" + sectionId);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsections.put(deviceId, new CnfSection(sectionId, deviceId, positionId, vOffset));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcnfData.setSections(sections);\n\t\t\treturn true;\n\n\t\t} catch (SAXParseException err) {\n\t\t\tSystem.out.println(\"** Parsing error\" + \", line \" + err.getLineNumber() + \", uri \" + err.getSystemId());\n\t\t\tSystem.out.println(\" \" + err.getMessage());\n\n\t\t} catch (SAXException e) {\n\t\t\tException x = e.getException();\n\t\t\t((x == null) ? e : x).printStackTrace();\n\n\t\t} catch (Throwable t) {\n\t\t\tt.printStackTrace();\n\t\t}\n\t\treturn false;\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 readProperties(String propFilename){\n\t\tString propertiesFilename = propFilename;\n\t\tProperties properties = new Properties();\n\n\t\tFileInputStream in;\n\t\ttry {\n\t\t\tin = new FileInputStream(propertiesFilename);\n\t\t\tproperties.load(in);\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error reading properties \"+propertiesFilename);\n\t\t\tSystem.exit(1);\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tString path=\"Not set\";\n\t\tint popSize=0;\n\t\tint features=0;\n\t\tint maxGenerations=0;\n\t\tboolean log=false;\n\t\tboolean debug=false;\n\t\tboolean printbest=false;\n\t\tboolean cwd=false;\n\t\tboolean arrcache=false;\n\t\tdouble addSubRangeH;\n\t\tdouble divMultRangeH;\n\t\tdouble randomThicknessRange;\n\t\tdouble randomVelocityRange;\n\n\t\tdouble addSubRangeVS;\n\t\tdouble divMultRangeVS;\n\n\t\tint zThreshold=0;\n\t\tboolean useThreshold = true;\n\n\tif(properties.containsKey(\"path\")){\n\t\tpath = ((String)properties.get(\"path\"));\n\t\tif(properties.containsKey(\"cwd\")){\n\t\t\tcwd = Boolean.parseBoolean((String)properties.get(\"cwd\"));\n\t\t}\n\t\tc.path=path;\n\t\tc.setPaths(cwd);\n\t}else{\n\t\tSystem.out.println(\"Path : \"+path);\n\t\tSystem.exit(1);\n\t}if(properties.containsKey(\"populationSize\")){\n\t\tpopSize = Integer.parseInt((String)properties.get(\"populationSize\"));\n\t\tc.populationSize =popSize;\n\t}if(properties.containsKey(\"printBest\")){\n\t\tprintbest = Boolean.parseBoolean((String)properties.get(\"printBest\"));\n\t\tc.printBest=printbest;\n\t}if(properties.containsKey(\"maxGenerations\")){\n\t\tmaxGenerations = Integer.parseInt((String)properties.get(\"maxGenerations\"));\n\t\tc.maxGenerations=maxGenerations;\n\t}if(properties.containsKey(\"log\")){\n\t\tlog = Boolean.parseBoolean((String)properties.get(\"log\"));\n\t\tc.log=log;\n\t}if(properties.containsKey(\"debug\")){\n\t\tdebug = Boolean.parseBoolean((String)properties.get(\"debug\"));\n\t\tc.debug=debug;\n\t}if(properties.containsKey(\"features\")){\n\t\tfeatures = Integer.parseInt((String)properties.get(\"features\"));\n\t\tc.features=features;\n\t}if(properties.containsKey(\"addSubRangeH\")){\n\t\taddSubRangeH = Double.parseDouble((String)properties.get(\"addSubRangeH\"));\n\t\tc.addSubRangeH=addSubRangeH;\n\t}if(properties.containsKey(\"addSubRangeVS\")){\n\t\taddSubRangeVS = Double.parseDouble((String)properties.get(\"addSubRangeVS\"));\n\t\tc.addSubRangeVS=addSubRangeVS;\n\t}if(properties.containsKey(\"divMultRangeH\")){\n\t\tdivMultRangeH = Double.parseDouble((String)properties.get(\"divMultRangeH\"));\n\t\tc.divMultRangeH=divMultRangeH;\n\t}if(properties.containsKey(\"divMultRangeVS\")){\n\t\tdivMultRangeVS = Double.parseDouble((String)properties.get(\"divMultRangeVS\"));\n\t\tc.divMultRangeVS=divMultRangeVS;\n\t}if(properties.containsKey(\"randomThicknessRange\")){\n\t\trandomThicknessRange = Double.parseDouble((String)properties.get(\"randomThicknessRange\"));\n\t\tc.randomThicknessRange=randomThicknessRange;\n\t}if(properties.containsKey(\"randomVelocityRange\")){\n\t\trandomVelocityRange = Double.parseDouble((String)properties.get(\"randomVelocityRange\"));\n\t\tc.randomVelocityRange=randomVelocityRange;\n\t}if(properties.containsKey(\"zThreshold\")){\n\t\tzThreshold = Integer.parseInt((String)properties.get(\"zThreshold\"));\n\t\tc.zThreshold=zThreshold;\n\t}if(properties.containsKey(\"useThreshold\")){\n\t\tuseThreshold = Boolean.parseBoolean((String)properties.get(\"useThreshold\"));\n\t\tc.useThreshold=useThreshold;\n\t}\n\n\tSystem.out.println(\" Debug? \"+debug + \" | Log? \"+ log + \" | printBest? \"+ printbest);\n\tSystem.out.println(\"Pop: \"+c.populationSize+\" | Max Gens: \"+ maxGenerations+ \"\\nPath: \"+c.path);\n\tSystem.out.println(\"randomThicknessRange :\"+c.randomThicknessRange+\" randomVelocityRange :\"+c.randomVelocityRange);\n\tSystem.out.println(\"AddSubRange H :\"+c.addSubRangeH+\" VS :\"+c.addSubRangeVS);\n\tSystem.out.println(\"divMultRange H :\"+c.divMultRangeH+\" VS :\"+c.divMultRangeVS);\n\tSystem.out.println(\"Threshold ? \"+c.useThreshold+\" : \"+c.zThreshold);\n\t}", "Points(String filepath){\n readPointsFile(filepath); //dengan file points.txt\n }", "public void load(){\n\t\t\tArrayList<String> entries = readEntriesFromFile(FILENAME);\n\t\t\t\n\t\t\tfor(int i = 1; i < entries.size(); i++){\n\t\t\t\tString entry = entries.get(i);\n\t\t\t\tString[] entryParts = entry.split(\",\");\n\t\t\t\tString name = entryParts[0];\n\t\t\t\tString power = entryParts[1];\n\t\t\t\tString gold = entryParts[2];\n\t\t\t\tString xp = entryParts[3];\n\t\t\t\tString location = entryParts[4];\n\t\t\t\tint powerInt = Integer.parseInt(power);\n\t\t\t\tint goldInt = Integer.parseInt(gold);\n\t\t\t\tint XPInt = Integer.parseInt(xp);\n\t\t\t\tRegion regionR = RM.getRegion(location);\n\t\t\t\tTrap trap = new Trap(name, powerInt, goldInt, XPInt, regionR);\n\t\t\t\ttrapList[i-1] = trap;\n\t\t\t}\n\t}", "public Example readExample(ArrayList<String> paths) throws Exception{\n\n ArrayList<ArrayList<String>> features = readFile(paths.get(0), Consts.SPACE);\n ArrayList<ArrayList<String>> labels = readFile(paths.get(1), Consts.SPACE);\n\n Example example = Factory.getExample(1);\n\n //extract the labels\n String label = labels.get(1).get(0)+Consts.CLASSIFICATION_SPLITTER+labels.get(1).get(1);\n example.setLabel(label);\n\n //extract the features\n for (int i=0 ; i<features.size() ; i++){\n\n Vector vector = new Vector();\n for(int j=0 ; j<features.get(i).size() ; j++){\n\n if(features.get(i).get(j).equalsIgnoreCase(\"nan\")) {\n vector.put(j, 0.0);\n continue;\n }\n\n if(!ConverterHelplers.tryParseDouble(features.get(i).get(j))){\n Logger.error(\"Error converting example.\");\n return null;\n }\n double num = Double.parseDouble(features.get(i).get(j));\n vector.put(j,num);\n }\n example.getFeatures2D().add(vector);\n }\n\n example.sizeOfVector = example.getFeatures2D().size();\n return example;\n }", "public File getAttributeFile();" ]
[ "0.71274203", "0.68559545", "0.65826863", "0.61214036", "0.5950146", "0.5877428", "0.58368504", "0.58025056", "0.5801011", "0.5770509", "0.5744325", "0.5697273", "0.5642944", "0.5638859", "0.56103486", "0.5565951", "0.55193144", "0.5502011", "0.5453952", "0.54459375", "0.54410344", "0.54395276", "0.53957546", "0.53453296", "0.5343347", "0.53419125", "0.5334228", "0.53315663", "0.5309845", "0.530711", "0.53044355", "0.5300015", "0.5299461", "0.52654976", "0.5265292", "0.5257345", "0.5256247", "0.52428126", "0.5242256", "0.52324575", "0.5231559", "0.5195961", "0.5184685", "0.5178027", "0.516657", "0.513998", "0.51358706", "0.51273274", "0.51264936", "0.51040536", "0.5100815", "0.5092742", "0.5090861", "0.50804013", "0.50802135", "0.5080069", "0.50765634", "0.5061441", "0.5058581", "0.50261176", "0.50229925", "0.49917325", "0.4990024", "0.49838707", "0.49816406", "0.49755773", "0.49716645", "0.49664", "0.4964455", "0.49623528", "0.4958969", "0.49549282", "0.49528676", "0.49511", "0.49506423", "0.49418342", "0.49389628", "0.49388486", "0.49351633", "0.4934873", "0.49161643", "0.49117342", "0.49072996", "0.49059135", "0.4898978", "0.48988584", "0.4896961", "0.48946893", "0.48876432", "0.48857385", "0.48812523", "0.48685887", "0.48626816", "0.4861643", "0.4858057", "0.48564625", "0.48494515", "0.4848887", "0.48476392", "0.48465037" ]
0.6063297
4
Create a matrix for each cluster, and plots the output using imported PCA implementation
public static void printClusters() { int count = 0; double[][] matrix = null; for(String s:allClusters) { count++; System.out.println(s); String points[] = s.split(","); matrix = new double[points.length][cols]; int k=0; for(String p:points) { resultClusters.put(Integer.parseInt(p), count); ArrayList<Double> features = geneAttributes.get(Integer.parseInt(p)); double[] arr = new double[cols]; for(int i=0;i<features.size();i++) arr[i] = features.get(i); matrix[k++] = arr; } pca_list.add(matrix); } Plot plot = new Plot((ArrayList<double[][]>) pca_list, "HAC"); plot.plot(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void viewPCAChart(int pcaI, int pcaII) {\r\n DivaClientService.computePCA(pcaI, pcaII,\r\n new AsyncCallback<PCAImageResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n Selection_Manager.connError();\r\n }\r\n\r\n @Override\r\n public void onSuccess(PCAImageResult result) {\r\n pcaPlotComponent = new PCAPlotComponent(result, Selection_Manager, DivaClientService, datasetInfo.getColNumb(), datasetInfo.getDatasetInfo(), middlePanelWidth);\r\n topMidLayout.add(pcaPlotComponent.getPCAComponent());\r\n topMidLayout.setCellHorizontalAlignment(pcaPlotComponent.getPCAComponent(), HorizontalPanel.ALIGN_RIGHT);\r\n if (!init) {\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n if (init) {\r\n viewRankTables();\r\n }\r\n }\r\n });\r\n }", "public void screePlotDataAlone(){\n if(!this.pcaDone)this.pca();\n\n // Create X-axis data array\n double[] components = new double[super.nItems];\n for(int i=0; i<this.nItems; i++)components[i] = i+1;\n\n // Create instance of PlotGraph\n PlotGraph pg = new PlotGraph(components, this.orderedEigenValues);\n pg.setGraphTitle(\"Principal Component Analysis Scree Plot\");\n pg.setXaxisLegend(\"Component\");\n pg.setYaxisLegend(\"Eigenvalues\");\n pg.setLine(3);\n pg.setPoint(1);\n pg.plot();\n }", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "private void cluster() {\n\t\tint index = 0;\n\t\tfor (DataObject obj : objects) {\n\t\t\tindex = getNearestCenterIndex(obj, centers);\n\t\t\tclusters.get(index).add(obj);\n\t\t}\n\t}", "public void screePlot(){\n if(!this.pcaDone)this.pca();\n if(!this.monteCarloDone)this.monteCarlo();\n\n // Create plotting data array\n double[][] plotData = new double[6][super.nItems];\n double[] components = new double[super.nItems];\n for(int i=0; i<this.nItems; i++)components[i] = i+1;\n plotData[0] = components;\n plotData[1] = this.orderedEigenValues;\n plotData[2] = components;\n plotData[3] = this.randomEigenValuesPercentiles;\n plotData[4] = components;\n plotData[5] = this.randomEigenValuesMeans;\n\n // Create instance of PlotGraph\n PlotGraph pg = new PlotGraph(plotData);\n pg.setErrorBars(2, this.randomEigenValuesSDs);\n if(this.gaussianDeviates){\n pg.setGraphTitle(\"Principal Component Analysis Scree Plot with Parallel Analysis using Gaussian deviates (\" + nMonteCarlo + \" simulations)\");\n }\n else{\n pg.setGraphTitle(\"Principal Component Analysis Scree Plot with Parallel Analysis using uniform deviates (\" + nMonteCarlo + \" simulations)\");\n }\n pg.setGraphTitle2(\"Closed squares - data eigenvalues; open circles = Monte Carlo eigenvalue \" + this.percentile + \"% percentiles; error bars = standard deviations about the Monte carlo means (crosses)\");\n pg.setXaxisLegend(\"Component\");\n pg.setYaxisLegend(\"Eigenvalue\");\n int[] line = {3, 0, 3};\n pg.setLine(line);\n int point[] = {5, 1, 7};\n pg.setPoint(point);\n pg.plot();\n }", "private JPanelCluster(String buttonName, java.awt.event.ActionListener a) {\r\n\t\t\t\tthis.setLayout(new BorderLayout());\r\n\t\t\t\tclusterOutput.setEditable(false);\r\n\t\t\t\tJPanel upPanel = new JPanel();\r\n\t\t\t\tupPanel.setLayout(new FlowLayout());\r\n\t\t\t\tJPanel centralPanel = new JPanel();\r\n\t\t\t\tcentralPanel.setLayout(new FlowLayout());\r\n\t\t\t\tJPanel downPanel = new JPanel();\r\n\t\t\t\tdownPanel.setLayout(new FlowLayout());\r\n\t\t\t\tupPanel.add(labelTable);\r\n\t\t\t\tupPanel.add(tableText);\r\n\t\t\t\tif (buttonName.equals(\"mine\")) {\r\n\t\t\t\t\tupPanel.add(labelk);\r\n\t\t\t\t\tupPanel.add(kText);\r\n\t\t\t\t}\r\n\t\t\t\tcentralPanel.add(clusterOutput);\r\n\t\t\t\texecuteButton = new JButton(buttonName);\r\n\t\t\t\tdownPanel.add(executeButton);\r\n\t\t\t\texecuteButton.addActionListener(a);\r\n\t\t\t\tthis.add(upPanel, BorderLayout.NORTH);\r\n\t\t\t\tthis.add(centralPanel, BorderLayout.CENTER);\r\n\t\t\t\tthis.add(downPanel, BorderLayout.SOUTH);\r\n\t\t\t\tJScrollPane sp = new JScrollPane(clusterOutput);\r\n\t\t\t\tthis.add(sp);\r\n\t\t\t\tsetVisible(true);\r\n\t\t\t}", "public void mouseClicked(MouseEvent e){\r\n\t\t int[] mouseCurent = new int[2];\r\n\t\t mouseCurent[0] = e.getX();\r\n\t\t mouseCurent[1] = e.getY();\r\n\t\t \r\n\t\t //if (clickedNum > totalNum-1) {\r\n\t\t //\t JOptionPane.showMessageDialog(new JFrame(),\r\n\t\t\t//\t\t \"No more clicked points are wanted.\",\r\n\t\t\t//\t\t \"Inane error\",\r\n\t\t\t//\t\t JOptionPane.ERROR_MESSAGE);\r\n\t\t //} else {\r\n\t\t if (e.getModifiers() == MouseEvent.BUTTON1_MASK) {\r\n\t\t\t double d[][] = plotViewer.plotPanel.plotCanvas.centerData;\r\n\t\t\t plotViewer.plotPanel.addPlot(\"SCATTER\", \"Cluster Center\", Color.BLACK, d);\r\n\t\t\t \r\n\t\t\t // increase the center data storage memory\r\n\t\t\t if (clickedNum == 0) {\r\n\t\t\t\t cluster2DCenters = new double[1][2];\r\n\t\t\t\t cluster2DCenters[0] = d[0];\r\n\t\t\t\t clickedNum++;\r\n\t\t\t } else {\r\n\t\t\t\t double bak[][] = new double[clickedNum][2];\r\n\t\t\t\t bak = copy(cluster2DCenters);\t\r\n\t\t\t\t clickedNum++;\r\n\t\t\t\t cluster2DCenters = new double[clickedNum][2];\r\n\t\t\t\t for (int i=0; i<clickedNum-1; i++) {\r\n\t\t\t\t\t cluster2DCenters[i] = copy(bak[i]);\r\n\t\t\t\t }\r\n\t\t\t\t cluster2DCenters[clickedNum-1] = d[0];\r\n\t\t\t }\r\n\t\t\t \r\n\t\t }\r\n\t }", "DataFramePCA<R,C> pca();", "public VCFManager(String inputVcf_file,NaivePedcaPlotter n) throws FileNotFoundException, InterruptedException {\n\t\tSystem.out.println(\"cluster 1 size:\"+n.LENGTH_OF_CLUSTER_ONE_CONTIGS+\" cluster 2 size:\"+n.LENGTH_OF_CLUSTER_TWO_CONTIGS);\n\t\tploestPlotter=n;\n\t\tFile pilonOutFolder = new File(outputFileRoot);\n\t\tpilonOutFolder.mkdirs();\n\t\tvcfExtractor(inputVcf_file);\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n redChart = new javax.swing.JPanel();\n jPanel2 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n redLimiar = new javax.swing.JSpinner();\n redPre = new javax.swing.JButton();\n redAplic = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n redStats = new javax.swing.JTextPane();\n jLabel1 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n redEixX = new javax.swing.JComboBox();\n redEixY = new javax.swing.JComboBox();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\" Principal Component Analysis (PCA)\");\n setIconImage(null);\n setResizable(false);\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n redChart.setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout redChartLayout = new javax.swing.GroupLayout(redChart);\n redChart.setLayout(redChartLayout);\n redChartLayout.setHorizontalGroup(\n redChartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n redChartLayout.setVerticalGroup(\n redChartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 277, Short.MAX_VALUE)\n );\n\n jPanel2.setBackground(new java.awt.Color(255, 255, 255));\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Configuração\"));\n\n jLabel2.setText(\"<html>\\n<p>\\nA avaliação de desempenho será realizada através do <strong>k-NN</strong> com a <strong>configuração atual</strong>.\\n</p>\\n<p>\\n*A base de dados será automaticamente normalizada, caso ainda não seja.\\n</p>\\n</html>\");\n\n jLabel3.setText(\"Porcentagem de variância coberta pelas componentes principais:\");\n\n redLimiar.setModel(new javax.swing.SpinnerNumberModel(0.95d, 0.1d, 1.0d, 0.05d));\n\n redPre.setText(\"Pré-Visualizar\");\n redPre.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n redPreActionPerformed(evt);\n }\n });\n\n redAplic.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n redAplic.setText(\"Aplicar*\");\n redAplic.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n redAplicActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(redLimiar, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(redPre, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(redAplic, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(redLimiar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(redAplic)\n .addComponent(redPre))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n redStats.setFont(new java.awt.Font(\"Courier New\", 0, 10)); // NOI18N\n redStats.setFocusable(false);\n jScrollPane2.setViewportView(redStats);\n\n jLabel1.setText(\"Eixo X:\");\n\n jLabel4.setText(\"Eixo Y:\");\n\n redEixX.setMaximumSize(new java.awt.Dimension(384, 32767));\n redEixX.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n changeAxis(evt);\n }\n });\n\n redEixY.setMaximumSize(new java.awt.Dimension(384, 32767));\n redEixY.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n changeAxis(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(redChart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(redEixY, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(redEixX, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane2))\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(redEixX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(redEixY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(redChart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jScrollPane2))\n .addContainerGap())\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void analysisExcel(){\n\n FileOutput fout = null;\n if(this.fileNumberingSet){\n fout = new FileOutput(this.outputFilename, 'n');\n }\n else{\n fout = new FileOutput(this.outputFilename);\n }\n\n // perform PCA if not already performed\n if(!pcaDone)this.pca();\n if(!this.monteCarloDone)this.monteCarlo();\n\n // output title\n fout.println(\"PRINCIPAL COMPONENT ANALYSIS\");\n fout.println(\"Program: PCA - Analysis Output\");\n for(int i=0; i<this.titleLines; i++)fout.println(title[i]);\n Date d = new Date();\n String day = DateFormat.getDateInstance().format(d);\n String tim = DateFormat.getTimeInstance().format(d);\n fout.println(\"Program executed at \" + tim + \" on \" + day);\n fout.println();\n if(this.covRhoOption){\n fout.println(\"Covariance matrix used\");\n }\n else{\n fout.println(\"Correlation matrix used\");\n }\n fout.println();\n\n // output eigenvalue table\n fout.println(\"ALL EIGENVALUES\");\n\n fout.printtab(\"Component \");\n fout.printtab(\"Unordered \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.println(\"Difference \");\n\n fout.printtab(\" \");\n fout.printtab(\"index\");\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.println(\" \");\n\n\n\n for(int i=0; i<this.nItems; i++){\n fout.printtab(i+1);\n fout.printtab((this.eigenValueIndices[i]+1));\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[i], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[i], this.trunc));\n if(i<this.nItems-1){\n fout.printtab(Fmath.truncate((this.orderedEigenValues[i] - this.orderedEigenValues[i+1]), this.trunc));\n }\n else{\n fout.printtab(\" \");\n }\n fout.printtab(\" \");\n\n fout.println();\n }\n fout.println();\n\n\n // Extracted components\n int nMax = this.greaterThanOneLimit;\n if(nMax<this.meanCrossover)nMax=this.meanCrossover;\n if(nMax<this.percentileCrossover)nMax=this.percentileCrossover;\n fout.println(\"EXTRACTED EIGENVALUES\");\n fout.printtab(\" \");\n fout.printtab(\"Greater than unity\");\n fout.printtab(\" \");fout.printtab(\" \");fout.printtab(\" \");\n fout.printtab(\"Greater than Monte Carlo Mean \");\n fout.printtab(\" \");fout.printtab(\" \");fout.printtab(\" \");\n fout.println(\"Greater than Monte Carlo Percentile\");\n\n fout.printtab(\"Component \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.printtab(\" \");\n\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.printtab(\" \");\n\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.println(\" \");\n\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.printtab(\" \");\n\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.printtab(\" \");\n\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.println(\" \");\n\n int ii=0;\n while(ii<nMax){\n fout.printtab(ii+1);\n\n if(ii<this.greaterThanOneLimit){\n fout.printtab(Fmath.truncate(this.orderedEigenValues[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n fout.printtab(\" \");\n }\n\n if(ii<this.meanCrossover){\n fout.printtab(Fmath.truncate(this.orderedEigenValues[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n fout.printtab(\" \");\n }\n\n if(ii<this.percentileCrossover){\n fout.printtab(Fmath.truncate(this.orderedEigenValues[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n }\n fout.println();\n ii++;\n }\n fout.println();\n\n\n fout.println(\"PARALLEL ANALYSIS\");\n fout.println(\"Number of simulations = \" + this.nMonteCarlo);\n if(this.gaussianDeviates){\n fout.println(\"Gaussian random deviates used\");\n }\n else{\n fout.println(\"Uniform random deviates used\");\n }\n fout.println(\"Percentile value used = \" + this.percentile + \" %\");\n\n fout.println();\n fout.printtab(\"Component \");\n fout.printtab(\"Data \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.printtab(\" \");\n fout.printtab(\"Data \");\n fout.printtab(\"Monte Carlo \");\n fout.printtab(\"Monte Carlo \");\n fout.println(\"Monte Carlo \");\n\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Eigenvalue \");\n fout.println(\"Eigenvalue \");\n\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\"Percentile \");\n fout.printtab(\"Mean \");\n fout.println(\"Standard Deviation \");\n\n for(int i=0; i<this.nItems; i++){\n fout.printtab(i+1);\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[i], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[i], this.trunc));\n fout.printtab(\" \");\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(this.randomEigenValuesPercentiles[i], this.trunc));\n fout.printtab(Fmath.truncate(this.randomEigenValuesMeans[i], this.trunc));\n fout.println(Fmath.truncate(this.randomEigenValuesSDs[i], this.trunc));\n }\n fout.println();\n\n // Correlation Matrix\n fout.println(\"CORRELATION MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.correlationMatrix.getElement(j,i), this.trunc));\n fout.println();\n }\n fout.println();\n\n // Covariance Matrix\n fout.println(\"COVARIANCE MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.covarianceMatrix.getElement(j,i), this.trunc));\n fout.println();\n }\n fout.println();\n\n // Eigenvectors\n fout.println(\"EIGENVECTORS\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println(\"Vector corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.println();\n fout.println(\"component\");\n\n for(int i=0; i<this.nItems; i++){\n fout.printtab((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.orderedEigenVectorsAsRows[i][j], this.trunc));\n fout.println();\n }\n fout.println();\n\n // Loading factors\n fout.println(\"LOADING FACTORS\");\n fout.println(\"Original indices in parenthesis\");\n fout.println(\"Loading factors corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue\");\n fout.printtab(\"% Proportion\");\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.loadingFactorsAsRows[i][j], this.trunc));\n fout.printtab(\" \");\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(proportionPercentage[i], this.trunc));\n fout.println(Fmath.truncate(cumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n // Rotated loading factors\n fout.println(\"ROTATED LOADING FACTORS\");\n if(this.varimaxOption){\n fout.println(\"NORMAL VARIMAX\");\n }\n else{\n fout.println(\"RAW VARIMAX\");\n }\n\n String message = \"The ordered eigenvalues with Monte Carlo means and percentiles in parenthesis\";\n message += \"\\n (Total number of eigenvalues = \" + this.nItems + \")\";\n int nDisplay = this.nItems;\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n int screenHeight = screenSize.height;\n int nDisplayLimit = 20*screenHeight/800;\n if(nDisplay>nDisplay)nDisplay = nDisplayLimit;\n for(int i=0; i<nDisplay; i++){\n message += \"\\n \" + Fmath.truncate(this.orderedEigenValues[i], 4) + \" (\" + Fmath.truncate(this.randomEigenValuesMeans[i], 4) + \" \" + Fmath.truncate(this.randomEigenValuesPercentiles[i], 4) + \")\";\n }\n if(nDisplay<this.nItems)message += \"\\n . . . \";\n message += \"\\nEnter number of eigenvalues to be extracted\";\n int nExtracted = this.greaterThanOneLimit;\n nExtracted = Db.readInt(message, nExtracted);\n this.varimaxRotation(nExtracted);\n\n fout.println(\"Varimax rotation for \" + nExtracted + \" extracted factors\");\n fout.println(\"Rotated loading factors and eigenvalues scaled to ensure total 'rotated variance' matches unrotated variance for the extracted factors\");\n fout.println(\"Original indices in parenthesis\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.rotatedIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue\");\n fout.printtab(\"% Proportion\");\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n for(int i=0; i<nExtracted; i++){\n fout.printtab((i+1) + \" (\" + (this.rotatedIndices[i]+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.rotatedLoadingFactorsAsRows[i][j], this.trunc));\n fout.printtab(\" \");\n fout.printtab(Fmath.truncate(rotatedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(rotatedProportionPercentage[i], this.trunc));\n fout.println(Fmath.truncate(rotatedCumulativePercentage[i], this.trunc));\n }\n\n\n fout.println();\n\n\n fout.println(\"DATA USED\");\n fout.println(\"Number of items = \" + this.nItems);\n fout.println(\"Number of persons = \" + this.nPersons);\n\n if(this.originalDataType==0){\n fout.printtab(\"Item\");\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n }\n fout.println();\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n for(int j=0; j<this.nPersons; j++){\n fout.printtab(Fmath.truncate(this.scores0[i][j], this.trunc));\n }\n fout.println();\n }\n }\n else{\n fout.printtab(\"Person\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n }\n fout.println();\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n for(int j=0; j<this.nItems; j++){\n fout.printtab(Fmath.truncate(this.scores1[i][j], this.trunc));\n }\n fout.println();\n }\n }\n\n fout.close();\n }", "private void analysisText(){\n\n FileOutput fout = null;\n if(this.fileNumberingSet){\n fout = new FileOutput(this.outputFilename, 'n');\n }\n else{\n fout = new FileOutput(this.outputFilename);\n }\n\n // perform PCA if not already performed\n if(!pcaDone)this.pca();\n if(!this.monteCarloDone)this.monteCarlo();\n\n // output title\n fout.println(\"PRINCIPAL COMPONENT ANALYSIS\");\n fout.println(\"Program: PCA - Analysis Output\");\n for(int i=0; i<this.titleLines; i++)fout.println(title[i]);\n Date d = new Date();\n String day = DateFormat.getDateInstance().format(d);\n String tim = DateFormat.getTimeInstance().format(d);\n fout.println(\"Program executed at \" + tim + \" on \" + day);\n fout.println();\n if(this.covRhoOption){\n fout.println(\"Covariance matrix used\");\n }\n else{\n fout.println(\"Correlation matrix used\");\n }\n fout.println();\n\n // output eigenvalue table\n // field width\n int field1 = 10;\n int field2 = 12;\n int field3 = 2;\n\n fout.println(\"ALL EIGENVALUES\");\n\n fout.print(\"Component \", field1);\n fout.print(\"Unordered \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.println(\"Difference \");\n\n fout.print(\" \", field1);\n fout.print(\"index\", field1);\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.println(\" \");\n\n\n\n for(int i=0; i<this.nItems; i++){\n fout.print(i+1, field1);\n fout.print((this.eigenValueIndices[i]+1), field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[i], this.trunc), field2);\n if(i<this.nItems-1){\n fout.print(Fmath.truncate((this.orderedEigenValues[i] - this.orderedEigenValues[i+1]), this.trunc), field2);\n }\n else{\n fout.print(\" \", field2);\n }\n fout.print(\" \", field3);\n\n fout.println();\n }\n fout.println();\n\n\n // Extracted components\n int nMax = this.greaterThanOneLimit;\n if(nMax<this.meanCrossover)nMax=this.meanCrossover;\n if(nMax<this.percentileCrossover)nMax=this.percentileCrossover;\n fout.println(\"EXTRACTED EIGENVALUES\");\n fout.print(\" \", field1);\n fout.print(\"Greater than unity\", 3*field2 + field3);\n fout.print(\"Greater than Monte Carlo Mean \", 3*field2 + field3);\n fout.println(\"Greater than Monte Carlo Percentile\");\n\n fout.print(\"Component \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.println(\" \");\n\n fout.print(\" \", field1);\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.println(\" \");\n\n int ii=0;\n while(ii<nMax){\n fout.print(ii+1, field1);\n\n if(ii<this.greaterThanOneLimit){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc), (field2+field3));\n }\n\n if(ii<this.meanCrossover){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc), (field2+field3));\n }\n\n if(ii<this.percentileCrossover){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n }\n fout.println();\n ii++;\n }\n fout.println();\n\n\n fout.println(\"PARALLEL ANALYSIS\");\n fout.println(\"Number of simulations = \" + this.nMonteCarlo);\n if(this.gaussianDeviates){\n fout.println(\"Gaussian random deviates used\");\n }\n else{\n fout.println(\"Uniform random deviates used\");\n }\n fout.println(\"Percentile value used = \" + this.percentile + \" %\");\n\n fout.println();\n fout.print(\"Component \", field1);\n fout.print(\"Data \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n fout.print(\"Data \", field2);\n fout.print(\"Monte Carlo \", field2);\n fout.print(\"Monte Carlo \", field2);\n fout.println(\"Monte Carlo \");\n\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Eigenvalue \", field2);\n fout.println(\"Eigenvalue \");\n\n fout.print(\" \", field1);\n fout.print(\" \", field2);\n fout.print(\" \", field2);\n fout.print(\" \", field2);\n fout.print(\" \", field3);\n fout.print(\" \", field2);\n fout.print(\"Percentile \", field2);\n fout.print(\"Mean \", field2);\n fout.println(\"Standard Deviation \");\n\n for(int i=0; i<this.nItems; i++){\n fout.print(i+1, field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[i], this.trunc), field2);\n fout.print(\" \", field3);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.randomEigenValuesPercentiles[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.randomEigenValuesMeans[i], this.trunc), field2);\n fout.println(Fmath.truncate(this.randomEigenValuesSDs[i], this.trunc));\n }\n fout.println();\n\n // Correlation Matrix\n fout.println(\"CORRELATION MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.correlationMatrix.getElement(j,i), this.trunc), field2);\n fout.println();\n }\n fout.println();\n\n // Covariance Matrix\n fout.println(\"COVARIANCE MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.covarianceMatrix.getElement(j,i), this.trunc), field2);\n fout.println();\n }\n\n fout.println();\n\n // Eigenvectors\n fout.println(\"EIGENVECTORS\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println(\"Vector corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.orderedEigenVectorsAsRows[i][j], this.trunc), field2);\n fout.println();\n }\n fout.println();\n\n // Loading factors\n fout.println(\"LOADING FACTORS\");\n fout.println(\"Original indices in parenthesis\");\n fout.println(\"Loading factors corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue\", field2);\n fout.print(\"Proportion\", field2);\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n for(int i=0; i<this.nItems; i++){\n fout.print((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.loadingFactorsAsRows[i][j], this.trunc), field2);\n fout.print(\" \", field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(proportionPercentage[i], this.trunc), field2);\n fout.println(Fmath.truncate(cumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n // Rotated loading factors\n fout.println(\"ROTATED LOADING FACTORS\");\n if(this.varimaxOption){\n fout.println(\"NORMAL VARIMAX\");\n }\n else{\n fout.println(\"RAW VARIMAX\");\n }\n\n String message = \"The ordered eigenvalues with Monte Carlo means and percentiles in parenthesis\";\n message += \"\\n (Total number of eigenvalues = \" + this.nItems + \")\";\n int nDisplay = this.nItems;\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n int screenHeight = screenSize.height;\n int nDisplayLimit = 20*screenHeight/800;\n if(nDisplay>nDisplay)nDisplay = nDisplayLimit;\n for(int i=0; i<nDisplay; i++){\n message += \"\\n \" + Fmath.truncate(this.orderedEigenValues[i], 4) + \" (\" + Fmath.truncate(this.randomEigenValuesMeans[i], 4) + \" \" + Fmath.truncate(this.randomEigenValuesPercentiles[i], 4) + \")\";\n }\n if(nDisplay<this.nItems)message += \"\\n . . . \";\n message += \"\\nEnter number of eigenvalues to be extracted\";\n int nExtracted = this.greaterThanOneLimit;\n nExtracted = Db.readInt(message, nExtracted);\n this.varimaxRotation(nExtracted);\n\n fout.println(\"Varimax rotation for \" + nExtracted + \" extracted factors\");\n fout.println(\"Rotated loading factors and eigenvalues scaled to ensure total 'rotated variance' matches unrotated variance for the extracted factors\");\n fout.println(\"Original indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.rotatedIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue\", field2);\n fout.print(\"Proportion\", field2);\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n\n for(int i=0; i<nExtracted; i++){\n fout.print((i+1) + \" (\" + (rotatedIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.rotatedLoadingFactorsAsRows[i][j], this.trunc), field2);\n fout.print(\" \", field1);\n fout.print(Fmath.truncate(rotatedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(rotatedProportionPercentage[i], this.trunc), field2);\n fout.println(Fmath.truncate(rotatedCumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n fout.println(\"DATA USED\");\n fout.println(\"Number of items = \" + this.nItems);\n fout.println(\"Number of persons = \" + this.nPersons);\n\n\n if(this.originalDataType==0){\n fout.printtab(\"Item\");\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n }\n fout.println();\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n for(int j=0; j<this.nPersons; j++){\n fout.printtab(Fmath.truncate(this.scores0[i][j], this.trunc));\n }\n fout.println();\n }\n }\n else{\n fout.printtab(\"Person\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n }\n fout.println();\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n for(int j=0; j<this.nItems; j++){\n fout.printtab(Fmath.truncate(this.scores1[i][j], this.trunc));\n }\n fout.println();\n }\n }\n\n fout.close();\n }", "public void createClusters() {\n\t\t/*\n\t\t * double simAvg = documentDao.getSimilarity(avg); double simMax =\n\t\t * documentDao.getSimilarity(max); double simMin =\n\t\t * documentDao.getSimilarity(min);\n\t\t */\n\n\t\t// initClusters();\n\n\t\tList<Document> docList = documentDao.getDocumentListOrderBySimilarity();\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tint i = 0;\n\t\tCluster cluster = clusterList.get(i);\n\t\tfor (Document document : docList) {\n\t\t\twhile (document.getSimilarity() < cluster.getLow()) {\n\t\t\t\tcluster = clusterList.get(++i);\n\t\t\t}\n\t\t\tif (document.getSimilarity() < cluster.getHigh() && document.getSimilarity() >= cluster.getLow()) {\n\t\t\t\tdocument.setClusterId(cluster.getId());\n\t\t\t\tdocumentDao.insertDocument(document);\n\t\t\t}\n\t\t}\n\n\t}", "protected void visualizeAllClusterAssignments(Instances instances) {\n\t\tint size = m_History.getList().getModel().getSize(); \r\n\t\t\r\n\t\tfinal SubspaceVisualData svp [] = new SubspaceVisualData[size];\r\n\t\tfinal SubspaceClusterer clusterer []= new SubspaceClusterer[size];\r\n\t\t\r\n\t\tFastVector rlist_item = null;\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\t\t\trlist_item = (FastVector) m_History.getNamedObject(m_History.getNameAtIndex(i));\r\n\t\r\n\t\t\tSubspaceVisualData temp_svp = null;\r\n\t\t\tSubspaceClusterer temp_clusterer = null;\r\n\t\r\n\t\t\tif (rlist_item != null) {\r\n\t\t\t\tfor (int j = 0; j < rlist_item.size(); j++) {\r\n\t\t\t\t\tObject temp = rlist_item.elementAt(j);\r\n\t\t\t\t\tif (temp instanceof SubspaceClusterer) {\r\n\t\t\t\t\t\ttemp_clusterer = (SubspaceClusterer) temp;\r\n\t\t\t\t\t} else if (temp instanceof SubspaceVisualData) { // normal errors\r\n\t\t\t\t\t\ttemp_svp = (SubspaceVisualData) temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsvp[i]=temp_svp;\r\n\t\t\tclusterer[i]=temp_clusterer;\r\n\t\t}\r\n\t\tnew VisualClusteringOverview(clusterer,svp,instances);\r\n\t}", "private void prepareCluster(GoogleMap googleMap){\n Log.d(\"CLUSTER\",\"IN PREPARAZIONE\");\n mClusterManager = new CustomClusterManager<>(this, googleMap);\n googleMap.setOnCameraIdleListener(mClusterManager);\n googleMap.setOnMarkerClickListener(mClusterManager);\n googleMap.setOnInfoWindowClickListener(mClusterManager);\n mClusterManager.setMapMarkerList(mapMarkers);\n mClusterManager.cluster();\n }", "public void displayResults() {\n\t\tcreateCluster();\n\t\tassignClusterID();\n\t\tSystem.out.println(iterations);\n\t\tWriter writer;\n\t\ttry {\n\t\t\twriter = new FileWriter(\"/Users/saikalyan/Documents/ClusterResult_kmeans.txt\");\n\t\t\tfor (int key : labelsMap.keySet()) {\n\t\t\t\tclusterResultsList.add(clusterIdMap.get(labelsMap.get(key)));\n\t\t\t\twriter.write(String.valueOf(clusterIdMap.get(labelsMap.get(key))));\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t\tSystem.out.println(key + \" : \" + clusterIdMap.get(labelsMap.get(key)));\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tExternalValidator extValidation = new ExternalValidator(count, groundTruthList, clusterResultsList);\n\n\t\tfloat res = extValidation.getCoefficient();\n\t\tSystem.out.println(\"Rand Index------------\" + res);\n\n\t\tfloat jaccard = extValidation.getJaccardCoeff();\n\t\tSystem.out.println(\"Jaccard co-efficient------------\" + jaccard);\n\n\t}", "@Override\n public void paint(Graphics g) {\n plotSampleData((Graphics2D) g);\n plotClusters((Graphics2D) g);\n }", "public void Matriz()\n {\n int dim;\n dim = Principal.dimension;\n \n matrix = new JLabel [dim][dim];\n\n for(int i=0; i< dim; i++){\n\n\t\t\t\tfor(int j=0; j< dim; j++){\n\n\t\t\t\t\t\n\n matrix[i][j] = new JLabel();\n\n matrix[i][j].setVisible(true);\n\n matrix[i][j].setBorder(javax.swing.BorderFactory.createLineBorder(Color.black, 1));\n\n matrix[i][j].setBounds(5 +(i*43), 5 +(j*43), 40, 40);\n\n matrix[i][j].setBackground(Color.green);\n\n matrix[i][j].setText(\"\");\n Pan_Tablero.add(matrix[i][j]);\n\n //this.getContentPane().add(matrix[i][j]);\n\n } \n\n} \n }", "public void addClusterBox(final Cluster cluster) {\n final JPanel label = new JPanel();\n label.setBackground(Browser.PANEL_BACKGROUND);\n label.setLayout(new BoxLayout(label, BoxLayout.Y_AXIS));\n label.add(new JLabel(cluster.getName()));\n for (final Host h : cluster.getHosts()) {\n final StringBuilder hostLabel = new StringBuilder();\n if (!h.isRoot()) {\n hostLabel.append(h.getUsername());\n hostLabel.append('@');\n }\n hostLabel.append(h.getName());\n final String port = h.getSSHPort();\n if (port != null && !\"22\".equals(port)) {\n hostLabel.append(':');\n hostLabel.append(port);\n }\n \n final JLabel nl = new JLabel(\" \" + hostLabel);\n final Font font = nl.getFont();\n final Font newFont = font.deriveFont(\n Font.PLAIN,\n (float) (font.getSize() / 1.2));\n nl.setFont(newFont);\n label.add(nl);\n }\n final JPanel startPanel = new JPanel(new BorderLayout());\n startPanel.setBackground(Browser.PANEL_BACKGROUND);\n clusterBackgrounds.put(cluster, startPanel);\n startPanel.setBorder(new LineBorder(Tools.getDefaultColor(\n \"EmptyBrowser.StartPanelTitleBorder\")));\n final JPanel left = new JPanel();\n left.setBackground(Browser.PANEL_BACKGROUND);\n clusterBackgrounds.put(cluster, startPanel);\n final JCheckBox markWi = new JCheckBox();\n markWi.setBackground(Browser.PANEL_BACKGROUND);\n allCheckboxes.put(cluster, markWi);\n left.add(markWi);\n left.add(label);\n startPanel.add(left, BorderLayout.LINE_START);\n final MyButton loadClusterBtn = loadClusterButton(cluster, markWi);\n startPanel.add(loadClusterBtn, BorderLayout.LINE_END);\n c.fill = GridBagConstraints.HORIZONTAL;\n mainPanel.add(startPanel, c);\n c.gridx++;\n if (c.gridx > 2) {\n c.gridx = 0;\n c.gridy++;\n }\n }", "protected void printClusters(List<Cluster> clusters) {\n ListIterator<Cluster> i = clusters.listIterator();\n while (i.hasNext()) {\n System.out.print(\"----cluster \" + i.nextIndex() + \" : \");\n System.out.println(i.next());\n }\n System.out.println(\"----\");\n }", "protected void visualizeClusterAssignments(SubspaceClusterer cluster, SubspaceVisualData sp, Instances instances) {\r\n\t\tif (sp != null) {\r\n\t\t\tnew VisualClusteringFrame(cluster, sp,instances);\r\n\t\t}\r\n\t}", "public Cluster() {\n setRadius(defaultClusterRadius);\n float hue = random.nextFloat();\n Color c = Color.getHSBColor(hue, 1f, 1f);\n setColor(c);\n setClusterNumber(clusterCounter++);\n setAspectRatio(EinsteinClusterTracker.this.getAspectRatio());\n// vxFilter.setTauMs(velocityTauMs);\n// vyFilter.setTauMs(velocityTauMs);\n }", "public String Km() throws Exception {\n int x = 0;\n System.out.println(x+\" hlikiaaaaaa\");\n ΑrffCreator gen = new ΑrffCreator();\n\t\t\tgen.ArffGenerator();\n\t\t\t\n\t\t\tSimpleKMeans kmeans = new SimpleKMeans();\n\t \n\t\t\tkmeans.setSeed(2);\n\t \n\t\t\t//important parameter to set: preserver order, number of cluster.\n\t\t\tkmeans.setPreserveInstancesOrder(true);\n\t\t\tkmeans.setNumClusters(2);\n\t \n\t\t\tBufferedReader datafile = readDataFile(\"E:\\\\Users\\\\Filippos\\\\Documents\\\\NetBeansProjects\\\\MapsCopy\\\\mytext.arff\"); \n\t\t\tInstances data = new Instances(datafile);\n\t \n\t \n\t\t\tkmeans.buildClusterer(data);\n\t \n\t\t\t// This array returns the cluster number (starting with 0) for each instance\n\t\t\t// The array has as many elements as the number of instances\n\t\t\tint[] assignments = kmeans.getAssignments();\n int noNoobs=-1;\n\t\t\t//int i=0;\n\t\t\tint g = assignments.length;\n String studentsLvl = \"\";\n String quizAns = \"\";\n int clusterResult;\n\t\t\t/*----------------------------------------->xeirokinitos upologismos<----------------------------------------\n \n /*for(int clusterNum : assignments) {\n if(i==x){\n noNoobs = assignments[i];\n System.out.println(\"to \"+g+\"o einai \"+ clusterNum+\"= \"+x+\" o cluster EINAI PROXORIMENOS\");\n\t\t\t\t}\t\n if(i==g-1) {\n \n if(assignments[i] == noNoobs){\n studentsLvl = \"advanced\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS\"+assignments[i]);\n \n }\n else{\n studentsLvl = \"beginner\";\n System.out.println(\"DEN PAEI POY8ENA ETSI\") ; \n }\n \n\t\t\t i++;\n\t\t\t}\n ---------------------------------------------------------------------------------------------------------*/\n /*upologizw thn euklideia apostash twn telikwn cluster cendroids apo to shmeio 0,0 \n auto pou apexei perissotero apo to kentro twn a3onwn , 8a einai to cluster advanced epeidi oso megaluterh hlikia \n kai kalutero scor sto preliminary test , toso pio advanced. Ka8w h logiki einai oti enas pio megalos kai diavasmenos ma8hths\n kaluteros apo enan pio pio mikro kai e3isou diavasmeno ma8hth h enan sunmoliko alla ligotero diavasmeno\n ----------------------------------------------------------------------------------------------------------*/\n \n //1 vazw ta teleutaia clusterCendroids se ena instance\t\t\t\n\t\t\tInstances clusterCendroid = kmeans.getClusterCentroids();\n //ta metatrepw se string\n\t\t\tString cluster0 = (clusterCendroid.firstInstance()).toString();\n\t\t\tString cluster1 = (clusterCendroid.lastInstance()).toString();\n\t\t\tSystem.out.println(cluster0+\"++++++++++++++++\"+cluster1);\n\t\t\t\n //2 spaw to ka8e string sto \",\" gt einai tis morfhs cluster0=\"x0,y0\" cluster1=\"x1,y1\"\n\t\t\tString[] parts = cluster0.split(\",\");\n\t\t\tString partx0 = parts[0]; // 004\n\t\t\tString party0 = parts[1]; // 034556\n\t\n\t\t\tSystem.out.println(partx0+\" || \"+party0);\n \n //3 Metatrepw ta String se double metavlites gia na epitrepontai oi pra3eis\n\t\t\tdouble clusterDx0 = Double.parseDouble(partx0);\n\t\t\tdouble clusterDy0 = Double.parseDouble(party0);\n\t\t\tSystem.out.println(clusterDx0+clusterDy0);\n\t\t\t\n //epanalamvanoume thn diadikasia apo to vhma 2\n\t\t\tString[] parts1 = cluster1.split(\",\");\n\t\t\tString partx1 = parts1[0]; // 004\n\t\t\tString party1 = parts1[1]; // 034556\n\t\t\t\n\t\t\tSystem.out.println(partx1+\" || \"+party1);\n\t\t\t\n \n double clusterDx1 = Double.parseDouble(partx1);\n\t\t\tdouble clusterDy1 = Double.parseDouble(party1);\n\t\t\t//System.out.println(clusterDx1+clusterDy2);\n //ypologizw thn euklidia apostasi twn 2 shmeivn ws pros to 0,0\n\t\t\tdouble popo = Math.sqrt((Math.pow(clusterDx0,2)+Math.pow(clusterDy0,2)));\n\t\t\tdouble popo2 = Math.sqrt((Math.pow(clusterDx1,2)+Math.pow(clusterDy1,2)));\n \n\t\t\tif (Math.max(popo, popo2)==popo) {\n \n clusterResult=0;\n\t\t\t\tSystem.out.println(\"0=advanced -- \"+popo+\"--1=begginer \"+popo2);\n\t\t\t}\n\t\t\telse {\n clusterResult=1;\n\t\t\t\tSystem.out.println(\"1=advanced -- \"+popo2+\"--0=begginer \"+popo);\n\t\t\t}\n\t\t\tSystem.out.println(popo+\"||\"+popo2+\"||\");\n \n if (assignments[data.numInstances()-1]==clusterResult){\n studentsLvl = \"advanced\";\n quizAns = \"yes\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS \"+assignments[data.numInstances()-1]);\n }\n else{\n quizAns = \"no\";\n studentsLvl = \"beginner\";\n System.out.println(\"MPAINEI STOUS MH PROXORIMENOUS \"+assignments[data.numInstances()-1]) ; \n }\n \n coursequizs lev = new coursequizs();\n lev.studentLevel(studentsLvl,quizAns);\n \n System.out.println(Arrays.toString(assignments));\n return \"home.jsf\";\n\t\t}", "private void doClustering(double[][] data, String[] names) {\n\t\ttry {\n\t\t\tClusteringAlgorithm algorithm = new DefaultClusteringAlgorithm();\n\t\t\tCluster cluster = algorithm.performClustering(data, names, new AverageLinkageStrategy());\n\t\t\tparentCluster = cluster;\n\t\t\tfillClusteredOrderedDataFromChildren(cluster);\n\t\t}catch(Exception e){\n\t\t\tJOptionPane.showMessageDialog(null, \"Duplicate identifiers found, the feature names should be unique\", \"Clustering error\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t}", "public void updateClusteringPanel(SomClusteringResult result, boolean clusterColumn) {\r\n SelectionManager.Busy_Task(true, true);\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, clusterColumn, rightPanelWidth, leftPanelHeight - 2);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n SelectionManager.Busy_Task(false, true);\r\n\r\n }", "private void createClusterForAks(ProvisionRequest provisionRequest, String processID) {\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tprovisionRequest.setKubeMonitoring(\"Grafana\");\n\t\t}\n\t\tstartCreateClusterTaskForAks(provisionRequest);\n\t}", "public ArrayList<ArrayList<double[]>> getClusterSet(){\n\t\treturn clusterSet;\n\t}", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "public ReducaoPCA(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n this.parent = (App) parent;\n this.setLocation(parent.getLocation());\n this.ch = new Chart(this.redChart.getWidth(), this.redChart.getHeight(),\n \"PCA - Espalhamento\", \"Eixo X\", \"Eixo Y\", Chart.CHART_SCATTER, false);\n Utils.addPlot(this.redChart, ch);\n this.ds = this.parent.getDsManipulavel().clonar();\n for (int i = 0; i < this.ds.getNumClass(); i++)\n this.ch.addXYSerie(\"Classe \"+(i+1));\n this.knn = this.parent.getKnn();\n this.pca = new PrincipalComponentAnalysis();\n }", "public static void main(String[] args) throws Exception{\n\t\t\n\t\tSystem.out.println(\"Clustering started\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tArrayList<SyntacticCluster> clusters = (ArrayList<SyntacticCluster>) MinerUtil\n\t\t\t\t.deserialize(\"all_cluster\", false);\n\t\t//ArrayList<SyntacticCluster> allList = allCluster.doClustering();\n\n\t\tArrayList<SemanticCluster> semanticClusterList = new SemanticClusteringer().doClustering(clusters);\n\t\tfor (SemanticCluster semC : semanticClusterList) {\n\t\t\tfor (ICluster clus : semC.getUnits()) {\n\t\t\t\tSyntacticCluster synC = (SyntacticCluster) clus;\n\t\t\t\tsynC.doInnerClustering();\n\t\t\t\t// System.out.print(\"\");\n\t\t\t}\n\t\t\t// System.out.print(\"\");\n\t\t}\n\t\tSystem.out.println(\"Clustering finished\");\n\t\tLogger.log2(semanticClusterList, \"syntactic_semantic_clustering\");\n\t\t\n\t\tCloneSets sets = semanticClusterList.get(0).getUnits().get(0).getCloneSets().get(0).getCloneSets();\n\t\t\n\t\tMinerUtil.serialize(semanticClusterList, \"semantic_clusters\", false);\n\t\tMinerUtil.serialize(sets, \"sets\", false);\n\t\t//ConsoleFormatter.displayClusters(clustersByTopic);\n\t}", "public void showMoreClusters() {\n\t\tfor (ETNACluster cluster : ontologyInstance.getHiddenClusters()) {\n\t\t\tif (!ontologyInstance.getClustersToShowInView().contains(cluster))\n\t\t\t\tontologyInstance.getClustersToShowInView().add(cluster.clone());\n\t\t}\n\t\tthis.clustersShowFlag = false;\n\t\tthis.activeTabIndex = \"-1\";\n\n\t}", "public static void main(String[] args){\n FileClass.readInputFile(\"robots.mat\");\n\n FileClass fileClass = new FileClass();\n\n ArrayList<ArrayList<Point>> robotsList = fileClass.allRobots;\n\n for (ArrayList<Point> robots : robotsList) {\n robots.get(0).isAwake = true;\n }\n\n ArrayList<ArrayList<Point>> inputPoints = fileClass.allInput;\n ArrayList<ArrayList<Point[]>> obstaclesList = fileClass.allObstacles;\n\n ArrayList<String> lines = new ArrayList<String>();\n\n\n for(int i = 0; i < inputPoints.size(); i++){\n MAT mat = new MAT();\n\n ArrayList<Point> pointsList = inputPoints.get(i);\n Point[] points = pointsList.toArray(new Point[pointsList.size()]);\n\n mat.setAllVisible(points, obstaclesList.get(i));\n\n int robots = robotsList.get(i).size();\n\n mat.initialiseTable(points.length);\n mat.genFloydTable1(points);\n mat.genFloydTable2(points);\n mat.meanDistanceRobots(points, robots);\n\n KMeans kmeans = new KMeans();\n kmeans.doKMeans(NUM_CLUSTERS, robots, robotsList.get(i));\n ArrayList<Point> clusteredPoints = kmeans.getPoints();\n// for (Point p : robotsList.get(i)) System.out.println(p);\n// for (Point p : clusteredPoints) {\n// System.out.println(p + \" belongs to cluster \" + p.getCluster());\n// }\n Point[] robotClusteredPoints = new Point[clusteredPoints.size()];\n int index = 0;\n for (Point p : clusteredPoints) points[index++].setCluster(p.getCluster());\n// for (Point p : clusteredPoints) robotClusteredPoints[index++] = p;\n ArrayList<Cluster> clusters = kmeans.clusters;\n\n String sol = (i+1) + \": \";\n\n sol += mat.buildPathScheduleKMeans(points, robots, clusters.size(), clusters);\n\n lines.add(sol);\n\n if(i==29) break;\n }\n\n FileClass.writeOutputFile(lines, \"output.txt\");\n\n\n //write solution to file\n //FileClass.writeOutputFile(inputPoints, \"out.txt\");\n /*\n\n Point[] points = new Point[2];\n points[0] = new Point(-1.0, -1.0, true);\n points[1] = new Point(4.0, 4.0,true);\n\n Point[] points2 = new Point[5];\n points2[0] = new Point(0.0,1.0, true);\n points2[1] = new Point(2.0,0.0, true);\n points2[2] = new Point(3.0,5.0, true);\n points2[3] = new Point(6.0,2.0, true);\n points2[4] = new Point(9.0,0.0, true);\n\n Point[] obstacles1 = new Point[14];\n obstacles1[0] = new Point(1.0, 6.0);\n obstacles1[1] = new Point(1.0, 1.0);\n obstacles1[2] = new Point(5.0, 1.0);\n obstacles1[3] = new Point(5.0, 5.0);\n obstacles1[4] = new Point(3.0, 5.0);\n obstacles1[5] = new Point(3.0, 3.0);\n obstacles1[6] = new Point(4.0, 3.0);\n obstacles1[7] = new Point(4.0, 2.0);\n obstacles1[8] = new Point(2.0, 2.0);\n obstacles1[9] = new Point(2.0, 6.0);\n obstacles1[10] = new Point(6.0, 6.0);\n obstacles1[11] = new Point(6.0, 0.0);\n obstacles1[12] = new Point(0.0, 0.0);\n obstacles1[13] = new Point(0.0, 6.0);\n\n\n Point[] obstacles2 = new Point[4];\n obstacles2[0] = new Point(8.0, 1.0);\n obstacles2[1] = new Point(4.0, 1.0);\n obstacles2[2] = new Point(4.0, 4.0);\n obstacles2[3] = new Point(5.0, 2.0);\n\n Point[] obstacles3 = new Point[4];\n obstacles3[0] = new Point(1.0, 2.0);\n obstacles3[1] = new Point(1.0, 4.0);\n obstacles3[2] = new Point(3.0, 4.0);\n obstacles3[3] = new Point(3.0, 2.0);\n\n ArrayList<Point[]> obstacles = new ArrayList<Point[]>();\n ArrayList<Point[]> anotherObstacles = new ArrayList<Point[]>();\n obstacles.add(obstacles1);\n anotherObstacles.add(obstacles2);\n anotherObstacles.add(obstacles3);*/\n/*\n MAT alg = new MAT();\n//\n Point[] all_points = new Point[16];\n int index = 0;\n for (Point point : points) {\n all_points[index++] = point;\n }\n for (Point[] obstacle : obstacles) {\n for (Point p : obstacle) {\n all_points[index++] = p;\n }\n }\n\n\n alg.setAllVisible(all_points, obstacles);\n\n for (Point p : all_points) {\n System.out.println(\"*** Visible from point \" + p.toString() + \"***\");\n ArrayList<Point> visible = p.visible;\n for (Point point : visible) {\n System.out.println(point.toString() + \", \");\n }\n }\n\n alg.initialiseTable(16);\n alg.genFloydTable1(all_points);\n alg.genFloydTable2(all_points);\n\n// alg.print_table(all_points);\n alg.visitAll(all_points, 2);*/\n/*\n System.out.println(\"\");\n System.out.println(\"***** QUESTION 3 *****\");\n MAT alg2 = new MAT();\n Point[] all_points2 = new Point[13];\n int index2 = 0;\n for (Point point : points2) {\n all_points2[index2++] = point;\n }\n for (Point[] obstacle : anotherObstacles) {\n for (Point p : obstacle) {\n all_points2[index2++] = p;\n }\n }\n\n alg2.setAllVisible(all_points2, anotherObstacles);\n\n for (Point p : all_points2) {\n System.out.println(\"*** Visible from point \" + p.toString() + \"***\");\n ArrayList<Point> visible = p.visible;\n for (Point point : visible) {\n System.out.print(point.toString() + \", \");\n }\n System.out.println(\"\");\n }\n\n alg2.initialiseTable(13);\n alg2.genFloydTable1(all_points2);\n alg2.genFloydTable2(all_points2);\n\n// alg.print_table(all_points);\n alg2.visitAll(all_points2, 5);*/\n }", "private void clusteredLayout(JFrame jf) {\n\t\tJFrame jf2 = jf;\n\n\t\tjf2.setTitle(\"Clustered Aggregate FRLayout\");\n\t\tjf2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\n\t\t//specify the Fruchterman-Rheingold layout algorithm\n\t\tfinal AggregateLayout<Number,Number> layout2 = \n\t\t\t\tnew AggregateLayout<Number,Number>(new FRLayout<Number,Number>(this.g));\n\t\tVisualizationViewer<Number, Number> vv2 = new VisualizationViewer<Number,Number>(layout2);\n\t\tvv2.setBackground( Color.white );\n\t\t//Tell the renderer to use our own customized color rendering\n\n\t\tvv2.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());\n\t\tvv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);\n\n\t\tvv2.getRenderContext().setVertexFillPaintTransformer(vertexPaints);\n\t\tvv2.getRenderContext().setVertexDrawPaintTransformer(new Function<Number,Paint>() {\n\t\t\tpublic Paint apply(Number v) {\n\t\t\t\tif(vv2.getPickedVertexState().isPicked(v)) {\n\t\t\t\t\treturn Color.cyan;\n\t\t\t\t} else {\n\t\t\t\t\treturn Color.BLACK;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tvv2.getRenderContext().setEdgeDrawPaintTransformer(edgePaints);\n\n\t\tvv2.getRenderContext().setEdgeStrokeTransformer(new Function<Number,Stroke>() {\n\t\t\tprotected final Stroke THIN = new BasicStroke(1);\n\t\t\tprotected final Stroke THICK= new BasicStroke(2);\n\t\t\tpublic Stroke apply(Number e)\n\t\t\t{\n\t\t\t\tPaint c = edgePaints.getUnchecked(e);\n\t\t\t\tif (c == Color.LIGHT_GRAY)\n\t\t\t\t\treturn THIN;\n\t\t\t\telse \n\t\t\t\t\treturn THICK;\n\t\t\t}\n\t\t});\n\t\tDefaultModalGraphMouse<Number, Number> gm = new DefaultModalGraphMouse<Number, Number>();\n\t\tvv2.setGraphMouse(gm);\n\t\tContainer content = jf2.getContentPane();\n\t\tcontent.add(new GraphZoomScrollPane(vv2));\n\t\tJPanel south = new JPanel();\n\t\tJPanel grid = new JPanel(new GridLayout(2,1));\n\n\t\tsouth.add(grid);\n\n\t\tJPanel p = new JPanel();\n\t\tp.setBorder(BorderFactory.createTitledBorder(\"Mouse Mode\"));\n\t\tp.add(gm.getModeComboBox());\n\t\tsouth.add(p);\n\t\tcontent.add(south, BorderLayout.SOUTH);\n\t\tjf2.pack();\n\t\tjf2.setVisible(true);\n\n\t}", "public SME_Cluster[] getClusters();", "public static void main(String[] args) {\n\t\t\n\t\tInteger k = 5;\n\t\t\n\t\tProcess model = new Process();\n\t\ttry {\n\t\t\tmodel.loadData(\"./datas/UserVector.txt\");\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\tEntry<Integer[], Double> ret = model.cluster(k);\n\t\tInteger[] ret_label = ret.getKey();\n\t\tInteger[] cnt = new Integer[31];\n\t\tfor(Integer i=0; i<=30; ++i)cnt[i] = 0;\n\t\tfor(Integer i=0; i<30; ++i)\n\t\t{\n\t\t\tcnt[ ret_label[i] ] ++;\n\t\t\tSystem.out.print((i+1) + \":\" + ret_label[i] + \" \");\n\t\t\tif(i%5==4)System.out.println();\n\t\t}\n\t\tfor(Integer i=0; i<k; ++i)System.out.println(i + \":\" + cnt[i]);\n\t}", "public void createCSVFromClusteringResult(final String outputPath, final Map<Double, List<Instance>> data)\n throws IOException {\n if (!data.isEmpty()) {\n final File file = new File(outputPath + \"/hierarchResults.csv\");\n\n // Creates the csv file.\n file.createNewFile();\n final BufferedWriter writer = Files.newBufferedWriter(file.toPath(), StandardOpenOption.CREATE);\n writer.append(\"# of cluster\");\n writer.append(',');\n writer.append(String.valueOf(data.size()));\n writer.append('\\n');\n\n // Write names of attributes to the file.\n final Enumeration attributeNames = data.entrySet().iterator().next().getValue().get(0)\n .enumerateAttributes();\n String attrNameString = \"\";\n while (attributeNames.hasMoreElements()) {\n String attrName = attributeNames.nextElement().toString();\n attrName = attrName.replace(\"@attribute '><\", \"\");\n attrName = attrName.replace(\"' numeric\", \"\");\n attrNameString += attrName;\n attrNameString += \", \";\n }\n writer.append(attrNameString);\n writer.append('\\n');\n\n // Write the different clusters and their assigned instances to the file.\n writer.append(\"ClusterID\");\n writer.append(',');\n writer.append(\"# of instances\");\n writer.append(',');\n writer.append(\"Assigned instances\");\n writer.append('\\n');\n for (final Entry<Double, List<Instance>> entry : data.entrySet()) {\n // Write cluster\n writer.append(String.valueOf(entry.getKey().intValue()));\n writer.append(',');\n // Write number of instances in this cluster\n writer.append(String.valueOf(entry.getValue().size()));\n writer.append(',');\n // Write list of instances which are assigned to this cluster.\n writer.append(\"[\");\n for (final Instance instance : entry.getValue()) {\n writer.append(\"[\");\n writer.append(String.valueOf(instance));\n writer.append(\"],\");\n }\n writer.append(\"]\");\n writer.append('\\n');\n }\n\n writer.flush();\n writer.close();\n }\n }", "protected void addClusterInfo(DefaultMutableTreeNode root) {\r\n DefaultMutableTreeNode node = new DefaultMutableTreeNode(\"Cluster Information\");\r\n node.add(new DefaultMutableTreeNode(new LeafInfo(\"Results (#,%)\", new GLOBANCInfoViewer(this.geneLists, this.geneListNames, this.resultMatrix, this.experiment.getNumberOfGenes(), this.dataDesign, this.numGroups))));\r\n root.add(node);\r\n }", "public void writeClusterMatrix(String filename, int[][] matrix) {\n\n\t try {\n\t FileWriter writer = new FileWriter(filename, true);\n\t for (int i = 0; i < matrix.length; i++) {\n\t for (int j = 0; j < matrix[i].length; j++) {\t \t\n\t writer.write(matrix[i][j] + \"\\t\");\n\t }\n\t //this is the code that you change, this will make a new line between each y value in the array\n\t writer.write(\"\\n\"); // write new line\n\t }\n\t writer.close();\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t }\n\n\t}", "public void connectClusters()\n\t{\n//\t\tfor(int i = 0; i<edges.size();i++)\n//\t\t{\n//\t\t\tEdgeElement edge = edges.get(i);\n//\t\t\tString fromNodeID = edge.fromNodeID;\n//\t\t\tNodeElement fromNode = findSubNode(fromNodeID);\n//\t\t\tString toNodeID = edge.toNodeID;\n//\t\t\tNodeElement toNode = findSubNode(toNodeID); \n//\t\t\t\n//\t\t\tif(fromNode != null && toNode != null)\n//\t\t\t{\n//\t\t\t\tPortInfo oport = new PortInfo(edge, fromNode);\n//\t\t\t\tfromNode.addOutgoingPort(oport);\n//\t\t\t\tedge.addIncomingPort(oport);\n//\t\t\t\tPortInfo iport = new PortInfo(edge, toNode);\n//\t\t\t\ttoNode.addIncomingPort(iport);\n//\t\t\t\tedge.addOutgoingPort(iport);\n//\t\t\t}\n//\t\t}\n\t}", "static double[][] powerIterationPCA(int numComponents, double[][] matrix) {\n double[][] out = new double[numComponents][];\n double[][] E = ArrayMatrix.copy(matrix);\n\n for (int i = 0; i < numComponents; i++) {\n double eigenOld = 0;\n double eigenNew = 0;\n double[] p = new double[matrix[0].length];\n double[] t = new double[matrix[0].length];\n double[][] tMatrix = {t};\n double[][] pMatrix = {p};\n System.arraycopy(matrix[i], 0, t, 0, t.length);\n\n do {\n eigenOld = eigenNew;\n double tMult = 1 / ArrayMatrix.dot(t, t);\n tMatrix[0] = t;\n p = ArrayMatrix.scale(ArrayMatrix.multiply(ArrayMatrix.transpose(E), tMatrix), tMult)[0];\n p = ArrayMatrix.normalize(p);\n double pMult = 1 / ArrayMatrix.dot(p, p);\n pMatrix[0] = p;\n t = ArrayMatrix.scale(ArrayMatrix.multiply(E, pMatrix), pMult)[0];\n eigenNew = ArrayMatrix.dot(t, t);\n } while (Math.abs(eigenOld - eigenNew) > THRESHOLD);\n\n tMatrix[0] = t;\n pMatrix[0] = p;\n E = ArrayMatrix.subtract(E, ArrayMatrix.multiply(tMatrix, ArrayMatrix.transpose(pMatrix)));\n\n out[i] = t;\n }\n return out;\n }", "public static void Agrupar() {\n\t\tArrayList<ArrayList<Double>> distancias_centroids = new ArrayList<ArrayList<Double>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Double> distancias= new ArrayList<Double>();\n\t\t\tfor (int j=0;j<petalas.size();j++) {\n\t\t\t\tdouble x1= centroids.get(i).petal_length;\n\t\t\t\tdouble x2= petalas.get(j).petal_length;\n\t\t\t\tdouble y1= centroids.get(i).petal_width;\n\t\t\t\tdouble y2= petalas.get(j).petal_width;\n\t\t\t\tdouble cateto1= x1-x2;\n\t\t\t\tdouble cateto2= y1-y2;\n\t\t\t\tdouble hipotenusa = Math.sqrt(cateto1*cateto1+cateto2*cateto2);\n\t\t\t\tdistancias.add(hipotenusa);\n\t\t\t\t/*\n\t\t\t\tSystem.out.println(\"cateto1: \"+cateto1);\n\t\t\t\tSystem.out.println(\"cateto2: \"+cateto2);\n\t\t\t\tSystem.out.println(\"hipotenusa: \"+hipotenusa);\n\t\t\t\t*/\n\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\tdistancias_centroids.add(distancias);\t\t\t\n\t\t}\n\t\t/*\n\t\tSystem.out.println(\"Distancias Centroids:\");\n\t\tfor (int i=0;i<distancias_centroids.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tfor (int j=0;j<distancias_centroids.get(i).size();j++) {\n\t\t\t\tSystem.out.println(distancias_centroids.get(i).get(j));\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t//Para qual centroid pertece cada ponto\n\t\tArrayList<ArrayList<Petala>> pontos_de_cada_centroid = new ArrayList<ArrayList<Petala>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Petala> p = new ArrayList<Petala>();\n\t\t\tpontos_de_cada_centroid.add(p); \n\t\t}\n\t\tfor (int i=0;i<petalas.size();i++) {\n\t\t\tdouble menor =100;\n\t\t\tint centroid_menor=0;\n\t\t\tfor (int j=0;j<centroids.size();j++) {\n\t\t\t\tif (distancias_centroids.get(j).get(i)<menor) {\n\t\t\t\t\tmenor = distancias_centroids.get(j).get(i);\n\t\t\t\t\tcentroid_menor=j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpontos_de_cada_centroid.get(centroid_menor).add(petalas.get(i));\n\t\t}\n\t\t/*\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tSystem.out.println(\"Petalas: \");\n\t\t\tSystem.out.println(pontos_de_cada_centroid.get(i));\n\t\t}\n\t\t*/\n\t\t//Novos centroids\n\t\tArrayList<Petala> novos_centroids = new ArrayList<Petala>();\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tdouble soma_x=0;\n\t\t\tdouble soma_y=0;\n\t\t\tfor (int j=0;j<pontos_de_cada_centroid.get(i).size();j++) {\n\t\t\t\tsoma_x+=pontos_de_cada_centroid.get(i).get(j).petal_length;\n\t\t\t\tsoma_y+=pontos_de_cada_centroid.get(i).get(j).petal_width;\n\t\t\t}\n\t\t\tdouble novo_x=soma_x/pontos_de_cada_centroid.get(i).size();\n\t\t\tdouble novo_y=soma_y/pontos_de_cada_centroid.get(i).size();\n\t\t\tPetala novo_centroid = new Petala(novo_x,novo_y);\n\t\t\tnovos_centroids.add(novo_centroid);\n \t\t}\n\t\t\n\t\t//Gravar Geracao\n\t\tArrayList<Petala> gc= new ArrayList<Petala>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tgc.add(centroids.get(i));\n\t\t}\n\t\tGeracao geracao = new Geracao(gc,pontos_de_cada_centroid);\n\t\tgeracoes.add(geracao);\n\t\t//Condicao de Parada\n\t\tboolean terminou = true;\n\t\tfor (int i=0; i<centroids.size();i++) {\n\t\t\tif (centroids.get(i).petal_length!=novos_centroids.get(i).petal_length) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (centroids.get(i).petal_width!=novos_centroids.get(i).petal_width) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (terminou) {\n\t\t\t/*\n\t\t\tSystem.out.println(\"Novos centroids:\");\n\t\t\tSystem.out.println(novos_centroids);\n\t\t\t\n\t\t\tSystem.out.println(\"FIM!\");\n\t\t*/\n\t\t}else {\n\t\t\tcentroids.clear();\n\t\t\tfor (int i=0;i<novos_centroids.size();i++) {\n\t\t\t\tcentroids.add(novos_centroids.get(i));\n\t\t\t}\n\t\tgeracao_atual++;\n\t\t\tAgrupar();\n\t\t}\n\t}", "public Clusters()\r\n\t{\r\n\t\tcluster = new boolean[MAX_CLUSTERS];\r\n\t}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n double p = sc.nextDouble();\n int M = sc.nextInt();\n\n // repeatedly created N-by-N matrices and display them using standard draw\n for (int i = 0; i < M; i++) {\n boolean[][] open = Percolation.random(N, p);\n StdDraw.clear();\n StdDraw.setPenColor(StdDraw.BLACK);\n Percolation.show(open, false);\n StdDraw.setPenColor(StdDraw.BOOK_BLUE);\n boolean[][] full = Percolation.flow(open);\n Percolation.show(full, true);\n StdDraw.show(1000);\n }\n }", "public PCA(){\n super.trunc = 4;\n }", "Point(int dimensionPass, int clusters){\n\tthis.dimension = dimensionPass;\n\tthis.data = new double[dimension];\n\tthis.clusterDist = new double[clusters];\n\t\n}", "@Override\n final public void computeTransform()\n {\n // PCA\n IDoubleArray Cov = moments.getCov();\n IEigenvalueDecomposition evd = alg.evd(Cov);\n IDoubleArray evalPCA = evd.getEvalNorm();\n IDoubleArray evecPCA = evd.getRightEigenvectorMatrix().viewReal();\n \n // normalize principal components\n IDoubleArray S = doublesNew.array(evalPCA.size());\n for (int i=0; i<S.size(); i++)\n S.set(i, 1.0*Math.sqrt(evalPCA.get(i)));\n // normalize weights by dividing by the standard deviation of the pcs \n IDoubleArray evecPCAscaled = alg.product(evecPCA, doublesNew.diag(S));\n\n // time-lagged covariance matrix\n this.CovTauSym = moments.getCovLagged();\n // symmetrize\n CovTauSym = alg.addWeightedToNew(0.5, CovTauSym, 0.5, alg.transposeToNew(CovTauSym)); // symmetrize\n\n // TICA weights\n IDoubleArray pcCovTau = alg.product(alg.product(alg.transposeToNew(evecPCAscaled), CovTauSym), evecPCAscaled);\n\n IEigenvalueDecomposition evd2 = alg.evd(pcCovTau);\n this.evalTICA = evd2.getEvalNorm();\n this.evecTICA = alg.product(evecPCAscaled, evd2.getRightEigenvectorMatrix().viewReal()); \n }", "public KMeansPerformanceClustererDialog(OrganizationalLogs orgLogs) {\n\n\t\tHashMap<Integer, SimpleKMeans> map = (HashMap<Integer, SimpleKMeans>) orgLogs.clusterings;\n\t\tDouble[][] arr = new Double[map.size()][2];\n\t\tSet entries = map.entrySet();\n\t\tIterator entriesIterator = entries.iterator();\n\n\t\tint i = 0;\n\t\twhile (entriesIterator.hasNext()) {\n\n\t\t\tEntry<Integer, SimpleKMeans> mapping = (Entry<Integer, SimpleKMeans>) entriesIterator.next();\n\n\t\t\tarr[i][0] = new Double(mapping.getKey());\n\t\t\tarr[i][1] = mapping.getValue().getSquaredError();\n\n\t\t\ti++;\n\t\t}\n\n\t\tsetLayout(new GridLayout(1, 0, 0, 0));\n\n\t\t{\n\n\t\t\tSlickerTabbedPane tabbedPane = SlickerFactory.instance().createTabbedPane(\"\", WidgetColors.COLOR_LIST_BG,\n\t\t\t\t\tWidgetColors.COLOR_LIST_FG, Color.GREEN);\n\n\t\t\tadd(tabbedPane);\n\n\t\t\t{\n\t\t\t\tProMHeaderPanel panel_1 = new ProMHeaderPanel(\"\");\n\t\t\t\tfinal XYDataset dataset = createDataset(arr);\n\t\t\t\tfinal JFreeChart chart = createChart(dataset);\n\n\t\t\t\tfinal ChartPanel chartPanel = new ChartPanel(chart);\n\t\t\t\tpanel_1.add(chartPanel);\n\n\t\t\t\tProMTextField txtpnInfoOnSelecting = new ProMTextField();\n\t\t\t\ttxtpnInfoOnSelecting\n\t\t\t\t\t\t.setText(\"Please select number of clusters (k) based on the SSE information provided above:\");\n\t\t\t\ttxtpnInfoOnSelecting.setEditable(false);\n\n\t\t\t\tInteger[] comboItems = new Integer[orgLogs.logs.size()];\n\n\t\t\t\tfor (int i1 = 0; i1 < orgLogs.logs.size(); i1++) {\n\t\t\t\t\tcomboItems[i1] = i1 + 1;\n\t\t\t\t}\n\t\t\t\tfinal ProMComboBox<Integer> comboBox = new ProMComboBox<Integer>(comboItems);\n\t\t\t\tcomboBox.addActionListener(new ActionListener() {\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tInteger selected = (Integer) comboBox.getSelectedItem();\n\t\t\t\t\t\tsetSelectedNumberOfCluster(selected);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tpanel_1.add(txtpnInfoOnSelecting);\n\t\t\t\tpanel_1.add(comboBox);\n\t\t\t\ttabbedPane.addTab(\"Chart Data\", panel_1);\n\t\t\t}\n\n\t\t\t{\n\n\t\t\t\tProMHeaderPanel scrollPane = new ProMHeaderPanel(\"\");\n\n\t\t\t\ttabbedPane.addTab(\"Table Data\", scrollPane);\n\n\t\t\t\tDefaultTableModel tbModel = new DefaultTableModel(arr, new String[] { \"Number of Clusters\",\n\t\t\t\t\t\t\"Sum of Squared Error (SSE)\" });\n\t\t\t\tProMTable table = new ProMTable(tbModel);\n\t\t\t\tscrollPane.add(table);\n\t\t\t}\n\n\t\t}\n\n\t}", "public void addCluster()\r\n\t{\r\n\t\tcluster[nextAvailableCluster()] = true;\r\n\t}", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "public static void main(String[] args) {\n //read the N set from a file\n In in = new In(args[0]);\n int N = in.readInt();\n //StdOut.println(\"N = \" + N);\n Point[] set = new Point[N];\n for (int i = 0; i < N; i++) {\n int x = in.readInt();\n int y = in.readInt();\n set[i] = new Point(x, y);\n } \n\n // draw the set\n StdDraw.show(0);\n StdDraw.setXscale(0, 32768);\n StdDraw.setYscale(0, 32768);\n //set[0].drawTo(set[1]);\n for (Point p : set) {\n p.draw();\n } \n\n // print and draw the line nSegments\n BruteCollinearPoints collinear = new BruteCollinearPoints(set);\n for (LineSegment segment : collinear.segments()) {\n StdOut.println(segment);\n segment.draw();\n } \n \n }", "private void initMleCluster() {\n\t\tpseudoTf = new double[documents.size()][];\n\t\tpseudoTermIndex = new int[documents.size()][];\n\t\tpseudoTermWeight = new double[documents.size()][];\n\t\t\n\t\tfor(int docIdx=0; docIdx<documents.size(); docIdx++) {\n\t\t\tcountOnePseudoDoc(docIdx);\n\t\t}\n\t}", "public CentroidViewer(Experiment experiment, int[][] clusters) {\r\n if (experiment == null) {\r\n throw new IllegalArgumentException(\"experiment == null\");\r\n }\r\n this.experiment = experiment;\r\n this.exptID = experiment.getId();\r\n this.clusters = clusters;\r\n setBackground(Color.white);\r\n setFont(new Font(\"monospaced\", Font.BOLD, 10));\r\n this.maxExperimentValue = experiment.getMaxAbsValue();\r\n this.yRangeOption = CentroidViewer.USE_EXPERIMENT_MAX;\r\n this.addMouseMotionListener(new GraphListener()); \r\n\r\n this.means = getMeans(clusters).A;\r\n this.variances = getVariances(clusters, getMeans(clusters)).A;\r\n \tPopupListener listener = new PopupListener();\r\n \tthis.popup = createJPopupMenu(listener);\r\n \tgetContentComponent().addMouseListener(listener);\r\n }", "public static void main(String[] args) {\r\n\r\n\t\ttry {\r\n\t\t\tfinal javax.swing.JFrame jf = new javax.swing.JFrame(\r\n\t\t\t\t\t\"Weka Explorer: Cluster\");\r\n\t\t\tjf.getContentPane().setLayout(new BorderLayout());\r\n\t\t\tfinal SubspaceClustererPanel sp = new SubspaceClustererPanel();\r\n\t\t\tjf.getContentPane().add(sp, BorderLayout.CENTER);\r\n\t\t\tweka.gui.LogPanel lp = new weka.gui.LogPanel();\r\n\t\t\tsp.setLog(lp);\r\n\t\t\tjf.getContentPane().add(lp, BorderLayout.SOUTH);\r\n\t\t\tjf.addWindowListener(new java.awt.event.WindowAdapter() {\r\n\t\t\t\tpublic void windowClosing(java.awt.event.WindowEvent e) {\r\n\t\t\t\t\tjf.dispose();\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tjf.pack();\r\n\t\t\tjf.setSize(800, 600);\r\n\t\t\tjf.setVisible(true);\r\n\t\t\tif (args.length == 1) {\r\n\t\t\t\tSystem.err.println(\"Loading instances from \" + args[0]);\r\n\t\t\t\tjava.io.Reader r = new java.io.BufferedReader(\r\n\t\t\t\t\t\tnew java.io.FileReader(args[0]));\r\n\t\t\t\tInstances i = new Instances(r);\r\n\t\t\t\tsp.setInstances(i);\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.err.println(ex.getMessage());\r\n\t\t}\r\n\t}", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "public void scatterNodes() {\n\t\tfor (int k = 0; k < nodes.length; k++) {\n\t\t\tNode got = nodes[k];\n\t\t\tif (!got.display) continue;\n\t\t\tscatterNode(got);\n\t\t}\n\t}", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "private static void clustering(String inputFile, String outputDir, double opticsXi, int opticsMinPoints) {\n \tLOG.info(\"Begin clustering of stay points.\");\n \t\n \tELKIClusterer.cluster(inputFile, outputDir,\topticsXi, opticsMinPoints);\n \t\n \tLOG.info(\"Finished clustering of stay points.\");\n }", "public void initClusters(){\n\t\tUnitRow unitRow = data.getUnitRow();\n\t\tUnit currentUnit = null;\n\t\tLeaf leaf = null;\n\n\t\tfor (int i = 0; i < unitRow.getLength(); i++){\n\t\t\tcurrentUnit = unitRow.getUnit(i);\n\t\t\tleaf = new Leaf(currentUnit);\n\t\t\tclusters.add(leaf);\n\t\t}\n\t\tSystem.out.println(\"Clusters initialized.\");\n\t}", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "public void cluster(ArrayList<double[]> data){\n\t\t// set the dimension to make the cut in\n\t\tint dim = chooseDimension(data);\n\t\tif(dim != -1){\n\t\t\tArrayList<double[]> lhs = new ArrayList<double[]>();\n\t\t\tArrayList<double[]> rhs = new ArrayList<double[]>();\n\t\t\t\n\t\t\t// split the partition into two partitions(lhs and rhs) so the same amount of elements is in each partition\n\t\t\tCollections.sort(data, new Comparator<double[]>() {\n public int compare(double[] values, double[] otherValues) {\n return new Double(values[dim]).compareTo(new Double(otherValues[dim]));\n }});\n\t\t\t\n\t\t\tfor(int i = 0; i < data.size(); i++){\n\t\t\t\tif(i < data.size()/2){\n\t\t\t\t\tlhs.add(data.get(i));\n\t\t\t\t}else{\n\t\t\t\t\trhs.add(data.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t// use algorithm mondrian recursively for the new partitions\n\t\t\tmondrian(rhs);\n\t\t\tmondrian(lhs);\n\t\t}\n\t}", "void formCluster(Set<ControllerNode> nodes, String ipPrefix);", "public static void main(String[] args){\n\t\tString dataset = null; boolean headless = false; boolean colour = false;boolean emd = false; int k = 0;\r\n\t\tint width = 0, height = 0;\r\n\t\t// load the properties, a bit messy because it's the 7th and I should not be writing code this late into the project\r\n\t\ttry {\r\n\t\t\t// file reader variables\r\n\t\t\tFile file = new File(\"data/KMEANS.properties\");\r\n\t\t\tFileReader fileReader = new FileReader(file);\r\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\t\t\t\r\n\t\t\tString line;\t\r\n\t\t\tint lineCounter = 0;\r\n\t\t\t\r\n\t\t\t// the loop for reading in the lines\r\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\r\n\t\t\t\tif(lineCounter == 0){\r\n\t\t\t\t\tdataset = line;\r\n\t\t\t\t}else if(lineCounter == 1){\r\n\t\t\t\t\theadless = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 2){\r\n\t\t\t\t\tcolour = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 3){\r\n\t\t\t\t\temd = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 4){\r\n\t\t\t\t\tk = Integer.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 5){\r\n\t\t\t\t\t// width\r\n\t\t\t\t\twidth = Integer.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 6){\r\n\t\t\t\t\t// height\r\n\t\t\t\t\theight = Integer.valueOf(line);\r\n\t\t\t\t}\r\n\t\t\t\tlineCounter++;\r\n\t\t\t}\r\n\t\t\tfileReader.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tif(!headless){\r\n\t\t\ttry {\r\n\t\t\t\t// load k-means before starting\r\n\t\t\t\tkmeans = new KMeans(dataset,false,colour,emd,k,width,height);\r\n\t\t\t\tif(!kmeans.MNIST){\r\n\t\t\t\t\tKMeans.INPUT_WIDTH = width;\r\n\t\t\t\t\tKMeans.INPUT_HEIGHT = height;\r\n\t\t\t\t\tKMeans.TOTAL_WEIGHTS = (KMeans.INPUT_WIDTH*KMeans.INPUT_HEIGHT)*KMeans.TOTAL_COLOURS;\r\n\t\t\t\t}\r\n\t\t\t\tAppGameContainer app;\r\n\t\t\t\tapp = new AppGameContainer(new Visualiser(\"Crowd-sourced drawing clustering with neural computing.\"));\r\n\t\t\t\tapp.setDisplayMode(1024, 720, false);\r\n\t\t\t\tapp.setShowFPS(false);\r\n\t\t\t\tapp.setAlwaysRender(true);\r\n\t\t\t\tapp.start();\r\n\t\t\t}catch (SlickException ex){\r\n\t\t\t\tLogger.getLogger(Visualiser.class.getName()).log(Level.SEVERE, null, ex);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t// start k-means in headless mode\r\n\t\t\tkmeans = new KMeans(dataset,true,colour,emd,k,width,height);\r\n\t\t\tif(!kmeans.MNIST){\r\n\t\t\t\tKMeans.INPUT_WIDTH = width;\r\n\t\t\t\tKMeans.INPUT_HEIGHT = height;\r\n\t\t\t\tKMeans.TOTAL_WEIGHTS = (KMeans.INPUT_WIDTH*KMeans.INPUT_HEIGHT)*KMeans.TOTAL_COLOURS;\r\n\t\t\t}\r\n\t\t\twhile(true){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tkmeans.update();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void hideClusters() {\n\n\t\tfor (ETNACluster cl : ontologyInstance.getHiddenClusters()) {\n\t\t\tif (ontologyInstance.getClustersToShowInView().contains(cl))\n\t\t\t\tontologyInstance.getClustersToShowInView().remove(cl);\n\t\t}\n\t\tthis.clustersShowFlag = true;\n\t\tthis.activeTabIndex = \"-1\";\n\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tString [] paises = new String [8];\r\n\t\t\r\n\t\t/*paises[0]=\"España\";\r\n\t\tpaises[1]=\"Mexico\";\r\n\t\tpaises[2]=\"Colombia\";\r\n\t\tpaises[3]=\"Peru\";\r\n\t\tpaises[4]=\"Chile\";\r\n\t\tpaises[5]=\"Argentina\";\r\n\t\tpaises[6]=\"Ecuador\";\r\n\t\tpaises[7]=\"Venezuela\";*/\r\n\t\t\r\n\t\t//String [] paises = {\"España\", \"México\", \"Colombia\", \"Peru\", \"Chile\", \"Argentina\", \"Ecuador\", \"Venezuela\"};\r\n\t\t\r\n\t\t/*for (int i = 0; i<paises.length; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Pais \"+ (i+1) + \" \" + paises[i]);\r\n\t\t}*/\r\n\t\t\r\n\t\t//Recorremos con foreach\r\n\t\t\r\n\t\t/*for(String elemento:paises) {\r\n\t\t\t\r\n\t\t\telemento = JOptionPane.showInputDialog(\"Introduce un pais\");\t\t\t\t//Mostrara todos los valores almacenados en la matriz \r\n\t\t}*/\r\n\t\t\r\n\t\tfor (int i=0; i<paises.length;i++) {\r\n\t\t\t\r\n\t\t\tpaises[i] = JOptionPane.showInputDialog(\"Introduce el pais \" + (i+1));\r\n\t\t}\r\n\t\t\r\n\t\tfor (String elemento:paises) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(elemento);\r\n\t\t}\r\n\t\t\r\n\t\t//rellenamos matriz d numeros aleatorios\r\n\t\t\r\n\t\tint [] matriz_aleatorios = new int [150];\r\n\t\t\r\n\t\tfor (int i=0; i<matriz_aleatorios.length;i++) {\r\n\t\t\t\r\n\t\t\t/*Como Math.random es un doble transformamos a int, redondeamos y numero aleatorio*/\r\n\t\t\tmatriz_aleatorios[i] = (int) Math.round(Math.random()*100);\t\t\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tfor (int numeros: matriz_aleatorios) {\t\t\t//antes usabamos string pq recorriamos palabras, ahora usamos int\r\n\t\t\t\r\n\t\t\tSystem.out.print(numeros + \" \");\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n public JComponent getInfoPanel() {\n if (infoPanel != null) {\n return infoPanel;\n }\n infoPanel = new JPanel();\n infoPanel.setLayout(new BoxLayout(infoPanel, BoxLayout.Y_AXIS));\n \n infoPanel.setBackground(Browser.PANEL_BACKGROUND);\n c.gridx = 0;\n c.gridy = 0;\n c.insets = new Insets(3, 3, 0, 0);\n \n mainPanel.setBackground(Browser.PANEL_BACKGROUND);\n mainPanel.setBackground(Color.WHITE);\n \n final Set<Cluster> clusters =\n Tools.getConfigData().getClusters().getClusterSet();\n if (clusters != null) {\n final JPanel bPanel =\n new JPanel(new BorderLayout());\n bPanel.setMaximumSize(new Dimension(10000, 60));\n final JPanel markedPanel = new JPanel(\n new FlowLayout(FlowLayout.LEFT));\n markedPanel.setBackground(Browser.BUTTON_PANEL_BACKGROUND);\n /* start marked clusters */\n loadMarkedClustersBtn.setEnabled(false);\n markedPanel.add(loadMarkedClustersBtn);\n \n /* stop marked clusters */\n unloadMarkedClustersBtn.setEnabled(false);\n markedPanel.add(unloadMarkedClustersBtn);\n /* remove marked clusters */\n removeMarkedClustersBtn.setEnabled(false);\n markedPanel.add(removeMarkedClustersBtn);\n \n bPanel.add(markedPanel, BorderLayout.CENTER);\n /* actions menu */\n bPanel.add(getActionsButton(), BorderLayout.EAST);\n infoPanel.add(bPanel);\n for (final Cluster cluster : clusters) {\n addClusterBox(cluster);\n }\n /* quick cluster box. */\n addQuickClusterBox();\n \n /* start marked clusters action listener */\n loadMarkedClustersBtn.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(final ActionEvent e) {\n final Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n loadMarkedClusters(clusters);\n }\n });\n t.start();\n }\n });\n \n /* stop marked clusters action listener */\n unloadMarkedClustersBtn.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(final ActionEvent e) {\n final Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n unloadMarkedClusters(clusters);\n }\n });\n t.start();\n }\n });\n \n /* remove marked clusters action listener */\n removeMarkedClustersBtn.addActionListener(\n new ActionListener() {\n @Override\n public void actionPerformed(final ActionEvent e) {\n removeMarkedClusters();\n }\n });\n \n /* mark checkbox item listeners */\n for (final Cluster cluster : clusters) {\n addCheckboxListener(cluster);\n }\n }\n \n final JPanel mPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));\n mPanel.add(mainPanel);\n mPanel.setBackground(Color.WHITE);\n final JScrollPane clustersPane =\n new JScrollPane(\n mPanel,\n JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,\n JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n \n infoPanel.add(clustersPane);\n final Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n Tools.sleep(3000);\n if (Tools.getConfigData().getAutoHosts().isEmpty()\n && !Tools.getConfigData().getAutoClusters().isEmpty()) {\n Tools.invokeLater(new Runnable() {\n @Override\n public void run() {\n for (final Cluster cl : allLoadButtons.keySet()) {\n if (cl.getClusterTab() == null\n && Tools.getConfigData().getAutoClusters()\n .contains(cl.getName())) {\n allLoadButtons.get(cl).pressButton();\n }\n }\n }\n });\n }\n }\n });\n t.start();\n return infoPanel;\n }", "public Cluster[] getClusters () {\n if (clusters != null) {\n return clusters;\n }\n \n try {\n List sort = org.openide.util.Utilities.topologicalSort (allPages.keySet (), deps);\n \n // ok, no cycles in between pages\n clusters = new Cluster[sort.size ()];\n for (int i = 0; i < clusters.length; i++) {\n clusters[i] = new Cluster (Collections.singleton (findPage ((String)sort.get (i))));\n }\n } catch (org.openide.util.TopologicalSortException ex) {\n // ok, there are cycles\n \n Set[] sets = ex.topologicalSets();\n clusters = new Cluster[sets.length];\n for (int i = 0; i < clusters.length; i++) {\n Set s = new TreeSet ();\n Iterator it = sets[i].iterator();\n while (it.hasNext ()) {\n String name = (String)it.next ();\n Page p = findPage (name);\n if (p != null) {\n s.add (p);\n }\n }\n clusters[i] = new Cluster (s);\n }\n }\n \n // references <Page -> Cluster>\n refs = new HashMap ();\n for (int i = 0; i < clusters.length; i++) {\n java.util.Iterator it = clusters[i].getPages ().iterator ();\n while (it.hasNext()) {\n Page p = (Page)it.next ();\n refs.put (p, clusters[i]);\n }\n }\n \n for (int i = 0; i < clusters.length; i++) {\n Set references = new HashSet ();\n java.util.Iterator it = clusters[i].getPages ().iterator ();\n while (it.hasNext()) {\n Page contained = (Page)it.next ();\n Collection c = (Collection)deps.get (contained.getFileName());\n if (c != null) {\n Iterator d = c.iterator();\n while (d.hasNext()) {\n String pageName = (String)d.next ();\n references.add (refs.get (findPage (pageName)));\n }\n }\n }\n // prevent self references\n references.remove (clusters[i]);\n clusters[i].references = (Cluster[])references.toArray (new Cluster[0]);\n }\n \n return clusters;\n }", "DescribeClustersResult describeClusters(DescribeClustersRequest describeClustersRequest);", "@Override\n\tpublic String getName() {\n\t\treturn \"Cluster View\";\n\t}", "public static void extractKCoreAndConnectedComponent(double threshold) throws IOException, ParseException, Exception {\n String[] prefixYesNo = {\"yes\", \"no\"};\n for (String prefix : prefixYesNo) {\n\n // Get the number of clusters\n int c = getNumberClusters(RESOURCES_LOCATION + prefix + \"_graph.txt\");\n\n // Get the number of nodes inside each cluster\n List<Integer> numberNodes = getNumberNodes(RESOURCES_LOCATION + prefix + \"_graph.txt\", c);\n\n PrintWriter pw_cc = new PrintWriter(new FileWriter(RESOURCES_LOCATION + prefix + \"_largestcc.txt\")); //open the file where the largest connected component will be written to\n PrintWriter pw_kcore = new PrintWriter(new FileWriter(RESOURCES_LOCATION + prefix + \"_kcore.txt\")); //open the file where the kcore will be written to\n\n // create the array of graphs\n WeightedUndirectedGraph[] gArray = new WeightedUndirectedGraph[c];\n for (int i = 0; i < c; i++) {\n System.out.println();\n System.out.println(\"Cluster \" + i);\n\n gArray[i] = new WeightedUndirectedGraph(numberNodes.get(i) + 1);\n\n // Put the nodes,\n NodesMapper<String> mapper = new NodesMapper<String>();\n gArray[i] = addNodesGraph(gArray[i], i, RESOURCES_LOCATION + prefix + \"_graph.txt\", mapper);\n\n //normalize the weights\n gArray[i] = normalizeGraph(gArray[i]);\n\n AtomicDouble[] info = GraphInfo.getGraphInfo(gArray[i], 1);\n System.out.println(\"Nodes:\" + info[0]);\n System.out.println(\"Edges:\" + info[1]);\n System.out.println(\"Density:\" + info[2]);\n\n // extract remove the edges with w<t\n gArray[i] = SubGraphByEdgesWeight.extract(gArray[i], threshold, 1);\n\n // get the largest CC and save to a file\n WeightedUndirectedGraph largestCC = getLargestCC(gArray[i]);\n saveGraphToFile(pw_cc, mapper, largestCC.in, i);\n\n // Get the inner core and save to a file\n WeightedUndirectedGraph kcore = kcore(gArray[i]);\n saveGraphToFile(pw_kcore, mapper, kcore.in, i);\n }\n\n pw_cc.close();\n pw_kcore.close();\n }\n }", "private void setUpClusterer() {\n mClusterManager = new ClusterManager<Company>(getActivity(), mMap);\n\n mClusterManager.setRenderer(new DefaultClusterRenderer<Company>(getActivity(), mMap, mClusterManager) {\n @Override\n protected void onBeforeClusterItemRendered(Company company, MarkerOptions markerOptions) {\n markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.hunting_target));\n // centering marker\n markerOptions.anchor(0.5f, 0.5f);\n }\n\n @Override\n protected void onBeforeClusterRendered(Cluster<Company> cluster, MarkerOptions markerOptions) {\n super.onBeforeClusterRendered(cluster, markerOptions);\n// markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.hunting_target));\n }\n\n @Override\n protected boolean shouldRenderAsCluster(Cluster cluster) {\n // Always render clusters.\n return cluster.getSize() > 1;\n }\n });\n\n mClusterManager.setOnClusterItemClickListener(new ClusterManager.OnClusterItemClickListener<Company>() {\n @Override\n public boolean onClusterItemClick(Company item) {\n openInfoWindow(item);\n return false;\n }\n });\n\n mClusterManager.setOnClusterClickListener(new ClusterManager.OnClusterClickListener<Company>() {\n @Override\n public boolean onClusterClick(Cluster<Company> cluster) {\n // Zoom in the cluster. Need to create LatLngBounds and including all the cluster items\n // inside of bounds, then animate to center of the bounds.\n\n // Create the builder to collect all essential cluster items for the bounds.\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 200));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }\n });\n\n // Point the map's listeners at the listeners implemented by the cluster manager.\n mMap.setOnCameraIdleListener(mClusterManager);\n mMap.setOnMarkerClickListener(mClusterManager);\n }", "public HashMap<Vertex, TreeMap<Vertex, Cooccurrence>> createCooccurenceMatrix() {\n\t\tif (_vertices == null || _modules == null)\n\t\t\treturn null;\n\t\t\n\t\tint size = _vertices.size();\t\t\n\n\t\t// set column, row names for the matrix\n\t\tVertex [] sortedVertices = getSortedVertexArray();\n\t\tString [] names = new String[sortedVertices.length];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tnames[i] = sortedVertices[i].getName();\n\t\t}\n\t\t\n\t\treturn generateMatrix(size, names);\n\t}", "public void writeClusters(List<Cluster> clusters)\n {\n deleteAllFileFolders();\n \n \n // root elements\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"ClusterInfo\");\n doc.appendChild(rootElement);\n Element numClusters=doc.createElement(\"NumOfClusters\");\n numClusters.appendChild(doc.createTextNode(clusters.size()+\"\"));\n rootElement.appendChild(numClusters); \n// Element clusterelem=doc.createElement(\"cluster\");\n int attribCnt=1;\n \n String writeText = \"\";\n for (Cluster cluster : clusters) {\n \n Element clusterelem=doc.createElement(\"cluster\");\n rootElement.appendChild(clusterelem);\n// Attr attr=doc.createAttribute(\"id\");\n// attr.setValue(\"\"+attribCnt++);\n// clusterelem.setAttributeNode(attr);\n clusterelem.setAttribute(\"id\", \"\"+attribCnt++);\n \n Index Firstindex = cluster.getFirstIndex();\n List<Index> indexes = cluster.getIndexLists();\n double rSpec = ((Double) Firstindex.getMeanRGB().get(0)).doubleValue();\n double gSpec = ((Double) Firstindex.getMeanRGB().get(1)).doubleValue();\n double bSpec = ((Double) Firstindex.getMeanRGB().get(2)).doubleValue();\n \n Element rspec=doc.createElement(\"rspec\");\n rspec.appendChild(doc.createTextNode(rSpec+\"\"));\n clusterelem.appendChild(rspec);\n \n Element gspec=doc.createElement(\"gspec\");\n gspec.appendChild(doc.createTextNode(gSpec+\"\"));\n clusterelem.appendChild(gspec);\n \n Element bspec=doc.createElement(\"bspec\");\n bspec.appendChild(doc.createTextNode(bSpec+\"\"));\n clusterelem.appendChild(bspec);\n \n \n String fileNames = \"\\n\\t\\t\";\n for (Index index : indexes) {\n fileNames += index.getFilePath() + \";\\n\\t\\t\";\n }\n// String record = \"@\" + rSpec + \":\" + gspec + \":\" + bspec + \":\" + fileNames + \"#\";\n// writeText += record;\n \n Element imgSrc=doc.createElement(\"ImageSrc\");\n imgSrc.appendChild(doc.createTextNode(fileNames+\"\"));\n clusterelem.appendChild(imgSrc);\n \n }\n \n WriteXML(doc);\n }", "private static void locateCenters(final int[] cluster, double[][] centers, final double[][] data) {\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n // reset centers to 0\n for (int c = 0; c < numCluster; c++) {\n Arrays.fill(centers[c], 0);\n }\n\n int[] countCluster = new int[numCluster];\n\n // sum over all samples\n for (int n = 0; n < N; n++) {\n vectorSumInPlace(centers[cluster[n]], data[n]);\n countCluster[cluster[n]]++;\n }\n\n // divide by number of samples in each cluster\n for (int c = 0; c < numCluster; c++) {\n vectorDivideInPlace(centers[c], countCluster[c]);\n }\n }", "public CentroidViewer(Experiment experiment, int[][] clusters, float[][] variances, float[][] means, float[][] codes) {\r\n \tthis.experiment = experiment;\r\n \tthis.clusters = clusters;\r\n \tthis.setVariances(variances);\r\n \tthis.setMeans(means);\r\n \tthis.setCodes(codes);\r\n setBackground(Color.white);\r\n setFont(new Font(\"monospaced\", Font.BOLD, 10));\r\n this.maxExperimentValue = experiment.getMaxAbsValue();\r\n this.yRangeOption = CentroidViewer.USE_EXPERIMENT_MAX;\r\n this.addMouseMotionListener(new GraphListener()); \r\n \r\n \tPopupListener listener = new PopupListener();\r\n \tthis.popup = createJPopupMenu(listener);\r\n \tgetContentComponent().addMouseListener(listener);\r\n }", "public static void main(String[] args) {\n In in = new In(args[0]); // input file\n int n = in.readInt(); // n-by-n percolation system\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\n // draw the points\n StdDraw.enableDoubleBuffering();\n StdDraw.setXscale(0, 32768);\n StdDraw.setYscale(0, 32768);\n for (Point p : points) {\n p.draw();\n }\n StdDraw.show();\n\n // print and draw the line segments\n BruteCollinearPoints collinear = new BruteCollinearPoints(points);\n for (LineSegment segment : collinear.segments() ) {\n StdOut.println(segment);\n segment.draw();\n }\n StdDraw.show();\n }", "public ClusteringPnlLeft() {\n initComponents();\n setSize(MainGUI.getInstance().getWidth(), MainGUI.getInstance().getHeight());\n setVisible(true);\n checkBoxes = new ArrayList<>();\n pnlAttributes.setLayout(new FlowLayout((int) LEFT_ALIGNMENT));\n \n int numOfAttributes = Data.getInstance().getInstances().numAttributes();\n for (int i = 0; i < numOfAttributes; i++) {\n String name = Data.getInstance().getInstances().attribute(i).name();\n int blank = 30 - name.length();\n for (int j = 0; j < blank; j++) {\n name = name + \" \";\n }\n checkBoxes.add(new JCheckBox(name));\n pnlAttributes.add(checkBoxes.get(i));\n }\n\n }", "private void setupClusterSource() {\n\n layers = new int[][]{new int[]{40, Color.RED}, new int[]{20, Color.BLUE}, new int[]{0, Color.GREEN}};\n\n for (int i = 0; i < layers.length; i++) {\n //Add cluster circles\n clusterLayer = new CircleLayer( \"cluster-\" + i, geojsonSourceId );\n clusterLayer.setProperties( circleColor( layers[i][1] ), circleRadius( 18f ) );\n pointCount=toNumber( get( \"point_count\" ) );\n // Add a filter to the cluster layer that hides the circles based on \"point_count\"\n clusterLayer.setFilter( i==0\n ? all( has( \"point_count\" ),\n gte( pointCount,literal(layers[i][0]) )\n ) : all(has(\"point_count\"),\n gt(pointCount,literal(layers[i][0])),\n lt(pointCount, literal(layers[i-1][0]))\n )\n );\n map.addLayer (clusterLayer);\n\n }\n //Add the count labels\n count = new SymbolLayer( \"count\", geojsonSourceId );\n count.setProperties( textField(Expression.toString( get( \"point_count\" ) )),\n textSize( 12f ),\n textColor( Color.WHITE ),\n textIgnorePlacement( true ),\n textAllowOverlap( false ));\n map.addLayer( count);\n\n }", "public void showDisplayCrossSectionBy(int[][] crossSection);", "public static int[] run(double[][] data, int numCluster) {\n int N = data.length;\n int M = data[0].length;\n\n // clustering result\n int[] cluster = new int[N];\n\n // randomize cluster center\n double[][] centers = new double[numCluster][M];\n for (int c = 0; c < numCluster; c++) {\n int idx = randomIntRange(0, N - 1);\n centers[c] = Arrays.copyOf(data[idx], M);\n }\n\n // assign every user to a cohort, use Euclidean distance\n assignCluster(cluster, centers, data);\n\n // iteration\n // (1) re-locate cohort center to average location of users in the cohort\n // (2) re-assign every user to the closest cohort center\n // (3) repeat\n // stop criterion: no change in cluster assignment, or reach max iteration\n int iterMax = 100;\n for (int iter = 0; iter < iterMax; iter++) {\n int[] oldCluster = Arrays.copyOf(cluster, N);\n locateCenters(cluster, centers, data);\n assignCluster(cluster, centers, data);\n\n // stop\n if (Arrays.equals(oldCluster, cluster)) {\n System.out.println(\"k-means : clustering converged\");\n break;\n }\n\n if (iter == iterMax) {\n System.out.println(\"k-means : reach max iteration\");\n }\n }\n\n return cluster;\n }", "public void assignPixelsToClusters(int[][] assigned){\n\n for(int i = 0; i < imageHeight; i++){\n for(int j = 0; j < imageWidth; j++){\n //System.out.println(\"pixel[\" + i + \"][\" + j + \"]\"); // Used for some debugging\n\n //Find the cluster color that is closest to the current pixel color\n int closestCluster = -1; // Holds the cluster that the pixel is closest to in color\n double closestDistance = Double.MAX_VALUE;// Initiate to the a max value\n for(int x = 0; x < kCenters.length; x++){\n if(diff(pixels[i][j], kCenters[x]) < closestDistance){\n closestCluster = x;\n closestDistance = diff(pixels[i][j], kCenters[x]);\n //Add the coordinates of this pixel to some arrayList of arrayList (a cluster arraylist)???\n }\n \n } // Done iterating through all kCenters and should have the closest\n if(closestCluster == -1){\n System.out.println(\"Error, no closest cluster found\");\n System.exit(-1);\n }\n assigned[i][j] = closestCluster;\n }\n }\n }", "public void connectClusters() {\n\t\tif (clusters.size() == 2) { // once have only two clusters\n\t\t\tSystem.out.println(\"DONE!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tcluster close1 = clusters.get(0),\n\t\t\t\tclose2 = clusters.get(1);\n\t\tdouble closestCluster = computeDistance(close1, close2);\n\t\t\n\t\tfor (int i=0; i<clusters.size(); i++) {\n\t\t\tcluster c1 = clusters.get(i);\n\t\t\t\n\t\t\tfor (int j=0; j<clusters.size(); j++) { // go through all the clusters and find closest\n\t\t\t\tif (i!=j) {\n\t\t\t\t\tcluster c2 = clusters.get(j);\n\t\t\t\t\tdouble dist = computeDistance(c1,c2);\n\t\t\t\t\tif (dist < closestCluster) {\n\t\t\t\t\t\tclose1 = c1;\n\t\t\t\t\t\tclose2 = c2;\n\t\t\t\t\t\tclosestCluster = dist;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tmakeCluster(close1, close2);\n\t\t\n\t}", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void showMoreClusterItems() {\n\n\t\tfor (EASTINProperty prop : activeETNACluster.getAttributesToHide()) {\n\t\t\tif (!activeETNACluster.getAttributesToShowInView().contains(prop))\n\t\t\t\tactiveETNACluster.getAttributesToShowInView().add(prop.clone());\n\t\t}\n\n\t\tfor (EASTINProperty prop : activeETNACluster.getMeasuresToHide()) {\n\t\t\tif (!activeETNACluster.getMeasuresToShowInView().contains(prop))\n\t\t\t\tactiveETNACluster.getMeasuresToShowInView().add(prop.clone());\n\t\t}\n\n\t\tthis.activeETNACluster.setShowItems(false);\n\n\t}", "private void dibujarCasillas() {\r\n for (int x = 0; x < 6; x++) {\r\n for (int y = 0; y < 6; y++) {\r\n panelTablero[x][y] = new CoordPanel();\r\n panelTablero[x][y].addMouseListener(this);\r\n panelTablero[x][y].setCoordenadas(x, y);\r\n pnlMain.add(panelTablero[x][y]);\r\n }\r\n }\r\n }", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "public void printCluster(PrintStream outs)\n {\n for (String upNode : getLiveNodes().split(\"\\\\s+\"))\n {\n if (upNode.length() > 0)\n {\n outs.println(String.format(\"%-21s up\", upNode));\n }\n }\n \n for (String downNode : getUnreachableNodes().split(\"\\\\s+\"))\n {\n if (downNode.length() > 0)\n {\n outs.println(String.format(\"%-21s down\", downNode));\n }\n }\n }", "public static Casilla[][] crearCasillaInicial(int cantidadCasillasX, int cantidadCasillasY){\n Casilla tableroAux;\n Casilla[][] tablero = new Casilla[cantidadCasillasX][cantidadCasillasY];\n for (int i = 0; i < cantidadCasillasX; i++) {\n for (int j = 0; j < cantidadCasillasY; j++) {\n int random = (int)(Math.random()*100);\n \n if(random>=50 && random<=60){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.RETROCESO));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n \n }\n else if(random>60 && random<=70){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.ADELANTO));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n \n }\n else if(random>70 && random<=80){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.ESCALERA));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n else if(random>80 && random<=90){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.SERPIENTE));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n else if(random>=0 && random<50){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.VACIA));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n else if(random>90 && random<=100){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.PIERDE_TURNO)+\" \");\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n \n }\n \n }\n return tablero;\n }", "public CentroidViewer(IFramework framework) {\r\n this(framework.getData().getExperiment(), defGenesOrder(framework.getData().getExperiment().getNumberOfGenes()));\r\n this.means = getMeans(clusters).A;\r\n this.variances = getVariances(clusters, getMeans(clusters)).A;\r\n this.framework=framework;\r\n this.onSelected(framework);\r\n }", "static List<MeanWithClusterProbAggregator> map(GmmPartitionData data, int countOfComponents) {\n List<MeanWithClusterProbAggregator> aggregators = new ArrayList<>();\n for (int i = 0; i < countOfComponents; i++)\n aggregators.add(new MeanWithClusterProbAggregator());\n\n for (int i = 0; i < data.size(); i++) {\n for (int c = 0; c < countOfComponents; c++)\n aggregators.get(c).add(data.getX(i), data.pcxi(c, i));\n }\n\n return aggregators;\n }", "private static void k_means_online(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n //writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "public void doInitialClustering(AddressIF me, Matrix_4_HSH tmp) {\n\t\t\n\t}", "public void stampa() {\n GridPane matrice = new GridPane();\n buildGriglia(matrice);\n Text scritta;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (getElementAt(griglia, i, j).cerchio.isVisible()) {\n scritta = new Text(\"1\");\n }\n else {\n scritta = new Text(\"0\");\n }\n matrice.add(scritta, j, i);\n }\n }\n Scene scene3 = new Scene(matrice, N * 100, N * 100);\n Stage stage3 = new Stage();\n stage3.setTitle(\"Matrice di occupazione:\");\n stage3.setScene(scene3);\n stage3.show();\n }", "public static void main(String[] args) {\n\n\t\tint[][] matrix = {{11,12,13,14},\n\t\t\t\t \t\t {15, 0,17,18},\n\t\t\t\t \t\t {19,20, 0,22},\n\t\t\t\t \t\t {23,24,25,26}\n\t\t\t\t};\n\n\t\tCTCI_1_8_1 a = new CTCI_1_8_1();\n\n\t\tSystem.out.println(\"Matrix before set Zeros\");\n\t\tfor(int i=0;i<matrix.length;i++) {\n\t\t\tfor(int j=0;j<matrix.length;j++) {\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Matrix after 90 degree rotation\");\n\t\t\n\t\ta.setZeros(matrix);\n\n\t\tfor(int i=0;i<matrix.length;i++) {\n\t\t\tfor(int j=0;j<matrix.length;j++) {\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t\n\t}", "private void process() {\n\tint i = 0;\n\tIOUtils.log(\"In process\");\n\tfor (Map.Entry<Integer, double[]> entry : vecSpaceMap.entrySet()) {\n\t i++;\n\t if (i % 1000 == 0)\n\t\tIOUtils.log(this.getName() + \" : \" + i + \" : \" + entry.getKey()\n\t\t\t+ \" : \" + this.getId());\n\t double[] cent = null;\n\t double sim = 0;\n\t for (double[] c : clusters.keySet()) {\n\t\t// IOUtils.log(\"before\" + c);\n\t\tdouble csim = cosSim(entry.getValue(), c);\n\t\tif (csim > sim) {\n\t\t sim = csim;\n\t\t cent = c;\n\t\t}\n\t }\n\t if (cent != null && entry.getKey() != null) {\n\t\ttry {\n\t\t clusters.get(cent).add(entry.getKey());\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t}\n\t }\n\t}\n }", "Cluster (Set pages) {\n this.pages = pages;\n }", "@Override\n \tpublic Collection<Collection<Integer>> call() throws Exception {\n \t\tEdgeWeighter<HomologyEdge> weighter = new EdgeWeighter<HomologyEdge>() {\n \t\t\t@Override\n \t\t\tpublic double getWeight(HomologyEdge e) {\n \t\t\t\treturn e.getWeight();\n \t\t\t}\n \t\t};\n \t\tProbabilisticDistanceClusterer<Integer, HomologyEdge> alg = new ProbabilisticDistanceClusterer<Integer, HomologyEdge>(\n \t\t\t\tweighter, xi);\n \t\tSet<Set<Integer>> ccs = alg.transform(graph.getHomology());\n \n \t\t// now map each cluster to a root for that cluster\n \t\t// the choice of root is arbitrary and just for hashing\n \t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n \t\tfor (Set<Integer> cc : ccs) {\n \t\t\tint v0 = -1;\n \t\t\tint i = 0;\n \t\t\tfor (int v : cc) {\n \t\t\t\tif (i == 0) v0 = v;\n \t\t\t\tmap.put(v, v0);\n \t\t\t\ti++;\n \t\t\t}\n \t\t}\n \n \t\t// find the cliques\n \t\tBronKerboschCliqueFinder<Integer, HomologyEdge> finder = new BronKerboschCliqueFinder<>();\n \t\tCollection<Set<Integer>> cliques = finder.transform(graph.getHomology());\n \n \t\t// group the cliques by sets of interactions\n \t\tNavigableMap<String, Collection<Integer>> cliqueGroups = new TreeMap<>();\n \t\tfor (Set<Integer> clique : cliques) {\n \t\t\tfor (int v : clique) {\n \t\t\t\tCollection<Integer> neighbors = graph.getInteractionNeighbors(v);\n \t\t\t\tString hash = hashVertexInteractions(neighbors, map);\n \t\t\t\tCollection<Integer> group = cliqueGroups.get(hash);\n \t\t\t\tif (group == null) group = new TreeSet<>();\n \t\t\t\tgroup.add(v);\n \t\t\t}\n \t\t}\n \n \t\t// now we just want a set to return\n \t\tSet<Collection<Integer>> set = new TreeSet<>();\n \t\tset.addAll(cliqueGroups.values());\n \n \t\treturn set;\n \t}", "private void run()\r\n {\n List<Cluster> clusters = createClusters();\r\n\r\n //compute MAX_WIDTH and MAX_HEIGHT\r\n computeCloudDimensions(clusters);\r\n\r\n double scale = 1.05;\r\n //try to layout words\r\n while (!doPacking(clusters))\r\n {\r\n //increase cloud dimensions\r\n MAX_WIDTH *= scale;\r\n MAX_HEIGHT *= scale;\r\n }\r\n\r\n doPacking(clusters);\r\n }", "@Override\n protected void onBeforeClusterRendered(Cluster<Person> cluster, MarkerOptions markerOptions) {\n List<Drawable> profilePhotos = new ArrayList<Drawable>(Math.min(4, cluster.getSize()));\n int width = mDimension;\n int height = mDimension;\n\n for (Person p : cluster.getItems()) {\n // Draw 4 at most.\n if (profilePhotos.size() == 4) break;\n Drawable drawable = getResources().getDrawable(p.profilePhoto);\n drawable.setBounds(0, 0, width, height);\n profilePhotos.add(drawable);\n }\n MultiDrawable multiDrawable = new MultiDrawable(profilePhotos);\n multiDrawable.setBounds(0, 0, width, height);\n\n mClusterImageView.setImageDrawable(multiDrawable);\n Bitmap icon = mClusterIconGenerator.makeIcon(String.valueOf(cluster.getSize()));\n markerOptions.icon(BitmapDescriptorFactory.fromBitmap(icon));\n }", "public void majAffichage() {\n this.grid.getChildren().clear(); // vide tout le gridpane\n for (int i = 0; i < this.matrice.getNbLigne(); i++) {\n for (int j = 0; j < this.matrice.getNbColonne(); j++) {\n Node n = this.matrice.getCell(i, j); // recupère les imgViews de la matrice\n this.grid.setHalignment(n, HPos.CENTER); // place les labels au centre des cases\n this.grid.add(this.matrice.getCell(i, j), j, i);\n }\n }\n }", "public static void academicClusterMenu() {\n\t\tCareerPlanningApplication.setHeader(\"CAREER PLANNING APP\");\n\t\tSystem.out.println(\"1. Add academic clusters\");\n\t\tSystem.out.println(\"2. View academic clusters\");\n\t\tSystem.out.println(\"3. Delete an academic cluster\");\n\t\tSystem.out.println(\"4. Return to Main Menu\");\n\t\tHelper.line(80, \"-\");\n\t}" ]
[ "0.6035538", "0.5909992", "0.57451266", "0.56329906", "0.5601707", "0.55872834", "0.5539201", "0.55278546", "0.5487739", "0.5448122", "0.5441196", "0.54399794", "0.54361486", "0.541576", "0.5413163", "0.54015386", "0.5357619", "0.5325333", "0.5324938", "0.52456653", "0.5228624", "0.51959825", "0.5192486", "0.51716775", "0.5168509", "0.5146618", "0.50896394", "0.50711644", "0.5042145", "0.5040816", "0.5040643", "0.50346243", "0.5008172", "0.49926698", "0.49873018", "0.49801865", "0.49784836", "0.49745488", "0.4965185", "0.49554098", "0.49137166", "0.4903738", "0.48895463", "0.48878905", "0.4886905", "0.48821598", "0.48799822", "0.4879756", "0.48645288", "0.48615345", "0.48597705", "0.48416612", "0.4792813", "0.47857228", "0.47735244", "0.47640374", "0.4759149", "0.47540802", "0.474857", "0.47386375", "0.47311255", "0.4720807", "0.4719088", "0.4715942", "0.46999785", "0.46982622", "0.46952653", "0.46938458", "0.46794602", "0.46786696", "0.4673688", "0.46728534", "0.46650097", "0.46522906", "0.4648647", "0.46462017", "0.4639112", "0.463522", "0.46274838", "0.46250874", "0.46202582", "0.46188757", "0.46109197", "0.46096724", "0.46039402", "0.46018454", "0.46016926", "0.45873785", "0.45845783", "0.4582072", "0.4575552", "0.45731446", "0.4571771", "0.45699358", "0.45672032", "0.45669618", "0.45602718", "0.45575094", "0.45492172", "0.45437175" ]
0.7540509
0
Creates the initial distance matrix by calculating euclidean matrix between each points
private static void makeInitialDistanceMatrix() { try { for(int i=1;i<=totalGenes;i++) { TreeMap<String, Double> temp1 = new TreeMap<>(); if(distanceMatrix.containsKey(i+"")) temp1 = distanceMatrix.get(i+""); for(int j=i+1;j<=totalGenes;j++) { double dist = getDist(i, j); TreeMap<String, Double> temp2 = new TreeMap<>(); if(distanceMatrix.containsKey(j+"")) temp2 = distanceMatrix.get(j+""); temp2.put(i+"", dist); distanceMatrix.put(j+"", temp2); temp1.put(j+"", dist); updateMinMatrix(i+"",j+"",dist); } distanceMatrix.put(i+"", temp1); } } catch(Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Double[][] makeAdjacencyMatrix()\n {\n Double[][] matrix = new Double[this.numIntxns][this.numIntxns];\n\n for (int i = 0; i < this.numIntxns; i++)\n {\n for (int j = 0; j < this.numIntxns; j++)\n {\n // if the indices are the same the distance is 0.0.\n // otherwise, it's infinite.\n matrix[i][j] = (i != j) ? null : 0.0;\n }\n }\n\n // populate the matrix\n for (int intxn = 0; intxn < this.numIntxns; intxn++)\n {\n for (Road road : this.roads)\n {\n if (intxn == road.start())\n {\n matrix[intxn][road.end()] = road.length();\n matrix[road.end()][intxn] = road.length();\n }\n }\n }\n\n return matrix;\n }", "public void evaluate_dist_1_DES_Ciphertext_Matrix() {\n // Initialisierung\n for (int row = 0; row < 8; row++)\n for (int col = 0; col < 8; col++) {\n DES_dist_1_Ciphertext_Matrix[row][col] = 0;\n DES_dist_1_Ciphertext_Vector[8 * row + col] = 0;\n }\n\n for (int row = 0; row < 8; row++)\n for (int col = 0; col < 8; col++) {\n for (int count = 0; count < 64; count++) {\n DES_dist_1_Ciphertext_Matrix[row][col] = DES_dist_1_Ciphertext_Matrix[row][col]\n + (DES_Ciphertext_Matrix[0][count] ^ DES_Ciphertext_Matrix[8 * row + col + 1][count]);\n DES_dist_1_Ciphertext_Vector[8 * row + col] = DES_dist_1_Ciphertext_Matrix[row][col];\n }\n }\n }", "public void evaluate_dist_2_DES_Ciphertext_Matrix() {\n // Initialisierung\n // for (int row=0; row<8; row++)\n // for (int col=0; col<8; col++)\n // DES_dist_2_Ciphertext_Matrix[row][col] = 0;\n intialize_matrix(DES_dist_2_Ciphertext_Matrix);\n\n for (int row = 0; row < 8; row++)\n for (int col = 0; col < 8; col++) {\n for (int count = 0; count < 64; count++)\n DES_dist_2_Ciphertext_Matrix[row][col] = DES_dist_2_Ciphertext_Matrix[row][col]\n + (DES_Ciphertext_Matrix[8 * row + col][count] ^ DES_Ciphertext_Matrix[8 * row + col + 1][count]);\n }\n }", "public static double[][] calcDistanceMatrix(Point[] points, int threadCount) {\n return new DistanceCalculator(threadCount).calculateDistanceMatrix(points);\n }", "private static void initialiseDistanceMatrix(ArrayList<City> cities) {\n // initialising the distanceMatrix as a new empty square 2D array, according to how many cities there are\n distanceMatrix = new double[cities.size()][cities.size()];\n\n for (int i = 0; i < cities.size(); i++) {\n for (int j = 0; j < cities.size(); j++) {\n // check if the distance between 2 cities has already been calculated\n if (distanceMatrix[i][j] == 0.0) {\n // calculate the distance between cities i and j\n distanceMatrix[i][j] = Location.distance(cities.get(i).location, cities.get(j).location);\n // set the distance between cities j and i to the distance between cities i and j,\n // as these will always be equal given that this is a Symmetric TSP\n distanceMatrix[j][i] = distanceMatrix[i][j];\n }\n }\n }\n }", "void calculate_distance()\n {\n \t\n \tfor(int i = 0; i<V ; i++)\n \t{\n \t\tfor(int j = 0; j<E ; j++)\n \t\t{\n \t\t\trelax(edge[j].src, edge[j].destination, edge[j].weight);\n \t\t}\n \t\tsp[i] = dist[i];\n \t\tx[i] = dist[i];\n \t}\n \tSystem.out.println();\n }", "public static void generateMatrix() {\r\n Random random = new Random();\r\n for (int i = 0; i < dim; i++)\r\n {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n if (i != j)\r\n \r\n adjacencyMatrix[i][j] = I; \r\n }\r\n }\r\n for (int i = 0; i < dim * dim * fill; i++)\r\n {\r\n adjacencyMatrix[random.nextInt(dim)][random.nextInt(dim)] =\r\n random.nextInt(maxDistance + 1);\r\n }\r\n \r\n\r\n\r\n \r\n //print(adjacencyMatrix);\r\n \r\n \r\n //This makes the main matrix d[][] ready\r\n for (int i = 0; i < dim; i++) {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n d[i][j] = adjacencyMatrix[i][j];\r\n if (i == j)\r\n {\r\n d[i][j] = 0;\r\n }\r\n }\r\n }\r\n }", "public static void matrixDis()\n\t{\n\t\t\n\t\tclade = clad[k];\n\t\t//System.err.println(\"\\n\\n\" + clade.cladeName);\n\n\t\tfor(c=0; c<clade.numSubClades; c++)\n\t\t{\n\t\t\tclade.Dc[c]=0;\n\t\t\tclade.Dn[c]=0;\n\t\t\t//clade.varDc[c]=0;\n\t\t\t//clade.varDn[c]=0;\n\t\t\tsum1 = sum2 = sum3 = 0;\n\t\t\tsumc1 = sumc2 = sumc3 = 0;\n\n\t\t\tfor(i=0; i<clade.numCladeLocations; i++) \t\n\t\t\t{\t\n\t\t\t\t\n\t\t\t\tsum2 += clade.obsMatrix[c][i] * (clade.obsMatrix[c][i]-1) / 2 ;\n\t\t\t\tsumc2 += (clade.obsMatrix[c][i] * (clade.obsMatrix[c][i]-1) / 2) + \n\t\t\t (clade.obsMatrix[c][i] * (clade.columnTotal[i] - clade.obsMatrix[c][i]));\t\n\t\t\t\n\t\t\t\tfor (j=0; j<clade.numCladeLocations; j++)\n\t\t\t\t{\t\n\t\t\t\t\tpopA = clade.cladeLocIndex[i];\n\t\t\t\t\tpopB = clade.cladeLocIndex[j];\n\t\t\t\t\t\n\t\t\t\t\tif (j != i)\n\t\t\t\t\t{\n\t\t\t\t\t\tsum1 += (double) clade.obsMatrix[c][i] * clade.obsMatrix[c][j] * distance[popA-1][popB-1];\n\t\t\t\t\t\tsum3 += clade.obsMatrix[c][i] * clade.obsMatrix[c][j];\t\t\t\n\t\t\t\t\t\tsumc1 += (double) clade.obsMatrix[c][i] * clade.columnTotal[j] * distance[popA-1][popB-1];\t\n\t\t\t\t\t\tsumc3 += clade.obsMatrix[c][i] * clade.columnTotal[j];\n\t\t\t\t\t\t//System.err.println(\"\\npopA = \" + popA + \" popB = \" + popB + \" dist= \" + distance[popA-1][popB-1]);\n\t\t\t\t\t\t//System.err.println(\"sumc1: \" + clade.obsMatrix[c][i] + \" * \" + clade.columnTotal[j] +\" * \" + distance[popA-1][popB-1] + \" = \" + sumc1); \n\t\t\t\t\t\t//System.err.println(\"\\nOBS[\" + c +\"][\" + i+ \"]= \" + clade.obsMatrix[c][i]); \n\t\t\t\t\t\t//System.err.println(\"\\nCT[\" + j +\"]= \" + clade.columnTotal[j]); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\n\t\t\t//System.err.println(\"\\nOBS[\" + c +\"][\" + i+ \"]= \" + clade.obsMatrix[c][i]); \n\t\t\n\t\t\t\n\t\t\tif (sum3 == 0.0)\n\t\t\t\tclade.Dc[c] = 0.0;\n\t\t\telse\n\t\t\t\tclade.Dc[c] = sum1 / (sum2 + sum3);\t\t\t\t\n\t\n\t\n\t\t\tif (sumc3 == 0.0)\n\t\t\t\tclade.Dn[c] = 0.0;\n\t\t\telse\n\t\t\t\tclade.Dn[c] = sumc1 / (sumc2 + sumc3);\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t//System.err.println(\"\\nClade \" + clade.cladeName + \" subclade \" + c + \n\t\t\t// \" Dc= \" + clade.Dc[c] + \" Dn= \" + clade.Dn[c]); \t\t\n\t\t\t//System.err.println(\"sum1= \" + sum1 + \" sum2= \" + sum2 + \" sum3= \" + sum3); \n\t\t\t//System.err.println(\"sumc1= \" + sumc1 + \" sumc2= \" + sumc2 + \" sumc3= \" + sumc3); \t\n\t\t}\t\t\n\n\t}", "private SparseMatrix<Float64> makeC(SparseMatrix<Float64> matrix) {\n\t\t// normalize products for each customer\n\t\tList<SparseVector<Float64>> normRows =\n\t\t\tnew ArrayList<SparseVector<Float64>>();\n\t\tfor (int i = 0; i < matrix.getNumberOfRows(); i++) {\n\t\t\tSparseVector<Float64> row = matrix.getRow(i);\n\t\t\tFloat64 sum =\n\t\t\t\trow\n\t\t\t\t\t.times(new AllSame<Float64>(row.getDimension(), Float64.ONE));\n\t\t\tSparseVector<Float64> norm = row.times(sum.inverse());\n\t\t\tnormRows.add(norm);\n\t\t}\n\t\treturn SparseMatrix.valueOf(normRows);\n\t}", "public void generateMatrix() {\n\n flow = new int[MATRIX_TAM][MATRIX_TAM];\n loc = new int[MATRIX_TAM][MATRIX_TAM];\n\n for (int i = 0; i < MATRIX_TAM; i++) {\n for (int j = 0; j < MATRIX_TAM; j++) {\n\n //fill the distances matrix\n if (i != j) {\n loc[i][j] = rn.nextInt(MAX_DISTANCE - MIN_DISTANCE + 1) + MIN_DISTANCE;\n } else {\n loc[i][j] = 0;\n }\n\n //fill the flow matrix\n if (i != j) {\n flow[i][j] = rn.nextInt(MAX_FLOW - MIN_FLOW + 1) + MIN_FLOW;\n } else {\n flow[i][j] = 0;\n }\n\n }\n }\n\n }", "public double[][] getDistances() {\n calculateDistances();\n\n int numPoints = getNumPoints();\n double[][] temp = new double[numPoints][numPoints];\n\n for (int i = 0; i < numPoints; i++) {\n for (int j = 0; j < numPoints; j++) {\n temp[i][j] = getDistance(i, j);\n }\n }\n\n return temp;\n }", "private void calculateDistances() {\n for (int point = 0; point < ntree.size(); point++) {\n calculateDistances(point);\n }\n }", "public void calculaMatrizCostes() {\n int i, j;\n double xd, yd;\n costes = new int[n][n];\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n xd = vx[i] - vx[j];\n yd = vy[i] - vy[j];\n costes[i][j] = (int) Math.round(Math.sqrt((xd * xd) + (yd * yd)));\n }\n }\n }", "@Test\n\tpublic void testDiagonalNeighbors() {\n\t\tPosition topLeft = new Position(0,0);\n\t\tPosition bottomRight = new Position(1,1);\n\n\t\tint distance = euclideanSquaredMetric.calculateCost(topLeft, bottomRight);\n\t\tassertEquals(2 * lateralDistanceWeight, distance);\n\n\t\tPosition topRight = new Position(0,1);\n\t\tPosition bottomLeft = new Position(1,0);\n\n\t\tdistance = euclideanSquaredMetric.calculateCost(topRight, bottomLeft);\n\t\tassertEquals(2*lateralDistanceWeight, distance);\n\n\t}", "private void generateMap () {\n for (int i = 0 ; i < n ; i++) {\n mapCoordinate[i] = new CoordinateInfo(100 * random.nextFloat(), 100 * random.nextFloat());\n\n for (int j = 0 ; j <= i ; j++) {\n mapDistance[i][j] = mapDistance[j][i] = getDistance(mapCoordinate[i], mapCoordinate[j]);\n }\n }\n }", "static private double[][] initMatrix(double[][] c) {\n final int N = c.length;\n final double value = 1 / Math.sqrt(2.0);\n\n for (int i = 1; i < N; i++) {\n for (int j = 1; j < N; j++) {\n c[i][j] = 1;\n }\n }\n\n for (int i = 0; i < N; i++) {\n c[i][0] = value;\n c[0][i] = value;\n }\n c[0][0] = 0.5;\n return c;\n }", "public static void main(String[] args) {\n\t\tCustomer depot = new Customer();\n\t\tdepot.x = 50;\n\t\tdepot.y = 50;\n\t\tdepot.demand = 0;\n\n\n\t\tint myBirthNumber = 8021994;\n\n\t\tRandom ran = new Random (myBirthNumber); \n\n\t\tint numberOfCustomers = 30;\n\n\t\t//Creating the list with the customers\t\t\n\t\tArrayList <Customer> customers = new ArrayList<>(); // with this code we initialize the new ArrayList, which is called \"customers\"\n\t\tfor (int i = 1 ; i <= numberOfCustomers; i++)\n\t\t{\n\t\t\tCustomer cust = new Customer();\n\t\t\tcust.x = ran.nextInt(100);\n\t\t\tcust.y = ran.nextInt(100); \n\t\t\tcust.demand = 4 + ran.nextInt(7); \n\t\t\tcustomers.add(cust);\n\t\t}\n\n\t\t//Build the allCustomers array and the corresponding distance matrix\n\t\tArrayList <Customer> allCustomers = new ArrayList<Customer>();\n\n\n\t\tallCustomers.add(depot);\n\t\tfor (int i = 0 ; i < customers.size(); i++)\n\t\t{\n\t\t\tCustomer cust = customers.get(i);\n\t\t\tallCustomers.add(cust);\n\t\t}\n\n\t\tfor (int i = 0 ; i < allCustomers.size(); i++)\n\t\t{\n\t\t\tCustomer nd = allCustomers.get(i);\n\t\t\tnd.ID = i;\n\t\t}\n\n\n\t\t// This is a 2-D array which will hold the distances between node pairs\n\t\t// The [i][j] element of this array is the distance required for moving \n\t\t// from the i-th node of allNodes (node with id : i)\n\t\t// to the j-th node of allNodes list (node with id : j)\n\t\tdouble [][] distanceMatrix = new double [allCustomers.size()][allCustomers.size()];\n\t\tfor (int i = 0 ; i < allCustomers.size(); i++)\n\t\t{\n\t\t\tCustomer from = allCustomers.get(i);\n\n\t\t\tfor (int j = 0 ; j < allCustomers.size(); j++)\n\t\t\t{\n\t\t\t\tCustomer to = allCustomers.get(j);\n\n\t\t\t\tdouble Delta_x = (from.x - to.x);\n\t\t\t\tdouble Delta_y = (from.y - to.y);\n\t\t\t\tdouble distance = Math.sqrt((Delta_x * Delta_x) + (Delta_y * Delta_y));\n\n\t\t\t\tdistance = Math.round(distance);\n\n\t\t\t\tdistanceMatrix[i][j] = distance;\n\n\t\t\t}\n\t\t}\n\n\n\n\t\t// This is the solution object - It will store the solution as it is iteratively generated\n\t\t// The constructor of Solution class will be executed\n\t\tSolution s = new Solution();\n\n\t\tint numberOfVehicles = 10;\n\n\t\t//Let rtList be the ArrayList of Vehicles assigned to the solution \"s\".\t\t\n\t\tArrayList <Route> rtList = s.routes; \n\t\tfor (int i = 1 ; i <= numberOfVehicles; i++)\n\t\t{\n\t\t\tRoute routeTemp = new Route();\n\t\t\trouteTemp.load = 0;\n\t\t\trouteTemp.capacity = 50;\n\t\t\trouteTemp.cost = 0;\n\t\t\trtList.add(routeTemp);\n\t\t}\n\n\t\t// indicate that all customers are non-routed\n\t\tfor (int i = 0 ; i < customers.size(); i++)\n\t\t{\n\t\t\tcustomers.get(i).isRouted = false;\n\t\t}\n\n\n\t\t/* \n\t\t * ##################\n\t\t * # INITIALIZATION #\n\t\t * ##################\n\t\t * */\n\n\t\t// Setting a count for customers who are not inserted in the solution yet\n\t\tint notInserted = numberOfCustomers;\n\n\t\tfor (int j=0; j < numberOfVehicles; j++)\n\t\t{\n\t\t\tArrayList <Customer> nodeSequence = rtList.get(j).customers;\n\t\t\tnodeSequence.add(depot);\t\n\n\t\t\tint capacity = rtList.get(j).capacity; // The capacity of this vehicle (=50)\n\t\t\tint load = rtList.get(j).load; // The initial load of this vehicle (=0)\n\t\t\t// Setting a boolean variable that shows the assignment is not final yet.\n\t\t\tboolean isFinal = false;\n\t\t\t// If we have no more customers to insert, we add the depot at the end of the sequence. \n\t\t\tif (notInserted == 0) {\n\t\t\t\tisFinal = true;\n\t\t\t\tnodeSequence.add(depot);\n\t\t\t}\n\t\t\twhile (isFinal == false)\t\t\t{\n\t\t\t\t//this will be the position of the nearest neighbor customer -- initialization to -1\n\t\t\t\tint positionOfTheNextOne = -1;\n\t\t\t\t// This will hold the minimal cost for moving to the next customer - initialized to something very large\n\t\t\t\tdouble bestCostForTheNextOne = Double.MAX_VALUE;\n\t\t\t\t//This is the last customer of the route (or the depot if the route is empty)\n\t\t\t\tCustomer lastInTheRoute = nodeSequence.get(nodeSequence.size() - 1);\n\t\t\t\t//identify nearest non-routed customer\n\t\t\t\tfor (int k = 0 ; k < customers.size(); k++)\n\t\t\t\t{\n\t\t\t\t\t// The examined customer is called candidate\n\t\t\t\t\tCustomer candidate = customers.get(k);\n\t\t\t\t\t// if this candidate has not been visited by a vehicle\n\t\t\t\t\tif (candidate.isRouted == false)\t\t\t\t\t{\n\t\t\t\t\t\t//This is the cost for moving from the last visited customer to the candidate customer\n\t\t\t\t\t\tdouble trialCost = distanceMatrix[lastInTheRoute.ID][candidate.ID];\n\t\t\t\t\t\t//If this is the minimal cost found so far -> store this cost and the position of this best candidate\n\t\t\t\t\t\tif (trialCost < bestCostForTheNextOne && candidate.demand<= capacity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionOfTheNextOne = k;\n\t\t\t\t\t\t\tbestCostForTheNextOne = trialCost;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // moving on to the next (candidate) customer\n\n\t\t\t\t// Step 2: Push the customer in the solution\n\t\t\t\t// We have found the customer to be pushed.\n\t\t\t\t// He is located in the positionOfTheNextOne position of the customers list\n\t\t\t\t// Let's inert him and update the cost of the solution and of the route, accordingly\n\n\t\t\t\tif (positionOfTheNextOne != -1 )\n\t\t\t\t{\n\t\t\t\t\tCustomer insertedNode = customers.get(positionOfTheNextOne);\n\t\t\t\t\t//Push the customer in the sequence\n\t\t\t\t\tnodeSequence.add(insertedNode);\n\t\t\t\t\t\n\t\t\t\t\trtList.get(j).cost = rtList.get(j).cost + bestCostForTheNextOne;\n\t\t\t\t\ts.cost = s.cost + bestCostForTheNextOne;\n\t\t\t\t\tinsertedNode.isRouted = true;\n\t\t\t\t\tcapacity = capacity - insertedNode.demand;\n\t\t\t\t\trtList.get(j).load = load + insertedNode.demand;\n\t\t\t\t\tload = load + insertedNode.demand;\n\t\t\t\t\tnotInserted = notInserted - 1;\n\t\t\t\t\t\n\t\t\t\t} else \n\t\t\t\t{ \n\t\t\t\t\t//if the positionOfTheNextOne = -1, it means there is no suitable candidate for this vehicle. So, we add the depot.\n\t\t\t\t\tnodeSequence.add(depot);\n\t\t\t\t\trtList.get(j).cost = rtList.get(j).cost + distanceMatrix[lastInTheRoute.ID][0];\n\t\t\t\t\ts.cost = s.cost + distanceMatrix[lastInTheRoute.ID][0];\n\t\t\t\t\tisFinal = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* \n\t\t * ###########\n\t\t * # RESULTS #\n\t\t * ###########\n\t\t * */\n\n\n\t\tfor (int j=0; j<numberOfVehicles; j++)\n\t\t{\n\t\t\tint vehicle_number = j+1;\n\t\t\tSystem.out.println(\"Route for Vehicle #\" + vehicle_number);\n\t\t\tfor (int k=0; k<s.routes.get(j).customers.size(); k++) \n\t\t\t{\n\t\t\t\tSystem.out.print(s.routes.get(j).customers.get(k).ID + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Route Cost = \" + s.routes.get(j).cost);\n\t\t\tSystem.out.println(\"Final Load: \" + s.routes.get(j).load);\n\t\t\tSystem.out.println(\"Final Remaining Capacity = \" + (rtList.get(j).capacity - s.routes.get(j).load));\n\t\t\tSystem.out.println(\"----------------------------------------\");\n\n\t\t}\t\t\n\t\tSystem.out.println(\"Total Solution Cost = \" + s.cost);\n\n\t\t// End of GCS Instance\n\n\n\t\t/* \n\t\t * ###################################################\n\t\t * # LOCAL SEARCH USING INTER+INTRA-RELOCATION MOVES #\n\t\t * ###################################################\n\t\t * */\n\n\n\t\t//this is a boolean flag (true/false) for terminating the local search procedure\n\t\tboolean terminationCondition = false;\n\n\t\t//this is a counter for holding the local search iterator\n\t\tint localSearchIterator = 0;\n\n\t\t//Here we apply the best relocation move local search scheme\n\t\t//This is an object for holding the best relocation move that can be applied to the candidate solution\n\t\tRelocationMove rm = new RelocationMove(); // in order to apply one relocation move for all routes - dont want to lose previous if i change vehicle\n\n\t\t//Initialize the relocation move rm\n\t\trm.positionOfRelocated = -1;\n\t\trm.positionToBeInserted = -1;\n\t\trm.fromRoute = 0;\n\t\trm.toRoute = 0;\n\t\trm.fromMoveCost = Double.MAX_VALUE;\n\t\trm.toMoveCost = Double.MAX_VALUE;\n\n\t\t// Until the termination condition is set to true repeat the following block of code\n\t\twhile (terminationCondition == false)\n\t\t{\n\t\t\t//With this function we look for the best relocation move\n\t\t\t//the characteristics of this move will be stored in the object rm\n\t\t\tfindBestRelocationMove(rm, s, distanceMatrix, numberOfVehicles);\n\n\t\t\t// If rm (the identified best relocation move) is a cost improving move, or in other words\n\t\t\t// if the current solution is not a local optimum\n\t\t\tif (rm.moveCost < 0)\n\t\t\t{\n\t\t\t\t//This is a function applying the relocation move rm to the candidate solution\n\t\t\t\tapplyRelocationMove(rm, s, distanceMatrix);\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if no cost improving relocation move was found,\n\t\t\t\t//or in other words if the current solution is a local optimum\n\t\t\t\t//terminate the local search algorithm\n\t\t\t\tterminationCondition = true;\n\t\t\t}\n\n\t\t\tlocalSearchIterator = localSearchIterator + 1;\n\t\t}\n\n\n\t\t/* \n\t\t * ###########\n\t\t * # RESULTS #\n\t\t * ###########\n\t\t * */\n\t\t\n\t\t\n\t\tSystem.out.println(\"\");\n\t\tfor (int j=0; j<numberOfVehicles; j++)\n\t\t{\n\t\t\tint vehicle_number = j+1;\n\t\t\tSystem.out.println(\"Updated Route for Vehicle #\" + vehicle_number);\n\t\t\tfor (int k=0; k<s.routes.get(j).customers.size(); k++) \n\t\t\t{\n\t\t\t\tSystem.out.print(s.routes.get(j).customers.get(k).ID + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Route Cost = \" + s.routes.get(j).cost);\n\t\t\tSystem.out.println(\"Final Load: \" + s.routes.get(j).load);\n\t\t\tSystem.out.println(\"Final Remaining Capacity = \" + (rtList.get(j).capacity - s.routes.get(j).load));\n\t\t\tSystem.out.println(\"----------------------------------------\");\n\n\t\t}\t\t\n\t\tSystem.out.println(\"Total Solution Cost = \" + s.cost);\n\t\tSystem.out.println(\"Total Local Search Iterations = \" + localSearchIterator);\n\t\tSystem.out.println(\"Total Local Search Relocations = \" + (localSearchIterator-1));\n\n\n\n\t}", "public double[][] getDistancematrix_d() {\n return distancematrix_d;\n }", "protected ArrayList<double[]> newMatrix(int _rows, int _cols) {\n ArrayList<double[]> matrix = new ArrayList<double[]>();\n for (int i=0; i<_rows; i++) {\n matrix.add(new double[_cols]);\n }\n return matrix;\n }", "public static void makeMatrix()\n {\n\n n = Graph.getN();\n m = Graph.getM();\n e = Graph.getE();\n\n connectMatrix = new int[n][n];\n\n // sets the row of value u and the column of value v to 1 (this means they are connected) and vice versa\n // vertices are not considered to be connected to themselves.\n for(int i = 0; i < m;i++)\n {\n connectMatrix[e[i].u-1][e[i].v-1] = 1;\n connectMatrix[e[i].v-1][e[i].u-1] = 1;\n }\n }", "public void KNN() {\n\n\t\t\n\t\t// for each point in test data\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble xy = 0;\n\t\tdouble sum = 0;\n\t\tdouble m = this.Extracted_TestDataset.length;\n\t\tArrayList<ArrayList<Double>> EucledianDistanceUnsorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\tArrayList<ArrayList<Double>> EucledianDistanceSorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\t//EucledianDistance\n\t\t\n\t\t// Initialize EucledianDistance List\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceUnsorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceSorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\t// Testing sorting \n\t\t/*\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tfor(int k=0; k < this.Extracted_TestDataset[i].length; k++) {\n\t\t\t\tdouble min = 0.0; // Set To Your Desired Min Value\n\t\t double max = 10.0; // Set To Your Desired Max Value\n\t\t double ran = (Math.random() * ((max - min) + 1)) + min; // This Will Create \n\t\t \n\t\t double xrounded = Math.round(ran * 100.0) / 100.0; \n\t\t System.out.print(xrounded); \n\t\t //System.out.print(\" , \"); \n\t\t EucledianDistanceUnsorted.get(i).add(xrounded);\n\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"\"); \n\t\t\t\n\t\t}\n\t\t*/\n\n\t\t\n\t\t\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int p = 1; p < (this.Extracted_TestDataset.length-1) ; p++) {\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int i = 1; i < this.Extracted_TrainingDataset.length; i++) {\n\t\t\tsum = 0;\n\t\t\tint k = 0;\n\t\t\t//System.out.println(\"first loop\");\n\t\t\tfor ( ; k < (this.Extracted_TestDataset[0].length-1) ; k++) {\t\t\t\n\t\t\t\t//System.out.println(\"second loop\");\n\t\t\t\t\n\t\t\t\tx = (Double.parseDouble(this.Extracted_TestDataset[p][k]));\n\t\t\t\t\t//System.out.print(\" x value : \");\n\t\t\t\t\t//System.out.print(x);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\ty = (Double.parseDouble(this.Extracted_TrainingDataset[i][k]));\n\t\t\t//\tSystem.out.print(\" y value : \");\n\t\t\t//\tSystem.out.println(y);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\txy = x - y;\n\t\t\t\n\t\t\t\txy = (Math.pow(xy, 2));\n\t\t\t\tsum += xy;\n\t\t\t\t\t\t\n\t\t\t\t//System.out.print(\" sum : \");\n\t\t\t\t//System.out.println(sum);\n\t\t\t\t}\n\n\t\t\tEucledianDistanceUnsorted.get(p).add((Math.sqrt(sum/k)));\n\t\t\t\t//System.out.printf(\" distance value of row %i in col %i : %s %n\", i, k ,EucledianDistanceUnsorted.get(i).get(k));\t\t\n\t\t\t}\n\t\t\n\t\t\t//start at index 1 discard the attribute name row\n\t\t\t/*for ( int i = 0; i < (this.Extracted_TrainingDataset.length-1) ; i++) {\t\t\n\t\t\t\tSystem.out.print(\" distance value of row \");\n\t\t\t\tSystem.out.print(p);\n\t\t\t\tSystem.out.print(\" in col \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" = \");\n\t\t\t\tSystem.out.print(EucledianDistanceUnsorted.get(p).get(i));\n\t\t\t\tSystem.out.println(\"\");\t\n\t\t\t}*/\n\t\t\t\n\t\t System.out.print(\"Count : \");\n\t\t System.out.println(p);\n\t\t}\n\t\n\t\tSystem.out.println(\"About to sort distance\");\n\t\t\n\t\tfor( int i = 1; i < (EucledianDistanceUnsorted.size()-1); i++){\n\t\t\tArrayList<Double> temp = EucledianDistanceUnsorted.get(i);\n\t\t\tCollections.sort(temp);\n\t\t\tfor(int k=0; k < (this.Extracted_TrainingDataset.length- 1); k++) {\n\t\t\t\tEucledianDistanceSorted.get(i).add(temp.get(k));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\" Sorted eucledian distance of first k values \");\n\t\tfor(int i=1; i < EucledianDistanceSorted.size()-1; i++) {\n\t\t\tfor(int k=0; k < (this.ValueofK); k++) {\n\t\t\t\tSystem.out.print(EucledianDistanceSorted.get(i).get(k));\n\t\t\t\tSystem.out.print(\" , \");\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\" finding class of first k points \");\n\t\t// find majority distance and find index of distance in unsorted distance \n\t\tdouble majority = 0.0;\n\t\tint IndexofDistance = 0;\n\t\tfor(int i=1; i < (EucledianDistanceSorted.size()-1); i++) {\n\t\t\t\n\t\t\t\tmajority = findMajority(EucledianDistanceSorted.get(i), this.ValueofK);\n\t\t\t\tSystem.out.print(\" index : \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" majority : \");\n\t\t\t\tSystem.out.println(majority);\n\t\t\t\tIndexofDistance = findIndexofMajority(majority,EucledianDistanceUnsorted.get(i));\n\n\t\t\t\t//System.out.print(\" test row original class :\");\n\t\t\t\t//System.out.println(this.Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\tconfusionmatrix.addTrueValue(Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\t//System.out.print(\" predectived training row classifier : \");\n\t\t\t\t//System.out.println(this.Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\t\n\t\t\t\tconfusionmatrix.addPrediction(Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Total number of predictions: \" + confusionmatrix.TotalNumberOfPredictions());\n\t\t\tSystem.out.println(\"Number of correct predictions: \"+confusionmatrix.Correct());\n\t\t\tSystem.out.println(\"Number of incorrect predictions: \"+confusionmatrix.Incorrect());\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"True positive (TP): correct positive prediction: \" + confusionmatrix.TruePositive());\n\t\t\tSystem.out.println(\"False positive (FP): incorrect positive prediction: \" + confusionmatrix.FalsePositive());\n\t\t\tSystem.out.println(\"True negative (TN): correct negative prediction: \" + confusionmatrix.TrueNegative());\n\t\t\tSystem.out.println(\"False negative (FN): incorrect negative prediction: \" +confusionmatrix.FalseNegative()); \n\t\t\tSystem.out.println(\"Error Rate: \"+confusionmatrix.ErrorRate());\n\t\t\tSystem.out.println(\"Accuracy Rate: \"+confusionmatrix.AccuracyRate());\n\t}", "private void euclidean(Node node, int d){\n int row1 = this.row;\n int col1 = this.col;\n int row2 = node.getRow();\n int col2 = node.getCol();\n\n double aSquared = Math.pow((row1-row2), 2);\n double bSquared = Math.pow((col1-col2), 2);\n\n if(d == 0) //Euclidean normal\n this.hVal = (float)Math.sqrt(aSquared+bSquared);\n else //Euclidean squared\n this.hVal = (float)(aSquared+bSquared);\n\n }", "public List<List<GenPolynomial<C>>> \n normalizeMatrix(int flen, List<List<GenPolynomial<C>>> M) { \n if ( M == null ) {\n return M;\n }\n if ( M.size() == 0 ) {\n return M;\n }\n List<List<GenPolynomial<C>>> N = new ArrayList<List<GenPolynomial<C>>>();\n List<List<GenPolynomial<C>>> K = new ArrayList<List<GenPolynomial<C>>>();\n int len = M.get( M.size()-1 ).size(); // longest row\n // pad / extend rows\n for ( List<GenPolynomial<C>> row : M ) {\n List<GenPolynomial<C>> nrow = new ArrayList<GenPolynomial<C>>( row );\n for ( int i = row.size(); i < len; i++ ) {\n nrow.add( null );\n }\n N.add( nrow );\n }\n // System.out.println(\"norm N fill = \" + N);\n // make zero columns\n int k = flen;\n for ( int i = 0; i < N.size(); i++ ) { // 0\n List<GenPolynomial<C>> row = N.get( i );\n if ( debug ) {\n logger.info(\"row = \" + row);\n }\n K.add( row );\n if ( i < flen ) { // skip identity part\n continue;\n }\n List<GenPolynomial<C>> xrow;\n GenPolynomial<C> a;\n //System.out.println(\"norm i = \" + i);\n for ( int j = i+1; j < N.size(); j++ ) {\n List<GenPolynomial<C>> nrow = N.get( j );\n //System.out.println(\"nrow j = \" +j + \", \" + nrow);\n if ( k < nrow.size() ) { // always true\n a = nrow.get( k );\n //System.out.println(\"k, a = \" + k + \", \" + a);\n if ( a != null && !a.isZERO() ) {\n xrow = blas.scalarProduct( a, row);\n xrow = blas.vectorAdd(xrow,nrow);\n //System.out.println(\"xrow = \" + xrow);\n N.set( j, xrow );\n }\n }\n }\n k++;\n }\n //System.out.println(\"norm K reduc = \" + K);\n // truncate \n N.clear();\n for ( List<GenPolynomial<C>> row: K ) {\n List<GenPolynomial<C>> tr = new ArrayList<GenPolynomial<C>>();\n for ( int i = 0; i < flen; i++ ) {\n tr.add( row.get(i) );\n }\n N.add( tr );\n }\n K = N;\n //System.out.println(\"norm K trunc = \" + K);\n return K;\n }", "@Override\n\tpublic double[][] calc() {\n\t\tfor (int i=0; i<this.singleMatrix.length; i++) {\n\t\t\t\n\t\t\tfor (int j=0; j<this.singleMatrix[i].length; j++) {\n\t\t\t\t\n\t\t\t\tthis.inverse = new double[this.singleMatrix.length][this.singleMatrix[i].length];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif (this.det != 0) {\t//if determinant is not 0.\n\t\t\t\n\t\t\tfor (int i=0; i<this.singleMatrix.length; i++) {\t\n\t\t\t\t\n\t\t\t\tfor (int j=0; j<this.singleMatrix[i].length; j++) {\n\t\t\t\t\t\n\t\t\t\t\tthis.cT = new double[this.singleMatrix.length][this.singleMatrix[i].length];\t//declare the size of co-factor matrix transposed\n\n\t\t\t\t\tthis.cT[i][j] = this.coFactor[j][i];\t//the rows of cT = the cols of coFactor matrix. the cols of cT = the rows of coFactor matrix\n\t\t\t\t\t\n\t\t\t\t\t/* # you might want to initialize this.inverse and calculate right after the above cT calculation done as follow,\n\t\t\t\t\t \n\t\t\t\t\t \t--------------------------------------------------------------------------------------\n\t\t\t\t\t \t- this.inverse = new double[this.singleMatrix.length][this.singleMatrix[i].length]; -\n\t\t\t\t\t \t- this.inverse[i][j] = 1 / this.det * this.cT[i][j]; -\n\t\t\t\t\t \t--------------------------------------------------------------------------------------\n\t\t\t\t\t \n\t\t\t\t\t technically, it's not really a problem when it comes to initializing one more variable in the same loop.\n\t\t\t\t\t however, this specific situation, that three variables (coFacotr, cT and inverse) and their values are involved in, occurs an unexpected result which is still not an error.\n\t\t\t\t\t \n\t\t\t\t\t this.coFactor is done in a loop in initializing and calculating \n\t\t\t\t\t this.cT and this.inverse are done in a loop in initializing and calculating\n\t\t\t\t\t \n\t\t\t\t\t # thus, calculation goes as it goes and this.inverse will be kept initializing until the loop ends.\n\t\t\t\t\t this.inverse will then always & only store its running value at a current location depending on increment of i and j.\n\t\t\t\t\t you will see only one result at the last index and won't see all the values stored correctly.\n\t\t\t\t\t (all of the values will be zero except the last value at the last index)\n\t\t\t\t\t \n\t\t\t\t\t # one simple solution is to initialize and calculate a variable -inverse in this case- in a separate for-loop\n\t\t\t\t\t \n\t\t\t\t\t */\n\n\t\t\t\t\t//calculate inverse here but initialize it in another for-loop\n\t\t\t\t\tthis.inverse[i][j] = 1 / this.det * this.cT[i][j]; //formula: A-1 = 1 / det * cT\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t}else {\t//det is 0\n\t\t\t\n\t\t\tSystem.out.println(\"\\nThe matrix is a singular. singular matrices can not have inverses.\");\n\t\t}\n\t\t\n\t\t//print\n\t\tSystem.out.println(\"\\nInverse of the current matrix is: \");\n\t\tfor (int i=0; i<this.singleMatrix.length; i++) {\n\t\t\t\t\t\n\t\t\tfor (int j=0; j<this.singleMatrix[i].length; j++) {\n\t\t \t\t\n\t\t\t\tSystem.out.print(String.format(\"%.2f\", this.inverse[i][j]) + \" \");\t//display the result with a space between value representing as two decimal point\n//\t\t\t\tSystem.out.print(this.inverse[i][j] + \" \");\t//display the result with a space between value representing as two decimal point\n\t\t\t}\n\t\tSystem.out.println();\t//a new line for the next row and cols\n\t\t}\n\t\t\n\t\treturn inverse;\t//return the value of inverse\n\t}", "public Matrix getD() {\n Matrix x = new DenseMatrix(n, n);\n x.assign(0);\n x.viewDiagonal().assign(d);\n for (int i = 0; i < n; i++) {\n double v = e.getQuick(i);\n if (v > 0) {\n x.setQuick(i, i + 1, v);\n } else if (v < 0) {\n x.setQuick(i, i - 1, v);\n }\n }\n return x;\n }", "private IMatrix cofactor() {\n\t\tint n = this.getColsCount();\n\t\tIMatrix algCompl = newInstance(n, n);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tdouble value = Math.pow(-1, i + j);\n\t\t\t\tIMatrix sub = this.subMatrix(i, j, true);\n\t\t\t\tDouble det = sub.determinant();\n\t\t\t\tvalue *= det;\n\t\t\t\talgCompl.set(i, j, value);\n\t\t\t}\n\t\t}\n\t\treturn algCompl;\n\t}", "private void tred2() {\n // This is derived from the Algol procedures tred2 by\n // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for\n // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding\n // Fortran subroutine in EISPACK.\n\n d.assign(v.viewColumn(n - 1));\n\n // Householder reduction to tridiagonal form.\n\n for (int i = n - 1; i > 0; i--) {\n\n // Scale to avoid under/overflow.\n\n double scale = d.viewPart(0, i).norm(1);\n double h = 0.0;\n\n\n if (scale == 0.0) {\n e.setQuick(i, d.getQuick(i - 1));\n for (int j = 0; j < i; j++) {\n d.setQuick(j, v.getQuick(i - 1, j));\n v.setQuick(i, j, 0.0);\n v.setQuick(j, i, 0.0);\n }\n } else {\n\n // Generate Householder vector.\n\n for (int k = 0; k < i; k++) {\n d.setQuick(k, d.getQuick(k) / scale);\n h += d.getQuick(k) * d.getQuick(k);\n }\n double f = d.getQuick(i - 1);\n double g = Math.sqrt(h);\n if (f > 0) {\n g = -g;\n }\n e.setQuick(i, scale * g);\n h -= f * g;\n d.setQuick(i - 1, f - g);\n for (int j = 0; j < i; j++) {\n e.setQuick(j, 0.0);\n }\n\n // Apply similarity transformation to remaining columns.\n\n for (int j = 0; j < i; j++) {\n f = d.getQuick(j);\n v.setQuick(j, i, f);\n g = e.getQuick(j) + v.getQuick(j, j) * f;\n for (int k = j + 1; k <= i - 1; k++) {\n g += v.getQuick(k, j) * d.getQuick(k);\n e.setQuick(k, e.getQuick(k) + v.getQuick(k, j) * f);\n }\n e.setQuick(j, g);\n }\n f = 0.0;\n for (int j = 0; j < i; j++) {\n e.setQuick(j, e.getQuick(j) / h);\n f += e.getQuick(j) * d.getQuick(j);\n }\n double hh = f / (h + h);\n for (int j = 0; j < i; j++) {\n e.setQuick(j, e.getQuick(j) - hh * d.getQuick(j));\n }\n for (int j = 0; j < i; j++) {\n f = d.getQuick(j);\n g = e.getQuick(j);\n for (int k = j; k <= i - 1; k++) {\n v.setQuick(k, j, v.getQuick(k, j) - (f * e.getQuick(k) + g * d.getQuick(k)));\n }\n d.setQuick(j, v.getQuick(i - 1, j));\n v.setQuick(i, j, 0.0);\n }\n }\n d.setQuick(i, h);\n }\n\n // Accumulate transformations.\n\n for (int i = 0; i < n - 1; i++) {\n v.setQuick(n - 1, i, v.getQuick(i, i));\n v.setQuick(i, i, 1.0);\n double h = d.getQuick(i + 1);\n if (h != 0.0) {\n for (int k = 0; k <= i; k++) {\n d.setQuick(k, v.getQuick(k, i + 1) / h);\n }\n for (int j = 0; j <= i; j++) {\n double g = 0.0;\n for (int k = 0; k <= i; k++) {\n g += v.getQuick(k, i + 1) * v.getQuick(k, j);\n }\n for (int k = 0; k <= i; k++) {\n v.setQuick(k, j, v.getQuick(k, j) - g * d.getQuick(k));\n }\n }\n }\n for (int k = 0; k <= i; k++) {\n v.setQuick(k, i + 1, 0.0);\n }\n }\n d.assign(v.viewRow(n - 1));\n v.viewRow(n - 1).assign(0);\n v.setQuick(n - 1, n - 1, 1.0);\n e.setQuick(0, 0.0);\n }", "public double[][] calculateLocation(double[] distances, double[][] positions) {\r\n int numDimensions = positions[0].length;\r\n int numSamples = positions.length;\r\n\r\n RealMatrix a = new Array2DRowRealMatrix(numDimensions, 1);\r\n RealMatrix b = new Array2DRowRealMatrix(numDimensions, numDimensions);\r\n RealMatrix c = new Array2DRowRealMatrix(numDimensions, 1);\r\n RealMatrix h = new Array2DRowRealMatrix(numDimensions, numDimensions);\r\n double qTransposeTimesQFirstTerm = 0;\r\n double qTransposeTimesQSecondTerm = 0;\r\n // Calculate a, b, c, and partially calculate h\r\n for(int i = 0; i < numSamples; i++) {\r\n RealMatrix position = new Array2DRowRealMatrix(positions[i]);\r\n RealMatrix transposePosition = position.transpose();\r\n RealMatrix posTimesTranspose = position.multiply(transposePosition);\r\n double distanceSquared = distances[i]*distances[i];\r\n qTransposeTimesQSecondTerm += distanceSquared;\r\n\r\n // a\r\n RealMatrix aLeftTerm = posTimesTranspose.multiply(position);\r\n RealMatrix aRightTerm = position.scalarMultiply(distanceSquared);\r\n a = a.add(aLeftTerm.subtract(aRightTerm));\r\n\r\n // b\r\n RealMatrix bLeftTerm = posTimesTranspose.scalarMultiply(-2);\r\n RealMatrix identity = MatrixUtils.createRealIdentityMatrix(numDimensions);\r\n double transposeTimesPos = transposePosition.multiply(position).getEntry(0, 0);\r\n RealMatrix bMiddleTerm = identity.scalarMultiply(transposeTimesPos);\r\n RealMatrix bRightTerm = identity.scalarMultiply(distanceSquared);\r\n b = b.add(bLeftTerm.subtract(bMiddleTerm).add(bRightTerm));\r\n\r\n // c\r\n c = c.add(position);\r\n\r\n // h\r\n h = h.add(posTimesTranspose);\r\n\r\n // qTransposeTimesQFirstTerm\r\n qTransposeTimesQFirstTerm += transposeTimesPos;\r\n }\r\n\r\n double inverseNumSamples = 1.0/numSamples;\r\n a = a.scalarMultiply(inverseNumSamples); // a's calculation done\r\n b = b.scalarMultiply(inverseNumSamples); // b's calculation done\r\n c = c.scalarMultiply(inverseNumSamples); // c's calculation done\r\n\r\n\r\n RealMatrix twoCTimesCTranspose = c.scalarMultiply(2).multiply(c.transpose());\r\n // Calculate f\r\n RealMatrix f = a.add(b.multiply(c)).add(twoCTimesCTranspose.multiply(c)); // f's calculation done\r\n\r\n // Calculate fPrime\r\n RealMatrix fPrime = new Array2DRowRealMatrix(numDimensions - 1, 1);\r\n for(int i = 0; i < fPrime.getRowDimension(); i++) {\r\n fPrime.setEntry(i, 0, f.getEntry(i, 0) - f.getEntry(numDimensions - 1, 0));\r\n }\r\n\r\n h = h.scalarMultiply(-2.0/numSamples).add(twoCTimesCTranspose); // h's calculation done\r\n\r\n\r\n // Calculate hPrime\r\n RealMatrix hPrime = new Array2DRowRealMatrix(numDimensions - 1, numDimensions);\r\n for(int i = 0; i < hPrime.getRowDimension(); i++) {\r\n for(int j = 0; j < hPrime.getColumnDimension(); j++) {\r\n hPrime.setEntry(i, j, h.getEntry(i, j) - h.getEntry(numDimensions - 1, j));\r\n }\r\n }\r\n\r\n QRDecomposition qrDecomp = new QRDecomposition(hPrime);\r\n RealMatrix q = qrDecomp.getQ();\r\n RealMatrix u = qrDecomp.getR();\r\n\r\n qTransposeTimesQFirstTerm *= -inverseNumSamples;\r\n qTransposeTimesQSecondTerm /= numSamples;\r\n double qTransposeTimesQThirdTerm = c.transpose().multiply(c).getEntry(0, 0);\r\n double qTransposeTimesQ = qTransposeTimesQFirstTerm + qTransposeTimesQSecondTerm + qTransposeTimesQThirdTerm;\r\n\r\n RealMatrix v = q.transpose().multiply(fPrime);\r\n\r\n\r\n double u11 = u.getEntry(0, 0);\r\n double u12 = u.getEntry(0, 1);\r\n double u13 = u.getEntry(0, 2);\r\n double u22 = u.getEntry(1, 1);\r\n double u23 = u.getEntry(1, 2);\r\n double v1 = v.getEntry(0, 0);\r\n double v2 = v.getEntry(1, 0);\r\n // Solving for values a, b, and c to be passed into the quadratic formula\r\n double quadraticA = Math.pow(((u12*u23)/(u11*u22)) - (u13/u11), 2) + Math.pow(u23/u22, 2) + 1;\r\n double quadraticB = 2 * ((((u12*v2)/(u11*u22))-( v1/u11 )) * (((u12*u23)/(u11*u22))-(u13/u11)) + ((u23*v2)/(u22*u22)));\r\n double quadraticC = Math.pow(((u12*v2)/(u11*u22))-(v1/u11), 2) + Math.pow(v2/u22, 2) - qTransposeTimesQ;\r\n\r\n\r\n // Using the quadratic equation, two possible solutions for q3 can be found\r\n double sqrtTerm = Math.sqrt(Math.abs((Math.pow(quadraticB, 2)) - (4*quadraticA*quadraticC)));\r\n\r\n double twoA = 2*quadraticA;\r\n\r\n RealMatrix qSol1 = new Array2DRowRealMatrix(numDimensions, 1);\r\n RealMatrix qSol2 = new Array2DRowRealMatrix(numDimensions, 1);\r\n\r\n // First q solution\r\n qSol1.setEntry(2, 0, (-quadraticB + sqrtTerm)/twoA);\r\n qSol1.setEntry(0, 0, threeDimensionalSolveQ1(u, v, qSol1.getEntry(2, 0)));\r\n qSol1.setEntry(1, 0, threeDimensionalSolveQ2(u, v, qSol1.getEntry(2, 0)));\r\n // Second q solution\r\n qSol2.setEntry(2, 0, (-quadraticB - sqrtTerm)/twoA);\r\n qSol2.setEntry(0, 0, threeDimensionalSolveQ1(u, v, qSol2.getEntry(2, 0)));\r\n qSol2.setEntry(1, 0, threeDimensionalSolveQ2(u, v, qSol2.getEntry(2, 0)));\r\n\r\n RealMatrix pSol1 = qSol1.add(c);\r\n RealMatrix pSol2 = qSol2.add(c);\r\n\r\n\r\n RealMatrix solution;\r\n\r\n // If this is the first calculated position, then go through\r\n // the longer process of using the distance formula to determine\r\n // which of the solutions is most accurate. Otherwise, if it\r\n // is not the first calculated position, then just return the\r\n // solution that is closest to the previous position.\r\n if(previousPosition == null) {\r\n solution = calculateBestSolution(distances, positions, pSol1, pSol2);\r\n\r\n }\r\n else {\r\n solution = solutionClosestToPrevious(pSol1, pSol2);\r\n\r\n }\r\n\r\n previousPosition = solution;\r\n\r\n\r\n return solution.getData();\r\n\r\n }", "private void buildMatrix() {\n\n int totalnumber=this.patents.size()*this.patents.size();\n\n\n\n int currentnumber=0;\n\n\n for(int i=0;i<this.patents.size();i++) {\n ArrayList<Double> temp_a=new ArrayList<>();\n for (int j=0;j<this.patents.size();j++) {\n if (i==j) temp_a.add(0.0); else if (i<j)\n {\n double temp = distance.distance(this.patents.get(i), this.patents.get(j));\n temp = (new BigDecimal(temp).setScale(2, RoundingMode.UP)).doubleValue();\n temp_a.add(temp);\n\n\n // simMatrix.get(i).set(j, temp);\n // simMatrix.get(j).set(i, temp);\n } else {\n temp_a.add(simMatrix.get(j).get(i));\n }\n currentnumber++;\n System.out.print(\"\\r\"+ProgressBar.barString((int)((currentnumber*100/totalnumber)))+\" \"+currentnumber);\n\n }\n simMatrix.add(temp_a);\n }\n System.out.println();\n\n }", "public TreeDistanceMatrix(Tree t)\n\t{\n\t\tthis(t, false, 0.0);\n\t}", "public double oneNorm(){\r\n \tdouble norm = 0.0D;\r\n \tdouble sum = 0.0D;\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tsum=0.0D;\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\tsum+=Math.abs(this.matrix[i][j]);\r\n \t\t}\r\n \t\tnorm=Math.max(norm,sum);\r\n \t}\r\n \treturn norm;\r\n \t}", "private static double dist(Data d, Centroid c)\r\n \t{\r\n \t\treturn Math.sqrt(Math.pow((c.Y() - d.Y()), 2) + Math.pow((c.X() - d.X()), 2));\r\n \t}", "public void buildDistances(ArrayList<ParentVertex> allVertices){\n distances = new ArrayList<>();\n \n // For all vertices in this graph\n for (int i = 0; i < allVertices.size(); i++){\n \n // If the vertex at hand is not the same vertex\n if (this.key != allVertices.get(i).getKey()){\n double distanceToAdd = \n // Euclidean distance function (this vertex to list vertex)\n Math.sqrt(\n Math.pow((allVertices.get(i).getXPos() - this.xPos), 2) + \n Math.pow((allVertices.get(i).getYPos() - this.yPos), 2));\n\n // If this is the first distance pair, add it in\n if (distances.size() == 0){\n distances.add(new VertexDistancePair(allVertices.get(i).getKey(), distanceToAdd));\n }\n\n else {\n // Place this new vertexDistancePair where it belongs:\n // nearest to furthest distance\n for (int j = 0; j < distances.size(); j++){\n if (distanceToAdd <= distances.get(j).distance){\n distances.add(j, new VertexDistancePair(allVertices.get(i).getKey(), distanceToAdd));\n break;\n }\n else if (j == distances.size()-1){\n distances.add(new VertexDistancePair(allVertices.get(i).getKey(), distanceToAdd));\n break;\n }\n }\n }\n }\n }\n }", "public static void ITdistances()\n\t{\n\t\t//System.err.println(\"Position\");\n\n\t\tclade = clad[k];\n\n\t\tclade.tipDistance = 0;\n\t\tclade.intDistance = 0;\n\t\tclade.tipDisNested = 0;\n\t\tclade.intDisNested = 0;\n\t\tclade.indTipClades = 0;\n\t\tclade.indIntClades = 0;\n\n\n\t\tif(clade.check != (double) clade.numSubClades && clade.check != 0)\n\t\t{ \n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\tif (clade.Position[i] == tip)\n\t\t\t\t\tclade.indTipClades += clade.rowTotal[i];\n\t\t\t\telse\n\t\t\t\t\tclade.indIntClades += clade.rowTotal[i];\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\t// weigthing within class\n\t\t\t\tclade.tipDistance += clade.Position[i] * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.tipDisNested += clade.Position[i] * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\n\t\t\t\tclade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\t\n\t\t\t\t\n\t\t\t\t// unweighted\n\t\t\t\t//clade.tipDistance += clade.Position[i] * clade.Dc[i] / (double) clade.check;\n\t\t\t\t//clade.tipDisNested += clade.Position[i] * clade.Dn[i] / (double) clade.check;\n\t\t\t\t//clade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] / (double) (clade.numSubClades - clade.check);\n\t\t\t\t//clade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] / (double) (clade.numSubClades - clade.check);\t\n\t\t\t}\n\n\t\t clade.tipIntDistance = clade.intDistance - clade.tipDistance;\n\t\t clade.tipIntDisNested = clade.intDisNested - clade.tipDisNested;\n\t\t if(verbose){\n\t\t\tlogfile.println(\"\\nIT \" + clade.cladeName + \" indTipClades = \" + clade.indTipClades\n\t\t\t\t+ \" indIntClades + \" + clade.indIntClades);\n\t\t\tlogfile.println(\"\\nITc \" + clade.cladeName + \" meanInt = \" + clade.intDistance\n\t\t\t\t+ \" meanTip = \" + clade.tipDistance);\n\t\t\tlogfile.println(\"ITn \" + clade.cladeName + \" meanInt = \" + clade.intDisNested\n\t\t\t\t+ \" meanTip = \" + clade.tipDisNested);\n\t\t }\n\t\t}\n\n\t\t//System.err.println(\"IT clade \" + clade.cladeName + \" meanInt = \" + clade.intDistance + \" meanTip = \" + clade.tipDistance);\n\n\t}", "private static double[][] populateXMatrix(ArrayList<Double> _xValues)\n {\n // convert from Double to double\n xInputValues = new double[_xValues.size()];\n Iterator<Double> iterator = _xValues.iterator();\n int i = 0;\n while(iterator.hasNext())\n {\n xInputValues[i] = iterator.next().doubleValue();\n i++;\n }\n\n // double[][] to use to construct Matrix Object\n double[][] XArray = new double[d+1][d+1];\n for(int c = 0; c < XArray.length; c++)\n {\n for(int r = c; r < XArray[c].length; r++) // Using r = c doubles efficiency\n {\n XArray[r][c] = XArray[c][r] = SumX(2*d-r-c, xInputValues);\n }\n }\n return XArray;\n }", "public static double getEuclideanDistance(DblArray1SparseVector x, \r\n\t\t DblArray1SparseVector y) {\r\n if (x==null || y==null) \r\n\t\t\tthrow new IllegalArgumentException(\"at least one arg null\");\r\n if (x.getNumCoords()!=y.getNumCoords()) \r\n\t\t\tthrow new IllegalArgumentException(\"args of different dimensions\");\r\n\t\tfinal int n = x.getNumCoords();\r\n double dist = 0.0;\r\n\t\tif (Double.compare(x.getDefaultValue(),y.getDefaultValue())==0) {\r\n\t\t\tfinal int xs_nz = x.getNumNonZeros();\r\n\t\t\tfinal int ys_nz = y.getNumNonZeros();\r\n\t\t\tfinal double defVal = x.getDefaultValue();\r\n\t\t\tint x_ind = 0;\r\n\t\t\tint y_ind = 0;\r\n\t\t\twhile (x_ind<xs_nz || y_ind<ys_nz) {\r\n\t\t\t\tint x_pos = x_ind < xs_nz ? x.getIthNonZeroPos(x_ind) : \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tInteger.MAX_VALUE;\r\n\t\t\t\tint y_pos = y_ind < ys_nz ? y.getIthNonZeroPos(y_ind) :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tInteger.MAX_VALUE;\r\n\t\t\t\tif (y_pos < x_pos) {\r\n\t\t\t\t\tdouble yi = y.getIthNonZeroVal(y_ind)-defVal;\r\n\t\t\t\t\tdist += yi*yi;\r\n\t\t\t\t\ty_ind++;\r\n\t\t\t\t}\r\n\t\t\t\telse if (x_pos < y_pos) {\r\n\t\t\t\t\tdouble xi = x.getIthNonZeroVal(x_ind)-defVal;\r\n\t\t\t\t\tdist += xi*xi;\r\n\t\t\t\t\tx_ind++;\r\n\t\t\t\t}\r\n\t\t\t\telse { // x_pos==y_pos\r\n\t\t\t\t\tdouble xmyi = y.getIthNonZeroVal(y_ind)-x.getIthNonZeroVal(x_ind);\r\n\t\t\t\t\tdist += xmyi*xmyi;\r\n\t\t\t\t\tx_ind++;\r\n\t\t\t\t\ty_ind++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn Math.sqrt(dist);\r\n\t\t}\r\n for (int i=0; i<n; i++) {\r\n double xi = x.getCoord(i);\r\n double yi = y.getCoord(i);\r\n dist += (xi-yi)*(xi-yi);\r\n }\r\n return Math.sqrt(dist);\t\t\r\n\t}", "@Override\n\tpublic double calculaDiagonal() {\n\t\treturn 0;\n\t}", "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 }", "public void GE() {\n for (int pivot = 0; pivot < rowSize; pivot++) {\n if (matrix.get(pivot).get(pivot) < EPSILON) {\n for (int i = pivot + 1; i < rowSize; i++) {\n if (matrix.get(i).get(pivot) < EPSILON) {\n swapRow(pivot, i);\n break;\n }\n }\n }\n Vector<Double> row = matrix.get(pivot);\n int cores = Runtime.getRuntime().availableProcessors();\n ExecutorService threadPool = Executors.newFixedThreadPool(cores);\n Vector<TargetCell> cells = new Vector<>();\n int cellAmount = (rowSize - pivot - 1) * (colSize - pivot) / cores + 1;\n row = multiplyRow(row, 1 / row.get(pivot));\n for (int r = pivot + 1; r < rowSize; r++) {\n Double value = -1 * matrix.get(r).get(pivot) / row.get(pivot);\n for (int c = pivot; c < colSize; c++) {\n if (cells.size() >= cellAmount) {\n threadPool.submit(new GEThread(matrix, copy(cells)));\n cells.clear();\n }\n cells.add(new TargetCell(r, c, value));\n }\n }\n threadPool.shutdown();\n /*\n System.out.println();\n matrix.forEach((n) -> System.out.println(n));*/\n }\n }", "private static final double[][] computeDistances(Tree tree, IdGroup idGroup)\n\t{\n\t\treturn computeDistances(tree, idGroup, false, 0.0);\n\t}", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "public static void corrDistOut()\t\n\t{\t \n\t\n\t\tdouble c, n, w;\n\t\t\n\t\t//System.err.println(\"CORRDIST\");\n\n\t\tclade = clad[k];\n\t\n\t clade.meanDc = 0;\n\t clade.meanDn = 0;\n\t clade.meanWeight = 0;\n\t clade.sumDcxWeight = 0;\n\t clade.sumDnxWeight = 0;\n\t clade.sumDcSq = 0;\n\t clade.sumDnSq = 0;\n\t clade.sumWeightSq = 0;\n\t\t\n\t\tc = n = w = 0;\n\t\t\n\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t \tclade.meanDc += clade.Dc[i] / (double) clade.numSubClades;\n\t \tclade.meanDn += clade.Dn[i] / (double) clade.numSubClades;\n\t \tclade.meanWeight += clade.weight[i] / (double) clade.numSubClades;\n\t \tclade.sumDcxWeight += clade.Dc[i] * clade.weight[i];\n\t \tclade.sumDnxWeight += clade.Dn[i] * clade.weight[i];\n\t \tclade.sumDcSq += Math.pow (clade.Dc[i],2); \n\t \tclade.sumDnSq += Math.pow(clade.Dn[i],2); \n\t \tclade.sumWeightSq += Math.pow(clade.weight[i], 2);\n\t \t \t}\t\n\t \n\t c = clade.sumDcSq - (double) clade.numSubClades * Math.pow(clade.meanDc,2);\n\t n = clade.sumDnSq - (double) clade.numSubClades * Math.pow(clade.meanDn,2);\n\t \tw = clade.sumWeightSq - (double) clade.numSubClades * Math.pow(clade.meanWeight,2); \n\n\t\tif(clade.sumDcSq == 0 || c == 0 || w == 0)\n\t\t\tclade.corrDcWeights = NA; \n\t else\n\t\t\tclade.corrDcWeights = (clade.sumDcxWeight - (double)clade.numSubClades * clade.meanDc * clade.meanWeight) / (Math.sqrt(c*w));\n\n\t\tif(clade.sumDnSq == 0 || n == 0 || w == 0)\n\t\t\tclade.corrDnWeights = NA; \n\t else\n\t\t\tclade.corrDnWeights = (clade.sumDnxWeight - (double) clade.numSubClades * clade.meanDn * clade.meanWeight) / (Math.sqrt(n*w));\n\n\t if(clade.corrDcWeights > 1 && clade.corrDcWeights < 2)\n\t clade.corrDcWeights = 1;\n\t \n\t if(clade.corrDcWeights < -1)\n\t clade.corrDcWeights = -1;\n\t \n\t if(clade.corrDnWeights > 1 && clade.corrDnWeights < 2)\n\t clade.corrDnWeights = 1;\n\t \n\t if(clade.corrDnWeights < -1)\n\t clade.corrDnWeights = -1; \n\n\t\t//System.err.println(\"Correlations clade \" + clade.cladeName + \": \" + clade.corrDcWeights + \" \" + clade.corrDnWeights);\n\n\t}", "public Transition[] computeDistances(){\n\t\tSystem.out.println(\"Computing Transitions...\");\n\t\tTransition[] instanceTransitions = new Transition[nbBd*(nbBd-1)*4];\n\t\t//i sera l'indice de la cellule du tableau\n\t\tint i=0;\n\t\tfor (Strip aStrip : tabStrips){\n\t\t\tfor (Strip anotherStrip : tabStrips)\n\t\t\t\tif (aStrip != anotherStrip){\n\t\t\t\t\tdouble dist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t}//i != j\n\t\t\t//calcul de indMiddleTMin au fur et a mesure en utilisant des coefficients \n\t\t\t//pour eviter de depasser la taille maximale des int \n\t\t\tint divider = ((2*i) / ((nbBd-1) * 4));\n\t\t\tindMiddleTMin = ((indMiddleTMin * (divider - 2)) + (aStrip.indTMin0 + aStrip.indTMin1)) / divider;\n\t\t}//for\n\t\treturn instanceTransitions;\n\t}", "public abstract double calculateDistance(double[] x1, double[] x2);", "double getDistance(int i, int j){\r\n\tdouble d = (coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0])+ (coord[i][1]-coord[j][1])*(coord[i][1]-coord[j][1]);\r\n\td = Math.sqrt(d);\r\n\treturn d;\r\n}", "public DistanceMatrix getDistanceMatrix() {\n\t\tsynchronized(this) {\n\t\t\treturn distanceMatrix;\n\t\t}\n\t}", "void updateDistMatrix(long timeStamp) {\n\n\t\t\t// for each alive landmark, when its ping results are received by\n\t\t\t// the source node,\n\t\t\t// we start the clustering computation process\n\t\t\t// TODO: remove landmarks that return a subset of results 10-12\n\t\t\tLong timer = Long.valueOf(timeStamp);\n\n\t\t\tif (!pendingHSHLandmarks.containsKey(timer)\n\t\t\t\t\t|| pendingHSHLandmarks.get(timer).IndexOfLandmarks == null) {\n\t\t\t\tSystem.err.println(\"$: Null elements!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tHSHRecord CurList = pendingHSHLandmarks.get(timer);\n\t\t\tint NoOfLandmarks = CurList.IndexOfLandmarks.size();\n\t\t\tif(NoOfLandmarks<=0){\n\t\t\t\tSystem.err.println(\"$: Empty elements!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tHashMap<AddressIF, ArrayList<RemoteState<AddressIF>>> LatRecords = CurList.pendingLandmarkLatency;\n\t\t\tif (LatRecords == null) {\n\t\t\t\tSystem.err\n\t\t\t\t\t\t.println(\"$: Null HashMap<AddressIF, ArrayList<RemoteState<AddressIF>>> LatRecords!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tint receivedLandmarks = LatRecords.keySet().size();\n\t\t\t// empty or incomplete records\n\t\t\tif (LatRecords.isEmpty() || receivedLandmarks < 0.8 * NoOfLandmarks) {\n\t\t\t\tSystem.err.println(\"$: Null LatRecords!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"$: HSH: total landmarks: \" + NoOfLandmarks\n\t\t\t\t\t+ \", received from \" + receivedLandmarks);\n\t\t\t// use the IndexOfLandmarks as the index of nodes\n\n\t\t\tif (CurList.DistanceMatrix == null\n\t\t\t\t\t|| CurList.DistanceMatrix.length != NoOfLandmarks) {\n\t\t\t\tCurList.DistanceMatrix = null;\n\t\t\t\tCurList.DistanceMatrix = new double[NoOfLandmarks][NoOfLandmarks];\n\t\t\t\tfor (int i = 0; i < NoOfLandmarks; i++) {\n\t\t\t\t\tfor (int j = 0; j < NoOfLandmarks; j++) {\n\t\t\t\t\t\tCurList.DistanceMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// fill elements\n\t\t\tIterator<Entry<AddressIF, ArrayList<RemoteState<AddressIF>>>> entrySet = LatRecords\n\t\t\t\t\t.entrySet().iterator();\n\n\t\t\twhile (entrySet.hasNext()) {\n\t\t\t\tEntry<AddressIF, ArrayList<RemoteState<AddressIF>>> tmp = entrySet\n\t\t\t\t\t\t.next();\n\t\t\t\t// empty lists\n\t\t\t\tif (tmp.getValue() == null || tmp.getValue().size() == 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// ===============================================================\n\t\t\t\tAddressIF srcNode = tmp.getKey();\n\t\t\t\t// find the index of landmarks\n\t\t\t\tint from = CurList.IndexOfLandmarks.indexOf(srcNode);\n\t\t\t\tIterator<RemoteState<AddressIF>> ier = tmp.getValue()\n\t\t\t\t\t\t.iterator();\n\t\t\t\tif (from < 0) {\n\t\t\t\t\t// already removed landmarks!\n\t\t\t\t\tSystem.out.println(\"already removed landmarks!\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\twhile (ier.hasNext()) {\n\t\t\t\t\tRemoteState<AddressIF> NP = ier.next();\n\n\t\t\t\t\tif (!CurList.IndexOfLandmarks.contains(NP.getAddress())) {\n\t\t\t\t\t\t// not landmarks\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tint to = CurList.IndexOfLandmarks.indexOf(NP.getAddress());\n\n\t\t\t\t\tdouble rtt = NP.getSample();\n\t\t\t\t\tif (to < 0 || rtt < 0) {\n\t\t\t\t\t\tSystem.err.println(\"$: failed to find the landmarks!\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// System.out.print(\" <\"+to+\", \"+from+\", \"+rtt+\"> \");\n\t\t\t\t\t\t// Note: symmetric RTT\n\t\t\t\t\t\tif (CurList.DistanceMatrix[to][from] > 0) {\n\t\t\t\t\t\t\tdouble avgRTT;\n\t\t\t\t\t\t\tif (rtt > 0) {\n\t\t\t\t\t\t\t\tavgRTT = (rtt + CurList.DistanceMatrix[to][from]) / 2;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tavgRTT = CurList.DistanceMatrix[to][from];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCurList.DistanceMatrix[from][to] = avgRTT;\n\t\t\t\t\t\t\tCurList.DistanceMatrix[to][from] = avgRTT;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// TODO: missing elements\n\t\t\t\t\t\t\tCurList.DistanceMatrix[from][to] = rtt;\n\t\t\t\t\t\t\tCurList.DistanceMatrix[to][from] = rtt;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ======================================================\n\n\t\t\tboolean markZero = false;\n\t\t\tfor (int i = 0; i < NoOfLandmarks; i++) {\n\t\t\t\tint sum = 0;\n\t\t\t\tfor (int column = 0; column < NoOfLandmarks; column++) {\n\t\t\t\t\tif (i == column) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (CurList.DistanceMatrix[i][column] > 0) {\n\t\t\t\t\t\tsum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (sum < 0.7 * NoOfLandmarks) {\n\t\t\t\t\tmarkZero = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (markZero) {\n\t\t\t\t// CurList.DistanceMatrix=null;\n\t\t\t\tSystem.err.println(\"$: incomplete CurList.DistanceMatrix!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"\\n\\n$: HSH: Start HSH clustering computation process!\");\n\n\t\t\t// TODO: find accurate clustering number\n\t\t\tint cluNum = MatrixOps.findClusteringNum(CurList.DistanceMatrix);\n\n\t\t\tif(cluNum<=0){\n\t\t\t\tSystem.err.println(\"the clustering number is <=0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t// version control for dimensions\n\t\t\tif (CurList.S != null && CurList.S.length == cluNum) {\n\n\t\t\t} else {\n\t\t\t\tCurList.version = System.currentTimeMillis();\n\t\t\t}\n\n\t\t\t// initialize the matrixes for computation\n\t\t\tCurList.H = new double[NoOfLandmarks][cluNum];\n\t\t\tCurList.S = new double[cluNum][cluNum];\n\t\t\t// CurList.Coord = new double[cluNum];\n\t\t\tfor (int i = 0; i < NoOfLandmarks; i++) {\n\t\t\t\tfor (int j = 0; j < cluNum; j++) {\n\t\t\t\t\tCurList.H[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < cluNum; i++) {\n\t\t\t\tfor (int j = 0; j < cluNum; j++) {\n\t\t\t\t\tCurList.S[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// update coordinate vectors\n\t\t\tMatrixOps.symmetric_NMF(NoOfLandmarks, cluNum,\n\t\t\t\t\tCurList.DistanceMatrix, CurList.H, CurList.S);\n\t\t\tCurList.alreadyComputedClustering = true;\n\n\t\t\t// TODO: H,S is Null\n\t\t\tif (CurList.H == null || CurList.S == null) {\n\t\t\t\tSystem.err.println(\"$: after HSH computation, NULL results!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// after centralized computation, the core node should send its H &\n\t\t\t// S to all the landmark nodes\n\t\t\tissueCoords(timeStamp, CurList.IndexOfLandmarks, new CB1<String>() {\n\t\t\t\tprotected void cb(CBResult ncResult, String errorString) {\n\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t.println(\"Core node has issued its H & S to all landmarks.\");\n\t\t\t\t}\n\t\t\t});\n\t\t}", "private static long[][] generatePerfectSquares() {\n ArrayList<Long> a = new ArrayList<>(10000);\n ArrayList<Long> b = new ArrayList<>(10000);\n\n for (long i = 1; i < 1000000; i += 2) {\n long sqr = i * i;\n if ((i + 1) % 4 == 0) {\n a.add(sqr);\n }\n\n if ((i + 1) % 3 == 0) {\n b.add(sqr);\n }\n }\n\n long[][] res = new long[2][];\n res[0] = new long[a.size()];\n res[1] = new long[b.size()];\n\n for (int i = 0; i < a.size(); i++) {\n res[0][i] = a.get(i);\n }\n\n for (int i = 0; i < b.size(); i++) {\n res[1][i] = b.get(i);\n }\n\n return res;\n }", "public void constructGraph() {\n graph = new double[array.length][array.length];\n for (int i = 0; i < graph.length; i++) {\n Crime c1 = array[i];\n for (int j = 0; j < graph.length; j++) {\n Crime c2 = array[j];\n graph[i][j] = ((c1.getX() - c2.getX()) * (c1.getX() - c2.getX()) +\n (c1.getY() - c2.getY()) * (c1.getY() - c2.getY()));\n }\n }\n }", "public void recalculateDistanceFunction()\r\n {\n findBoundaryGivenPhi();\r\n \r\n active.removeAllElements();\r\n\tfor(int i=0; i<pixelsWide; i++)\r\n\t\tfor(int j=0; j<pixelsHigh; j++)\r\n\t\t\t{\r\n if(!boundary.contains(new Int2d(i,j))) phi[i][j] = phiStart;\r\n //else System.out.println(\"Boundary point at i,j = \" + i + \", \" + j + \" with phi = \" + phi[i][j]);\r\n\t\t\t}\r\n \r\n //System.out.println(\"Building Initial Band\");\r\n\tbuildInitialBand(); \r\n \r\n //System.out.println(active.size());\r\n \r\n //System.out.println(\"Running Algorithm\");\r\n\twhile(active.size()>0)\r\n\t\t{\r\n\t\trunAlgorithmStep();\r\n\t\t}\r\n\t\r\n //System.out.println(\"Distance function calculated\");\r\n\t//maxPhi = findMaxPhi();\r\n }", "private static DenseMatrix generateRandomMatrix (int rows, int cols, int m_seed){\n\n Random random_value = new Random(m_seed);\n DenseMatrix randomMX = new DenseMatrix(rows, cols);\n for (int i=0; i<rows; i++){\n for (int j=0; j<cols;j++){\n randomMX.set(i,j, random_value.nextDouble());\n }\n }\n return randomMX;\n }", "private double[] energyVector(double[][] distanceMatrix) {\r\n // Ignore the set (maxSize + 1)'th archive member since it's the new\r\n // solution that is tested for eligibility of replacement.\r\n double[] energyVector = new double[distanceMatrix.length - 1];\r\n for (int i = 0; i < energyVector.length - 1; i++) {\r\n for (int j = i + 1; j < energyVector.length; j++) {\r\n energyVector[i] += scalarization.getAttribute(archive.get(j)) / distanceMatrix[i][j];\r\n energyVector[j] += scalarization.getAttribute(archive.get(i)) / distanceMatrix[i][j];\r\n }\r\n energyVector[i] *= scalarization.getAttribute(archive.get(i));\r\n }\r\n return energyVector;\r\n }", "public double[][] monteCarloEigenValues(){\n if(!this.monteCarloDone)this.monteCarlo();\n return this.randomEigenValues;\n }", "private void initMleCluster() {\n\t\tpseudoTf = new double[documents.size()][];\n\t\tpseudoTermIndex = new int[documents.size()][];\n\t\tpseudoTermWeight = new double[documents.size()][];\n\t\t\n\t\tfor(int docIdx=0; docIdx<documents.size(); docIdx++) {\n\t\t\tcountOnePseudoDoc(docIdx);\n\t\t}\n\t}", "public double norm() {\n\t\thomogenize();\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}", "public DenseMatrix( int rows , int columns )\n\t{\n\t\tsuper( rows , columns );\n\n\t\tmatrixData\t\t= new double[ rows ][ columns ];\n\t}", "public DoubleMatrix2D start(Instances data) {\n\t\tDoubleMatrix2D distanceMatrix = Methods.createDistanceMatrix(data);\n\t\tdouble baselineCosts = Methods.baselineMatrixNormal(distanceMatrix);\n\t\t// Create graph from the given dataset\n\t\tgraph = Methods.createGraph(data, distanceMatrix, 1.0);\n\n\t\tif (Parameters.DEBUG) {\n\t\t\tSystem.out.println(\"BaselineCosts: \" + baselineCosts);\n\t\t\tSystem.out.println(\"Instances \" + data.numInstances());\n\t\t\tSystem.out.println(\"Edges \" + graph.getEdgeCount());\n\t\t}\n\t\t// Calculates the codingCosts of the adjacencymatrix\n\t\tdouble graphCodingCosts = Methods.codingCostsGraph(graph);\n\t\tdouble regressionError = Methods.Regression(graph, distanceMatrix, data).getSumSquaredErrors();\n\t\tint k = (int) Math.log(data.numInstances());\n\t\twhile ((graphCodingCosts + regressionError) * 1.5 < baselineCosts) {\n\t\t\tfor (int i = 0; i < distanceMatrix.columns(); i++) {\n\t\t\t\tList<Pair> orderOfAddedEdges = MethodsKNN.createOrderedList(distanceMatrix.viewColumn(i), i);\n\t\t\t\tfor (int j = 0; j < k; j++) {\n\t\t\t\t\tint column = orderOfAddedEdges.get(j).getX();\n\t\t\t\t\tint row = orderOfAddedEdges.get(j).getY();\n\t\t\t\t\tgraph.addEdge(new MyLink(distanceMatrix.get(i, j)), data.instance(column), data.instance(row));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update\n\t\t\tregressionError = Methods.Regression(graph, distanceMatrix, data).getSumSquaredErrors();\n\t\t\tgraphCodingCosts = Methods.codingCostsGraph(graph);\n\t\t\tif (Parameters.DEBUG) {\n\t\t\t\tSystem.out.println(\"Graphkodierungskosten: \" + graphCodingCosts + \" k \" + k + \" coding \"\n\t\t\t\t\t\t+ regressionError);\t\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t\treturn Methods.fromGraphToSimMatrix(data, graph, distanceMatrix);\n\t}", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "public void normalize() {\n float length = (float)Math.sqrt(nx * nx + ny * ny);\n nx/=length;\n ny/=length;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n mNodes = sc.nextInt();\n mEdges = sc.nextInt();\n \n mDistances = new int[mNodes+1][mNodes+1];\n \n for (int i =1; i <= mNodes; i++)\n {\n \n for (int j =1; j <=mNodes;j++)\n {\n mDistances[i][j] = Integer.MAX_VALUE;\n \n }\n }\n \n for (int i =1; i <= mNodes; i++)\n {\n mDistances[i][i] =0;\n }\n \n for (int i = 0 ; i < mEdges; i++)\n {\n int from = sc.nextInt();\n int to = sc.nextInt();\n \n mDistances[from][to] = sc.nextInt();\n \n \n }\n \n \n //FW\n \n for (int k = 1; k <= mNodes; k++)\n {\n \n for (int i = 1; i <= mNodes; i++)\n {\n \n for (int j = 1; j <= mNodes; j++)\n {\n \n if (mDistances[i][k]!= Integer.MAX_VALUE && mDistances[k][j] != Integer.MAX_VALUE )\n {\n if (mDistances[i][j] > mDistances[i][k] + mDistances[k][j])\n {\n \n mDistances[i][j] = mDistances[i][k] + mDistances[k][j];\n }\n \n }\n \n }\n }\n \n }\n \n mQueries = sc.nextInt();\n \n for (int i =0; i < mQueries; i++)\n {\n int dist = mDistances[sc.nextInt()][sc.nextInt()];\n \n if (dist == Integer.MAX_VALUE)\n {\n dist = -1;\n }\n \n System.out.println(dist);\n \n }\n \n \n \n \n \n \n \n \n \n }", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public static void twoStarAlign() {\n if (star1DcEq != null && star2DcEq != null) {\r\n star3DcEq = ccm.starVectorProduct(star1DcEq, star2DcEq);\r\n }\r\n if (star1DcTel != null && star2DcTel != null) {\r\n star3DcTel = ccm.starVectorProduct(star1DcTel, star2DcTel);\r\n }\r\n if (star3DcTel == null || star3DcEq == null) {\r\n //GuiUpdater.updateLog(\"Error: Null Matrixes found. Check your input!!\", Color.RED);\r\n \tLog.e(TAG, \"Error: Null Matrix calculation for 3rd star. Possible null matrixes\");\r\n }\r\n\r\n //Construct two 3X3 matrix for eq direction cosines \r\n //and telescope direction cosines\r\n double star1DcEqD[] = star1DcEq.getColumnPackedCopy();\r\n double star2DcEqD[] = star2DcEq.getColumnPackedCopy();\r\n double star3DcEqD[] = star3DcEq.getColumnPackedCopy();\r\n double starsDcEqD[][] = {\r\n {star1DcEqD[0], star2DcEqD[0], star3DcEqD[0]},\r\n {star1DcEqD[1], star2DcEqD[1], star3DcEqD[1]},\r\n {star1DcEqD[2], star2DcEqD[2], star3DcEqD[2]}};\r\n Matrix eqDirectionCosines = new Matrix(starsDcEqD);\r\n\r\n double star1DcTelD[] = star1DcTel.getColumnPackedCopy();\r\n double star2DcTelD[] = star2DcTel.getColumnPackedCopy();\r\n double star3DcTelD[] = star3DcTel.getColumnPackedCopy();\r\n double starsDcTelD[][] = {\r\n {star1DcTelD[0], star2DcTelD[0], star3DcTelD[0]},\r\n {star1DcTelD[1], star2DcTelD[1], star3DcTelD[1]},\r\n {star1DcTelD[2], star2DcTelD[2], star3DcTelD[2]}};\r\n Matrix telDirectionCosines = new Matrix(starsDcTelD);\r\n\r\n T = telDirectionCosines.times(eqDirectionCosines.inverse());\r\n //GuiUpdater.updateLog(\"Two Star Alignment completed successfuly!\");\r\n Log.i(TAG, \"++ twoStarAlign() ++ \\nT=\");\r\n T.print(5, 2);\r\n }", "public static void main(String[] args) {\n\t\tint[] a = new int[] {1,2,3,4};\n\t\tint [][] b = new int[2][2];\n\t\tint [][] c = new int[2][2];\n\t\tfor(int i=0;i<2;i++)\n\t\t\tfor(int j=0;j<2;j++) {\n\t\t\t\tb[i][j]=1;\n\t\t c[i][j]=0;\n\t\t\t}\n\t\tSystem.out.println(sqrt(15.9));\n\t\tSystem.out.println(a);\n\t\tSystem.out.println(matrix(b,c));\n\t}", "public double norm() {\r\n return Math.sqrt(innerProduct(this));\r\n }", "public void calcMatrix() {\n \n FockState rowState = new FockState(_systemSize, _epsilon, _mass);\n FockState opedState = new FockState(_systemSize, _epsilon, _mass);\n Integer column;\n int[] momenta = new int[_phiPow-1]; \n for(int row=0; row<_numStates; row++) {\n \n // Run through the matrix rows\n \t// Set the row state and create the row Map\n \t\n rowState.setAsIndex(row);\n Map<Integer, Double> rowMap = new HashMap<Integer, Double>();\n \t\t_elements.add(row, rowMap);\n\n \t// Reset the momenta combinations array\n \t\n \tfor(int i=0; i<(_phiPow-1); i++) {\n momenta[i]=0;\n } \n for(int j=0; j<_momCombs; j++) {\n \n // Run through the various momenta combinations\n \n for(int opType=0; opType<_opCombs; opType++) {\n \n // Run through the various operator combinations\n \n opedState.makeSameAs(rowState);\n applyOperators(opedState, momenta, opType); \n if(opedState.isValid()==true) {\n \t\n \t// Calculate the column\n \t\n \tcolumn = opedState.calcIndex(); \n \tif((column != null) && (column < _numStates)) {\n \t\t\n \t\t// If the resulting state is valid and within the cutoff, store the result\n \t\t\n \t\tstore(row, column, momenta);\n \n \t} \t\n } \n }\n \n // Increment the momenta label array unless this is the final run through\n \n if(j != (_momCombs-1)) {\n \tincrementMomentaLabel(momenta);\n } \n } \n }\n \n }", "public static HashMap<String,CPUParams> doMDS(DoubleMatrix probMatrix,int dim, double parinf, double parsup, HashMap<String,Integer> ids) {\n\t\tint N = ids.size() ;\n\t\tDoubleMatrix centeringMatrix = new DoubleMatrix(N,N) ;\n\t\tfor(int i = 0 ; i<N ; i++) {\n\t\t\tfor(int j = 0 ; j<N ; j++) {\n\t\t\t\tif(i==j)\n\t\t\t\t\tcenteringMatrix.put(i,j,1.0-(1.0/((double)N))) ;\n\t\t\t\telse \n\t\t\t\t\tcenteringMatrix.put(i,j,-(1.0/((double)N))) ;\n\t\t\t}\n\t\t}\n\t\t// Centrer\n\t\tprobMatrix = centeringMatrix.mmul(probMatrix).mmul(centeringMatrix) ;\n\t\t\n\t\t// Faire la MDS de probmatric centree.\n\t\tDoubleMatrix eig[] = Eigen.symmetricEigenvectors(probMatrix) ;\n\t\tDoubleMatrix eigVect = eig[0] ;\n\t\tDoubleMatrix eigVal = eig[1] ;\n\t\tArrayList<Double> eigvalueslist = new ArrayList<Double>() ;\n\t\tArrayList<DoubleMatrix> eigvectorslist = new ArrayList<DoubleMatrix>() ;\n\t\tint NposEig = 0 ;\n\t\tfor(int i=0 ; i<N ;i++) {\n\t\t\tDouble ev = eigVal.get(i,i) ;\n\t\t\tif(ev>0)\n\t\t\t\tNposEig++ ;\n\t\t\teigvalueslist.add(ev) ;\n\t\t\teigvectorslist.add(eigVect.getColumn(i)) ;\n\t\t\t\n\t\t}\n\t\tint MDSsize = Math.min(NposEig, dim) ;\n\t\tDoubleMatrix reducedEigVect = new DoubleMatrix(N,MDSsize) ;\n\t\tDoubleMatrix reducedEigVal = new DoubleMatrix(MDSsize,MDSsize) ;\n\t\tCollections.sort(eigvalueslist) ;\n\t\tCollections.reverse(eigvalueslist);\n\t\t\n\t\t\n\t\t//Filtrer les eigens\n\t\tfor(int i=0 ; i<MDSsize ; i++) {\n\t\t\tif(eigvalueslist.get(i)>0) {\n\t\t\t\treducedEigVal.put(i, i,Math.sqrt(eigvalueslist.get(i))) ;\n\t\t\t\treducedEigVect.putColumn(i, eigvectorslist.get(i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Faire la MDS\n\t\tDoubleMatrix mds = reducedEigVect.mmul(reducedEigVal) ;\n\t\t\n\t\tHashMap<String,CPUParams> r = new HashMap<String, CPUParams>() ;\n\t\tfor(String u : User.users.keySet()) {\n\t\t\tint id1 = ids.get(u) ;\n\t\t\tCPUParams cpu = new CPUParams(1, dim, 0.0,parinf,parsup) ;\n\t\t\tParameters pList = new Parameters(dim, 0.0) ;\n\t\t\tfor(int i=0 ; i<MDSsize ; i++) {\n\t\t\t\tpList.set(i, new Parameter(mds.get(id1, i)*parsup));\n\t\t\t}\n\t\t\tcpu.setParameters(pList);\n\t\t\tr.put(u, cpu) ;\n\t\t}\n\t\t\n\t\treturn r ;\n\t}", "public static void generatetripletmatrix() {\n\t\tresultMatrix = new int[3][numNonZero];\n\n\t // Generating result matrix\n\t int k = 0;\n\t for (int ro = 0; ro < row; ro++) {\n\t for (int column = 0; column < 6; column++) {\n\t if (matrix[ro][column] != 0)\n\t {\n\t resultMatrix[0][k] = ro;\n\t resultMatrix[1][k] = column;\n\t resultMatrix[2][k] = matrix[ro][column];\n\t k++;\n\t }\n\t }\n\t }\n\t \n\t}", "double getSquareDistance();", "private void initialize(int entitySize, int relationSize,int k){\n entityVectors = new ArrayList<double[]>();\n relationVectors = new ArrayList<double[]>();\n normalVectors = new ArrayList<double[]>();\n for (int i = 0; i < entitySize; i++){\n double[] eVector = helper.initVector(k);\n double[] normedEVector = helper.norm(eVector);\n entityVectors.add(normedEVector);\n }\n for(int j =0; j < relationSize; j++){\n double[] rVector = helper.initVector(k);\n double[] normRVector = helper.norm(rVector);\n double[] nVector = helper.initVector(k);\n double[]normNVector = helper.norm(nVector);\n relationVectors.add(normRVector);\n normalVectors.add(normNVector);\n }\n }", "private Distance(){}", "private static int[][] distanceGrid(final int[][] board) {\n final int numRows = board.length;\n final int numCols = board[0].length;\n\n final int distance = 0;\n\n final int[][] distanceGrid = new int[numRows][numCols];\n for (final int[] row : distanceGrid) {\n Arrays.fill(row, INACCESSABLE_SPACE_DISTANCE);\n }\n // For each space on the board\n for (int r = 0; r < numRows; r++) {\n nextBoardSpace:\n for (int c = 0; c < numCols; c++) {\n ArrayList<int[]> explored = new ArrayList<>();\n Queue<int[]> toExplore = new LinkedList<>();\n Map<String,Integer> dists = new HashMap<>();\n\n // Add the space to the explore queue\n toExplore.add(new int[] {r, c, 0});\n \n // While there is more to explore\n while (!toExplore.isEmpty()) {\n int[] currExplor = toExplore.remove();\n explored.add(currExplor);\n int explRow = currExplor[0];\n int explCol = currExplor[1];\n int explDist = currExplor[2];\n\n String key = Arrays.toString(new int[] {explRow, explCol});\n dists.put(key, 1);\n \n // If the space contains a player's move, add the distance to the \n //distanceGrid, and continue on the next boardspace\n if (board[explRow][explCol] > 0) {\n distanceGrid[r][c] = explDist;\n continue nextBoardSpace;\n }\n \n // Otherwise, if the space is empty, add it's neighbours to the queue\n if (board[explRow][explCol] == 0) {\n ArrayList<int[]> neighbours = Utils.neighbours(explRow, explCol, numRows, numCols);\n for (int[] neighbour : neighbours) {\n int[] temp = new int[] {neighbour[0], neighbour[1], explDist+1};\n if (dists.containsKey(key)) continue;\n toExplore.add(temp);\n }\n }\n }\n\n // If a path to one of our spaces is not found, space is inaccessable\n if (board[r][c] != 0) {\n distanceGrid[r][c] = -1;\n }\n\n }\n }\n return distanceGrid;\n }", "private static void calculateSimilarity() {\n \tLOG.info(\"Begin calculating spatial similarity between users.\");\n \t\n\t\t// Get a list of all users\n \tNeo4JUserDAO uDao = (Neo4JUserDAO) DAOFactory.instance().getUserDAO();\n\t\tList<Node> users = uDao.findAll();\n\t\t\n\t\tint usersCount = users.size();\n \tLOG.debug(\"Found {} users.\", usersCount);\n\t\t\n\t\t// Instantiate all needed classes for similarity measurement\n\t\tNeo4JSequenceExtractor ex = new Neo4JSequenceExtractor();\n\t\tex.setFromLevel(clArgs.calcSimilarityFromLevel);\n\t\tex.setToLevel(clArgs.calcSimilarityToLevel);\n\t\t\n\t\tNeo4JSequenceMatcher matcher = new Neo4JSequenceMatcher(\n\t\t\t\tclArgs.calcSimilaritySplitThreshold, \n\t\t\t\tclArgs.calcSimilarityMinSequenceLength,\n\t\t\t\tclArgs.calcSimilarityTempConstraintThreshold);\n\t\tNeo4JSimilarityAnalyzer analyzer = new Neo4JSimilarityAnalyzer();\n\t\t\n\t\t// Create matrix that holds similarity results\n\t\tdouble[][] similarityResults = new double[usersCount][usersCount];\n\t\t\n\t\t// Go through all pair-wise user combinations\n \tfor (int i = 0; i < usersCount; i++) {\n\t\t\tNode userOne = users.get(i);\n\t\t\tObject userOneId = uDao.getUserId(userOne);\n\t\t\t\n\t\t\t// Set current first user for sequence extraction\n\t\t\tex.setUserNodeOne(userOne);\n\t\t\t\n\t\t\tfor (int j = i + 1; j < usersCount; j++) {\n\t\t\t\tNode userTwo = users.get(j);\n\t\t\t\tObject userTwoId = uDao.getUserId(userTwo);\n\t\t\t\tLOG.info(\"Calculate similarity between user [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\n\t\t\t\tdouble similarity = 0.0;\n\t\t\t\t\n\t\t\t\t// Step 1: Extract cluster sequences of two users based on their hierarchical graphs\n\t\t\t\t// Set current second user for sequence extraction\n\t\t\t\tex.setUserNodeTwo(userTwo);\n\t\t\t\tMap<Integer, SequenceWrapper> clusterSequences = null;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t// Start extraction of cluster sequences\n\t\t\t\t\tLOG.info(\"Step 1: Extraction of cluster sequences from level {} to level {}.\", clArgs.calcSimilarityFromLevel, clArgs.calcSimilarityToLevel);\n\t\t\t\t\tclusterSequences = ex.extract();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(\"An error occurred while extracting the sequences of common clusters of user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Step 2: Match the extracted cluster sequences to find maximal length similar sequences\n\t\t\t\tMap<Integer, List<Sequence<SimilarSequenceCluster>>> maxLengthSimilarSequences = null;\n\t\t\t\t\n\t\t\t\t// Matching is only possible if there is a valid result of step 1 \n\t\t\t\tif (clusterSequences != null && !clusterSequences.isEmpty()) {\n\t\t\t\t\tmatcher.setSequencesOnLevel(clusterSequences);\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Start matching of cluster sequences\n\t\t\t\t\t\tLOG.info(\"Step 2: Matching of cluster sequences.\");\n\t\t\t\t\t\tmaxLengthSimilarSequences = matcher.match();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tLOG.error(\"An error occurred while matching the sequences of common clusters of user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t// Step 3: Compute spatial similarity between the current two users\n\t\t\t\t\t// Similarity measurement is only possible with a valid result of step 2\n\t\t\t\t\tif (maxLengthSimilarSequences != null && !maxLengthSimilarSequences.isEmpty()) {\n\t\t\t\t\t\tanalyzer.setUserNodeOne(userOne);\n\t\t\t\t\t\tanalyzer.setUserNodeTwo(userTwo);\n\t\t\t\t\t\tanalyzer.setMaximalLengthSimilarSequencesOnLevel(maxLengthSimilarSequences);\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Start similarity measurement\n\t\t\t\t\t\t\tLOG.info(\"Step 3: Similarity measurement.\");\n\t\t\t\t\t\t\tsimilarity = analyzer.analyze();\n\t\t\t\t\t\t\tLOG.debug(\"Final similarity score: {}\", similarity);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Save similarity value in result matrix\n\t\t\t\t\t\t\tsimilarityResults[i][j] = similarity;\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tLOG.error(\"An error occurred while measuring similarity between user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t// END: step 3\n\t\t\t\t}\t// END: step 2\n\t\t\t}\t// END: user two loop\n\t\t}\t// END: user one loop\n \t\n \tLOG.info(\"Finished calculating spatial similarity.\");\n \t\n \t// Normalize the similarity scores from 0 to 1\n \tif (clArgs.normalization) {\n\t \tLOG.info(\"Normalizing similarity scores.\");\n\t \tsimilarityResults = SimilarityNormalizer.normalize(similarityResults);\n \t}\n \t\n \t// The evaluation is requested\n \tif (clArgs.evaluation) {\n \t\tLOG.info(\"Evaluation is enabled.\");\n \t\t\n \t\t// Calculate simple evaluation\n \t\tLOG.info(\"Calculate similarity evaluation values.\");\n \t\tSimilarityEvaluation evaluation = SimilarityEvaluator.evaluate(similarityResults);\n \t\t\n \t\t// Build up other information to include in the evaluation files\n \t\tList<String> otherInformation = new ArrayList<String>();\n \t\tif (clArgs.automation) {\n \t\t\t// Clustering information is only included if the automation task is running\n \t\t\totherInformation.add(CommandLineArgs.CLUSTERING_OPTICS_XI);\n \t\t\totherInformation.add(String.valueOf(df.format(currentOpticsXi)));\n \t\t\totherInformation.add(CommandLineArgs.CLUSTERING_OPTICS_MIN_POINTS);\n \t\t\totherInformation.add(String.valueOf(df.format(currentOpticsMinPoints)));\n \t\t}\n \t\t\n \t\t// Add simple metrics from similarity measurement\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MIN);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getMin())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MAX);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getMax())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MEAN);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getSimilarityMean())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILAR_USER_PAIRS);\n \t\totherInformation.add(String.valueOf(evaluation.getSimilarUserPairs()));\n \t\t\n \t\t// Write similarity results in a file\n \t\tLOG.info(\"Writing evaluation data to a file.\");\n \t\tArrayToCsvWriter.writeDoubles(similarityResults, clArgs.evaluationOutDir, otherInformation.toArray(new String[0]));\n \t}\n \t// Evaluation is not requested, write the similarity scores into the graph database\n \telse {\n \t\tLOG.info(\"Write similarity scores to the graph database.\");\n \t\t\n \t\tfor (int i = 0; i < similarityResults.length; i++) {\n \t\t\t// Get first user by id\n \t\t\tNode userOne = uDao.findUserById(i);\n \t\t\tfor (int j = i + 1; j < similarityResults.length; j++) {\n \t\t\t\tdouble similarityScore = similarityResults[i][j];\n \t\t\t\t// User pairs that are not similar (i.e., have a similarity score of zero) do not get a connection\n \t\t\t\tif (similarityScore > 0) {\n\t \t\t\t\t// Get second user by id\n\t \t\t\t\tNode userTwo = uDao.findUserById(j);\n\t \t\t\t\t\n\t \t\t\t\t// Add similarity relationship\n\t \t\t\t\tuDao.connectSimilarUsers(userOne, userTwo, similarityScore);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }", "public static int[][] computeTable() {\n\t\tint [][] ret = new int[10][10];\n\t\tfor (int m = 0; m < 10; m++) {\n\t\t\tfor (int n = 0; n < 10; n++) {\n\t\t\t\tret[m][n] = m*n;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "public TreeDistanceMatrix( Tree t, IdGroup idGroup)\n\t{\n\t\tthis(t, idGroup, false, 0.0);\n\t}", "private static void createMinMatrixAfterRemoval(String c) {\n\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\tfor(String s:allClusters) {\n\t\t\tif(!s.equals(c)) {\n\t\t\t\tdouble dist = temp.get(s);\n\t\t\t\tupdateMinMatrix(c,s,dist);\n\t\t\t}\n\t\t}\n\t}", "public abstract double initialize(double[][] rawData, int clusterCount);", "private double distance(Double[] e1, Double[] e2) {\n if(e1.length != e2.length)\n throw new IllegalArgumentException(\"e1 and e2 lie in two different dimensional spaces.\");\n\n double sum = 0.0;\n for(int i = 0; i < e1.length; ++i)\n sum += Math.pow(e1[i] - e2[i], 2);\n return Math.sqrt(sum);\n }", "public HashMap getClusterDiameter() {\n double maxEuclideanDistance = 0;\n double maxCorrelationDistance = 0;\n\n Set probeIDSet = points.keySet();\n Iterator probeIt = probeIDSet.iterator();\n \n int comparisonIndex = 0;\n \n while (probeIt.hasNext()) {\n int probeID = (Integer) probeIt.next();\n double[] pointA = (double[]) points.get(probeID);\n\n Set probeIDSet2 = points.keySet();\n Iterator probeIt2 = probeIDSet2.iterator();\n while (probeIt2.hasNext()) {\n int probeID2 = (Integer) probeIt2.next();\n double[] pointB = (double[]) points.get(probeID2);\n \n HashMap distances = KMeans.getDistances(pointA, pointB);\n double eucDist = (Double) distances.get(\"euclidean\");\n double correlDist = (Double) distances.get(\"correlation\");\n \n if (comparisonIndex == 0) { // First distance\n maxEuclideanDistance = eucDist;\n maxCorrelationDistance = correlDist;\n } else if (eucDist > maxEuclideanDistance) {\n maxEuclideanDistance = eucDist;\n } else if ( Math.abs(correlDist) < maxCorrelationDistance) {\n maxCorrelationDistance = correlDist;\n }\n comparisonIndex++;\n }\n }\n \n HashMap<String, Double> distances = new HashMap<String, Double>();\n distances.put(\"euclidean\", maxEuclideanDistance);\n distances.put(\"correlation\", maxCorrelationDistance);\n return distances;\n }", "private void constructECMatrix() \n {\n final int COLUMNS = dimSquared * CONSTRAINTS;\n ecMatrix = new boolean[dimCubed][COLUMNS];\n int r, c, v, v1, v2;\n\n //Loop through each row of the ECM\n for(int i = 0; i < dimCubed; i++)\n {\n //Get the grid row, column and value for the current row in the ECM\n r = matrixRowToGridRow(i);\n c = matrixRowToGridCol(i);\n v = matrixRowToGridVal(i);\n //Loop through each column of the ECM\n for(int j = 0; j < COLUMNS; j++)\n {\n //Get the values for the current constraint column using j\n v1 = matrixColToV1(j);\n v2 = matrixColToV2(j);\n\n //Compare with the values for the current row, if equal set to true\n if(j < dimSquared) //Cell occupied constraint\n {\n if(v1 == r && v2 == c)\n {\n ecMatrix[i][j] = true;\n }\n }\n else if(j >= dimSquared && j < dimSquared * 2) //Row value constraint\n {\n if(v1 == r && v2 == v)\n {\n ecMatrix[i][j] = true;\n }\n }\n else if(j >= dimSquared * 2 && j < dimSquared * 3) //Column value constraint\n {\n if(v1 == c && v2 == v)\n {\n ecMatrix[i][j] = true;\n }\n }\n else if(j >= dimSquared * 3 && j < dimSquared * 4) //Box value constraint\n {\n if(v1 == getBox(r, c) && v2 == v)\n {\n ecMatrix[i][j] = true;\n }\n }\n }\n }\n }", "public void initial()\n\t{ \n\t\tint i,j; \n\t\tint tempValue=0;\n\t\tfor(i=0; i<n; i++) \n\t\t{ \n\t\t\tfor(j=0; j<n; j++)\n\t\t\t {\n\t\t\t\tif(j==0)\n\t\t\t\t{\n\t\t\t\t\ttempValue = cost[i][j];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(tempValue> cost[i][j])\n\t\t\t\t\t{\n\t\t\t\t\t\ttempValue = cost[i][j];\n\t\t\t\t\t}\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tfor (j=0; j<n;j++)\n\t\t\t{\n\t\t\t\tcost[i][j] = cost[i][j]- tempValue;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tfor(j=0;j<n;j++)\n\t\t{\n\t\t\tfor (i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tif(i==0)\n\t\t\t\t{\n\t\t\t\t\ttempValue = cost[i][j];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t if(tempValue> cost[i][j])\n\t\t\t\t {\n\t\t\t\t \ttempValue = cost[i][j];\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tcost[i][j] = cost[i][j] - tempValue;\n\t\t\t}\n\t\t}\t\n\t}", "public static void main(String[] main) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint min = -12;\n\t\tint max = 12;\n\n\t\tint firstX = sc.nextInt();\n\t\tint firstY = sc.nextInt();\n\n\t\tHashMap<Point, Double> euclideanDistanceMap = new HashMap<>();\n\n\t\tfor(int i = min; i <= max; i++) {\n\t\t\tfor (int j = min; j <= max; j++) {\n\t\t\t\tif (getEuclideanDistance(j, i) != Math.floor(getEuclideanDistance(j, i))) {\n\n\t\t\t\t\tdouble temp = (getEuclideanDistance(j, i) - Math.floor(getEuclideanDistance(j, i))) * Math.pow(10, 12);\n\t\t\t\t\teuclideanDistanceMap.put(new Point(j, i), temp);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tfor(Point p: euclideanDistanceMap.keySet()) {\n\t\t\tSystem.out.println(euclideanDistanceMap.get(p));\n\t\t}\n\t\tsc.close();\n\t}", "public void evaluate_CD() {\n int[] CD_init = new int[56]; // CD_init = conc(C_init, D_init)\n int[] C_init = new int[28];\n int[] D_init = new int[28];\n\n // definiert das Tupel (C0,D0)\n // \"-1\" dient der Fehler-Ekennung\n for (int i = 0; i < 56; i++) {\n CD_init[i] = -1;\n }\n CD_init = select(DES_key, PC1);\n\n for (int j = 0; j < 28; j++) // definiert C0 and D0 using (C0,D0)\n {\n C_init[j] = CD_init[j];\n D_init[j] = CD_init[j + 28];\n }\n\n for (int u = 0; u < 28; u++) {\n C[0][u] = C_init[u];\n D[0][u] = D_init[u];\n }\n\n for (int i = 1; i < 17; i++) {\n C[i] = cyclic_rot(v[i - 1], C[i - 1]);\n D[i] = cyclic_rot(v[i - 1], D[i - 1]);\n }\n\n // definiert die Matrix (C[i],D[i]), notwendig um die Roundkeys K_i zu berechnen\n for (int k = 0; k < 17; k++) {\n for (int t = 0; t < 28; t++) {\n CD[k][t] = C[k][t];\n CD[k][t + 28] = D[k][t];\n }\n }\n\n // definiert die 34x28 Matrix C0D0,....,C16D16 (displayed in \"CD_Matrix\")\n for (int z = 0; z < 17; z++)\n for (int s = 0; s < 28; s++) {\n CD_mix[2 * z][s] = CD[z][s];\n CD_mix[2 * z + 1][s] = CD[z][28 + s];\n }\n }", "private Double euclidean(LatitudeLongitude point1, LatitudeLongitude point2) {\n return Double.valueOf(Math.sqrt(Math.pow(point1.getLatitude() - point2.getLatitude(), 2)\n + Math.pow(point1.getLongitude() - point2.getLongitude(), 2)));\n }", "public abstract double getDiagonal();", "public Matrix xMatrix(){\n if(!this.pcaDone)this.pca();\n double denom = this.nItems;\n if(!super.nFactorOption)denom -= 1.0;\n Matrix mat = dataMinusMeans.times(1.0/Math.sqrt(denom));\n return mat;\n }", "public double infinityNorm(){\r\n \tdouble norm = 0.0D;\r\n \tdouble sum = 0.0D;\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tsum=0.0D;\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\tsum+=Math.abs(this.matrix[i][j]);\r\n \t\t}\r\n \t\tnorm=Math.max(norm,sum);\r\n \t}\r\n \treturn norm;\r\n \t}", "public static void readMatrix() throws ProgressionException\n\t{\t\n\t\t//System.out.println(\"Reading Matrix\");\n\t\t//File file = GeoDis_GUI.inputfile;\n\t\t//infilename = file.getPath();\n\t\t//System.err.println(file.getPath());\n\t\t//infile = new TextInputStream(file.getPath());\n\t\tlogfile.print(\"\\nReading distance matrix ...\");\n\t\tinfile = new TextInputStream(GeoDis.infilename);\n\n\t\tdataName = infile.readLine(); \n\t\t//System.err.println (dataName);\n\n\n\t\tnumLocations = infile.readInt(); // number of locations = dimensions of the distance matrix\n\t\tdistance = new double[numLocations][numLocations];\n\t\tlocationIndex = new int[numLocations]; // locationIndex is the index of the population\n\t\tlocationName = new String[numLocations]; // locationName is the name of each location\n\t\tsampleSize = new int[numLocations]; // sampleSize is the sample size\n\n\t\tfor (popA=0; popA<numLocations; popA++)\n\t\t{\n\t\t\tlocationIndex[popA] = infile.readInt();\n\t\t\tlocationName[popA] = infile.readWord();\n\t\t\tsampleSize[popA] = infile.readInt();\n\n\t\t\tif (locationIndex[popA] <= 0 || locationName[popA] == null || sampleSize[popA] < 0)\n\t\t\t{\n\t\t\t\tStringBuffer str = new StringBuffer();\n\t\t\t\tstr.append(\"There was an error reading the population descriptions\");\n\t\t\t\tstr.append(\"\\nin the pairwise distance matrix\");\n\t\t\t\tif(!Mediator.isCommandLineApp()){\n\t\t\t\t\tJOptionPane.showMessageDialog(frame,\"There was an error reading the population descriptions\" +\n\t\t\t\t\t\t\"\\nin the pairwise distance matrix\",\n \"GeoDis warning\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t//frame.dispose();\t\t\t\t\n\t\t\t\t\t//System.exit(0);\n\t\t\t\t\tthrow new ProgressionException(str.toString());\n\t\t\t\t} else {\n\t\t\t\t\tstr.append(\"[GeoDis]\\n\");\n\t\t\t\t\tMediator.writeError(str.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor (popB=0; popB<popA; popB++) \n\t\t\t{\n\t\t\t\tdistance[popA][popB] = distance[popB][popA] = infile.readDouble();\n\t\t\t\t\n\n\t\t\t\tif (distance[popA][popB] < 0)\n\t\t\t\t{\n\t\t\t\t\tif(!Mediator.isCommandLineApp()){\n\t\t\t\t\t\tJOptionPane.showMessageDialog(frame,\"There was an error reading the distance matrix\",\n\t \t \"GeoDis warning\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\t//frame.dispose();\t\t\t\t\n\t\t\t\t\t\t//System.exit(0);\n\t\t\t\t\t\tthrow new ProgressionException(\"There was an error reading the distance matrix\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tMediator.writeError(\"There was an error reading the distance matrix.[GeoDis]\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t }\n\t\t}\n\t\tlogfile.println(\"OK\");\n/*\n\t\tfor (popA=0; popA<numLocations; popA++)\n\t\t{\n\t\t\tSystem.out.print(locationIndex[popA] + \" \" + locationName[popA] + \" \" + sampleSize[popA] + \" \");\n\n\t\t\tfor (popB=0; popB<=popA; popB++) \n\t\t\t{\n\t\t\t\tSystem.out.print(distance[popA][popB] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\t\t}\n*/\n\t\n\t}", "public TriDiagonalMatrixF(int n) {\n this.A = new double[n];\n this.B = new double[n];\n this.C = new double[n];\n }", "private double[] replacementVector(double[][] distanceMatrix) {\r\n double[] replacementVector = new double[distanceMatrix.length - 1];\r\n // Energy between archive member k and new solution\r\n double[] individualEnergy = new double[distanceMatrix.length - 1];\r\n // Sum of all individual energies\r\n double totalEnergy = 0.0;\r\n for (int i = 0; i < replacementVector.length; i++) {\r\n individualEnergy[i] = scalarization.getAttribute(archive.get(i)) / distanceMatrix[i][maxSize];\r\n totalEnergy += individualEnergy[i];\r\n }\r\n for (int i = 0; i < individualEnergy.length; i++) {\r\n replacementVector[i] = totalEnergy - individualEnergy[i];\r\n replacementVector[i] *= scalarization.getAttribute(archive.get(maxSize));\r\n }\r\n return replacementVector;\r\n }", "@Override\n public Matrix idct(final MatrixView in) {\n check(in);\n double[][] out = new double[in.getRows()][in.getColumns()];\n double tmp1, tmp2, tmp3, tmp4;\n double tmpm0 = 0, tmpm1 = 0, tmpm2 = 0, tmpm3 = 0, tmpm4 = 0, tmpm5 = 0, tmpm6 = 0, tmpm7 = 0;\n double tmpm20, tmpm21, tmpm22, tmpm23, tmpm24, tmpm25, tmpm26, tmpm27 = 0;\n double[] outtmpmyi = null;\n\n for (int my = 0; my < in.getRows(); my += SIZE) {\n for (int mx = 0; mx < in.getColumns(); mx += SIZE) {\n for (int i = 0; i < 8; i++) {\n outtmpmyi = out[my + i];\n\n tmpm0 = in.getDouble(my + i, mx + 0);\n tmpm1 = in.getDouble(my + i, mx + 1);\n tmpm2 = in.getDouble(my + i, mx + 2);\n tmpm3 = in.getDouble(my + i, mx + 3);\n tmpm4 = in.getDouble(my + i, mx + 4);\n tmpm5 = in.getDouble(my + i, mx + 5);\n tmpm6 = in.getDouble(my + i, mx + 6);\n tmpm7 = in.getDouble(my + i, mx + 7);\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n outtmpmyi[mx + 0] = tmpm0 + tmpm7;\n outtmpmyi[mx + 7] = tmpm0 - tmpm7;\n outtmpmyi[mx + 1] = tmpm1 + tmpm6;\n outtmpmyi[mx + 6] = tmpm1 - tmpm6;\n outtmpmyi[mx + 2] = tmpm2 + tmpm5;\n outtmpmyi[mx + 5] = tmpm2 - tmpm5;\n outtmpmyi[mx + 3] = tmpm3 + tmpm4;\n outtmpmyi[mx + 4] = tmpm3 - tmpm4;\n\n }\n\n for (int i = 0; i < 8; i++) {\n\n tmpm0 = out[my + 0][mx + i];\n tmpm1 = out[my + 1][mx + i];\n tmpm2 = out[my + 2][mx + i];\n tmpm3 = out[my + 3][mx + i];\n tmpm4 = out[my + 4][mx + i];\n tmpm5 = out[my + 5][mx + i];\n tmpm6 = out[my + 6][mx + i];\n tmpm7 = out[my + 7][mx + i];\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n out[my + 0][mx + i] = tmpm0 + tmpm7;\n out[my + 7][mx + i] = tmpm0 - tmpm7;\n out[my + 1][mx + i] = tmpm1 + tmpm6;\n out[my + 6][mx + i] = tmpm1 - tmpm6;\n out[my + 2][mx + i] = tmpm2 + tmpm5;\n out[my + 5][mx + i] = tmpm2 - tmpm5;\n out[my + 3][mx + i] = tmpm3 + tmpm4;\n out[my + 4][mx + i] = tmpm3 - tmpm4;\n }\n }\n }\n\n return new DoubleMatrix(in.getRows(), in.getColumns(), out);\n }", "Matrix()\n {\n x = new Vector();\n y = new Vector();\n z = new Vector();\n }", "public static Map<Cell, Map<Cell, Number>> getDistances() {\n\t\treturn distances;\n\t}", "private double getDistance(double initX, double initY, double targetX, double targetY) {\n\t\treturn Math.sqrt(Math.pow((initX - targetX), 2) + Math.pow((initY - targetY), 2));\n\t}", "default double euclideanDistance(double[] a, double[] b) {\n checkLengthOfArrays(a, b);\n double sum = 0.0;\n for (int i = 0; i < a.length; i++) {\n final double d = a[i] - b[i];\n sum += d * d;\n }\n return Math.sqrt(sum);\n }", "private Point2D.Double calcNormVec(double x1, double x2, double y1, double y2)\n\t{\n\n\t\treturn new Point2D.Double(-(y2 - y1), (x2 - x1));\n\t}", "public void start()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tcost[i][j] = temp[i][j];\n\t\t\t\tmatrix[i][j]=0;\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int k=0;k<n;k++)\n\t\t{\n\t\t\trowLabelMultiple[k]=0;\n\t\t\tcolumnLabelMultiple[k]=0;\n\t\t}\t\t\t\n\t}", "public static void main (String[] args) {\n double[][] matrix = new double[25][25];\n for (int i = 0; i < matrix.length; i++) { //Vertical matrix (y-akse)\n for (int j = 0; j < matrix[i].length; j++) { //Horizontal matrix (x-akse)\n // Math.random gives at random number between 0 and 1\n // (int)(Math.random() * ((upperbound - lowerbound) + 1) + lowerbound); \n // Generate a random numbers between 50 and 100 \n matrix[i][j] = (int)(Math.random() * ((100 - 50) + 1) + 50);\n }\n } \n min(matrix);\n \n }", "private double calculeDistanceLinaire(int[] tableauDeIntRandom) {\n double resultat = 0;\n for (int i = 0; i < tableauDeIntRandom.length; i++) {\n resultat += Math.abs(tableauDeIntRandom[i] - tableauDeIntRandom[(i + 1) % tableauDeIntRandom.length]);\n }\n return resultat;\n }", "public Instances[] processDistancesAndIndices(Instances instances) throws Exception {\n \n int seriesLength = instances.numAttributes()-(instances.classIndex()>=0?1:0);\n \n if(windowSize < 3){\n throw new Exception(\"Error: window must be at least 3. You have specified \"+windowSize);\n }\n \n if(windowSize > seriesLength){\n throw new Exception(\"Error: window must be smaller than the number of attributes. Window length: \"+windowSize+\", series length: \"+seriesLength);\n }\n \n if(seriesLength/4 < windowSize){\n throw new Exception(\"Error: the series length must be at least 4 times larger than the window size to satisfy the exclusion zone criteria for trivial matches. These instances have a series length of \"+seriesLength+\"; the maximum window size is therefore \"+(seriesLength/4)+\" and you have specified \"+windowSize);\n }\n \n SingleInstanceMatrixProfile mpIns;\n Instances outputDistances = this.determineOutputFormat(instances);\n Instances outputIndices = this.determineOutputFormat(instances);\n Instance outDist, outIdx;\n \n this.distances = new double[instances.numInstances()][];\n this.indices = new int[instances.numInstances()][];\n \n for(int a = 0; a < seriesLength-windowSize+1; a++){\n outputIndices.renameAttribute(a, \"idx_\"+a);\n }\n outputIndices.setRelationName(outputIndices.relationName()+\"_indices\");\n \n for(int ins = 0; ins < instances.numInstances(); ins++){\n mpIns = new SingleInstanceMatrixProfile(instances.get(ins),this.windowSize, this.stride);\n outDist = new DenseInstance(outputDistances.numAttributes());\n outIdx = new DenseInstance(outputIndices.numAttributes());\n \n distances[ins] = mpIns.distances;\n indices[ins] = mpIns.indices;\n \n for(int i = 0; i < mpIns.distances.length; i++){\n outDist.setValue(i, mpIns.distances[i]);\n outIdx.setValue(i, mpIns.indices[i]);\n }\n \n if(instances.classIndex() >=0){\n outDist.setValue(mpIns.distances.length, instances.instance(ins).classValue());\n outIdx.setValue(mpIns.indices.length, instances.instance(ins).classValue());\n }\n \n outputDistances.add(outDist);\n outputIndices.add(outIdx);\n }\n return new Instances[]{outputDistances,outputIndices};\n }", "private void initTables(){\n\tfor (int i = 0; i < RouterSimulator.NUM_NODES; i++) {\n if (myID == i) {\n myNeighboursDistTable[i] = costs;\n } else {\n int[] tmp = new int[RouterSimulator.NUM_NODES];\n Arrays.fill(tmp, RouterSimulator.INFINITY);\n myNeighboursDistTable[i] = tmp;\n }\n if (costs[i] == RouterSimulator.INFINITY) {\n neighbours[i] = false;\n route[i] = -1;\n } else if (i != myID) {\n neighbours[i] = true;\n route[i] = i;\n }\n\t}\n }" ]
[ "0.6071057", "0.6009269", "0.59006923", "0.582869", "0.58004725", "0.575729", "0.5695122", "0.5680566", "0.55614185", "0.55571693", "0.55315614", "0.54693353", "0.5443908", "0.539081", "0.5379529", "0.5366954", "0.52358764", "0.5224007", "0.5216435", "0.51281995", "0.5118363", "0.511834", "0.510109", "0.50788224", "0.50611144", "0.50398076", "0.5034786", "0.5032527", "0.50073206", "0.5002578", "0.49823746", "0.49655205", "0.49581578", "0.4953768", "0.49509183", "0.4942959", "0.49423552", "0.4940031", "0.4931141", "0.49032235", "0.48953006", "0.487643", "0.4848457", "0.48382443", "0.4826969", "0.48226058", "0.48016682", "0.4795386", "0.47887456", "0.478826", "0.477458", "0.47652417", "0.4751351", "0.47424415", "0.47393858", "0.4736385", "0.47348446", "0.47216317", "0.47215143", "0.47202277", "0.4707219", "0.46991602", "0.46919608", "0.46821192", "0.46773124", "0.46765894", "0.46735656", "0.46665177", "0.46632287", "0.46626154", "0.46567252", "0.46458936", "0.46342835", "0.46329358", "0.46299914", "0.46282724", "0.46249264", "0.46235248", "0.46186495", "0.46145573", "0.46062362", "0.45950973", "0.45892367", "0.4577749", "0.45704225", "0.4564702", "0.45615754", "0.4559864", "0.45575526", "0.45565954", "0.45517188", "0.45509264", "0.4549724", "0.45459494", "0.45459357", "0.4540815", "0.4532121", "0.4524463", "0.4523548", "0.45181167" ]
0.6832015
0
find the minimum distance from the matrix and merges those two clusters and updates corresponding distance by taking the minimum distance between two points from either clusters update the number of clusters.
private static void mergeNext() { String ids[] = getMinGeneIds(); String minI = ids[0]; String minJ = ids[1]; String newEntry = createNewEntry(minI, minJ); TreeMap<String, Double> prevI = distanceMatrix.remove(minI); TreeMap<String, Double> prevJ = distanceMatrix.remove(minJ); minMatrix.remove(minI);minMatrix.remove(minJ); allClusters.remove(minI);allClusters.remove(minJ); TreeMap<String, Double> newTemp = new TreeMap<String, Double>(); for(String c: allClusters) { TreeMap<String, Double> temp = distanceMatrix.get(c); temp.remove(minI);temp.remove(minJ); double dist1 = prevI.get(c); double dist2 = prevJ.get(c); if(dist1 < dist2) { newTemp.put(c,dist1); updateMinMatrix(newEntry, c, dist1); temp.put(newEntry, dist1); String minData[] = minMatrix.get(c).split(";"); if(minData[0].equals(minI) || minData[0].equals(minJ)) { minMatrix.remove(c); createMinMatrixAfterRemoval(c); } updateMinMatrix(c, newEntry, dist1); } else { newTemp.put(c,dist2); updateMinMatrix(newEntry, c, dist2); temp.put(newEntry, dist2); String minData[] = minMatrix.get(c).split(";"); if(minData[0].equals(minI) || minData[0].equals(minJ)) { minMatrix.remove(c); createMinMatrixAfterRemoval(c); } updateMinMatrix(c, newEntry, dist2); } distanceMatrix.put(c, temp); } distanceMatrix.put(newEntry, newTemp); allClusters.add(newEntry); totalCluster = allClusters.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void connectClusters() {\n\t\tif (clusters.size() == 2) { // once have only two clusters\n\t\t\tSystem.out.println(\"DONE!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tcluster close1 = clusters.get(0),\n\t\t\t\tclose2 = clusters.get(1);\n\t\tdouble closestCluster = computeDistance(close1, close2);\n\t\t\n\t\tfor (int i=0; i<clusters.size(); i++) {\n\t\t\tcluster c1 = clusters.get(i);\n\t\t\t\n\t\t\tfor (int j=0; j<clusters.size(); j++) { // go through all the clusters and find closest\n\t\t\t\tif (i!=j) {\n\t\t\t\t\tcluster c2 = clusters.get(j);\n\t\t\t\t\tdouble dist = computeDistance(c1,c2);\n\t\t\t\t\tif (dist < closestCluster) {\n\t\t\t\t\t\tclose1 = c1;\n\t\t\t\t\t\tclose2 = c2;\n\t\t\t\t\t\tclosestCluster = dist;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tmakeCluster(close1, close2);\n\t\t\n\t}", "public int minCost(int[][] distance) {\n Map<Index, Integer> minCostDP = new HashMap<>();\n Map<Index, Integer> parent = new HashMap<>();\n\n List<Set<Integer>> allSets;\n\n for (Set<Integer> set : allSets) {\n for (int currentVertex = 1; currentVertex < distance.length; currentVertex++) {\n if (set.contains(currentVertex)) continue;\n Index index = Index.createIndex(currentVertex,set);\n int minCost = Integer.MAX_VALUE;\n int minPrevVertex = 0;\n\n Set<Integer> copySet = new HashSet<>();\n for (int prevVertex : set) {\n int cost = distance[prevVertex][currentVertex] + getCost(copySet, prevVertex, minCostDP);\n }\n }\n }\n }", "public double computeSimilarity(int[] cluster1, int[] cluster2);", "public Cluster(Cluster one, Cluster two) {\n this();\n // merge locations by just averaging\n// location.x=(one.location.x+two.location.x)/2;\n// location.y=(one.location.y+two.location.y)/2;\n\n Cluster older = one.firstTimestamp < two.firstTimestamp ? one : two;\n// Cluster older=one.numEvents>two.numEvents? one:two;\n\n // merge locations by average weighted by number of events supporting cluster\n int sumEvents = one.numEvents + two.numEvents;\n location.x = (one.location.x * one.numEvents + two.location.x * two.numEvents) / (sumEvents);\n location.y = (one.location.y * one.numEvents + two.location.y * two.numEvents) / (sumEvents);\n angle = older.angle;\n cosAngle = older.cosAngle;\n sinAngle = older.sinAngle;\n averageEventDistance = (one.averageEventDistance * one.numEvents + two.averageEventDistance * two.numEvents) / sumEvents;\n averageEventXDistance = (one.averageEventXDistance * one.numEvents + two.averageEventXDistance * two.numEvents) / sumEvents;\n averageEventYDistance = (one.averageEventYDistance * one.numEvents + two.averageEventYDistance * two.numEvents) / sumEvents;\n \n lastTimestamp = one.lastTimestamp > two.lastTimestamp ? one.lastTimestamp : two.lastTimestamp;\n numEvents = sumEvents;\n firstTimestamp = older.firstTimestamp; // make lifetime the oldest src cluster\n path = older.path;\n birthLocation = older.birthLocation;\n velocityFitter = older.velocityFitter;\n velocityPPT.x = older.velocityPPT.x;\n velocityPPT.y = older.velocityPPT.y;\n velocityPPS.x = older.velocityPPS.x;\n velocityPPS.y = older.velocityPPS.y;\n velocityValid = older.velocityValid;\n// vxFilter=older.vxFilter;\n// vyFilter=older.vyFilter;\n avgEventRate = older.avgEventRate;\n avgISI = older.avgISI;\n hasObtainedSupport = older.hasObtainedSupport;\n setAspectRatio(older.getAspectRatio());\n\n// Color c1=one.getColor(), c2=two.getColor();\n setColor(older.getColor());\n// System.out.println(\"merged \"+one+\" with \"+two);\n //the radius should increase\n// setRadius((one.getRadius()+two.getRadius())/2);\n if (growMergedSizeEnabled) {\n float R = (one.getRadius() + two.getRadius()) / 2;\n setRadius(R + getMixingFactor() * R);\n } else {\n setRadius(older.getRadius());\n }\n\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "void unionTreeCoreset(int k,int n_1,int n_2,int d, Point[] setA,Point[] setB, Point[] centres, MTRandom clustererRandom) {\n\t\t//printf(\"Computing coreset...\\n\");\n\t\t//total number of points\n\t\tint n = n_1+n_2;\n\n\t\t//choose the first centre (each point has the same probability of being choosen)\n\t\t\n\t\t//stores, how many centres have been choosen yet\n\t\tint choosenPoints = 0; \n\t\t\n\t\t//only choose from the n-i points not already choosen\n\t\tint j = clustererRandom.nextInt(n-choosenPoints); \n\n\t\t//copy the choosen point\n\t\tif(j < n_1){\n\t\t\t//copyPointWithoutInit(&setA[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setA[j].clone();\n\t\t} else {\n\t\t\tj = j - n_1;\n\t\t\t//copyPointWithoutInit(&setB[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setB[j].clone();\n\t\t}\n\t\ttreeNode root = new treeNode(setA,setB,n_1,n_2, centres[choosenPoints],choosenPoints); //??\n\t\tchoosenPoints = 1;\n\t\t\n\t\t//choose the remaining points\n\t\twhile(choosenPoints < k){\n\t\t\tif(root.cost > 0.0){\n\t\t\t\ttreeNode leaf = selectNode(root, clustererRandom);\n\t\t\t\tPoint centre = chooseCentre(leaf, clustererRandom);\n\t\t\t\tsplit(leaf,centre,choosenPoints);\n\t\t\t\t//copyPointWithoutInit(centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = centre;\n\t\t\t} else {\n\t\t\t\t//create a dummy point\n\t\t\t\t//copyPointWithoutInit(root.centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = root.centre;\n\t\t\t\tint l;\n\t\t\t\tfor(l=0;l<root.centre.dimension;l++){\n\t\t\t\t\tcentres[choosenPoints].coordinates[l] = -1 * 1000000;\n\t\t\t\t}\n\t\t\t\tcentres[choosenPoints].id = -1;\n\t\t\t\tcentres[choosenPoints].weight = 0.0;\n\t\t\t\tcentres[choosenPoints].squareSum = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\tchoosenPoints++;\n\t\t}\n\n\t\t//free the tree\n\t\tfreeTree(root);\n\n\t\t//recalculate clustering features\n\t\tint i;\n\t\tfor(i=0;i<n;i++){\n\t\t\t\t\n\t\t\tif(i < n_1) {\n\t\t\t\t\n\t\t\t\tint index = setA[i].centreIndex;\n\t\t\t\tif(centres[index].id != setA[i].id){\n\t\t\t\t\tcentres[index].weight += setA[i].weight;\n\t\t\t\t\tcentres[index].squareSum += setA[i].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setA[i].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setA[i].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tint index = setB[i-n_1].centreIndex;\n\t\t\t\tif(centres[index].id != setB[i-n_1].id){\n\t\t\t\t\tcentres[index].weight += setB[i-n_1].weight;\n\t\t\t\t\tcentres[index].squareSum += setB[i-n_1].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setB[i-n_1].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setB[i-n_1].coordinates[l];\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 ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "public int[] findClusterCorrespondence(int[] idx1, int[] idx2) {\n\t\tint n = idx1.length;\n\t\tif (n != idx2.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has to have same number of elements\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find unique values in idx1 and idx2\n\t\tUniqueResult<Integer> ur_idx1 = utils.findUnique(idx1);\n\t\tUniqueResult<Integer> ur_idx2 = utils.findUnique(idx2);\n\t\tif (ur_idx1.domain.length != ur_idx2.domain.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has different number of clusters\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find Jaccard coefficient\n\t\tdouble[][] J = findJaccardIndex(idx1, idx2);\n\t\t\n\t\t// use Hungarian method - use any kind of Hungarian algorithm\n\t\tHungarianAlgorithm h = new HungarianAlgorithm();\n\t\t@SuppressWarnings(\"static-access\")\n\t\tint[][] match = h.hgAlgorithm(J, \"max\");\n\t\t\n\t\t// print match matrix\n\t\tif (verbose) {\n\t\t\tSystem.out.println(\"Hunguarian Cost Matrix\");\n\t\t\tutils.printMatrix(match);\n\t\t}\n\t\t\n\t\t// relabel the idx2\n\t\tif (verbose) System.out.println(\"Class correspondents matrix:\");\n\t\tint[] target = idx1.clone();\n\t\tfor (int i = 0; i < match.length; i++) {\n\t\t\tint idx1_index = ur_idx1.domain[match[i][0]];\n\t\t\tint idx2_index = ur_idx2.domain[match[i][1]];\n\t\t\tif (verbose) System.out.printf(\"%d\\t%d\", idx1_index, idx2_index);\t\t\t\n\t\t\tif (idx1_index != idx2_index) {\n\t\t\t\tif (verbose) System.out.printf(\"\\t(will replace all %d in idx2 by %d)\", idx2_index, idx1_index);\n\t\t\t\tboolean[] index = utils.getIndexByValue(idx2, idx2_index);\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (index[j]) target[j] = idx1_index;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (verbose) System.out.printf(\"\\n\");\n\t\t}\n\t\t\n\t\tif (verbose) {\n\t\t\tint v_tt = 15;\n\t\t\tif (target.length < v_tt) v_tt = target.length;\n\t\t\tSystem.out.printf(\"Printing first %d elements of input and output arrays\\n\", v_tt);\n\t\t\tSystem.out.printf(\"IDX1\\tIDX2\\tFINAL IDX\\n\");\n\t\t\tfor (int i = 0; i < v_tt; i++) System.out.printf(\"%d\\t%d\\t%d\\n\", idx1[i], idx2[i], target[i]);\n\t\t}\n\t\t\n\t\treturn target;\n\t}", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private void cluster() {\n\t\tint index = 0;\n\t\tfor (DataObject obj : objects) {\n\t\t\tindex = getNearestCenterIndex(obj, centers);\n\t\t\tclusters.get(index).add(obj);\n\t\t}\n\t}", "public double computeDistance(cluster c1, cluster c2) {\n\t\tdouble closest = 4000;\n\t\tfor (point p1 : c1.getPoints()) {\n\t\t\tfor (point p2 : c2.getPoints()) {\n\t\t\t\tdouble dist = Math.sqrt(Math.pow( (p1.x() - p2.x()) , 2) + Math.pow( (p1.y() - p2.y()) , 2));\n\t\t\t\tif (dist < closest) {\n\t\t\t\t\tclosest = dist;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn closest;\n\t}", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "private static void updateMinMatrix(String i, String j, double dist) {\n\t\tif(minMatrix.containsKey(i)) {\n\t\t\tString minData[] = minMatrix.get(i).split(\";\");\n\t\t\tdouble prevDist = Double.parseDouble(minData[1]);\n\t\t\tif(dist < prevDist)\n\t\t\t\tminMatrix.put(i+\"\", j+\";\"+dist);\n\t\t} else {\n\t\t\tminMatrix.put(i+\"\", j+\";\"+dist);\n\t\t}\n\t\tif(minMatrix.containsKey(j)) {\n\t\t\tString minData[] = minMatrix.get(j).split(\";\");\n\t\t\tdouble prevDist = Double.parseDouble(minData[1]);\n\t\t\tif(dist < prevDist)\n\t\t\t\tminMatrix.put(j, i+\";\"+dist);\n\t\t} else {\n\t\t\tminMatrix.put(j, i+\";\"+dist);\n\t\t}\n\t}", "private void clusterElements(int element1,int element2)\n\t{\n\t\tint index1 = getClusterIndex(element1);\n\t\tint index2 = getClusterIndex(element2);\n\t\t\n\t\t\n\t\tif (index1 != index2)\n\t\t\tif((index1 != -1) && (index2 != -1))\n\t\t\t\tcombineClusters(index1,index2);\n\t}", "public void activateCluster(){\n for (int row = 0; row < matrix.length; row++) {\n// Cell[] matrix1 = matrix[i];\n for (int col = 0; col < matrix[row].length; col++) {\n Cell cell = matrix[row][col];\n // check every if null it means there is no cell at that position\n // get fist occured cell and meet it with the next one\n // run the loop while\n // while cell.getRow < cell.bestRow && cell.getCol < cell.bestCol\n if(cell != null) {\n while (cell.getRow() <= this.cellBiggestRow && cell.getCol() <= this.cellBiggestCol) {\n\n if (cell.getCol() >= matrix[row].length) {\n if (!(cell.getRow() >= matrix.length)) {\n cell.setRow(cell.getRow() + 1);\n }\n } else {\n cell.setCol(cell.getCol() + 1);\n }\n\n // if cell.getCol + 1 < matrix[row].length && matrix[row] != null\n // get the next cell and do the fight\n }\n }\n }\n }\n\n }", "void renewNeighbourClusters() {\n neighbourClusters = new HashMap<Cluster, Integer>();\n\n for (Person p : members) {\n for (Person x : p.getFriends()) {\n if (!members.contains(x)) {\n Cluster xC = x.getCluster();\n if (!neighbourClusters.containsKey(xC)) {\n neighbourClusters.put(xC, 1);\n } else {\n neighbourClusters.put(xC, neighbourClusters.get(xC) + 1);\n }\n }\n }\n }\n\n }", "void updateDistMatrix(long timeStamp) {\n\n\t\t\t// for each alive landmark, when its ping results are received by\n\t\t\t// the source node,\n\t\t\t// we start the clustering computation process\n\t\t\t// TODO: remove landmarks that return a subset of results 10-12\n\t\t\tLong timer = Long.valueOf(timeStamp);\n\n\t\t\tif (!pendingHSHLandmarks.containsKey(timer)\n\t\t\t\t\t|| pendingHSHLandmarks.get(timer).IndexOfLandmarks == null) {\n\t\t\t\tSystem.err.println(\"$: Null elements!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tHSHRecord CurList = pendingHSHLandmarks.get(timer);\n\t\t\tint NoOfLandmarks = CurList.IndexOfLandmarks.size();\n\t\t\tif(NoOfLandmarks<=0){\n\t\t\t\tSystem.err.println(\"$: Empty elements!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tHashMap<AddressIF, ArrayList<RemoteState<AddressIF>>> LatRecords = CurList.pendingLandmarkLatency;\n\t\t\tif (LatRecords == null) {\n\t\t\t\tSystem.err\n\t\t\t\t\t\t.println(\"$: Null HashMap<AddressIF, ArrayList<RemoteState<AddressIF>>> LatRecords!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tint receivedLandmarks = LatRecords.keySet().size();\n\t\t\t// empty or incomplete records\n\t\t\tif (LatRecords.isEmpty() || receivedLandmarks < 0.8 * NoOfLandmarks) {\n\t\t\t\tSystem.err.println(\"$: Null LatRecords!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"$: HSH: total landmarks: \" + NoOfLandmarks\n\t\t\t\t\t+ \", received from \" + receivedLandmarks);\n\t\t\t// use the IndexOfLandmarks as the index of nodes\n\n\t\t\tif (CurList.DistanceMatrix == null\n\t\t\t\t\t|| CurList.DistanceMatrix.length != NoOfLandmarks) {\n\t\t\t\tCurList.DistanceMatrix = null;\n\t\t\t\tCurList.DistanceMatrix = new double[NoOfLandmarks][NoOfLandmarks];\n\t\t\t\tfor (int i = 0; i < NoOfLandmarks; i++) {\n\t\t\t\t\tfor (int j = 0; j < NoOfLandmarks; j++) {\n\t\t\t\t\t\tCurList.DistanceMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// fill elements\n\t\t\tIterator<Entry<AddressIF, ArrayList<RemoteState<AddressIF>>>> entrySet = LatRecords\n\t\t\t\t\t.entrySet().iterator();\n\n\t\t\twhile (entrySet.hasNext()) {\n\t\t\t\tEntry<AddressIF, ArrayList<RemoteState<AddressIF>>> tmp = entrySet\n\t\t\t\t\t\t.next();\n\t\t\t\t// empty lists\n\t\t\t\tif (tmp.getValue() == null || tmp.getValue().size() == 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// ===============================================================\n\t\t\t\tAddressIF srcNode = tmp.getKey();\n\t\t\t\t// find the index of landmarks\n\t\t\t\tint from = CurList.IndexOfLandmarks.indexOf(srcNode);\n\t\t\t\tIterator<RemoteState<AddressIF>> ier = tmp.getValue()\n\t\t\t\t\t\t.iterator();\n\t\t\t\tif (from < 0) {\n\t\t\t\t\t// already removed landmarks!\n\t\t\t\t\tSystem.out.println(\"already removed landmarks!\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\twhile (ier.hasNext()) {\n\t\t\t\t\tRemoteState<AddressIF> NP = ier.next();\n\n\t\t\t\t\tif (!CurList.IndexOfLandmarks.contains(NP.getAddress())) {\n\t\t\t\t\t\t// not landmarks\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tint to = CurList.IndexOfLandmarks.indexOf(NP.getAddress());\n\n\t\t\t\t\tdouble rtt = NP.getSample();\n\t\t\t\t\tif (to < 0 || rtt < 0) {\n\t\t\t\t\t\tSystem.err.println(\"$: failed to find the landmarks!\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// System.out.print(\" <\"+to+\", \"+from+\", \"+rtt+\"> \");\n\t\t\t\t\t\t// Note: symmetric RTT\n\t\t\t\t\t\tif (CurList.DistanceMatrix[to][from] > 0) {\n\t\t\t\t\t\t\tdouble avgRTT;\n\t\t\t\t\t\t\tif (rtt > 0) {\n\t\t\t\t\t\t\t\tavgRTT = (rtt + CurList.DistanceMatrix[to][from]) / 2;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tavgRTT = CurList.DistanceMatrix[to][from];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCurList.DistanceMatrix[from][to] = avgRTT;\n\t\t\t\t\t\t\tCurList.DistanceMatrix[to][from] = avgRTT;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// TODO: missing elements\n\t\t\t\t\t\t\tCurList.DistanceMatrix[from][to] = rtt;\n\t\t\t\t\t\t\tCurList.DistanceMatrix[to][from] = rtt;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ======================================================\n\n\t\t\tboolean markZero = false;\n\t\t\tfor (int i = 0; i < NoOfLandmarks; i++) {\n\t\t\t\tint sum = 0;\n\t\t\t\tfor (int column = 0; column < NoOfLandmarks; column++) {\n\t\t\t\t\tif (i == column) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (CurList.DistanceMatrix[i][column] > 0) {\n\t\t\t\t\t\tsum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (sum < 0.7 * NoOfLandmarks) {\n\t\t\t\t\tmarkZero = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (markZero) {\n\t\t\t\t// CurList.DistanceMatrix=null;\n\t\t\t\tSystem.err.println(\"$: incomplete CurList.DistanceMatrix!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"\\n\\n$: HSH: Start HSH clustering computation process!\");\n\n\t\t\t// TODO: find accurate clustering number\n\t\t\tint cluNum = MatrixOps.findClusteringNum(CurList.DistanceMatrix);\n\n\t\t\tif(cluNum<=0){\n\t\t\t\tSystem.err.println(\"the clustering number is <=0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t// version control for dimensions\n\t\t\tif (CurList.S != null && CurList.S.length == cluNum) {\n\n\t\t\t} else {\n\t\t\t\tCurList.version = System.currentTimeMillis();\n\t\t\t}\n\n\t\t\t// initialize the matrixes for computation\n\t\t\tCurList.H = new double[NoOfLandmarks][cluNum];\n\t\t\tCurList.S = new double[cluNum][cluNum];\n\t\t\t// CurList.Coord = new double[cluNum];\n\t\t\tfor (int i = 0; i < NoOfLandmarks; i++) {\n\t\t\t\tfor (int j = 0; j < cluNum; j++) {\n\t\t\t\t\tCurList.H[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < cluNum; i++) {\n\t\t\t\tfor (int j = 0; j < cluNum; j++) {\n\t\t\t\t\tCurList.S[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// update coordinate vectors\n\t\t\tMatrixOps.symmetric_NMF(NoOfLandmarks, cluNum,\n\t\t\t\t\tCurList.DistanceMatrix, CurList.H, CurList.S);\n\t\t\tCurList.alreadyComputedClustering = true;\n\n\t\t\t// TODO: H,S is Null\n\t\t\tif (CurList.H == null || CurList.S == null) {\n\t\t\t\tSystem.err.println(\"$: after HSH computation, NULL results!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// after centralized computation, the core node should send its H &\n\t\t\t// S to all the landmark nodes\n\t\t\tissueCoords(timeStamp, CurList.IndexOfLandmarks, new CB1<String>() {\n\t\t\t\tprotected void cb(CBResult ncResult, String errorString) {\n\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t.println(\"Core node has issued its H & S to all landmarks.\");\n\t\t\t\t}\n\t\t\t});\n\t\t}", "private static void createMinMatrixAfterRemoval(String c) {\n\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\tfor(String s:allClusters) {\n\t\t\tif(!s.equals(c)) {\n\t\t\t\tdouble dist = temp.get(s);\n\t\t\t\tupdateMinMatrix(c,s,dist);\n\t\t\t}\n\t\t}\n\t}", "public void mergeClusters(int[] newCluster) {\n\t\tint i, j, k;\n\t\tif (cluster == null)\n\t\t\treturn;\n\t\ti = 0;\n\t\tfor (j = 0; j < nNodes; j++) {\n\t\t\tk = newCluster[cluster[j]];\n\t\t\tif (k > i)\n\t\t\t\ti = k;\n\t\t\tcluster[j] = k;\n\t\t}\n\t\tnClusters = i + 1;\n\t\tdeleteClusteringStats();\n\t}", "public float compare(Cluster other) {\n \treturn compare(center, other.center);\n }", "public CountMin merge(final CountMin other) {\n if (this.rows != other.rows || this.columns != other.columns) {\n throw new IllegalArgumentException(\n \"Trying to merge two CountMin data structures of different sizes.\");\n }\n for (int i = 0; i < rows * columns; i++) {\n this.counts[i] += other.counts[i];\n }\n this.update_sum += other.update_sum;\n return this;\n }", "private static void makeInitialDistanceMatrix() {\n\t\ttry {\n\t\t\tfor(int i=1;i<=totalGenes;i++) {\n\t\t\t\tTreeMap<String, Double> temp1 = new TreeMap<>();\n\t\t\t\tif(distanceMatrix.containsKey(i+\"\"))\n\t\t\t\t\ttemp1 = distanceMatrix.get(i+\"\");\n\t\t\t\tfor(int j=i+1;j<=totalGenes;j++) {\n\t\t\t\t\tdouble dist = getDist(i, j);\n\t\t\t\t\tTreeMap<String, Double> temp2 = new TreeMap<>();\n\t\t\t\t\tif(distanceMatrix.containsKey(j+\"\"))\n\t\t\t\t\t\ttemp2 = distanceMatrix.get(j+\"\");\n\t\t\t\t\ttemp2.put(i+\"\", dist);\n\t\t\t\t\tdistanceMatrix.put(j+\"\", temp2);\n\t\t\t\t\ttemp1.put(j+\"\", dist);\n\t\t\t\t\tupdateMinMatrix(i+\"\",j+\"\",dist);\n\t\t\t\t}\n\t\t\t\tdistanceMatrix.put(i+\"\", temp1);\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private Map<double[], Set<String>> initiateClusters(int k, Set<String> restaurantIDs) {\n // centroids[0] is lattitude and centroids[1] is longitude for a centroid\n // Map assigns restaurants to a specific centroid\n Map<double[], Set<String>> restaurantClusters = new HashMap<double[], Set<String>>();\n\n // Find the min and max latitudes and longitudes\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n\n for (String rID : restaurantIDs) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n\n // Create a number of centroids equal to k\n for (int i = 0; i < k; i++) {\n // generate random centroid based on min and max latitudes\n // and longitudes, with (currently) no assigned restaurants\n HashSet<String> emptySet = new HashSet<String>();\n restaurantClusters.put(this.generateRandomCentroid(minLat, maxLat, minLon, maxLon), emptySet);\n }\n\n // Assign each restaurant to its closest centroid\n\n for (String rID : restaurantIDs) {\n\n double[] newCentroid = null;\n double minDist = Double.MAX_VALUE;\n\n for (double[] centroid : restaurantClusters.keySet()) {\n double distance = this.computeDistance(centroid, this.restaurantMap.get(rID));\n if (distance < minDist) {\n newCentroid = centroid;\n minDist = distance;\n }\n }\n restaurantClusters.get(newCentroid).add(rID);\n }\n return restaurantClusters;\n }", "private void calculateDistances(int pDistancia,int pMetrica,int k)\n\t{\n\t\tDistance dist = null;\n\t\t\n\t\tfor (int i = 0; i < clusterList.size(); i++)\n\t\t{\n\t\t\tfor (int j = i+1; j < clusterList.size(); j++)\n\t\t\t{\n\t\t\t\tdist = new Distance(clusterList.get(i), clusterList.get(j));\n\t\t\t\tdist.calculateDistance(pDistancia, pMetrica, k);\n\t\t\t\tdistanceList.addLast(dist);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(distanceList);\n\t}", "public static Tour CheapInsert (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int start, ziel;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n start = in.getPointNumber() - 1;\n ziel = out.getPointNumber() - 1;\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(out);\n tour.addPoint(in);\n for (int i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n int pos = -1;\n if (visited[i] == 1) {\n } else {\n double distance;\n double minimum = Double.MAX_VALUE;\n int insertPoint = 0;\n for (int j = 1; j <= tour.getSize(); j++) {\n if (tour.getPoint(j % tour.getSize()) == in) {\n pos = i;\n } else {\n int vor = tour.getPoint((j - 1) % tour.getSize()).getPointNumber() - 1;\n int nach = tour.getPoint((j) % tour.getSize()).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex] + distancematrix[cityIndex][nach];\n if (distance < minimum) {\n minimum = distance;\n insertPoint = j % tour.getSize();\n pos = i;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(i));\n visited[pos] = 1;\n }\n }\n }\n return tour;\n }", "public int minDistance(String word1, String word2) {\n char[] cs1 = word1.toCharArray();\n char[] cs2 = word2.toCharArray();\n int len1 = cs1.length;\n int len2 = cs2.length;\n // if (len1 * len2 == 0) {\n // return Math.max(len1, len2);\n // }\n int[][] min = new int[len1][len2];\n int m = Integer.MAX_VALUE;\n for (int i = 0; i < len1; i++) {\n for (int j = 0; j < len2; j++) {\n m = Integer.MAX_VALUE;\n m = Math.min(getMinDis(min, i, j - 1) + 1, m);\n m = Math.min(getMinDis(min, i - 1, j) + 1, m);\n m = Math.min(getMinDis(min, i - 1, j - 1)\n + (cs1[i] == cs2[j] ? 0 : 1), m);\n min[i][j] = m;\n }\n }\n return getMinDis(min, len1 - 1, len2 - 1);\n }", "@Override\n protected double calcSimilarity(Cluster a, Cluster b) {\n List<Point> aItems = a.getItems();\n List<Point> bItems = b.getItems();\n\n // calculate the similarity of each item in a with every item in b,\n // save the min value in sim-variable\n double sim = Double.MAX_VALUE;\n for (Point x : aItems) {\n for (Point y : bItems) {\n double currSim = x.distanceTo(y);\n if (currSim < sim) {\n sim = currSim;\n }\n }\n }\n\n return sim;\n }", "public double getClosestDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn distanceMin;\n\t\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n mNodes = sc.nextInt();\n mEdges = sc.nextInt();\n \n mDistances = new int[mNodes+1][mNodes+1];\n \n for (int i =1; i <= mNodes; i++)\n {\n \n for (int j =1; j <=mNodes;j++)\n {\n mDistances[i][j] = Integer.MAX_VALUE;\n \n }\n }\n \n for (int i =1; i <= mNodes; i++)\n {\n mDistances[i][i] =0;\n }\n \n for (int i = 0 ; i < mEdges; i++)\n {\n int from = sc.nextInt();\n int to = sc.nextInt();\n \n mDistances[from][to] = sc.nextInt();\n \n \n }\n \n \n //FW\n \n for (int k = 1; k <= mNodes; k++)\n {\n \n for (int i = 1; i <= mNodes; i++)\n {\n \n for (int j = 1; j <= mNodes; j++)\n {\n \n if (mDistances[i][k]!= Integer.MAX_VALUE && mDistances[k][j] != Integer.MAX_VALUE )\n {\n if (mDistances[i][j] > mDistances[i][k] + mDistances[k][j])\n {\n \n mDistances[i][j] = mDistances[i][k] + mDistances[k][j];\n }\n \n }\n \n }\n }\n \n }\n \n mQueries = sc.nextInt();\n \n for (int i =0; i < mQueries; i++)\n {\n int dist = mDistances[sc.nextInt()][sc.nextInt()];\n \n if (dist == Integer.MAX_VALUE)\n {\n dist = -1;\n }\n \n System.out.println(dist);\n \n }\n \n \n \n \n \n \n \n \n \n }", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "public void assignPixelsToClusters(int[][] assigned){\n\n for(int i = 0; i < imageHeight; i++){\n for(int j = 0; j < imageWidth; j++){\n //System.out.println(\"pixel[\" + i + \"][\" + j + \"]\"); // Used for some debugging\n\n //Find the cluster color that is closest to the current pixel color\n int closestCluster = -1; // Holds the cluster that the pixel is closest to in color\n double closestDistance = Double.MAX_VALUE;// Initiate to the a max value\n for(int x = 0; x < kCenters.length; x++){\n if(diff(pixels[i][j], kCenters[x]) < closestDistance){\n closestCluster = x;\n closestDistance = diff(pixels[i][j], kCenters[x]);\n //Add the coordinates of this pixel to some arrayList of arrayList (a cluster arraylist)???\n }\n \n } // Done iterating through all kCenters and should have the closest\n if(closestCluster == -1){\n System.out.println(\"Error, no closest cluster found\");\n System.exit(-1);\n }\n assigned[i][j] = closestCluster;\n }\n }\n }", "private void reassignCentroids(Map<double[], Set<String>> restaurantClusters) {\n\n for (double[] centroid : restaurantClusters.keySet()) {\n\n // If a centroid has no restaurants, do not update the centroid\n if (restaurantClusters.get(centroid).isEmpty()) {\n continue;\n }\n\n double totalLat = 0;\n double totalLon = 0;\n int size = restaurantClusters.get(centroid).size();\n\n for (String rID : restaurantClusters.get(centroid)) {\n Restaurant r = this.restaurantMap.get(rID);\n // Get the total value for lattitude and longitude for all restaurants\n // in the cluster\n totalLat += r.getLatitude();\n totalLon += r.getLongitude();\n }\n\n centroid[0] = totalLat / size;\n centroid[1] = totalLon / size;\n }\n }", "public ArrayList<Cluster> mergeBestCluster(int pDistancia,int pMetrica,int k, int clustN)\n\t{\n\t\tcalculateDistances(pDistancia, pMetrica, k);\n\t\tDistance dist = distanceList.getFirst();\n\t\tArrayList<Cluster> clustArray;\n\t\tclustArray = (ArrayList<Cluster>) clusterList.clone();\n\t\tclustArray.remove(dist.getCluster1());\n\t\tclustArray.remove(dist.getCluster2());\n\t\t\n\t\tCluster clust = new Cluster(clustN, dist.mergerInstances() , dist.getCluster1(), dist.getCluster2(), iterationName);\n\t\t//Añadimos el nuevo cluster (El unido) a la nuevalista de clusters\n\t\tclustArray.add(clustArray.size(),clust);\n\t\t\n\t\treturn clustArray;\n\t}", "public static Tour NNHeuristic (double distancematrix [][], Cluster cluster) {\n Stack<Integer> stack= new Stack<Integer>();\n Tour tour = new Tour(0);\n double length =0;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n Point out = cluster.getOutPoint ();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n\n tour.addPoint(out);\n tour.addPoint(in);\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n\n int element, dst = 0, i, pos = 0;\n stack.push(in.getPointNumber());\n element = stack.peek() - 1;\n boolean minFlag = false;\n while (!stack.isEmpty()) {\n double min = Integer.MAX_VALUE;\n for (i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (distancematrix[element][cityIndex] > 0 && visited[i] == 0) {\n if (min > distancematrix[element][cityIndex]) {\n min = distancematrix[element][cityIndex];\n dst = cityIndex + 1;\n pos = i;\n minFlag = true;\n }\n }\n }\n if (minFlag) {\n length = length + min;\n visited[pos] = 1;\n stack.push(dst);\n element = stack.peek() - 1;\n tour.addPoint(cluster.getPoints().get(pos));\n minFlag = false;\n continue;\n }\n stack.pop();\n }\n tour.removePoint(out);\n tour.removePoint(in);\n tour.addPoint(out);\n tour.addPoint(in);\n }\n return tour;\n }", "public int minDistance(String word1, String word2) {\n int m=word1.length();\n int n=word2.length();\n \n int dp[][]=new int[m+1][n+1];\n \n for(int i=0;i<m+1;i++){\n for(int j=0;j<n+1;j++){\n //if first string is empty then only option is add all chars from second\n if(i==0)\n dp[i][j]=j;\n \n //if second string is empty then only option is remove all chars from 1st\n else if(j==0)\n dp[i][j]=i;\n //do nothing and copy from diagonal ie. ignore \n else if(word1.charAt(i-1)==word2.charAt(j-1))\n dp[i][j]=dp[i-1][j-1];\n else\n {\n //insert , //remove // replace\n dp[i][j]=1+Math.min(dp[i][j-1], Math.min(dp[i-1][j], dp[i-1][j-1]));\n }\n }\n }\n return dp[m][n];\n }", "public void merge(MicroCluster other) {\r\n\t\t// 1. update idList\r\n\t\tif (idSet == null)\r\n\t\t\tidSet = new HashSet<Integer>();\r\n\t\tidSet.add(other.clusterID);\r\n // If other is a composite cluster, then we need to incorporate the member ids.\r\n\t\tif (other.idSet != null) {\r\n idSet.addAll(other.idSet);\r\n\t\t}\r\n\t\t// 2. update num, ts1, ts2, sum, ssum\r\n\t\tnum += other.num;\r\n\t\tts1 += other.ts1;\r\n\t\tts2 += other.ts2;\r\n sum = sum.add(other.getSum());\r\n ssum = ssum.add(other.getSquareSum());\r\n\t\t// 3. update the semantic information\r\n\t\tfor (Map.Entry e : other.getWords().entrySet()) {\r\n\t\t\tint wordId = (Integer) e.getKey();\r\n\t\t\tint cnt = (Integer) e.getValue();\r\n\t\t\tint originalCnt = words.containsKey(wordId) ? words.get(wordId) : 0;\r\n\t\t\twords.put(wordId, originalCnt + cnt);\r\n\t\t}\r\n\t}", "private static void k_means_online(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n //writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "public void balanceCentroids() {\n for(Cluster cluster : clusters)\n cluster.recalculateCentroid();\n }", "public int minDistance_LCS(String word1, String word2) {\n int N=word1.length(), M=word2.length();\n int[][] dp = new int[N+1][M+1];\n for (int i=1; i<=N; i++) {\n for (int j=1; j<=M; j++) {\n if (word1.charAt(i-1)==word2.charAt(j-1)) {\n dp[i][j]=dp[i-1][j-1]+1;\n } else {\n dp[i][j]=Math.max(dp[i-1][j], dp[i][j-1]);\n }\n }\n }\n return N+M-2*dp[N][M];\n }", "private double dist(Point a,Point b)//to find distance between the new entry to predict and the male or female cluster mean positions.\n { double d;\n d=Math.sqrt( Math.pow((a.ht-b.ht),2) + Math.pow((a.wt-b.wt),2));\n return d;\n }", "public HashMap getClusterDiameter() {\n double maxEuclideanDistance = 0;\n double maxCorrelationDistance = 0;\n\n Set probeIDSet = points.keySet();\n Iterator probeIt = probeIDSet.iterator();\n \n int comparisonIndex = 0;\n \n while (probeIt.hasNext()) {\n int probeID = (Integer) probeIt.next();\n double[] pointA = (double[]) points.get(probeID);\n\n Set probeIDSet2 = points.keySet();\n Iterator probeIt2 = probeIDSet2.iterator();\n while (probeIt2.hasNext()) {\n int probeID2 = (Integer) probeIt2.next();\n double[] pointB = (double[]) points.get(probeID2);\n \n HashMap distances = KMeans.getDistances(pointA, pointB);\n double eucDist = (Double) distances.get(\"euclidean\");\n double correlDist = (Double) distances.get(\"correlation\");\n \n if (comparisonIndex == 0) { // First distance\n maxEuclideanDistance = eucDist;\n maxCorrelationDistance = correlDist;\n } else if (eucDist > maxEuclideanDistance) {\n maxEuclideanDistance = eucDist;\n } else if ( Math.abs(correlDist) < maxCorrelationDistance) {\n maxCorrelationDistance = correlDist;\n }\n comparisonIndex++;\n }\n }\n \n HashMap<String, Double> distances = new HashMap<String, Double>();\n distances.put(\"euclidean\", maxEuclideanDistance);\n distances.put(\"correlation\", maxCorrelationDistance);\n return distances;\n }", "public Map<double[], Integer> kmeans(int distance, Map<Integer, double[]> centroids, int k) {\n Map<double[], Integer> clusters = new HashMap<>();\n int k1 = 0;\n double dist = 0.0;\n for (double[] x : features) {\n double minimum = 999999.0;\n for (int j = 0; j < k; j++) {\n if (distance == 1) {\n dist = Distance.eucledianDistance(centroids.get(j), x);\n } else if (distance == 2) {\n dist = Distance.manhattanDistance(centroids.get(j), x);\n }\n if (dist < minimum) {\n minimum = dist;\n k1 = j;\n }\n\n }\n clusters.put(x, k1);\n }\n\n return clusters;\n }", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "private void combineClusters(int index1,int index2)\n\t{\n\t\tVector <Integer> cluster1 = (Vector<Integer>)clusters.elementAt(index1);\n\t\tVector <Integer> cluster2 = (Vector<Integer>)clusters.elementAt(index2);\n\t\tVector <Integer> cluster3 = new Vector<Integer>(cluster1);\n\t\tcluster3.addAll(cluster2);\n\t\tclusters.add(cluster3);\n\t\tclusters.removeElementAt(index1);\n\t\t\n\t\t//take into account shift in indices after removal of first element\n\t\tif(index2 < index1)\n\t\t\tclusters.removeElementAt(index2);\n\t\telse\n\t\t\tclusters.removeElementAt(index2-1);\n\t\t\n\t\n\t}", "public static Tour FarthestInsertion (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n double max;\n double min;\n int chosenPoint = 0;\n int pos = -1;\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(in);\n tour.addPoint(out);\n while (tour.getSize() != numbernodes) {\n int point = 1;\n int insertPoint = 1;\n max =0;\n for (int i = 0; i < numbernodes; i++) {\n double minimum = Double.MAX_VALUE;\n\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (visited[i] == 1) {\n } else {\n double distance;\n\n for (int j = 1; j <= tour.getSize() - 1; j++) {\n int vor = tour.getPoint((j - 1)).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex];\n if (distance < minimum) {\n minimum = distance;\n point = j;\n pos = i;\n }\n }\n if (minimum > max){\n max = minimum;\n chosenPoint = pos;\n insertPoint = point;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(chosenPoint));\n visited[chosenPoint] = 1;\n }\n }\n tour.removePoint(in);\n tour.addPoint(in);\n return tour;\n }", "private static int editDistance(String str1, String str2)\n {\n // if either of the strings is null, distance cannot be computed\n if (str1 == null || str2 == null)\n {\n return -1; // indicates error input\n }\n \n // all values are by default initialized to 0 by JVM\n int[][] distanceTable = new int[str1.length()+1][str2.length()+1];\n \n int numRows = str1.length() + 1;\n int numCols = str2.length() + 1;\n \n for (int m = 0; m < numRows; m++)\n {\n for (int n = 0; n < numCols; n++)\n {\n // if length of str1 is 0, we have no option but to insert all of str2 \n if (m == 0)\n {\n distanceTable[m][n] = n;\n }\n \n // if length of str2 is 0, delete all of str1 of make it match with str2\n else if (n == 0)\n {\n distanceTable[m][n] = m;\n }\n \n /*\n * if last characters of str1 and str2 are equal, compute distance ending at\n * second last characters for both str1 and str2 \n */\n else if (str1.charAt(m-1) == str2.charAt(n-1))\n {\n distanceTable[m][n] = distanceTable[m-1][n-1]; \n }\n \n /*\n * else use minimum of following three cases:\n * delete last character of str1 and check distance: distance(str1, str2, m-1, n)\n * insert last character of str2 into str1 and check distance: distance(str1, str2, m, n-1)\n * replace last char of str1 with last char of str2 and check distance: distance(str1, str2, m-1, n-1) \n */\n else\n {\n distanceTable[m][n] = min (\n 1 + distanceTable[m-1][n],\n 1 + distanceTable[m][n-1],\n 1 + distanceTable[m-1][n-1]\n );\n }\n }\n }\n \n return distanceTable[numRows-1][numCols-1];\n }", "private void updateCenterSquareSum() {\n\t\tfor(KMeansCluster cluster : clusters) {\n\t\t\tKMeansNode center = cluster.getCenter();\n\t\t\tdouble squareSum = 0;\n\t\t\tfor(Entry<?, Double> entry : center.getVector().entrySet()) {\n\t\t\t\tsquareSum += entry.getValue() * entry.getValue();\n\t\t\t}\n\t\t\tsquareSum = Math.sqrt(squareSum);\n\t\t\tcenterTfidfSquireSum.put(cluster, squareSum);\n\t\t\t\n\t\t}\n\t}", "public Ms2Cluster cluster(Map<Ms2Pointer, MsnSpectrum> spectra, Float lowmass, OffsetPpmTolerance tol, double min_dp, int miss_index)\n {\n // quit if the master or input are not present!\n if (mHead==null || !Tools.isSet(spectra)) return null;\n\n mHead.cluster=this;\n\n // setting the seed spectrum\n if (getMaster()==null && spectra.get(getHead())!=null)\n setMaster(spectra.get(getHead()).copy(new PurgingPeakProcessor()));\n\n// MsnSpectrum HEAD = (mMaster!=null?mMaster:spectra.get(mHead));\n // setup the master first\n List<Peak> head = Spectra.toListOfPeaks(getMaster(), lowmass);\n // get the index of the HEAD spectrum\n List<Peak> index = Similarity.index(head, 7, 0, 1, 5, 0);\n\n // the collections\n if (mMembers!=null) mMembers.clear(); else mMembers = new ArrayList<>();\n // new members from this round\n Collection<MsnSpectrum> members = new ArrayList<>();\n // the error tolerance\n double delta = tol.calcError(500);\n for (Ms2Pointer member : mCandidates)\n {\n MsnSpectrum scan = spectra.get(member);\n // need to exclude the head itself\n if (member.hcode==getHead().hcode)\n {\n member.dp=1; // being the self\n member.cluster=this;\n mMembers.add(member);\n continue;\n }\n if (scan!=null)\n {\n // calc the forward and backward DPs and choose the smallest\n List<Peak> pks = Spectra.toListOfPeaks(scan,lowmass);\n // make sure a min number of the index peaks are found\n if (miss_index>=0 && index.size()-Peaks.overlap_counts(pks, index, delta, true)>miss_index) continue;\n\n member.dp=(float )Similarity.bidirectional_dp(head, pks, tol, true, true, true);\n // now the matching probability\n member.prob = (float )Similarity.similarity_hg(head, pks, delta);\n\n if (member.dp>=min_dp)\n {\n member.cluster=this;\n mMembers.add(member);\n members.add(spectra.get(member));\n }\n }\n }\n mMaster = Spectra.accumulate(getMaster(), tol, 0.5f, members);\n mMz = (float )mMaster.getPrecursor().getMz();\n mRT = (float )getMaster().getRetentionTimes().getFirst().getTime()/60f;\n mCharge = getMaster().getPrecursor().getCharge();\n// mID = Tools.d2s(getMz(),3)+\"|\"+getCharge()+\"|\"+Tools.d2s(getRT(),1);\n mID = toString();\n\n // remove the local objects\n head = (List )Tools.dispose(head);\n index = (List )Tools.dispose(index);\n members = Tools.dispose(members);\n\n return this;\n }", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "public void Synchronize(){\n\t\tfor(int i=0; i<centers.size(); i++){\n\t\t\tHashSet<Integer> datasets = centers.get(i);\n\t\t\tfor(int j=0; j<centers.size(); j++){\n\t\t\t\tif(j!=i){\n\t\t\t\t\tHashSet<Integer> other = centers.get(j);\n\t\t\t\t\tfor (Iterator iterator = other.iterator(); iterator\n\t\t\t\t\t\t\t.hasNext();) {\n\t\t\t\t\t\tInteger data = (Integer) iterator.next();\n\t\t\t\t\t\tif(!datasets.contains(data)){\n\t\t\t\t\t\t\tSystem.out.println(data + \" \" + (j+1) + \" \" + (i+1));\n\t\t\t\t\t\t\tdatasets.add(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"done\");\n\t}", "private static int getClusterCorrespondance(Integer cl1, Integer cl2,\n HashMap<Integer, HashMap<Integer, Integer>> clusterCorresp, int nextId)\n{\n HashMap<Integer, Integer> map = clusterCorresp.get(cl1);\n if (map == null) {\n map = new HashMap<Integer, Integer>();\n map.put(cl2, nextId);\n clusterCorresp.put(cl1, map);\n return nextId;\n }\n Integer corresp = map.get(cl2);\n if (corresp == null) {\n map.put(cl2, nextId);\n return nextId;\n }\n return corresp.intValue();\n}", "private static double findOneSetCost(int r, int [] set,\r\n Vector oneSetVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n ArrayList setNeighbors = new ArrayList();\r\n for ( int i = 0; i < set.length; i++)\r\n {\r\n int index = set[i] - 1;\r\n Host neighbor = (Host) neighbors.get(index);\r\n setNeighbors.add(neighbor);\r\n }\r\n double [][] setDistanceArray = findDistanceArray(currentNode, destList, setNeighbors);\r\n //the setDistanceArray[r][m]\r\n\r\n //check if any neighbor in set is not common neighbor for all dests\r\n //if a neighbor is so, return a MaxDistance, hopArray = NULL\r\n int m = destList.size();\r\n for ( int i = 0; i < m; i++)\r\n {\r\n int num = 0;\r\n for ( int j = 0; j < r; j++)\r\n {\r\n if (setDistanceArray[j][i] < 0)\r\n {\r\n num++;\r\n setDistanceArray[j][i] = MaxDistance;\r\n }\r\n }\r\n if ( num >= r )\r\n {\r\n // All the neighbors in set cannot forward to destination[i]\r\n oneSetVector.clear(); // ???\r\n return MaxDistance;\r\n }\r\n }\r\n\r\n //find forward nodes provides min remain distance\r\n double totalCost = 0.0;\r\n\r\n //go thourgh destList, find a best forward neighbor for each dest\r\n //add the distance to totalRemainDistance\r\n for (int i = 0; i < m; ++i) {//loop through destList\r\n double minCost = setDistanceArray[0][i];//get first neighbor for each dest\r\n oneSetVector.add(i, setNeighbors.get(0));\r\n for (int j = 0; j < r; ++j) {// Loop through the neighbor\r\n if (minCost > setDistanceArray[j][i]) {\r\n // Swap\r\n minCost = setDistanceArray[j][i];\r\n oneSetVector.set(i, setNeighbors.get(j));\r\n }\r\n }\r\n totalCost += minCost;\r\n }\r\n\r\n return totalCost;\r\n }", "private void cheminMin (ArrayList<Integer> parcours, ArrayList<Integer> sommets, int n, double dist){\r\n\t\t\r\n\t\t//condition d'arret\r\n\t\tif (sommets.size()>=1){\r\n\t\t\tif (n != super.g.getDim()){\r\n\t\t\t\t\r\n\t\t\t\t//test si le parcours n'est pas sup�rieur au parcours total\r\n\t\t\t\tif (dist<super.dist){\r\n\t\t\t\t\tfor (int ind=0; ind<sommets.size(); ind++) {\r\n\t\t\t\t\t\tdouble dist2 = dist + super.g.calculDist(parcours.get(parcours.size()-1), sommets.get(ind));\r\n\t\t\t\t\t\tArrayList<Integer> sommets2 = new ArrayList<Integer>();\r\n\t\t\t\t\t\tArrayList<Integer> parcours2 = new ArrayList<Integer>();\r\n\t\t\t\t\t\tparcours2 = super.copieListe(parcours);\r\n\t\t\t\t\t\tsommets2 = super.copieListe(sommets);\r\n\t\t\t\t\t\tparcours2.add(sommets2.get(ind));\r\n\t\t\t\t\t\tsommets2.remove(ind);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//appel r�cursif avec les copies avec ajout du sommet dans le parcours\r\n\t\t\t\t\t\tcheminMin(parcours2, sommets2, n-1,dist2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tArrayList<Integer> sommets2 = new ArrayList<Integer>();\r\n\t\t\t\tArrayList<Integer> parcours2 = new ArrayList<Integer>();\r\n\t\t\t\tparcours2 = super.copieListe(parcours);\r\n\t\t\t\tsommets2 = super.copieListe(sommets);\r\n\t\t\t\tparcours2.add(0);\r\n\t\t\t\t\r\n\t\t\t\t//appel r�cursif avec les copies\r\n\t\t\t\tcheminMin(parcours2, sommets2, n-1, dist);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble dist2 = super.g.calculDist(0, parcours.get(parcours.size()-1))+dist;\r\n\t\t\tif (dist2<super.dist || super.dist == -1){\r\n\t\t\t\tsuper.dist = dist2;\r\n\t\t\t\tsuper.parcoursMin = super.copieListe(parcours);\r\n\t\t\t\tsuper.parcoursMin.add(0);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int minDistance(String word1, String word2) {\n int N=word1.length(), M=word2.length();\n int[][] dp = new int[N+1][M+1];\n for (int i=0; i<=N; i++) dp[i][0]=i;\n for (int j=0; j<=M; j++) dp[0][j]=j;\n for (int i=1; i<=N; i++) {\n for (int j=1; j<=M; j++) {\n if (word1.charAt(i-1)==word2.charAt(j-1)) {\n dp[i][j]=dp[i-1][j-1];\n } else {\n dp[i][j]=Math.min(dp[i-1][j], dp[i][j-1]) + 1;\n }\n }\n }\n return dp[N][M];\n }", "public void recalculateNodes(int width) {\n int x, y, minX, minY, maxX, maxY;\n List<Set<String>> inputData = new ArrayList<Set<String>>();\n // use squar of distance\n for (ReferenceNode node : nodeList) {\n Point location = node.getLocation();\n x = location.x;\n y = location.y;\n minX = Math.max(0, x - width);\n minY = Math.max(0, y - width);\n maxX = Math.min(SOM.X_LENGTH - 1, x + width);\n maxY = Math.min(SOM.Y_LENGTH - 1, y + width);\n inputData.clear();\n for (x = minX; x < maxX + 1; x++) {\n for (y = minY; y < maxY + 1; y++) {\n ReferenceNode neighborNode = getNodeAt(x, y);\n List<Set<String>> data = neighborNode.getInputData();\n if (data != null)\n inputData.addAll(data);\n }\n }\n // Set<String> newData = average(inputData);\n // node.setReferenceData(newData);\n node.setInputReferenceData(inputData);\n }\n // Have to empty input nodes\n for (ReferenceNode node : nodeList)\n node.resetInputData();\n }", "private void calculateDistances() {\n for (int point = 0; point < ntree.size(); point++) {\n calculateDistances(point);\n }\n }", "public final float minimumMarchingDistance(float[] val, boolean[] flag) {\n\n // s = a + b +c; s2 = a*a + b*b +c*c\n s = 0;\n s2 = 0;\n count = 0;\n\n for (int n=0; n<6; n+=2) {\n\t\t\tif (flag[n] && flag[n+1]) {\n\t\t\t\ttmp = Numerics.min(val[n], val[n+1]); // Take the smaller one if both are processed\n\t\t\t\ts += tmp;\n\t\t\t\ts2 += tmp*tmp;\n\t\t\t\tcount++;\n\t\t\t} else if (flag[n]) {\n\t\t\t\ts += val[n]; // Else, take the processed one\n\t\t\t\ts2 += val[n]*val[n];\n\t\t\t\tcount++;\n\t\t\t} else if (flag[n+1]) {\n\t\t\t\ts += val[n+1];\n\t\t\t\ts2 += val[n+1]*val[n+1];\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n // count must be greater than zero since there must be at least one processed pt in the neighbors\n \n tmp = (s+Math.sqrt( (s*s-count*(s2-1.0f))))/count;\n\n // The larger root\n return (float)tmp;\n }", "private Long getMinSpanDistance(Long[][] pasMat){\n\t\tInteger ptr[] = new Integer[pasMat.length];\n\t\tLong minSpanTarget = -1L;\n\t\tfor(int i=0; i<pasMat.length; ptr[i++] = 0){\n\t\t\tif(pasMat[i] != null)\n\t\t\t\tminSpanTarget++;\n\t\t}\n\n\t\t/*System.out.println(\"new doc\\n\");\n\t\tSystem.out.println(\"-----------------------------\");\n\t\tfor(int i=0;i<pasMat.length; i++){\n\t\t\tSystem.out.print(\"term[\"+i+\"]\");\n\t\t\tfor(int j=0;pasMat[i]!= null && j<pasMat[i].length; j++){\n\t\t\t\tSystem.out.print(\"\\t\" + pasMat[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tSystem.out.println(\"-----------------------------\\n\");*/\n\n\t\tLong minSpan = Long.MAX_VALUE;\n\t\twhile(true){\n\t\t\t\n\t\t\tLong minVal = Long.MAX_VALUE;\n\t\t\tLong maxVal = Long.MIN_VALUE;\n\t\t\tInteger minI = null; \n\t\t\t\n\t\t\tfor(int i=0; i<pasMat.length; i++){\n\t\t\t\tInteger j = ptr[i];\n\t\t\t\tif (pasMat[i] == null) continue;\n\t\t\t\t\n\t\t\t\tLong value = pasMat[i][j];\n\t\t\t\tminVal = Math.min(minVal, value);\n\t\t\t\tmaxVal = Math.max(maxVal, value);\n\t\t\t\t\n\t\t\t\t// current value is less than min J value and there is room for incrementing \n\t\t\t\tif(((minI == null) || (value < pasMat[minI][ptr[minI]]))\n\t\t\t\t\t&& (ptr[i]+1 < pasMat[i].length)){\n\t\t\t\t\tminI = i;\n\t\t\t\t}\n\t\t\t\t//System.out.println(\"[\"+i+\"][\"+j+\"]\\t val=\"+value+\"\\tmini=\"+minI+\"\\t\");\n\t\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"\");\n\t\t\t\n\t\t\tminSpan = Math.min(minSpan, maxVal - minVal);\n\t\t\t\n\t\t\tif(minSpan == minSpanTarget || minI == null) break;\n\t\t\tptr[minI]++;\n\t\t}\n\t\treturn minSpan;\n\t}", "private static void calculateSimilarity() {\n \tLOG.info(\"Begin calculating spatial similarity between users.\");\n \t\n\t\t// Get a list of all users\n \tNeo4JUserDAO uDao = (Neo4JUserDAO) DAOFactory.instance().getUserDAO();\n\t\tList<Node> users = uDao.findAll();\n\t\t\n\t\tint usersCount = users.size();\n \tLOG.debug(\"Found {} users.\", usersCount);\n\t\t\n\t\t// Instantiate all needed classes for similarity measurement\n\t\tNeo4JSequenceExtractor ex = new Neo4JSequenceExtractor();\n\t\tex.setFromLevel(clArgs.calcSimilarityFromLevel);\n\t\tex.setToLevel(clArgs.calcSimilarityToLevel);\n\t\t\n\t\tNeo4JSequenceMatcher matcher = new Neo4JSequenceMatcher(\n\t\t\t\tclArgs.calcSimilaritySplitThreshold, \n\t\t\t\tclArgs.calcSimilarityMinSequenceLength,\n\t\t\t\tclArgs.calcSimilarityTempConstraintThreshold);\n\t\tNeo4JSimilarityAnalyzer analyzer = new Neo4JSimilarityAnalyzer();\n\t\t\n\t\t// Create matrix that holds similarity results\n\t\tdouble[][] similarityResults = new double[usersCount][usersCount];\n\t\t\n\t\t// Go through all pair-wise user combinations\n \tfor (int i = 0; i < usersCount; i++) {\n\t\t\tNode userOne = users.get(i);\n\t\t\tObject userOneId = uDao.getUserId(userOne);\n\t\t\t\n\t\t\t// Set current first user for sequence extraction\n\t\t\tex.setUserNodeOne(userOne);\n\t\t\t\n\t\t\tfor (int j = i + 1; j < usersCount; j++) {\n\t\t\t\tNode userTwo = users.get(j);\n\t\t\t\tObject userTwoId = uDao.getUserId(userTwo);\n\t\t\t\tLOG.info(\"Calculate similarity between user [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\n\t\t\t\tdouble similarity = 0.0;\n\t\t\t\t\n\t\t\t\t// Step 1: Extract cluster sequences of two users based on their hierarchical graphs\n\t\t\t\t// Set current second user for sequence extraction\n\t\t\t\tex.setUserNodeTwo(userTwo);\n\t\t\t\tMap<Integer, SequenceWrapper> clusterSequences = null;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t// Start extraction of cluster sequences\n\t\t\t\t\tLOG.info(\"Step 1: Extraction of cluster sequences from level {} to level {}.\", clArgs.calcSimilarityFromLevel, clArgs.calcSimilarityToLevel);\n\t\t\t\t\tclusterSequences = ex.extract();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(\"An error occurred while extracting the sequences of common clusters of user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Step 2: Match the extracted cluster sequences to find maximal length similar sequences\n\t\t\t\tMap<Integer, List<Sequence<SimilarSequenceCluster>>> maxLengthSimilarSequences = null;\n\t\t\t\t\n\t\t\t\t// Matching is only possible if there is a valid result of step 1 \n\t\t\t\tif (clusterSequences != null && !clusterSequences.isEmpty()) {\n\t\t\t\t\tmatcher.setSequencesOnLevel(clusterSequences);\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Start matching of cluster sequences\n\t\t\t\t\t\tLOG.info(\"Step 2: Matching of cluster sequences.\");\n\t\t\t\t\t\tmaxLengthSimilarSequences = matcher.match();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tLOG.error(\"An error occurred while matching the sequences of common clusters of user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t// Step 3: Compute spatial similarity between the current two users\n\t\t\t\t\t// Similarity measurement is only possible with a valid result of step 2\n\t\t\t\t\tif (maxLengthSimilarSequences != null && !maxLengthSimilarSequences.isEmpty()) {\n\t\t\t\t\t\tanalyzer.setUserNodeOne(userOne);\n\t\t\t\t\t\tanalyzer.setUserNodeTwo(userTwo);\n\t\t\t\t\t\tanalyzer.setMaximalLengthSimilarSequencesOnLevel(maxLengthSimilarSequences);\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Start similarity measurement\n\t\t\t\t\t\t\tLOG.info(\"Step 3: Similarity measurement.\");\n\t\t\t\t\t\t\tsimilarity = analyzer.analyze();\n\t\t\t\t\t\t\tLOG.debug(\"Final similarity score: {}\", similarity);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Save similarity value in result matrix\n\t\t\t\t\t\t\tsimilarityResults[i][j] = similarity;\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tLOG.error(\"An error occurred while measuring similarity between user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t// END: step 3\n\t\t\t\t}\t// END: step 2\n\t\t\t}\t// END: user two loop\n\t\t}\t// END: user one loop\n \t\n \tLOG.info(\"Finished calculating spatial similarity.\");\n \t\n \t// Normalize the similarity scores from 0 to 1\n \tif (clArgs.normalization) {\n\t \tLOG.info(\"Normalizing similarity scores.\");\n\t \tsimilarityResults = SimilarityNormalizer.normalize(similarityResults);\n \t}\n \t\n \t// The evaluation is requested\n \tif (clArgs.evaluation) {\n \t\tLOG.info(\"Evaluation is enabled.\");\n \t\t\n \t\t// Calculate simple evaluation\n \t\tLOG.info(\"Calculate similarity evaluation values.\");\n \t\tSimilarityEvaluation evaluation = SimilarityEvaluator.evaluate(similarityResults);\n \t\t\n \t\t// Build up other information to include in the evaluation files\n \t\tList<String> otherInformation = new ArrayList<String>();\n \t\tif (clArgs.automation) {\n \t\t\t// Clustering information is only included if the automation task is running\n \t\t\totherInformation.add(CommandLineArgs.CLUSTERING_OPTICS_XI);\n \t\t\totherInformation.add(String.valueOf(df.format(currentOpticsXi)));\n \t\t\totherInformation.add(CommandLineArgs.CLUSTERING_OPTICS_MIN_POINTS);\n \t\t\totherInformation.add(String.valueOf(df.format(currentOpticsMinPoints)));\n \t\t}\n \t\t\n \t\t// Add simple metrics from similarity measurement\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MIN);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getMin())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MAX);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getMax())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MEAN);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getSimilarityMean())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILAR_USER_PAIRS);\n \t\totherInformation.add(String.valueOf(evaluation.getSimilarUserPairs()));\n \t\t\n \t\t// Write similarity results in a file\n \t\tLOG.info(\"Writing evaluation data to a file.\");\n \t\tArrayToCsvWriter.writeDoubles(similarityResults, clArgs.evaluationOutDir, otherInformation.toArray(new String[0]));\n \t}\n \t// Evaluation is not requested, write the similarity scores into the graph database\n \telse {\n \t\tLOG.info(\"Write similarity scores to the graph database.\");\n \t\t\n \t\tfor (int i = 0; i < similarityResults.length; i++) {\n \t\t\t// Get first user by id\n \t\t\tNode userOne = uDao.findUserById(i);\n \t\t\tfor (int j = i + 1; j < similarityResults.length; j++) {\n \t\t\t\tdouble similarityScore = similarityResults[i][j];\n \t\t\t\t// User pairs that are not similar (i.e., have a similarity score of zero) do not get a connection\n \t\t\t\tif (similarityScore > 0) {\n\t \t\t\t\t// Get second user by id\n\t \t\t\t\tNode userTwo = uDao.findUserById(j);\n\t \t\t\t\t\n\t \t\t\t\t// Add similarity relationship\n\t \t\t\t\tuDao.connectSimilarUsers(userOne, userTwo, similarityScore);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }", "@Override\n public String kMeansClusters_json(int k) {\n\n List<Set<String>> kMeansClusters = new ArrayList<Set<String>>();\n\n if (k == 1) {\n // No algorithm needed\n kMeansClusters.add(new HashSet<String>(this.restaurantMap.keySet()));\n return this.clusterToJSON(kMeansClusters);\n }\n\n // restaurant clusters contains random centroids mapped to a set of its closest\n // restaurants (in id form)\n Map<double[], Set<String>> restaurantClusters = this.initiateClusters(k, this.restaurantMap.keySet());\n\n do {\n Set<String> emptyCluster = findEmptyCluster(restaurantClusters);\n Set<String> largestCluster = findLargestCluster(restaurantClusters);\n\n // Code below finds some random centroid within the largest cluster\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n for (String rID : largestCluster) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n double[] centroidInLargestCluster = this.generateRandomCentroid(minLat, maxLat, minLon, maxLon);\n\n // Find the empty cluster and reassign its centroid by placing it somewhere in\n // the largest cluster\n for (double[] centroid : restaurantClusters.keySet()) {\n if (restaurantClusters.get(centroid).equals(emptyCluster)) {\n centroid[0] = centroidInLargestCluster[0]; // New longitude based on largest cluster\n centroid[1] = centroidInLargestCluster[1]; // New latitude based on largest cluster\n break; // Once we find the empty cluster, we are done\n }\n }\n\n // Flag is true if any restaurants are reassigned to a new centroid\n // If no restaurants are reassigned, then we are done one run through\n boolean flag;\n do {\n this.reassignCentroids(restaurantClusters);\n flag = reassignRestaurants(restaurantClusters, this.restaurantMap.keySet());\n } while (flag);\n\n } while (atLeastOneEmptyCluster(restaurantClusters)); // Repeat if any empty clusters are detected\n\n // Add final restaurant clusters to list of clusters\n for (Set<String> cluster : restaurantClusters.values()) {\n kMeansClusters.add(cluster);\n }\n return this.clusterToJSON(kMeansClusters);\n }", "private static void k_means_offline(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "public static int mergeStones(int[] stones, int K) {\n int N = stones.length;\n if ((N-1)%(K-1)!=0) return -1;\n\n // dp[i][j] stores from i to j if can merge, what is the min cost, if (Len(j, i)-1)%(K-1) == 0 that means it can merge to 1 pile, otherwise, we only calculate\n // (from i(start point) to the farest point which can finally merge to 1 pile)'s merge cost\n int[][] dp = new int[N][N];\n\n int[] sum = new int[N+1];\n for (int i=0; i<N; i++) sum[i+1] = sum[i]+stones[i];\n\n for (int L=K; L<=N; L++) { // L is the length of small range\n // i is the subPiles is start point\n for (int i=0; i<=N-L; i++) {\n // j is the end point, L 不一定是K的倍数\n int j=i+L-1;\n dp[i][j]=Integer.MAX_VALUE;\n\n // each time we need keep from i to m is a \"can-merge-to-one-pile\" piles set, so m step is K-1; because each time besides i, we add(K-1) to the piles\n // [i, i+K-1] length is K\n // 把区间[i, j] split to [i, m] and [m+1,j], the left range must be merged to one pile, the right one maybe can or can not\n for (int m=i; m<j; m+=K-1) {\n dp[i][j]=Math.min(dp[i][j], dp[i][m] + dp[m+1][j]);\n }\n if ((j-i)%(K-1)==0) {\n dp[i][j]+=sum[j+1] - sum[i]; // if [i, j] can merge to 1 pile, we need finally add each elem from i to j\n System.out.println(dp[i][j]);\n }\n }\n }\n\n return dp[0][N-1];\n }", "public static int minDistance(String word1, String word2){\n int m = word1.length(), n = word2.length();\n int[][] dp = new int[m+1][n+1];\n\n for (int i = 0; i <= m; i++){\n dp[i][0] = i;\n }\n for (int i = 0; i <= n; i++){\n dp[0][i] = i;\n }\n\n for (int i = 1; i <= m; i++){\n for (int j = 1; j <= n; j++){\n if (word1.charAt(i-1) == word2.charAt(j-1)){\n dp[i][j] = dp[i-1][j-1];\n }else{\n dp[i][j] = Math.min(dp[i-1][j-1], Math.min(dp[i][j-1], dp[i-1][j])) + 1;\n }\n }\n }\n\n return dp[m][n];\n }", "public void merge(SegmentCluster segment) {\n int cs = segmentIds.size();\n int ct = segment.segmentIds.size();\n double sScale = (double) cs / (cs + ct);\n double tScale = (double) ct / (cs + ct);\n for (int i = 0; i < period; i++) {\n int finalI = i;\n distMatrix[i] = IntStream\n .range(0, PeriodicaDocs.nRefSpots())\n .mapToDouble(o -> sScale * distMatrix[finalI][o] + tScale * segment.distMatrix[finalI][o])\n .toArray();\n }\n segmentIds.addAll(segment.segmentIds);\n this.repError = calculateRepresentationError();\n }", "private static void kmeans(int[] rgb, int k) {\n\t\tColor[] rgbColor = new Color[rgb.length];\r\n\t\tColor[] ColorCluster = new Color[rgb.length];\r\n\t\tint[] ColorClusterID = new int[rgb.length];\r\n\t\t\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgbColor[i] = new Color(rgb[i]);\r\n\t\t\tColorClusterID[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tColor[] currentCluster = new Color[k];\t\t\r\n\t\tint randomNumber[]= ThreadLocalRandom.current().ints(0, rgb.length).distinct().limit(k).toArray();\r\n\t\tColor[] modifiedColorCluster = new Color[k];\t\r\n\t\t\r\n\t\tfor(int j=0;j<k;j++) {\r\n\t\t\tcurrentCluster[j]=rgbColor[randomNumber[j]];\r\n\t\t}\r\n\t\tint flag = 1;\r\n\t\tint maxIterations = 1000;\r\n\t\tint numIteration=0;\r\n\t\tdouble[] distance = new double[maxIterations+1];\t\t\r\n\t\tdistance[0]=Double.MAX_VALUE;\r\n\t\twhile(flag == 1) {\r\n\t\t\tflag = 0;\r\n\t\t\tnumIteration++;\r\n\t\t\tdistance[numIteration]=assignCLustersToPixels(rgbColor,currentCluster,ColorCluster,ColorClusterID,k,rgb.length);\r\n\t\t\tmodifiedColorCluster= findMeans(rgbColor,ColorClusterID,modifiedColorCluster,k,rgb.length);\r\n\t\t\tif(!clusterCenterCheck(currentCluster, modifiedColorCluster,k)){\r\n\t\t\t\tflag = 1;\r\n\t\t\t\tfor(int j=0;j<k;j++) {\r\n\t\t\t\t\tcurrentCluster[j]=modifiedColorCluster[j];}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgb[i]= getValue(ColorCluster[i].getRed(),ColorCluster[i].getGreen(),ColorCluster[i].getBlue());\r\n\t\t}\r\n\t\treturn;\r\n\t }", "public int compare(Cluster cluster1, Cluster cluster2) {\n for (Node n1 : cluster1) {\n for (Node n2 : cluster2) {\n if (n1.isAncestorOf(n2)) {\n return -1;\n } else if (n2.isAncestorOf(n1)) {\n return 1;\n }\n }\n }\n return 0;\n }", "void pairwiseCombine(){\n\t\t\n\t\tmin.Left.Right = min.Right;\n\t\tmin.Right.Left = min.Left;\n\t\t/**\n\t\tPairwise combine differentiates itself in operation of depending on the presence of a child node\n\t\t*/\n\t\t\n\t\tif(min.Child==null){\n\t\t/*map acts as the table to store similar degree nodes*/\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Right;\n\t\t\tmin = null;\n\t\t\tmin = current;\n\t\t\tlast = current.Left;\n\t\t\twhile(current!=last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\t\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\t\n\t\t\t\t\t/*Since a parent node can have only one child node a condition is checked to update its child node*/\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t/*If the node stored is less than the incoming node*/\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\tif(temp.Child == temp.Child.Right){\n\t\t\t\t\t\t\t\ttemp.Child.Right = current;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t/*If the incoming node is lower*/\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\t\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\t/*Since our condition is used only till last node and exits during last node the iteration is repeated for the last node*/\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\n\t\t}\n\t\telse{\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Child;\n\t\t\tcurrent.Parent = null;\n\t\t\tif(min!=min.Right){\n\t\t\t\tcurrent.Right.Left = min.Left;\n\t\t\t\tmin.Left.Right = current.Right;\n\t\t\t\tcurrent.Right = min.Right;\n\t\t\t\tmin.Right.Left = current;\n\t\t\t\tlast = current.Left;\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tlast = current.Left;\n\n\t\t\t}\n\t\t\tmin =null;\n\t\t\tmin = current;\n\t\t\t/*In the presence of a child the child has to be inserted at the top level*/\n\t\t\twhile(current != last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\n\t\t\t\twhile(map.containsKey(current.degree)){\n\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist && temp.dist!=0){\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\t\t}\n\n\t}", "public static int minDistanceIteration(String word1, String word2) {\n\n int m = word1.length();\n int n = word2.length();\n\n //op[i][j] 代表word1[0...i-1]与word2[0...j-1]的编辑距离\n int[][] op = new int[m + 1][n + 1];\n\n for (int i = 0; i <= m; i++) {\n op[i][0] = i;\n }\n\n for (int i = 0; i <=n; i++) {\n op[0][i] = i;\n }\n\n for (int i = 1; i <=m; i++) {\n for (int j = 1; j <=n; j++) {\n if (word1.charAt(i-1) == word2.charAt(j-1)) {\n op[i][j] = op[i-1][j-1];\n } else {\n op[i][j] = Math.min(Math.min(op[i-1][j-1], op[i-1][j]), op[i][j-1]) + 1;\n }\n }\n }\n\n return op[m][n];\n }", "public double distance(DoubleMatrix1D vector1, DoubleMatrix1D vector2) throws MetricException;", "private static void locateCenters(final int[] cluster, double[][] centers, final double[][] data) {\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n // reset centers to 0\n for (int c = 0; c < numCluster; c++) {\n Arrays.fill(centers[c], 0);\n }\n\n int[] countCluster = new int[numCluster];\n\n // sum over all samples\n for (int n = 0; n < N; n++) {\n vectorSumInPlace(centers[cluster[n]], data[n]);\n countCluster[cluster[n]]++;\n }\n\n // divide by number of samples in each cluster\n for (int c = 0; c < numCluster; c++) {\n vectorDivideInPlace(centers[c], countCluster[c]);\n }\n }", "public int minDistance(String word1, String word2) {\n if (word1==null && word2==null)\n return 0;\n if (word1==null)\n return word2.length();\n if (word2==null)\n return word1.length();\n\n int len1 = word1.length()+1;\n int len2 = word2.length()+1;\n int[][] dp = new int[len1][len2];\n for (int i=0; i<len1; i++) {\n dp[i][0] = i;\n }\n for (int j=1; j<len2; j++) {\n dp[0][j] = j;\n }\n for (int i=1; i<len1; i++) {\n char ch1 = word1.charAt(i-1);\n for (int j=1; j<len2; j++) {\n char ch2 = word2.charAt(j-1);\n if (ch1 == ch2) {\n dp[i][j] = dp[i-1][j-1];\n } else {\n int change = dp[i-1][j-1]+1;\n int delete = dp[i-1][j]+1;\n int add = dp[i][j-1]+1;\n int best = change > delete ? delete : change;\n best = best > add ? add : best;\n dp[i][j] = best;\n }\n }\n }\n return dp[len1-1][len2-1];\n }", "public void cluster(ArrayList<double[]> data){\n\t\t// set the dimension to make the cut in\n\t\tint dim = chooseDimension(data);\n\t\tif(dim != -1){\n\t\t\tArrayList<double[]> lhs = new ArrayList<double[]>();\n\t\t\tArrayList<double[]> rhs = new ArrayList<double[]>();\n\t\t\t\n\t\t\t// split the partition into two partitions(lhs and rhs) so the same amount of elements is in each partition\n\t\t\tCollections.sort(data, new Comparator<double[]>() {\n public int compare(double[] values, double[] otherValues) {\n return new Double(values[dim]).compareTo(new Double(otherValues[dim]));\n }});\n\t\t\t\n\t\t\tfor(int i = 0; i < data.size(); i++){\n\t\t\t\tif(i < data.size()/2){\n\t\t\t\t\tlhs.add(data.get(i));\n\t\t\t\t}else{\n\t\t\t\t\trhs.add(data.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t// use algorithm mondrian recursively for the new partitions\n\t\t\tmondrian(rhs);\n\t\t\tmondrian(lhs);\n\t\t}\n\t}", "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 int minDistance(String word1, String word2) {\n\n rows = word1.length() + 1;\n cols = word2.length() + 1;\n dp = new int[rows][cols];\n for (int i = 0; i < rows; i++) {\n dp[i][0] = i;\n }\n for (int i = 0; i < cols; i++) {\n dp[0][i] = i;\n }\n\n for (int i = 1; i < rows; i++) {\n for (int j = 1; j < cols; j++) {\n if (word1.charAt(i - 1) == word2.charAt(j - 1)) {\n dp[i][j] = dp[i - 1][j - 1];\n } else {\n dp[i][j] = 1 + Math.min(dp[i - 1][j - 1], Math.min(dp[i][j - 1], dp[i - 1][j]));\n }\n }\n }\n findPath(dp);\n printPath(dp);\n return dp[rows - 1][cols - 1];\n }", "public int minDistance(String word1, String word2) {\n int[][] mem = new int[word1.length() + 1][word2.length() + 1];\n for (int[] row : mem) Arrays.fill(row, -1);\n mem[word1.length()][word2.length()] = 0;\n return minDist(word1, 0, word2, 0, mem);\n }", "@Test\r\n public void testGroupSimilarity() throws Exception {\r\n final List<ICluster> originalCLuster = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster);\r\n List<ICluster> l1 = new ArrayList<ICluster>(originalCLuster);\r\n\r\n final List<ICluster> originalCLuster2 = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster2);\r\n List<ICluster> l2 = new ArrayList<ICluster>(originalCLuster2);\r\n\r\n ClusterListSimilarity cd = new ClusterListSimilarity(distanceMeasure);\r\n final List<ICluster> identical = cd.identicalClusters(l1, l2);\r\n\r\n Assert.assertEquals(originalCLuster.size(), identical.size());\r\n Assert.assertTrue(l1.isEmpty());\r\n Assert.assertTrue(l2.isEmpty());\r\n }", "@Override\r\n\tpublic void getMinimumSpanningTree(GraphStructure graph) {\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[0]=0;\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\tList<Edge> list;\r\n\t\twhile(spanningTreeSet.size()!=numberOfVertices) {\r\n\t\t\tfor (int vertex=0; vertex<numberOfVertices;vertex++) {\r\n\t\t\t\tif(! spanningTreeSet.contains(vertex)) {\r\n\t\t\t\t\tspanningTreeSet.add(vertex);\r\n\t\t\t\t\tlist = adjacencyList[vertex];\r\n\t\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[vertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nvertex\\tdistance from source\");\r\n\t\tfor (int i=0;i<numberOfVertices;i++) {\r\n\t\t\tSystem.out.println(i+\"\\t\"+distanceArray[i]);\r\n\t\t}\r\n\t}", "private void getMinDistances(String u, HashMap<Integer, Integer> distances, HashMap<String, Integer> nodeDistances){\n if(!graphVertexHashMap.containsKey(u)) return;\n\n Queue<String> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n queue.add(u);\n visited.put(u, true);\n int dist = 0;\n\n distances.put(dist, 1);\n nodeDistances.put(u, 0);\n\n while(!queue.isEmpty()){\n String node = queue.poll();\n dist += 1;\n boolean found = false;\n for(String edge : graphVertexHashMap.get(node).getOutDegrees().keySet()){\n if(!visited.containsKey(edge)){\n found = true;\n visited.put(edge, true);\n queue.add(edge);\n if(distances.get(dist) == null){\n distances.put(dist, 1);\n }\n else{\n distances.put(dist, distances.get(dist) + 1);\n }\n if(nodeDistances.containsKey(edge)){\n if(dist < nodeDistances.get(edge)){\n nodeDistances.put(edge, dist);\n }\n }else{\n nodeDistances.put(edge, dist);\n }\n }\n }\n if(!found) dist -=1;\n }\n\n }", "private Node<Integer> minDistance(Map<Node<Integer>, Double> distances, Map<Node<Integer>, Double> unvisitedNodes) {\n Double min = Double.POSITIVE_INFINITY;\n\n Node<Integer> minNode = null;\n for (Map.Entry<Node<Integer>, Double> entry : distances.entrySet()) {\n Double d = entry.getValue();\n if (Double.compare(d, min) < 0 && unvisitedNodes.containsKey(entry.getKey())) {\n min = d;\n minNode = entry.getKey();\n }\n }\n return minNode;\n }", "private static double findMinCost(double lemda, Vector finalVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n int n = neighbors.size();\r\n int m = destList.size();\r\n int w = n > m ? m : n;\r\n\r\n double [] costFor_r = new double[w];\r\n\r\n double minCost = MaxDistance;\r\n double totalCurToAll = findDistanceCurToAll(currentNode, destList);\r\n for ( int r = 0 ; r < w; r ++ )\r\n {\r\n Vector rSetVector = new Vector();\r\n costFor_r[r] = getMinSetCost_given_r( r+1, rSetVector,\r\n currentNode,\r\n neighbors,\r\n destList);\r\n costFor_r[r] = (1.0 - lemda) * (r + 1) / n + costFor_r[r] / totalCurToAll;\r\n if ( costFor_r[r] < minCost ) {\r\n minCost = costFor_r[r];\r\n finalVector.clear();\r\n for (int k = 0; k < rSetVector.size(); ++k) {\r\n finalVector.add(k, rSetVector.get(k));\r\n }\r\n }\r\n }\r\n\r\n return minCost;\r\n }", "@Test\r\n public void testMerge() throws Exception {\r\n// List<ISpectrum> spectra = ClusteringTestUtilities.readConsensusSpectralItems();\r\n//\r\n// List<ICluster> list = ClusterUtilities.asClusters(spectra);\r\n// IClusteringEngine engine = new ClusteringEngineFactory().getClusteringEngine();\r\n// for (ICluster sc : list) {\r\n// engine.addClusters(sc);\r\n// }\r\n// for (int i = 0; i < Defaults.getNumberReclusteringPasses(); i++) {\r\n// if (!engine.processClusters())\r\n// break;\r\n// }\r\n// // we have solved for these\r\n// List<ICluster> found = (List<ICluster>) engine.getClusters();\r\n//\r\n//\r\n// final ISimilarityChecker similarityChecker = new FrankEtAlDotProduct(Defaults.getFragmentIonTolerance(), Defaults.getNumberComparedPeaks());\r\n// final List<ICluster> newClusters = ClusterUtilities.mergeClusters(found, similarityChecker, 1);\r\n//\r\n// // because we just did this in the engine we expect little further merging\r\n// Assert.assertEquals(newClusters.size(), found.size());\r\n\r\n\r\n }", "public static final int[] MSC(double[][] users, double kernelSize) {\n\t\tif(users.length==0) return null;\n\t\t\n\t\tint dimension = users[0].length;\n\t\tint points = users.length;\n\t\t// TODO revisar el codigo y optimizar\n\t\t// TODO Entender esta linea. Sirve para copiar arrays, pero quiero aprender como funciona stream\n\t\tdouble[][] clusterPoints = Arrays.stream(users).map(double[]::clone).toArray(double[][]::new);\n\t\tboolean[] hasConverged = new boolean[points];\n\t\tint totalConverged = 0;\n\t\twhile(totalConverged < points)\n\t\t\tfor(int i = 0; i < points; i++) {\n\t\t\t\tif(hasConverged[i]==true) continue;\n\t\t\t\t\n\t\t\t\tdouble[] shift = new double[dimension];\n\t\t\t\tint totalMove = 0;\n\t\t\t\t\n\t\t\t\tfor(int j = 0; j < points;j++) \n\t\t\t\t\tif(Metrics.flatKernel(clusterPoints[i],kernelSize, users[j])>0) {\n\t\t\t\t\t\tshift = Vectors.sumV(shift, users[j]);\n\t\t\t\t\t\ttotalMove++;\n\t\t\t\t\t}\n\t\t\t\tshift = Vectors.divVC(shift, totalMove);\n\t\t\t\tif(Vectors.isZero(Vectors.subV(shift, clusterPoints[i]))) {\n\t\t\t\t\thasConverged[i] = true;\n\t\t\t\t\ttotalConverged++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tclusterPoints[i] = shift.clone();\n\t\t\t}\n\t\t\n\t\tint[] resultClusters = new int[points];\n\t\tint actCluster = 0;\n\t\tfor(int i = 0; i < points-1; i++) {\n\t\t\tif(hasConverged[i]==false) continue;\n\t\t\tresultClusters[i] = ++actCluster;\n\t\t\tfor(int j = i+1; j < points; j++) \n\t\t\t\tif(Vectors.isEqual(clusterPoints[i], clusterPoints[j])) {\n\t\t\t\t\thasConverged[j] = false;\n\t\t\t\t\tresultClusters[j] = actCluster;\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn resultClusters;\n\t}", "Point determineClosestCentre(Point p, Point centreA, Point centreB){\n\t\t\n\t\t//loop counter variable\n\t\tint l;\t\n\n\t\t//stores the distance between p and centreA\n\t\tdouble distanceA = 0.0;\n\n\t\tfor(l=0;l<p.dimension;l++){\n\t\t\t//centroid coordinate of the point\n\t\t\tdouble centroidCoordinatePoint;\n\t\t\tif(p.weight != 0.0){\n\t\t\t\tcentroidCoordinatePoint = p.coordinates[l] / p.weight;\n\t\t\t} else {\n\t\t\t\tcentroidCoordinatePoint = p.coordinates[l];\n\t\t\t}\n\t\t\t//centroid coordinate of the centre\n\t\t\tdouble centroidCoordinateCentre;\n\t\t\tif(centreA.weight != 0.0){\n\t\t\t\tcentroidCoordinateCentre = centreA.coordinates[l] / centreA.weight;\n\t\t\t} else {\n\t\t\t\tcentroidCoordinateCentre = centreA.coordinates[l];\n\t\t\t}\n\n\t\t\tdistanceA += (centroidCoordinatePoint-centroidCoordinateCentre) * \n\t\t\t\t\t(centroidCoordinatePoint-centroidCoordinateCentre) ;\n\t\t}\n\n\t\t//stores the distance between p and centreB\n\t\tdouble distanceB = 0.0;\n\n\t\tfor(l=0;l<p.dimension;l++){\n\t\t\t//centroid coordinate of the point\n\t\t\tdouble centroidCoordinatePoint;\n\t\t\tif(p.weight != 0.0){\n\t\t\t\tcentroidCoordinatePoint = p.coordinates[l] / p.weight;\n\t\t\t} else {\n\t\t\t\tcentroidCoordinatePoint = p.coordinates[l];\n\t\t\t}\n\t\t\t//centroid coordinate of the centre\n\t\t\tdouble centroidCoordinateCentre;\n\t\t\tif(centreB.weight != 0.0){\n\t\t\t\tcentroidCoordinateCentre = centreB.coordinates[l] / centreB.weight;\n\t\t\t} else {\n\t\t\t\tcentroidCoordinateCentre = centreB.coordinates[l];\n\t\t\t}\n\n\t\t\tdistanceB += (centroidCoordinatePoint-centroidCoordinateCentre) * \n\t\t\t\t\t(centroidCoordinatePoint-centroidCoordinateCentre) ;\n\t\t}\n\n\t\t//return the nearest centre\n\t\tif(distanceA < distanceB){\n\t\t\treturn centreA;\n\t\t} else {\n\t\t\treturn centreB;\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 }", "public void doInitialClustering(AddressIF me, Matrix_4_HSH tmp) {\n\t\t\n\t}", "public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}", "int partDist(String w1, String w2, int w1len, int w2len) {\n // To remember previous state\n int [][] matrix = new int [w1len + 1][w2len +1];\n for(int i = 0; i <= w1len; i++){\n for(int j = 0; j <= w2len; j++){\n // If word 1 is empty\n if(i == 0)\n matrix[i][j] = j;\n // If word 2 is empty\n else if(j == 0)\n matrix[i][j] = i;\n\n // if the previous letter are the same\n else if(w1.charAt(i-1) == w2.charAt(j-1))\n matrix[i][j] = matrix[i-1][j-1];\n /*\n remove one letter matrix[i][j-1]\n add one letter matrix[i-1][j]\n change letter matrix[i-1][j-1]\n */\n else\n matrix[i][j] = 1 + min(matrix[i][j-1], matrix[i-1][j], matrix[i-1][j-1]);\n }\n }\n\n return matrix[w1len][w2len];\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n MapModel map = new MapModel(googleMap, true, true);\n map.setMapType(1);\n\n new PersonModel().addItems(person_list);\n //Cluster Manage with click actions in cluster and inside cluster markers :)\n\n LatLng center_location = map.getMapCenterPosition(1, person_list);\n\n Location center_point = new Location(\"center_point\");\n center_point.setLatitude(center_location.latitude);\n center_point.setLongitude(center_location.longitude);\n\n float max_distance = 0;\n for (PersonModel person : person_list) {\n\n System.out.println(person.getPosition());\n\n Location location_mountain = new Location(\"select_location\");\n\n location_mountain.setLatitude(person.getPosition().latitude);\n location_mountain.setLongitude(person.getPosition().longitude);\n float distance = center_point.distanceTo(location_mountain);\n System.out.println(distance + \" to check....\");\n if (distance > max_distance) {\n max_distance = distance;\n System.out.println(distance + \" new asign....\");\n }\n }\n\n\n map.moveCamera(center_location, max_distance);\n mClusterManager = new ClusterManager<>(this, map.getGoogleMap());\n mClusterManager.setRenderer(new PersonClusterRenderer(this, map.getGoogleMap() ,mClusterManager, ClusterMapsActivity.this));\n map.getGoogleMap().setOnCameraChangeListener(mClusterManager);\n map.getGoogleMap().setOnMarkerClickListener(mClusterManager);\n map.getGoogleMap().setOnInfoWindowClickListener(mClusterManager);\n mClusterManager.setOnClusterClickListener(this);\n mClusterManager.setOnClusterInfoWindowClickListener(this);\n mClusterManager.setOnClusterItemClickListener(this);\n mClusterManager.setOnClusterItemInfoWindowClickListener(this);\n for(PersonModel person:person_list)\n {\n mClusterManager.addItem(person);\n }\n\n mClusterManager.cluster();\n\n\n map.getGoogleMap().setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n @Override\n public void onInfoWindowClick(Marker arg0) {\n\n for (PersonModel person : person_list) {\n if (person.name.equals(arg0.getTitle())) {\n\n String uri = \"http://maps.google.com/maps?daddr=\"+arg0.getPosition().latitude+\",\"+\n arg0.getPosition().longitude;\n System.out.println(\"Google maps url: \"+uri);\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));\n intent.setClassName(\"com.google.android.apps.maps\", \"com.google.android.maps.MapsActivity\");\n startActivity(intent);\n }\n }\n }\n });\n }", "private int dist(int city1, int city2){\n\t\treturn this.getGraph().getWeight(city1, city2);\n\t}", "static int editDistDP(String str1, String str2, int m, int n) \n {\n int dp[][] = new int[m + 1][n + 1]; \n \n // Fill d[][] in bottom up manner \n for (int i = 0; i <= m; i++) { \n for (int j = 0; j <= n; j++) { \n // If first string is empty, only option is to \n // insert all characters of second string \n if (i == 0) \n dp[i][j] = j; // Min. operations = j \n \n // If second string is empty, only option is to \n // remove all characters of second string \n else if (j == 0) \n dp[i][j] = i; // Min. operations = i \n \n // If last characters are same, ignore last char \n // and recur for remaining string \n else if (str1.charAt(i - 1) == str2.charAt(j - 1)) \n dp[i][j] = dp[i - 1][j - 1]; \n \n // If the last character is different, consider all \n // possibilities and find the minimum \n else\n dp[i][j] = 1 + min(dp[i][j - 1], // Insert \n dp[i - 1][j], // Remove \n dp[i - 1][j - 1]); // Replace \n } \n }\n\t\tprint2DArray(dp);\n \n return dp[m][n]; \n }", "public double distance(double[] vector1, double[] vector2) throws MetricException;", "public void findCommunities() {\n\n\t\t// We copy the community of scale to scale+1\n\t\tfor (Object o : G) {\n\t\t\tNode i = (Node) o;\n\t\t\ti.addCommunity(scale + 1, i.getCommunity(scale));\n\t\t}\n\t\tscale++;\n\t\tG.setScaleMax(scale);\n\n\t\tString old_community;\n\t\tString current_community;\n\t\tString best_community = \"\";\n\t\tdouble dQ_max = 0;\n\t\tdouble dQ = 0;\n\t\t// double old_Q;\n\t\t// do {\n\t\t// old_Q = Q;\n\t\tfor (Object oi : G) {\n\t\t\tNode i = (Node) oi;\n\t\t\t// Node iH = (Node) nodesH.toArray()[k];\n\t\t\tdQ_max = 0;\n\t\t\tfor (Object oj : G) {\n\t\t\t\tNode j = (Node) oj;\n\t\t\t\tif (i != j && i.getCommunity(scale) != j.getCommunity(scale)) {\n\t\t\t\t\t// We put i into the community C of j\n\t\t\t\t\told_community = i.getCommunity(scale);\n\t\t\t\t\tcurrent_community = j.getCommunity(scale);\n\t\t\t\t\ti.editCommunity(scale, current_community);\n\t\t\t\t\t// We compute the modularity gain.\n\t\t\t\t\tdQ = computeModularityGain(i, current_community);\n\t\t\t\t\t// We keep the community with the highest gain.\n\t\t\t\t\tif (dQ > dQ_max) {\n\t\t\t\t\t\tdQ_max = dQ;\n\t\t\t\t\t\tbest_community = current_community;\n\t\t\t\t\t}\n\t\t\t\t\t// We put i back into its old community.\n\t\t\t\t\ti.editCommunity(scale, old_community);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// We put i into the best community.\n\t\t\tif (dQ_max > 0) {\n\t\t\t\ti.editCommunity(scale, best_community);\n\t\t\t\t// iH.editCommunity(scale, best_community);\n\t\t\t}\n\t\t}\n\t\tcomputeModularity();\n\t\t// } while (old_Q != Q);\n\t}", "public Clustering<V> compute() {\n if (graph.vertexSet().isEmpty()) {\n return new ClusteringImpl<>(Collections.emptyList());\n }\n\n matrix = Matrices.buildAdjacencyMatrix(graph, mapping, true);\n\n normalize();\n\n for (var i = 0; i < iterations; i++) {\n final var previous = matrix.copy();\n\n expand();\n inflate();\n normalize();\n\n if (matrix.equals(previous)) break;\n }\n\n // matrix can contain identical clusters of elements which are less than one\n final var clusters = new HashSet<Set<V>>(matrix.getRowDimension());\n\n for (var i = 0; i < matrix.getRowDimension(); i++) {\n final var cluster = new HashSet<V>();\n\n for (var j = 0; j < matrix.getColumnDimension(); j++) {\n if (matrix.getEntry(i, j) > 0) cluster.add(mapping.getIndexList().get(j));\n }\n\n if (!cluster.isEmpty()) clusters.add(cluster);\n }\n\n return new ClusteringImpl<>(new ArrayList<>(clusters));\n }", "public abstract double calculateDistance(double[] x1, double[] x2);", "public Cluster(Point minPoint, Point maxPoint) {\n\t\tthis.minPoint = minPoint;\n\t\tthis.maxPoint = maxPoint;\n\t}", "public double distance(double[] vector1, DoubleMatrix1D vector2) throws MetricException;" ]
[ "0.6301736", "0.62014365", "0.6146969", "0.6090013", "0.6064633", "0.59684366", "0.5967493", "0.5959441", "0.5848342", "0.5842815", "0.5814147", "0.5811335", "0.5666473", "0.56541586", "0.5634452", "0.5621878", "0.561433", "0.5614295", "0.5555766", "0.55281264", "0.55273247", "0.5517535", "0.55162036", "0.55137485", "0.551347", "0.5504834", "0.5485196", "0.5484005", "0.5476001", "0.54749197", "0.5468564", "0.5467693", "0.54405135", "0.5423232", "0.54033047", "0.5401536", "0.53978527", "0.53573173", "0.5355234", "0.5351187", "0.53438723", "0.53387576", "0.5331712", "0.5325196", "0.5315655", "0.53119224", "0.5306245", "0.5281669", "0.52784425", "0.5274577", "0.52183926", "0.52114445", "0.5177243", "0.51761246", "0.5156945", "0.51442826", "0.5133895", "0.5123223", "0.5111317", "0.5106621", "0.50963056", "0.5078848", "0.50781006", "0.505946", "0.5057146", "0.5055872", "0.50486857", "0.50397164", "0.503352", "0.5019451", "0.5017592", "0.50163645", "0.5004043", "0.4997997", "0.49918", "0.4973474", "0.49700284", "0.4966712", "0.49591276", "0.4952286", "0.49457577", "0.4943609", "0.49362347", "0.49341398", "0.49316192", "0.49259064", "0.49257514", "0.49234772", "0.49158865", "0.49102208", "0.49019593", "0.4899021", "0.48926437", "0.48906058", "0.48852956", "0.48844182", "0.48786393", "0.48785782", "0.48779023", "0.48690122" ]
0.7049068
0
if the removed cluster was in min distance for other clusters, we remove that entry
private static void createMinMatrixAfterRemoval(String c) { TreeMap<String, Double> temp = distanceMatrix.get(c); for(String s:allClusters) { if(!s.equals(c)) { double dist = temp.get(s); updateMinMatrix(c,s,dist); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Centroid removeCentroid();", "public void deleteMin();", "public void deleteMin()\t\t\t\t//delete smallest key\n\t{\n\t\troot=deleteMin(root);\n\t}", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "public void deleteMin() {\n root = deleteMin(root);\n }", "public void deleteMin() {\n root = deleteMin(root);\n }", "public void removeMin() {\n\t\troot = removeMin(root);\n\t}", "void deleteMin() {\n delete(keys[0]);\n }", "public T deleteMin();", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "Nodefh removeMin(){\n\t\t\n\t\tif(min == null){\n\t\t\tNodefh dummy = new Nodefh();\n\t\t\tdummy.index = -1;\n\t\t\treturn dummy;\n\t\t}\n\t\tNodefh temp = new Nodefh();\n\t\ttemp = min;\n\t\tif((min.Child == null) && (min == min.Right)){\n\t\t\tmin = null;\n\t\t\treturn temp;\n\t\t}\n\t\tpairwiseCombine();\n\t\treturn temp;\n\t}", "public abstract int deleteMin();", "@Override\r\n\t\t\t\t\tprotected boolean removeEldestEntry(Map.Entry e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn size()>5;\r\n\t\t\t\t\t}", "@Override\n public E deleteMin()\n {\n return list.removeFirst();\n }", "public void delete(Node<T> x) {\n decreaseKey(x, min.key);\n extractMin();\n }", "@Override\r\n\t\t\tprotected boolean removeEldestEntry(Map.Entry eldest) {\r\n\t\t return size() > 3;\t//every time the eldest element will be removed if size > 3\r\n\t\t }", "public int Delete_Min()\n {\n \tthis.array[0]=this.array[this.getSize()-1];\n \tthis.size--; \n \tthis.array[0].setPos(0);\n \tint numOfCompares = heapifyDown(this, 0);\n \treturn numOfCompares;\n }", "public Node removeMin() {\n \t\t// TODO Complete this method!\n \t\tif (indexOfLeastPriority == 2) {\n \t\t\tNode toReturn = getNode(1);\n \t\t\tsetNode(1, null);\n \t\t\treturn toReturn;\n \t\t}\n \t\tint indexOfReplacement = indexOfLeastPriority - 1;\n \t\tNode nodeOfReplacement = getNode(indexOfReplacement);\n \t\tNode toRemove = getNode(1);\n \t\tsetNode(indexOfReplacement, null);\n \t\tsetNode(1, nodeOfReplacement);\n \t\tbubbleDown(1);\n \t\t//decrement IoLP\n \t\tindexOfLeastPriority--;\n \t\treturn toRemove;\n \t}", "public T removeMin ();", "private boolean distributeRemoveByKey(Entry<ProcessorDistributionKey, Collection<Geometry>> removeEntry)\n {\n boolean processorsChanged = false;\n final GeometryProcessor<? extends Geometry> processor = myGeometryProcessorsMap.get(removeEntry.getKey());\n final Collection<? extends Geometry> procRemoves = removeEntry.getValue();\n if (processor == null)\n {\n // If we are removing geometries and there is no\n // processor, then the geometries should be in one of the\n // holding lists.\n final Set<Geometry> inactive = myInactiveGeometries.get(removeEntry.getKey());\n if (inactive != null)\n {\n inactive.removeAll(procRemoves);\n if (inactive.isEmpty())\n {\n myInactiveGeometries.remove(removeEntry.getKey());\n }\n }\n }\n else\n {\n processor.receiveObjects(this, Collections.<Geometry>emptyList(), procRemoves);\n if (processor.getGeometryCount() == 0)\n {\n processorsChanged = true;\n myGeometryProcessorsMap.remove(removeEntry.getKey());\n processor.close();\n }\n if (LOGGER.isDebugEnabled())\n {\n LOGGER.debug(\"Removed \" + procRemoves.size() + \" for processor \" + processor);\n if (processorsChanged)\n {\n LOGGER.debug(\"Removed processor for distribution key \" + removeEntry.getKey());\n }\n }\n }\n\n return processorsChanged;\n }", "public Node<E> remove_min_node(){\r\n if (theData.size() <= 0) return null;\r\n\r\n int index = 0 ;\r\n E min = theData.get(0).getData();\r\n //searching min element\r\n for (int i = 0; i< theData.size() ; i++){\r\n if (min.compareTo(theData.get(i).getData()) > 0 ){\r\n min = theData.get(i).getData();\r\n index = i;\r\n }\r\n }\r\n\r\n //copying element for return\r\n Node<E> item = new Node<E>(theData.get(index).getData());\r\n item.data = theData.get(index).getData();\r\n item.count = theData.get(index).getCount();\r\n\r\n //removing all occurances\r\n while (theData.get(index).count > 1)\r\n theData.get(index).count-=1;\r\n\r\n if (theData.get(index).count == 1 ){\r\n\r\n if(index != theData.size()-1){\r\n theData.set(index, theData.remove(theData.size() - 1));\r\n fixHeap(index);\r\n }else\r\n theData.remove(theData.size() - 1);\r\n }\r\n return item;\r\n }", "private void updateClusterList(EventPacket<BasicEvent> ae, int t) {\n pruneList.clear();\n for (Cluster c : clusters) {\n int t0 = c.getLastEventTimestamp();\n// int t1=ae.getLastTimestamp();\n int timeSinceSupport = t - t0;\n if (timeSinceSupport == 0) {\n continue; // don't kill off cluster spawned from first event\n }\n boolean killOff = false;\n if (clusterLifetimeIncreasesWithAge) {\n int age = c.getLifetime();\n int supportTime = clusterLifetimeWithoutSupportUs;\n if (age < clusterLifetimeWithoutSupportUs) {\n supportTime = age;\n }\n if (timeSinceSupport > supportTime) {\n killOff = true;\n// System.out.println(\"pruning unsupported \"+c);\n }\n } else {\n if (timeSinceSupport > clusterLifetimeWithoutSupportUs) {\n killOff = true;\n// System.out.println(\"pruning unzupported \"+c);\n }\n }\n boolean hitEdge = c.hasHitEdge();\n if (t0 > t || killOff || timeSinceSupport < 0 || hitEdge) {\n // ordinarily, we discard the cluster if it hasn't gotten any support for a while, but we also discard it if there\n // is something funny about the timestamps\n pruneList.add(c);\n }\n// if(t0>t1){\n// log.warning(\"last cluster timestamp is later than last packet timestamp\");\n// }\n }\n clusters.removeAll(pruneList);\n // merge clusters that are too close to each other.\n // this must be done interatively, because merging 4 or more clusters feedforward can result in more clusters than\n // you start with. each time we merge two clusters, we start over, until there are no more merges on iteration.\n // for each cluster, if it is close to another cluster then merge them and start over.\n// int beforeMergeCount=clusters.size();\n boolean mergePending;\n Cluster c1 = null;\n Cluster c2 = null;\n do {\n mergePending = false;\n int nc = clusters.size();\n outer:\n for (int i = 0; i < nc; i++) {\n c1 = clusters.get(i);\n for (int j = i + 1; j < nc; j++) {\n c2 = clusters.get(j); // getString the other cluster\n if (c1.distanceTo(c2) < (c1.getRadius() + c2.getRadius())) {\n // if distance is less than sum of radii merge them\n // if cluster is close to another cluster, merge them\n mergePending = true;\n break outer; // break out of the outer loop\n }\n }\n }\n if (mergePending && c1 != null && c2 != null) {\n pruneList.add(c1);\n pruneList.add(c2);\n clusters.remove(c1);\n clusters.remove(c2);\n clusters.add(new Cluster(c1, c2));\n// System.out.println(\"merged \"+c1+\" and \"+c2);\n }\n } while (mergePending);\n // update all cluster sizes\n // note that without this following call, clusters maintain their starting size until they are merged with another cluster.\n if (isHighwayPerspectiveEnabled()) {\n for (Cluster c : clusters) {\n c.setRadius(defaultClusterRadius);\n }\n }\n // update paths of clusters\n numVisibleClusters = 0;\n for (Cluster c : clusters) {\n c.updatePath(ae);\n if (c.isVisible()) {\n numVisibleClusters++;\n }\n }\n }", "public HuffmanTree removeMin();", "public boolean removePoint(Point p){\n\t\t\treturn clusterPointsList.remove(p);\n\t\t}", "public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n// TODO:adding check for assurance\n }", "public void removeSmaller(double value){\r\n\t DoubleNode cursor2; \r\n\tfor(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\tif(cursor.getData() < value){\r\n\t\t\tif(cursor == head){\r\n\t\t\t\thead = head.getLink(); \r\n\t\t\t\tmanyNodes--; \r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcursor2 = cursor; \r\n\t\t\t\tthis.removeCurrent();\r\n\t\t\t\tcursor = cursor2;\r\n\t\t\t\tmanyNodes--; \r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n }", "public void removeCluster(FileEntry file, int position)\r\n\t{\r\n\t\t//Loop will continue until it reaches the end of the array\r\n\t\t//or if the index i matches that of the cluster number\r\n\t\tfor (int i = 0; i < MAX_CLUSTERS; i++)\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t//Sets the cluster at index i to false if it matches the\r\n\t\t\t\t//cluster number in the DiskClusterList at the given position\r\n\t\t\t\tif (((file.getCluster().getClusterNumber(position)) == i)\r\n\t\t\t\t && (cluster[i]) == true)\r\n\t\t\t\t\tcluster[i] = false;\r\n\t\t\t}\r\n\t\t\tcatch (InvalidPositionException ipe)\t{\t}\r\n\t\t}\t\r\n\t}", "public int removeMin() {\n // FILL IN CODE\n\n return -1; // don't forget to change it\n }", "public void removeEdge() {\n Graph GO = new Graph(nbOfVertex + 1);\n Value.clear();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n Value.add(j);\n if (MaxMatch[i] == Map.get(j)) {\n GO.addEdge(Map.get(j), i);\n } else {\n GO.addEdge(i, Map.get(j));\n }\n }\n }\n\n for (int i : V2) {\n for (int j : Value) {\n if (!V2.contains(j)) {\n GO.addEdge(i, j);\n }\n }\n }\n //System.out.println(\"GO : \");\n //System.out.println(GO);\n int[] map2Node = GO.findStrongConnectedComponent();\n //GO.printSCC();\n\n ArrayList<Integer>[] toRemove = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n toRemove[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n for (int j : x[i].getDomain()) {\n ////System.out.println(i + \" \" + j);\n if (map2Node[i] != map2Node[Map.get(j)] && MaxMatch[i] != Map.get(j)) {\n toRemove[i].add(j);\n if (debug == 1) System.out.println(\"Remove arc : \" + i + \" => \" + j);\n }\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j : toRemove[i]) {\n x[i].removeValue(j);\n }\n }\n }", "static double removeHeuristic1(GameState c, boolean isMaxNode) {\n\t\tint i;\n\t\tint curWeight = 0;\n\t\tint feasible_remove_moves = 0;\n\t\tint total_moves = 0;\n\t\tfor (i = -GameState.HALF_BOARD; i <= GameState.HALF_BOARD; i = i + 1) {\n\t\t\tcurWeight = c.getWeight(i);\n\t\t\tif (curWeight != 0) {\n\t\t\t\ttotal_moves++;\n\t\t\t\t// There is a weight at this position. Try Removing it\n\t\t\t\tCocaineWeight w = c.removeMove(i);\n\t\t\t\t// Check if the board tipped\n\t\t\t\tif (c.isTipping_old() == false) {\n\t\t\t\t\tfeasible_remove_moves++;\n\t\t\t\t}\n\t\t\t\t// Place the weight back\n\t\t\t\tc.makeMove(curWeight, i, w.player);\n\t\t\t}\n\t\t}\n\t\tif (total_moves == 0) {\n\t\t\treturn 0.0;\n\t\t} else if (isMaxNode) {\n\t\t\treturn ((double) (feasible_remove_moves) / (double) (total_moves));\n\t\t} else {\n\t\t\treturn (-1.0 * ((double) (feasible_remove_moves) / (double) (total_moves)));\n\t\t}\n\t}", "private void removeOldestPoint() {\n PathPoint p = points.get(points.size() - length - 1);\n // if points has 5 points (0-4), length=3, then remove points(5-3-1)=points(1) leaving 2-4 which is correct\n float t = p.t - firstTimestamp;\n st -= t;\n sx -= p.x;\n sy -= p.y;\n stt -= t * t;\n sxt -= p.x * t;\n syt -= p.y * t;\n }", "private Node deleteMin(Node h) {\n if (h.left == null)\n return null;\n\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n\n h.left = deleteMin(h.left);\n return balance(h);\n }", "public E removeMin() {\n // TODO: YOUR CODE HERE\n E min = getElement(1);\n swap(1, size());\n setElement(size(), null);\n bubbleDown(1);\n size -= 1;\n return min;\n }", "public boolean removeEldestEntry(Map.Entry entry){\n return size() > capacity;\n }", "private void removeInvalidFromPool()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_1st_oldest;//index of the oldest individual\r\n\t\tint idx_2nd_oldest;//index of the 2nd oldest individual\r\n\t\tint idx_to_remove;//index of an chromosome which has to be removed\r\n\t\tint idx_current;//index of currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tint max_num_errors;//maximum numbers of stored errors among checked chromosomes\r\n\t\tdouble error_1st_oldest;//average error of the oldest individual\r\n\t\tdouble error_2nd_oldest;//average error of the 2nd oldest individual\r\n\t\tdouble max_error;//largest error among the oldest individuals\r\n\t\tVector<Integer> idx_oldest;//indices of all chromosomes with a life span larger than a predefined threshold\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\t//if the maturity pool is full and none of the genotypes could be removed above because of module outputs\r\n\t\t//then remove one of the oldest individuals according to the errors\r\n\t\tif(_pool_of_bests.size()==_size_pool_of_bests)\r\n\t\t{\r\n\t\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\t\r\n\t\t\t//find all oldest genotypes\r\n\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t{\r\n\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_oldest.add(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//1) find the worst oldest gentypes with a span above a threshold\r\n\t\t\t//2) do not remove a single genotype without comparison;\r\n\t\t\t// it could have very high performance\r\n\t\t\tif(idx_oldest.size() > 1)\r\n\t\t\t{\r\n\t\t\t\tidx_to_remove = idx_oldest.get(0);\r\n\t\t\t\tmax_error = _pool_of_bests.get(idx_to_remove)._error.getAverageError();\r\n\t\t\t\tfor(i=idx_to_remove+1; i<idx_oldest.size(); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\t\tif(max_error < _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tidx_to_remove = idx_current;\r\n\t\t\t\t\t\tmax_error = _pool_of_bests.get(idx_to_remove)._error.getAverageError();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse//remove the worst of two oldest genotypes if none of genotypes had span above the threshold\r\n\t\t\t{\r\n\t\t\t\t//find the oldest and 2nd oldest individuals\r\n\t\t\t\tidx_1st_oldest = -1;\r\n\t\t\t\tmax_num_errors = 0;\r\n\t\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t//\"[0]\" because the number of errors is equal for all sub-individuals of the same individual\r\n\t\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\t\tif(max_num_errors < num_errors)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmax_num_errors = num_errors;\r\n\t\t\t\t\t\tidx_1st_oldest = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//find the 2nd oldest individuals\r\n\t\t\t\tidx_2nd_oldest = -1;\r\n\t\t\t\tif(size_mature_pool > 1)//the 2nd oldest individual exists if there are 2 or more individuals\r\n\t\t\t\t{\r\n\t\t\t\t\tmax_num_errors = 0;\r\n\t\t\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i!=idx_1st_oldest)//the oldest individual should be ignored\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//\"[0]\" because the number of errors is equal for all sub-individuals of the same individual\r\n\t\t\t\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\t\t\t\tif(max_num_errors < num_errors)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmax_num_errors = num_errors;\r\n\t\t\t\t\t\t\t\tidx_2nd_oldest = i;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//compare performances of both oldest genotypes using their average errors;\r\n\t\t\t\terror_1st_oldest = _pool_of_bests.get(idx_1st_oldest)._error.getAverageError();\r\n\t\t\t\tif(idx_2nd_oldest!=-1)\r\n\t\t\t\t{\r\n\t\t\t\t\terror_2nd_oldest = _pool_of_bests.get(idx_2nd_oldest)._error.getAverageError();\r\n\r\n\t\t\t\t\tif(error_1st_oldest < error_2nd_oldest)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tidx_to_remove = idx_2nd_oldest;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tidx_to_remove = idx_1st_oldest;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse//a single individual must always be replaced\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_to_remove = idx_1st_oldest;\r\n\t\t\t\t}\r\n\t\t\t}//are there genotypes with life span above a threshold?\r\n\t\t\t\r\n\t\t\t_pool_of_bests.remove(idx_to_remove);\r\n\t\t}//is maturity pool full?\r\n\t}", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private RBNode<T> removeMin(RBNode<T> node){\n //find the min node\n RBNode<T> parent = node;\n while(node!=null && node.getLeft()!=null){\n parent = node;\n node = node.getLeft();\n }\n //remove min node\n if(parent==node){\n return node;\n }\n\n parent.setLeft(node.getRight());\n setParent(node.getRight(),parent);\n\n //don't remove right pointer,it is used for fixed color balance\n //node.setRight(null);\n return node;\n }", "public int deleteMin() {\n int keyItem = heap[0];\n delete(0);\n return keyItem;\n }", "public void removeMin() {\n if (isEmpty()) throw new RuntimeException(\"underflow\");\n root = removeMin(root);\n }", "private Cluster getNearestCluster(BasicEvent event) {\n float minDistance = Float.MAX_VALUE;\n Cluster closest = null;\n float currentDistance = 0;\n for (Cluster c : clusters) {\n float rX = c.radiusX;\n float rY = c.radiusY; // this is surround region for purposes of dynamicSize scaling of cluster size or aspect ratio\n if (dynamicSizeEnabled) {\n rX *= surround;\n rY *= surround; // the event is captured even when it is in \"invisible surround\"\n }\n float dx, dy;\n if ((dx = c.distanceToX(event)) < rX && (dy = c.distanceToY(event)) < rY) { // needs instantaneousAngle metric\n currentDistance = dx + dy;\n if (currentDistance < minDistance) {\n closest = c;\n minDistance = currentDistance;\n c.distanceToLastEvent = minDistance;\n c.xDistanceToLastEvent = dx;\n c.yDistanceToLastEvent = dy;\n }\n }\n }\n return closest;\n }", "void removeHasLatitude(Object oldHasLatitude);", "public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n assert check();\n }", "void removeIsCentralNode(Boolean oldIsCentralNode);", "public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n }", "public AnyType deleteMin() {\n if (isEmpty())\n throw new UnderflowException();\n\n AnyType minItem = root.element;\n root = merge(root.left, root.right);\n\n return minItem;\n }", "public AnyType deleteMin() throws NoSuchElementException {\n\t\t\n\t\t// if the heap is empty, throw a NoSuchElementException\n\t\tif(this.size() == 0){\n\t\t\tthrow new NoSuchElementException();\n\t\t}\n\n\t\t// store the minimum item so that it may be returned at the end\n\t\tAnyType minValue = this.findMin();\n\n\t\t// replace the item at minIndex with the last item in the tree\n\t\tAnyType lastValue = this.array[this.size()-1];\n\t\tthis.array[0] = lastValue;\n\t\tthis.array[this.size() - 1] = null;\n\t\t\n\t\t// update size\n\t\tthis.currentSize--;\n\n\t\t// percolate the item at minIndex down the tree until heap order is restored\n\t\t// It is STRONGLY recommended that you write a percolateDown helper method!\n\t\tthis.percolateDown(0);\n\t\t\n\t\t// return the minimum item that was stored\n\t\treturn minValue;\n\t}", "protected boolean removeEldestEntry(Map.Entry eldest) {\n/* 49 */ return (size() > this.maxElements);\n/* */ }", "public V remove(K key) {\n\tint bucket=Math.abs(key.hashCode()%capacity);\n\t//for(int i=0;i<table[bucket].size()-1;i++){\n\tfor(MyEntry i:table[bucket]) { \n\t if(i.key==key) {\n\t\t//location.remove(key\n\t\tV previousvalue=i.value;\n\t\ttable[bucket].remove(i);\n\t\tsize--;\n\t\t/*if(table[bucket].size()==0) {\n\t\t utilizedbuckets.remove(bucket);\n\t\t}*/\n\t\treturn previousvalue;\n\t }\t\n\t}\n\treturn null;\n }", "private static Node delMin(ArrayList<Node> minHeap) {\n\t\tNode min = minHeap.remove(1);\n\t\t//put last element first\n\t\tint n = minHeap.size();\n\t\tif (n==1) return min;\n\t\tNode last = minHeap.remove(n-1);\n\t\tminHeap.add(1, last);\n\t\t//sink the new top to its right position\n\t\tsink(minHeap);\n\t\treturn min;\n\t}", "public static Tour CheapInsert (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int start, ziel;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n start = in.getPointNumber() - 1;\n ziel = out.getPointNumber() - 1;\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(out);\n tour.addPoint(in);\n for (int i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n int pos = -1;\n if (visited[i] == 1) {\n } else {\n double distance;\n double minimum = Double.MAX_VALUE;\n int insertPoint = 0;\n for (int j = 1; j <= tour.getSize(); j++) {\n if (tour.getPoint(j % tour.getSize()) == in) {\n pos = i;\n } else {\n int vor = tour.getPoint((j - 1) % tour.getSize()).getPointNumber() - 1;\n int nach = tour.getPoint((j) % tour.getSize()).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex] + distancematrix[cityIndex][nach];\n if (distance < minimum) {\n minimum = distance;\n insertPoint = j % tour.getSize();\n pos = i;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(i));\n visited[pos] = 1;\n }\n }\n }\n return tour;\n }", "@Override\n protected boolean removeChanceNode() {\n\n Node candidateToReduce;\n Node candidateToRemove;\n Node nodeToRemove;\n String operation;\n int i;\n NodeList children;\n Node valueNodeToReduce;\n\n NodeList chancesID;\n boolean removed = false;\n Node nodeUtil = null;\n\n\n\n\n // Obtain the value node \n\n //sv = ((IDWithSVNodes) diag).getTerminalValueNode();\n\n //diag.save(\"debug-mediastinet.elv\");\n\n //List of chance nodes in the diagram\n chancesID = diag.getNodesOfKind(Node.CHANCE);\n\n for (i = 0; (i < chancesID.size()) && removed == false; i++) {\n\n candidateToRemove = chancesID.elementAt(i);\n\n //Check if the candidaToRemove can be removed\n if (isRemovableChance(candidateToRemove)) {\n\n nodeToRemove = candidateToRemove;\n children = nodeToRemove.getChildrenNodes();\n //Reduce value nodes if it's necessary\n\n if (children.size() > 1) {\n //We have to reduce\n candidateToReduce = getCandidateValueNodeToReduceForChanceNode(nodeToRemove);\n\n //valueNodeToReduce =\tobtainValueNodeToReduce(reachableParents);\n valueNodeToReduce = obtainValueNodeToReduce(nodeToRemove, candidateToReduce);\n ReductionAndEvalID.reduceNode(\n (IDWithSVNodes) diag,\n valueNodeToReduce);\n nodeUtil = valueNodeToReduce;\n operation = \"Reduce: \" + nodeUtil.getName() + \" to eliminate: \" + nodeToRemove.getName();\n System.out.println(operation);\n statistics.addOperation(operation);\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n //The chance has only one child (utility)\n nodeUtil = children.elementAt(0);\n\n }\n\n\n String auxName = candidateToRemove.getName();\n operation = \"Chance node removal: \" + auxName;\n System.out.println(operation);\n statistics.addOperation(operation);\n\n //Add the name of the node to 'orderOfElimination'\n ((PropagationStatisticsID) statistics).addNameToOrderOfElimination(auxName);\n\n // The relation of the utility node is modified. In this \n // case the parents of the node to remove will be parents \n // of the utility node \n\n modifyUtilityRelation(nodeUtil, nodeToRemove, true);\n\n // Calculate the new expected utility \n getExpectedUtility(nodeUtil, nodeToRemove);\n\n // The node is deleted \n\n diag.removeNodeOnly(nodeToRemove);\n\n//\t\t\t\tStore the size of the diagram\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n\n statistics.addTime(crono.getTime());\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n // Set removed \n removed = true;\n\n }\n }//for\n return removed;\n }", "@Override\n protected boolean removeEldestEntry(Map.Entry<String, Bitmap> eldest) {\n \t// Log.w(\"ImageDownloader\", \"removeEldestEntry() has been invoked: \" + eldest.getKey() + \" size()=\" + size());\n \t// Log.w(\"ImageDownloader\", \"Entries are transferred to soft reference cache\"); \n \tif (size() > HARD_CACHE_CAPACITY) {\n \t\tLog.w(\"ImageDownloader\", \"Entries are transferred to soft reference cache\");\n // Entries push-out of hard reference cache are transferred to soft reference cache\n sSoftBitmapCache.put(eldest.getKey(), new SoftReference<Bitmap>(eldest.getValue()));\n return true;\n } else\n \tLog.w(\"ImageDownloader\", \"Entries are Not transferred to soft reference cache\");\n return false;\n }", "private Node removeMin(Node node){\n if(node == null)\n return null;\n else if(node.left == null) {//use right child to replace this node (min value node)\n if(node.count!=0){ //multiple value in same node\n node.count--;\n return node;\n }\n else{\n decDepth(node.right); //maintain depth when chain in right tree\n return node.right;\n }\n }\n\n //walk through left branch\n node.left = removeMin(node.left);\n if(node!=null) node.size--; // the min value must be removed\n return node;\n }", "final IntHashMapEntry removeEntry(int par1)\n {\n int j = computeHash(par1);\n int k = getSlotIndex(j, this.slots.length);\n IntHashMapEntry inthashmapentry = this.slots[k];\n IntHashMapEntry inthashmapentry1;\n IntHashMapEntry inthashmapentry2;\n\n for (inthashmapentry1 = inthashmapentry; inthashmapentry1 != null; inthashmapentry1 = inthashmapentry2)\n {\n inthashmapentry2 = inthashmapentry1.nextEntry;\n\n if (inthashmapentry1.hashEntry == par1)\n {\n ++this.versionStamp;\n --this.count;\n\n if (inthashmapentry == inthashmapentry1)\n {\n this.slots[k] = inthashmapentry2;\n }\n else\n {\n inthashmapentry.nextEntry = inthashmapentry2;\n }\n\n return inthashmapentry1;\n }\n\n inthashmapentry = inthashmapentry1;\n }\n\n return inthashmapentry1;\n }", "@Override\r\n public node_data removeNode(int key) {\r\n// if(this.graph.containsKey(key)){\r\n// //while - all the node toward him\r\n// if(this.neighbors.get(key) != null){\r\n// ArrayList<edge_data> ni = new ArrayList<edge_data>(this.neighbors.get(key).values()); //o(k)\r\n//\r\n// while(ni.size()!= 0) { //o(k)\r\n// int n = ni.get(0).getDest();\r\n// removeEdge(key, n);\r\n// ni.remove(0);\r\n// }\r\n// }\r\n// }\r\n// return null;\r\n \t\r\n \tif (this.graph.containsKey(key)) {\r\n \t\t\r\n \t\t//go to connected remove\r\n \t\t\r\n \t\tfor (Integer v : this.connected_to.get(key)) {\r\n\t\t\t\t\r\n \t\t\tthis.neighbors.get(v).remove(key);\r\n \t\t\t\r\n \t\t\tthis.edgeCounter--;\r\n \t\t\tthis.mc++;\r\n \t\t\t\r\n\t\t\t}\r\n \t\t\r\n \t\t//remove all neighbors\r\n \t\tthis.edgeCounter -= this.neighbors.get(key).size();\r\n \t\tthis.mc += this.neighbors.get(key).size();\r\n\r\n \t\tthis.neighbors.get(key).clear();\r\n \t\t\r\n \t\treturn this.graph.remove(key);\r\n \t\t//return node\r\n \t\t\r\n \t}\r\n \t\r\n \treturn null;\r\n \t\r\n }", "private Map<User, Double> reversedCheckToInsertOrRemoveNeighbour(Map.Entry<User, Double> mapEntry, User currentUser, double similarity) {\n for (Map.Entry<User, Double> entry : nearestNeighbours.entrySet()) {\n if (mapEntry == null || mapEntry.getValue() < entry.getValue()) {\n mapEntry = entry;\n value = mapEntry.getValue();\n }\n }\n //Check user rating versus lowest similarity.\n if (value >= similarity) {\n //Remove lowest similarity.\n nearestNeighbours.remove(mapEntry.getKey());\n //Check threshold and add user to nearestNeighbours TreeMap\n if (threshold == null) {\n nearestNeighbours.put(currentUser, similarity);\n }\n }\n return nearestNeighbours;\n }", "public void deleteSelected() {\r\n \t\tObject cells[] = graph.getSelectionCells();\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \r\n \t\t// If a cell is a blocking region avoid removing its edges and\r\n \t\t// select its element at the end of the removal process\r\n \t\tSet edges = new HashSet();\r\n \t\tSet<Object> select = new HashSet<Object>();\r\n \r\n \t\t// Set with all regions that can be deleted as its child were removed\r\n \t\tSet<Object> regions = new HashSet<Object>();\r\n \t\t// Set with all JmtCells that we are removing\r\n \t\tSet<Object> jmtCells = new HashSet<Object>();\r\n \r\n \t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t// for(int k=0; k<cells.length; k++){\r\n \t\t// if(cells[k] instanceof JmtEdge){\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)cells[k])))).SubOut();\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)cells[k])))).SubIn();\r\n \t\t// }\r\n \t\t//\r\n \t\t// }\r\n \t\tfor (int i = 0; i < cells.length; i++) {\r\n \t\t\tif (!(cells[i] instanceof BlockingRegion)) {\r\n \t\t\t\t// Adds edge for removal\r\n \t\t\t\tedges.addAll(DefaultGraphModel.getEdges(graphmodel, new Object[] { cells[i] }));\r\n \t\t\t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t\t\t// quando vado a eliminare un nodo, a cui collegato un arco,\r\n \t\t\t\t// vado ad incrementare o diminuire il contatore per il\r\n \t\t\t\t// pulsanteAGGIUSTATUTTO\r\n \t\t\t\t// Iterator iter = edges.iterator();\r\n \t\t\t\t// while (iter.hasNext()) {\r\n \t\t\t\t// Object next = iter.next();\r\n \t\t\t\t// if (next instanceof JmtEdge){\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)next)))).SubOut();\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)next)))).SubIn();\r\n \t\t\t\t// }\r\n \t\t\t\t//\r\n \t\t\t\t// }\r\n \t\t\t\t// Stores parents information and cell\r\n \t\t\t\tif (cells[i] instanceof JmtCell) {\r\n \t\t\t\t\tif (((JmtCell) cells[i]).getParent() instanceof BlockingRegion) {\r\n \t\t\t\t\t\tregions.add(((JmtCell) cells[i]).getParent());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tjmtCells.add(cells[i]);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t// Adds node for selection\r\n \t\t\t\tObject[] nodes = graph.getDescendants(new Object[] { cells[i] });\r\n \t\t\t\tfor (Object node : nodes) {\r\n \t\t\t\t\tif (node instanceof JmtCell || node instanceof JmtEdge) {\r\n \t\t\t\t\t\tselect.add(node);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\t// Removes blocking region from data structure\r\n \t\t\t\tmodel.deleteBlockingRegion(((BlockingRegion) cells[i]).getKey());\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tif (!edges.isEmpty()) {\r\n \t\t\tgraphmodel.remove(edges.toArray());\r\n \t\t}\r\n \t\t// removes cells from graph\r\n \t\tgraphmodel.remove(cells);\r\n \r\n \t\t// Checks if all children of a blocking region have been removed\r\n \t\tIterator<Object> it = regions.iterator();\r\n \t\twhile (it.hasNext()) {\r\n \t\t\tjmtCells.add(null);\r\n \t\t\tBlockingRegion region = (BlockingRegion) it.next();\r\n \t\t\tList child = region.getChildren();\r\n \t\t\tboolean empty = true;\r\n \t\t\tfor (int i = 0; i < child.size(); i++) {\r\n \t\t\t\tif (child.get(i) instanceof JmtCell && !jmtCells.contains(child.get(i))) {\r\n \t\t\t\t\tempty = false;\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (empty) {\r\n \t\t\t\tmodel.deleteBlockingRegion(region.getKey());\r\n \t\t\t\tgraphmodel.remove(new Object[] { region });\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Removes cells from data structure\r\n \t\tfor (Object cell : cells) {\r\n \t\t\tif (cell instanceof JmtCell) {\r\n \t\t\t\tmodel.deleteStation(((CellComponent) ((JmtCell) cell).getUserObject()).getKey());\r\n \t\t\t} else if (cell instanceof JmtEdge) {\r\n \t\t\t\tJmtEdge link = (JmtEdge) cell;\r\n \t\t\t\tmodel.setConnected(link.getSourceKey(), link.getTargetKey(), false);\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// If no stations remains gray select and link buttons\r\n \t\tif (graph.getModel().getRootCount() == 0) {\r\n \t\t\tcomponentBar.clearButtonGroupSelection(0);\r\n \t\t\tsetConnect.setEnabled(false);\r\n \t\t\tsetSelect.setEnabled(false);\r\n \t\t}\r\n \r\n \t\t// Selects components from removed blocking regions\r\n \t\tif (select.size() > 0) {\r\n \t\t\tgraph.setSelectionCells(select.toArray());\r\n \t\t\t// Resets parent information of cells that changed parent\r\n \t\t\tit = select.iterator();\r\n \t\t\twhile (it.hasNext()) {\r\n \t\t\t\tObject next = it.next();\r\n \t\t\t\tif (next instanceof JmtCell) {\r\n \t\t\t\t\t((JmtCell) next).resetParent();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "private static <K, V> @Nullable Node<K, V> removeMininumNodeInTree(@Var Node<K, V> current) {\n if (current.left == null) {\n // This is the minium node to delete\n return null;\n }\n\n if (!Node.isRed(current.left) && !Node.isRed(current.left.left)) {\n // Push red to left if necessary (similar to general removal strategy).\n current = makeLeftRed(current);\n }\n\n // recursive descent\n Node<K, V> newLeft = removeMininumNodeInTree(current.left);\n current = current.withLeftChild(newLeft);\n\n return restoreInvariants(current);\n }", "public Node deleteMin() {\n\t\t// if the heap is empty\n\t\t// return MAXINT as output\n\t\tNode min = new Node(Integer.MAX_VALUE);\n\t\tif(this.head == null)\n\t\t\treturn min;\n\t\t\n\t\t\n\t\tNode prevMin = null;\n\t\tNode curr = this.head;\n\t\tNode prev = null;\n\t\t\n\t\t// find the smallest node\n\t\t// keep track of node who points to this minimum node\n\t\twhile(curr!=null) {\n\t\t\tif(curr.key<min.key) {\n\t\t\t\tmin = curr;\n\t\t\t\tprevMin = prev;\n\t\t\t}\n\t\t\tprev = curr;\n\t\t\tcurr = curr.rightSibling;\n\t\t}\n\t\t\n\t\t// if its the head then move one pointer ahead\n\t\tif(prevMin == null)\n\t\t\tthis.head = min.rightSibling;\n\t\telse {\n\t\t\t// else attach the previous node to the rightSibling of min\n\t\t\tprevMin.rightSibling = min.rightSibling;\n\t\t}\n\t\tmin.rightSibling = null;\n\t\t\n\t\t//return min node\n\t\treturn min;\n\t}", "@Override\n\tprotected boolean removeEldestEntry(Map.Entry eldest) {\n\t\treturn size() > MAX_ENTRIES;\n\t}", "public T deleteMin()\n\t{\t\n\t\t//declating variables\n\t\tint minIndex = 0;\n\t\tboolean flag = false;\n\t\tboolean flag2 = false;\n\t\t//if size == 0; returns null\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t//if checks size and deletes accordingly.\n\t\tif(size == 1)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tarray[0] = null;\n\t\t\tsize--;\n\t\t\treturn tempo;\n\n\t\t}\n\n\t\tif(size == 2)\n\t\t{\n\t\t\tT temp = array[0];\n\t\t\tarray[0] = array[1];\n\t\t\tarray[1] = null;\n\t\t\tsize--;\n\t\t\treturn temp;\n\n\t\t}\n\t\tif(size == 3)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tint small = grandChildMin(1, 2);\n\t\t\tarray[0] = array[small];\n\t\t\tif(small == 2)\n\t\t\t{\n\t\t\t\tarray[small] = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray[1] = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t}\n\n\t\t\tsize--;\n\t\t\treturn tempo;\n\t\t}\n\n\t\t//if size > 3 does sophisticated deleting\n\t\tT temp = array[0];\n\t\tarray[0] = array[size-1];\n\t\tarray[size-1] = null;\n\t\tsize--;\n\t\tint index = 0;\n\n\t\t//gets the smallest of the children & grandchildren\n\t\tint smallest = min(index).get(0);\n\t\t//while it has grandchildren, keeps going\n\t\twhile(smallest != 0)\n\t\t{\n\t\t\t//doesn't switch if im less than the smallest grandchild\n\t\t\t//& breaks\n\t\t\tif(object.compare(array[index], array[smallest]) <= 0 )\n\t\t\t{\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//special case when i could switch with child or grandchild\n\t\t\tif( min(index).size() > 1)\n\t\t\t{\n\t\t\t\tflag2 = true;\n\t\t\t}\n\n\t\t\t//switches the locations and updates index\n\t\t\tT lemp = array[index];\n\t\t\tarray[index] = array[smallest];\n\t\t\tarray[smallest] = lemp;\n\t\t\tindex = smallest;\n\t\t\tsmallest = min(smallest).get(0);\n\n\t\t}\n\t\t//if i dont switch, i check if i have to switch then percolate back up\n\t\tif(flag == true)\n\t\t{\n\t\t\tif(object.compare(array[index], array[grandChildMin(2*index+1, 2*index+2)]) > 0)\n\t\t\t{\n\t\t\t\tint mIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\t\tT k = array[mIndex];\n\t\t\t\tarray[mIndex] = array[index];\n\t\t\t\tarray[index] = k;\n\n\t\t\t\tint y = mIndex;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT f = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = f;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(object.compare(array[index], array[(index-1)/2]) > 0)\n\t\t\t{\n\t\t\t\tT m = array[(index-1)/2];\n\t\t\t\tarray[(index-1)/2] = array[index];\n\t\t\t\tarray[index] = m;\n\t\t\t\tint y = (index-1)/2;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if(flag2 == true)\n\t\t{\n\t\t\tint y = index;\n\n\t\t\tif(getLevel(y+1) % 2 == 1)\n\t\t\t{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\t\telse if(object.compare(array[index], array[grandChildMin(2*index +1, 2*index+2)]) > 0 && grandChildMin(2*index +1, 2*index+2) != 0)\n\t\t{\n\t\t\tminIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\tT wemp = array[index];\n\t\t\tarray[index] = array[minIndex];\n\t\t\tarray[minIndex] = wemp;\n\n\t\t\tint y = minIndex;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\telse if (object.compare(array[index], array[(index-1)/2]) > 0) \n\t\t{\n\n\t\t\tT femp = array[(index-1)/2];\n\t\t\tarray[(index-1)/2] = array[index];\n\t\t\tarray[index] = femp;\n\n\t\t\tint y = (index-1)/2;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\treturn temp;\n\t}", "public void RemoveRowsIfStackedTooHigh() {\n \t\t\n while (rowHasBlocks(Parameters.RemoveBiggestPartialRowIfBlockInRow)) {\n int NoOfPiecesRemoved = \n eraseBiggestRowGreaterThan(Parameters.RemoveBiggestPartialRowIfBlockInRow);\n //remove points for each empty square\n ComputeScoreAndDelay(-(COLUMNS - NoOfPiecesRemoved) * Parameters.PointsSubtractedPerEmptySpaceFromPartialRow);\n \n }\n game_grid.repaint();\n LogEvent(\"row_removed\");\n }", "@Override\n\tpublic boolean removeEldestEntry(Map.Entry<T,U> element)\n\t{\n\t\t// Remove it if we've hit our capacity (meaning\n\t\t// we've overflowed)\n\t\t//\n\t\treturn size() > maxSize;\n\t}", "private void removeEntry(CacheEntry entry) {\n\t\tmap.remove(entry.getKey());\n\t\tsize.decrementAndGet();\n\t\tindex.remove(entry.getItem());\n\t\tentry.delete();\n\t}", "protected boolean removeEldestEntry(Map.Entry eldest) {\n\t\t\t\treturn size() > CACHESIZE;\r\n\t\t\t}", "protected boolean removeEldestEntry(Map.Entry eldest) {\n\t\t\t\treturn size() > CACHESIZE;\r\n\t\t\t}", "protected boolean removeEldestEntry(Map.Entry<Integer, String> eldest){\n\t return size() > this.capacity;\n\t }", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "@Override\n\t\t\tprotected boolean removeEldestEntry(final Map.Entry<K, V> eldest) {\n\t\t\t\treturn super.size() > LRUCache.this.cacheSize;\n\t\t\t}", "private Node deleteMin(Node n)\n {\n if (n.left == null) \n return n.right;\n n.left = deleteMin(n.left); \n n.count= 1 + size(n.left)+ size(n.right); \n return n;\n }", "@Override\n protected boolean removeEldestEntry(final Map.Entry<K, V> eldest) {\n return size() > capacity;\n }", "public void deleteInstance(){\n //cancels the runnable\n shouldCancelRunnable = true;\n //remove the chest from the map to avoid confusion\n this.location.getBlock().setType(Material.AIR);\n //unregister from all events, we're done!\n HandlerList.unregisterAll(this);\n }", "protected synchronized void prune()\n {\n long ldtStart = Base.getSafeTimeMillis();\n int cCur = getUnits();\n int cMin = getLowUnits();\n if (cCur < cMin)\n {\n return;\n }\n\n int nType = getEvictionType();\n switch (nType)\n {\n default:\n case EVICTION_POLICY_HYBRID:\n {\n // sum the entries' units per priority\n int[] acUnits;\n while (true)\n {\n try\n {\n acUnits = new int[11];\n for (Iterator iter = entrySet().iterator(); iter.hasNext(); )\n {\n Entry entry = (Entry) iter.next();\n int cUnits = entry.getUnits();\n try\n {\n acUnits[entry.getPriority()] += cUnits;\n }\n catch (IndexOutOfBoundsException e)\n {\n acUnits[Math.max(0, Math.min(entry.getPriority(), 10))] += cUnits;\n }\n }\n break;\n }\n catch (ConcurrentModificationException e)\n {\n }\n }\n\n int cTotal = 0;\n int nPrunePriority = 0;\n while (nPrunePriority <= 10)\n {\n cTotal += acUnits[nPrunePriority];\n if (cTotal > cMin)\n {\n break;\n }\n ++nPrunePriority;\n }\n\n // build a list of entries to discard\n Entry entryDiscardHead = null;\n Entry entryDiscardTail = null;\n\n // determine the number at the cut-off priority that must be pruned\n int cAdditional = Math.max(0, cTotal - cMin);\n\n while (cCur > cMin)\n {\n try\n {\n for (Iterator iter = entrySet().iterator(); iter.hasNext() && cCur > cMin; )\n {\n Entry entry = (Entry) iter.next();\n int nPriority = entry.getPriority();\n if (nPriority >= nPrunePriority)\n {\n int cUnits = entry.getUnits();\n if (nPriority == nPrunePriority)\n {\n if (cAdditional <= 0)\n {\n continue;\n }\n cAdditional -= cUnits;\n }\n cCur -= cUnits;\n\n // remove the entry from the map\n super.removeEntryInternal(entry);\n\n // link the entry into the list of deferred\n // removals, but without changing its \"next\"\n // reference because the iterator that we are\n // using here is counting on that \"next\" ref\n if (entryDiscardHead == null)\n {\n entryDiscardHead = entry;\n }\n else\n {\n entryDiscardTail.setNext(entry);\n }\n entryDiscardTail = entry;\n }\n }\n\n // seal the end of the linked list of entries to discard\n if (entryDiscardTail != null)\n {\n entryDiscardTail.setNext(null);\n }\n break;\n }\n catch (ConcurrentModificationException e)\n {\n }\n }\n\n // process the list of deferred removals\n for (Entry entryDiscard = entryDiscardHead; entryDiscard != null; )\n {\n // unlink it altogether\n Entry entryNext = entryDiscard.getNext();\n entryDiscard.setNext(null);\n\n // discard it\n removeExpired(entryDiscard, false);\n\n entryDiscard = entryNext;\n }\n }\n break;\n\n case EVICTION_POLICY_LRU:\n case EVICTION_POLICY_LFU:\n {\n boolean fLRU = (nType == EVICTION_POLICY_LRU);\n SparseArray array;\n while (true)\n {\n try\n {\n array = new SparseArray();\n for (Iterator iter = entrySet().iterator(); iter.hasNext(); )\n {\n Entry entry = (Entry) iter.next();\n long lOrder = fLRU ? entry.getLastTouchMillis()\n : entry.getTouchCount();\n Object oPrev = array.set(lOrder, entry);\n if (oPrev != null)\n {\n // oops, more than one entry with the same order;\n // make a list of entries\n List list;\n if (oPrev instanceof List)\n {\n list = (List) oPrev;\n }\n else\n {\n list = new ArrayList();\n list.add((Entry) oPrev);\n }\n list.add(entry);\n array.set(lOrder, list);\n }\n }\n break;\n }\n catch (ConcurrentModificationException e)\n {\n }\n }\n\n for (Iterator iter = array.iterator();\n getUnits() > cMin && iter.hasNext(); )\n {\n Object o = iter.next();\n if (o instanceof Entry)\n {\n Entry entry = (Entry) o;\n removeExpired(entry, true);\n }\n else\n {\n List list = (List) o;\n for (Iterator iterList = list.iterator();\n getUnits() > cMin && iterList.hasNext(); )\n {\n Entry entry = (Entry) iterList.next();\n removeExpired(entry, true);\n }\n }\n }\n }\n break;\n\n case EVICTION_POLICY_EXTERNAL:\n getEvictionPolicy().requestEviction(cMin);\n break;\n }\n m_stats.registerCachePrune(ldtStart);\n }", "protected void discard()\n {\n if (!isDiscarded())\n {\n OldOldCache map = OldOldCache.this;\n synchronized (map)\n {\n int cUnits = m_cUnits;\n if (cUnits == -1)\n {\n // entry is discarded; avoid repetitive events\n return;\n }\n\n if (cUnits > 0)\n {\n map.adjustUnits(-cUnits);\n }\n\n m_cUnits = -1;\n }\n\n // issue remove notification\n if (map.hasListeners())\n {\n map.dispatchEvent(map.instantiateMapEvent(\n MapEvent.ENTRY_DELETED, getKey(), getValue(), null));\n }\n }\n }", "void removeNeighbors();", "@Override\n public int deleteByQuery(Ares2ClusterQuery query) {\n return ares2ClusterExtMapper.deleteByQuery(query);\n }", "public Location remove() {\n\t\t//empty set\n\t\tif (head == null){\n\t\t\treturn null;\n\t\t}\n\n\t\t//removes and returns the SquarePosition object from the top of the set\n\t\tLocation removedLocation = head.getElement();\n\t\thead = head.next;\n\t\tsize --;\n\t\treturn removedLocation;\n\t}", "public T removeBest();", "public Ms2Cluster trimByDotP(Map<Ms2Pointer, MsnSpectrum> spectra, Tolerance tol, double min_dp)\n {\n // quit if the master or input are not present!\n if (mMaster==null || !Tools.isSet(spectra)) return null;\n\n // setup the master first\n List<Peak> master = Spectra.toListOfPeaks(mMaster);\n Iterator<Ms2Pointer> itr = mCandidates.iterator();\n while (itr.hasNext())\n {\n MsnSpectrum scan = spectra.get(itr.next());\n if (scan!=null && Similarity.dp(master, Spectra.toListOfPeaks(scan), tol, true, true)<min_dp) itr.remove();\n }\n\n return this;\n }", "void remove(@NotNull final ByteBuffer key) {\n final ClusterValue prev = storage.put(key, ClusterValue.deadCluster());\n if (prev == null) {\n tableSize = tableSize + key.remaining();\n } else if (!prev.isTombstone()) {\n tableSize = tableSize - prev.getData().remaining();\n }\n }", "static double removeHeuristic2(GameState c, boolean isMaxNode) {\n\t\treturn addHeuristic4(c, isMaxNode);\n\t}", "@Override\r\n\t\tprotected boolean removeEldestEntry(java.util.Map.Entry<K, com.vip.utils.AutoClearnMap.Entry<V>> eldest) {\n\t\t\tlong now = System.currentTimeMillis();\r\n\t\t\tif ((now - eldest.getValue().getLastTime()) > getMaxTime())\r\n\t\t\t\treturn true;\r\n\t\t\t\r\n\t\t\treturn super.removeEldestEntry(eldest);\r\n\t\t}", "@Override\n public void onRemoval() {\n try {\n if (eOutputHatches != null) {\n for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) {\n hatch_elemental.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) {\n hatch_elemental.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_OutputData hatch_data : eOutputData) {\n hatch_data.id = -1;\n hatch_data.q = null;\n }\n for (GT_MetaTileEntity_Hatch_InputData hatch_data : eInputData) {\n hatch_data.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) {\n hatch.getBaseMetaTileEntity().setActive(false);\n }\n for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) {\n hatch.getBaseMetaTileEntity().setActive(false);\n }\n }\n cleanOutputEM_EM();\n if (ePowerPass && getEUVar() > V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) {\n explodeMultiblock();\n }\n } catch (Exception e) {\n if (DEBUG_MODE) {\n e.printStackTrace();\n }\n }\n }", "@Override\n protected void rebalanceDelete(Position<Entry<K, V>> p) {\n if (isRed(p)) {\n makeBlack(p);\n } else if (!isRoot(p)) {\n Position<Entry<K, V>> sib = sibling(p);\n if (isInternal(sib) & (isBlack(sib) || isInternal(left(sib)))) {\n remedyDoubleBlack(p);\n }\n }\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "public Entry remove(Object key) {\n int i = compFunction(key.hashCode());\n SList chain = buckets[i];\n try {\n for (SListNode n = (SListNode) chain.front(); n.isValidNode(); n = (SListNode) n.next()) {\n Entry e = (Entry) n.item();\n if (e.key.equals(key)) {\n n.remove();\n size--;\n return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null; \n }", "public void clearOld(int p_turn)\n {\n HashSet<Integer> toR = new HashSet<>();\n for (Integer i : this.e.keySet())\n if (this.e.get(i).turn < p_turn)\n toR.add(i);\n this.e.keySet().removeAll(toR);\n\n toR.clear();\n // Clear captured data (unupdated)\n for (Integer i : this.d.keySet())\n if (this.d.get(i).turn < p_turn)\n toR.add(i);\n this.d.keySet().removeAll(toR);\n\n this.moveToData = State.clustering(this.d, CLUSTER_DIST);\n // this.moveToEnnemies = WizState.clustering(this.e, CLUSTER_DIST);\n }", "void removeNextSeamVert() {\n SeamInfo toRemove = this.curLowest;\n\n toRemove.removeSeamVert();\n\n if (toRemove.containsPixel(this.curPixel)) {\n\n this.curPixel = this.curPixel.right;\n }\n\n this.removedSeams.add(toRemove);\n\n this.draw();\n }", "public void entryRemoved(EntryEvent<Identifier, SystemMetadata> event) {\n // we don't remove replicas (do we?)\n\n }", "void removeHasNodeID(Integer oldHasNodeID);", "public boolean prune()\n throws org.json.JSONException, java.io.IOException\n {\n TreeSet<String> to_delete =new TreeSet<String>();\n int current_block_height = server.getCurrentBlockTemplate().getInt(\"height\");\n\n synchronized(open_jobs)\n {\n if (open_jobs.size() == 0) return true;\n\n for(Map.Entry<String, JobInfo> me : open_jobs.entrySet())\n {\n JobInfo ji = me.getValue();\n if (ji.getHeight() + 1 < current_block_height)\n {\n to_delete.add(me.getKey());\n }\n } \n for(String job_id : to_delete)\n {\n open_jobs.remove(job_id);\n }\n\n }\n return false;\n\n }", "@Override\n\tpublic boolean removeVertex(Object value)\n\t{\n\t\tif(this.map.containsKey(value))\n\t\t{\n\t\t\t// remove the value from the map\n\t\t\tthis.map.remove(value);\n\t\t\t// iterate over the map and remove any edges of the value\n\t\t\tfor(Map.Entry<Object, SinglyLinkedList> vertex : map.entrySet())\n\t\t\t\tvertex.getValue().removeNode(value);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public int delete(int k)\r\n\t{\r\n\t\tIAVLNode node = searchFor(this.root, k);\r\n\t\tIAVLNode parent;\r\n\t\tif(node==root)\r\n\t\t\tparent=new AVLNode(null);\r\n\t\telse\r\n\t\t\tparent=node.getParent();\r\n\t\t\r\n\t\tIAVLNode startHieghtUpdate = parent; // this will be the node from which we'll start updating the nodes' hieghts\r\n\t\t\r\n\t\tif (!node.isRealNode())\r\n\t\t\treturn -1;\r\n\t\t\r\n\t\t//updating the maximum and minimum fields\r\n\t\tif (node == this.maximum)\r\n\t\t\tthis.maximum = findPredecessor(node);\r\n\t\telse\r\n\t\t\tif (node == this.minimum)\r\n\t\t\t\tthis.minimum = findSuccessor(node); \r\n\t\t\r\n\t\t//if the node we wish to delete is a leaf\r\n\t\tif (!node.getLeft().isRealNode()&&!node.getRight().isRealNode())\r\n\t\t{\r\n\t\t\tif (node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\telse\r\n\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\tnode.getRight().setParent(parent);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t //if the node we wish to delete is unary:\r\n\t\t\tif (node.getLeft().isRealNode()&&!node.getRight().isRealNode()) //only left child\r\n\t\t\t{\r\n\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\tparent.setLeft(node.getLeft());\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.setRight(node.getLeft());\r\n\t\t\t\tnode.getLeft().setParent(parent);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tif (node.getRight().isRealNode()&&!node.getLeft().isRealNode()) //only right child\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\t\t\tnode.getRight().setParent(parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t//if the node we wish to delete is a father of two\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\tIAVLNode suc = findSuccessor(node);\r\n\t\t\t\t\t\tIAVLNode sucsParent = suc.getParent();\r\n\t\t\t\t\t\t//deleting the successor of the node we wish to delete\r\n\t\t\t\t\t\tif (suc == sucsParent.getLeft())\r\n\t\t\t\t\t\t\tsucsParent.setLeft(suc.getRight());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tsucsParent.setRight(suc.getRight());\r\n\t\t\t\t\t\tsuc.getRight().setParent(sucsParent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//inserting the successor in it's new place (the previous place of the node we deleted)\r\n\t\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\t\tparent.setLeft(suc);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tparent.setRight(suc);\r\n\t\t\t\t\t\tsuc.setParent(parent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// node's children are now his scuccessor's children\r\n\t\t\t\t\t\tsuc.setRight(node.getRight());\r\n\t\t\t\t\t\tsuc.setLeft(node.getLeft());\r\n\t\t\t\t\t\tsuc.getRight().setParent(suc);\r\n\t\t\t\t\t\tsuc.getLeft().setParent(suc);\r\n\t\t\t\t\t\t//now we check if the successor of the node we wanted to delete was his son\r\n\t\t\t\t\t\tif (node != sucsParent) // the successor's parent was the deleted node (which is no longer part of the tree)\r\n\t\t\t\t\t\t\tstartHieghtUpdate = sucsParent;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tstartHieghtUpdate = suc;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if we wish to delete the tree's root, then we need to update the tree's root to a new node\r\n\t\tif (node == this.root) \r\n\t\t{\r\n\t\t\tthis.root = parent.getRight();\r\n\t\t\tthis.root.setParent(null);\r\n\t\t}\r\n\t\t\r\n\t\tint moneRot = HieghtsUpdating(startHieghtUpdate);\r\n\t\treturn moneRot;\r\n\t}", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "private Map<User, Double> checkToInsertOrRemoveNeighbour(Map.Entry<User, Double> mapEntry, User currentUser, double similarity) {\n if (reversed) {\n nearestNeighbours = reversedCheckToInsertOrRemoveNeighbour(mapEntry, currentUser, similarity);\n } else {\n LowestSimilarity LowestSimilarity = new LowestSimilarity(mapEntry, nearestNeighbours, value).invoke();\n value = LowestSimilarity.getValue();\n //Check user rating versus lowest similarity.\n if (value <= similarity) {\n //Remove lowest similarity.\n nearestNeighbours.remove(LowestSimilarity.getMapEntry().getKey());\n //Check threshold and add user to nearestNeighbours TreeMap\n if (threshold == null) {\n nearestNeighbours.put(currentUser, similarity);\n } else if (similarity >= threshold) {\n nearestNeighbours.put(currentUser, similarity);\n }\n }\n }\n return nearestNeighbours;\n }", "public Builder clearIsClusteringKey() {\n\n isClusteringKey_ = false;\n onChanged();\n return this;\n }", "public void deleteMin() {\r\n\t\tif (empty())\r\n\t\t\treturn;\r\n\t\telse {\r\n\t\t\tif (this.size > 0) {\r\n\t\t\t\tthis.size--;\r\n\t\t\t}\r\n\t\t\tif (this.size == 0) {\r\n\t\t\t\tthis.empty = true;\r\n\t\t\t}\r\n\r\n\t\t\tHeapNode hN = this.min;\r\n\t\t\tint rnkCount = 0;\r\n\t\t\tHeapNode hNIterator = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\trnkCount++;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t}\r\n\t\t\tthis.HeapTreesArray[rnkCount] = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\trnkCount--;\r\n\t\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\t\tif (hNIterator != null) {\r\n\t\t\t\tbH.empty = false;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\tbH.HeapTreesArray[rnkCount] = hNIterator;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t\tbH.HeapTreesArray[rnkCount].rightBrother = null;\r\n\t\t\t\tif (hNIterator != null) {\r\n\t\t\t\t\thNIterator.leftBrother = null;\r\n\t\t\t\t}\r\n\t\t\t\trnkCount = rnkCount - 1;\r\n\t\t\t}\r\n\t\t\tthis.min = null;\r\n\t\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\t\tif (this.min == null) {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tif (this.HeapTreesArray[i].value < this.min.value) {\r\n\t\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\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 (!bH.empty()) {\r\n\t\t\t\tfor (int i = 0; i < bH.HeapTreesArray.length; i++) {\r\n\t\t\t\t\tif (bH.min == null) {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tif (bH.HeapTreesArray[i].value < bH.min.value) {\r\n\t\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.meld(bH);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "private void removeMoveIfExist(ActorRef actorRef) {\n for (int distance = 1; distance <= pointsMap.getLength(); distance++) {\n for (int lane = 1; lane <= pointsMap.getLanesNumber(); lane++) {\n if (!pointsMap.isMarked(distance, lane)) {\n pointsMap.putWithCondition(distance, lane, null, oldAct -> oldAct == actorRef);\n }\n }\n }\n }", "protected void removeEldestEntry(){\n Entry lastEntry = header.before;\n\n header.before = header.before.before;\n header.before.after = header;\n\n int index = getIndexForKey(lastEntry.key);\n Entry entries = table[index];\n Entry prevEntry = null;\n for(Entry entry = entries; entry != null; entry = entry.next){\n if(entry.key == lastEntry.key){\n if(prevEntry != null){\n prevEntry.next = entry.next;\n }else{\n table[index] = entry.next;\n }\n }\n prevEntry = entry;\n }\n size--;\n }" ]
[ "0.6525471", "0.63876647", "0.62954897", "0.62759703", "0.6241879", "0.6241879", "0.6175996", "0.6095031", "0.6026908", "0.5981368", "0.59510946", "0.59359246", "0.579662", "0.57815886", "0.577193", "0.5754532", "0.5749173", "0.5748879", "0.571352", "0.5709522", "0.5694528", "0.5681924", "0.56721354", "0.5657074", "0.5653916", "0.56106645", "0.5610604", "0.5584803", "0.5579045", "0.55657864", "0.5555055", "0.5541968", "0.55282444", "0.55249393", "0.5501319", "0.5498769", "0.5484516", "0.54559946", "0.54513353", "0.5448968", "0.54488623", "0.5443468", "0.54406774", "0.5413472", "0.5412898", "0.5401957", "0.53866595", "0.53853667", "0.5374609", "0.5371472", "0.53659517", "0.5361149", "0.5359234", "0.53591454", "0.5358177", "0.53535855", "0.5339182", "0.5338824", "0.5331264", "0.531422", "0.5311596", "0.5297604", "0.5283642", "0.5278192", "0.5277648", "0.5274454", "0.5274454", "0.52743626", "0.5274347", "0.5266689", "0.52663267", "0.52660286", "0.52598035", "0.5250697", "0.5237473", "0.5224196", "0.5215874", "0.520675", "0.52046436", "0.51987916", "0.5196432", "0.51956195", "0.51949996", "0.51898897", "0.5183857", "0.51799095", "0.5177112", "0.517692", "0.517446", "0.5174005", "0.5173817", "0.51563394", "0.5155648", "0.51497734", "0.514251", "0.51341414", "0.5133231", "0.5133118", "0.5130458", "0.512986" ]
0.6559551
0
it check for current minimum distance for cluster i and j. If given distance is less than current stored distance, it updates.
private static void updateMinMatrix(String i, String j, double dist) { if(minMatrix.containsKey(i)) { String minData[] = minMatrix.get(i).split(";"); double prevDist = Double.parseDouble(minData[1]); if(dist < prevDist) minMatrix.put(i+"", j+";"+dist); } else { minMatrix.put(i+"", j+";"+dist); } if(minMatrix.containsKey(j)) { String minData[] = minMatrix.get(j).split(";"); double prevDist = Double.parseDouble(minData[1]); if(dist < prevDist) minMatrix.put(j, i+";"+dist); } else { minMatrix.put(j, i+";"+dist); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int minCost(int[][] distance) {\n Map<Index, Integer> minCostDP = new HashMap<>();\n Map<Index, Integer> parent = new HashMap<>();\n\n List<Set<Integer>> allSets;\n\n for (Set<Integer> set : allSets) {\n for (int currentVertex = 1; currentVertex < distance.length; currentVertex++) {\n if (set.contains(currentVertex)) continue;\n Index index = Index.createIndex(currentVertex,set);\n int minCost = Integer.MAX_VALUE;\n int minPrevVertex = 0;\n\n Set<Integer> copySet = new HashSet<>();\n for (int prevVertex : set) {\n int cost = distance[prevVertex][currentVertex] + getCost(copySet, prevVertex, minCostDP);\n }\n }\n }\n }", "public double getMinimumDistance() { return minDistance; }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private Node<Integer> minDistance(Map<Node<Integer>, Double> distances, Map<Node<Integer>, Double> unvisitedNodes) {\n Double min = Double.POSITIVE_INFINITY;\n\n Node<Integer> minNode = null;\n for (Map.Entry<Node<Integer>, Double> entry : distances.entrySet()) {\n Double d = entry.getValue();\n if (Double.compare(d, min) < 0 && unvisitedNodes.containsKey(entry.getKey())) {\n min = d;\n minNode = entry.getKey();\n }\n }\n return minNode;\n }", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "private static int findMinDistance(int[] distance, boolean[] visitedVertex) {\r\n int minDistance = Integer.MAX_VALUE;\r\n int minDistanceVertex = -1;\r\n for (int i = 0; i < distance.length; i++) {\r\n if (!visitedVertex[i] && distance[i] < minDistance) {\r\n minDistance = distance[i];\r\n minDistanceVertex = i;\r\n }\r\n }\r\n return minDistanceVertex;\r\n }", "private int minDistance(int dist[], boolean sptSet[]) {\n int min = Integer.MAX_VALUE, min_index = -1;\n\n for (int v = 0; v < V; v++)\n if (!sptSet[v] && dist[v] < min) {\n min = dist[v];\n min_index = v;\n }\n\n return min_index;\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 int minWeight(int dist[], Boolean sptSet[]){\n int min = Integer.MAX_VALUE;\r\n int minIndex = -1;\r\n\r\n for(int n = 0; n< rideCount; n++){\r\n if(!sptSet[n] && dist[n] <= min) {\r\n min = dist[n];\r\n minIndex = n;\r\n }\r\n }\r\n return minIndex;\r\n }", "int minDistance(int dist[], Boolean sptSet[]) {\n // Initialize min value\n int min = Integer.MAX_VALUE, min_index=-1;\n\n for (int v = 0; v < V; v++)\n if (sptSet[v] == false && dist[v] <= min) {\n min = dist[v];\n min_index = v;\n }\n\n return min_index;\n }", "public int minDistance(int distance[], Boolean span_tree[]) {\n\t\tint min_value=Integer.MAX_VALUE,min_node=-1;\n\t\tfor(int i=0;i<vertexs;i++) {\n\t\t\tif(span_tree[i]==false && distance[i]<=min_value) {\n\t\t\t\tmin_value=distance[i];\n\t\t\t\tmin_node=i;\n\t\t\t}\n\t\t}\n\t\treturn min_node;\n\t}", "public double getClosestDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn distanceMin;\n\t\t}", "public void theMinX() {\n\t\tfloat minx = coords.getFirst().getX(); // set the smallest x to the first one\n\t\tfor(Coord2D c: coords) { // go through the whole linked list\n\t\t\tif(c.getX() < minx) { // if the x of the current coordinate set is smaller than the current min\n\t\t\t\tminx = c.getX(); // make that current coordinate the new min\n\t\t\t}\n\t\t}\n\t\tthis.setMinX(minx);\n\t}", "private void set_distance() {\n int[] k = new int[getQueue().length];\n distance = 0.0;\n for (int i = 1; i < getQueue().length; i++) {\n distance += getPoints().get(way[i]).distance(getPoints().get(way[i - 1]));\n }\n distance += getPoints().get(getQueue()[getPoints().size() - 1]).distance(getPoints().get(0));\n enterd = true;\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "public int getMinDistance(){\n return totalDistance;\n }", "private void cheminMin (ArrayList<Integer> parcours, ArrayList<Integer> sommets, int n, double dist){\r\n\t\t\r\n\t\t//condition d'arret\r\n\t\tif (sommets.size()>=1){\r\n\t\t\tif (n != super.g.getDim()){\r\n\t\t\t\t\r\n\t\t\t\t//test si le parcours n'est pas sup�rieur au parcours total\r\n\t\t\t\tif (dist<super.dist){\r\n\t\t\t\t\tfor (int ind=0; ind<sommets.size(); ind++) {\r\n\t\t\t\t\t\tdouble dist2 = dist + super.g.calculDist(parcours.get(parcours.size()-1), sommets.get(ind));\r\n\t\t\t\t\t\tArrayList<Integer> sommets2 = new ArrayList<Integer>();\r\n\t\t\t\t\t\tArrayList<Integer> parcours2 = new ArrayList<Integer>();\r\n\t\t\t\t\t\tparcours2 = super.copieListe(parcours);\r\n\t\t\t\t\t\tsommets2 = super.copieListe(sommets);\r\n\t\t\t\t\t\tparcours2.add(sommets2.get(ind));\r\n\t\t\t\t\t\tsommets2.remove(ind);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//appel r�cursif avec les copies avec ajout du sommet dans le parcours\r\n\t\t\t\t\t\tcheminMin(parcours2, sommets2, n-1,dist2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tArrayList<Integer> sommets2 = new ArrayList<Integer>();\r\n\t\t\t\tArrayList<Integer> parcours2 = new ArrayList<Integer>();\r\n\t\t\t\tparcours2 = super.copieListe(parcours);\r\n\t\t\t\tsommets2 = super.copieListe(sommets);\r\n\t\t\t\tparcours2.add(0);\r\n\t\t\t\t\r\n\t\t\t\t//appel r�cursif avec les copies\r\n\t\t\t\tcheminMin(parcours2, sommets2, n-1, dist);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble dist2 = super.g.calculDist(0, parcours.get(parcours.size()-1))+dist;\r\n\t\t\tif (dist2<super.dist || super.dist == -1){\r\n\t\t\t\tsuper.dist = dist2;\r\n\t\t\t\tsuper.parcoursMin = super.copieListe(parcours);\r\n\t\t\t\tsuper.parcoursMin.add(0);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n protected int selectNextClusterIndex(\n final double[] minDistances,\n final boolean[] selected)\n {\n double maxMinDistance = Double.MAX_VALUE;\n int maxIndex = 0;\n\n final int elementCount = minDistances.length;\n for (int i = 0; i < elementCount; i++)\n {\n if (selected[i])\n {\n // Skip clusters we've already selected.\n continue;\n }\n\n // Get the current minimum distance for the element.\n double minDistance = minDistances[i];\n\n if (maxIndex == 0 || minDistance > maxMinDistance)\n {\n // This is the minium seen so far, so keep track of\n // it.\n maxIndex = i;\n maxMinDistance = minDistance;\n }\n }\n\n if (maxMinDistance <= 0.0)\n {\n // There are not enough points to prevent selecting two\n // that are on top of each other.\n return -1;\n }\n else\n {\n return maxIndex;\n }\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 static Tour CheapInsert (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int start, ziel;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n start = in.getPointNumber() - 1;\n ziel = out.getPointNumber() - 1;\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(out);\n tour.addPoint(in);\n for (int i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n int pos = -1;\n if (visited[i] == 1) {\n } else {\n double distance;\n double minimum = Double.MAX_VALUE;\n int insertPoint = 0;\n for (int j = 1; j <= tour.getSize(); j++) {\n if (tour.getPoint(j % tour.getSize()) == in) {\n pos = i;\n } else {\n int vor = tour.getPoint((j - 1) % tour.getSize()).getPointNumber() - 1;\n int nach = tour.getPoint((j) % tour.getSize()).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex] + distancematrix[cityIndex][nach];\n if (distance < minimum) {\n minimum = distance;\n insertPoint = j % tour.getSize();\n pos = i;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(i));\n visited[pos] = 1;\n }\n }\n }\n return tour;\n }", "private static double findMinCost(double lemda, Vector finalVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n int n = neighbors.size();\r\n int m = destList.size();\r\n int w = n > m ? m : n;\r\n\r\n double [] costFor_r = new double[w];\r\n\r\n double minCost = MaxDistance;\r\n double totalCurToAll = findDistanceCurToAll(currentNode, destList);\r\n for ( int r = 0 ; r < w; r ++ )\r\n {\r\n Vector rSetVector = new Vector();\r\n costFor_r[r] = getMinSetCost_given_r( r+1, rSetVector,\r\n currentNode,\r\n neighbors,\r\n destList);\r\n costFor_r[r] = (1.0 - lemda) * (r + 1) / n + costFor_r[r] / totalCurToAll;\r\n if ( costFor_r[r] < minCost ) {\r\n minCost = costFor_r[r];\r\n finalVector.clear();\r\n for (int k = 0; k < rSetVector.size(); ++k) {\r\n finalVector.add(k, rSetVector.get(k));\r\n }\r\n }\r\n }\r\n\r\n return minCost;\r\n }", "private void findMinimalDistances(City sourceCity) {\n\t\tList<City> adjacentCities = getNeighbors(sourceCity);\r\n\r\n\t\tfor (City target : adjacentCities) {\r\n\t\t\t// Compare the newly calculated tentative transportation cost to the current\r\n\t\t\t// assigned value and assign the smaller one.\r\n\t\t\tif (getShortestDistance(target) > getShortestDistance(sourceCity) + getDistance(sourceCity, target)) {\r\n\t\t\t\tdistance.put(target, getShortestDistance(sourceCity) + getDistance(sourceCity, target));\r\n\t\t\t\t// saves info on what was the city you came from\r\n\t\t\t\tpredecessors.put(target, sourceCity);\r\n\t\t\t\t// add neighbors as unsettled\r\n\t\t\t\tunSettledCities.add(target);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public final float minimumMarchingDistance(float[] val, boolean[] flag) {\n\n // s = a + b +c; s2 = a*a + b*b +c*c\n s = 0;\n s2 = 0;\n count = 0;\n\n for (int n=0; n<6; n+=2) {\n\t\t\tif (flag[n] && flag[n+1]) {\n\t\t\t\ttmp = Numerics.min(val[n], val[n+1]); // Take the smaller one if both are processed\n\t\t\t\ts += tmp;\n\t\t\t\ts2 += tmp*tmp;\n\t\t\t\tcount++;\n\t\t\t} else if (flag[n]) {\n\t\t\t\ts += val[n]; // Else, take the processed one\n\t\t\t\ts2 += val[n]*val[n];\n\t\t\t\tcount++;\n\t\t\t} else if (flag[n+1]) {\n\t\t\t\ts += val[n+1];\n\t\t\t\ts2 += val[n+1]*val[n+1];\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n // count must be greater than zero since there must be at least one processed pt in the neighbors\n \n tmp = (s+Math.sqrt( (s*s-count*(s2-1.0f))))/count;\n\n // The larger root\n return (float)tmp;\n }", "static int minCost(int cost[][], int destinationStation)\n {\n // dist[i] stores minimum cost to reach station i\n // from station 0.\n int minCost[] = new int[destinationStation];\n Arrays.fill(minCost, Integer.MAX_VALUE);\n minCost[0] = 0;\n \n // Go through every station and check if using it\n // as an intermediate station gives better path\n for (int i=0; i < destinationStation; i++)\n { \n \tfor (int j=i+1; j < destinationStation; j++)\n \t{ \n \t\tminCost[j] = Math.min(minCost[i] + cost[i][j], minCost[j]);\n \t}\n }\n return minCost[destinationStation-1];\n }", "public int minDistinction() {\n\n // If the jumble could contain nothing, min distinction is 0\n if (this.total == 0) {\n return 0;\n }\n\n return this.distincts().size();\n }", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "private void FindMinZ()\r\n\t{\r\n\t\tminimum_Z=Integer.MAX_VALUE;\r\n\t\tfor(Entry<Integer,Node> entry : FutureUpdateList.entrySet())\r\n\t\t{\r\n\t\t\tNode temp=entry.getValue();\r\n\t\t\tif(temp.z<minimum_Z)\r\n\t\t\t{\r\n\t\t\t\tminimum_Z=temp.z;\r\n\t\t\t\tminimum_X=temp.x;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private Long getMinSpanDistance(Long[][] pasMat){\n\t\tInteger ptr[] = new Integer[pasMat.length];\n\t\tLong minSpanTarget = -1L;\n\t\tfor(int i=0; i<pasMat.length; ptr[i++] = 0){\n\t\t\tif(pasMat[i] != null)\n\t\t\t\tminSpanTarget++;\n\t\t}\n\n\t\t/*System.out.println(\"new doc\\n\");\n\t\tSystem.out.println(\"-----------------------------\");\n\t\tfor(int i=0;i<pasMat.length; i++){\n\t\t\tSystem.out.print(\"term[\"+i+\"]\");\n\t\t\tfor(int j=0;pasMat[i]!= null && j<pasMat[i].length; j++){\n\t\t\t\tSystem.out.print(\"\\t\" + pasMat[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tSystem.out.println(\"-----------------------------\\n\");*/\n\n\t\tLong minSpan = Long.MAX_VALUE;\n\t\twhile(true){\n\t\t\t\n\t\t\tLong minVal = Long.MAX_VALUE;\n\t\t\tLong maxVal = Long.MIN_VALUE;\n\t\t\tInteger minI = null; \n\t\t\t\n\t\t\tfor(int i=0; i<pasMat.length; i++){\n\t\t\t\tInteger j = ptr[i];\n\t\t\t\tif (pasMat[i] == null) continue;\n\t\t\t\t\n\t\t\t\tLong value = pasMat[i][j];\n\t\t\t\tminVal = Math.min(minVal, value);\n\t\t\t\tmaxVal = Math.max(maxVal, value);\n\t\t\t\t\n\t\t\t\t// current value is less than min J value and there is room for incrementing \n\t\t\t\tif(((minI == null) || (value < pasMat[minI][ptr[minI]]))\n\t\t\t\t\t&& (ptr[i]+1 < pasMat[i].length)){\n\t\t\t\t\tminI = i;\n\t\t\t\t}\n\t\t\t\t//System.out.println(\"[\"+i+\"][\"+j+\"]\\t val=\"+value+\"\\tmini=\"+minI+\"\\t\");\n\t\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"\");\n\t\t\t\n\t\t\tminSpan = Math.min(minSpan, maxVal - minVal);\n\t\t\t\n\t\t\tif(minSpan == minSpanTarget || minI == null) break;\n\t\t\tptr[minI]++;\n\t\t}\n\t\treturn minSpan;\n\t}", "public static int minDistance(int[] dist, boolean[] visited) {\n int min = Integer.MAX_VALUE;\n int min_index = 0;\n\n for (int v = 0; v < dist.length; ++v) {\n if (!visited[v] && dist[v] < min) {\n min = dist[v];\n min_index = v;\n }\n }\n\n return min_index;\n }", "public int getMinDistanceArray(){\n int result = 0;\n double max_double = Double.MAX_VALUE;\n \n for (int i = 0; i < MinDistance.size(); i++){\n if (!MinDistanceStatus.get(i)){ //only checks for non final weights\n if (MinDistance.get(i) < max_double ){\n max_double = MinDistance.get(i);\n result = i;\n }\n }\n }\n \n return result;\n }", "private static void createMinMatrixAfterRemoval(String c) {\n\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\tfor(String s:allClusters) {\n\t\t\tif(!s.equals(c)) {\n\t\t\t\tdouble dist = temp.get(s);\n\t\t\t\tupdateMinMatrix(c,s,dist);\n\t\t\t}\n\t\t}\n\t}", "private void getMinDistances(String u, HashMap<Integer, Integer> distances, HashMap<String, Integer> nodeDistances){\n if(!graphVertexHashMap.containsKey(u)) return;\n\n Queue<String> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n queue.add(u);\n visited.put(u, true);\n int dist = 0;\n\n distances.put(dist, 1);\n nodeDistances.put(u, 0);\n\n while(!queue.isEmpty()){\n String node = queue.poll();\n dist += 1;\n boolean found = false;\n for(String edge : graphVertexHashMap.get(node).getOutDegrees().keySet()){\n if(!visited.containsKey(edge)){\n found = true;\n visited.put(edge, true);\n queue.add(edge);\n if(distances.get(dist) == null){\n distances.put(dist, 1);\n }\n else{\n distances.put(dist, distances.get(dist) + 1);\n }\n if(nodeDistances.containsKey(edge)){\n if(dist < nodeDistances.get(edge)){\n nodeDistances.put(edge, dist);\n }\n }else{\n nodeDistances.put(edge, dist);\n }\n }\n }\n if(!found) dist -=1;\n }\n\n }", "private static int getMinDistIndex(ArrayList<Double> list, int indexNotInterested) {\n \tdouble newDistMin = Double.MAX_VALUE;\n\t\tint newMinDistIndex = -1;\n\t\t\n\t\tfor(int i = 0; i < list.size(); i++) {\n\t\t\tif(i != indexNotInterested && newDistMin > list.get(i)) {\n\t\t\t\tnewDistMin = list.get(i);\n\t\t\t\tnewMinDistIndex = i;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn newMinDistIndex;\n }", "public Coord minCell()\n {\n\t int minX = getGrid().keySet().stream().mapToInt(Coord::getX).min().orElse(0);\n\n\t int minY = getGrid().keySet().stream().mapToInt(Coord::getY).min().orElse(0);\n\n\t return new Coord(minX, minY);\n }", "@Override\n\tpublic void search() {\n\t\tpq = new IndexMinPQ<>(graph.getNumberOfStations());\n\t\tpq.insert(startIndex, distTo[startIndex]);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tint v = pq.delMin();\n\t\t\tnodesVisited.add(graph.getStation(v));\n\t\t\tnodesVisitedAmount++;\n\t\t\tfor (Integer vertex : graph.getAdjacentVertices(v)) {\t\n\t\t\t\trelax(graph.getConnection(v, vertex));\n\t\t\t}\n\t\t}\n\t\tpathWeight = distTo[endIndex];\n\t\tpathTo(endIndex);\n\t}", "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 }", "@Override\r\n\tpublic void getMinimumSpanningTree(GraphStructure graph) {\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[0]=0;\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\tList<Edge> list;\r\n\t\twhile(spanningTreeSet.size()!=numberOfVertices) {\r\n\t\t\tfor (int vertex=0; vertex<numberOfVertices;vertex++) {\r\n\t\t\t\tif(! spanningTreeSet.contains(vertex)) {\r\n\t\t\t\t\tspanningTreeSet.add(vertex);\r\n\t\t\t\t\tlist = adjacencyList[vertex];\r\n\t\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[vertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nvertex\\tdistance from source\");\r\n\t\tfor (int i=0;i<numberOfVertices;i++) {\r\n\t\t\tSystem.out.println(i+\"\\t\"+distanceArray[i]);\r\n\t\t}\r\n\t}", "private T getMinUnvisited(){\n if (unvisited.isEmpty()) return null;\n T min = unvisited.get(0);\n for (int i = 1; i < unvisited.size(); i++){\n T temp = unvisited.get(i);\n if (distances[vertexIndex(temp)] < distances[vertexIndex(min)]){\n min = temp;\n }\n }\n return min;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n mNodes = sc.nextInt();\n mEdges = sc.nextInt();\n \n mDistances = new int[mNodes+1][mNodes+1];\n \n for (int i =1; i <= mNodes; i++)\n {\n \n for (int j =1; j <=mNodes;j++)\n {\n mDistances[i][j] = Integer.MAX_VALUE;\n \n }\n }\n \n for (int i =1; i <= mNodes; i++)\n {\n mDistances[i][i] =0;\n }\n \n for (int i = 0 ; i < mEdges; i++)\n {\n int from = sc.nextInt();\n int to = sc.nextInt();\n \n mDistances[from][to] = sc.nextInt();\n \n \n }\n \n \n //FW\n \n for (int k = 1; k <= mNodes; k++)\n {\n \n for (int i = 1; i <= mNodes; i++)\n {\n \n for (int j = 1; j <= mNodes; j++)\n {\n \n if (mDistances[i][k]!= Integer.MAX_VALUE && mDistances[k][j] != Integer.MAX_VALUE )\n {\n if (mDistances[i][j] > mDistances[i][k] + mDistances[k][j])\n {\n \n mDistances[i][j] = mDistances[i][k] + mDistances[k][j];\n }\n \n }\n \n }\n }\n \n }\n \n mQueries = sc.nextInt();\n \n for (int i =0; i < mQueries; i++)\n {\n int dist = mDistances[sc.nextInt()][sc.nextInt()];\n \n if (dist == Integer.MAX_VALUE)\n {\n dist = -1;\n }\n \n System.out.println(dist);\n \n }\n \n \n \n \n \n \n \n \n \n }", "public void setMinDistance(double newdistance) {\r\n\t\t// TODO\r\n\t\tif (newdistance <= 0) {\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\tmindistance = newdistance;\r\n\t}", "private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }", "public static Tour NNHeuristic (double distancematrix [][], Cluster cluster) {\n Stack<Integer> stack= new Stack<Integer>();\n Tour tour = new Tour(0);\n double length =0;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n Point out = cluster.getOutPoint ();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n\n tour.addPoint(out);\n tour.addPoint(in);\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n\n int element, dst = 0, i, pos = 0;\n stack.push(in.getPointNumber());\n element = stack.peek() - 1;\n boolean minFlag = false;\n while (!stack.isEmpty()) {\n double min = Integer.MAX_VALUE;\n for (i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (distancematrix[element][cityIndex] > 0 && visited[i] == 0) {\n if (min > distancematrix[element][cityIndex]) {\n min = distancematrix[element][cityIndex];\n dst = cityIndex + 1;\n pos = i;\n minFlag = true;\n }\n }\n }\n if (minFlag) {\n length = length + min;\n visited[pos] = 1;\n stack.push(dst);\n element = stack.peek() - 1;\n tour.addPoint(cluster.getPoints().get(pos));\n minFlag = false;\n continue;\n }\n stack.pop();\n }\n tour.removePoint(out);\n tour.removePoint(in);\n tour.addPoint(out);\n tour.addPoint(in);\n }\n return tour;\n }", "private int shortestDistance(Vertex dest) {\n Integer d = distance.get(dest);\n if (d==null)\n return Integer.MAX_VALUE;\n return d;\n }", "private void checkForMinimumDistanceFailure(final ReadEndsForMateCigar current) {\n if (!toMarkQueue.isEmpty()) {\n final ReadEndsForMateCigar other = toMarkQueue.peek();\n if (other.read1ReferenceIndex == current.read1ReferenceIndex && toMarkQueue.getToMarkQueueMinimumDistance() <= other.read1Coordinate - current.read1Coordinate) {\n if (checkCigarForSkips(other.getRecord().getCigar())) {\n throw new PicardException(\"Found a samRecordWithOrdinal with sufficiently large code length that we may have\\n\"\n + \" missed including it in an early duplicate marking iteration. Alignment contains skipped\"\n + \" reference bases (N's). If this is an\\n RNAseq aligned bam, please use MarkDuplicates instead,\"\n + \" as this tool does not work well with spliced reads.\\n Minimum distance set to \"\n + toMarkQueue.getToMarkQueueMinimumDistance() + \" but \" + (other.read1Coordinate - current.read1Coordinate - 1)\n + \" would be required.\\n\" + \"Record was: \" + other.getRecord().getSAMString());\n } else {\n System.err.print(\"record #1: \" + other.getRecord().getSAMString());\n System.err.print(\"record #2: \" + current.getRecord().getSAMString());\n throw new PicardException(\"Found a samRecordWithOrdinal with sufficiently large clipping that we may have\\n\"\n + \" missed including it in an early duplicate marking iteration. Please increase the\"\n + \" minimum distance to at least \" + (other.read1Coordinate - current.read1Coordinate - 1)\n + \"bp\\nto ensure it is considered (was \" + toMarkQueue.getToMarkQueueMinimumDistance() + \").\\n\"\n + \"Record was: \" + other.getRecord().getSAMString());\n }\n }\n }\n }", "Execution getClosestDistance();", "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 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}", "private static void makeInitialDistanceMatrix() {\n\t\ttry {\n\t\t\tfor(int i=1;i<=totalGenes;i++) {\n\t\t\t\tTreeMap<String, Double> temp1 = new TreeMap<>();\n\t\t\t\tif(distanceMatrix.containsKey(i+\"\"))\n\t\t\t\t\ttemp1 = distanceMatrix.get(i+\"\");\n\t\t\t\tfor(int j=i+1;j<=totalGenes;j++) {\n\t\t\t\t\tdouble dist = getDist(i, j);\n\t\t\t\t\tTreeMap<String, Double> temp2 = new TreeMap<>();\n\t\t\t\t\tif(distanceMatrix.containsKey(j+\"\"))\n\t\t\t\t\t\ttemp2 = distanceMatrix.get(j+\"\");\n\t\t\t\t\ttemp2.put(i+\"\", dist);\n\t\t\t\t\tdistanceMatrix.put(j+\"\", temp2);\n\t\t\t\t\ttemp1.put(j+\"\", dist);\n\t\t\t\t\tupdateMinMatrix(i+\"\",j+\"\",dist);\n\t\t\t\t}\n\t\t\t\tdistanceMatrix.put(i+\"\", temp1);\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static Tour FarthestInsertion (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n double max;\n double min;\n int chosenPoint = 0;\n int pos = -1;\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(in);\n tour.addPoint(out);\n while (tour.getSize() != numbernodes) {\n int point = 1;\n int insertPoint = 1;\n max =0;\n for (int i = 0; i < numbernodes; i++) {\n double minimum = Double.MAX_VALUE;\n\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (visited[i] == 1) {\n } else {\n double distance;\n\n for (int j = 1; j <= tour.getSize() - 1; j++) {\n int vor = tour.getPoint((j - 1)).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex];\n if (distance < minimum) {\n minimum = distance;\n point = j;\n pos = i;\n }\n }\n if (minimum > max){\n max = minimum;\n chosenPoint = pos;\n insertPoint = point;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(chosenPoint));\n visited[chosenPoint] = 1;\n }\n }\n tour.removePoint(in);\n tour.addPoint(in);\n return tour;\n }", "public int findMinimumStudentCost(Student start, Student dest) {\n initializeSingleSource(start);\n minHeap.buildHeap(students); //build heap from array of studente keyed by minCost\n while (minHeap.size() != 0) { //while heap size does not equal 0.\n Student minimum = minHeap.extractMin();\n if (minimum.getName() == dest.getName()) {\n return minimum.getminCost();\n }\n for (int i = 0; i < minimum.getNeighbors().size(); ++i) { //for each vertex v in m's adjacency list\n relax(minimum, minimum.getNeighbors().get(i), i); //relax\n }\n }\n return -1; //error message\n }", "void dijkstra(int[][] graph){\r\n int dist[] = new int[rideCount];\r\n Boolean sptSet[] = new Boolean[rideCount];\r\n\r\n for(int i = 0; i< rideCount; i++){\r\n dist[i] = Integer.MAX_VALUE;\r\n sptSet[i] = false;\r\n }\r\n\r\n dist[0] = 0;\r\n\r\n for(int count = 0; count< rideCount -1; count++){\r\n int u = minWeight(dist, sptSet);\r\n sptSet[u] = true;\r\n for(int v = 0; v< rideCount; v++){\r\n if (!sptSet[v] && graph[u][v] != 0 && dist[u] + graph[u][v] < dist[v]){\r\n dist[v] = dist[u] + graph[u][v];\r\n }\r\n }\r\n }\r\n printSolution(dist);\r\n }", "public void extractMin (Tree tempTree, ArrayList <String> qList, Vertex min) {\r\n\r\n //find all connected verticies to the minimum\r\n connectedList = allConnected(min);\r\n \r\n \r\n //for each connected vertex\r\n for (int i = 0; i < connectedList.size(); ++i){\r\n\r\n //check if the connected edge is in the Qlist\r\n if (qList.contains(connectedList.get(i).getStart()) == true || qList.contains(connectedList.get(i).getEnd()) == true) {\r\n tempTree.checkWeight(connectedList.get(i), min);\r\n }\r\n }\r\n }", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "public void activateCluster(){\n for (int row = 0; row < matrix.length; row++) {\n// Cell[] matrix1 = matrix[i];\n for (int col = 0; col < matrix[row].length; col++) {\n Cell cell = matrix[row][col];\n // check every if null it means there is no cell at that position\n // get fist occured cell and meet it with the next one\n // run the loop while\n // while cell.getRow < cell.bestRow && cell.getCol < cell.bestCol\n if(cell != null) {\n while (cell.getRow() <= this.cellBiggestRow && cell.getCol() <= this.cellBiggestCol) {\n\n if (cell.getCol() >= matrix[row].length) {\n if (!(cell.getRow() >= matrix.length)) {\n cell.setRow(cell.getRow() + 1);\n }\n } else {\n cell.setCol(cell.getCol() + 1);\n }\n\n // if cell.getCol + 1 < matrix[row].length && matrix[row] != null\n // get the next cell and do the fight\n }\n }\n }\n }\n\n }", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "private static void compareDistanceAndReplace(final DirectedGraph directedGraph,\n final Map<String, Integer> currentShortestPaths,\n final String start) {\n final Map<String, Integer> possibleDestinations = directedGraph.get(start);\n if (possibleDestinations != null) {\n // For each possible edge to this node, check if the distance of this edge plus the value of how\n // we arrived at the start node is smaller than the current value in the table, if so then replace it\n possibleDestinations.forEach((toNode, distance) -> {\n final int valueToCompare = currentShortestPaths.get(start) + distance;\n final Integer currentShortest = currentShortestPaths.get(toNode);\n final boolean currentInfinity = currentShortestPaths.containsKey(toNode) && (currentShortest == null || currentShortest == 0);\n // If the to node we are currently looking at is infinity in our table, then always replace\n // or if there is a real value then compare it\n // and if the new route is shorter then replace it\n if (currentInfinity\n || (containsAndNotNull(currentShortestPaths, toNode) && (currentShortest > valueToCompare))) {\n currentShortestPaths.put(toNode, valueToCompare);\n }\n });\n }\n }", "private int getNearestNode(LatLng vic) {\n\t\tint node = 0;\n\t\tfor(int j=0; j<nodeList.size()-1; j++){\n\t\t\tdouble dist1 = getWeight(vic, nodeList.get(node));\n\t\t\tdouble dist2 = getWeight(vic, nodeList.get(j));\n\t\t\tif(dist1 > dist2){\n\t\t\t\tnode = j;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}", "public int extractMinDistance(int queue[], boolean set[]){\r\n\t\tint min=Integer.MAX_VALUE;\t\r\n\t\tint minIndex=0;\r\n\t\t\r\n\t\tfor(int v=0;v<vertices; v++){\r\n\t\t\tif(set[v] == false && queue[v] <= min){\r\n\t\t\t\tmin=queue[v]; \r\n\t\t\t\tminIndex=v;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn minIndex;\r\n\t}", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private String findMin(Map<String, Node> nodeList)\n\t{\n\t\tint min = Integer.MAX_VALUE;\n\t\tString sommet = null;\n\t\t\n\t\tfor (String nodeName : nodeList.keySet()) {\n\t\t\tint distance = nodeList.get(nodeName).getDistanceFromOrigin();\n\n\t\t\tif(min > distance) {\n\t\t\t\tmin = distance;\n\t\t\t\tsommet = nodeName;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sommet;\n\t}", "private static Point getNearest(Collection<Point> centers, Point p) {\n\t\tdouble min = 0;\n\t\tPoint minPoint = null;\n\t\tfor(Point c : centers){\n\t\t\tif(minPoint == null || c.distance(p) < min){\n\t\t\t\tmin = c.distance(p);\n\t\t\t\tminPoint = c;\n\t\t\t}\n\t\t}\n\t\treturn minPoint;\n\t}", "static int minCost(int cost[][], int srcStation, int destinationStation)\n {\n int minCost[] = new int[destinationStation];\n Arrays.fill(minCost, Integer.MAX_VALUE);\n minCost[srcStation] = 0;\n\n // Go through every station and check if using it\n // as an intermediate station gives better path\n for (int i=srcStation; i < destinationStation; i++)\n {\n for (int j=i+1; j < destinationStation; j++)\n {\n minCost[j] = Math.min(minCost[i] + cost[i][j], minCost[j]);\n }\n }\n return minCost[destinationStation-1];\n }", "public final boolean searchMinimum(){\r\n\t\tif (!initialized()) minimum=true;\r\n\t\treturn minimum;\r\n\t}", "private double oneWayDistance(Shape other, Vector3D direction) {\n // for every vertex in this shape,\n // would it intersect the other shape if moved in direction dir?\n // if so, at what distance? Find the min.\n\n Vector3D d = direction.normalize();\n double[] v = this.getTransformedVertices();\n double tmin = -1;\n\n for (int i = 0; i < v.length; i += 3) {\n Vector3D vertex = new Vector3D(v[i], v[i + 1], v[i + 2]);\n double t = other.rayIntersect(vertex, d, false, null, null);\n tmin = Util.Math.minIfValid(t, tmin);\n }\n\n return tmin;\n }", "public void solveUsingLeastCostMethod() {\n\n this.solution = new Solution();\n\n Source[] proxySources = Arrays.copyOf(sources, sources.length);\n Destination[] proxyDestinations = Arrays.copyOf(destinations, destinations.length);\n int[][] matrix = new int[costs.length][costs[0].length];\n\n List<Integer> rows = new ArrayList<Integer>();\n List<Integer> columns = new ArrayList<Integer>();\n while ( rows.size() != proxySources.length && columns.size() != proxyDestinations.length ) {\n //getting minimum cell (if there is a tie, we choose where is the maximum quantity)\n int indexI,indexJ, value;\n indexI = 0;\n indexJ = 0;\n value = 0;\n boolean firstElement = true;\n for(int i=0;i<proxySources.length;i++) {\n if( !rows.contains(i) ) {\n for(int j=0;j<proxyDestinations.length;j++) {\n if( !columns.contains(j) ) {\n if ( firstElement ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n firstElement = false;\n }\n if( costs[i][j] < value ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n else if( costs[i][j] == value ) {\n if( Math.min(proxySources[i].getSupply(),proxyDestinations[j].getDemand()) > Math.min(proxySources[indexI].getSupply(),proxyDestinations[indexJ].getDemand()) ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n }\n }\n }\n }\n }\n int supply = proxySources[indexI].getSupply();\n int demand = proxyDestinations[indexJ].getDemand();\n\n\n this.solution.add(sources[indexI], destinations[indexJ], Math.min(supply,demand), costs[indexI][indexJ]);\n\n if ( supply < demand ) {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(demand - supply);\n rows.add(indexI);\n }\n else if( supply > demand ) {\n proxySources[indexI].setSupply(supply-demand);\n proxyDestinations[indexJ].setDemand(0);\n columns.add(indexJ);\n }\n else {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(0);\n rows.add(indexI);\n columns.add(indexJ);\n }\n }\n this.solution.showSolution();\n\n\n }", "private Cluster getNearestCluster(BasicEvent event) {\n float minDistance = Float.MAX_VALUE;\n Cluster closest = null;\n float currentDistance = 0;\n for (Cluster c : clusters) {\n float rX = c.radiusX;\n float rY = c.radiusY; // this is surround region for purposes of dynamicSize scaling of cluster size or aspect ratio\n if (dynamicSizeEnabled) {\n rX *= surround;\n rY *= surround; // the event is captured even when it is in \"invisible surround\"\n }\n float dx, dy;\n if ((dx = c.distanceToX(event)) < rX && (dy = c.distanceToY(event)) < rY) { // needs instantaneousAngle metric\n currentDistance = dx + dy;\n if (currentDistance < minDistance) {\n closest = c;\n minDistance = currentDistance;\n c.distanceToLastEvent = minDistance;\n c.xDistanceToLastEvent = dx;\n c.yDistanceToLastEvent = dy;\n }\n }\n }\n return closest;\n }", "public void findShortestPath() {\r\n\t\t\r\n\t\t//Create a circular array that will store the possible next tiles in the different paths.\r\n\t\tOrderedCircularArray<MapCell> path = new OrderedCircularArray<MapCell>();\r\n\t\t\r\n\t\t//Acquire the starting cell.\r\n\t\tMapCell starting = cityMap.getStart();\r\n\t\t\r\n\t\t//This variable is to be updated continuously with the cell with the shortest distance value in the circular array.\r\n\t\tMapCell current=null;\r\n\t\t\r\n\t\t//This variable is to check if the destination has been reached, which is initially false.\r\n\t\tboolean destination = false;\r\n\t\t\r\n\t\t//Add the starting cell into the circular array, and mark it in the list.\r\n\t\tpath.insert(starting, 0);\r\n\t\t\r\n\t\tstarting.markInList(); \r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t//As long as the circular array isn't empty, and the destination hasn't been reached, run this loop.\r\n\t\t\twhile(!path.isEmpty()&&!destination) {\r\n\t\t\t\t\r\n\t\t\t\t//Take the cell with the shortest distance out of the circular array, and mark it accordingly.\r\n\t\t\t\tcurrent = path.getSmallest();\r\n\t\t\t\tcurrent.markOutList();\r\n\t\t\t\t\r\n\t\t\t\tMapCell next;\r\n\t\t\t\tint distance;\r\n\t\t\t\t\r\n\t\t\t\tif(current.isDestination()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tdestination = true; //If the current cell is the destination, end the loop.\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\t\tnext = nextCell(current); //Acquire the next possible neighbour of the current cell.\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Don't run if next is null, meaning there is no other possible neighbour in the path for the current cell.\r\n\t\t\t\t\twhile(next!=null) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdistance = current.getDistanceToStart() + 1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//If the distance of the selected neighbouring cell is currently more than 1 more than the current cell's \r\n\t\t\t\t\t\t//distance, update the distance of the neighbouring cell. Then, set the current cell as its predecessor.\r\n\t\t\t\t\t\tif(next.getDistanceToStart()>distance) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnext.setDistanceToStart(distance);\r\n\t\t\t\t\t\t\tnext.setPredecessor(current);\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\tdistance = next.getDistanceToStart(); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(next.isMarkedInList() && distance<path.getValue(next)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tpath.changeValue(next, distance); //If the neighbouring cell is in the circular array, but with a \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //larger distance value than the new updated distance, change its value.\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else if(!next.isMarkedInList()){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tpath.insert(next, distance); //If the neighbouring cell isn't in the circular array, add it in.\r\n\t\t\t\t\t\t\tnext.markInList();\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\tnext = nextCell(current); //Look for the next possible neighbour, if any.\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\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Catch all the possible exceptions that might be thrown by the method calls. Print the appropriate messages.\r\n\t\t} catch (EmptyListException e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.out.println(\"Path finding execution stopped.\");\r\n\t\t\t\r\n\t\t} catch (InvalidNeighbourIndexException e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"The program tried to access an invalid neighbour of a tile.\");\r\n\t\t\tSystem.out.println(\"Path finding execution stopped.\");\r\n\t\t\t\r\n\t\t} catch (InvalidDataItemException e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.out.println(\"Path finding execution stopped.\");\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(e.getMessage()+\" Path finding execution has stopped.\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//If a path was found, print the number of tiles in the path.\r\n\t\tif(destination) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Number of tiles in path: \" + (current.getDistanceToStart()+1));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"No path found.\"); //Otherwise, indicate that a path wasn't found.\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "@Override\r\n public double calculateBestQuality() {\r\n int numClasses = parentClassDist.size();\r\n \r\n //Sort the mean distance orderline\r\n Collections.sort(meanDistOrderLine);\r\n \r\n //Find approximate minimum orderline objects\r\n OrderLineObj min = new OrderLineObj(-1.0, 0.0);\r\n for(Double d : parentClassDist.keySet()){\r\n int unassignedObjs = parentClassDist.get(d) - orderLineClassDist.get(d);\r\n double distMin = (sums[d.intValue()] + (unassignedObjs * minDistance)) / parentClassDist.get(d);\r\n if(min.getDistance() == -1.0 || distMin < min.getDistance()){\r\n min.setDistance(distMin);\r\n min.setClassVal(d);\r\n }\r\n }\r\n \r\n //Find approximate maximum orderline objects\r\n OrderLineObj max = new OrderLineObj(-1.0, 0.0);\r\n for(Double d : parentClassDist.keySet()){\r\n int unassignedObjs = parentClassDist.get(d) - orderLineClassDist.get(d);\r\n double distMax = (sums[d.intValue()] + (unassignedObjs * maxDistance)) / parentClassDist.get(d); \r\n if(d != min.getClassVal() && (max.getDistance() == -1.0 || distMax > max.getDistance())){\r\n max.setDistance(distMax);\r\n max.setClassVal(d);\r\n }\r\n }\r\n \r\n //Adjust running sums\r\n double increment = (max.getDistance() - min.getDistance()) / (numClasses-1);\r\n int multiplyer = 1;\r\n for (OrderLineObj currentObj : meanDistOrderLine) {\r\n double thisDist;\r\n int unassignedObjs = parentClassDist.get(currentObj.getClassVal()) - orderLineClassDist.get(currentObj.getClassVal());\r\n \r\n if(currentObj.getClassVal() == min.getClassVal()){\r\n thisDist = minDistance;\r\n }else if(currentObj.getClassVal() == max.getClassVal()){\r\n thisDist = maxDistance;\r\n }else{\r\n thisDist = minDistance + (increment * multiplyer);\r\n multiplyer++; \r\n }\r\n sums[(int)currentObj.getClassVal()] += thisDist * unassignedObjs;\r\n sumOfSquares[(int)currentObj.getClassVal()] += thisDist * thisDist * unassignedObjs;\r\n sumsSquared[(int)currentObj.getClassVal()] = sums[(int)currentObj.getClassVal()] * sums[(int)currentObj.getClassVal()];\r\n }\r\n \r\n double ssTotal;\r\n double part1 = 0;\r\n double part2 = 0;\r\n\r\n for (int i = 0; i < numClasses; i++) {\r\n part1 += sumOfSquares[i];\r\n part2 += sums[i];\r\n }\r\n\r\n part2 *= part2;\r\n part2 /= numInstances;\r\n ssTotal = part1 - part2;\r\n\r\n double ssAmoung;\r\n part1 = 0;\r\n part2 = 0;\r\n for (int i = 0; i < numClasses; i++) {\r\n part1 += (double) sumsSquared[i] / parentClassDist.get((double) i);//.data[i].size();\r\n part2 += sums[i];\r\n }\r\n ssAmoung = part1 - (part2 * part2) / numInstances;\r\n double ssWithin = ssTotal - ssAmoung;\r\n\r\n int dfAmoung = numClasses - 1;\r\n int dfWithin = numInstances - numClasses;\r\n\r\n double msAmoung = ssAmoung / dfAmoung;\r\n double msWithin = ssWithin / dfWithin;\r\n\r\n double f = msAmoung / msWithin;\r\n \r\n //Reset running sums\r\n multiplyer = 1;\r\n for (OrderLineObj currentObj : meanDistOrderLine) {\r\n double thisDist;\r\n int unassignedObjs = parentClassDist.get(currentObj.getClassVal()) - orderLineClassDist.get(currentObj.getClassVal());\r\n \r\n if(currentObj.getClassVal() == min.getClassVal()){\r\n thisDist = minDistance;\r\n }else if(currentObj.getClassVal() == max.getClassVal()){\r\n thisDist = maxDistance;\r\n }else{\r\n thisDist = minDistance + (increment * multiplyer);\r\n multiplyer++; \r\n }\r\n sums[(int)currentObj.getClassVal()] -= thisDist * unassignedObjs;\r\n sumOfSquares[(int)currentObj.getClassVal()] -= thisDist * thisDist * unassignedObjs;\r\n sumsSquared[(int)currentObj.getClassVal()] = sums[(int)currentObj.getClassVal()] * sums[(int)currentObj.getClassVal()];\r\n }\r\n \r\n return Double.isNaN(f) ? 0.0 : f;\r\n }", "private Cell getShortestPath(List<Cell> surroundingBlocks, int DestinationX, int DestinationY) {\n \n int cellIdx = random.nextInt(surroundingBlocks.size());\n Cell min = surroundingBlocks.get(0);\n int distMin = euclideanDistance(surroundingBlocks.get(0).x, surroundingBlocks.get(0).y, DestinationX, DestinationY);\n \n for(int i = 0; i < surroundingBlocks.size(); i++) {\n if (i==1) {\n min = surroundingBlocks.get(i);\n }\n if(distMin > euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY)) {\n distMin = euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY);\n min = surroundingBlocks.get(i);\n }\n }\n return min;\n }", "protected final void setMin() {\n\tint prevmin = this.min;\n\n\tint i1 = this.low;\n\tint i2 = left.min;\n\tint i3 = right.min;\n\n\tif (i2 == -1) \n\t i2 = i1;\n\tif (i3 == -1) \n\t i3 = i1;\n\n\tif ((i1 <= i2) && (i1 <= i3)) {\n\t this.min = i1;\n\t} else if ((i2 <= i1) && (i2 <= i3)) {\n\t this.min = i2;\n\t} else {\n\t this.min = i3;\n\t}\n\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmin != this.min)) {\n \t p.setMin();\n\t}\n }", "private void computeShortestPath(){\n T current = start;\n boolean atEnd = false;\n while (!unvisited.isEmpty()&& !atEnd){\n int currentIndex = vertexIndex(current);\n LinkedList<T> neighbors = getUnvisitedNeighbors(current); // getting unvisited neighbors\n \n //what is this doing here???\n if (neighbors.isEmpty()){\n \n }\n \n // looping through to find distances from start to neighbors\n for (T neighbor : neighbors){ \n int neighborIndex = vertexIndex(neighbor); \n int d = distances[currentIndex] + getEdgeWeight(current, neighbor);\n \n if (d < distances[neighborIndex]){ // if this distance is less than previous distance\n distances[neighborIndex] = d;\n closestPredecessor[neighborIndex] = current; // now closest predecessor is current\n }\n }\n \n if (current.equals(end)){\n atEnd = true;\n }\n else{\n // finding unvisited node that is closest to start node\n T min = getMinUnvisited();\n if (min != null){\n unvisited.remove(min); // remove minimum neighbor from unvisited\n visited.add(min); // add minimum neighbor to visited\n current = min;\n }\n }\n }\n computePath();\n totalDistance = distances[vertexIndex(end)];\n }", "public void setMin(Vect3d min) {\r\n this.min = min;\r\n }", "public void update(Packet p)\r\n {\r\n int[] min_distance = new int[NetworkSimulator.NUMENTITIES];\r\n boolean table_changed = false;\r\n\r\n System.out.println();\r\n System.out.println(\"--------------------------------\");\r\n System.out.println(\"update() for Node \" + NODE_NUM);\r\n System.out.println(\"--------------------------------\");\r\n System.out.println(\"Packet Sender: Node \" + p.getSource());\r\n\r\n for (int i = 0; i < NetworkSimulator.NUMENTITIES; i++) {\r\n int current_cost = distanceTable[NODE_NUM][i];\r\n int source_cost = distanceTable[NODE_NUM][p.getSource()];\r\n int packet_cost = p.getMincost(i);\r\n\r\n if (source_cost + packet_cost < current_cost) {\r\n min_distance[i] = source_cost + packet_cost;\r\n distanceTable[NODE_NUM][i] = min_distance[i];\r\n table_changed = true;\r\n } else {\r\n min_distance[i] = current_cost;\r\n }\r\n\r\n distanceTable[p.getSource()][i] = packet_cost;\r\n }\r\n\r\n if (table_changed) {\r\n System.out.println(\"*Distance table changed*\");\r\n System.out.println(\"Minimum distances sent: \" + Arrays.toString(min_distance));\r\n\r\n for (int neighbor : NEIGHBORS) {\r\n Packet dtPacket = new Packet(NODE_NUM, neighbor, min_distance);\r\n NetworkSimulator.toLayer2(dtPacket);\r\n }\r\n } else {\r\n System.out.println(\"Distance table not changed.\");\r\n }\r\n\r\n printDT();\r\n }", "public M csmiPlaceMin(Object min){this.put(\"csmiPlaceMin\", min);return this;}", "public Set<? extends Position> findNearest(\n\t\t\tPosition position, int k, double distance);", "private static int minTime(Map<Integer, Map<Integer, Integer>> graph, int s, int d) {\n //System.out.println(\"minTime: \" + s + \",\" + d);\n int min = Integer.MAX_VALUE;\n int[] minAr = new int[3];\n boolean found = false;\n LinkedList<Integer> queue = new LinkedList<>();\n HashSet<Integer> visited = new HashSet<>(graph.size());\n\n queue.add(s);\n visited.add(s);\n\n while (queue != null && queue.peek() != null) {\n int i = queue.poll();\n Map<Integer, Integer> map = graph.get(i);\n if(map!=null){\n for (Integer key : map.keySet()) {\n if (!visited.contains(key)) {\n queue.add(key);\n visited.add(key);\n\n if (min > map.get(key)) {\n min = map.get(key);\n minAr[0] = i;\n minAr[1] = key;\n minAr[2] = min;\n\n //System.out.println( \"minAr inside: \" + minAr[0] + \"-\"+ minAr[1] + \"-\" +minAr[2]);\n }\n\n if (key == d) {\n found = true;\n queue = null;\n break;\n\n }\n }\n }\n }\n }\n if (found) {\n //System.out.println(\"minAr: \" + minAr[0] + \"-\" + minAr[1] + \"-\" + minAr[2]);\n Map<Integer, Integer> map1 = graph.get(minAr[0]);\n map1.remove(minAr[1]);\n graph.put(minAr[0], map1);\n Map<Integer, Integer> map2 = graph.get(minAr[1]);\n map2.remove(minAr[0]);\n graph.put(minAr[1], map2);\n System.out.println(\"min : \" + min);\n\n min = (min == Integer.MAX_VALUE) ? 0 : min;\n } else {\n System.out.println(\"no connection\");\n min = 0;\n }\n return min;\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 }", "public double cheapestInsert(Integer[] notSeen){\n List<Integer> list = new ArrayList<>();\n list.add(lastSeen);\n list.add(0);\n \n List<Integer> notSeenTemp = new ArrayList<>();\n for(Integer node: notSeen){\n notSeenTemp.add(node);\n }\n \n int i = 0;\n int chosenIndex=0;\n Integer chosenNode = null;\n \n //While all the inserts have not been done\n while (notSeenTemp.size() >0){\n double cheapestInsertCost = Double.MAX_VALUE;\n //For each position in the list\n for(i =0; i< list.size()-1; i++){\n //For each \"not seen\" node not yet inserted\n for(Integer nodeTemp: notSeenTemp){\n //find the cheapest insert\n if(cheapestInsertCost>(cost[list.get(i)][nodeTemp] + cost[nodeTemp][list.get(i+1)] - cost[list.get(i)][list.get(i+1)])){\n cheapestInsertCost=cost[list.get(i)][nodeTemp] + cost[nodeTemp][list.get(i+1)] - cost[list.get(i)][list.get(i+1)];\n chosenIndex = i+1;\n chosenNode = nodeTemp; \n }\n \n }\n \n }\n list.add(chosenIndex, chosenNode);\n notSeenTemp.remove(chosenNode);\n }\n \n double res =0;\n for(i = 0; i< list.size()-1; i++){\n res+= cost[list.get(i)][list.get(i+1)];\n }\n return res;\n }", "public GraphNode getMinDistanceNode(GraphNode pNode, double pWeight){\n GraphNode result = null;\n double max_double = Double.MAX_VALUE;\n \n ArrayList<ArcGraph> conections = pNode.getConections();\n \n for (int i = 0; i < conections.size(); i++){\n if (conections.get(i).getWeight() + pWeight < max_double ){\n max_double = conections.get(i).getWeight(); //updates the min weight\n result = conections.get(i).getDestiny(); //returns the destiny Node\n }\n }\n System.out.println(String.valueOf(result.getLatitude())+\" \"+String.valueOf(result.getLongitude())+\" \"+String.valueOf(result.getRating())+\" \"\n +result.getThumbnail()+\" \"+result.getType());\n return result;\n \n }", "public float compare(Cluster other) {\n \treturn compare(center, other.center);\n }", "public Point getFurthermost(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint closest = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t\tclosest = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t}", "int freecabInd(int dest) {\n int index = 0;\n int min = 0;\n int minIndex = 0;\n\n for(int i=0;i<freeCab.length;i++){\n\n int matLandmark = matchingLandmark(freeCab[index][0], freeCab[index][1]);\n\n int dis = distance.dijkstra(adjancy, matLandmark, dest);\n\n if (dis < min) {\n min = dis;\n minIndex = index;\n }\n index++;\n\n }\n\n return minIndex;\n\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "private void findBestPath(int start){\n\t\tint n = this.getDimension(); // for readability\n\t\tint lastCity, minDist = 0, moment = 0;\n\t\t\n\t\tthis.path = new int[this.getDimension() + 1];\n\t\tthis.visited = 0; \n\t\t\n\t\tsetAllUnvisited();\n\t\t\n\t\tvisitCity(moment, start); // visits the first city in time 0\n\t\tlastCity = start;\n//\t\tSystem.out.println(Arrays.toString(this.path) + \" > \" + this.visited);\n\t\t// Repeats until all cities were visited\n\t\twhile(visited < n){\n//\t\t\tSystem.out.println(\"LC:\" + lastCity + \" MD:\" + minDist + \" M:\" + moment);\n\t\t\tmoment++;\n\t\t\t\n\t\t\t// Finds the closest city\n\t\t\tint closest = -1, closestDist = -1;\n\t\t\tfor(int i = 0; i < n; i++){\n\t\t\t\tif(!wasVisited(i)){\n\t\t\t\t\tif(dist(lastCity, i) < closestDist || closestDist == -1){ // If it's the first iteration or found a closer city\n\t\t\t\t\t\tclosest = i;\n\t\t\t\t\t\tclosestDist = dist(lastCity, closest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Updates distance\n\t\t\tminDist += dist(lastCity, closest);\n\t\t\t\n\t\t\t// Visits the closest city\n\t\t\tvisitCity(moment, closest);\n\t\t\tlastCity = closest;\n//\t\t\tSystem.out.println(Arrays.toString(this.path) + \" > \" + minDist);\n\t\t\t\n\t\t}\n\t\t\n\t\t// Returns to the first city\n\t\tvisitCity(moment + 1, start);\n\t\tminDist += dist(lastCity, start);\n\t\t\n\t\tif(minDist < this.totalDistance || this.totalDistance == -1){\n\t\t\tthis.totalDistance = minDist;\n\t\t\tthis.bestPath = this.path.clone();\n\t\t}\n//\t\tSystem.out.println(Arrays.toString(this.path) + \" -----> \" + minDist);\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 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 void setMax(){\n for (int i = 0; i < Nodes.size(); i++){\n this.MinDistance.add(Double.MAX_VALUE);\n }\n }", "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 }", "public boolean getNearestTownforTheFirstTime() {\n\t\tint eigenePositionX = stadtposition.x;\r\n\t\tint eigenePositionY = stadtposition.y;\r\n\t\tint anderePositionX, anderePositionY;\r\n\t\tint deltaX, deltaY;\r\n\t\tint distance;\r\n\t\tint distancesum;\r\n\t\tint mindistance = 1200;\r\n\t\tint minIndex = 0;\r\n\r\n\t\tfor (int i = 0; i < otherTowns.size(); i++) {\r\n\t\t\tanderePositionX = otherTowns.get(i).stadtposition.x;\r\n\t\t\tanderePositionY = otherTowns.get(i).stadtposition.y;\r\n\t\t\tdeltaX = eigenePositionX - anderePositionX;\r\n\t\t\tdeltaY = eigenePositionY - anderePositionY;\r\n\t\t\tdistancesum = deltaX * deltaX + deltaY * deltaY;\r\n\t\t\tdistance = (int) Math.sqrt(distancesum);\r\n\r\n\t\t\tif (distance == 0) {\r\n\t\t\t\tdistance = 1500;\r\n\t\t\t}\r\n\r\n\t\t\tif (distance < mindistance) {\r\n\t\t\t\t// System.out.println(distance+\" von minindex i \"+i+\"ist kleiner\");\r\n\t\t\t\tminIndex = i;\r\n\t\t\t\tmindistance = distance;\r\n\t\t\t\tif (mindistance < 33) {\r\n\t\t\t\t\tmindistance = 1200;\r\n\t\t\t\t\ti = 0;\r\n\t\t\t\t\tstadtposition.x = (int) (Math.random() * 1000);\r\n\t\t\t\t\tstadtposition.y = (int) ((Math.random() * 680) + 100);\r\n\r\n//\t\t\t\t\tSystem.out.println(\"stadt ist zu nahe, ändere stadtposition\");\r\n\t\t\t\t\treturn false;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n//\t\tSystem.out.println(\"minIndex: \" + minIndex + \" ist mit mindistance \" + mindistance + \" am nahsten\");\r\n\t\tnahsteStadt = otherTowns.get(minIndex);\r\n\t\treturn true;\r\n\r\n\t}", "private int getMinCostVertexFromTheGraph(int[] minCostComputedForVertices, boolean[] verticesAlreadyVisited) {\n\t\tint minVertex = -1;\n\t\tint minCost = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i=0;i<minCostComputedForVertices.length;i++) {\n\t\t\tif(verticesAlreadyVisited[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(minCost > minCostComputedForVertices[i]) {\n\t\t\t\tminCost = minCostComputedForVertices[i];\n\t\t\t\tminVertex = i;\n\t\t\t}\n\t\t}\n\t\treturn minVertex;\n\t}", "public int kthSmallest(int[][] matrix, int k) {\n int rows = matrix.length;\n int columns = matrix[0].length;\n // setup a Min heap for getting the first k items in the heap\n PriorityQueue<Cell> minHeap = new PriorityQueue<Cell>(k, new Comparator<Cell>() {\n @Override\n public int compare(Cell o1, Cell o2) {\n if(o1.value == o2.value) return 0;\n return o1.value < o2.value ? -1 : 1;\n }\n });\n boolean[][] visited = new boolean[rows][columns];\n minHeap.offer(new Cell(0,0,matrix[0][0]));\n visited[0][0] = true;\n // BFS. Imaging the matrix is a graph, and neighbor is left, and down 1.\n // using BFS searching, but keep the data in min heap structure.\n for(int i = 0; i < k-1; i++){\n Cell curr = minHeap.poll();\n // two condition for putting the element into min heep\n // 1.if it is in the range of matrix\n // 2.if it is not visited.\n if(curr.row + 1 < rows && !visited[curr.row+1][curr.column]){\n minHeap.offer(new Cell(curr.row+1,curr.column,matrix[curr.row+1][curr.column]));\n visited[curr.row+1][curr.column] = true;\n }\n if(curr.column + 1 < columns && ! visited[curr.row][curr.column+1]){\n minHeap.offer(new Cell(curr.row,curr.column+1, matrix[curr.row][curr.column+1]));\n visited[curr.row][curr.column+1] = true;\n }\n }\n // after put first k item into min heap, we only need to get the top item\n return minHeap.peek().value;\n }", "public ArcGraph getMinDistanceArc(GraphNode pNode, double pWeight){\n ArcGraph result = null;\n double max_double = Double.MAX_VALUE;\n \n ArrayList<ArcGraph> conections = pNode.getConections();\n \n for (int i = 0; i < conections.size(); i++){\n if (conections.get(i).getWeight() + pWeight < max_double ){\n max_double = conections.get(i).getWeight(); //updates the min weight\n result = conections.get(i);\n }\n }\n return result;\n }", "private Map<Vertice<T>, Integer> caminosMinimoDikstra(Vertice<T> origen) {\n \tMap<Vertice<T>, Integer> distancias = new HashMap<Vertice<T>, Integer>();\n \tfor(Vertice<T> unVertice : this.vertices) {\n \t\tdistancias.put(unVertice, Integer.MAX_VALUE);\n \t}\n \tdistancias.put(origen, 0);\n \t\n \t// guardo visitados y pendientes de visitar\n \tSet<Vertice<T>> visitados = new HashSet<Vertice<T>>();\n \tTreeMap<Integer,Vertice<T>> aVisitar= new TreeMap<Integer,Vertice<T>>();\n\n \taVisitar.put(0,origen);\n \t \n \twhile (!aVisitar.isEmpty()) {\n \t\tEntry<Integer, Vertice<T>> nodo = aVisitar.pollFirstEntry();\n \t\tvisitados.add(nodo.getValue());\n \t\t\n \tint nuevaDistancia = Integer.MIN_VALUE;\n \tList<Vertice<T>> adyacentes = this.getAdyacentes(nodo.getValue());\n \t\n \tfor(Vertice<T> unAdy : adyacentes) {\n if(!visitados.contains(unAdy)) {\n Arista<T> enlace = this.buscarArista(nodo.getValue(), unAdy);\n if(enlace !=null) {\n nuevaDistancia = enlace.getValor().intValue();\n }\n int distanciaHastaAdy = distancias.get(nodo.getValue()).intValue();\n int distanciaAnterior = distancias.get(unAdy).intValue();\n if(distanciaHastaAdy + nuevaDistancia < distanciaAnterior ) {\n distancias.put(unAdy, distanciaHastaAdy + nuevaDistancia);\n aVisitar.put(distanciaHastaAdy + nuevaDistancia,unAdy);\n }\n }\n } \t\t\n \t}\n \tSystem.out.println(\"DISTANCIAS DESDE \"+origen);\n \tSystem.out.println(\"Resultado: \"+distancias);\n \treturn distancias;\n }", "@Override\r\n public Double calcDistance(List<Point> src, List<Point> dst) {\r\n // Local Variables\r\n Double shortestDistance = Double.MAX_VALUE;\r\n Double currentDistance;\r\n\r\n // for each point in source\r\n for (Point p1:src) {\r\n // for each point in destination\r\n for (Point p2:dst) {\r\n // calc distance\r\n currentDistance = p1.distanceFrom(p2);\r\n\r\n // current < shortest -> update\r\n if(currentDistance < shortestDistance ){\r\n shortestDistance = currentDistance;\r\n }\r\n\r\n }\r\n }\r\n\r\n return shortestDistance;\r\n }", "void updateMin(StockNode a){\n\t\tif(minNode==null){\r\n\t\t\tminNode=a;\r\n\t\t} else {\r\n\t\t\tif(a.stockValue<minNode.stockValue){\r\n\t\t\t\tminNode=a;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int getNearbyMines(int i, int j) {\n int numberOfMines = 0;\n\n if (i > 0) { //IF there is space above\n if (game[i-1][j].equals(mine)) { //checks top\n numberOfMines++;\n }\n if (j > 0) {\n if (game[i-1][j-1].equals(mine)) { //checks top left\n numberOfMines++;\n }\n }\n if (j < column-1) {\n if ((game[i-1][j+1].equals(mine))) { //checks top right\n numberOfMines++;\n }\n }\n }\n\n if (i < row-1) { //IF there is space below\n if (game[i+1][j].equals(mine)) { //checks bottom\n numberOfMines++;\n }\n if (j > 0) {\n if (game[i+1][j-1].equals(mine)) { //checks bottom left\n numberOfMines++;\n }\n }\n if (j < column-1) {\n if (game[i+1][j+1].equals(mine)) { //checks bottom right\n numberOfMines++;\n }\n }\n }\n\n if (j > 0) { //IF there is space to the left\n if (game[i][j-1].equals(mine)) { //checks left\n numberOfMines++;\n }\n }\n if (j < column-1) { //IF there is space to the right\n if (game[i][j+1].equals(mine)) {\n numberOfMines++; //checks right\n }\n }\n return numberOfMines;\n }", "void dijkstra(int strtval){\n PriorityQueue<Integer> pq = new PriorityQueue<>(new Comparator<Integer>(){\n @Override\n public int compare(Integer i1, Integer i2){\n Node n1 = dlist.get(i1);\n Node n2 = dlist.get(i2);\n return n1.getDist() > n2.getDist()?1 : n1.getDist() < n2.getDist()? -1:0;\n }\n });\n\n Node stnode = dlist.get(strtval);\n stnode.setval(strtval);\n stnode.setDist(0);\n seen.add(strtval);\n pq.add(strtval);\n while(!pq.isEmpty()){\n strtval = pq.poll();\n LinkedList<Node> alist = grp.getOrDefault(strtval, null);\n if(alist != null){\n for(Node node : alist){\n //see distance and then decide if needs to be added to qu is not seen.\n int nval = node.getval();\n int nweg = node.getDist();\n int ddist = dlist.get(nval).getDist();\n int odist = dlist.get(strtval).getDist();\n if(ddist > odist+nweg){\n dlist.get(nval).setval(strtval);\n dlist.get(nval).setDist(odist+nweg);\n }\n //if alerady seen do not cal the distance again.\n if(!seen.contains(nval)){\n seen.add(nval);\n pq.add(nval);\n }\n }\n }\n }\n //print here:\n for(int key: dlist.keySet()){\n System.out.println(key+\" dist:\"+dlist.get(key).getDist()+\" prev:\"+dlist.get(key).getval());\n }\n }", "public void Djkstra(int source) {\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE; // added infinity to all ,\n\t\t}\n\t\t\n\t\tdist[source] = 0;\n\n\t\t// add source vertex to priority queue\n\t\tq.add(new Node(source, 0));\n\n\n\t\t// while my all vertices are not selected as a min among smallest one time\n\t\t// refracted in visited\n\t\twhile (visited.size() != vertices) {\n\n\t\t\t// pick from priority queue the smallest/min distance\n\t\t\tint i = q.remove().node;\n\n\t\t\t// once node is removed from queue add to set\n\t\t\tvisited.add(i);\n\n\t\t\t// relax adjacent vertex of this node;\n\t\t\t// And add the new node to queue bcoz distance has got updated so add new node as i dont have any method to update \n\t\t\t// already present node and its distance\n\t\t\t\n\n\t\t\tfor (Node v : graph[i]) {\n\t\t\t\tif (!visited.contains(v.node)) {\n\t\t\t\t\tif (dist[i] + v.cost < dist[v.node]) {\n\t\t\t\t\t\tdist[v.node] = dist[i] + v.cost;\n\t\t\t\t\t\tq.add(new Node(v.node, dist[v.node]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "private AStarNode getMinFScore(ArrayList<AStarNode> openSet) {\n AStarNode save = null;\n for (AStarNode neighbor : openSet) { //linear search\n if (save == null) {\n save = neighbor;\n } else {\n if (save.getFScore() > neighbor.getFScore())\n save = neighbor;\n }\n }\n return save;\n }" ]
[ "0.6862464", "0.6354226", "0.6310704", "0.62822247", "0.62309456", "0.6189486", "0.6048455", "0.6044129", "0.59392965", "0.5909016", "0.58603746", "0.5807418", "0.5783012", "0.5763171", "0.57573074", "0.57352513", "0.5734545", "0.5708995", "0.56676316", "0.5648943", "0.5626977", "0.55846786", "0.5576099", "0.55583036", "0.55477786", "0.5545789", "0.5529235", "0.55162966", "0.54876333", "0.54677814", "0.5467107", "0.54330677", "0.54171824", "0.5414072", "0.5408532", "0.5399716", "0.5397206", "0.53610855", "0.53593004", "0.53521174", "0.5338828", "0.53339314", "0.53261507", "0.5318331", "0.5304834", "0.5302933", "0.5300319", "0.52933425", "0.52916825", "0.5286617", "0.52799064", "0.5248267", "0.5225717", "0.5223908", "0.5223418", "0.52129847", "0.52122575", "0.5211686", "0.5186784", "0.5171871", "0.5159111", "0.5119112", "0.51177526", "0.5099983", "0.5097806", "0.5093265", "0.508415", "0.5082979", "0.50823355", "0.5079485", "0.50727516", "0.5072056", "0.507164", "0.5070209", "0.5069251", "0.5058435", "0.50488853", "0.50421935", "0.5041291", "0.5040985", "0.5040823", "0.5034356", "0.5034079", "0.50215703", "0.5017123", "0.50166565", "0.5015871", "0.501336", "0.5009967", "0.5007446", "0.5007364", "0.5006907", "0.5005715", "0.50053465", "0.4996135", "0.4989976", "0.49663016", "0.4965895", "0.49629128", "0.4961379" ]
0.6517766
1
creates a new cluster from two given clusters in lexicographical order
private static String createNewEntry(String minI, String minJ) { String first[] = minI.split(","); String second[] = minJ.split(","); ArrayList<Integer> arr = new ArrayList<>(); for(int i=0;i<first.length;i++) arr.add(Integer.parseInt(first[i])); for(int j=0;j<second.length;j++) arr.add(Integer.parseInt(second[j])); Collections.sort(arr); String result = arr.get(0)+""; for(int i=1;i<arr.size();i++) { result = result + "," + arr.get(i); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void makeCluster(cluster c1, cluster c2) {\n\t\tColor newC = Color.black;\n\t\twhile (true) {\n\t\t\tnewC = colors.get(rand());\n\t\t\tif (!usedcolors.contains(newC)) { // if color hasn't been used\n\t\t\t\tusedcolors.add(newC); // add color to the used colors list\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tArrayList<point> cpoints = new ArrayList<point>();\n\t\tfor (point p : c1.getPoints()) { // add points from both clusters to the new one\n\t\t\tcpoints.add(p);\n\t\t}\n\t\tfor (point p : c2.getPoints()) {\n\t\t\tcpoints.add(p);\n\t\t}\n\t\t\n\t\t// make a new cluster passing it all the points from both of the others\n\t\tcluster flurp = new cluster(cpoints, newC);\n\t\t\n\t\t// remove the two old clusters\n\t\tclusters.remove(c1); // DOUBLE CHECK THIS, MAY NEED THE CLUSTER'S INDEX\n\t\tclusters.remove(c2);\n\t\t\n\t\t// add the new cluster\n\t\tclusters.add(flurp);\n\t\t\n\t}", "public Cluster(Cluster one, Cluster two) {\n this();\n // merge locations by just averaging\n// location.x=(one.location.x+two.location.x)/2;\n// location.y=(one.location.y+two.location.y)/2;\n\n Cluster older = one.firstTimestamp < two.firstTimestamp ? one : two;\n// Cluster older=one.numEvents>two.numEvents? one:two;\n\n // merge locations by average weighted by number of events supporting cluster\n int sumEvents = one.numEvents + two.numEvents;\n location.x = (one.location.x * one.numEvents + two.location.x * two.numEvents) / (sumEvents);\n location.y = (one.location.y * one.numEvents + two.location.y * two.numEvents) / (sumEvents);\n angle = older.angle;\n cosAngle = older.cosAngle;\n sinAngle = older.sinAngle;\n averageEventDistance = (one.averageEventDistance * one.numEvents + two.averageEventDistance * two.numEvents) / sumEvents;\n averageEventXDistance = (one.averageEventXDistance * one.numEvents + two.averageEventXDistance * two.numEvents) / sumEvents;\n averageEventYDistance = (one.averageEventYDistance * one.numEvents + two.averageEventYDistance * two.numEvents) / sumEvents;\n \n lastTimestamp = one.lastTimestamp > two.lastTimestamp ? one.lastTimestamp : two.lastTimestamp;\n numEvents = sumEvents;\n firstTimestamp = older.firstTimestamp; // make lifetime the oldest src cluster\n path = older.path;\n birthLocation = older.birthLocation;\n velocityFitter = older.velocityFitter;\n velocityPPT.x = older.velocityPPT.x;\n velocityPPT.y = older.velocityPPT.y;\n velocityPPS.x = older.velocityPPS.x;\n velocityPPS.y = older.velocityPPS.y;\n velocityValid = older.velocityValid;\n// vxFilter=older.vxFilter;\n// vyFilter=older.vyFilter;\n avgEventRate = older.avgEventRate;\n avgISI = older.avgISI;\n hasObtainedSupport = older.hasObtainedSupport;\n setAspectRatio(older.getAspectRatio());\n\n// Color c1=one.getColor(), c2=two.getColor();\n setColor(older.getColor());\n// System.out.println(\"merged \"+one+\" with \"+two);\n //the radius should increase\n// setRadius((one.getRadius()+two.getRadius())/2);\n if (growMergedSizeEnabled) {\n float R = (one.getRadius() + two.getRadius()) / 2;\n setRadius(R + getMixingFactor() * R);\n } else {\n setRadius(older.getRadius());\n }\n\n }", "private void combineClusters(int index1,int index2)\n\t{\n\t\tVector <Integer> cluster1 = (Vector<Integer>)clusters.elementAt(index1);\n\t\tVector <Integer> cluster2 = (Vector<Integer>)clusters.elementAt(index2);\n\t\tVector <Integer> cluster3 = new Vector<Integer>(cluster1);\n\t\tcluster3.addAll(cluster2);\n\t\tclusters.add(cluster3);\n\t\tclusters.removeElementAt(index1);\n\t\t\n\t\t//take into account shift in indices after removal of first element\n\t\tif(index2 < index1)\n\t\t\tclusters.removeElementAt(index2);\n\t\telse\n\t\t\tclusters.removeElementAt(index2-1);\n\t\t\n\t\n\t}", "public void connectClusters() {\n\t\tif (clusters.size() == 2) { // once have only two clusters\n\t\t\tSystem.out.println(\"DONE!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tcluster close1 = clusters.get(0),\n\t\t\t\tclose2 = clusters.get(1);\n\t\tdouble closestCluster = computeDistance(close1, close2);\n\t\t\n\t\tfor (int i=0; i<clusters.size(); i++) {\n\t\t\tcluster c1 = clusters.get(i);\n\t\t\t\n\t\t\tfor (int j=0; j<clusters.size(); j++) { // go through all the clusters and find closest\n\t\t\t\tif (i!=j) {\n\t\t\t\t\tcluster c2 = clusters.get(j);\n\t\t\t\t\tdouble dist = computeDistance(c1,c2);\n\t\t\t\t\tif (dist < closestCluster) {\n\t\t\t\t\t\tclose1 = c1;\n\t\t\t\t\t\tclose2 = c2;\n\t\t\t\t\t\tclosestCluster = dist;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tmakeCluster(close1, close2);\n\t\t\n\t}", "private void clusterElements(int element1,int element2)\n\t{\n\t\tint index1 = getClusterIndex(element1);\n\t\tint index2 = getClusterIndex(element2);\n\t\t\n\t\t\n\t\tif (index1 != index2)\n\t\t\tif((index1 != -1) && (index2 != -1))\n\t\t\t\tcombineClusters(index1,index2);\n\t}", "public int[] findClusterCorrespondence(int[] idx1, int[] idx2) {\n\t\tint n = idx1.length;\n\t\tif (n != idx2.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has to have same number of elements\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find unique values in idx1 and idx2\n\t\tUniqueResult<Integer> ur_idx1 = utils.findUnique(idx1);\n\t\tUniqueResult<Integer> ur_idx2 = utils.findUnique(idx2);\n\t\tif (ur_idx1.domain.length != ur_idx2.domain.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has different number of clusters\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find Jaccard coefficient\n\t\tdouble[][] J = findJaccardIndex(idx1, idx2);\n\t\t\n\t\t// use Hungarian method - use any kind of Hungarian algorithm\n\t\tHungarianAlgorithm h = new HungarianAlgorithm();\n\t\t@SuppressWarnings(\"static-access\")\n\t\tint[][] match = h.hgAlgorithm(J, \"max\");\n\t\t\n\t\t// print match matrix\n\t\tif (verbose) {\n\t\t\tSystem.out.println(\"Hunguarian Cost Matrix\");\n\t\t\tutils.printMatrix(match);\n\t\t}\n\t\t\n\t\t// relabel the idx2\n\t\tif (verbose) System.out.println(\"Class correspondents matrix:\");\n\t\tint[] target = idx1.clone();\n\t\tfor (int i = 0; i < match.length; i++) {\n\t\t\tint idx1_index = ur_idx1.domain[match[i][0]];\n\t\t\tint idx2_index = ur_idx2.domain[match[i][1]];\n\t\t\tif (verbose) System.out.printf(\"%d\\t%d\", idx1_index, idx2_index);\t\t\t\n\t\t\tif (idx1_index != idx2_index) {\n\t\t\t\tif (verbose) System.out.printf(\"\\t(will replace all %d in idx2 by %d)\", idx2_index, idx1_index);\n\t\t\t\tboolean[] index = utils.getIndexByValue(idx2, idx2_index);\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (index[j]) target[j] = idx1_index;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (verbose) System.out.printf(\"\\n\");\n\t\t}\n\t\t\n\t\tif (verbose) {\n\t\t\tint v_tt = 15;\n\t\t\tif (target.length < v_tt) v_tt = target.length;\n\t\t\tSystem.out.printf(\"Printing first %d elements of input and output arrays\\n\", v_tt);\n\t\t\tSystem.out.printf(\"IDX1\\tIDX2\\tFINAL IDX\\n\");\n\t\t\tfor (int i = 0; i < v_tt; i++) System.out.printf(\"%d\\t%d\\t%d\\n\", idx1[i], idx2[i], target[i]);\n\t\t}\n\t\t\n\t\treturn target;\n\t}", "public double computeSimilarity(int[] cluster1, int[] cluster2);", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public int compare(Cluster cluster1, Cluster cluster2) {\n for (Node n1 : cluster1) {\n for (Node n2 : cluster2) {\n if (n1.isAncestorOf(n2)) {\n return -1;\n } else if (n2.isAncestorOf(n1)) {\n return 1;\n }\n }\n }\n return 0;\n }", "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "public void createClusters() {\n\t\t/*\n\t\t * double simAvg = documentDao.getSimilarity(avg); double simMax =\n\t\t * documentDao.getSimilarity(max); double simMin =\n\t\t * documentDao.getSimilarity(min);\n\t\t */\n\n\t\t// initClusters();\n\n\t\tList<Document> docList = documentDao.getDocumentListOrderBySimilarity();\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tint i = 0;\n\t\tCluster cluster = clusterList.get(i);\n\t\tfor (Document document : docList) {\n\t\t\twhile (document.getSimilarity() < cluster.getLow()) {\n\t\t\t\tcluster = clusterList.get(++i);\n\t\t\t}\n\t\t\tif (document.getSimilarity() < cluster.getHigh() && document.getSimilarity() >= cluster.getLow()) {\n\t\t\t\tdocument.setClusterId(cluster.getId());\n\t\t\t\tdocumentDao.insertDocument(document);\n\t\t\t}\n\t\t}\n\n\t}", "public void mergeClusters(int[] newCluster) {\n\t\tint i, j, k;\n\t\tif (cluster == null)\n\t\t\treturn;\n\t\ti = 0;\n\t\tfor (j = 0; j < nNodes; j++) {\n\t\t\tk = newCluster[cluster[j]];\n\t\t\tif (k > i)\n\t\t\t\ti = k;\n\t\t\tcluster[j] = k;\n\t\t}\n\t\tnClusters = i + 1;\n\t\tdeleteClusteringStats();\n\t}", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private void cluster() {\n\t\tint index = 0;\n\t\tfor (DataObject obj : objects) {\n\t\t\tindex = getNearestCenterIndex(obj, centers);\n\t\t\tclusters.get(index).add(obj);\n\t\t}\n\t}", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "public float compare(Cluster other) {\n \treturn compare(center, other.center);\n }", "public static Clusters convertToClusters(Graph clusterGraph, List<Node> measuredVariables) {\n List<String> latents = new ArrayList<String>();\n Clusters clusters = new Clusters();\n\n for (Node node : clusterGraph.getNodes()) {\n if (!measuredVariables.contains(node)) {\n// if (node.getNodeType() == NodeType.LATENT) {\n latents.add(node.getName());\n }\n }\n\n Collections.sort(latents);\n\n for (int i = 0; i < latents.size(); i++) {\n String name = latents.get(i);\n clusters.setClusterName(i, name);\n Node latent = clusterGraph.getNode(name);\n List<Node> measured =\n clusterGraph.getNodesOutTo(latent, Endpoint.ARROW);\n\n for (Node _node : measured) {\n if (measuredVariables.contains(_node)) {\n// if (!(_node.getNodeType() == NodeType.LATENT)) {\n clusters.addToCluster(i, _node.getName());\n }\n }\n }\n\n return clusters;\n }", "private void partitionImpl(Collection<S> vocab, HashMap<Dimension<T>, MutableDouble> center) {\n double firstVal = Double.POSITIVE_INFINITY;\n double secondVal = Double.POSITIVE_INFINITY;\n S firstWord = null;\n S secondWord = null;\n\n LinkedList<S> cluster1 = new LinkedList<S>();\n LinkedList<S> cluster2 = new LinkedList<S>();\n HashMap<Dimension<T>, MutableDouble> newCenter1 = null;\n HashMap<Dimension<T>, MutableDouble> newCenter2 = null;\n\n if (vocab.size() > 2) {\n for (S word : vocab) {\n double dist = distanceToCenter(word, center);\n if (dist < secondVal) {\n if (dist < firstVal) {\n secondVal = firstVal;\n secondWord = firstWord;\n firstVal = dist;\n firstWord = word;\n } else {\n secondVal = dist;\n secondWord = word;\n }\n }\n }\n if (distance(firstWord, secondWord) <= 0.0) {\n System.out.printf(\"zero distance between '%s' and '%s'\\n\", firstWord, secondWord);\n // pick an arbitrary second word\n for (S word : vocab) {\n if (word.equals(firstWord) || word.equals(secondWord)) {\n continue;\n }\n if (distance(firstWord, word) > 0.0) {\n secondWord = word;\n break;\n }\n }\n System.out.printf(\"selected '%s' and '%s'\\n\", firstWord, secondWord);\n }\n\n HashMap<Dimension<T>, MutableDouble> center1 = wordToVector(firstWord);\n HashMap<Dimension<T>, MutableDouble> center2 = wordToVector(secondWord);\n for (S word : vocab) {\n double dist1 = distanceToCenter(word, center1);\n double dist2 = distanceToCenter(word, center2);\n if (dist1 < dist2) {\n cluster1.add(word);\n } else {\n cluster2.add(word);\n }\n }\n\n int changed = 1;\n int iteration = 0;\n while (++iteration <= MAX_ITERATIONS && changed > 0) {\n System.out.printf(\"Iteration %d/%d\\n\", iteration, MAX_ITERATIONS);\n changed = 0;\n newCenter1 = getCenter(cluster1);\n newCenter2 = getCenter(cluster2);\n\n LinkedList<S> tmpCluster1 = new LinkedList<S>();\n LinkedList<S> tmpCluster2 = new LinkedList<S>();\n\n for (ListIterator<S> it = cluster1.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist1 <= dist2) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n changed++;\n System.out.printf(\"changing %s : %g > %g\\n\", word, dist1, dist2);\n }\n }\n\n for (ListIterator<S> it = cluster2.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist2 <= dist1) {\n tmpCluster2.add(word);\n } else {\n tmpCluster1.add(word);\n changed++;\n System.out.printf(\"changing %s : %g < %g\\n\", word, dist1, dist2);\n }\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n System.out.printf(\"changed: %d/%d\\n\", changed, vocab.size());\n if (cluster1.size() == 0 || cluster2.size() == 0) {\n LinkedList<S> cl = cluster1.size() == 0 ? cluster2 : cluster1;\n System.out.printf(\"Cannot split %s, split them randomly\\n\", cl.toString());\n tmpCluster1 = new LinkedList<S>();\n tmpCluster2 = new LinkedList<S>();\n boolean b = true;\n for (S word : cl) {\n if (b) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n }\n b = !b;\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n }\n }\n } else if (vocab.size() == 2) {\n Iterator<S> it = vocab.iterator();\n S word1 = it.next();\n S word2 = it.next();\n cluster1.add(word1);\n cluster2.add(word2);\n newCenter1 = wordToVector(word1);\n newCenter2 = wordToVector(word2);\n } else {\n return;\n }\n\n if (notifyNewCluster(vocab, cluster1, cluster2)) {\n partition(cluster1, newCenter1);\n partition(cluster2, newCenter2);\n }\n\n }", "private static int getClusterCorrespondance(Integer cl1, Integer cl2,\n HashMap<Integer, HashMap<Integer, Integer>> clusterCorresp, int nextId)\n{\n HashMap<Integer, Integer> map = clusterCorresp.get(cl1);\n if (map == null) {\n map = new HashMap<Integer, Integer>();\n map.put(cl2, nextId);\n clusterCorresp.put(cl1, map);\n return nextId;\n }\n Integer corresp = map.get(cl2);\n if (corresp == null) {\n map.put(cl2, nextId);\n return nextId;\n }\n return corresp.intValue();\n}", "private static double intraClusterScore(List<String> arg1, List<String> arg2) {\n\t\t// compare each elements from argList1 vs argList2\n\n\t\tPair<String, String> pair = null;\n\t\tdouble tempScore = 0;\n\t\tdouble maxScore = 0;\n\n\t\tfor (int list1Id = 0; list1Id < arg1.size(); list1Id++) {\n\t\t\tfor (int list2Id = 0; list2Id < arg2.size(); list2Id++) {\n\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(arg1.get(list1Id)\n\t\t\t\t\t\t.trim(), arg2.get(list2Id).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(arg2.get(\n\t\t\t\t\t\t\t\tlist2Id).trim(), arg1.get(list1Id).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(\" temp score = \" + tempScore);\n\t\t\t\tmaxScore = (tempScore > maxScore) ? tempScore : maxScore;\n\t\t\t}\n\t\t}\n\n\t\t// System.out.println(\"max = \" + maxScore);\n\t\treturn maxScore;\n\t}", "private void categoriseNodes(final CyNetwork result, final Set<CyNode> leftSet,\n\t\t\t\t final Set<CyNode> rightSet)\n\t{\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig1 = new HashSet<CyNode>(network1.nodesList());\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig2 = new HashSet<CyNode>(network2.nodesList());\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal List<CyNode> resultNodes = (List<CyNode>)result.nodesList();\n\t\t\n\t\tfinal CyAttributes nodeAttr = Cytoscape.getNodeAttributes();\n\t\t\n\t\tfor (final CyNode node : resultNodes) {\n\t\t\tfinal boolean inNetwork1 = orig1.contains(node);\n\t\t\tfinal boolean inNetwork2 = orig2.contains(node);\n\t\t\t\n\t\t\tif (inNetwork1 && inNetwork2)\n\t\t\t\t/* Do Nothing. */;\n\t\t\telse if (inNetwork1 && !inNetwork2) {\n\t\t\t\tleftSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network1.getTitle());\n\t\t\t} else if (!inNetwork1 && inNetwork2) {\n\t\t\t\trightSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network2.getTitle());\n\t\t\t} else // This should never happen!\n\t\t\t\tthrow new IllegalStateException(\"Do not know how to categorise a node!\");\n\t\t}\n\t}", "private DataForSingleCluster[] clusterInstances(Instances i1, Instances i2) {\n DataForSingleCluster[] toReturn =\n new DataForSingleCluster[OCCTFineGrainedJaccardSplitModel.NUM_OF_CLUSTERS];\n // Make a single instances object in order to run the clustering algorithm with it\n Instances joinedInstances = this.joinInstances(i1, i2);\n // TODO: Maybe allow various clustering algorithms\n SimpleKMeans kMeansClusterer = new SimpleKMeans();\n try {\n // Build the clusterer using the joined instances\n kMeansClusterer.setNumClusters(OCCTFineGrainedJaccardSplitModel.NUM_OF_CLUSTERS);\n kMeansClusterer.buildClusterer(joinedInstances);\n // Initialize the array to return\n for (int i = 0; i < toReturn.length; ++i) {\n toReturn[i] = new DataForSingleCluster(i);\n }\n // Now, go over all the instances and separate them according their clustering result\n this.clusterSingleInstances(i1, true, kMeansClusterer, toReturn);\n this.clusterSingleInstances(i2, false, kMeansClusterer, toReturn);\n } catch (Exception e) {\n // TODO: What should we do in this case?\n e.printStackTrace();\n System.exit(-1);\n }\n return toReturn;\n }", "private List<SquareNode> createCluster(boolean skip, int ...levels ) {\n\n\t\tint total = 0;\n\t\tfor (int i = 0; i < levels.length; i++) {\n\t\t\ttotal += levels[i];\n\t\t}\n\n\t\tList<SquareNode> out = new ArrayList<>();\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tout.add( new SquareNode());\n\t\t\tout.get(i).graph = SquareNode.RESET_GRAPH;\n\t\t\tout.get(i).square = new Polygon2D_F64(4);\n\t\t}\n\n\t\tint previous = 0;\n\t\tfor (int i = 0; i < levels.length-1; i++) {\n\t\t\tint current = previous + levels[i];\n\t\t\tint next = current + levels[i + 1];\n\t\t\tfor (int a = 0; a < levels[i]; a++) {\n\t\t\t\tSquareNode n = out.get(previous + a);\n\n\t\t\t\tint right = skip ? current + a + 1 : current + a;\n\t\t\t\tint left = right - 1;\n\n\t\t\t\tif (right < next)\n\t\t\t\t\tconnect(n, 2, out.get(right), 0);\n\t\t\t\tif (left >= current) {\n\t\t\t\t\tconnect(n, 3, out.get(left), 1);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tprevious = current;\n\t\t\tskip = !skip;\n\t\t}\n\n\t\treturn out;\n\t}", "protected List<Node> makeWordSubCluster(List<Node> cluster, String word) {\n List<Node> sub = new ArrayList<Node>();\n for (Node n : cluster) {\n if (n.getWord().getSpelling().equals(word)) {\n sub.add(n);\n }\n }\n return sub;\n }", "void unionTreeCoreset(int k,int n_1,int n_2,int d, Point[] setA,Point[] setB, Point[] centres, MTRandom clustererRandom) {\n\t\t//printf(\"Computing coreset...\\n\");\n\t\t//total number of points\n\t\tint n = n_1+n_2;\n\n\t\t//choose the first centre (each point has the same probability of being choosen)\n\t\t\n\t\t//stores, how many centres have been choosen yet\n\t\tint choosenPoints = 0; \n\t\t\n\t\t//only choose from the n-i points not already choosen\n\t\tint j = clustererRandom.nextInt(n-choosenPoints); \n\n\t\t//copy the choosen point\n\t\tif(j < n_1){\n\t\t\t//copyPointWithoutInit(&setA[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setA[j].clone();\n\t\t} else {\n\t\t\tj = j - n_1;\n\t\t\t//copyPointWithoutInit(&setB[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setB[j].clone();\n\t\t}\n\t\ttreeNode root = new treeNode(setA,setB,n_1,n_2, centres[choosenPoints],choosenPoints); //??\n\t\tchoosenPoints = 1;\n\t\t\n\t\t//choose the remaining points\n\t\twhile(choosenPoints < k){\n\t\t\tif(root.cost > 0.0){\n\t\t\t\ttreeNode leaf = selectNode(root, clustererRandom);\n\t\t\t\tPoint centre = chooseCentre(leaf, clustererRandom);\n\t\t\t\tsplit(leaf,centre,choosenPoints);\n\t\t\t\t//copyPointWithoutInit(centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = centre;\n\t\t\t} else {\n\t\t\t\t//create a dummy point\n\t\t\t\t//copyPointWithoutInit(root.centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = root.centre;\n\t\t\t\tint l;\n\t\t\t\tfor(l=0;l<root.centre.dimension;l++){\n\t\t\t\t\tcentres[choosenPoints].coordinates[l] = -1 * 1000000;\n\t\t\t\t}\n\t\t\t\tcentres[choosenPoints].id = -1;\n\t\t\t\tcentres[choosenPoints].weight = 0.0;\n\t\t\t\tcentres[choosenPoints].squareSum = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\tchoosenPoints++;\n\t\t}\n\n\t\t//free the tree\n\t\tfreeTree(root);\n\n\t\t//recalculate clustering features\n\t\tint i;\n\t\tfor(i=0;i<n;i++){\n\t\t\t\t\n\t\t\tif(i < n_1) {\n\t\t\t\t\n\t\t\t\tint index = setA[i].centreIndex;\n\t\t\t\tif(centres[index].id != setA[i].id){\n\t\t\t\t\tcentres[index].weight += setA[i].weight;\n\t\t\t\t\tcentres[index].squareSum += setA[i].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setA[i].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setA[i].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tint index = setB[i-n_1].centreIndex;\n\t\t\t\tif(centres[index].id != setB[i-n_1].id){\n\t\t\t\t\tcentres[index].weight += setB[i-n_1].weight;\n\t\t\t\t\tcentres[index].squareSum += setB[i-n_1].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setB[i-n_1].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setB[i-n_1].coordinates[l];\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\tpublic int compareTo(Cluster o) {\n\t\treturn 0;\n\t}", "public Set<String> LCS(String instance1, String instance2)\r\n\t{\r\n\t\tSet<String> parents1 = new HashSet<String>();\t\r\n\t\tfor(Iterator<String> iter = listBelongingClasses(instance1);iter.hasNext(); )\r\n\t\t\tparents1.add(iter.next());\r\n\t\t\r\n\r\n\t\tSet<String> parents2 = new HashSet<String>();\t\r\n\t\tfor(Iterator<String> iter = listBelongingClasses(instance2);iter.hasNext(); )\r\n\t\t\tparents2.add(iter.next());\t\r\n\t\t\r\n\t\tSet<String> res = new HashSet<String>();\r\n\t\tint maxProf = Integer.MIN_VALUE;\r\n\t\t\r\n\t\tparents1.retainAll(parents2);\r\n\t\tfor(String c: parents1)\r\n\t\t{\r\n\t\t\tint pc = this.profConcept(c);\r\n\t\t\tif(pc>maxProf)\r\n\t\t\t{\r\n\t\t\t\tres.clear();\r\n\t\t\t\tres.add(c);\r\n\t\t\t\tmaxProf = pc;\r\n\t\t\t}\r\n\t\t\telse if(pc==maxProf)\r\n\t\t\t{\r\n\t\t\t\tres.add(c);\r\n\t\t\t\tmaxProf = pc;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn res;\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\tSet<String> res = new HashSet<String>();\r\n\t\t\r\n\t\tSet<String> sc1 = new HashSet<String>();\t\r\n\t\tfor(Iterator<String> iter = listDeclaredBelongingClasses(instance1);iter.hasNext(); )\r\n\t\t\tsc1.add(iter.next());\r\n\t\t\r\n\t\tSet<String> sc2 = new HashSet<String>();\t\r\n\t\tfor(Iterator<String> iter = listDeclaredBelongingClasses(instance2);iter.hasNext(); )\r\n\t\t\tsc2.add(iter.next());\r\n\t\t\r\n\t\tSet<String> inter = new HashSet<String>(sc1);\r\n\t\tinter.retainAll(sc2);\r\n\t\t\r\n\t\tres.addAll(inter);\r\n\t\t\r\n\t\tsc1.removeAll(inter);\r\n\t\tsc2.removeAll(inter);\r\n\t\t\r\n\t\t\r\n\t\tSet<String> sparentsc1 = new HashSet<String>();\r\n\t\tSet<String> sparentsc2 = new HashSet<String>();\r\n\r\n\t\twhile(!sc1.isEmpty() && !sc2.isEmpty())\r\n\t\t{\r\n\t\t\t\r\n\t\t\tfor(String c1: sc1)\r\n\t\t\t{\r\n\t\t\t\tIterator<String> iter = listSuperClasses(c1, true);\r\n\t\t\t\tif(iter != null)\r\n\t\t\t\t\twhile(iter.hasNext())\r\n\t\t\t\t\t\tsparentsc1.add(iter.next());\r\n\t\t\t}\r\n\t\t\tfor(String c2: sc2)\r\n\t\t\t{\r\n\t\t\t\tIterator<String> iter = listSuperClasses(c2, true);\r\n\t\t\t\tif(iter != null)\r\n\t\t\t\t\twhile(iter.hasNext())\r\n\t\t\t\t\t\tsparentsc2.add(iter.next());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tinter.clear();\r\n\t\t\tinter.addAll(sparentsc1);\r\n\t\t\tinter.retainAll(sparentsc2);\r\n\t\t\t\r\n\t\t\tres.addAll(inter);\r\n\t\t\tsparentsc1.removeAll(inter);\r\n\t\t\tsparentsc2.removeAll(inter);\r\n\t\t\t\r\n\t\t\tsc1 = new HashSet<String>(sparentsc1);\r\n\t\t\tsc2 = new HashSet<String>(sparentsc2);\r\n\t\t}\r\n\t\treturn inter;\r\n\t\t*/\r\n\t}", "private Map<double[], Set<String>> initiateClusters(int k, Set<String> restaurantIDs) {\n // centroids[0] is lattitude and centroids[1] is longitude for a centroid\n // Map assigns restaurants to a specific centroid\n Map<double[], Set<String>> restaurantClusters = new HashMap<double[], Set<String>>();\n\n // Find the min and max latitudes and longitudes\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n\n for (String rID : restaurantIDs) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n\n // Create a number of centroids equal to k\n for (int i = 0; i < k; i++) {\n // generate random centroid based on min and max latitudes\n // and longitudes, with (currently) no assigned restaurants\n HashSet<String> emptySet = new HashSet<String>();\n restaurantClusters.put(this.generateRandomCentroid(minLat, maxLat, minLon, maxLon), emptySet);\n }\n\n // Assign each restaurant to its closest centroid\n\n for (String rID : restaurantIDs) {\n\n double[] newCentroid = null;\n double minDist = Double.MAX_VALUE;\n\n for (double[] centroid : restaurantClusters.keySet()) {\n double distance = this.computeDistance(centroid, this.restaurantMap.get(rID));\n if (distance < minDist) {\n newCentroid = centroid;\n minDist = distance;\n }\n }\n restaurantClusters.get(newCentroid).add(rID);\n }\n return restaurantClusters;\n }", "@Test\r\n public void testGroupSimilarity() throws Exception {\r\n final List<ICluster> originalCLuster = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster);\r\n List<ICluster> l1 = new ArrayList<ICluster>(originalCLuster);\r\n\r\n final List<ICluster> originalCLuster2 = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster2);\r\n List<ICluster> l2 = new ArrayList<ICluster>(originalCLuster2);\r\n\r\n ClusterListSimilarity cd = new ClusterListSimilarity(distanceMeasure);\r\n final List<ICluster> identical = cd.identicalClusters(l1, l2);\r\n\r\n Assert.assertEquals(originalCLuster.size(), identical.size());\r\n Assert.assertTrue(l1.isEmpty());\r\n Assert.assertTrue(l2.isEmpty());\r\n }", "public void insertCluster(int tick, Set<Integer> ids) {\n\n }", "private ITaskCluster createTaskCluster(ITaskObject... taskObjects) {\n ITaskCluster taskCluster = getTaskManagerConfiguration().getTaskFactory().newTaskCluster();\n taskCluster = getTaskManagerConfiguration().getTaskManagerWriter().saveNewTaskCluster(taskCluster);\n\n return createTaskGraphForTaskCluster(taskCluster, taskObjects);\n }", "public static void main(String[] args) throws Exception{\n\t\t\n\t\tSystem.out.println(\"Clustering started\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tArrayList<SyntacticCluster> clusters = (ArrayList<SyntacticCluster>) MinerUtil\n\t\t\t\t.deserialize(\"all_cluster\", false);\n\t\t//ArrayList<SyntacticCluster> allList = allCluster.doClustering();\n\n\t\tArrayList<SemanticCluster> semanticClusterList = new SemanticClusteringer().doClustering(clusters);\n\t\tfor (SemanticCluster semC : semanticClusterList) {\n\t\t\tfor (ICluster clus : semC.getUnits()) {\n\t\t\t\tSyntacticCluster synC = (SyntacticCluster) clus;\n\t\t\t\tsynC.doInnerClustering();\n\t\t\t\t// System.out.print(\"\");\n\t\t\t}\n\t\t\t// System.out.print(\"\");\n\t\t}\n\t\tSystem.out.println(\"Clustering finished\");\n\t\tLogger.log2(semanticClusterList, \"syntactic_semantic_clustering\");\n\t\t\n\t\tCloneSets sets = semanticClusterList.get(0).getUnits().get(0).getCloneSets().get(0).getCloneSets();\n\t\t\n\t\tMinerUtil.serialize(semanticClusterList, \"semantic_clusters\", false);\n\t\tMinerUtil.serialize(sets, \"sets\", false);\n\t\t//ConsoleFormatter.displayClusters(clustersByTopic);\n\t}", "private void doClustering(double[][] data, String[] names) {\n\t\ttry {\n\t\t\tClusteringAlgorithm algorithm = new DefaultClusteringAlgorithm();\n\t\t\tCluster cluster = algorithm.performClustering(data, names, new AverageLinkageStrategy());\n\t\t\tparentCluster = cluster;\n\t\t\tfillClusteredOrderedDataFromChildren(cluster);\n\t\t}catch(Exception e){\n\t\t\tJOptionPane.showMessageDialog(null, \"Duplicate identifiers found, the feature names should be unique\", \"Clustering error\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t}", "void add(Cluster c){\n Set<Cluster> tempC = new TreeSet<Cluster>();\n for(Cluster i: C)\n tempC.add(i);\n tempC.add(c);\n C = tempC;\n }", "@Override\n protected DataSet<GraphHead> computeNewGraphHeads() {\n return firstCollection.getGraphHeads()\n .union(secondCollection.getGraphHeads())\n .groupBy(new Id<GraphHead>())\n .reduceGroup(new GroupCountEquals<GraphHead>(2));\n }", "public Clustering splitCluster(Clustering inputClustering, List<Point2D> newRepresentatives,\n\t\t\tint splittingClusterIndex, int splittingClusterIndex2) {\n\t\tthis.inputClustering = new Clustering(inputClustering.getCluster(splittingClusterIndex), ClusterType.CLUSTERED,\n\t\t\t\t-1);\n\t\tkNumber = newRepresentatives.size() / 2;\n\t\tcentroids = newRepresentatives.subList(0, 2);\n\t\tbasicIterations = 0;\n\t\tbaseAlgorithm();\n\n\t\ttotalIterations = basicIterations;\n\t\tbasicIterations = 0;\n\t\tlong runtime = basicRuntime;\n\t\tList<Cluster> clustersToSplit = clustering.getClusters();\n\n\t\tthis.inputClustering = new Clustering(inputClustering.getCluster(splittingClusterIndex2), ClusterType.CLUSTERED,\n\t\t\t\t-1);\n\t\tcentroids = newRepresentatives.subList(2, 4);\n\t\tbasicIterations = 0;\n\t\tbaseAlgorithm();\n\n\t\ttotalIterations += basicIterations;\n\t\tbasicIterations = 0;\n\t\truntime += basicRuntime;\n\t\tinputClustering.replaceSplittedCluster(splittingClusterIndex, splittingClusterIndex2, clustersToSplit,\n\t\t\t\tclustering.getClusters());\n\n\t\tkNumber = inputClustering.getSize();\n\t\tthis.inputClustering = inputClustering;\n\t\tcentroids = inputClustering.getCentroids();\n\t\tbaseAlgorithm();\n\n\t\ttotalIterations += basicIterations;\n\t\tbasicRuntime += runtime;\n\t\treturn clustering;\n\t}", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "public CreateClusterRequest(CreateClusterRequest source) {\n if (source.ClusterName != null) {\n this.ClusterName = new String(source.ClusterName);\n }\n if (source.ClusterType != null) {\n this.ClusterType = new String(source.ClusterType);\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.ClusterCIDR != null) {\n this.ClusterCIDR = new String(source.ClusterCIDR);\n }\n if (source.ClusterDesc != null) {\n this.ClusterDesc = new String(source.ClusterDesc);\n }\n if (source.TsfRegionId != null) {\n this.TsfRegionId = new String(source.TsfRegionId);\n }\n if (source.TsfZoneId != null) {\n this.TsfZoneId = new String(source.TsfZoneId);\n }\n if (source.SubnetId != null) {\n this.SubnetId = new String(source.SubnetId);\n }\n if (source.ClusterVersion != null) {\n this.ClusterVersion = new String(source.ClusterVersion);\n }\n if (source.MaxNodePodNum != null) {\n this.MaxNodePodNum = new Long(source.MaxNodePodNum);\n }\n if (source.MaxClusterServiceNum != null) {\n this.MaxClusterServiceNum = new Long(source.MaxClusterServiceNum);\n }\n if (source.ProgramId != null) {\n this.ProgramId = new String(source.ProgramId);\n }\n if (source.KuberneteApiServer != null) {\n this.KuberneteApiServer = new String(source.KuberneteApiServer);\n }\n if (source.KuberneteNativeType != null) {\n this.KuberneteNativeType = new String(source.KuberneteNativeType);\n }\n if (source.KuberneteNativeSecret != null) {\n this.KuberneteNativeSecret = new String(source.KuberneteNativeSecret);\n }\n if (source.ProgramIdList != null) {\n this.ProgramIdList = new String[source.ProgramIdList.length];\n for (int i = 0; i < source.ProgramIdList.length; i++) {\n this.ProgramIdList[i] = new String(source.ProgramIdList[i]);\n }\n }\n }", "protected Cluster makeWordSubCluster(Cluster cluster, String word) {\n List<Node> l = makeWordSubCluster(cluster.elements, word);\n Cluster c = new Cluster(cluster.startTime, cluster.endTime);\n c.elements = l;\n return c;\n }", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "public Cluster(Point minPoint, Point maxPoint) {\n\t\tthis.minPoint = minPoint;\n\t\tthis.maxPoint = maxPoint;\n\t}", "public Cluster(Cluster source) {\n if (source.ClusterId != null) {\n this.ClusterId = new String(source.ClusterId);\n }\n if (source.ClusterName != null) {\n this.ClusterName = new String(source.ClusterName);\n }\n if (source.ClusterType != null) {\n this.ClusterType = new String(source.ClusterType);\n }\n if (source.ClusterTag != null) {\n this.ClusterTag = new String(source.ClusterTag);\n }\n if (source.Zone != null) {\n this.Zone = new String(source.Zone);\n }\n if (source.Network != null) {\n this.Network = new String(source.Network);\n }\n if (source.MaxConn != null) {\n this.MaxConn = new Long(source.MaxConn);\n }\n if (source.MaxInFlow != null) {\n this.MaxInFlow = new Long(source.MaxInFlow);\n }\n if (source.MaxInPkg != null) {\n this.MaxInPkg = new Long(source.MaxInPkg);\n }\n if (source.MaxOutFlow != null) {\n this.MaxOutFlow = new Long(source.MaxOutFlow);\n }\n if (source.MaxOutPkg != null) {\n this.MaxOutPkg = new Long(source.MaxOutPkg);\n }\n if (source.MaxNewConn != null) {\n this.MaxNewConn = new Long(source.MaxNewConn);\n }\n if (source.HTTPMaxNewConn != null) {\n this.HTTPMaxNewConn = new Long(source.HTTPMaxNewConn);\n }\n if (source.HTTPSMaxNewConn != null) {\n this.HTTPSMaxNewConn = new Long(source.HTTPSMaxNewConn);\n }\n if (source.HTTPQps != null) {\n this.HTTPQps = new Long(source.HTTPQps);\n }\n if (source.HTTPSQps != null) {\n this.HTTPSQps = new Long(source.HTTPSQps);\n }\n if (source.ResourceCount != null) {\n this.ResourceCount = new Long(source.ResourceCount);\n }\n if (source.IdleResourceCount != null) {\n this.IdleResourceCount = new Long(source.IdleResourceCount);\n }\n if (source.LoadBalanceDirectorCount != null) {\n this.LoadBalanceDirectorCount = new Long(source.LoadBalanceDirectorCount);\n }\n if (source.Isp != null) {\n this.Isp = new String(source.Isp);\n }\n if (source.ClustersZone != null) {\n this.ClustersZone = new ClustersZone(source.ClustersZone);\n }\n if (source.ClustersVersion != null) {\n this.ClustersVersion = new String(source.ClustersVersion);\n }\n if (source.DisasterRecoveryType != null) {\n this.DisasterRecoveryType = new String(source.DisasterRecoveryType);\n }\n }", "private double intersection(HardClustering hard1, int comm1,\n HardClustering hard2, int comm2) {\n final TIntArrayList duplicate = new TIntArrayList(hard1.members(comm1));\n duplicate.retainAll(hard2.members(comm2));\n\n return duplicate.size();\n }", "public void addCluster()\r\n\t{\r\n\t\tcluster[nextAvailableCluster()] = true;\r\n\t}", "void formCluster(Set<ControllerNode> nodes, String ipPrefix);", "public static void main(String[] args) {\n\t\tLL l1 = new LL();\n\t\tLL l2 = new LL();\n\t\tl1.insert(15);\n\t\tl1.insert(25);\n\t\tl1.insert(35);\n\t\tl1.insert(45);\n\t\tl1.insert(55);\n\t\t\n\t\tl2.insert(10);\n\t\tl2.insert(17);\n\t\tl2.insert(35);\n\t\tl2.insert(47);\n\t\tl2.insert(11);\n\t \t\n\t\t\n//\t\tl1.print();\n//\t\tl2.print();\n\t\t\n\t\tSystem.out.println(getIntersection(l1.head,l2.head));\n\t\t\n\t}", "public static ArrayList<ImageSegmentEdge> singleLinkCluster(ArrayList<ImageSegmentEdge> edges,\n int nodes, int k) {\n Collections.sort(edges);\n int[] nodeIndexes = IntStream.range(0, nodes).toArray();\n UnionFind uf = new UnionFind(nodeIndexes);\n\n return edges.stream()\n .filter(edge -> uf.union(edge.getA(), edge.getB()))\n .limit(nodes - k)\n .collect(Collectors.toCollection(ArrayList::new));\n }", "public Clustering cluster(int kNumber, Clustering inputClustering, List<Point2D> centroids) {\n\t\tthis.inputClustering = inputClustering;\n\t\tthis.kNumber = kNumber;\n\t\tthis.centroids = centroids;\n\t\tbasicIterations = 0;\n\t\tbaseAlgorithm();\n\t\ttotalIterations = basicIterations;\n\t\treturn clustering;\n\t}", "void renewNeighbourClusters() {\n neighbourClusters = new HashMap<Cluster, Integer>();\n\n for (Person p : members) {\n for (Person x : p.getFriends()) {\n if (!members.contains(x)) {\n Cluster xC = x.getCluster();\n if (!neighbourClusters.containsKey(xC)) {\n neighbourClusters.put(xC, 1);\n } else {\n neighbourClusters.put(xC, neighbourClusters.get(xC) + 1);\n }\n }\n }\n }\n\n }", "ClusterSet() {\n }", "public ArrayList<Cluster> mergeBestCluster(int pDistancia,int pMetrica,int k, int clustN)\n\t{\n\t\tcalculateDistances(pDistancia, pMetrica, k);\n\t\tDistance dist = distanceList.getFirst();\n\t\tArrayList<Cluster> clustArray;\n\t\tclustArray = (ArrayList<Cluster>) clusterList.clone();\n\t\tclustArray.remove(dist.getCluster1());\n\t\tclustArray.remove(dist.getCluster2());\n\t\t\n\t\tCluster clust = new Cluster(clustN, dist.mergerInstances() , dist.getCluster1(), dist.getCluster2(), iterationName);\n\t\t//Añadimos el nuevo cluster (El unido) a la nuevalista de clusters\n\t\tclustArray.add(clustArray.size(),clust);\n\t\t\n\t\treturn clustArray;\n\t}", "@Override\n\tpublic List<ClusteredMention> runCoreference(Document doc) {\n\t\t//(variables)\n\t\t//Put all in one hash, then build at the end....\n\t\tMap<Mention,Mention> corefs = new HashMap<Mention,Mention>();\n\t\t//if mention isnt in corefs, add it as a singleton cluster\n\t\t//Otherwise markcoref, and add to clusters\n\t\t\n\t\tMap<String,Mention> stringMatches = new HashMap<String,Mention>();\n\t\t//Map of string to mention...\n\t\t\n\t\t//Map<Mention,Entity> pronounClusters = new HashMap<Mention,Entity>();\n\t\tboolean clustered;\n\t\t//Evaluate all non pronoun mentions\n\t\tfor(Mention m : doc.getMentions()){\n\t\t\tclustered = false;\n\t\t\t//(...get its text)\n\t\t\tString mentionString = m.gloss();\n\t\t\t//If its not a pronoun\n\t\t\tif (!checkPronoun(m.headWord(),m.headToken())) {\n\t\t\t\t//(...if we've seen this text before...)\n\t\t\t\tif(stringMatches.containsKey(mentionString)){\n\t\t\t\t\t//Mark coreferent\n\t\t\t\t\tcorefs.put(m,stringMatches.get(mentionString));\n\t\t\t\t\tclustered=true;\n\t\t\t\t} else {\n\t\t\t\t\t//try to find a head word match to m's head word\n\t\t\t\t\t//(for each previous mention...)\n\t\t\t\t\tfor (int i=doc.indexOfMention(m)-1; i>=0 && !clustered;i--) {\n\t\t\t\t\t\tMention h = doc.getMentions().get(i);\n\t\t\t\t\t\tString otherMention = h.gloss();\n\t\t\t\t\t\t//If head words are identical, or head words are coreferent\n\t\t\t\t\t\tif (m.headWord().equalsIgnoreCase(h.headWord()) || \n\t\t\t\t\t\t\t\t(coreferentHeads.containsKey(m.headWord()) && \n\t\t\t\t\t\t\t\t\t\tcoreferentHeads.get(m.headWord()).contains(h.headWord()))) {\n\t\t\t\t\t\t\t//Mark as coreferent\n\t\t\t\t\t\t\tstringMatches.put(mentionString, m);\n\t\t\t\t\t\t\tcorefs.put(m,stringMatches.get(otherMention));\n\t\t\t\t\t\t\tclustered=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!clustered){\n\t\t\t\t\t//(...else create a new singleton cluster)\n\t\t\t\t\tstringMatches.put(mentionString, m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(Mention m : doc.getMentions()){\n\t\t\t//If it is a pronoun of interest\n\t\t\tif (checkPronoun(m.headWord(),m.headToken())) {\n\t\t\t\tMention hco = hobbsCoreferent(m);\n\t\t\t\tif (hco!=null && !hco.equals(m)){\n\t\t\t\t\tString hcoString = hco.gloss();\n\t\t\t\t\t//System.out.printf(\"Found coreference %s\\n\", hcoString);\n\t\t\t\t\tif (stringMatches.containsKey(hcoString)){\n\t\t\t\t\t\t//mentions.add(m.markCoreferent(stringClusters.get(hcoString)));\n\t\t\t\t\t\tcorefs.put(m,stringMatches.get(hcoString));\n\t\t\t\t\t} else{\n\t\t\t\t\t\t//Add as coreferent\n\t\t\t\t\t\tcorefs.put(m, hco);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\n\t\t//Build list of mentions\n\t\tList<ClusteredMention> cMentions = new ArrayList<ClusteredMention>();\n\t\tMap<Mention,ClusteredMention> clusters = new HashMap<Mention,ClusteredMention>();\n\t\tList<Mention> mentions = new ArrayList<Mention>(doc.getMentions());\n\t\twhile (!mentions.isEmpty()){\n\t\t\tMention m = mentions.get(0);\n\t\t\tif (corefs.containsKey(m) && corefs.get(m)!=null){\n\t\t\t\tMention h = corefs.get(m);\n\t\t\t\tif(!clusters.containsKey(h)) {\n\t\t\t\t\tint hIndex = mentions.indexOf(h);\n\t\t\t\t\tmentions.set(0, h);\n\t\t\t\t\tmentions.set(hIndex,m);\n\t\t\t\t\tif (hIndex > 0){\n\t\t\t\t\t\tClusteredMention newCluster = h.markSingleton();\n\t\t\t\t\t\tcMentions.add(newCluster);\n\t\t\t\t\t\tmentions.remove(hIndex);\n\t\t\t\t\t\tclusters.put(h,newCluster);\n\t\t\t\t\t\tcMentions.add(m.markCoreferent(clusters.get(h)));\n\t\t\t\t\t\tmentions.remove(0);\n\t\t\t\t\t\tclusters.put(m,clusters.get(h));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\tcMentions.add(m.markCoreferent(clusters.get(h)));\n\t\t\t\tmentions.remove(0);\n\t\t\t\tclusters.put(m,clusters.get(h));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tClusteredMention newCluster = m.markSingleton();\n\t\t\t\tcMentions.add(newCluster);\n\t\t\t\tmentions.remove(0);\n\t\t\t\tclusters.put(m,newCluster);\n\t\t\t}\n\t\t}\n\t\treturn cMentions;\n\t}", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "public JavaPairRDD<String, Tuple2<Iterable<Integer>, Iterable<Integer>>> cogroupExample(){\n return firstSet\n .cogroup(secondSet);\n }", "public void merge(MicroCluster other) {\r\n\t\t// 1. update idList\r\n\t\tif (idSet == null)\r\n\t\t\tidSet = new HashSet<Integer>();\r\n\t\tidSet.add(other.clusterID);\r\n // If other is a composite cluster, then we need to incorporate the member ids.\r\n\t\tif (other.idSet != null) {\r\n idSet.addAll(other.idSet);\r\n\t\t}\r\n\t\t// 2. update num, ts1, ts2, sum, ssum\r\n\t\tnum += other.num;\r\n\t\tts1 += other.ts1;\r\n\t\tts2 += other.ts2;\r\n sum = sum.add(other.getSum());\r\n ssum = ssum.add(other.getSquareSum());\r\n\t\t// 3. update the semantic information\r\n\t\tfor (Map.Entry e : other.getWords().entrySet()) {\r\n\t\t\tint wordId = (Integer) e.getKey();\r\n\t\t\tint cnt = (Integer) e.getValue();\r\n\t\t\tint originalCnt = words.containsKey(wordId) ? words.get(wordId) : 0;\r\n\t\t\twords.put(wordId, originalCnt + cnt);\r\n\t\t}\r\n\t}", "public Chromosome crossover(Chromosome firstParent, Chromosome secondParent);", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "public static Tour CheapInsert (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int start, ziel;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n start = in.getPointNumber() - 1;\n ziel = out.getPointNumber() - 1;\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(out);\n tour.addPoint(in);\n for (int i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n int pos = -1;\n if (visited[i] == 1) {\n } else {\n double distance;\n double minimum = Double.MAX_VALUE;\n int insertPoint = 0;\n for (int j = 1; j <= tour.getSize(); j++) {\n if (tour.getPoint(j % tour.getSize()) == in) {\n pos = i;\n } else {\n int vor = tour.getPoint((j - 1) % tour.getSize()).getPointNumber() - 1;\n int nach = tour.getPoint((j) % tour.getSize()).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex] + distancematrix[cityIndex][nach];\n if (distance < minimum) {\n minimum = distance;\n insertPoint = j % tour.getSize();\n pos = i;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(i));\n visited[pos] = 1;\n }\n }\n }\n return tour;\n }", "private void clink(int x1, int y1, int x2, int y2) {\n\t\tint cx = x1;\n\t\tint cy = y1;\n\n\t\twhile (cx != x2) {\n\t\t\tif (x1 > x2) {\n\t\t\t\tcx--;\n\t\t\t} else {\n\t\t\t\tcx++;\n\t\t\t}\n\t\t\tif (inRange(cx, cy) == 1)\n\t\t\t\tmap[cx][cy] = 0;\n\t\t}\n\t\twhile (cy != y2) {\n\t\t\tif (y1 > y2) {\n\t\t\t\tcy--;\n\t\t\t} else {\n\t\t\t\tcy++;\n\t\t\t}\n\t\t\tif (inRange(cx, cy) == 1)\n\t\t\t\tmap[cx][cy] = 0;\n\t\t}\n\t}", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "public static void prefixMerge(Client [] list1, Client [] list2,\n Client[] result){\n\n int listOneIndex = 0;\n int listTwoIndex = 0;\n for (int i = 0; i < result.length; i++){\n if (list1[listOneIndex].compareClient(list2[listTwoIndex]) < 0){\n result[i] = list1[listOneIndex];\n listOneIndex++;\n } else if (list1[listOneIndex].compareClient(list2[listTwoIndex]) > 0) {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n } else {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n listOneIndex++;\n }\n }\n }", "public static ArrayList<HashSet<Integer>> clustersFromEdges(ArrayList<ImageSegmentNode> nodes,\n ArrayList<ImageSegmentEdge> edges,\n int k) {\n boolean[] inCluster = new boolean[nodes.size()];\n Arrays.fill(inCluster, false);\n\n ArrayList<HashSet<Integer>> clusters = Stream.generate(HashSet<Integer>::new)\n .limit(k)\n .collect(Collectors.toCollection(ArrayList::new));\n\n\n @SuppressWarnings(\"unchecked\")\n ArrayList<ImageSegmentEdge> edgeList = (ArrayList<ImageSegmentEdge>) edges.clone();\n\n int i = 0;\n for (int j = 0; j < nodes.size(); j++) {\n boolean incrementI = false;\n ArrayList<Integer> queue = new ArrayList<>();\n\n if (!inCluster[j]) {\n queue.add(j);\n incrementI = true;\n }\n\n while (!queue.isEmpty()) {\n int node = queue.remove(0);\n\n if (!inCluster[node]) {\n clusters.get(i).add(node);\n inCluster[node] = true;\n\n for (ImageSegmentEdge edgeTwo : edgeList) {\n if (edgeTwo.getA() == node && !inCluster[edgeTwo.getB()]) {\n queue.add(edgeTwo.getB());\n } else if (edgeTwo.getB() == node && !inCluster[edgeTwo.getA()]) {\n queue.add(edgeTwo.getA());\n }\n }\n }\n }\n if (incrementI) {\n i++;\n }\n }\n return clusters;\n }", "public Ms2Cluster cluster(Map<Ms2Pointer, MsnSpectrum> spectra, Float lowmass, OffsetPpmTolerance tol, double min_dp, int miss_index)\n {\n // quit if the master or input are not present!\n if (mHead==null || !Tools.isSet(spectra)) return null;\n\n mHead.cluster=this;\n\n // setting the seed spectrum\n if (getMaster()==null && spectra.get(getHead())!=null)\n setMaster(spectra.get(getHead()).copy(new PurgingPeakProcessor()));\n\n// MsnSpectrum HEAD = (mMaster!=null?mMaster:spectra.get(mHead));\n // setup the master first\n List<Peak> head = Spectra.toListOfPeaks(getMaster(), lowmass);\n // get the index of the HEAD spectrum\n List<Peak> index = Similarity.index(head, 7, 0, 1, 5, 0);\n\n // the collections\n if (mMembers!=null) mMembers.clear(); else mMembers = new ArrayList<>();\n // new members from this round\n Collection<MsnSpectrum> members = new ArrayList<>();\n // the error tolerance\n double delta = tol.calcError(500);\n for (Ms2Pointer member : mCandidates)\n {\n MsnSpectrum scan = spectra.get(member);\n // need to exclude the head itself\n if (member.hcode==getHead().hcode)\n {\n member.dp=1; // being the self\n member.cluster=this;\n mMembers.add(member);\n continue;\n }\n if (scan!=null)\n {\n // calc the forward and backward DPs and choose the smallest\n List<Peak> pks = Spectra.toListOfPeaks(scan,lowmass);\n // make sure a min number of the index peaks are found\n if (miss_index>=0 && index.size()-Peaks.overlap_counts(pks, index, delta, true)>miss_index) continue;\n\n member.dp=(float )Similarity.bidirectional_dp(head, pks, tol, true, true, true);\n // now the matching probability\n member.prob = (float )Similarity.similarity_hg(head, pks, delta);\n\n if (member.dp>=min_dp)\n {\n member.cluster=this;\n mMembers.add(member);\n members.add(spectra.get(member));\n }\n }\n }\n mMaster = Spectra.accumulate(getMaster(), tol, 0.5f, members);\n mMz = (float )mMaster.getPrecursor().getMz();\n mRT = (float )getMaster().getRetentionTimes().getFirst().getTime()/60f;\n mCharge = getMaster().getPrecursor().getCharge();\n// mID = Tools.d2s(getMz(),3)+\"|\"+getCharge()+\"|\"+Tools.d2s(getRT(),1);\n mID = toString();\n\n // remove the local objects\n head = (List )Tools.dispose(head);\n index = (List )Tools.dispose(index);\n members = Tools.dispose(members);\n\n return this;\n }", "@Test\r\n public void testMerge() throws Exception {\r\n// List<ISpectrum> spectra = ClusteringTestUtilities.readConsensusSpectralItems();\r\n//\r\n// List<ICluster> list = ClusterUtilities.asClusters(spectra);\r\n// IClusteringEngine engine = new ClusteringEngineFactory().getClusteringEngine();\r\n// for (ICluster sc : list) {\r\n// engine.addClusters(sc);\r\n// }\r\n// for (int i = 0; i < Defaults.getNumberReclusteringPasses(); i++) {\r\n// if (!engine.processClusters())\r\n// break;\r\n// }\r\n// // we have solved for these\r\n// List<ICluster> found = (List<ICluster>) engine.getClusters();\r\n//\r\n//\r\n// final ISimilarityChecker similarityChecker = new FrankEtAlDotProduct(Defaults.getFragmentIonTolerance(), Defaults.getNumberComparedPeaks());\r\n// final List<ICluster> newClusters = ClusterUtilities.mergeClusters(found, similarityChecker, 1);\r\n//\r\n// // because we just did this in the engine we expect little further merging\r\n// Assert.assertEquals(newClusters.size(), found.size());\r\n\r\n\r\n }", "public static SiftKnnContainer mergetosizeofboth(SiftKnnContainer a, SiftKnnContainer b) {\n SiftKnnContainer ret = new SiftKnnContainer( a.getK() + b.getK() );\n ret.SetQueryPoint(a.getQueryPoint());\n\n knnPair[] knn = a.getknnPairArray();\n for (int i = 0; i < knn.length ; i++) {\n if (knn[i].distance != Integer.MAX_VALUE) {\n ret.addNoDuplicateIDs(knn[i].pointID, knn[i].distance);\n }\n }\n knn = b.getknnPairArray();\n for (int i = 0; i < knn.length ; i++) {\n if (knn[i].distance != Integer.MAX_VALUE) {\n ret.addNoDuplicateIDs(knn[i].pointID, knn[i].distance);\n }\n }\n return ret;\n }", "private PairOfNodeIndexIntervals createNodeIndexIntervalPair(int firstStart, int secondStart, int matchedLen) {\n\t\t// new first and second \n\t\tNodeIndexInterval first = new NodeIndexInterval(getStartNodeIndex(firstStart),\n\t\t\t\tgetEndNodeIndex(firstStart, matchedLen));\n\t\tNodeIndexInterval second = new NodeIndexInterval(getStartNodeIndex(secondStart),\n\t\t\t\tgetEndNodeIndex(secondStart, matchedLen));\n\n\t\tPairOfNodeIndexIntervals pair = new PairOfNodeIndexIntervals(first, second);\n\n\t\treturn pair;\n\t}", "public static void prefixMerge(Client [] list1, Client [] list2, Client[] result){\n int resultCount = 0;\n for (int i = 0; resultCount < result.length; i++) //goes through list1 up until the end of result\n {\n for (int j = 0; j < list2.length && resultCount < result.length; j++) //goes through list2 up until the end of list2\n {\n for (int k = 0; k < resultCount; k++) { //check if current element of list2 is already in result\n if (list2[j].compareClient(result[k]) == 0) { j++; } //without this there is an issue where the previous element of list1 is\n } //repeated in list2 but the current element of list1 is larger\n\n if (list2[j].compareClient(list1[i]) < 0) { //copies current element of list2 to result if it is smaller\n result[resultCount] = list2[j]; //than current element of list1\n resultCount++;\n }\n }\n if (resultCount < result.length) { //copies current element of list1 to result if there is room in result\n result[resultCount] = list1[i]; // needed if statement because of outOfBounds exception where all elements\n resultCount++; //in result were already filled by list2\n }\n }\n\n }", "private void crossover(Chromosome c1, Chromosome c2){\n int split = (int)(Math.random()*c1.getNumWeights());\n \n double[][] m1 = c1.getGeneData();\n double[][] m2 = c2.getGeneData();\n double store;\n \n //Begin the switch\n for(int r=0; r<m1.length; r++){\n //Stop spliting\n if(split <= 0){\n break;\n }\n for(int c=0; c<m1[r].length;c++){\n store = m1[r][c];\n m1[r][c] = m2[r][c];\n m2[r][c] = store;\n split--;\n //Stop spliting\n if(split <= 0){\n break;\n }\n }\n }\n }", "public void connectClusters()\n\t{\n//\t\tfor(int i = 0; i<edges.size();i++)\n//\t\t{\n//\t\t\tEdgeElement edge = edges.get(i);\n//\t\t\tString fromNodeID = edge.fromNodeID;\n//\t\t\tNodeElement fromNode = findSubNode(fromNodeID);\n//\t\t\tString toNodeID = edge.toNodeID;\n//\t\t\tNodeElement toNode = findSubNode(toNodeID); \n//\t\t\t\n//\t\t\tif(fromNode != null && toNode != null)\n//\t\t\t{\n//\t\t\t\tPortInfo oport = new PortInfo(edge, fromNode);\n//\t\t\t\tfromNode.addOutgoingPort(oport);\n//\t\t\t\tedge.addIncomingPort(oport);\n//\t\t\t\tPortInfo iport = new PortInfo(edge, toNode);\n//\t\t\t\ttoNode.addIncomingPort(iport);\n//\t\t\t\tedge.addOutgoingPort(iport);\n//\t\t\t}\n//\t\t}\n\t}", "public int run(String[] args) throws Exception {\n\t\t\n\t\tint zipNumLines = -1;\n\n\t\tList<String> otherArgs = new ArrayList<String>();\n\t\tJob job = new Job(getConf(), \"merge-clusters\");\n\t\tConfiguration conf = job.getConfiguration();\n\t\tfor (int i = 0; i < args.length; ++i) {\n\t\t\ttry {\n\t\t\t\tif (\"--zip-num-output\".equals(args[i])) {\n\t\t\t\t\tzipNumLines = Integer.parseInt(args[++i]);\n\t\t\t\t} else if (\"--max-map-attempts\".equals(args[i])) {\n\t\t\t\t\tconf.setInt(\"mapred.map.max.attempts\",Integer.parseInt(args[++i]));\n\t\t\t\t} else {\n\t\t\t\t\totherArgs.add(args[i]);\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException except) {\n\t\t\t\tSystem.out.println(\"ERROR: Integer expected instead of \"\n\t\t\t\t\t\t+ args[i]);\n\t\t\t\treturn printUsage();\n\t\t\t} catch (ArrayIndexOutOfBoundsException except) {\n\t\t\t\tSystem.out.println(\"ERROR: Required parameter missing from \"\n\t\t\t\t\t\t+ args[i - 1]);\n\t\t\t\treturn printUsage(); // exits\n\t\t\t}\n\t\t}\n\n\t\t// Make sure there are at least 3 parameters left: split target input input ...\n\t\tif (otherArgs.size() < 3) {\n\t\t\tSystem.out.println(\"ERROR: Wrong number of parameters: \"\n\t\t\t\t\t+ otherArgs.size() + \" instead of 2.\");\n\t\t\treturn printUsage();\n\t\t}\n\n\t\tMergeClusterRangesInputFormat.setSplitPath(conf, otherArgs.get(0));\n\t\tFileOutputFormat.setOutputPath(job, new Path(otherArgs.get(1)));\n\t\tString[] clusters = new String[otherArgs.size() - 2];\n\t\tfor(int i = 2; i < otherArgs.size(); i++) {\n\t\t\tclusters[i-2] = otherArgs.get(i);\n\t\t}\n\t\tMergeClusterRangesInputFormat.setClusterPaths(conf, clusters);\n\t\t\n\t\tjob.setInputFormatClass(MergeClusterRangesInputFormat.class);\n\t\tjob.setJarByClass(MergeClusterRangesJob.class);\n\n\t\tjob.setMapperClass(SimpleTextMapper.class);\n\n\t\tjob.setOutputKeyClass(Text.class);\n\t\tjob.setOutputValueClass(Text.class);\t\t\n\t\t\n\t\tif(zipNumLines != -1) { \n\t\t\tSystem.err.format(\"INFO: zipnum count: %d\\n\",zipNumLines);\n\t\t\tZipNumOutputFormat.setZipNumLineCount(conf, zipNumLines);\n\t\t}\n\t\tjob.setOutputFormatClass(ZipNumOutputFormat.class);\n\n\t\tjob.setNumReduceTasks(0);\n\n\t\treturn (job.waitForCompletion(true) ? 0 : 1);\n\t}", "@PostMapping\n public KubeClusterDto create(@RequestBody ClusterCreationRequest clusterCreationRequest) {\n return kubeClusterMapper.map(kubeClusterService.create(clusterCreationRequest));\n }", "@Override\n public String kMeansClusters_json(int k) {\n\n List<Set<String>> kMeansClusters = new ArrayList<Set<String>>();\n\n if (k == 1) {\n // No algorithm needed\n kMeansClusters.add(new HashSet<String>(this.restaurantMap.keySet()));\n return this.clusterToJSON(kMeansClusters);\n }\n\n // restaurant clusters contains random centroids mapped to a set of its closest\n // restaurants (in id form)\n Map<double[], Set<String>> restaurantClusters = this.initiateClusters(k, this.restaurantMap.keySet());\n\n do {\n Set<String> emptyCluster = findEmptyCluster(restaurantClusters);\n Set<String> largestCluster = findLargestCluster(restaurantClusters);\n\n // Code below finds some random centroid within the largest cluster\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n for (String rID : largestCluster) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n double[] centroidInLargestCluster = this.generateRandomCentroid(minLat, maxLat, minLon, maxLon);\n\n // Find the empty cluster and reassign its centroid by placing it somewhere in\n // the largest cluster\n for (double[] centroid : restaurantClusters.keySet()) {\n if (restaurantClusters.get(centroid).equals(emptyCluster)) {\n centroid[0] = centroidInLargestCluster[0]; // New longitude based on largest cluster\n centroid[1] = centroidInLargestCluster[1]; // New latitude based on largest cluster\n break; // Once we find the empty cluster, we are done\n }\n }\n\n // Flag is true if any restaurants are reassigned to a new centroid\n // If no restaurants are reassigned, then we are done one run through\n boolean flag;\n do {\n this.reassignCentroids(restaurantClusters);\n flag = reassignRestaurants(restaurantClusters, this.restaurantMap.keySet());\n } while (flag);\n\n } while (atLeastOneEmptyCluster(restaurantClusters)); // Repeat if any empty clusters are detected\n\n // Add final restaurant clusters to list of clusters\n for (Set<String> cluster : restaurantClusters.values()) {\n kMeansClusters.add(cluster);\n }\n return this.clusterToJSON(kMeansClusters);\n }", "public Ms2Cluster() { super(); }", "public void merge(int lX, int lY, int lZ, int rX, int rY, int rZ) {\n for (int i = lX; i < rX; i++) {\n for (int j = lY; j < rY; j++) {\n for (int k = lZ; k < rZ; k++) {\n int label1 = (int) labelledVolume.value(i, j, k);\n for (int t1 = i - 1; t1 <= i + 1 && t1 >= 0 && t1 < x; t1++) {\n for (int t2 = j - 1; t2 <= j + 1 && t2 >= 0 && t2 < y; t2++) {\n for (int t3 = k - 1; t3 <= k + 1 && t3 >= 0 && t3 < z; t3++) {\n if (label1 > 0 && (int) labelledVolume.value(t1, t2, t3) != label1) {\n labelCluster(label1, t1 + (t2 * x) + (t3 * x * y));\n }\n }\n }\n }\n }\n }\n }\n }", "public double computeDistance(cluster c1, cluster c2) {\n\t\tdouble closest = 4000;\n\t\tfor (point p1 : c1.getPoints()) {\n\t\t\tfor (point p2 : c2.getPoints()) {\n\t\t\t\tdouble dist = Math.sqrt(Math.pow( (p1.x() - p2.x()) , 2) + Math.pow( (p1.y() - p2.y()) , 2));\n\t\t\t\tif (dist < closest) {\n\t\t\t\t\tclosest = dist;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn closest;\n\t}", "public Clusters()\r\n\t{\r\n\t\tcluster = new boolean[MAX_CLUSTERS];\r\n\t}", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "public List<Tuple<Tuple<Integer, Integer>, Tuple<Integer, Integer>>> cluster(\n\t\t\tTuple<Sentences, Sentences> translation, boolean mergeIntersections,\n\t\t\tint maxClusterSize) {\n\n\t\tList<Tuple<Tuple<Integer, Integer>, Tuple<Integer, Integer>>> segments =\n\t\t\t\tnew LinkedList<Tuple<Tuple<Integer, Integer>, Tuple<Integer, Integer>>>();\n\t\tList<Word> cluster = new LinkedList<Word>();\n\t\tWord previous = null;\n\n\t\tif (maxClusterSize < 0) {\n\t\t\tmaxClusterSize = Integer.MAX_VALUE;\n\t\t}\n\n\t\tfor (Token token : translation._1.getTokens()) {\n\t\t\tif (token.isWord()) {\n\t\t\t\tWord word = (Word) token;\n\t\t\t\tboolean previousMatches = previous == null || !previous.getMatches().isEmpty();\n\n\t\t\t\tif (!word.getMatches().isEmpty()) { // add to current cluster\n\t\t\t\t\tcluster.add(word);\n\t\t\t\t}\n\n\t\t\t\t// add breaks for current cluster and start new one\n\t\t\t\tif (word.getMatches().isEmpty() || cluster.size() >= maxClusterSize) {\n\t\t\t\t\tif (!cluster.isEmpty()) {\n\t\t\t\t\t\taddSegment(segments, cluster, translation);\n\t\t\t\t\t}\n\t\t\t\t\tprevious = null;\n\t\t\t\t\tcluster.clear();\n\t\t\t\t}\n\n\t\t\t\tprevious = word;\n\t\t\t}\n\t\t}\n\n\t\tif (!cluster.isEmpty()) { // add possible trailing cluster\n\t\t\taddSegment(segments, cluster, translation);\n\t\t}\n\n\t\twhile (mergeIntersections) { // merge until all intersections are found\n\t\t\tint size = segments.size();\n\t\t\tsegments = mergeIntersectingSegments(segments);\n\n\t\t\tif (size == segments.size())\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn segments;\n\t}", "public SME_Cluster[] getClusters();", "public static List<Integer> lcs(List<Integer> arr1, List<Integer> arr2) {\r\n ArrayList empty = new ArrayList();\r\n /* BEFORE WE ALLOCATE ANY DATA STORAGE, VALIDATE ARGS */\r\n if (null == arr1 || 0 == arr1.size())\r\n return empty;\r\n if (null == arr2 || 0 == arr2.size())\r\n return empty;\r\n\r\n if (equalLists(arr1, arr2)) {\r\n return arr1;\r\n }\r\n\r\n /* ALLOCATE VARIABLES WE'LL NEED FOR THE ROUTINE */\r\n ArrayList<Integer> bestMatch = new ArrayList<Integer>();\r\n ArrayList<Integer> currentMatch = new ArrayList<Integer>();\r\n ArrayList<List<Integer>> dataSuffixList = new ArrayList<List<Integer>>();\r\n ArrayList<List<Integer>> lineSuffixList = new ArrayList<List<Integer>>();\r\n\r\n /* FIRST, COMPUTE SUFFIX ARRAYS */\r\n for (int i = 0; i < arr1.size(); i++) {\r\n dataSuffixList.add(arr1.subList(i, arr1.size()));\r\n }\r\n for (int i = 0; i < arr2.size(); i++) {\r\n lineSuffixList.add(arr2.subList(i, arr2.size()));\r\n }\r\n\r\n /* STANDARD SORT SUFFIX ARRAYS */\r\n IntegerListComparator comp = new IntegerListComparator();\r\n Collections.sort(dataSuffixList, comp);\r\n Collections.sort(lineSuffixList, comp);\r\n\r\n /* NOW COMPARE ARRAYS MEMBER BY MEMBER */\r\n List<?> d = null;\r\n List<?> l = null;\r\n List<?> shorterTemp = null;\r\n int stopLength = 0;\r\n int k = 0;\r\n boolean match = false;\r\n\r\n bestMatch.retainAll(empty);\r\n bestMatch.addAll(currentMatch);\r\n for (int i = 0; i < dataSuffixList.size(); i++) {\r\n d = (List) dataSuffixList.get(i);\r\n for (int j = 0; j < lineSuffixList.size(); j++) {\r\n l = (List) lineSuffixList.get(j);\r\n if (d.size() < l.size()) {\r\n shorterTemp = d;\r\n } else {\r\n shorterTemp = l;\r\n }\r\n\r\n currentMatch.retainAll(empty);\r\n k = 0;\r\n stopLength = shorterTemp.size();\r\n match = (l.get(k).equals(d.get(k)));\r\n while (k < stopLength && match) {\r\n if (l.get(k).equals(d.get(k))) {\r\n currentMatch.add((Integer) shorterTemp.get(k));\r\n k++;\r\n } else {\r\n match = false;\r\n }\r\n }\r\n if (currentMatch.size() > bestMatch.size()) {\r\n bestMatch.retainAll(empty);\r\n bestMatch.addAll(currentMatch);\r\n }\r\n }\r\n }\r\n return bestMatch;\r\n }", "public Cluster newCluster( VTrack trv )\n {\n return newCluster(trv, 0);\n }", "private double dist(Point a,Point b)//to find distance between the new entry to predict and the male or female cluster mean positions.\n { double d;\n d=Math.sqrt( Math.pow((a.ht-b.ht),2) + Math.pow((a.wt-b.wt),2));\n return d;\n }", "private boolean firstPerson(Mention a, Mention b) {\n if (a.getPerson() == Person.FIRST && b.getPerson() == Person.FIRST) {\n addToCluster(a, b);\n return true;\n }\n\n return false;\n }", "public static Node cccc_combination(LinkedList list1, LinkedList list2) {\n\n Node Katlyn1 = list1.head;\n Node Katlyn2 = list2.head;\n Node nodethaniel = new Node(0);\n Node tail = nodethaniel;\n\n while (true) {\n if (Katlyn1 == null) {\n tail.next = Katlyn2;\n break;\n }\n if (Katlyn2 == null) {\n tail.next = Katlyn1;\n break;\n }\n // Arrow function in Java?\n if (Katlyn1.valueData <= Katlyn2.valueData) {\n tail.next = Katlyn1;\n Katlyn1 = Katlyn1.next;\n } else {\n tail.next = Katlyn2;\n Katlyn2 = Katlyn2.next;\n }\n tail = tail.next;\n }\n return nodethaniel.next;\n }", "public void assignPixelsToClusters(int[][] assigned){\n\n for(int i = 0; i < imageHeight; i++){\n for(int j = 0; j < imageWidth; j++){\n //System.out.println(\"pixel[\" + i + \"][\" + j + \"]\"); // Used for some debugging\n\n //Find the cluster color that is closest to the current pixel color\n int closestCluster = -1; // Holds the cluster that the pixel is closest to in color\n double closestDistance = Double.MAX_VALUE;// Initiate to the a max value\n for(int x = 0; x < kCenters.length; x++){\n if(diff(pixels[i][j], kCenters[x]) < closestDistance){\n closestCluster = x;\n closestDistance = diff(pixels[i][j], kCenters[x]);\n //Add the coordinates of this pixel to some arrayList of arrayList (a cluster arraylist)???\n }\n \n } // Done iterating through all kCenters and should have the closest\n if(closestCluster == -1){\n System.out.println(\"Error, no closest cluster found\");\n System.exit(-1);\n }\n assigned[i][j] = closestCluster;\n }\n }\n }", "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 }", "private TreeNode<K> combine(TreeNode<K> x, TreeNode<K> y) {\n TreeNode<K> z = new TreeNode<K>();\n z.left = x;\n z.right = y;\n z.rank = x.rank + 1;\n sift(z);\n return z;\n }", "public int compareTo(Cluster cluster) {\n if (documents.isEmpty() || cluster.documents.isEmpty()) {\n return 0;\n }\n return documents.get(0).compareTo(cluster.documents.get(0));\n }", "@Override\n protected double calcSimilarity(Cluster a, Cluster b) {\n List<Point> aItems = a.getItems();\n List<Point> bItems = b.getItems();\n\n // calculate the similarity of each item in a with every item in b,\n // save the min value in sim-variable\n double sim = Double.MAX_VALUE;\n for (Point x : aItems) {\n for (Point y : bItems) {\n double currSim = x.distanceTo(y);\n if (currSim < sim) {\n sim = currSim;\n }\n }\n }\n\n return sim;\n }", "protected Sausage sausageFromClusters(List<Cluster> clusters) {\n Sausage sausage = new Sausage(clusters.size());\n int index = 0;\n for (Cluster cluster : clusters) {\n HashSet<String> seenWords = new HashSet<String>();\n for (Node node : cluster) {\n Word word = node.getWord();\n if (seenWords.contains(word.getSpelling())) {\n continue;\n }\n seenWords.add(word.getSpelling());\n WordResult swr =\n new WordResult(\n node,\n wordSubClusterProbability(\n cluster, word.getSpelling()));\n sausage.addWordHypothesis(index, swr);\n }\n index++;\n }\n sausage.fillInBlanks();\n return sausage;\n }", "EffectiveClusterSpec getCluster(ClusterSpec clusterSpec);", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}", "static int lcs(int x, int y, String s1, String s2)\n {\n // your code here\n \n int len1 = x;\n \n int len2 = y;\n \n int dp[][] = new int[len1+1][len2+1];\n \n for(int i=0;i<=len1;i++){\n dp[i][0] = 0;\n }\n \n for(int i=0;i<=len2;i++){\n dp[0][i] = 0;\n }\n \n for(int i=1;i<=len1;i++){\n for(int j=1;j<=len2;j++){\n \n if(s1.charAt(i-1)==s2.charAt(j-1)){\n dp[i][j]=1+dp[i-1][j-1];\n }\n else {\n dp[i][j] = Math.max(dp[i-1][j],dp[i][j-1]);\n }\n \n }\n }\n \n return dp[len1][len2];\n }", "private static Collection<Point> relocate(Collection<Point> centers,\n\t\t\tCollection<Point> points) {\n\t\tCollection<Point> result = new HashSet<Point>();\n\t\tfor(Point c : centers){\n\t\t\tint sumX = 0;\n\t\t\tint sumY = 0;\n\t\t\tint count = 0;\n\t\t\tfor(Point p : points){\n\t\t\t\tif(p.getColor() == c.getColor()){\n\t\t\t\t\tsumX += p.getX();\n\t\t\t\t\tsumY += p.getY();\n\t\t\t\t\tcount ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tPoint newCenter = new Point(0,0);\n\t\t\tif(count == 0){\n\t\t\t\tnewCenter.setX(c.getX());\n\t\t\t\tnewCenter.setY(c.getY());\n\t\t\t} else {\n\t\t\t\tnewCenter.setY((int)Math.round(sumY * 1.0 / count));\n\t\t\t\tnewCenter.setX((int)Math.round(sumX * 1.0 / count));\n\t\t\t}\n\t\t\t\n\t\t\tnewCenter.setColor(c.getColor());\n\t\t\tresult.add(newCenter);\n\t\t}\t\n\t\treturn result;\n\t}", "public Clustering splitCluster(Clustering inputClustering, List<Point2D> newRepresentatives,\n\t\t\tint splittingClusterIndex) {\n\t\tthis.inputClustering = new Clustering(inputClustering.getCluster(splittingClusterIndex), ClusterType.CLUSTERED,\n\t\t\t\t-1);\n\t\tkNumber = newRepresentatives.size();\n\t\tcentroids = newRepresentatives;\n\t\tbasicIterations = 0;\n\t\tbaseAlgorithm();\n\n\t\ttotalIterations = basicIterations;\n\t\tbasicIterations = 0;\n\t\tlong runtime = basicRuntime;\n\t\tinputClustering.replaceSplittedCluster(splittingClusterIndex, clustering.getClusters());\n\t\tkNumber = inputClustering.getSize();\n\t\tthis.inputClustering = inputClustering;\n\t\tcentroids = inputClustering.getCentroids();\n\t\tbaseAlgorithm();\n\n\t\ttotalIterations += basicIterations;\n\t\tbasicRuntime += runtime;\n\t\treturn clustering;\n\t}", "DescribeClustersResult describeClusters(DescribeClustersRequest describeClustersRequest);" ]
[ "0.6448355", "0.63659596", "0.62588483", "0.61228687", "0.60986423", "0.60627776", "0.60453707", "0.59786993", "0.58659744", "0.5864086", "0.5850054", "0.58381194", "0.58071893", "0.5707428", "0.56870514", "0.5565338", "0.5487596", "0.5442949", "0.53926927", "0.53123885", "0.52844095", "0.526219", "0.52337575", "0.52184176", "0.5204192", "0.51761264", "0.517345", "0.5153912", "0.5152881", "0.5099497", "0.5093733", "0.50781876", "0.50753117", "0.50485814", "0.50471467", "0.5031328", "0.49420542", "0.4915588", "0.49124235", "0.48929703", "0.4880949", "0.4839137", "0.48368883", "0.48353702", "0.482622", "0.4820811", "0.48117808", "0.48100924", "0.48064357", "0.47943652", "0.4793143", "0.47782788", "0.4776788", "0.47758082", "0.47685382", "0.47600916", "0.47464746", "0.47386032", "0.47116506", "0.47057962", "0.470165", "0.46982545", "0.46967396", "0.46957454", "0.46894714", "0.46861562", "0.4682959", "0.46772274", "0.46736202", "0.46706843", "0.46665046", "0.4664318", "0.46623224", "0.46600074", "0.46586224", "0.4656463", "0.46382415", "0.4636665", "0.46341208", "0.46298602", "0.46246347", "0.46165913", "0.46136722", "0.461059", "0.46090716", "0.45865175", "0.4584553", "0.45630136", "0.4562714", "0.4560638", "0.45559987", "0.45530427", "0.45511854", "0.45502704", "0.4545272", "0.45421773", "0.45348242", "0.45276377", "0.45247525", "0.45227394", "0.45107096" ]
0.0
-1
finds minimum from minmatrix where key is each cluster and value is min distance to any cluster
private static String[] getMinGeneIds() { String []output = new String[2]; String minI = "", minJ = ""; double min = Double.MAX_VALUE; for (Map.Entry<String, String> entry : minMatrix.entrySet()) { String minData[] = entry.getValue().split(";"); double currDist = Double.parseDouble(minData[1]); if(currDist < min) { minI = entry.getKey(); minJ = minData[0]; min = currDist; } } output[0] = minI;output[1] = minJ; return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int minCost(int[][] distance) {\n Map<Index, Integer> minCostDP = new HashMap<>();\n Map<Index, Integer> parent = new HashMap<>();\n\n List<Set<Integer>> allSets;\n\n for (Set<Integer> set : allSets) {\n for (int currentVertex = 1; currentVertex < distance.length; currentVertex++) {\n if (set.contains(currentVertex)) continue;\n Index index = Index.createIndex(currentVertex,set);\n int minCost = Integer.MAX_VALUE;\n int minPrevVertex = 0;\n\n Set<Integer> copySet = new HashSet<>();\n for (int prevVertex : set) {\n int cost = distance[prevVertex][currentVertex] + getCost(copySet, prevVertex, minCostDP);\n }\n }\n }\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 Node<Integer> minDistance(Map<Node<Integer>, Double> distances, Map<Node<Integer>, Double> unvisitedNodes) {\n Double min = Double.POSITIVE_INFINITY;\n\n Node<Integer> minNode = null;\n for (Map.Entry<Node<Integer>, Double> entry : distances.entrySet()) {\n Double d = entry.getValue();\n if (Double.compare(d, min) < 0 && unvisitedNodes.containsKey(entry.getKey())) {\n min = d;\n minNode = entry.getKey();\n }\n }\n return minNode;\n }", "private String findMin(Map<String, Node> nodeList)\n\t{\n\t\tint min = Integer.MAX_VALUE;\n\t\tString sommet = null;\n\t\t\n\t\tfor (String nodeName : nodeList.keySet()) {\n\t\t\tint distance = nodeList.get(nodeName).getDistanceFromOrigin();\n\n\t\t\tif(min > distance) {\n\t\t\t\tmin = distance;\n\t\t\t\tsommet = nodeName;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sommet;\n\t}", "public int minXValue (Map <String,ArrayList<Point>> map){\r\n \tint min = 0 , i = 0;\r\n \t\tfor (String key : map.keySet()) {\r\n \t\t\tif ( min < map.get(key).get(i).getX())\r\n \t\t\t\tmin = (int) map.get(key).get(i).getX();\r\n \t\t\ti++;\r\n \t\t}\r\n \treturn min;\t\r\n }", "public int minDistance(int distance[], Boolean span_tree[]) {\n\t\tint min_value=Integer.MAX_VALUE,min_node=-1;\n\t\tfor(int i=0;i<vertexs;i++) {\n\t\t\tif(span_tree[i]==false && distance[i]<=min_value) {\n\t\t\t\tmin_value=distance[i];\n\t\t\t\tmin_node=i;\n\t\t\t}\n\t\t}\n\t\treturn min_node;\n\t}", "public K min();", "int minKey(float key[], Boolean mstSet[]){\n float min = Float.MAX_VALUE;\n int min_index = -1;\n \n for (int v = 0; v < V; v++)\n if (mstSet[v] == false && key[v] < min) {\n min = key[v];\n min_index = v;\n }\n \n return min_index;\n }", "int minKey(int[] key, Boolean[] mstSet) {\n // Initialize min value\n int min = Integer.MAX_VALUE, min_index = -1;\n\n for (int v = 0; v < VERTICES; v++)\n if (mstSet[v] == false && key[v] < min) {\n min = key[v];\n min_index = v;\n }\n\n return min_index;\n }", "public static Matrix min(Matrix m) {\n int rows_c = m.rows(), cols_c = m.cols(), den = rows_c;\n Matrix d;\n if (rows_c == 1) {\n return m;\n } else {\n d = MatrixFactory.getMatrix(1, cols_c, m);\n for (int col = 1; col <= cols_c; col++) {\n double min = 0D;\n boolean firstiter = true;\n for (int row = 1; row <= rows_c; row++) {\n double tmp = m.get(row, col);\n if (!firstiter) {\n min = Math.min(tmp, min);\n } else {\n min = tmp;\n firstiter = false;\n }\n }\n d.set(1, col, min);\n }\n }\n return d;\n }", "private static int findMinDistance(int[] distance, boolean[] visitedVertex) {\r\n int minDistance = Integer.MAX_VALUE;\r\n int minDistanceVertex = -1;\r\n for (int i = 0; i < distance.length; i++) {\r\n if (!visitedVertex[i] && distance[i] < minDistance) {\r\n minDistance = distance[i];\r\n minDistanceVertex = i;\r\n }\r\n }\r\n return minDistanceVertex;\r\n }", "private int minDistance(int dist[], boolean sptSet[]) {\n int min = Integer.MAX_VALUE, min_index = -1;\n\n for (int v = 0; v < V; v++)\n if (!sptSet[v] && dist[v] < min) {\n min = dist[v];\n min_index = v;\n }\n\n return min_index;\n }", "private static void createMinMatrixAfterRemoval(String c) {\n\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\tfor(String s:allClusters) {\n\t\t\tif(!s.equals(c)) {\n\t\t\t\tdouble dist = temp.get(s);\n\t\t\t\tupdateMinMatrix(c,s,dist);\n\t\t\t}\n\t\t}\n\t}", "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 }", "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}", "int minDistance(int dist[], Boolean sptSet[]) {\n // Initialize min value\n int min = Integer.MAX_VALUE, min_index=-1;\n\n for (int v = 0; v < V; v++)\n if (sptSet[v] == false && dist[v] <= min) {\n min = dist[v];\n min_index = v;\n }\n\n return min_index;\n }", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "public double getMinimumDistance() { return minDistance; }", "private int minWeight(int dist[], Boolean sptSet[]){\n int min = Integer.MAX_VALUE;\r\n int minIndex = -1;\r\n\r\n for(int n = 0; n< rideCount; n++){\r\n if(!sptSet[n] && dist[n] <= min) {\r\n min = dist[n];\r\n minIndex = n;\r\n }\r\n }\r\n return minIndex;\r\n }", "public double getClosestDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn distanceMin;\n\t\t}", "static int minimumDistances(int[] a) {\n int l = a.length;\n Map<Integer, List<Integer>> map = new HashMap<>();\n for (int i = 0; i <l ; i++) {\n List<Integer> val = map.get(a[i]);\n if(val == null){\n val = new ArrayList<>();\n }\n val.add(i);\n map.put(a[i], val);\n }\n int min = Integer.MAX_VALUE;\n for (List<Integer> value:\n map.values()) {\n int c = value.size();\n if(c>1){\n for (int i = 0; i < c-1 ; i++) {\n min = Math.min(min, value.get(i+1)- value.get(i));\n }\n }\n }\n if(min == Integer.MAX_VALUE) min = -1;\n return min;\n\n\n }", "public int minYValue (Map <String,ArrayList<Point>> map){\r\n \tint min = 0 , i = 0;\r\n \t\tfor (String key : map.keySet()) {\r\n \t\t\tif ( min < map.get(key).get(i).getY())\r\n \t\t\t\tmin = (int) map.get(key).get(i).getY();\r\n \t\t\ti++;\r\n \t\t}\r\n \treturn min;\t\r\n }", "public int kthSmallest(int[][] matrix, int k) {\n int rows = matrix.length;\n int columns = matrix[0].length;\n // setup a Min heap for getting the first k items in the heap\n PriorityQueue<Cell> minHeap = new PriorityQueue<Cell>(k, new Comparator<Cell>() {\n @Override\n public int compare(Cell o1, Cell o2) {\n if(o1.value == o2.value) return 0;\n return o1.value < o2.value ? -1 : 1;\n }\n });\n boolean[][] visited = new boolean[rows][columns];\n minHeap.offer(new Cell(0,0,matrix[0][0]));\n visited[0][0] = true;\n // BFS. Imaging the matrix is a graph, and neighbor is left, and down 1.\n // using BFS searching, but keep the data in min heap structure.\n for(int i = 0; i < k-1; i++){\n Cell curr = minHeap.poll();\n // two condition for putting the element into min heep\n // 1.if it is in the range of matrix\n // 2.if it is not visited.\n if(curr.row + 1 < rows && !visited[curr.row+1][curr.column]){\n minHeap.offer(new Cell(curr.row+1,curr.column,matrix[curr.row+1][curr.column]));\n visited[curr.row+1][curr.column] = true;\n }\n if(curr.column + 1 < columns && ! visited[curr.row][curr.column+1]){\n minHeap.offer(new Cell(curr.row,curr.column+1, matrix[curr.row][curr.column+1]));\n visited[curr.row][curr.column+1] = true;\n }\n }\n // after put first k item into min heap, we only need to get the top item\n return minHeap.peek().value;\n }", "public static Node getLowestDistanceNode(Set<Node> unsettledNodes) {\n Node lowestDistanceNode = null;\n int lowestDistance = Integer.MAX_VALUE;\n for (Node node: unsettledNodes) {\n int nodeDistance = node.distance;\n if (nodeDistance < lowestDistance) {\n lowestDistance = nodeDistance;\n lowestDistanceNode = node;\n }\n }\n return lowestDistanceNode;\n }", "private void getMinDistances(String u, HashMap<Integer, Integer> distances, HashMap<String, Integer> nodeDistances){\n if(!graphVertexHashMap.containsKey(u)) return;\n\n Queue<String> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n queue.add(u);\n visited.put(u, true);\n int dist = 0;\n\n distances.put(dist, 1);\n nodeDistances.put(u, 0);\n\n while(!queue.isEmpty()){\n String node = queue.poll();\n dist += 1;\n boolean found = false;\n for(String edge : graphVertexHashMap.get(node).getOutDegrees().keySet()){\n if(!visited.containsKey(edge)){\n found = true;\n visited.put(edge, true);\n queue.add(edge);\n if(distances.get(dist) == null){\n distances.put(dist, 1);\n }\n else{\n distances.put(dist, distances.get(dist) + 1);\n }\n if(nodeDistances.containsKey(edge)){\n if(dist < nodeDistances.get(edge)){\n nodeDistances.put(edge, dist);\n }\n }else{\n nodeDistances.put(edge, dist);\n }\n }\n }\n if(!found) dist -=1;\n }\n\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "private List<Integer> findMinNodes() {\n\t\tint minLabel = Integer.MAX_VALUE;\n\t\tList<Integer> result = new ArrayList<Integer>();\n\n\t\tfor (int node = 0; node < vertices.length; node++) {\n\t\t\tint nodeLabel = connectivity[node][node];\n\t\t\tif (nodeLabel < minLabel) {\n\t\t\t\tresult.clear();\n\t\t\t\tresult.add(node);\n\t\t\t\tminLabel = nodeLabel;\n\t\t\t} else if (nodeLabel == minLabel) {\n\t\t\t\tresult.add(node);\n\t\t\t} else\n\t\t\t\tcontinue;\n\t\t}\n\t\treturn result;\n\t}", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "public M csmiHostMin(Object min){this.put(\"csmiHostMin\", min);return this;}", "private static int minTime(Map<Integer, Map<Integer, Integer>> graph, int s, int d) {\n //System.out.println(\"minTime: \" + s + \",\" + d);\n int min = Integer.MAX_VALUE;\n int[] minAr = new int[3];\n boolean found = false;\n LinkedList<Integer> queue = new LinkedList<>();\n HashSet<Integer> visited = new HashSet<>(graph.size());\n\n queue.add(s);\n visited.add(s);\n\n while (queue != null && queue.peek() != null) {\n int i = queue.poll();\n Map<Integer, Integer> map = graph.get(i);\n if(map!=null){\n for (Integer key : map.keySet()) {\n if (!visited.contains(key)) {\n queue.add(key);\n visited.add(key);\n\n if (min > map.get(key)) {\n min = map.get(key);\n minAr[0] = i;\n minAr[1] = key;\n minAr[2] = min;\n\n //System.out.println( \"minAr inside: \" + minAr[0] + \"-\"+ minAr[1] + \"-\" +minAr[2]);\n }\n\n if (key == d) {\n found = true;\n queue = null;\n break;\n\n }\n }\n }\n }\n }\n if (found) {\n //System.out.println(\"minAr: \" + minAr[0] + \"-\" + minAr[1] + \"-\" + minAr[2]);\n Map<Integer, Integer> map1 = graph.get(minAr[0]);\n map1.remove(minAr[1]);\n graph.put(minAr[0], map1);\n Map<Integer, Integer> map2 = graph.get(minAr[1]);\n map2.remove(minAr[0]);\n graph.put(minAr[1], map2);\n System.out.println(\"min : \" + min);\n\n min = (min == Integer.MAX_VALUE) ? 0 : min;\n } else {\n System.out.println(\"no connection\");\n min = 0;\n }\n return min;\n }", "private T getMinUnvisited(){\n if (unvisited.isEmpty()) return null;\n T min = unvisited.get(0);\n for (int i = 1; i < unvisited.size(); i++){\n T temp = unvisited.get(i);\n if (distances[vertexIndex(temp)] < distances[vertexIndex(min)]){\n min = temp;\n }\n }\n return min;\n }", "@Test\n\tpublic void testExtractMin() {\n\t\tHeap heap = new Heap(testArrayList.length);\n\t\tdouble[] expected = new double[] { 5, 7, 24, 36, 15, 48, 32, 47, 93, 27, 38, 70, 53, 33, 93 };\n\t\theap.build(testArrayList);\n\t\tassertEquals(3, heap.extractMin().key);\n\t\tassertArrayEquals(expected, heap.getKeyArray());\n\t\tassertEquals(14, heap.getSize());\n\t}", "default DiscreteDoubleMap2D pointWiseMinimum(double value) {\r\n\t\treturn (x, y) -> Math.min(this.getValueAt(x, y), value);\r\n\t}", "public BSTMapNode findMin() \n\t{\n\t\t\n\t\t\n\t\treturn null;\n\t}", "private static int minKey(int[] key, Boolean[] mstSet, int V)\r\n {\r\n // Initialize min value\r\n int min = Integer.MAX_VALUE, min_index=-1;\r\n\r\n for (int v = 0; v < V; v++)\r\n if (!mstSet[v] && key[v] < min)\r\n {\r\n min = key[v];\r\n min_index = v;\r\n }\r\n\r\n return min_index;\r\n }", "private static int[] FindLowest(int[][] terrainMap) {\n\n int[] lowestPosition = {-1, -1};\n int lowestValue = terrainMap[0][0];\n\n int i, j;\n\n for (i = 0; i < terrainMap.length; i++) {\n for (j = 0; j < terrainMap[0].length; j++) {\n if (terrainMap[i][j] < lowestValue) {\n lowestValue = terrainMap[i][j];\n lowestPosition[0] = i;\n lowestPosition[1] = j;\n }\n }\n\n }\n\n return lowestPosition;\n\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}", "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 }", "private Cluster getNearestCluster(BasicEvent event) {\n float minDistance = Float.MAX_VALUE;\n Cluster closest = null;\n float currentDistance = 0;\n for (Cluster c : clusters) {\n float rX = c.radiusX;\n float rY = c.radiusY; // this is surround region for purposes of dynamicSize scaling of cluster size or aspect ratio\n if (dynamicSizeEnabled) {\n rX *= surround;\n rY *= surround; // the event is captured even when it is in \"invisible surround\"\n }\n float dx, dy;\n if ((dx = c.distanceToX(event)) < rX && (dy = c.distanceToY(event)) < rY) { // needs instantaneousAngle metric\n currentDistance = dx + dy;\n if (currentDistance < minDistance) {\n closest = c;\n minDistance = currentDistance;\n c.distanceToLastEvent = minDistance;\n c.xDistanceToLastEvent = dx;\n c.yDistanceToLastEvent = dy;\n }\n }\n }\n return closest;\n }", "private Node lowestCostThrough(List<Node> openSet, Map<Node, Double> costThrough){\n Node lowest = openSet.get(0);\n\n for(Node n: openSet){\n if(costThrough.get(n) < costThrough.get(lowest)){\n lowest = n;\n }\n }\n return lowest;\n }", "private static Key min(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey min = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(min) < 0) {\n\t\t\t\tmin = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}", "public static Tour NNHeuristic (double distancematrix [][], Cluster cluster) {\n Stack<Integer> stack= new Stack<Integer>();\n Tour tour = new Tour(0);\n double length =0;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n Point out = cluster.getOutPoint ();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n\n tour.addPoint(out);\n tour.addPoint(in);\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n\n int element, dst = 0, i, pos = 0;\n stack.push(in.getPointNumber());\n element = stack.peek() - 1;\n boolean minFlag = false;\n while (!stack.isEmpty()) {\n double min = Integer.MAX_VALUE;\n for (i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (distancematrix[element][cityIndex] > 0 && visited[i] == 0) {\n if (min > distancematrix[element][cityIndex]) {\n min = distancematrix[element][cityIndex];\n dst = cityIndex + 1;\n pos = i;\n minFlag = true;\n }\n }\n }\n if (minFlag) {\n length = length + min;\n visited[pos] = 1;\n stack.push(dst);\n element = stack.peek() - 1;\n tour.addPoint(cluster.getPoints().get(pos));\n minFlag = false;\n continue;\n }\n stack.pop();\n }\n tour.removePoint(out);\n tour.removePoint(in);\n tour.addPoint(out);\n tour.addPoint(in);\n }\n return tour;\n }", "public Coord minCell()\n {\n\t int minX = getGrid().keySet().stream().mapToInt(Coord::getX).min().orElse(0);\n\n\t int minY = getGrid().keySet().stream().mapToInt(Coord::getY).min().orElse(0);\n\n\t return new Coord(minX, minY);\n }", "private void FindMinZ()\r\n\t{\r\n\t\tminimum_Z=Integer.MAX_VALUE;\r\n\t\tfor(Entry<Integer,Node> entry : FutureUpdateList.entrySet())\r\n\t\t{\r\n\t\t\tNode temp=entry.getValue();\r\n\t\t\tif(temp.z<minimum_Z)\r\n\t\t\t{\r\n\t\t\t\tminimum_Z=temp.z;\r\n\t\t\t\tminimum_X=temp.x;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "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 }", "public int getMinDistanceArray(){\n int result = 0;\n double max_double = Double.MAX_VALUE;\n \n for (int i = 0; i < MinDistance.size(); i++){\n if (!MinDistanceStatus.get(i)){ //only checks for non final weights\n if (MinDistance.get(i) < max_double ){\n max_double = MinDistance.get(i);\n result = i;\n }\n }\n }\n \n return result;\n }", "private Long getMinSpanDistance(Long[][] pasMat){\n\t\tInteger ptr[] = new Integer[pasMat.length];\n\t\tLong minSpanTarget = -1L;\n\t\tfor(int i=0; i<pasMat.length; ptr[i++] = 0){\n\t\t\tif(pasMat[i] != null)\n\t\t\t\tminSpanTarget++;\n\t\t}\n\n\t\t/*System.out.println(\"new doc\\n\");\n\t\tSystem.out.println(\"-----------------------------\");\n\t\tfor(int i=0;i<pasMat.length; i++){\n\t\t\tSystem.out.print(\"term[\"+i+\"]\");\n\t\t\tfor(int j=0;pasMat[i]!= null && j<pasMat[i].length; j++){\n\t\t\t\tSystem.out.print(\"\\t\" + pasMat[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tSystem.out.println(\"-----------------------------\\n\");*/\n\n\t\tLong minSpan = Long.MAX_VALUE;\n\t\twhile(true){\n\t\t\t\n\t\t\tLong minVal = Long.MAX_VALUE;\n\t\t\tLong maxVal = Long.MIN_VALUE;\n\t\t\tInteger minI = null; \n\t\t\t\n\t\t\tfor(int i=0; i<pasMat.length; i++){\n\t\t\t\tInteger j = ptr[i];\n\t\t\t\tif (pasMat[i] == null) continue;\n\t\t\t\t\n\t\t\t\tLong value = pasMat[i][j];\n\t\t\t\tminVal = Math.min(minVal, value);\n\t\t\t\tmaxVal = Math.max(maxVal, value);\n\t\t\t\t\n\t\t\t\t// current value is less than min J value and there is room for incrementing \n\t\t\t\tif(((minI == null) || (value < pasMat[minI][ptr[minI]]))\n\t\t\t\t\t&& (ptr[i]+1 < pasMat[i].length)){\n\t\t\t\t\tminI = i;\n\t\t\t\t}\n\t\t\t\t//System.out.println(\"[\"+i+\"][\"+j+\"]\\t val=\"+value+\"\\tmini=\"+minI+\"\\t\");\n\t\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"\");\n\t\t\t\n\t\t\tminSpan = Math.min(minSpan, maxVal - minVal);\n\t\t\t\n\t\t\tif(minSpan == minSpanTarget || minI == null) break;\n\t\t\tptr[minI]++;\n\t\t}\n\t\treturn minSpan;\n\t}", "default DiscreteDoubleMap2D pointWiseMinimum(DiscreteDoubleMap2D other) {\r\n\t\treturn (x, y) -> Math.min(this.getValueAt(x, y), other.getValueAt(x, y));\r\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 static int minDistance(int[] dist, boolean[] visited) {\n int min = Integer.MAX_VALUE;\n int min_index = 0;\n\n for (int v = 0; v < dist.length; ++v) {\n if (!visited[v] && dist[v] < min) {\n min = dist[v];\n min_index = v;\n }\n }\n\n return min_index;\n }", "public node_data heapExtractMin(){\n\t\tdouble min = _positiveInfinity;\n\t\tnode_data v=null;\n\t\tif (!isEmpty()){\n\t\t\tv = _a[0];\n\t\t\tmin = v.getWeight();\n\t\t\t_a[0]=_a[_size-1];\n\t\t\t_size = _size-1;\n\t\t\tminHeapify(0, _size);\n\t\t}\n\t\treturn v;\n\t}", "private static void makeInitialDistanceMatrix() {\n\t\ttry {\n\t\t\tfor(int i=1;i<=totalGenes;i++) {\n\t\t\t\tTreeMap<String, Double> temp1 = new TreeMap<>();\n\t\t\t\tif(distanceMatrix.containsKey(i+\"\"))\n\t\t\t\t\ttemp1 = distanceMatrix.get(i+\"\");\n\t\t\t\tfor(int j=i+1;j<=totalGenes;j++) {\n\t\t\t\t\tdouble dist = getDist(i, j);\n\t\t\t\t\tTreeMap<String, Double> temp2 = new TreeMap<>();\n\t\t\t\t\tif(distanceMatrix.containsKey(j+\"\"))\n\t\t\t\t\t\ttemp2 = distanceMatrix.get(j+\"\");\n\t\t\t\t\ttemp2.put(i+\"\", dist);\n\t\t\t\t\tdistanceMatrix.put(j+\"\", temp2);\n\t\t\t\t\ttemp1.put(j+\"\", dist);\n\t\t\t\t\tupdateMinMatrix(i+\"\",j+\"\",dist);\n\t\t\t\t}\n\t\t\t\tdistanceMatrix.put(i+\"\", temp1);\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "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 M csmiIdMin(Object min){this.put(\"csmiIdMin\", min);return this;}", "public int findMinimumStudentCost(Student start, Student dest) {\n initializeSingleSource(start);\n minHeap.buildHeap(students); //build heap from array of studente keyed by minCost\n while (minHeap.size() != 0) { //while heap size does not equal 0.\n Student minimum = minHeap.extractMin();\n if (minimum.getName() == dest.getName()) {\n return minimum.getminCost();\n }\n for (int i = 0; i < minimum.getNeighbors().size(); ++i) { //for each vertex v in m's adjacency list\n relax(minimum, minimum.getNeighbors().get(i), i); //relax\n }\n }\n return -1; //error message\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 }", "private int minWeightST(int weights[], Boolean mstSet[]){\r\n int min = Integer.MAX_VALUE;\r\n int minIndex = -1;\r\n\r\n for(int v=0; v<rideCount; v++){\r\n if(!mstSet[v] && weights[v]<min){\r\n min = weights[v];\r\n minIndex = v;\r\n }\r\n }\r\n return minIndex;\r\n }", "private static Point getNearest(Collection<Point> centers, Point p) {\n\t\tdouble min = 0;\n\t\tPoint minPoint = null;\n\t\tfor(Point c : centers){\n\t\t\tif(minPoint == null || c.distance(p) < min){\n\t\t\t\tmin = c.distance(p);\n\t\t\t\tminPoint = c;\n\t\t\t}\n\t\t}\n\t\treturn minPoint;\n\t}", "public int extractMinDistance(int queue[], boolean set[]){\r\n\t\tint min=Integer.MAX_VALUE;\t\r\n\t\tint minIndex=0;\r\n\t\t\r\n\t\tfor(int v=0;v<vertices; v++){\r\n\t\t\tif(set[v] == false && queue[v] <= min){\r\n\t\t\t\tmin=queue[v]; \r\n\t\t\t\tminIndex=v;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn minIndex;\r\n\t}", "public static Tour CheapInsert (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int start, ziel;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n start = in.getPointNumber() - 1;\n ziel = out.getPointNumber() - 1;\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(out);\n tour.addPoint(in);\n for (int i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n int pos = -1;\n if (visited[i] == 1) {\n } else {\n double distance;\n double minimum = Double.MAX_VALUE;\n int insertPoint = 0;\n for (int j = 1; j <= tour.getSize(); j++) {\n if (tour.getPoint(j % tour.getSize()) == in) {\n pos = i;\n } else {\n int vor = tour.getPoint((j - 1) % tour.getSize()).getPointNumber() - 1;\n int nach = tour.getPoint((j) % tour.getSize()).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex] + distancematrix[cityIndex][nach];\n if (distance < minimum) {\n minimum = distance;\n insertPoint = j % tour.getSize();\n pos = i;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(i));\n visited[pos] = 1;\n }\n }\n }\n return tour;\n }", "private static double findMinCost(double lemda, Vector finalVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n int n = neighbors.size();\r\n int m = destList.size();\r\n int w = n > m ? m : n;\r\n\r\n double [] costFor_r = new double[w];\r\n\r\n double minCost = MaxDistance;\r\n double totalCurToAll = findDistanceCurToAll(currentNode, destList);\r\n for ( int r = 0 ; r < w; r ++ )\r\n {\r\n Vector rSetVector = new Vector();\r\n costFor_r[r] = getMinSetCost_given_r( r+1, rSetVector,\r\n currentNode,\r\n neighbors,\r\n destList);\r\n costFor_r[r] = (1.0 - lemda) * (r + 1) / n + costFor_r[r] / totalCurToAll;\r\n if ( costFor_r[r] < minCost ) {\r\n minCost = costFor_r[r];\r\n finalVector.clear();\r\n for (int k = 0; k < rSetVector.size(); ++k) {\r\n finalVector.add(k, rSetVector.get(k));\r\n }\r\n }\r\n }\r\n\r\n return minCost;\r\n }", "public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}", "private void findMinimalDistances(City sourceCity) {\n\t\tList<City> adjacentCities = getNeighbors(sourceCity);\r\n\r\n\t\tfor (City target : adjacentCities) {\r\n\t\t\t// Compare the newly calculated tentative transportation cost to the current\r\n\t\t\t// assigned value and assign the smaller one.\r\n\t\t\tif (getShortestDistance(target) > getShortestDistance(sourceCity) + getDistance(sourceCity, target)) {\r\n\t\t\t\tdistance.put(target, getShortestDistance(sourceCity) + getDistance(sourceCity, target));\r\n\t\t\t\t// saves info on what was the city you came from\r\n\t\t\t\tpredecessors.put(target, sourceCity);\r\n\t\t\t\t// add neighbors as unsettled\r\n\t\t\t\tunSettledCities.add(target);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public int kthSmallest(int[][] matrix, int k) {\n int rows = matrix.length;\n int columns = matrix[0].length;\n if (rows == 1)\n return matrix[0][k-1];\n else if (columns == 1)\n return matrix[k-1][0];\n List<Integer> list = new LinkedList<>();\n for (int i = 0; i < rows; i++) {\n int index = Math.min(columns, (k - 1) / (i + 1));\n list = merge(list, k, matrix, i, index);\n }\n if (list.size() <= k){\n int result = list.size()< k? Integer.MAX_VALUE : list.get(list.size()-1);\n for (int i = 0; i < rows; i++) {\n int index = Math.min(columns, (k - 1) / (i + 1));\n if (index != columns)\n result = Math.min(result, matrix[i][index]);\n }\n return result;\n }\n return list.get(k-1);\n }", "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}", "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}", "private Vertex getMinimum(Set<Vertex> vertexes) {\n // Use of Java 8 Optional container object.\n Optional<Vertex> minimum = Optional.empty();\n for (Vertex vertex : vertexes) {\n if (!minimum.isPresent()) {\n minimum = Optional.of(vertex);\n } else {\n if (distance.get(vertex) < distance.get(minimum.get())) {\n minimum = Optional.of(vertex);\n }\n }\n }\n\n return minimum.get();\n }", "private double getMin() {\n return Collections.min(values.values());\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 }", "Coordinate getMinX();", "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 }", "public int minCost(int[] keys, int[] freq) {\n /* Create an auxiliary 2D matrix to store results of subproblems */\n int cost[][] = new int[keys.length][keys.length];\n\n /* cost[i][j] = Optimal cost of binary search tree that can be\n formed from input[i] to input[j].\n cost[0][n-1] will store the resultant cost */\n \n // For a single key, cost is equal to frequency of the key\n for (int i = 0; i < cost.length; i++) {\n cost[i][i] = freq[i];\n }\n \n // Now we need to consider chains of length 2, 3, ... .\n // L is chain length.\n for (int L = 2; L <= keys.length; L++) {\n \n // i is row number in cost[][]\n for (int i = 0; i <= keys.length - L; i++) {\n // Get column number j from row number i and chain length L\n int j = i + L - 1;\n cost[i][j] = Integer.MAX_VALUE;\n // get summation of array elements freq[i] to freq[j]\n int sum = getSum(freq, i, j);\n\n // Try making all keys 'k' in interval keys[i..j] as root\n for (int k = i; k <= j; k++) {\n // val = value when when keys[k] becomes root of this subtree\n int val = sum \n + (k - 1 < i ? 0 : cost[i][k - 1]) //add range before key\n + (k + 1 > j ? 0 : cost[k + 1][j]); //add range after key\n if (val < cost[i][j]) { //keep best cost\n cost[i][j] = val;\n }\n }\n }\n }\n return cost[0][keys.length - 1];\n }", "public int kthSmallest(int[][] matrix, int k) {\n int N = matrix.length;\n // Smallest element in the matrix\n int lowest = matrix[0][0];\n // Greatest element in the matrix\n int greatest = matrix[N - 1][N - 1];\n // Binary search in this range\n while (lowest < greatest) {\n // Middle value\n int middle = lowest + (greatest - lowest) / 2;\n // Position of the middle value in the sorted matrix\n int position = getPosition(matrix, middle);\n // if the position is less than the target\n if (position < k) {\n // Move to the right half\n lowest = middle + 1;\n } else {\n greatest = middle;\n }\n }\n return greatest;\n }", "int getMinAvailable(ClusterSpec clusterSpec);", "public int[][] minCost(int[][] inputMatrix) {\n\t\tint[][] toReturn = new int[inputMatrix.length][inputMatrix.length];\n\t\tfor (int j = 0; j < inputMatrix.length; j++) {\n\t\t\ttoReturn[0][j] = inputMatrix[0][j];\n\t\t\ttoReturn[j][0] = inputMatrix[0][0];\n\t\t}\n\t\tint i;\n\t\tfor (int j = 1; j < inputMatrix.length; j++) {\n\t\t\tfor (i = 1; i < inputMatrix.length; i++) {\n\t\t\t\tif (inputMatrix[i][j] == 0) {\n\t\t\t\t\ttoReturn[i][j] = toReturn[i - 1][j];\n\t\t\t\t} else {\n\t\t\t\t\ttoReturn[i][j] = Math.min(toReturn[i - 1][j], (toReturn[i][j - 1] + inputMatrix[i][j]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn toReturn;\n\t}", "public M csmiPlaceMin(Object min){this.put(\"csmiPlaceMin\", min);return this;}", "public int kthSmallest(int[][] matrix, int k) {\n return 0;\n }", "private static void updateMinMatrix(String i, String j, double dist) {\n\t\tif(minMatrix.containsKey(i)) {\n\t\t\tString minData[] = minMatrix.get(i).split(\";\");\n\t\t\tdouble prevDist = Double.parseDouble(minData[1]);\n\t\t\tif(dist < prevDist)\n\t\t\t\tminMatrix.put(i+\"\", j+\";\"+dist);\n\t\t} else {\n\t\t\tminMatrix.put(i+\"\", j+\";\"+dist);\n\t\t}\n\t\tif(minMatrix.containsKey(j)) {\n\t\t\tString minData[] = minMatrix.get(j).split(\";\");\n\t\t\tdouble prevDist = Double.parseDouble(minData[1]);\n\t\t\tif(dist < prevDist)\n\t\t\t\tminMatrix.put(j, i+\";\"+dist);\n\t\t} else {\n\t\t\tminMatrix.put(j, i+\";\"+dist);\n\t\t}\n\t}", "public int[][] minHashMatrix()\r\n\t{\r\n\t\treturn minHash;\r\n\t}", "public double[] getMin(){\n double[] min = new double[3];\n for (Triangle i : triangles) {\n double[] tempmin = i.minCor();\n min[0] = Math.min( min[0], tempmin[0]);\n min[1] = Math.min( min[1], tempmin[1]);\n min[2] = Math.min( min[2], tempmin[2]);\n }\n return min;\n }", "private int getMinCostVertexFromTheGraph(int[] minCostComputedForVertices, boolean[] verticesAlreadyVisited) {\n\t\tint minVertex = -1;\n\t\tint minCost = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i=0;i<minCostComputedForVertices.length;i++) {\n\t\t\tif(verticesAlreadyVisited[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(minCost > minCostComputedForVertices[i]) {\n\t\t\t\tminCost = minCostComputedForVertices[i];\n\t\t\t\tminVertex = i;\n\t\t\t}\n\t\t}\n\t\treturn minVertex;\n\t}", "private double[] getMin(double[][] res) {\r\n\t\tdouble min[] = new double [3];\r\n\t\t\tmin[0] = res[0][0];\r\n\t\tfor(int i = 0 ; i < res.length ; i ++){\r\n\t\t\tfor(int j = 0 ; j < res.length ; j++)\r\n\t\tif(res[i][j] < min[0] && res[i][j] != -1){\r\n\t\t\tmin[0] = res[i][j];\r\n\t\t\tmin[1] = i;\r\n\t\t\tmin[2] = j;\r\n\t\tSystem.out.println(\"test\" + res[i][j]);\r\n\t\t}\r\n\t\t}\r\n\t\treturn min;\r\n\t}", "public M csmiMemberIdMin(Object min){this.put(\"csmiMemberIdMin\", min);return this;}", "@Override\r\n\tpublic void getMinimumSpanningTree(GraphStructure graph) {\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[0]=0;\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\tList<Edge> list;\r\n\t\twhile(spanningTreeSet.size()!=numberOfVertices) {\r\n\t\t\tfor (int vertex=0; vertex<numberOfVertices;vertex++) {\r\n\t\t\t\tif(! spanningTreeSet.contains(vertex)) {\r\n\t\t\t\t\tspanningTreeSet.add(vertex);\r\n\t\t\t\t\tlist = adjacencyList[vertex];\r\n\t\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[vertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nvertex\\tdistance from source\");\r\n\t\tfor (int i=0;i<numberOfVertices;i++) {\r\n\t\t\tSystem.out.println(i+\"\\t\"+distanceArray[i]);\r\n\t\t}\r\n\t}", "public double minimum(double[][] datasetF) {\r\n\t\tint col = 0;\r\n\t\tdouble minF = Double.MAX_VALUE;\r\n\t\twhile (col != numOfDimension) {\r\n\t\t\tminF = Double.MAX_VALUE;\r\n\t\t\tfor (int i = 0; i < datasetF.length; i++) {\r\n\t\t\t\tif (datasetF[i][col] < minF)\r\n\t\t\t\t\tminF = datasetF[i][col];\r\n\t\t\t}\r\n\t\t\t// System.out.println(\"Minimum \"+col+\" = \" + minF);\r\n\t\t\tcol++;\r\n\t\t}\r\n\t\treturn minF;\r\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 }", "private static int optimalBinary(int[][] costMatrix, int[] key, int[] values, int[][] nodeMatrix) {\n\t\tint min=0;\n\t\tint n= values.length;\n\t\tint r;\n\t\tint currentSum=0;\n\t\t\n\t\tfor(int size=1;size<=n; size++){\n\t\t\t////System.out.println(\"size \"+size);\n\t\t\tfor(int l=1;l<=n-size+1;l++){\n\t\t\t\tcurrentSum=0;\n\t\t\t\tr=l+size-1;\n\t\t\t\tmin = costMatrix[l][r];\n\t\t\t\t////System.out.println(\"\"+l+r);\n\t\t\t\tint sum1=0;\n\t\t\t\tfor(int k=l;k<=r;k++){\n\t\t\t\t\tsum1+=values[k-1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(l==r){\n\t\t\t\t\tmin=values[l-1];\n\t\t\t\t}else{\n\t\t\t\t\tfor(int k=l;k<=r;k++){\n\t\t\t\t\t\t////System.out.println(\" :::: K which is root \" +k+ \" : \" +l+ \" \" +(k-1)+ \" \"+ (k+1)+\" \"+ r +\" : \");\n\t\t\t\t\t\tcurrentSum = sum1 + costMatrix[l][k-1]+ ( (k+1 <= n) ? costMatrix[k+1][r] : 0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(currentSum<min){ \n\t\t\t\t\t\t\tmin=currentSum;\n\t\t\t\t\t\t\tnodeMatrix[l][r]=k;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcostMatrix[l][r]= min;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn min;\n\t}", "public void theMinX() {\n\t\tfloat minx = coords.getFirst().getX(); // set the smallest x to the first one\n\t\tfor(Coord2D c: coords) { // go through the whole linked list\n\t\t\tif(c.getX() < minx) { // if the x of the current coordinate set is smaller than the current min\n\t\t\t\tminx = c.getX(); // make that current coordinate the new min\n\t\t\t}\n\t\t}\n\t\tthis.setMinX(minx);\n\t}", "public T minimum() {\n return min.key;\n }", "protected static <T> Set<List<T>> cluster(ISearchIndex<T> index, double epsilon, int minimum) {\n Set<List<T>> clusters = new HashSet<List<T>>();\n Set<T> visited = new HashSet<T>();\n Set<T> noise = new HashSet<T>();\n\n for (T element : index) {\n if (visited.contains(element)) {\n continue;\n }\n visited.add(element);\n\n List<T> neighbors = index.radius(element, epsilon);\n\n if (neighbors.size() < minimum) {\n noise.add(element);\n } else {\n List<T> cluster = new LinkedList<T>();\n\n LinkedList<T> seeds = new LinkedList<T>();\n for (T neighbor : neighbors) {\n seeds.push(neighbor);\n visited.add(neighbor);\n cluster.add(neighbor);\n noise.remove(neighbor);\n }\n\n while (!seeds.isEmpty()) {\n T seed = seeds.pollLast();\n List<T> exteriors = index.radius(seed, epsilon);\n\n if (exteriors.size() >= minimum) {\n Set<T> subvisited = new HashSet<T>();\n for (T exterior : exteriors) {\n if (!visited.contains(exterior)) {\n seeds.push(exterior);\n subvisited.add(exterior);\n cluster.add(exterior);\n }\n if (noise.contains(exterior)) {\n noise.remove(exterior);\n cluster.add(exterior);\n }\n }\n visited.addAll(subvisited);\n }\n }\n\n clusters.add(cluster);\n }\n }\n\n return clusters;\n }", "public void extractMin (Tree tempTree, ArrayList <String> qList, Vertex min) {\r\n\r\n //find all connected verticies to the minimum\r\n connectedList = allConnected(min);\r\n \r\n \r\n //for each connected vertex\r\n for (int i = 0; i < connectedList.size(); ++i){\r\n\r\n //check if the connected edge is in the Qlist\r\n if (qList.contains(connectedList.get(i).getStart()) == true || qList.contains(connectedList.get(i).getEnd()) == true) {\r\n tempTree.checkWeight(connectedList.get(i), min);\r\n }\r\n }\r\n }", "public T findMin();", "public int minCost(int[][] costs) {\n\nif(costs== null || costs.length == 0)\nreturn 0;\n// int n_houses = costs.length ;\nint lastR = costs[0][0];\nint lastB = costs[0][1];\nint lastG = costs[0][2];\nint currR,currB,currG ;\nfor(int i = 1; i< costs.length ; i++ ){\ncurrR = costs[i][0] + Math.min(lastB,lastG);\ncurrB = costs[i][1] + Math.min(lastR,lastG);\ncurrG = costs[i][2] + Math.min(lastR,lastB);\nlastR = currR;\nlastB = currB;\nlastG = currG;\n}\n// return Math.min(Math.min(lastR,lastB),lastG);\nreturn Math.min(Math.min(lastR,lastB),lastG);\n}", "int[] primMST() {\n // Clone actual array\n int[][] graph = Arrays.stream(this.graph).map(int[]::clone).toArray(int[][]::new);\n\n // Array to store constructed MST\n int[] parent = new int[VERTICES];\n\n // Key values used to pick minimum weight edge in cut\n int[] key = new int[VERTICES];\n\n // To represent set of vertices included in MST\n Boolean[] mstSet = new Boolean[VERTICES];\n\n // Initialize all keys as INFINITE\n for (int i = 0; i < VERTICES; i++) {\n key[i] = Integer.MAX_VALUE;\n mstSet[i] = false;\n }\n\n // Always include first 1st vertex in MST.\n key[0] = 0; // Make key 0 so that this vertex is picked as first vertex\n parent[0] = -1; // zFirst node is always root of MST\n\n // The MST will have V vertices\n for (int count = 0; count < VERTICES - 1; count++) {\n // Pick thd minimum key vertex from the set of vertices\n // not yet included in MST\n int u = minKey(key, mstSet);\n\n // Add the picked vertex to the MST Set\n mstSet[u] = true;\n\n // Update key value and parent index of the adjacent\n // vertices of the picked vertex. Consider only those\n // vertices which are not yet included in MST\n for (int v = 0; v < VERTICES; v++)\n\n // graph[u][v] is non zero only for adjacent vertices of m\n // mstSet[v] is false for vertices not yet included in MST\n // Update the key only if graph[u][v] is smaller than key[v]\n if (graph[u][v] != 0 && mstSet[v] == false && graph[u][v] < key[v]) {\n parent[v] = u;\n key[v] = graph[u][v];\n }\n }\n\n return parent;\n }", "public node_data heapMinimum(){return _a[0];}", "public int minkeys() {\n\t\tint min = 0;\n\t\tif (parentref == null) {\n\t\t\treturn 1;\n\t\t}\n\t\tmin = (int)Math.ceil((degree) / 2.0) - 1;\n\t\t//min = (int)Math.ceil(degree / 2.0);\n\t\treturn Math.max(min, 0);\n\t}", "int getXMin();", "public void deleteMin()\t\t\t\t//delete smallest key\n\t{\n\t\troot=deleteMin(root);\n\t}", "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 Integer minimumData(Node root) {\n Integer min = root.getData();\n while (root.getLeftChild() != null) {\n min = root.getLeftChild().getData();\n root = root.getLeftChild();\n }\n return min;\n }", "public int\ngetNodeIndexMin();" ]
[ "0.7086165", "0.68995804", "0.6888722", "0.6610021", "0.65470886", "0.6403021", "0.63770545", "0.63676083", "0.6252671", "0.6247706", "0.6234645", "0.6228699", "0.61906654", "0.6180418", "0.6125848", "0.6125807", "0.6110644", "0.61104035", "0.60939306", "0.60937285", "0.60931623", "0.6092962", "0.6057578", "0.6053411", "0.6001197", "0.59876716", "0.59702206", "0.5970164", "0.59487754", "0.59390545", "0.5919889", "0.59133804", "0.59120053", "0.59105295", "0.589487", "0.5887463", "0.58530223", "0.5810526", "0.5801829", "0.5782869", "0.5780263", "0.57759756", "0.57675064", "0.5763691", "0.5755912", "0.5740675", "0.5736196", "0.57335645", "0.57331353", "0.57232994", "0.5720246", "0.57196623", "0.57011205", "0.57005364", "0.56585324", "0.5655178", "0.5641856", "0.56397086", "0.56353277", "0.5635131", "0.56312037", "0.5603959", "0.5602795", "0.5598354", "0.55968535", "0.55956286", "0.5588319", "0.55851257", "0.55817336", "0.55797976", "0.5559033", "0.5557828", "0.5551934", "0.55516493", "0.55497175", "0.55435693", "0.5541124", "0.5538584", "0.55355775", "0.55352914", "0.5534506", "0.55290574", "0.55264777", "0.5526414", "0.55220336", "0.5521103", "0.5516637", "0.55109197", "0.5504811", "0.5495698", "0.54817134", "0.5475029", "0.5471923", "0.5467628", "0.5464067", "0.546338", "0.54624134", "0.54623026", "0.54560983", "0.5453109", "0.5449934" ]
0.0
-1
Calculates the euclidean distance between two points
public static double getDist(int id1, int id2) { ArrayList<Double> gA1 = geneAttributes.get(id1); ArrayList<Double> gA2 = geneAttributes.get(id2); double dist = 0; for(int i=0;i<gA1.size();i++) { dist += ( (gA1.get(i) - gA2.get(i)) * (gA1.get(i) - gA2.get(i)) ); } dist = Math.sqrt(dist); return dist; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Double euclidean(LatitudeLongitude point1, LatitudeLongitude point2) {\n return Double.valueOf(Math.sqrt(Math.pow(point1.getLatitude() - point2.getLatitude(), 2)\n + Math.pow(point1.getLongitude() - point2.getLongitude(), 2)));\n }", "private static double EuclideanDistance(Point p1, Point p2) {\n\t\tdouble dx = p2.X - p1.X;\n\t\tdouble dy = p2.Y - p1.Y;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t}", "public static double calculateEuclideanDistance(GridPoint point1, GridPoint point2) {\n\t\treturn Math.sqrt(Math.pow(point1.getX() - point2.getX(), 2) + Math.pow(point1.getY() - point2.getY(), 2));\n\t}", "public static float euclideanDistance(PointF firstPoint, PointF secondPoint) {\n return PointF.length(secondPoint.x - firstPoint.x, secondPoint.y - firstPoint.y);\n }", "public static double euclideanDistance(Prototype one, Prototype two)\r\n {\r\n return d(one, two);\r\n }", "default double euclideanDistance(double[] a, double[] b) {\n checkLengthOfArrays(a, b);\n double sum = 0.0;\n for (int i = 0; i < a.length; i++) {\n final double d = a[i] - b[i];\n sum += d * d;\n }\n return Math.sqrt(sum);\n }", "public static float euclideanDistance(JSONArray point1, JSONArray point2) {\n\n ArrayList<Float> deltas = new ArrayList<>();\n\n for (int dimension = 0; dimension < point1.size(); dimension++)\n {\n deltas.add((float)\n Math.pow(((Double) point1.get(dimension)).floatValue() - ((Double) point2.get(dimension)).floatValue(), 2));\n }\n\n float sum = 0;\n for (float number : deltas) {\n sum += number;\n }\n\n return (float) Math.sqrt(sum);\n }", "public double distance(double x, double y);", "public int euclideanDistance(DataValue<T> value1, DataValue<T> value2)\r\n\t{\n\t\tint difference = value1.difference(value2);\r\n\t\tdifference = difference * difference;\t\r\n\t\treturn (int) Math.sqrt(difference);\r\n\t}", "double distance(double x1, double y1, double x2, double y2) {\r\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\r\n }", "public double getEuclideanDistance2D( double x1, double x2, double y1, double y2 )\n {\n double distance;\n double t1 = x1 - y1;\n double t2 = t1 * t1;\n t1 = x2 - y2;\n t2 += ( t1 * t1 );\n distance = Math.sqrt( t2 );\n\n return distance;\n }", "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 EquationExpression dist(final EquationPoint a,\n\t\t\tfinal EquationPoint b) {\n\t\treturn sqrt(dist2(a, b));\n\t}", "public static double distancia(Entidade e1,Entidade e2){\r\n\t\tdouble dx = e1.getPosicaoX() - e2.getPosicaoX();\r\n\t\tdouble dy = e1.getPosicaoY() - e2.getPosicaoY();\r\n\t\tdouble d = Math.sqrt(dx*dx + dy*dy);\r\n\t\treturn d;\r\n\t}", "public final double calcDistance( Point a, Point b )\r\n {\r\n return( Math.sqrt( (Math.pow(a.y - b.y, 2)) +\r\n (Math.pow(a.x - b.x, 2)) ) );\r\n }", "static double distance(Point a, Point b) {\n\t\tint xDiff = a.x - b.x;\n\t\tint yDiff = a.y - b.y;\n\t\treturn Math.sqrt((xDiff * xDiff) + (yDiff * yDiff));\n\t}", "static double distance(double x1, double y1, double x2, double y2)\n {\n double x_dist = x2 - x1;\n double y_dist = y2 - y1;\n double dist = Math.sqrt(Math.pow(x_dist, 2) + Math.pow(y_dist, 2));\n return dist;\n }", "public static EquationExpression dist(final EquationPoint a, final EquationPoint b) {\n return sqrt(dist2(a,b));\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 static double euclidDist(Point p1, Point p2) {\r\n\t\tvar p1Lat = p1.latitude();\r\n\t\tvar p1Lon = p1.longitude();\r\n\t\tvar p2Lat = p2.latitude();\r\n\t\tvar p2Lon = p2.longitude();\r\n\t\tvar dist = Math.sqrt( ((p1Lat-p2Lat)*(p1Lat-p2Lat)) + ((p1Lon-p2Lon)*(p1Lon-p2Lon)) );\r\n\t\treturn dist;\r\n\t}", "public int distance(Coord coord1, Coord coord2);", "public double distance(double x1, double y1, double x2, double y2)\n {\n return Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow(y2 - y1, 2));\n }", "public static double eucleidian(InputSpacePoint a, InputSpacePoint b) {\n double sum =0.0;\n for(String s : a.getKeysAsCollection()) {\n sum += Math.pow(a.getValue(s)-b.getValue(s), 2);\n }\n return Math.sqrt(sum);\n }", "private double distance(Double[] e1, Double[] e2) {\n if(e1.length != e2.length)\n throw new IllegalArgumentException(\"e1 and e2 lie in two different dimensional spaces.\");\n\n double sum = 0.0;\n for(int i = 0; i < e1.length; ++i)\n sum += Math.pow(e1[i] - e2[i], 2);\n return Math.sqrt(sum);\n }", "public double getEuclideanDistance( double[] x, double[] y )\n {\n double distance = 0;\n double t = 0;\n double s = 0;\n\n for( int i=0; i<x.length; i++ )\n {\n t = x[ i ] - y[ i ];\n s += (t * t);\n }\n\n distance = Math.sqrt( s );\n\n return distance;\n }", "protected double getSquaredEuclideanDistance(double[] v1, double[] v2) {\r\n \r\n double sum = 0;\r\n \r\n for(int i = 0; i < v1.length; i++) {\r\n sum += Math.pow((v1[i] - v2[i]), 2);\r\n }\r\n \r\n return sum;\r\n }", "public double getEuclideanDistance( Double[] x, Double[] y )\n {\n double distance = 0;\n double t = 0;\n double s = 0;\n\n for( int i=0; i<x.length; i++ )\n {\n t = x[ i ] - y[ i ];\n s += (t * t);\n }\n\n distance = Math.sqrt( s );\n\n return distance;\n }", "private double distance(Point a, Point b) {\n\t\tDouble xdist = new Double( a.x - b.x );\n\t\tDouble ydist = new Double( a.y - b.y );\n\t\treturn Math.sqrt( Math.pow(xdist, 2.0) + Math.pow(ydist, 2.0) );\n\t}", "public static double getEuclideanDistance(VectorIntf x, VectorIntf y) {\r\n if (x==null || y==null) \r\n\t\t\tthrow new IllegalArgumentException(\"at least one arg null\");\r\n if (x.getNumCoords()!=y.getNumCoords()) \r\n\t\t\tthrow new IllegalArgumentException(\"args of different dimensions\");\r\n\t\tfinal int n = x.getNumCoords();\r\n double dist = 0.0;\r\n for (int i=0; i<n; i++) {\r\n double xi = x.getCoord(i);\r\n double yi = y.getCoord(i);\r\n dist += (xi-yi)*(xi-yi);\r\n }\r\n return Math.sqrt(dist);\r\n }", "static double distance(Point p1, Point p2) {\n\t\treturn Math.sqrt((p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y));\n\t}", "public static double distance(double x1, double y1, double x2, double y2) {\n\t\tdouble r1 = x2 - x1;\n\t\tdouble r2 = y2 - y1;\n\t\treturn Math.sqrt(r1 * r1 + r2 * r2);\n\t}", "public static double distance(\n\t\t\tdouble x1, double y1, double x2, double y2) {\n\t\treturn Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n\t}", "public static EquationExpression dist2(final EquationPoint a,\n\t\t\tfinal EquationPoint b) {\n\t\tEquationExpression x = diff(a.getXExpression(), b.getXExpression());\n\t\tEquationExpression y = diff(a.getYExpression(), b.getYExpression());\n\t\treturn sum(times(x, x), times(y, y));\n\t}", "private static int dist(int x1, int y1, int x2, int y2) {\n\t\treturn (int) Math.sqrt(Math.abs(((x2-x1) * (x2-x1)) + ((y2-y1) * (y2-y1))));\n\t}", "public static EquationExpression dist2(final EquationPoint a, final EquationPoint b) {\n EquationExpression x = diff(a.getXExpression(), b.getXExpression());\n EquationExpression y = diff(a.getYExpression(), b.getYExpression());\n return sum(times(x,x), times(y,y));\n }", "public static double squaredEuclideanDistance(Prototype one, Prototype two)\r\n {\r\n final double[] oneInputs = one.getInputs();\r\n final double[] twoInputs = two.getInputs();\r\n //final int _size = one.numberOfInputs();\r\n double acc = 0.0;\r\n for (int i = 0; i < numberOfInputs; i++)\r\n {\r\n acc += (oneInputs[i] - twoInputs[i]) * (oneInputs[i] - twoInputs[i]);\r\n }\r\n return acc;\r\n }", "public double distance(Point a, Point b) {\n\t\tdouble dx = a.x - b.x;\n\t\tdouble dy = a.y - b.y;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t}", "public static double dist (ECEF a, ECEF b)\r\n\t{\r\n\t\tdouble distsquared = square (a.x-b.x) + square (a.y-b.y) + square (a.z-b.z);\r\n\t\treturn Math.sqrt(distsquared);\r\n\t}", "private static double distance(double x, double y, double x1, double x2,\n\t\t\tdouble y1, double y2) {\n\t\tPoint p = new Point(x, y);\n\t\tPoint p1 = new Point(x1, y1);\n\t\tPoint p2 = new Point(x2, y2);\n\t\treturn p.distance(p1, p2);\n\t}", "default double euclideanDistanceAbs(double[] a, double[] b) {\n checkLengthOfArrays(a, b);\n double sum = 0.0;\n for (int i = 0; i < a.length; i++) {\n final double d = Math.abs(a[i] - b[i]);\n sum += d * d;\n }\n return Math.sqrt(sum);\n }", "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 double dist(double [] v1, double [] v2){\n \t\tdouble sum=0;\n \t\tfor (int i=0; i<nDimensions; i++){\n \t\t\tdouble d = v1[i]-v2[i];\n \t\t\tsum += d*d;\n \t\t}\n \t\treturn Math.sqrt(sum);\n \t}", "public double euclideDistance(ArrayList<Double> vectorA, ArrayList<Double> vectorB) {\n double distance = 0.0;\n for (int i = 0; i < vectorA.size(); i++) {\n distance += Math.pow(vectorA.get(i) - vectorB.get(i), 2);\n }\n return Math.sqrt(distance);\n }", "public static double computeDistance(GeoPoint point1, GeoPoint point2) {\n return Math.sqrt(Math.pow(point1.getLatitudeE6()\n - point2.getLatitudeE6(), 2d)\n + Math.pow(point1.getLongitudeE6() - point2.getLongitudeE6(),\n 2d));\n }", "static private double dist(double[] a, double[] b) {\n\t\treturn new gov.pnnl.jac.geom.distance.Euclidean().distanceBetween(a, b);\n }", "private double distance(Point A, Point B) {\n\t\tdouble dX = A.x - B.x;\n\t\tdouble dY = A.y - B.y;\n\t\treturn Math.sqrt(dX * dX + dY * dY);\n\t}", "private double calculateDistance(Circle point1, Circle point2) {\r\n double x = point1.getCenterX() - point2.getCenterX();\r\n double y = point1.getCenterY() - point2.getCenterY();\r\n\r\n return Math.sqrt(x*x + y*y);\r\n }", "public abstract double calculateDistance(double[] x1, double[] x2);", "public static double getEuclideanDistance(DblArray1SparseVector x, \r\n\t\t DblArray1SparseVector y) {\r\n if (x==null || y==null) \r\n\t\t\tthrow new IllegalArgumentException(\"at least one arg null\");\r\n if (x.getNumCoords()!=y.getNumCoords()) \r\n\t\t\tthrow new IllegalArgumentException(\"args of different dimensions\");\r\n\t\tfinal int n = x.getNumCoords();\r\n double dist = 0.0;\r\n\t\tif (Double.compare(x.getDefaultValue(),y.getDefaultValue())==0) {\r\n\t\t\tfinal int xs_nz = x.getNumNonZeros();\r\n\t\t\tfinal int ys_nz = y.getNumNonZeros();\r\n\t\t\tfinal double defVal = x.getDefaultValue();\r\n\t\t\tint x_ind = 0;\r\n\t\t\tint y_ind = 0;\r\n\t\t\twhile (x_ind<xs_nz || y_ind<ys_nz) {\r\n\t\t\t\tint x_pos = x_ind < xs_nz ? x.getIthNonZeroPos(x_ind) : \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tInteger.MAX_VALUE;\r\n\t\t\t\tint y_pos = y_ind < ys_nz ? y.getIthNonZeroPos(y_ind) :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tInteger.MAX_VALUE;\r\n\t\t\t\tif (y_pos < x_pos) {\r\n\t\t\t\t\tdouble yi = y.getIthNonZeroVal(y_ind)-defVal;\r\n\t\t\t\t\tdist += yi*yi;\r\n\t\t\t\t\ty_ind++;\r\n\t\t\t\t}\r\n\t\t\t\telse if (x_pos < y_pos) {\r\n\t\t\t\t\tdouble xi = x.getIthNonZeroVal(x_ind)-defVal;\r\n\t\t\t\t\tdist += xi*xi;\r\n\t\t\t\t\tx_ind++;\r\n\t\t\t\t}\r\n\t\t\t\telse { // x_pos==y_pos\r\n\t\t\t\t\tdouble xmyi = y.getIthNonZeroVal(y_ind)-x.getIthNonZeroVal(x_ind);\r\n\t\t\t\t\tdist += xmyi*xmyi;\r\n\t\t\t\t\tx_ind++;\r\n\t\t\t\t\ty_ind++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn Math.sqrt(dist);\r\n\t\t}\r\n for (int i=0; i<n; i++) {\r\n double xi = x.getCoord(i);\r\n double yi = y.getCoord(i);\r\n dist += (xi-yi)*(xi-yi);\r\n }\r\n return Math.sqrt(dist);\t\t\r\n\t}", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "public double distanceBetween2Points(double x1,double y1,double x2, double y2){\n\t\treturn Math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));\n\t}", "public static float getDistance(float x1, float y1, float x2, float y2)\r\n\t{\r\n\t\treturn (float) Math.sqrt(getSquareDistance(x1, y1, x2, y2));\r\n\t}", "public static double getDistance(GPSCoordinates point1, GPSCoordinates point2) {\r\n\t\t\r\n\t\treturn EARTH_RADIUS * 2 * Math.atan2( Math.sqrt( getHaversinePart(point1, point2)), Math.sqrt( getHaversinePart(point1, point2) ) );\r\n\t}", "public static double distanceCalculator(Point a, Point b) {\n double distSquared = (Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2) + Math.pow(a.z - b.z, 2));\n return Math.sqrt(distSquared);\n }", "public abstract double distanceFrom(double x, double y);", "public double getEuclideanDistanceTo(Position other) {\n\n double sum = 0;\n //POEY comment: values.length = the number of extraction functions\n //find different values of every object's values in each function (round-robin tournament event itself)\n for (int i = 0; i < values.length; i++) {\n double value = values[i];\n double otherValue = other.values[i];\n double diff = value - otherValue;\n sum += (diff * diff);\n }\n\n return Math.sqrt(sum);\n \n }", "public static double dist (Vertex a, Vertex b){\n return Math.sqrt((b.y-a.y)*(b.y-a.y) + (b.x-a.x)*(b.x-a.x));\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 double getEuclideanDistance( int[] x, int[] y )\n {\n double[] a = new double[ x.length ];\n double[] b = new double[ y.length ];\n\n for( int i=0; i<a.length; i++ )\n {\n a[ i ] = (double) x[ i ];\n }\n\n for( int j=0; j<b.length; j++ )\n {\n b[ j ] = (double) y[ j ];\n }\n\n return getEuclideanDistance( a, b );\n }", "public static final double distance(final float x1, final float x2, final float y1, final float y2) {\r\n return Math.sqrt( ( (x2 - x1) * (x2 - x1)) + ( (y2 - y1) * (y2 - y1)));\r\n }", "public static double getDistance(int x1, int y1, int x2, int y2)\n {\n double dx = x2 - x1;\n double dy = y2 - y1;\n\n // return Math.hypot(x2 - x1, y2 - y1); // Extremely slow\n // return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); // 20 times faster than hypot\n return Math.sqrt(dx * dx + dy * dy); // 10 times faster then previous line\n }", "public static final double distance(final double x1, final double x2, final double y1, final double y2) {\r\n return Math.sqrt( ( (x2 - x1) * (x2 - x1)) + ( (y2 - y1) * (y2 - y1)));\r\n }", "private double DistancePoint(Point a, Point b) {\n\t\tdouble ab = Math.sqrt( \n\t\t\t\tMath.pow( (b.getX() - a.getX()) , 2) +\n\t\t\t\tMath.pow( (b.getY() - a.getY()) , 2)\n\t\t);\n\t\treturn ab;\n\t}", "public static double d(Prototype one, Prototype two)\r\n {\r\n return Math.sqrt(squaredEuclideanDistance(one, two));\r\n }", "private double getDistance(float x, float y, float x1, float y1) {\n double distanceX = Math.abs(x - x1);\n double distanceY = Math.abs(y - y1);\n return Math.sqrt(distanceX * distanceX + distanceY * distanceY);\n }", "private double calculateDistance(int sourceX, int sourceY, int targetX, int targetY){\n int xLength = targetX - sourceX;\n int yLength = targetY - sourceY;\n return Math.sqrt((xLength*xLength)+(yLength*yLength)); \n }", "public static float distance(Vec2 start, Vec2 end) {\r\n\t\treturn (float) Math.sqrt((end.x - start.x) * (end.x - start.x) + (end.y - start.y)\r\n\t\t\t\t* (end.y - start.y));\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}", "public double getDistance(double x, double y) {\n double xdist = 0;\n if (x < x1 && x < x2) xdist = Math.min(x1, x2) - x;\n else if (x > x1 && x > x2) xdist = x - Math.max(x1, x2);\n double ydist = 0;\n if (y < y1 && y < y2) ydist = Math.min(y1, y2) - y;\n else if (y > y1 && y > y2) ydist = y - Math.max(y1, y2);\n return Math.sqrt(xdist * xdist + ydist * ydist);\n }", "double distance (double px, double py);", "public static String distance(String x1, String x2){\n\n }", "public double distance(int x, int y){\n double distanceSq= Math.pow(this.x-x,2.0) + Math.pow(this.y-y,2.0);\n //double distance= Math.sqrt(distanceSq);\n return Math.sqrt(distanceSq);\n }", "public double distance(Point other) {\n\n // Define delta-X and delta-Y.\n double deltaX = this.x - other.x;\n double deltaY = this.y - other.y;\n\n // Calculate distance and return.\n return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n }", "private int distance(Point p1, Point p2) {\n return (int) Math.sqrt(Math.pow(p1.getCenterX() - p2.getCenterX(), 2) + Math.pow(p1.getCenterY() - p2.getCenterY(), 2));\n }", "double distanceEcl(Coord other) {\n\t\tint deltaX = x - other.x;\n\t\tint deltaY = y - other.y;\n\t\treturn sqrt(((double)deltaX * deltaX) + ((double)deltaY * deltaY));\n\t}", "private double norm(double x1, double y1, double x2, double y2)\n {\n return Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));\n }", "public static void main(String[] args) {\n \n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tSystem.out.print(\"Enter the values for x1 and y1: \");\n\t\tdouble x1 = s.nextDouble();\n\t\tdouble y1 = s.nextDouble();\n\t\t\n\t\tSystem.out.print(\"Enter the values for x2 and y2: \");\n\t\tdouble x2 = s.nextDouble();\n\t\tdouble y2 = s.nextDouble();\n\t\tdouble a = (x2-x1)*(x2-x1);\n\t\tdouble b =(y2-y1)*(y2-y1);\n\t\tdouble distance = Math.pow(a+b, 0.5);\n\t\t\t\t\n\t\t\n\t\tSystem.out.println(\"The distance of the points is \" + distance);\n\t\t\n\t}", "public double distance(V a, V b);", "public static float PointDistance(final Point start, final Point end) {\n return (sqrt(sq(end.x - start.x) + sq(end.y - start.y) + sq(end.z - start.z)));\n }", "public double distance(Coordinates coordinate1, Coordinates coordinate2)\n {\n return Math.sqrt(Math.pow(coordinate1.getX() - coordinate2.getX(), 2) + Math.pow(coordinate1.getY() - coordinate2.getY(), 2));\n }", "public double computeDistance(cluster c1, cluster c2) {\n\t\tdouble closest = 4000;\n\t\tfor (point p1 : c1.getPoints()) {\n\t\t\tfor (point p2 : c2.getPoints()) {\n\t\t\t\tdouble dist = Math.sqrt(Math.pow( (p1.x() - p2.x()) , 2) + Math.pow( (p1.y() - p2.y()) , 2));\n\t\t\t\tif (dist < closest) {\n\t\t\t\t\tclosest = dist;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn closest;\n\t}", "private double distance(Position pos1, Position pos2)\r\n {\r\n assert pos1 != null;\r\n assert pos2 != null;\r\n\r\n int x = Math.abs(pos1.column() - pos2.column());\r\n int y = Math.abs(pos1.line() - pos2.line());\r\n\r\n return Math.sqrt(x * x + y * y);\r\n }", "public double distance(Point other) {\n double newX = this.x - other.getX();\n double newY = this.y - other.getY();\n return Math.sqrt((newX * newX) + (newY * newY));\n }", "double distanceSq (double px, double py);", "public double distance(double[] vector1, double[] vector2) throws MetricException;", "double getDistance(Point p);", "public static double calculateDistance(Point point1, Point point2){\n\n if (point1.getX() > point2.getX() || point1.getY() > point2.getY()){\n Point tmp = point1;\n point1 = point2;\n point2 = tmp;\n }\n\n double distance = Math.abs(Math.sqrt((point2.x - point1.x) * (point2.x - point1.x) + (point2.y - point1.y) * (point2.y - point1.y)));\n\n return distance;\n //return Math.ceil(distance * scale) / scale;\n }", "public static final double distance(final int x1, final int x2, final int y1, final int y2) {\r\n return Math.sqrt( ( (x2 - x1) * (x2 - x1)) + ( (y2 - y1) * (y2 - y1)));\r\n }", "public static float calculateDistance(Vec2 vecA, Vec2 vecB) {\n\t\treturn (float) Math.sqrt(\n\t\t\t\tMath.pow(vecA.x - vecB.x, 2)\n\t\t\t\t+\n\t\t\t\tMath.pow(vecA.y - vecB.y, 2)\n\t\t\t\t);\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 double distance(InputDatum datum, InputDatum datum2) throws MetricException;", "public double distance(final Coordinates other) {\n\t\treturn Math.sqrt(Math.pow((double) x - other.getX(), 2) + Math.pow((double) y - other.getY(), 2));\n\t}", "public double distance() {\n \tif (dist == -1) {\n \t\tdist = distance(vertex1, vertex2);\n \t}\n \n \treturn dist;\n }", "private static double distance(double lat1, double lat2, double lon1, double lon2,\n\t double el1, double el2) {\n\n\t final int R = 6371; // Radius of the earth\n\n\t Double latDistance = deg2rad(lat2 - lat1);\n\t Double lonDistance = deg2rad(lon2 - lon1);\n\t Double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n\t + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2))\n\t * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n\t Double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t double distance = R * c * 1000; // convert to meters\n\n\t double height = el1 - el2;\n\t distance = Math.pow(distance, 2) + Math.pow(height, 2);\n\t return Math.sqrt(distance);\n\t}", "public double getDistance(double x, double y, Point p)\n\t{\n\t\tdouble s1 = Math.sqrt((x - p.x)*(x - p.x) + (y - p.y)*(y - p.y));\n\t\treturn s1;\n\t}", "public double findEvolutionaryDistance(String label1, String label2) {\n PhyloTreeNode node1 = findTreeNodeByLabel(label1);\n PhyloTreeNode node2 = findTreeNodeByLabel(label2);\n if(node1 == null || node2 == null) {\n return java.lang.Double.POSITIVE_INFINITY;\n }\n PhyloTreeNode ancestor = findLeastCommonAncestor(node1, node2);\n return (findEvolutionaryDistanceHelper(ancestor, node1) + findEvolutionaryDistanceHelper(ancestor, node2));\n }", "public double distance(Point other) {\r\n double dx = this.x - other.getX();\r\n double dy = this.y - other.getY();\r\n return Math.sqrt((dx * dx) + (dy * dy));\r\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Enter the value of X1 and Y1\");\n\t\tdouble x1 = sc.nextDouble();\n\t\tdouble y1 =sc.nextDouble();\n\t\t\n\t\tSystem.out.println(\"Enter the value of X2 and Y2\");\n\t\tdouble x2 =sc.nextDouble();\n\t\tdouble y2 = sc.nextDouble();\n\t\t\n\t\tdouble a = Math.pow(x2-x1, 2) + Math.pow(y2-y1, 2);\n\t\t\n\t\tdouble distance = Math.sqrt(a) ;\n\t\tSystem.out.printf(\"%.4f\",distance);\n\n\t}", "public double calculateDistance(double latitude1, double longitude1, double latitude2, double longitude2)\n {\n latitude1 = Math.toRadians(latitude1);\n longitude1 = Math.toRadians(longitude1);\n latitude2 = Math.toRadians(latitude2);\n longitude2 = Math.toRadians(longitude2);\n\n double dlon = longitude2 - longitude1;\n double dlat = latitude2 - latitude1;\n\n double a = Math.pow((Math.sin(dlat/2)),2) + Math.cos(latitude1) * Math.cos(latitude2) * Math.pow(Math.sin(dlon/2),2);\n\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n //System.out.println(\"a: \" + a + \";c: \" + c + \";result: \" + (r*c));\n return r * c;\n }", "private double distance(double lat1, double lat2, double lon1, double lon2)\n {\n lon1 = Math.toRadians(lon1);\n lon2 = Math.toRadians(lon2);\n lat1 = Math.toRadians(lat1);\n lat2 = Math.toRadians(lat2);\n\n // Haversine formula\n double dlon = lon2 - lon1;\n double dlat = lat2 - lat1;\n double a = Math.pow(Math.sin(dlat / 2), 2)\n + Math.cos(lat1) * Math.cos(lat2)\n * Math.pow(Math.sin(dlon / 2),2);\n\n double c = 2 * Math.asin(Math.sqrt(a));\n\n // Radius of earth in kilometers. Use 3956\n // for miles\n double r = 6371;\n\n // calculate the result\n return(c * r);\n }", "public double getDistance(Node start, Node end) {\n\tstartX = start.getX();\n\tstartY = start.getY();\n\tendX = end.getX();\n\tendY = end.getY();\n\n int Xsquared = (startX - endX) * (startX - endX);\n\tint Ysquared = (startY - endY) * (startY - endY);\n\n\treturn Math.sqrt(Xsquared + Ysquared);\n\t\n }" ]
[ "0.8051838", "0.7971306", "0.7806096", "0.77365065", "0.7729238", "0.7688141", "0.7586136", "0.75584406", "0.75579476", "0.75359845", "0.74778175", "0.7399622", "0.73989415", "0.7390973", "0.7386147", "0.7379352", "0.73702574", "0.7366829", "0.7337556", "0.73208123", "0.73083156", "0.7296681", "0.72707504", "0.7248932", "0.72437894", "0.7240365", "0.721969", "0.7206137", "0.7187048", "0.7148218", "0.71300375", "0.7061725", "0.7055917", "0.7055801", "0.705323", "0.7051403", "0.7036005", "0.7031739", "0.70284736", "0.7024295", "0.70005393", "0.69915533", "0.6984299", "0.6978437", "0.69771314", "0.69746864", "0.69685626", "0.6964207", "0.69606256", "0.695837", "0.69562745", "0.6944126", "0.69137275", "0.68861574", "0.6856473", "0.6854837", "0.6854551", "0.68542117", "0.6833278", "0.68326217", "0.6827127", "0.6819757", "0.68016", "0.67957187", "0.6777785", "0.67709076", "0.6765666", "0.6735629", "0.67307043", "0.6726134", "0.6722891", "0.66908383", "0.6677995", "0.6672113", "0.6652212", "0.6652039", "0.663848", "0.66192967", "0.6617801", "0.66114414", "0.6609672", "0.66031504", "0.6595119", "0.6592603", "0.65918976", "0.6584069", "0.65671563", "0.6562562", "0.6541784", "0.65310246", "0.6530303", "0.6528521", "0.6524948", "0.6519407", "0.65120834", "0.6499629", "0.64972115", "0.6482639", "0.6469487", "0.64526784", "0.6452602" ]
0.0
-1
/ Calculates and returns the external index(Jacard) using the given ground truth and resultant clusterc obtained above.
public static double getJaccard() { double match = 0; double unmatch = 0; for(int i = 1;i<=totalGenes;i++) { int c1 = actualClusters.get(i); int r1 = resultClusters.get(i); for(int j=1;j<=totalGenes;j++) { int c2 = actualClusters.get(j); int r2 = resultClusters.get(j); if(c1 == c2 && r1 == r2) match++; else if( (c1 == c2 && r1 != r2) || (c1 != c2 && r1 == r2)) unmatch++; } } double jacard = match/(match+unmatch); return jacard; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double[][] findJaccardIndex(int[] idx, int[] class_idx) {\n\t\t// find domain for membership vector\n\t\tUniqueResult<Integer> idxUR = utils.findUnique(idx);\n\t\tint numClusters = idxUR.domain.length;\n\t\t\n\t\t// find domain for class distribution\n\t\tUniqueResult<Integer> class_idxUR = utils.findUnique(class_idx);\n\t\tint numClasses = class_idxUR.domain.length;\n\t\t\n\t\tdouble[][] res = new double[numClusters][numClasses];\n\t\tint row = -1;\n\t\tint col = -1;\n\t\t\n\t\t// run\n\t\tfor (Integer i : idxUR.domain) {\n\t\t\tcol = -1;\n\t\t\trow++;\n\t\t\tboolean[] a = utils.getIndexByValue(idx, i);\n\t\t\tfor (Integer j : class_idxUR.domain) {\n\t\t\t\tcol++;\n\t\t\t\tboolean[] b = utils.getIndexByValue(class_idx, j);\n\t\t\t\tboolean[] ab = utils.findAandB(a, b);\n\t\t\t\tint sum_ab = utils.findSum(ab);\n\t\t\t\tdouble div = (utils.findSum(a) + utils.findSum(b) - sum_ab);\n\t\t\t\tif (div != 0) {\n\t\t\t\t\tres[row][col] = sum_ab/div;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"ClusterUtils: findJaccardIndex: Divizion by Zero!\");\n\t\t\t\t\tres[row][col] = Double.POSITIVE_INFINITY;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// output\n\t\tif (verbose) {\n\t\t\tSystem.out.println(\"Jaccard coefficient:\");\n\t\t\t// print header\n\t\t\tSystem.out.printf(\"\\t\");\n\t\t\tfor (int j = 0; j < numClasses; j++) System.out.printf(\"%d\\t\", class_idxUR.domain[j]);\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t\t// print Jaccard matrix\n\t\t\tfor (int i = 0; i < numClusters; i++) {\n\t\t\t\tSystem.out.printf(\"%d.\\t\", idxUR.domain[i]);\n\t\t\t\tfor (int j = 0; j < numClasses; j++) {\n\t\t\t\t\tSystem.out.printf(\"%5.4f\\t\", res[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(\"\\n\");\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\treturn res;\n\t}", "public double[][] findJaccardIndex(int[] idx, int[] class_idx, int numClusters, int numClasses) {\n\t\tdouble[][] res = new double[numClusters][numClasses];\n\t\tfor (int i = 0; i < numClusters; i++) {\n\t\t\tboolean[] a = utils.getIndexByValue(idx, i);\n\t\t\tfor (int j = 0; j < numClasses; j++) {\n\t\t\t\tboolean[] b = utils.getIndexByValue(class_idx, j);\n\t\t\t\tboolean[] ab = utils.findAandB(a, b);\n\t\t\t\tint sum_ab = utils.findSum(ab);\n\t\t\t\tdouble div = (utils.findSum(a) + utils.findSum(b) - sum_ab);\n\t\t\t\tif (div != 0) {\n\t\t\t\t\tres[i][j] = sum_ab/div;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"ClusterUtils: findJaccardIndex: Divizion by Zero!\");\n\t\t\t\t\tres[i][j] = Double.MIN_VALUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}", "public int[] findClusterCorrespondence(int[] idx1, int[] idx2) {\n\t\tint n = idx1.length;\n\t\tif (n != idx2.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has to have same number of elements\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find unique values in idx1 and idx2\n\t\tUniqueResult<Integer> ur_idx1 = utils.findUnique(idx1);\n\t\tUniqueResult<Integer> ur_idx2 = utils.findUnique(idx2);\n\t\tif (ur_idx1.domain.length != ur_idx2.domain.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has different number of clusters\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find Jaccard coefficient\n\t\tdouble[][] J = findJaccardIndex(idx1, idx2);\n\t\t\n\t\t// use Hungarian method - use any kind of Hungarian algorithm\n\t\tHungarianAlgorithm h = new HungarianAlgorithm();\n\t\t@SuppressWarnings(\"static-access\")\n\t\tint[][] match = h.hgAlgorithm(J, \"max\");\n\t\t\n\t\t// print match matrix\n\t\tif (verbose) {\n\t\t\tSystem.out.println(\"Hunguarian Cost Matrix\");\n\t\t\tutils.printMatrix(match);\n\t\t}\n\t\t\n\t\t// relabel the idx2\n\t\tif (verbose) System.out.println(\"Class correspondents matrix:\");\n\t\tint[] target = idx1.clone();\n\t\tfor (int i = 0; i < match.length; i++) {\n\t\t\tint idx1_index = ur_idx1.domain[match[i][0]];\n\t\t\tint idx2_index = ur_idx2.domain[match[i][1]];\n\t\t\tif (verbose) System.out.printf(\"%d\\t%d\", idx1_index, idx2_index);\t\t\t\n\t\t\tif (idx1_index != idx2_index) {\n\t\t\t\tif (verbose) System.out.printf(\"\\t(will replace all %d in idx2 by %d)\", idx2_index, idx1_index);\n\t\t\t\tboolean[] index = utils.getIndexByValue(idx2, idx2_index);\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (index[j]) target[j] = idx1_index;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (verbose) System.out.printf(\"\\n\");\n\t\t}\n\t\t\n\t\tif (verbose) {\n\t\t\tint v_tt = 15;\n\t\t\tif (target.length < v_tt) v_tt = target.length;\n\t\t\tSystem.out.printf(\"Printing first %d elements of input and output arrays\\n\", v_tt);\n\t\t\tSystem.out.printf(\"IDX1\\tIDX2\\tFINAL IDX\\n\");\n\t\t\tfor (int i = 0; i < v_tt; i++) System.out.printf(\"%d\\t%d\\t%d\\n\", idx1[i], idx2[i], target[i]);\n\t\t}\n\t\t\n\t\treturn target;\n\t}", "public abstract long getIndex();", "int getC();", "String getClusteringKey(int index);", "protected abstract int applyGetIndex(CControlManager mgr, CDasherNode node);", "private int getClusterIndex(int element)\n\t{\n\t\tfor(int i=0; i<clusters.size(); i++)\n\t\t{\n\t\t\tVector v = (Vector)clusters.elementAt(i);\n\t\t\t\n\t\t\tif (v.contains(new Integer(element)))\n\t\t\t\treturn i;\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public int[] getCluster() {\r\n return this.clusters[this.clusterIndex];\r\n }", "int funkcjaRynkuGetIndex(float cena)\n\t{\n\t\tArrayList<Point> L1 =listaFunkcjiUzytecznosci.get(0);\n\n\t\tint a=0;\n\t\twhile (cena>L1.get(a).getPrice())\n\t\t{\n\t\t\ta++;\n\t\t}\n\t\t\n\t\tif(a>0)\n\t\t{\n\t\t\ta--;\n\t\t}\n\t\t\n\t\tif (a==L1.size())\n\t\t{\n\t\t\ta--;\t\n\t\t}\n\t\t\n\t\t\n\t\t//getInput(\"funkcjaRynkuGetIndex \"+a+\" cena \"+ cena);\n\t\t\t\n\t\treturn a;\n\t}", "public Integer getClusterNum(Integer key)\n{\n return NPchains.get(key);\n}", "void createIndex(){\n int index=0;\n for(int i=0;i<ancogs.size();i++)\n if(!cogToIndex.containsKey(ancogs.get(i).getValue2()))\n cogToIndex.put(ancogs.get(i).getValue2(), index++);\n}", "private int getIndex(char c) {\n // if the character is a-z then return 0-25 based on position in alphabet\n if (c >= 'a' && c <= 'z') {\n return c - 'a';\n }\n // if the character is an appostrophe return 26 (last element in node array)\n else if (c == '\\'') {\n return 26;\n }\n // if the character is not a-z nor an apostrophe, return -1 to signify error\n else {\n return -1;\n }\n }", "private int goalEntry0ind(int r, int c) {\n if (r == N - 1 && c == N - 1) return 0;\n else return N * r + c + 1;\n }", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public int nextAvailableCluster()\r\n\t{\r\n\t\tfor (int i = 0; i < MAX_CLUSTERS; i++)\r\n\t\t\tif (cluster[i] == false)\r\n\t\t\t\treturn i;\r\n\t\treturn -1;\r\n\t}", "private double jaccardIndexCross(Object m1, Object m2) \n\t{\n\t\treturn 0;\n\t}", "int freecabInd(int dest) {\n int index = 0;\n int min = 0;\n int minIndex = 0;\n\n for(int i=0;i<freeCab.length;i++){\n\n int matLandmark = matchingLandmark(freeCab[index][0], freeCab[index][1]);\n\n int dis = distance.dijkstra(adjancy, matLandmark, dest);\n\n if (dis < min) {\n min = dis;\n minIndex = index;\n }\n index++;\n\n }\n\n return minIndex;\n\n }", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "public abstract int getIndex();", "public double calc_c() {\r\n \t\t\r\n \t\tdouble cij = 0;\r\n \t\tint sum_i = 0;\r\n \t\tint sum_j = 0;\r\n \t\tint diff = 0;\r\n \t\tint state = 0;\r\n \t\t\r\n \t\tdouble li, lri, lj, lrj;\r\n \t\t\r\n \t\tList<Integer> samestate_i = new ArrayList<>();\r\n \t\tList<Integer> samestate_j = new ArrayList<>();\r\n \t\t\r\n \t\tList<Double> gradient_i = new ArrayList<>();\r\n \t\tList<Double> gradient_j = new ArrayList<>();\r\n \t\t\r\n\t\t// if the time step is less than the window cij is initialized to zero.\r\n\t\tif(this.n <= this.w || this.w <2) {\r\n\t\t\tcij = 0;\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t// else we determine the state of the region i and region j of which\r\n\t\t\t// we are calculating the cij for\r\n\t \t\tDeterminestate di = new Determinestate(this.i, this.n);\r\n\t\t\tDeterminestate dj = new Determinestate(this.j, this.n);\r\n\t\t\t\r\n\t\t\tProbability pi = new Probability(this.i, this.n, this.w, this.neighborsize);\r\n\t\t\tProbability pj = new Probability(this.i, this.n, this.w, this.neighborsize);\r\n\t\t\t\r\n\t\t\tif(di.regionCurrentstate() == dj.regionCurrentstate()) {\r\n\t\t\t\tli = pi.getLsave().get(0);\r\n\t\t\t\tlj = pj.getLsave().get(0);\r\n\t\t\t\tstate = 0;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tli = pi.getLsave().get(1);\r\n\t\t\t\tlj = pj.getLsave().get(1);\r\n\t\t\t\tstate =1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// for the time window\r\n\t\t\tfor(int k=1; k<this.w; k++) {\r\n\t\t\t\t\r\n\t\t\t\t// determine the state of i and j in the in n-k time step\r\n\t \t\t\tDeterminestate dri = new Determinestate(this.i, this.n-k);\r\n\t \t\t\tDeterminestate drj = new Determinestate(this.j, this.n-k);\r\n\t \t\t\t\r\n\t \t\t\tProbability pri = new Probability(this.i, this.n, this.w, this.neighborsize);\r\n\t\t\t\tProbability prj = new Probability(this.i, this.n, this.w, this.neighborsize);\r\n\t\t\t\t\r\n\t\t\t\tlri = pri.getLsave().get(state);\r\n\t\t\t\tlrj = prj.getLsave().get(state);\r\n\t \t\t\t\r\n\t \t\t\t\r\n\t \t\t\t//if state matches for i make a list of time step in which they match and another list of gradient of Likelihood \r\n\t \t\t\tif(di.regionCurrentstate() == dri.regionCurrentstate()){\r\n\t \t\t\t\tsamestate_i.add(k);\r\n\t \t\t\t\tgradient_i.add(li - lri);\r\n\t \t\t\t}\r\n\t \t\t\t\r\n\t \t\t\t//if state matches for j make a list of time step in which they match and another list of gradient of Likelihood \r\n\t \t\t\tif(di.regionCurrentstate() == drj.regionCurrentstate()){\r\n\t \t\t\t\tsamestate_j.add(k);\r\n\t \t\t\t\tgradient_j.add(lj - lrj);\r\n\t \t\t\t}\r\n\t \t\t\t\r\n\t \t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t// if no match found return zero\r\n\t\tif(samestate_i.size() == 0 || samestate_j.size() == 0) {\r\n\t\t\tcij = 0;\r\n\t\t}\r\n\t\t\r\n\t\t// else calculate cij\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t// if both have same length \r\n\t\t\tif(samestate_i.size() == samestate_j.size()) {\r\n\t\t\t\tfor(int i=0; i<samestate_i.size(); i++) {\r\n\t\t\t\t\tsum_i = sum_i + samestate_i.get(i);\r\n\t\t\t\t\tsum_j = sum_j + samestate_j.get(i);\r\n\t\t\t\t}\r\n\t\t\t\tdiff = (sum_i%this.w - sum_j%this.w);\r\n\t\t\t\tif (diff == 0) {\r\n\t\t\t\t\tcij = cosine_sim(gradient_i, gradient_j);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcij = cosine_sim(gradient_i, gradient_j) * Math.abs(diff/(double)this.w);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//if i is smaller\r\n\t\t\telse if(samestate_i.size() < samestate_j.size()) {\r\n\t\t\t\tfor(int i=0; i<samestate_i.size(); i++) {\r\n\t\t\t\t\tsum_i = sum_i + samestate_i.get(i);\r\n\t\t\t\t\tsum_j = sum_j + samestate_j.get(i);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tdiff = (sum_i%this.w - sum_j%this.w);\r\n\t\t\t\tif (diff == 0) {\r\n\t\t\t\t\tcij = cosine_sim(gradient_i.subList(0, samestate_i.size()), gradient_j);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcij = cosine_sim(gradient_i.subList(0, samestate_i.size()), gradient_j) * diff/(double)this.w;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if j is smaller \r\n\t\t\telse {\r\n\t\t\t\tfor(int i=0; i<samestate_j.size(); i++) {\r\n\t\t\t\t\tsum_i = sum_i + samestate_i.get(i);\r\n\t\t\t\t\tsum_j = sum_j + samestate_j.get(i);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tdiff = (sum_i%this.w - sum_j%this.w);\r\n\t\t\t\tif (diff == 0) {\r\n\t\t\t\t\tcij = cosine_sim(gradient_i.subList(0, samestate_j.size()), gradient_j);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcij = cosine_sim(gradient_i.subList(0, samestate_j.size()), gradient_j) * diff/(double)this.w;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (Double.isNaN(cij)) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn cij;\r\n\t\t}\r\n \t}", "private int getCharacterIndex(Character c, int index) {\r\n if (c instanceof CommonInfected) {\r\n return (index % cInfectedNum);\r\n\t\t}\r\n else if (c instanceof Tank) {\r\n return (index % tankNum);\r\n\t\t}\r\n else if (c instanceof Child) {\r\n return (index % childNum);\r\n\t\t}\r\n else if (c instanceof Teacher) {\r\n return (index % teacherNum);\r\n\t\t}\r\n else if (c instanceof Soldier) {\r\n return (index % soldierNum);\r\n\t\t}\r\n else {\r\n return -1;\r\n\t\t}\r\n }", "public static void main(String[] args) throws CorruptIndexException, LockObtainFailedException, IOException, ParseException{\n\t\tboolean lucene_im_mem = false;\n\t\t//1. Build the Index with varying \"database size\"\n\t\tString dirName =\"/data/home/duy113/SupSearchExp/AIDSNew/\";\n//\t\tString dirName = \"/Users/dayuyuan/Documents/workspace/Experiment/\";\n\t\tString dbFileName = dirName + \"DBFile\";\n\t\tString trainQueryName= dirName + \"TrainQuery\";\n//\t\tString testQuery15 = dirName + \"TestQuery15\";\n\t\tString testQuery25 = dirName + \"TestQuery25\";\n//\t\tString testQuery35 = dirName + \"TestQuery35\";\n\t\tGraphDatabase query = new GraphDatabase_OnDisk(testQuery25, MyFactory.getSmilesParser());\n\t\tdouble[] minSupts = new double[4];\n\t\tminSupts[0] = 0.05; minSupts[1] = 0.03; minSupts[2] =0.02; minSupts[3] = 0.01;\n \t\tint lwIndexCount[] = new int[1];\n\t\tlwIndexCount[0] = 479;\t\n//\t\tSystem.out.println(\"Build CIndexFlat Left-over: \");\n//\t\tfor(int j = 3; j< 4; j++){\n//\t\t\tdouble minSupt = minSupts[j];\n//\t\t\tfor(int i = 4; i<=10; i = i+2){\n//\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n//\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n//\t\t\t\tif(i == 2){\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n//\t\t\t\t\tCIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n//\t\t\t\t}\n//\t\t\t\telse{\n//\t\t\t\t\tString featureBaseName = dirName + \"G_2\" + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat with Features \" + featureBaseName);\n//\t\t\t\t\tCIndexExp.buildIndex(featureBaseName, trainingDB, baseName, minSupt);\n//\t\t\t\t}\n//\t\t\t\tSystem.gc();\n//\t\t\t}\n//\t\t}\n\t\tSystem.out.println(\"Run Query Processing: \");\n\t\tfor(int j = 0; j< 4; j++){\n\t\t\tdouble minSupt = minSupts[j];\n\t\t\tfor(int i = 2; i<=10; i = i+2){\n\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n\t\t\t\tif(j!=0 || i!=2){\n\t\t\t\t\tSystem.out.println(baseName + \"LWindex\");\n\t\t\t\t\t//LWIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, trainQuery.getParser(),baseName, minSupt, lwIndexCount);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndex\");\n\t\t\t\t\t//PrefixIndexExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndexHi\");\n\t\t\t\t\t//PrefixIndexExp.buildHiIndex(trainingDB, trainingDB, 2, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"GPTree\");\n\t\t\t\t\t//GPTreeExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n\t\t\t\t\t//CIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t}\n\t\t\t\tif(j==0&&i==2){\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\t\tCIndexExp.buildIndexTopDown(trainingDB, trainQuery, trainingDB,MyFactory.getUnCanDFS(), baseName, minSupt, 2*trainQuery.getTotalNum()/lwIndexCount[0] ); // 8000 test queries\n\t\t\t\t\t//System.gc();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\tSystem.gc();\n\t\t\t}\n\t\t}\n\t\tAIDSLargeExp.main(args);\n\t}", "public int getIndex();", "public int getIndex();", "public int getIndex();", "public abstract int getNeighboursNumber(int index);", "default Pair<Crosslink, List<ValidatorIndex>> get_winning_crosslink_and_attesting_indices(\n BeaconState state, EpochNumber epoch, ShardNumber shard) {\n List<PendingAttestation> shard_attestations = get_matching_source_attestations(state, epoch)\n .stream().filter(a -> a.getData().getShard().equals(shard)).collect(toList());\n List<Crosslink> shard_crosslinks = shard_attestations.stream()\n .map(a -> get_crosslink_from_attestation_data(state, a.getData())).collect(toList());\n List<Crosslink> candidate_crosslinks = shard_crosslinks.stream()\n .filter(c -> {\n Hash32 root = hash_tree_root(state.getCurrentCrosslinks().get(shard));\n return root.equals(c.getPreviousCrosslinkRoot()) || root.equals(hash_tree_root(c));\n }).collect(toList());\n if (candidate_crosslinks.isEmpty()) {\n return Pair.with(new Crosslink(getConstants().getGenesisEpoch(), Hash32.ZERO, Hash32.ZERO),\n Collections.emptyList());\n }\n\n Crosslink winning_crosslink = candidate_crosslinks.stream()\n .max((c1, c2) -> {\n Gwei b1 = get_attesting_balance(state, get_attestations_for(state, shard_attestations, c1));\n Gwei b2 = get_attesting_balance(state, get_attestations_for(state, shard_attestations, c2));\n if (b1.equals(b2)) {\n return c1.getCrosslinkDataRoot().toString().compareTo(c2.getCrosslinkDataRoot().toString());\n } else {\n return b1.compareTo(b2);\n }\n }).get();\n\n return Pair.with(winning_crosslink,\n get_unslashed_attesting_indices(state,\n get_attestations_for(state, shard_attestations, winning_crosslink)));\n }", "private static int getClusterCorrespondance(Integer cl1, Integer cl2,\n HashMap<Integer, HashMap<Integer, Integer>> clusterCorresp, int nextId)\n{\n HashMap<Integer, Integer> map = clusterCorresp.get(cl1);\n if (map == null) {\n map = new HashMap<Integer, Integer>();\n map.put(cl2, nextId);\n clusterCorresp.put(cl1, map);\n return nextId;\n }\n Integer corresp = map.get(cl2);\n if (corresp == null) {\n map.put(cl2, nextId);\n return nextId;\n }\n return corresp.intValue();\n}", "private void getNeighbouringCells(Index3D current, Index3D center, int clusterLabel) {\n\n int integerIndexForm = current.i1() + current.i2() * x + current.i3() * x * y;\n\n /**Check if the voxel is part of the cluster */\n if ((getLabel(current) == clusterLabel) &&\n !cellCluster.contains(integerIndexForm)) {\n\n if (!current.equals(center)) {\n voxelStack.push(current);\n }\n\n /**Spread recursively from the voxel if it exists within the\n * boundary of the center voxel */\n if (checkSubBoundary(current, center)) {\n cellCluster.add(integerIndexForm);\n\n /**Check for all 26-neighbour voxels reachable from the\n * current voxel */\n for (int i = current.i1() - 1; i < x\n && i >= 0 && i <= current.i1() + 1; i++) {\n for (int j = current.i2() - 1; j < y\n && j >= 0 && j <= current.i2() + 1; j++) {\n for (int k = current.i3() - 1; k < z\n && k >= 0 && k <= current.i3() + 1; k++) {\n getNeighbouringCells(new Index3D(i, j, k), center, clusterLabel);\n }\n }\n }\n }\n }\n }", "Expression getIndexExpr();", "private static double getInterClusterScore(List<String> cluster) {\n\n\t\tPair<String, String> pair = null;\n\n\t\tdouble score = 1;\n\t\tdouble tempScore = 0;\n\n\t\t// System.out.println(\"CL size \" + cluster.size());\n\t\tif (cluster.size() <= 1)\n\t\t\treturn 0;\n\n\t\tfor (int outer = 0; outer < cluster.size(); outer++) {\n\t\t\tfor (int inner = outer + 1; inner < cluster.size(); inner++) {\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(outer)\n\t\t\t\t\t\t.trim(), cluster.get(inner).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(\n\t\t\t\t\t\t\t\tinner).trim(), cluster.get(outer).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// for sum of all pairwise scores\n\t\t\t\t// score = score + tempScore;\n\n\t\t\t\t// for the minimum inter cluster score\n\t\t\t\tscore = (score >= tempScore) ? tempScore : score;\n\t\t\t}\n\t\t}\n\t\treturn score;\n\t}", "protected static int tableIndex(int hc, int lm1)\n {\n hc ^= (hc >>> 20) ^ (hc >>> 12);\n hc ^= (hc >>> 7) ^ (hc >>> 4);\n return hc & lm1;\n }", "public int[] getIndexReference(){\r\n \treturn this.index;\r\n \t}", "private void calculateIndex() {\n for(int i=0; i<matrix.length; i++) {\n for(int j=0; j<matrix.length; j++) {\n if(matrix[i][j] == 0) {\n index = (i*matrix.length)+(j+1);\n return;\n }\n }\n }\n }", "public int contenuto(int r, int c) { return contenutoCaselle[r][c]; }", "public int hIndex(int[] citations) {\n int n = citations.length;\n int lo = 0;\n int hi = n - 1;\n while (lo < hi) {\n int mid = lo + (hi - lo) / 2;\n if (citations[mid] < n - mid) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n return citations[n - 1] == 0 ? 0 : n - lo;\n }", "private int correspondingIndex(ObjectID oid, ObjectID[] id_seq_at_replica, int start)\r\n\t{\n\t\tint iadj = start;\r\n\t\tint index = -1;\r\n\t\twhile (index == -1) {\r\n\t\t\tindex = indexOf(id_seq_at_replica[iadj++]);\r\n\t\t}\r\n\t\treturn index;\r\n\t}", "public int getConstituentIndex() {\n return this.constituentIndex;\n }", "private static int getCustomerIndex(List<Integer> customer){\n return customer.get(0);\n }", "int index();", "public static int getIndex(int i,int j){\r\n\t\t return i+(Variables.N+2)*j;\r\n\t }", "public static void extractKCoreAndConnectedComponent(double threshold) throws IOException, ParseException, Exception {\n String[] prefixYesNo = {\"yes\", \"no\"};\n for (String prefix : prefixYesNo) {\n\n // Get the number of clusters\n int c = getNumberClusters(RESOURCES_LOCATION + prefix + \"_graph.txt\");\n\n // Get the number of nodes inside each cluster\n List<Integer> numberNodes = getNumberNodes(RESOURCES_LOCATION + prefix + \"_graph.txt\", c);\n\n PrintWriter pw_cc = new PrintWriter(new FileWriter(RESOURCES_LOCATION + prefix + \"_largestcc.txt\")); //open the file where the largest connected component will be written to\n PrintWriter pw_kcore = new PrintWriter(new FileWriter(RESOURCES_LOCATION + prefix + \"_kcore.txt\")); //open the file where the kcore will be written to\n\n // create the array of graphs\n WeightedUndirectedGraph[] gArray = new WeightedUndirectedGraph[c];\n for (int i = 0; i < c; i++) {\n System.out.println();\n System.out.println(\"Cluster \" + i);\n\n gArray[i] = new WeightedUndirectedGraph(numberNodes.get(i) + 1);\n\n // Put the nodes,\n NodesMapper<String> mapper = new NodesMapper<String>();\n gArray[i] = addNodesGraph(gArray[i], i, RESOURCES_LOCATION + prefix + \"_graph.txt\", mapper);\n\n //normalize the weights\n gArray[i] = normalizeGraph(gArray[i]);\n\n AtomicDouble[] info = GraphInfo.getGraphInfo(gArray[i], 1);\n System.out.println(\"Nodes:\" + info[0]);\n System.out.println(\"Edges:\" + info[1]);\n System.out.println(\"Density:\" + info[2]);\n\n // extract remove the edges with w<t\n gArray[i] = SubGraphByEdgesWeight.extract(gArray[i], threshold, 1);\n\n // get the largest CC and save to a file\n WeightedUndirectedGraph largestCC = getLargestCC(gArray[i]);\n saveGraphToFile(pw_cc, mapper, largestCC.in, i);\n\n // Get the inner core and save to a file\n WeightedUndirectedGraph kcore = kcore(gArray[i]);\n saveGraphToFile(pw_kcore, mapper, kcore.in, i);\n }\n\n pw_cc.close();\n pw_kcore.close();\n }\n }", "public int getNBCInoperative();", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private int resolveIndex(Label l){\n\t\tif(l == null){\n\t\t\tthrow new NullPointerException(\"cannot resolve index of ConfusionMatrix of null label/class (null Label object)\");\n\t\t}\n\n\t\tString key = l.getValue();\n\n\t\tif(l.isEmpty()){\n\t\t\tthrow new IllegalArgumentException(\"cannot resolve index of ConfusionMatrix of emtpy label/class value\");\n\t\t}\n\n\t\tif(!indexMap.containsKey(key)){\n\t\t\tthrow new IllegalArgumentException(\"could not resolve ConfusionMatrix index for unknown label: \"+key);\n\t\t}\n\t\treturn indexMap.get(key);\n\n\t}", "public int getAccessibleIndex(int r, int c) {\n try {\n return unoAccessibleTable.getAccessibleIndex(r,c);\n } catch (com.sun.star.lang.IndexOutOfBoundsException e) {\n return -1;\n } catch (com.sun.star.uno.RuntimeException e) {\n return -1;\n }\n }", "public void displayResults() {\n\t\tcreateCluster();\n\t\tassignClusterID();\n\t\tSystem.out.println(iterations);\n\t\tWriter writer;\n\t\ttry {\n\t\t\twriter = new FileWriter(\"/Users/saikalyan/Documents/ClusterResult_kmeans.txt\");\n\t\t\tfor (int key : labelsMap.keySet()) {\n\t\t\t\tclusterResultsList.add(clusterIdMap.get(labelsMap.get(key)));\n\t\t\t\twriter.write(String.valueOf(clusterIdMap.get(labelsMap.get(key))));\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t\tSystem.out.println(key + \" : \" + clusterIdMap.get(labelsMap.get(key)));\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tExternalValidator extValidation = new ExternalValidator(count, groundTruthList, clusterResultsList);\n\n\t\tfloat res = extValidation.getCoefficient();\n\t\tSystem.out.println(\"Rand Index------------\" + res);\n\n\t\tfloat jaccard = extValidation.getJaccardCoeff();\n\t\tSystem.out.println(\"Jaccard co-efficient------------\" + jaccard);\n\n\t}", "public int index();", "int getNNZ(){\n return this.nnz;\n }", "public double computeSimilarity(int[] cluster1, int[] cluster2);", "public int findEntranceIndex() {\n for (int i = 0; i < cells.size() ; i++) {\n if (cells.get(i) == CellState.Entrance) { // Entrance -> indexEntrance\n return i;\n }\n }\n return -1;\n }", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "int getIndex(Character c)\n{\n int a = Character.getNumericValue('a');\n int z = Character.getNumericValue('z');\n int val = Character.getNumericValue(c);\n \n if (a <= val && val <= z) return val - a;\n return -1;\n}", "@VTID(10)\n int getIndex();", "@Test\n\tpublic void testGettingIndexOfKing()\n\t{\n\t\t// arrange\n\t\tData d = new Data();\n\t\t// act\n\t\tint index = d.getIndex(61);\n\n\t\t// assert\n\t\tassertEquals(index, 0); // the king lives in the index 0\n\t}", "private int getSelectedCustomerIndex() {\n\t\tString selection = (String) nameBox.getSelectedItem();\t//retrieves the selected name\n\t\ttempInt = 0;\t\t\t\t\t\t\t\t\t\t\t//resets the tempInt to zero\n\t\tfor (int i = 0; i < pcArray.size(); i++) {\t\t\t\t//loops for every preferred customer in the array\n\t\t\tif (selection.equals(pcArray.get(i).getFName())) {\t\t//if a customer matches the chosen name then..\n\t\t\t\ttempInt = i;\t\t\t\t\t\t\t\t\t\t\t//sets the tempInt to the arrays index\n\t\t\t\ti = pcArray.size();\t\t\t\t\t\t\t\t\t\t//sets the iterator to the last index\n\t\t\t} //end if\n\t\t} //end for loop\n\t\treturn tempInt;\t//return the array index\n\t}", "protected short getConstantPoolIndex(int rawcode, int bci) {\n String fmt = Bytecodes.format(rawcode);\n int cpCacheIndex;\n switch (fmt.length()) {\n case 2: cpCacheIndex = method.getBytecodeByteArg(bci); break;\n case 3: cpCacheIndex = method.getBytecodeShortArg(bci); break;\n case 5:\n if (fmt.indexOf(\"__\") >= 0)\n cpCacheIndex = method.getBytecodeShortArg(bci);\n else\n cpCacheIndex = method.getBytecodeIntArg(bci);\n break;\n default: throw new IllegalArgumentException();\n }\n\n if (cpCache == null) {\n return (short) cpCacheIndex;\n } else if (fmt.indexOf(\"JJJJ\") >= 0) {\n // Invokedynamic require special handling\n cpCacheIndex = ~cpCacheIndex;\n cpCacheIndex = bytes.swapInt(cpCacheIndex);\n return (short) cpCache.getEntryAt(cpCacheIndex).getConstantPoolIndex();\n } else if (fmt.indexOf(\"JJ\") >= 0) {\n // change byte-ordering and go via cache\n return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort((short)cpCacheIndex))).getConstantPoolIndex();\n } else if (fmt.indexOf(\"j\") >= 0) {\n // go via cache\n return (short) cpCache.getEntryAt((int) (0xFF & cpCacheIndex)).getConstantPoolIndex();\n } else {\n return (short) cpCacheIndex;\n }\n }", "public double getClusterCoefficientJUNG()\r\n\t{\n\t\tMap<Entity, Double> coefficients = Metrics\r\n\t\t\t\t.clusteringCoefficients(undirectedGraph);\r\n\t\tdouble coefficientSum = 0.0;\r\n\t\t// logger.info(\"Clustering coefficients: \" + coefficients);\r\n\t\tfor (Entity vertex : coefficients.keySet()) {\r\n\t\t\t// logger.info(vertex + ((JUNGEntityVertex)\r\n\t\t\t// vertex).getVertexEntity());\r\n\t\t\tcoefficientSum += coefficients.get(vertex);\r\n\t\t}\r\n\t\treturn coefficientSum / getNumberOfNodes();\r\n\t}", "default int getIndex() {\n return meta(\"nlpcraft:nlp:index\");\n }", "public IntArrayList getNeighbourCluster(int index) {\n\n /**List for storing the indexes of the cells in the cluster containing\n * the given index */\n cellCluster = new IntArrayList();\n\n /**The label of the cluster */\n int clusterLabel = (int) labelledVolume.value(index);\n\n /**Clear the linked list for the use of this algorithm */\n voxelStack.clear();\n voxelStack.push(imageMask.indexToGrid(index));\n\n /**Use iteration and recursion to get all the cells\n * within the cluster */\n while (voxelStack.size() > 0) {\n Index3D center = voxelStack.pop();\n getNeighbouringCells(center, center, clusterLabel);\n }\n return cellCluster;\n }", "private int getIndex(int val){\n return val%bucket;\n }", "public abstract int compile(byte bc[], int index);", "public long getNodeIndex();", "public int hIndexV1(int[] citations) {\n int n = citations.length;\n int lo = 0;\n int hi = n - 1;\n while (lo <= hi) {\n int mid = lo + (hi - lo) / 2;\n if (citations[mid] == n - mid) {\n return n - mid;\n } else if (citations[mid] < n - mid) {\n lo = mid + 1;\n } else {\n hi = mid - 1;\n }\n }\n return n - lo;\n }", "private long getPrefixValue(int preIndex){\n long result = 0;\n for(int index = 0; index<=preIndex;index++){\n result = result^array[index];\n }\n return result;\n }", "@TimeComplexity(\"O(1)\")\n\tpublic int index()\n\t{\n\t\t//TCJ: the cost does not vary with input size so it is constant\n\t\treturn index;\n\t}", "protected abstract int getBucketIndex(int freeSpace);", "public int indexHrany(String zacatek,String cil){\n\t\tint pom = -1;\n\t\tfor(int i = 0;i < pocetHr; i++){\n\t\t\t//v pripade ze jsou hrany neorintovane\n\t\t\tif(hrana[i].typ == '-'){\n\t\t\t\tif(hrana[i].zacatek.equals(zacatek) || hrana[i].zacatek.equals(cil)){\n\t\t\t\t\tif(hrana[i].konec.equals(cil) || hrana[i].konec.equals(zacatek)){\n\t\t\t\t\t\tpom = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//v pripade ze jsou hrany orientovane\n\t\t\tif(hrana[i].typ == '>'){\n\t\t\t\tif(hrana[i].zacatek.equals(zacatek)){\n\t\t\t\t\tif(hrana[i].konec.equals(cil)){\n\t\t\t\t\t\tpom = i;\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}\n\t\t}\n\t\treturn pom;\n\t}", "public static int getHomeCellIndex()\n {\n switch (TurnController.getPlayerTurn())\n {\n case BLUE:\n return 48;\n case RED:\n return 55;\n case GREEN:\n return 62;\n case YELLOW:\n return 69;\n }\n return -1;\n }", "public IndexON getIndex() {\n return _index;\n }", "private int getArrayIndex() {\n\t\tswitch (getId()) {\n\t\tcase 3493:\n\t\t\treturn Recipe_For_Disaster.AGRITH_NA_NA_INDEX;\n\t\tcase 3494:\n\t\t\treturn Recipe_For_Disaster.FLAMBEED_INDEX;\n\t\tcase 3495:\n\t\t\treturn Recipe_For_Disaster.KARAMEL_INDEX;\n\t\tcase 3496:\n\t\t\treturn Recipe_For_Disaster.DESSOURT_INDEX;\n\t\t}\n\t\treturn -1;\n\t}", "public int findCourseIndex(Course c) {\n return courseList.indexOf(c);\n }", "private Matrix nadir_dcm(double jd, VectorN xsc, int cbody, int vbody){\n\t\tVectorN xce = new VectorN(3);\r\n\t\tVectorN xve = new VectorN(3);\r\n\t\tif(cbody==BODY_EARTH){\r\n\t\t\txce = new VectorN(3);\r\n\t\t}else if(cbody == BODY_MOON){\r\n\t\t\t//* TODO watch units\r\n\t\t\txce = new VectorN(ephem.get_planet_pos(DE405_Body.GEOCENTRIC_MOON, TimeUtils.TTtoTDB(TimeUtils.UTCtoTT(TimeUtils.JDtoMJD(jd))))).times(1000);\r\n\t\t}\r\n\t\t//% Second get vbody relative to earth\r\n\t\t//xve=feval(vbody.fn,jd);\r\n\t\tif(vbody==BODY_EARTH){\r\n\t\t\txve = new VectorN(3);\r\n\t\t}else if(vbody == BODY_MOON){\r\n\t\t\txve = new VectorN(ephem.get_planet_pos(DE405_Body.GEOCENTRIC_MOON, TimeUtils.TTtoTDB(TimeUtils.UTCtoTT(TimeUtils.JDtoMJD(jd))))).times(1000);\r\n\t\t}\r\n\t\t\r\n\t\t//% Finally spacecraft relative to vbody\r\n\t\tVectorN xsv= xsc.get(0,3).plus(xce.minus(xve));\r\n\r\n\t\t//% Get unit vector from vbody to spacecraft\r\n\t\t//xsvnorm=norm(xsv(1:3));\r\n\t\tVectorN xsvhat=xsv.unitVector();\r\n\r\n\r\n\t\tVectorN zm=xsvhat.times(-1.0);\r\n\t\tVectorN z = new VectorN(0.0,0.0,1.0);\r\n\t\tVectorN xm=z.crossProduct(zm);\r\n\t\txm= xm.unitVector();\r\n\t\tVectorN ym=zm.crossProduct(xm);\r\n\t\tMatrix A_sensor_2_inertial= new Matrix(3);\r\n\t\tA_sensor_2_inertial.A[0][0] = xm.x[0];\r\n\t\tA_sensor_2_inertial.A[1][0] = xm.x[1];\r\n\t\tA_sensor_2_inertial.A[2][0] = xm.x[2];\r\n\t\tA_sensor_2_inertial.A[0][1] = ym.x[0];\r\n\t\tA_sensor_2_inertial.A[1][1] = ym.x[1];\r\n\t\tA_sensor_2_inertial.A[2][1] = ym.x[2];\r\n\t\tA_sensor_2_inertial.A[0][2] = zm.x[0];\r\n\t\tA_sensor_2_inertial.A[1][2] = zm.x[1];\r\n\t\tA_sensor_2_inertial.A[2][2] = zm.x[2];\r\n\t\t\r\n\t\treturn A_sensor_2_inertial.transpose();\r\n\t}", "public static native void OpenMM_AmoebaMultipoleForce_getCovalentMaps(PointerByReference target, int index, PointerByReference covalentLists);", "public IndexDatabase(String index_path) {\n int k;\n long p;\n try {\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n kmers_num = read_long(pre_file);\n suf_len = K - pre_len;\n key = new kmer(K, pre_len, suf_len);\n System.out.println(\"Indexing \" + kmers_num + \" kmers... \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n }\n pre_buff = null;\n }\n pre_file.close();\n // mapping suffix file into the memory\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n } catch (IOException e) {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "@Test\n public void testCreateIdxOnClient() {\n getDefaultCacheOnClient().query(new SqlFieldsQuery(((\"CREATE INDEX IDX_11 ON \" + (GridCacheDynamicLoadOnClientTest.FULL_TABLE_NAME)) + \" (name asc)\"))).getAll();\n }", "int getMinAvailable(ClusterSpec clusterSpec);", "public int getBlockIndex(int block){\n for(int i=0;i<localCache.length;i++){\n if(localCache[i].isOccupied && localCache[i].blockID==block)\n return i;\n }\n return -1;\n }", "private int getNeighbours(Container[][][] buffer) {\n int neighbours = 0;\n if (indexPosition.x + 1 < buffer.length && buffer[(int) indexPosition.x + 1][(int) indexPosition.y][(int) indexPosition.z] != null) {\n neighbours++;\n }\n if (indexPosition.x - 1 >= 0 && buffer[(int) indexPosition.x - 1][(int) indexPosition.y][(int) indexPosition.z] != null) {\n neighbours++;\n }\n if (indexPosition.y + 1 < buffer[0].length && buffer[(int) indexPosition.x][(int) indexPosition.y + 1][(int) indexPosition.z] != null) {\n neighbours++;\n }\n if (indexPosition.y - 1 >= 0 && buffer[(int) indexPosition.x][(int) indexPosition.y - 1][(int) indexPosition.z] != null) {\n neighbours++;\n }\n if (indexPosition.z + 1 < buffer[0][0].length && buffer[(int) indexPosition.x][(int) indexPosition.y][(int) indexPosition.z + 1] != null) {\n neighbours++;\n }\n if (indexPosition.z - 1 >= 0 && buffer[(int) indexPosition.x][(int) indexPosition.y][(int) indexPosition.z - 1] != null) {\n neighbours++;\n }\n return neighbours;\n }", "int score(OfcHandMatrix matrix);", "private int indexOfClef(Object c) {\n for (int i = 0; i < nbAssoc; i++)\n if (associations[i].premier().equals(c))\n return i;\n return -1;\n }", "public File cluster() throws IOException, InterruptedException {\n Runtime r = Runtime.getRuntime();\n Process p = r.exec(mclExecutablePath + \" \" + fileName + \" -o \" + fileName + \".I20\");\n p.waitFor();\n clusterResultFile = new File(fileName + \".I20\");\n return clusterResultFile;\n }", "public String getCluster() {\n return this.cluster;\n }", "public String getCluster() {\n return this.cluster;\n }", "public int[][] getMatriceAdjacence()\n {\n return matriceAdjacence;\n }", "private int getIndex2(int val){\n return val/bucket;\n }" ]
[ "0.59268117", "0.55176276", "0.55075204", "0.54425555", "0.52222866", "0.51913303", "0.5191169", "0.51555234", "0.51544094", "0.5106042", "0.5053124", "0.49960068", "0.49948123", "0.49855486", "0.49760833", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.49749827", "0.496541", "0.4908722", "0.4890109", "0.48744905", "0.4866039", "0.48608524", "0.48378968", "0.48314488", "0.4829469", "0.4829469", "0.4829469", "0.48054275", "0.4762103", "0.47542334", "0.47532403", "0.47516766", "0.47426957", "0.47403994", "0.4733839", "0.47302416", "0.47286516", "0.4727188", "0.47169816", "0.4693048", "0.4692944", "0.46719477", "0.466499", "0.4659637", "0.46565965", "0.4639711", "0.46307018", "0.46275783", "0.46175557", "0.46161854", "0.46083194", "0.46057796", "0.46006754", "0.45933294", "0.45882437", "0.4573975", "0.45673472", "0.45545256", "0.45531687", "0.45520458", "0.45504153", "0.45494062", "0.4548846", "0.45463848", "0.45450318", "0.4543456", "0.4541689", "0.45408088", "0.45351222", "0.4533691", "0.45289645", "0.45268232", "0.451705", "0.45157906", "0.45141408", "0.45136902", "0.45128864", "0.4510703", "0.4508856", "0.45081496", "0.45080674", "0.4508027", "0.44990912", "0.4496121", "0.44958124", "0.44958124", "0.44930995", "0.4491104" ]
0.60031796
0
Constructs a new image style. All attributes are optional except type.
@JsonCreator public ImageStyle ( final @JsonProperty ("type") String type, final @JsonProperty ("opacity") Double opacity, final @JsonProperty ("rotateWithView") Boolean rotateWithView, final @JsonProperty ("rotation") Double rotation, final @JsonProperty ("scale") Double scale, final @JsonProperty ("snapToPixel") Boolean snapToPixel, final @JsonProperty ("radius") Double radius, final @JsonProperty ("fill") FillStyle fill, final @JsonProperty ("stroke") StrokeStyle stroke) { this.type = type; this.opacity = opacity; this.rotateWithView = rotateWithView; this.rotation = rotation; this.scale = scale; this.snapToPixel = snapToPixel; this.radius = radius; this.fill = fill; this.stroke = stroke; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Image() {\n\t\tsuper();\n\t\taddNewAttributeList(NEW_ATTRIBUTES);\n\t\taddNewResourceList(NEW_RESOURCES);\n\t}", "STYLE createSTYLE();", "public abstract TC createStyle();", "public S create() {\n\t\tS style = createDefault();\n\t\tint id = nextID();\n\t\tstyle.setId(id);\n\t\taddStyle(style);\n\t\treturn style;\n\t}", "@Nonnull\n private BufferedImage createImage() {\n return new BufferedImage(getWidth(), getHeight(), getImageType().getType());\n }", "public Image() {\n\t\t\tthis(Color.white, 0);\n\t\t}", "public SquareImageView(final Context context, final AttributeSet attrs, final int\n\t\t\tdefStyleAttr) {\n\t\tsuper(context, attrs, defStyleAttr);\n\t\tinit(attrs, defStyleAttr, 0);\n\t}", "public Image()\r\n {\r\n super();\r\n setBounds( 0, 0, 10, 10 );\r\n }", "Image createImage();", "public void buildImageStyle( IImageContent image, StringBuffer styleBuffer,\n\t\t\tint display )\n \t{\n \t\t// image size\n \t\tbuildSize( styleBuffer, HTMLTags.ATTR_WIDTH, image.getWidth( ) ); //$NON-NLS-1$\n \t\tbuildSize( styleBuffer, HTMLTags.ATTR_HEIGHT, image.getHeight( ) ); //$NON-NLS-1$\n\t\t// build the none value of display\n\t\tsetDisplayProperty( display, 0, styleBuffer );\n \t\tbuildStyle( image, styleBuffer );\n \t}", "public Image() {\n \n }", "Attribute createAttribute();", "Attribute createAttribute();", "public AtlasImageView2(Context context, AttributeSet attrs, int defStyle) {\n super(context, attrs, defStyle);\n setupPaints();\n }", "IMG createIMG();", "public Image() {\n }", "protected abstract void useStyleAttributes(TypedArray attrs);", "public Stub(String label, Image image, int style) {\n\t\t\tthis(label, image, style, null, null);\n\t\t}", "private Style createDefaultStyle() {\n Rule rule = createRule(LINE_COLOUR, FILL_COLOUR); //utilizamos las definiciones anteriores\n\n FeatureTypeStyle fts = sf.createFeatureTypeStyle();\n fts.rules().add(rule);\n\n Style style = sf.createStyle();\n style.featureTypeStyles().add(fts);\n return style;\n}", "private Image createImage(String image_file) {\n\t\tImage img = new Image(image_file);\n\t\treturn img;\n\t}", "protected abstract void createAttributes();", "public BuiltInStyle(int xfind, int sn)\r\n/* 10: */ {\r\n/* 11:46 */ super(Type.STYLE);\r\n/* 12: */ \r\n/* 13:48 */ this.xfIndex = xfind;\r\n/* 14:49 */ this.styleNumber = sn;\r\n/* 15: */ }", "public MatteIcon() {\r\n this(32, 32, null);\r\n }", "public BufferedImage create() {\n checkDimensions();\n final BufferedImage image = createImage();\n getImagePainter().paint(image);\n return image;\n }", "public SpriteBuilder(Image image) {\r\n if (image == null) {\r\n throw new IllegalArgumentException(\"The image can't be null!!\");\r\n }\r\n this.imageView = new ImageView(image);\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }", "private Images() {}", "abstract protected InlineStyle createInlineStyle(Node owner);", "ElementImage createElementImage();", "public ImageLevel(Context context, AttributeSet attr) \n\t{\n\t\tsuper(context, attr);\n\t\t\n\t\tResources res = getResources();\n\t\t\n\t\t// Acquiring image dimension from resources\n\t\tmThumbnailWidth = (int)res.getDimension(R.dimen.thumbnailWidth);\n\t\tmThumbnailHeight = (int)res.getDimension(R.dimen.thumbnailHeight);\n\t\t\n\t\tmMemberLevel = MemberLevel.MemberLevels.eMemberLevelBase;\n\t\tmCurrentImage = new ImageView(getContext());\n\t\tmCurrentImage.setScaleType(ImageView.ScaleType.FIT_CENTER);\n\t\tmCurrentImage.setMaxWidth(mThumbnailWidth);\n\t\tmCurrentImage.setMaxHeight(mThumbnailHeight);\n\t\t\n\t\t// Acquiring first image from resource\n\t\tmBackImage = ((BitmapDrawable)res.getDrawable(R.drawable.smiley)).getBitmap();\n\t\t\n\t\tif (mBackImage != null)\n\t\t{\n\t\t\tLog.v(LOG_TAG, \"Drawing image.\");\n\t\t\tdrawThumbnail();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLog.e(LOG_TAG, \"Initial bitmap not found\");\n\t\t}\n\t\t\n\t\taddView(mCurrentImage\n\t\t\t , new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)\n\t\t\t );\t\t\n\t\t\n\t}", "@Override\r\n\t\tpublic MyImage createMyImage(MyImage myimage) {\r\n\t\t\t\r\n\t\t\treturn myimg.createMyImage(myimage);\r\n\t\t}", "private void createImage()\n {\n GreenfootImage image = new GreenfootImage(width, height);\n setImage(\"Player.png\");\n }", "public ArrayList setImageTemplate() {\n imageTemplate = new ArrayList();\n imageTemplate.add(0,\"template\");//Integer : จำนวนเทมเพลต\n imageTemplate.add(1,\"marge_one_stroke\");//Float : marge one stroke in purcent\n imageTemplate.add(2,\"marge_one_color\");//String : color in hex\n imageTemplate.add(3,\"marge_two_stroke\");//Float : marge two stroke in purcent\n imageTemplate.add(4,\"marge_two_color\");//String : color in hex\n imageTemplate.add(5,\"top_value\");//Float : position of value top for the line\n imageTemplate.add(6,\"bottom_value\");//Float : position of value bottom for the line\n imageTemplate.add(7,\"right_value\");//Float : position of value right for the line\n imageTemplate.add(8,\"left_value\");//Float : position of value left for the line\n imageTemplate.add(9,\"center_x\");//Float : position of value x for the line\n imageTemplate.add(10,\"center_y\");//Float : position of value y for the line\n return (imageTemplate);\n }", "private Sprite createSprite(Image image)\n\t{\n\t\tSprite sprite = new Sprite(image, image.getWidth(), image.getHeight());\n\t\treturn sprite;\n\t}", "public MatteIcon(int width, int height) {\r\n this(width, height, null);\r\n }", "public SimpleStyle() {\n\t\t// set default values\n\t\tthis.foregroundColor = -1;\n\t\t// others are null: VM DONE\n\t}", "protected BufferedImage createImage(int width, int height) {\n\t\treturn (new java.awt.image.BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB));\n\t}", "TAttribute createTAttribute();", "BasicScalingType createBasicScalingType();", "public CreateImage pretty(String pretty) {\n put(\"pretty\", pretty);\n return this;\n }", "public PlainImage(Image image) {\r\n\t\tthis.image = image;\r\n\t}", "public Style(Style copy) {\n backgroundColor = copy.backgroundColor;//default background color of black\n hoverColor = copy.hoverColor;//default background color of black\n activeColor = copy.activeColor;//default background color of black\n borderColor = copy.borderColor;//default border color of transparent\n dropShadowColor = copy.dropShadowColor;\n textColor = copy.textColor;\n textFamily = copy.textFamily;\n textSize = copy.textSize;//default text size of 22 pixels\n borderRadius = copy.borderRadius; //No border radius by default\n render = copy.render;//render by default\n rounded = copy.rounded; //No rounding by default\n dropShadow = copy.dropShadow; //No drop shadow by default\n dropShadowOffset = copy.dropShadowOffset;\n computeSize = copy.computeSize;\n }", "@Function Attr createAttribute(String name);", "public ImageGraphics createGraphics(String image, float width, float height) {\n\t\tImageGraphics imageGraphics = new ImageGraphics(image, height, width);\n\t\timageGraphics.setParent(entity);\n\t\treturn imageGraphics;\n\t}", "private RoundImage img(String imgAddress) {\n return new RoundImage(\"frontend/src/images/books.png\",\"64px\",\"64px\");\n }", "private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}", "public abstract void setImageFormat(String format);", "public abstract Image gen();", "public interface Style extends CssResource {\n\n /**\n * The style for the panel that contains\n * the whole user record\n *\n * @author Ruan Naude <[email protected]>\n * @since 22 Jan 2013\n *\n * @return The name of the compiled style\n */\n String searchBoxUserRecord();\n\n /**\n * The style for the name of the user\n *\n * @author Ruan Naude <[email protected]>\n * @since 22 Jan 2013\n *\n * @return The name of the compiled style\n */\n String nameLabel();\n\n /**\n * The style for the username of the user\n *\n * @author Ruan Naude <[email protected]>\n * @since 22 Jan 2013\n *\n * @return The name of the compiled style\n */\n String usernameLabel();\n\n /**\n * The style for the user avatar image\n *\n * @author Ruan Naude <[email protected]>\n * @since 22 Jan 2013\n *\n * @return The name of the compiled style\n */\n String avatarImage();\n\n /**\n * The style for the remove image\n *\n * @author Johannes Gryffenberg <[email protected]>\n * @since 26 Feb 2013\n *\n * @return The name of the compiled style\n */\n String removeImageStyle();\n\n /**\n * The style for the user record when it is selected\n *\n * @author Ruan Naude <[email protected]>\n * @since 22 Jan 2013\n *\n * @return The name of the compiled style\n */\n String searchBoxUserRecordSelected();\n\n /**\n * The style for the username when the record is selected\n *\n * @author Ruan Naude <[email protected]>\n * @since 22 Jan 2013\n *\n * @return The name of the compiled style\n */\n String usernameLabelSelected();\n\n /**\n * The style for the avatar when the record is selected\n *\n * @author Ruan Naude <[email protected]>\n * @since 22 Jan 2013\n *\n * @return The name of the compiled style\n */\n String avatarImageSelected();\n }", "public Image createImage() {\n if (source == null) {\n source = new MemoryImageSource(width, height, cModel, pixels, 0, width);\n source.setAnimated(true);\n }\n Image img = Toolkit.getDefaultToolkit().createImage(source);\n return img;\n }", "public SpriteBuilder(String imagePath) {\r\n if (imagePath == null || \"\".equals(imagePath.trim())) {\r\n throw new IllegalArgumentException(\"The image path can't be null!!\");\r\n }\r\n this.imageView = new ImageView(imagePath);\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }", "private Attribute createAttribute() {\n\t\t\tAttribute att = AttributeFactory.createAttribute(getName(), getValueType());\n\t\t\tatt.getAnnotations().clear();\n\t\t\tatt.getAnnotations().putAll(getAnnotations());\n\t\t\tattribute = att;\n\t\t\treturn att;\n\t\t}", "public Thumbnail() {\n this(100, 100);\n }", "VisualizationAttribute createVisualizationAttribute();", "public void styleFinder() {\n switch (style) {\n case BLACK_TANK -> styleImage = BLACK_TANK_IMAGE;\n case SAND_TANK -> styleImage = SAND_TANK_IMAGE;\n case RED_TANK -> styleImage = RED_TANK_IMAGE;\n case BLUE_TANK -> styleImage = BLUE_TANK_IMAGE;\n case GREEN_TANK -> styleImage = GREEN_TANK_IMAGE;\n case BLACK_INVINCIBLE_TANK -> styleImage = BLACK_INVINCIBLE_TANK_IMAGE;\n case SAND_INVINCIBLE_TANK -> styleImage = SAND_INVINCIBLE_TANK_IMAGE;\n case RED_INVINCIBLE_TANK -> styleImage = RED_INVINCIBLE_TANK_IMAGE;\n case BLUE_INVINCIBLE_TANK -> styleImage = BLUE_INVINCIBLE_TANK_IMAGE;\n case GREEN_INVINCIBLE_TANK -> styleImage = GREEN_INVINCIBLE_TANK_IMAGE;\n }\n }", "@Override\r\n public Sprite build() {\r\n return new Sprite(imageView, totalNbrFrames, columns, offsetX, offsetY, widthFrame, heightFrame);\r\n }", "public SvgStyle(final SvgStyle s) {\n\n\t\t\tthis.fillPaint = new Paint(s.fillPaint);\n\t\t\tthis.strokePaint = new Paint(s.fillPaint);\n\t\t\tthis.fillPaint.setStyle(Paint.Style.FILL);\n\t\t\tthis.strokePaint.setStyle(Paint.Style.STROKE);\n\t\t\tthis.fillPaint.setColor(s.fillPaint.getColor());\n\t\t\tthis.strokePaint.setColor(s.strokePaint.getColor());\n\t\t\tthis.masterOpacity = s.masterOpacity;\n\t\t\tthis.fillOpacity = s.fillOpacity;\n\t\t\tthis.strokeOpacity = s.strokeOpacity;\n\t\t\tthis.fillPaint.setAntiAlias(true);\n\t\t\tthis.strokePaint.setAntiAlias(true);\n\t\t\tthis.fillPaint.setStrokeWidth(1f);\n\t\t\tthis.strokePaint.setStrokeWidth(1f);\n\t\t\tthis.fillPaint.setTextAlign(s.fillPaint.getTextAlign());\n\t\t\tthis.strokePaint.setTextAlign(s.strokePaint.getTextAlign());\n\t\t\tthis.fillPaint.setTextSize(s.fillPaint.getTextSize());\n\t\t\tthis.strokePaint.setTextSize(s.strokePaint.getTextSize());\n\t\t\tthis.fillPaint.setTextScaleX(s.fillPaint.getTextScaleX());\n\t\t\tthis.strokePaint.setTextScaleX(s.strokePaint.getTextScaleX());\n\t\t\tthis.fillPaint.setTypeface(Typeface.DEFAULT);\n\t\t\tthis.strokePaint.setTypeface(Typeface.DEFAULT);\n\t\t\tthis.hasFill = s.hasFill;\n\t\t\tthis.hasStroke = s.hasStroke;\n\n\t\t}", "@attribute(value = \"\", required = false, defaultValue=\"NONE\")\r\n\tpublic void setStyle(String style) {\r\n\t\t// dummy function for comment\r\n\t}", "public IImage createImage(IImage source) {\n return null;\r\n }", "public Picture(String url) {\n\t\t//file naming convention: noOfTypos_image_imageNo\n\t\t//3_image_1\n\t\tnoTypos = Integer.parseInt(Character.toString(url.charAt(0)));\n\t\t//TODO: Finish generating imageFile\n\t}", "Builder addImage(ImageObject value);", "String removeImageStyle();", "Builder addImage(String value);", "protected Image(int instance, String context) {\n\tsuper(instance, context);\n\taddObjectTable(fieldTable, null);\n }", "public interface Graphics {\n public static enum ImageFormat {\n ARGB8888, ARGB4444, RGB565\n }\n\n public Bitmap newImage(String fileName, ImageFormat format);\n\n}", "public Grey_peg(double dx, double dy, String type){\r\n\r\n super(dx, dy, \"grey_peg\");\r\n\r\n super.beIndestructible();\r\n\r\n if (type.equals(\"grey_peg_vertical\")){\r\n super.setImage(\"res/grey-vertical-peg.png\");\r\n super.setShape(\"vertical\");\r\n }\r\n else if (type.equals(\"grey_peg_horizontal\")){\r\n super.setImage(\"res/grey-horizontal-peg.png\");\r\n super.setShape(\"horizontal\");\r\n }\r\n else {\r\n super.setImage(\"res/grey-peg.png\");\r\n }\r\n super.setColor(\"grey\");\r\n }", "@Generated\n @Selector(\"configurationWithTextStyle:\")\n public static native UIImageSymbolConfiguration configurationWithTextStyle(@NotNull String textStyle);", "Atributo createAtributo();", "public static Style getDefault() { return Style.SHAPE; }", "public IImage createImage(String name) throws IOException {\n return null;\r\n }", "private static ImageResource initImageResource() {\n\t\tImageResource imageResource = new ImageResource(Configuration.SUPERVISOR_LOGGER);\n\t\t\n\t\timageResource.addResource(ImageTypeAWMS.VERTICAL_BAR.name(), imagePath + \"blue_vertical_bar.png\");\n\t\timageResource.addResource(ImageTypeAWMS.HORIZONTAL_BAR.name(), imagePath + \"blue_horizontal_bar.png\");\n\t\timageResource.addResource(ImageTypeAWMS.WELCOME.name(), imagePath + \"welcome.png\");\n\t\t\n\t\t\n\t\treturn imageResource;\n\t}", "public ImageConverter() {\n\t}", "AttributeCell createAttributeCell();", "public SvgStyle() {\n\n\t\t\tfillPaint = new Paint();\n\t\t\tstrokePaint = new Paint();\n\t\t\tfillPaint.setStyle(Paint.Style.FILL);\n\t\t\tstrokePaint.setStyle(Paint.Style.STROKE);\n\t\t\tfillPaint.setColor(0xff000000);\n\t\t\tstrokePaint.setColor(0xff000000);\n\t\t\tmasterOpacity = 1;\n\t\t\tfillOpacity = 1;\n\t\t\tstrokeOpacity = 1;\n\t\t\tfillPaint.setAntiAlias(true);\n\t\t\tstrokePaint.setAntiAlias(true);\n\t\t\tfillPaint.setStrokeWidth(1f);\n\t\t\tstrokePaint.setStrokeWidth(1f);\n\t\t\tfillPaint.setTextAlign(Paint.Align.LEFT);\n\t\t\tstrokePaint.setTextAlign(Paint.Align.LEFT);\n\t\t\tfillPaint.setTextSize(0.02f);\n\t\t\tstrokePaint.setTextSize(0.02f);\n\t\t\tfillPaint.setTextScaleX(1f);\n\t\t\tstrokePaint.setTextScaleX(1f);\n\t\t\tfillPaint.setTypeface(Typeface.DEFAULT);\n\t\t\tstrokePaint.setTypeface(Typeface.DEFAULT);\n\t\t\thasFill = true;\n\t\t\thasStroke = false;\n\t\t}", "public Image( int x, int y, int w, int h, String s )\r\n {\r\n super();\r\n setBounds( x, y, w, h );\r\n setImage( s );\r\n }", "public Image( int x, int y, int w, int h )\r\n {\r\n super();\r\n setBounds( x, y, w, h );\r\n }", "public Sash (Composite parent, int style) {\n\tsuper (parent, checkStyle (style));\n}", "public Sash (Composite parent, int style) {\n\tsuper (parent, checkStyle (style));\n}", "public Building(Building.Type type, ImageIcon image, int food, int wood, \n\t\t\tint gold, int favor){\n\t\tthis.type = type;\n\t\tthis.image = image;\n\t\tcost[0] = food;\n\t\tcost[1] = wood;\n\t\tcost[2] = gold;\n\t\tcost[3] = favor;\n\t}", "protected Image addImageOrig(String href, Panel hp, String stylename) {\n if (href == null) {\n return null;\n }\n if (href.equals(\"\")) {\n return null;\n }\n final Image image = new Image();\n //image.addStyleName(\"scaleme\");\n image.setUrl(mywebapp.getUrl(href));\n addImageOrig(image, hp, stylename);\n return image;\n }", "public VectorImage() {\n\t}", "public Group(Composite parent, int style) {\n super(parent, checkStyle(style));\n }", "public BufferedImage buildBufferedImage(Dimension size) {\n/* 101 */ return new BufferedImage(size.width, size.height, 1);\n/* */ }", "ImageComponent3D() {}", "@Override\n public GTRenderer create(View view, Map<?, Object> opts) {\n BufferedImage img = IMAGE.get(opts);\n if (img == null) {\n // create one from dimensions\n int type = IMAGE_TYPE.get(opts);\n img = new BufferedImage(view.getWidth(), view.getHeight(), type);\n }\n\n return new GTRenderer(img);\n }", "public J3DAttribute () {}", "public void setFillStyle(STYLE style);", "public Pixel() {\r\n\t\t}", "public HSIImage()\r\n {\r\n }", "ShipmentTypeAttr createShipmentTypeAttr();", "public static SVGImage createImage(InputStream is) throws IOException {\n ScalableImage scalableImage = ScalableImage.createImage(is, null);\n return new SVGImage(scalableImage);\n }", "public RenderedImage create(ParameterBlock args,\n RenderingHints renderHints) {\n \n // Get the source image and the data type parameter.\n RenderedImage src = args.getRenderedSource(0);\n Integer datatype = (Integer)args.getObjectParameter(0);\n int type = datatype.intValue();\n\n // Get ImageLayout from renderHints if any.\n ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);\n\n // If there is no change return the source image directly.\n if(layout == null && type == src.getSampleModel().getDataType()) {\n return src;\n }\n\n // Create or clone the ImageLayout.\n if(layout == null) {\n layout = new ImageLayout(src);\n } else {\n layout = (ImageLayout)layout.clone();\n }\n\n\tboolean isDataTypeChange = false;\n\n // Get prospective destination SampleModel.\n SampleModel sampleModel = layout.getSampleModel(src);\n\n // Create a new SampleModel if the type is not as desired.\n if (sampleModel.getDataType() != type) {\n int tileWidth = layout.getTileWidth(src);\n int tileHeight = layout.getTileHeight(src);\n int numBands = src.getSampleModel().getNumBands();\n\n SampleModel csm =\n RasterFactory.createComponentSampleModel(sampleModel,\n type,\n tileWidth,\n tileHeight,\n numBands);\n\n layout.setSampleModel(csm);\n\t isDataTypeChange = true;\n }\n\n\n // Check ColorModel.\n ColorModel colorModel = layout.getColorModel(null);\n if(colorModel != null &&\n !JDKWorkarounds.areCompatibleDataModels(layout.getSampleModel(src),\n colorModel)) {\n // Clear the mask bit if incompatible.\n layout.unsetValid(ImageLayout.COLOR_MODEL_MASK);\n }\n\n // Check whether anything but the ColorModel is changing.\n if (layout.getSampleModel(src) == src.getSampleModel() &&\n layout.getMinX(src) == src.getMinX() &&\n layout.getMinY(src) == src.getMinY() &&\n layout.getWidth(src) == src.getWidth() &&\n layout.getHeight(src) == src.getHeight() &&\n layout.getTileWidth(src) == src.getTileWidth() &&\n layout.getTileHeight(src) == src.getTileHeight() &&\n layout.getTileGridXOffset(src) == src.getTileGridXOffset() &&\n layout.getTileGridYOffset(src) == src.getTileGridYOffset()) {\n\n if(layout.getColorModel(src) == src.getColorModel()) {\n // Nothing changed: return the source directly.\n return src;\n } else {\n // Remove TileCache hint from RenderingHints if present.\n RenderingHints hints = renderHints;\n if(hints != null && hints.containsKey(JAI.KEY_TILE_CACHE)) {\n hints = new RenderingHints((Map)renderHints);\n hints.remove(JAI.KEY_TILE_CACHE);\n }\n\n // Only the ColorModel is changing.\n return new NullOpImage(src, layout, hints,\n OpImage.OP_IO_BOUND);\n }\n }\n\n\tif (isDataTypeChange == true) {\n\n\t // Add JAI.KEY_REPLACE_INDEX_COLOR_MODEL hint to renderHints\n\t if (renderHints == null) {\n\t\trenderHints = \n\t\t new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,\n\t\t\t\t Boolean.TRUE);\n\t\t\n\t } else if (!renderHints.containsKey(\n\t\t\t\t\tJAI.KEY_REPLACE_INDEX_COLOR_MODEL)) {\n\t\t// If the user specified a value for this hint, we don't\n\t\t// want to change that\n\t\trenderHints.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, \n\t\t\t\tBoolean.TRUE);\n\t }\n\t}\n\n return new CopyOpImage(src, renderHints, layout);\n }", "Builder addImage(ImageObject.Builder value);", "public SpriteBuilder(ImageView imageView) {\r\n if (imageView == null) {\r\n throw new IllegalArgumentException(\"The image view can't be null!!\");\r\n }\r\n this.imageView = imageView;\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }", "public SymImage(Image SymImage) {\n\n this.imgBackground = SymImage;\n\n /**\n * Setup for Scaling\n imwidth = (double) this.imgBackground.getWidth(null);\n oldwidth = 461;\n oldheight = 361;\n */\n }", "public ImagePane() {\r\n\t\tsuper();\r\n\t}", "final private void setupAttributes() {\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_DPI, DEFAULT_BASE_DPI));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_DENSITY, DEFAULT_BASE_DENSITY));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_SCREEN, DEFAULT_BASE_SCREEN));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_PROPORTION_FROM, DEFAULT_PROPORTION_FROM));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_PROPORTION_MODE, DEFAULT_PROPORTION_MODES));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BACKGROUND_COLOR, DEFAULT_BACKGROUND_COLOR));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_CALIBRATE_DPI, DEFAULT_CALIBRATE_DPI));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_RESTORER_NOTIFICATION, new Object()));\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\timg = new ImageClass();\r\n\t\timg.Init(imgPath);\r\n\t}", "public XONImageMaker() {\r\n\t\tthis(true, null);\r\n\t}", "public CellStyle createCellStyle() {\n\t\treturn null;\n\t}", "public ReorientImageFilter() {\n }" ]
[ "0.63695836", "0.6108497", "0.6066603", "0.5932366", "0.57701916", "0.57445806", "0.57208383", "0.56590843", "0.56293565", "0.56258905", "0.54159117", "0.54015416", "0.54015416", "0.54010844", "0.53605473", "0.5313467", "0.529545", "0.5288382", "0.5279513", "0.5277118", "0.5261343", "0.5238257", "0.5192551", "0.515942", "0.5152756", "0.5148425", "0.5118838", "0.5110828", "0.51097906", "0.5098497", "0.5059713", "0.5038965", "0.50029963", "0.5002038", "0.4983345", "0.49715012", "0.4964525", "0.49548295", "0.4950913", "0.49493408", "0.49403042", "0.49335408", "0.49089417", "0.4903525", "0.49007136", "0.48975167", "0.4896393", "0.4881206", "0.48735923", "0.48709196", "0.48696783", "0.48637566", "0.48558706", "0.4844276", "0.4843347", "0.4835015", "0.48330432", "0.4830632", "0.48215654", "0.48188478", "0.48179424", "0.48178244", "0.48127124", "0.48078445", "0.48037577", "0.48022985", "0.48000002", "0.47991073", "0.47881252", "0.47849882", "0.4783151", "0.4782681", "0.47728252", "0.47708398", "0.47679046", "0.476429", "0.476429", "0.47449327", "0.4730414", "0.47287259", "0.47151652", "0.4715013", "0.4697589", "0.46818718", "0.4676229", "0.46753243", "0.4674284", "0.46734583", "0.4672843", "0.46721938", "0.46721795", "0.46650365", "0.46628967", "0.46582153", "0.4655659", "0.46550122", "0.46541414", "0.46534273", "0.46522957", "0.46521714" ]
0.72512436
0
Don't call getName() directly since it will just return the name given to this thread, not the name of the actual thread running the code.
@Override public void run() { String name = currentThread().getName(); System.out.println(ANSI_BLUE + "Hello from " + name + "."); // Let the main thread exit and continue outputting to console. if (currentThread().getName().equals("main")) { return; } try { Thread.sleep(3000); } catch (InterruptedException e) { System.out.println(ANSI_BLUE + name + " was prematurely woken up."); return; // Sine it doesn't make sense to output the next message if it's already woken up. } // Not guaranteed to run after three seconds since another thread might wake this thread up, // and because the timing is operating system / JVM dependant. System.out.println(ANSI_BLUE + "Three seconds have passed and " + name + " is awake."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getThreadName() {\n return threadName;\n }", "public String getThreadName() {\n return null;\n }", "public String toString()\n\t{\n\t\treturn threadName;\n\t}", "@Override\n public void run(){\n System.out.println(\"Running thread name: \"+Thread.currentThread().getName());\n }", "public void setThreadName(String name) {\n threadName = name;\n }", "public void run(){\n String threadName = Thread.currentThread().getName();\n System.out.println(\"Hello \" + threadName);\n }", "public String getName ()\n {\n if (__name == null)\n {\n __name = getName (getClass ());\n }\n return __name;\n }", "public String getName() {\r\n \treturn this.getClass().getName();\r\n }", "public String getName()\r\n {\r\n return taskName;\r\n }", "public String getName()\n throws RemoteException, DeadlockException;", "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();", "public static String getName()\n {\n read_if_needed_();\n \n return _get_name;\n }", "public String getName() {\r\n if (target != null) {\r\n return target.getName();\r\n }\r\n\r\n if (benchmark != null) {\r\n return benchmark.getName();\r\n }\r\n\r\n return \"\";\r\n }", "@Override\n public String getName() {\n return this.getClass().getSimpleName();\n }", "public String getName()\r\n\t{\r\n\t\treturn name; // gives the value of the name to the caller\r\n\t}", "protected String getName() {\n\t\treturn name;\n\t}", "protected String getName() {\n\t\treturn name;\n\t}", "public static String getName() {\n return name;\n }", "public final String getName() {\n if (name == null) {\n name = this.getClass().getSimpleName().substring(3);\n }\n return name;\n }", "private String getName() {\n\t\treturn name;\n\t}", "public String getThread()\n\t{\n\t\treturn this.thread;\n\t}", "@Override\r\n\tprotected String getName() {\n\t\treturn NAME;\r\n\t}", "public String getName() {\n\t\treturn name; // Replace with your code\n\t}", "public String getName()\n\t{ return name; }", "@Override\n\t\tfinal public String getName() {\n\t\t\treturn this.Name;\n\t\t}", "public final String getName() {\r\n return name;\r\n }", "public final String getName()\n {\n return name;\n }", "@Override\n\t\t\tpublic String getName() {\n\t\t\t\treturn name;\n\t\t\t}", "public final String getName() {\n\treturn name.getName();\n }", "protected String getName() {\n\t\t\t\treturn name;\n\t\t\t}", "String getName() ;", "protected String getName() {\n\t\tfinal String tmpName = getClass().getSimpleName();\n\t\tif (tmpName.length() == 0) {\n\t\t\t// anonymous class\n\t\t\treturn \"???\";//createAlgorithm(replanningContext).getClass().getSimpleName();\n\t\t}\n\n\t\treturn tmpName;\n\t}", "public String getName() {\r\n \t\t\treturn name;\r\n \t\t}", "public String getName()\n\t{\treturn name;\t}", "@Override\n\tpublic String getName() {\n\n\t\treturn name;\n\t}", "@Override\n public void run() {\n threadLocalTest.setName(Thread.currentThread().getName());\n System.out.println(Thread.currentThread().getName() + \":\" + threadLocalTest.getName());\n }", "public String getName() {\r\n\t\treturn name.get();\r\n\t}", "@Override\r\n\tpublic String getName() {\n\t\treturn name;\r\n\t}", "public final String getName() {\n return name;\n }", "@Override\r\n\tpublic String getName() \r\n\t{\r\n\t\treturn this._name;\r\n\t}", "public String getName(Runnable run) {\n return set.getName(run); \n }", "public String getName()\n\t{\n\t\treturn theName;\n\t}", "public String getName()\n \t{\n \t\treturn name;\n \t}", "public static void main(String[] args) {\n Thread thread = new Thread(\"New Thread\") {\n public void run(){\n System.out.println(\"run by: \" + getName());\n }\n };\n\n thread.start();\n System.out.println(thread.getName());\n\n }", "public String getName() {\n\t\treturn this.toString();\n\t}", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.78908616", "0.77201647", "0.7247608", "0.719185", "0.7090519", "0.7064872", "0.69618875", "0.69361037", "0.6930654", "0.6898677", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68906", "0.68891805", "0.6865297", "0.6858864", "0.6838275", "0.68328524", "0.68250966", "0.68250966", "0.6815475", "0.6808257", "0.6802826", "0.67971224", "0.6796801", "0.6772967", "0.6739949", "0.6726328", "0.6720806", "0.67169166", "0.6709581", "0.6708852", "0.6695628", "0.6694794", "0.6685184", "0.66812265", "0.6674911", "0.66724914", "0.66720563", "0.66703147", "0.66619265", "0.66598815", "0.6658298", "0.66569823", "0.6656367", "0.66540056", "0.66539806", "0.66536564", "0.6648408", "0.6648408", "0.6648408", "0.6648408" ]
0.0
-1
The main program adds tools.jar and runs build
public static void main(java.lang.String[] args) throws java.lang.Exception { java.lang.System.out.println("Bootstrapping mutant"); java.net.URL bootstrapURL = org.apache.ant.init.ClassLocator.getClassLocationURL(org.apache.ant.bootstrap.Bootstrap.class); java.net.URL builderURL = new java.net.URL(bootstrapURL, "../builder/"); java.net.URL toolsJarURL = org.apache.ant.init.ClassLocator.getToolsJarURL(); java.net.URL[] urls = new java.net.URL[]{ builderURL, toolsJarURL }; java.lang.ClassLoader builderLoader = new java.net.URLClassLoader(urls); // org.apache.ant.init.LoaderUtils.dumpLoader(System.out, // builderLoader); java.lang.Class builderClass = java.lang.Class.forName("org.apache.ant.builder.Builder", true, builderLoader); final java.lang.Class[] param = new java.lang.Class[]{ java.lang.Class.forName("[Ljava.lang.String;") }; final java.lang.reflect.Method main = builderClass.getMethod("main", param); final java.lang.Object[] argument = new java.lang.Object[]{ args }; main.invoke(null, argument); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }", "protected void addJDKToolsJar(ClassPathBuilder cpb) {\n try {\n\n File jdkToolsJar = helper.getJDKToolsJar();\n if (jdkToolsJar.exists()) {\n cpb.addJar(jdkToolsJar);\n } else {\n // on the mac, it happens all the time\n logger.fine(\"JDK tools.jar does not exist at \" + jdkToolsJar);\n }\n } catch (IOException e) {\n throw new Error(e);\n }\n }", "public void run(String[] args) throws Exception {\n\t\tSysProtocol protocol = new SysProtocol();\n\t\t\n\t\tString jar = \"<name>.jar\";\n\t\t\n\t\ttry{\n\t\t\tFile jarfile = new File(CLI.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());\n\t\t\tjar = jarfile.getName();\n\t\t}catch(Exception e){ }\n\t\t\n\t\tString outdir = \".\";\n\t\t\n\t\tif( (args.length == 0 && (tools.length > 1 || !tools[0].getToolParameters().hasDefaultOrIsSet()) ) ||\n\t\t\t\t( tools.length > 1 && getToolIndex( args[0] ) < 0 ) ){\n\t\t\tif(tools.length > 1){\n\t\t\t\tSystem.err.println( \"Available tools:\\n\" );\n\t\t\t\tfor(int i=0;i<tools.length;i++){\n\t\t\t\t\tSystem.err.println(\"\\t\"+tools[i].getShortName()+\" - \"+tools[i].getToolName());\n\t\t\t\t}\n\t\t\t\tSystem.err.println();\n\t\t\t\tSystem.err.println(\"Syntax: java -jar \"+jar+\" <toolname> [<parameter=value> ...]\\n\");\n\t\t\t\tSystem.err.println(\"Further info about the tools is given with\\n\\tjava -jar \"+jar+\" <toolname> info\\n\");\n\t\t\t\tSystem.err.println(\"Tool parameters are listed with\\n\\tjava -jar \"+jar+\" <toolname>\\n\");\n\t\t\t}else{\n\t\t\t\tprintToolParameters(0,protocol,outdir,1);\n\t\t\t}\n\t\t\treturn;\n\t\t}/*else if( ( tools.length == 1 && args.length==0) || args.length == 1){\n\t\t\tint toolIndex = getToolIndex( args[0] );\n\t\t\tprintToolParameters(toolIndex,protocol,\".\");\n\t\t\tSystem.err.println( \"Syntax: java -jar \"+jar+\" [<parameter=value> ...]\" );\n\t\t\treturn;\n\t\t}*/else if(args.length > 1 && args[1].equals( \"info\" )){\n\t\t\tint toolIndex = getToolIndex( args[0] );\n\t\t\tSystem.err.println(\"\\n\"+parse(tools[toolIndex].getHelpText()));\n\t\t}else{\n\t\t\tint toolIndex = tools.length == 1 ? 0 : getToolIndex( args[0] );\n\t\t\tPair<String,Integer> pair = setToolParameters(configureThreads[toolIndex], tools.length == 1 ? 0 : 1, toolParameters[toolIndex],keyMap[toolIndex],args, protocol);\n\t\t\toutdir = pair.getFirstElement();\n\t\t\tint threads = pair.getSecondElement();\n\t\t\t\n\t\t\tif(!toolParameters[toolIndex].hasDefaultOrIsSet()){\n\t\t\t\tSystem.err.println(\"At least one parameter has not been set (correctly):\\n\");\n\t\t\t\tprintToolParameters(toolIndex,protocol,outdir,threads);\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\tprintToolParameters(toolIndex,protocol,outdir,threads);\n\t\t\t}\n\t\t\t\n\t\t\tprotocol.flush();\n\t\t\t\n\t\t\tToolResult results = tools[toolIndex].run( toolParameters[toolIndex], protocol, new ProgressUpdater(), threads );\n\t\t\t\n\t\t//\tResultSetResult res = new ResultSetResult( \"Tool results\", \"\", null, results );\n\t\t\t\n\t\t\tResultSaver saver = ResultSaverLibrary.getSaver( results.getClass() );\n\t\t\t\n\t\t\tsaver.writeOutput( results, new File(outdir) );\n\t\t\t\n\t\t\t\n\t\t\tString prefix = outdir+File.separator+\"protocol_\" + tools[toolIndex].getShortName();//new\n\t\t\tFile protout = new File( prefix + \".txt\");\n\t\t\tint k=1;\n\t\t\twhile(protout.exists()){\n\t\t\t\tprotout = new File(prefix + \"_\"+k+\".txt\");\n\t\t\t\tk++;\n\t\t\t}\n\t\t\t\n\t\t\tFileManager.writeFile( protout, protocol.getLog() );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "java.lang.Object setupBuild(java.util.Map properties) throws org.apache.ant.common.util.ExecutionException;", "protected void buildBootstrap() {\n String command = \"-prod -mac -o2 rom -strip:d j2me imp\";\n if (includeDebugger) {\n command += \" debugger\";\n }\n command += \" -- translator\";\n builder(command);\n }", "default void buildMainBuildModules() {\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n if (modules.isEmpty()) {\n log(\"Main module list is empty, nothing to build here.\");\n return;\n }\n var s = modules.size() == 1 ? \"\" : \"s\";\n say(\"Build %d main module%s: %s\", modules.size(), s, modules.toNames(\", \"));\n\n var release = main.release();\n var feature = release != 0 ? release : Runtime.version().feature();\n var classes = bach().folders().workspace(\"classes-main-\" + feature);\n\n var workspaceModules = bach().folders().workspace(\"modules\");\n Paths.deleteDirectories(workspaceModules);\n if (feature == 8) {\n bach().run(buildMainJavac(9, classes)).requireSuccessful();\n buildMainSpaceClassesForJava8(classes);\n } else {\n bach().run(buildMainJavac(release, classes)).requireSuccessful();\n }\n\n Paths.createDirectories(workspaceModules);\n var jars = new ArrayList<Jar>();\n var javacs = new ArrayList<Javac>();\n for (var declaration : modules.map().values()) {\n for (var folder : declaration.sources().list()) {\n if (!folder.isTargeted()) continue;\n javacs.add(buildMainJavac(declaration, folder, classes));\n }\n jars.add(buildMainJar(declaration, classes));\n }\n if (!javacs.isEmpty()) bach().run(javacs.stream()).requireSuccessful();\n bach().run(jars.stream()).requireSuccessful();\n }", "private void makeBinariesExecutable() throws IOException {\n\t\tif (!isWindows()) {\n\t\t\tBundle bundle = Platform.getBundle(Activator.PLUGIN_ID);\n\t\t\tFile binDir = new File(FileLocator.toFileURL(FileLocator.find(bundle, new Path(\"bin\"), null)).getPath());\n\t\t\tnew File(binDir, \"align-it\").setExecutable(true);\n\t\t\tnew File(binDir, \"filter-it\").setExecutable(true);\n\t\t\tnew File(binDir, \"strip-it\").setExecutable(true);\n\t\t\tnew File(binDir, \"shape-it\").setExecutable(true);\n\t\t}\n\t}", "public void build(@NonNull CommandLineRunner launcher)\n throws IOException, InterruptedException, LoggedErrorException {\n FileGatherer fileGatherer = new FileGatherer();\n SourceSearcher searcher = new SourceSearcher(mSourceFolders, \"rs\", \"fs\");\n searcher.setUseExecutor(false);\n searcher.search(fileGatherer);\n\n List<File> renderscriptFiles = fileGatherer.getFiles();\n\n if (renderscriptFiles.isEmpty()) {\n return;\n }\n\n // get the env var\n Map<String, String> env = Maps.newHashMap();\n if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN) {\n env.put(\"DYLD_LIBRARY_PATH\", mBuildToolInfo.getLocation().getAbsolutePath());\n } else if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX) {\n env.put(\"LD_LIBRARY_PATH\", mBuildToolInfo.getLocation().getAbsolutePath());\n }\n\n doMainCompilation(renderscriptFiles, launcher, env);\n\n if (mSupportMode) {\n createSupportFiles(launcher, env);\n }\n }", "public static void main(String[] args) {\n\t\textractedMain(JarFolders.SRC_FOLDER);\r\n\t}", "private List<String> buildCommandLine()\n {\n List<String> commandLine = new ArrayList<String>();\n\n if (executable == null)\n {\n throw new CargoException(\"Java executable not set\");\n }\n commandLine.add(executable);\n\n commandLine.addAll(jvmArguments);\n commandLine.addAll(systemProperties);\n\n if (classpath != null && jarPath == null)\n {\n commandLine.add(\"-classpath\");\n commandLine.add(classpath);\n }\n\n if (jarPath != null)\n {\n commandLine.add(\"-jar\");\n commandLine.add(jarPath);\n }\n\n if (jarPath == null)\n {\n commandLine.add(mainClass);\n }\n commandLine.addAll(applicationArguments);\n\n return commandLine;\n }", "public void build() {\r\n\tfDoingBatchBuild = true;\r\n\tfNotifier = new BuildNotifier(fDC, true);\r\n\tgetBuilderEnvironment().setNotifier(fNotifier);\r\n\tfNotifier.begin();\r\n\ttry {\r\n\t\tfNewState.readClassPath();\r\n\t\tfNotifier.subTask(Util.bind(\"build.scrubbingOutput\"/*nonNLS*/));\r\n\t\tfNewState.getBinaryOutput().scrubOutput();\r\n\t\tfNotifier.updateProgressDelta(0.05f);\r\n\t\tfNotifier.subTask(Util.bind(\"build.analyzingPackages\"/*nonNLS*/));\r\n\t\tfNewState.buildInitialPackageMap();\r\n\t\tfNotifier.updateProgressDelta(0.05f);\r\n\r\n\t\t/* Force build all in build context */\r\n\t\tfNotifier.subTask(Util.bind(\"build.analyzingSources\"/*nonNLS*/));\r\n\t\tIPackage[] pkgs = fNewState.getPackageMap().getAllPackagesAsArray();\r\n\t\tfor (int i = 0; i < pkgs.length; ++i) {\r\n\t\t\tfNotifier.checkCancel();\r\n\t\t\tSourceEntry[] entries = fNewState.getSourceEntries(pkgs[i]);\r\n\t\t\tif (entries != null) {\r\n\t\t\t\tfor (int j = 0; j < entries.length; ++j) {\r\n\t\t\t\t\tSourceEntry sEntry = entries[j];\r\n\t\t\t\t\tif (sEntry.isSource()) {\r\n\t\t\t\t\t\tPackageElement element = fNewState.packageElementFromSourceEntry(sEntry);\r\n\t\t\t\t\t\tfWorkQueue.add(element);\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\tfNotifier.updateProgressDelta(0.05f);\r\n\t\tVector vToCompile = fWorkQueue.getElementsToCompile();\r\n\t\tif (vToCompile.size() > 0) {\r\n\t\t\tfNotifier.setProgressPerCompilationUnit(0.75f / vToCompile.size());\r\n\t\t\tcompile(vToCompile);\r\n\t\t}\r\n\t\t/* Copy resources to binary output */\r\n\t\tnew ProjectResourceCopier(fNewState.getJavaProject(), fDC, fNotifier, 0.10f).copyAllResourcesOnClasspath();\r\n\t\t\r\n\t\tfNotifier.done();\r\n\t} finally {\r\n\t\tcleanUp();\r\n\t}\r\n}", "private static void buildFramework() {\n \tLOG.info(\"Begin building of shared framework.\");\n \t\n \tLOG.debug(\"Create a IterativeFileReader.\");\n \tIterativeFileReader iterativeFileReader = (IterativeFileReader) ReaderFactory.instance().getIterativeFileReader();\n \tLOG.debug(\"Create a TextFileLineReader.\");\n \tTextFileLineReader textFileLineReader = (TextFileLineReader) ReaderFactory.instance().getTextFileLineReader();\n \t\n \t// Setup IterativeFileReader\n \tFile dir = new File(clArgs.buildFrameworkInDir);\n \titerativeFileReader.setFile(dir);\n \titerativeFileReader.setFileFilter(FileUtil.acceptOnlyClusterFilesFilter());\n \titerativeFileReader.setReader(textFileLineReader);\n \t\n \t// Setup processor\n \tLOG.debug(\"Create a SharedFrameworkProcessor.\");\n \tSharedFrameworkProcessor sharedFrameworkProcessor = new SharedFrameworkProcessor();\n \ttextFileLineReader.setProcessor(sharedFrameworkProcessor);\n \t// Get informed about the finishing of each cluster (file) to reset the processor's status\n \ttextFileLineReader.attach(sharedFrameworkProcessor, Interests.HasFinished);\n \t// Get informed about the finishing of all clusters to give each cluster in the generated graph a pretty id\n \titerativeFileReader.attach(sharedFrameworkProcessor, Interests.HasFinished);\n \t\n \titerativeFileReader.read();\n \t\n \tLOG.info(\"Finished building shared framework.\");\n }", "public void testBuildAndRun() {\n SourcePackagesNode sourcePackagesNode = new SourcePackagesNode(SAMPLE_PROJECT_NAME);\n Node sample1Node = new Node(sourcePackagesNode, SAMPLE1_PACKAGE_NAME);\n JavaNode sampleClass1Node = new JavaNode(sample1Node, SAMPLE1_FILE_NAME);\n // increase timeout to 60 seconds\n MainWindowOperator.getDefault().getTimeouts().setTimeout(\"Waiter.WaitingTime\", 60000);\n // start to track Main Window status bar\n MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault().getStatusTextTracer();\n stt.start();\n // call Build|Compile main menu item\n new CompileJavaAction().perform(sampleClass1Node);\n // \"SampleProject (compile-single)\"\n String compileSingleTarget = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"TITLE_output_target\",\n new Object[]{SAMPLE_PROJECT_NAME, null, \"compile-single\"}); // NOI18N\n // \"Finished building SampleProject (compile-single)\"\n String finishedCompileSingleLabel = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"FMT_finished_target_status\",\n new String[]{compileSingleTarget});\n // wait message \"Finished building SampleProject (compile-single)\"\n stt.waitText(finishedCompileSingleLabel); \n\n // \"Run\"\n // TODO bundle property name should be changed back to Menu/RunProject after updating bundle\n String runItem = Bundle.getStringTrimmed(\"org.netbeans.modules.project.ui.Bundle\", \"Menu/BuildProject\");\n // \"Run File\"\n String runFileItem = Bundle.getStringTrimmed(\"org.netbeans.modules.project.ui.actions.Bundle\",\n \"LBL_RunSingleAction_Name\",\n new Object[]{new Integer(1), SAMPLE1_FILE_NAME});\n // call \"Run|Run File|Run \"SampleClass1.java\"\"\n new Action(runItem + \"|\" + runFileItem, null).perform(sampleClass1Node);\n // \"SampleProject (run-single)\"\n String runSingleTarget = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"TITLE_output_target\",\n new Object[]{SAMPLE_PROJECT_NAME, null, \"run-single\"}); // NOI18N\n // \"Finished building SampleProject (run-single)\"\n String finishedRunSingleLabel = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"FMT_finished_target_status\",\n new String[]{runSingleTarget});\n // wait message \"Finished building SampleProject (run-single)\"\n stt.waitText(finishedRunSingleLabel); // NOI18N\n // check Hello and Good bye was printed out to the output window\n\n OutputTabOperator outputOper = new OutputTabOperator(\"run-single\"); //NOI18N\n outputOper.waitText(\"Hello\"); //NOI18N\n outputOper.waitText(\"Good bye\"); //NOI18N\n\n // \"Run\"\n String buildItem = Bundle.getStringTrimmed(\"org.netbeans.modules.project.ui.Bundle\", \"Menu/BuildProject\");\n // \"Build Main Project\"\n String buildMainProjectItem = Bundle.getStringTrimmed(\"org.netbeans.modules.project.ui.actions.Bundle\", \"LBL_BuildMainProjectAction_Name\");\n // call \"Run|Build Main Project\" main menu item\n new Action(buildItem + \"|\" + buildMainProjectItem, null).perform();\n // \"SampleProject (jar)\"\n String jarTarget = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"TITLE_output_target\",\n new Object[]{SAMPLE_PROJECT_NAME, null, \"jar\"}); // NOI18N\n // \"Finished building SampleProject (jar)\"\n String finishedJarLabel = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"FMT_finished_target_status\",\n new String[]{jarTarget});\n // wait message \"Finished building SampleProject (jar)\"\n stt.waitText(finishedJarLabel);\n\n // Run Main Project\n String runMainProjectItem = Bundle.getStringTrimmed(\"org.netbeans.modules.project.ui.actions.Bundle\", \"LBL_RunMainProjectAction_Name\");\n // call \"Run|Run Main Project\" main menu item\n new Action(runItem + \"|\" + runMainProjectItem, null).perform();\n // \"SampleProject (run)\"\n String runTarget = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"TITLE_output_target\",\n new Object[]{SAMPLE_PROJECT_NAME, null, \"run\"}); // NOI18N\n // \"Finished building SampleProject (run)\"\n String finishedRunLabel = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"FMT_finished_target_status\",\n new String[]{runTarget});\n // wait message \"Finished building SampleProject (run)\"\n stt.waitText(finishedRunLabel);\n\n stt.stop();\n }", "public static void main(String[] ignored) {\n try {\n ArtifactoryClientConfiguration clientConfiguration = createArtifactoryClientConfiguration();\n ArtifactoryManagerBuilder artifactoryManagerBuilder = new ArtifactoryManagerBuilder().setClientConfiguration(clientConfiguration, clientConfiguration.resolver);\n ArtifactoryClientConfiguration.PackageManagerHandler packageManagerHandler = clientConfiguration.packageManagerHandler;\n ArtifactoryClientConfiguration.GoHandler goHandler = clientConfiguration.goHandler;\n GoRun goRun = new GoRun(\n packageManagerHandler.getArgs(),\n Paths.get(packageManagerHandler.getPath() != null ? packageManagerHandler.getPath() : \".\"),\n packageManagerHandler.getModule(),\n artifactoryManagerBuilder,\n clientConfiguration.resolver.getRepoKey(),\n clientConfiguration.resolver.getUsername(),\n clientConfiguration.resolver.getPassword(),\n clientConfiguration.getLog(),\n clientConfiguration.getAllProperties()\n );\n goRun.executeAndSaveBuildInfo(clientConfiguration);\n } catch (RuntimeException e) {\n ExceptionUtils.printRootCauseStackTrace(e, System.out);\n System.exit(1);\n }\n }", "public static void main(String[] args) throws IOException {\n \n arg = new Arguments(args);\n \n execute(Paths.get(arg.getSourceDir()), \n getLibraryFiles(Paths.get(arg.getLibraryDir())));\n }", "default void buildMainGenerateCustomRuntimeImage() {\n if (!bach().project().settings().tools().enabled(\"jlink\")) return;\n say(\"Assemble custom runtime image\");\n var image = bach().folders().workspace(\"image\");\n Paths.deleteDirectories(image);\n bach().run(buildMainJLink(image));\n }", "public void testMain() {\n System.out.println(\"main\");\n String[] args = new String[]{\n \n \"-out\", \"ausgabe.jar\",\n \"-mc\", \"inteco.Saukopf\",\n// \"-m manifest.mf \" \n// \"-v\",\n \"-l\",\n \"-lib\", \"CustJar.jar\", \"./asm.jar\", \"D:\\\\Development\\\\Java\\\\Componenten\\\\Hibernate\\\\hibernate-3.0.2\\\\hibernate-3.0\\\\lib\"\n // -mainclass\n };\n CustJar.main(args);\n\n \n }", "private ArrayList<String> javaCommadBuilder(StringBuilder currentFile)\n\t{\n\t\tArrayList<String> command = new ArrayList<String>(Arrays.asList(\"java\", \"-cp\", \"Class\", \"CCLRun\"));\n\t\tcommand.add(currentFile.toString().substring(0, currentFile.toString().indexOf(\".\")));\n\t\treturn command;\n\t}", "@Override\r\n public void pack() {\r\n super.pack();\r\n JkFileTree.of(this.classDir()).exclude(\"**/*.jar\").zip().to(packer().jarFile(\"lean\"));\r\n distrib();\r\n }", "protected void builder(String commandLine) {\n // Pass through the command line options from the current builder\n List passThroughArgs = env.getBuilderArgs();\n for (Iterator iterator = passThroughArgs.iterator(); iterator.hasNext();) {\n commandLine = (String)iterator.next() + \" \" + commandLine;\n }\n\n StringTokenizer st = new StringTokenizer(commandLine);\n final String[] args = new String[st.countTokens()];\n for (int i = 0; i != args.length; ++i) {\n args[i] = st.nextToken();\n }\n// String command = \"java -jar build.jar \" + commandLine;\n new Build().mainProgrammatic(args);\n }", "private void addMultiJobBuildCommand() {\r\n \tString html_text = \"\";\r\n String report_format=\"\";\r\n\r\n if (getOptionHTMLBuildDesc().equalsIgnoreCase(\"HTML\")) {\r\n html_text = \".html\";\r\n report_format = \"HTML\";\r\n } else {\r\n html_text = \".txt\";\r\n report_format = \"TEXT\";\r\n }\r\n\r\n String win =\r\n\"set VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupWin() + \"\\n\";\r\n if (isUsingSCM()) {\r\n win +=\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\extract_build_dir.py\\\"\\n\";\r\n }\r\n if (getOptionUseReporting()) {\r\n win +=\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\incremental_build_report_aggregator.py\\\" --rptfmt \" + report_format + \"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status=@PROJECT_BASE@_full_report.html\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status > @PROJECT_BASE@_full_report.txt\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=aggregate --output=\\\\\\\"@PROJECT_BASE@_aggregate_report.html\\\\\\\"\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=metrics --output=\\\\\\\"@PROJECT_BASE@_metrics_report.html\\\\\\\"\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=environment --output=\\\\\\\"@PROJECT_BASE@_environment_report.html\\\\\\\"\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\gen-combined-cov.py\\\" \\\"@PROJECT_BASE@_aggregate_report.html\\\"\\n\" +\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\getTotals.py\\\" @PROJECT_BASE@_full_report.txt\\n\";\r\n }\r\n win +=\r\ngetEnvironmentTeardownWin() + \"\\n\";\r\n win = StringUtils.replace(win, \"@PROJECT@\", getManageProjectName());\r\n win = StringUtils.replace(win, \"@PROJECT_BASE@\", getBaseName());\r\n\r\n String unix =\r\n\"export VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupUnix() + \"\\n\";\r\n if (isUsingSCM()) {\r\n unix +=\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/extract_build_dir.py\\\"\\n\";\r\n }\r\n if (getOptionUseReporting()) {\r\n unix +=\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/incremental_build_report_aggregator.py\\\" --rptfmt \" + report_format + \"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status=@PROJECT_BASE@_full_report.html\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --full-status > @PROJECT_BASE@_full_report.txt\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=aggregate --output=\\\\\\\"@PROJECT_BASE@_aggregate_report.html\\\\\\\"\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=metrics --output=\\\\\\\"@PROJECT_BASE@_metrics_report.html\\\\\\\"\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --create-report=environment --output=\\\\\\\"@PROJECT_BASE@_environment_report.html\\\\\\\"\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/gen-combined-cov.py\\\" \\\"@PROJECT_BASE@_aggregate_report.html\\\"\\n\" +\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/getTotals.py\\\" @PROJECT_BASE@_full_report.txt\\n\" +\r\n\"\\n\";\r\n }\r\n unix +=\r\ngetEnvironmentTeardownUnix() + \"\\n\";\r\n unix = StringUtils.replace(unix, \"@PROJECT@\", getManageProjectName());\r\n unix = StringUtils.replace(unix, \"@PROJECT_BASE@\", getBaseName());\r\n \r\n VectorCASTCommand command = new VectorCASTCommand(win, unix);\r\n getTopProject().getBuildersList().add(command);\r\n }", "public void execute()\n throws BuildException\n {\n if (_resinHome == null)\n throw new BuildException(\"resinHome is required by jspc\");\n\n if (_rootDirectory == null)\n throw new BuildException(\"rootDirectory is required by jspc\");\n\n File resinJar = new File(_resinHome,\n \"lib\" + File.separatorChar + \"resin.jar\");\n\n if (! resinJar.exists())\n throw new BuildException(\"resinHome '\"\n + _resinHome\n + \"' does not appear to be valid\");\n\n Java java = new Java(this);\n java.setFailonerror(true);\n java.setFork(true);\n java.setJar(resinJar);\n\n List<String> args = new ArrayList<String>();\n args.add(\"jspc\");\n args.add(\"-app-dir\");\n args.add(_rootDirectory.getPath());\n\n for (String arg : args)\n java.createArg().setLine(arg);\n\n log(java.getCommandLine().toString(), _level.intValue());\n\n java.executeJava();\n }", "public static void main(String argv[]) {\n\n\tTkAppBase myApp = null;\n\ttry {\n\n\t myApp = new ToolKitFinder(null);\n\t start(myApp, argv);\n\t}\n\tcatch (Exception e) {\n\t handleExceptionInMain(e);\n\t} finally {\n\t handleInFinallyBlock(myApp);\n\t}\n\n }", "public static void generate(GNUMakefileSettings gnuMakefileSettings, Collection peerGenDependencies, Collection proxyGenDependencies)\n throws java.io.IOException {\n System.out.println(\"generating GNU Makefile for project \" + gnuMakefileSettings.getProject().getName() + \" ...\");\n FormattedFileWriter writer = new FormattedFileWriter(gnuMakefileSettings.getProject().getCPPOutputDir() + File.separator + gnuMakefileSettings.getName());\n\n writer.outputLine(\"INCLUDES= -I. -I$(JNIPP_HOME)/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(OS)\");\n writer.output(\"TARGETTYPE= \");\n writer.outputLine(gnuMakefileSettings.getProject().getTargetType().equals(\"exe\") == true ? \"consoleapp\" : \"shlib\");\n writer.output(\"TARGETNAME= \");\n if (gnuMakefileSettings.getProject().getTargetType().equals(\"exe\") == false) {\n writer.output(\"lib\");\n }\n writer.outputLine(gnuMakefileSettings.getProject().getTargetName());\n writer.newLine(1);\n writer.outputLine(\"ifeq ($(TARGETTYPE), shlib)\");\n writer.outputLine(\"DBGCPPFLAGS= -O0 -g -fPIC -c -Wall $(INCLUDES)\");\n writer.outputLine(\"RELCPPFLAGS= -O0 -fPIC -c -Wall $(INCLUDES)\");\n writer.outputLine(\"else\");\n writer.outputLine(\"DBGCPPFLAGS= -O0 -g -c -Wall $(INCLUDES)\");\n writer.outputLine(\"RELCPPFLAGS= -O0 -c -Wall $(INCLUDES)\");\n writer.outputLine(\"endif\");\n writer.newLine(1);\n writer.outputLine(\"LIBPATH= -L$(JNIPP_HOME)/lib\");\n writer.outputLine(\"DBGLIBS= $(LIBPATH) -lJNIPPCore_d\");\n writer.outputLine(\"RELLIBS= $(LIBPATH) -lJNIPPCore\");\n writer.newLine(1);\n writer.outputLine(\"LINKFLAGS=\");\n writer.outputLine(\"EXT=\");\n writer.outputLine(\"ifeq ($(TARGETTYPE), shlib)\");\n writer.outputLine(\"ifeq ($(OS), linux)\");\n writer.outputLine(\"LINKFLAGS=-shared\");\n writer.outputLine(\"EXT=.so\");\n writer.outputLine(\"else\");\n writer.outputLine(\"SHLIBCMD=-G\");\n writer.outputLine(\"EXT=.so\");\n writer.outputLine(\"endif\");\n writer.outputLine(\"endif\");\n writer.newLine(1);\n writer.outputLine(\"%_d.o:\\t%.cpp\");\n writer.outputLine(\"\\t\\t\\tg++ $(DBGCPPFLAGS) $< -o $@\");\n writer.newLine(1);\n writer.outputLine(\"%.o:\\t%.cpp\");\n writer.outputLine(\"\\t\\t\\tg++ $(RELCPPFLAGS) $< -o $@\");\n writer.newLine(1);\n writer.output(\"SRCS= \");\n Iterator depIter = peerGenDependencies.iterator();\n while (depIter.hasNext() == true) {\n DependencyData current = (DependencyData) depIter.next();\n writer.output(\" \" + gnuMakefileSettings.getProject().getCPPOutputDir() + File.separator + current.getFullCPPFileName());\n }\n depIter = proxyGenDependencies.iterator();\n while (depIter.hasNext() == true) {\n DependencyData current = (DependencyData) depIter.next();\n writer.output(\" \" + gnuMakefileSettings.getProject().getCPPOutputDir() + File.separator + current.getFullCPPFileName());\n }\n writer.newLine(1);\n writer.outputLine(\"DBGOBJS=$(patsubst %.cpp, %_d.o, $(SRCS))\");\n writer.outputLine(\"RELOBJS=$(patsubst %.cpp, %.o, $(SRCS))\");\n writer.newLine(1);\n writer.outputLine(\"all:\\t\\tDebug Release\");\n writer.newLine(1);\n writer.outputLine(\"Debug:\\tdirs $(DBGOBJS)\");\n writer.outputLine(\"\\t\\t\\tg++ $(LINKFLAGS) -o Debug/$(TARGETNAME)_d$(EXT) $(DBGOBJS) $(DBGLIBS)\");\n writer.newLine(1);\n writer.outputLine(\"Release:\\tdirs $(RELOBJS)\");\n writer.outputLine(\"\\t\\t\\tg++ $(LINKFLAGS) -o Release/$(TARGETNAME)$(EXT) $(RELOBJS) $(RELLIBS)\");\n writer.newLine(1);\n writer.outputLine(\"dirs:\\t$(dummy)\");\n writer.outputLine(\"\\t\\t@mkdir -p Debug\");\n writer.outputLine(\"\\t\\t@mkdir -p Release\");\n writer.newLine(1);\n writer.outputLine(\"clean:\\t$(dummy)\");\n writer.outputLine(\"\\t\\t\\t@rm -rf Debug\");\n writer.outputLine(\"\\t\\t\\t@rm -rf Release\");\n writer.newLine(1);\n writer.outputLine(\"rebuild:\tclean Debug Release\");\n\n writer.flush();\n writer.close();\n }", "public static void main(String[] args) {\r\n JkInit.instanceOf(CoreBuild.class, args).doDefault();\r\n }", "public static void main(String[] args) throws Exception{\n\n if (args.length < 1 || args.length > 2){\n System.err.println(\"Usage: java com.armhold.Provenance lib_dir add_comments\");\n System.err.println(\"\\tlib_dir\\t\\t\\t directory containing your *.jar files\");\n System.err.println(\"\\tadd_comments\\t optional flag (true or false) to avoid printing comments in pom, default is true\");\n System.exit(1);\n }\n\n if(args.length == 2 && args[1].equalsIgnoreCase(\"false\")) ADD_COMMENTS = false;\n\n Provenance provenance = new Provenance();\n provenance.importJarFiles(args[0]);\n }", "public Arguments create() throws IOException {\r\n Arguments args = new Arguments();\r\n ArrayList vmArgs = new ArrayList();\r\n \r\n // Start empty framework\r\n if (clean) {\r\n // Remove bundle directories\r\n File[] children = workDir.listFiles();\r\n for (int i=0; i<children.length; i++) {\r\n if (children[i].isDirectory() && children[i].getName().startsWith(\"bundle\")) {\r\n deleteDir(children[i]);\r\n }\r\n }\r\n }\r\n \r\n // Create system properties file\r\n File systemPropertiesFile = new File(workDir, \"system.properties\");\r\n Path path = new Path(systemPropertiesFile.getAbsolutePath());\r\n vmArgs.add(\"-Doscar.system.properties=\"+path.toString());\r\n \r\n // Set bundle cache dir\r\n writeProperty(systemPropertiesFile, PROPERTY_CACHE_DIR, new Path(workDir.getAbsolutePath()).toString(), false);\r\n \r\n // Set start level\r\n writeProperty(systemPropertiesFile, PROPERTY_STARTLEVEL, Integer.toString(startLevel), true);\r\n \r\n // System properties\r\n if (systemProperties != null) {\r\n for(Iterator i=systemProperties.entrySet().iterator();i.hasNext();) {\r\n Map.Entry entry = (Map.Entry) i.next();\r\n writeProperty(systemPropertiesFile, (String) entry.getKey(), (String) entry.getValue(), true);\r\n }\r\n }\r\n\r\n // Add bundle\r\n StringBuffer autoStart = new StringBuffer(\"\");\r\n StringBuffer autoInstall = new StringBuffer(\"\");\r\n for (Iterator i=bundles.entrySet().iterator();i.hasNext();) {\r\n Map.Entry entry = (Map.Entry) i.next();\r\n Integer level = (Integer) entry.getKey();\r\n \r\n // Add bundle install entries for this start level\r\n ArrayList l = (ArrayList) entry.getValue();\r\n autoStart.setLength(0);\r\n autoInstall.setLength(0);\r\n for (Iterator j = l.iterator() ; j.hasNext() ;) {\r\n BundleElement e = (BundleElement) j.next();\r\n if (e.getLaunchInfo().getMode() == BundleLaunchInfo.MODE_START) {\r\n if (autoStart.length()>0) {\r\n autoStart.append(\" \");\r\n }\r\n autoStart.append(\"file:\");\r\n autoStart.append(new Path(e.getBundle().getPath()).toString());\r\n } else {\r\n if (autoInstall.length()>0) {\r\n autoInstall.append(\" \");\r\n }\r\n autoInstall.append(\"file:\");\r\n autoInstall.append(new Path(e.getBundle().getPath()).toString());\r\n }\r\n }\r\n if (autoInstall.length()>0) {\r\n writeProperty(systemPropertiesFile, PROPERTY_AUTO_INSTALL+level, autoInstall.toString(), true);\r\n }\r\n if (autoStart.length()>0) {\r\n writeProperty(systemPropertiesFile, PROPERTY_AUTO_START+level, autoStart.toString(), true);\r\n }\r\n }\r\n \r\n args.setVMArguments((String[]) vmArgs.toArray(new String[vmArgs.size()]));\r\n return args;\r\n }", "public static void main(String[] args)\n/* */ {\n/* 124 */ if (catalinaHome == null) {\n/* 125 */ log.error(\"Must set 'catalina.home' system property\");\n/* 126 */ System.exit(1);\n/* */ }\n/* */ \n/* */ \n/* 130 */ int index = 0;\n/* */ for (;;) {\n/* 132 */ if (index == args.length) {\n/* 133 */ usage();\n/* 134 */ System.exit(1);\n/* */ }\n/* 136 */ if (\"-ant\".equals(args[index])) {\n/* 137 */ ant = true;\n/* 138 */ } else if (\"-common\".equals(args[index])) {\n/* 139 */ common = true;\n/* 140 */ } else if (\"-server\".equals(args[index])) {\n/* 141 */ server = true;\n/* 142 */ } else { if (!\"-shared\".equals(args[index])) break;\n/* 143 */ shared = true;\n/* */ }\n/* */ \n/* 146 */ index++;\n/* */ }\n/* 148 */ if (index > args.length) {\n/* 149 */ usage();\n/* 150 */ System.exit(1);\n/* */ }\n/* */ \n/* */ \n/* 154 */ if (ant) {\n/* 155 */ System.setProperty(\"ant.home\", catalinaHome);\n/* */ }\n/* */ \n/* 158 */ ClassLoader classLoader = null;\n/* */ try {\n/* 160 */ ArrayList<File> packed = new ArrayList();\n/* 161 */ ArrayList<File> unpacked = new ArrayList();\n/* 162 */ unpacked.add(new File(catalinaHome, \"classes\"));\n/* 163 */ packed.add(new File(catalinaHome, \"lib\"));\n/* 164 */ if (common) {\n/* 165 */ unpacked.add(new File(catalinaHome, \"common\" + File.separator + \"classes\"));\n/* */ \n/* 167 */ packed.add(new File(catalinaHome, \"common\" + File.separator + \"lib\"));\n/* */ }\n/* */ \n/* 170 */ if (server) {\n/* 171 */ unpacked.add(new File(catalinaHome, \"server\" + File.separator + \"classes\"));\n/* */ \n/* 173 */ packed.add(new File(catalinaHome, \"server\" + File.separator + \"lib\"));\n/* */ }\n/* */ \n/* 176 */ if (shared) {\n/* 177 */ unpacked.add(new File(catalinaHome, \"shared\" + File.separator + \"classes\"));\n/* */ \n/* 179 */ packed.add(new File(catalinaHome, \"shared\" + File.separator + \"lib\"));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 184 */ classLoader = ClassLoaderFactory.createClassLoader((File[])unpacked.toArray(new File[0]), \n/* 185 */ (File[])packed.toArray(new File[0]), null);\n/* */ }\n/* */ catch (Throwable t) {\n/* 188 */ ExceptionUtils.handleThrowable(t);\n/* 189 */ log.error(\"Class loader creation threw exception\", t);\n/* 190 */ System.exit(1);\n/* */ }\n/* 192 */ Thread.currentThread().setContextClassLoader(classLoader);\n/* */ \n/* */ \n/* 195 */ Class<?> clazz = null;\n/* 196 */ String className = args[(index++)];\n/* */ try {\n/* 198 */ if (log.isDebugEnabled())\n/* 199 */ log.debug(\"Loading application class \" + className);\n/* 200 */ clazz = classLoader.loadClass(className);\n/* */ } catch (Throwable t) {\n/* 202 */ ExceptionUtils.handleThrowable(t);\n/* 203 */ log.error(\"Exception creating instance of \" + className, t);\n/* 204 */ System.exit(1);\n/* */ }\n/* */ \n/* 207 */ Method method = null;\n/* 208 */ String[] params = new String[args.length - index];\n/* 209 */ System.arraycopy(args, index, params, 0, params.length);\n/* */ try {\n/* 211 */ if (log.isDebugEnabled())\n/* 212 */ log.debug(\"Identifying main() method\");\n/* 213 */ String methodName = \"main\";\n/* 214 */ Class<?>[] paramTypes = new Class[1];\n/* 215 */ paramTypes[0] = params.getClass();\n/* 216 */ method = clazz.getMethod(methodName, paramTypes);\n/* */ } catch (Throwable t) {\n/* 218 */ ExceptionUtils.handleThrowable(t);\n/* 219 */ log.error(\"Exception locating main() method\", t);\n/* 220 */ System.exit(1);\n/* */ }\n/* */ \n/* */ try\n/* */ {\n/* 225 */ if (log.isDebugEnabled())\n/* 226 */ log.debug(\"Calling main() method\");\n/* 227 */ Object[] paramValues = new Object[1];\n/* 228 */ paramValues[0] = params;\n/* 229 */ method.invoke(null, paramValues);\n/* */ } catch (Throwable t) {\n/* 231 */ t = ExceptionUtils.unwrapInvocationTargetException(t);\n/* 232 */ ExceptionUtils.handleThrowable(t);\n/* 233 */ log.error(\"Exception calling main() method\", t);\n/* 234 */ System.exit(1);\n/* */ }\n/* */ }", "public void addBuildables(){\n this.allBuildables.add(new Nexus());\n this.allBuildables.add(new Pylon());\n this.allBuildables.add(new Assimilator());\n this.allBuildables.add(new Gateway());\n this.allBuildables.add(new CyberneticsCore());\n this.allBuildables.add(new RoboticsFacility());\n this.allBuildables.add(new Stargate());\n this.allBuildables.add(new TwilightCouncil());\n this.allBuildables.add(new TemplarArchives());\n this.allBuildables.add(new DarkShrine());\n this.allBuildables.add(new RoboticsBay());\n this.allBuildables.add(new FleetBeacon());\n this.allBuildables.add(new Probe());\n this.allBuildables.add(new Zealot());\n this.allBuildables.add(new Stalker());\n this.allBuildables.add(new Sentry());\n this.allBuildables.add(new Observer());\n this.allBuildables.add(new Immortal());\n this.allBuildables.add(new Phoenix());\n this.allBuildables.add(new VoidRay());\n this.allBuildables.add(new Colossus());\n this.allBuildables.add(new HighTemplar());\n this.allBuildables.add(new DarkTemplar());\n this.allBuildables.add(new Carrier());\n }", "private static void deployHECode(String targetDir) throws InterruptedException, IOException, Exception {\r\n\t\t// Build library\r\n\t\tProcessBuilder ps = new ProcessBuilder(\"make\", \"-C\", targetDir);\r\n\r\n\t\t//From the DOC: Initially, this property is false, meaning that the \r\n\t\t//standard output and error output of a subprocess are sent to two \r\n\t\t//separate streams\r\n\t\tps.redirectErrorStream(true);\r\n\r\n\t\tProcess pr = ps.start(); \r\n\t\t\r\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(pr.getInputStream()));\r\n\t\tString line;\r\n\t\twhile ((line = in.readLine()) != null) {\r\n\t\t System.out.println(line);\r\n\t\t}\r\n\t\tint result = pr.waitFor();\r\n\t\tSystem.out.println(\"ok!\");\r\n\r\n\t\tin.close();\r\n//\t\tint result = Runtime.getRuntime().exec(\"make -C \" + targetDir).waitFor();\r\n\t\tif(result == 0) {\r\n\t\t\tSystem.out.println(\"Build successful\");\r\n\t\t} else {\r\n\t\t\tthrow new Exception(\"Service build unsuccessful\");\r\n\t\t}\r\n\t}", "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 }", "public void execute()\n throws MojoExecutionException\n {\n this.checkOperatingSystem();\n\n final File folderApp =\n new File( this.data.getTargetDirectory(), this.data.getAppName() + \"-\" + this.data.getAppVersion() + \".app\" );\n final File folderContents = new File( folderApp, \"Contents\" );\n final File folderMacOS = new File( folderContents, \"MacOS\" );\n final File folderResources = new File( folderContents, \"Resources\" );\n final File folderJava = new File( folderResources, \"Java\" );\n\n final File targetJavaAppStub = new File( folderMacOS, JAVA_APP_STUB.getName() );\n final File targetInfoPlistFile = new File( folderContents, FILENAME_PLIST_INFO );\n final File targetVersionPlistFile = new File( folderContents, FILENAME_PLIST_VERSION );\n\n if ( folderApp.exists() == true )\n {\n try\n {\n this.logger.info( \"Deleting already existing application folder at '\" + folderApp.getName() + \"' ...\" );\n PtFileUtil.deleteDirectoryRecursive( folderApp );\n }\n catch ( PtException e )\n {\n throw new MojoExecutionException( \"Could not delete directory '\" + folderApp.getAbsolutePath() + \"'!\" );\n }\n }\n\n makeFolders( folderApp );\n makeFolders( folderContents );\n makeFolders( folderMacOS );\n makeFolders( folderResources );\n makeFolders( folderJava );\n\n final String jarWithDependsFileName =\n this.data.getAppName() + \"-\" + this.data.getAppVersion() + \"-\" + \"jar-with-dependencies.jar\";\n final File jarWithDependsSource = new File( this.data.getTargetDirectory(), jarWithDependsFileName );\n\n if ( jarWithDependsSource.exists() == false )\n {\n throw new MojoExecutionException(\n \"Jar with dependencies file not existing (try 'mvn assembly:assembly') at: \"\n + jarWithDependsSource.getAbsolutePath() );\n }\n\n if ( this.data.isPlistInfoParamsSet() == true )\n {\n\n final String mainClassFqn = this.data.getPlistInfoParams( PlistInfoParam.MAIN_CLASS );\n this.checkJarWithDependsMainClass( jarWithDependsSource, mainClassFqn );\n\n }\n else\n {\n this.logger.debug( \"Could not check MainClass existence.\" );\n // TODO if Info.plist file is given directly, check for file\n // existence,\n // then parse it (validate!) and retrieve MainClass attribute to\n // check jar with dependencies\n }\n\n this.executeCopyFiles( folderResources, folderJava, targetJavaAppStub, jarWithDependsSource );\n this.executePlistFiles( jarWithDependsFileName, targetInfoPlistFile, targetVersionPlistFile );\n this.executeShellCommands( folderApp, targetJavaAppStub );\n\n }", "public static void main(final String[] args) {\n String docletProjectRootDir = new File(System.getProperty(\"user.dir\")).getAbsolutePath();\n docletProjectRootDir = docletProjectRootDir.replaceAll(\"\\\\\\\\\", \"/\");\n\n String repositoryRootDir = new File(System.getProperty(\"user.dir\")).getParentFile().getParent();\n repositoryRootDir = repositoryRootDir.replaceAll(\"\\\\\\\\\", \"/\");\n\n final String projectDir = repositoryRootDir + \"/../org.eclipse.ease.modules/plugins/org.eclipse.ease.modules.platform\";\n\n // @formatter:off\n final String[] javadocargs = {\n \"-sourcepath\", \"/home/saul/eclipse-workspace/debrief/org.mwc.debrief.scripting/src:/home/saul/eclipse-workspace/debrief/org.mwc.cmap.legacy/src:/home/saul/eclipse-workspace/debrief/org.mwc.debrief.legacy/src\",\n \"-root\", \"/home/saul/eclipse-workspace/debrief/org.mwc.debrief.scripting\",\n \"-doclet\", ModuleDoclet.class.getName(),\n \"-docletpath\", docletProjectRootDir + \"/lib\",\n\n \"-failOnHTMLError\", \"false\",\n \"-failOnMissingDocs\", \"false\",\n\n \"-linkoffline\", \"https://docs.oracle.com/en/java/javase/11/docs/api/\", \"package-list\",\n\t\t\t\t//\"-link\", \"https://docs.oracle.com/javase/8/docs/api\",\n\t\t\t\t\"--ignore-source-errors\",\n\n \"-subpackages\",\n \"org.mwc.debrief.scripting.wrappers\"\n };\n\t\t// @formatter:on\n\n\t\tfinal DocumentationTool systemDocumentationTool = getSystemDocumentationTool();\n\t\tfinal DocumentationTool.DocumentationTask toolTask = systemDocumentationTool.getTask(null, null, null, ModuleDoclet.class, List.of(javadocargs), null);\n\t\ttoolTask.call();\n\t}", "default void buildMainGenerateAPIDocumentation() {\n if (!bach().project().settings().tools().enabled(\"javadoc\")) return;\n say(\"Generate API documentation\");\n var api = bach().folders().workspace(\"documentation\", \"api\");\n bach().run(buildMainJavadoc(api)).requireSuccessful();\n bach().run(buildMainJavadocJar(api)).requireSuccessful();\n }", "public Project createProject( File build_file ) throws Exception { // NOPMD\n if ( build_file == null || !build_file.exists() )\n return null;\n\n // load the option settings for this build file\n setPrefs( build_file );\n\n // configure the project\n Project p = new Project();\n\n // set the project helper -- the AntelopeProjectHelper2 is the same as the Ant\n // ProjectHelper2, but has been slightly modified so it does not automatically\n // run the implicit target\n System.setProperty( \"org.apache.tools.ant.ProjectHelper\", \"ise.antelope.common.AntelopeProjectHelper2\" );\n\n try {\n ClassLoader cl = _helper.getAntClassLoader();\n p.setCoreLoader( cl );\n\n /*\n try {\n Log.log(\"loading antlib with _helper classloader\");\n cl.getResource( \"ise/antelope/tasks/antlib.xml\" );\n Log.log(\"loaded antlib with _helper classloader\");\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n */\n\n // add the antelope build logger now so that any output produced by the\n // ProjectHelper is captured\n p.addBuildListener( _build_logger );\n\n // add the progress bar build listener\n p.addBuildListener( _progress );\n\n // optionally add the antelope performance listener\n if ( _settings.getShowPerformanceOutput() ) {\n if ( _performance_listener == null )\n _performance_listener = new AntPerformanceListener();\n p.addBuildListener( _performance_listener );\n }\n\n // add the gui input handler\n setInputHandler( p );\n\n p.init(); // this takes as much as 9 seconds the first time, less than 1/2 second later\n\n p.setUserProperty( \"ant.file\", build_file.getAbsolutePath() );\n p.setProperty( \"ant.version\", Main.getAntVersion() );\n //String ant_home = System.getProperty(\"ant.home\");\n String ant_home = AntUtils.getAntHome();\n if ( ant_home != null ) {\n p.setProperty( \"ant.home\", ant_home );\n }\n String ant_lib_dirs = AntUtils.getAntLibDirs();\n if ( ant_lib_dirs != null )\n p.setProperty( \"ant.library.dir\", ant_lib_dirs );\n\n // add ant.jar to the classpath\n // for Ant 1.6, does ant-launcher.jar need to be added also? --\n // yes -- add all jars in $ant_home/lib and $user.home/.ant/lib, this\n // is what command-line Ant does. Ant also supports a -lib command-line\n // option where the user can specify additional locations. Should\n // Antelope support this? Need a gui in the properties panel if so.\n // 12/22/2004: added AntelopeLauncher, so -lib option is handled for app,\n // but not for plugin\n /// -- should this be done here or in the helper? --\n java.util.List ant_jars = _helper.getAntJarList();\n if ( ant_jars != null ) {\n java.util.List cp_list = new ArrayList();\n String classpath = p.getProperty( \"java.class.path\" );\n StringTokenizer st = new StringTokenizer( classpath, File.pathSeparator );\n while ( st.hasMoreTokens() ) {\n cp_list.add( new File( st.nextToken() ) );\n }\n Iterator it = ant_jars.iterator();\n while ( it.hasNext() ) {\n File f = new File( ( String ) it.next() );\n if ( !cp_list.contains( f ) ) {\n cp_list.add( f );\n }\n }\n StringBuffer sb = new StringBuffer();\n it = cp_list.iterator();\n while ( it.hasNext() ) {\n sb.append( ( ( File ) it.next() ).getAbsolutePath() ).append( File.pathSeparator );\n }\n classpath = sb.toString();\n p.setProperty( \"java.class.path\", classpath );\n System.setProperty( \"java.class.path\", classpath );\n }\n\n // load any saved user properties for this build file. These are properties\n // that the user has set using the properties dialog and in command-line\n // Ant would have been passed on the command line.\n Preferences user_prefs = getPrefs().node( Constants.ANT_USER_PROPS );\n String[] keys = user_prefs.keys();\n for ( int i = 0; i < keys.length; i++ ) {\n p.setUserProperty( keys[ i ], user_prefs.get( keys[ i ], \"\" ) );\n }\n\n //ProjectHelper.configureProject( p, build_file ); // deprecated\n ProjectHelper helper = ProjectHelper.getProjectHelper();\n p.addReference( \"ant.projectHelper\", helper );\n helper.parse( p, build_file );\n\n //for (Iterator it = p.getTargets().keySet().iterator(); it.hasNext(); ) {\n // System.out.println(\"target: \" + it.next());\n //}\n\n /*\n // looks like a recent change for antlib has busted loading custom tasks from\n // an antlib declaration. Need to check if this ever worked, I used to use\n // taskdef exclusively, and have only recently switched to using antlib.\n // Using antlib works when Antelope is running as an application, but not as\n // a plugin. Seems to have something to do with classloading.\n try {\n System.out.println(\"AntelopePanel classloader = \" + getClass().getClassLoader().hashCode());\n Class c = Class.forName(\"org.apache.tools.ant.Main\");\n if (c != null) {\n System.out.println(\"classloader for Main = \" + c.getClassLoader().hashCode());\n System.out.println(\"parent classloader for Main = \" + c.getClassLoader().getParent());\n }\n else\n System.out.println(\"did not find class for Main\");\n c = Class.forName(\"ise.antelope.tasks.Unset\");\n if (c != null){\n System.out.println(\"classloader for Unset = \" + c.getClassLoader().hashCode());\n System.out.println(\"parent classloader for Unset = \" + c.getClassLoader().getParent());\n System.out.println(\"classloader for Unset is a \" + c.getClassLoader().getClass().getName());\n }\n else\n System.out.println(\"did not find class for Unset\");\n c = Class.forName(\"org.apache.tools.ant.taskdefs.optional.EchoProperties\");\n if (c != null){\n System.out.println(\"classloader for EchoProperties = \" + c.getClassLoader().hashCode());\n System.out.println(\"parent classloader for EchoProperties = \" + c.getClassLoader().getParent());\n System.out.println(\"classloader for EchoProperties is a \" + c.getClassLoader().getClass().getName());\n }\n else\n System.out.println(\"did not find class for EchoProperties\");\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n */\n\n\n return p;\n }\n catch ( Exception e ) {\n Log.log( e );\n e.printStackTrace( System.out );\n JOptionPane.showMessageDialog( GUIUtils.getRootJFrame( this ),\n \"<html>Error:<br>\" + e.getMessage(),\n \"Ant Error\",\n JOptionPane.ERROR_MESSAGE );\n throw e;\n }\n catch ( NoClassDefFoundError error ) {\n Log.log( error );\n error.printStackTrace( System.out );\n JOptionPane.showMessageDialog( GUIUtils.getRootJFrame( this ),\n \"<html>Error: No Class Definition Found for<br>\" + error.getMessage() +\n \"<br><p>This is most likely caused by a required third-party<br>\" +\n \"jar file not being in the class path.\",\n \"Ant Error\",\n JOptionPane.ERROR_MESSAGE );\n throw new Exception( error.getMessage() ); // NOPMD\n }\n }", "public static void main(String[] args) {\n\t\tmappingLibs.put(\"java.\", \"./lib/rt8.jar\");\n\t\tmappingLibs.put(\"org.apache.commons.codec.\", \"./lib/org.apache.commons.codec-1.9.0.jar\");\n\t\tmappingLibs.put(\"javax.crypto.\", \"./lib/javax-crypto.jar\");\n//\t\tallLibs = new ArrayList<String>(Arrays.asList(\"./lib/rt8.jar\", \"./lib/org.apache.commons.codec-1.9.0.jar\",\n//\t\t\t\t\"./lib/javax-crypto.jar\", \"./lib/symail.jar\", \"./lib/greenmail-standalone-1.5.8.jar\",\n//\t\t\t\t\"./lib/javax.mail.jar\", \"./lib/simple-java-mail-5.0.3.jar\", \"./lib/emailaddress-rfc2822-1.1.0.jar\"));\n\t\tallLibs = new ArrayList<String>(Arrays.asList(\"./lib/rt8.jar\", \"./lib/org.apache.commons.codec-1.9.0.jar\",\n\t\t\t\t\"./lib/javax-crypto.jar\", \"./lib/symail.jar\"));\n\t\tServerRunner.run(HttpServer.class);\n\t}", "public ToolList tools() {\r\n\t\treturn new ToolList(LeapJNI.Hand_tools(this.swigCPtr, this), true);\r\n\t}", "BluejProject(AntProjectHelper helper) throws IOException {\n this.helper = helper;\n eval = createEvaluator();\n aux = helper.createAuxiliaryConfiguration();\n refHelper = new ReferenceHelper(helper, aux, eval);\n genFilesHelper = new GeneratedFilesHelper(helper);\n this.updateHelper = new UpdateHelper (this, this.helper, this.aux, this.genFilesHelper,\n UpdateHelper.createDefaultNotifier());\n\n lookup = createLookup(aux);\n helper.addAntProjectListener(this);\n }", "public static void main(String[] args) throws IOException {\n\n _project _sc = _project.of();\n //reads from a maven-central jar file\n _downloadArchiveConsumer.of(\"https://search.maven.org/remotecontent?filepath=com/github/javaparser/javaparser-core/3.15.18/javaparser-core-3.15.18-sources.jar\",\n (ZipEntry ze, InputStream is)-> {\n if( ze.getName().endsWith(\".java\")){\n _sc.add( _codeUnit.of(is) );\n }\n });\n System.out.println( _sc.size() );\n\n _project _src = _githubProject.of(\"https://github.com/edefazio/bincat\").load();\n //_sources _src = _sources.of();\n //_downloadArchive _da = _downloadArchive.of(url, (ZipEntry ze,InputStream is)-> {\n // if( ze.getName().endsWith(\".java\")){\n // _src.add( _codeUnit.of(is) );\n // }\n //});\n /*\n try( InputStream inputStream = url.openStream();\n ZipInputStream zis = new ZipInputStream(inputStream) ) {\n\n byte[] buffer = new byte[2048];\n\n while (zis.available() > 0) {\n ZipEntry ze = zis.getNextEntry();\n System.out.println(\"reading \" + ze.getName());\n\n if( ze.isDirectory() ){\n ze.\n } else if( ze.)\n\n if (!ze.isDirectory() && ze.getName().endsWith(\".java\")) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n int len;\n while ((len = zis.read(buffer)) > 0) {\n baos.write(buffer, 0, len);\n }\n try {\n System.out.println(\"adding\" + ze.getName());\n _src.add(_codeUnit.of(baos.toString()));\n } catch (Exception e) {\n throw new _ioException(\"could not read from entry \" + ze.getName());\n }\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n */\n\n System.out.println( \"finished reading \"+ _src.size());\n }", "public void run() throws IOException {\n copyFile(JAR_PATH, JAR_DESTINATION);\n copyFile(LICENSE_PATH, LICENSE_DESTINATION);\n copyFile(LISTFILE_PATH, LISTFILE_DESTINATION);\n copyFile(README_PATH, README_DESTINATION);\n writeFileContents(RUN_CONTENTS, RUN_DESTINATION);\n }", "public void run(){\n\t\tGlobal.printer.print(\"\\ngetting resource from \"+apkName+\" ... \");\n\t\tString cmd = \"java -jar \\\"\"+this.apktoolPath+\"\\\" d \\\"\"+this.filePath+\"\\\" -f -o \\\"\"+ this.apkPath+\"\\\"\";\n\t\t//Global.copyDir(this.tmpResPath, this.apkPath);\n\t\ttry {\n\t\t\tGlobal.sysCmd(cmd );//,Global.printer);\n\t\t\tGlobal.printer.print(\"succeed!!\");\n\t\t} catch (Exception e) {\n\t\t\tGlobal.printer.print(\"error!!\");\n\t\t\t//Global.printer.print(e.getMessage());\n\t\t}\n\t}", "private void hugoBuild(@Nonnull Run<?, ?> run, Launcher launcher, TaskListener listener, @Nonnull FilePath workspace)\n throws IOException, InterruptedException\n {\n PrintStream logger = listener.getLogger();\n EnvVars env = run.getEnvironment(listener);\n\n String hugoCmd;\n if(getHugoHome() == null || \"\".equals(getHugoHome().trim()))\n {\n hugoCmd = \"hugo\";\n }\n else\n {\n hugoCmd = getHugoHome() + \"hugo\";\n }\n\n launcher.launch().cmds(hugoCmd).envs(env).stdout(logger).stderr(logger);\n }", "public static void main(String[] args) throws Exception{\n\t\tParseTree tree = new ParseTree(new Information(\"C:\\\\Users\\\\Darkras\\\\Documents\\\\CPSC 449\\\\commands.jar\", \"Commands\"));\n\t\tFile f = new File(\"C:\\\\Users\\\\Darkras\\\\Documents\\\\CPSC 449\\\\commands.jar\");\n\t\tClass[] parameterTypes = new Class[]{URL.class};\n\t\tURL url = (f.toURI()).toURL();\n\t\tURLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader();\n\t\tClass<?> sysclass = URLClassLoader.class;\n\t\tMethod method = sysclass.getDeclaredMethod(\"addURL\", parameterTypes);\n\t\tmethod.setAccessible(true);\n\t\tmethod.invoke(sysloader, new Object[]{ url });\n\t\t\n\t\tClass<?> c = Class.forName(\"Commands\");\n\t\tMethod[] methods = c.getDeclaredMethods();\n\t\t\n\t\tInformation test = new Information(\"C:\\\\Users\\\\Darkras\\\\Documents\\\\CPSC 449\\\\commands.jar\", \"Commands\");\n\t\tList<Integer[]> testList = test.properArguments(\"add\");\n\t\t\n\t\tSystem.out.println(testList);\n\t\t\n\t\t\n\t\tTreeEvaluator e = new TreeEvaluator(test);\n\t\t\n\t\ttree.grow(\"add\",1);\n\t\ttree.grow(\"5\",0);\n\t\ttree.grow(\"5\",0);\n\t\ttree.addReturnTypes();\n\t\tSystem.out.println(tree.isComplete());\n\t\tSystem.out.print(e.evaluate(tree.getRoot()));\n\t}", "protected void build() {\n // Make sure we have a fresh build of everything needed to run a JAM session\n // - bootstrap, translator and agent suites\n builder(\"clean\");\n builder(\"\");\n buildBootstrap();\n }", "public static void main(String[] args) throws Exception {\n\t\tint res = ToolRunner.run(new Configuration(), new Gumbo(), args);\n\n\t\tSystem.exit(res);\n\t}", "public static void main(String[] args) {\r\n\t\tString appname=\"Miniz.apk\";\r\n\t\t\t\t\t\t\t\t\t//for creation of entrypoint providing the application and android jar\r\n\t//Options.v().setPhaseOption(\"cg.cha\",\"on\");\r\n\tSetupApplication app = new\tSetupApplication(\"android.jar\",appname);\r\n\ttry {\r\n\t \t\t app.calculateSourcesSinksEntrypoints(\"SourceAndSinks.txt\");\t\t \t\t\t\r\n\t} catch (Exception e) {\r\n\t\te.printStackTrace();\r\n }\r\n\tsoot.G.reset();\r\n\t//set soot options\r\n\tOptions.v().set_src_prec(Options.src_prec_apk);\r\n\tOptions.v().set_process_dir(Collections.singletonList(appname));\r\n\tOptions.v().set_force_android_jar(\"android.jar\");\r\n\tOptions.v().set_whole_program(true);\r\n\tOptions.v().set_allow_phantom_refs(true);\r\n\t//For Handling the Junit test cases output the result into Jimple files\r\n\tOptions.v().set_output_format(Options.output_format_J);\r\n\t//For the code execution \r\n\t//Options.v().set_output_format(Options.output_format_dex);\r\n\tOptions.v().setPhaseOption(\"cg.spark verbose:true\",\"on\");\r\n\tOptions.v().setPhaseOption(\"on-fly-cg\",\"true\");\r\n\t//Renaming dummy main method as void main(String args) for sending the cfg in VASCO\r\n\tList<Type> s = new ArrayList<Type>();\r\n\ts=Arrays.asList(new Type[]{\r\n\tsoot.ArrayType.v(soot.RefType.v(\"java.lang.String\"), 1)\r\n\t});\r\n\t//creating dummy main\r\n\tSootMethod entryPoint =app.getEntryPointCreator().createDummyMain();\r\n\tentryPoint.setName(\"main\");\r\n\tentryPoint.setParameterTypes(s);\r\n\tChain<Unit> u1=entryPoint.getActiveBody().getUnits();\r\n Unit first=u1.getFirst();\r\n //Replacing the constant intitialization of dummy main variable by randomnumber for VASCO doesnt remove any branches from dummy main\r\n Scene.v().loadClassAndSupport(\"java.lang.Math\");\r\n SootMethod sm=Scene.v().getMethod(\"<java.lang.Math: double random()>\");\r\n SootMethodRef smRef=sm.makeRef();\r\n if(first instanceof AssignStmt){\r\n \tValue lhsOp = ((AssignStmt) first).getLeftOp();\r\n Value rhsOp = ((AssignStmt) first).getRightOp();\r\n if(lhsOp instanceof Local && rhsOp instanceof Constant){\r\n \tu1.removeFirst();\r\n u1.addFirst(Jimple.v().newAssignStmt(lhsOp, Jimple.v().newStaticInvokeExpr(smRef)));\r\n }\r\n }\r\n\r\n Scene.v().loadNecessaryClasses();\r\n System.out.println(\"Class::--\"+entryPoint.getDeclaringClass()+\"\\n Dummy Main....-->\"+ entryPoint.getActiveBody());\r\n\tScene.v().setEntryPoints(Collections.singletonList(entryPoint));\r\n\tOptions.v().set_main_class(entryPoint.getDeclaringClass().getName());\r\n\tPackManager.v().runPacks();\r\n\tcg = Scene.v().getCallGraph();\r\n \t\r\n\t\r\n\t//function to get all the methods existing in the call graph\r\n\trecursive(entryPoint);\r\n\t//Printing the methods in the call graph \r\n\tfor(Entry<String, Boolean> eSet : visited.entrySet()){\r\n\t\t\tString value=eSet.getKey().toString();\r\n\t\t\tSystem.out.println(\"Methods in callg graph: \"+value);\r\n\t}\r\n\t\r\n\tList<SootMethod> unusedmethods=new ArrayList<SootMethod>();\t\r\n\tSystem.out.println(\"All::-->\");\r\n\t//Fetching all the methods in the Application and storing the unused methods in a list(unusedmethods)\r\n\tChain<SootClass> clas=Scene.v().getApplicationClasses();\r\n\tfor(SootClass abc1:clas){\r\n\t \tSootClass sClass=Scene.v().loadClassAndSupport(abc1.getName());\r\n\t \tList <SootMethod> methods=sClass.getMethods();\r\n\t\t\t \tfor(SootMethod a: methods){\r\n\t \t\tSystem.out.println( a.getSignature());\r\n\t \t\tif(visited.containsKey(a.getSignature()))\r\n\t \t\t\tcontinue;\r\n\t \t\telse{\r\n\t \t\t\t//Handling classes which extends View and the attributes are not defined in Layout.xml , Handling all init & access functions and Handler functions along with SQLiteDatabase Helper \r\n\t \t\t \t\t\tif(!(a.getSubSignature().contains(\"void <init>\") || a.getSubSignature().contains(\"void <clinit>\") || a.getSubSignature().contains(\"access$\") || a.getDeclaringClass().getSuperclass().getName().contains(\"SQLiteOpenHelper\"))){\r\n\t \t\t \t\t\t\tif(a.getDeclaringClass().getSuperclass().getName().equals(\"android.view.View\") || a.getDeclaringClass().getSuperclass().getName().contains(\"android.os.Handler\")){\r\n\t \t\t \t\t\t\t\tList<SootMethod> methodlist=a.getDeclaringClass().getSuperclass().getMethods();\r\n\t \t\t\t \t\t\t\tint flag=0;\r\n\t \t\t\t \t\t\t\tfor(SootMethod ab: methodlist){\r\n\t \t\t\t \t\t\t\t\tif(ab.getSubSignature()==a.getSubSignature()){// && !unusedmethods.contains(a))\r\n\t \t\t\t \t\t\t\t\t\tflag=1;\r\n\t \t\t\t \t\t\t\t\t\tbreak;\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\tif(flag!=1)\r\n\t \t\t\t \t\t\t\t\tunusedmethods.add(a);\r\n\t \t\t\t \t\t\t}\r\n\t \t\t \t\t\t\telse\r\n\t \t\t\t \t\t\t\tunusedmethods.add(a);\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t\r\n\t \t\t}\r\n\r\n\t \t}\r\n\t }\r\n\t \r\n\t //Handling the functions when the class implements interface\r\n\t List<SootMethod> delm = new ArrayList<SootMethod>();\r\n\t List<SootMethod> un=unusedmethods;\r\n\t for(SootMethod m:un){\r\n\t\t \t if(m.getDeclaringClass().getInterfaceCount()>0){\r\n\t\t\t\t\t Chain<SootClass> interfaces=m.getDeclaringClass().getInterfaces();\r\n\t\t\t\t\t for(SootClass c:interfaces){\r\n\t\t\t\t\t\t List<SootMethod> smi=c.getMethods();\r\n\t\t\t\t\t\t for(SootMethod m1:smi){\r\n\t\t\t\t\t\t\t if(m1.getName().contains(m.getName())){\r\n\t\t\t\t\t\t\t\t delm.add(m);\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\t \r\n\t\t\t\t\t }\r\n\t\t\t \r\n\t\t\t }\r\n\t }\r\n\t for(SootMethod m1:delm){\r\n\t\t unusedmethods.remove(m1);\r\n\t }\r\n\r\n\t //Handling Reflection methods\r\n\t for(SootMethod a: un){\r\n\t\t\tSootClass classWeNeedToLoad = a.getDeclaringClass();\r\n\t\t\tfor(Map.Entry<String,String> entry: Driver.runmethods.entrySet()){\r\n\t\t\t//\tif(!(entry.getKey().contains(classWeNeedToLoad.toString()) && a.getName().contains(entry.getValue())))\r\n\t\t\t\tif(entry.getValue().contains(a.getName()) && entry.getKey().contains(classWeNeedToLoad.toString())){\r\n\t\t\t\t\tunusedmethods.remove(a);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} \r\n\t \r\n\t //Remove the unused methods\t \r\n\t for(SootMethod a: unusedmethods){\r\n\t \tSootClass classWeNeedToLoad = a.getDeclaringClass();\r\n\t \tclassWeNeedToLoad.removeMethod(a);\r\n\t\t}\r\n\t\r\n\r\n\t//Calling Vasco for interprocedural analysis \r\n\tInterproceduralAnalysis ipa = new InterproceduralAnalysis(new EmptyReporter());\r\n\tipa.doAnalysis();\r\n\tprint();\r\n\t//Deleting the ifs with constant result\r\n\tdeleteifs(ifStmts);\r\n\t\r\n\t//Write the apk\r\n\tPackManager.v().writeOutput();\r\n}", "private static void compileAndRun(String fileName, String code) {\n\n if(verboseCompiling) println(\"Deleting old temp files...\", warning);\n new File(fileName + \".java\").delete();\n new File(fileName + \".class\").delete();\n\n if(verboseCompiling) println(\"Creating source file...\", progErr);\n file = new File(fileName + \".java\");\n\n if(verboseCompiling) println(\"Writing code to source file...\", progErr);\n try {\n new FileWriter(file).append(code).close();\n } catch (IOException i) {\n println(\"Had an IO Exception when trying to write the code. Stack trace:\", error);\n i.printStackTrace();\n return; //Exit on error\n }\n\n if(verboseCompiling) println(\"Compiling code...\", progErr);\n //This should only ever be called if the JDK isn't installed. How you'd get here, I don't know.\n if (compiler == null) {\n println(\"Fatal Error: JDK not installed. Go to java.sun.com and install.\", error);\n return;\n }\n\n //Tries to compile. Success code is 0, so if something goes wrong, report.\n int result = -1;\n if (compileOptions.trim().equals(\"\"))\n result = compiler.run(null, out, err, file.getAbsolutePath());\n else\n //result = compiler.run(null, out, err, compileOptions, file.getAbsolutePath());\n result = compiler.run(null, out, err, \"-cp\", \"/Users/student/Desktop/bluecove-2.1.0.jar\", file.getAbsolutePath());\n //ArrayList<String> files = new ArrayList<>();\n //files.add(fileName);\n //boolean result = compiler.getTask(null, null, new ErrorReporter(), null, files, null).call();\n if (result != 0) {\n displayLog();\n //println(\"end record\", error); //End recording and pull out the message\n\n //println(\"Error type: \" + result,error);\n println(\"Failed to compile.\", warning);\n return; //Return on error\n }\n\n if(verboseCompiling) println(\"Attempting to run code...\", progErr);\n try {\n //Makes sure the JVM resets if it's already running.\n if(JVMrunning) \n kill();\n\n //Clears terminal window on main method call.\n if(clearOnMethod)\n outputText.setText(\"\");\n\n //Some String constants for java path and OS-specific separators.\n String separator = System.getProperty(\"file.separator\");\n String path = System.getProperty(\"java.home\")\n + separator + \"bin\" + separator + \"java\";\n\n //Creates a new process that executes the source file.\n ProcessBuilder builder = null;\n if(runOptions.trim().equals(\"\")) \n builder = new ProcessBuilder(path, fileName);\n else \n builder = new ProcessBuilder(path, runOptions, fileName);\n\n //Everything should be good now. Everything past this is on you. Don't mess it up.\n println(\"Build succeeded on \" + java.util.Calendar.getInstance().getTime().toString(), progErr);\n println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\", progErr); \n\n //Tries to run compiled code.\n JVM = builder.start();\n JVMrunning = true;\n\n //Links runtime out/err to our terminal window. No support for input yet.\n Reader errorReader = new InputStreamReader(JVM.getErrorStream());\n Reader outReader = new InputStreamReader(JVM.getInputStream());\n //Writer inReader = new OutputStreamWriter(JVM.getOutputStream());\n\n redirectErr = redirectIOStream(errorReader, err);\n redirectOut = redirectIOStream(outReader, out);\n //redirectIn = redirectIOStream(null, inReader);\n } catch (IOException e) {\n //JVM = builder.start() can throw this.\n println(\"IOException when running the JVM.\", progErr);\n e.printStackTrace();\n displayLog();\n return;\n }\n }", "void runBuild(java.lang.Object buildKey, java.util.List targets) throws org.apache.ant.common.util.ExecutionException;", "private void addBuildCommands(Project project, MultiJobDetail detail, String baseName, String name) {\r\n String report_format=\"\";\r\n String html_text=\"\";\r\n\r\n if (getOptionHTMLBuildDesc().equalsIgnoreCase(\"HTML\")) {\r\n html_text = \".html\";\r\n report_format = \"HTML\";\r\n } else {\r\n html_text = \".txt\";\r\n report_format = \"TEXT\";\r\n }\r\n\r\n String win =\r\n\"set VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupWin() + \"\\n\";\r\n win +=\r\ngetExecutePreambleWin() +\r\n\" %VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=\" + report_format + \"\\\"\\n\" +\r\n\" %VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --level @LEVEL@ -e @ENV@ --build-execute --incremental --output @NAME@_rebuild\" + html_text + \"\\\"\\n\" +\r\n\" %VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=HTML\\\"\\n\";\r\n\r\n if (isUsingSCM()) {\r\n win +=\r\n\"%VECTORCAST_DIR%\\\\vpython \\\"%WORKSPACE%\\\\vc_scripts\\\\copy_build_dir.py\\\" \\\"@PROJECT@\\\" @LEVEL@ @BASENAME@ @ENV@\\n\";\r\n }\r\n win +=\r\ngetEnvironmentTeardownWin() + \"\\n\" +\r\n\"\\n\";\r\n win = StringUtils.replace(win, \"@PROJECT@\", getManageProjectName());\r\n win = StringUtils.replace(win, \"@LEVEL@\", detail.getLevel());\r\n win = StringUtils.replace(win, \"@ENV@\", detail.getEnvironment());\r\n win = StringUtils.replace(win, \"@BASENAME@\", baseName);\r\n win = StringUtils.replace(win, \"@NAME@\", name);\r\n \r\n String unix = \r\n\"export VCAST_RPTS_PRETTY_PRINT_HTML=FALSE\\n\" +\r\ngetEnvironmentSetupUnix() + \"\\n\";\r\n unix +=\r\ngetExecutePreambleUnix() +\r\n\" $VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=\" + report_format + \"\\\"\\n\" +\r\n\" $VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --level @LEVEL@ -e @ENV@ --build-execute --incremental --output @NAME@_rebuild\" + html_text + \"\\\"\\n\" +\r\n\" $VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/managewait.py\\\" --wait_time \" + getWaitTime() + \" --wait_loops \" + getWaitLoops() + \" --command_line \\\"--project \\\\\\\"@PROJECT@\\\\\\\" --config VCAST_CUSTOM_REPORT_FORMAT=HTML\\\"\\n\";\r\n if (isUsingSCM()) {\r\n unix +=\r\n\"$VECTORCAST_DIR/vpython \\\"$WORKSPACE/vc_scripts/copy_build_dir.py\\\" \\\"@PROJECT@\\\" @LEVEL@ @BASENAME@ @ENV@\\n\";\r\n }\r\n unix +=\r\ngetEnvironmentTeardownUnix() + \"\\n\" +\r\n\"\\n\";\r\n unix = StringUtils.replace(unix, \"@PROJECT@\", getManageProjectName());\r\n unix = StringUtils.replace(unix, \"@LEVEL@\", detail.getLevel());\r\n unix = StringUtils.replace(unix, \"@ENV@\", detail.getEnvironment());\r\n unix = StringUtils.replace(unix, \"@BASENAME@\", baseName);\r\n unix = StringUtils.replace(unix, \"@NAME@\", name);\r\n\r\n VectorCASTCommand command = new VectorCASTCommand(win, unix);\r\n project.getBuildersList().add(command);\r\n }", "private void addPostbuildGroovy(Project project, MultiJobDetail detail, String baseName) {\r\n String html_text;\r\n if (getOptionHTMLBuildDesc().equalsIgnoreCase(\"HTML\")) {\r\n html_text = \".html\";\r\n } else {\r\n html_text = \".txt\";\r\n }\r\n String script =\r\n\"import hudson.FilePath\\n\" +\r\n\"\\n\" +\r\n\"Boolean buildFailed = false\\n\" +\r\n\"Boolean buildUnstable = false\\n\" +\r\n\"\\n\" +\r\n\"if(manager.logContains(\\\".*py did not execute correctly.*\\\") || manager.logContains(\\\".*Traceback .most recent call last.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Jenkins Integration Script Failure\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Jenkins Integration Script Failure\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*Failed to acquire lock on environment.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Failed to acquire lock on environment\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Failed to acquire lock on environment\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*Environment Creation Failed.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Environment Creation Failed\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Environment Creation Failed\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*FLEXlm Error.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"FLEXlm Error\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"FLEXlm Error\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*INCR_BUILD_FAILED.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Build Error\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Build Error\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*Environment was not successfully built.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Build Error\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Build Error\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*NOT_LINKED.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Link Error\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Link Error\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*Preprocess Failed.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Preprocess Error\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Preprocess Error\\\")\\n\" +\r\n\"}\\n\" +\r\n\"if (manager.logContains(\\\".*Value Line Error - Command Ignored.*\\\"))\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"warning.gif\\\").appendText(\\\"Test Case Import Error\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildUnstable = true\\n\" +\r\n\" manager.addBadge(\\\"warning.gif\\\", \\\"Test Case Import Error\\\")\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\"if(manager.logContains(\\\".*Abnormal Termination on Environment.*\\\")) \\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"error.gif\\\").appendText(\\\"Abnormal Termination of at least one Environment\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" buildFailed = true\\n\" +\r\n\" manager.addBadge(\\\"error.gif\\\", \\\"Abnormal Termination of at least one Environment\\\")\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\"if (buildFailed && !buildUnstable)\\n\" +\r\n\"{\\n\" +\r\n\" manager.buildFailure()\\n\" +\r\n\"}\\n\" +\r\n\"if (buildUnstable)\\n\" +\r\n\"{\\n\" +\r\n\" manager.buildUnstable()\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\"FilePath fp_i = new FilePath(manager.build.getWorkspace(),'@NAME@_rebuild\" + html_text + \"')\\n\" +\r\n\"\\n\" +\r\n\"if (!fp_i.exists())\\n\" +\r\n\"{\\n\" +\r\n\" manager.build.description = \\\"General Failure, Incremental Build Report or Full Report Not Present. Please see the console for more information\\\"\\n\" +\r\n\"}\\n\" +\r\n\"\\n\";\r\n script = StringUtils.replace(script, \"@BASENAME@\", baseName);\r\n script = StringUtils.replace(script, \"@NAME@\", detail.getProjectName());\r\n \r\n SecureGroovyScript secureScript = new SecureGroovyScript(script, /*sandbox*/false, /*classpath*/null);\r\n GroovyPostbuildRecorder groovy = new GroovyPostbuildRecorder(secureScript, /*behaviour*/2, /*matrix parent*/false);\r\n project.getPublishersList().add(groovy);\r\n }", "public static void main(String[] args) {\n\t\tgetJredispool();\n\t}", "private void addToolsAndCommands() {\n this.selectTargetCadastreObjectTool\n = new CadastreChangeSelectCadastreObjectTool(this.getPojoDataAccess());\n this.selectTargetCadastreObjectTool.setTargetParcelsLayer(targetParcelsLayer);\n this.selectTargetCadastreObjectTool.setCadastreObjectType(CadastreObjectTypeBean.CODE_PARCEL);\n this.getMap().addTool(this.selectTargetCadastreObjectTool, this.getToolbar(), true);\n }", "public static void main(String[] args) throws Exception {\n int res = ToolRunner.run(new Configuration(), new Main(), args);\n System.exit(res);\n }", "public interface ExecService {\n /**\n * Parse an XML file into a build model.\n *\n * @param xmlBuildFile\n * \t\tThe file containing the XML build description.\n * @return A Project model for the build.\n * @exception ExecutionException\n * \t\tif the build cannot be parsed\n */\n org.apache.ant.common.model.Project parseXMLBuildFile(java.io.File xmlBuildFile) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Create a project reference.\n *\n * @param referenceName\n * \t\tthe name under which the project will be\n * \t\treferenced.\n * @param model\n * \t\tthe project model.\n * @exception ExecutionException\n * \t\tif the project cannot be referenced.\n */\n void createProjectReference(java.lang.String referenceName, org.apache.ant.common.model.Project model) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Setup a sub-build.\n *\n * @param model\n * \t\tthe project model to be used for the build\n * @param properties\n * \t\tthe initiali properties to be used in the build\n * @return a key to the build allowing it to be executed and managed\n * @exception ExecutionException\n * \t\tif the subbuild cannot be setup\n */\n java.lang.Object setupBuild(org.apache.ant.common.model.Project model, java.util.Map properties) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Setup a sub-build using the current frame's project model\n *\n * @param properties\n * \t\tthe initiali properties to be used in the build\n * @return a key to the build allowing it to be executed and managed\n * @exception ExecutionException\n * \t\tif the subbuild cannot be setup\n */\n java.lang.Object setupBuild(java.util.Map properties) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * Run a build which have been previously setup\n *\n * @param buildKey\n * \t\tthe buildKey returned previously when the build was\n * \t\tsetup\n * @param targets\n * \t\tA list of targets to be run\n * @exception ExecutionException\n * \t\tif the build cannot be run\n */\n void runBuild(java.lang.Object buildKey, java.util.List targets) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * execute a task. The task should have already been initialised by the\n * core\n *\n * @param task\n * \t\tthe task to be executed.\n * @exception ExecutionException\n * \t\tif there is a problem in execution.\n */\n void executeTask(org.apache.ant.common.antlib.Task task) throws org.apache.ant.common.util.ExecutionException;\n\n /**\n * get the name of the project associated with this execution.\n *\n * @return the project's name\n */\n java.lang.String getProjectName();\n\n /**\n * Get the basedir for the current execution\n *\n * @return the base directory for this execution of Ant\n */\n java.io.File getBaseDir();\n\n /**\n * Handle subbuild output.\n *\n * @param subbuildKey\n * \t\tthe core's key for managing the subbuild.\n * @param line\n * \t\tthe content produce by the current thread.\n * @param isErr\n * \t\ttrue if this content is from the thread's error stream.\n * @exception ExecutionException\n * \t\tif the subbuild cannot be found.\n */\n void handleBuildOutput(java.lang.Object subbuildKey, java.lang.String line, boolean isErr) throws org.apache.ant.common.util.ExecutionException;\n}", "public static void main(String[] args) {\n\t\t\r\n\t\tBeanBuilder.Building();\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}", "public void actionPerformed( ActionEvent e )\r\n\t{\n\t\t// | CREATE JAR FILE\r\n\t\t// +---------------------------------------------------+\r\n\t\tif ( e.getActionCommand().equals( CREATE_JAR_ACTION ) )\r\n\t\t{\r\n\t\t\tOwlFileChooser fileChooser =\r\n\t\t\t\t\t\tnew OwlFileChooser( new File( jarFilePath ),\r\n\t\t\t\t\t\t\t\t\t\t\t\"jar\" );\r\n\r\n\t\t\tif ( fileChooser.saveDialog() )\r\n\t\t\t{\r\n\t\t\t\tVector<String> cmdVec = new Vector<String>();\r\n\r\n\t\t\t\tjarFilePath = fileChooser.getSelectedFile().getParent();\r\n\r\n\t\t\t\tif ( fileChooser.getSelectedFile().exists() )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( !fileChooser.getSelectedFile().delete() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tMainApp.warn( \"Failed to delete existing file: \" +\r\n\t\t\t\t\t\t\t\t\t fileChooser.getSelectedFile() );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcmdVec.add( \"jar\" );\r\n\t\t\t\tcmdVec.add( \"cf\" );\r\n\t\t\t\tcmdVec.add( fileChooser.getSelectedFile().getPath() );\r\n\r\n\t\t\t\tif ( !dllVec.isEmpty() )\r\n\t\t\t\t{\r\n\t\t\t\t\tfor ( int i=0; i<dllVec.size(); i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcmdVec.add( \"-C\" );\r\n\t\t\t\t\t\tcmdVec.add( OwlUtilities.getPath( dllVec.get( i ) ) );\r\n\r\n\t\t\t\t\t\tcmdVec.add( dllVec.get( i ).substring( dllVec.get( i ).lastIndexOf(\r\n\t\t\t\t\t\t\t\t\tSystem.getProperty( \"file.separator\" ) ) + 1 ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( !pkgVec.isEmpty() )\r\n\t\t\t\t{\r\n\t\t\t\t\tPkgInfo pkgInfo = ( PkgInfo )null;\r\n\r\n\t\t\t\t\tfor ( int i=0; i<pkgVec.size(); i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tpkgInfo = pkgVec.get( i );\r\n\r\n\t\t\t\t\t\tcmdVec.add( \"-C\" );\r\n\t\t\t\t\t\tcmdVec.add( pkgInfo.sPkgPath );\r\n\t\t\t\t\t\tcmdVec.add( pkgInfo.sClassName );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( !classVec.isEmpty() )\r\n\t\t\t\t{\r\n\t\t\t\t\tfor ( int i=0; i<classVec.size(); i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( !( new File( classVec.get( i ) ) ).isDirectory() )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcmdVec.add( \"-C\" );\r\n\t\t\t\t\t\t\tcmdVec.add( OwlUtilities.getPath( classVec.get( i ) ) );\r\n\r\n\t\t\t\t\t\t\tcmdVec.add( classVec.get( i ).substring( classVec.get( i ).lastIndexOf(\r\n\t\t\t\t\t\t\t\t\t\tSystem.getProperty( \"file.separator\" ) ) + 1 ) );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tProcess proc =\r\n\t\t\t\t\t\tRuntime.getRuntime().exec( cmdVec.toArray( new String[ cmdVec.size() ] ) );\r\n\t\t\t\t}\r\n\t\t\t\tcatch ( Exception ex )\r\n\t\t\t\t{\r\n\t\t\t\t\tMainApp.error( ex );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tMainApp.info( \"JAR successfully built!\" );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// +---------------------------------------------------+\r\n\t\t// | ADD DLL(S)\r\n\t\t// +---------------------------------------------------+\r\n\t\telse if ( e.getActionCommand().equals( DLL_ADD_ACTION ) )\r\n\t\t{\r\n\t\t\tOwlIconedFileChooser fileChooser\r\n\t\t\t\t\t= new OwlIconedFileChooser(\r\n\t\t\t\t\t\t\t new File( dllFilePath ),\r\n\t\t\t\t\t\t\t new String[] { \"dll\" },\r\n\t\t\t\t\t\t\t new String[] { \"Native Library ( *.dll )\" },\r\n\t\t\t\t\t\t\t new ImageIcon[] { new ImageIcon( MainApp.getBitmapPath() +\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t \"libs.gif\" ) } );\r\n\r\n\t\t\tif ( !System.getProperty( \"os.name\" ).toLowerCase().contains( \"win\" ) )\r\n\t\t\t{\r\n\t\t\t\tfileChooser = new OwlIconedFileChooser( new File( System.getProperty( \"user.dir\" ) ),\r\n\t\t\t\t\t\t \t new String[] { \"so\" },\r\n\t\t\t\t\t\t \t new String[] { \"Native Library ( *.so )\" },\r\n\t\t\t\t\t\t \t new ImageIcon[] { new ImageIcon( MainApp.getBitmapPath() + \"libs.gif\" ) } );\r\n\t\t\t}\r\n\r\n\t\t\tfileChooser.setMultiSelectionEnabled( true );\r\n\r\n\t\t\tif ( fileChooser.openDialog() )\r\n\t\t\t{\r\n\t\t\t\tFile[] files = fileChooser.getSelectedFiles();\r\n\r\n\t\t\t\tif ( files != null )\r\n\t\t\t\t{\r\n\t\t\t\t\tdllFilePath = files[ 0 ].getParent();\r\n\t\r\n\t\t\t\t\tfor ( int i=0; i<files.length; i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdllVec.add( files[ i ].getAbsolutePath() );\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tdllList.setListData( dllVec );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// +---------------------------------------------------+\r\n\t\t// | DELETE DLL ( from list )\r\n\t\t// +---------------------------------------------------+\r\n\t\telse if ( e.getActionCommand().equals( DLL_DEL_ACTION ) )\r\n\t\t{\r\n\t\t\tdllVec.removeAll( Arrays.asList( dllList.getSelectedValues() ) );\r\n\t\t\tdllList.setListData( dllVec );\r\n\t\t}\r\n\r\n\t\t// +---------------------------------------------------+\r\n\t\t// | ADD CLASS(ES)\r\n\t\t// +---------------------------------------------------+\r\n\t\telse if ( e.getActionCommand().equals( CLASS_ADD_ACTION ) )\r\n\t\t{\r\n\t\t\tOwlIconedFileChooser fileChooser\r\n\t\t\t\t\t= new OwlIconedFileChooser(\r\n\t\t\t\t\t\t\t new File( classFilePath ),\r\n\t\t\t\t\t\t\t new String[] { \"class\" },\r\n\t\t\t\t\t\t\t new String[] { \"Java Class ( *.class )\" },\r\n\t\t\t\t\t\t\t new ImageIcon[] { new ImageIcon( MainApp.getBitmapPath() +\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t \"class.gif\" ) } );\r\n\r\n\t\t\tfileChooser.setMultiSelectionEnabled( true );\r\n\r\n\t\t\tif ( fileChooser.openDialog() )\r\n\t\t\t{\r\n\t\t\t\tFile[] files = fileChooser.getSelectedFiles();\r\n\r\n\t\t\t\tif ( files != null )\r\n\t\t\t\t{\r\n\t\t\t\t\tclassFilePath = files[ 0 ].getParent();\r\n\r\n\t\t\t\t\tfor ( int i=0; i<files.length; i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tclassVec.add( files[ i ].getAbsolutePath() );\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tclassList.setListData( classVec );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// +---------------------------------------------------+\r\n\t\t// | ADD PACKAGE\r\n\t\t// +---------------------------------------------------+\r\n\t\telse if ( e.getActionCommand().equals( PKG_ADD_ACTION ) )\r\n\t\t{\r\n\t\t\tOwlDirChooser dirChooser =\r\n\t\t\t\t\t\tnew OwlDirChooser( new File( pkgFilePath ) );\r\n\r\n\t\t\tif ( dirChooser.openDialog() )\r\n\t\t\t{\r\n\t\t\t\tFile pkgDir = dirChooser.getSelectedFile();\r\n\r\n\t\t\t\tif ( pkgDir != null )\r\n\t\t\t\t{\r\n\t\t\t\t\tpkgFilePath = pkgDir.getPath();\r\n\r\n\t\t\t\t\treadPackageDir( pkgDir );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// +---------------------------------------------------+\r\n\t\t// | DELETE CLASS(ES)/JARS ( from list )\r\n\t\t// +---------------------------------------------------+\r\n\t\telse if ( e.getActionCommand().equals( CLASS_DEL_ACTION ) )\r\n\t\t{\r\n\t\t\tclassVec.removeAll( Arrays.asList( classList.getSelectedValues() ) );\r\n\t\t\tclassList.setListData( classVec );\r\n\t\t}\r\n\r\n\t\t// +---------------------------------------------------+\r\n\t\t// | PASS TO SUPER\r\n\t\t// +---------------------------------------------------+\r\n\t\telse\r\n\t\t{\r\n\t\t\tsuper.actionPerformed( e );\r\n\t\t}\r\n\t}", "public void addFromJAR() {\n btAddFromJAR().push();\n }", "BuildClient createBuildClient();", "public interface BuildMainSpaceAPI extends API {\n\n /**\n * Build all assets of the main code space.\n *\n * <ul>\n * <li>Compile sources and jar generated classes\n * <li>Check modules\n * <li>Generate API documentation\n * <li>Generate custom runtime image\n * </ul>\n *\n * @see #buildMainBuildModules()\n * @see #buildMainCheckModules()\n * @see #buildMainGenerateAPIDocumentation()\n * @see #buildMainGenerateCustomRuntimeImage()\n */\n default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }\n\n /** Compile and jar main modules. */\n default void buildMainBuildModules() {\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n if (modules.isEmpty()) {\n log(\"Main module list is empty, nothing to build here.\");\n return;\n }\n var s = modules.size() == 1 ? \"\" : \"s\";\n say(\"Build %d main module%s: %s\", modules.size(), s, modules.toNames(\", \"));\n\n var release = main.release();\n var feature = release != 0 ? release : Runtime.version().feature();\n var classes = bach().folders().workspace(\"classes-main-\" + feature);\n\n var workspaceModules = bach().folders().workspace(\"modules\");\n Paths.deleteDirectories(workspaceModules);\n if (feature == 8) {\n bach().run(buildMainJavac(9, classes)).requireSuccessful();\n buildMainSpaceClassesForJava8(classes);\n } else {\n bach().run(buildMainJavac(release, classes)).requireSuccessful();\n }\n\n Paths.createDirectories(workspaceModules);\n var jars = new ArrayList<Jar>();\n var javacs = new ArrayList<Javac>();\n for (var declaration : modules.map().values()) {\n for (var folder : declaration.sources().list()) {\n if (!folder.isTargeted()) continue;\n javacs.add(buildMainJavac(declaration, folder, classes));\n }\n jars.add(buildMainJar(declaration, classes));\n }\n if (!javacs.isEmpty()) bach().run(javacs.stream()).requireSuccessful();\n bach().run(jars.stream()).requireSuccessful();\n }\n\n /** Check main modules. */\n default void buildMainCheckModules() {\n if (!bach().project().settings().tools().enabled(\"jdeps\")) return;\n say(\"Check main modules\");\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n var jdeps = new ArrayList<JDeps>();\n for (var declaration : modules.map().values()) {\n jdeps.add(buildMainJDeps(declaration));\n }\n bach().run(jdeps.stream()).requireSuccessful();\n }\n\n /** Generate HTML pages of API documentation from main modules' source files. */\n default void buildMainGenerateAPIDocumentation() {\n if (!bach().project().settings().tools().enabled(\"javadoc\")) return;\n say(\"Generate API documentation\");\n var api = bach().folders().workspace(\"documentation\", \"api\");\n bach().run(buildMainJavadoc(api)).requireSuccessful();\n bach().run(buildMainJavadocJar(api)).requireSuccessful();\n }\n\n /** Assemble and optimize main modules and their dependencies into a custom runtime image. */\n default void buildMainGenerateCustomRuntimeImage() {\n if (!bach().project().settings().tools().enabled(\"jlink\")) return;\n say(\"Assemble custom runtime image\");\n var image = bach().folders().workspace(\"image\");\n Paths.deleteDirectories(image);\n bach().run(buildMainJLink(image));\n }\n\n default void buildMainSpaceClassesForJava8(Path classes) {\n var project = bach().project();\n var folders = project.settings().folders();\n var main = project.spaces().main();\n var classPaths = new ArrayList<Path>();\n main.declarations().toNames().forEach(name -> classPaths.add(classes.resolve(name)));\n classPaths.addAll(Paths.list(bach().folders().externalModules(), Paths::isJarFile));\n var javacs = new ArrayList<Javac>();\n for (var declaration : main.declarations().map().values()) {\n var name = declaration.name();\n var sources = declaration.sources();\n var root = sources.list().isEmpty() ? folders.root() : sources.first().path();\n var java8Files = Paths.find(root, 99, BuildMainSpaceAPI::isJava8File);\n if (java8Files.isEmpty()) continue; // skip aggregator module\n var compileSources =\n Command.javac()\n .with(\"--release\", main.release()) // 8\n .with(\"--class-path\", classPaths)\n .ifTrue(bach().is(Flag.STRICT), javac -> javac.with(\"-Xlint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javac\"))\n .with(\"-d\", classes.resolve(name))\n .withAll(java8Files);\n javacs.add(compileSources);\n }\n if (javacs.isEmpty()) return; // no javac command collected\n bach().run(javacs.stream()).requireSuccessful();\n }\n\n /** Test supplied path for pointing to a Java 8 compilation unit. */\n private static boolean isJava8File(Path path) {\n var name = Paths.name(path);\n return !path.startsWith(\".bach\") // ignore all files in `.bach` directory\n && name.endsWith(\".java\")\n && !name.equals(\"module-info.java\") // ignore module declaration compilation units\n && Files.isRegularFile(path);\n }\n\n /**\n * {@return the {@code javac} call to compile all configured modules of the main space}\n *\n * @param release the Java feature release number to compile modules for\n */\n default Javac buildMainJavac(int release, Path classes) {\n var project = bach().project();\n var main = project.spaces().main();\n return Command.javac()\n .ifTrue(release != 0, javac -> javac.with(\"--release\", release))\n .with(\"--module\", main.declarations().toNames(\",\"))\n .with(\"--module-version\", project.version())\n .forEach(\n main.declarations().toModuleSourcePaths(false),\n (javac, path) -> javac.with(\"--module-source-path\", path))\n .ifPresent(\n main.modulePaths().pruned(), (javac, paths) -> javac.with(\"--module-path\", paths))\n .ifTrue(bach().is(Flag.STRICT), javac -> javac.with(\"-Xlint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javac\"))\n .with(\"-d\", classes);\n }\n\n /** {@return the {@code javac} call to compile a specific version of a multi-release module} */\n default Javac buildMainJavac(LocalModule local, SourceFolder folder, Path classes) {\n var name = local.name();\n var project = bach().project();\n var main = project.spaces().main();\n var release = folder.release();\n var javaSourceFiles = Paths.find(folder.path(), 99, Paths::isJavaFile);\n return Command.javac()\n .with(\"--release\", release)\n .with(\"--module-version\", project.version())\n .ifPresent(\n main.modulePaths().pruned(), (javac, paths) -> javac.with(\"--module-path\", paths))\n .with(\"--class-path\", classes.resolve(name))\n .with(\"-implicit:none\") // generate classes for explicitly referenced source files\n .withAll(main.tweaks().arguments(\"javac\"))\n .withAll(main.tweaks().arguments(\"javac(\" + name + \")\"))\n .withAll(main.tweaks().arguments(\"javac(\" + release + \")\"))\n .withAll(main.tweaks().arguments(\"javac(\" + name + \"@\" + release + \")\"))\n .with(\"-d\", buildMultiReleaseClassesDirectory(name, release))\n .withAll(javaSourceFiles);\n }\n\n private Path buildMultiReleaseClassesDirectory(String module, int release) {\n return bach().folders().workspace(\"classes-mr-\" + release, module);\n }\n\n default Jar buildMainJar(LocalModule local, Path classes) {\n var project = bach().project();\n var main = project.spaces().main();\n var name = local.name();\n var file = bach().folders().workspace(\"modules\", buildMainJarFileName(name));\n var mainClass = local.reference().descriptor().mainClass();\n var jar =\n Command.jar()\n .ifTrue(bach().is(Flag.VERBOSE), command -> command.with(\"--verbose\"))\n .with(\"--create\")\n .with(\"--file\", file)\n .ifPresent(mainClass, (args, value) -> args.with(\"--main-class\", value))\n .withAll(main.tweaks().arguments(\"jar\"))\n .withAll(main.tweaks().arguments(\"jar(\" + name + \")\"));\n var baseClasses = classes.resolve(name);\n if (Files.isDirectory(baseClasses)) jar = jar.with(\"-C\", baseClasses, \".\");\n // include base resources\n for (var folder : local.resources().list()) {\n if (folder.isTargeted()) continue; // handled later\n jar = jar.with(\"-C\", folder.path(), \".\");\n }\n // add (future) targeted classes and targeted resources in ascending order\n for (int release = 9; release <= Runtime.version().feature(); release++) {\n var paths = new ArrayList<Path>();\n var isSourceTargeted = local.sources().stream(release).findAny().isPresent();\n if (isSourceTargeted) paths.add(buildMultiReleaseClassesDirectory(name, release));\n local.resources().stream(release).map(SourceFolder::path).forEach(paths::add);\n if (paths.isEmpty()) continue;\n jar = jar.with(\"--release\", release);\n for (var path : paths) jar = jar.with(\"-C\", path, \".\");\n }\n return jar;\n }\n\n default String buildMainJarFileName(String module) {\n return module + '@' + bach().project().versionNumberAndPreRelease() + \".jar\";\n }\n\n default JDeps buildMainJDeps(LocalModule local) {\n var folders = bach().folders();\n return Command.jdeps()\n .with(\"--check\", local.name())\n .with(\"--multi-release\", \"BASE\")\n .with(\"--module-path\", List.of(folders.workspace(\"modules\"), folders.externalModules()));\n }\n\n default Javadoc buildMainJavadoc(Path destination) {\n var project = bach().project();\n var main = project.spaces().main();\n return Command.javadoc()\n .with(\"--module\", main.declarations().toNames(\",\"))\n .forEach(\n main.declarations().toModuleSourcePaths(false),\n (javadoc, path) -> javadoc.with(\"--module-source-path\", path))\n .ifPresent(\n main.modulePaths().pruned(), (javadoc, paths) -> javadoc.with(\"--module-path\", paths))\n .ifTrue(bach().is(Flag.STRICT), javadoc -> javadoc.with(\"-Xdoclint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javadoc\"))\n .with(\"-d\", destination);\n }\n\n /** {@return the jar call generating the API documentation archive} */\n default Jar buildMainJavadocJar(Path api) {\n var project = bach().project();\n var file = project.name() + \"-api-\" + project.version() + \".zip\";\n return Command.jar()\n .with(\"--create\")\n .with(\"--file\", api.getParent().resolve(file))\n .with(\"--no-manifest\")\n .with(\"-C\", api, \".\");\n }\n\n default JLink buildMainJLink(Path image) {\n var project = bach().project();\n var main = project.spaces().main();\n var test = project.spaces().test();\n return Command.jlink()\n .ifPresent(main.launcher(), (jlink, launcher) -> jlink.with(\"--launcher\", launcher.value()))\n .with(\"--add-modules\", main.declarations().toNames(\",\"))\n .ifPresent(\n test.modulePaths().pruned(), (jlink, paths) -> jlink.with(\"--module-path\", paths))\n .withAll(main.tweaks().arguments(\"jlink\"))\n .with(\"--output\", image);\n }\n}", "public String build(boolean verbose) throws RunnerException {\n return build(tempBuildFolder.getAbsolutePath(), verbose);\n }", "public boolean perform(Build build, Launcher launcher, BuildListener listener) {\n \tMap<String, String> envVars = build.getEnvVars();\n \tSet<String> keys = envVars.keySet();\n \tfor (String key : keys) {\n \t this.projectPath = this.projectPath.replaceAll(\"\\\\$\" + key, envVars.get(key));\n \t this.projectPath = this.projectPath.replaceAll(\"\\\\$\\\\{\" + key + \"\\\\}\", envVars.get(key));\n \t}\n\n \t// split the components entered in the component field\n \tString[] componentList = this.components.split(\",\");\n\n \tString rhapsodyCall = DESCRIPTOR.rhapsodyClPath() + \" -cmd=open \" + this.projectPath;\n \tfor (int i=0; i < componentList.length; ++i)\n \t{\n\t\t\tif (generate)\n\t\t\t{\n \t\t\trhapsodyCall += \" -cmd=setcomponent \" + componentList[i];\n \t\t\trhapsodyCall += \" -cmd=setconfiguration \" + this.rhapsodyConfiguration + \" -cmd=regenerate\";\n\t \t\tif (make)\n\t \t\t{\n\t \t\t\trhapsodyCall += \" -cmd=syncmake\";\n\t \t\t}\n\t\t\t}\n \t}\n \trhapsodyCall += \" -cmd=exit \\n\";\n \t\n \tMap<String, String> system =System.getenv();\n\t\tList<String> param = new ArrayList<String>();\n\t\tfor (Map.Entry<String, String> entry : system.entrySet()) {\n\t\t\tString s = entry.getKey() + \"=\" + entry.getValue();\t\t\t\n\t\t\tparam.add(s);\n\t\t}\n\t\tif (DESCRIPTOR.licenseServerPath()!=null) {\n\t\t\tparam.add(\"LM_LICENSE_FILE=\" + DESCRIPTOR.licenseServerPath());\n\t\t}\n\t\tString[] env = param.toArray(new String[param.size()]);\t\n \t\n\t\tint returnValue;\n \ttry {\n\t\t\tProc proc = launcher.launch(rhapsodyCall, env, listener.getLogger(), build.getProject().getWorkspace());\n\t\t\treturnValue = proc.join();\n \t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n \t\tlistener.getLogger().println(\"IOException !\");\n\t\t\treturn false;\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tlistener.getLogger().println(\"InterruptedException !\");\n\t\t\treturn false;\n\t\t}\n\t\tif (returnValue == 0)\n \t return true;\n\t\telse\n\t\t\treturn false;\n }", "@Test\n public void buildFromDeployJar() throws Exception {\n File tempFolder = temp.newFolder();\n File app1Zip = new File(tempFolder, \"app1.zip\");\n File app2Zip = new File(tempFolder, \"app2.zip\");\n AndroidApp app1 =\n buildFromDeployJar(\n CompilerUnderTest.R8,\n CompilationMode.RELEASE,\n GMSCoreCompilationTestBase.GMSCORE_V10_DIR,\n false,\n options ->\n options.proguardMapConsumer =\n ToolHelper.consumeString(proguardMap -> this.proguardMap1 = proguardMap),\n () -> new ArchiveConsumer(app1Zip.toPath(), true));\n AndroidApp app2 =\n buildFromDeployJar(\n CompilerUnderTest.R8,\n CompilationMode.RELEASE,\n GMSCoreCompilationTestBase.GMSCORE_V10_DIR,\n false,\n options ->\n options.proguardMapConsumer =\n ToolHelper.consumeString(proguardMap -> this.proguardMap2 = proguardMap),\n () -> new ArchiveConsumer(app2Zip.toPath(), true));\n\n // Verify that the result of the two compilations was the same.\n assertIdenticalApplications(app1, app2);\n assertIdenticalZipFiles(app1Zip, app2Zip);\n assertEquals(proguardMap1, proguardMap2);\n }", "public static void setup(String[] args) {\n\t\tif (parametersContains(\"classpath\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.CLASSPATH;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \"./src/main/resources/\";\r\n\t\t} else if (parametersContains(\"currentDir\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.INSTALL_DIR;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \".\";\r\n\t\t} else {\r\n\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"Start this runtime environment with option -classpath to load all resources from your classpath or with -currentDir to load all resources from current directory ./game-resources/.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\tROOT_PATH = new File(ROOT_PATH_STR);\r\n\t\tRESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR);\r\n\t\tIMAGE_RESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR + File.separator + IMAGE_FOLDER_STR);\r\n\r\n\t\tlog.info(\"Setting up path settings for runtime.\");\r\n\t\tlog.info(\"Resource loading strategy : \" + RESOURCE_TYPE);\r\n\t\tlog.info(\"Root path (path): \" + ROOT_PATH.getPath());\r\n\t\tlog.info(\"Root path (absolute): \"\r\n\t\t\t\t+ ROOT_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Resource path (path): \" + RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Resource path (absolute): \"\r\n\t\t\t\t+ RESOURCE_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Image resource path (path): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Image resource path (absolute): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getAbsolutePath());\r\n\t}", "protected void compile(String[] args) {\n String[] commandArray = null;\n File tmpFile = null;\n\n try {\n String myos = System.getProperty(\"os.name\");\n\n\n if (myos.toLowerCase().indexOf(\"windows\") >= 0 \n && args.length > 250) {\n PrintWriter out = null;\n try {\n tmpFile = new File(\"jikes\"+(new Random(System.currentTimeMillis())).nextLong());\n out = new PrintWriter(new FileWriter(tmpFile));\n for (int i = 0; i < args.length; i++) {\n out.println(args[i]);\n }\n out.flush();\n commandArray = new String[] { command, \n \"@\" + tmpFile.getAbsolutePath()};\n } catch (IOException e) {\n throw new BuildException(\"Error creating temporary file\", e);\n } finally {\n if (out != null) {\n try {out.close();} catch (Throwable t) {}\n }\n }\n } else {\n commandArray = new String[args.length+1];\n commandArray[0] = command;\n System.arraycopy(args,0,commandArray,1,args.length);\n }\n \n try {\n Execute exe = new Execute(jop);\n exe.setAntRun(project);\n exe.setWorkingDirectory(project.getBaseDir());\n exe.setCommandline(commandArray);\n exe.execute();\n } catch (IOException e) {\n throw new BuildException(\"Error running Jikes compiler\", e);\n }\n } finally {\n if (tmpFile != null) {\n tmpFile.delete();\n }\n }\n }", "@Override\n public List<FileObject> createBuildSystem(Space s, List<FileObject> files) {\n TemplatePair tmpl_extra = new TemplatePair(\"linker_script\", s.getName());\n TemplatePair tmpl_extra1 = new TemplatePair(\"sdk_config\", \"sdk_config\");\n List<TemplatePair> make_addons = new ArrayList<>();\n make_addons.add(tmpl_extra);\n //make_addons.add(tmpl_extra1);\n List<FileObject> all_files = new ArrayList<>(super.createBuildSystem(s,files, NrfPlatformOptions.getInstance(), make_addons));\n\n all_files.add(makeLinkerScript(tmpl_extra));\n //all_files.add(makeConfigFile(tmpl_extra1, build_nrf_config_file(s)));\n\n return all_files;\n }", "private void setupLauncherClassLoader() throws Exception {\n ClassLoader extCL = ClassLoader.getSystemClassLoader().getParent();\n ClassPathBuilder cpb = new ClassPathBuilder(extCL);\n\n try {\n addFrameworkJars(cpb);\n addJDKToolsJar(cpb);\n findDerbyClient(cpb);\n File moduleDir = bootstrapFile.getParentFile();\n cpb.addGlob(moduleDir, additionalJars);\n this.launcherCL = cpb.create();\n } catch (IOException e) {\n throw new Error(e);\n }\n Thread.currentThread().setContextClassLoader(launcherCL);\n }", "public static void main(String args[])\r\n\t{\r\n\t\tToolStarter.startSwingTool(EV3SDCard.class, args);\r\n\t}", "public void buildImage(String buildContextPath, String toolId)\n\t{\n\t\tExecutor exec = new DefaultExecutor();\n\t\texec.setWorkingDirectory(new File(buildContextPath));\n\t\tCommandLine cl = CommandLine.parse(\"/usr/bin/docker build -t bd2kbdds/\" + toolId + \" .\");\n\t\tint execValue;\n\t\ttry {\n\t\t\texecValue = exec.execute(cl);\n\t\t} catch (ExecuteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws Exception{\r\n\t\t\r\n\t\tString line;\r\n\t\t//Scanner scan = new Scanner(System.in);\r\n\r\n\t\tProcess process = Runtime.getRuntime ().exec(\"cmd.exe /c mvn clean install com.jaxio.celerio:bootstrap-maven-plugin:bootstrap\",null,\r\n\t\t\t\tnew File(\"C:\\\\AutoCodeGeneration\\\\ivu.apie.database\\\\ivu.apie.database\"));\r\n\t\tOutputStream stdin = process.getOutputStream ();\r\n\t\tInputStream stderr = process.getErrorStream ();\r\n\t\tInputStream stdout = process.getInputStream ();\r\n\r\n\t\tBufferedReader reader = new BufferedReader (new InputStreamReader(stdout));\r\n\t\tBufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin));\r\n\r\n\t\tString input = \"2\";//scan.nextLine();\r\n\t\tinput += \"\\n\";\r\n\t\twriter.write(input);\r\n\t\twriter.flush();\r\n\r\n\t\tinput = \"4\";\r\n\t\tinput += \"\\n\";\r\n\t\twriter.write(input);\r\n\t\twriter.flush();\r\n\r\n\t\t/*\r\n\t\t * while ((line = reader.readLine ()) != null) { System.out.println (\"Stdout: \"\r\n\t\t * + line); }\r\n\t\t */\r\n\r\n\t\tinput = \"auto\";\r\n\t\t//input = \"vvvvvv\";\r\n\t\tinput += \"\\n\";\r\n\t\twriter.write(input);\r\n\t\twriter.flush();\r\n\t\t\r\n\t\tinput = \"com.jaxio.auto\";\r\n\t\t//input = \"package_name\";\r\n\t\tinput += \"\\n\";\r\n\t\twriter.write(input);\r\n\t\twriter.close();\r\n\r\n\t\twhile ((line = reader.readLine ()) != null) {\r\n\t\tSystem.out.println (\"Stdout: \" + line);\r\n\t\t}\r\n\t}", "private ArrayList<String> javacCommandBuilder(StringBuilder currentProject, StringBuilder currentFile)\n\t{\n\t\tFile folder = new File(currentProject.toString());\n\t\tString[] files = folder.list();\n\t\tArrayList<String> command = new ArrayList<String>(Arrays.asList(\"javac\", \"-d\", \"Class\"));\n\t\t\n\t\tfor(String file : files)\n\t\t{\n\t\t\tcommand.add(currentProject.toString()+\"\\\\\"+file);\n\t\t}\n\t\treturn command;\n\t}", "public TeamBuildTool(String name) {\n team = new Team(name);\n run();\n }", "public static void main(String[] args) throws IOException {\r\n\t\tString outputDirectory;\r\n\t\tString parsedFileName;\r\n\t\tString normalizedFileName;\r\n\r\n\t\t// build acquis\r\n\t\toutputDirectory = Config.get().outputDirectory + \"brown/\";\r\n\t\tparsedFileName = \"parsed.txt\";\r\n\t\tnormalizedFileName = \"normalized.txt\";\r\n\t\tString[] languages = Config.get().acquisLanguages.split(\",\");\r\n\t\tnew File(outputDirectory).mkdirs();\r\n\r\n\t\tfor (String language : languages) {\r\n\t\t\tString outputPath = outputDirectory + language + \"/\";\r\n\t\t\tnew File(outputPath).mkdirs();\r\n\r\n\t\t\ttry {\r\n\t\t\t\tAcquisMain.run(Config.get().acquisInputDirectory, outputPath\r\n\t\t\t\t\t\t+ parsedFileName, outputPath + normalizedFileName,\r\n\t\t\t\t\t\tlanguage);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// // build acquis\r\n\t\t// outputDirectory = Config.get().outputDirectory + \"acquis/\";\r\n\t\t// parsedFileName = \"parsed.txt\";\r\n\t\t// normalizedFileName = \"normalized.txt\";\r\n\t\t// String[] languages = Config.get().acquisLanguages.split(\",\");\r\n\t\t// new File(outputDirectory).mkdirs();\r\n\t\t//\r\n\t\t// for (String language : languages) {\r\n\t\t// String outputPath = outputDirectory + language + \"/\";\r\n\t\t// new File(outputPath).mkdirs();\r\n\t\t//\r\n\t\t// try {\r\n\t\t// AcquisMain.run(Config.get().acquisInputDirectory,\r\n\t\t// outputPath + parsedFileName, outputPath\r\n\t\t// + normalizedFileName, language);\r\n\t\t// } catch (IOException e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t\t// }\r\n\r\n\t\t// // build enron\r\n\t\t// outputDirectory = Config.get().outputDirectory + \"enron/en/\";\r\n\t\t// parsedFileName = \"parsed.txt\";\r\n\t\t// normalizedFileName = \"normalized.txt\";\r\n\t\t// new File(outputDirectory).mkdirs();\r\n\t\t//\r\n\t\t// try {\r\n\t\t// EnronMain.run(Config.get().enronInputDirectory, outputDirectory\r\n\t\t// + parsedFileName, outputDirectory + normalizedFileName);\r\n\t\t// } catch (IOException e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t\t//\r\n\t\t// // build reuters\r\n\t\t// outputDirectory = Config.get().outputDirectory + \"reuters/en/\";\r\n\t\t// parsedFileName = \"parsed.txt\";\r\n\t\t// normalizedFileName = \"normalized.txt\";\r\n\t\t// new File(outputDirectory).mkdirs();\r\n\t\t//\r\n\t\t// try {\r\n\t\t// ReutersMain.run(Config.get().reutersInputDirectory,\r\n\t\t// outputDirectory + parsedFileName, outputDirectory\r\n\t\t// + normalizedFileName);\r\n\t\t// } catch (IOException e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t}", "public static void \n main\n (\n String[] args /* IN: command line arguments */\n )\n {\n FileCleaner.init();\n\n try {\n TestJarReaderApp app = new TestJarReaderApp();\n app.run();\n } \n catch (Exception ex) {\n ex.printStackTrace();\n System.exit(1);\n } \n \n System.exit(0);\n }", "private synchronized void addBuildWrapperPath(ProcessBuilder pb){\r\n \t\tif (needPath==null || needPath.booleanValue() && bwPath!=null){\r\n \t\t\tneedPath=false;\r\n \t\t\tString path=new File(bwPath).getParent();\r\n \t\t\tif (path!=null){\r\n \t\t\t\tMap<String,String> env=pb.environment();\r\n \t\t\t\tString pathValue=env.get(\"PATH\");\r\n \t\t\t\tif (Boolean.TRUE.equals(needPath) || pathValue==null || pathValue.length()==0 || !pathValue.contains(path)){\r\n \t\t\t\t\tif (pathValue==null || pathValue.length()==0){\r\n \t\t\t\t\t\tpathValue=path;\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tpathValue+=File.pathSeparator+path;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tenv.put(\"PATH\",pathValue);\r\n \t\t\t\t\tneedPath=true;\r\n \t\t\t\t} \r\n \t\t\t}\r\n \t\t}\r\n \t}", "GradleBuild create();", "public static void main(String[] args){\n //WebFactory.setLoaderFactory(() -> new HelperLoader());\n launch(args);\n }", "void build(String name, Project project);", "@TaskAction\n public void initialize() throws IOException {\n // so if the sdk version is empty, we find the newest one...\n // I'm not yet sure how that is going to work with non-major releases, but we'll see\n String version = sdk.isEmpty() ? FileTools.newestVersion(\"jde/sdks\") : sdk;\n System.out.println(String.format(\"SDK Version %s selected for runtime setup\", version));\n\n // abort if a runtime already exists\n if (FileTools.exists(String.format(\"jde/runtime/%s\", version))) {\n System.out.println(String.format(\"Runtime for %s already exists. Doing nothing.\", version));\n return;\n }\n\n // VersionChecker is just a sanity test for what can be set up.\n // 1) check sdk\n // 2) check server\n // 3) check database\n // 4) check sdk_files.cfg\n if (VersionChecker.canSetup(version)) {\n setup(version);\n }\n }", "public void execute() throws MojoExecutionException {\n\n // 1. Create and set up directories\n getLog().info(\"Creating and setting up the bundle directories\");\n buildDirectory.mkdirs();\n\n File bundleDir = new File(buildDirectory, bundleName + \".app\");\n bundleDir.mkdirs();\n\n File contentsDir = new File(bundleDir, \"Contents\");\n contentsDir.mkdirs();\n\n File resourcesDir = new File(contentsDir, \"Resources\");\n resourcesDir.mkdirs();\n\n File javaDirectory = new File(contentsDir, \"Java\");\n javaDirectory.mkdirs();\n\n File macOSDirectory = new File(contentsDir, \"MacOS\");\n macOSDirectory.mkdirs();\n\n // 2. Copy in the native java application stub\n getLog().info(\"Copying the native Java Application Stub\");\n File launcher = new File(macOSDirectory, javaLauncherName);\n launcher.setExecutable(true);\n\n FileOutputStream launcherStream = null;\n try {\n launcherStream = new FileOutputStream(launcher);\n } catch (FileNotFoundException ex) {\n throw new MojoExecutionException(\"Could not copy file to directory \" + launcher, ex);\n }\n\n InputStream launcherResourceStream = this.getClass().getResourceAsStream(javaLauncherName);\n try {\n IOUtil.copy(launcherResourceStream, launcherStream);\n } catch (IOException ex) {\n throw new MojoExecutionException(\"Could not copy file \" + javaLauncherName + \" to directory \" + macOSDirectory, ex);\n }\n\n // 3.Copy icon file to the bundle if specified\n if (iconFile != null) {\n File f = searchFile(iconFile, project.getBasedir());\n\n if (f != null && f.exists() && f.isFile()) {\n getLog().info(\"Copying the Icon File\");\n try {\n FileUtils.copyFileToDirectory(f, resourcesDir);\n } catch (IOException ex) {\n throw new MojoExecutionException(\"Error copying file \" + iconFile + \" to \" + resourcesDir, ex);\n }\n } else {\n throw new MojoExecutionException(String.format(\"Could not locate iconFile '%s'\", iconFile));\n }\n }\n\n // 4. Resolve and copy in all dependencies from the pom\n getLog().info(\"Copying dependencies\");\n List<String> files = copyDependencies(javaDirectory);\n if (additionalBundledClasspathResources != null && !additionalBundledClasspathResources.isEmpty()) {\n files.addAll(copyAdditionalBundledClasspathResources(javaDirectory, \"lib\", additionalBundledClasspathResources));\n }\n\n // 5. Check if JRE should be embedded. Check JRE path. Copy JRE\n if (jrePath != null) {\n File f = new File(jrePath);\n if (f.exists() && f.isDirectory()) {\n // Check if the source folder is a jdk-home\n File pluginsDirectory = new File(contentsDir, \"PlugIns/JRE/Contents/Home/jre\");\n pluginsDirectory.mkdirs();\n\n File sourceFolder = new File(jrePath, \"Contents/Home\");\n if (new File(jrePath, \"Contents/Home/jre\").exists()) {\n sourceFolder = new File(jrePath, \"Contents/Home/jre\");\n }\n\n try {\n getLog().info(\"Copying the JRE Folder from : [\" + sourceFolder + \"] to PlugIn folder: [\" + pluginsDirectory + \"]\");\n FileUtils.copyDirectoryStructure(sourceFolder, pluginsDirectory);\n File binFolder = new File(pluginsDirectory, \"bin\");\n //Setting execute permissions on executables in JRE\n for (String filename : binFolder.list()) {\n new File(binFolder, filename).setExecutable(true, false);\n }\n\n new File (pluginsDirectory, \"lib/jspawnhelper\").setExecutable(true,false);\n embeddJre = true;\n } catch (IOException ex) {\n throw new MojoExecutionException(\"Error copying folder \" + f + \" to \" + pluginsDirectory, ex);\n }\n } else {\n getLog().warn(\"JRE not found check jrePath setting in pom.xml\");\n }\n } else if (jreFullPath != null){\n getLog().info(\"JRE Full path is used [\" + jreFullPath + \"]\");\n embeddJre = true;\n }\n\n // 6. Create and write the Info.plist file\n getLog().info(\"Writing the Info.plist file\");\n File infoPlist = new File(bundleDir, \"Contents\" + File.separator + \"Info.plist\");\n this.writeInfoPlist(infoPlist, files);\n\n // 7. Copy specified additional resources into the top level directory\n getLog().info(\"Copying additional resources\");\n if (additionalResources != null && !additionalResources.isEmpty()) {\n this.copyResources(buildDirectory, additionalResources);\n }\n\n // 7. Make the stub executable\n if (!SystemUtils.IS_OS_WINDOWS) {\n getLog().info(\"Making stub executable\");\n Commandline chmod = new Commandline();\n try {\n chmod.setExecutable(\"chmod\");\n chmod.createArgument().setValue(\"755\");\n chmod.createArgument().setValue(launcher.getAbsolutePath());\n\n chmod.execute();\n } catch (CommandLineException e) {\n throw new MojoExecutionException(\"Error executing \" + chmod + \" \", e);\n }\n } else {\n getLog().warn(\"The stub was created without executable file permissions for UNIX systems\");\n }\n\n // 8. Create the DMG file\n if (generateDiskImageFile) {\n if (SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC) {\n getLog().info(\"Generating the Disk Image file\");\n Commandline dmg = new Commandline();\n try {\n // user wants /Applications symlink in the resulting disk image\n if (includeApplicationsSymlink) {\n createApplicationsSymlink();\n }\n dmg.setExecutable(\"hdiutil\");\n dmg.createArgument().setValue(\"create\");\n dmg.createArgument().setValue(\"-srcfolder\");\n dmg.createArgument().setValue(buildDirectory.getAbsolutePath());\n dmg.createArgument().setValue(diskImageFile.getAbsolutePath());\n\n try {\n dmg.execute().waitFor();\n } catch (InterruptedException ex) {\n throw new MojoExecutionException(\"Thread was interrupted while creating DMG \" + diskImageFile, ex);\n } finally {\n if (includeApplicationsSymlink) {\n removeApplicationsSymlink();\n }\n }\n } catch (CommandLineException ex) {\n throw new MojoExecutionException(\"Error creating disk image \" + diskImageFile, ex);\n }\n\n if (diskImageInternetEnable) {\n getLog().info(\"Enabling the Disk Image file for internet\");\n try {\n Commandline internetEnableCommand = new Commandline();\n\n internetEnableCommand.setExecutable(\"hdiutil\");\n internetEnableCommand.createArgument().setValue(\"internet-enable\");\n internetEnableCommand.createArgument().setValue(\"-yes\");\n internetEnableCommand.createArgument().setValue(diskImageFile.getAbsolutePath());\n\n internetEnableCommand.execute();\n } catch (CommandLineException ex) {\n throw new MojoExecutionException(\"Error internet enabling disk image: \" + diskImageFile, ex);\n }\n }\n projectHelper.attachArtifact(project, \"dmg\", null, diskImageFile);\n }\n if (SystemUtils.IS_OS_LINUX) {\n getLog().info(\"Generating the Disk Image file\");\n Commandline linux_dmg = new Commandline();\n try {\n linux_dmg.setExecutable(\"genisoimage\");\n linux_dmg.createArgument().setValue(\"-V\");\n linux_dmg.createArgument().setValue(bundleName);\n linux_dmg.createArgument().setValue(\"-D\");\n linux_dmg.createArgument().setValue(\"-R\");\n linux_dmg.createArgument().setValue(\"-apple\");\n linux_dmg.createArgument().setValue(\"-no-pad\");\n linux_dmg.createArgument().setValue(\"-o\");\n linux_dmg.createArgument().setValue(diskImageFile.getAbsolutePath());\n linux_dmg.createArgument().setValue(buildDirectory.getAbsolutePath());\n\n try {\n linux_dmg.execute().waitFor();\n } catch (InterruptedException ex) {\n throw new MojoExecutionException(\"Thread was interrupted while creating DMG \" + diskImageFile,\n ex);\n }\n } catch (CommandLineException ex) {\n throw new MojoExecutionException(\"Error creating disk image \" + diskImageFile + \" genisoimage probably missing\", ex);\n }\n projectHelper.attachArtifact(project, \"dmg\", null, diskImageFile);\n\n } else {\n getLog().warn(\"Disk Image file cannot be generated in non Mac OS X and Linux environments\");\n }\n }\n\n getLog().info(\"App Bundle generation finished\");\n }", "public void buildGui() {\n\t}", "public static void main(String[] args) {\n\t\tList<String> productionIssues = AllTestMethodNames.getTestSuiteProductionIssuesMethods(product);\n\t\tList<String> obsolete = AllTestMethodNames.getTestSuiteObsoleteMethods(product);\n\t\tproductionIssues.addAll(obsolete);\n\t\tList<String> productionIssuesAndObsoleteTestCases = productionIssues;\n\n\t\tList<String> logNew;\n\t\tList<String> logOld;\n\t\tLogAnalyzer tool;\n\n\t\tinitializeToolPaths();\n\t\tlogNew = LogAnalyzerReader.readJenkinsLogFromFile(LOG_ANALYZER_LOG_NEW);\n\t\tlogOld = LogAnalyzerReader.readJenkinsLogFromFile(LOG_ANALYZER_LOG_OLD);\n\t\ttool = new LogAnalyzer(logNew);\n\t\tcreateFullReport(tool, logOld, productionIssuesAndObsoleteTestCases);\n\n\t\t// generate xml file with test cases which were started during an automation run but never finished\n\t\t// createXMLWithUnfinishedTestCases(tool, productionIssuesAndObsoleteTestCases);\n\n\t\t// generate xml file with test cases which were not started at all because for instance test run failed before finishing. (eg Java Heap)\n\t\t// Place log contents of complete full recent run into C:\\Automation_artifacts\\LogAnalyzer\\LogAnalyzer-LogOld.log\n\t\t// createXMLWithTestCasesThatNeverStartedFromLog(tool, logOld, productionIssuesAndObsoleteTestCases);\n\n\t\t// Change to which group test cases belong to.\n\t\t// Options below will add additional group to the @Test(groups = {\"\"}) the test cases belong to or if non exist then it will add a new one. This will make the change in the\n\t\t// source code.\n\t\t// In the test case file each test case is separated by a new line, 2 test case file would be ex:\n\t\t// c158643\n\t\t// c256486\n\t\t// Uncomment the option you want below. Place testCaseList.txt file containing test cases needing update in C:\\Automation_artifacts\\LogAnalyzer\\ directory.\n\t\t// Update the product variable value above if its different than cpm\n\n\t\t// AllTestMethodNames.addTestCaseToObsoleteTestCasesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToProductionIssuesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToExternalExecGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToDateTimeChangeGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\",product);\n\t\t// AllTestMethodNames.addTestCaseToCustomGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", \"EnterCustomGroupNameHere\", product); // enter your custom group name as the 2nd parameter.\n\n\t\t// Remove to which group test cases belong to.\n\t\t// AllTestMethodNames.removeTestCaseFromObsoleteTestCasesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromProductionIssuesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromExternalExecGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromDateTimeChangeGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromCustomGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\",\"EnterCustomGroupNameHere\", product ); // enter your custom group name as the 2nd parameter.\n\n\t}", "public static void main(String[] args) throws Exception {\r\n\t\tint res = ToolRunner.run(new Configuration(), new AnnotateClueRunWithURLs(), args);\r\n\t\tSystem.exit(res);\r\n\t}", "public static void main(String args[]) {\n (Installer.instance = new Installer(true)).loadWindow();\n\n //TODO: Save autohide status on file before implementing\n Installer.instance.autoHide.setState(false);\n Installer.instance.autoHide.setVisible(false);\n\n String gameDir = FileUtils.getWorkingDirectory().getAbsolutePath();\n\n /* Forces the forge installer download, enables the progress bar */\n Rectangle oldBounds = Installer.instance.frame.getBounds();\n Installer.instance.frame.setBounds(oldBounds.x, oldBounds.y, oldBounds.width, oldBounds.height + 50);\n\n download(new File(gameDir), manifest_url, true, \"forge\");\n\n /* Removes the progress bar & download status after finishing download */\n Installer.instance.frame.setBounds(oldBounds);\n Installer.instance.downloadStatus.setVisible(false);\n\n log(\"Download completed\");\n }", "public void cosoleText() throws IOException\n\t{\n\t\tconsole.setText(\"\"); //Clear the current text on the console\n\t\t//Create anew Process builder with the command to compile all the projects in the current open directory\n\t\tProcessBuilder processBuilder = new ProcessBuilder(javacCommandBuilder(currentProject, currentFile)); \n\t\tProcess process = processBuilder.start(); //Start the process\n\t\t//Create and start Processes for the CCL Loader and CCLRun functions\n\t\tProcess processCCLoader = new ProcessBuilder(new String[] {\"javac\", \"-cp\", \"Class\",\"-d\", \"Class\", \"SDPRO\\\\src\\\\CompilingClassLoader.java\"} ).start();\n\t\tProcess processCCL = new ProcessBuilder(new String[] {\"javac\", \"-cp\", \"Class\",\"-d\", \"Class\", \"SDPRO\\\\src\\\\CCLRun.java\"} ).start();\n\t\t\n\t\t//If the process fails on compile\n\t\tif(process.getErrorStream().read() != -1)\n\t\t{\n\t\t\t//Get the process Error message\n\t\t\tInputStream in = process.getErrorStream();\n\t\t\t//Read the error message and paste it to the console\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\n\t\t\tString line = null;\n\t\t\twhile (in.read() != -1)\n\t\t\t{\n\t\t\t\tline = br.readLine();\n\t\t\t\tconsole.append(line + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t//If the CCLpader process fails to compile\n\t\tif(processCCLoader.getErrorStream().read() != -1)\n\t\t{\n\t\t\t//Get the process Error message\n\t\t\tInputStream in = processCCLoader.getErrorStream();\n\t\t\t//Read the error message and paste it to the console\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\n\t\t\tString line = null;\n\t\t\twhile (in.read() != -1)\n\t\t\t{\n\t\t\t\tline = br.readLine();\n\t\t\t\tconsole.append(line + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t//If the CCLRun fails to compile\n\t\tif(processCCL.getErrorStream().read() != -1)\n\t\t{\n\t\t\t//Get the process Error message\n\t\t\tInputStream in = processCCL.getErrorStream();\n\t\t\t//Read the error message and paste it to the console\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\n\t\t\tString line = null;\n\t\t\twhile (in.read() != -1)\n\t\t\t{\n\t\t\t\tline = br.readLine();\n\t\t\t\tconsole.append(line + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t//If the process compiles\n\t\tif(process.exitValue() == 0)\n\t\t{\n\t\t\t//Create a new thread\n\t\t\tExecutorService service = Executors.newFixedThreadPool(1);\n\t\t\t//Run the java process in a thread\n\t\t\tservice.submit(new ProcessTask(javaCommadBuilder(currentFile)));\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"com.j256.ormlite.logger.level\", \"ERROR\");\n\n\t\t// Registering resources classes and devices classes\n\t\t// @Extension did not work sometimes\n\t\tfinal PluginManager pluginManager = new JarPluginManager();\n\n\t\tSystem.out.println(\"Registering resource enumeration:\");\n\t\tResourceManager.register(DefaultResource.class);\n\t\tResourceManager.register(Ore.class);\n\t\tResourceManager.register(Ingot.class);\n\t\tResourceManager.register(Plate.class);\n\t\tResourceManager.register(Wire.class);\n\t\tResourceManager.register(Product.class);\n\n\t\tfinal List<Class<? extends Resource>> resourceEnums = pluginManager.getExtensionClasses(Resource.class);\n\t\tfor (final Class<? extends Resource> resourceEnum : resourceEnums) {\n\t\t\tResourceManager.register(resourceEnum);\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Registering device type:\");\n\t\tDeviceController.registerType(Floor.class);\n\t\tDeviceController.registerType(Buyer.class);\n\t\tDeviceController.registerType(Seller.class);\n\t\tDeviceController.registerType(Conveyor.class);\n\t\tDeviceController.registerType(LeftConveyor.class);\n\t\tDeviceController.registerType(RightConveyor.class);\n\t\tDeviceController.registerType(MultiConveyor.class);\n\t\tDeviceController.registerType(Furnace.class);\n\t\tDeviceController.registerType(Press.class);\n\t\tDeviceController.registerType(WireDrawer.class);\n\t\tDeviceController.registerType(Constructor.class);\n\n\t\tDataPersisterManager.registerDataPersisters(ResourcePersister.getInstance());\n\n\t\tfinal List<Class<? extends Device>> devicesClasses = pluginManager.getExtensionClasses(Device.class);\n\t\tfor (final Class<? extends Device> deviceClass : devicesClasses) {\n\t\t\tDeviceController.registerType(deviceClass);\n\t\t}\n\n\t\tSystem.out.println(\"-----------------------------------------------------------------\");\n\n\t\tlaunch(args);\n\t}", "public MakePlugin() {\n super(\n new ExerciseBuilder(),\n new StudentFileAwareSubmissionProcessor(),\n new StudentFileAwareZipper(),\n new StudentFileAwareUnzipper());\n this.makeUtils = new MakeUtils();\n }", "Lighter build();", "private boolean buildFile(IFile file) {\n \t\t/* \n \t\t * We want to compile each source file in .gf with these commands:\n \t\t * i --retain HelloEng.gf\n \t\t * ss -strip -save\n \t\t * \n \t\t * Shell command: echo \"ss -strip -save\" | gf -retain HelloEng.gf\n \t\t */\n \t\tString filename = file.getName();\n \t\tString buildDir = getBuildDirectory(file);\n \t\t\n \t\tArrayList<String> command = new ArrayList<String>();\n \t\tcommand.add(gfPath);\n \t\tcommand.add(\"--retain\");\n \t\tif (USE_INDIVIDUAL_FOLDERS) {\n \t\t\tcommand.add(String.format(\"..%1$s..%1$s%2$s\", java.io.File.separator, filename));\n \t\t} else {\n \t\t\tcommand.add(\"..\" + java.io.File.separator + filename);\n \t\t}\n \t\t\n \t\ttry {\n \t\t\t// Check the build directory and try to create it\n \t\t\tFile buildDirFile = new File(buildDir);\n \t\t\tif (!buildDirFile.exists()) {\n \t\t\t\tbuildDirFile.mkdir();\n \t\t\t}\n \t\t\t\n \t\t\t// Piece together our GF process\n \t\t\tProcessBuilder b = new ProcessBuilder(command);\n \t\t\tb.directory(buildDirFile);\n //\t\t\tb.redirectErrorStream(true);\n \t\t\tProcess process = b.start();\n \t\t\t\n \t\t\t// Feed it our commands, then quit\n \t\t\tBufferedWriter processInput = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));\n \t\t\tprocessInput.write(\"ss -strip -save\");\n \t\t\tprocessInput.newLine();\n \t\t\tprocessInput.flush();\n \t\t\tprocessInput.write(\"quit\");\n \t\t\tprocessInput.newLine();\n \t\t\tprocessInput.flush();\n \t\t\t\n //\t\t\tBufferedReader processError = new BufferedReader(new InputStreamReader(process.getErrorStream()));\n //\t\t\tString err_str;\n //\t\t\twhile ((err_str = processError.readLine()) != null) {\n//\t\t\t\tSystem.out.println(err_str);\n //\t\t\t}\n \t\t\tBufferedReader processOutput = new BufferedReader(new InputStreamReader(process.getInputStream()));\n \t\t\tString out_str;\n \t\t\twhile ((out_str = processOutput.readLine()) != null) {\n\t\t\t\tSystem.out.println(out_str);\n \t\t\t}\n \t\t\t\n \t\t\t// Tidy up\n \t\t\tprocessInput.close();\n //\t\t\tprocessOutput.close();\n \t\t\tprocess.waitFor();\n \t\t\treturn true;\n \t\t\t\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t} catch (InterruptedException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\t\n \t\treturn false;\t\t\n \t}", "private void createSupportFiles(@NonNull final CommandLineRunner launcher,\n @NonNull final Map<String, String> env)\n throws IOException, InterruptedException, LoggedErrorException {\n File rawFolder = new File(mResOutputDir, SdkConstants.FD_RES_RAW);\n\n SourceSearcher searcher = new SourceSearcher(\n Collections.singletonList(rawFolder), EXT_BC);\n FileGatherer fileGatherer = new FileGatherer();\n searcher.search(fileGatherer);\n\n WaitableExecutor<Void> mExecutor = new WaitableExecutor<Void>();\n\n for (final File bcFile : fileGatherer.getFiles()) {\n String name = bcFile.getName();\n final String objName = name.replaceAll(\"\\\\.bc\", \".o\");\n final String soName = \"librs.\" + name.replaceAll(\"\\\\.bc\", \".so\");\n\n for (final Abi abi : ABIS) {\n if (mAbiFilters != null && !mAbiFilters.contains(abi.mDevice)) {\n continue;\n }\n\n // make sure the dest folders exist\n final File objAbiFolder = new File(mObjOutputDir, abi.mDevice);\n if (!objAbiFolder.isDirectory() && !objAbiFolder.mkdirs()) {\n throw new IOException(\"Unable to create dir \" + objAbiFolder.getAbsolutePath());\n }\n\n final File libAbiFolder = new File(mLibOutputDir, abi.mDevice);\n if (!libAbiFolder.isDirectory() && !libAbiFolder.mkdirs()) {\n throw new IOException(\"Unable to create dir \" + libAbiFolder.getAbsolutePath());\n }\n\n mExecutor.execute(new Callable<Void>() {\n @Override\n public Void call() throws Exception {\n File objFile = createSupportObjFile(bcFile, abi, objName, objAbiFolder,\n launcher, env);\n createSupportLibFile(objFile, abi, soName, libAbiFolder, launcher, env);\n return null;\n }\n });\n }\n }\n\n mExecutor.waitForTasksWithQuickFail(true /*cancelRemaining*/);\n }", "public QuarkusCodestartTestBuilder buildTool(BuildTool buildTool) {\n this.buildTool = buildTool;\n return this;\n }", "private BuildTargets() {}", "public void execute()\n throws BuildException {\n this.validator = new TestClassValidator.DefaultClassValidator();\n this.validator.setListener(new TestClassValidator.ClassValidatorListener() {\n public void info(String message) {\n log(\"INFO> \" + message, verbosity);\n System.out.println(\"INFO> \" + message);\n }\n\n public void warning(String message) {\n log(\"WARNING> \" + message, verbosity);\n System.out.println(\"WARNING> \" + message);\n }\n\n public void error(String message) {\n log(\"ERROR> \" + message, verbosity);\n System.out.println(\"ERROR> \" + message);\n }\n });\n\n\n if (classpath != null) {\n classpath.setProject(project);\n this.loader = new AntClassLoader(project, classpath);\n }\n\n log(TestClassValidator.BANNER, Project.MSG_VERBOSE);\n System.out.println(TestClassValidator.BANNER);\n int count = 0;\n for (int i = 0; i < filesets.size(); i++) {\n FileSet fs = (FileSet) filesets.get(i);\n\n try {\n DirectoryScanner ds = fs.getDirectoryScanner(project);\n ds.scan();\n\n String[] files = ds.getIncludedFiles();\n\n for (int k = 0; k < files.length; k++) {\n String pathname = files[k];\n if (pathname.endsWith(\".class\")) {\n String classname = pathname.substring(0, pathname.length() - \".class\".length()).replace(File.separatorChar, '.');\n processFile(classname);\n }\n }\n count += files.length;\n } catch (BuildException e) {\n if (failonerror) {\n throw e;\n } else {\n log(e.getMessage(), quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);\n }\n } catch (ClassNotFoundException e) {\n if (failonerror) {\n throw new BuildException(e);\n } else {\n log(e.getMessage(), quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);\n }\n }\n log(\"Number of classes: \" + count, Project.MSG_VERBOSE);\n System.out.println(\"Number of classes: \" + count);\n }\n }", "public static void main(String[] args)throws Exception {\n\t\tnew recipes().run();\r\n\t}", "public static void main(String[] args) {\n addTint(new DemoTint());\n // start script with filename and function registry\n start(\"demo.tea\");\n }", "private <T> T run(LinkedList<String> args,JSONFactory<T> f,boolean canRerun){\r\n \t\r\n \t\tif (bwPath==null){\r\n \t\t\tif (!showedNoExeError){\r\n \t\t\t\tBuildWrapperPlugin.logError(BWText.error_noexe, null);\r\n \t\t\t\tshowedNoExeError=true;\r\n \t\t\t}\r\n \t\t\treturn null;\r\n \t\t}\r\n \t\tshowedNoExeError=false;\r\n \t\tboolean isConfigureAction=args.size()>0 && (\"synchronize\".equals(args.get(0)) || \"configure\".equals(args.get(0)) || \"build\".equals(args.get(0)));\r\n \t\targs.addFirst(bwPath);\r\n \t\targs.add(\"--tempfolder=\"+DIST_FOLDER);\r\n \t\tif (cabalImplDetails!=null){\r\n \t\t\targs.add(\"--cabalpath=\"+cabalImplDetails.getExecutable());\r\n \t\t}\r\n \t\targs.add(\"--cabalfile=\"+cabalFile);\r\n \t\targs.add(\"--cabalflags=\"+flags);\r\n \t\tfor (String s:extraOpts){\r\n \t\t\targs.add(\"--cabaloption=\"+s);\r\n \t\t}\r\n \t\tif (cabalImplDetails!=null){\r\n \t\t\tfor (String s:cabalImplDetails.getOptions()){\r\n \t\t\t\targs.add(\"--cabaloption=\"+s);\r\n \t\t\t}\r\n \t\t}\r\n \t\tProcessBuilder pb=new ProcessBuilder();\r\n \t\tpb.directory(workingDir);\r\n \t\tpb.redirectErrorStream(true);\r\n \t\tpb.command(args);\r\n \t\taddBuildWrapperPath(pb);\r\n \t\tif (ow!=null && BuildWrapperPlugin.logAnswers) {\r\n \t\t\tow.addMessage(LangUtil.join(args, \" \"));\r\n \t\t}\t\t\t\t\t\r\n \t\tT obj=null;\r\n \t\ttry {\r\n \t\t\tProcess p=pb.start();\r\n \t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream(),FileUtil.UTF8));\r\n \t\t\t//long t0=System.currentTimeMillis();\r\n \t\t\tString l=br.readLine();\r\n \t\t\tboolean goOn=true;\r\n \t\t\tboolean needConfigure=false;\r\n \t\t\tboolean needDelete=false;\r\n \t\t\twhile (goOn && l!=null){\r\n \t\t\t\t/*if (outStream!=null){\r\n \t\t\t\t\toutStream.write(l);\r\n \t\t\t\t\toutStream.write(PlatformUtil.NL);\r\n \t\t\t\t\toutStream.flush();\r\n \t\t\t\t}*/\r\n \t\t\t\t\r\n \t\t\t\tif (l.startsWith(prefix)){\r\n \t\t\t\t\tif (ow!=null && BuildWrapperPlugin.logAnswers) {\r\n \t\t\t\t\t\tow.addMessage(l);\r\n \t\t\t\t\t}\t\t\t\t\t\r\n \t\t\t\t\tString jsons=l.substring(prefix.length()).trim();\r\n \t\t\t\t\ttry {\r\n \t\t\t\t\t\tobj=f.fromJSON(jsons);\r\n \t\t\t\t\t} catch (JSONException je){\r\n \t\t\t\t\t\tBuildWrapperPlugin.logError(BWText.process_parse_error, je);\r\n \t\t\t\t\t}\r\n \t\t\t\t\tgoOn=false;\r\n \r\n \t\t\t\t} else {\r\n \t\t\t\t\tString ll=l.toLowerCase(Locale.ENGLISH);\r\n \t\t\t\t\tif (ll.contains(CabalMessages.RERUN_CONFIGURE) || ll.contains(CabalMessages.CANNOT_SATISFY)){\r\n \t\t\t\t\t\tif (ll.contains(CabalMessages.VERSION)){\r\n \t\t\t\t\t\t\tneedDelete=true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tneedConfigure=true;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (ow!=null) {\r\n \t\t\t\t\t\tow.addMessage(l);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (goOn){\r\n \t\t\t\t\tl=br.readLine();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (needConfigure && canRerun && !isConfigureAction){\r\n \t\t\t\tif (needDelete){\r\n \t\t\t\t\ttry {\r\n \t\t\t\t\t\tIFolder fldr=project.getFolder(DIST_FOLDER);\r\n \t\t\t\t\t\tif (fldr.exists()){\r\n \t\t\t\t\t\t\tfldr.delete(IResource.FORCE, new NullProgressMonitor());\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} catch (CoreException ce){\r\n \t\t\t\t\t\tBuildWrapperPlugin.logError(BWText.process_launch_error, ce);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tconfigure(new BuildOptions());\r\n \t\t\t\treturn run(new LinkedList<String>(args.subList(1, args.size()-4)),f,false);\r\n \t\t\t} else if (needDelete){\r\n \t\t\t\tconfigureFailures++;\r\n \t\t\t\tif (BuildWrapperPlugin.getMaxConfigureFailures()>=0 && configureFailures>=BuildWrapperPlugin.getMaxConfigureFailures()){\r\n \t\t\t\t\tBuildWrapperPlugin.logError(BWText.error_toomanyfailures, null);\r\n \t\t\t\t\tshowedNoExeError=true;\r\n \t\t\t\t\tbwPath=null;\r\n \t\t\t\t}\r\n \t\t\t// we reran and we don't need to configure after that call, we reset the count\r\n \t\t\t} else if (!canRerun && !needConfigure){\r\n \t\t\t\tconfigureFailures=0;\r\n \t\t\t}\r\n \t\t\t// maybe now the folder exists...\r\n \t\t\tif (needSetDerivedOnDistDir){\r\n \t\t\t\tsetDerived();\r\n \t\t\t}\r\n \t\t\t//long t1=System.currentTimeMillis();\r\n \t\t\t//BuildWrapperPlugin.logInfo(\"read run:\"+(t1-t0)+\"ms\");\r\n \t\t} catch (IOException ioe){\r\n \t\t\tBuildWrapperPlugin.logError(BWText.process_launch_error, ioe);\r\n \t\t}\r\n \t\treturn obj;\r\n \t}", "private void addGroovyScriptMultiJob() {\r\n\t\tString html_text = \"\";\r\n\t\tString html_newline = \"\";\r\n\r\n if (getOptionHTMLBuildDesc().equalsIgnoreCase(\"HTML\")) {\r\n html_text = \".html\";\r\n html_newline = \"<br>\";\r\n } else {\r\n html_text = \".txt\";\r\n html_newline = \"\\\\n\";\r\n }\r\n String script =\r\n\"import hudson.FilePath\\n\" +\r\n\"\\n\" +\r\n\"FilePath fp_c = new FilePath(manager.build.getWorkspace(),'CombinedReport\" + html_text + \"')\\n\" +\r\n\"FilePath fp_f = new FilePath(manager.build.getWorkspace(),'@PROJECT_BASE@_full_report\" + html_text + \"')\\n\" +\r\n\"\\n\" +\r\n\"if (fp_c.exists() && fp_f.exists())\\n\" +\r\n// Must put HTML in createSummary and not description. Description will be truncated\r\n// and shown in Build history on left and cause corruption in the display, particularly\r\n// if using 'anything-goes-formatter'\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"monitor.png\\\").appendText(fp_c.readToString() + \\\"\" + html_newline + \"\\\" + fp_f.readToString(), false)\\n\" +\r\n\"}\\n\" +\r\n\"else\\n\" +\r\n\"{\\n\" +\r\n\" manager.createSummary(\\\"warning.gif\\\").appendText(\\\"General Failure\\\", false, false, false, \\\"red\\\")\\n\" +\r\n\" manager.buildUnstable()\\n\" +\r\n\" manager.build.description = \\\"General Failure, Incremental Build Report or Full Report Not Present. Please see the console for more information\\\"\\n\" +\r\n\" manager.addBadge(\\\"warning.gif\\\", \\\"General Error\\\")\\n\" +\r\n\"}\\n\" +\r\n\"\\n\";\r\n script = StringUtils.replace(script, \"@PROJECT_BASE@\", getBaseName());\r\n\r\n SecureGroovyScript secureScript = new SecureGroovyScript(script, /*sandbox*/false, /*classpath*/null);\r\n GroovyPostbuildRecorder groovy = new GroovyPostbuildRecorder(secureScript, /*behaviour*/2, /*matrix parent*/false);\r\n getTopProject().getPublishersList().add(groovy);\r\n }", "public void run() throws Exception {\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tStandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n\t\tPath tempFolder = Files.createTempDirectory(\"gwt-jackson-apt-tmp\", new FileAttribute[0]);\n\t\tfileManager.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tfileManager.setLocation(StandardLocation.SOURCE_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tCompilationTask task = compiler.getTask(\n\t\t\t\tnew PrintWriter(System.out), \n\t\t\t\tfileManager, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tfileManager.getJavaFileObjects(\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicTest.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseInterface.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass2.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SimpleGenericBeanObject.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicGenericClass.java\")));\n\n\n\t\ttask.setProcessors(Arrays.asList(new ObjectMapperProcessor()));\n\t\ttask.call();\n\t}", "public TeamBuildTool(Team team) {\n this.team = team;\n run();\n }", "public static void main(final String[] args) {\n ManualStartUi.newStyleBuilder();\n }", "public static void main(String[] argv) {\r\n\t\tDemo15 demo = new Demo15();\r\n\t\tdemo.start();\r\n\t}" ]
[ "0.6349391", "0.6135693", "0.59528357", "0.5910785", "0.59091824", "0.5844861", "0.56910104", "0.5670798", "0.5627073", "0.5608749", "0.5592133", "0.5475898", "0.5462547", "0.53992414", "0.5394016", "0.5384833", "0.5363209", "0.532423", "0.53233236", "0.5304557", "0.5285875", "0.5258076", "0.5252016", "0.5248224", "0.52466166", "0.5245659", "0.5237395", "0.5223258", "0.52179927", "0.51998067", "0.51962936", "0.5189829", "0.5179704", "0.517621", "0.51751477", "0.517392", "0.5143228", "0.5139267", "0.51269555", "0.5118524", "0.51037014", "0.5101918", "0.5090043", "0.5064186", "0.5060598", "0.50493854", "0.50461054", "0.5044627", "0.50306034", "0.50077766", "0.4988327", "0.4986867", "0.49750814", "0.49735713", "0.49521595", "0.49511254", "0.49505612", "0.4950063", "0.4934305", "0.4931305", "0.49232233", "0.49227092", "0.4912246", "0.4905485", "0.49002424", "0.4897786", "0.48916772", "0.4888325", "0.48861292", "0.48835936", "0.48820746", "0.4871654", "0.48715863", "0.48706916", "0.4866563", "0.48644283", "0.48579928", "0.485316", "0.48341757", "0.48255655", "0.48239404", "0.48216277", "0.48166636", "0.48105267", "0.481044", "0.48038188", "0.4785144", "0.47828424", "0.47779357", "0.47678614", "0.4765207", "0.4757636", "0.47546202", "0.4748703", "0.4740201", "0.47305948", "0.47259644", "0.47175628", "0.47173867", "0.4712036" ]
0.6195713
1
The class holding records for this type
@Override public Class<QuestionForBuddysRecord> getRecordType() { return QuestionForBuddysRecord.class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RecordRecord() {\n\t\tsuper(org.jooq.examples.cubrid.demodb.tables.Record.RECORD);\n\t}", "public Class<?> getRecordClass() \n\t{\n\t return recordClass ;\n\t}", "public DataRecord() {\n super(DataTable.DATA);\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "public Record() {\n data = new int[DatabaseManager.fieldNames.length];\n }", "@Override\n public Class<PgClassRecord> getRecordType() {\n return PgClassRecord.class;\n }", "@Override\n public Class<ModelRecord> getRecordType() {\n return ModelRecord.class;\n }", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "public ARecord() {\n super(A.A);\n }", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "public ObjectRecord() {\n\t\tsuper(org.jooq.test.hsqldb.generatedclasses.tables.Object.OBJECT);\n\t}", "public WERecordDataModel()\n\t{\n\t\tsuper();\n\t\tsetEqFileName(RECORD_NAME);\n\t\tinitMessages();\n\t}", "public Record toRecord() {\n return new Record().setColumns(this);\n }", "DataHRecordData() {}", "@Override\n public Class<ResourcesRecord> getRecordType() {\n return ResourcesRecord.class;\n }", "public GO_RecordType() {\n }", "@Override\n public Class<QsRecord> getRecordType() {\n return QsRecord.class;\n }", "public ItemRecord() {\n super(Item.ITEM);\n }", "public Record getRecord() {\n return record;\n }", "public Record getRecord() {\n return record;\n }", "@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}", "@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}", "@Override\n public Class<LinearmodelRecord> getRecordType() {\n return LinearmodelRecord.class;\n }", "@JsonProperty(\"Records\") abstract List<?> getRecords();", "public Item_Record() {\n super(Item_.ITEM_);\n }", "@Override\n public Class<MytableRecord> getRecordType() {\n return MytableRecord.class;\n }", "@Override\n protected Class<RecordType> getBoundType() {\n return RecordType.class;\n }", "@Override\n public Class<PatientRecord> getRecordType() {\n return PatientRecord.class;\n }", "public interface CollectionRecord {\n\n\t/**\n\t * Gets the id attribute of the CollectionRecord object\n\t *\n\t * @return The id value\n\t */\n\tpublic String getId();\n\n\n\t/**\n\t * Gets the setSpec attribute of the CollectionRecord object\n\t *\n\t * @return The setSpec value\n\t */\n\tpublic String getSetSpec();\n\n\n\t/**\n\t * Gets the metadataHandle attribute of the CollectionRecord object\n\t *\n\t * @param collectionSetSpec setSpec (e.g., \"dcc\")\n\t * @return The metadataHandle value\n\t * @exception Exception if there is a webservice error\n\t */\n\tpublic String getMetadataHandle(String collectionSetSpec) throws Exception;\n\n\n\t/**\n\t * Gets the handleServiceBaseUrl attribute of the CollectionRecord object\n\t *\n\t * @return The handleServiceBaseUrl value\n\t */\n\tpublic String getHandleServiceBaseUrl();\n\n\t/* \tpublic String getNativeFormat();\n\tpublic DcsDataRecord getDcsDataRecord();\n\tpublic MetaDataFramework getMetaDataFramework();\n\tpublic Document getLocalizedDocument(); */\n}", "@Override\n\tpublic Class<QuotesRecord> getRecordType() {\n\t\treturn QuotesRecord.class;\n\t}", "@Override\n public Class<AnalysisRecord> getRecordType() {\n return AnalysisRecord.class;\n }", "public Record() {\n this.symptoms = new LinkedHashSet<>();\n this.diagnoses = new LinkedHashSet<>();\n this.prescriptions = new LinkedHashSet<>();\n }", "public OpenERPRecordSet() {\r\n\t\trecords = new Vector<OpenERPRecord>();\r\n\t}", "public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public GenericData.Record serialize() {\n return null;\n }", "public GenericTcalRecord() {\n this(-1);\n }", "public StudentRecord() {\n\t\tscores = new ArrayList<>();\n\t\taverages = new double[5];\n\t}", "@Override\n public Class<CarmodelRecord> getRecordType() {\n return CarmodelRecord.class;\n }", "@Override\n public Class<MemberRecord> getRecordType() {\n return MemberRecord.class;\n }", "public BookRecord() {\n super(Book.BOOK);\n }", "@Override\n public Class<SearchLogsRecord> getRecordType() {\n return SearchLogsRecord.class;\n }", "@Override\n public Class<EasytaxTaxationsRecord> getRecordType() {\n return EasytaxTaxationsRecord.class;\n }", "public SalesRecords() {\n super();\n }", "public SongRecord(){\n\t}", "@Override\n public Class<LangsRecord> getRecordType() {\n return LangsRecord.class;\n }", "public PersonRecord(){\n\t\tlistNames = new ArrayList<String>();\n\t}", "@Override\n public Class<RoomRecord> getRecordType() {\n return RoomRecord.class;\n }", "@Override\n public Class<CalcIndicatorAccRecordInstanceRecord> getRecordType() {\n return CalcIndicatorAccRecordInstanceRecord.class;\n }", "public ArrayList<Record> getRecords() {\r\n\t\treturn records;\r\n\t}", "@Override\n public Class<CourseRecord> getRecordType() {\n return CourseRecord.class;\n }", "@Override\n public Class<CabTripDataRecord> getRecordType() {\n return CabTripDataRecord.class;\n }", "@Override\n public Class<TripsRecord> getRecordType() {\n return TripsRecord.class;\n }", "public Item_Record(Integer _Id_, String name_, String description_, String code_, Double price_, Double retailPrice_, Double costPrice_, Object _Search_, String[] _Types_, String _LastModified_, Integer _Version_) {\n super(Item_.ITEM_);\n\n set(0, _Id_);\n set(1, name_);\n set(2, description_);\n set(3, code_);\n set(4, price_);\n set(5, retailPrice_);\n set(6, costPrice_);\n set(7, _Search_);\n set(8, _Types_);\n set(9, _LastModified_);\n set(10, _Version_);\n }", "@Override\r\n\tpublic List<T> getRecords() {\n\t\treturn null;\r\n\t}", "@Override\n public Class<StudentCourseRecord> getRecordType() {\n return StudentCourseRecord.class;\n }", "@Override\n public Class<ZTest1Record> getRecordType() {\n return ZTest1Record.class;\n }", "public OfcRecordRecord() {\n\t\tsuper(org.openforis.collect.persistence.jooq.tables.OfcRecord.OFC_RECORD);\n\t}", "public Class<gDBR> getRecordClass() \n {\n return this.rcdClass;\n }", "public RecordingRepository() {\r\n recordings = new ArrayList<>();\r\n recordingMap = new HashMap<>();\r\n recordingsByMeetingIDMap = new HashMap<>();\r\n update();\r\n }", "@Override\n public Class<GchCarLifeBbsRecord> getRecordType() {\n return GchCarLifeBbsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<nesi.jobs.tables.records.HourlyRecordRecord> getRecordType() {\n\t\treturn nesi.jobs.tables.records.HourlyRecordRecord.class;\n\t}", "@Override\n public Class<AccountRecord> getRecordType() {\n return AccountRecord.class;\n }", "public ExperimentRecord() {\n super(Experiment.EXPERIMENT);\n }", "public MealRecord() {\n\t\tsuper(Meal.MEAL);\n\t}", "@Override\n public Class<StaffRecord> getRecordType() {\n return StaffRecord.class;\n }", "public LateComingRecord() {\n\t\t}", "@Override\n public Class<AssessmentStudenttrainingworkflowRecord> getRecordType() {\n return AssessmentStudenttrainingworkflowRecord.class;\n }", "public UsersRecord() {\n super(Users.USERS);\n }", "@Override\n public Class<MyMenuRecord> getRecordType() {\n return MyMenuRecord.class;\n }", "public DataPersistence() {\n storage = new HashMap<>();\n idCounter = 0;\n }", "public AnswerRecord() {\n super(Answer.ANSWER);\n }", "public DatasetReader()\n\t{\n\t\treviews = new ArrayList<Review>();\n\t\tratings = new HashMap<Double,List<Double>>();\n\t\tproducts = new HashMap<String, Map<String,Double>>();\n\t\tproductRatings = new HashMap<String, List<Double>>();\n\t\treInstanceList = new ArrayList<ReviewInstance>();\n\t\treInstanceMap = new HashMap<String, ReviewInstance>();\n\t}", "@Override\n public Class<JournalEntryLineRecord> getRecordType() {\n return JournalEntryLineRecord.class;\n }", "@Override\n public Class<CommentsRecord> getRecordType() {\n return CommentsRecord.class;\n }", "@Override\n public Class<SpeedAlertsHistoryRecord> getRecordType() {\n return SpeedAlertsHistoryRecord.class;\n }", "@Override\n public Class<RatingsRecord> getRecordType() {\n return RatingsRecord.class;\n }", "@Override\n public Class<TOpLogsRecord> getRecordType() {\n return TOpLogsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<net.user1.union.zz.common.model.tables.records.ZzcronRecord> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic RelationClass() {\n\t\t\n\t\tParser pars = new Parser(FILE_NAME); \t\t\t\t\t\t\t\n\t\tint bucketlength = 0;\n\t\tbucketlength = (int) (pars.getNumOfLines()*BUCKET_MULTIPLIER);\n\t\tbuckets = (Node<k,v>[]) new Node<?,?>[bucketlength];\n\t\tpars.process(this);\t\t\t\t\t\t\t\t\t\t\t\t\n\t}", "@Override\n\tpublic java.lang.Class<persistencia.tables.records.AsientoRecord> getRecordType() {\n\t\treturn persistencia.tables.records.AsientoRecord.class;\n\t}", "@Override\n public Class<StatsRecord> getRecordType() {\n return StatsRecord.class;\n }", "@Override\n\tpublic Class<QuestionRecord> getRecordType() {\n\t\treturn QuestionRecord.class;\n\t}", "public MetricSchemaRecord() { }", "public PedidoRecord() {\n super(Pedido.PEDIDO);\n }", "@Override\n public Class<DynamicSchemaRecord> getRecordType() {\n return DynamicSchemaRecord.class;\n }", "public PersonRecord() {}", "@Override\n\tpublic Class<RentalRecord> getRecordType() {\n\t\treturn RentalRecord.class;\n\t}", "public PagesRecord() {\n super(Pages.PAGES);\n }", "@Override\n public Class<AbsenceRecord> getRecordType() {\n return AbsenceRecord.class;\n }", "@Override\n public Class<RedpacketConsumingRecordsRecord> getRecordType() {\n return RedpacketConsumingRecordsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<jooq.model.tables.records.TBasicSalaryRecord> getRecordType() {\n\t\treturn jooq.model.tables.records.TBasicSalaryRecord.class;\n\t}", "public YearlyRecord() {\n this.wordToCount = new HashMap<String, Integer>();\n this.wordToRank = new HashMap<String, Integer>();\n this.countToWord = new HashMap<Integer, Set<String>>();\n }" ]
[ "0.68004626", "0.66954035", "0.64103794", "0.6398801", "0.6398801", "0.6398801", "0.6398801", "0.6393993", "0.6354873", "0.6192012", "0.61258304", "0.61258304", "0.61258304", "0.6104736", "0.60470754", "0.60470754", "0.60470754", "0.6040716", "0.6029211", "0.6020949", "0.6008978", "0.60082155", "0.6006576", "0.59716636", "0.59703285", "0.5949182", "0.5949182", "0.59396815", "0.59396815", "0.5936131", "0.5935658", "0.5895888", "0.5895527", "0.5893964", "0.5884042", "0.58751285", "0.58681023", "0.5865894", "0.5864961", "0.5855157", "0.58495414", "0.58392423", "0.58338994", "0.58154637", "0.58069575", "0.57927567", "0.578939", "0.57841045", "0.5779981", "0.5753099", "0.5741735", "0.57333666", "0.57321835", "0.5731796", "0.57317585", "0.572287", "0.5720141", "0.5712233", "0.56939065", "0.56927073", "0.5685293", "0.56847894", "0.5683809", "0.56834316", "0.56828403", "0.56666017", "0.56607187", "0.56579894", "0.5648655", "0.56438047", "0.5620551", "0.561873", "0.5609984", "0.55931836", "0.55871445", "0.5586237", "0.55789423", "0.55779636", "0.55737203", "0.55702287", "0.55692416", "0.5561011", "0.5559403", "0.5543905", "0.5541634", "0.5536858", "0.5522634", "0.5517553", "0.5517258", "0.5512109", "0.5509594", "0.55070907", "0.5496529", "0.54921997", "0.5491354", "0.5486711", "0.5481696", "0.54758567", "0.5471066", "0.54659206" ]
0.5851545
40
Create a public.question_for_buddys table reference
public QuestionForBuddys() { this(DSL.name("question_for_buddys"), null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}", "public void createSurvey(int tid);", "public QuestionForBuddys(Name alias) {\n this(alias, QUESTION_FOR_BUDDYS);\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"ANSWERS_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"ID_QUESTION\\\" TEXT,\" + // 1: idQuestion\n \"\\\"ID_ANSWER\\\" TEXT,\" + // 2: idAnswer\n \"\\\"DESCRIPTION\\\" TEXT,\" + // 3: description\n \"\\\"VALUE\\\" INTEGER,\" + // 4: value\n \"\\\"POINTS\\\" INTEGER,\" + // 5: points\n \"\\\"ENABLE\\\" INTEGER,\" + // 6: enable\n \"\\\"TXT_SECOND_QUESTION\\\" TEXT);\"); // 7: txtSecondQuestion\n }", "public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}", "public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}", "private void createStocksTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE stocks \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \" + \"owner INT, \"\n\t\t\t\t\t+ \"shareAmount INT, \" + \"purchasePrice DOUBLE, \" + \"symb VARCHAR(10), \"\n\t\t\t\t\t+ \"timePurchased BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table stocks\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of stocks table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "public void buildItems() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT\"\n + \" EXISTS items (order_id TEXT, item TEXT, FOREIGN KEY (order_id)\"\n + \" REFERENCES orders(id) ON DELETE CASCADE ON UPDATE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException exc) {\n exc.printStackTrace();\n }\n }", "public QuestionForBuddys(String alias) {\n this(DSL.name(alias), QUESTION_FOR_BUDDYS);\n }", "void create(Trubriques trubriques);", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "private void createTableOrdersWaiting() throws SQLException\r\n {\r\n String sqlQuery = \r\n \"CREATE TABLE orders \" +\r\n \"(id auto_increment INT NOT NULL PRIMARY KEY, \" +\r\n \"custname VARCHAR(25) NOT NULL, \" +\r\n \"tablenumber INT NOT NULL, \" +\r\n \"foodname VARCHAR(100) NOT NULL, \" + \r\n \"beveragename VARCHAR(100) NOT NULL, \" + \r\n \"served BOOLEAN NOT NULL, \" + \r\n \"billed BOOLEAN NOT NULL, \" + \r\n \"time DATETIME DEFAULT CURRENT_TIMESTAMP)\";\r\n myStmt.executeUpdate(sqlQuery);\r\n }", "int createSurvey(List<Question> questions, String userId);", "BTable createBTable();", "@Test\r\n\tpublic void testCreate() {\r\n\t\tQuestion q = new Question(\"Empty\", 1, 20, quizzes, null, choices);\r\n\t\tdao.create(q);\r\n\t}", "private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"EXAM_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"TITLE\\\" TEXT,\" + // 1: title\n \"\\\"TYPE\\\" INTEGER NOT NULL ,\" + // 2: type\n \"\\\"ANSWER_A\\\" TEXT,\" + // 3: answerA\n \"\\\"ANSWER_B\\\" TEXT,\" + // 4: answerB\n \"\\\"ANSWER_C\\\" TEXT,\" + // 5: answerC\n \"\\\"ANSWER_D\\\" TEXT,\" + // 6: answerD\n \"\\\"REAL_ANSWER\\\" TEXT);\"); // 7: realAnswer\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public void fillQuestionsTable() {\n\n //Hard Questions\n Questions q1 = new Questions(\"The redshift of a distant galaxy is 0·014. According to Hubble’s law, the distance of the galaxy from Earth is? \", \" 9·66 × 10e-12 m\", \" 9·32 × 10e27 m\", \"1·83 × 10e24 m\", \"1·30 × 10e26 m \", 3);\n addQuestion(q1);\n Questions q2 = new Questions(\"A ray of monochromatic light passes from air into water. The wavelength of this light in air is 589 nm. The speed of this light in water is? \", \" 2·56 × 10e2 m/s \", \"4·52 × 10e2 m/s\", \"4·78 × 10e2 m/s\", \"1·52 × 10e2 m/s\", 2);\n addQuestion(q2);\n Questions q3 = new Questions(\"A car is moving at a speed of 2·0 m s−1. The car now accelerates at 4·0 m s−2 until it reaches a speed of 14 m s−1. The distance travelled by the car during this acceleration is\", \"1.5m\", \"18m\", \"24m\", \"25m\", 3);\n addQuestion(q3);\n Questions q4 = new Questions(\"A spacecraft is travelling at 0·10c relative to a star. \\nAn observer on the spacecraft measures the speed of light emitted by the star to be?\", \"0.90c\", \"1.00c\", \"1.01c\", \"0.99c\", 2);\n addQuestion(q4);\n Questions q5 = new Questions(\"Measurements of the expansion rate of the Universe lead to the conclusion that the rate of expansion is increasing. Present theory proposes that this is due to? \", \"Redshift\", \"Dark Matter\", \"Dark Energy\", \"Gravity\", 3);\n addQuestion(q5);\n Questions q6 = new Questions(\"A block of wood slides with a constant velocity down a slope. The slope makes an angle of 30º with the horizontal axis. The mass of the block is 2·0 kg. The magnitude of the force of friction acting on the block is?\" , \"1.0N\", \"2.0N\", \"9.0N\", \"9.8N\", 4);\n addQuestion(q6);\n Questions q7 = new Questions(\"A planet orbits a star at a distance of 3·0 × 10e9 m. The star exerts a gravitational force of 1·6 × 10e27 N on the planet. The mass of the star is 6·0 × 10e30 kg. The mass of the planet is? \", \"2.4 x 10e14 kg\", \"3.6 x 10e25 kg\", \"1.2 x 10e16 kg\", \"1.6 x 10e26 kg\", 2);\n addQuestion(q7);\n Questions q8 = new Questions(\"Radiation of frequency 9·00 × 10e15 Hz is incident on a clean metal surface. The maximum kinetic energy of a photoelectron ejected from this surface is 5·70 × 10e−18 J. The work function of the metal is?\", \"2.67 x 10e-19 J\", \"9.10 x 10e-1 J\", \"1.60 x 10e-18 J\", \"4.80 x 10e-2 J\", 1);\n addQuestion(q8);\n Questions q9 = new Questions(\"The irradiance of light from a point source is 32 W m−2 at a distance of 4·0 m from the source. The irradiance of the light at a distance of 16 m from the source is? \", \"1.0 W m-2\", \"8.0 W m-2\", \"4.0 W m-2\", \"2.0 W m-2\", 4);\n addQuestion(q9);\n Questions q10 = new Questions(\"A person stands on a weighing machine in a lift. When the lift is at rest, the reading on the weighing machine is 700 N. The lift now descends and its speed increases at a constant rate. The reading on the weighing machine...\", \"Is a constant value higher than 700N. \", \"Is a constant value lower than 700N. \", \"Continually increases from 700 N. \", \"Continually decreases from 700 N. \", 2);\n addQuestion(q10);\n\n //Medium Questions\n Questions q11 = new Questions(\"What is Newtons Second Law of Motion?\", \"F = ma\", \"m = Fa\", \"F = a/m\", \"Every action has an equal and opposite reaction\", 1);\n addQuestion(q11);\n Questions q12 = new Questions(\"In s = vt, what does s stand for?\", \"Distance\", \"Speed\", \"Sin\", \"Displacement\", 4);\n addQuestion(q12);\n Questions q13 = new Questions(\"An object reaches terminal velocity when...\", \"Forward force is greater than the frictional force.\", \"All forces acting on that object are equal.\", \"Acceleration starts decreasing.\", \"Acceleration is greater than 0\", 2);\n addQuestion(q13);\n Questions q14 = new Questions(\"An Elastic Collision is where?\", \"There is no loss of Kinetic Energy.\", \"There is a small loss in Kinetic Energy.\", \"There is an increase in Kinetic Energy.\", \"Some Kinetic Energy is transferred to another type.\", 1);\n addQuestion(q14);\n Questions q15 = new Questions(\"The speed of light is?\", \"Different for all observers.\", \"The same for all observers. \", \"The same speed regardless of the medium it is travelling through. \", \"Equal to the speed of sound.\", 2);\n addQuestion(q15);\n Questions q16 = new Questions(\"What is redshift?\", \"Light moving to us, shifting to red. \", \"A dodgy gear change. \", \"Light moving away from us shifting to longer wavelengths.\", \"Another word for dark energy. \", 3);\n addQuestion(q16);\n Questions q17 = new Questions(\"Which law allows us to estimate the age of the universe?\", \"Newtons 3rd Law \", \"The Hubble-Lemaitre Law \", \"Planck's Law \", \"Wien's Law \", 2);\n addQuestion(q17);\n Questions q18 = new Questions(\"The standard model...\", \"Models how time interacts with space. \", \"Describes how entropy works. \", \"Is the 2nd Law of Thermodynamics. \", \"Describes the fundamental particles of the universe and how they interact\", 4);\n addQuestion(q18);\n Questions q19 = new Questions(\"The photoelectric effect gives evidence for?\", \"The wave model of light. \", \"The particle model of light. \", \"The speed of light. \", \"The frequency of light. \", 2);\n addQuestion(q19);\n Questions q20 = new Questions(\"AC is a current which...\", \"Doesn't change direction. \", \"Is often called variable current. \", \"Is sneaky. \", \"Changes direction and instantaneous value with time. \", 4);\n addQuestion(q20);\n\n //Easy Questions\n Questions q21 = new Questions(\"What properties does light display?\", \"Wave\", \"Particle\", \"Both\", \"Neither\", 3);\n addQuestion(q21);\n Questions q22 = new Questions(\"In V = IR, what does V stand for?\", \"Velocity\", \"Voltage\", \"Viscosity\", \"Volume\", 2);\n addQuestion(q22);\n Questions q23 = new Questions(\"The abbreviation rms typically stands for?\", \"Round mean sandwich. \", \"Random manic speed. \", \"Root manic speed. \", \"Root mean squared. \", 4);\n addQuestion(q23);\n Questions q24 = new Questions(\"Path Difference = \", \"= (m/λ) or (m + ½)/λ where m = 0,1,2…\", \"= mλ or (m + ½) λ where m = 0,1,2…\", \"= λ / m or (λ + ½) / m where m = 0,1,2…\", \" = mλ or (m + ½) λ where m = 0.5,1.5,2.5,…\", 2);\n addQuestion(q24);\n Questions q25 = new Questions(\"How many types of quark are there?\", \"6\", \"4 \", \"8\", \"2\", 1);\n addQuestion(q25);\n Questions q26 = new Questions(\"A neutrino is a type of?\", \"Baryon\", \"Gluon\", \"Lepton\", \"Quark\", 3);\n addQuestion(q26);\n Questions q27 = new Questions(\"A moving charge produces:\", \"A weak field\", \"An electric field\", \"A strong field\", \"Another moving charge\", 2);\n addQuestion(q27);\n Questions q28 = new Questions(\"What contains nuclear fusion reactors?\", \"A magnetic field\", \"An electric field\", \"A pool of water\", \"Large amounts of padding\", 1);\n addQuestion(q28);\n Questions q29 = new Questions(\"What is the critical angle of a surface?\", \"The incident angle where the angle of refraction is 45 degrees.\", \"The incident angle where the angle of refraction is 90 degrees.\", \"The incident angle where the angle of refraction is 135 degrees.\", \"The incident angle where the angle of refraction is 180 degrees.\", 2);\n addQuestion(q29);\n Questions q30 = new Questions(\"Which is not a type of Lepton?\", \"Electron\", \"Tau\", \"Gluon\", \"Muon\", 3);\n addQuestion(q30);\n }", "private void fillQuestionsTable() {\n Question q1 = new Question(\"Who is NOT a Master on the Jedi council?\", \"Anakin Skywalker\", \"Obi Wan Kenobi\", \"Mace Windu\", \"Yoda\", 1);\n Question q2 = new Question(\"Who was Anakin Skywalker's padawan?\", \"Kit Fisto\", \"Ashoka Tano\", \"Barris Ofee\", \"Jacen Solo\",2);\n Question q3 = new Question(\"What Separatist leader liked to make find additions to his collection?\", \"Pong Krell\", \"Count Dooku\", \"General Grevious\", \"Darth Bane\", 3);\n Question q4 = new Question(\"Choose the correct Response:\\n Hello There!\", \"General Kenobi!\", \"You are a bold one!\", \"You never should have come here!\", \"You turned her against me!\", 1);\n Question q5 = new Question(\"What ancient combat technique did Master Obi Wan Kenobi use to his advantage throughout the Clone Wars?\", \"Kendo arts\", \"The High ground\", \"Lightsaber Form VIII\", \"Force healing\", 2);\n Question q6 = new Question(\"What was the only surviving member of Domino squad?\", \"Fives\", \"Heavy\", \"Echo\", \"Jesse\", 3);\n Question q7 = new Question(\"What Jedi brutally murdered children as a part of his descent to become a Sith?\", \"Quinlan Vos\", \"Plo Koon\", \"Kit Fisto\", \"Anakin Skywalker\", 4);\n Question q8 = new Question(\"What Sith was the first to reveal himself to the Jedi after a millenia and was subsquently cut in half shortly after?\", \"Darth Plagieus\", \"Darth Maul\", \"Darth Bane\", \"Darth Cadeus\", 2);\n Question q9 = new Question(\"What 4 armed creature operates a diner on the upper levels of Coruscant?\", \"Dexter Jettster\", \"Cad Bane\", \"Aurua Sing\", \"Dorme Amidala\", 1);\n Question q10 = new Question(\"What ruler fell in love with an underage boy and subsequently married him once he became a Jedi?\", \"Aurua Sing\", \"Duttchess Satine\", \"Mara Jade\", \"Padme Amidala\", 4);\n\n // adds them to the list\n addQuestion(q1);\n addQuestion(q2);\n addQuestion(q3);\n addQuestion(q4);\n addQuestion(q5);\n addQuestion(q6);\n addQuestion(q7);\n addQuestion(q8);\n addQuestion(q9);\n addQuestion(q10);\n }", "tbls createtbls();", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"BUDGETS\\\" (\" + //\n \"\\\"idBudget\\\" INTEGER PRIMARY KEY ,\" + // 0: id\n \"\\\"ID_USER\\\" INTEGER NOT NULL ,\" + // 1: idUser\n \"\\\"BUDGET_DATE\\\" INTEGER,\" + // 2: budgetDate\n \"\\\"ACTIVE\\\" INTEGER);\"); // 3: active\n }", "protected void createTableRecordings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Recordings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"artist_name\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track_name\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"CONSTRAINT unique_track PRIMARY KEY (artist_name, track_name)\" \t+\n\t\t\t\t\");\"\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "@Override\n public void onCreate(SQLiteDatabase db) {\n this.db = db;\n\n final String SQL_CREATE_QUESTIONS_TABLE = \"CREATE TABLE \" +\n QuestionsTable.Table_name + \" ( \" +\n QuestionsTable._ID + \" Integer PRIMARY KEY AUTOINCREMENT, \" +\n QuestionsTable.Column_Question + \" TEXT, \" +\n QuestionsTable.Column_Option1 + \" TEXT, \" +\n QuestionsTable.Column_Option2 + \" TEXT, \" +\n QuestionsTable.Column_Option3 + \" TEXT, \" +\n QuestionsTable.Column_Option4 + \" TEXT, \" +\n QuestionsTable.Column_Answer_Nr + \" Integer\" +\n \")\";\n\n\n db.execSQL(SQL_CREATE_QUESTIONS_TABLE);\n fillQuestionsTable();\n }", "public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void buildRatingsTable() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT EXISTS user_ratings (user_id\"\n + \" TEXT, rating REAL, user_type TEXT, FOREIGN KEY (user_ID)\"\n + \" REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\n\t\t\n\t\tdb.execSQL(\"CREATE TABLE \"+TABLE+\" (\"+QID+\" TEXT, \"+\n\t\t\t\tQNAME+\" TEXT, \"+OPTIONA+\" TEXT,\"+OPTIONB+\" TEXT,\"+OPTIONC+\" TEXT,\"+OPTIOND+\" TEXT,\"+ANS+\" TEXT) ;\");\n\t\t\n\t//\tdb.execSQL(\"insert into \"+TestTable+\"values('10','Grace period for the renewal of a permanent Driving License','a)Nill','b)30days','C)60days','D)90days');\");\n\t\t\n\t}", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public void createAll() {\n SQLFormater SQLFormaterMoods = new SQLFormater(MOODS_TABLE_NAME, ID_FIELD); // objects help to form sql strings for creating tables\n SQLFormater SQLFormaterAnswers = new SQLFormater(ANSWERS_TABLE_NAME, ID_FIELD);\n\n String[] answersTableFields = {ANSWERS_FIELD, ID_MOODS_FIELD}; // ordered fields\n String[] moodsTableFields = {MOODS_FIELD, HI_FIELD, BYBY_FIELD};\n\n SQLFormaterMoods.setNewField(MOODS_FIELD, STRING_TYPE, \"NOT NULL\"); // creating tables\n SQLFormaterMoods.setNewField(HI_FIELD, STRING_TYPE, null);\n SQLFormaterMoods.setNewField(BYBY_FIELD, STRING_TYPE, null);\n dbConnection.execute(SQLFormaterMoods.getStringToCreateDB(null));\n\n SQLFormaterAnswers.setNewField(ANSWERS_FIELD, STRING_TYPE, \"NOT NULL\");\n SQLFormaterAnswers.setNewField(ID_MOODS_FIELD, INTEGER_TYPE, null);\n String reference = \"FOREIGN KEY (\" + ID_MOODS_FIELD + \")\" +\n \" REFERENCES \" + MOODS_TABLE_NAME +\n \"(\" + ID_FIELD + \")\";\n dbConnection.execute(SQLFormaterAnswers.getStringToCreateDB(reference)); // create table with reference\n\n insertTableValues(SQLFormaterMoods, moodsTableFields, getMoodsTableValues()); // inserting ordered values into tables\n insertTableValues(SQLFormaterAnswers, answersTableFields, getAnswersTableValues());\n }", "public static void createTable() {\n\n // Create statement\n Statement statement = null;\n try {\n statement = Database.getDatabase().getConnection().createStatement();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n // Attempt to create table\n try {\n statement.execute(\n \"CREATE TABLE \" + Constants.SANITATION_TABLE + \"(\" +\n \"requestID INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\" +\n \"nodeID VARCHAR(100) References \" + Constants.LOCATION_TABLE + \" (nodeID), \" +\n \"priority VARCHAR(10), \" +\n \"status VARCHAR(100), \" +\n \"description VARCHAR(100), \" +\n \"requesterID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"requestTime TIMESTAMP, \" +\n \"servicerID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"claimedTime TIMESTAMP, \" +\n \"completedTime TIMESTAMP, \" +\n \"CONSTRAINT priority_enum CHECK (priority in ('LOW', 'MEDIUM', 'HIGH')), \" +\n \"CONSTRAINT status_enum CHECK (status in ('INCOMPLETE', 'COMPLETE')))\"\n );\n } catch (SQLException | NullPointerException e) {\n e.printStackTrace();\n }\n }", "public void createTable(String tableName) {\n db.execSQL(\"create table if not exists '\" + tableName.replaceAll(\"\\\\s\", \"_\") + \"' (\"\n + KEY_ROWID + \" integer primary key autoincrement, \"\n + KEY_QUESTION + \" string not null, \"\n + KEY_ANSWER + \" string not null);\");\n }", "protected abstract void insertQuestionTx(QuestionImpl question);", "public static final String getAuthKWRelTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authkw_\" +shortname +\r\n\t\t\"(author varchar(70) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" PRIMARY KEY (keyword,author)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"GAME_FILL_ITEM\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY UNIQUE ,\" + // 0: id\n \"\\\"TITLE\\\" TEXT,\" + // 1: title\n \"\\\"ANSWER\\\" INTEGER NOT NULL ,\" + // 2: answer\n \"\\\"FIRST_ANSWER\\\" TEXT,\" + // 3: first_answer\n \"\\\"SECOND_ANSWER\\\" TEXT,\" + // 4: second_answer\n \"\\\"THIRD_ANSWER\\\" TEXT,\" + // 5: third_answer\n \"\\\"FOURTH_ANSWER\\\" TEXT);\"); // 6: fourth_answer\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString CREATE_MULTI = \"CREATE TABLE multichoice (\"\n\t\t\t\t+ \"id INTEGER PRIMARY KEY AUTOINCREMENT, \"\n\t\t\t\t+ \"question_id INTEGER, \" + \"value TEXT ); \";\n\t\t// create the mutli-answer table\n\t\tdb.execSQL(CREATE_MULTI);\n\n\t\t// create Question Table\n\t\tString CREATE_QUES = \"CREATE TABLE questions (\"\n\t\t\t\t+ \"id INTEGER PRIMARY KEY AUTOINCREMENT,\" + \"variable TEXT, \"\n\t\t\t\t+ \"month INTEGER, \" + \"day INTEGER, \" + \"year INTEGER, \"\n\t\t\t\t+ \"day_week TEXT, \" + \"time TEXT, \" + \"type TEXT, \"\n\t\t\t\t+ \"value TEXT );\";\n\n\t\t// create the question table\n\t\tdb.execSQL(CREATE_QUES);\n\t}", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"DCPURCHASE_DATA\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,\" + // 0: id\n \"\\\"VFCROPS_ID\\\" INTEGER NOT NULL ,\" + // 1: vfcropsId\n \"\\\"EXPECTNEEDS_NUM\\\" INTEGER NOT NULL ,\" + // 2: expectneedsNum\n \"\\\"DATE\\\" TEXT,\" + // 3: date\n \"\\\"DCID\\\" INTEGER NOT NULL );\"); // 4: dcid\n }", "protected void createTableListenings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Listenings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"user\t\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track\t\t\tVARCHAR(259),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"playcount\t\tINTEGER,\" \t\t\t\t\t\t\t\t\t\t\t+ \n\t\t\t\t\"FOREIGN KEY (user) REFERENCES Persons(lfm_username),\" \t\t\t\t+\n\t\t\t\t\"FOREIGN KEY (listens_to) REFERENCES Recordings(unique_track)\"\t\t+\n\t\t\t\t\");\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }", "public void createTable() throws DatabaseException\n\t{\n\t\tConnection connection = DatabaseManager.getSingleton().getConnection();\n\t\ttry\n\t\t{\n\t\t\tClosingPreparedStatement stmt = new ClosingPreparedStatement(connection,\n\t\t\t\t\t\"DROP TABLE IF EXISTS QuestStates\");\n\t\t\tstmt.executeUpdate();\n\t\t\tstmt.close();\n\n\t\t\tstmt = new ClosingPreparedStatement(connection,\n\t\t\t\t\t\"Create TABLE QuestStates (playerID INT NOT NULL, questID INT NOT NULL , questState INT NOT NULL, needingNotification BOOLEAN NOT NULL)\");\n\t\t\tstmt.executeUpdate();\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\tthrow new DatabaseException(\"Unable to create the Quest table\", e);\n\t\t}\n\t}", "private void createReferentialIntegrityConstraints() {\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" ADD FOREIGN KEY (THE_BOOK_FK) REFERENCES \" + IDaoBooks.TABLE + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" ADD FOREIGN KEY (THE_AUTHOR_FK) REFERENCES \" + IDaoPersons.TABLE + \" (ID) ON UPDATE SET NULL\");\n\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_KIND_FK) REFERENCES \" + SimpleData.DataType.KIND.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_LANGUAGE_FK) REFERENCES \" + SimpleData.DataType.LANGUAGE.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_LENDING_FK) REFERENCES \" + IDaoLendings.TABLE + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_SAGA_FK) REFERENCES \" + SimpleData.DataType.SAGA.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_TYPE_FK) REFERENCES \" + SimpleData.DataType.TYPE.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_EDITOR_FK) REFERENCES \" + IDaoEditors.TABLE + \" (ID) ON UPDATE SET NULL\");\n }", "ForeignKey createForeignKey();", "public void createbook(Author a, Connection c) throws SQLException{\n\t a.insert(c, \"While the cows lie\", \"Cows are big and cannot run\", 2, 2, 0);\r\n\t\t\r\n\t\t\r\n\t\t//a.createTable(c);\r\n\t\t//String chapName= \"Toodloo\";\r\n\t\t//String chap = \"Bippidee boppidee\";\r\n\t\t//a.insert(c, chapName, chap);\r\n\t\t//a.viewnextchap(c,2);\r\n\t\t//a.getNextChap(c, 2);\r\n\t}", "@Override\n\tpublic void createBanque(Banque b) {\n\t\t\n\t}", "private void statsTable() {\n try (Connection connection = hikari.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS `\" + TABLE_STATS + \"` \" +\n \"(id INT NOT NULL AUTO_INCREMENT UNIQUE, \" +\n \"uuid varchar(255) PRIMARY KEY, \" +\n \"name varchar(255), \" +\n \"kitSelected varchar(255), \" +\n \"points INT, \" +\n \"kills INT, \" +\n \"deaths INT, \" +\n \"killstreaks INT, \" +\n \"currentKillStreak INT, \" +\n \"inGame BOOLEAN)\")) {\n statement.execute();\n statement.close();\n connection.close();\n }\n } catch (SQLException e) {\n LogHandler.getHandler().logException(\"TableCreator:statsTable\", e);\n }\n }", "@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }", "@Override\n public void add(Question q) {\n try {\n c = DBConncetion.getConnection();\n int type = q.getType() == MultipleChoice ? 1 : 2; // 1 = MC , 2 = FB\n System.out.println(type);\n String sql = \"Insert into mainquestion \\n\" +\n \"Values (?,?,?,?,0,0,0)\";\n PreparedStatement pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,q.getTitle());\n pstmt.setString(3,String.valueOf(q.getTime()));\n pstmt.setString(4,String.valueOf(type));\n pstmt.executeUpdate();\n if (type == 1) {\n sql = \"Insert into multiplechoice \\n\" +\n \"Values (?,?,?,?,?,?)\";\n MultipleChoice mc = (MultipleChoice) q;\n String[] answers = mc.getAnswers();\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,answers[0]);\n pstmt.setString(3,answers[1]);\n pstmt.setString(4,answers[2]);\n pstmt.setString(5,answers[3]);\n pstmt.setString(6,mc.getCorrectAnswers());\n pstmt.executeUpdate();\n } else {\n sql = \"Insert into fill_blank Values(?,?)\";\n FillBlank fb = (FillBlank) q;\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,fb.getCorrectAnswer());\n pstmt.executeUpdate();\n }\n } catch (Exception e) {\n throw new LoadSaveException(\"Error while adding\");\n }\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"FITTING_TABLE\\\" (\" + //\n \"\\\"NAME\\\" TEXT PRIMARY KEY NOT NULL ,\" + // 0: name\n \"\\\"DB_NAME\\\" TEXT,\" + // 1: dbName\n \"\\\"CATEGORY\\\" TEXT,\" + // 2: category\n \"\\\"DES\\\" TEXT,\" + // 3: des\n \"\\\"LAYOUT_RESOURCE_ID\\\" INTEGER);\"); // 4: layoutResourceID\n }", "public static void createOrders() {\n Connection con = getConnection();\n\n String createString;\n createString = \"create table Orders (\" +\n \"Prod_ID INTEGER, \" +\n \"ProductName VARCHAR(20), \" +\n \"Employee_ID INTEGER )\";\n\n try {\n stmt = con.createStatement();\n stmt.executeUpdate(createString);\n\n stmt.close();\n con.close();\n\n } catch (SQLException ex) {\n System.err.println(\"SQLException: \" + ex.getMessage());\n }\n JOptionPane.showMessageDialog(null, \"Orders Table Created\");\n }", "private void insertDummyBook() {\n ContentValues values = new ContentValues();\n values.put(BookEntry.COLUMN_NAME, getString(R.string.dummy_book_name));\n values.put(BookEntry.COLUMN_GENRE, BookEntry.GENRE_SELF_HELP);\n values.put(BookEntry.COLUMN_PRICE, getResources().getInteger(R.integer.dummy_book_price));\n values.put(BookEntry.COLUMN_QUANTITY, getResources().getInteger(R.integer.dummy_book_quantity));\n values.put(BookEntry.COLUMN_SUPPLIER, getString(R.string.dummy_book_supplier));\n values.put(DatabaseContract.BookEntry.COLUMN_SUPPLIER_PHONE, getString(R.string.dummy_supplier_phone_number));\n values.put(DatabaseContract.BookEntry.COLUMN_SUPPLIER_EMAIL, getString(R.string.dummy_book_supplier_email));\n getContentResolver().insert(BookEntry.CONTENT_URI, values);\n }", "FromTable createFromTable();", "void addQuestions(String surveyId, List<Question> questions);", "public question() {\n initComponents();\n this.setLocationRelativeTo(null);\n Fillcombo();\n FillTableAdd(\"select * from question\");\n FillTableDel(\"select * from question\");\n FillTableUpd(\"select * from question\");\n \n }", "public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}", "public WishlistItemTbl () {\n\t\tsuper();\n\t}", "public int createTable(KeywordFactory kwf, boolean quiet) \n throws InterruptedException, IOException \n {\n int status = dropTable(true);\n /*\n if (tablecreated) {\n int status = dropTable();\n // if (status != 0) return status;\n }\n */\n\n DbCreateTable crtr = new MySQLCreateTable(kwf, tbl);\n\n Process proc = startDbClient();\n Writer w = new OutputStreamWriter(proc.getOutputStream());\n crtr.writeSqlScript(w);\n w.close();\n\n proc.waitFor();\n if (! quiet) {\n if (proc.exitValue() > 0) {\n for (String line : emsgs) \n System.err.println(line);\n }\n else {\n tablecreated = true;\n System.err.println(\"Table \"+tbl+\" created\");\n }\n }\n\n return proc.exitValue();\n }", "public boolean createQuestion(int qID, int cID, String q, String a1, String a2, String a3, String a4, String a5, int correctAns) {\n try {\n Connection con = Database.createDBconnection();\n String ins = \"INSERT into question (question_ID, category_ID, question, ans1, ans2, ans3, ans4, ans5, correct_answer, point_value) values ('\"\n + qID + \"','\" + cID + \"','\" + q + \"','\" + a1 + \"','\" + a2 + \"','\" + a3 + \"','\" + a4 + \"','\" + a5 + \"','\" + correctAns + \"','\" + 10 + \"');\";\n Statement ins_stmt = con.createStatement();\n ins_stmt.executeUpdate(ins);\n\n Database.closeDBconnection(con);\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "private void generateTemporaryTable(String tableName, Collection<?> items, SQLProcessor sqlP)\n throws GenericEntityException {\n //Ensure connection is created\n sqlP.getConnection();\n\n //Determine the data type to create based on the item element type\n //Right now this only works for SQL server so we hardcode the SQL server data types\n //And we only support numbers and strings at this point\n Object firstItem = items.iterator().next();\n String dataType;\n if (firstItem instanceof Number) {\n dataType = \"bigint\";\n } else {\n dataType = \"varchar(8000)\"; //8000 is max size of varchar for SQL server\n }\n\n sqlP.executeUpdate(\"create table #\" + tableName + \" (item \" + dataType + \" primary key)\");\n\n //Insert data into this temporary table\n sqlP.prepareStatement(\"insert into #\" + tableName + \" (item) values (?)\");\n PreparedStatement stat = sqlP.getPreparedStatement();\n try {\n for (Object item : items) {\n if (item instanceof Number) {\n stat.setLong(1, ((Number) item).longValue());\n } else if (item instanceof String) {\n stat.setString(1, (String) item);\n } else {\n stat.setObject(1, item);\n }\n\n stat.addBatch();\n }\n stat.executeBatch();\n } catch (SQLException e) {\n throw new GenericEntityException(e.getMessage(), e);\n } finally {\n try {\n stat.close();\n } catch (SQLException ignore) {\n }\n }\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"BIG_MONSTERS\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"NAME\\\" TEXT,\" + // 1: name\n \"\\\"TIPS\\\" TEXT,\" + // 2: tips\n \"\\\"ATTACK\\\" INTEGER NOT NULL ,\" + // 3: attack\n \"\\\"ARMOR\\\" INTEGER NOT NULL ,\" + // 4: armor\n \"\\\"LIFE\\\" INTEGER NOT NULL ,\" + // 5: life\n \"\\\"TYPE\\\" TEXT,\" + // 6: type\n \"\\\"MONSTER_PLACE_ID\\\" INTEGER NOT NULL ,\" + // 7: monsterPlaceId\n \"\\\"EXP\\\" INTEGER NOT NULL ,\" + // 8: exp\n \"\\\"MONEY\\\" INTEGER NOT NULL ,\" + // 9: money\n \"\\\"DROP_GOODS_ID\\\" INTEGER,\" + // 10: dropGoodsId\n \"\\\"CONSUME_POWER\\\" INTEGER NOT NULL ,\" + // 11: consumePower\n \"\\\"IS_GONE\\\" INTEGER NOT NULL ,\" + // 12: isGone\n \"\\\"IS_DEAD\\\" INTEGER NOT NULL ,\" + // 13: isDead\n \"\\\"DAYS\\\" INTEGER NOT NULL ,\" + // 14: days\n \"\\\"ATTACK_SPEED\\\" INTEGER NOT NULL );\"); // 15: attackSpeed\n }", "public static void createTables() throws SQLException {\n\t\tString table = \"CREATE table users(\" + \"customer_ID INT NOT NULL,\" + \"uNAME VARCHAR(15) NOT NULL,\"\n\t\t\t\t+ \"BANNED boolean default 0,\" + \"PRIMARY KEY(customer_ID)\" + \");\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\n\t\t// Creating table items, Items(Item_ID, Item_name, Cost, department);\n\t\ttable = \"CREATE table items(\" + \"item_ID INT NOT NULL,\" + \"item_name VARCHAR(25) NOT NULL,\"\n\t\t\t\t+ \"cost double not null,\" + \"department VARCHAR(20) DEFAULT NULL,\" + \"PRIMARY KEY(item_id, department)\"\n\t\t\t\t+ \");\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\n\t\t// Needed for foreign key on department.\n\t\ttable = \"CREATE index department on items(department);\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\n\t\t// Creating table sales, Sales(Sales_ID, customer_id, Item_ID,\n\t\t// SaleDate);\n\t\ttable = \"CREATE table sales(\" + \"sales_ID INT NOT NULL,\" + \"customer_ID INT,\" + \"item_ID INT,\"\n\t\t\t\t+ \"sale_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\" + \"department VARCHAR(20) DEFAULT 'None',\"\n\t\t\t\t+ \"PRIMARY KEY(sales_ID),\";\n\t\ttable += \"FOREIGN KEY(customer_ID) references users(customer_ID) ON DELETE SET NULL,\";\n\t\ttable += \"FOREIGN KEY(item_ID) references items(item_ID) ON DELETE SET NULL,\";\n\t\ttable += \"FOREIGN KEY(department) references items(department) ON DELETE SET NULL\";\n\t\ttable += \");\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\t}", "private void createTables() {\n\n\t\tAutoDao.createTable(db, true);\n\t\tAutoKepDao.createTable(db, true);\n\t\tMunkaDao.createTable(db, true);\n\t\tMunkaEszkozDao.createTable(db, true);\n\t\tMunkaKepDao.createTable(db, true);\n\t\tMunkaTipusDao.createTable(db, true);\n\t\tPartnerDao.createTable(db, true);\n\t\tPartnerKepDao.createTable(db, true);\n\t\tProfilKepDao.createTable(db, true);\n\t\tSoforDao.createTable(db, true);\n\t\tTelephelyDao.createTable(db, true);\n\t\tPushMessageDao.createTable(db, true);\n\n\t}", "public void createNewTable(String dbName, String tableName) {\r\n\t\t// SQL statement for creating a new table\r\n\t\tString sql = \"CREATE TABLE IF NOT EXISTS \" + tableName + \" (\\n\"\r\n\t\t\t\t+ \"id integer PRIMARY KEY,\\n\"\r\n\t\t\t\t+ \"first_name VARCHAR(20) NOT NULL,\\n\"\r\n\t\t\t\t+ \"last_name VARCHAR(20) NOT NULL,\\n\"\r\n\t\t\t\t+ \"manager_id integer NOT NULL,\\n\"\r\n\t\t\t\t+ \"join_date DATE NOT NULL,\\n\"\r\n\t\t\t\t+ \"billable_hours double NOT NULL);\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tConnection conn = this.connect(dbName);\t\t\t// open connection\r\n\t\t\t\r\n\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\r\n\t\t\t// create a new table using prepared sql statement\r\n\t\t\tstmt.execute(sql);\r\n\t\t\tSystem.out.println(\"Executed create table statement\");\r\n\t\t\t\r\n\t\t\tconn.close();\t\t\t\t\t\t\t\t\t// close connection\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public void createSourceOrderItemTable() throws SQLException {\n sourceExecuteWithLog(extraSQLCommand.getCreateTableOrderItem());\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"BACK_ALARM_MODEL\\\" (\" + //\n \"\\\"BACKID\\\" TEXT,\" + // 0: BACKID\n \"\\\"RECEPID\\\" TEXT,\" + // 1: RECEPID\n \"\\\"USERID\\\" TEXT,\" + // 2: USERID\n \"\\\"DQID\\\" TEXT,\" + // 3: DQID\n \"\\\"DQNAME\\\" TEXT,\" + // 4: DQNAME\n \"\\\"CHECKER\\\" TEXT,\" + // 5: CHECKER\n \"\\\"BACKTIME\\\" TEXT,\" + // 6: BACKTIME\n \"\\\"BACKSTATUS\\\" TEXT,\" + // 7: BACKSTATUS\n \"\\\"ISFIRE\\\" TEXT,\" + // 8: ISFIRE\n \"\\\"FIRETYPE\\\" TEXT,\" + // 9: FIRETYPE\n \"\\\"FIRESIUATION\\\" TEXT,\" + // 10: FIRESIUATION\n \"\\\"POLICESIUATION\\\" TEXT,\" + // 11: POLICESIUATION\n \"\\\"BELONGAREAID\\\" TEXT,\" + // 12: BELONGAREAID\n \"\\\"BELONGAREANAME\\\" TEXT,\" + // 13: BELONGAREANAME\n \"\\\"INRELATION\\\" TEXT,\" + // 14: INRELATION\n \"\\\"REMARK\\\" TEXT,\" + // 15: REMARK\n \"\\\"REMARK1\\\" TEXT,\" + // 16: REMARK1\n \"\\\"REMARK2\\\" TEXT);\"); // 17: REMARK2\n }", "@Test(timeout = 4000)\n public void test49() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n SQLUtil.normalize(\";AS5U5EP/!f\", true);\n System.setCurrentTimeMillis(2989L);\n String[] stringArray0 = new String[1];\n stringArray0[0] = \"; AS5U5EP / ! f\";\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\";AS5U5EP/!f\", true, defaultDBTable0, stringArray0, defaultDBTable0, stringArray0);\n SQLUtil.constraintName(dBForeignKeyConstraint0);\n Random.setNextRandom(223);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"VKT,^OP\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n String CREATE_BEER_TABLE = \"CREATE TABLE \" + TABLE_BEERS + \"(\" + KEY_ID + \" INTEGER PRIMARY KEY,\" +\n BEER_NAME + \" TEXT,\" + BEER_RATING + \" INTEGER,\" + USER_NAME + \" TEXT,\" + BREWERY + \" TEXT)\";\n\n db.execSQL(CREATE_BEER_TABLE);\n }", "@Override\r\n\tpublic boolean createBooking(Booking_IF bk) {\r\n\t\tPreparedStatement myStatement = null;\r\n\t\tString query = null;\r\n\t\tint count = 0;\r\n\t\ttry{\r\n\t\t\tquery = \"insert into Booking values(?,?);\";\r\n\t\t\tmyStatement = myCon.prepareStatement(query);\r\n\t\t\tmyStatement.setInt(2, bk.getUserid());\r\n\t\t\tmyStatement.setInt(1, bk.getShiftid());\r\n\t\t\tcount = myStatement.executeUpdate();\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally{\r\n\t\t\ttry {\r\n\t\t\t\tif (myStatement != null)\r\n\t\t\t\t\tmyStatement.close();\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count!=1){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}", "@Override\n public void execute()\n {\n mDbHandle.execSQL(CREATE_TABLE_BLOOD_SUGAR);\n }", "private void createCheckingAccountsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE checkingAccounts \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY ( START WITH 1000000001, INCREMENT BY 1 ), \" + \"owner INT, \"\n\t\t\t\t\t+ \"balance DOUBLE, \" + \"intRate DOUBLE, \"\n\t\t\t\t\t+ \"timeCreated BIGINT, \" + \"lastPaidInterest DOUBLE, \"\n\t\t\t\t\t+ \"dateOfLastPaidInterest BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table checkingAccounts\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of checkingAccounts table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "TABLE createTABLE();", "public void createTableIfAbsent() {\n try (Statement statement = connection.createStatement()) {\n\n statement.executeUpdate(\"CREATE TABLE IF NOT EXISTS `BookReview`(\" +\n \" id INTEGER PRIMARY KEY AUTOINCREMENT,\" +\n \" title VARCHAR(100),\" +\n \" author_id INTEGER,\" +\n \" FOREIGN KEY (`author_id`) REFERENCES `authors`(`id`)\" +\n \")\");\n\n } catch (SQLException e) {\n throw new BookDaoException(e);\n }\n }", "@Test(timeout = 4000)\n public void test124() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"Illegal column type format: \");\n String[] stringArray0 = new String[9];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"66i,cw\", true, stringArray0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "public void addQuestionNote(int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_QUESTION_NOTES, null, values);\r\n\r\n db.close();\r\n }", "public void createNewTable() throws WoodsException{\n\t\t\tuserTable = new Table(tableName);\n\t\t\tDatabase.get().storeTable(tableName, userTable);\n\t\t}", "public void createDepartamentoTable() throws SQLException {\n\t\tString sql = \"create table departamento (piso int, depto varchar(100), expensas double,\ttitular varchar(100))\";\n\t\tConnection c = DBManager.getInstance().connect();\n\t\tStatement s = c.createStatement();\n\t\ts.executeUpdate(sql);\n\t\tc.commit();\n\t\t\t\n\t}", "public static void RecipeTipsFirebaseCreate(\n Context context,\n String recipe_tips_recipe,\n String recipe_tips_number,\n String recipe_tips_text) {\n\n try {\n\n databaseReference = FirebaseDatabase.getInstance().getReference(TABLE_RECIPE_TIPS);\n\n String firebaseKey = databaseReference.push().getKey();\n\n assert firebaseKey != null;\n\n databaseReference.child(firebaseKey).child(FIELD_RECIPE_TIPS_RECIPE).setValue(recipe_tips_recipe);\n databaseReference.child(firebaseKey).child(FIELD_RECIPE_TIPS_NUMBER).setValue(recipe_tips_number);\n databaseReference.child(firebaseKey).child(FIELD_RECIPE_TIPS_TEXT).setValue(recipe_tips_text);\n\n } catch (Exception error) {\n\n String ClassName = String.class.getName();\n new SupportHandlingExceptionError(ClassName, error, context);\n\n }\n }", "public void initializeCategory() {\n try {\n Connection connection = connect();\n PreparedStatement createCategoryTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS category (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"categoryUser varchar,\"\n + \"name varchar(100),\"\n + \"FOREIGN KEY (categoryUser) REFERENCES user(username));\"\n );\n createCategoryTable.execute();\n createCategoryTable.close();\n\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\n public void onCreate(SQLiteDatabase db){\n db.execSQL(create_User_Table);\n db.execSQL(create_Budget_Table);\n\n\n\n\n }", "public static void createTicket(Ticket ticket) {\n try {\n Connection conn = Main.conn;\n PreparedStatement statement = conn.prepareStatement(\"INSERT INTO bs_tickets (username, admin, status, question, server, date_created, date_accepted, date_resolved) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\");\n\n statement.setString(1, ticket.username);\n statement.setString(2, ticket.admin);\n statement.setString(3, ticket.status);\n statement.setString(4, ticket.question);\n statement.setString(5, ticket.server);\n statement.setInt(6, ticket.date_created);\n statement.setInt(7, ticket.date_accepted);\n statement.setInt(8, ticket.date_resolved);\n\n statement.executeUpdate();\n }\n catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void createAnswerStatistics(int sid,int qid);", "public void addTopicQuestion(int id, int tId, int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_ID, id);\r\n values.put(KEY_TID, tId);\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_TOPICS_QUESTIONS, null, values);\r\n\r\n db.close();\r\n }", "private void createTableMenuItems() throws SQLException\r\n {\r\n String sqlQuery = \r\n \"CREATE TABLE menuitems \" +\r\n \"(menudesc VARCHAR(12) NOT NULL, \" + \r\n \"mealtype VARCHAR(12) NOT NULL, \" +\r\n \"itemname VARCHAR(100) NOT NULL, \" +\r\n \"price INT NOT NULL, \" + \r\n \"energy INT NOT NULL, \" + \r\n \"protein FLOAT NOT NULL, \" + \r\n \"carbs FLOAT NOT NULL, \" + \r\n \"fat FLOAT NOT NULL, \" + \r\n \"fibre FLOAT NOT NULL, \" + \r\n \"id INT NOT NULL)\";\r\n myStmt.executeUpdate(sqlQuery);\r\n }", "@Override\n public void createTable() {\n String[] TABLE_COLUMNS_ATLAS = {\n TableColumn.ChecklistTable.CID + \" INTEGER PRIMARY KEY AUTOINCREMENT\",\n TableColumn.ChecklistTable.PID + \" INTEGER NOT NULL\",\n TableColumn.ChecklistTable.REAL + \" INTEGER DEFAULT 0\",\n TableColumn.ChecklistTable.UNIT_ID + \" INTEGER\",\n TableColumn.ChecklistTable.WAREHOUSE_ID + \" INTEGER\",\n TableColumn.ChecklistTable.QUEUE_ID + \" INTEGER\",\n TableColumn.ChecklistTable.CATEGORIES_ID + \" INTEGER\",\n TableColumn.ChecklistTable.DATE + \" DATE\",\n TableColumn.ChecklistTable.RECORDTIME + \" DATE\",\n TableColumn.ChecklistTable.CONFIRM + \" INTEGER DEFAULT 0\"\n };\n\n //TODO: create table\n database.execSQL(makeSQLCreateTable(TABLE_NAME, TABLE_COLUMNS_ATLAS));\n\n addColumn(TableColumn.ChecklistTable.CONFIRM, \" INTEGER DEFAULT 0\");\n\n //TODO: show table\n XCursor cursor = selectTable();\n printData(TABLE_NAME, cursor);\n cursor.close();\n }", "QuestionPick addPickDetail(Question question);", "@WebMethod Question createQuestion(Event event, String question, double betMinimum) throws EventFinished, QuestionAlreadyExist;", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"STOCK\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY ,\" + // 0: id\n \"\\\"SYMBOL\\\" TEXT NOT NULL UNIQUE ,\" + // 1: symbol\n \"\\\"NAME\\\" TEXT NOT NULL ,\" + // 2: name\n \"\\\"EPS\\\" REAL,\" + // 3: eps\n \"\\\"YEAR_HIGH\\\" REAL,\" + // 4: yearHigh\n \"\\\"YEAR_LOW\\\" REAL,\" + // 5: yearLow\n \"\\\"OPEN\\\" REAL,\" + // 6: open\n \"\\\"PERCENT_CHANGE\\\" TEXT,\" + // 7: percentChange\n \"\\\"EX_DIVIDEND_DATE\\\" INTEGER,\" + // 8: exDividendDate\n \"\\\"DIVIDEND_PAY_DATE\\\" INTEGER,\" + // 9: dividendPayDate\n \"\\\"DIVIDEND_AVERAGE\\\" REAL);\"); // 10: dividendAverage\n }", "public QuestionEntity createQuestion(QuestionEntity questionEntity) {\n entityManager.persist(questionEntity);\n return questionEntity;\n }", "public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );", "public static void createExampleOrders(DatabaseReference myRef) {\n for (int i = 1; i <= 3; i++) {\r\n myRef.child(\"example\" + i).child(\"status\").setValue(\"ACTIVE\");\r\n myRef.child(\"example\" + i).child(\"food\").setValue(\"Example Order \" + i);\r\n myRef.child(\"example\" + i).child(\"table\").setValue(i);\r\n myRef.child(\"example\" + i).child(\"timestamp\").setValue(\"0000000000000\");\r\n }\r\n }", "private void createAddonTable(SQLiteDatabase db) {\n // SQL statement to create addon table\n String CREATE_ADDON_TABLE = \"CREATE TABLE IF NOT EXISTS \" + ADDON_TABLE_NAME + \" (\" +\n NAME_ID + \" INTEGER PRIMARY KEY,\" +\n NAME_NAME + \" TEXT,\" +\n NAME_SLUG + \" TEXT,\" +\n NAME_DESCRIPTION + \" TEXT,\" +\n NAME_CREATED_AT + \" TEXT,\" +\n NAME_PUBLISHED_AT + \" TEXT,\" +\n NAME_DOWNLOADS + \" INTEGER,\" +\n NAME_SIZE + \" INTEGER,\" +\n NAME_MD5 + \" TEXT,\" +\n NAME_DOWNLOAD_LINK + \" TEXT,\" +\n NAME_CATEGORY + \" TEXT\" +\n \")\";\n // create addon table\n db.execSQL(CREATE_ADDON_TABLE);\n }", "public abstract void generateQuestion();", "public static void SetupDB() {\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS User(email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS FriendList(ID INTEGER PRIMARY KEY, email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS Category(ID INTEGER PRIMARY KEY,name TEXT);\");\n\t}", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"BABY_INFOS_BEAN\\\" (\" + //\n \"\\\"BIRTHDAY\\\" TEXT,\" + // 0: birthday\n \"\\\"SEX\\\" TEXT,\" + // 1: sex\n \"\\\"HEAD_IMAGE_URL\\\" TEXT,\" + // 2: headImageUrl\n \"\\\"HEAD_IMAGE_ID\\\" TEXT,\" + // 3: headImageId\n \"\\\"NICKNAME\\\" TEXT,\" + // 4: nickname\n \"\\\"BABY_ID\\\" TEXT,\" + // 5: babyId\n \"\\\"_id\\\" INTEGER PRIMARY KEY ,\" + // 6: id\n \"\\\"ACCOUNT_ID\\\" TEXT,\" + // 7: accountId\n \"\\\"LOCAL_ID\\\" TEXT,\" + // 8: localId\n \"\\\"CONTROL_STATUS\\\" TEXT,\" + // 9: controlStatus\n \"\\\"IS_ADD\\\" INTEGER NOT NULL ,\" + // 10: isAdd\n \"\\\"IS_SCALE_BIG\\\" TEXT);\"); // 11: isScaleBig\n }", "public void createCoupon(Coupon coupon) throws DbException;", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'ORDER_BATCH' (\" + //\n \"'ID' TEXT PRIMARY KEY NOT NULL ,\" + // 0: id\n \"'COOPERATE_ID' TEXT NOT NULL ,\" + // 1: cooperateId\n \"'S_PDTG_CUSTFULLNAME' TEXT,\" + // 2: sPdtgCustfullname\n \"'L_PDTG_BATCH' INTEGER NOT NULL ,\" + // 3: lPdtgBatch\n \"'DRIVERS_ID' TEXT NOT NULL ,\" + // 4: driversID\n \"'EVALUATION' TEXT,\" + // 5: evaluation\n \"'CAN_EVALUTAION' TEXT,\" + // 6: canEvalutaion\n \"'STATUS' TEXT NOT NULL ,\" + // 7: status\n \"'ADD_TIME' INTEGER NOT NULL ,\" + // 8: addTime\n \"'EDIT_TIME' INTEGER,\" + // 9: editTime\n \"'USER_NAME' TEXT NOT NULL );\"); // 10: userName\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"USER_BEAN\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"COMMODITY_ID\\\" TEXT,\" + // 1: commodityId\n \"\\\"COMMODITY_NAME\\\" TEXT,\" + // 2: commodityName\n \"\\\"COUNT\\\" TEXT,\" + // 3: count\n \"\\\"PIC\\\" TEXT,\" + // 4: pic\n \"\\\"PRICE\\\" TEXT);\"); // 5: price\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"ORDER_PAY\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"AMOUNT\\\" INTEGER NOT NULL ,\" + // 1: amount\n \"\\\"BODY\\\" TEXT,\" + // 2: body\n \"\\\"DESCRIPTION\\\" TEXT,\" + // 3: description\n \"\\\"METADATA\\\" TEXT,\" + // 4: metadata\n \"\\\"ORDER_NO\\\" TEXT,\" + // 5: orderNo\n \"\\\"SUBJECT\\\" TEXT,\" + // 6: subject\n \"\\\"TICKET_ID\\\" TEXT);\"); // 7: ticketId\n }", "public void createTable() {\r\n\t\tclient.createTable();\r\n\t}", "public void initialProductTable() {\r\n\t\tString sqlCommand = \"CREATE TABLE IF NOT EXISTS ProductTable (\\n\" + \"Barcode integer PRIMARY KEY,\\n\"\r\n\t\t\t\t+ \"Product_Name VARCHAR(30) NOT Null,\\n\" + \"Delivery_Time integer NOT NULL,\\n\"\r\n\t\t\t\t+ \"Quantity_In_Store integer NOT NULL,\\n\" + \"Quantity_In_storeroom integer NOT NULL,\\n\"\r\n\t\t\t\t+ \"Supplier_Name VARCHAR(30) NOT NUll,\\n\" + \"Average_Sales_Per_Day integer DEFAULT 0,\\n\"\r\n\t\t\t\t+ \"Location_In_Store VARCHAR(30) NOT NULL,\\n\" + \"Location_In_Storeroom VARCHAR(30) NOT NULL,\\n\"\r\n\t\t\t\t+ \"Faulty_Product_In_Store integer DEFAULT 0,\\n\" + \"Faulty_Product_In_Storeroom integer DEFAULT 0,\\n\"\r\n\t\t\t\t+ \"Category integer DEFAULT 0,\\n\"\r\n\t\t\t\t+ \" FOREIGN KEY (Category) REFERENCES CategoryTable(CategoryID) ON UPDATE CASCADE ON DELETE CASCADE\"\r\n\t\t\t\t+ \");\";// create the fields of the table\r\n\t\ttry (Connection conn = DriverManager.getConnection(dataBase); Statement stmt = conn.createStatement()) {\r\n\t\t\tstmt.execute(sqlCommand);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"initialProductTable: \"+ e.getMessage());\r\n\t\t}\r\n\t}", "private void createDataTable() {\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoEditors.TABLE + \" (ID INT IDENTITY PRIMARY KEY, NAME VARCHAR(150) NOT NULL UNIQUE)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.TABLE + \" (ID INT IDENTITY PRIMARY KEY, TITLE VARCHAR(150) NOT NULL UNIQUE, YEAR INT, ISBN10 VARCHAR(20), ISBN13 VARCHAR(13), NOTE INT, PAGES_NUMBER INT, RESUME VARCHAR(2000), THE_EDITOR_FK INT, THE_KIND_FK INT, THE_LANGUAGE_FK INT, THE_LENDING_FK INT, THE_SAGA_FK INT, THE_TYPE_FK INT)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" (THE_BOOK_FK INT NOT NULL, THE_AUTHOR_FK INT NOT NULL)\");\n\n jdbcTemplate.update(\"CREATE INDEX BOOK_EDITOR_IDX ON \" + IDaoEditors.TABLE + \"(ID)\");\n jdbcTemplate.update(\"CREATE INDEX BOOKS_IDX ON \" + IDaoBooks.TABLE + \"(ID)\");\n }", "@Before\n public void createAndFillTable() {\n try {\n DBhandler dBhandler = new DBhandler(h2DbConnection);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }" ]
[ "0.56218797", "0.5476367", "0.5443071", "0.5421309", "0.53949034", "0.53949034", "0.5385732", "0.5377326", "0.53391826", "0.5336067", "0.5326431", "0.53141594", "0.5292226", "0.5231184", "0.5228019", "0.5227332", "0.52142996", "0.5183955", "0.5149179", "0.5140587", "0.51297134", "0.51003563", "0.5093296", "0.5069086", "0.5053435", "0.50480527", "0.5031034", "0.50232744", "0.5017764", "0.49937737", "0.4985315", "0.49631393", "0.49630022", "0.4921723", "0.48970643", "0.4889293", "0.48614603", "0.48544848", "0.48348716", "0.4832214", "0.48292398", "0.4816385", "0.48161545", "0.48101234", "0.4803696", "0.4801698", "0.47870564", "0.47857562", "0.47733316", "0.47730577", "0.47695482", "0.47635606", "0.47625265", "0.47494674", "0.47397035", "0.47356957", "0.47317958", "0.47301164", "0.47241113", "0.4716096", "0.47142246", "0.47134867", "0.47090784", "0.47075018", "0.46919882", "0.46783802", "0.4669554", "0.4669312", "0.4662889", "0.4647935", "0.46391013", "0.46269226", "0.4626498", "0.4626161", "0.46223447", "0.4619901", "0.46168146", "0.46152538", "0.4612059", "0.45998192", "0.4597088", "0.4589061", "0.45870018", "0.4584312", "0.4578324", "0.45780456", "0.45753118", "0.4574794", "0.4573838", "0.45704657", "0.45636052", "0.45627913", "0.4560188", "0.455621", "0.45513007", "0.4548249", "0.45429194", "0.45380762", "0.45363", "0.45359442" ]
0.64965016
0
Create an aliased public.question_for_buddys table reference
public QuestionForBuddys(String alias) { this(DSL.name(alias), QUESTION_FOR_BUDDYS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public QuestionForBuddys(Name alias) {\n this(alias, QUESTION_FOR_BUDDYS);\n }", "public QuestionForBuddys() {\n this(DSL.name(\"question_for_buddys\"), null);\n }", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public static final String getAuthKWRelTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authkw_\" +shortname +\r\n\t\t\"(author varchar(70) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" PRIMARY KEY (keyword,author)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}", "public static final String getAuthCollabOverKWTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authcollabkw_\" +shortname +\r\n\t\t\"(keyword varchar(255) NOT NULL, \" + \r\n\t\t\"author varchar(70) NOT NULL, \" + \r\n\t\t\" collabauth varchar(70) NOT NULL, \" +\r\n\t\t\"collabcnt int NOT NULL\" +\r\n\t\t\" ) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "@Test\n public void testAliasedTableColumns()\n {\n assertEquals(\n runner.execute(\"SELECT * FROM orders AS t (a, b, c, d, e, f, g, h, i)\"),\n runner.execute(\"SELECT * FROM orders\"));\n }", "public String generateTemporaryTableName(String baseTableName) {\n \t\treturn \"HT_\" + baseTableName;\n \t}", "public void fillQuestionsTable() {\n\n //Hard Questions\n Questions q1 = new Questions(\"The redshift of a distant galaxy is 0·014. According to Hubble’s law, the distance of the galaxy from Earth is? \", \" 9·66 × 10e-12 m\", \" 9·32 × 10e27 m\", \"1·83 × 10e24 m\", \"1·30 × 10e26 m \", 3);\n addQuestion(q1);\n Questions q2 = new Questions(\"A ray of monochromatic light passes from air into water. The wavelength of this light in air is 589 nm. The speed of this light in water is? \", \" 2·56 × 10e2 m/s \", \"4·52 × 10e2 m/s\", \"4·78 × 10e2 m/s\", \"1·52 × 10e2 m/s\", 2);\n addQuestion(q2);\n Questions q3 = new Questions(\"A car is moving at a speed of 2·0 m s−1. The car now accelerates at 4·0 m s−2 until it reaches a speed of 14 m s−1. The distance travelled by the car during this acceleration is\", \"1.5m\", \"18m\", \"24m\", \"25m\", 3);\n addQuestion(q3);\n Questions q4 = new Questions(\"A spacecraft is travelling at 0·10c relative to a star. \\nAn observer on the spacecraft measures the speed of light emitted by the star to be?\", \"0.90c\", \"1.00c\", \"1.01c\", \"0.99c\", 2);\n addQuestion(q4);\n Questions q5 = new Questions(\"Measurements of the expansion rate of the Universe lead to the conclusion that the rate of expansion is increasing. Present theory proposes that this is due to? \", \"Redshift\", \"Dark Matter\", \"Dark Energy\", \"Gravity\", 3);\n addQuestion(q5);\n Questions q6 = new Questions(\"A block of wood slides with a constant velocity down a slope. The slope makes an angle of 30º with the horizontal axis. The mass of the block is 2·0 kg. The magnitude of the force of friction acting on the block is?\" , \"1.0N\", \"2.0N\", \"9.0N\", \"9.8N\", 4);\n addQuestion(q6);\n Questions q7 = new Questions(\"A planet orbits a star at a distance of 3·0 × 10e9 m. The star exerts a gravitational force of 1·6 × 10e27 N on the planet. The mass of the star is 6·0 × 10e30 kg. The mass of the planet is? \", \"2.4 x 10e14 kg\", \"3.6 x 10e25 kg\", \"1.2 x 10e16 kg\", \"1.6 x 10e26 kg\", 2);\n addQuestion(q7);\n Questions q8 = new Questions(\"Radiation of frequency 9·00 × 10e15 Hz is incident on a clean metal surface. The maximum kinetic energy of a photoelectron ejected from this surface is 5·70 × 10e−18 J. The work function of the metal is?\", \"2.67 x 10e-19 J\", \"9.10 x 10e-1 J\", \"1.60 x 10e-18 J\", \"4.80 x 10e-2 J\", 1);\n addQuestion(q8);\n Questions q9 = new Questions(\"The irradiance of light from a point source is 32 W m−2 at a distance of 4·0 m from the source. The irradiance of the light at a distance of 16 m from the source is? \", \"1.0 W m-2\", \"8.0 W m-2\", \"4.0 W m-2\", \"2.0 W m-2\", 4);\n addQuestion(q9);\n Questions q10 = new Questions(\"A person stands on a weighing machine in a lift. When the lift is at rest, the reading on the weighing machine is 700 N. The lift now descends and its speed increases at a constant rate. The reading on the weighing machine...\", \"Is a constant value higher than 700N. \", \"Is a constant value lower than 700N. \", \"Continually increases from 700 N. \", \"Continually decreases from 700 N. \", 2);\n addQuestion(q10);\n\n //Medium Questions\n Questions q11 = new Questions(\"What is Newtons Second Law of Motion?\", \"F = ma\", \"m = Fa\", \"F = a/m\", \"Every action has an equal and opposite reaction\", 1);\n addQuestion(q11);\n Questions q12 = new Questions(\"In s = vt, what does s stand for?\", \"Distance\", \"Speed\", \"Sin\", \"Displacement\", 4);\n addQuestion(q12);\n Questions q13 = new Questions(\"An object reaches terminal velocity when...\", \"Forward force is greater than the frictional force.\", \"All forces acting on that object are equal.\", \"Acceleration starts decreasing.\", \"Acceleration is greater than 0\", 2);\n addQuestion(q13);\n Questions q14 = new Questions(\"An Elastic Collision is where?\", \"There is no loss of Kinetic Energy.\", \"There is a small loss in Kinetic Energy.\", \"There is an increase in Kinetic Energy.\", \"Some Kinetic Energy is transferred to another type.\", 1);\n addQuestion(q14);\n Questions q15 = new Questions(\"The speed of light is?\", \"Different for all observers.\", \"The same for all observers. \", \"The same speed regardless of the medium it is travelling through. \", \"Equal to the speed of sound.\", 2);\n addQuestion(q15);\n Questions q16 = new Questions(\"What is redshift?\", \"Light moving to us, shifting to red. \", \"A dodgy gear change. \", \"Light moving away from us shifting to longer wavelengths.\", \"Another word for dark energy. \", 3);\n addQuestion(q16);\n Questions q17 = new Questions(\"Which law allows us to estimate the age of the universe?\", \"Newtons 3rd Law \", \"The Hubble-Lemaitre Law \", \"Planck's Law \", \"Wien's Law \", 2);\n addQuestion(q17);\n Questions q18 = new Questions(\"The standard model...\", \"Models how time interacts with space. \", \"Describes how entropy works. \", \"Is the 2nd Law of Thermodynamics. \", \"Describes the fundamental particles of the universe and how they interact\", 4);\n addQuestion(q18);\n Questions q19 = new Questions(\"The photoelectric effect gives evidence for?\", \"The wave model of light. \", \"The particle model of light. \", \"The speed of light. \", \"The frequency of light. \", 2);\n addQuestion(q19);\n Questions q20 = new Questions(\"AC is a current which...\", \"Doesn't change direction. \", \"Is often called variable current. \", \"Is sneaky. \", \"Changes direction and instantaneous value with time. \", 4);\n addQuestion(q20);\n\n //Easy Questions\n Questions q21 = new Questions(\"What properties does light display?\", \"Wave\", \"Particle\", \"Both\", \"Neither\", 3);\n addQuestion(q21);\n Questions q22 = new Questions(\"In V = IR, what does V stand for?\", \"Velocity\", \"Voltage\", \"Viscosity\", \"Volume\", 2);\n addQuestion(q22);\n Questions q23 = new Questions(\"The abbreviation rms typically stands for?\", \"Round mean sandwich. \", \"Random manic speed. \", \"Root manic speed. \", \"Root mean squared. \", 4);\n addQuestion(q23);\n Questions q24 = new Questions(\"Path Difference = \", \"= (m/λ) or (m + ½)/λ where m = 0,1,2…\", \"= mλ or (m + ½) λ where m = 0,1,2…\", \"= λ / m or (λ + ½) / m where m = 0,1,2…\", \" = mλ or (m + ½) λ where m = 0.5,1.5,2.5,…\", 2);\n addQuestion(q24);\n Questions q25 = new Questions(\"How many types of quark are there?\", \"6\", \"4 \", \"8\", \"2\", 1);\n addQuestion(q25);\n Questions q26 = new Questions(\"A neutrino is a type of?\", \"Baryon\", \"Gluon\", \"Lepton\", \"Quark\", 3);\n addQuestion(q26);\n Questions q27 = new Questions(\"A moving charge produces:\", \"A weak field\", \"An electric field\", \"A strong field\", \"Another moving charge\", 2);\n addQuestion(q27);\n Questions q28 = new Questions(\"What contains nuclear fusion reactors?\", \"A magnetic field\", \"An electric field\", \"A pool of water\", \"Large amounts of padding\", 1);\n addQuestion(q28);\n Questions q29 = new Questions(\"What is the critical angle of a surface?\", \"The incident angle where the angle of refraction is 45 degrees.\", \"The incident angle where the angle of refraction is 90 degrees.\", \"The incident angle where the angle of refraction is 135 degrees.\", \"The incident angle where the angle of refraction is 180 degrees.\", 2);\n addQuestion(q29);\n Questions q30 = new Questions(\"Which is not a type of Lepton?\", \"Electron\", \"Tau\", \"Gluon\", \"Muon\", 3);\n addQuestion(q30);\n }", "private String generateSqlServerTemporaryTableName() {\n return \"temp\" + temporaryTableCounter.getAndIncrement();\n }", "FromTableJoin createFromTableJoin();", "private void fillQuestionsTable() {\n Question q1 = new Question(\"Who is NOT a Master on the Jedi council?\", \"Anakin Skywalker\", \"Obi Wan Kenobi\", \"Mace Windu\", \"Yoda\", 1);\n Question q2 = new Question(\"Who was Anakin Skywalker's padawan?\", \"Kit Fisto\", \"Ashoka Tano\", \"Barris Ofee\", \"Jacen Solo\",2);\n Question q3 = new Question(\"What Separatist leader liked to make find additions to his collection?\", \"Pong Krell\", \"Count Dooku\", \"General Grevious\", \"Darth Bane\", 3);\n Question q4 = new Question(\"Choose the correct Response:\\n Hello There!\", \"General Kenobi!\", \"You are a bold one!\", \"You never should have come here!\", \"You turned her against me!\", 1);\n Question q5 = new Question(\"What ancient combat technique did Master Obi Wan Kenobi use to his advantage throughout the Clone Wars?\", \"Kendo arts\", \"The High ground\", \"Lightsaber Form VIII\", \"Force healing\", 2);\n Question q6 = new Question(\"What was the only surviving member of Domino squad?\", \"Fives\", \"Heavy\", \"Echo\", \"Jesse\", 3);\n Question q7 = new Question(\"What Jedi brutally murdered children as a part of his descent to become a Sith?\", \"Quinlan Vos\", \"Plo Koon\", \"Kit Fisto\", \"Anakin Skywalker\", 4);\n Question q8 = new Question(\"What Sith was the first to reveal himself to the Jedi after a millenia and was subsquently cut in half shortly after?\", \"Darth Plagieus\", \"Darth Maul\", \"Darth Bane\", \"Darth Cadeus\", 2);\n Question q9 = new Question(\"What 4 armed creature operates a diner on the upper levels of Coruscant?\", \"Dexter Jettster\", \"Cad Bane\", \"Aurua Sing\", \"Dorme Amidala\", 1);\n Question q10 = new Question(\"What ruler fell in love with an underage boy and subsequently married him once he became a Jedi?\", \"Aurua Sing\", \"Duttchess Satine\", \"Mara Jade\", \"Padme Amidala\", 4);\n\n // adds them to the list\n addQuestion(q1);\n addQuestion(q2);\n addQuestion(q3);\n addQuestion(q4);\n addQuestion(q5);\n addQuestion(q6);\n addQuestion(q7);\n addQuestion(q8);\n addQuestion(q9);\n addQuestion(q10);\n }", "public void buildItems() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT\"\n + \" EXISTS items (order_id TEXT, item TEXT, FOREIGN KEY (order_id)\"\n + \" REFERENCES orders(id) ON DELETE CASCADE ON UPDATE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException exc) {\n exc.printStackTrace();\n }\n }", "public void buildRatingsTable() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT EXISTS user_ratings (user_id\"\n + \" TEXT, rating REAL, user_type TEXT, FOREIGN KEY (user_ID)\"\n + \" REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException e) {\n e.printStackTrace();\n }\n }", "BTable createBTable();", "private void renameAnalyticsPeriodBoundaryTableToPeriodBoundary()\r\n {\r\n\r\n String sql =\r\n \"INSERT INTO periodboundary(periodboundaryid, uid, code, created, lastupdated, lastupdatedby, boundarytarget, analyticsperiodboundarytype, offsetperiods, offsetperiodtypeid, programindicatorid) \" +\r\n \"SELECT analyticsperiodboundaryid, uid, code, created, lastupdated, lastupdatedby, boundarytarget, analyticsperiodboundarytype, offsetperiods, offsetperiodtypeid, programindicatorid \" +\r\n \"FROM analyticsperiodboundary; \" +\r\n \"DROP TABLE analyticsperiodboundary;\";\r\n\r\n executeSql( sql );\r\n\r\n }", "private void appendPrimaryTableName() {\n super.appendTableName(Constants.FROM, joinQueryInputs.primaryTableName);\n }", "private void appendFullTableNameAndAlias(String stageName) {\n builder.append(getFullTableName(stageName)).append(AS).append(getTableAlias(stageName));\n }", "tbls createtbls();", "public String getReferencedTableName();", "FromTable createFromTable();", "public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}", "public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}", "public String getNextTableSqlAlias() {\n return \"t\"+(aliasCounter++);\n }", "public Mytable(String alias) {\n this(DSL.name(alias), MYTABLE);\n }", "public String getCreationSQL(final boolean quoteNames) {\n final StringBuilder sbSQL = new StringBuilder();\n sbSQL.append(\"CREATE TABLE \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" (\\n\");\n \n for (PgColumn column : columns) {\n sbSQL.append(\"\\t\");\n sbSQL.append(column.getFullDefinition(quoteNames, false));\n sbSQL.append(\",\\n\");\n }\n \n sbSQL.setLength(sbSQL.length() - 2);\n sbSQL.append(\"\\n)\");\n \n if ((inherits != null) && (inherits.length() > 0)) {\n sbSQL.append(\"\\nINHERITS \");\n sbSQL.append(inherits);\n }\n \n sbSQL.append(';');\n \n for (PgColumn column : getColumnsWithStatistics()) {\n sbSQL.append(\"\\nALTER TABLE ONLY \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" ALTER COLUMN \");\n sbSQL.append(\n PgDiffUtils.getQuotedName(column.getName(), quoteNames));\n sbSQL.append(\" SET STATISTICS \");\n sbSQL.append(column.getStatistics());\n sbSQL.append(';');\n }\n \n return sbSQL.toString();\n }", "private String createLabelTableSQL()\n\t{\n\t\treturn \"LABEL ON TABLE \" + getFullPath() + \" IS '\" + SQLToolbox.cvtToSQLFieldColHdg(function.getLabel()) + \"'\";\n\t}", "private void createStocksTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE stocks \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \" + \"owner INT, \"\n\t\t\t\t\t+ \"shareAmount INT, \" + \"purchasePrice DOUBLE, \" + \"symb VARCHAR(10), \"\n\t\t\t\t\t+ \"timePurchased BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table stocks\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of stocks table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "public void addWithVarName_expressionSqlTo(String varName, StringBuffer sqlStringB) {\r\n sqlStringB.append(varName+\".\"+tableColumnName+\" \");\r\n }", "public static String makeFreeTextDocTablename(final String ryaInstanceName) {\n requireNonNull(ryaInstanceName);\n return ryaInstanceName + TABLE_SUFFFIX_DOC;\n }", "String getTempTableName(String name);", "public Table<Integer, Integer, String> getAnonymizedData();", "Table getReferencedTable();", "private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }", "protected void createTableRecordings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Recordings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"artist_name\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track_name\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"CONSTRAINT unique_track PRIMARY KEY (artist_name, track_name)\" \t+\n\t\t\t\t\");\"\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "public void createSurvey(int tid);", "@Test(timeout = 4000)\n public void test49() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n SQLUtil.normalize(\";AS5U5EP/!f\", true);\n System.setCurrentTimeMillis(2989L);\n String[] stringArray0 = new String[1];\n stringArray0[0] = \"; AS5U5EP / ! f\";\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\";AS5U5EP/!f\", true, defaultDBTable0, stringArray0, defaultDBTable0, stringArray0);\n SQLUtil.constraintName(dBForeignKeyConstraint0);\n Random.setNextRandom(223);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"VKT,^OP\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "@Test(timeout = 4000)\n public void test124() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"Illegal column type format: \");\n String[] stringArray0 = new String[9];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"66i,cw\", true, stringArray0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "void gen_table_names(Connection c, PreparedStatement pst ) throws ClassNotFoundException, SQLException\n\t{\n\t String lambda_term_query = \"select subgoal_names from view2subgoals where view = '\"+ name +\"'\";\n\n\t\t\n\t pst = c.prepareStatement(lambda_term_query);\n\t \n\t ResultSet rs = pst.executeQuery();\n\t \n\t if(!rs.wasNull())\n\t {\n\t \twhile(rs.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(rs.getString(1));\n\t\t }\n\t }\n\t \n\t else\n\t {\n\t \tlambda_term_query = \"select subgoal from web_view_table where renamed_view = '\"+ name +\"'\";\n\n\t\t\t\n\t\t pst = c.prepareStatement(lambda_term_query);\n\t\t \n\t\t ResultSet r = pst.executeQuery();\n\n\t\t while(r.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(r.getString(1));\n\t\t }\n\t }\n\t \n\t \n\t \n\n\t}", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "public static String getActualTableName(String utableName)\n {\n String tn = (DBFactory.TableNameMap != null)? DBFactory.TableNameMap.get(utableName) : null;\n return (tn != null)? tn : utableName;\n }", "TableOrAlias createTableOrAlias();", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"ANSWERS_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"ID_QUESTION\\\" TEXT,\" + // 1: idQuestion\n \"\\\"ID_ANSWER\\\" TEXT,\" + // 2: idAnswer\n \"\\\"DESCRIPTION\\\" TEXT,\" + // 3: description\n \"\\\"VALUE\\\" INTEGER,\" + // 4: value\n \"\\\"POINTS\\\" INTEGER,\" + // 5: points\n \"\\\"ENABLE\\\" INTEGER,\" + // 6: enable\n \"\\\"TXT_SECOND_QUESTION\\\" TEXT);\"); // 7: txtSecondQuestion\n }", "protected void generateFromClause( WrqInfo wrqInfo, SQLStatementWithParams sqlStatement ) throws BindingException\n {\n sqlStatement.append(\" FROM \");\n WrqBindingSet bs = wrqInfo.getResultingBindingSet();\n resolvedBindingSets.addAll(bs.getResolvedBindingSets());\n sqlStatement.append(wrqInfo.getSQLSelectWithParams()); \n }", "String getCreateTableSql(String name, DataSet dataSet, boolean isTemporary,\r\n String key, FieldsRepository fieldsRepository);", "public void createTable(String tableName) {\n db.execSQL(\"create table if not exists '\" + tableName.replaceAll(\"\\\\s\", \"_\") + \"' (\"\n + KEY_ROWID + \" integer primary key autoincrement, \"\n + KEY_QUESTION + \" string not null, \"\n + KEY_ANSWER + \" string not null);\");\n }", "private void createReferentialIntegrityConstraints() {\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" ADD FOREIGN KEY (THE_BOOK_FK) REFERENCES \" + IDaoBooks.TABLE + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" ADD FOREIGN KEY (THE_AUTHOR_FK) REFERENCES \" + IDaoPersons.TABLE + \" (ID) ON UPDATE SET NULL\");\n\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_KIND_FK) REFERENCES \" + SimpleData.DataType.KIND.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_LANGUAGE_FK) REFERENCES \" + SimpleData.DataType.LANGUAGE.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_LENDING_FK) REFERENCES \" + IDaoLendings.TABLE + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_SAGA_FK) REFERENCES \" + SimpleData.DataType.SAGA.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_TYPE_FK) REFERENCES \" + SimpleData.DataType.TYPE.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_EDITOR_FK) REFERENCES \" + IDaoEditors.TABLE + \" (ID) ON UPDATE SET NULL\");\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n DBSchema dBSchema0 = new DBSchema(\"truncate\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"createnuniqe inde*]/$]($%;qgq`gg\", dBSchema0);\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\"&]ZYR\", false, defaultDBTable0, (String[]) null, defaultDBTable0, (String[]) null);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n String string0 = SQLUtil.fkSpec(dBForeignKeyConstraint0, nameSpec0);\n assertEquals(\"CONSTRAINT &]ZYR FOREIGN KEY () REFERENCES createnuniqe inde*]/$]($%;qgq`gg()\", string0);\n }", "private List<String> generateDropStatementsForQueueTables() throws SQLException {\n List<String> statements = new ArrayList<String>();\n\n List<String> objectNames = jdbcTemplate.queryForStringList(\"SELECT QUEUE_TABLE FROM ALL_QUEUE_TABLES WHERE OWNER = ?\", name);\n for (String objectName : objectNames) {\n statements.add(\"BEGIN DBMS_AQADM.DROP_QUEUE_TABLE('\" + dbSupport.quote(name, objectName) + \"', FORCE => TRUE); END;\");\n }\n\n return statements;\n }", "public String getCreateTemporaryTableString() {\n \t\treturn \"create table\";\n \t}", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"EXAM_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"TITLE\\\" TEXT,\" + // 1: title\n \"\\\"TYPE\\\" INTEGER NOT NULL ,\" + // 2: type\n \"\\\"ANSWER_A\\\" TEXT,\" + // 3: answerA\n \"\\\"ANSWER_B\\\" TEXT,\" + // 4: answerB\n \"\\\"ANSWER_C\\\" TEXT,\" + // 5: answerC\n \"\\\"ANSWER_D\\\" TEXT,\" + // 6: answerD\n \"\\\"REAL_ANSWER\\\" TEXT);\"); // 7: realAnswer\n }", "PivotTable createPivotTable();", "public void createManyToManyTable(Class sourceClass, Class referenceClass) {\n Connection connection = ConnectionPoll.getConnection();\n ManyToManyHandler manyToManyHandler = new ManyToManyHandler(connection);\n try {\n manyToManyHandler.createMtMTable(sourceClass, referenceClass);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n ConnectionPoll.releaseConnection(connection);\n }", "@VisibleForTesting\n protected void addFullTableName(String stageName) {\n String bqTableName = getBQTableName(stageName);\n stageToFullTableNameMap.put(stageName,\n String.format(\"`%s.%s.%s`\", dataset.getProject(), dataset.getDataset(), bqTableName));\n }", "private void generateTemporaryTable(String tableName, Collection<?> items, SQLProcessor sqlP)\n throws GenericEntityException {\n //Ensure connection is created\n sqlP.getConnection();\n\n //Determine the data type to create based on the item element type\n //Right now this only works for SQL server so we hardcode the SQL server data types\n //And we only support numbers and strings at this point\n Object firstItem = items.iterator().next();\n String dataType;\n if (firstItem instanceof Number) {\n dataType = \"bigint\";\n } else {\n dataType = \"varchar(8000)\"; //8000 is max size of varchar for SQL server\n }\n\n sqlP.executeUpdate(\"create table #\" + tableName + \" (item \" + dataType + \" primary key)\");\n\n //Insert data into this temporary table\n sqlP.prepareStatement(\"insert into #\" + tableName + \" (item) values (?)\");\n PreparedStatement stat = sqlP.getPreparedStatement();\n try {\n for (Object item : items) {\n if (item instanceof Number) {\n stat.setLong(1, ((Number) item).longValue());\n } else if (item instanceof String) {\n stat.setString(1, (String) item);\n } else {\n stat.setObject(1, item);\n }\n\n stat.addBatch();\n }\n stat.executeBatch();\n } catch (SQLException e) {\n throw new GenericEntityException(e.getMessage(), e);\n } finally {\n try {\n stat.close();\n } catch (SQLException ignore) {\n }\n }\n }", "ForeignKey createForeignKey();", "Column referencedColumn();", "public void setTableName(String tmp) {\n this.tableName = tmp;\n }", "public static void createDispensedDrug()\n {\n try\n {\n String strSql = \"select order_no, order_date, dispensed_by from pis_dispense_master, pis_dispense_detail\"\n + \" where order_date < CURDATE()\";\n }catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }", "public Mytable(Name alias) {\n this(alias, MYTABLE);\n }", "public abstract void generateQuestion();", "UsingCols createUsingCols();", "public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static String makeTableBaseName(int number) {\n return \"bi_\" + Integer.toString(number);\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public String getCreateTemporaryTablePostfix() {\n \t\treturn \"\";\n \t}", "public static String tableName() {\r\n return \"TB_UPP_CHECK_STORE_DIVERGENCE\";\r\n }", "public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }", "private void appendTempTableRightSideJoin(\r\n Object source,\r\n Attribute[] prototypeAttributes,\r\n MithraFastList<Attribute> nullAttributes,\r\n int pkAttributeCount,\r\n TupleTempContext tempContext,\r\n StringBuilder builder)\r\n {\r\n builder.append(tempContext.getFullyQualifiedTableName(source, this.getMithraObjectPortal().getPersisterId()));\r\n builder.append(\" t1 where \");\r\n this.constructJoin(prototypeAttributes, nullAttributes, pkAttributeCount, builder);\r\n }", "public void createAnswerStatistics(int sid,int qid);", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "public Table asTable() {\n Table table = Table.create(this.name());\n for (Column<?> column : this.columns()) {\n table.addColumns(column);\n }\n return table;\n }", "public void createAll() {\n SQLFormater SQLFormaterMoods = new SQLFormater(MOODS_TABLE_NAME, ID_FIELD); // objects help to form sql strings for creating tables\n SQLFormater SQLFormaterAnswers = new SQLFormater(ANSWERS_TABLE_NAME, ID_FIELD);\n\n String[] answersTableFields = {ANSWERS_FIELD, ID_MOODS_FIELD}; // ordered fields\n String[] moodsTableFields = {MOODS_FIELD, HI_FIELD, BYBY_FIELD};\n\n SQLFormaterMoods.setNewField(MOODS_FIELD, STRING_TYPE, \"NOT NULL\"); // creating tables\n SQLFormaterMoods.setNewField(HI_FIELD, STRING_TYPE, null);\n SQLFormaterMoods.setNewField(BYBY_FIELD, STRING_TYPE, null);\n dbConnection.execute(SQLFormaterMoods.getStringToCreateDB(null));\n\n SQLFormaterAnswers.setNewField(ANSWERS_FIELD, STRING_TYPE, \"NOT NULL\");\n SQLFormaterAnswers.setNewField(ID_MOODS_FIELD, INTEGER_TYPE, null);\n String reference = \"FOREIGN KEY (\" + ID_MOODS_FIELD + \")\" +\n \" REFERENCES \" + MOODS_TABLE_NAME +\n \"(\" + ID_FIELD + \")\";\n dbConnection.execute(SQLFormaterAnswers.getStringToCreateDB(reference)); // create table with reference\n\n insertTableValues(SQLFormaterMoods, moodsTableFields, getMoodsTableValues()); // inserting ordered values into tables\n insertTableValues(SQLFormaterAnswers, answersTableFields, getAnswersTableValues());\n }", "private Tables() {\n\t\tsuper(\"TABLES\", org.jooq.util.mysql.information_schema.InformationSchema.INFORMATION_SCHEMA);\n\t}", "UnpivotTable createUnpivotTable();", "public boolean referenceColumnInSql() {\n return false;\n }", "@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }", "private HsqlName newIndexHsqlName(String name,\n boolean isQuoted) throws HsqlException {\n\n return HsqlName.isReservedName(name)\n ? database.nameManager.newAutoName(\"USER\", name)\n : database.nameManager.newHsqlName(name, isQuoted);\n }", "public void createSourceOrderItemTable() throws SQLException {\n sourceExecuteWithLog(extraSQLCommand.getCreateTableOrderItem());\n }", "private static String getTableName(String baseName, boolean isCommunity, boolean isCollection, boolean isDistinct,\n boolean isMap) {\n // isDistinct is meaningless in relation to isCommunity and isCollection\n // so we bounce that back first, ignoring other arguments\n if (isDistinct) {\n return baseName + \"_dis\";\n }\n\n // isCommunity and isCollection are mutually exclusive\n if (isCommunity) {\n baseName = baseName + \"_com\";\n } else if (isCollection) {\n baseName = baseName + \"_col\";\n }\n\n // isMap is additive to isCommunity and isCollection\n if (isMap) {\n baseName = baseName + \"_dmap\";\n }\n\n return baseName;\n }", "public abstract String[] createTablesStatementStrings();", "protected void createTableListenings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Listenings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"user\t\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track\t\t\tVARCHAR(259),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"playcount\t\tINTEGER,\" \t\t\t\t\t\t\t\t\t\t\t+ \n\t\t\t\t\"FOREIGN KEY (user) REFERENCES Persons(lfm_username),\" \t\t\t\t+\n\t\t\t\t\"FOREIGN KEY (listens_to) REFERENCES Recordings(unique_track)\"\t\t+\n\t\t\t\t\");\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "private void setupHelpButton() {\n\t\tImageIcon help_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"help.png\");\n\t\tJButton help_button = new JButton(\"\",help_button_image);\n\t\thelp_button.setBorderPainted(false);\n\t\thelp_button.setBounds(1216, 24, 100, 100);\n\t\thelp_button.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tHelp help_frame=new Help(PanelID.Quiz);\n\t\t\t\thelp_frame.setVisible(true);\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t}\n\t\t});\n\t\thelp_button.addMouseListener(new VoxMouseAdapter(help_button,null));\n\t\tadd(help_button);\n\t}", "public ActiveSurveyQuestionItem(ResultSet rs) throws SQLException {\n buildRecord(rs);\n }", "protected abstract String copyQuestionHistoricalTx(String userId, String qid, Pool destination);", "@Override\n\tprotected String getTableName() {\n\t\treturn super.getTableName();\n\t}", "private void statsTable() {\n try (Connection connection = hikari.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS `\" + TABLE_STATS + \"` \" +\n \"(id INT NOT NULL AUTO_INCREMENT UNIQUE, \" +\n \"uuid varchar(255) PRIMARY KEY, \" +\n \"name varchar(255), \" +\n \"kitSelected varchar(255), \" +\n \"points INT, \" +\n \"kills INT, \" +\n \"deaths INT, \" +\n \"killstreaks INT, \" +\n \"currentKillStreak INT, \" +\n \"inGame BOOLEAN)\")) {\n statement.execute();\n statement.close();\n connection.close();\n }\n } catch (SQLException e) {\n LogHandler.getHandler().logException(\"TableCreator:statsTable\", e);\n }\n }", "public abstract void setupReferences() throws SQLException;", "AliasStatement createAliasStatement();", "public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );", "@Override\n public void onCreate(SQLiteDatabase db) {\n this.db = db;\n\n final String SQL_CREATE_QUESTIONS_TABLE = \"CREATE TABLE \" +\n QuestionsTable.Table_name + \" ( \" +\n QuestionsTable._ID + \" Integer PRIMARY KEY AUTOINCREMENT, \" +\n QuestionsTable.Column_Question + \" TEXT, \" +\n QuestionsTable.Column_Option1 + \" TEXT, \" +\n QuestionsTable.Column_Option2 + \" TEXT, \" +\n QuestionsTable.Column_Option3 + \" TEXT, \" +\n QuestionsTable.Column_Option4 + \" TEXT, \" +\n QuestionsTable.Column_Answer_Nr + \" Integer\" +\n \")\";\n\n\n db.execSQL(SQL_CREATE_QUESTIONS_TABLE);\n fillQuestionsTable();\n }", "SQLCaseWhens createSQLCaseWhens();", "@Override\n\tpublic String getTableName() {\n\t\treturn \"DMDB.GY_DM_ZJLX\";\n\t}", "public question() {\n initComponents();\n this.setLocationRelativeTo(null);\n Fillcombo();\n FillTableAdd(\"select * from question\");\n FillTableDel(\"select * from question\");\n FillTableUpd(\"select * from question\");\n \n }", "private void appendTempTableUpdateDeleteJoin(Object source, Attribute[] prototypeAttributes, MithraFastList<Attribute> nullAttributes, int pkAttributeCount, TupleTempContext tempContext, StringBuilder builder)\r\n {\r\n builder.append(\" from \").append(this.getFullyQualifiedTableNameGenericSource(source));\r\n builder.append(\" t0, \");\r\n this.appendTempTableRightSideJoin(source, prototypeAttributes, nullAttributes, pkAttributeCount, tempContext, builder);\r\n }", "private void createAddonTable(SQLiteDatabase db) {\n // SQL statement to create addon table\n String CREATE_ADDON_TABLE = \"CREATE TABLE IF NOT EXISTS \" + ADDON_TABLE_NAME + \" (\" +\n NAME_ID + \" INTEGER PRIMARY KEY,\" +\n NAME_NAME + \" TEXT,\" +\n NAME_SLUG + \" TEXT,\" +\n NAME_DESCRIPTION + \" TEXT,\" +\n NAME_CREATED_AT + \" TEXT,\" +\n NAME_PUBLISHED_AT + \" TEXT,\" +\n NAME_DOWNLOADS + \" INTEGER,\" +\n NAME_SIZE + \" INTEGER,\" +\n NAME_MD5 + \" TEXT,\" +\n NAME_DOWNLOAD_LINK + \" TEXT,\" +\n NAME_CATEGORY + \" TEXT\" +\n \")\";\n // create addon table\n db.execSQL(CREATE_ADDON_TABLE);\n }", "protected abstract FlowRule.Builder setDefaultTableIdForFlowObjective(Builder ruleBuilder);", "@Override\n protected Map<TableUniqueName, String> tableSubstitution() {\n return ImmutableMap.of();\n }", "public void from(com.intuit.datasource.jooq.information_schema.tables.interfaces.IKeyColumnUsage from);" ]
[ "0.5754421", "0.574136", "0.5151576", "0.5148992", "0.49183482", "0.4905059", "0.48708302", "0.48262215", "0.4781196", "0.4692668", "0.46828917", "0.46744254", "0.46607614", "0.46338826", "0.4551627", "0.45216897", "0.4509388", "0.4478113", "0.44743243", "0.44710883", "0.4465976", "0.44509524", "0.44509524", "0.4447826", "0.44154575", "0.43957746", "0.43729162", "0.43700612", "0.4359687", "0.43445212", "0.4343463", "0.4340616", "0.43377733", "0.4336555", "0.43354747", "0.43339884", "0.43327522", "0.43228358", "0.4315997", "0.4312744", "0.43124652", "0.4308981", "0.42953748", "0.42828515", "0.42827928", "0.42804283", "0.42717555", "0.4267674", "0.42675036", "0.42552406", "0.42494574", "0.42487606", "0.42288902", "0.4218465", "0.42182377", "0.42093465", "0.42069733", "0.41897315", "0.41877568", "0.41854435", "0.4180469", "0.4171953", "0.41667637", "0.41593385", "0.4157631", "0.41556412", "0.41553208", "0.41539937", "0.41535905", "0.41464072", "0.41423422", "0.41379762", "0.41287208", "0.41185835", "0.4114763", "0.41136363", "0.41062826", "0.4093457", "0.4090735", "0.40905795", "0.4090097", "0.40886363", "0.40880483", "0.40830195", "0.4077826", "0.40773964", "0.4073891", "0.40726396", "0.40703988", "0.4069088", "0.40621924", "0.40597293", "0.405963", "0.40569574", "0.40436625", "0.4041625", "0.40410247", "0.4038266", "0.4036335", "0.40345716" ]
0.57656044
0
Create an aliased public.question_for_buddys table reference
public QuestionForBuddys(Name alias) { this(alias, QUESTION_FOR_BUDDYS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public QuestionForBuddys(String alias) {\n this(DSL.name(alias), QUESTION_FOR_BUDDYS);\n }", "public QuestionForBuddys() {\n this(DSL.name(\"question_for_buddys\"), null);\n }", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public static final String getAuthKWRelTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authkw_\" +shortname +\r\n\t\t\"(author varchar(70) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" PRIMARY KEY (keyword,author)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}", "public static final String getAuthCollabOverKWTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authcollabkw_\" +shortname +\r\n\t\t\"(keyword varchar(255) NOT NULL, \" + \r\n\t\t\"author varchar(70) NOT NULL, \" + \r\n\t\t\" collabauth varchar(70) NOT NULL, \" +\r\n\t\t\"collabcnt int NOT NULL\" +\r\n\t\t\" ) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "@Test\n public void testAliasedTableColumns()\n {\n assertEquals(\n runner.execute(\"SELECT * FROM orders AS t (a, b, c, d, e, f, g, h, i)\"),\n runner.execute(\"SELECT * FROM orders\"));\n }", "public String generateTemporaryTableName(String baseTableName) {\n \t\treturn \"HT_\" + baseTableName;\n \t}", "public void fillQuestionsTable() {\n\n //Hard Questions\n Questions q1 = new Questions(\"The redshift of a distant galaxy is 0·014. According to Hubble’s law, the distance of the galaxy from Earth is? \", \" 9·66 × 10e-12 m\", \" 9·32 × 10e27 m\", \"1·83 × 10e24 m\", \"1·30 × 10e26 m \", 3);\n addQuestion(q1);\n Questions q2 = new Questions(\"A ray of monochromatic light passes from air into water. The wavelength of this light in air is 589 nm. The speed of this light in water is? \", \" 2·56 × 10e2 m/s \", \"4·52 × 10e2 m/s\", \"4·78 × 10e2 m/s\", \"1·52 × 10e2 m/s\", 2);\n addQuestion(q2);\n Questions q3 = new Questions(\"A car is moving at a speed of 2·0 m s−1. The car now accelerates at 4·0 m s−2 until it reaches a speed of 14 m s−1. The distance travelled by the car during this acceleration is\", \"1.5m\", \"18m\", \"24m\", \"25m\", 3);\n addQuestion(q3);\n Questions q4 = new Questions(\"A spacecraft is travelling at 0·10c relative to a star. \\nAn observer on the spacecraft measures the speed of light emitted by the star to be?\", \"0.90c\", \"1.00c\", \"1.01c\", \"0.99c\", 2);\n addQuestion(q4);\n Questions q5 = new Questions(\"Measurements of the expansion rate of the Universe lead to the conclusion that the rate of expansion is increasing. Present theory proposes that this is due to? \", \"Redshift\", \"Dark Matter\", \"Dark Energy\", \"Gravity\", 3);\n addQuestion(q5);\n Questions q6 = new Questions(\"A block of wood slides with a constant velocity down a slope. The slope makes an angle of 30º with the horizontal axis. The mass of the block is 2·0 kg. The magnitude of the force of friction acting on the block is?\" , \"1.0N\", \"2.0N\", \"9.0N\", \"9.8N\", 4);\n addQuestion(q6);\n Questions q7 = new Questions(\"A planet orbits a star at a distance of 3·0 × 10e9 m. The star exerts a gravitational force of 1·6 × 10e27 N on the planet. The mass of the star is 6·0 × 10e30 kg. The mass of the planet is? \", \"2.4 x 10e14 kg\", \"3.6 x 10e25 kg\", \"1.2 x 10e16 kg\", \"1.6 x 10e26 kg\", 2);\n addQuestion(q7);\n Questions q8 = new Questions(\"Radiation of frequency 9·00 × 10e15 Hz is incident on a clean metal surface. The maximum kinetic energy of a photoelectron ejected from this surface is 5·70 × 10e−18 J. The work function of the metal is?\", \"2.67 x 10e-19 J\", \"9.10 x 10e-1 J\", \"1.60 x 10e-18 J\", \"4.80 x 10e-2 J\", 1);\n addQuestion(q8);\n Questions q9 = new Questions(\"The irradiance of light from a point source is 32 W m−2 at a distance of 4·0 m from the source. The irradiance of the light at a distance of 16 m from the source is? \", \"1.0 W m-2\", \"8.0 W m-2\", \"4.0 W m-2\", \"2.0 W m-2\", 4);\n addQuestion(q9);\n Questions q10 = new Questions(\"A person stands on a weighing machine in a lift. When the lift is at rest, the reading on the weighing machine is 700 N. The lift now descends and its speed increases at a constant rate. The reading on the weighing machine...\", \"Is a constant value higher than 700N. \", \"Is a constant value lower than 700N. \", \"Continually increases from 700 N. \", \"Continually decreases from 700 N. \", 2);\n addQuestion(q10);\n\n //Medium Questions\n Questions q11 = new Questions(\"What is Newtons Second Law of Motion?\", \"F = ma\", \"m = Fa\", \"F = a/m\", \"Every action has an equal and opposite reaction\", 1);\n addQuestion(q11);\n Questions q12 = new Questions(\"In s = vt, what does s stand for?\", \"Distance\", \"Speed\", \"Sin\", \"Displacement\", 4);\n addQuestion(q12);\n Questions q13 = new Questions(\"An object reaches terminal velocity when...\", \"Forward force is greater than the frictional force.\", \"All forces acting on that object are equal.\", \"Acceleration starts decreasing.\", \"Acceleration is greater than 0\", 2);\n addQuestion(q13);\n Questions q14 = new Questions(\"An Elastic Collision is where?\", \"There is no loss of Kinetic Energy.\", \"There is a small loss in Kinetic Energy.\", \"There is an increase in Kinetic Energy.\", \"Some Kinetic Energy is transferred to another type.\", 1);\n addQuestion(q14);\n Questions q15 = new Questions(\"The speed of light is?\", \"Different for all observers.\", \"The same for all observers. \", \"The same speed regardless of the medium it is travelling through. \", \"Equal to the speed of sound.\", 2);\n addQuestion(q15);\n Questions q16 = new Questions(\"What is redshift?\", \"Light moving to us, shifting to red. \", \"A dodgy gear change. \", \"Light moving away from us shifting to longer wavelengths.\", \"Another word for dark energy. \", 3);\n addQuestion(q16);\n Questions q17 = new Questions(\"Which law allows us to estimate the age of the universe?\", \"Newtons 3rd Law \", \"The Hubble-Lemaitre Law \", \"Planck's Law \", \"Wien's Law \", 2);\n addQuestion(q17);\n Questions q18 = new Questions(\"The standard model...\", \"Models how time interacts with space. \", \"Describes how entropy works. \", \"Is the 2nd Law of Thermodynamics. \", \"Describes the fundamental particles of the universe and how they interact\", 4);\n addQuestion(q18);\n Questions q19 = new Questions(\"The photoelectric effect gives evidence for?\", \"The wave model of light. \", \"The particle model of light. \", \"The speed of light. \", \"The frequency of light. \", 2);\n addQuestion(q19);\n Questions q20 = new Questions(\"AC is a current which...\", \"Doesn't change direction. \", \"Is often called variable current. \", \"Is sneaky. \", \"Changes direction and instantaneous value with time. \", 4);\n addQuestion(q20);\n\n //Easy Questions\n Questions q21 = new Questions(\"What properties does light display?\", \"Wave\", \"Particle\", \"Both\", \"Neither\", 3);\n addQuestion(q21);\n Questions q22 = new Questions(\"In V = IR, what does V stand for?\", \"Velocity\", \"Voltage\", \"Viscosity\", \"Volume\", 2);\n addQuestion(q22);\n Questions q23 = new Questions(\"The abbreviation rms typically stands for?\", \"Round mean sandwich. \", \"Random manic speed. \", \"Root manic speed. \", \"Root mean squared. \", 4);\n addQuestion(q23);\n Questions q24 = new Questions(\"Path Difference = \", \"= (m/λ) or (m + ½)/λ where m = 0,1,2…\", \"= mλ or (m + ½) λ where m = 0,1,2…\", \"= λ / m or (λ + ½) / m where m = 0,1,2…\", \" = mλ or (m + ½) λ where m = 0.5,1.5,2.5,…\", 2);\n addQuestion(q24);\n Questions q25 = new Questions(\"How many types of quark are there?\", \"6\", \"4 \", \"8\", \"2\", 1);\n addQuestion(q25);\n Questions q26 = new Questions(\"A neutrino is a type of?\", \"Baryon\", \"Gluon\", \"Lepton\", \"Quark\", 3);\n addQuestion(q26);\n Questions q27 = new Questions(\"A moving charge produces:\", \"A weak field\", \"An electric field\", \"A strong field\", \"Another moving charge\", 2);\n addQuestion(q27);\n Questions q28 = new Questions(\"What contains nuclear fusion reactors?\", \"A magnetic field\", \"An electric field\", \"A pool of water\", \"Large amounts of padding\", 1);\n addQuestion(q28);\n Questions q29 = new Questions(\"What is the critical angle of a surface?\", \"The incident angle where the angle of refraction is 45 degrees.\", \"The incident angle where the angle of refraction is 90 degrees.\", \"The incident angle where the angle of refraction is 135 degrees.\", \"The incident angle where the angle of refraction is 180 degrees.\", 2);\n addQuestion(q29);\n Questions q30 = new Questions(\"Which is not a type of Lepton?\", \"Electron\", \"Tau\", \"Gluon\", \"Muon\", 3);\n addQuestion(q30);\n }", "private String generateSqlServerTemporaryTableName() {\n return \"temp\" + temporaryTableCounter.getAndIncrement();\n }", "FromTableJoin createFromTableJoin();", "private void fillQuestionsTable() {\n Question q1 = new Question(\"Who is NOT a Master on the Jedi council?\", \"Anakin Skywalker\", \"Obi Wan Kenobi\", \"Mace Windu\", \"Yoda\", 1);\n Question q2 = new Question(\"Who was Anakin Skywalker's padawan?\", \"Kit Fisto\", \"Ashoka Tano\", \"Barris Ofee\", \"Jacen Solo\",2);\n Question q3 = new Question(\"What Separatist leader liked to make find additions to his collection?\", \"Pong Krell\", \"Count Dooku\", \"General Grevious\", \"Darth Bane\", 3);\n Question q4 = new Question(\"Choose the correct Response:\\n Hello There!\", \"General Kenobi!\", \"You are a bold one!\", \"You never should have come here!\", \"You turned her against me!\", 1);\n Question q5 = new Question(\"What ancient combat technique did Master Obi Wan Kenobi use to his advantage throughout the Clone Wars?\", \"Kendo arts\", \"The High ground\", \"Lightsaber Form VIII\", \"Force healing\", 2);\n Question q6 = new Question(\"What was the only surviving member of Domino squad?\", \"Fives\", \"Heavy\", \"Echo\", \"Jesse\", 3);\n Question q7 = new Question(\"What Jedi brutally murdered children as a part of his descent to become a Sith?\", \"Quinlan Vos\", \"Plo Koon\", \"Kit Fisto\", \"Anakin Skywalker\", 4);\n Question q8 = new Question(\"What Sith was the first to reveal himself to the Jedi after a millenia and was subsquently cut in half shortly after?\", \"Darth Plagieus\", \"Darth Maul\", \"Darth Bane\", \"Darth Cadeus\", 2);\n Question q9 = new Question(\"What 4 armed creature operates a diner on the upper levels of Coruscant?\", \"Dexter Jettster\", \"Cad Bane\", \"Aurua Sing\", \"Dorme Amidala\", 1);\n Question q10 = new Question(\"What ruler fell in love with an underage boy and subsequently married him once he became a Jedi?\", \"Aurua Sing\", \"Duttchess Satine\", \"Mara Jade\", \"Padme Amidala\", 4);\n\n // adds them to the list\n addQuestion(q1);\n addQuestion(q2);\n addQuestion(q3);\n addQuestion(q4);\n addQuestion(q5);\n addQuestion(q6);\n addQuestion(q7);\n addQuestion(q8);\n addQuestion(q9);\n addQuestion(q10);\n }", "public void buildItems() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT\"\n + \" EXISTS items (order_id TEXT, item TEXT, FOREIGN KEY (order_id)\"\n + \" REFERENCES orders(id) ON DELETE CASCADE ON UPDATE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException exc) {\n exc.printStackTrace();\n }\n }", "public void buildRatingsTable() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT EXISTS user_ratings (user_id\"\n + \" TEXT, rating REAL, user_type TEXT, FOREIGN KEY (user_ID)\"\n + \" REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException e) {\n e.printStackTrace();\n }\n }", "BTable createBTable();", "private void renameAnalyticsPeriodBoundaryTableToPeriodBoundary()\r\n {\r\n\r\n String sql =\r\n \"INSERT INTO periodboundary(periodboundaryid, uid, code, created, lastupdated, lastupdatedby, boundarytarget, analyticsperiodboundarytype, offsetperiods, offsetperiodtypeid, programindicatorid) \" +\r\n \"SELECT analyticsperiodboundaryid, uid, code, created, lastupdated, lastupdatedby, boundarytarget, analyticsperiodboundarytype, offsetperiods, offsetperiodtypeid, programindicatorid \" +\r\n \"FROM analyticsperiodboundary; \" +\r\n \"DROP TABLE analyticsperiodboundary;\";\r\n\r\n executeSql( sql );\r\n\r\n }", "private void appendPrimaryTableName() {\n super.appendTableName(Constants.FROM, joinQueryInputs.primaryTableName);\n }", "private void appendFullTableNameAndAlias(String stageName) {\n builder.append(getFullTableName(stageName)).append(AS).append(getTableAlias(stageName));\n }", "tbls createtbls();", "public String getReferencedTableName();", "FromTable createFromTable();", "public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}", "public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}", "public String getNextTableSqlAlias() {\n return \"t\"+(aliasCounter++);\n }", "public Mytable(String alias) {\n this(DSL.name(alias), MYTABLE);\n }", "public String getCreationSQL(final boolean quoteNames) {\n final StringBuilder sbSQL = new StringBuilder();\n sbSQL.append(\"CREATE TABLE \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" (\\n\");\n \n for (PgColumn column : columns) {\n sbSQL.append(\"\\t\");\n sbSQL.append(column.getFullDefinition(quoteNames, false));\n sbSQL.append(\",\\n\");\n }\n \n sbSQL.setLength(sbSQL.length() - 2);\n sbSQL.append(\"\\n)\");\n \n if ((inherits != null) && (inherits.length() > 0)) {\n sbSQL.append(\"\\nINHERITS \");\n sbSQL.append(inherits);\n }\n \n sbSQL.append(';');\n \n for (PgColumn column : getColumnsWithStatistics()) {\n sbSQL.append(\"\\nALTER TABLE ONLY \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" ALTER COLUMN \");\n sbSQL.append(\n PgDiffUtils.getQuotedName(column.getName(), quoteNames));\n sbSQL.append(\" SET STATISTICS \");\n sbSQL.append(column.getStatistics());\n sbSQL.append(';');\n }\n \n return sbSQL.toString();\n }", "private String createLabelTableSQL()\n\t{\n\t\treturn \"LABEL ON TABLE \" + getFullPath() + \" IS '\" + SQLToolbox.cvtToSQLFieldColHdg(function.getLabel()) + \"'\";\n\t}", "private void createStocksTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE stocks \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \" + \"owner INT, \"\n\t\t\t\t\t+ \"shareAmount INT, \" + \"purchasePrice DOUBLE, \" + \"symb VARCHAR(10), \"\n\t\t\t\t\t+ \"timePurchased BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table stocks\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of stocks table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "public void addWithVarName_expressionSqlTo(String varName, StringBuffer sqlStringB) {\r\n sqlStringB.append(varName+\".\"+tableColumnName+\" \");\r\n }", "public static String makeFreeTextDocTablename(final String ryaInstanceName) {\n requireNonNull(ryaInstanceName);\n return ryaInstanceName + TABLE_SUFFFIX_DOC;\n }", "String getTempTableName(String name);", "Table getReferencedTable();", "public Table<Integer, Integer, String> getAnonymizedData();", "private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }", "protected void createTableRecordings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Recordings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"artist_name\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track_name\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"CONSTRAINT unique_track PRIMARY KEY (artist_name, track_name)\" \t+\n\t\t\t\t\");\"\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "@Test(timeout = 4000)\n public void test49() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n SQLUtil.normalize(\";AS5U5EP/!f\", true);\n System.setCurrentTimeMillis(2989L);\n String[] stringArray0 = new String[1];\n stringArray0[0] = \"; AS5U5EP / ! f\";\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\";AS5U5EP/!f\", true, defaultDBTable0, stringArray0, defaultDBTable0, stringArray0);\n SQLUtil.constraintName(dBForeignKeyConstraint0);\n Random.setNextRandom(223);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"VKT,^OP\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "public void createSurvey(int tid);", "@Test(timeout = 4000)\n public void test124() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"Illegal column type format: \");\n String[] stringArray0 = new String[9];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"66i,cw\", true, stringArray0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "void gen_table_names(Connection c, PreparedStatement pst ) throws ClassNotFoundException, SQLException\n\t{\n\t String lambda_term_query = \"select subgoal_names from view2subgoals where view = '\"+ name +\"'\";\n\n\t\t\n\t pst = c.prepareStatement(lambda_term_query);\n\t \n\t ResultSet rs = pst.executeQuery();\n\t \n\t if(!rs.wasNull())\n\t {\n\t \twhile(rs.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(rs.getString(1));\n\t\t }\n\t }\n\t \n\t else\n\t {\n\t \tlambda_term_query = \"select subgoal from web_view_table where renamed_view = '\"+ name +\"'\";\n\n\t\t\t\n\t\t pst = c.prepareStatement(lambda_term_query);\n\t\t \n\t\t ResultSet r = pst.executeQuery();\n\n\t\t while(r.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(r.getString(1));\n\t\t }\n\t }\n\t \n\t \n\t \n\n\t}", "public static String getActualTableName(String utableName)\n {\n String tn = (DBFactory.TableNameMap != null)? DBFactory.TableNameMap.get(utableName) : null;\n return (tn != null)? tn : utableName;\n }", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "TableOrAlias createTableOrAlias();", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "protected void generateFromClause( WrqInfo wrqInfo, SQLStatementWithParams sqlStatement ) throws BindingException\n {\n sqlStatement.append(\" FROM \");\n WrqBindingSet bs = wrqInfo.getResultingBindingSet();\n resolvedBindingSets.addAll(bs.getResolvedBindingSets());\n sqlStatement.append(wrqInfo.getSQLSelectWithParams()); \n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"ANSWERS_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"ID_QUESTION\\\" TEXT,\" + // 1: idQuestion\n \"\\\"ID_ANSWER\\\" TEXT,\" + // 2: idAnswer\n \"\\\"DESCRIPTION\\\" TEXT,\" + // 3: description\n \"\\\"VALUE\\\" INTEGER,\" + // 4: value\n \"\\\"POINTS\\\" INTEGER,\" + // 5: points\n \"\\\"ENABLE\\\" INTEGER,\" + // 6: enable\n \"\\\"TXT_SECOND_QUESTION\\\" TEXT);\"); // 7: txtSecondQuestion\n }", "String getCreateTableSql(String name, DataSet dataSet, boolean isTemporary,\r\n String key, FieldsRepository fieldsRepository);", "public void createTable(String tableName) {\n db.execSQL(\"create table if not exists '\" + tableName.replaceAll(\"\\\\s\", \"_\") + \"' (\"\n + KEY_ROWID + \" integer primary key autoincrement, \"\n + KEY_QUESTION + \" string not null, \"\n + KEY_ANSWER + \" string not null);\");\n }", "private void createReferentialIntegrityConstraints() {\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" ADD FOREIGN KEY (THE_BOOK_FK) REFERENCES \" + IDaoBooks.TABLE + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" ADD FOREIGN KEY (THE_AUTHOR_FK) REFERENCES \" + IDaoPersons.TABLE + \" (ID) ON UPDATE SET NULL\");\n\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_KIND_FK) REFERENCES \" + SimpleData.DataType.KIND.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_LANGUAGE_FK) REFERENCES \" + SimpleData.DataType.LANGUAGE.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_LENDING_FK) REFERENCES \" + IDaoLendings.TABLE + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_SAGA_FK) REFERENCES \" + SimpleData.DataType.SAGA.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_TYPE_FK) REFERENCES \" + SimpleData.DataType.TYPE.getTable() + \" (ID) ON UPDATE SET NULL\");\n jdbcTemplate.update(\"ALTER TABLE \" + IDaoBooks.TABLE + \" ADD FOREIGN KEY (THE_EDITOR_FK) REFERENCES \" + IDaoEditors.TABLE + \" (ID) ON UPDATE SET NULL\");\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n DBSchema dBSchema0 = new DBSchema(\"truncate\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"createnuniqe inde*]/$]($%;qgq`gg\", dBSchema0);\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\"&]ZYR\", false, defaultDBTable0, (String[]) null, defaultDBTable0, (String[]) null);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n String string0 = SQLUtil.fkSpec(dBForeignKeyConstraint0, nameSpec0);\n assertEquals(\"CONSTRAINT &]ZYR FOREIGN KEY () REFERENCES createnuniqe inde*]/$]($%;qgq`gg()\", string0);\n }", "private List<String> generateDropStatementsForQueueTables() throws SQLException {\n List<String> statements = new ArrayList<String>();\n\n List<String> objectNames = jdbcTemplate.queryForStringList(\"SELECT QUEUE_TABLE FROM ALL_QUEUE_TABLES WHERE OWNER = ?\", name);\n for (String objectName : objectNames) {\n statements.add(\"BEGIN DBMS_AQADM.DROP_QUEUE_TABLE('\" + dbSupport.quote(name, objectName) + \"', FORCE => TRUE); END;\");\n }\n\n return statements;\n }", "public String getCreateTemporaryTableString() {\n \t\treturn \"create table\";\n \t}", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"EXAM_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"TITLE\\\" TEXT,\" + // 1: title\n \"\\\"TYPE\\\" INTEGER NOT NULL ,\" + // 2: type\n \"\\\"ANSWER_A\\\" TEXT,\" + // 3: answerA\n \"\\\"ANSWER_B\\\" TEXT,\" + // 4: answerB\n \"\\\"ANSWER_C\\\" TEXT,\" + // 5: answerC\n \"\\\"ANSWER_D\\\" TEXT,\" + // 6: answerD\n \"\\\"REAL_ANSWER\\\" TEXT);\"); // 7: realAnswer\n }", "PivotTable createPivotTable();", "public void createManyToManyTable(Class sourceClass, Class referenceClass) {\n Connection connection = ConnectionPoll.getConnection();\n ManyToManyHandler manyToManyHandler = new ManyToManyHandler(connection);\n try {\n manyToManyHandler.createMtMTable(sourceClass, referenceClass);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n ConnectionPoll.releaseConnection(connection);\n }", "@VisibleForTesting\n protected void addFullTableName(String stageName) {\n String bqTableName = getBQTableName(stageName);\n stageToFullTableNameMap.put(stageName,\n String.format(\"`%s.%s.%s`\", dataset.getProject(), dataset.getDataset(), bqTableName));\n }", "private void generateTemporaryTable(String tableName, Collection<?> items, SQLProcessor sqlP)\n throws GenericEntityException {\n //Ensure connection is created\n sqlP.getConnection();\n\n //Determine the data type to create based on the item element type\n //Right now this only works for SQL server so we hardcode the SQL server data types\n //And we only support numbers and strings at this point\n Object firstItem = items.iterator().next();\n String dataType;\n if (firstItem instanceof Number) {\n dataType = \"bigint\";\n } else {\n dataType = \"varchar(8000)\"; //8000 is max size of varchar for SQL server\n }\n\n sqlP.executeUpdate(\"create table #\" + tableName + \" (item \" + dataType + \" primary key)\");\n\n //Insert data into this temporary table\n sqlP.prepareStatement(\"insert into #\" + tableName + \" (item) values (?)\");\n PreparedStatement stat = sqlP.getPreparedStatement();\n try {\n for (Object item : items) {\n if (item instanceof Number) {\n stat.setLong(1, ((Number) item).longValue());\n } else if (item instanceof String) {\n stat.setString(1, (String) item);\n } else {\n stat.setObject(1, item);\n }\n\n stat.addBatch();\n }\n stat.executeBatch();\n } catch (SQLException e) {\n throw new GenericEntityException(e.getMessage(), e);\n } finally {\n try {\n stat.close();\n } catch (SQLException ignore) {\n }\n }\n }", "ForeignKey createForeignKey();", "Column referencedColumn();", "public void setTableName(String tmp) {\n this.tableName = tmp;\n }", "public static void createDispensedDrug()\n {\n try\n {\n String strSql = \"select order_no, order_date, dispensed_by from pis_dispense_master, pis_dispense_detail\"\n + \" where order_date < CURDATE()\";\n }catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }", "public Mytable(Name alias) {\n this(alias, MYTABLE);\n }", "public abstract void generateQuestion();", "UsingCols createUsingCols();", "public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static String makeTableBaseName(int number) {\n return \"bi_\" + Integer.toString(number);\n }", "public String getCreateTemporaryTablePostfix() {\n \t\treturn \"\";\n \t}", "public static String tableName() {\r\n return \"TB_UPP_CHECK_STORE_DIVERGENCE\";\r\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }", "private void appendTempTableRightSideJoin(\r\n Object source,\r\n Attribute[] prototypeAttributes,\r\n MithraFastList<Attribute> nullAttributes,\r\n int pkAttributeCount,\r\n TupleTempContext tempContext,\r\n StringBuilder builder)\r\n {\r\n builder.append(tempContext.getFullyQualifiedTableName(source, this.getMithraObjectPortal().getPersisterId()));\r\n builder.append(\" t1 where \");\r\n this.constructJoin(prototypeAttributes, nullAttributes, pkAttributeCount, builder);\r\n }", "public void createAnswerStatistics(int sid,int qid);", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "public Table asTable() {\n Table table = Table.create(this.name());\n for (Column<?> column : this.columns()) {\n table.addColumns(column);\n }\n return table;\n }", "public void createAll() {\n SQLFormater SQLFormaterMoods = new SQLFormater(MOODS_TABLE_NAME, ID_FIELD); // objects help to form sql strings for creating tables\n SQLFormater SQLFormaterAnswers = new SQLFormater(ANSWERS_TABLE_NAME, ID_FIELD);\n\n String[] answersTableFields = {ANSWERS_FIELD, ID_MOODS_FIELD}; // ordered fields\n String[] moodsTableFields = {MOODS_FIELD, HI_FIELD, BYBY_FIELD};\n\n SQLFormaterMoods.setNewField(MOODS_FIELD, STRING_TYPE, \"NOT NULL\"); // creating tables\n SQLFormaterMoods.setNewField(HI_FIELD, STRING_TYPE, null);\n SQLFormaterMoods.setNewField(BYBY_FIELD, STRING_TYPE, null);\n dbConnection.execute(SQLFormaterMoods.getStringToCreateDB(null));\n\n SQLFormaterAnswers.setNewField(ANSWERS_FIELD, STRING_TYPE, \"NOT NULL\");\n SQLFormaterAnswers.setNewField(ID_MOODS_FIELD, INTEGER_TYPE, null);\n String reference = \"FOREIGN KEY (\" + ID_MOODS_FIELD + \")\" +\n \" REFERENCES \" + MOODS_TABLE_NAME +\n \"(\" + ID_FIELD + \")\";\n dbConnection.execute(SQLFormaterAnswers.getStringToCreateDB(reference)); // create table with reference\n\n insertTableValues(SQLFormaterMoods, moodsTableFields, getMoodsTableValues()); // inserting ordered values into tables\n insertTableValues(SQLFormaterAnswers, answersTableFields, getAnswersTableValues());\n }", "private Tables() {\n\t\tsuper(\"TABLES\", org.jooq.util.mysql.information_schema.InformationSchema.INFORMATION_SCHEMA);\n\t}", "UnpivotTable createUnpivotTable();", "public boolean referenceColumnInSql() {\n return false;\n }", "@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }", "public void createSourceOrderItemTable() throws SQLException {\n sourceExecuteWithLog(extraSQLCommand.getCreateTableOrderItem());\n }", "private static String getTableName(String baseName, boolean isCommunity, boolean isCollection, boolean isDistinct,\n boolean isMap) {\n // isDistinct is meaningless in relation to isCommunity and isCollection\n // so we bounce that back first, ignoring other arguments\n if (isDistinct) {\n return baseName + \"_dis\";\n }\n\n // isCommunity and isCollection are mutually exclusive\n if (isCommunity) {\n baseName = baseName + \"_com\";\n } else if (isCollection) {\n baseName = baseName + \"_col\";\n }\n\n // isMap is additive to isCommunity and isCollection\n if (isMap) {\n baseName = baseName + \"_dmap\";\n }\n\n return baseName;\n }", "public abstract String[] createTablesStatementStrings();", "private HsqlName newIndexHsqlName(String name,\n boolean isQuoted) throws HsqlException {\n\n return HsqlName.isReservedName(name)\n ? database.nameManager.newAutoName(\"USER\", name)\n : database.nameManager.newHsqlName(name, isQuoted);\n }", "protected void createTableListenings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Listenings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"user\t\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track\t\t\tVARCHAR(259),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"playcount\t\tINTEGER,\" \t\t\t\t\t\t\t\t\t\t\t+ \n\t\t\t\t\"FOREIGN KEY (user) REFERENCES Persons(lfm_username),\" \t\t\t\t+\n\t\t\t\t\"FOREIGN KEY (listens_to) REFERENCES Recordings(unique_track)\"\t\t+\n\t\t\t\t\");\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "private void setupHelpButton() {\n\t\tImageIcon help_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"help.png\");\n\t\tJButton help_button = new JButton(\"\",help_button_image);\n\t\thelp_button.setBorderPainted(false);\n\t\thelp_button.setBounds(1216, 24, 100, 100);\n\t\thelp_button.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tHelp help_frame=new Help(PanelID.Quiz);\n\t\t\t\thelp_frame.setVisible(true);\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t}\n\t\t});\n\t\thelp_button.addMouseListener(new VoxMouseAdapter(help_button,null));\n\t\tadd(help_button);\n\t}", "protected abstract String copyQuestionHistoricalTx(String userId, String qid, Pool destination);", "public ActiveSurveyQuestionItem(ResultSet rs) throws SQLException {\n buildRecord(rs);\n }", "@Override\n\tprotected String getTableName() {\n\t\treturn super.getTableName();\n\t}", "private void statsTable() {\n try (Connection connection = hikari.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS `\" + TABLE_STATS + \"` \" +\n \"(id INT NOT NULL AUTO_INCREMENT UNIQUE, \" +\n \"uuid varchar(255) PRIMARY KEY, \" +\n \"name varchar(255), \" +\n \"kitSelected varchar(255), \" +\n \"points INT, \" +\n \"kills INT, \" +\n \"deaths INT, \" +\n \"killstreaks INT, \" +\n \"currentKillStreak INT, \" +\n \"inGame BOOLEAN)\")) {\n statement.execute();\n statement.close();\n connection.close();\n }\n } catch (SQLException e) {\n LogHandler.getHandler().logException(\"TableCreator:statsTable\", e);\n }\n }", "public abstract void setupReferences() throws SQLException;", "AliasStatement createAliasStatement();", "public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );", "@Override\n public void onCreate(SQLiteDatabase db) {\n this.db = db;\n\n final String SQL_CREATE_QUESTIONS_TABLE = \"CREATE TABLE \" +\n QuestionsTable.Table_name + \" ( \" +\n QuestionsTable._ID + \" Integer PRIMARY KEY AUTOINCREMENT, \" +\n QuestionsTable.Column_Question + \" TEXT, \" +\n QuestionsTable.Column_Option1 + \" TEXT, \" +\n QuestionsTable.Column_Option2 + \" TEXT, \" +\n QuestionsTable.Column_Option3 + \" TEXT, \" +\n QuestionsTable.Column_Option4 + \" TEXT, \" +\n QuestionsTable.Column_Answer_Nr + \" Integer\" +\n \")\";\n\n\n db.execSQL(SQL_CREATE_QUESTIONS_TABLE);\n fillQuestionsTable();\n }", "SQLCaseWhens createSQLCaseWhens();", "@Override\n\tpublic String getTableName() {\n\t\treturn \"DMDB.GY_DM_ZJLX\";\n\t}", "private void appendTempTableUpdateDeleteJoin(Object source, Attribute[] prototypeAttributes, MithraFastList<Attribute> nullAttributes, int pkAttributeCount, TupleTempContext tempContext, StringBuilder builder)\r\n {\r\n builder.append(\" from \").append(this.getFullyQualifiedTableNameGenericSource(source));\r\n builder.append(\" t0, \");\r\n this.appendTempTableRightSideJoin(source, prototypeAttributes, nullAttributes, pkAttributeCount, tempContext, builder);\r\n }", "public question() {\n initComponents();\n this.setLocationRelativeTo(null);\n Fillcombo();\n FillTableAdd(\"select * from question\");\n FillTableDel(\"select * from question\");\n FillTableUpd(\"select * from question\");\n \n }", "private void createAddonTable(SQLiteDatabase db) {\n // SQL statement to create addon table\n String CREATE_ADDON_TABLE = \"CREATE TABLE IF NOT EXISTS \" + ADDON_TABLE_NAME + \" (\" +\n NAME_ID + \" INTEGER PRIMARY KEY,\" +\n NAME_NAME + \" TEXT,\" +\n NAME_SLUG + \" TEXT,\" +\n NAME_DESCRIPTION + \" TEXT,\" +\n NAME_CREATED_AT + \" TEXT,\" +\n NAME_PUBLISHED_AT + \" TEXT,\" +\n NAME_DOWNLOADS + \" INTEGER,\" +\n NAME_SIZE + \" INTEGER,\" +\n NAME_MD5 + \" TEXT,\" +\n NAME_DOWNLOAD_LINK + \" TEXT,\" +\n NAME_CATEGORY + \" TEXT\" +\n \")\";\n // create addon table\n db.execSQL(CREATE_ADDON_TABLE);\n }", "protected abstract FlowRule.Builder setDefaultTableIdForFlowObjective(Builder ruleBuilder);", "@Override\n protected Map<TableUniqueName, String> tableSubstitution() {\n return ImmutableMap.of();\n }", "private String getCloneSetLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET_LINK(\");\n \t\tbuilder.append(\"CLONE_SET_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"ADDED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"DELETED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CO_CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINKS TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}" ]
[ "0.57637644", "0.57401437", "0.5151099", "0.5148677", "0.49183524", "0.4904905", "0.48715234", "0.482641", "0.47813696", "0.46933076", "0.46850222", "0.46746317", "0.46621054", "0.46363825", "0.45532832", "0.45235723", "0.4510264", "0.44791076", "0.4474819", "0.4473546", "0.44670013", "0.44513094", "0.44513094", "0.44478217", "0.4414298", "0.43971658", "0.43738556", "0.4370321", "0.43596098", "0.4344611", "0.43437847", "0.4341606", "0.4341544", "0.43374795", "0.43361738", "0.43340072", "0.43334356", "0.43242097", "0.43166506", "0.43126738", "0.43113568", "0.43098855", "0.429478", "0.4282939", "0.4282833", "0.42810112", "0.42721248", "0.42695305", "0.42689934", "0.42554134", "0.42508358", "0.424873", "0.4230527", "0.42197683", "0.4219132", "0.42102727", "0.42079145", "0.41929027", "0.41878667", "0.41856012", "0.41799366", "0.4170702", "0.41678175", "0.41606757", "0.4157858", "0.4157152", "0.41556215", "0.4155496", "0.4154873", "0.4149401", "0.4141181", "0.41378048", "0.41307637", "0.41198498", "0.41158155", "0.41148302", "0.410869", "0.4094653", "0.4090801", "0.40902385", "0.40892816", "0.40892723", "0.40892264", "0.40829685", "0.40782028", "0.40781718", "0.40744975", "0.40743116", "0.40720433", "0.40670997", "0.40635467", "0.40610114", "0.40605956", "0.40579444", "0.40449405", "0.40441772", "0.4041546", "0.40384594", "0.40381306", "0.40367392" ]
0.57528895
1
INSTACIAR PREFERENCES PARA PEGAR VALOR
@Override public void onClick(DialogInterface dialog, int which) { Preferences preferences = new Preferences(TelaPet.this); String identificadorUsuarioLogado = preferences.getIdentificador(); //EXCLUIR CONVERSAS DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference(); databaseReference = databaseReference.child("PETs") .child(identificadorUsuarioLogado) .child(idPet); //Pegando id do pet startActivity(new Intent(TelaPet.this, ListarPets.class)); Toast.makeText(getApplicationContext(), "Pet excluido com sucesso!!", Toast.LENGTH_SHORT).show(); databaseReference.removeValue(); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void savingVariablesWebConfig(){\n SharedPreferences prefs = getSharedPreferences(Constants.PREFERENCES_NAME, Context.MODE_PRIVATE);\n //Save data of user in preferences\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_ACCEPTED, \"3\");\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_VISIBLE, \"10\");\n editor.putString(Constants.PREF_VALUE_MAX_TIME_ORDERS, \"15\");\n editor.commit();\n }", "protected void onPref(String name, String value){}", "private void inicializaValores(){\n /**\n * Reinicia los valores de las variables.\n */\n ce.setVariables();\n valorA.setText(null);\n valorB.setText(null);\n valorC.setText(null);\n x1.setText(null);\n x2.setText(null);\n \n }", "private void initValues() {\n \n }", "void realizeMeaningPrefs(Object obj, Variable[] vars) {\n realizeMeaningPrefs(projectSettings, obj, vars);\n \t}", "Variables createVariables();", "private void getSavedValues() {\r\n\r\n if (this.pl_expert.getParam(\"displayNodeDegree\") != null) {\r\n this.display_node_degree_current = this.pl_expert.getParam(\"displayNodeDegree\");\r\n } else {\r\n this.display_node_degree_current = display_node_degree_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"displayEdges\") != null) {\r\n this.display_edges_current = this.pl_expert.getParam(\"displayEdges\");\r\n } else {\r\n this.display_edges_current = display_edges_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"scale\") != null) {\r\n this.scale_current = this.pl_expert.getParam(\"scale\");\r\n } else {\r\n this.scale_current = scale_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"minWeight\") != null) {\r\n this.minweight_edges_current = this.pl_expert.getParam(\"minWeight\");\r\n } else {\r\n this.minweight_edges_current = minweight_edges_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"iterations\") != null) {\r\n this.iterations_current = this.pl_expert.getParam(\"iterations\");\r\n } else {\r\n this.iterations_current = iterations_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"vote_value\") != null) {\r\n this.vote_value_current = this.pl_expert.getParam(\"vote_value\");\r\n } else {\r\n this.vote_value_current = vote_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"keep_value\") != null) {\r\n this.keepclass_value_current = this.pl_expert.getParam(\"keep_value\");\r\n } else {\r\n this.keepclass_value_current = keepclass_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"mut_value\") != null) {\r\n this.mut_value_current = this.pl_expert.getParam(\"mut_value\");\r\n } else {\r\n this.mut_value_current = mut_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"mutationParameter\") != null) {\r\n this.mut_option_current = this.pl_expert.getParam(\"mutationParameter\");\r\n } else {\r\n this.mut_option_current = mut_option_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"Update_param\") != null) {\r\n this.update_param_current = this.pl_expert.getParam(\"Update_param\");\r\n } else {\r\n this.update_param_current = update_param_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"Alg_param\") != null) {\r\n this.alg_param_current = this.pl_expert.getParam(\"Alg_param\");\r\n } else {\r\n this.alg_param_current = alg_param_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"only_sub\") != null) {\r\n this.display_sub_current = new Boolean(this.pl_expert.getParam(\"only_sub\")).booleanValue();\r\n } else {\r\n this.display_sub_current = display_sub_default;\r\n }\r\n\r\n this.is_alg_started = false;\r\n }", "private void saveValues() {\r\n this.pl_expert.setParam(\"displayNodeDegree\", (String) this.nodeDegreeSpinner.getValue());\r\n this.pl_expert.setParam(\"displayEdges\", (String) this.displayEdgesSpinner.getValue());\r\n this.pl_expert.setParam(\"scale\", (String) this.scaleSpinner.getValue());\r\n this.pl_expert.setParam(\"minWeight\", (String) this.minweightSpinner.getValue());\r\n this.pl_expert.setParam(\"iterations\", (String) this.iterationsSpinner.getValue());\r\n this.pl_expert.setParam(\"mutationParameter\", this.mutationParameter.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"Update_param\", this.Update_param.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"vote_value\", (String) this.vote_value.getValue());\r\n this.pl_expert.setParam(\"keep_value\", (String) this.keep_value.getValue());\r\n this.pl_expert.setParam(\"mut_value\", (String) this.mut_value.getValue());\r\n this.pl_expert.setParam(\"only_sub\", new Boolean(this.only_sub.isSelected()).toString());\r\n\r\n this.is_alg_started = false;\r\n }", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n String aaString = sharedPreferences.getString(getString(R.string.pref_antalAktier_key), getString(R.string.pref_antalAktier_default));\n// float aaFloat = Float.parseFloat(aaString);\n editTextAntalAktier.setText(aaString);\n\n String kk = sharedPreferences.getString(getString(R.string.pref_koebskurs_key), getString(R.string.pref_koebskurs__default));\n editTextKoebskurs.setText(kk);\n\n String k = sharedPreferences.getString(getString(R.string.pref_kurtage_key), getString(R.string.pref_kurtage_default));\n editTextKurtage.setText(k);\n\n// float minSize = Float.parseFloat(sharedPreferences.getString(getString(R.string.pref_size_key),\n// getString(R.string.pref_size_default)));\n// mVisualizerView.setMinSizeScale(minSize);\n\n // Register the listener\n sharedPreferences.registerOnSharedPreferenceChangeListener(this);\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.pref);\n sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n //onSharedPreferenceChanged(sharedPreferences, getString(R.string.language_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.difficulty_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.word_category_key));\n }", "private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}", "public void inicializarVariables(boolean inicializa){\n\t\tif(inicializa){\n\t\t\tx = 1;\n\t\t\ty = 3*x;\n\t\t\t//TODO cómo se resuelve este problema?\n\t\t\tDouble temp = Math.pow(x, 2) + y;\n\n\t\t\tz = temp.intValue(); \n\t\t\tSystem.out.println(\"Valor de z\"+z);\n\t\t}else{\n\t\t\t// No hacer nada\n\t\t}\t\t\n\t}", "private LODEParameters(){\n prefsFile=new File(LODEConstants.PARAMS_FILE);\n }", "@Override\n protected void elaboraParametri() {\n super.elaboraParametri();\n titoloPagina = TITOLO_PAGINA;\n }", "public void inicializar();", "public static interface Prefs{\n /**\n * The key-value pair stores the name of the file\n */\n public static final String FILE_NAME = \"game_preferences\";\n\n /**\n * The key that stores the field name: the best score\n */\n public static final String KEY_BEST_SCORE = \"best_score\";\n }", "private void loadDefaultValues() {\n for (Map.Entry<EditText, Integer> e : mPrefKeys.entrySet()) {\n e.getKey().setText(Pref.getDefault(this, e.getValue()));\n }\n }", "public Preferences(BlueJ bluej) {\r\n this.bluej = bluej;\r\n myPanel = new JPanel();\r\n myPanel.add(new JLabel(\"Favorite Colour\"));\r\n color = new JTextField(40);\r\n myPanel.add(color);\r\n // Load the default value\r\n loadValues();\r\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "public void setPreference() {\n prefs = Preferences.userRoot().node(this.getClass().getName());\n String ID1 = \"Test1\";\n String ID2 = \"Test2\";\n String ID3 = \"Test3\";\n// First we will get the values\n// Define a boolean value\n System.out.println(prefs.getBoolean(ID1, true));\n// Define a string with default \"Hello World\n System.out.println(prefs.get(ID2, \"Hello World\"));\n// Define a integer with default 50\n System.out.println(prefs.getInt(ID3, 50));\n// Now set the values\n prefs.putBoolean(ID1, false);\n prefs.put(ID2, \"Hello Europa\");\n prefs.putInt(ID3, 45);\n\t\t\n prefs.remove(ID1);// Delete the preference settings for the first value\n }", "public SettingsSaver() {\n set[0] = advModeUnlocked;\n set[1] = LIM_NOTESPERLINE;\n set[2] = LIM_96_MEASURES;\n set[3] = LIM_VOLUME_LINE;\n set[4] = LIM_LOWA;\n set[5] = LIM_HIGHD;\n set[6] = LOW_A_ON;\n set[7] = NEG_TEMPO_FUN;\n set[8] = LIM_TEMPO_GAPS;\n set[9] = RESIZE_WIN;\n set[10] = ADV_MODE;\n }", "public interface PreferenceHelper {\r\n // Preference Name\r\n String PREFERENCE_NAME = \"Embedded_Downloads_preference\";\r\n // Preference mode\r\n int PRIVATE_MODE = 0;\r\n String INITIAL_START = \"initial_start\";\r\n String WALLET_ADDRESS = \"wallet_address\";\r\n String WALLET_NAME = \"wallet_name\";\r\n String TRANSACTION_WALLET_ADDRESS = \"transaction_wallet_address\";\r\n String WALLET_POSITION =\"wallet_position\";\r\n String CALL_TRANSACTION_STATUS = \"call_transaction_status\";\r\n String CALL_INCOMING = \"call_incoming\";\r\n String CALL_OUTGOING = \"call_outgoing\";\r\n}", "public XmlParserPref(Context cont, String name) {\n\t\tcontext = cont;\n\t\tprefEdit = PreferenceManager.getDefaultSharedPreferences(context).edit();\n\t\tprofileName = name;\n\t}", "SharedPreferences mo117960a();", "public void loadValue() {\n int loadInt = assignedDataObject.getInt(name);\n Integer iv = new Integer(loadInt);\n editBeginValue = iv.toString();\n if (!showZero & loadInt == 0) editBeginValue = \"\";\n if (loadInt == 0 & assignedDataObject.getMode() == DataObject.INSERTMODE) editBeginValue = new Integer(defaultValue).toString();\n this.setText(editBeginValue);\n }", "private void initVariables() {\n ivBack.setVisibility(View.VISIBLE);\n tvTitle.setVisibility(View.VISIBLE);\n tvTitle.setText(getString(R.string.change_language));\n\n gifProgress.setImageResource(R.drawable.shopholic_loader);\n progressBar.setVisibility(View.GONE);\n String currentLang = AppSharedPreference.getInstance().getString(this, AppSharedPreference.PREF_KEY.CURRENT_LANGUAGE);\n setLanguage(currentLang);\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.settings_main);\n\n Preference orderBy = findPreference(getString(R.string.settings_order_by_key));\n bindPreferenceSummaryToValue(orderBy);\n\n Preference filterByCompany = findPreference(getString(R.string.settings_filter_by_company_key));\n bindPreferenceSummaryToValue(filterByCompany);\n\n Preference filterBySection = findPreference(getString(R.string.settings_filter_by_section_key));\n bindPreferenceSummaryToValue(filterBySection);\n }", "void setupVariables(IVariableFactory factory);", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.preferences);\n }", "void controlParameters(Tesseract instance) throws Exception {\n File configvarsFilePath = new File(datapath, CONFIG_PATH + CONFIGVARS_FILE);\n if (!configvarsFilePath.exists()) {\n return;\n }\n\n String str = Utils.readTextFile(configvarsFilePath);\n\n for (String line : str.split(\"\\n\")) {\n if (!line.trim().startsWith(\"#\")) {\n try {\n String[] keyValuePair = line.trim().split(\"\\\\s+\");\n instance.setVariable(keyValuePair[0], keyValuePair[1]);\n } catch (Exception e) {\n //ignore and continue on\n }\n }\n }\n }", "private void loadParameters(ParameterDatabase parameterDB) {\n // global - enterprise\n// global.SetInitialNumberOfHouseholds(returnIntParameter(parameterDB, \"InitialNumberOfHouseholds\",\n// global.getInitialNumberOfHouseholds()));\n// \n global.setInitialRefugeeNumber(returnIntParameter(parameterDB, \"initialRefugeeNumber\",\n global.getInitialRefugeeNumber()));\n global.setMaximumNumberRelative(returnIntParameter(parameterDB, \"MaximumNumberRelative\",\n global.getMaximumNumberRelative()));\n global.setPercentageOfAsymptomatic(returnDoubleParameter(parameterDB, \"PercentageOfAsymptomatic\",\n global.getPercentageOfAsymptomatic()));\n global.setProbRecoveryToSuscebtable(returnDoubleParameter(parameterDB, \"recovery_To_Susceb_Rate\",\n global.getProbRecoveryToSuscebtable()));\n global.setHealthDepreciation(returnDoubleParameter(parameterDB, \"healthDepreciation\",\n global.getHealthDepreciation()));\n global.setprobabilityOfEffectiveNessofmedicine(returnDoubleParameter(parameterDB, \"probabilityOfEffectiveNessofmedicine\",\n global.getprobabilityOfEffectiveNessofmedicine()));\n global.setWaterContaminationThreshold(returnDoubleParameter(parameterDB, \"WaterContaminationThreshold\",\n global.getWaterContaminationThreshold()));\n global.setvibrioCholeraePerHealthyPerson(returnDoubleParameter(parameterDB, \"vibrioCholeraePerHealthyPerson\",\n global.getvibrioCholeraePerHealthyPerson()));\n global.setvibrioCholeraePerExposedPerson(returnDoubleParameter(parameterDB, \"vibrioCholeraePerExposedPerson\",\n global.getvibrioCholeraePerExposedPerson()));\n global.setvibrioCholeraePerInfectedPerson(returnDoubleParameter(parameterDB, \"vibrioCholeraePerInfectedPerson\",\n global.getvibrioCholeraePerInfectedPerson()));\n global.setcholeraInfectionDurationMAX(returnIntParameter(parameterDB, \"choleraInfectionDurationMAX\",\n global.getcholeraInfectionDurationMAX()));\n global.setcholeraInfectionDurationMIN(returnIntParameter(parameterDB, \"choleraInfectionDurationMIN\",\n global.getcholeraInfectionDurationMIN())); \n global.setMaxDistanceLaterine(returnIntParameter(parameterDB, \"MaxDistanceLaterine\",\n global.getMaxDistanceLaterine()));\n global.setBacteriaErosionRate(returnDoubleParameter(parameterDB, \"bacteriaErosionRate\",\n global.getBacteriaErosionRate()));\n global.setBoreHoleDischareRatePerMinute(returnDoubleParameter(parameterDB, \"boreHoleDischareRate\",\n global.getBoreHoleDischareRatePerMinute()));\n global.setBoreholeWaterSupplyPerDay(returnDoubleParameter(parameterDB, \"waterCapacityBorehole\",\n global.getBoreholeWaterSupplyPerDay()));\n global.setHeaalthFacilityCapacity(returnIntParameter(parameterDB, \"healthFacilityCapacity\",\n global.getHeaalthFacilityCapacity()));\n global.setMaximumCrowedLevel(returnDoubleParameter(parameterDB, \"CROWED_LEVEL_THRESHOLD\",\n global.getMaximumCrowedLevel()));\n global.setProbabilityGuestContaminationRate(returnDoubleParameter(parameterDB, \"probabilityGuestContaminationRate\",\n global.getProbabilityGuestContaminationRate()));\n global.setMaximumHHOccumpancyPerField(returnIntParameter(parameterDB, \"maximum_occupancy_Threshold\",\n global.getMaximumHHOccumpancyPerField()));\n global.setMaximumWaterRequirement(returnDoubleParameter(parameterDB, \"Maximum_Water_Requirement\",\n global.getMaximumWaterRequirement()));\n global.setMinimumWaterRequirement(returnDoubleParameter(parameterDB, \"Minimum_Water_Requirement\",\n global.getMinimumWaterRequirement()));\n global.setLaterineCoverage(returnDoubleParameter(parameterDB, \"laterineCoverage\",\n global.getLaterineCoverage()));\n global.setRainfallDuration_Minute(returnIntParameter(parameterDB, \"rainDuration\",\n global.getRainfallDuration_Minute()));\n global.setRainfallFirstDay(returnIntParameter(parameterDB, \"firstRainfallDay\",\n global.getRainfallFirstDay()));\n global.setRainfallFrequencyInterval_Days(returnIntParameter(parameterDB, \"rainfallFrequency\",\n global.getRainfallFrequencyInterval_Days()));\n global.setRainfall_MM_Per_Minute(returnDoubleParameter(parameterDB, \"rainfallInMM\",\n global.getRainfall_MM_Per_Minute()));\n global.setAbsorbtionRatePerMinute(returnDoubleParameter(parameterDB, \"absorbtionRatePerMinute\",\n global.getAbsorbtionRatePerMinute()));\n \n \n \n }", "public void saveValues() {\n bluej.setExtensionPropertyString(PROFILE_LABEL, color.getText());\r\n }", "private void storeProperties() {\n storeValue(Variable.MODE);\n storeValue(Variable.ITEM);\n storeValue(Variable.DEST_PATH);\n storeValue(Variable.MAXTRACKS_ENABLED);\n storeValue(Variable.MAXTRACKS);\n storeValue(Variable.MAXSIZE_ENABLED);\n storeValue(Variable.MAXSIZE);\n storeValue(Variable.MAXLENGTH_ENABLED);\n storeValue(Variable.MAXLENGTH);\n storeValue(Variable.ONE_MEDIA_ENABLED);\n storeValue(Variable.ONE_MEDIA);\n storeValue(Variable.CONVERT_MEDIA);\n storeValue(Variable.CONVERT_COMMAND);\n storeValue(Variable.NORMALIZE_FILENAME);\n storeValue(Variable.RATING_LEVEL);\n }", "private void inicializar()\n\t{\n\t\tif( this.getIn() != null )\n\t\t\tthrow new ConsolaTecladoSoloPuedeHaberUnaInstanciaException();\n\t\t\t\n\t\tthis.setIn( new Scanner( System.in ) );\n\t}", "private void LoadSavedPreferences() {\n\t\tString value;\n\t\tSharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\t// tab 3 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tempSzad\", \"22\");\n\t\tettempSzad_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPmaxdop\", \"70\");\n\t\tettempPmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempZmaxdop\", \"22\");\n\t\tettempZmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPumpaON\", \"50\");\n\t\tettempPumpaON_.setText(value);\n\n\t\t// tab 1 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tv1\", \"20.20\");\n\t\ttvS1.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv2\", \"44.22\");\n\t\ttvS2.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv3\", \"19.22\");\n\t\ttvS3.setText(value);\n\t}", "static void realizeMeaningPrefs(HashMap<Setting,Object> projectSettings, Object obj, Variable[] vars) {\n HashMap<String,Object> settingsByPrefName = new HashMap<String,Object>();\n for (int i = 0; i < vars.length; i++) {\n Variable var = vars[i];\n if (var == null) continue;\n Object value = var.getObject();\n if (!(value instanceof String)) {\n if (value instanceof Short || value instanceof Byte)\n value = new Integer(((Number)value).intValue());\n if (!(value instanceof Number) && !(value instanceof Boolean))\n continue;\n }\n String prefName = var.getKey().getName();\n String prefPath = null;\n if (obj instanceof Technology) {\n prefPath = Technology.TECH_NODE + \"/\";\n Map<Setting,Object> convertedVars = ((Technology)obj).convertOldVariable(prefName, value);\n if (convertedVars != null) {\n for (Map.Entry<Setting,Object> e: convertedVars.entrySet()) {\n Setting setting = e.getKey();\n prefName = setting.getPrefName();\n value = e.getValue();\n projectSettings.put(setting, value);\n }\n continue;\n }\n } else if (obj instanceof Tool) {\n prefPath = ((Tool)obj).prefs.relativePath() + \"/\";\n }\n settingsByPrefName.put(prefPath + prefName, value);\n }\n Setting.Group grp = obj instanceof Technology ? ((Technology)obj).getProjectSettings() : ((Tool)obj).getProjectSettings();\n for (Setting setting: grp.getSettings()) {\n Object value = settingsByPrefName.get(setting.getPrefPath());\n if (value != null)\n projectSettings.put(setting, value);\n }\n \t}", "public void iniciarValores(){\r\n //Numero de campos da linha, do arquivo de saida filtrado\r\n this.NUM_CAMPOS = 106;\r\n this.ID = 0; //numero da ficha\r\n this.NUM_ARQUIVOS = 2070;\r\n\r\n this.MIN_INDICE = 1; //indice do cadastro inicial\r\n this.MAX_INDICE = 90; //indice do cadastro final\r\n this.NUM_INDICES = 90; //quantidade de cadastros lidos em cada arquivo\r\n }", "protected void storeCurrentValues() {\n }", "public void IntialProperties() {\r\n Properties prop = new Properties();\r\n try (FileInputStream input = new FileInputStream(\"./config.properties\")) {\r\n prop.load(input);\r\n generate = prop.getProperty(\"generate\");\r\n solve = prop.getProperty(\"algorithm\");\r\n setChanged();\r\n notifyObservers(\"prop\");\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public void loadDefaultValues() {\r\n\t}", "public static void setUserHintValues()\n {\n int hintValueNum=1; //Número de casillas que son reveladas al inicio de la partida.\n \n switch(GameManager.getGameLevel())\n {\n case 1: hintValueNum = 9;\n break;\n case 2: hintValueNum = 6;\n break;\n case 3: hintValueNum = 3;\n break;\n }\n \n int row; //Número de fila.\n int col; //Número de columna.\n boolean isSet; //Define si el valor de la casilla ya ha sido inicializado anteriormente.\n \n for (int i = 0; i < hintValueNum; i++)\n {\n isSet=false;\n do{\n row = (int) (Math.random() * 4);\n col = (int) (Math.random() * 4);\n \n if (playerBoardPos[row][col]==0)\n {\n //Inicializa algunas posiciones aleatorias para las pistas iniciales del tablero del jugador.\n playerBoardPos[row][col] = boardPos[row][col]; \n isDefaultPos[row][col]=true;\n isSet=true;\n }\n }while (isSet==false);\n }\n }", "private void saveValues() {\n for (Map.Entry<EditText, Integer> e : mPrefKeys.entrySet()) {\n // If the field is disabled, add the DEACTIVATED marker to the value of the field\n if (e.getKey().isEnabled())\n Pref.put(this, e.getValue(), e.getKey().getText().toString());\n else\n Pref.put(this, e.getValue(), Data.DEACTIVATED_MARKER + e.getKey().getText().toString());\n }\n\n }", "public void test_95052() {\n \t\tIProject project = getProject(getUniqueString());\n \t\tensureExistsInWorkspace(project, true);\n \t\tPreferences node = new ProjectScope(project).getNode(ResourcesPlugin.PI_RESOURCES);\n \t\tnode.put(\"key1\", \"value1\");\n \t\tnode.put(\"key2\", \"value2\");\n \t\tnode.put(\"key3\", \"value3\");\n \t\ttry {\n \t\t\tnode.flush();\n \t\t} catch (BackingStoreException e) {\n \t\t\tfail(\"1.1\", e);\n \t\t}\n \t\tIFile prefFile = getFileInWorkspace(project, ResourcesPlugin.PI_RESOURCES);\n \t\tassertTrue(\"1.2\", prefFile.exists());\n \t\tProperties properties = new Properties();\n \t\tInputStream contents = null;\n \t\ttry {\n \t\t\tcontents = prefFile.getContents();\n \t\t} catch (CoreException e) {\n \t\t\tfail(\"1.3\", e);\n \t\t}\n \t\ttry {\n \t\t\tproperties.load(contents);\n \t\t} catch (IOException e) {\n \t\t\tfail(\"1.4\", e);\n \t\t} finally {\n \t\t\ttry {\n \t\t\t\tcontents.close();\n \t\t\t} catch (IOException e) {\n \t\t\t\t//\n \t\t\t}\n \t\t}\n \t\tassertEquals(\"2.0\", \"value1\", properties.get(\"key1\"));\n \t\tassertEquals(\"2.1\", \"value2\", properties.get(\"key2\"));\n \t\tassertEquals(\"2.2\", \"value3\", properties.get(\"key3\"));\n \t\t// add a new property\n \t\tproperties.put(\"key0\", \"value0\");\n \t\t// change an existing property\t\t\n \t\tproperties.put(\"key2\", \"value2\".toUpperCase());\n \t\t// removes a property\n \t\tproperties.remove(\"key3\");\n \t\tByteArrayOutputStream tempOutput = new ByteArrayOutputStream();\n \t\ttry {\n \t\t\tproperties.store(tempOutput, null);\n \t\t} catch (IOException e) {\n \t\t\t// should never happen, we are not doing I/O\t\t\t\n \t\t\tfail(\"2.4\", e);\n \t\t}\n \t\tByteArrayInputStream tempInput = new ByteArrayInputStream(tempOutput.toByteArray());\n \t\ttry {\n \t\t\tprefFile.setContents(tempInput, false, false, getMonitor());\n \t\t} catch (CoreException e) {\n \t\t\tfail(\"2.5\", e);\n \t\t}\n \n \t\t// here, project preferences should have caught up with the changes\t\t\n \t\tnode = new ProjectScope(project).getNode(ResourcesPlugin.PI_RESOURCES);\n \t\t// property was added\n \t\tassertEquals(\"3.0\", \"value0\", node.get(\"key0\", null));\n \t\t// property value was not changed\t\t\n \t\tassertEquals(\"3.1\", \"value1\", node.get(\"key1\", null));\n \t\t// property value was changed to upper case\t\t\n \t\tassertEquals(\"3.2\", \"value2\".toUpperCase(), node.get(\"key2\", null));\n \t\t// property was deleted\n \t\tassertNull(\"3.3\", node.get(\"key3\", null));\n \t}", "public Final_parametre() {\r\n\t}", "public interface PropertyValues {\n\n String DEFAULT_PRO_FILE = \"/data/MyPerf4J/MyPerf4J.properties\";\n\n String RECORDER_MODE_ACCURATE = \"accurate\";\n\n String RECORDER_MODE_ROUGH = \"rough\";\n\n int MIN_BACKUP_RECORDERS_COUNT = 1;\n\n int MAX_BACKUP_RECORDERS_COUNT = 8;\n\n String DEFAULT_PERF_STATS_PROCESSOR = DefaultStdoutProcessor.class.getName();\n\n long DEFAULT_TIME_SLICE = 60 * 1000L;\n\n long MIN_TIME_SLICE = 1000L;\n\n long MAX_TIME_SLICE = 10 * 60 * 1000L;\n\n String FILTER_SEPARATOR = \";\";\n\n}", "private String ProperEstadoCivil()\n{\n String strRes=\"\";\n try\n {\n //Leer archivo de configuración .\n java.util.Properties proArc=new java.util.Properties();\n \n java.io.FileInputStream fis=new java.io.FileInputStream(\"config.properties.txt\");\n proArc.load(fis);\n fis.close();\n \n \n \n strRes=proArc.getProperty(\"EstadoCivil\");\n proArc=null;\n }\n catch (java.io.IOException e)\n {\n strRes=\"\";\n }\n catch (Exception e)\n {\n strRes=\"\";\n }\n return strRes;\n }", "void setup(String value, String loadResource, String saveResource);", "private void collectValuesForSettings() {\n portColumnsValue = (portColumns.getProgress());\n portRowsValue = (portRows.getProgress());\n landColumnsValue = (landColumns.getProgress());\n landRowsValue = (landRows.getProgress());\n }", "public void loadValues() {\n color.setText(bluej.getExtensionPropertyString(PROFILE_LABEL, \"\"));\r\n }", "private void showPreferenceSettings() {\n \tfor(PrefKeysE k: PrefKeysE.values()) {\n \t\tString key = k.getKey();\n \t\tboolean isFound = Tt.isPreferencePresent(key);\n \t\tint prtFlags = 0; //don't print from getPreference()\n// \t\tboolean valB;\n// \t\tint valI;\n// \t\tdouble valD;\n \t\tString valFoundStr = \"\";\n \t\tString prefix = String.format(\"%-40s: %-7s: found? %s, default \", key, k.getType().name(), (isFound ? \"Y\" : \"N\"));\n \t\tswitch(k.getType()) {\n \t\tcase BOOLEAN:\n \t\t\tboolean dfltB = k.getDefaultBoolean();\n \t\t\tvalFoundStr += dfltB;\n \t\t\tif(isFound) {\n \t\t\t\tboolean val = Tt.getPreference(k, dfltB, prtFlags, PrefCreateE.DO_NOT_CREATE);\n \t\t\t\tvalFoundStr += \", current \" + val;\n \t\t\t}\n \t\t\tbreak;\n \t\tcase INT:\n \t\t\tint dfltI = k.getDefaultInt();\n \t\t\tvalFoundStr += dfltI;\n \t\t\tif(isFound) {\n \t\t\t\tint val = Tt.getPreference(k, dfltI, prtFlags, PrefCreateE.DO_NOT_CREATE);\n \t\t\t\tvalFoundStr += \", current \" + val;\n \t\t\t}\n \t\t\tbreak;\n \t\tcase DOUBLE:\n \t\t\tdouble dfltD = k.getDefaultDouble();\n \t\t\tvalFoundStr = String.format(\"% 1.4f\", dfltD);\n \t\t\tif(isFound) {\n \t\t\t\tdouble val = Tt.getPreference(k, dfltD, prtFlags, PrefCreateE.DO_NOT_CREATE);\n \t\t\t\tvalFoundStr += String.format(\", current % 1.4f\", val);\n \t\t\t}\n \t\t\tbreak;\n \t\tcase STRING:\n \t\t\tString dfltS = k.getDefaultString();\n\t\t\t\tvalFoundStr += \"'\" + dfltS + \"'\";\n \t\t\tif(isFound) {\n \t\t\t\tString val = Tt.getPreference(k, dfltS, prtFlags, PrefCreateE.DO_NOT_CREATE);\n \t\t\t\tvalFoundStr += \", current '\" + val + \"'\";\n \t\t\t}\n \t\t\tbreak;\n \t\t}\n\t\t\tP.println(prefix + valFoundStr);\n\n// \t\tif(k.getType().equals(PrefTypeE.BOOLEAN)) \n \t}\n }", "public void configurarIdioma() {\n botonAceptar.setText(resources.getString(\"aceptar\"));\n labelErrorRegistro.setText(resources.getString(\"LabelErrorRegistro\"));\n labelNoSePuedeRegistrar.setText(resources.getString(\"noSePuedeRegistrar\"));\n labelCamposVacios.setText(resources.getString(\"hayCamposVacios\"));\n }", "protected void inicializar(){\n kr = new CreadorHojas(wp);\n jPanel1.add(wp,0); // inserta el workspace en el panel principal\n wp.insertarHoja(\"Hoja 1\");\n //wp.insertarHoja(\"Hoja 2\");\n //wp.insertarHoja(\"Hoja 3\");\n }", "private void prefil_demo_values() {\n //Dont forget to look at \"Controller.connect()\" method\n //\n MY_SQL = false;\n DATE_FORMAT = \"yy/MM/dd\";\n String quality = \"1702860-ST110\";\n jComboBoxQuality.addItem(quality);\n jComboBoxQuality.setSelectedItem(quality);\n String testCode = \"10194\";\n jComboBoxTestCode.addItem(testCode);\n jComboBoxTestCode.setSelectedItem(testCode);\n //\n String testName = \"ML\";\n jComboBoxTestName.addItem(testName);\n jComboBoxTestName.setSelectedItem(testName);\n //\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.preferences);\n\n SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getBaseContext());\n\n //String ip = SP.getString(\"ip\", \"NULL\");\n // Config.ip = SP.getString(\"ip\", \"NULL\");\n // Log.e(\"IP\",Config.ip );\n String language = SP.getString(\"language\",\"NULL\");\n // Toast.makeText(getApplicationContext(),Config.ip,Toast.LENGTH_SHORT).show();\n //Toast.makeText(getApplicationContext(),language,Toast.LENGTH_SHORT).show();\n }", "private void loadPreferences() {\n SharedPreferences sp = getSharedPreferences(MY_PREFS, MODE_PRIVATE);\n\n int entreeIndex = sp.getInt(\"entreeIndex\", 0);\n int drinkIndex = sp.getInt(\"drinkIndex\", 0);\n int dessertIndex = sp.getInt(\"dessertIndex\", 0);\n\n // Setting inputs from SharedPreferences\n spEntree.setSelection(entreeIndex);\n spDrink.setSelection(drinkIndex);\n spDessert.setSelection(dessertIndex);\n\n edtTxtEntreePrice.setText(alEntreePrices.get(entreeIndex));\n edtTxtDrinkPrice.setText(alDrinkPrices.get(drinkIndex));\n edtTxtDessertPrice.setText(alDessertPrices.get(dessertIndex));\n }", "public Variables() {\n this.numCliente = 0;\n this.tiempoSalida = 999;\n }", "private UserPrefernce(){\r\n\t\t\r\n\t}", "private void getPreferences() {\n Constants constants = new Constants();\n android.content.SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n\n serverUrl = sharedPreferences.getString(\"LedgerLinkBaseUrl\", constants.DEFAULTURL);\n IsEditing = SharedPrefs.readSharedPreferences(getActivity(), \"IsEditing\", \"0\");\n tTrainerId = SharedPrefs.readSharedPreferences(getActivity(), \"ttrainerId\", \"-1\");\n vslaId = SharedPrefs.readSharedPreferences(getActivity(), \"vslaId\", \"-1\");\n\n vslaName = DataHolder.getInstance().getVslaName();\n representativeName = DataHolder.getInstance().getGroupRepresentativeName();\n representativePost = DataHolder.getInstance().getGroupRepresentativePost();\n repPhoneNumber = DataHolder.getInstance().getGroupRepresentativePhoneNumber();\n grpBankAccount = DataHolder.getInstance().getGroupBankAccount();\n physAddress = DataHolder.getInstance().getPhysicalAddress();\n regionName = DataHolder.getInstance().getRegionName();\n grpPhoneNumber = DataHolder.getInstance().getGroupPhoneNumber();\n grpBankAccount = DataHolder.getInstance().getGroupBankAccount();\n locCoordinates = DataHolder.getInstance().getLocationCoordinates();\n grpSupportType = DataHolder.getInstance().getSupportTrainingType();\n numberOfCycles = DataHolder.getInstance().getNumberOfCycles();\n }", "public static void main(String[] args) {\n\t\tResourceBundle configuracion = ResourceBundle.getBundle(\"configuracion.properties\");\n\t\tString usuario = configuracion.getString(\"login\");\n\t\tString password = configuracion.getString(\"clave\");\n\t\tSystem.out.println(\"valores obtenidos:\"+usuario+\"--\"+password);\n\t}", "private void loadPreferences() {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n boolean lm = sp.getBoolean(getString(R.string.live_match), true);\n boolean ls = sp.getBoolean(getString(R.string.live_score), true);\n\n if(lm) live_match.setChecked(true);\n else live_match.setChecked(false);\n\n if(ls) live_score.setChecked(true);\n else live_score.setChecked(false);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.settings_main);\n // Find the preference we’re interested in and then bind the current preference value to be displayed\n // Use its findPreference() method to get the Preference object. To help us with binding the value that’s in SharedPreferences to what will show up in the preference summary, we’ll create a help method and call it\n Preference minNews = findPreference(getString(R.string.settings_number_of_news_key));\n // in order to update the preference summary when the settings activity is launched we setup the bindPreferenceSummaryToValue() helper method and which we used in onCreate()\n bindPreferenceSummaryToValue(minNews);\n\n Preference orderBy = findPreference(getString(R.string.settings_order_by_key));\n bindPreferenceSummaryToValue(orderBy);\n\n }", "public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}", "public interface GeneralPreferenceHelper {\n String PREF_USER_NAME = \"pref_name_user\";\n String PREF_ENABLE_SOCIAL = \"pref_social_recomendation\";\n}", "private void processPrefs(Class<?> baseClass, SimplTypesScope translationScope,\n \t\t\tStack<String> argStack, float prefsAssetVersion) throws SIMPLTranslationException\n \t{\n \t\tLaunchType launchType = LaunchType.ECLIPSE; // current default\n \n \t\t// look for launch method identifier in upper case\n \t\tString arg = pop(argStack);\n \n \t\tif (arg != null)\n \t\t{\n \t\t\tString uc = arg.toUpperCase();\n \t\t\tif (\"JNLP\".equals(uc))\n \t\t\t{ // tells us how we were launched: e.g., JNLP, ECLIPSE, ...\n \t\t\t\tlaunchType = LaunchType.JNLP;\n \t\t\t}\n \t\t\telse if (\"STUDIES\".equals(uc))\n \t\t\t{\n \t\t\t\tlaunchType = LaunchType.STUDIES;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t// TODO -- recognize JAR here !!!\n \t\t\t\targStack.push(arg);\n \t\t\t}\n \t\t\tLAUNCH_TYPE_PREF.setValue(launchType);\n \t\t}\n \t\tprintln(\"LaunchType = \" + launchType);\n \t\tthis.launchType = launchType;\n \t\t// look for codeBase path\n \t\targ = pop(argStack);\n \n \t\t// read perhaps meta-preferences and surely preferences from application data dir\n \t\tFile applicationDir = PropertiesAndDirectories.thisApplicationDir();\n \n \t\tParsedURL applicationDataPURL = new ParsedURL(applicationDir);\n \t\tprefsPURL = applicationDataPURL.getRelative(\"preferences/prefs.xml\");\n \t\tdebugA(\"prefsPURL= \" + prefsPURL);\n \n \t\tSystem.out.println(\"arg: \" + arg);\n \n \t\tswitch (launchType)\n \t\t{\n \t\tcase STUDIES:\n \t\tcase JNLP:\n \t\t\t// next arg *should* be code base\n \t\t\tif ((arg != null) && arg.endsWith(\"/\"))\n \t\t\t{\n \t\t\t\t// JNLP only! (as of now)\n \t\t\t\t// right now this only works for http://\n \t\t\t\tParsedURL codeBase = ParsedURL.getAbsolute(arg, \"Setting up codebase\");\n \t\t\t\tthis.setCodeBase(codeBase);\n \n \t\t\t\t// XXX is this right?\n \t\t\t\tfinal String host = codeBase.host();\n \t\t\t\tif (\"localhost\".equals(host) || \"127.0.0.1\".equals(host))\n \t\t\t\t{\n \t\t\t\t\tdebug(\"launched from localhost. must be a developer.\");\n \t\t\t\t\tLAUNCH_TYPE_PREF.setValue(LaunchType.LOCAL_JNLP);\n \t\t\t\t}\n \n \t\t\t\tSIMPLTranslationException metaPrefSetException = null;\n \t\t\t\tParsedURL metaPrefsPURL = null;\n \t\t\t\ttry\n \t\t\t\t{\n \t\t\t\t\tAssetsRoot prefAssetsRoot = new AssetsRoot(this, PREFERENCES, null);\n \t\t\t\t\tFile metaPrefsFile = Assets.getAsset(\tprefAssetsRoot,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMETAPREFS_XML,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefs\",\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefsAssetVersion);\n \t\t\t\t\tmetaPrefsPURL = new ParsedURL(metaPrefsFile);\n \t\t\t\t\tmetaPrefSet = MetaPrefSet.load(metaPrefsFile, translationScope);\n \t\t\t\t\tprintln(\"OK: loaded MetaPrefs from \" + metaPrefsFile);\n \t\t\t\t}\n \t\t\t\tcatch (SIMPLTranslationException e)\n \t\t\t\t{\n \t\t\t\t\tmetaPrefSetException = e;\n \t\t\t\t}\n \t\t\t\tcatch (Exception e)\n \t\t\t\t{\n \t\t\t\t\te.printStackTrace();\n \t\t\t\t}\n \t\t\t\t// from supplied URL instead of from here\n \t\t\t\ttry\n \t\t\t\t{\n \t\t\t\t\tdebugA(\"Considering prefSet=\" + prefSet + \"\\tprefsPURL=\" + prefsPURL);\n \t\t\t\t\tif (prefSet == null) // Normal Case\n \t\t\t\t\t{\n \t\t\t\t\t\tprefSet = PrefSet.load(prefsPURL, translationScope);\n \t\t\t\t\t\tif (prefSet != null)\n \t\t\t\t\t\t\tprintln(\"OK: Loaded Prefs from \" + prefsPURL);\n \t\t\t\t\t\telse\n \t\t\t\t\t\t\tprintln(\"No Prefs to load from \" + prefsPURL);\n \t\t\t\t\t}\n \t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t{\n \t\t\t\t\t\twarning(\"Couldn't load MetaPrefs:\");\n \t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tcatch (SIMPLTranslationException e)\n \t\t\t\t{\n \t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t{\n \t\t\t\t\t\terror(\"Can't load MetaPrefs or Prefs. Quitting.\");\n \t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\te.printTraceOrMessage(this, \"Prefs\", prefsPURL);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\t// meta prefs o.k. we can continue\n \t\t\t\t\t\twarning(\"Couldn't load Prefs:\");\n \t\t\t\t\t\te.printTraceOrMessage(this, \"Prefs\", prefsPURL);\n \t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t}\n \t\t\t\t}\n \n \t\t\t\tdebugA(\"argStack.size() = \" + argStack.size());\n \t\t\t\tif (argStack.size() > 0)\n \t\t\t\t{\n \t\t\t\t\tString prefSpec = \"\";\n \t\t\t\t\tif (arg.startsWith(\"http://\"))\n \t\t\t\t\t{\n \t\t\t\t\t\t// PreferencesServlet\n \t\t\t\t\t\tprefSpec = pop(argStack);\n \n \t\t\t\t\t\tif (prefSpec != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\t// load URLEncoded prefs XML straight from the argument\n \t\t\t\t\t\t\tPrefSet JNLPPrefSet = loadPrefsFromJNLP(prefSpec);\n \n \t\t\t\t\t\t\tif (JNLPPrefSet != null)\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tif (prefSet == null)\n \t\t\t\t\t\t\t\t\tprefSet = JNLPPrefSet;\n \t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\tprefSet.append(JNLPPrefSet);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t{ // if we got args straight from jnlp, then continue\n \t\t\t\t\t\t\t\tif (JNLPPrefSet != null)\n \t\t\t\t\t\t\t\t\tprefSpec = pop(argStack);\n \n \t\t\t\t\t\t\t\tif (prefSpec != null)\n \t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\tPrefSet servletPrefSet = requestPrefFromServlet(prefSpec, translationScope);\n \t\t\t\t\t\t\t\t\tif (servletPrefSet == null)\n \t\t\t\t\t\t\t\t\t\terror(\"incorrect prefXML string returned from the servlet=\" + prefSpec);\n \t\t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\t\tif (prefSet == null)\n \t\t\t\t\t\t\t\t\t\t\tprefSet = servletPrefSet;\n \t\t\t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\t\t\tprefSet.append(servletPrefSet);\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\telse\n \t\t\t{\n \t\t\t\terror(\"No code base argument :-( Can't load preferences.\");\n \t\t\t}\n \t\t\tbreak;\n \t\tcase ECLIPSE:\n \t\tcase JAR:\n \t\t\t// NB: This gets executed even if arg was null!\n \t\t\tFile localCodeBasePath = deriveLocalFileCodeBase(baseClass); // sets codeBase()!\n \t\t\targStack.push(arg);\n \n \t\t\t// AssetsRoot prefAssetsRoot = new AssetsRoot(Assets.getAssetsRoot().getRelative(PREFERENCES),\n \t\t\t// Files.newFile(PropertiesAndDirectories.thisApplicationDir(), PREFERENCES));\n \t\t\t// Assets.downloadZip(prefAssetsRoot, \"prefs\", null, false, prefsAssetVersion);\n \n \t\t\tSIMPLTranslationException metaPrefSetException = null;\n \t\t\tFile metaPrefsFile = new File(localCodeBasePath, ECLIPSE_PREFS_DIR + METAPREFS_XML);\n \t\t\tParsedURL metaPrefsPURL = new ParsedURL(metaPrefsFile);\n \t\t\ttry\n \t\t\t{\n \t\t\t\tmetaPrefSet = MetaPrefSet.load(metaPrefsPURL, translationScope);\n \t\t\t\tprintln(\"OK: Loaded MetaPrefs from: \" + metaPrefsFile);\n \t\t\t}\n \t\t\tcatch (SIMPLTranslationException e)\n \t\t\t{\n \t\t\t\tmetaPrefSetException = e;\n \t\t\t}\n \n \t\t\t// load the application dir prefs from this machine\n \t\t\t// (e.g., c:\\Documents and Settings\\andruid\\Application\n \t\t\t// Data\\combinFormation\\preferences\\prefs.xml\n \t\t\t// these are the ones that get edited interactively!\n \n \t\t\tprefSet = PrefSet.load(prefsPURL, translationScope);\n \t\t\tif (prefSet != null)\n \t\t\t\tprintln(\"Loaded Prefs from: \" + prefsPURL);\n \t\t\telse\n \t\t\t\tprintln(\"No Prefs to load from: \" + prefsPURL);\n \n \t\t\t// now seek the path to an application specific xml preferences file\n \t\t\targ = pop(argStack);\n \t\t\t// if (arg == null)\n \t\t\t// return;\n \t\t\tif (arg != null)\n \t\t\t{\n \t\t\t\t// load preferences specific to this invocation\n \t\t\t\tif (arg.endsWith(\".xml\"))\n \t\t\t\t{\n \t\t\t\t\tFile argPrefsFile = new File(localCodeBasePath, ECLIPSE_PREFS_DIR + arg);\n \t\t\t\t\tParsedURL argPrefsPURL = new ParsedURL(argPrefsFile);\n \t\t\t\t\ttry\n \t\t\t\t\t{\n \t\t\t\t\t\tPrefSet argPrefSet = PrefSet.load(argPrefsPURL, translationScope);\n \t\t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\twarning(\"Couldn't load MetaPrefs:\");\n \t\t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (argPrefSet != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tprintln(\"OK: Loaded Prefs from: \" + argPrefsFile);\n \t\t\t\t\t\t\tif (prefSet != null)\n \t\t\t\t\t\t\t\tprefSet.addPrefSet(argPrefSet);\n \t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\tprefSet = argPrefSet;\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\tprintln(\"\");\n \t\t\t\t\t\t\tString doesntExist = argPrefsFile.exists() ? \"\" : \"\\n\\tFile does not exist!!!\\n\\n\";\n \t\t\t\t\t\t\tprintln(\"ERROR: Loading Prefs from: \" + argPrefsFile + doesntExist);\n \t\t\t\t\t\t}\n \n \t\t\t\t\t}\n \t\t\t\t\tcatch (SIMPLTranslationException e)\n \t\t\t\t\t{\n \t\t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\terror(\"Can't load MetaPrefs or Prefs. Quitting.\");\n \t\t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\tthrow e;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t// meta prefs o.k. we can continue without having loaded Prefs now\n \t\t\t\t\t\te.printTraceOrMessage(this, \"Couldn't load Prefs\", argPrefsPURL);\n \t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t\targStack.push(arg);\n \t\t\t}\n \t\t\telse\n \t\t\t\targStack.push(arg); // let the next code handle returning.\n \t\t\tbreak;\n \t\t}\n \t\tSystem.out.println(\"Printing Prefs:\\n\");\n \t\ttry\n \t\t{\n \t\t\tif (prefSet != null)\n \t\t\t\tSimplTypesScope.serialize(prefSet, System.out, StringFormat.XML);\t\t\t\t\n \t\t}\n \t\tcatch (SIMPLTranslationException e)\n \t\t{\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\n \t\t}\n \t\tSystem.out.println(\"\\nPrefs Printed\");\n \t\tif (prefSet != null)\n \t\t\tpostProcessPrefs(prefSet);\n \t}", "public ValorVariavel() {\r\n }", "private void loadValues()\n {\n OperationSetBasicAutoAnswer opset = providerService\n .getOperationSet(OperationSetBasicAutoAnswer.class);\n OperationSetAdvancedAutoAnswer opSetAdvanced = providerService\n .getOperationSet(OperationSetAdvancedAutoAnswer.class);\n\n if(opset == null)\n return;\n\n noneRadio.setSelected(true);\n alwaysAnswerRadio.setSelected(\n opset.isAutoAnswerUnconditionalSet());\n\n if(opSetAdvanced != null)\n {\n if(opSetAdvanced.isAutoAnswerConditionSet())\n {\n String fName = opSetAdvanced.getAutoAnswerHeaderName();\n String fValue = opSetAdvanced.getAutoAnswerHeaderValue();\n if(AUTO_ALERT_INFO_NAME.equals(fName)\n && AUTO_ALERT_INFO_VALUE.equals(fValue))\n {\n alertInfoValue.setSelected(true);\n }\n else\n {\n customValueRadio.setSelected(true);\n headerNameField.setText(fName);\n\n if(StringUtils.isNotEmpty(fValue))\n headerValueField.setText(fValue);\n }\n\n }\n\n if(StringUtils.isNotEmpty(opSetAdvanced.getCallForward()))\n {\n callFwd.setSelected(true);\n callFwdNumberField.setText(opSetAdvanced.getCallForward());\n }\n }\n\n answerWithVideoCheckBox.setSelected(\n opset.isAutoAnswerWithVideoSet());\n }", "private void getDataFromSharedPrefernce() {\r\n\r\n\t\tprofileImageString = mSharedPreferences_reg.getString(\"ProfileImageString\",\"\");\r\n\t\tpsedoName = mSharedPreferences_reg.getString(\"PseudoName\", \"\");\r\n\t\tprofiledescription = mSharedPreferences_reg.getString(\"Pseudodescription\", \"\");\r\n\r\n\t\tsetDataToRespectiveFields();\r\n\t}", "private void limpiarValores(){\n\t\tpcodcia = \"\";\n\t\tcedula = \"\";\n\t\tcoduser = \"\";\n\t\tcluser = \"\";\n\t\tmail = \"\";\n\t\taudit = \"\";\n\t\tnbr = \"\";\n\t\trol = \"\";\n\t}", "public void afficherVariables() {\n System.out.println\r\n (\"Objet de type GrillePain avec variables d'instance année = \" +\r\n annee + \" et nbTranches = \" + nbTranches);\r\n }", "public Valvula(){}", "public void validerSaisie();", "private void setPreferences(Preferences preferences) {\n this.preferences = preferences;\n }", "public Preferences(Arguments args) {\r\n\t\tsuper(Preferences.Key.class);\r\n\t\tportable = args.getBool(Arguments.Key.PORTABLE);\r\n\r\n\t\tFile file = new File(args.getPath(), FileAtlas.PREF_FILENAME);\r\n\t\ttry (\tFileInputStream input = new FileInputStream(file);\r\n\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(input)) ) {\r\n\t\t\tString line;\r\n\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\tif (line.length() < 1 || line.charAt(0) == '#')\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tint split = line.indexOf('=');\r\n\t\t\t\tif (split > -1) {\r\n\t\t\t\t\tKey key = Key.fromId(line.substring(0, split));\r\n\r\n\t\t\t\t\tif (key != null)\r\n\t\t\t\t\t\tmap.put(key, line.substring(split+1));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Unable to load runeframe.pref\");\r\n\t\t}\r\n\t}", "public PreferencesDialog (JFrame owner)\n {\n this (owner, \"OPENMARKOV User Preferences\",\n OpenMarkovPreferences.OPENMARKOV_NODE_PREFERENCES, true/*\n * ,\n * OpenMarkovPreferences\n * .\n * OPENMARKOV_KERNEL_PREFERENCES\n * , false\n */);\n }", "private void setUpFrom(){\n\t\tEPVentanaTemporal ven = new EPVentanaTemporal();\n\t\tEPPropiedad pro = new EPPropiedad();\n\t\t//setemamos la ventana.\n\t\tven.setNombre(\"time_batch\");\n\t\tven.setValor(\"10\");\n\t\tven.setUnidadTemporal(\"seconds\");\n\t\tven.setPseudonombre(\"a1\");\n\t\tpro.setNombre(\"p4\");\n\t\tpro.setPseudonombre(\"\");\n\t\tpro.setVentana(ven);\n\t\texpresionesFrom.add(pro);\n\t}", "public Polipara() {\n // Iniciar el programa cargando el archivo de propiedades si existe.\n\n if (this.validarSerializacion()) {\n int response = JOptionPane.showConfirmDialog(null, \"Hay una versión anterior de una copa,\\n\"\n + \"¿Desea cargar esa versión? (Al seleccionar \\\"No\\\", se eliminará el avance anterior y se cargará una copa nueva.)\");\n if (response == 0) {\n this.cargarSerializacion();\n } else {\n this.iniciarCopa();\n }\n } else {\n this.iniciarCopa();\n }\n }", "private SingletonLectorPropiedades() {\n\t}", "public static void main(String[] args) {\n\n\t\tProperties props = null;\n\t\tString chemin = \"fichiers/Config.properties\";\n\t\t\n\t\ttry {\n\t\t\tprops= OutilLectParamConnect.recupererProperties(chemin);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\n\t\tConnection connection = null;\n\t\tconnection = Singleton.getInstance(props);\n\n\t\t\n\t\t\t\t\n\t\t// Insertion d'un objet Localexpo\n\t\tSystem.out.println(\"Insertion un objet\");\n\t\t\n\t\tAdresse adresse1 = new Adresse();\n\t\tadresse1.setIdAdresse(1);\n\t\t\t\n\t\tLocalexpo loc = new Localexpo();\n\t\tloc.setIdAdresseLocal(0);\n\t\tloc.setNomLocal(\"Nom\");\n\t\tloc.setSuperficieExpo(55.20);\n\t\tloc.setTelephoneLocal(\"Telephone\");\n\t\tloc.setAdresse(adresse1);\t\t\n\t\t\n\t\t\n\t\t\n\t\tLocalexpoDao locDao1 = new LocalexpoDao(connection);\n\t\t\t\n\t\ttry {\n\t\t\tlocDao1.insert(loc);\n\t\t\tSystem.out.println(\"Insertion réussie\");\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de l'insertion\");\n\t\t}\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Insertion d'un tableau d'objets Localexpo\n\t\tSystem.out.println(\"Insertion tableau d'objets\");\n\t\t\n\t\tAdresse adresse2 = new Adresse();\n\t\tadresse2.setIdAdresse(2);\n\t\t\n\t\tLocalexpo loc1 = new Localexpo();\n\t\tloc1.setIdAdresseLocal(0);\n\t\tloc1.setNomLocal(\"Nom 1\");\n\t\tloc1.setSuperficieExpo(27.20);\n\t\tloc1.setTelephoneLocal(\"Telephone 1\");\n\t\tloc1.setAdresse(adresse2);\t\t\n\t\t\t\n\t\tAdresse adresse3 = new Adresse();\n\t\tadresse3.setIdAdresse(3);\n\t\t\n\t\tLocalexpo loc2 = new Localexpo();\n\t\tloc2.setIdAdresseLocal(0);\n\t\tloc2.setNomLocal(\"Nom 2\");\n\t\tloc2.setSuperficieExpo(55.20);\n\t\tloc2.setTelephoneLocal(\"Telephone 2\");\n\t\tloc2.setAdresse(adresse3);\t\t\n\t\t\n\t\t\n\t\tAdresse adresse4 = new Adresse();\n\t\tadresse4.setIdAdresse(4);\n\t\t\n\t\tLocalexpo loc3 = new Localexpo();\n\t\tloc3.setIdAdresseLocal(0);\n\t\tloc3.setNomLocal(\"Nom 3\");\n\t\tloc3.setSuperficieExpo(95.20);\n\t\tloc3.setTelephoneLocal(\"Telephone 3\");\n\t\tloc3.setAdresse(adresse4);\t\t\n\t\t\n\t\t\n\t\t\n\t\tLocalexpo [] tabLoc = new Localexpo [3];\n\t\t\n\t\ttabLoc[0]=loc1;\n\t\ttabLoc[1]=loc2;\n\t\ttabLoc[2]=loc3;\n\t\t\n\t\t\n\t\t\n\t\tLocalexpoDao locDao2 = new LocalexpoDao(connection);\n\t\t\t\t\n\t\ttry {\n\t\t\tlocDao2.insertTabObj(tabLoc);\n\t\t\tSystem.out.println(\"Insertion réussie\");\t\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de l'insertion du tableau d'objets Localexpo\");\n\t\t}\n\t\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t// Insertion d'une Collection d'objets Localexpo\n\t\tSystem.out.println(\"Insertion collection d'objets\");\n\t\t\n\t\tAdresse adresse5 = new Adresse();\n\t\tadresse5.setIdAdresse(6);\n\t\t\n\t\tLocalexpo loc4 = new Localexpo();\n\t\tloc4.setIdAdresseLocal(0);\n\t\tloc4.setNomLocal(\"Nom 4\");\n\t\tloc4.setSuperficieExpo(89.20);\n\t\tloc4.setTelephoneLocal(\"Telephone 4\");\n\t\tloc4.setAdresse(adresse5);\t\t\n\n\t\t\n\t\tAdresse adresse6 = new Adresse();\n\t\tadresse6.setIdAdresse(7);\n\t\t\n\t\tLocalexpo loc5 = new Localexpo();\n\t\tloc5.setIdAdresseLocal(0);\n\t\tloc5.setNomLocal(\"Nom 5\");\n\t\tloc5.setSuperficieExpo(83.20);\n\t\tloc5.setTelephoneLocal(\"Telephone 5\");\n\t\tloc5.setAdresse(adresse6);\t\t\n\t\t\n\t\tAdresse adresse7 = new Adresse();\n\t\tadresse7.setIdAdresse(8);\n\t\t\n\t\tLocalexpo loc6 = new Localexpo();\n\t\tloc6.setIdAdresseLocal(0);\n\t\tloc6.setNomLocal(\"Nom 6\");\n\t\tloc6.setSuperficieExpo(588.20);\n\t\tloc6.setTelephoneLocal(\"Telephone 6\");\n\t\tloc6.setAdresse(adresse7);\t\t\n\t\t\n\t\t\n\t\tList<Localexpo> maliste = new ArrayList<Localexpo>(); \n\n\t\tmaliste.add(loc4); \n\t\tmaliste.add(loc5);\n\t\tmaliste.add(loc6);\n\t\t\t\n\t\t\t\n\t\tLocalexpoDao locDao3 = new LocalexpoDao(connection);\n\t\t\t\n\t\ttry {\n\t\t\tlocDao3.insertCollObj(maliste);\n\t\t\tSystem.out.println(\"Insertion réussie\");\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de l'insertion d'une Collection d'objets Localexpo\");\n\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\n\n\t\t\n\t\t// Mise à jour d'un objet Localexpo\n\t\tSystem.out.println(\"Mise à jour d'un objet\");\n\t\t\n\t\tLocalexpo loc7 = new Localexpo();\n\t\tloc7.setIdAdresseLocal(2);\n\t\tloc7.setNomLocal(\"Nom 7 update\");\n\t\tloc7.setSuperficieExpo(38.20);\n\t\tloc7.setTelephoneLocal(\"Telephone 7 update\");\t\n\t\t\n\t\t\t\n\t\tLocalexpoDao locDao4 = new LocalexpoDao(connection);\n\t\t\t\n\t\ttry {\n\t\t\tlocDao4.update(loc7);\n\t\t\tSystem.out.println(\"Mise à jour réussie\");\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de la mise à jour\");\n\t\t}\n\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Suppression d'un objet Localexpo\n\t\tSystem.out.println(\"Supression d'un objet\");\n\t\t\n\t\tLocalexpo loc8 = new Localexpo();\n\t\tloc8.setIdAdresseLocal(5);\n\t\t\t\t\t\n\t\tLocalexpoDao locDao5 = new LocalexpoDao(connection);\n\t\t\t\t\t\n\t\ttry {\n\t\t\tlocDao5.delete(loc8);\n\t\t\tSystem.out.println(\"Supression réussie\");\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de la supression de l'objet\");\n\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\n\t\t// Selection d'un objet Localexpo\n\t\tSystem.out.println(\"Sélection d'un objet\");\n\t\t\n\t\tLocalexpoDao locDao6 = new LocalexpoDao(connection);\n\t\tLocalexpo loc9 = new Localexpo();\n\t\t\t\n\t\ttry {\n\t\t\tloc9=locDao6.find(3);\n\t\t\tSystem.out.println(\"Objet sélectionné: \"+ loc9.getIdAdresseLocal() \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+\" \"+ loc9.getNomLocal());\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de la selection de l'objet\");\n\t\t}\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Selection de tous les objets Localexpo\n\t\tSystem.out.println(\"Sélection de tous les objets\");\n\t\t\n\t\tLocalexpoDao locDao7 = new LocalexpoDao(connection);\n\t\tList<Localexpo> listloc = new ArrayList<Localexpo>();\n\t\t\t\n\t\ttry {\n\t\t\tlistloc=locDao7.findAll();\n\t\t\t\n\t\t\tStringBuffer chaine = new StringBuffer();\n\t\t\tfor (Localexpo localexpo:listloc){\n\t\t\t\tchaine.append(localexpo.toString()+\"\\n\");\n\t\t\t}\n\t\t\tSystem.out.println(chaine);\n\t\t\t\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de la sélection des tous les objets\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\t// Sélection des objets Localexpo entre deux PK\n\t\tSystem.out.println(\"Sélection d'objets entre deux PK\");\n\t\t\n\t\tLocalexpoDao locDao8 = new LocalexpoDao(connection);\n\t\tList<Localexpo> listloc2 = new ArrayList<Localexpo>();\n\t\tInteger a= new Integer(2);\n\t\tInteger b= new Integer(4);\n\t\n\t\ttry {\n\t\t\tlistloc2=locDao8.findBetween(a,b);\n\t\t\t\n\t\t\tStringBuffer chaine2 = new StringBuffer();\n\t\t\tfor (Localexpo localexpo:listloc2){\n\t\t\t\tchaine2.append(localexpo.toString()+\"\\n\");\n\t\t\t}\n\t\t\tSystem.out.println(chaine2);\n\t\t\t\n\t\t} catch (MyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Echec de la sélection des objets entre deux PK\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\n\n\t\t\t\n\t\t// Fermer la connection\n\t\tSingleton.shutdown();\n\t\t\t\n\t}", "protected void InitValuables() {\n\t\tsuper.InitValuables();\n\t\t\n\t}", "public interface DefaultSettings {\n int SAMPLERATE = 16000;\n int BEAT_LENGTH_IN_MS = 100;\n int BUFFER_SIZE = 4096;\n int MAX_TEMPO_VALUE = 400;\n int MIN_TEMP_VALUE = 1;\n\n int PRESS_TEMPO_CHANGE_TIME_IN_MS = 500;\n}", "public void setUserPreferences (int outdoorPref, int nightlifePref, int hotelPref, int shoppingPref, int restaurantPref) {\n\t\tpreferences.clear(); \n\t\tpreferences.add(outdoorPref); \n\t\tpreferences.add(nightlifePref); \n\t\tpreferences.add(hotelPref); \n\t\tpreferences.add(shoppingPref); \n\t\tpreferences.add(restaurantPref); \n\t}", "void aprovarAnalise();", "public interface PrefsKey {\n\n String Ssid = \"Ssid\";\n String HotKeys = \"HotKeys\";\n String HistoryKeys = \"HistoryKeys\";\n String HistoryCooking = \"HistoryCooking\";\n\n String Guided = \"Guided\";\n}", "static public void verificaParametros()\r\n \r\n {\r\n SynthesizerModeDesc synthesizerModeDescTemp = (SynthesizerModeDesc)synthesizer.getEngineModeDesc();\r\n System.out.println(\"Nome do engine utilizado: \"+synthesizerModeDescTemp.getEngineName());\r\n System.out.println(\"Nome do modo de funcionamento utilizado: \"+synthesizerModeDescTemp.getModeName());\r\n \tSystem.out.println(\"Nome da localidade utilizada: \"+synthesizerModeDescTemp.getLocale().toString());\r\n \t\t//verifica a flag de controle\r\n if(synthesizerModeDescTemp.getRunning()!=null)\r\n if(synthesizerModeDescTemp.getRunning().booleanValue())\r\n System.out.println(\"Engine rodando.\");\r\n else\r\n System.out.println(\"Engine parado.\");\r\n else\r\n System.out.println(\"A flag de controle não foi setada e tem valor nulo.\");\r\n \t\t//mostra as vozes suportadas\r\n Voice[] VoiceTemp = synthesizerModeDescTemp.getVoices();\r\n for(int i=0;i<VoiceTemp.length;i++)\r\n {\r\n System.out.println(\"Voz numero \"+(i+1)+\" : \"+VoiceTemp[i].getName());\r\n }\r\n }", "public void loadPreferecences()\n {\n // Load preferences for chapter\n chapterPref = Activator.getDefault().getPluginPreferences().getBoolean(PREFERENCE_FOR_CHAPTER);\n if (controller != null)\n { \n\t\t\tcontroller.setHierarchical(chapterPref);\n\t\t}\n // Load preferences for value to recognize req\n String pref = Activator.getDefault().getPluginPreferences().getString(PREFERENCE_FOR_VALUE_TO_RECOGNIZE_REQ);\n if (pref != null && pref.length() > 0)\n {\n Serializer<RecognizedElement> serializer = new Serializer<RecognizedElement>();\n RecognizedElement element = serializer.unSerialize(pref);\n if (element != null)\n {\n valueToRecognizeReq = element;\n }\n }\n\n // Load preferences for attributes list\n pref = Activator.getDefault().getPluginPreferences().getString(PREFERENCE_FOR_LIST_RECOGNIZED_ELEMENT);\n if (pref != null && pref.length() > 0)\n {\n Serializer<Collection<RecognizedElement>> serializer = new Serializer<Collection<RecognizedElement>>();\n Collection<RecognizedElement> paramDecoded = serializer.unSerialize(pref);\n if (paramDecoded != null && paramDecoded.size() > 0)\n {\n for (Iterator<RecognizedElement> iterator = paramDecoded.iterator(); iterator.hasNext();)\n {\n tree.add((RecognizedElement) iterator.next());\n }\n }\n }\n \n // Load preferences for the description\n descriptionChecked = Activator.getDefault().getPluginPreferences().getBoolean(PREFERENCE_FOR_DESCRIPTION);\n }", "protected void initVars() {}", "public interface Config {\n public final String contentOfDocument=\"contentOfDoc\";\n public final String docId=\"docId\";\n public final String baseIp=\"http://irlab.daiict.ac.in/Annotation_Interface\";\n public final String sentenceFolder=\"sentences\";\n public final String savedSentenceEnd=\"savedSentenceEnd\";\n public final String savedSentenceStart=\"savedSentenceStart\";\n public final String docName=\"doc_name\";\n public final String relationFolder=\"relationsFolder\";\n public final String savedRelation=\"savedRelation\";\n public final String loginPrefs=\"loginFolder\";\n public final String isLoggedIn=\"isLoggedIn\";\n public final String userName=\"userName\";\n public final String password=\"password\";\n public final String relation=\"relation\";\n public final String checkedRelation=\"checkedRelation\";\n}", "public void setValues(RutaParams params){\n this.costo = params.costo;\n this.tiempoVuelo = params.tiempoVuelo;\n this.piloto =encriptar(params.piloto);\n }", "public void setContrasena(String contrasena) {this.contrasena = contrasena;}", "private void LoadCoreValues()\n\t{\n\t\tString[] reservedWords = \t{\"program\",\"begin\",\"end\",\"int\",\"if\",\"then\",\"else\",\"while\",\"loop\",\"read\",\"write\"};\n\t\tString[] specialSymbols = {\";\",\",\",\"=\",\"!\",\"[\",\"]\",\"&&\",\"||\",\"(\",\")\",\"+\",\"-\",\"*\",\"!=\",\"==\",\"<\",\">\",\"<=\",\">=\"};\n\t\t\n\t\t//Assign mapping starting at a value of 1 for reserved words\n\t\tfor (int i=0;i<reservedWords.length;i++)\n\t\t{\n\t\t\tcore.put(reservedWords[i], i+1);\n\t\t}\n\t\t//Assign mapping for special symbols\n\t\tfor (int i=0; i<specialSymbols.length; i++)\n\t\t{\t\n\t\t\tcore.put(specialSymbols[i], reservedWords.length + i+1 );\n\t\t}\n\t}", "void loadPreferences() throws OntimizeJEERuntimeException;", "private static void getInstancia() throws IOException {\r\n if (propiedades == null) {\r\n propiedades = new PropiedadesComunicacion();\r\n }\r\n }", "protected void initPreference(){\n DataUtils.savePreference(Const.REPORT, \"\");\n DataUtils.savePreference(Const.TRY_MATCH_PERSON,\"\");\n }", "@PostLoad\n private void settingsAfterLoad()\n {\n\n productInfo = pis != null && pis.size() > 0;\n\n /* [2] setup transient : type */\n\n boolean clIsTransfer = cluster.getName().equals(R.CLNAME_TRANSFER);\n boolean catransferIsNone = catransfer.getName().equals(R.CANAME_NONE);\n\n Assert.assertEquals(MSG_PREF + \"pivot iff cluster = \" + R.CLNAME_PIVOT,\n pivot, cluster.getName().equals(R.CLNAME_PIVOT));\n\n Assert.assertTrue(MSG_PREF + \"RULE: cl=\" + R.CLNAME_TRANSFER + \" ==> catransfer!=\" + R.CANAME_NONE\n + \"; GOT: \" + cluster + \", \" + catransfer + \"; clIsTransfer=\" + clIsTransfer\n + \" catransferIsNone=\" + catransferIsNone, !clIsTransfer || !catransferIsNone);\n\n if (pivot) type = TTransactionType.pivot;\n else if (clIsTransfer) type = TTransactionType.transfer;\n else type = TTransactionType.simple;\n // TODO TTransactionType.exchange\n\n }", "private void getPreferences() {\n\n if(sharedpreferences.getBoolean(\"usaGPU\", true)) {\n mUtilizzoGPU.setChecked(true);\n }\n else{\n mUtilizzoGPU.setChecked(false);\n }\n\n }", "void setPosiblesValores(int[] valores);", "public void test_55410() {\n \t\tIProject project1 = getProject(getUniqueString());\n \t\tensureExistsInWorkspace(new IResource[] {project1}, true);\n \t\tPreferences node = new ProjectScope(project1).getNode(ResourcesPlugin.PI_RESOURCES).node(\"subnode\");\n \t\tString key1 = \".\";\n \t\tString key2 = \"x\";\n \t\tString value1 = getUniqueString();\n \t\tString value2 = getUniqueString();\n \t\tnode.put(key1, value1);\n \t\tnode.put(key2, value2);\n \t\tassertEquals(\"0.8\", value1, node.get(key1, null));\n \t\tassertEquals(\"0.9\", value2, node.get(key2, null));\n \t\tIFile prefsFile = getFileInWorkspace(project1, ResourcesPlugin.PI_RESOURCES);\n \t\tassertTrue(\"1.0\", !prefsFile.exists());\n \t\ttry {\n \t\t\tnode.flush();\n \t\t} catch (BackingStoreException e) {\n \t\t\tfail(\"1.1\", e);\n \t\t}\n \t\tassertTrue(\"1.1\", prefsFile.exists());\n \t\tProperties props = new Properties();\n \t\tInputStream contents = null;\n \t\ttry {\n \t\t\tcontents = prefsFile.getContents();\n \t\t} catch (CoreException e) {\n \t\t\tfail(\"1.2\", e);\n \t\t}\n \t\ttry {\n \t\t\tprops.load(contents);\n \t\t} catch (IOException e) {\n \t\t\tfail(\"1.3\", e);\n \t\t} finally {\n \t\t\tif (contents != null)\n \t\t\t\ttry {\n \t\t\t\t\tcontents.close();\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\t// ignore\n \t\t\t\t}\n \t\t}\n \t\tassertEquals(\"2.0\", value2, props.getProperty(\"subnode/\" + key2));\n \t\tassertEquals(\"2.1\", value1, props.getProperty(\"subnode/\" + key1));\n \t}", "Values createValues();", "private void load()\n {\n SharedPreferences sp = getActivity().getPreferences(Context.MODE_PRIVATE);\n if (sp.contains(\"passLength\") && passLenSB != null)\n passLenSB.setProgress(sp.getInt(\"passLength\", 0));\n\n if (sp.contains(\"minDigits\") && minDigSB != null)\n minDigSB.setProgress(sp.getInt(\"minDigits\", 0));\n\n for (int i=0; i<checkBoxes.size(); i++)\n {\n checkBoxes.get(i).setChecked(sp.getBoolean(\"chkbx\"+Integer.toString(i), false));\n if (checkBoxes.get(i).isChecked())\n runChkBxOption(i, checkBoxes.get(i), rootView, child); // this code makes app generate new pass each time\n\n }\n // this code will restore pass on rotation only\n if (savedInstanceState != null && savedInstanceState.containsKey(\"password\"))\n passTV.setText(colourCodePass(savedInstanceState.getString(\"password\")));\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\tString filePath=\"/Users/aydin/eclipse-workspace/JavaBatch6/configs/Examples.properties\";\n\t\tFileInputStream fish =new FileInputStream(filePath);\n\t\tProperties prop=new Properties();\n\t\ttry {\n\t\t\tprop.load(fish);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tprop.setProperty(\"Phone number\", \"12345667\");\n\t\t\n\t\tFileOutputStream fos =new FileOutputStream(filePath);\n\t\ttry {\n\t\t\tprop.store(fos, \"added additinal key\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override \r\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState); \r\n addPreferencesFromResource(R.xml.preference);\r\n initPreferenceCategory(\"pref_key_allow_typedefine_commond\");\r\n }" ]
[ "0.5964694", "0.5935109", "0.5933346", "0.5891508", "0.58092827", "0.5787585", "0.57673115", "0.5693001", "0.56549", "0.5653248", "0.5638543", "0.56073725", "0.5598858", "0.55935866", "0.55694735", "0.55669636", "0.55516326", "0.54967004", "0.54633516", "0.5456514", "0.5452128", "0.54476553", "0.5437047", "0.5430396", "0.5414838", "0.5414411", "0.5413426", "0.5412982", "0.54068", "0.54062015", "0.53783727", "0.53736967", "0.5358118", "0.535512", "0.53513396", "0.5338683", "0.5332585", "0.5331952", "0.5319351", "0.5318561", "0.5315134", "0.53147936", "0.53048056", "0.53019506", "0.5299221", "0.5292032", "0.5290598", "0.5287709", "0.52843934", "0.528063", "0.5280427", "0.52687305", "0.5268594", "0.5265035", "0.52580875", "0.52558047", "0.5250951", "0.52400017", "0.5239952", "0.52378464", "0.5233008", "0.5226007", "0.52216965", "0.52206075", "0.5216033", "0.5213947", "0.5212463", "0.520856", "0.5206644", "0.5206045", "0.52041537", "0.5199097", "0.51896256", "0.5177641", "0.516865", "0.5162662", "0.51568764", "0.515631", "0.5148626", "0.5146889", "0.5143351", "0.5140089", "0.513613", "0.5133982", "0.51327026", "0.51292336", "0.5118693", "0.51179683", "0.51172537", "0.51169986", "0.51146334", "0.5114284", "0.511056", "0.5105597", "0.5101634", "0.50966275", "0.50955176", "0.5095051", "0.50941634", "0.50901705", "0.50834024" ]
0.0
-1
/ //Using PhantomJS DesiredCapabilities caps = new DesiredCapabilities(); caps.setJavascriptEnabled(true); caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "C:/phantomjs2.1.1windows/bin/phantomjs.exe"); driver = new PhantomJSDriver(caps); using firefox
@BeforeClass public static void setUpClass() throws Exception { driver = new FirefoxDriver(); baseUrl = "http://localhost/"; driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected WebDriver createPhantomJSDriver() {\n DesiredCapabilities desiredCapabilities = new DesiredCapabilities();\n String[] phantomArgs = new String[]{\n \"--webdriver-loglevel=\"\n + Resources.base().webDriverLogLevel()\n };\n desiredCapabilities\n .setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS,\n phantomArgs);\n desiredCapabilities.setCapability(\n \"phantomjs.page.customHeaders.Accept-Language\",\n getSystemLanguage());\n PhantomJSDriver phantomJSDriver = new PhantomJSDriver(\n desiredCapabilities);\n phantomJSDriver.manage().window().maximize();\n return phantomJSDriver;\n }", "@Test\n public void test(){\n\n\n FirefoxProfile profile = new FirefoxProfile();\n // profile.EnableNativeEvents = true;\n\n WebDriver driver = new FirefoxDriver(profile);\n driver.get(\"http://www.baidu.com\");\n }", "public void checkStatusWithPhantomJS() throws TechnicalException {\n\t\t PhantomJSDriver driver=null;\n\t\t String baseUrl;\n\t\t StringBuffer verificationErrors = new StringBuffer();\n\t\ttry {\n\t\t\tDesiredCapabilities caps = new DesiredCapabilities();\n\t\t\tcaps.setCapability(\"phantomjs.binary.path\", statusProperties.getPhantom_path());\n\t\t\tdriver = new PhantomJSDriver(caps);\n\t\t\tbaseUrl = statusProperties.getInter_pbl_url();\n\t\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t\t\t//Connection \n\t\t\tdriver.get(baseUrl);\n\t\t\t//specific login for developement environement\n\t\t\tif (driver.getTitle().equals(pblinkProperties.getIndex_title())) {\n\t\t\t\tdriver.findElement(By.cssSelector(\"input[type=\\\"image\\\"]\")).click();\n\t\t\t}else{\n\t\t\t\t//UAt environnement\n\t\t\t\tif (driver.getTitle().equals(pblinkProperties.getSso_title())) {\n\t\t\t\t\t//get ther form\n\t\t\t\t\tlogInSSO(driver, baseUrl);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//check Iframe menu\n\t\t\tcheckScnarioUserListe(driver);\n\t\t} catch (Exception exp) {\n\t\t\tTechnicalException techExp = new TechnicalException(exp);\n\t\t\tif(logger.isErrorEnabled())\n\t\t\t\tlogger.error(techExp.getStrstackTrace());\n\t\t\tthrow techExp; \n\t\t}\n\t\tfinally{\n\t\t\tif (driver !=null)\n\t\t\tdriver.quit();\n\t\t\tString verificationErrorString = verificationErrors.toString();\n\t\t\tif (!\"\".equals(verificationErrorString)) {\n\t\t\t\tif(logger.isErrorEnabled())\n\t\t\t\t\tlogger.error(\"ERROR : there are some verifications errors : \"+verificationErrorString);\n\t\t\t\tthrow new TechnicalException(\"ERROR : PBL Internet checking/there are some verifications errors with phantom driver : \"+verificationErrorString);\n\t\t\t}\n\t\t}\n\t}", "@BeforeClass\n\tpublic void openFirefoxBrowser(){\n\t\tdriver = new FirefoxDriver();\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t//wait = new WebDriverWait(driver,5);\n\t}", "public static void main(String[] args) {\nWebDriver driver = new FirefoxDriver();\nSystem.out.println(\"hai\");\ndriver.get(\"https://www.google.com\");\nSystem.out.println(driver.getTitle());\ndriver.close();\n\t}", "@BeforeTest\r\n\tpublic void operBrowser(){\n\t\td1=Driver.getBrowser();\r\n\t\tWebDriverCommonLib wlib=new WebDriverCommonLib();\r\n\t\td1.get(Constant.url);\r\n\t\twlib.maximizeBrowse();\r\n\t\twlib.WaitPageToLoad();\r\n\t}", "@Before\n public void start(){\n DesiredCapabilities caps = new DesiredCapabilities();\n driver = new FirefoxDriver(new FirefoxBinary(new File(\"C:\\\\Program Files (x86)\\\\Nightly\\\\firefox.exe\")), new FirefoxProfile(), caps);\n wait = new WebDriverWait(driver, 10);\n\n //IE\n// DesiredCapabilities caps = new DesiredCapabilities();\n// caps.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);\n// WebDriver driver = new InternetExplorerDriver(caps);\n\n\n }", "@Test \n public void executeSessionTwo(){\n System.out.println(\"open the browser: FIREFOX \");\n final String GECKO_DRIVER_DIRECTORY = System.getProperty(\"user.dir\") + \"/src/test/java/BrowserDrivers/geckodriver.exe\";\n System.setProperty(\"webdriver.gecko.driver\", GECKO_DRIVER_DIRECTORY);\n final WebDriver driver = new FirefoxDriver();\n //Goto guru99 site\n driver.get(\"http://demo.guru99.com/V4/\");\n //find user name text box and fill it\n driver.quit();\n }", "public WebDriver login() {\r\n System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\sa841\\\\Documents\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n //System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\sa841\\\\Documents\\\\chromedriver_win32\\\\phantomjs.exe\");\r\n String URL = \"http://Admin:[email protected]:8080/phenotips123/bin/loginsubmit/XWiki/XWikiLogin/\";\r\n ChromeOptions options = new ChromeOptions();\r\n options.addArguments(\"window-size=1024,768\");\r\n DesiredCapabilities capabilities = DesiredCapabilities.chrome();\r\n capabilities.setCapability(ChromeOptions.CAPABILITY, options);\r\n WebDriver driver = new ChromeDriver(capabilities);\r\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n //WebDriver driver = new PhantomJS();\r\n driver.get(URL);\r\n driver.findElement(By.id(\"j_username\")).sendKeys(\"Admin\");\r\n driver.findElement(By.id(\"j_password\")).sendKeys(\"admin\");\r\n driver.findElement(By.className(\"button\")).click();\r\n return driver;\r\n }", "public static void main(String[] args) throws InterruptedException {\nWebDriver driver=new FirefoxDriver();\ndriver.get(\"file:/// C:/Users/viprava/Desktop/sample1.html\");\n//driver.findElement(By.id(\"/n\")).click();\n//Thread.sleep(2000);\n//driver.navigate().back();\nThread.sleep(2000);\ndriver.findElement(By.name(\"uname\")).click();\nThread.sleep(2000);\ndriver.navigate().back();\nThread.sleep(2000);\ndriver.findElement(By.className(\"abc\")).click();\nThread.sleep(2000);\ndriver.navigate().back();\nThread.sleep(2000);\ndriver.close();\n\t}", "@Test\r\n\tpublic void launch_browser()\r\n\t{ \r\n\t\t\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C://TESTING TOOLS - SOFTWARES/chromedriver.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\tdriver.get(\"https://www.javatpoint.com/\");\r\n\t\t// remove all cookies\r\n\t\t//driver.manage().deleteAllCookies();\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\t\r\n\t}", "public static void setup(String browser) throws Exception{\n if(browser.equalsIgnoreCase(\"firefox\")){\n \tFile pathToBinary = new File(\"C:\\\\Program Files (x86)\\\\Mozilla Firefox 41\\\\firefox.exe\");\n \tFirefoxBinary binary = new FirefoxBinary(pathToBinary);\n \tFirefoxDriver driver = new FirefoxDriver(binary, new FirefoxProfile());\n \t\n \t//System.setProperty(\"webdriver.firefox.driver\",\"C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\firefox.exe\");\n \t/*DesiredCapabilities capabilies = DesiredCapabilities.firefox();\t\t\t\n capabilies.getBrowserName();\n capabilies.getVersion();*/\n \t\t\t\n \t//create Firefox instance\t \n //driver = new FirefoxDriver(); \n System.out.println(\"Browser Used: \"+browser);\n }\t \n //Check if parameter passed is 'Chrome'\n // https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html\n // http://www.programcreek.com/java-api-examples/index.php?api=org.openqa.selenium.remote.DesiredCapabilities (Singleton)\n else if(browser.equalsIgnoreCase(\"chrome\")){\t \t \n System.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n ChromeOptions opt = new ChromeOptions();\n opt.setBinary(\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n opt.setExperimentalOption(\"Browser\", \"Chrome\");\n opt.getExperimentalOption(\"version\");\n \n// DesiredCapabilities capabilies = DesiredCapabilities.chrome();\n// capabilies.setBrowserName(\"chrome\");\n// capabilies.setPlatform(Platform.WINDOWS);\n// capabilies.setVersion(\"38\");\n// DesiredCapabilities capabilities = new DesiredCapabilities();\n \n //Create Chrome instance\n driver = new ChromeDriver(opt);\t \n }\n \n //Check if parameter passed is 'Safari'\t\n else if(browser.equalsIgnoreCase(\"safari\")){\t \t \n \tSystem.setProperty(\"webdriver.safari.driver\",\"C:/safaridriver.exe\");\n \t\n \t//System.setProperty(\"webdriver.safari.noinstall\", \"true\");\n \tdriver = new SafariDriver();\n \t\n /*\tSafariOptions options = new SafariOptions();\n \tSafariDriver driver = new SafariDriver(options);\n \tDesiredCapabilities capabilities = DesiredCapabilities.safari();\n \tcapabilities.setCapability(SafariOptions.CAPABILITY, options);*/\n }\n \n //Check if parameter passed is 'IE'\t \n else if(browser.equalsIgnoreCase(\"ie\")){\n \t//String IE32 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_32.exe\"; //IE 32 bit\n\t\t\tString IE64 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_64.exe\"; //IE 64 bit\n \tSystem.setProperty(\"webdriver.ie.driver\",IE64);\n \t\n /* \tDesiredCapabilities capabilies = DesiredCapabilities.internetExplorer();\n \tcapabilies.setBrowserName(\"ie\");\n capabilies.getBrowserName();\n capabilies.getPlatform();\n capabilies.getVersion();*/\n \n \t//Create IE instance\n \tdriver = new InternetExplorerDriver();\n }\t \n else{\t \n //If no browser passed throw exception\t \n throw new Exception(\"Browser is not correct\");\t \n }\t \n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\n\t}", "@BeforeTest\n\tpublic void openBrowser(){\n\t\t//initializing the firefox driver\n\t\tdriver =new FirefoxDriver();\n\t\t// accessing the webpage\n\t\tdriver.get(\"https://platform-stag.systran.net\");\n\t\t//setting the windows size in 1920*1080\n\t\tdriver.manage().window().setSize(new Dimension(1920,1080));\n\n\t\t// the imperative wait \n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n\t\t//accessing the from page of the webpage and clicking in the sign in button\n\t\tLocatorsInFrontPage locatorinfront=PageFactory.initElements(driver, LocatorsInFrontPage.class);\n\t\tlocatorinfront.signIn.click();\n\t\t// accessing the pop up sign in and choosing the log in with systran\t\n\t\tLocatorsInSigninPopUp signinpopup=PageFactory.initElements(driver, LocatorsInSigninPopUp.class);\n\t\tsigninpopup.continueWithSystran.click();\n\n\t\t// locating the username and password filling form\n\t\tLocatorsInSignInaccount locatorinSignIn=PageFactory.initElements(driver, LocatorsInSignInaccount.class);\n\t\tlocatorinSignIn.userName.sendKeys(\"[email protected]\");\n\t\tlocatorinSignIn.password.sendKeys(\"SESpassword\");\n\t\tlocatorinSignIn.signIn.click();\n\n\n\t}", "@Before\n public void setUp() throws Exception {\n\t //driver = WebDriverFactory.getDriver(DesiredCapabilities.firefox());\n\t driver = new FirefoxDriver();\n baseUrl = \"https://my.roboforex.com/\";\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n }", "@Test\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tFile src = new File(\"C://PhantonJs//bin//phantomjs//bin//phantomjs.exe\");\n\t\tSystem.setProperty(\"phantomjs.binary.path\",src.getAbsolutePath());\n\t\tWebDriver driver = new PhantomJSDriver();\n\t\tdriver.get(\"https://www.linkedin.com\");\n\t\tSystem.out.println(\"Opening Application URL\");\n\t WebElement element=driver.findElement(By.xpath(\"//input[@name='session_key']\"));\n\t\telement.sendKeys(\"****\");\n\t\tSystem.out.println(\"login ID opened\");\n\t\tWebElement element2=driver.findElement(By.xpath(\"//input[@name='session_password']\"));\n\t\telement2.sendKeys(\"****\");\n\t\tdriver.findElement(By.xpath(\"//input[@class='login submit-button']\")).click();\n\t\tSystem.out.println(\"login sucess\");\n\t\tFile scrFile=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\tFileUtils.copyFile(scrFile,new File(\"E:\\\\link.jpg\"),true);\n\t}", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.firefox.bin\", \"C:\\\\Program Files\\\\Nightly\\\\firefox.exe\");\n\t\tSystem.setProperty(\"webdriver.gecko.driver\", \"G:\\\\WebUITests\\\\src\\\\test\\\\resources\\\\Drivers\\\\geckodriver.exe\");\n\t\t//System.setProperty(\"webdriver.gecko.driver\", \"G:\\\\geckodriver-v0.18.0-win64\\\\geckodriver.exe\");\n\t\t\n\t\tDesiredCapabilities capabilities=DesiredCapabilities.firefox();\n\t\tcapabilities.setCapability(\"marionette\", true);\n\t\tWebDriver driver = new FirefoxDriver(capabilities);\n\t\t//driver.navigate().to(\"http://www.google.com\");\n\t\tdriver.get(\"http://www.google.com\");\n\t\tdriver.quit();\n\t}", "@Before\n public void setup() {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(FirefoxDriver.MARIONETTE, false); // new schema disable\n webdriver = new FirefoxDriver(caps);\n wait = new WebDriverWait(webdriver, 10);\n\n }", "public static void main(String[] args) {\nSystem.setProperty(\"webdriver.gecko.driver\", \"C:\\\\Users\\\\v-poori\\\\Desktop\\\\selenium\\\\geckodriver-v0.11.1-win64\\\\geckodriver.exe\");\n\tdriver = new FirefoxDriver();\n\tdriver.manage().window().maximize();\n\n\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\t\n\tdriver.get(\"https://www.google.co.in/\");\n\t}", "@Test\n\tpublic void TC_01_Run_On_Firefox() {\n\t\tdriver = new FirefoxDriver();\n\t\t\n\t\t//(>=48) lastest version \n\t\t//System.setProperty(\"webdriver.gecko.driver\",\"//geckodriver_path\");\n\t\t//driver = new FirefoxDriver();\n\t\t\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t\tdriver.get(\"http://demo.guru99.com/v4/\");\n\t\tdriver.quit();\n\n\t}", "@Test\npublic void TestMarketWatch() throws InterruptedException {\nSystem.setProperty(\"webdriver.firefox.bin\",\"/Users/jasonsouryamath/Desktop/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin\");\ndriver = new FirefoxDriver();\ndriver.get(\"http://www.marketwatch.com/\");\nThread.sleep(2000);\n((JavascriptExecutor)driver).executeScript(\"scroll(0,1000)\");\nnew WebDriverWait(driver,10).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(\"#f72ae3716b0373a474b6898d41a29e1a9158244d > li:nth-child(3) > div:nth-child(1) > div:nth-child(2) > h3:nth-child(1) > a:nth-child(1)\"))).click();\n((JavascriptExecutor)driver).executeScript(\"scroll(0,1200)\");\n}", "@Test\n public void testBrowser() {\n driver.get(BASE_URL);\n assertEquals(\"My AngularJS App\", driver.getTitle());\n }", "@Override\n public List<DesiredCapabilities> getBrowsersToTest() {\n return getBrowsersExcludingPhantomJS();\n }", "public static void main(String[] args) {\nString browser=\"ff\";\nif (browser.equals(\"chrome\")) {\n\tWebDriverManager.chromedriver().setup();\n\t// System.setProperty(\"webdriver.chrome.driver\", \"/Users/user/Downloads/chromedriver\");\n\tdriver=new ChromeDriver();\n}\nelse if (browser.equals(\"ff\")) {\n\tWebDriverManager.firefoxdriver().setup();\n\tdriver=new FirefoxDriver();\n}\nelse\n\tif (browser.equals(\"IE\")) {\n\t\tWebDriverManager.iedriver().setup();\n\t\tdriver=new InternetExplorerDriver();\n\t}\n\telse\n\t\tif (browser.equals(\"opera\")) {\n\t\t\tWebDriverManager.operadriver().setup();\n\t\t\tdriver=new OperaDriver();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"no defined driver\");\n\t\t}\n\n\ndriver.get(\"https://google.com\");\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\t}", "@Test\n public void test1() {\n FirefoxBinary binary =\n new FirefoxBinary(new File(FIREFOX_PATH));\n driver = TestBench.createDriver(\n new FirefoxDriver(binary, new FirefoxProfile()));\n setDriver(driver);\n getDriver().get(URL);\n ButtonElement button = $(ButtonElement.class).first();\n button.click();\n LabelElement label = $(LabelElement.class).id(\"result\");\n\n Assert.assertEquals(\"Thanks , it works!\",label.getText());\n driver.quit();\n }", "private static WebDriver getFirefoxriver() {\n\t\treturn null;\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 }", "@Test\n public void test() throws MalformedURLException {\n System.setProperty(\"webdriver.chrome.driver\",System.getProperty(\"user.dir\")+\"\\\\drivers\\\\chromedriver.exe\"); \n WebDriver driver=new ChromeDriver();\n // WebDriver driver=new RemoteWebDriver(url,cap);\n driver.manage().window().maximize(); \n driver.get(\"https://curiedoctorapp.firebaseapp.com\");\n System.out.println(\"The title is\"+ driver.getTitle());\n driver.quit();\n \n }", "@Given(\"I open a browser and launch the application\")\n public void open_a_browser_and_launch_the_application() throws MalformedURLException\n {\n try {\n if(System.getProperty(\"exemode\").equals(\"remote\")) {\n if(System.getProperty(\"browser\").equals(\"firefox\")){\n System.setProperty(\"webdriver.gecko.driver\", \"./drivers/geckodriver\");\n DesiredCapabilities dc = DesiredCapabilities.firefox();\n dc.setBrowserName(\"firefox\");\n dc.setPlatform(Platform.LINUX);\n driver = new RemoteWebDriver(new URL(UtilConstants.ENDPOINT_SELENIUM_HUB), dc);\n }\n else if(System.getProperty(\"browser\").equals(\"chrome\")){\n System.setProperty(\"webdriver.chrome.driver\", \"./drivers/chromedriver\");\n DesiredCapabilities dc = DesiredCapabilities.chrome();\n dc.setBrowserName(\"chrome\");\n dc.setPlatform(Platform.LINUX);\n driver = new RemoteWebDriver(new URL(UtilConstants.ENDPOINT_SELENIUM_HUB), dc);\n }\n }\n else{\n if(System.getProperty(\"browser\").equals(\"firefox\")){\n System.setProperty(\"webdriver.gecko.driver\", \"./drivers/geckodriver\");\n driver = new FirefoxDriver();\n }\n else if(System.getProperty(\"browser\").equals(\"chrome\")){\n System.setProperty(\"webdriver.chrome.driver\", \"./drivers/chromedriver\");\n driver = new ChromeDriver();\n }\n }\n\n if(driver!=null){\n driver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n //driver.manage().timeouts().pageLoadTimeout(5, TimeUnit.SECONDS);\n driver.get(ENDPOINT_PHPTRAVELS);\n }\n }\n catch(Exception e){\n e.printStackTrace();\n// System.exit(1);\n }\n }", "private void initFirefoxDriver(String appUrl) {\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"Drivers\\\\geckodriver.exe\");\n\t\tdriver = new FirefoxDriver();\n\t\tdriver.get(appUrl);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t\n\t}", "@Test \n public void executSessionOne(){\n\t System.out.println(\"open the browser: chrome\");\n final String CHROME_DRIVER_DIRECTORY = System.getProperty(\"user.dir\") + \"/src/test/java/BrowserDrivers/chromedriver.exe\";\n System.setProperty(\"webdriver.chrome.driver\", CHROME_DRIVER_DIRECTORY);\n final WebDriver driver = new ChromeDriver();\n //Goto guru99 site\n driver.get(\"http://demo.guru99.com/V4/\");\n //find user name text box and fill it\n driver.quit();\n }", "@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}", "public static void main(String[] args) throws InterruptedException {\n WebDriverManager.chromedriver().setup();\n ChromeDriver driver = new ChromeDriver(); // ChromeDriver is a reference type\n //RemoteWebDriver driver = new SafariDriver();\n //RemoteWebDriver driver = new ChromeDriver();\n //RemoteWebDriver driver = new InternetExplorerDriver(); //RemoteWebDriver is the parent of webdrivers\n //They all inherited RemoteWebDriver. It is called polymorphism\n\n //In selenium, everything starts from Webdriver interface\n //If I want to open a web page I just call this driver and I use methods from the driver\n //here we used get() method. Every single script always start with get() method.\n //It is like key to open the door. Get will open website first\n driver.get(\"http://google.com\");\n driver.manage().window().maximize(); //to maximize the browser\n //driver.manage().window().fullscreen();\n\n Thread.sleep(3000); //for demo, wait 3 seconds. If you use this add throws declaration. This is why we used throws InterruptedException\n\n //method that returns page title. You can also see it as tab name, in the browser\n String title = driver.getTitle(); //returns <title>Some title</title> text. It is actual title\n String expectedTitle = \"Google\"; //It is expected title\n System.out.println(\"Title is...\"+ title);\n\n if (expectedTitle.equalsIgnoreCase(title)){ //expected title is equal to actual title\n System.out.println(\"TEST PASSED!\");\n }else {\n System.out.println(\"TEST FAILED\");\n }\n\n //go to another website within the same window\n driver.navigate().to(\"http://amazon.com\");\n //amazon has long title so we just used contain method not equals\n if (driver.getTitle().toLowerCase().contains(\"amazon\")){\n System.out.println(\"TEST PASSED!\");\n }else {\n System.out.println(\"TEST FAILED!\");\n }\n\n //comeback to google. Instead of writing if statement,line 32, we can write this method\n driver.navigate().back();\n Thread.sleep(3000); //adding 3 sec between the navigating Google to Amazon\n verifyEquals(driver.getTitle(), \"Google\"); //calling verifyEquals method, line 55, checking if page title is equals to Google\n\n //move forward in the browser history, again going to amazon\n driver.navigate().forward();\n Thread.sleep(3000);\n\n System.out.println(\"Title: \"+driver.getTitle()); //Title is a String\n System.out.println(\"URL: \"+ driver.getCurrentUrl()); // to get URL, URL is a String\n\n driver.navigate().refresh(); //to reload page\n Thread.sleep(3000);\n //must be at the end\n driver.close(); //to close browser\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 static void main(String[] args) throws InterruptedException {\nFirefoxDriver driver=new FirefoxDriver();\r\nThread.sleep(5000);\r\ndriver.get(\"http://newtours.demoaut.com\");\r\ndriver.findElement(By.linkText(\"REGISTER\")).click();\r\nThread.sleep(5000);\r\nfor(int i=0;i<20;i++)\r\n{\r\n\t\r\n\r\ndriver.findElement(By.name(\"firstName\")).sendKeys(\"JOhn\");\r\n\r\ndriver.findElement(By.name(\"phone\")).sendKeys(\"1234\");\r\ndriver.findElement(By.name(\"userName\")).sendKeys(\"[email protected]\");\r\ndriver.findElement(By.name(\"address1\")).sendKeys(\"abc\");\r\ndriver.findElement(By.name(\"address2\")).sendKeys(\"123\");\r\ndriver.findElement(By.name(\"city\")).sendKeys(\"hyd\");\r\ndriver.findElement(By.name(\"state\")).sendKeys(\"tel\");\r\ndriver.findElement(By.name(\"postalCode\")).sendKeys(\"500089\");\r\ndriver.findElement(By.name(\"country\")).sendKeys(\"INDIA\");\r\ndriver.findElement(By.name(\"email\")).sendKeys(\"xyz\");\r\ndriver.findElement(By.name(\"password\")).sendKeys(\"nb78\");\r\ndriver.findElement(By.name(\"confirmPassword\")).sendKeys(\"nb78\");\r\nThread.sleep(5000);\r\ndriver.findElement(By.name(\"register\")).click();\r\nThread.sleep(5000);\r\ndriver.navigate().back();\r\n\t}\r\n\t}", "public static void main(String[] args) {\n\t\tWebDriverManager.firefoxdriver().setup();\r\n\t\tWebDriver driver = new FirefoxDriver();\r\n\t\t//driver.navigate().to(\"https://www.facebook.com/\");\r\n\r\n\t}", "@Given(\"^Launch the page$\")\r\n\tpublic void launch_the_page() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"./driver/chromedrivernew.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\tdriver.get(\"http://realestate.upskills.in\");\r\n\t \t}", "@BeforeTest\n\tpublic void LaunchBrowser() {\n\t\t driver = init(\"URL_JQuery\");\n\t\t// driver.get(\"https://jqueryui.com/autocomplete/\");\n\t\t driver.switchTo().frame(0);\n\t\t jq = new JQueryAutocompletePage(driver);\n\t\t \n\t}", "public FirefoxDriver openBrowser(String site){\n System.setProperty(\"webdriver.gecko.driver\", \"c:\\\\Utils\\\\geckodriver.exe\");\n FirefoxDriver browser = new FirefoxDriver();\n browser.get(site);\n return browser;\n }", "public static void main(String[] args) {\n\t\tWebDriverManager.chromedriver().setup(); //boni garcia\r\n\t\t//WebDriverManager.firefoxdriver().setup();\r\n\t\t//for firefox use firefox word instead of chrome in chromederiver \r\n\t\t//note:selenium do not allow to access already opened browser or manually opened browser\r\n\t\t// step 1: launch a chrome browser (selenium)\r\n\t\t//call chromederiver class with any objectname here we used driver\r\n\t\tChromeDriver driver = new ChromeDriver();\r\n\t\t//FirefoxDriver driver = new FirefoxDriver();\r\n\t\t//step 2: load a url (get method---objname.get(driver.get)\r\n\t\tdriver.get(\"http://leaftaps.com/opentaps\");\r\n\t\t// step 3: get the title use gettitle method\r\n\t\tString title = driver.getTitle();\r\nSystem.out.println(title);\r\n//step 4: maximize the browser\r\ndriver.manage().window().maximize();\r\n//to close the window\r\n//driver.close();\r\ndriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\nWebElement webUser = driver.findElement(By.id(\"username\")); //locate id\r\nwebUser.sendKeys(\"demosalesmanager\");\r\ndriver.findElement(By.id(\"password\")).sendKeys(\"crmsfa\"); //locate id\r\ndriver.findElement(By.className(\"decorativeSubmit\")).click();//locate classname\r\ndriver.findElement(By.linkText(\"CRM/SFA\")).click();\r\n//verify if correctly landed on home page\r\nString frontTitle = \"My Home | opentaps CRM\";\r\nString homeTitle = driver.getTitle();\r\nif(frontTitle.equals(homeTitle)) {\r\n\tSystem.out.println(\"in the home page\");\r\n}\r\nelse\r\nSystem.out.println(\"not in the home page\"); \r\n//driver.findElement(By.linkText(\"http://leaftaps.com/crmsfa/control/leadsMain\")).click();\r\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}", "@BeforeClass\r\n\tpublic void browser() {\r\n\tdriver = new FirefoxDriver();\r\n\t}", "@Test\n public void test () throws InterruptedException \n {\n JavascriptExecutor javascript = (JavascriptExecutor) driver;\n javascript.executeScript(\"alert('Test Case Execution Is started Now..');\");\n Thread.sleep(2000);\n driver.switchTo().alert().accept();\n }", "public void setUpDriver(final String browser) throws MalformedURLException{\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString gridUrl=System.getProperty(\"gridurl\");\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//check if parameter passed from TestNg is 'firefox'\r\n\t\t\r\n//\t\tif (BrowserLib.FIREFOX.equalsIgnoreCase(browser)){\r\n//\t\t DesiredCapabilities capabilities =DesiredCapabilities.firefox();\r\n//\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n//\t\t if(StringUtils.isNotEmpty(gridUrl)){\r\n//\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n//\t\t }\r\n//\t\t else{\r\n//\t\t\t driver =new FirefoxDriver(capabilities);\r\n//\t\t }\r\n\t\t \r\n\t\t\r\n\t\tif(BrowserLib.FIREFOX.equalsIgnoreCase(browser)){\r\n\t\t\t\r\n\t\t\t DesiredCapabilities capabilities =DesiredCapabilities.firefox();\r\n//\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n\t\t\t \r\n\t\t\t final String firebugpath1=\"src//main//resource//firepath-0.9.7.1-fx.xpi\";\r\n\t\t\t final String firebugpath =\"src//main//resource//firebug-1.12.8.xpi\";\r\n\t\t\t FirefoxProfile profile=new FirefoxProfile();\r\n//\t\t System.setProperty(\"webdriver.firefox.driver\", \"C:\\\\Program Files\\\\MozillaFirefox\\\\firefox.exe\");\r\n\r\n\t\t\t \r\n\t\t\t try{\r\n\t\t\t\t profile.addExtension(new File(firebugpath));\r\n\t\t\t\t profile.addExtension(new File(firebugpath1));\t \r\n\t\t\t }catch (IOException e){\r\n\t\t\t\t logger.error(\"Exception:\",e);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t profile.setPreference(\"extensions.firebug.allpagesActivation\", \"on\");\r\n//\t\t\t capabilities.setCapability(FirefoxDriver.PROFILE,profile);\r\n\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n\t\t\t System.setProperty(\"webdriver.firefox.driver\", \"C:\\\\Program Files\\\\MozillaFirefox\\\\firefox.exe\");\r\n\t\t\t //if (StringUtils.isNotEmpty(gridUrl)){\r\n\t\t\t if(gridUrl==null){\r\n\t\t\t\t driver =new FirefoxDriver(capabilities); \r\n \t\t\t \r\n\t\t\t }else{\r\n\t\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n\t\t\t }\r\n\t\t}else if(BrowserLib.CHROME.equalsIgnoreCase(browser)){\r\n\t\t\t DesiredCapabilities capabilities =DesiredCapabilities.chrome();\r\n\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n\t\t\t if(gridUrl==null){\r\n\t\t\t\t driver =new ChromeDriver();\t \r\n\t\t\t }else{\r\n\t\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t \r\n\t\t}else if(BrowserLib.INTERNET_EXP.equalsIgnoreCase(browser)){\r\n//\t\t\tset path to iedriver.exe you may need to download it from 32 bits\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.setProperty(\"webDriver.ie.driver\", System.getProperty(\"user.dir\")+\"/src/main/resource/\"+ \"IEDriverserver.exe\");\r\n//\t\t\t create ie instance\r\n\t\t\t DesiredCapabilities capabilities =DesiredCapabilities.internetExplorer();\r\n\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n//\t\t\t if (StringUtils.isNotEmpty(gridUrl)){\r\n// \t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n//\t\t\t }else{\r\n//\t\t\t\t driver =new FirefoxDriver(capabilities); \r\n//\t\t\t }\r\n\t\t\t if(gridUrl.isEmpty()){\r\n\t\t\t\t driver =new InternetExplorerDriver(capabilities); \r\n \t\t\t \r\n\t\t\t }else{\r\n\t\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t}else{\r\n//\t\t\tif no browser passed throw exception\r\n\t\t\tthrow new UnsupportBrowserException();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tthis.driver.manage().deleteAllCookies();\r\n\t\tthis.browserMaximize();\r\n\t\tthis.driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t\r\n\t}", "@BeforeMethod\n public void beforeMethod() {\n System.setProperty(\"webdriver.chrome.driver\",\n \"./src/test/resources/drivers/chromedriver\");\n System.setProperty(\"webdriver.gecko.driver\",\n \"./src/test/resources/drivers/geckodriver\");\n System.setProperty(\"webdriver.opera.driver\",\n \"./src/test/resources/drivers/operadriver\");\n\n // Initialize new WebDriver session\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setHeadless(false);\n\n driver = new ChromeDriver(chromeOptions);\n\n FirefoxOptions firefoxOptions = new FirefoxOptions();\n firefoxOptions.setHeadless(false);\n\n// driver = new FirefoxDriver(firefoxOptions);\n// driver = new SafariDriver();\n// driver = new OperaDriver();\n\n // Maximize browser window\n driver.manage().window().maximize();\n\n // Take screenshot of the web page and save it to a file\n// File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n// FileUtils.copyFile(scrFile, new File(\"./target/screenshot.png\"));\n }", "@BeforeMethod\r\n public void setUp() {\n WebDriver driver = new FirefoxDriver();\r\n driver.get(\"http://selenium.polteq.com/testshop/index.php\");\r\n }", "public static void main(String[] args) throws Exception {\n\t\tWebDriver driver=new FirefoxDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\t// open website\r\n\t\tdriver.get(\"https://adminfrontend.b2b-staging.thebestagent.pro/\");\r\n\t\tThread.sleep(2500);\r\n\r\n\t\t// log in\r\n\t driver.findElement(By.id(\"login-email\")).sendKeys(\"[email protected]\");\r\n\t driver.findElement(By.id(\"login-password\")).sendKeys(\"cba321\");\r\n\t\tdriver.findElement(By.cssSelector(\".auth__login .button\")).click();\r\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t\t// open Agencies page\r\n\t\tdriver.findElement(By.linkText(\"Agencies\")).click();\r\n\t\tThread.sleep(1500);\r\n\t\t\r\n\t\t// looking for the ticketing fee preset link and clicking it\r\n\t driver.findElement(By.xpath(\"/html/body/div[2]/section[2]/div/div/table/tbody/tr[2]/td[2]/span/a\")).click();\r\n\t Thread.sleep(2500);\r\n\t \r\n\t\t// Looking for H1 \"Rules\" when clicked link page is opened\r\n\t\ttry {\r\n\t\t\tWebDriverWait h1title = new WebDriverWait(driver,3);\r\n\t\t\th1title.until(ExpectedConditions.textToBePresentInElementLocated(By.className(\"Index__title\"), \"Rules\"));\r\n\t\t\tSystem.out.println(\"H1 title 'Rules' found. As expected. PASS\");\r\n\t\t\t}\r\n\t\t \r\n\t\t catch(Exception fieldname) {\r\n\t\t\t System.out.println(\"H1 title not found. FAIL\");\r\n\t\t }\r\n\r\n\t // Following code captures the screenshot and place it in specified location\r\n\t TakesScreenshot ts = (TakesScreenshot)driver;\r\n\t\tFile scrFile = ts.getScreenshotAs(OutputType.FILE);\r\n\t\t\r\n\t\tString desiredName = \"D:/AlexP/Trash/TicketingFeeNameAsLinkOpensFeePage.png\";\r\n\t\tFile dstFile = new File(desiredName);\r\n\t int i = 0;\r\n\t\twhile (dstFile.exists ()) {\r\n\t\t i += 1;\r\n\t\t desiredName = \"D:/AlexP/Trash/TicketingFeeNameAsLinkOpensFeePage(\" + i + \").png\";\r\n\t\t dstFile = new File(desiredName);\r\n\t\t \r\n\t\t \t}\r\n\t\tSystem.out.println(\"Screenshot is taken, please check the folder D:/AlexP/Trash/\");\r\n\t\tFiles.copy(scrFile, dstFile); \r\n\t \r\n }", "private void setFirefoxDriver() throws Exception {\n\t\t// Disable cache\n\t\tffProfile.setPreference(\"browser.cache.disk.enable\", false);\n\t\tffProfile.setPreference(\"browser.cache.disk_cache_ssl\", false);\n\t\tffProfile.setPreference(\"browser.cache.memory.enable\", false);\n\t\tffProfile.setPreference(\"browser.cache.offline.enable\", false);\n\t\t// Set to download automatically\n\t\tffProfile.setPreference(\"browser.download.folderList\", 2);\n\t\tffProfile.setPreference(\"browser.download.manager.showWhenStarting\", false);\n\t\tffProfile.setPreference(\"browser.helperApps.neverAsk.saveToDisk\", \"application/zip\");\n\t\tffProfile.setPreference(\"browser.download.dir\", BasePage.myTempDownloadsFolder);// \"\\\\temp_downloads\");\n\t\t// TODO: Using \"C:\" will not work for Linux or OS X support\n\t\tFile dir = new File(BasePage.myTempDownloadsFolder);// \"\\\\temp_downloads\");\n\t\tif (!dir.exists()) {\n\t\t\tdir.mkdir();\n\t\t}\n\t\t// Disable hardware acceleration\n\t\tffProfile.setPreference(\"gfx.direct2d.disabled\", false);\n\t\tffProfile.setPreference(\"layers.acceleration.disabled\", false);\n\t\tFirefoxOptions ffOptions = new FirefoxOptions();\n\n\t\t/*\n\t\t * Set FF to run headless -- Need to make conditional from browser\n\t\t * parameter -- Does NOT work properly with all necessary tests.\n\t\t */\n\t\t// ffOptions.setHeadless(true);\n\n\t\tffOptions.setProfile(ffProfile);\n\t\tcapabilities = DesiredCapabilities.firefox();\n\t\tcapabilities.setCapability(FirefoxDriver.PROFILE, ffProfile);\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.gecko.driver\", firefoxDriverLocation);\n\t\t\tmyDriver = new FirefoxDriver(ffOptions);\n\t\t\tbreak;\n\t\tcase \"grid\":\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), ffOptions);\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 = defaultFirefoxVersion;\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), ffOptions);\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 = defaultFirefoxVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\t//capabilities.setCapability(\"name\", testMethod.get());\n\t\t\tcapabilities.setCapability(\"build\", testProperties.getString(TEST_ENV)+\" FF-\"+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\tmyDriver = new FirefoxDriver(ffOptions);\n\t\t\tbreak;\n\t\t}\n\t\tdriver.set(myDriver);\n\t}", "@Given(\"I am on the jquery homepage\")\n public void i_am_on_the_jquery_homepage() {\n System.out.println(\"inside given\");\n // baseUrl= \"https://jqueryui.com/\";\n driver= DriverMgr.getDriver();\n jQueryHPage= new JQueryHPage(driver);\n datePickerPage= new DatePickerPage(driver);\n// driver.manage().window().maximize();---> moved to @Before hook\n// driver.get(baseUrl);---> moved to @Before hook\n }", "@Test \n public void executSessionThree(){\n System.out.println(\"open the browser: chrome III\");\n final String CHROME_DRIVER_DIRECTORY = System.getProperty(\"user.dir\") + \"/src/test/java/BrowserDrivers/chromedriver.exe\";\n System.setProperty(\"webdriver.chrome.driver\", CHROME_DRIVER_DIRECTORY);\n final WebDriver driver = new ChromeDriver();\n //Goto guru99 site\n driver.get(\"http://demo.guru99.com/V4/\");\n //find user name text box and fill it\n driver.quit();\n }", "public static WebDriver firefox()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",System.getProperty(\"user.dir\")+\"\\\\Gecko\\\\geckodriver.exe\");\r\n\t\tgk = new FirefoxDriver();\r\n\t\treturn gk;\r\n\t}", "@BeforeTest\n\tpublic void beforeTest() {\n\t\t\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\".\\\\lib\\\\geckodriver.exe\");\n\t\tdriver = new FirefoxDriver(); \n//\t\tSystem.setProperty(\"webdriver.ie.driver\",\".\\\\lib\\\\IEDriverServer.exe\");\n//\t\tdriver = new InternetExplorerDriver();\n\t\t\n//\t\tSystem.setProperty(\"webdriver.chrome.driver\",\".\\\\lib\\\\chromedriver.exe\");\n//\t\tdriver = new ChromeDriver();\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t\tdriver.manage().window().maximize();\n\t}", "@BeforeTest\n\tpublic void OpenBrowser() throws InterruptedException {\n\t\t\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\PSQA\\\\Desktop\\\\driver\\\\chromedriver.exe\");\n\t\tdriver = new ChromeDriver();\n\t\tdriver.get(\"https://www.booking.com/\");\n\t\n\t\t\n\t\tdriver.manage().window().maximize();\n\t\tThread.sleep(100);\n\t\t\n}", "public static void main(String[] args) throws InterruptedException {\n\t\tif (browser.equals(\"Firefox\")) {\r\n\t\t\tWebDriverManager.firefoxdriver().setup();\r\n\t\t\tdriver = new FirefoxDriver();\r\n\t\t} else if (browser.equals(\"Chrome\")) {\r\n\t\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\tdriver = new ChromeDriver();\r\n\t\t} else if (browser.equals(\"Edge\")) {\r\n\t\t\tWebDriverManager.edgedriver().setup();\r\n\t\t\tdriver = new EdgeDriver();\r\n\t}\r\n\r\n\t\t\r\n\t\tdriver.get(\"https://www.w3schools.com/js/tryit.asp?filename=tryjs_default\");\r\n\t\t driver.manage().window().maximize();\r\n\t\t //This will throws error of handling frame\r\n\t\t// driver.findElement(By.xpath(\"//button[text()='Click Me!']\")).click();\r\n\t\t \r\n\t\t // A page can have multiple iframe. First We need to find xpath for required iframe\r\n\t\t WebElement framebyelemnet = driver.findElement(By.xpath(\"//iframe[@id='iframeResult']\"));\r\n\t\t //Then use switch method to navigate to the correct iframe. This iframe switch over by using Webelement\r\n\t\t driver.switchTo().frame(framebyelemnet);\r\n\t\t driver.findElement(By.xpath(\"//button[text()='Click Me!']\")).click();\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t //Switch to iframe using name or id of iframe\r\n\t\t driver.get(\"https://www.w3schools.com/js/tryit.asp?filename=tryjs_default\");\r\n\t\t driver.manage().window().maximize();\r\n\t\t driver.switchTo().frame(\"iframeResult\");\r\n\t\t driver.findElement(By.xpath(\"//button[text()='Click Me!']\")).click();\r\n\t\t \r\n\t\t //Switch to iframe using index of the iframe\r\n\t\t driver.get(\"https://www.w3schools.com/js/tryit.asp?filename=tryjs_default\");\r\n\t\t driver.manage().window().maximize();\r\n\t\t //To find frame index , you need enter //iframe in the search html box. It will display how many iframe tag\r\n\t\t //presented in the page. move the cursor and find out which index it will stop. Each index start with 0\r\n\t\t // For Example. if the page have 2 frame and the current frame is 1 ,then index of that iframe is 0\r\n\t\t driver.switchTo().frame(0);\r\n\t\t driver.findElement(By.xpath(\"//button[text()='Click Me!']\")).click();\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}", "public static void main(String[] args) throws InterruptedException \n\t{\n\t\tFirefoxDriver webPage = new FirefoxDriver();\n\t\t\n\t\t// open IRCTC registration page using gets method \n\t\twebPage.get(\"https://www.irctc.co.in/eticketing/userSignUp.jsf\");\n\t\t\n\t\t// check if requested page has been opened or not\n\t\tSystem.out.println(webPage.getTitle()+\" Loaded\");\n\t\t\n\t\t// Enter username\n\t\twebPage.findElementById(\"userRegistrationForm:userName\").sendKeys(\"login987\");\n\t\t\n\t\t//Enter Password\n\t\twebPage.findElementById(\"userRegistrationForm:password\").sendKeys(\"Pass1234\");\n\t\t\n\t\t//Re-enter Password\n\t\twebPage.findElementById(\"userRegistrationForm:confpasword\").sendKeys(\"Pass1234\");\n\t\t\n\t\t//Select security question\n\t\twebPage.findElementById(\"userRegistrationForm:securityQ\").sendKeys(\"What is your pet name?\");\n\t\t\n\t\t//Enter Security answer\n\t\twebPage.findElementById(\"userRegistrationForm:securityAnswer\").sendKeys(\"Pupppy\");\n\t\t\n\t\t//Enter First Name\n\t\twebPage.findElementById(\"userRegistrationForm:firstName\").sendKeys(\"Arun\");\n\t\t\n\t\t//Enter Last Name\n\t\twebPage.findElementById(\"userRegistrationForm:lastName\").sendKeys(\"Rajamani\");\n\t\t\n\t\t//Enter Gender\n\t\twebPage.findElementById(\"userRegistrationForm:gender:0\").click();\n\t\t\n\t\t//Enter Marital Status\n\t\twebPage.findElementById(\"userRegistrationForm:maritalStatus:1\").click();\n\t\t\n\t\t//DOB Date\n\t\twebPage.findElementById(\"userRegistrationForm:dobDay\").sendKeys(\"12\");\n\t\t\n\t\t//DOB Month\n\t\twebPage.findElementById(\"userRegistrationForm:dobMonth\").sendKeys(\"06\");\n\t\t\n\t\t//DOB Year\n\t\twebPage.findElementById(\"userRegistrationForm:dateOfBirth\").sendKeys(\"1989\");\n\t\t\n\t\t//Enter Occupation\n\t\twebPage.findElementById(\"userRegistrationForm:occupation\").sendKeys(\"Private\");\n\t\t\n\t\t//Enter email id\n\t\twebPage.findElementById(\"userRegistrationForm:email\").sendKeys(\"[email protected]\");\n\t\t\n\t\t//Enter mobile num\n\t\twebPage.findElementById(\"userRegistrationForm:mobile\").sendKeys(\"1234567890\");\n\t\t\n\t\t//Enter Nationality\n\t\twebPage.findElementById(\"userRegistrationForm:nationalityId\").sendKeys(\"India\");\n\t\t\n\t\t//Enter Address\n\t\twebPage.findElementById(\"userRegistrationForm:address\").sendKeys(\"123 Test Address\");\n\t\t\n\t\t//Enter Country\n\t\twebPage.findElementById(\"userRegistrationForm:countries\").sendKeys(\"India\");\n\t\t\n\t\t//Enter pincode\n\t\twebPage.findElementById(\"userRegistrationForm:pincode\").sendKeys(\"600073\");\n\t\t\n\t\t//Click on page for drop down to load \n\t\twebPage.findElementByTagName(\"body\").click();\n\t\tThread.sleep(10000);\n\t\t\n\t\t//Select city/town Name\n\t\twebPage.findElementById(\"userRegistrationForm:cityName\").sendKeys(\"Kanchipuram\");\n\t\t\n\t\t//Click on page for drop down to load\n\t\twebPage.findElementByTagName(\"body\").click();\n\t\t\n\t\tThread.sleep(10000);\n\t\t//Select post office name\n\t\twebPage.findElementById(\"userRegistrationForm:postofficeName\").sendKeys(\"Gowriwakkam S.O\");\n\t\t\n\t\t//Enter Landline phone number\n\t\twebPage.findElementById(\"userRegistrationForm:landline\").sendKeys(\"1234567890\");\n\t\t\n\t\t//Click Submit Link\n\t\twebPage.findElementById(\"userRegistrationForm:j_idt486\").click();\n\t}", "public static void main(String[] args) {\n\r\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"./sotware/geckodriver.exe\");\r\n\t\tFirefoxDriver driver=new FirefoxDriver();\r\n\t}", "public static void main(String[] args) throws InterruptedException {\n\r\n\t\tWebDriver driver = new FirefoxDriver();\r\n\t\t\r\n\t\tdriver.get(\"http://www.mail.yahoo.com\");\r\n\t\tThread.sleep(5000);\r\n\t\tSystem.out.println(\"Title :\"+driver.getTitle());\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tWebDriver driver;\n\t\t\n\t\t// Used to launch Firefox Driver\n\t\t// WebDriver driver = new FirefoxDriver();\n\t\tFile file = new File(\"driver//geckodriver.exe\");\n\t\tSystem.setProperty(\"webdriver.gecko.driver\", file.getAbsolutePath());\n\t\tDesiredCapabilities capabilities = DesiredCapabilities.firefox();\n\t\tcapabilities.setCapability(\"marionette\",true);\n\t\tdriver = new FirefoxDriver(capabilities);\n\t\t \n\t\t//Launching the URL in to the firefox address bar\n\t\tdriver.get(\"http://www.seleniumhq.org/download/\");\n\t\t\n\t\t//Get the Title of the page\n\t\tString TitleValue = driver.getTitle();\n\t\tSystem.out.println(\"Title of the page is \"+ TitleValue);\n\t\t\n\t\t// Used to maximize the window\n\t\tdriver.manage().window().maximize();\n\t\t\n\t\tdriver.navigate().back();\n\t\tSystem.out.println(\"Navigated back to the page\");\n\t\t\n\t\tdriver.navigate().forward();\n\t\tSystem.out.println(\"Forwared page \");\n\t\t\n\t\tdriver.navigate().refresh();\n\t\tSystem.out.println(\"Refresh the page\");\n\t\t\n\t\t//Close the driver\n\t\tdriver.close();\n\t}", "@ BeforeTest \n\tpublic void Amazon() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",System.getProperty(\"user.dir\")+\"\\\\resources\\\\chromedriver.exe\"); // to make the path portable create folder reources and put the element to it \n\t\tdriver = new ChromeDriver();\n\t\tdriver.get(\"https://www.amazon.com/\");\n\t\tSystem.out.println(driver.getCurrentUrl());\t\n\t\tdriver.manage().window().maximize();\n\n}", "@BeforeClass\n @Parameters({\"browser\", \"url\"})\n // Step 2: create a method with appropriate params\n void setup(String mBrowser, String mUrl){\n // Step 3: make use of the parameters\n if(mBrowser.equalsIgnoreCase(\"chrome\")){\n System.setProperty(\"webdriver.chrome.driver\",\"C:/chromedriver_win32/chromedriver.exe\");\n driver = new ChromeDriver();\n }else if(mBrowser.equalsIgnoreCase(\"firefox\")){\n System.setProperty(\"webdriver.chrome.driver\",\"C:/firefox_win32/firefoxdriver.exe\");\n driver = new FirefoxDriver();\n }\n // Step 3: make use of the parameters\n driver.get(mUrl);\n }", "public static void main(String[] args) throws InterruptedException {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"E:\\\\Pragati\\\\Selenium\\\\Exe files\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t//\t String baseUrl=\"http://www.facebook.com\";\r\n\t\tString baseUrl=\"http://demo.guru99.com/test/ajax.html\";\r\n\t\t WebDriver driver= new ChromeDriver();\r\n\t\t driver.get(baseUrl);\r\n\t\t Thread.sleep(10000);\r\n\t\t/* driver.switchTo().frame(\"classFrame\");\r\n\t\t driver.findElement(By.linkText(\"Deprecated\")).click();\r\n*/\r\n\t\t List<WebElement> elements=driver.findElements(By.name(\"name\"));\r\n System.out.println(\"No. of elements=\" +elements.size());\r\n for(int i=0;i<elements.size();i++)\r\n {\r\n \t System.out.println(\"Radio button text:\" +elements.get(i).getAttribute(\"value\")); \r\n }\r\n\t\t /* String tgName=driver.findElement(By.id(\"email\")).getTagName();\r\n\t\t System.out.println(tgName);\r\n\t\t String verUrl=driver.getCurrentUrl();\r\n\t\t System.out.println(verUrl);\r\n\t\t System.out.println(driver.getPageSource().length());\r\n\t\t String expedtedTitle=\"Facebook – log in or sign up\";\r\n\t\t String ActualTitle= driver.getTitle();\r\n\t\t if(expedtedTitle.equalsIgnoreCase(ActualTitle)&& verUrl.equalsIgnoreCase(baseUrl))\r\n\t\t {System.out.println(\"PASS\");}\r\n\t\t else\r\n\t\t {\r\n\t\t\t System.out.println(\"FAIL\"); \r\n\t\t }*/\r\n\t\t \r\n\t\t /* String alertMessage;\r\n\r\n\t driver.get(\"http://jsbin.com/usidix/1\");\r\n\t driver.findElement(By.cssSelector(\"input[value=\\\"Go!\\\"]\")).click();\r\n\t \r\n\t alertMessage = driver.switchTo().alert().getText();\r\n\t Thread.sleep(1000);\r\n\t driver.switchTo().alert().accept();\r\n\t \r\n\t System.out.println(alertMessage);\r\n\t */\r\n\r\n\r\n\t}", "private static WebDriver newHtmlUnitDiver() {\n\t\tcapabilities = new DesiredCapabilities().htmlUnit();\n\t\tcapabilities.setBrowserName(\"HtmlUnit\");\n\t\tsetCommonCapabilities();\n\n//\t\treturn new HtmlUnitDriver(capabilities);\n\t\treturn new HtmlUnitDriver(true);\n\t}", "public static void main(String[] args) throws IOException {\n\t\t\n\t\tFile src = new File(\"C://PhantonJs//bin//phantomjs//bin//phantomjs.exe\");\n\t\tSystem.setProperty(\"phantomjs.binary.path\",src.getAbsolutePath());\n\t\tWebDriver driver = new PhantomJSDriver();\n\t\tdriver.get(\"https://en-gb.facebook.com/login/\");\n\t\tSystem.out.println(\"Opening Application URL\");\n\t WebElement element=driver.findElement(By.xpath(\"//input[@id='email']\"));\n\t\telement.sendKeys(\"****\");\n\t\tWebElement element2=driver.findElement(By.xpath(\"//input[@id='pass']\"));\n\t\telement2.sendKeys(\"***\");\n\t\tdriver.findElement(By.xpath(\"//*[@id='loginbutton']\")).click();\n\t\tSystem.out.println(\"login sucessful\");\n\t\tFile scrFile=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\tFileUtils.copyFile(scrFile,new File(\"E:\\\\projects\\\\pivotal.jpg\"),true);\n\t}", "WebDriver modify(WebDriver webDriver);", "public static void main(String[] args) {\n\t\tWebDriver driver = new FirefoxDriver();\n\t\t//WebDriverWait wait= new WebDriverWait(driver, 10);\n\t\t//Open the browser\n\t\tdriver.get(\"https://www.training-support.net/selenium/javascript-alerts\");\n\n\t\tString pageTitle= driver.getTitle();\n\t\tSystem.out.println(\"Title of the page is : \"+pageTitle);\n\t\t\n\t\tWebElement simple=driver.findElement(By.xpath(\"//button[@id='simple']\"));\n\t\t\n\t\tsimple.click();\n\t\t\n\t\tAlert simpleAlert=driver.switchTo().alert();\n\t\t\n\t\tSystem.out.println(\"Text in alert : \"+simpleAlert.getText());\n\t\t\n\t\tsimpleAlert.accept();\n\t\t\n\t\tdriver.close();\n\t\t\n\t\t\n\t}", "public Page(WebDriver webDriver) {\n this.webDriver = webDriver;\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 }", "@Test\n public void selenium(){\n LandingPage landingPage = new LandingPage();\n landingPage.setDriver(driver);\n landingPage\n .assertTitle()\n .clickFindMeeting()\n .assertTitle()\n .search(\"10011\")\n .printFirstLocation()\n .printFirstDistance()\n .clickOnLocation()\n .assertLocationMatches()\n .printTodaysHours();\n }", "@Override\n public WebDriver getWebDriver() {\n return new FirefoxDriver();\n }", "@BeforeMethod\r\n public void backendJobListing() {\n driver = new FirefoxDriver();\r\n \r\n //Open browser\r\n driver.get(\"https://alchemy.hguy.co/jobs/wp-admin\");\r\n \r\n }", "@BeforeTest\n\n public void setup() {\n\n \t System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\Lenovo 1\\\\eclipse-workspace\\\\firstTestProject\\\\src\\\\test\\\\resources\\\\chromedriver.exe\");\n driver = new ChromeDriver();\n\n /* System.setProperty(\"webdriver.gecko.driver\", \"C:\\\\Users\\\\Lenovo 1\\\\eclipseprojects\\\\seleniumTestProject\\\\src\\\\test\\\\resources\\\\geckodriver.exe\");\n driver = new FirefoxDriver();*/\n\n\n// System.setProperty(\"webdriver.chrome.driver\", \"/home/ushani/Selenium_ProjectWS/TwoBulls/seleniumTestProject/src/test/resources/chromedriver\");\n// WebDriver driver = new ChromeDriver();\n\n driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\n driver.get(\"http://www.google.com\");\n }", "@BeforeClass\n\tpublic void initializebrowser() throws InterruptedException {\n\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", Chrome);\n\t\t// driver = new ChromeDriver(); \n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--disable-extensions\");\n\t\toptions.addArguments(\"test-type\");\n\t\toptions.addArguments(\"--disable-popup-blocking\");\n\t\tdriver = new ChromeDriver(options);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.get(common.URL);\n\t\tThread.sleep(3000);\n\n\t\t\n\t\t/*DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();\n\t\t \n\t\t //Method and Description - void setCapability(java.lang.String capabilityName, boolean value)\n\t\t capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);\n\t\t \n\t\t //Among the facilities provided by the System class are standard input, standard output, and error output streams; access to externally defined \"properties\"; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.\n\t\t System.setProperty(\"webdriver.ie.driver\", common.IE);\n\t\t \n\t\t //InternetExplorerDriver(Capabilities capabilities)\n\t\t WebDriver driver = new InternetExplorerDriver(capabilities);\n\t\t \n\t\t driver.manage().window().maximize();\n\t\t driver.get(common.URL);\n\t\t Thread.sleep(3000);*/\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"C:\\\\Users\\\\DR\\\\Desktop\\\\seli\\\\geckodriver.exe\");\r\n\t\tWebDriver d=new FirefoxDriver();\r\n\t\t\t\td.get(\"https://www.google.com/\");\r\nd.findElement(By.xpath(\".//*[@id='gs_htif0']\")).sendKeys(\"Sam\");\r\nd.findElement(By.xpath(\".//*[@id='tsf']/div[2]/div[3]/center/input[1]\")).click();\r\n\r\n\r\n\t}", "void browserMethod();", "@BeforeMethod\n\tpublic void launch()\n\t{\n\t\t\n\t\tdriver=new FirefoxDriver();\n\t\tdriver.manage().window().maximize();\n\t\t\n\t\tdriver.manage().deleteAllCookies();\n\t\tdriver.get(\"https://www.facebook.com/\");\n\t\t\n\t}", "public RegisterPage(WebDriver driver){ this.driver = driver; }", "@Test\n public void sdet() {\n System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\willi\\\\Desktop\\\\WebdriverJavaCucumber\\\\chromedriver.exe\");\n\n WebDriver driver = new ChromeDriver();\n //WebDriver driver = new FirefoxDriver();\n //open url\n driver.get(\"http://sdettraining.com/trguitransactions/AccountManagement.aspx\");\n// //enter email\n driver.findElement(By.xpath(\"//*[@name = 'ctl00$MainContent$txtUserName']\")).sendKeys(\"[email protected]\");\n// //enter pass SeleniumClass\n driver.findElement(By.xpath(\"//input[@id='MainContent_txtPassword']\")).sendKeys(\"SeleniumClass\");\n// //click Logon\n driver.findElement(By.xpath(\"//input[@id='MainContent_btnLogin']\")).click();\n// //get comfirmation\n\n if (driver.getTitle().equals(\"SDET Training | Account Management\")){\n System.out.println(\"Test passed\");\n }else {\n System.out.println(\"Test failed\");\n //make it really fail if it fils\n fail(\"Test failed\");//junit ..>>import static junit.framework.TestCase.fail;\n }\n\n// String message = driver.findElement(By.id(\"//small[@id='conf_message']\")).getText();\n// System.out.println(\"Confirmation\" + message);\n// //close\n driver.close();\n\n\n\n\n }", "public static <JavascriptExcutor> void main(String[] args) throws Exception {\n\t\tSystem.setProperty(\"webdriver.firefox.marionette\",\".\\\\Tools\\\\geckodriver.exe\");\n//\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"\\\\Tools\\\\geckodriver.exe\");\n\t\tWebDriver driver = new FirefoxDriver();\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(8, TimeUnit.SECONDS);\n\t\tdriver.get(\"http://data.pharmacodia.com/web/homePage/index?ns=1&ts=1&str=YWSJ\");\n\t\tSystem.out.println(\"Current tab title is \"+ driver.getTitle());\n\t\tThread.sleep(1000);\n\t\tdriver.switchTo().frame(\"rightMain\");\n\t\tWebElement element = driver.findElement(By.xpath(\"//*/span[@title='化学药']\"));\n//\t\tWebElement element = driver.findElement(By.xpath(\"//*[@id='search_top']/div[1]/div[1]/div/div/span[1]\"));\n\t\telement.click();\n\t\tThread.sleep(1000);\n\t\tdriver.switchTo().defaultContent();\n\t\tdriver.findElement(By.xpath(\"//*[@id='noLoginAlert']/div/button\")).click();\n\t\tdriver.quit();\n\t}", "public static void main(String[] args) throws InterruptedException {\n\t\tFirefoxProfile prof = new FirefoxProfile();\r\n\t\tprof.setAcceptUntrustedCertificates(false);\r\n//the above 2 lines will allow you to get past an unsecured site (The connection is untusted. Remember to pass the object in the line below..) Only in FF, IE and Chrome handles it fine \r\n\t\t\r\n\t\tWebDriver driver = new FirefoxDriver(prof);\r\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\r\n\t\t//the global 5 second implicit wait above applies for all code below\r\n\t\t\r\n\t\tdriver.get(\"www.ebay.com\");\r\n\t\tdriver.findElement(By.tagName(\"a\")).click();\r\n\t\tThread.sleep(5000L);//explicit wait to wait for 5 seconds to do other tasks\r\n\t\t//But if you need to keep adding sleeps like this it can cause performance issues. So instead let's set a global implicit wait\r\n\t\tdriver.manage().deleteAllCookies();\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Parameters({\"Browser\"})\n\t@BeforeClass\n\tpublic void BeforeStudentStatusBlocking(String sBrowser) throws MalformedURLException\n\t{\n\t\t\n\t\t//Edit Browser Capabilities as per project\n\t\t//Fire fox Profile\t\t\n\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\tprofile.setPreference(\"network.automatic-ntlm-auth.trusted-uris\",EnvironmentVariables.sUrl_KuportalAdmin);\n\t\t\n\t\t//Capability\n\t\tobjBrowserMgr = new BrowserManagement(sBrowser);\n\t\tobjBrowserMgr.capability.setCapability(FirefoxDriver.PROFILE, profile);\t\t\n\t\t\t\n\t\t//Create the Remote Driver Instance\n\t\ttry\n\t\t{\t\t\t\t\t\t\n\t\t\tdriver = new RemoteWebDriver(new URL(\"http://\".concat(EnvironmentVariables.sHub).concat(\":\").concat(EnvironmentVariables.sHubPort).concat(\"/wd/hub\")), objBrowserMgr.capability);\n\t\t\tdriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n\t\t\tScreenShotOnTestFailure.init(driver, EnvironmentVariables.sEnv, EnvironmentVariables.sApp);\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\t\n\t\t\tReportExtn.Fail(\"Unable to create the Remotedriver\" + ex.getMessage());\t\t\t\n\t\t}\n\t\tdriver.get(EnvironmentVariables.sUrl_KuportalAdmin);\n\t\tdriver.manage().window().maximize();\n\t\tuiLandingPageObjects = new LandingPage(driver);\n\t\tuiLandingPageObjects.LoginToAdminPortal(EnvironmentVariables.sAdminUserName, EnvironmentVariables.sAdminPassword);\n\t\tuiHomePageObjects = new HomePage(driver);\n\t\t\n\t\t/*//Read Application Variables from Properties File\n\t\tFileInputStream objFileInputStream = null;\n\t\tProperties objProperties = new Properties();\n\t\tFile objFile = new File(EnvironmentVariables.sApplicationVariablePath);\n\t\ttry {\n\t\t\t\tobjFileInputStream = new FileInputStream(objFile);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t\tobjProperties.load(objFileInputStream);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t*/\n\t\t\n\t}", "@BeforeTest\r\n\r\n\tpublic void setUp() throws Exception {\r\n\t\t// PropertyConfigurator.configure(\"log4j.properties\");\r\n\t\tdriver = new FirefoxDriver();\r\n\t\tbaseUrl = \"https://pghvm-vr7-www1.omnyx.com/Omnyx.Web/login\";\r\n\r\n\t\t// Maximize the browser's window\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\tdriver.manage().timeouts().pageLoadTimeout(15, TimeUnit.SECONDS);\r\n\r\n\t}", "@Test\n public void Cristo_Dubai() throws InterruptedException {\n \tSystem.setProperty(\"webdriver.gecko.driver\",\"/opt/Anbu/Azhagan/WorkSpace/Selenium_Drivers/NEW/geckodriver\");\n \tdriver = new FirefoxDriver();\n\n \t\n\t driver.get(\"http://cristo.avosa.org:9898/dubai/registration/form\");\n\t \n\t driver.manage().window().maximize();\n\t \n//\t String expectedTitle =\"Wealth Vruddhi\";\n//\t \n//\t String actualTitle = driver.getTitle();\n// \n//\t Assert.assertEquals(expectedTitle,actualTitle);\n // Register click\n\t \n\t driver.findElement(By.xpath(\"//*[@id=\\\"emirate_id\\\"]\")).sendKeys(\"784199412345678\");\n \n\n\t driver.findElement(By.xpath(\"//*[@id=\\\"myform\\\"]/div/section/div/div[1]/div[2]/div[4]/div[1]/div[2]/input\")).sendKeys(\"automation\");\n\t driver.findElement(By.xpath(\"//*[@id=\\\"myform\\\"]/div/section/div/div[1]/div[2]/div[4]/div[1]/div[3]/input\")).sendKeys(\"automation\");\n\t driver.findElement(By.xpath(\"//*[@id=\\\"myform\\\"]/div/section/div/div[1]/div[2]/div[4]/div[2]/div[1]/div[1]\")).click();\n\n\t driver.findElement(By.xpath(\"/html/body/div[2]/div[1]/table/thead/tr[1]/th[2]\")).click();\n\t System.out.println(\"\");\n\t \n\t driver.findElement(By.xpath(\"//*[@id='myform']/div/section/div/div[1]/div[2]/div[4]/div[2]/div[1]/div[2]/div/div/label[1]\")).click();\n\t driver.findElement(By.xpath(\"//*[@id='m']\")).click();\n//\t Select select = new Select(driver.findElement(By.xpath(\"//*[@id='country_id']\")));\n//\t select.selectByVisibleText(\"Resident Individual\");\n\t \n\t \n\t driver.findElement(By.xpath(\"//*[@id=\\\"myform\\\"]/div/section/div/div[1]/div[2]/div[4]/div[2]/div[2]\")).click();\n\t\tList<WebElement> list = driver.findElements(By.xpath(\"//*[@id=\\\"resident_type\\\"]\"));\n\t\tSystem.out.println(list.size());\n\t\t\n\t\tfor(WebElement element:list){\n\t\t\t\n\t\t\tSystem.out.println(\"Values \" + element.getAttribute(\"innerHTML\"));\n\t\t\t\n\t\t\tString innnerhtml=element.getAttribute(\"innerHTML\");\n\t\t\t\n\t\t\tif (element.getAttribute(\"innerHTML\").contains(\"Resident Individual\"))\n\t\t\t{\n\t\t\t\telement.click();\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Selected State is ======\"+innnerhtml);\n\t\t}\n\t \n\t\n\t driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t \n// driver.close();\n }", "@BeforeClass\n\tpublic static void beforeClass() throws MalformedURLException {\n\n\t\tDrivers.driver = Drivers.browser(\"firefox\");\n\t\tcommUtil.launchBrowser(\"http://demoqa.com/\");\n\t\tDrivers.driver.manage().window().maximize();\n\n\t\t// Drivers.driver = Drivers.browser(\"internetExplorer\");\n\t\t// commUtil.launchBrowser(\"http://demoqa.com/\");\n\t}", "public static void main(String[] args) throws Exception {\n\n\t\t \n\t\t \n\t\t\n\t\t WebDriver driver = new FirefoxDriver(FirefoxDriverProfile());\n\t\t driver.manage().window().maximize();\n\t\t Scanner sc=new Scanner(System.in);\n\t\t driver.get(\"http://172.16.32.63/AP_FO/ImportBOMList.aspx\");\n\t\t // Screen scr = new Screen();\n\t\t \n\t\t sc.nextLine(); \n\t\t driver.findElement(By.xpath(\"//form[@id='WebForm1']/div[3]/div[3]/div/div/div/div[2]/ul/li[5]/a\")).click();\n\t\t Thread.sleep(3000);\n\t\t driver.findElement(By.xpath(\"//a[@id='AP_Layout_wt104_block_wtMainContent_wt45']/img\")).click();\n\t\n\t\t \n\t\t \n\t\t\t /* driver.get(\"http://spreadsheetpage.com/index.php/file/C35/P10/\");\n\t\t\t driver.findElement(By.linkText(\"smilechart.xls\")).click();\n\t\t */\n\t}", "@Test\n public void TestToPass(){\n System.out.println(\"This method to pass test\");\n driver.get(\"https://www.softwaretestingmaterial.com/100-software-testing-interview-questions/\");\n driver.getTitle();\n driver.quit();\n }", "public static void main(String[] args) {\n\n\n WebDriver driver = WebDriverFactory.getDriver(\"CHROME\");\n driver.get(\"http://google.com\");\n driver.navigate().to(\"https://amazon.com\");\n driver.navigate().back();\n\n driver.close();\n\n WebDriver driver2 = WebDriverFactory.getDriver(\"FIREFOX\");\n driver2.get(\"https://www.mozilla.org\");\n\n\n driver2.close();\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\tWebDriver driver=launchBrowser(\"http://www.seleniumframework.com/Practiceform/\");\r\n\tdriver.findElement(By.id(\"alert\")).click();\r\n\t\r\n\tAlert alert=driver.switchTo().alert();\r\n\tString alertText=alert.getText();\r\n\tSystem.out.println(alertText);\r\n\talert.accept();\r\n\t\r\n\tdriver.findElement(By.name(\"name\")).sendKeys(\"Selenium\");\r\n\t\r\n\tdriver.switchTo().frame(0);\r\n\t//adfasdfasdf\r\n\tdriver.switchTo().defaultContent();\r\n\t\r\n\t\r\n\t\r\n\t}", "@Test\r\n\t\tpublic static void LaunchUrl()\r\n\t\t{\r\n\t\t\tdriver.manage().deleteAllCookies();\r\n\t\t\tdriver.get(prop.getProperty(\"url\"));\r\n\t\t\tdriver.manage().window().maximize();\t\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\t\r\n\t\t\r\n\t\t}", "private static WebDriver launchFirefox()\n\t{\n\t\tif (REMOTE_URL != null && !REMOTE_URL.equals(\"\")) {\n\t\t\tDesiredCapabilities capabilities = DesiredCapabilities.firefox();\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\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\t\tprofile.setAcceptUntrustedCertificates(true);\n\n\t\t\treturn new FirefoxDriver(profile);\n\n\t\t}\n\n\n\t}", "public static void main(String[] args) throws InterruptedException {\n\t\t\r\n\t\t\r\n\t\tString key=\"webdriver.gecko.driver\";\r\n\t\tString value=\".\\\\Drivers\\\\geckodriver.exe\";\r\n\t\tSystem.setProperty(key, value);\r\n\t\t\r\n\t\tWebDriver driver =new FirefoxDriver();\r\n\t\t\r\n\t\tdriver.get(\"https://www.irctc.co.in/eticketing/loginHome.jsf\");\r\n\t\tThread.sleep(1000);\r\n\t\t\r\n\t\tWebElement button=driver.findElement(By.id(\"loginbutton\"));\r\n\t\tbutton.click();\r\n\t\t\r\n\t\tAlert alert=driver.switchTo().alert();\r\n\t\tString strText=alert.getText();\r\n\t\tSystem.out.println(\"javascript popup text:-\"+strText);\r\n\t\tThread.sleep(1000);\r\n\t\talert.accept();\r\n\t\t\r\n\t\tdriver.close();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public void WakeFirefox() {\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"D://geckodriver.exe\" );\n\t\t\n\t\t// We have to import Webdriver class from library to create object named driver below\n\t\tWebDriver driver = new FirefoxDriver();\n\t\t\n\t\t//Open URL\n\t\tdriver.get(\"https://technoticle.wordpress.com/\");\n\t\t\n\t\t//To get title of Website\n\t\tSystem.out.println(driver.getTitle());\n\t\t\n\t\t//Verification to know whether we are not getting redirected anywhere else. This will print hit URL\n\t\tSystem.out.println(driver.getCurrentUrl());\n\t\t\n\t\t//Close the browser\n\t\tdriver.close();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@BeforeClass\n\tpublic void setUp() throws MalformedURLException, AWTException{\n\t\tString filepath_driver=Reader.extract(\"chromedriver.exe\");\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", filepath_driver);\n driver = new ChromeDriver(); \n driver.get(\"http://baladyapps.momra.gov.sa/Eservices/Pages/MyRequests.aspx\");\n \n Robot r = new Robot(); \n r.keyPress(KeyEvent.VK_ESCAPE); \n r.keyRelease(KeyEvent.VK_ESCAPE);\n \n \n \n \n\t}", "@BeforeMethod\r\n\tpublic void setUp() {\n\t\tdriver = new FirefoxDriver();\r\n\t\tbaseUrl = \"https://www.google.com/\";\r\n\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\tdriver.manage().window().maximize();\r\n\r\n\t\tdriver.get(baseUrl);\r\n\t}", "@Test(priority = 2)\n //@Parameters({\"browser\"})\n public void testPageTitleA2() throws Exception{\n driver.get(\"http://www.snapdeal.com\");\n //Thread.sleep(5000);\n String strPageTitle = driver.getTitle();\n System.out.println(\"SnapDeal : \"+strPageTitle);\n try{\n Assert.assertTrue(strPageTitle.contains(\"Amazon\"), \"SnapDeal : Page title doesn't match : \"+strPageTitle);\n }catch (Exception e){\n System.out.println(e);\n }\n //Thread.sleep(5000);\n // driver.quit();\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}", "@Test\n public void hello() {\n\n WebDriverManager.getInstance(CHROME).setup();\n ChromeOptions options = new ChromeOptions();\n\n WebDriver driver = new ChromeDriver(options);\n//\n// options.setPageLoadStrategy(PageLoadStrategy.EAGER); // https://www.skptricks.com/2018/08/timed-out-receiving-message-from-renderer-selenium.html\n// options.addArguments(\"start-maximized\"); // https://stackoverflow.com/a/26283818/1689770\n// options.addArguments(\"enable-automation\"); // https://stackoverflow.com/a/43840128/1689770\n// options.addArguments(\"--headless\"); // only if you are ACTUALLY running headless\n// options.addArguments(\"--no-sandbox\"); //https://stackoverflow.com/a/50725918/1689770\n// options.addArguments(\"--disable-infobars\"); //https://stackoverflow.com/a/43840128/1689770\n// options.addArguments(\"--disable-dev-shm-usage\"); //https://stackoverflow.com/a/50725918/1689770\n// options.addArguments(\"--disable-browser-side-navigation\"); //https://stackoverflow.com/a/49123152/1689770\n// options.addArguments(\"--disable-gpu\"); //https://stackoverflow.com/questions/51959986/how-to-solve-selenium-chromedriver-timed-out-receiving-message-from-renderer-exc\n// driver = new ChromeDriver(options);\n\n driver.get(\"https://www.mbvans.com/en/cpo\");\n driver.manage().window().maximize();\n WebDriverWait wait = new WebDriverWait(driver, 20);\n WebElement el = wait.until(ExpectedConditions.elementToBeClickable(By.className(\"column-link-list__link-container footer-container__item-content\")));\n driver.getTitle();\n driver.close();\n}", "public WebDriver browserSetup() throws IOException\r\n\t{ \r\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\r\n\t\tSystem.out.println(\"1.Chrome\\n2.Firefox \\nEnter your choice:\");\r\n\t\tString choice=br.readLine();\r\n\t\t\r\n\t\tswitch(choice)\r\n\t\t{\r\n\t\t//To start Chrome Driver\r\n\t\tcase \"1\":\r\n\t\t System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Test Automation\\\\Software\\\\chrome\\\\New Version\\\\chromedriver.exe\");\r\n\t\t ChromeOptions options=new ChromeOptions();\r\n\t\t options.addArguments(\"--disable-notifications\");\r\n\t\t driver=new ChromeDriver(options);\r\n\t\t break;\r\n\t\t\r\n\t\t//To start Firefox Driver\r\n\t\tcase \"2\":\r\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", \"C:\\\\***\\\\drivers\\\\geckodriver.exe\");\r\n\t\t\tdriver=new FirefoxDriver();\r\n\t\t\tbreak;\r\n\t\t} \r\n\t\t\r\n\t\tdriver.get(url);\r\n\t\t\r\n\t\t//To maximize the window\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\tdriver.manage().timeouts().pageLoadTimeout(8, TimeUnit.SECONDS);\r\n\t\t\r\n\t\treturn driver;\r\n\t}", "@Given(\"browser is open\")\n\tpublic void browser_is_open() {\n\t\tSystem.out.println(\"browseris open\");\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"/home/rahul/Desktop\");\n\t\tdriver=new ChromeDriver();\n\t\tdriver.manage().timeouts().implicitlyWait(40,TimeUnit.SECONDS);\n\t\t\n\t}", "@Test(priority = 1,enabled = true)\n //@Parameters({\"browser\"})\n public void testPageTitleA1() throws Exception{\n driver.navigate().to(\"http://www.youtube.com\");\n //Thread.sleep(5000);\n String strPageTitle = driver.getTitle();\n System.out.println(\"Youtube : \"+strPageTitle);\n Assert.assertTrue(strPageTitle.contains(\"Flipkart\"), \"Youtube : Page title doesn't match : \"+strPageTitle);\n //Thread.sleep(5000);\n // driver.quit();\n }", "public static void main(String[] args) throws Exception {\n\r\n\t\tSystem.setProperty(\"webdriver.gecko.driver\", \"F:\\\\workspace\\\\geckodriver.exe\");\r\n\t\tWebDriver driver = new FirefoxDriver();\r\n\t\tdriver.get(\"https://qaclickacademy.com/practice.php/ \");\r\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t\t//count of number of links on the page\r\n\t\tSystem.out.println(driver.findElements(By.tagName(\"a\")).size());\r\n\t\t\r\n\t\t\r\n\t\t//count of number of links on the footer section on the page\r\n\t\tWebElement footerdriver=driver.findElement(By.id(\"gf-BIG\"));\r\n\t\tSystem.out.println(footerdriver.findElements(By.tagName(\"a\")).size());\r\n\t\t\r\n\t\t\r\n\t\t//count the number links on the 1st coloumn in footer section\r\n\t\tWebElement coloumndriver=footerdriver.findElement(By.xpath(\"//*[@id=\\\"gf-BIG\\\"]/table/tbody/tr/td[1]/ul\"));\r\n\t\tSystem.out.println(coloumndriver.findElements(By.tagName(\"a\")).size());\r\n\t\t\r\n\t\t//click on each link in the coloumn check of the pages are opening\r\n\t\tfor(int i=1; i<coloumndriver.findElements(By.tagName(\"a\")).size(); i++)\r\n\t\t{\r\n\t\t\t//String clinkonlinkTab= Keys.chord(Keys.CONTROL , Keys.ENTER);\r\n\t\t\tcoloumndriver.findElements(By.tagName(\"a\")).get(i).sendKeys(Keys.CONTROL , Keys.ENTER);\r\n\t\t\tThread.sleep(5000);\r\n\t\t}\r\n\t\t\r\n\t\tSet<String> abc = driver.getWindowHandles();\r\n\t\tIterator<String> it = abc.iterator();\r\n\t\twhile(it.hasNext())\r\n\t\t{\r\n\t\t\tdriver.switchTo().window(it.next());\r\n\t\t\tSystem.out.println(driver.getTitle());\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n protected RemoteWebDriver createLocalDriver() {\n return new FirefoxDriver();\n }" ]
[ "0.7216055", "0.68454695", "0.6836505", "0.6548202", "0.6294509", "0.6241417", "0.6239782", "0.62354946", "0.6145016", "0.61364806", "0.6119824", "0.6116706", "0.6059395", "0.60326374", "0.6031917", "0.60243267", "0.5992876", "0.596968", "0.5965476", "0.5960569", "0.5954111", "0.5934614", "0.59261334", "0.5916988", "0.58902824", "0.5869958", "0.58525103", "0.5851759", "0.58392113", "0.5827348", "0.58206886", "0.5807285", "0.580339", "0.58018374", "0.5796947", "0.57741094", "0.57686394", "0.5767529", "0.57664967", "0.57553613", "0.5754194", "0.5743757", "0.5741493", "0.5728493", "0.57049704", "0.5703255", "0.57013416", "0.56997204", "0.569709", "0.5695307", "0.56930435", "0.5689536", "0.56891453", "0.56810856", "0.5676554", "0.56763947", "0.56757945", "0.56635463", "0.56587887", "0.56563586", "0.5651642", "0.5649578", "0.564945", "0.56487733", "0.5639562", "0.56324416", "0.56293", "0.5626807", "0.5618105", "0.56085855", "0.56081647", "0.5605837", "0.5596689", "0.5595791", "0.5594866", "0.559342", "0.5588958", "0.558182", "0.5570158", "0.5555959", "0.5553155", "0.5546351", "0.55434287", "0.55422795", "0.5538429", "0.5537868", "0.5536624", "0.55257964", "0.5524067", "0.5517841", "0.55167186", "0.5515224", "0.5511678", "0.55070865", "0.55016255", "0.5499979", "0.5495986", "0.5490005", "0.54874045", "0.5485931" ]
0.5683094
53
assertText | css=img[alt="Actif"] |
protected void assertUtilisateurActif() { assertTrue( ((DoliUserPage)_currentPage).isUtilisateurActif()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testImageFiltering()\n { \n String html = header + \"<img src=\\\"file://path/to/local/image.png\\\"/>\" + footer;\n Document doc = wysiwygHTMLCleaner.clean(new StringReader(html));\n NodeList nodes = doc.getElementsByTagName(\"img\");\n Assert.assertEquals(1, nodes.getLength());\n Element image = (Element) nodes.item(0);\n Node startComment = image.getPreviousSibling();\n Node stopComment = image.getNextSibling();\n Assert.assertEquals(Node.COMMENT_NODE, startComment.getNodeType());\n Assert.assertEquals(\"startimage:false|-|attach|-|Missing.png\", startComment.getNodeValue());\n Assert.assertEquals(\"Missing.png\", image.getAttribute(\"src\"));\n Assert.assertEquals(Node.COMMENT_NODE, stopComment.getNodeType());\n Assert.assertTrue(stopComment.getNodeValue().equals(\"stopimage\"));\n }", "private void doTestStyleWhenCaretIsAfterImage()\n {\n // NOTE: In IE8 with the document rendered in standards mode we can't place the caret after an image if it's the\n // last child of its parent..\n rta.setHTML(\"#<img/><em>$</em>\");\n\n Range range = ((Document) rta.getDocument()).createRange();\n range.setStartAfter(getBody().getChildNodes().getItem(1));\n range.collapse(true);\n select(range);\n\n assertFalse(executable.isExecuted());\n assertTrue(executable.execute(null));\n assertTrue(executable.isExecuted());\n assertTrue(executable.execute(null));\n assertFalse(executable.isExecuted());\n insertHTML(\"x\");\n assertFalse(executable.isExecuted());\n assertEquals(\"#<img>x<em>$</em>\", rta.getHTML().toLowerCase());\n }", "public void testGetSetImageString() {\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/smallpill.png\").getImage());\n\t\t\n\t\t//SET NEW IMAGE (\"PACMAN/littlepill.png\" because it exists)\n\t\ttestNormal.setImage(\"PACMAN/bigpill.png\");\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/bigpill.png\").getImage());\n\t}", "public static final String alt(String text) {\n return \"%\" + text; /*I18nOK:LINE*/\n }", "@Test\n public void testGetIcon() throws Exception {\n assert ResourceManager.getIcon(\"/images/card_00.png\") instanceof ImageIcon;\n }", "@Test(dataProvider = \"expectedTextsUnderCorrespondingIcons\", dataProviderClass = DataProviders.class)\n public void underBenefitIconsTextsTest(int iconIndex, String expectedTextUnderIconWithIndex) {\n String iconsClass = \"benefit-icon\";\n\n // TODO This locator can be improved.\n List<WebElement> underBenefitIconsElements = getDriver()\n .findElements(By.xpath(\"//div[@class='\" + iconsClass + \"']/following::span[@class='benefit-txt']\"));\n\n // TODO This is a bit better, but what do you have in your logs in case of failure ? Just \"Expected true but was false\".\n // TODO Is it possible to improve this message somehow ?\n assertEquals(underBenefitIconsElements.size(), 4);\n assertTrue(underBenefitIconsElements.stream().allMatch(WebElement::isDisplayed));\n assertEquals(expectedTextUnderIconWithIndex, underBenefitIconsElements.get(iconIndex).getText());\n }", "@Test\n\tpublic void testIconText() {\n\t\tfor (QUADRANT quad : QUADRANT.values()) {\n\t\t\tImageIcon icon =\n\t\t\t\tnew MultiIconBuilder(makeQuandrantIcon(32, 32, Palette.GRAY, Palette.WHITE))\n\t\t\t\t\t\t.addText(\"Abcfg\", font, Palette.RED, quad)\n\t\t\t\t\t\t.build();\n\t\t\ticon.getDescription();\n\t\t}\n\t}", "@Test\n public void testNumCathyPics()\n {\n driver.findElement(By.linkText(\"Cathedral Pics\")).click();\n List<WebElement> links = driver.findElements(By.tagName(\"img\"));\n assertEquals(3, links.size());\n }", "private void doTestStyleWhenCaretIsBeforeImage()\n {\n rta.setHTML(\"<img/>*\");\n\n Range range = ((Document) rta.getDocument()).createRange();\n range.setStartBefore(getBody().getFirstChild());\n range.collapse(true);\n select(range);\n\n assertFalse(executable.isExecuted());\n assertTrue(executable.execute(null));\n assertTrue(executable.isExecuted());\n insertHTML(\"y\");\n assertTrue(executable.isExecuted());\n assertEquals(\"<em>y</em><img>*\", rta.getHTML().toLowerCase());\n assertTrue(executable.execute(null));\n assertFalse(executable.isExecuted());\n assertEquals(\"<em></em>y<em></em><img>*\", rta.getHTML().toLowerCase());\n }", "public String checkInput() {\n\t\treturn ((WebElement) links.get(0)).getAttribute(\"alt\");\n\t\t\n\t}", "@Test\r\n public void testInjest() throws Exception {\r\n System.out.println(\"injest\");\r\n String doc = \"crowd.xml\";\r\n ImageWord word = new ImageWord();\r\n word.setUrl(doc);\r\n ImageTextSource source = new ImageTextSource();\r\n Set sourceSet = new HashSet();\r\n sourceSet.add(\"crowd\");\r\n source.setWordSet(sourceSet);\r\n word.setTextSrc(source);\r\n word.setType(\"svg\");\r\n word.setDataSource(\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" version=\\\"1.0\\\" x=\\\"0px\\\" y=\\\"0px\\\" width=\\\"100px\\\" height=\\\"100px\\\" viewBox=\\\"0 0 100 100\\\" enable-background=\\\"new 0 0 100 100\\\" xml:space=\\\"preserve\\\">\\n\" +\r\n \"<path d=\\\"M19.453,27.837c3.151,0,5.698-2.551,5.698-5.697c0-3.15-2.546-5.702-5.698-5.702 c-3.15,0-5.696,2.551-5.696,5.702C13.757,25.286,16.303,27.837,19.453,27.837z\\\"/>\\n\" +\r\n \"<circle cx=\\\"81.189\\\" cy=\\\"22.138\\\" r=\\\"5.699\\\"/>\\n\" +\r\n \"<path d=\\\"M50.35,27.837c3.147,0,5.697-2.551,5.697-5.697c0-3.15-2.55-5.702-5.697-5.702 c-3.151,0-5.702,2.551-5.702,5.702C44.648,25.286,47.199,27.837,50.35,27.837z\\\"/>\\n\" +\r\n \"<circle cx=\\\"81.189\\\" cy=\\\"22.138\\\" r=\\\"5.699\\\"/>\\n\" +\r\n \"<path d=\\\"M89.036,35.577l9.913-11.868c1.292-1.549,1.085-3.858-0.467-5.151c-1.551-1.293-3.85-1.086-5.146,0.462 c0,0-7.637,9.068-7.658,9.057c-1.274,1.124-2.936,1.811-4.763,1.811c-1.71,0-3.278-0.597-4.507-1.59 c-0.019,0.007-0.01,0.004-0.006,0l-7.873-9.277c-0.771-0.923-1.904-1.366-3.019-1.301c-1.116-0.064-2.242,0.378-3.018,1.301 c0,0-7.637,9.068-7.654,9.057c-1.273,1.124-2.939,1.811-4.763,1.811c-1.709,0-3.278-0.597-4.507-1.59h-0.004l-7.875-9.277 c-0.78-0.93-1.92-1.372-3.044-1.301c-1.128-0.071-2.274,0.371-3.045,1.301c0,0-7.64,9.068-7.658,9.057 c-1.273,1.124-2.939,1.811-4.768,1.811c-1.71,0-3.274-0.597-4.507-1.59l-7.878-9.277c-1.292-1.549-3.596-1.756-5.146-0.462 c-1.552,1.292-1.755,3.602-0.463,5.151L11.61,36.194v12.185c0,0.337,0.026,0.661,0.071,0.987l-1.595,30.765 c-0.146,2.055,1.405,3.838,3.458,3.979c2.054,0.141,3.834-1.401,3.975-3.459l1.269-24.463c0.224,0.017,0.44,0.035,0.665,0.035 c0.273,0,0.542-0.014,0.807-0.044l1.679,24.472c0.137,2.058,1.921,3.6,3.978,3.459c2.05-0.142,3.605-1.925,3.46-3.979 l-2.124-30.939c0.026-0.267,0.044-0.541,0.044-0.813V35.577l7.35-8.799l7.861,9.417v2.594L39,62.291h2.903l-0.925,17.84 c-0.141,2.055,1.405,3.838,3.458,3.979c2.058,0.141,3.842-1.401,3.983-3.459l0.952-18.36h2.199l1.255,18.36 c0.15,2.058,1.93,3.6,3.983,3.459c2.054-0.142,3.604-1.925,3.463-3.979l-1.225-17.84h2.864L58.193,37.37v-1.793l7.318-8.764 l7.838,9.382v12.185c0,0.337,0.021,0.661,0.067,0.987l-1.596,30.765c-0.141,2.055,1.405,3.838,3.458,3.979 c2.054,0.141,3.838-1.401,3.983-3.459l1.267-24.463c0.215,0.017,0.436,0.035,0.66,0.035c0.271,0,0.542-0.014,0.807-0.044 l1.674,24.472c0.145,2.058,1.929,3.6,3.983,3.459c2.05-0.142,3.601-1.925,3.459-3.979l-2.125-30.939 c0.032-0.267,0.049-0.541,0.049-0.813V35.577z\\\"/>\\n\" +\r\n \"<circle cx=\\\"81.189\\\" cy=\\\"22.138\\\" r=\\\"5.699\\\"/>\\n\" +\r\n \"</svg>\");\r\n String xml = new Util().generateXML(word);\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n boolean expResult = true;\r\n System.out.println(xml);\r\n boolean result = instance.injest(doc, xml);\r\n assertEquals(expResult, result);\r\n }", "@Test(timeout = 4000)\n public void test337() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"Tfoot component can be added only to a Table.\");\n // Undeclared exception!\n try { \n xmlEntityRef0.img((String) null, \"wheel.components.Submit\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public final String getAltAttribute() {\n return getAttributeValue(\"alt\");\n }", "@Then(\"^assert that the text \\\"([^\\\"]*)\\\" element is the text \\\"([^\\\"]*)\\\"$\")\n\tpublic void assert_that_the_text_element_is(String arg1, String arg2) throws Throwable {\n\t\tString[] parts = arg1.split(\"=\");\n\t\tString selector=parts[1];\n\t\tString result = driver.findElement(By.cssSelector(selector)).getText();\n\t\tAssert.assertEquals(result, arg2);\n\t\tSystem.out.println(\"Assert \"+ arg2 +\" is the text : \"+result);\n\t}", "@Test(priority=1)\n\tpublic void verifyText() {\n\t\tString expectedText = \"Facebook helps you connect and share with the people in your life.\";\n\t\tString actualText = driver.findElement(By.cssSelector(\"#content > div > div > div > div > div.lfloat._ohe > div > div\")).getText();\n\t\tAssert.assertEquals(actualText, expectedText);\n\t}", "public void clickAssertionEdit() {\r\n\t\tString Expected2 = \"Assessment edited\";\r\n\t\tString Actualtext2 = driver.findElement(By.xpath(\"//*[@id=\\\"content-section\\\"]/div/div[2]\")).getText();\r\n\t\tAssert.assertEquals(Actualtext2, Expected2);\r\n\t\tSystem.out.println(Actualtext2);\r\n\t}", "@Test(timeout = 4000)\n public void test113() throws Throwable {\n Hidden hidden0 = new Hidden((Component) null, \"!\", \"java.lang.String@0000000005\");\n Hidden hidden1 = new Hidden(hidden0, \"{7i(tT&i0oG.E#h\", \"{7i(tT&i0oG.E#h\");\n // Undeclared exception!\n try { \n hidden1.img(\"abbr\", \"{7i(tT&i0oG.E#h\");\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test\n public void testGridViewImages() {\n /* use of the content desc from the cursor data gets us the specific imageview.\n Use of the 'anyOf' is an or statement for matching multiple content descriptions if necessary\n */\n final int COL_TITLE = 2;\n Cursor cursor = mActivityRule.getActivity().getContentResolver().query(\n TVContract.TVEntry.CONTENT_URI,\n null, // leaving \"columns\" null just returns all the columns.\n null, // cols for \"where\" clause\n null, // values for \"where\" clause\n null // sort order\n );\n\n cursor.moveToFirst();\n onView(anyOf(withContentDescription(cursor.getString(COL_TITLE)))).check(matches(isDisplayed()));\n }", "@Test\n public void testHomepageUsageText()\n {\n try {\n WebElement e = driver.findElement(By.className(\"row\"));\n String elementText = e.getText();\n assertTrue(elementText.contains(\"Used for CS1632 Software Quality Assurance, taught by Bill Laboon\"));\n } catch (NoSuchElementException e) {\n fail();\n }\n }", "String getImaginary_lit();", "@Test\r\n public void ActionableTrainingTest() {\n WebElement title1 = driver.findElement(By.cssSelector(\"h3.uagb-ifb-title\"));\r\n \r\n //Assertion for title of the first info box\r\n Assert.assertEquals(title1.getText(), \"Actionable Training\");\r\n \r\n //Print heading of the first info box\r\n Reporter.log(\"Heading is: \" + title1.getText(), true);\r\n }", "@Test(timeout = 4000)\n public void test196() throws Throwable {\n Hidden hidden0 = new Hidden((Component) null, \"(vLoO6y2\\\"Vht&{{\", \"(vLoO6y2\\\"Vht&{{\");\n Hidden hidden1 = (Hidden)hidden0.attribute(\"(vLoO6y2\\\"Vht&{{\", \"(vLoO6y2\\\"Vht&{{\");\n assertTrue(hidden1.isValid());\n }", "@Test\n public void getImgByUri() {\n String uri = \"https://image.chosun.com/sitedata/image/201410/30/2014103000633_0.jpg\";\n\n\n// onView(withId(R.id.url_load_et)).perform(replaceText(uri));\n// onView(withId(R.id.url_load_btn)).perform(click());\n// onView(withId(R.id.save_btn)).perform(click());\n// Espresso.pressBack();\n }", "@Test\n\n public void validateAppTitle() throws IOException {\n LandingPage l = new LandingPage(driver);\n //compare the text from the browser with actual text.- Error..\n Assert.assertEquals(l.getTitle().getText(), \"FEATURED COURSES\");\n\n System.out.println(\"Test running from Inside docker for tests dated 22-03-2020\");\n System.out.println(\"Test completed\");\n\n ;\n\n\n }", "com.yahoo.xpathproto.TransformTestProtos.ContentImage getImageByTransform();", "public void clickQuilllogo(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Staples logo should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"imgQuilllogo\"));\r\n\t\t\twaitForPageToLoad(1000);\r\n\t\t\tclick(locator_split(\"imgQuilllogo\"));\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Staples logo is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- staples logo is not clicked \"+elementProperties.getProperty(\"imgQuilllogo\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgQuilllogo\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void testSpecialIcons() {\n Utility.FolderProperties fp = Utility.FolderProperties.getInstance(mContext);\n \n // Make sure they're available\n Drawable inbox = fp.getIconIds(Mailbox.TYPE_INBOX);\n Drawable mail = fp.getIconIds(Mailbox.TYPE_MAIL);\n Drawable parent = fp.getIconIds(Mailbox.TYPE_PARENT);\n Drawable drafts = fp.getIconIds(Mailbox.TYPE_DRAFTS);\n Drawable outbox = fp.getIconIds(Mailbox.TYPE_OUTBOX);\n Drawable sent = fp.getIconIds(Mailbox.TYPE_SENT);\n Drawable trash = fp.getIconIds(Mailbox.TYPE_TRASH);\n Drawable junk = fp.getIconIds(Mailbox.TYPE_JUNK);\n \n // Make sure they're unique\n Set<Drawable> set = new HashSet<Drawable>();\n set.add(inbox);\n set.add(mail);\n set.add(parent);\n set.add(drafts);\n set.add(outbox);\n set.add(sent);\n set.add(trash);\n set.add(junk);\n assertEquals(8, set.size());\n }", "@Test\n void shouldRenderValidTags() throws Exception {\n MatcherAssert.assertThat(\n new Variable(\n new SquareIndicate()\n ).render(\n \"[[ aA0._ ]] \",\n new MapOf<>(\"aA0._\", \"XX\")\n ),\n Matchers.is(\"XX \")\n );\n }", "@Then(\"^the results images should be displayed$\")\n\tpublic void the_results_images_should_be_displayed() throws Throwable {\n\t\thomepage.waitForPageToLoad(homepage.getTitle());\n\t\thomepage.waitForVisibility(homepage.imageContainer);\n\t}", "public String getResult() {\n\t\treturn ((WebElement) links.get(1)).getAttribute(\"alt\");\n\t}", "@Then(\"^click on \\\"([^\\\"]*)\\\" icon$\")\npublic void click_on_icon(String arg1) throws Throwable \n{\n\tThread.sleep(3000);\n\tdriver.findElement(By.xpath(\"//button[@class=' btn btn-primary ']\")).click();\n\tdriver.findElement(By.xpath(\"//div[@class='alert alert-success']\")).isDisplayed();\n\t \n\n}", "com.yahoo.xpathproto.TransformTestProtos.ContentImage getImageByHandler();", "public static void verifyFullViewImage(WebDriver driver) {\n FindElement.waitForElementXpath(driver, \"//div[@class = 'letterbox']//img[contains(@src,'.png')]\", \"full view modal image\");\n }", "@Test\n public void withAttribute_Matching() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EQUALS, \"en-US\").size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \"content\").size());\n assertEquals(0, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \" content\").size());\n }", "@Test\n public void testFlairImage33() { // FlairImage: 33\n FlairImage testi = new FlairImage(); \n assertEquals(\"From: FlairImage line: 35\", \"0|\", testi.toString()); \n assertEquals(\"From: FlairImage line: 36\", 0, testi.getNumber()); \n assertEquals(\"From: FlairImage line: 37\", \"\", testi.getName()); \n }", "@Test\t\r\n\r\npublic void forgot(){\n\t\r\n driver.findElement(By.partialLinkText(\"Forgot\")).click();\r\n System.out.println(\"the forgotpage title is \"+\" \"+driver.getTitle());\r\n String expectedTitle = \"Forgot Password | Can't Log In | Facebook\";\r\n String actualTitle = driver.getTitle();\r\n softassert.assertEquals(actualTitle, expectedTitle);\r\n softassert.assertAll();\r\n \r\n}", "@Test(enabled = true)\n public void mainLogo() {\n WebElement element = driver.findElement(By.className(\"large-logo\"));\n element.click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n //Variables\n String expectedLink = \"https://www.expedia.com/\";\n String actualLink = driver.getCurrentUrl();\n String expectedTitle = \"Expedia Travel: Vacation Homes, Hotels, Car Rentals, Flights & More\";\n String actualTitle = driver.getTitle();\n\n //Validate Links\n Assert.assertEquals(actualLink, expectedLink, \"Test Failed, Link Does Not Match\");\n Assert.assertEquals(actualTitle, expectedTitle, \"Title Does not match, Test Failed.\");\n }", "public String ImageControl(String image) {\n \n String tmp = null;\n \n if (image != null && !image.isEmpty()){\n tmp = image;\n } else {\n int num = (new Random()).nextInt(4);\n tmp = \"icon\"+num+\".png\";\n }\n \n return tmp;\n }", "public boolean verifyEmptyToDoImage() {\n if (validateAttributeContain(imageEmptyToDo, \"src\", \"images/icons/clipboard.png\", \"Image Empty ToDo\")) {\n return true;\n }\n return false;\n }", "public SNGTestCases RuleOfTheGame_TC1005() throws InterruptedException{\n \tLogin();\n \t waitForVisibilityOf(By.id(commonIdPath + \"/subject_image\"));\n List subject = driver.findElements(By.id(commonIdPath + \"/subject_image\"));\n ((WebElement) subject.get(0)).click();\n waitForVisibilityOf(By.id(\"com.pointedsquares.gamy5.android:id/info_icon\"));\n driver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/info_icon\")).click();\n waitForVisibilityOf(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'app_info_title')]\"));\n return new SNGTestCases(driver);\n\t}", "@Test\n public void normalCategoryFirstRangeInKgAndCm() {\n\n\n driver.findElement(By.xpath(\"//input[@name='wg']\")).sendKeys(\"59.3\");\n driver.findElement(By.xpath(\"//input[@name='ht']\")).sendKeys(\"179\");\n driver.findElement(By.xpath(\"//input[@name='cc']\")).click();\n Assert.assertEquals(driver.findElement(By.name(\"desc\")).getAttribute(\"value\"), \"Your category is Normal\",\n \"actual text is not: Your category is Normal\");\n }", "public static By for_text_exact(String text) {\n return By.xpath(\"//UIAStaticText[@visible=\\\"true\\\" and (@name=\\\"\" + text\n + \"\\\" or @hint=\\\"\" + text + \"\\\" or @label=\\\"\" + text\n + \"\\\" or @value=\\\"\" + text + \"\\\")]\");\n }", "@Then(\"^assert that the text \\\"([^\\\"]*)\\\" element has \\\"([^\\\"]*)\\\"$\")\n\tpublic void assert_that_the_text_element_has(String arg1, String arg2) throws Throwable {\n\t\tString[] parts = arg1.split(\"=\");\n\t\tString selector=parts[1];\n\t\tString result = driver.findElement(By.cssSelector(selector)).getText();\n\t\tAssert.assertTrue(\"Text is not included\", result.contains(arg2));\n\t\tSystem.out.println(\"Assert \"+ result +\" contain the text : \"+arg2 );\n\t}", "public Result testGetIcon() {\n try {\n assertNull(beanInfo.getIcon(BeanInfo.ICON_MONO_16x16));\n Bean1BeanInfo.verifyException();\n return passed();\n } catch (Exception e) {\n e.printStackTrace();\n return failed(e.getMessage());\n }\n }", "@Test\n public void VerifyTooltip() {\n String baseUrl = \"http://demo.guru99.com/test/social-icon.html\";\n String expectedTooltip = \"Github\";\n driver.get(baseUrl);\n driver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\n //Find element and get attribute\n WebElement gitHub = driver.findElement(By.xpath(\"//*[@title='Github']\"));\n String actualTooltip = gitHub.getAttribute(\"title\");\n\n System.out.println(\"======= TEST CASE 1: Github tooltip verification =======\");\n //Github tooltip verification point\n if (actualTooltip.equals(expectedTooltip)) {\n System.out.println(\"Actual Tooltip is: \" + actualTooltip);\n System.out.println(\"Expected Tooltip is: \" + expectedTooltip);\n System.out.println(\"Github tooltip verification is PASSED\");\n } else {\n softAssert.assertEquals(expectedTooltip, actualTooltip, \"Github tooltip validation is FAILED\");\n }\n\n\n //Get Tooltip by Actions Class - JQuery or CSS\n String secondUrl = \"http://demo.guru99.com/test/tooltip.html\";\n String expectedSecondTooltip = \"What's new in 3.2\";\n driver.navigate().to(secondUrl);\n driver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\n\n //Find element\n WebElement downloadNow = driver.findElement(By.xpath(\"//*[@id='download_now']\"));\n\n //Get tooltip by actions class\n Actions builder = new Actions(driver);\n builder.moveToElement(downloadNow).clickAndHold().build().perform();\n WebElement secondTooltip = driver.findElement(By.xpath(\"//*[@class='box']/div/a\"));\n String secondTooltipText = secondTooltip.getText();\n\n System.out.println(\"======= TEST CASE 2: What's new in 3.2 tooltip verification =======\");\n\n //Verification of the second tooltip\n if (secondTooltipText.equals(expectedSecondTooltip)) {\n System.out.println(\"Expected second tooltip is: \" + expectedSecondTooltip);\n System.out.println(\"Actual second tooltip is: \" + secondTooltipText);\n System.out.println(\"What's new in 3.2 tooltip verification is PASSED\");\n } else {\n softAssert.assertEquals(secondTooltipText, expectedSecondTooltip, \"What's new in 3.2 tooltip verification is FAILED.\");\n }\n\n }", "public void testStyleWhenCaretIsAfterImage()\n {\n deferTest(new Command()\n {\n public void execute()\n {\n doTestStyleWhenCaretIsAfterImage();\n }\n });\n }", "public static String customTextFilter(BufferedImage img, String txt) {\n\n int newHeight = img.getHeight() / 200;\n int newWidth = img.getWidth() / 200;\n String html = \"\";\n int aux = 0;\n\n for (int i = 0; i < 200; i++) {\n if (i > 0) {\n html += \"\\n<br>\\n\";\n }\n for (int j = 0; j < 200; j++) {\n if (aux == txt.length()) {\n html += \"<b>&nbsp</b>\";\n aux = 0;\n } else {\n Color c = regionAvgColor(j * newWidth, (j * newWidth) + newWidth,\n i * newHeight, (i * newHeight) + newHeight, newHeight,\n newWidth, img);\n html += \"<b style='color:rgb(\" + c.getRed() + \",\"\n + c.getGreen() + \",\" + c.getBlue() + \");'>\"\n + txt.substring(aux, aux + 1) + \"</b>\";\n aux++;\n }\n }\n }\n String style = \"body{\\nfont-size: 15px\\n}\";\n String title = \"Imagen Texto\";\n int styleIndex = HTML.indexOf(\"?S\"), titleIndex = HTML.indexOf(\"?T\"),\n bodyIndex = HTML.indexOf(\"?B\");\n String htmlFile = HTML.substring(0, styleIndex) + style;\n htmlFile += HTML.substring(styleIndex + 2, titleIndex) + title;\n htmlFile += HTML.substring(titleIndex + 2, bodyIndex) + html;\n htmlFile += HTML.substring(bodyIndex + 2);\n return htmlFile;\n }", "public void assertText(final String elementLocator, final String text);", "@Then(\"^assert that the text \\\"([^\\\"]*)\\\" element is not \\\"([^\\\"]*)\\\"$\")\n\tpublic void assert_that_the_text_element_is_not(String arg1, String arg2) throws Throwable {\n\t\tString[] parts = arg1.split(\"=\");\n\t\tString selector=parts[1];\n\t\tString result = driver.findElement(By.cssSelector(selector)).getText();\n\t\tassertNotEquals(result,arg2);\n\t\tSystem.out.println(\"Assert \"+ result +\" is not the text : \"+arg2 );\n\t}", "boolean isImageDisplayed();", "public void testGetSetImageImage() {\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/smallpill.png\").getImage());\n\t\t\n\t\t//SET NEW IMAGE\n\t\ttestNormal.setImage(testImage);\n\t\tassertEquals(testNormal.getImage(), testImage);\n\t}", "public boolean translateImageToText();", "private void imgDetected(Matcher matcher) {\n String component;\n matcher.reset();\n\n // store src value if <img> exist\n while (matcher.find()) {\n Data.imagesSrc.add(matcher.group(1));\n }\n\n // separate if the paragraph contain img\n // replace <img> with -+-img-+- to indicate image position in the text\n component = matcher.replaceAll(\"-+-img-+-\");\n\n //split the delimiter to structure image position\n String[] imageStructure = component.split(\"-\\\\+-\");\n\n // start looping the structured text\n int imageFoundIndex = 0;\n for (String structure : imageStructure) {\n // continue if the current index is not empty string \"\"\n if (!structure.trim().equals(\"\")) {\n // create ImageView if current index value equeal to \"img\"\n if (structure.trim().equals(\"img\")) {\n createImageView();\n imageFoundIndex++;\n } else {\n // else create textView for the text\n generateView(structure);\n }\n }\n }\n }", "public void VerifyitemGreyedout(String exp){\r\n\t\tString Expected = getValue(exp);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The unchecked item should be greyed out\");\r\n\t\ttry{\r\n\t\t\tVerifySpecificElementByProperty(locator_split(\"vfyItemgreyout\"), \"style\",Expected );\r\n\t\t\tSystem.out.println(exp+\" is present so the item is greyed out\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Third item is unchecked from Frequenlty bought items\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Third item is not unchecked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"chkFrequentlybrought\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public String verifyToolTipText(String object, String data) {\n\n\t\tlogger.debug(\"Verifying the ToolTip text\");\n\t\ttry {\n\t\t\tString actual = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object)))).getAttribute(OR.getProperty(\"ATTRIBUTE_ALT\"));\n\t\t\tString expected = data;\n\t\t\tlogger.debug(\"actual\" + actual);\n\t\t\tlogger.debug(\"expected\" + expected);\n\t\t\tif (actual.equals(expected))\n\t\t\t\treturn Constants.KEYWORD_PASS + \"-- ToolTip text verified-- \" + expected;\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \" -- ToolTip text not verified-- \" + actual + \" -- \" + expected;\n\t\t} catch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}catch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + \" Object not found \" + e.getMessage();\n\t\t}\n\n\t}", "private static List<InOut> getHtmlTestCases() {\n final List<InOut> testCases = new ArrayList<>();\n // <p> tag is allowed\n addTestCase(testCases, \"<p>test</p>\");\n // <h7> tag is not allowed\n addTestCase(testCases, \"<h7>test</h7>\", \"test\");\n // href's are allowed to http, https, mailto and ANET objects, but nofollow is added\n addTestCase(testCases, \"<a href=\\\"http://www.example.com/\\\">test</a>\",\n \"<a href=\\\"http://www.example.com/\\\" rel=\\\"nofollow\\\">test</a>\");\n addTestCase(testCases, \"<a href=\\\"https://www.example.com/\\\">test</a>\",\n \"<a href=\\\"https://www.example.com/\\\" rel=\\\"nofollow\\\">test</a>\");\n addTestCase(testCases, \"<a href=\\\"mailto:[email protected]/\\\">test</a>\",\n \"<a href=\\\"mailto:nobody&#64;example.com/\\\" rel=\\\"nofollow\\\">test</a>\");\n addTestCase(testCases,\n \"<a href=\\\"urn:anet:people:00000000-0000-0000-0000-000000000000\\\">test</a>\",\n \"<a href=\\\"urn:anet:people:00000000-0000-0000-0000-000000000000\\\" rel=\\\"nofollow\\\">test</a>\");\n // href's to ftp and data are not allowed\n addTestCase(testCases, \"<a href=\\\"ftp://ftp.example.com/\\\">test</a>\", \"test\");\n addTestCase(testCases, \"<a href=\\\"data:MMM\\\">test</a>\", \"test\");\n // but title is\n addTestCase(testCases, \"<a href=\\\"data:MMM\\\" title=\\\"test\\\">test</a>\",\n \"<a title=\\\"test\\\">test</a>\");\n // in-line <img> is allowed\n addTestCase(testCases, \"<img src=\\\"data:image/jpeg;base64;MMM\\\" />\");\n // <img> reference is not allowed\n addTestCase(testCases, \"<img src=\\\"http://www.wexample.com/logo.gif\\\" />\", \"\");\n // allowed <img> attributes\n addTestCase(testCases,\n \"<img title=\\\"test\\\" align=\\\"top\\\" alt=\\\"test\\\" border=\\\"0\\\" name=\\\"test\\\" height=\\\"1\\\" width=\\\"1\\\" hspace=\\\"0\\\" vspace=\\\"0\\\" />\");\n // disallowed <img> attributes\n addTestCase(testCases, \"<img crossorigin=\\\"anonymous\\\" />\", \"\");\n addTestCase(testCases, \"<img onload=\\\"test();\\\" />\", \"\");\n // <script> tag is disallowed\n addTestCase(testCases, \"<script type=\\\"text/javascript\\\">alert(\\\"Hello World!\\\");</script>\",\n \"\");\n return testCases;\n }", "public Image getTrebleClef();", "@Test\n public void normalCategorySecondRangeInKgAndCm() {\n\n driver.findElement(By.xpath(\"//input[@name='wg']\")).sendKeys(\"81\");\n driver.findElement(By.xpath(\"//input[@name='ht']\")).sendKeys(\"180\");\n driver.findElement(By.xpath(\"//input[@name='cc']\")).click();\n Assert.assertEquals(driver.findElement(By.name(\"desc\")).getAttribute(\"value\"), \"Your category is Normal\",\n \"actual text is not: Your category is Normal\");\n }", "void seTubeDownImage(String image);", "@Test //Associated with Confirm image icon exists (Scenario 2)\n public void confirmImageIconExistsTest() throws Exception {\n onView(withId(R.id.contact_new)).perform(click());\n\n //types in the name \"Shane\" into the name field for the Contact\n onView(withId(R.id.info_name)).perform(typeText(\"Shane\"), closeSoftKeyboard());\n\n //performs a click operation on the \"Submit Changes\" button\n onView(withId(R.id.info_edit_button)).perform(click());\n\n //performs a scroll action within the activity to take you to the necessary spot where\n //the newly created contact will be located\n onView(withId(R.id.contacts_list)).perform(RecyclerViewActions.scrollToPosition(0));\n\n //performs a click operation on the newly created Contact that is within the field\n //of view for the RecyclerView\n onView(withText(\"Shane\")).perform(click());\n\n //performs a click operation on the \"Edit Contact Info\" button\n onView(withId(R.id.info_edit_button)).perform(click());\n\n //confirms that the button on the Edit Contact screen associated with the id info_delete_button\n //has a string associated with it that reads \"Delete Contact\". This string and id is unique in the\n //app and only exists in this singular activity.\n onView(withId(R.id.info_delete_button)).check(matches(withText(R.string.info_delete)));\n\n onView(withId(R.id.info_pic)).check(matches(withContentDescription(R.string.image_contact)));\n\n //clicks the Delete Contact button\n onView(withId(R.id.info_delete_button)).perform(click());\n }", "public void setAlt(String alt) {\n DOM.setElementAttribute(getElement(), \"alt\", alt);\n }", "@Test(enabled = false)\n public void testCreateImage() {\n }", "public BufferedImage getImage(String word) throws CaptchaException\n {\n int wordLenght;\n //check word\n wordLenght = checkWordLenght(word);\n //create attribute string from word\n AttributedString attributedWord = getAttributedString(word, wordLenght);\n\n //create backgound\n BufferedImage background = getBackround();\n //apply text on background\n return pasteText(background, attributedWord);\n\n }", "public String clickImage(String object, String data) {\n\t\tlogger.debug(\"Clicking the image\");\n\t\tWebElement ele=null;\n\t\ttry {\n\t\t\t\n\t\t\twaitForPageLoad(driver);\t \n\t\t\tele = wait.until(explicitWaitForElement((By.xpath(OR.getProperty(object)))));\n\t\t\t\tele.click();\n\t\t\t\t//browserSpecificPause(object, data);\n\t\t\t\treturn Constants.KEYWORD_PASS;\n\t\t}\n\t\tcatch(TimeoutException ex)\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\tcatch(WebDriverException ex){\n\t\t\ttry{\n\t\t\t\tString exceptionMessage=ex.getMessage();\n\t\t\t\t\tif(exceptionMessage.contains(\"Element is not clickable at point\"))\n\t\t\t\t\t{\n\t\t\t\tif(new ApplicationSpecificKeywordEventsUtil().clickJs(ele).equals(Constants.KEYWORD_PASS))\n\t\t\t\t\t\t\treturn Constants.KEYWORD_PASS;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn Constants.KEYWORD_FAIL+ex.getMessage();\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t\treturn Constants.KEYWORD_FAIL+\"not able to Click\";\n\t\t\t\t} \n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + \" -- Not able to click on image\" + e.getMessage();\n\t\t}\n\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + \" -- Not able to click on image\" + e.getMessage();\n\t\t}\n\t}", "public static void verifyEqualsText_Funct(String desc, String actResult, String expResult) {\n\t\t// if (expResult.equalsIgnoreCase(actResult)) {\n\t\tif (expResult.equals(actResult)) {\n\t\t\tMyExtentListners.test.pass(\"Verify \" + desc + \" is displayed or not \" + \" || Expected : \" + \"\\'\"\n\t\t\t\t\t+ expResult + \"\\''\" + \" eqauls to Actual : \" + actResult);\n\t\t} else {\n\t\t\tMyExtentListners.test.fail(MarkupHelper\n\t\t\t\t\t.createLabel(\"Verify \" + desc + \" is diaplayed or not\" + \" || Expected : \" + \"\\'\" + expResult\n\t\t\t\t\t\t\t+ \"\\''\" + \" not eqauls to Actual : \" + \"\\'\" + actResult + \"\\'\", ExtentColor.RED));\n\t\t}\n\t}", "java.lang.String getImage();", "public java.lang.String getAlternateText() {\n return _courseImage.getAlternateText();\n }", "String getIcon();", "String getIcon();", "@Test\n public void prime(){\n\n WebElement input = driver.findElement(By.id(\"twotabsearchtextbox\"));\n input.sendKeys(\"wooden spoon\");\n WebElement searchButton = driver.findElement(By.className(\"nav-input\"));\n searchButton.click();\n\n String productName = \"COOKSMARK 5 Piece Bamboo Wood Nonstick Cooking Utensils - Wooden Spoons and Spatula Utensil Set with Multicolored Silicone Handles in Red Yellow Green Orange Blue\";\n\n WebElement primeButton = driver.findElement(By.xpath(\"(//i[@class='a-icon a-icon-checkbox'])[1]\"));\n primeButton.click();\n\n\n }", "@Test\r\n public void testGetImageWord() throws Exception {\r\n System.out.println(\"getImageWord\");\r\n String word = \"crowd\";\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n ImageWord expResult = null;\r\n ImageWord result = instance.getImageWord(word);\r\n System.out.println(result.toString());\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "public interface ITexturable<T extends AbstractElement> extends IElement<T> {\n /**\n * Sets the background image for an element\n */\n default T background(ResourceUrn urn) {\n get(ImageCmp.class).ifPresentOrElse(bgCmp -> {\n var texture = Assets.get(urn, Texture.class);\n if (texture.isEmpty())\n logger().warn(\"Failed to find texture {} for element {}\", urn, name());\n else\n bgCmp.setTexture(texture.get());\n }, () -> {\n var bgCmp = new ImageCmp(cast());\n var texture = Assets.get(urn, Texture.class);\n if (texture.isEmpty())\n logger().warn(\"Failed to find texture {} for element {}\", urn, name());\n else\n bgCmp.setTexture(texture.get());\n add(bgCmp);\n });\n return cast();\n }\n\n /**\n * Sets the background texture to the texture with the given name\n */\n default T background(Name name) {\n return background(new ResourceUrn(new Name(\"engine\"), new Name(\"textures\"), name));\n }\n\n}", "public String verifyMouseOverText(String object, String data) {\n\t\tlogger.debug(\"verifying Mouseover text\");\n\t\ttry {\n\n\t\t\tboolean flag = false;\n\t\t\tString actual = \"\";\n\t\t\tactual = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object)))).getAttribute(OR.getProperty(\"ATTRIBUTE_TITLE\"));\n\t\t\tlogger.debug(\"data\" + data);\n\t\t\tlogger.debug(\"act\" + actual);\n\t\t\tif (actual.equals(data)) {\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t\tif (flag)\n\t\t\t\treturn Constants.KEYWORD_PASS + \"--- Mouseover text matched\";\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \" -- Mouseover text not verified \" + actual + \" -- \" + data;\n\t\t} catch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}catch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + \" Object not found \" + e.getMessage();\n\t\t}\n\t}", "public String getXPageAlt();", "@Test\n public void obesityCategory() {\n\n driver.findElement(By.xpath(\"//input[@name='wg']\")).sendKeys(\"102.7\");\n driver.findElement(By.xpath(\"//input[@name='ht']\")).sendKeys(\"185\");\n driver.findElement(By.xpath(\"//input[@name='cc']\")).click();\n Assert.assertEquals(driver.findElement(By.name(\"desc\")).getAttribute(\"value\"), \"Your category is Overweight\",\n \"actual text is not: Your category is Overweight\");\n }", "@Test\r\n public void testCreateImageUrl() throws MovieDbException {\r\n LOG.info(\"createImageUrl\");\r\n MovieDb movie = tmdb.getMovieInfo(ID_MOVIE_BLADE_RUNNER, \"\");\r\n String result = tmdb.createImageUrl(movie.getPosterPath(), \"original\").toString();\r\n assertTrue(\"Error compiling image URL\", !result.isEmpty());\r\n }", "public void assertAttribute(final String elementLocator, final String attributeName, final String textPattern);", "@Then(\"user verifies that {string} message is displayed\")\n public void user_verifies_that_message_is_displayed(String expectedWarningMessage) {\n\n String actualWarningMessage = loginPage.getWarningMessageText();\n Assert.assertEquals(expectedWarningMessage,actualWarningMessage);\n // Assert.assertTrue(loginPage.warningMessage.isDisplayed()); //if the webelement is setted as public\n\n\n\n }", "public void verifyTrashToDoIcon() {\n try {\n waitForVisibleElement(trashToDoBtnEle, \"Trash ToDo icon\");\n NXGReports.addStep(\"Verify trash ToDo icon\", LogAs.PASSED, null);\n } catch (AssertionError e) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"TestScript Failed: Verify trash ToDo icon\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }", "public String content_pic_rule() {\n\t\treturn \"img[title~=屏幕快照]\";\n\t}", "public void clickAssertionAttach() {\r\n\t\tString Expected3 = \"Default certificate\";\r\n\t\tString Actualtext3 = driver.findElement(By.xpath(\"//tr[@class='row_even']/td[2]/a\")).getText();\r\n\t\tAssert.assertEquals(Actualtext3, Expected3);\r\n\t\tSystem.out.println(Actualtext3);\r\n\t}", "@Test\n public void withAttribute_Existing() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EXISTING, null).size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EXISTING, null).size());\n }", "public static void VerifyListIcon(String renderingControl){\n\t\ttry{\n\t\t\tactualListIcon=sitecoreObj.aboutusListIcon.getAttribute(\"class\");\n\t\t\tAssert.assertEquals(actualListIcon, expectedData.getProperty(\"aboutusListIcon\"));\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" List Icon - \"+actualListIcon);\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" List Icon - \"+expectedData.getProperty(\"aboutusListIcon\"));\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" List Icon are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" List Icon - \"+actualListIcon);\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" List Icon - \"+expectedData.getProperty(\"aboutusListIcon\"));\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" List Icon are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No List Icon on \" + renderingControl + \" element\");\n\t\t}\n\t}", "@Test\n public void testTftile() {\n TfTile tile = new TfTile(1);\n assertEquals(R.drawable.tftile_01, tile.getBackground());\n assertEquals(1, tile.getId());\n tile.setId(11);\n assertEquals(R.drawable.tftile_11, tile.getBackground());\n }", "private void verifyTextAndLabels(){\n common.explicitWaitVisibilityElement(\"//*[@id=\\\"content\\\"]/article/h2\");\n\n //Swedish labels\n common.timeoutMilliSeconds(500);\n textAndLabelsSwedish();\n\n //Change to English\n common.selectEnglish();\n\n //English labels\n textAndLabelsEnglish();\n }", "@Test\n public void thumbnailTest() {\n // TODO: test thumbnail\n }", "public String getDescription() {\r\n\t return \"Just accept image file\";\r\n\t }", "public void assertAttribute(final String attributeLocator, final String textPattern);", "public void VerifyShowOnlyInkAndTonerLink(String text){\r\n\t\tString Text = getValue(text);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+Text);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Show Only Ink And Toner Link - '\"+Text+\"' should be displayed\");\r\n\t\ttry{\r\n\t\t\tif(getText(locator_split(\"lnkShowOnlyInkAndToner\")).equalsIgnoreCase(Text)){\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Show Only Ink And Toner Link - '\"+Text+\"' is displayed\");\r\n\t\t\t\tSystem.out.println(\"Verified the Text -\"+Text);\r\n\t\t\t}else {\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Show Only Ink And Toner Link - '\"+Text+\"' is not displayed\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Show Only Ink And Toner Link - '\"+Text+\"' is not displayed\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkShowOnlyInkAndToner\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "@Test\n public void overweightCategorySecondRangeInKgAndCm() {\n\n driver.findElement(By.xpath(\"//input[@name='wg']\")).sendKeys(\"94\");\n driver.findElement(By.xpath(\"//input[@name='ht']\")).sendKeys(\"177\");\n driver.findElement(By.xpath(\"//input[@name='cc']\")).click();\n Assert.assertEquals(driver.findElement(By.name(\"desc\")).getAttribute(\"value\"), \"Your category is Overweight\",\n \"actual text is not: Your category is Overweight\");\n }", "public static void main(String[] args) {\n\t\tWebDriverManager.chromedriver().setup();\n\t\tdriver = new ChromeDriver();\n\t\tdriver.get(\"https://www.amazon.in/\");\n\t\t\n\t\tBy image= By.tagName(\"img\");\n\t\t\n\t\tList<String>altList=getElementAttrList(image, \"alt\");\n\t\tList<String>srclist=getElementAttrList(image, \"src\");\n \n System.out.println(altList.size());\t\n System.out.println(srclist.size());\t\n \n//\t\tList<WebElement> imageList = driver.findElements(By.tagName(\"img\"));\n//\n//\t\tSystem.out.println(\"total images: \" + imageList.size());\n//\n//\t\tfor(WebElement e:imageList)\n//\t\t{\n//\t\t\tString altvalue=e.getAttribute(\"alt\");\n//\t\t\tString srcvalue=e.getAttribute(\"src\");\n//\t\t\tSystem.out.println(altvalue);\n//\t\t\tSystem.out.println(srcvalue);\n//\t\t}\n\t}", "@When(\"^user clicks on image tab$\")\n\tpublic void user_clicks_on_image_tab() throws Throwable {\n\t\thomepage.waitForPageToLoad(\"Google Images\");\n\t\thomepage.waitForElementToBeClickable(homepage.imagesButton);\n\t\thomepage.clickOnElementUsingJs(homepage.imagesButton);\n\t}", "@Test(description = \"Verify Login page elements\")\n @Issue(\"EZ-8885\")\n void verifyTextElementsOnLoginPage() {\n LoginPage loginPage = new LoginPage(BaseUrl.loginPageBaseUrl());\n loginPage.open().getPageLogoLink();\n loginPage.getSectionTitle();\n loginPage.getTitleRelatedToFields();\n\n\n SoftAssertions softly = new SoftAssertions();\n softly.assertThat(loginPage.getPageLogoLink()).isEqualTo(\"https://hotline.ua/public/i/logo-v2.svg\");\n softly.assertThat(loginPage.getSectionTitle()).isEqualTo(\"Вход\");\n softly.assertThat(loginPage.getTitleRelatedToFields()).isEqualTo(\"Заполните поля\");\n softly.assertThat(getBrowserConsoleErrors()).isFalse();\n softly.assertAll();\n }", "java.lang.String getIcon();", "java.lang.String getIcon();", "public String verifyIconIsInActive(String object, String data) {\n\n\t\ttry {\n\n\t\t\tWebElement link = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object))));\n\t\t\tif (link.getAttribute(OR.getProperty(\"ATTRIBUTE_CLASS\")).equals(OR.getProperty(\"DISABLE_ICON_CLASS\"))) {\n\t\t\t\treturn Constants.KEYWORD_PASS + \"Icon is In Active\";\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\treturn Constants.KEYWORD_FAIL + \"Icon is Active\";\n\t\t\t}\n\n\t\t} catch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}catch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + e.getMessage();\n\t\t}\n\t}", "@Source(\"gr/grnet/pithos/resources/translate.png\")\n ImageResource selectAll();", "@Test\n public void getPicture_NoPictureExist(){\n Bitmap retrieved = testRecipe.getImage(appContext);\n assertNotEquals(\"getPicture - Not Null\", null, retrieved);\n }", "@Test\n public void testHelloNoTrail()\n {\n driver.findElement(By.linkText(\"Hello\")).click();\n WebElement e = driver.findElement(By.className(\"jumbotron\"));\n String elementText = e.getText();\n assertTrue(elementText.contains(\"Hello CS1632, from Prof. Laboon!\"));\n }", "@Test\n public void testSearchImages() {\n System.out.println(\"searchImages\");\n String image = \"saqhuss\";\n Docker instance = new Docker();\n String expResult = \"NAME\";\n String[] result = instance.searchImages(image).split(\"\\n\");;\n String[] res = result[0].split(\" \");\n assertEquals(expResult, res[0].trim());\n }", "public void setAlternateText(java.lang.String alternateText) {\n _courseImage.setAlternateText(alternateText);\n }" ]
[ "0.58485526", "0.56754243", "0.5487901", "0.5478162", "0.5448396", "0.54064333", "0.53817135", "0.53681356", "0.53573936", "0.53461844", "0.53321373", "0.5314191", "0.5285441", "0.5277879", "0.524006", "0.523332", "0.5211143", "0.5208792", "0.52022505", "0.5198242", "0.5193272", "0.51638824", "0.5132023", "0.51302046", "0.51212716", "0.51157033", "0.5106159", "0.50959015", "0.5053934", "0.5050087", "0.50490975", "0.5027114", "0.50052613", "0.5001245", "0.499259", "0.49791595", "0.4961646", "0.4956953", "0.49547672", "0.49519598", "0.49386588", "0.49384582", "0.49371648", "0.49307758", "0.49294156", "0.49191457", "0.4915155", "0.4914294", "0.49113047", "0.49038", "0.4890948", "0.4888832", "0.48872942", "0.4883108", "0.48774084", "0.48658487", "0.4863057", "0.48628983", "0.4862346", "0.48612958", "0.48499224", "0.48491478", "0.48351082", "0.4823481", "0.48198438", "0.4816636", "0.4810179", "0.48033237", "0.48033237", "0.48026842", "0.47994456", "0.47990543", "0.47897485", "0.47889593", "0.47875044", "0.47856438", "0.4783402", "0.47630012", "0.47574067", "0.47558144", "0.47556922", "0.4749846", "0.474123", "0.47306722", "0.47303253", "0.4720632", "0.4712029", "0.47118053", "0.47105128", "0.4709631", "0.47082144", "0.47074807", "0.47028524", "0.4695306", "0.4695306", "0.46935108", "0.46788475", "0.46738306", "0.46738136", "0.4669489", "0.46684155" ]
0.0
-1
click | link=Nouveau client |
protected void clickOnNouveauClient() { _currentPage = ((DoliTiersPage)_currentPage).clickOnNouveauClient(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void clickOnCreerClient() {\n\t\t\t_currentPage = ((DoliNouveauTiersPage)_currentPage).clickOnCreerClient();\n\t\t}", "HtmlPage clickLink();", "HtmlPage clickSiteLink();", "public void AdminLink(){\n\t\tAdminLink.click();\n\t}", "@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tclientAnchor.setHref(GWT.getHostPageBaseURL() + \"IT_Projekt.html\");\r\n\t\t}", "public void I_Should_click_My_Account_link(){\n\t MyAccountLink.click();\n\t \n}", "public void _linkClient(ModelElement client1);", "public void clickCreateAccLink()\n\t{\n \telementUtils.performElementClick(wbCreateAccLink);\n\t}", "@When(\"I click on add to compare list link\")\n public void i_click_on_add_to_compare_list_link() {\n BasePage.driverUtils.waitForWebElementToBeClickable(BasePage.htcOneMiniBluePage.getHtcOneMiniBlueAddToCompareListButton());\n BasePage.htcOneMiniBluePage.getHtcOneMiniBlueAddToCompareListButton().click();\n }", "@When(\"^Click on Compose hyperlink icon$\")\npublic void click_on_Compose_hyperlink_icon() throws Throwable \n{\n\tWebElement p=driver.findElement(By.partialLinkText(\"Compose\"));\n p.click();\n System.out.println(\"Page title after link click : \" + driver.getTitle());\n \n\n\n}", "@When(\"I click on the product comparision message link\")\n public void i_click_on_the_product_comparision_link() {\n BasePage.htcOneMiniBluePage.clickOnProductComparisionLink();\n }", "public void clickcreateuser(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Create new user link should be clicked\");\r\n\t\ttry{\r\n\t\t\twaitForElement(locator_split(\"lnkcreateuser\"));\r\n\t\t\tclick(locator_split(\"lnkcreateuser\"));\r\n\t\t\twaitForPageToLoad(400);\r\n\t\t\tSystem.out.println(\"Create new user link clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:-Create new user link is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Create new user link is not clicked\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public void clickLink(String link){\n\t\tSystem.out.println(\"CONTROLLER: LINK WAS CLICKED: \" + link);\n\t\tURL url_ = null;\n\t\ttry{\n\t\t\turl_ = new URL(new URL(this.url), link);\n\t\t\tthis.content = BrowsrDocumentValidator.assertIsValidBrowsrDocument(url_);\n\t\t\tthis.url = url_.toString();\n\t\t\tSystem.out.println(\"URL CONTROLLER:\" + this.url);\n\t\t} catch (Exception exception){\n\t\t\tthis.content = new Text(exception.toString());\n\t\t}\n\n\t}", "public void clicarLink(String link) {\n getDriver().findElement(By.linkText(link)).click();\n\t}", "public void clickOnContinueAsGuestUserLink()\n \t{\n \t\tproductRequirementsPageLocators.continueAsGuestUserLIink.click();\n\n \t}", "void issuedClick(String item);", "public void clickOnNewContactLink() {\n\t\tActions action=new Actions(driver);\n\t\taction.moveToElement(contactlink).build().perform();\n\t\tnewContactLink.click();\n\t}", "public void clickEditLink() {\r\n\t\tbtn_EditLink.click();\r\n\t}", "public void clickCreateAccountLink(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Create Account Link should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitForElement(locator_split(\"lnkCreateAccount\"));\r\n\t\t\tclick(locator_split(\"lnkCreateAccount\")); \r\n\t\t\tsleep(1000);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Create Account Link is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Create Account Link is not clicked \"+elementProperties.getProperty(\"lnkCreateAccount\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkCreateAccount\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t}", "public void clickOnServiceLink() {\n Reporter.addStepLog(\"Clicking on service link: \" + _link_service);\n clickOnElement(_link_service);\n log.info(\"Clicking on login link: \" + _link_service);\n }", "public String clickOnPresenternameLink() {\n String linkName=presenterNameLink.getText().substring(0, 21);\n waitAndClick(presenterNameLink);\n return linkName;\n\t}", "HtmlPage clickSiteName();", "@Override\n\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\tIntent i = new Intent(Intent.ACTION_VIEW, Uri\n\t\t\t\t\t\t\t\t\t\t.parse(fullsitelink));\n\t\t\t\t\t\t\t\tstartActivity(i);\n\n\t\t\t\t\t\t\t}", "public String clickLink(int _index) {\n String item_ = getItems().get(_index).getName();\n return tryRedirectIt(item_);\n// getForms().put(CST_ITEM, item_);\n// Item it_ = data_.getItem(item_);\n// return switchItem(it_);\n }", "public void myorders() {\n\t\t\t\r\n\t\t\t\r\n\t\tBy my=By.xpath(\"//a[@href='/my/orders/create?form']\");\r\n\t\tWebElement We_my=wt.ElementToBeClickable(my, 20);\r\n\t\tWe_my.click();\r\n\t\t}", "public void clickContactUS() {\n\t\tSystem.out.println(\"Clicked contactus link\");\n\t}", "@And(\"^user clicks on credit cards link$\")\r\n\t public void userclicksoncreditcardslink() {\r\n\t\t dbsdriver.findElement(By.xpath(\"//a[starts-with(@data-flk-success,'atNodeInserted') and text()='Credit Cards']\")).click();\r\n\t\t test.log(LogStatus.INFO, \"credit cards link is displayed\");\r\n\t }", "public void ClickApplyOnlineLink()\n {\n\n new WebDriverWait(driver, 30).until(ExpectedConditions.visibilityOf(ApplyOnlineLink)).click();\n\n }", "public void clickingOnGiftLink(WebDriver driver)\r\n\t {\r\n\t\t try\r\n\t\t {\r\n\t\t\t driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t driver.findElement(By.xpath(\"//a[contains(text(),'Gift')]\")).click();\r\n\t\t\t log.info(\"Clicked on View/Edit Credits Link\");\r\n\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS); \r\n\t\t }catch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t }", "public void clickOnLaceBootsLink(){\n Reporter.log(\"clicking on boots \"+ bootsLink+\"<br>\");\n clickOnElement(bootsLink);\n }", "public void Open() {\r\n\t click();\r\n\t }", "public ClientEditPage createNewClient() throws Exception {\n if (isNotAt()) {\n goTo();\n }\n newClientButton.click();\n Thread.sleep(Browser.getDelayAfterNewItemClick());\n return Pages.getClientEditPage();\n }", "public void clickRegisterLink() {\n $(registerLink).click();\n }", "public static void m15844c() {\n HashMap hashMap = new HashMap();\n hashMap.put(\"action_type\", \"click\");\n C8443c.m25663a().mo21606a(\"guest_connection_anchor\", hashMap, Room.class);\n }", "public void clickCreate() {\n\t\tbtnCreate.click();\n\t}", "void clickSomewhereElse();", "public void onUnlink()\n {\n getTextArea().setFocus(true);\n// clientJupiter.generate(treeOperationFactory.createLink(clientJupiter.getSiteId(),\n// getTextArea().getDocument().getSelection().getRangeAt(0), linkConfig.getUrl()));\n Console.getInstance().log(\"RTP: onUnlink\");\n }", "@Override\r\npublic void beforeClickOn(WebElement arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "public void clickOrderHistoryLink()\n\t{\n \telementUtils.performElementClick(wbOrderHistoryLink);\n\t}", "@Test\n @When(\"I navigate to Market\")\n public void s04_MarketOpen(){\n WebElement marketLink = driver.findElementByLinkText(\"Маркет\");\n marketLink.click();\n System.out.println(\"Step04 PASSED\");\n }", "public void clickOnMoreLatesBookLink() {\n\t}", "@Override\n\tpublic void onClick(ClickEvent arg0) {\n\t\t\n\t}", "@Test\n\tpublic void demoqaLinkIsClickable() {\n\t\tassertTrue(ServicesLogic.demoqaLinkIsClickable());\n\t}", "public OntologyLinkModeTool()\n \t{\n \tedu.tufts.vue.ontology.ui.OntologyBrowser.getBrowser().addOntologySelectionListener(this);\n \t//creationLink.setID(\"<creationLink>\"); // can't use label or it will draw one \n \t//invisibleLinkEndpoint.addLinkRef(creationLink);\n \tcreationLink=null;\n invisibleLinkEndpoint.setSize(0,0);\n \n \t}", "@When(\"^I click on \\\"([^\\\"]*)\\\" link$\")\n\tpublic void i_click_on_link(String arg1) throws Throwable {\n\t driver.findElement(By.linkText(arg1)).click();\n\t}", "@Override\r\n public void beforeClickOn(final WebElement arg0, final WebDriver arg1) {\n\r\n }", "public void initContactCreation() {\n click(By.linkText(\"add new\"));\n //wd.findElement(By.linkText(\"add new\")).click();\n }", "public void clickOnEngagementLink() {\n getLogger().info(\"Click on engagement link\");\n try {\n waitForClickableOfElement(eleEngagementLink, \"Wait for click on engagement link\");\n clickElement(eleEngagementLink, \"Click on engagement\");\n NXGReports.addStep(\"Verify click on engagement link \", LogAs.PASSED, null);\n } catch (Exception ex) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify click on engagement link \", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }", "public void clickDemandSideManagement();", "@Test\n public void clickResourceLink() {\n aboutPage.clickResourceLink();\n }", "HtmlPage clickDateLink();", "void openLink(Link target);", "private WriteAReviewPage clickOnStartHereButton(){\n click(button_StartHereLocator);\n return new WriteAReviewPage();\n }", "@UiHandler(\"talksLink\")\r\n\tprotected void onClickTalksLink(ClickEvent event) {\r\n\t\tnavigation.goTo(TalkListPage.class, PageStates.empty());\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n \tUri uri = Uri.parse(\"http://l-sls0483d.research.ltu.se/userdata/notes/\"+param1+\"/cchat.html\");\n \t\t\n \t\tIntent intent = new Intent(Intent.ACTION_VIEW, uri);\n \t\tstartActivity(intent);\n }", "@Given(\"User clicked on add first Travel leg link\")\n public void user_clicked_on_add_first_Travel_leg_link() {\n throw new cucumber.api.PendingException();\n }", "@And(\"^user clicks New button$\")\n\tpublic void user_clicks_New_button() throws Throwable {\n\t\ttry {\n\t\tSeleniumOperations.switchTo(\"actionid\");\n\t\t SeleniumOperations.clickButton(\"//a[@onclick='newItem()']\");\n\t\t HTMLReportGenerator.StepDetails(\"pass\", \"user clicks New button\", \"Expected:User should able to click New button,Actual:User clicked New button successfully \");\n\t\t// String op1=\"Expected:User should able to click New button:\"+\",Actual:User clicked New button Successfully,Exception:NA\";\n\t \t//System.out.println(op1);\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\tHTMLReportGenerator.StepDetails(\"Fail\", \"user clicks New button\", \"Expected:User should able to click New button,Actual:Failed to clicked New button \");\n\t\t\t//String op1=\"Expected:User should able to click Manage Company:\"+\",Actual:Falied to click New button ,Exception:\"+ex.getMessage();\n\t \t//System.out.println(op1);\n\t\t \n\t\t}\n\t}", "@When(\"user clicks on Careers link\")\n public void user_clicks_on_careers_link() throws InterruptedException {\n // bu.windowHandling();\n hp.search();\n }", "java.lang.String getClickURL();", "Link createLink();", "SimpleLink createSimpleLink();", "public void clickAddonLineActivity() {\r\n\t\tthis.clickAddOnlineActivity.click();\r\n\t}", "@Test(priority=1)\n public void adminPage(){\n\t\tdriver.findElement(By.xpath(\"/html/body/div[1]/nav/a[5]\")).click();\n\t}", "@Given(\"^user should open link$\")\r\n\tpublic void user_should_open_link() throws Throwable {\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n driver.manage().deleteAllCookies();\r\n\r\n driver.get(prop.getProperty(\"url\"));\r\n\r\n WebDriverWait wait = new WebDriverWait(driver,60);\r\n \t wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(prop.getProperty(\"Popup\"))));\r\n \t driver.findElement(By.xpath(prop.getProperty(\"Popup\"))).click();Thread.sleep(5000);\r\n\t}", "public static void goTo() {\n\tBrowser.instance.findElement(maintenanceMenu).click();\r\n\tWebElement element = Browser.instance.findElement(By.linkText(\"Tender and Bag Maintenance\"));\r\n Actions action = new Actions(Browser.instance);\r\n action.moveToElement(element).build().perform(); \r\n Browser.instance.findElement(By.linkText(\"Bag Types\")).click();\r\n // WebDriverWait wait = new WebDriverWait(Browser.instance,10);\r\n WebDriverWait wait = new WebDriverWait(Browser.instance,10);\r\n\twait.until(ExpectedConditions.elementToBeClickable(editButton));\r\n//\tBrowser.instance.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n}", "public void clickAssertionLinkAdd() {\r\n\t\tString Expected1 = \"The link has been added.\";\r\n\t\tString Actualtext1 = driver.findElement(By.xpath(\"//*[@id=\\\"content-section\\\"]/div/div[2]\")).getText();\r\n\t\tAssert.assertEquals(Actualtext1, Expected1);\r\n\t\tSystem.out.println(Actualtext1);\r\n\r\n\t}", "void onLinkClicked(@Nullable ContentId itemId);", "@Test\n public void clickContactLink() {\n aboutPage.clickContactLink();\n }", "public void generateEnquireLink();", "public void adding() {\n\t\t By cr=By.xpath(\"//a[@href=\\\"/cart?add&itemId=EST-2\\\"]\"); \r\n\t\tWebElement we_cr=wt.ElementToBeClickable(cr, 20);\r\n\t\twe_cr.click();\r\n\t}", "@Test\r\n public void testConceptsButton() {\r\n WicketTester tester = new WicketTester(new GreenometerApplication());\r\n tester.startPage(StopLightPage.class);\r\n tester.assertRenderedPage(StopLightPage.class);\r\n\r\n tester.clickLink(\"ConceptsPageButton\", false);\r\n tester.assertRenderedPage(ConceptsPage.class);\r\n }", "public void clickDashboardLink() {\n this.action.click(this.dashboardLink);\n }", "private void clickInvite(){\n WebDriverHelper.clickElement(inviteButton);\n }", "private void viewPageClicked() {\n //--\n //-- WRITE YOUR CODE HERE!\n //--\n try{\n Desktop d = Desktop.getDesktop();\n d.browse(new URI(itemView.getItem().getURL()));\n }catch(Exception e){\n e.printStackTrace();\n }\n\n showMessage(\"View clicked!\");\n }", "@Override\n public void buttonClick(ClickEvent event) {\n \tgetUI().getNavigator().navigateTo(NAME + \"/\" + contenView);\n }", "public void testGUI(){\n \tFile xml = new File(testData,\"html/htmlsidekick.html\");\n \t\n \tTestUtils.openFile(xml.getPath());\n\t\t\n \t// wait for end of parsing\n \tdoInBetween(new Runnable(){\n \t\t\tpublic void run(){\n \t\t\t\taction(\"sidekick-parse\",1);\n \t\t}}, \n \t\tmessageOfClassCondition(sidekick.SideKickUpdate.class),\n \t\t10000);\n\t\t\n \tTestUtils.view().getTextArea().scrollTo(3319,false);\n\t\tfinal java.awt.Point hrefP = TestUtils.view().getTextArea().offsetToXY(3319);\n\t\threfP.translate(30, 10);\n\t\tfinal JEditTextAreaFixture tf = new JEditTextAreaFixture(TestUtils.robot(),TestUtils.view().getTextArea()); \n\n\t\t// doesn't work: the hyperlink is not triggered...\n\t\ttf.robot.moveMouse(tf.target,hrefP);\n\t\ttf.robot.pressModifiers(InputEvent.CTRL_DOWN_MASK);\n\t\tPause.pause(2000);\n\t\threfP.translate(10,4);\n\t\ttf.robot.moveMouse(tf.target,hrefP);\n\t\tPause.pause(4000);\n\t\ttf.robot.click(tf.target, MouseButton.LEFT_BUTTON);\n\t\ttf.robot.releaseModifiers(InputEvent.CTRL_DOWN_MASK);\n\t}", "@Test(priority = 5)\n public void openDifferentElementsPageTest() {\n driver.findElement(new By.ByLinkText(\"SERVICE\")).click();\n driver.findElement(By.xpath(\"//a[contains(text(),'Different elements')]\")).click();\n }", "public void clickWishlistLink()\n\t{\n \telementUtils.performElementClick(wbWishlistLink);\n\t}", "private void viewPageClicked(ActionEvent event) {\n\n Item tempItem = new Item();\n String itemURL = tempItem.itemURL;\n Desktop dk = Desktop.getDesktop();\n try{\n dk.browse(new java.net.URI(itemURL));\n }catch(IOException | URISyntaxException e){\n System.out.println(\"The URL on file is invalid.\");\n }\n\n showMessage(\"Visiting Item Web Page\");\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n \tUri uri = Uri.parse(\"http://l-sls0483d.research.ltu.se/userdata/notes/\"+param1+\"/notes.html\");\n \t\t\n \t\n \t\tIntent intent = new Intent(Intent.ACTION_VIEW, uri);\n \t\tstartActivity(intent);\n \n }", "@DISPID(-2147412104)\n @PropGet\n java.lang.Object onclick();", "@Override\n\tprotected void OnClick() {\n\t\t\n\t}", "public void onClick$cancelEditClientButton() {\n\t\tExecutions.sendRedirect(\"queryClients.zul\");\n\t}", "public void openPortal(String id){\n\n\n\n\n }", "default public void clickMenu() {\n\t\tremoteControlAction(RemoteControlKeyword.MENU);\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n \tUri uri = Uri.parse(\"http://l-sls0483d.research.ltu.se/userdata/notes/\"+param1+\"/notes.html\");\n \t\n \t\tIntent intent = new Intent(Intent.ACTION_VIEW, uri);\n \t\tstartActivity(intent);\n }", "@When(\"^Click on Contactus Option$\")\r\n\tpublic void click_on_Contactus_Option() {\n\t\tnop.click(\"//*[@id=\\\"contact-link\\\"]/a\"); //clicking contact us option\r\n\t\t\r\n\t}", "public void clickOnSellAMotorcycleLink() {\r\n\t\tprint(\"Click on Sell A Motorcycle Link\");\r\n\t\tlocator = Locator.MyTrader.Sell_A_Motorcycle.value;\r\n\t\twaitForElementPresentInDom(2);\r\n\t\tclickOn(locator);\r\n\t}", "@When(\"I click on the Create new Project\")\n public void i_click_on_the_create_new_project(){\n\n i_click_on_create_a_new_project();\n }", "@Then(\"^user clicks on new customer tab$\")\n\tpublic void user_clicks_on_new_customer_tab() {\n\t driver.findElement(By.xpath(\"//a[@href='addcustomerpage.php']\")).click();\n\t \n\t}", "public void clickOnCreateButton() {\n\t\twaitForElement(createButton);\n\t\tclickOn(createButton);\n\t}", "public void onClick(ClickEvent event) {\n\t\t\t\tsendNameToServer();\n\t\t\t}", "LINK createLINK();", "@Override\r\npublic void afterClickOn(WebElement arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "@Test\n\tpublic void verifycustomerSupportlink() {\n\t\tKeywords.clickOnElement(PropertiesFile.getLocator(\"Spportlink\")[0],PropertiesFile.getLocator(\"Spportlink\")[1]);\n\t\tSystem.out.println(\"24*7 goCare Support link is Displayed on Header\");\n\t\tConstants.driver.manage().timeouts().implicitlyWait(60,TimeUnit.SECONDS) ;\n\t\tKeywords.terminateBrowser();\n\n\t}", "public void showNewLoanTab(Client client) {\n loanTabModel.getNewLoanRequestPanel().setVisible(true);\n //this.revalidate();\n //this.repaint();\n }", "public void clickedPresentationNew() {\n\t\t\n\t}", "@Override\r\n public void afterClickOn(final WebElement arg0, final WebDriver arg1) {\n\r\n }", "public void onAddByWebSitePressed( ) {\n Router.Instance().changeView(Router.Views.AddFromWebSite);\n }", "@Override\n public void onItemClick(String url) {\n RxBus2.getInstance().post(Constants.SHOW_WEBVIEW, url);\n RxBus3.getInstance().post(Constants.SHOW_WEBVIEW, url);\n }" ]
[ "0.68572885", "0.6706976", "0.63808554", "0.63673127", "0.63296163", "0.62224036", "0.60803545", "0.60668606", "0.60214776", "0.59102905", "0.58192503", "0.58155143", "0.5804207", "0.5800836", "0.5786893", "0.5751543", "0.574301", "0.5736859", "0.5723695", "0.5718649", "0.57067645", "0.5693106", "0.5685907", "0.5675025", "0.5666911", "0.5655118", "0.56309056", "0.5595991", "0.5591071", "0.55846536", "0.5583902", "0.55825883", "0.5578476", "0.55737066", "0.557282", "0.55727917", "0.55712736", "0.55594844", "0.5553223", "0.5540584", "0.5533014", "0.5517665", "0.551622", "0.55040514", "0.54986155", "0.54960334", "0.54936874", "0.5489656", "0.5473193", "0.5471728", "0.5468992", "0.54667777", "0.54606354", "0.5456065", "0.545475", "0.544711", "0.54439014", "0.5442923", "0.5442811", "0.5433447", "0.5432049", "0.5427114", "0.54251885", "0.5423503", "0.54214203", "0.5419625", "0.5417618", "0.5416929", "0.54152536", "0.53948426", "0.53927624", "0.53900814", "0.5372877", "0.5368613", "0.5368498", "0.53608453", "0.53572345", "0.53570825", "0.5355248", "0.5351763", "0.5351594", "0.53438187", "0.53433645", "0.53275174", "0.5327256", "0.53261083", "0.5320041", "0.5316327", "0.53139836", "0.5313492", "0.5313275", "0.5309519", "0.53092307", "0.53071487", "0.5305896", "0.52906287", "0.5267443", "0.5266988", "0.5264803", "0.5256017" ]
0.7501469
0
click | css=center > input.button |
protected void clickOnCreerClient() { _currentPage = ((DoliNouveauTiersPage)_currentPage).clickOnCreerClient(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clickSearchButton() {\n\t\tsearchButton.click();\n\t}", "public void clickOnEditButton() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-btn.ant-btn-primary.ant-btn-circle\"), SHORTWAIT);\r\n\t}", "@WebElementLocator(webDesktop = \"//input[@type='submit']\",webPhone = \"//input[@type='submit']\")\n private static WebElement buttonSubmit() {\n return getDriver().findElement(By.xpath(new WebElementLocatorFactory().getLocator(LoginPage.class, \"buttonSubmit\")));\n }", "WebElement getSearchButton();", "public void selectSubmitButton() {\n\t\tel = Browser.getDriver().findElement(element_submit_button);\n\t\tuihelper.click(el);\n\t}", "public void clickOnSearchButton() {\n elementControl.clickElement(searchButton);\n }", "public void clickOnLoginButton(){\n\t\tthis.loginButton.click();\n\t}", "public SelenideElement submitButton() {\n return formPageRoot().$(By.xpath (\"//button[@type='submit']\")); \n }", "@When(\"^Clicking on login button$\")\npublic void clicking_on_login_button() throws Throwable {\n driver.findElement(By.xpath(\"//*[@id=\\\"loginfrm\\\"]/button\")).click();\n}", "public void clickLoginBtn() {\r\n\t\tthis.loginBtn.click(); \r\n\t}", "public void selectAttributeClickOK() {\n $(attributeClickOk).click();\n }", "@Test\n public final void testClickButton() {\n spysizedialog.getStartButton().doClick();\n }", "public void clickSubmitButton(){\n actionsWithOurElements.clickOnElement(buttonSubmit);\n }", "@And(\"click on login button\")\n\tpublic void click_on_login_button() {\n\t\tSystem.out.println(\"click on login button\");\n\t\tdriver.findElement(By.name(\"Submit\")).click();\n\t \n\t}", "@When(\"^click on Login Button$\")\npublic void click_on_Login_Button() throws Throwable \n{\n\tdriver.findElement(By.id(\"form-login_submitAuth\")).click();\n}", "public void clickgoButton(){\n \n \t \n driver.findElement(By.cssSelector(goButton)).click();\n }", "public void clickbtnFilter() {\n\t\twaitForElementClickable(10,btnFilter);\n\t\tclickByJavaScript(btnFilter);\n\t\tsleep(3);\n\t}", "public void clickSubmitSearchButton(){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Search Button should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"btnSearchSubmit\"));\r\n\t\t\tclick(locator_split(\"btnSearchSubmit\"));\r\n\t\t\twaitForPageToLoad(10);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Search Button is clicked\");\r\n\t\t\tSystem.out.println(\"Sarch icon is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Search Button is not clicked \"+elementProperties.getProperty(\"btnSearchSubmit\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btnSearchSubmit\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public HTMLInputElement getElementBtnPrincipal() { return this.$element_BtnPrincipal; }", "public void irParaPaginaDeLogin (){\n\n click(By.className(btnLoginClass));\n }", "@Then(\"user clicks on apply button\")\r\n\tpublic void user_clicks_on_apply_button() {\n\t WebElement element = Browser.session.findElement(By.xpath(\"//*[@type='submit']\"));\r\n\t try {\r\n\t\t\tThread.sleep(5000);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t element.click();\r\n\t}", "public void clickOnUpdateButton() {\r\n\t\tsafeJavaScriptClick(updateButton);\r\n\t}", "public interface ButtonQuery extends ElementQuery<Button, StateProperty<Button>>, ButtonProvider {\n}", "public void clickButton()\n {\n fieldChangeNotify( 0 );\n }", "public void clickSubmitInkAndTonnerSearchButton(){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Ink and Tonner Search Button should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"btnInkSeacrh\"));\r\n\t\t\tclick(locator_split(\"btnInkSeacrh\"));\r\n\t\t\twaitForPageToLoad(10);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Ink and Tonner Search Button is clicked\");\r\n\t\t\tSystem.out.println(\"Ink and Tonner Search icon is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Ink and Tonner Search Button is not clicked \"+elementProperties.getProperty(\"btnSearchSubmit\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btnInkSeacrh\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public void clickOnDeleteButton() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-btn.ant-btn-danger.ant-btn-circle\"), MEDIUMWAIT);\r\n\t}", "public void clickSearchButton(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- SearchButton should be clicked\");\r\n\t\ttry{\r\n\t\t\tsleep(3000);\r\n\t\t\twaitforElementVisible(locator_split(\"BybtnSearch\"));\r\n\t\t\tclick(locator_split(\"BybtnSearch\"));\r\n\t\t\twaitForPageToLoad(100);\r\n\t\t\tSystem.out.println(\"SearchButton is clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- SearchButton is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- SearchButton is not clicked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"BybtnSearch\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void buttonPressed(){\r\n\t\tsetBorder(new BevelBorder(10));\r\n\t}", "public void click() {\n\t\tSystem.out.println(\"LinuxButton Click\");\r\n\t}", "public void clickOnLoginButton() {\n\t\tutil.clickOnElement(this.loginPageLocators.getLoginButtonElement());\n\t}", "@When(\"^click on login button$\")\n\tpublic void click_on_login_button() throws Throwable {\n\t\tdriver.findElement(By.xpath(\"//input[@name='btnLogin']\")).click();\n\t}", "public void buttonClick() {\n\t\tdriver.get(\"https://es.wikipedia.org\");\n\t\tWebElement input = driver.findElement(By.id(\"searchInput\"));\n\t\tinput.sendKeys(\"React\");\n\t\tinput.clear();\n\t\tinput.sendKeys(\"Angular\");\n\t\t\n\t\tWebElement button = driver.findElement(By.id(\"searchButton\"));\n\t\tbutton.click();\n\t}", "@And(\"^I click the signin button$\")\n public void iClickTheSigninButton() throws Throwable {\n }", "public Command click() {\r\n\t\treturn command;\r\n\t}", "void clickSomewhereElse();", "public void buttonClicked();", "private void button1MouseClicked(MouseEvent e) {\n }", "private void btnLogin(ActionEvent e) {\n }", "@Step\n public void clickRegistrationButton(){\n actionWithWebElements.clickOnElement(registrationButton);\n }", "Button getBtn();", "public void click_SIGN_IN() {\r\n\t\tbtn_SIGN_IN.click();\r\n\t}", "public void clickEditButton(){\r\n\t\t\r\n\t\tMcsElement.getElementByXpath(driver, \"//div[contains(@class,'x-tab-panel-noborder') and not(contains(@class,'x-hide-display'))]//button[contains(@class,'icon-ov-edit')]\").click();\r\n\t\t\r\n\t}", "private void button1MouseClicked(MouseEvent e) {\n\t}", "public void clickloginbutton(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Login Button should be clicked\");\r\n\t\ttry{\r\n\t\t\tclick(locator_split(\"btnLogin\"));\r\n\t\t\tsleep(2000);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Login Button is clicked\");\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Login button is not clicked with WebElement \"+elementProperties.getProperty(\"btnLogin\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btnLogin\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void ClickChecoutSubmitbutton(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Checkout Registration submit button should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\tclick(locator_split(\"btncheckoutregistrationsubmit\"));\r\n\t\t\tSystem.out.println(\"Checkout Registration submit button is clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Checkout Registration submit button is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Checkout Registration submit button is not clicked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btncheckoutregistrationsubmit\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "private void button1MousePressed(MouseEvent e) {\n }", "@Then (\"click on compose button\")\npublic void composeMail()\n{\n\t\tdriver.findElement(By.xpath(\"//div[@class='T-I T-I-KE L3' and text()='Compose']\")).click();\n}", "public void clickSignInButton() {\r\n\t\tsignInButton = driver.findElement(signInButtonSelector);\r\n\t\tsignInButton.click();\r\n\t\t\r\n\t}", "@Test(priority =1)\r\n\tpublic void button() {\r\n button = driver.findElement(By.cssSelector(\"button.black\"));\r\n assertFalse(button.isDisplayed());\r\n //sf.assertFalse(button.isDisplayed());\r\n System.out.println(\"Print this\");\r\n\t}", "@Override\r\n\tpublic void mousePressed(MouseEvent me) {\r\n\t\tbuttonType = me.getButton();\r\n\t\tselect(me.getX(), me.getY());\r\n\t}", "public static void pushApplySiteSettingsButton()\n\t\n\t{\n//\t\tMoveAndClick.OneElement(\"//input[@value='Log in now']\");\n\t\t\n\t}", "public void clickOnLogin() {\n\t\tWebElement loginBtn=driver.findElement(loginButton);\n\t\tif(loginBtn.isDisplayed())\n\t\t\tloginBtn.click();\n\t}", "@When(\"I click on the search button\")\n\tpublic void i_click_on_search_button() {\n\t\tdriver.findElement(By.xpath(searchbtn)).click();\n\t}", "public void clickButton(String locator) {\n\t\tclickOnElement(loginPageProperties.getProperty(locator));\n\t}", "@DISPID(-2147412104)\n @PropGet\n java.lang.Object onclick();", "@Step\r\n\tpublic void clickSubmit() {\r\n\t\tLOGGER.info(\"Clicking submit\");\r\n\t\tspeedoSubmit.click();\r\n\t}", "public void acceptTenderButton() {\n\t\tBy elem = By.cssSelector(\"button\");\n\t\tList<WebElement> elements = driver.findElements(elem);\n\t\t\n\t\tfor (WebElement item : elements) {\n\t\t\tString test = item.getAttribute(\"innerHTML\");\n\t\t\tif (test.contains(\"ACCEPT TENDER\")) {\n\t\t\t\titem.click();\n\t\t\t}\n\t\t}\n\t}", "@And (\"^I click on \\\"([^\\\"]*)\\\"$\")\n\tpublic void click_on(String object){\n\t\tString result = selenium.clickButton(object);\n\t\tAssert.assertEquals(selenium.result_pass, result);\n\t}", "public void performClick() {\n\t\tgetWrappedElement().click();\n\t}", "public void clickIconSignin()\n\t{\n \telementUtils.performElementClick(wbIconSignin); //wbIconSignin.click();\n\t}", "public void clickLikeBtn() {\n likeBtn.click();\n }", "public void clickSalvar (){driver.findElement(botaoSalvar).click();}", "void buttonPressed(ButtonType type);", "public final void click() {\n getUnderlyingElement().click();\n }", "@And(\"clicks on login button\")\n\tpublic void clicks_on_login_button() {\n\t\tdriver.findElement(By.id(\"login\")).click();\n\t\t\n\n\t}", "public void clickOnAddVehicleButton() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-btn.ant-btn-primary\"), SHORTWAIT);\r\n\t}", "public void clickOnProceedToCheckoutButton()\n \t{\n \t\tproductRequirementsPageLocators.clickOnProceedToCheckoutButton.click();\n\n \t}", "@Then(\"^click on \\\"([^\\\"]*)\\\" icon$\")\npublic void click_on_icon(String arg1) throws Throwable \n{\n\tThread.sleep(3000);\n\tdriver.findElement(By.xpath(\"//button[@class=' btn btn-primary ']\")).click();\n\tdriver.findElement(By.xpath(\"//div[@class='alert alert-success']\")).isDisplayed();\n\t \n\n}", "public void ClickMyAccountSubmitbutton(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account Registration submit button should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\tclick(locator_split(\"btnMyAccountSubmit\"));\r\n\t\t\tSystem.out.println(\"Checkout Registration submit button is clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- My Account Registration submit button is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- My Account Registration submit button is not clicked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btnMyAccountSubmit\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void clickLoginButton() {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying the login button is available or not\");\n\t\tAssert.assertTrue(clickLoginButton.isDisplayed());\n\t\tclickLoginButton.click();\n\t}", "@Step\n public void clickSendSMSButton(){\n actionWithWebElements.clickOnElement(sendSMSButton);\n }", "@Then(\"^Click On Send Button$\")\r\n\tpublic void click_On_Send_Button() {\n\t\tnop.click(\"//*[@id=\\\"submitMessage\\\"]/span\"); \r\n\t \r\n\t}", "public void clickOnArchiveButtonInMarkAsCompletePopup() {\n getLogger().info(\"Click on archive button in mark as complete button\");\n try {\n waitForClickableOfElement(archiveMarkPopupBtn, \"Wait for click on archive button\");\n clickElement(archiveMarkPopupBtn, \"Click on archive button\");\n NXGReports.addStep(\"Verify click on archive button in mark as complete popup successful \", LogAs.PASSED, null);\n } catch (Exception ex) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify click on archive button in mark as complete popup fail\", LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }", "public void clickOnSubmitButton() throws FileNotFoundException, IOException, ParseException, InterruptedException\n\t{\n\t\twaitForVisibility(sbmnit);\n\t\tsbmnit.click();\n\t}", "@When(\"^I click on login button$\")\n public void iClickOnLoginButton() throws Throwable {\n }", "@Override\r\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getButton());\r\n\r\n // MouseEvent.BUTTON3 es el boton derecho\r\n }", "public void clickBulkActions() {\n btnBulkActions.click();\n }", "public void clickSearch() {\n\t\twaitForDocumentReady(5);\n\t\tlog.debug(\"Clicking on search button\");\n\t\tclickOn(search_button, 20);\n\t\tlog.info(\"Clicked on search button\");\n\t\tlogger.log(Status.INFO, \"Search for cruise completed\");\n\t\t\n\t}", "public void clickLogin() {\n\t\t driver.findElement(loginBtn).click();\n\t }", "public void clickCheckoutButton(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- CheckOut button should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitForElement(locator_split(\"btnCheckout\"));\r\n\t\t\tclick(locator_split(\"btnCheckout\")); \r\n\t\t\tsleep(1000);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- CheckOut button is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- CheckOut button is not clicked \"+elementProperties.getProperty(\"btnCheckout\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btnCheckout\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t\tReporter.log(\"Clicked on Checkout button\");\r\n\t}", "@Test(enabled = true, priority = 8)\n\tpublic void loginButtonTest03() {\n\t\tdriver.findElement(By.cssSelector(\"#cms-login-submit\")).click();\n\n\t}", "public HTMLInputElement getElementBtnSalir() { return this.$element_BtnSalir; }", "@FXML\n private void mouseClicked(MouseEvent event) {\n checkClick(event);\n }", "@When(\"User clicks on Find Details button\")\r\n\tpublic void user_clicks_on_find_details_button() \r\n\t{\n\t driver.findElement(By.xpath(\"//input[@type='submit']\")).click();\r\n\t}", "private Technique clickButton(TextButton button) {\n\t\tInputEvent event1 = new InputEvent();\n event1.setType(InputEvent.Type.touchDown);\n button.fire(event1);\n InputEvent event2 = new InputEvent();\n event2.setType(InputEvent.Type.touchUp);\n button.fire(event2);\n return selectedTechnique;\n\t}", "@And(\"^I click on \\\"([^\\\"]*)\\\"$\")\r\n\tpublic void i_click_On_Button(String actkey) throws Throwable {\n\t\tThread.sleep(5000);\r\n\t\t//loginPage.getDriver().findElement(By.xpath(\".//*[contains(@value,'Edit')]\")).click();\r\n\t\tenduser.Qos_screen_edit_and_save(actkey);\r\n\t\t\r\n\t}", "public WebElement btnFirstOption()\n\t{\n\t\treturn getDriver().findElement(By.cssSelector(\"#preformatted-coverages-auto-plans-1 > div.preformatted-coverages__content > a\"));\n\t}", "public static Button select(String texturePrefix) {\n float xOffset = (Gdx.graphics.getWidth() - EntityType.BUTTON.getWidth() * 4.0f) / 5.0f;\n float spacing = (EntityType.BUTTON.getWidth() + xOffset);\n return new Button(\n new Vector2(xOffset + spacing * ((boatSelectionButtonCount++)%4), 100),\n texturePrefix + activeSuffix,\n texturePrefix + inactiveSuffix\n );\n }", "public static void clickOnAmazon(By locator){\n\t\twebAction(locator).click();\n\t}", "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 clickSaveChangesButton() {\n\t\tlog.info(\"Verifying the login button is available or not\");\n\t\tAssert.assertTrue(clickSaveChangesButton.isDisplayed());\n\t\tclickSaveChangesButton.click();\n\t}", "public void setButtonSelection(String action);", "private static By bButton(String sBy) {\n String sBy1 = sBy.toLowerCase().trim();\n String sBy2 = \"Continue\";\n switch(sBy1){\n case \"continue\": sBy2 = \"Continue\";\n break;\n case \"complete\": sBy2 = \"Complete\";\n break;\n case \"mvp plans\": sBy2 = \"MVP Plans\";\n break;\n case \"vip report\": sBy2 = \"VIP Report\";\n break;\n }\n String locator = \"//button[text()='\"+sBy2+\"']\";\n return By.xpath(locator) ;\n }", "public void clickSubmitOnly() {\r\n\t\tutilities.clickOnElement(btnSubmit);\r\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\tJLabel button = (JLabel)e.getSource();\n\t\t//BorderFactory.createLoweredBevelBorder());\n\t\t\t\n\t\t}", "public Result clickSearch() {\n\t\tthis.searchButton.click();\r\n\t\treturn new Result(driver);\r\n\t}", "public HTMLInputElement getElementBtnGrabar() { return this.$element_BtnGrabar; }", "public HTMLInputElement getElementBtnAyuda() { return this.$element_BtnAyuda; }", "public void submit_intsatpos(View button) {\n }", "@OnClick(R.id.login_btn)\n void loginClick() {\n mPresenter.clickOnLogin();\n }", "public void clickApplyButtonInMyPassword() throws UIAutomationException{\t\r\n\t\telementController.requireElementSmart(fileName,\"Apply Button In My Password\",GlobalVariables.configuration.getAttrSearchList(), \"Apply Button In My Password\");\r\n\t\tUIActions.click(fileName,\"Apply Button In My Password\",GlobalVariables.configuration.getAttrSearchList(), \"Apply Button In My Password\");\r\n\t\tUIActions.getText(fileName, \"Password Changed Notification\",GlobalVariables.configuration.getAttrSearchList() , \"Password Changed Notification\");\r\n\t\t}" ]
[ "0.591391", "0.58722806", "0.58314735", "0.58255154", "0.5760596", "0.5736589", "0.5707859", "0.57071596", "0.5700977", "0.5697649", "0.56138754", "0.56000394", "0.5545196", "0.5540852", "0.5497452", "0.5477141", "0.5476695", "0.5467649", "0.54627013", "0.54317135", "0.5427804", "0.5426339", "0.54055023", "0.54016364", "0.5387785", "0.5383402", "0.53637576", "0.5351506", "0.5328043", "0.53243846", "0.5320419", "0.5318867", "0.5308826", "0.53043437", "0.529776", "0.5296114", "0.5270851", "0.52699274", "0.5245517", "0.5243379", "0.52407223", "0.523709", "0.5227621", "0.52239215", "0.5221029", "0.5213604", "0.5208155", "0.52037233", "0.52019864", "0.5198363", "0.5179895", "0.5171399", "0.5158706", "0.51426184", "0.51365304", "0.51342034", "0.5121295", "0.5121127", "0.5121021", "0.5113404", "0.51133955", "0.51124537", "0.5109181", "0.51082194", "0.5106357", "0.5101616", "0.5097239", "0.5095331", "0.5091984", "0.5090485", "0.5082178", "0.5080892", "0.5071956", "0.50681406", "0.50657463", "0.50621825", "0.5053712", "0.5053675", "0.5052663", "0.50469327", "0.5042786", "0.50328535", "0.5029689", "0.5026195", "0.50260544", "0.50251395", "0.50205743", "0.50200975", "0.50194776", "0.5010764", "0.49975437", "0.499516", "0.4979602", "0.49692822", "0.49631166", "0.49529433", "0.4951578", "0.4946207", "0.49438074", "0.49434745", "0.4943228" ]
0.0
-1
TODO Autogenerated method stub
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == CommenString.TAKE_PHOTO) { cameraUtil.photoZoomFromTake(CropperImageScale.square); } else if (requestCode == CommenString.LOCAL_PHOTO) { List<String> selectedImage = data.getStringArrayListExtra("paths"); cameraUtil.photoZoomFromMapStorage(selectedImage.get(0), CropperImageScale.square); } else if (requestCode == CommenString.PHOTO_RESULT) { Bundle extras = data.getExtras(); if (extras != null) { headBitmap = extras.getParcelable("data"); image_up.setImageBitmap(headBitmap); } } else { } } }
{ "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
Deny requests with no image ID
@GET @Path("image") @Produces(MediaType.TEXT_PLAIN) public Response voidImage() { return Response.status(Response.Status.NOT_FOUND).build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasImageByHandler();", "@Override\n protected String getRequestedImage(HttpServletRequest req) {\n\treturn null;\n }", "public boolean isImageAllowed() {\n return mIsImageAllowed;\n }", "public boolean hasImageByHandler() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "private static boolean cancelPotentialDownload(int resourceId, ImageView imageView) {\n BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);\n\n if (bitmapDownloaderTask != null) {\n int bitmapId = bitmapDownloaderTask.resourceId;\n if (resourceId != bitmapId) {\n bitmapDownloaderTask.cancel(true);\n } else {\n // The same URL is already being downloaded.\n return false;\n }\n }\n return true;\n }", "private void checkImage(int id, GraphicsContext gc)\n {\n switch (id)\n {\n case 1:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/hero_onder.png\", 5, 5);\n break;\n case 2:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n break;\n case 3:\n drawImage(gc, \"/images/doel.png\", 0, 0);\n break;\n case 4:\n drawImage(gc, \"/images/muur.png\", 0, 0);\n break;\n case 5:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/kist.png\", 5, 5);\n break;\n }\n }", "@Test\n public void testNotRegenerateImage() throws Exception {\n assertFalse(\n \"This flag should not be committed as true\", ImageSimilarity.REGENERATE_EXPECTED_IMAGES);\n }", "private void disablePhotoEditing() {\r\n isEditingPhotos = false;\r\n }", "public boolean hasImageByHandler() {\n return ((bitField0_ & 0x00004000) == 0x00004000);\n }", "public boolean hasNoImages() {\n return noImages;\n }", "public void mo38841a(ImagesRequest imagesRequest) {\n }", "public boolean hasImage() {\n return !getImageResourceIds().equals(\"\");\n }", "public void setAmusementObjectImageA(int imageId){\r\n amusementObjectImageA = imageId;\r\n }", "@Override\n\tpublic boolean isMyImage() {\n\t\treturn false;\n\t}", "public static Long getAValidImageId() {\n\t\tLong id = getAId();\n\t\tif (id == null) {\n\n\t\t\tImage img = new Image(\"http://dummy.com/img.jpg\", (long)(Math.random()*10000), \"Description\", \"keyword\", new Date(0001L));\n\t\t\tIImageStore imageStore = StoreFactory.getImageStore();\n\t\t\timageStore.insert(img);\n\n\t\t\tid = getAId();\n\t\t\tif (id == null) {\n\t\t\t\tthrow new RuntimeException(\"There are no images in DB, and I can't insert one. Cannot run tests without.\");\n\t\t\t}\n\t\t}\n\t\treturn id;\n\t}", "@Test\n public void testNoMatchValidNoShareId1() {\n Matcher mtch = filter.getMatcher(\"/shares\");\n assertFalse(\"match\", filter.isResourceAccess(mtch));\n }", "public void cancelAllImages() {\n int size = currentImageRequests.size();\n for (int i = 0; i < size; i++) {\n currentImageRequests.valueAt(i).cancel();\n }\n }", "public void setImage(int imageId) {\n this.imageId=imageId;\n\t}", "public boolean hasImage(){\n return imageResourceID != NO_IMAGE_PROVIED;\n\n }", "Receta getByIdWithImages(long id);", "boolean isOmitResourceId();", "public boolean hasImage() { return ImageResource != NO_IMAGE_PROVIDED; }", "@Test\n public void testImageFiltering()\n { \n String html = header + \"<img src=\\\"file://path/to/local/image.png\\\"/>\" + footer;\n Document doc = wysiwygHTMLCleaner.clean(new StringReader(html));\n NodeList nodes = doc.getElementsByTagName(\"img\");\n Assert.assertEquals(1, nodes.getLength());\n Element image = (Element) nodes.item(0);\n Node startComment = image.getPreviousSibling();\n Node stopComment = image.getNextSibling();\n Assert.assertEquals(Node.COMMENT_NODE, startComment.getNodeType());\n Assert.assertEquals(\"startimage:false|-|attach|-|Missing.png\", startComment.getNodeValue());\n Assert.assertEquals(\"Missing.png\", image.getAttribute(\"src\"));\n Assert.assertEquals(Node.COMMENT_NODE, stopComment.getNodeType());\n Assert.assertTrue(stopComment.getNodeValue().equals(\"stopimage\"));\n }", "private Images() {}", "@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_USER_PREMIUM') or hasRole('ROOT')\")\n @RequestMapping(value = \"/images/{id}/{user}/{user_id}\", method = RequestMethod.DELETE)\n public ResponseEntity<?> deleteImage(@PathVariable(\"id\") final int id, @PathVariable(\"user\") final String username,\n @PathVariable(\"user_id\") final Integer user_id) {\n Image image = imageRepository.findById(id).orElse(null);\n User user = userRepository.findById(user_id).orElse(null);\n if (image == null || user == null)\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\n\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n System.out.println(\"User : \" + authentication.getName() + \"; user id: \" + user_id + \"; image fk_id: \"\n + image.getUser().getId());\n if (!authentication.getName().equals(username) || !image.getUser().getId().equals(user_id))\n return new ResponseEntity<>(HttpStatus.FORBIDDEN);\n\n user.dismissImage(image);\n imageRepository.deleteById(id);\n\n return new ResponseEntity<>(HttpStatus.OK);\n }", "abstract boolean ignoreContentLength();", "@Override\n public void denyAdoptionRequest(Animal animal) {\n animalsDatabase.removeAdoptionRequestFromAnimal(animal);\n }", "@Test\n public void getPicture_NoPictureExist(){\n Bitmap retrieved = testRecipe.getImage(appContext);\n assertNotEquals(\"getPicture - Not Null\", null, retrieved);\n }", "public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }", "public Boolean allowsViewImages() {\n return this.allowsViewImages;\n }", "public void secretMode()\n {\n \tsecret = true;\n \ttry {\n\t\t\timg = ImageIO.read(new File(\"DatBoi.png\"));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "Map getImageCode(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "private void defaultAssetShouldNotBeFound(String filter) throws Exception {\n restAssetMockMvc.perform(get(\"/api/assets?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 }", "private void getDoctorImageRequest(String imageLink, final ImageView imageView) {\n ImageRequest request = new ImageRequest(AppConfig.LIVE_IMAGE_DOCTOR_API_LINK + imageLink,\n new Response.Listener<Bitmap>() {\n @Override\n public void onResponse(Bitmap bitmap) {\n imageView.setImageBitmap(bitmap);\n// pDialog.hide();\n }\n }, 0, 0, null,\n new Response.ErrorListener() {\n public void onErrorResponse(VolleyError error) {\n imageView.setImageResource(R.drawable.ic_doctor);\n// pDialog.hide();\n }\n });\n // Access the RequestQueue through your singleton class.\n AppController.getInstance().addToRequestQueue(request);\n }", "private boolean isImageGiven(){\n return captureImage.getDrawable() != null;\n }", "@Override\n\tprotected boolean onAccessDenied(ServletRequest arg0, ServletResponse arg1) throws Exception {\n\t\treturn false;\n\t}", "@Override\r\n public void onDialogNegativeConfirmation(int requestID) {\r\n switch (requestID) {\r\n case REQUEST_CONFIRMATION_DELETE_PHOTO:\r\n disablePhotoEditing();\r\n break;\r\n }\r\n }", "@Override\n\tpublic int imgListCheck(String userid) throws Exception{\n\t\treturn sqlSession.selectOne(\"PostMapper.imgListCheck\", userid);\n\t}", "boolean canTakeNewPhoto();", "private void searchImages()\n {\n searchWeb = false;\n search();\n }", "public Image getDisabledImage () {\r\n\tcheckWidget();\r\n\treturn disabledImage;\r\n}", "public static boolean isAssetRequested(MD5Key key) {\n \t\treturn assetLoader.isIdRequested(key);\n \t}", "public void setAmusementObjectImageB(int imageId){\r\n amusementObjectImageB = imageId;\r\n }", "protected Image forceCaching(Image img) throws IOException {\n/* 221 */ if (img instanceof ImageRawStream) {\n/* 222 */ ImageRawStream raw = (ImageRawStream)img;\n/* 223 */ if (log.isDebugEnabled()) {\n/* 224 */ log.debug(\"Image is made cacheable: \" + img.getInfo());\n/* */ }\n/* */ \n/* */ \n/* 228 */ ByteArrayOutputStream baout = new ByteArrayOutputStream();\n/* 229 */ InputStream in = raw.createInputStream();\n/* */ try {\n/* 231 */ IOUtils.copy(in, baout);\n/* */ } finally {\n/* 233 */ IOUtils.closeQuietly(in);\n/* */ } \n/* 235 */ byte[] data = baout.toByteArray();\n/* 236 */ raw.setInputStreamFactory((ImageRawStream.InputStreamFactory)new ImageRawStream.ByteArrayStreamFactory(data));\n/* 237 */ return (Image)raw;\n/* */ } \n/* 239 */ return null;\n/* */ }", "int seachImage(Image img) {\r\n\t\treturn 1;\r\n\t}", "private void cacheUserImages() {\n User user = User.getLoggedInUser(this);\n if (user != null) {\n ImageView view = new ImageView(this);\n Picasso.with(this).load(user.getBannerImageUrl()).into(view);\n\n ImageView view2 = new ImageView(this);\n Picasso.with(this).load(user.getProfileImageUrl()).into(view2);\n }\n }", "public void tryaAainPhoto() {\n\t\tthis.photo_attache_capture = false;\n\t}", "public List<ImageFile> getUserImage(int userID) {\n List<ImageFile> listOfImages = null;\n Session session = sessionFactory.openSession();\n // Try to return the user by the given nickname\n try {\n session.beginTransaction();\n \n // if mode equals MINE then get just users ID\n Criteria criteria = session.createCriteria(ImageFile.class);\n criteria.add(Restrictions.eq(\"ownerUser.userID\", userID));\n listOfImages = (List<ImageFile>) criteria.list();\n \n session.getTransaction().commit();\n session.flush();\n } \n catch (HibernateException e) { e.printStackTrace(); return null;} \n finally { session.close(); }\n // Return userID if seted\n return listOfImages;\n }", "boolean isNonSecureAccess();", "public boolean denied(String action) {\n if (deny_all) {\n return true;\n }\n\t\tfor(String a : actions) {\n\t\t\tif (a.equals(action)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasImage() {\n\t\treturn false;\n\t}", "public void setImgId(String imgId) {\n this.imgId = imgId == null ? null : imgId.trim();\n }", "void denyConnection(UUID requestId) throws\n ArtistConnectionDenialFailedException,\n ConnectionRequestNotFoundException;", "@Test\n\tpublic void othersShouldNotBeAbleToLookAtLeonardsQueryByItsPrivateId() throws Exception {\n\t\tthis.mockMvc.perform(get(\"/user/me/queries/123456789\").accept(MediaType.APPLICATION_JSON)).\n\t\t\t\tandExpect(status().isForbidden());\n\t}", "public M csmiOnCertifyImageNull(){if(this.get(\"csmiOnCertifyImageNot\")==null)this.put(\"csmiOnCertifyImageNot\", \"\");this.put(\"csmiOnCertifyImage\", null);return this;}", "static void disableImageViews() {\n\t\tfor (int i=0; i<Play.NUM[TOTAL]; i++) {\n\t\t\tPlay.pieceViews.get(i).setEnabled(false);\n\t\t}\n\t}", "void blocked(HttpServletRequest request, HttpServletResponse response) throws IOException;", "@Override\n public void onLoadingCancelled(String arg0, View arg1) {\n holder.imageView.setVisibility(View.GONE);\n }", "public boolean shouldImageProcess() {\r\n\t\treturn table.getBoolean(SHOULD_IMAGE_PROCESS_KEY, false);\r\n\t}", "private static void setCacheTag(File image, HttpServletRequest request, HttpServletResponse response) {\n String fileName = image.getName();\n long length = image.length();\n long lastModified = image.lastModified();\n String eTag = fileName + \"_\" + length + \"_\" + lastModified;\n long expires = System.currentTimeMillis() + DEFAULT_EXPIRE_TIME;\n\n // Validate request headers for caching ---------------------------------------------------\n\n // If-None-Match header should contain \"*\" or ETag. If so, then return 304.\n String ifNoneMatch = request.getHeader(\"If-None-Match\");\n if (ifNoneMatch != null && matches(ifNoneMatch, eTag)) {\n response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);\n response.setHeader(\"ETag\", eTag); // Required in 304.\n response.setDateHeader(\"Expires\", expires); // Postpone cache with 1 week.\n return;\n }\n\n // If-Modified-Since header should be greater than LastModified. If so, then return 304.\n // This header is ignored if any If-None-Match header is specified.\n long ifModifiedSince = request.getDateHeader(\"If-Modified-Since\");\n if (ifNoneMatch == null && ifModifiedSince != -1 && ifModifiedSince + 1000 > lastModified) {\n response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);\n response.setHeader(\"ETag\", eTag); // Required in 304.\n response.setDateHeader(\"Expires\", expires); // Postpone cache with 1 week.\n return;\n }\n\n if (null == ifNoneMatch && ifModifiedSince == -1) {\n// response.setHeader(HTTPCacheHeader.CACHE_CONTROL.getName(), cacheControl.toString());\n response.setDateHeader(\"Expires\", expires); // Postpone cache with 1 week.\n }\n\n\n }", "@RequestMapping(value = \"/images\", method = RequestMethod.DELETE)\n public ResponseEntity<?> deleteImage() {\n return new ResponseEntity<>(HttpStatus.BAD_REQUEST);\n }", "@Test\n public void testFailureWithoutObjectId() throws URISyntaxException, IOException {\n testCantView(adminLogin, \"\", 400);\n }", "private void viewImage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint id= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tFiles file= new FilesDAO().view(id);\n\t\trequest.setAttribute(\"files\", file);\n\t\trequest.setAttribute(\"path\", path);\n\t\trequest.getRequestDispatcher(\"viewImage.jsp\").forward(request, response);\n\t\tSystem.out.println(file);\n\t}", "@Override\n\tpublic boolean isDenied();", "public Long getImgId() {\r\n return imgId;\r\n }", "public String getImgId() {\n return imgId;\n }", "OauthResource getResourceByIllegalId(String testId);", "public boolean hasImage() {\n return mImageResourceId != NO_IMAGE_PROVIDED;\n }", "public boolean hasImage() {\n return mImageResourceId != NO_IMAGE_PROVIDED;\n }", "private void deleteImage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint id= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tFiles file= new FilesDAO().view(id);\n\t\t//Logic to delete the file from the database\n\t\t\n\t\tnew FilesDAO().delete(id);\n\t\t\n\t\t\n\t\t//Logic to delete file from the file system\n\t\t\n\t\tFile fileOnDisk= new File(path+file.getFileName());\n\t\tif(fileOnDisk.delete()) {\n\t\t\tSystem.out.println(\"File deleted from the folder\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Sorr! file couldn't get deleted from the folder\");\n\t\t}\n\t\tlistingPage(request, response);\n\t}", "@Test\n public void testFailureWithNonexistantObjectId() throws URISyntaxException, IOException {\n testCantView(adminLogin, reqFactory.createIdApiRequest(Types.PACKAGE).execute(hc), 404);\n }", "public boolean isImageNotPresent() {\n if (addingItem) {\n if (picturePath == null) {\n if (makeImageMandatory) {\n return true;\n //true creates toast\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "private static Boolean isPhotoLiked(String postId, String accessToken) throws URISyntaxException, IOException, JSONException {\n\n\t\tString JsonResponse = null;\n String urlPost = \"https://api.instagram.com/v1/media/\"+postId+ \"?access_token=\" + accessToken;\n\t\tInputStream inputStream = null;\n\t\tHttpURLConnection urlConnection = null;\n\t\tInteger result = 0;\n\t\ttry {\n /* forming th java.net.URL object */\n\n\t\t\tURL url = new URL(urlPost);\n\t\t\turlConnection = (HttpURLConnection) url.openConnection();\n\n /* optional request header */\n\t\t\turlConnection.setRequestProperty(\"Content-Type\", \"application/json\");\n\n /* optional request header */\n\t\t\turlConnection.setRequestProperty(\"Accept\", \"application/json\");\n\n /* for Get request */\n\t\t\turlConnection.setRequestMethod(\"GET\");\n\t\t\tint statusCode = urlConnection.getResponseCode();\n\n\n /* 200 represents HTTP OK */\n\t\t\tif (statusCode == 200) {\n\t\t\t\tinputStream = new BufferedInputStream(urlConnection.getInputStream());\n\t\t\t\tString response = Utils.convertInputStreamToString(inputStream);\n\t\t\t\tJsonResponse = response;\n\t\t\t}else{\n\t\t\t\tJsonResponse = null; //\"Failed to fetch data!\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(\"Error\", e.getLocalizedMessage());\n\t\t}\n JSONObject respObject = new JSONObject(JsonResponse);\n\nJSONObject id = respObject.getJSONObject(\"data\");\n\n boolean userhasliked = id.getBoolean(\"user_has_liked\");\n\n if(userhasliked)\n {\n return true;\n }\n else\n {\n return false;\n }\n\n\n }", "@Override\n\tpublic boolean isSecured() {\n\t\treturn false;\n\t}", "boolean hasImagePath();", "@Override\r\n public void forbidShape (Shape shape)\r\n {\r\n if (forbiddenShapes == null) {\r\n forbiddenShapes = new HashSet<>();\r\n }\r\n\r\n forbiddenShapes.add(shape);\r\n }", "public int getImageId() {\n return imageId_;\n }", "@Override\n public Image getImage(Photo photo) {\n return null;\n }", "private void checkIfThereIsStudentPhoto() {\n if (studentHasPhoto) {\n mAddPhotoImageView.setVisibility(View.GONE);\n mAddPhotoLabelTextView.setVisibility(View.GONE);\n }\n }", "public boolean verifyEmptyToDoImage() {\n if (validateAttributeContain(imageEmptyToDo, \"src\", \"images/icons/clipboard.png\", \"Image Empty ToDo\")) {\n return true;\n }\n return false;\n }", "private void getUserImage(){\r\n \t//setProgressBarIndeterminateVisibility(true);\r\n \t\r\n \tusername=null;\r\n \tfor(int i=0; i<senderList.size(); i++) {\t// kovetkezo felhasznalo kepe\r\n \t\tString str=senderList.get(i);\r\n \t\tif (!userImage.containsKey(str)) {\r\n \t\t\tusername=str;\r\n \t\t\tbreak;\r\n \t\t}\r\n \t}\r\n \t\r\n \tif (username==null) return;\r\n \t\r\n\t String url = \"ImageDownload?size=medium&username=\" + username +\r\n\t \t\t\t\t\t\t \"&ssid=\" + UserInfo.getSSID();\r\n\t downloadUserImage = new HttpGetByteConnection(url, mHandler, TASK_GETUSERIMAGE);\r\n\t downloadUserImage.start();\r\n }", "com.yahoo.xpathproto.TransformTestProtos.ContentImage getImageByHandler();", "public int getImageId(){\n \t\treturn imageId;\n \t}", "private boolean imageViewReused(LoadDataHolder loadDataHolder) {\n String url = relationsMap.get(loadDataHolder.getImageView());\n // Check is url exist in relationsMap and equals to url from holder\n return url == null || !url.equals(loadDataHolder.getUrl());\n }", "void rejectFiles(String[] fileIds,String[] commentList,String userId)throws LMSException;", "public M csmiCertifyImageNull(){if(this.get(\"csmiCertifyImageNot\")==null)this.put(\"csmiCertifyImageNot\", \"\");this.put(\"csmiCertifyImage\", null);return this;}", "public void removeImage() {\n setFileImage(null);\n getSelected().setUrlImage(null);\n RequestContext.getCurrentInstance().update(\"image\");\n }", "@Override\n public void onLoadingFailed(String arg0, View arg1, FailReason arg2) {\n holder.imageView.setVisibility(View.GONE);\n }", "protected abstract void requestNoCache(ActionContext context);", "@Override\n\tpublic List<PersonalisationMediaModel> getImageByID(final String imageID)\n\t{\n\t\tfinal String query1 = \"Select {pk} from {PersonalisationMedia} Where {code}=?imageId and {user}=?user\";\n\t\t/**\n\t\t * select distinct {val:pk} from {PersonalisationMediaModel as val join MediaModel as media on\n\t\t * {media:PK}={val.image} join User as user on {user:pk}={val:user} and {media:code}=?imageId and {user:pk}=?user}\n\t\t */\n\t\tfinal UserModel user = getUserService().getCurrentUser();\n\t\tfinal FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query1);\n\t\tfinal Map<String, Object> params = new HashMap<>();\n\t\tparams.put(\"imageId\", imageID);\n\t\tparams.put(\"user\", user);\n\t\tfQuery.addQueryParameters(params);\n\t\tLOG.info(\"getImageByID\" + fQuery);\n\t\tfinal SearchResult<PersonalisationMediaModel> searchResult = flexibleSearchService.search(fQuery);\n\t\treturn searchResult.getResult();\n\t}", "private void getImagesFromServer() {\n trObtainAllPetImages.setUser(user);\n trObtainAllPetImages.execute();\n Map<String, byte[]> petImages = trObtainAllPetImages.getResult();\n Set<String> names = petImages.keySet();\n\n for (String petName : names) {\n byte[] bytes = petImages.get(petName);\n Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, Objects.requireNonNull(bytes).length);\n int index = user.getPets().indexOf(new Pet(petName));\n user.getPets().get(index).setProfileImage(bitmap);\n ImageManager.writeImage(ImageManager.PET_PROFILE_IMAGES_PATH, user.getUsername() + '_' + petName, bytes);\n }\n }", "@Override\r\n \t\t\tpublic boolean isAllowed(long sessionId, String actionKey) {\n \t\t\t\treturn false;\r\n \t\t\t}", "public PublishNoImgJoke() {\n\t\tsuper();\n\t}", "public static List<Image> findImagesByUserId(Integer userId){\n return finder.where().eq(\"user_id\", userId).findList();\n }", "private void displayNoImage() {\n\t\tGRect imageRect = new GRect(LEFT_MARGIN, nameY + IMAGE_MARGIN,\n\t\t\t\tIMAGE_WIDTH, IMAGE_HEIGHT);\n\t\tadd(imageRect);\n\t\tGLabel noImage = new GLabel(\"No Image\");\n\t\tnoImage.setFont(PROFILE_IMAGE_FONT);\n\t\tdouble labelWidth = LEFT_MARGIN + IMAGE_WIDTH / 2 - noImage.getWidth()\n\t\t\t\t/ 2;\n\t\tdouble labelHeight = nameY + IMAGE_MARGIN + IMAGE_HEIGHT / 2;\n\t\tadd(noImage, labelWidth, labelHeight);\n\t}", "public Image getImage(URL paramURL) {\n/* 276 */ return getAppletContext().getImage(paramURL);\n/* */ }", "boolean deleteImage(Image img) {\r\n\t\treturn true;\r\n\t}", "public boolean validImageContent() {\n\t\treturn input.validFile(list);\n\t}", "public void setImageId(long imageId) {\n this.imageId = imageId;\n }", "@Override\n\t\t\t\t\tpublic void onNothingSelected(AdapterView<?> arg0) {\n\t\t\t\t\t\timage_id=1908;\n\t\t\t\t\t\t\n\t\t\t\t\t}" ]
[ "0.5890951", "0.57765955", "0.5624362", "0.54121274", "0.5333215", "0.53148717", "0.53147477", "0.53018653", "0.53003913", "0.5274974", "0.5244217", "0.5217026", "0.52121764", "0.5194779", "0.51867986", "0.5161428", "0.51180947", "0.51042175", "0.5104152", "0.5097398", "0.5091279", "0.50891125", "0.50640684", "0.5044213", "0.5027585", "0.49837166", "0.4976329", "0.49706167", "0.49591118", "0.49584293", "0.49565223", "0.49477232", "0.49438554", "0.49406597", "0.49403268", "0.49401915", "0.4938456", "0.49250305", "0.49238375", "0.48905915", "0.488913", "0.48834634", "0.48733482", "0.48728132", "0.48677263", "0.48607242", "0.48541486", "0.48355946", "0.4835398", "0.48285607", "0.48257685", "0.48201755", "0.48133576", "0.48117965", "0.48054412", "0.48022", "0.480032", "0.47986007", "0.4797853", "0.4796304", "0.47950467", "0.47946838", "0.47918603", "0.47889563", "0.47763896", "0.47756246", "0.4774994", "0.47736752", "0.47736752", "0.47658768", "0.47626272", "0.47588804", "0.47579262", "0.47453427", "0.4734946", "0.47335425", "0.47270375", "0.47268578", "0.47243518", "0.47076517", "0.4707209", "0.47070622", "0.47069332", "0.4704011", "0.4699994", "0.46957895", "0.4695752", "0.46953857", "0.4688408", "0.46874222", "0.46837088", "0.4682124", "0.4680265", "0.46648726", "0.46644598", "0.46626574", "0.46621493", "0.46582493", "0.4654963", "0.46535903" ]
0.54173523
3
JAVA Generics to Create and return a New Page
public <TPage extends BasePage> TPage GetInstance(Class<TPage> pageClass) { try { return pageClass.getDeclaredConstructor(WebDriver.class, WebDriverWait.class).newInstance(this.driver, this.wait); }catch(Exception e) { e.printStackTrace(); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Page createPage();", "public PageData createPageBean( HttpServletRequest request, Object actionResult ) throws ServletException;", "@Override\n public String createRecord(String creatingPage) {\n return creatingPage;\n }", "public interface Page {\n\n public abstract String createTitle();\n public abstract Markup createMarkup();\n}", "public abstract void addCustomPages();", "private void createGenericPage() throws IOException {\r\n\t\tFileOutputStream pageStream = new FileOutputStream(page, false);\r\n\t\tpageStream.write(DEFAULT_STRING.getBytes());\r\n\t\tpageStream.close();\r\n\t}", "Page getPage();", "abstract public String createPage(int taskId, Connection con) throws SQLException, ServletException;", "@Override\n\tpublic Page createPage(String title, String author) {\n\t\treturn new ListPage(title, author);\n\t}", "static BasePage getPageInstance(String page_name,HttpServletRequest request,\n HttpServletResponse response,HttpServlet servlet){\n HttpSession session = request.getSession();\n BasePage page = (BasePage)session.getAttribute(page_name);\n if(page == null){\n page = (BasePage)createInstance(page_name);\n session.setAttribute(page_name,page);\n if(page == null)\n System.err.println(\"Could not create \" + page_name);\n } //if\n page.request = request;\n page.session = session;\n page.servlet = servlet;\n if(!page.$isLoaded())\n page.fillDom();\n return page;\n}", "public RubyObject createObject() {\n\t\treturn (RubyObject) RGSSProjectHelper.getInterpreter(project).runScriptlet(\"return RPG::Troop::Page.new\");\n\t}", "public org.biocatalogue.x2009.xml.rest.PageParameter addNewPage()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.biocatalogue.x2009.xml.rest.PageParameter target = null;\r\n target = (org.biocatalogue.x2009.xml.rest.PageParameter)get_store().add_element_user(PAGE$2);\r\n return target;\r\n }\r\n }", "protected PageRec createPage(IWorkbenchPart part, IPageBookViewPage page) {\n\t\tinitPage(page);\n\t\tpage.createControl(getPageBook());\n\t\tgetPages().add(page);\n\t\treturn new PageRec(part, page);\n\t}", "public abstract Page value();", "public abstract <T> Page<T> list(Pageable pageable, Class<T> clazz);", "public T _gotoPage(Class<? extends Page> pageClass)\n {\n tester.startPage(pageClass);\n return getBuilder();\n }", "@Override\r\n\tpublic IndexStore addPage(String pageName, String description, String message, ContainerTypes type, boolean onCancel, boolean onFinish ) {\r\n\t\tcurrent = new IndexStore( pageName, description, message, type, this.store.size() );\r\n\t\tif( onCancel ){\r\n\t\t\tfor( IndexStore is: store.values() )\r\n\t\t\t\tis.onCancel = false;\r\n\t\t\tcurrent.onCancel = true;\r\n\t\t}\r\n\t\tif( onFinish ){\r\n\t\t\tfor( IndexStore is: store.values() )\r\n\t\t\t\tis.onFinish = false;\r\n\t\t\tcurrent.onFinish = true;\r\n\t\t}\r\n\t\tstore.put( pageName, current );\r\n\t\treturn current;\r\n\t}", "AdminConsolePageType createAdminConsolePageType();", "public void addPages() {\n\t\t\n\t\tProjectUtils projectUtils = new ProjectUtils();\n\t\tIProject proj = projectUtils.getProject(selection);\n\t\t\n\t\t\n\t\t\n\t\tDb db = loadDBParams();\n\t\tDBConnection dbConn = new DBConnection();\n\t\tConnection connection = null;\n\t\t\n\t\t\n\t\ttry {\n\t\t\tconnection = dbConn.loadDriver(proj.getLocation()+\"/\"+db.getDriverClassPath(), db.getDriverClass(), db.getDatabaseURL(), db.getUserName(), db.getPassWord());\n\t\t} catch (MalformedURLException 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 (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\tpage = new SmartNewWizardPage(selection, connection, proj.getLocation().toString());\n\t\taddPage(page);\n\n\t}", "NewAccountPage openNewAccountPage();", "abstract public Content createContent();", "protected void createPages() {\n\t\tcreateIntroEditor();\n\t\tcreatePageMainEditor();\n\t\tcreatePageController();\n\t\tcreateCssEditor();\n\t\tcreatePageTextEditor();\n\t\trefreshPageMainEditor();\n\t\trefreshPageControllerEditor();\n\t\trefreshCssEditor();\n\t\tsetDirty(false);\n\t}", "protected abstract Content newContent();", "private Page createPage() throws IOException {\n\n Page page = new Page(DenseLayerPath + indexkey + \"dense_\" + (++noPages) + \".class\");\n saveindex();\n return page;\n }", "public void addPage() {\n Context context = App.getContext();\n //get index for new current page\n int index = 0;\n if (currentPage != null) {\n index = currentPage.getIndex() + 1;\n }\n if(currentPage == null || !currentPage.isPageEmpty()){\n //add page to template\n currentPage = new TemplatePage(index);\n currentTemplate.addPage(currentPage);\n //inflater needed to \"inflate\" layouts\n LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View newView = inflater.inflate(R.layout.new_page, null);\n //Add page to the list so we keep track of the pages for printing\n pageViews.add(newView.findViewById(R.id.linearLayoutBody));\n //Add new page under last\n linearLayoutPdf.addView(newView, linearLayoutPdf.getChildCount());\n //focus on new page\n linearLayoutBody = newView.findViewById(R.id.linearLayoutBody);\n //Number the page\n linearLayoutBody.setTag(currentPage);\n TextView footer = linearLayoutBody.findViewById(R.id.footer);\n footer.setText(\"Page \" + (index + 1));\n //log\n LogManager.reportStatus(context, \"INSPECTOR\", \"onAddPage\");\n //add slots\n if(!isLoading){\n isLoading = true;\n int slot = 16;\n while (slot > 0){\n addSpacer(0);\n slot = slot - 1;\n }\n isLoading = false;\n }\n } else{\n //do nothing, current page is empty\n LogManager.reportStatus(context, \"INSPECTOR\", \"pageNotAdded:PageEmpty\");\n }\n }", "private final void createAppPages() {\r\n\t\t//Instantiate Page objects that have no associated test properties\r\n\t\t//Note that if a test DOES need to specify test properties for one of these pages\r\n\t\t// (e.g., search terms), it can create its own local version of the page, and pass\r\n\t\t// the pagePropertiesFilenameKey argument, OR create it here, by calling createPage\r\n\t\t// instead of createStaticPage\r\n\r\n\t\t//Can also instantiate regular (i.e., with associated test properties) DD-specific\r\n\t\t// Page objects here, but typically it is best for the test or utility methods to do that;\r\n\t\t// if we do it here we may end up creating Page objects that never get used.\r\n }", "PageAgent getPage();", "public void addPages() {\n\t\tpage = new NewTotoriWizardPage(selection);\n\t\taddPage(page);\n\t}", "public Content createContent();", "public abstract void createWebsite();", "public Object navigate(Class<? extends Page> pageObject) {\n\n Page page;\n\n try {\n page = pageObject.getConstructor(WebDriver.class).newInstance(driver.get());\n driver.get().navigate().to(page.getURL());\n//\t\t\tdriver.get().navigate().to(System.getProperty(\"APPLICATION_URL\"));\n return page;\n\n } catch (InstantiationException e) {\n LOGGER.log(Level.SEVERE,\n \"ERROR loading pageObject\", e);\n return null;\n } catch (IllegalAccessException e) {\n LOGGER.log(Level.SEVERE,\n \"ERROR loading pageObject\", e);\n return null;\n } catch (IllegalArgumentException e) {\n LOGGER.log(Level.SEVERE,\n \"ERROR loading pageObject\", e);\n return null;\n } catch (InvocationTargetException\n e) {\n LOGGER.log(Level.SEVERE,\n \"ERROR loading pageObject\", e);\n return null;\n } catch (NoSuchMethodException e) {\n LOGGER.log(Level.SEVERE,\n \"ERROR loading pageObject\", e);\n return null;\n } catch (SecurityException e) {\n LOGGER.log(Level.SEVERE,\n \"ERROR loading pageObject\", e);\n return null;\n }\n }", "@Override\r\n\tpublic void mypage() {\n\t\t\r\n\t}", "public void createPage(@NonNull WPEView wpeView, @NonNull Context context) {\n Log.d(LOGTAG, \"Create new Page instance for view \" + wpeView);\n if (m_pages == null) {\n m_pages = new IdentityHashMap<>();\n }\n assert (!m_pages.containsKey(wpeView));\n Page page = new Page(this, context, wpeView, m_pages.size());\n m_pages.put(wpeView, page);\n m_activeView = wpeView;\n if (m_webProcess != null) {\n m_webProcess.setActivePage(page);\n }\n loadPendingUrls(wpeView);\n }", "public interface TypeView extends BaseView {\n void getNewListEnd();\n\n void getNewListSuccess(List<New> news, int page);\n\n void getNewListError(String message, int page);\n}", "@Override\n public Page addPage(String title) {\n throw new RuntimeException(\"addPage(String) unimplemented\");\n }", "@Override\n public void addPages() {\n super.addPages();\n page1 = new NewReviewWizardPage();\n addPage(page1);\n }", "public static <T extends Object> T getPageInstance(Class<T> type, String template, Agent agent)\n throws Exception {\n String className = String.format(template, type.getSimpleName());\n @SuppressWarnings(\"rawtypes\")\n Class cls = Class.forName(className);\n @SuppressWarnings(\"unchecked\")\n Constructor<T> constructor = cls.getConstructor(Agent.class);\n Object pageImpl = constructor.newInstance(agent);\n return type.cast(pageImpl);\n }", "private static MockPageManager createPageManager()\r\n {\r\n return new MockPageManager();\r\n }", "public interface Page {\n\n public int getSize();\n public Container getContainer();\n public void setContainer(Container containerss);\n\n public String getName();\n public String getDisplayName();\n public PageComponent[] getPageComponents();\n\n public void putPageComponentsPlayerHotbar(Player player);\n\n public void showGui(Player player);\n public void addComponent(PageComponent pageComponent);\n public void addComponent(PageComponent pageComponent, int index);\n\n public Inventory getInventory();\n\n public boolean hasFreeSlot();\n public void clearComponents();\n public void removeComponent(String name);\n\n public void updateComponents();\n\n}", "protected void creaPagine() {\n Pagina pag;\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* crea la pagina e aggiunge campi e pannelli */\n pag = this.addPagina(\"generale\");\n\n pan = PannelloFactory.orizzontale(this);\n pan.add(Cam.data);\n pan.add(Cam.importo.get());\n pan.add(Cam.note.get());\n pag.add(pan);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "public void setPage(Page page) {this.page = page;}", "public void addPage(String name, String park);", "public interface AccountsPage extends Page {\n\n /**\n * Return the UI element of 'Login ID' field.\n *\n * @return the UI element of 'Login ID' field\n */\n WebElement getLoginIDField();\n\n /**\n * Return the UI element of 'Name' field.\n *\n * @return the UI element of 'Name' field\n */\n WebElement getNameField();\n\n /**\n * Return the UI element of 'Organization' field.\n *\n * @return the UI element of 'Organization' field\n */\n WebElement getOrganizationField();\n\n /**\n * Return the UI element of 'Status' select field.\n *\n * @return the UI element of 'Status' select field\n */\n WebElement getStatusSelectField();\n\n /**\n * Return the UI element of 'Search' button.\n *\n * @return the UI element of 'Search' button\n */\n WebElement getSearchButton();\n\n /**\n * Return the UI element of the table record at the given index, which starts from 1.\n *\n * @param idx The index of the table record.\n * @return the UI element of the table record at the given index\n */\n WebElement getTableRecordAtIndex(int idx);\n\n /**\n * Return the UI element of the column of the given table record with the column name.\n *\n * @param tableRecord the table record\n * @param columnName the column name\n * @return the UI element of the column\n */\n WebElement getColumnByName(WebElement tableRecord, String columnName);\n\n /**\n * Return the UI element of 'New Account' button.\n *\n * @return the UI element of 'New Account' button\n */\n WebElement getNewAccountButton();\n\n /**\n * Open the 'New Account' page.\n *\n * @return 'New Account' page object\n */\n NewAccountPage openNewAccountPage();\n\n /**\n * Open the 'Edit Account' page by the given Login ID text.\n *\n * @param loginID Login ID text\n * @return 'Edit Account' page object\n * @throws NoSuchElementException if the account being requested does not exist.\n */\n EditAccountPage openEditAccountPageByLoginID(String loginID) throws NoSuchElementException;\n\n}", "List<? extends Page> getPages();", "@Override\n public WikiPageInfo createWikiPage(String siteShortName, String title,\n String content) \n {\n NodeRef container = getSiteWikiContainer(siteShortName, true);\n \n // Build the name\n String name = buildName(title);\n \n // Get the properties for the node\n Map<QName, Serializable> props = new HashMap<QName, Serializable>();\n props.put(ContentModel.PROP_NAME, name);\n props.put(ContentModel.PROP_TITLE, title);\n \n // Build the node\n NodeRef nodeRef = nodeService.createNode(\n container,\n ContentModel.ASSOC_CONTAINS,\n QName.createQName(name),\n ContentModel.TYPE_CONTENT,\n props\n ).getChildRef();\n \n // Store the content\n ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);\n writer.setMimetype(MimetypeMap.MIMETYPE_HTML);\n writer.setEncoding(\"UTF-8\");\n writer.putContent(content);\n \n // Generate the wrapping object for it\n // Build it that way, so creator and created date come through\n return buildPage(nodeRef, container, name, content);\n }", "public interface TestPage<D> {\r\n\tpublic TestPage<D> getParent();\r\n\r\n\tpublic PageLocator getPageLocator();\r\n\r\n\t/***\r\n\t * This method check for existence of page in browser so we can proceed\r\n\t * further with page functionality.\r\n\t * \r\n\t * @param args\r\n\t * optional arguments required to identify page.\r\n\t * @return\r\n\t */\r\n\tpublic boolean isPageActive(PageLocator loc, Object... args);\r\n\r\n\t/**\r\n\t * selenium base instance to provide selenium\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic UiTestBase<D> getTestBase();\r\n\r\n\t/**\r\n\t * Returns the body text of the current page\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic String getText();\r\n\r\n\t/**\r\n\t * Use only launchPage method to load a page. For more usability you can\r\n\t * overload this method in your page class but make sure to call this method\r\n\t * within it to load page. eg:\r\n\t * \r\n\t * <pre>\r\n\t * <code>\r\n\t * void launchPage(){\r\n\t * \t\tlaunchPage(null)\r\n\t * }\r\n\t * OR\r\n\t * void launchPage(String locator){\r\n\t * \t\tlaunchPage(new DefaultPageLocator(locator));\r\n\t * }\r\n\t * </code>\r\n\t * </pre>\r\n\t * \r\n\t * @param locator\r\n\t * to locate page on parent page.\r\n\t * <p>\r\n\t * This locator will be passed to other fw methods for example\r\n\t * {@link #isPageActive(PageLocator, Object...)}\r\n\t * @param args\r\n\t * optional page identifiers to verify is this page for what we\r\n\t * aspect? for example: view details page for specific user or\r\n\t * item, you can identify page by user or item id/name\r\n\t * <p>\r\n\t * This args will be passed to other fw methods for example\r\n\t * {@link #isPageActive(PageLocator, Object...)}\r\n\t */\r\n\tpublic void launchPage(PageLocator locator, Object... args);\r\n\r\n\t/**\r\n\t * You can specify launch behavior before launching the page by calling this\r\n\t * method.\r\n\t * \r\n\t * @param strategy\r\n\t * launch strategy.\r\n\t */\r\n\tpublic void setLaunchStrategy(LaunchStrategy strategy);\r\n\r\n\tpublic enum LaunchStrategy {\r\n\t\t/**\r\n\t\t * To specify that even if the page is active, launch page form the\r\n\t\t * parent page.\r\n\t\t */\r\n\t\talwaysRelaunchFromParent,\r\n\t\t/**\r\n\t\t * To specify that even if the page or its parent page is active, launch\r\n\t\t * form the root by navigating entire hierarchy.\r\n\t\t */\r\n\t\talwaysRelaunchFromRoot,\r\n\t\t/**\r\n\t\t * To specify that launch the page if it is not active.\r\n\t\t */\r\n\t\tonlyIfRequired;\r\n\t}\r\n\r\n}", "public abstract void create(T t);", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate void build(final Page page,Class cls) {\n//\t\tif(page == null || cls ==null){\n\t\tif(page == null){\n\t\t\treturn;\n\t\t}\n//\t\tthis.pageInfo = new PageInfo();\n//\t\tthis.pageInfo.setNumber(page.getNumber());\n//\t\tthis.pageInfo.setNumberOfElements(page.getNumberOfElements());\n//\t\tthis.pageInfo.setSize(page.getSize());\n//\t\tthis.pageInfo.setTotalElements(page.getTotalElements());\n//\t\tthis.pageInfo.setTotalPages(page.getTotalPages());\n//\t\tthis.pageInfo.setFirst(page.isFirst());\n//\t\tthis.pageInfo.setLast(page.isLast());\n\t\t\n\t\tList list = page.getContent();\n\t\tif(cls == null){\n\t\t\tthis.data = list;\n\t\t\treturn;\n\t\t}\n\t\tList dtoList = new ArrayList();\n\t\tObject dto = null; // cls.newInstance();\n\t\tfor(Object e:list){\n\t\t\ttry {\n\t\t\t\tdto = cls.newInstance();\n\t\t\t\tBeanUtils.copyProperties(e, dto);\t\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t} \n\t\t\tif(dto != null){\n\t\t\t\tdtoList.add(dto);\n\t\t\t}\n\t\t}\n\t\tthis.data = dtoList;\n\t}", "public Page(Class<?> root) {\n\t\tentityName = StringUtils.uncapitalize(root.getSimpleName());\n\t\tentityClass = root;\n\t\ttitle = new StringBuilder(entityName).append(\".page.title\").toString();\n\t\textractFormFields(root, \"\");\n\t}", "@Override\n protected void init(PageDto page, HttpServletRequest request, HttpServletResponse response, Model model) {\n\n }", "String urlFor(Class<? extends Page> pageClazz, PageParameters params);", "Pages getPages();", "Builder addMainEntityOfPage(URL value);", "public NewCZ_DPPHRProcessPage(){ super(); }", "T create();", "T create();", "ListItem createListItem();", "@Override\r\n\tpublic void addPages() {\n\t\tprojectPage = new NewProjectWizardPage();\r\n\t\taddPage(projectPage);\r\n\t}", "For createFor();", "public SlingHttpResponse createPage(String pageLabel, String pageTitle, String parentPath, String templatePath, int... expectedStatus)\n throws ClientException {\n FormEntityBuilder feb = FormEntityBuilder.create()\n .addParameter(\"cmd\", CMD_CREATE_PAGE)\n .addParameter(\"parentPath\", parentPath)\n .addParameter(\"label\", pageLabel)\n .addParameter(\"title\", pageTitle)\n .addParameter(\"template\", templatePath);\n\n return executeWCMCommand(CMD_CREATE_PAGE, feb, expectedStatus);\n }", "public abstract Response create(Request request, Response response);", "public interface TDgapWsDailyStatProvider extends BaseProvider<TDgapWsDailyStat> {\n PageInfo<Map<String, Object>> list(Map<String, Object> params);\n\n public int stateDailyLog(Date time);\n\n public void testPageHelper();\n\n}", "public RemovePage() {\n }", "@Override\n\tpublic void addPages() {\n\t\t_fileWizard = new NewPlotFilenameWizardPage(selection);\n\t\t_scaleWizard = new ScaleWizardPage(selection);\n\t\t_coastWizard = new CoastWizardPage(selection);\n\t\t_gridWizard = new GridWizardPage(selection);\n\n\t\t// check there's ETOPO data before we add the page\n\t\t_etopoWizard = new ETOPOWizardPage(selection);\n\n\t\taddPage(_fileWizard);\n\t\taddPage(_scaleWizard);\n\t\taddPage(_coastWizard);\n\t\taddPage(_gridWizard);\n\t\tif (_etopoWizard.isAvailable())\n\t\t\taddPage(_etopoWizard);\n\t}", "@Override\n\tpublic Result getNewsByPage(Page page) {\n\t\tList<News> newsList = indexMapper.selectAll();\n\t\tResult result = new Result(1,\"success\",newsList);\n//\t\tSystem.out.println(\"indexService\"+newsList);\n\t\treturn result;\n\t}", "public void addPages() {\n //super.addPages(); //<--- notice we're overriding here\n mainPage = new NewTargetWizardPage(\"newFilePage1\", getSelection());//$NON-NLS-1$\n mainPage.setTitle(TITLE);\n mainPage.setDescription(DESCRIPTION); \n addPage(mainPage);\n }", "public NewPageWizard(IXWikiSpace sapce)\n {\n super();\n setWindowTitle(\"Add New Page...\");\n setNeedsProgressMonitor(false);\n this.space = sapce;\n }", "public void addPages() {\t\t\n\t\tpage1 = new Opera2ActionsTransformationWizardPage1(selection, operaModel);\n\t\taddPage(page1);\t\n\t}", "@RequestMapping(value = \"/createentry\", method = RequestMethod.GET)\n\tpublic String navigateCreateEntry(Model model){\n\t\tmodel.addAttribute(\"entry\", new Entry());\t\n\t\treturn \"entry/createEntry\";\n\t}", "public interface CreatePageMarker {\n}", "public abstract void create();", "public abstract <T> T create(Object object, Class<T> clazz);", "@Test\r\n\tpublic void testContestant_Page() {\r\n\t\tnew Contestant_Page(myID, myEntryData);\r\n\t\t\r\n\t}", "void create(T t);", "public Page getPage() {return page;}", "@Override\r\n\tpublic Type getRequestType() {\n\t\treturn Type.PAGE;\r\n\t}", "protected abstract DataPage getDataPage(PageId pageId);", "@Override\n\tpublic void process(Page page){\n\n\t CollectTemplate collectTemplate = templateService.getCollectTemplateById(templateId);\n\t String currentUrl=page.getUrl().toString();\n\t String nextUrlXpath=collectTemplate.getNextUrlXpath();\n \tString contentUrlXpath=collectTemplate.getContentUrlXpath();\n \tString listUrlRegex=collectTemplate.getListUrlRegex();\n \tString contentUrlRegex=collectTemplate.getContentUrlRegex();\n \tList<CollectTemplateField> fields=collectTemplate.getFields();\n \ttry {\n\t \t\t\n\t \tHtml currentHtml= page.getHtml();\n\n\t\t\t//判断是否是列表页\n\t if (currentUrl.matches(listUrlRegex)) {\n\n\t\t\t\t//处理列表页\n\t\t\t\tString nextPageUrl=\"\";\n\t\t\t\ttry{\n\t\t\t\t\tnextPageUrl=currentHtml.xpath(nextUrlXpath).toString();\n\t\t\t\t\tif (nextPageUrl==null||StringUtils.isEmpty(nextPageUrl)){\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t}catch (Exception e){\n\t\t\t\t\tXpath2Selector xpath2Selector = new Xpath2Selector(nextUrlXpath);\n\t\t\t\t\tnextPageUrl = xpath2Selector.select(page.getRawText());\n\n\t\t\t\t\tif (nextPageUrl!=null&&nextPageUrl.startsWith(\"/\")){\n\t\t\t\t\t\tnextPageUrl = \"http://\"+site.getDomain()+nextPageUrl;\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\n\t \tif (StringUtils.isNotEmpty(nextPageUrl)) {\n\n\t \t\tRequest request=new Request();\n\t \t\trequest.setUrl(nextPageUrl);\n\t \t\trequest.setPriority(-1);\n\t \t\t\n\t \t\tpage.addTargetRequest(request);\n\n\t \t\tlogService.info(projectId,\"get the next page link \"+nextPageUrl+\" and add it to the queue\");\n\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get the next page link\");\n\n\t\t\t\t}\n\t \tList<String> detailPagesUrl;\n\t \ttry{\n\t\t\t\t\tdetailPagesUrl = currentHtml.xpath(contentUrlXpath).all();\n\n\t\t\t\t}catch (Exception e){\n\n\t\t\t\t\tXpath2Selector xpath2Selector2 = new Xpath2Selector(contentUrlXpath);\n\t\t\t\t\tdetailPagesUrl = xpath2Selector2.selectList(currentHtml.getDocument().text());\n\t\t\t\t}\n\n\n\n\t \tif (detailPagesUrl!=null&&detailPagesUrl.size()!=0) {\n\t\t\t\t\t//添加详情页\n\t\t\t\t\tpage.addTargetRequests(detailPagesUrl, 1);\n\n\t\t\t\t\tlogService.info(projectId,\"get \"+detailPagesUrl.size()+\" detail pages\");\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get detail page\");\n\n\t\t\t\t}\n\t\t\t}else if (StringUtils.isEmpty(contentUrlRegex)||currentUrl.matches(contentUrlRegex)) {\n\t \t//处理详情页\n\t\t\t\tcontentPageProcessService.setProjectId(projectId);\n\t\t\t\tcontentPageProcessService.progressContentPage(page,fields);\n\t\t\t}\n\t \t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t \n\t }", "public TreinamentoPage() {\r\n\t\tPageFactory.initElements(TestRule.getDriver(), this);\r\n\t}", "public PageResponse build() {\n return new PageResponse(this);\n }", "@Override\n\tpublic List<Factory> findPage(Page page) {\n\t\treturn null;\n\t}", "protected Page<V> getVO (Page<T> page, Pageable pageRequest) {\n List<V> contentVO = getVO(page.getContent());\n Page<V> pageResult = new PageImpl<>(contentVO, pageRequest, page.getTotalElements());\n return pageResult;\n }", "Compuesta createCompuesta();", "<C> ContentHandle<C> newHandle(Class<C> type);", "interface Create {}", "Response createResponse();", "public void addPages() {\n\t\twizardPage = new WizardNewProjectCreationPage(\n\t\t\"NewExampleComSiteProject\");\n\t\twizardPage.setDescription(\"Create a new Example.com Site Project.\");\n\t\twizardPage.setTitle(\"New Example.com Site Project\");\n\t\taddPage(wizardPage);\n\t}", "public abstract T create(T obj);", "public String create() {\n\n if (log.isDebugEnabled()) {\n log.debug(\"create()\");\n }\n FacesContext context = FacesContext.getCurrentInstance();\n StringBuffer sb = registration(context);\n sb.append(\"?action=Create\");\n forward(context, sb.toString());\n return (null);\n\n }", "public PageGeneratorLanguareFactoryImpl()\n {\n super();\n }", "public NewcommunityPage submitKo() {\n driver.findElement(nextLocator).click();\r\n\r\n // Return a new page object representing the destination. Should the login page ever\r\n // go somewhere else (for example, a legal disclaimer) then changing the method signature\r\n // for this method will mean that all tests that rely on this behaviour won't compile.\r\n return new NewcommunityPage(driver); \r\n\t}", "@Override\n\tpublic ModelAndView create() {\n\t\treturn null;\n\t}", "public abstract AdvertisingPageType mo11614e();", "public PageId newPage(Page firstpage, int howmany) throws Exception {\n\t\tPageId firstPageId = null;\n\t\t// if the number of pages less than 0 throw exception\n\t\tif (howmany <= 0) {\n\t\t\tthrow new InvalidRunSizeException(null,\n\t\t\t\t\t\"error .. invalid number of pages entered\");\n\n\t\t} else if (firstpage == null) {\n\t\t\t// if the firstpage == null this mean wrong entery and throw\n\t\t\t// exception\n\t\t\tthrow new PageException(null, \"check the page inialisation\");\n\n\t\t} else if (pageHashtable.size() < numbufs) {// check if there is place\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and then allocate and pin\n\t\t\t\t\t\t\t\t\t\t\t\t\t// it\n\t\t\tfirstPageId = new PageId();\n\t\t\t(SystemDefs.JavabaseDB).allocate_page(firstPageId, howmany);\n\t\t\tpinPage(firstPageId, firstpage, false);\n\t\t}\n\t\treturn firstPageId;\n\t}", "private void _createPageDef()\n {\n _pageDef = new DemoPageDef();\n _pageDef.setupAttributes();\n \n List<DemoPageDef.SavedSearchDef> searchDefList = _pageDef.setupSavedSearchDefList();\n \n // Mark the first sabved Search definition as the current\n _currentDescriptor = new DemoQueryDescriptor(searchDefList.get(0));\n for (DemoPageDef.SavedSearchDef searchDef: searchDefList)\n {\n DemoQueryDescriptor qd = new DemoQueryDescriptor(searchDef);\n _QDMap.put(searchDef.getName(), qd); \n if (_currentDescriptor == null)\n _currentDescriptor = qd;\n }\n\n _queryModel = new DemoQueryModel(_QDMap);\n \n }", "public PersonalPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "public interface InventoryChangeFormService {\n\n\n\n Page<InventoryChangeHistoryForm> getHistoryChangeForm(Long maxCatalog,\n Long minCatalog,\n Date start,\n Date end,\n String goodsInfoName,\n String goodsInfoItemNo,\n Pageable pageable);\n}", "public Page(String name)\r\n {\r\n super(name,0,0,0,0);\r\n }", "Builder addMainEntityOfPage(String value);", "PageService(UpodDao upodDao) {}" ]
[ "0.80644596", "0.6753358", "0.67081803", "0.6596044", "0.6530627", "0.6378633", "0.6368049", "0.63570005", "0.62558156", "0.61405176", "0.61231625", "0.61155856", "0.60791224", "0.6078911", "0.59994906", "0.5996156", "0.59832597", "0.59402084", "0.586944", "0.586258", "0.58571696", "0.5803233", "0.5802296", "0.57900214", "0.5773791", "0.57726896", "0.5742747", "0.5725444", "0.57191014", "0.5715925", "0.5684882", "0.56796765", "0.5674868", "0.5672827", "0.5669316", "0.56691635", "0.5660916", "0.56465715", "0.56403446", "0.5640287", "0.5623155", "0.5619179", "0.5616757", "0.56136096", "0.5607811", "0.56065476", "0.5599188", "0.55981", "0.55903083", "0.55827117", "0.5575324", "0.55659777", "0.5565469", "0.5537016", "0.55214053", "0.55214053", "0.55197024", "0.5513821", "0.5509577", "0.5501335", "0.54923445", "0.5484272", "0.54762393", "0.5459124", "0.5435763", "0.54262835", "0.5426096", "0.54051274", "0.5395339", "0.5386642", "0.53863066", "0.53766054", "0.53625345", "0.5344901", "0.5343188", "0.5339791", "0.5334346", "0.5330301", "0.532644", "0.53262985", "0.53169495", "0.5314655", "0.53143805", "0.5313759", "0.53108156", "0.5305622", "0.5297725", "0.5297029", "0.5287738", "0.5287272", "0.52829725", "0.5277886", "0.52688634", "0.5268738", "0.52645755", "0.52612007", "0.5259399", "0.5257342", "0.5257196", "0.5255806" ]
0.56393546
40
Don't construct, allow inheritance
protected HadoopUtils() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void construct();", "_ExtendsNotAbstract() {\n super(\"s\"); // needs this if not default ctor;\n }", "protected ChildType() {/* intentionally empty block */}", "O() { super(null); }", "Reproducible newInstance();", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "@Override\n protected void checkSubclass() {\n }", "protected Animal() {\t\r\n\t}", "private BigB()\r\n{\tsuper();\t\r\n}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n public boolean isInstantiable() {\n return false;\n }", "@Override\r\n protected void checkSubclass() {\n }", "@Override\r\n protected void checkSubclass() {\n }", "@Override\r\n protected void checkSubclass() {\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "private SingleObject(){}", "MyEncodeableWithoutPublicNoArgConstructor() {}", "protected AbstractReadablePacket() {\n this.constructor = createConstructor();\n }", "private InheritableBuildingBlock() {\r\n super(IInheritableBuildingBlock.TYPE_ID);\r\n }", "public Pleasure() {\r\n\t\t}", "private SystemInfo() {\r\n // forbid object construction \r\n }", "public b3(){\n super();\n }", "abstract Object build();", "@SuppressWarnings(\"unused\")\n\tprivate AbstractCommand() {\n\t\t//\n\t}", "private E() {}", "private void __sep__Constructors__() {}", "Inheritance createInheritance();", "public Implementor(){}", "protected void checkSubclass() {\n }", "protected Depot() {\n\t\tthis(null);\n\t}", "@Override\n protected void prot() {\n }", "protected Approche() {\n }", "protected void checkSubclass() {\n }", "protected void checkSubclass() {\n }", "protected void checkSubclass() {\n }", "public Clade() {}", "private TypicalPersons() {}", "private TypicalPersons() {}", "defaultConstructor(){}", "private SingleObject()\r\n {\r\n }", "private ChildContract() {}", "protected Betaling()\r\n\t{\r\n\t\t\r\n\t}", "private Cat() {\n\t\t\n\t}", "public no() {}", "@Override\r\n\tpublic CMObject newInstance()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\treturn this.getClass().getDeclaredConstructor().newInstance();\r\n\t\t}\r\n\t\tcatch(final Exception e)\r\n\t\t{\r\n\t\t\tLog.errOut(ID(),e);\r\n\t\t}\r\n\t\treturn new StdBehavior();\r\n\t}", "Object getBase();", "void DefaultConstructor(){}", "private InterpreterDependencyChecks() {\r\n\t\t// Hides default constructor\r\n\t}", "private NaturePackage() {}", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "public aed(World paramaqu)\r\n/* 9: */ {\r\n/* 10: 24 */ super(paramaqu);\r\n/* 11: */ }", "private Instantiation(){}", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "public Boop() {\n\t\tsuper();\n\t}", "public AbstractBinaryInteraction() {\n\n\t}", "protected Shape() {}", "public BasicSafetyCaseFactoryImpl() {\n\t\tsuper();\n\t}", "public InsulinType(){\n super();\n }", "public BaseElement() {\n }", "private Consts(){\n //this prevents even the native class from \n //calling this ctor as well :\n throw new AssertionError();\n }", "private SingleObject(){\n }", "private Rekenhulp()\n\t{\n\t}", "private CheckingTools() {\r\n super();\r\n }", "private NoOpCompactor(SegmentStorageSystem storage) {\n super(storage);\n }", "public Supercar() {\r\n\t\t\r\n\t}", "protected BaseFeat()\n {\n super(TYPE);\n }", "@Override\n\tpublic Response construct() {\n\t\treturn null;\n\t}", "public BaseContract() {}" ]
[ "0.69784", "0.6888036", "0.67381084", "0.66753334", "0.64418054", "0.6400845", "0.6360677", "0.6354851", "0.62108976", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.62038696", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.6203643", "0.62036365", "0.62036365", "0.62036365", "0.6164839", "0.61645746", "0.61645746", "0.61645746", "0.6129408", "0.6128802", "0.6098061", "0.6052195", "0.60400414", "0.6029309", "0.5997482", "0.59727705", "0.59519863", "0.5948028", "0.59377486", "0.5877422", "0.5873595", "0.58680606", "0.5858135", "0.58547616", "0.5849046", "0.58424777", "0.5837373", "0.5837373", "0.5837373", "0.5833253", "0.5826702", "0.5826702", "0.58265686", "0.5825861", "0.5823785", "0.5820539", "0.5813545", "0.58096594", "0.5802954", "0.5794757", "0.57872444", "0.57855463", "0.57799125", "0.57791054", "0.57765925", "0.57724535", "0.5768304", "0.5766059", "0.5764116", "0.5761085", "0.5756976", "0.5740178", "0.5736295", "0.57333773", "0.57277876", "0.57274187", "0.57269967", "0.57163745", "0.5704515", "0.570096", "0.56992966", "0.56895655" ]
0.0
-1
Set Configuration if object is Configurable
public static void setConfIfPossible(Object object, Configuration conf) { if (object instanceof Configurable) { ((Configurable) object).setConf(conf); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Configurable {\n void setConf(Configuration conf);\n Configuration getConf();\n}", "public void\t\tsetConfiguration(Object obj);", "abstract Configurable<?> getConfigurable();", "public interface Configurable {\n\n void configure(Properties properties);\n}", "public abstract void configure(T object, U configuration);", "public interface Configurable\t{\n\t/**\n\t *\tConfiguration files have changed.\n\t */\n\tpublic void reConfigure();\n}", "public static void setJobConfIfPossible(Object object, JobConf jobConf) {\n if (object instanceof JobConfigurable) {\n ((JobConfigurable) object).configure(jobConf);\n }\n }", "void setConfiguration();", "public void setConfiguration(Properties props);", "public static Configurable configure() {\n return new RedisManager.ConfigurableImpl();\n }", "public interface Configurable {\n RequestConfig getConfig();\n}", "public void configure() throws ConfigurationException;", "void configure(String name, Map<String, Object> configuration);", "public static Configuration getConfIfPossible(Object object) {\n if (object instanceof Configurable) {\n return ((Configurable) object).getConf();\n }\n return null;\n }", "public abstract void Configure( DataMap<String, Serializable> configuration);", "@Override\n public void setupConfiguration(Configuration config)\n {\n\n }", "public interface IConfiguration extends ISessionAwareObject {\n\n\tString ENV_SOPECO_HOME = \"SOPECO_HOME\";\n\n\tString CONF_LOGGER_CONFIG_FILE_NAME = \"sopeco.config.loggerConfigFileName\";\n\n\tString CONF_SCENARIO_DESCRIPTION_FILE_NAME = \"sopeco.config.measurementSpecFileName\";\n\n\tString CONF_SCENARIO_DESCRIPTION = \"sopeco.config.measurementSpecification\";\n\n\tString CONF_MEASUREMENT_CONTROLLER_URI = \"sopeco.config.measurementControllerURI\";\n\n\tString CONF_MEASUREMENT_CONTROLLER_CLASS_NAME = \"sopeco.config.measurementControllerClassName\";\n\n\tString CONF_APP_NAME = \"sopeco.config.applicationName\";\n\n\tString CONF_MAIN_CLASS = \"sopeco.config.mainClass\";\n\n\tString CONF_MEC_ACQUISITION_TIMEOUT = \"sopeco.config.MECAcquisitionTimeout\";\n\n\n\tString CONF_MEC_SOCKET_RECONNECT_DELAY = \"sopeco.config.mec.reconnectDelay\";\n\n\tString CONF_HTTP_PROXY_HOST = \"sopeco.config.httpProxyHost\";\n\t\n\tString CONF_HTTP_PROXY_PORT = \"sopeco.config.httpProxyPort\";\n\n\t\n\tString CONF_DEFINITION_CHANGE_HANDLING_MODE = \"sopeco.config.definitionChangeHandlingMode\";\n\tString DCHM_ARCHIVE = \"archive\";\n\tString DCHM_DISCARD = \"discard\";\n\n\tString CONF_SCENARIO_DEFINITION_PACKAGE = \"sopeco.config.xml.scenarioDefinitionPackage\";\n\t/** Holds the path to the root folder of SoPeCo. */\n\tString CONF_APP_ROOT_FOLDER = \"sopeco.config.rootFolder\";\n\tString CONF_EXPERIMENT_EXECUTION_SELECTION = \"sopeco.engine.experimentExecutionSelection\";\n\t/**\n\t * Holds the path to the plugins folder, relative to the root folder of\n\t * SoPeCo.\n\t */\n\tString CONF_PLUGINS_DIRECTORIES = \"sopeco.config.pluginsDirs\";\n\n\tString CLA_EXTENSION_ID = \"org.sopeco.config.commandlinearguments\";\n\n\t/** Folder for configuration files relative to the application root folder */\n\tString DEFAULT_CONFIG_FOLDER_NAME = \"config\";\n\n\tString DEFAULT_CONFIG_FILE_NAME = \"sopeco-defaults.conf\";\n\n\tString DIR_SEPARATOR = \":\";\n\t\n\tString EXPERIMENT_RUN_ABORT = \"org.sopeco.experiment.run.abort\";\n\n\t/**\n\t * Export the configuration as a key-value map. Both, the default ones and the ones in the\n\t * system environment are included.\n\t * \n\t * @return a key-value representation of the configuration\n\t * \n\t * @deprecated Use {@code exportConfiguration()} and {@code exportDefaultConfiguration}.\n\t */\n\t@Deprecated\n\tMap<String, Object> getProperties();\n\t\n\t/**\n\t * Exports the configuration as a key-value map. The default configuration and the ones\n\t * defined in the system environment are not included. \n\t * \n\t * @return a key-value representation of the configuration\n\t */\n\tMap<String, Object> exportConfiguration();\n\t\n\t/**\n\t * Exports the default configuration as a key-value map. The actual configuration and the ones\n\t * defined in the system environment are not included. \n\t * \n\t * @return a key-value representation of the configuration\n\t */\n\tMap<String, Object> exportDefaultConfiguration();\n\t\n\t/**\n\t * Imports the configuration as a key-value map. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid importConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Imports the default configuration as a key-value map. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid importDefaultConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Overwrites the configuration with the given configuration. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid overwriteConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Overwrites the default configuration with the given configuration. \n\t * \n\t * @param config a key-value map representation of the default configuration\n\t */\n\tvoid overwriteDefaultConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Returns the configured value of the given property in SoPeCo.\n\t * \n\t * It first looks up the current SoPeCo configuration, if there is no value\n\t * defined there, looks up the system properties, if no value is defined\n\t * there, then loads it from the default values; in case of no default\n\t * value, returns null.\n\t * \n\t * @param key\n\t * property key\n\t * @return Returns the configured value of the given property in SoPeCo.\n\t */\n\tObject getProperty(String key);\n\n\t/**\n\t * Returns the configured value of the given property as a String.\n\t * \n\t * This method calls the {@link Object#toString()} of the property value and\n\t * is for convenience only. If the given property is not set, it returns\n\t * <code>null</code>.\n\t * \n\t * @param key\n\t * property key\n\t * \n\t * @see #getProperty(String)\n\t * @return Returns the configured value of the given property as a String.\n\t */\n\tString getPropertyAsStr(String key);\n\n\t/**\n\t * Returns the configured value of the given property as a Boolean value.\n\t * \n\t * This method uses the {@link #getPropertyAsStr(String)} and interprets\n\t * values 'yes' and 'true' (case insensitive) as a Boolean <code>true</code>\n\t * value and all other values as <code>false</code>. If the value of the\n\t * given property is <code>null</code> it returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a boolean\n\t * \n\t * @see #getProperty(String)\n\t */\n\tboolean getPropertyAsBoolean(String key, boolean defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as a Long value.\n\t * \n\t * This method uses the {@link Long.#parseLong(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a long\n\t * \n\t * @see #getProperty(String)\n\t */\n\tlong getPropertyAsLong(String key, long defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as a Double value.\n\t * \n\t * This method uses the {@link Double.#parseLong(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a double\n\t * \n\t * @see #getProperty(String)\n\t */\n\tdouble getPropertyAsDouble(String key, double defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as an Integer value.\n\t * \n\t * This method uses the {@link Integer.#parseInt(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as an int\n\t * \n\t * @see #getProperty(String)\n\t */\n\tint getPropertyAsInteger(String key, int defaultValue);\n\n\t/**\n\t * Sets the value of a property for the current run.\n\t * \n\t * @param key\n\t * property key\n\t * @param value\n\t * property value\n\t */\n\tvoid setProperty(String key, Object value);\n\n\t/**\n\t * Clears the value of the given property in all layers of configuration,\n\t * including the system property environment.\n\t * \n\t * @param key the property\n\t */\n\tvoid clearProperty(String key);\n\n\t/**\n\t * Returns the default value (ignoring the current runtime configuration)\n\t * for a given property.\n\t * \n\t * @param key\n\t * porperty key\n\t * \n\t * @return Returns the default value for a given property.\n\t */\n\tObject getDefaultValue(String key);\n\n\t/**\n\t * Processes the given command line arguments, the effects of which will\n\t * reflect in the global property values.\n\t * \n\t * @param args\n\t * command line arguments\n\t * @throws ConfigurationException\n\t * if there is any problem with command line arguments\n\t */\n\tvoid processCommandLineArguments(String[] args) throws ConfigurationException;\n\n\t/**\n\t * Loads default configurations from a file name. If the file name is not an\n\t * absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the system class loader. See\n\t * {@link #loadDefaultConfiguration(ClassLoader, String)} for loading\n\t * default configuration providing a class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t * \n\t */\n\tvoid loadDefaultConfiguration(String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads default configurations from a file name. If the file name is not an\n\t * absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the given class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param classLoader\n\t * an instance of a class loader\n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadDefaultConfiguration(ClassLoader classLoader, String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads user-level configurations from a file name. If the file name is not\n\t * an absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the system class loader. See\n\t * {@link #loadConfiguration(ClassLoader, String)} for loading default\n\t * configuration providing a class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadConfiguration(String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads user-level configurations from a file name. If the file name is not\n\t * an absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finally the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the given class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param classLoader\n\t * an instance of a class loader\n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadConfiguration(ClassLoader classLoader, String fileName) throws ConfigurationException;\n\n\t/**\n\t * Performs any post processing of configuration settings that may be\n\t * required.\n\t * \n\t * This method can be called after manually making changes to the\n\t * configuration values. It should be called automatically after a call to\n\t * {@link IConfiguration#loadConfiguration(String)}.\n\t */\n\tvoid applyConfiguration();\n\n\t/**\n\t * Sets the value of scenario description file name.\n\t * \n\t * @param fileName\n\t * file name\n\t * @see #CONF_SCENARIO_DESCRIPTION_FILE_NAME\n\t */\n\tvoid setScenarioDescriptionFileName(String fileName);\n\n\t/**\n\t * Sets the sceanrio description as the given object. This property in\n\t * effect overrides the value of scenario description file name (\n\t * {@link IConfiguration#CONF_SCENARIO_DESCRIPTION_FILE_NAME}).\n\t * \n\t * @param sceanrioDescription\n\t * an instance of a scenario description\n\t * @see #CONF_SCENARIO_DESCRIPTION\n\t */\n\tvoid setScenarioDescription(Object sceanrioDescription);\n\n\t/**\n\t * Sets the measurement controller URI.\n\t * \n\t * @param uriStr\n\t * a URI as an String\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tvoid setMeasurementControllerURI(String uriStr) throws ConfigurationException;\n\n\t/**\n\t * Sets the measurement controller class name. This also sets the\n\t * measurement controller URI to be '<code>class://[CLASS_NAME]</code>'.\n\t * \n\t * @param className\n\t * the full name of the class\n\t * @see #CONF_MEASUREMENT_CONTROLLER_CLASS_NAME\n\t */\n\tvoid setMeasurementControllerClassName(String className);\n\n\t/**\n\t * Sets the application name for this executable instance.\n\t * \n\t * @param appName\n\t * an application name\n\t */\n\tvoid setApplicationName(String appName);\n\n\t/**\n\t * Sets the main class that runs this thread. This will also be used in\n\t * finding the root folder\n\t * \n\t * @param mainClass\n\t * class to be set as main class\n\t */\n\tvoid setMainClass(Class<?> mainClass);\n\n\t/**\n\t * Sets the logger configuration file name and triggers logger\n\t * configuration.\n\t * \n\t * @param fileName\n\t * a file name\n\t */\n\tvoid setLoggerConfigFileName(String fileName);\n\n\t/**\n\t * @return Returns the application root directory.\n\t */\n\tString getAppRootDirectory();\n\n\t/**\n\t * Sets the application root directory to the given folder.\n\t * \n\t * @param rootDir\n\t * path to a folder\n\t */\n\tvoid setAppRootDirectory(String rootDir);\n\n\t/**\n\t * @return Returns the application's configuration directory.\n\t */\n\tString getAppConfDirectory();\n\n\t/**\n\t * @return Returns the value of scenario description file name.\n\t * \n\t * @see #CONF_SCENARIO_DESCRIPTION_FILE_NAME\n\t */\n\tString getScenarioDescriptionFileName();\n\n\t/**\n\t * @return returns the sceanrio description as the given object.\n\t * \n\t * @see #CONF_SCENARIO_DESCRIPTION\n\t */\n\tObject getScenarioDescription();\n\n\t/**\n\t * @return Returns the measurement controller URI.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tURI getMeasurementControllerURI();\n\n\t/**\n\t * @return Returns the measurement controller URI as a String.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tString getMeasurementControllerURIAsStr();\n\n\t/**\n\t * @return Returns the measurement controller class name.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_CLASS_NAME\n\t */\n\tString getMeasurementControllerClassName();\n\n\t/**\n\t * @return Returns the application name for this executable instance.\n\t */\n\tString getApplicationName();\n\n\t/**\n\t * @return Returns the main class that runs this thread. This value must\n\t * have been set by a call to\n\t * {@link IConfiguration#setMainClass(Class)}.\n\t */\n\tClass<?> getMainClass();\n\n\t/**\n\t * Writes the current configuration values into a file.\n\t * \n\t * @param fileName\n\t * the name of the file\n\t * @throws IOException\n\t * if exporting the configuration fails\n\t */\n\tvoid writeConfiguration(String fileName) throws IOException;\n\n\t/**\n\t * Overrides the values of this configuration with those of the given\n\t * configuration.\n\t * \n\t * @param configuration\n\t * with the new values\n\t */\n\t void overwrite(IConfiguration configuration);\n\n\t /**\n\t * Adds a new command-line extension to the configuration component. \n\t * \n\t * The same extension will not be added twice. \n\t * \n\t * @param extension a command-line extension\n\t */\n\t void addCommandLineExtension(ICommandLineArgumentsExtension extension);\n\t \n\t /**\n\t * Removes a new command-line extension from the configuration component. \n\t * \n\t * @param extension a command-line extension\n\t */\n\t void removeCommandLineExtension(ICommandLineArgumentsExtension extension);\n}", "public static Configurable configure() {\n return new SqlVirtualMachineManager.ConfigurableImpl();\n }", "public interface ConfigureConfiguration {\n\n\t// A list of names of configuration files\n\t@Option(shortName=\"c\", description = \"Name of one or many configuration \"\n\t\t+ \"files. Parameters in configuration files override each other. If a\"\n\t\t+ \" parameter is provided in more than one file, the first occurrence \"\n\t\t+ \" is used.\"\n\t) \n\tList<File> getConf();\n\tboolean isConf();\n\t\n}", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public static Configurable configure() {\n return new SqlServerManager.ConfigurableImpl();\n }", "@Override\n public void setConf(Configuration conf) {\n }", "public interface Configuration {\n\n}", "public abstract void changeConfiguration(Configuration configuration);", "public abstract Configuration configuration();", "public void setConfig(ConfigurationHolder c) {\n this.cfg = c;\n }", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of RedisManager that exposes Cache management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing Cache management API entry points that work across subscriptions\n */\n RedisManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "void applyConfiguration(Configuration configuration);", "protected void enhanceConfig(ConfigurationBuilder c) {\n }", "@Override\n\tpublic void configure(JSONObject settings)\n\t{\n\t\tthrow new UnsupportedOperationException();\n\t}", "public T caseConfigurable(Configurable object) {\n\t\treturn null;\n\t}", "@Override\n public void configure(Configuration conf) throws ConfigurationException\n {\n super.configure( conf );\n lazyLoading = conf.getAttributeAsBoolean( LAZY_LOADING, false);\n getLogger().debug(\"setting lazyLoading: \" + lazyLoading);\n }", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of SqlVirtualMachineManager that exposes SqlVirtualMachine management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing SqlVirtualMachine management API entry points that work across subscriptions\n */\n SqlVirtualMachineManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "public void injectConfiguration(ComponentConfiguration conf);", "void overwrite(IConfiguration configuration);", "protected void configure() {\n\t \n\t Configuration.BASE=true;\n\t Configuration.BASEMENUBAR=true;\n\t Configuration.BASETOOLBAR=true;\n\t Configuration.EDITMENUBAR=true;\n\t Configuration.EDITTOOLBAR=true;\n\t Configuration.FORMATMENUBAR=true;\n\t Configuration.FORMATTOOLBAR=true;\n\t Configuration.PERSISTENCEMENUBAR=true;\n\t Configuration.PERSISTENCETOOLBAR=true;\n\t Configuration.PRINTMENUBAR=true;\n\t Configuration.PRINTTOOLBAR=true;\n\t Configuration.SEARCHMENUBAR=true;\n\t Configuration.SEARCHTOOLBAR=true;\n\t Configuration.UNDOREDOMENUBAR=true;\n\t \t Configuration.UNDOREDOTOOLBAR=true;\n\t //\n\t Configuration.WORDCOUNTMENUBAR=true;\n\t Configuration.WORDCOUNTTOOLBAR=true;\n }", "void overwriteConfiguration(Map<String, Object> config);", "@Override\n\tpublic void configure(ComponentConfiguration arg0) {\n\t\t\n\t}", "@Override\n\tpublic void configure(ComponentConfiguration arg0) {\n\n\t}", "public void setConfig(C config)\n {\n this.config = config;\n fireConfigChanged();\n }", "Configuration getConfiguration();", "Configuration getConfiguration();", "Configuration getConfiguration();", "Configuration getConfiguration();", "public T caseConfiguration(Configuration object) {\n\t\treturn null;\n\t}", "public void setConfig(ConfigurationManagement config) {\r\n\t\tthis.config = config;\r\n\t}", "public void setConfigurations() {\n configurations = jsonManager.getConfigurationsFromJson();\n }", "@Override\n\t\t\tprotected void configure() {\n\t\t\t}", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of RecoveryServicesManager that exposes RecoveryServices management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing RecoveryServices management API entry points that work across subscriptions\n */\n RecoveryServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of RecoveryServicesManager that exposes RecoveryServices management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing RecoveryServices management API entry points that work across subscriptions\n */\n RecoveryServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "protected Configuration getConfiguration(){\n return configuration;\n }", "@Override\n\tpublic void configure(JobConf arg0) {\n\t\t\n\t}", "public void setConfiguration(CodeGeneratorConfiguration config) {\n \t\tthis.config = config;\n \t}", "@Override\n\tpublic void configure(Context arg0) {\n\n\t}", "public void configure( final Configuration configuration )\n throws ConfigurationException\n {\n final String name =\n configuration.getChild( \"name\" ).getValue();\n setName( name );\n final int priority =\n configuration.getChild( \"priority\" ).getValueAsInteger( Thread.NORM_PRIORITY );\n setPriority( priority );\n final boolean isDaemon =\n configuration.getChild( \"is-daemon\" ).getValueAsBoolean( false );\n setDaemon( isDaemon );\n\n final GenericObjectPool.Config config = getCommonsConfig();\n\n final boolean limit =\n configuration.getChild( \"resource-limiting\" ).getValueAsBoolean( false );\n if( limit )\n {\n config.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK;\n }\n else\n {\n config.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_GROW;\n }\n\n config.maxActive =\n configuration.getChild( \"max-threads\" ).getValueAsInteger( 10 );\n config.maxIdle = configuration.getChild( \"max-idle\" ).\n getValueAsInteger( config.maxActive / 2 );\n }", "public void setConfig(WeberknechtConf conf, AreaPathResolver areaPathResolver);", "public boolean setConfiguration(ProgressSiteConfiguration config);", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of SqlServer that exposes Compute resource management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription\n * @return the SqlServer\n */\n SqlServerManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "protected static void setConfigured(boolean fConfig)\n {\n __s_Configured = fConfig;\n }", "void configure (Settings settings);", "@Override\n\tpublic void configure(Context arg0) {\n\t\t\n\t}", "@Override\n\tpublic void configure(Context arg0) {\n\t\t\n\t}", "@Override\n public void configure() {\n }", "@Override\r\n public void configure(Map<String, ?> configs, boolean isKey) {\n \r\n }", "@Override\n\tpublic void configure(Map<String, ?> configs, boolean isKey) {\n\t}", "protected void sequence_Configuration(ISerializationContext context, Configuration semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "@Override\n public void configure(Map<String, ?> configs, boolean isKey) {\n }", "void configure();", "void config(Config config);", "@Override\n\tpublic void configure(AladinScriptActivityConfigurationBean configBean)\n\t\t\tthrows ActivityConfigurationException {\n\t\t\n\t\tif(!( configBean.getTypeOfInput().compareTo(\"File\")==0\n\t\t\t\t|| configBean.getTypeOfInput().compareTo(\"URL\")==0\n\t\t\t\t|| configBean.getTypeOfInput().compareTo(\"String\")==0)){\n\t\t\tthrow new ActivityConfigurationException(\n\t\t\t\t\t\"Invalid input type for the tables\");\n\t\t}\n\t\t\n\t\tif(!( configBean.getTypeOfMode().compareTo(\"gui\")==0\n\t\t\t\t|| configBean.getTypeOfMode().compareTo(\"nogui\")==0)){\n\t\t\tthrow new ActivityConfigurationException(\n\t\t\t\t\t\"Invalid type of process.\");\n\t\t}\n\t\t\n\t\t\n\t\t// Store for getConfiguration(), but you could also make\n\t\t// getConfiguration() return a new bean from other sources\n\t\tthis.configBean = configBean;\n\n\t\t// OPTIONAL: \n\t\t// Do any server-side lookups and configuration, like resolving WSDLs\n\n\t\t// myClient = new MyClient(configBean.getExampleUri());\n\t\t// this.service = myClient.getService(configBean.getExampleString());\n\n\t\t\n\t\t// REQUIRED: (Re)create input/output ports depending on configuration\n\t\tconfigurePorts();\n\t}", "@Override\n public void configure(Map<String, ?> configs, boolean isKey) {\n }", "public interface ConfigProcessor {\n\n\tvoid inject2Instance(Object obj,String keyName);\n\n\tvoid storeOneFile(ConfigBaseModel configBaseModel);\n\n\tvoid inject2Conf();\n\n}", "@Override\n\tpublic void configure() {\n\t\t\n\t}", "@Override\n\tpublic void configure() {\n\n\t}", "public void setConfig(Config config) {\n this.config = config;\n }", "public interface ConfigurableComponentProvider extends ComponentProvider {\n\n}", "public void configure( InputStream is )\n throws IOException, ConfigurationException, DuplicateRealmException, NoSuchRealmException {\n final Configurator configurator = new Configurator( this );\n \n configurator.configure( is );\n }", "public boolean configure(String name, Map<String, Object> params) throws ConfigurationException;", "public interface XmlConfigurable {\n\n /** Configure the object using the xml tree rooted at the supplied org.jdom.Element.\n * @param node An instance of org.jdom.Element containing the root of the object's\n * configuration information tree.\n * @throws Exception if the configuration is invalid in some way.\n */\n public void configure(Element node) throws Exception;\n\n}", "public ComponentConfiguration getConfiguration();", "protected final Configuration getConfiguration()\n {\n return mConfiguration;\n }", "public interface ConfigurationManager {\n\n String loadRunAsUser();\n\n void storeRunAsUser(String username);\n\n List<String> loadEnabledProjects();\n\n void storeEnabledProjects(List<String> projectKeys);\n\n Map<String, String> loadBranchFilters();\n \n void storeBranchFilters(Map<String, String> branchFilters);\n \n /**\n * @since v1.2\n */\n Collection<String> loadCrucibleUserNames();\n\n /**\n * @since v1.2\n */\n void storeCrucibleUserNames(Collection<String> usernames);\n\n /**\n * @since v1.3\n */\n Collection<String> loadCrucibleGroups();\n\n /**\n * @since v1.3\n */\n void storeCrucibleGroups(Collection<String> groupnames);\n\n CreateMode loadCreateMode();\n\n void storeCreateMode(CreateMode mode);\n\n /**\n * @since v1.4.1\n */\n boolean loadIterative();\n\n /**\n * @since v1.4.1\n */\n void storeIterative(boolean iterative);\n}", "protected void additionalConfig(ConfigType config){}", "public abstract IOpipeConfiguration config();", "@Override\n public void configure(@Nonnull AbstractConfigNode node) throws ConfigurationException {\n Preconditions.checkArgument(node instanceof ConfigPathNode);\n try {\n ConfigurationAnnotationProcessor.readConfigAnnotations(getClass(), (ConfigPathNode) node, this);\n Map<String, Object> config = configuration(node);\n ClientBuilder builder = ClientBuilder.newBuilder();\n if (config != null && !config.isEmpty()) {\n for (String key : config.keySet()) {\n builder.property(key, config.get(key));\n }\n }\n builder.connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS);\n builder.readTimeout(readTimeout, TimeUnit.MILLISECONDS);\n\n if (useSSL) {\n builder.sslContext(SSLContext.getDefault());\n }\n client = builder.register(JacksonJaxbJsonProvider.class).build();\n state().setState(EConnectionState.Open);\n } catch (Exception ex) {\n state().setError(ex);\n throw new ConfigurationException(ex);\n }\n }", "public void configure(Map<String, String> configuration) throws AlgebricksException;", "public void setCon(Object o) {\n con = o;\n }", "public void setConfigurationService(ConfigurationService kualiConfigurationService) {\n this.kualiConfigurationService = kualiConfigurationService;\n }", "public void configure(Entity entity, boolean canChangePermission);", "@Override\r\n\tprotected void configure() {\n\t\t\r\n\t}", "@Override\n public boolean isConfigured() {\n return delegate.isConfigured();\n }", "public void setObject(Object obj) {\n\tObject bean = ((AxBridgeObject)obj).getJavaObject();\n\ttry {\n\t Class cls = bInfo.getBeanDescriptor().getCustomizerClass();\n\t if(cls != null) {\n\t\tcustomizer = (Customizer)cls.newInstance();\n\t\tcomp = (Component)customizer;\n\t\tcustomizer.setObject(bean);\n\t }\n\t \n\t //If no customizer, try property editors\n\t if(comp == null) {\n\t\tPropertyDescriptor[] pds = bInfo.getPropertyDescriptors();\n\t\tfor(int i=0;i<pds.length;i++) {\n\t\t cls = pds[i].getPropertyEditorClass();\n\t\t if(cls != null) {\n\t\t\t//System.out.println(cls.toString() + i);\n\t\t\tpropEditor = (PropertyEditor)cls.newInstance();\n\t\t\tif(propEditor.supportsCustomEditor()) {\n\t\t\t comp = propEditor.getCustomEditor();\n\t\t\t propEditor.setValue(bean);\n\t\t\t break;\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t} catch(Throwable e) {\n\t e.printStackTrace();\n\t}\n }", "public interface ArchivaConfiguration\n{\n\n\n String USER_CONFIG_PROPERTY = \"archiva.user.configFileName\";\n String USER_CONFIG_ENVVAR = \"ARCHIVA_USER_CONFIG_FILE\";\n\n /**\n * Get the configuration.\n *\n * @return the configuration\n */\n Configuration getConfiguration();\n\n /**\n * Save any updated configuration.\n *\n * @param configuration the configuration to save\n * @throws org.apache.archiva.components.registry.RegistryException\n * if there is a problem saving the registry data\n * @throws IndeterminateConfigurationException\n * if the configuration cannot be saved because it was read from two sources\n */\n void save( Configuration configuration )\n throws RegistryException, IndeterminateConfigurationException;\n\n /**\n * Save any updated configuration. This method allows to add a tag to the thrown event.\n * This allows to verify the origin if the caller is the same as the listener.\n *\n * @param configuration the configuration to save\n * @param eventTag the tag to add to the thrown event\n * @throws org.apache.archiva.components.registry.RegistryException\n * if there is a problem saving the registry data\n * @throws IndeterminateConfigurationException\n * if the configuration cannot be saved because it was read from two sources\n */\n void save( Configuration configuration, String eventTag )\n throws RegistryException, IndeterminateConfigurationException;\n\n /**\n * Determines if the configuration in use was as a result of a defaulted configuration.\n *\n * @return true if the configuration was created from the default-archiva.xml as opposed\n * to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or\n * ${appserver.base}/conf/archiva.xml\n */\n boolean isDefaulted();\n\n /**\n * Add a configuration listener to notify of changes to the configuration.\n *\n * @param listener the listener\n */\n void addListener( ConfigurationListener listener );\n\n /**\n * Remove a configuration listener to stop notifications of changes to the configuration.\n *\n * @param listener the listener\n */\n void removeListener( ConfigurationListener listener );\n\n /**\n * Add a registry listener to notify of events in spring-registry.\n *\n * @param listener the listener\n * TODO: Remove in future.\n */\n void addChangeListener( RegistryListener listener );\n\n void removeChangeListener( RegistryListener listener );\n\n /**\n * reload configuration from file included registry\n *\n * @since 1.4-M1\n */\n void reload();\n\n public Locale getDefaultLocale();\n\n public List<Locale.LanguageRange> getLanguagePriorities();\n\n public Path getAppServerBaseDir();\n\n /**\n * Returns the base directory for repositories that have a relative location path set.\n * @return\n */\n public Path getRepositoryBaseDir();\n\n /**\n * Returns the base directory for remote repositories\n * @return\n */\n public Path getRemoteRepositoryBaseDir();\n\n /**\n * Returns the base directory for repository group files.\n * @return\n */\n public Path getRepositoryGroupBaseDir();\n\n /**\n * Returns the data directory where repositories and metadata reside\n * @return\n */\n public Path getDataDirectory();\n\n /**\n * Return the used configuration registry\n * @return\n */\n Registry getRegistry( );\n}", "public void setConfig(KernelConfig config)\n {\n Kernel.checkConfigure();\n this.config = config;\n }", "public T caseConfiguration(Configuration object)\n {\n return null;\n }", "public void setConfiguration(\n Configuration configuration) {\n this.configuration = configuration;\n }", "public Configuration update(final Configuration configuration);", "public void configure(Configuration config) throws ConfigurationException {\n\n this.inputConf = config.getChild(\"input-module\");\n this.inputName = this.inputConf.getAttribute(\"name\", this.inputHint);\n this.outputConf = config.getChild(\"output-module\");\n this.outputName = this.outputConf.getAttribute(\"name\", this.outputHint);\n this.defaultParameterName = config.getChild(\"parameter-name\").getValue(null);\n this.useGetValues = config.getChild(\"use-getValues\").getValueAsBoolean(this.useGetValues);\n }", "public void setConfig(FCKEditorConfig value)\n {\n config = value;\n }" ]
[ "0.73894143", "0.73873013", "0.71150565", "0.7039677", "0.66550285", "0.6559196", "0.64902765", "0.6342369", "0.63278323", "0.6107082", "0.6064918", "0.6030355", "0.59945977", "0.5993128", "0.59178334", "0.59052384", "0.58824915", "0.5857691", "0.58546424", "0.5825903", "0.5825903", "0.58099854", "0.5803918", "0.5773497", "0.5739695", "0.5661028", "0.56242526", "0.5615472", "0.55982983", "0.5570581", "0.5563584", "0.5553566", "0.5542029", "0.5540026", "0.5521614", "0.5491471", "0.54869795", "0.5463084", "0.5454039", "0.54510725", "0.54220474", "0.54163796", "0.54163796", "0.54163796", "0.54163796", "0.5402207", "0.5374255", "0.536423", "0.5356802", "0.53529024", "0.53529024", "0.53398925", "0.5328057", "0.53271705", "0.53208745", "0.53136843", "0.52991796", "0.52891713", "0.5288042", "0.5280351", "0.52802086", "0.5261342", "0.5261342", "0.52569443", "0.5252232", "0.5249609", "0.524464", "0.5241959", "0.52355355", "0.5232066", "0.5230599", "0.5213079", "0.5211343", "0.5202316", "0.51992255", "0.51878613", "0.518079", "0.5177223", "0.516922", "0.5166646", "0.51605815", "0.5155592", "0.51510006", "0.5147968", "0.5138407", "0.5133964", "0.5130489", "0.5129972", "0.5123963", "0.51228124", "0.511818", "0.5111268", "0.5109843", "0.5103461", "0.50984573", "0.50934744", "0.50658", "0.5064193", "0.50638354", "0.5062396" ]
0.70211303
4
Set JobConf if object is JobConfigurable
public static void setJobConfIfPossible(Object object, JobConf jobConf) { if (object instanceof JobConfigurable) { ((JobConfigurable) object).configure(jobConf); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void configure(JobConf arg0) {\n\t\t\n\t}", "protected JobConf createJobConf() \n {\n return new JobConf();\n }", "JobConf getJobConf() {\n return jobConf;\n }", "public interface Configurable {\n void setConf(Configuration conf);\n Configuration getConf();\n}", "abstract Configurable<?> getConfigurable();", "public void setHadoopJob( Job currJob ) ;", "public void configure(JobConf job) {\n\t\ttimeGranularity = Integer.parseInt(job.get(\"timeGranularity\"));\n\t}", "public void configure(JobConf conf) {\n filePath = conf.get(INPUT_FILE_PARAMETER);\n }", "public void setJobObserver(JobObserver jO) {\n\r\n\t}", "public interface Configurable {\n\n void configure(Properties properties);\n}", "protected void configureJob(Job job) {\n\t\tjob.setUser(true);\n\t\tjob.setPriority(Job.LONG);\n\t}", "private void setConfiguration() throws IOException{\n\t\tString confPath = \"mapreduce.conf\";\n\t\tFileInputStream fis = new FileInputStream(confPath);\n\t\tthis.load(fis);\n\t\tfis.close();\n\t}", "public void\t\tsetConfiguration(Object obj);", "public static void setConfIfPossible(Object object, Configuration conf) {\n if (object instanceof Configurable) {\n ((Configurable) object).setConf(conf);\n }\n }", "public interface IJobshelper {\n\n\t/**\n\t * Can do some initialization for task like file location, Emailer list, Emailer\n\t * message etc This is used to set some configuration for this Job and should be\n\t * using some properties file so that each Job could use specific configuration\n\t * \n\t * @throws JobExecutionException\n\t */\n\tpublic void initialJobContext(String configFileName) throws JobExecutionException;\n\n}", "private Properties getJobConfFromFile(RunningJob runningJob) {\n Properties jobConfProperties = new Properties();\n try {\n log.info(\"RunningJob Configuration File location: \" + runningJob.getJobFile());\n Path path = new Path(runningJob.getJobFile());\n Configuration conf = new Configuration(false);\n FileSystem fileSystem = FileSystem.get(new Configuration());\n InputStream inputStream = fileSystem.open(path);\n conf.addResource(inputStream);\n\n for (Map.Entry<String, String> entry : conf) {\n if (entry.getKey().equals(\"pig.mapPlan\")\n || entry.getKey().equals(\"pig.reducePlan\")) {\n jobConfProperties.setProperty(entry.getKey(),\n ObjectSerializer.deserialize(entry.getValue()).toString());\n } else {\n jobConfProperties.setProperty(entry.getKey(), entry.getValue());\n }\n }\n } catch (FileNotFoundException e) {\n log.warn(\"Configuration file not found for old jobsflows.\");\n } catch (IOException e) {\n log.warn(\"Error occurred when retrieving configuration info.\", e);\n }\n return jobConfProperties;\n }", "public void initialJobContext(String configFileName) throws JobExecutionException;", "public void setConfiguration(Properties props);", "private void setProperties( JobConf conf ) throws IOException {\n \t\tConfig index_conf = ConfigFactory.load();\n\t\tconf.set( CONFIG_PROPERTIES, index_conf.toString());\n \n \t\t// Also set mapred speculative execution off:\n \t\tconf.set( \"mapred.reduce.tasks.speculative.execution\", \"false\" );\n \n \t\t// Reducer count dependent on concurrent HTTP connections to Solr server.\n \t\ttry {\n \t\t\tnumReducers = index_conf.getInt( \"warc.hadoop.num_reducers\" );\n \t\t} catch( NumberFormatException n ) {\n \t\t\tnumReducers = 10;\n \t\t}\n \t}", "private void initialiseConfiguration(final JobExecutionContext context)\n \n {\n // PRECONDITIONS\n assert context != null : \"context must not be null.\";\n \n // Body\n \n // Pull state from the job configuration data.\n JobDataMap jobData = context.getJobDetail().getJobDataMap();\n Object transactionServiceObj = jobData.get(JOB_DATA_PARAMETER_NAME_TRANSACTION_SERVICE);\n Object deploymentReportCleanupServiceObj = jobData.get(JOB_DATA_PARAMETER_NAME_DEPLOYMENT_REPORT_CLEANUP_SERVICE);\n Object webProjectNodeRefObj = jobData.get(JOB_DATA_PARAMETER_NAME_WEB_PROJECT_NODE_REF);\n Object webProjectDNSNameObj = jobData.get(JOB_DATA_PARAMETER_NAME_WEB_PROJECT_DNS_NAME);\n Object maxReportsToPrunePerBatchObj = jobData.get(JOB_DATA_PARAMETER_NAME_MAX_REPORTS_TO_PRUNE_PER_BATCH);\n\n \n // Service Registry\n if (transactionServiceObj == null ||\n !(transactionServiceObj instanceof TransactionService))\n {\n throw new AlfrescoRuntimeException(JOB_DATA_PARAMETER_NAME_TRANSACTION_SERVICE + \" must be provided and must be a reference to an instance of org.alfresco.service.transaction.TransactionService.\");\n }\n \n this.transactionService = (TransactionService)transactionServiceObj;\n \n \n // Timed Deployment Service\n if (deploymentReportCleanupServiceObj == null ||\n !(deploymentReportCleanupServiceObj instanceof DeploymentReportCleanupService))\n {\n throw new AlfrescoRuntimeException(JOB_DATA_PARAMETER_NAME_DEPLOYMENT_REPORT_CLEANUP_SERVICE + \" must be provided and must be a reference to an instance of org.alfresco.extension.deployment.reports.DeploymentReportCleanupService.\");\n }\n \n this.deploymentReportCleanupService = (DeploymentReportCleanupService)deploymentReportCleanupServiceObj;\n\n \n // Web Project, either by NodeRef or DNS Name\n if (webProjectNodeRefObj == null &&\n webProjectDNSNameObj == null)\n {\n throw new AlfrescoRuntimeException(\"Either \" + JOB_DATA_PARAMETER_NAME_WEB_PROJECT_NODE_REF + \" or \" +\n JOB_DATA_PARAMETER_NAME_WEB_PROJECT_DNS_NAME + \" must be provided.\");\n }\n \n if (webProjectNodeRefObj != null)\n {\n this.webProjectNodeRef = new NodeRef((String)webProjectNodeRefObj);\n }\n \n if (webProjectDNSNameObj != null)\n {\n this.webProjectDNSName = (String)webProjectDNSNameObj;\n }\n \n \n // Max reports to prune per batch\n if (maxReportsToPrunePerBatchObj != null &&\n maxReportsToPrunePerBatchObj instanceof String)\n {\n int maxReportsToPrunePerBatch = -1;\n \n try\n {\n maxReportsToPrunePerBatch = Integer.valueOf((String)maxReportsToPrunePerBatchObj);\n \n this.deploymentReportCleanupService.setMaxReportsToPrunePerBatch(maxReportsToPrunePerBatch);\n }\n catch (NumberFormatException nfe)\n {\n // Swallow and move on\n log.warn(\"Unable to parse \" + JOB_DATA_PARAMETER_NAME_MAX_REPORTS_TO_PRUNE_PER_BATCH + \" value '\" + (String)maxReportsToPrunePerBatchObj + \"' - reverting to default.\");\n }\n }\n }", "public interface Configurable\t{\n\t/**\n\t *\tConfiguration files have changed.\n\t */\n\tpublic void reConfigure();\n}", "public void setJobDataMap(JobDataMap jobDataMap) {\n this.jobDataMap = jobDataMap;\n }", "@Override\n\tpublic void setJob(String job) {\n\t\tsuper.setJob(job);\n\t}", "public JobConf createJobConf(byte id)\r\n\t\tthrows IOException\r\n\t{\r\n\t\t// preparing to create the new job, write the job conf\r\n\t\t\r\n\t\tthis.id = id;\r\n\t\t\r\n\t\tif ( this.tupleConstraint!=null)\r\n\t\t\tthis.conf.set(this.id+\".tuple.criteria\", SerializableUtil.serializeToBase64(this.tupleConstraint));\r\n\t\t\r\n\t\tStringBuffer schemaStr = new StringBuffer();\r\n\t\tIterator<String> it = this.getSchema().iterator();\r\n\t\twhile( it.hasNext() )\r\n\t\t{\r\n\t\t\tschemaStr.append(it.next());\r\n\t\t\tif( it.hasNext() )\r\n\t\t\t\tschemaStr.append(\",\");\r\n\t\t}\r\n\t\tthis.conf.set(this.id+\".schema\", schemaStr.toString());\r\n\t\t\r\n\t\t// setup computed columns, if any\r\n\t\tif( this.computedColumns!=null && this.computedColumns.size()>0 )\r\n\t\t{\r\n\t\t\tthis.conf.set(this.id+\".computed.columns\", SerializableUtil.serializeToBase64(this.computedColumns));\r\n\t\t}\r\n\t\t\r\n\t\t// setup id to name mapping\r\n\t\tString mapping = this.getID()+\";\"+this.getName();\r\n\t\t\r\n\t\tconf.set(ConfigureConstants.DATASET_ID_TO_NAME_MAPPING, mapping);\r\n\t\t\r\n\t\treturn new JobConf(this.conf);\r\n\t}", "public interface BaseJob {\n Object start();\n\n Object initJob(Map<String, Object> param);\n\n Object stop();\n}", "public boolean setConfiguration(ProgressSiteConfiguration config);", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of RedisManager that exposes Cache management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing Cache management API entry points that work across subscriptions\n */\n RedisManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "@Override\n public void setConf(Configuration conf) {\n }", "public interface Configurable {\n RequestConfig getConfig();\n}", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of RecoveryServicesManager that exposes RecoveryServices management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing RecoveryServices management API entry points that work across subscriptions\n */\n RecoveryServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of RecoveryServicesManager that exposes RecoveryServices management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing RecoveryServices management API entry points that work across subscriptions\n */\n RecoveryServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "public void setJobProgress(JobProgress jobProgress) {\n this.jobProgress = jobProgress;\n }", "public synchronized void setConfiguration(IWorkerPoolConfiguration newConfig) {\n if (name != null && !name.equals(newConfig.getName())) {\n // The given configuration is not for the managed worker pool!\n log.error(\"Name conflict between supplied configuration and worker pool: Config is for:\" + config.getName() + \", while worker pools name is:\" + name);\n throw new IllegalArgumentException(\"Name conflict between supplied configuration and worker pool: Config is for:\" + config.getName() + \", while worker pools name is:\" + name);\n } else {\n log.info(\"Start configuration\");\n if (this.config == null) {\n setup(newConfig);\n } else {\n reconfigure(newConfig);\n }\n \n this.config = newConfig;\n log.info(\"Done configuration\");\n }\n }", "public void setJob(String job) {\n this.job = job;\n }", "void configureSource(Job job, int inputId) throws IOException;", "public static Configuration getConfIfPossible(Object object) {\n if (object instanceof Configurable) {\n return ((Configurable) object).getConf();\n }\n return null;\n }", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of SqlVirtualMachineManager that exposes SqlVirtualMachine management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription UUID\n * @return the interface exposing SqlVirtualMachine management API entry points that work across subscriptions\n */\n SqlVirtualMachineManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "public interface IConfiguration extends ISessionAwareObject {\n\n\tString ENV_SOPECO_HOME = \"SOPECO_HOME\";\n\n\tString CONF_LOGGER_CONFIG_FILE_NAME = \"sopeco.config.loggerConfigFileName\";\n\n\tString CONF_SCENARIO_DESCRIPTION_FILE_NAME = \"sopeco.config.measurementSpecFileName\";\n\n\tString CONF_SCENARIO_DESCRIPTION = \"sopeco.config.measurementSpecification\";\n\n\tString CONF_MEASUREMENT_CONTROLLER_URI = \"sopeco.config.measurementControllerURI\";\n\n\tString CONF_MEASUREMENT_CONTROLLER_CLASS_NAME = \"sopeco.config.measurementControllerClassName\";\n\n\tString CONF_APP_NAME = \"sopeco.config.applicationName\";\n\n\tString CONF_MAIN_CLASS = \"sopeco.config.mainClass\";\n\n\tString CONF_MEC_ACQUISITION_TIMEOUT = \"sopeco.config.MECAcquisitionTimeout\";\n\n\n\tString CONF_MEC_SOCKET_RECONNECT_DELAY = \"sopeco.config.mec.reconnectDelay\";\n\n\tString CONF_HTTP_PROXY_HOST = \"sopeco.config.httpProxyHost\";\n\t\n\tString CONF_HTTP_PROXY_PORT = \"sopeco.config.httpProxyPort\";\n\n\t\n\tString CONF_DEFINITION_CHANGE_HANDLING_MODE = \"sopeco.config.definitionChangeHandlingMode\";\n\tString DCHM_ARCHIVE = \"archive\";\n\tString DCHM_DISCARD = \"discard\";\n\n\tString CONF_SCENARIO_DEFINITION_PACKAGE = \"sopeco.config.xml.scenarioDefinitionPackage\";\n\t/** Holds the path to the root folder of SoPeCo. */\n\tString CONF_APP_ROOT_FOLDER = \"sopeco.config.rootFolder\";\n\tString CONF_EXPERIMENT_EXECUTION_SELECTION = \"sopeco.engine.experimentExecutionSelection\";\n\t/**\n\t * Holds the path to the plugins folder, relative to the root folder of\n\t * SoPeCo.\n\t */\n\tString CONF_PLUGINS_DIRECTORIES = \"sopeco.config.pluginsDirs\";\n\n\tString CLA_EXTENSION_ID = \"org.sopeco.config.commandlinearguments\";\n\n\t/** Folder for configuration files relative to the application root folder */\n\tString DEFAULT_CONFIG_FOLDER_NAME = \"config\";\n\n\tString DEFAULT_CONFIG_FILE_NAME = \"sopeco-defaults.conf\";\n\n\tString DIR_SEPARATOR = \":\";\n\t\n\tString EXPERIMENT_RUN_ABORT = \"org.sopeco.experiment.run.abort\";\n\n\t/**\n\t * Export the configuration as a key-value map. Both, the default ones and the ones in the\n\t * system environment are included.\n\t * \n\t * @return a key-value representation of the configuration\n\t * \n\t * @deprecated Use {@code exportConfiguration()} and {@code exportDefaultConfiguration}.\n\t */\n\t@Deprecated\n\tMap<String, Object> getProperties();\n\t\n\t/**\n\t * Exports the configuration as a key-value map. The default configuration and the ones\n\t * defined in the system environment are not included. \n\t * \n\t * @return a key-value representation of the configuration\n\t */\n\tMap<String, Object> exportConfiguration();\n\t\n\t/**\n\t * Exports the default configuration as a key-value map. The actual configuration and the ones\n\t * defined in the system environment are not included. \n\t * \n\t * @return a key-value representation of the configuration\n\t */\n\tMap<String, Object> exportDefaultConfiguration();\n\t\n\t/**\n\t * Imports the configuration as a key-value map. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid importConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Imports the default configuration as a key-value map. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid importDefaultConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Overwrites the configuration with the given configuration. \n\t * \n\t * @param config a key-value map representation of the configuration\n\t */\n\tvoid overwriteConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Overwrites the default configuration with the given configuration. \n\t * \n\t * @param config a key-value map representation of the default configuration\n\t */\n\tvoid overwriteDefaultConfiguration(Map<String, Object> config);\n\t\n\t/**\n\t * Returns the configured value of the given property in SoPeCo.\n\t * \n\t * It first looks up the current SoPeCo configuration, if there is no value\n\t * defined there, looks up the system properties, if no value is defined\n\t * there, then loads it from the default values; in case of no default\n\t * value, returns null.\n\t * \n\t * @param key\n\t * property key\n\t * @return Returns the configured value of the given property in SoPeCo.\n\t */\n\tObject getProperty(String key);\n\n\t/**\n\t * Returns the configured value of the given property as a String.\n\t * \n\t * This method calls the {@link Object#toString()} of the property value and\n\t * is for convenience only. If the given property is not set, it returns\n\t * <code>null</code>.\n\t * \n\t * @param key\n\t * property key\n\t * \n\t * @see #getProperty(String)\n\t * @return Returns the configured value of the given property as a String.\n\t */\n\tString getPropertyAsStr(String key);\n\n\t/**\n\t * Returns the configured value of the given property as a Boolean value.\n\t * \n\t * This method uses the {@link #getPropertyAsStr(String)} and interprets\n\t * values 'yes' and 'true' (case insensitive) as a Boolean <code>true</code>\n\t * value and all other values as <code>false</code>. If the value of the\n\t * given property is <code>null</code> it returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a boolean\n\t * \n\t * @see #getProperty(String)\n\t */\n\tboolean getPropertyAsBoolean(String key, boolean defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as a Long value.\n\t * \n\t * This method uses the {@link Long.#parseLong(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a long\n\t * \n\t * @see #getProperty(String)\n\t */\n\tlong getPropertyAsLong(String key, long defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as a Double value.\n\t * \n\t * This method uses the {@link Double.#parseLong(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as a double\n\t * \n\t * @see #getProperty(String)\n\t */\n\tdouble getPropertyAsDouble(String key, double defaultValue);\n\n\t/**\n\t * Returns the configured value of the given property as an Integer value.\n\t * \n\t * This method uses the {@link Integer.#parseInt(String)} to interpret the\n\t * values. If the value of the given property is <code>null</code> it\n\t * returns the passed default value.\n\t * \n\t * @param key\n\t * property key\n\t * @param defaultValue\n\t * the default value returned in case of a null property value\n\t * \n\t * @return the value of the given property as an int\n\t * \n\t * @see #getProperty(String)\n\t */\n\tint getPropertyAsInteger(String key, int defaultValue);\n\n\t/**\n\t * Sets the value of a property for the current run.\n\t * \n\t * @param key\n\t * property key\n\t * @param value\n\t * property value\n\t */\n\tvoid setProperty(String key, Object value);\n\n\t/**\n\t * Clears the value of the given property in all layers of configuration,\n\t * including the system property environment.\n\t * \n\t * @param key the property\n\t */\n\tvoid clearProperty(String key);\n\n\t/**\n\t * Returns the default value (ignoring the current runtime configuration)\n\t * for a given property.\n\t * \n\t * @param key\n\t * porperty key\n\t * \n\t * @return Returns the default value for a given property.\n\t */\n\tObject getDefaultValue(String key);\n\n\t/**\n\t * Processes the given command line arguments, the effects of which will\n\t * reflect in the global property values.\n\t * \n\t * @param args\n\t * command line arguments\n\t * @throws ConfigurationException\n\t * if there is any problem with command line arguments\n\t */\n\tvoid processCommandLineArguments(String[] args) throws ConfigurationException;\n\n\t/**\n\t * Loads default configurations from a file name. If the file name is not an\n\t * absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the system class loader. See\n\t * {@link #loadDefaultConfiguration(ClassLoader, String)} for loading\n\t * default configuration providing a class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t * \n\t */\n\tvoid loadDefaultConfiguration(String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads default configurations from a file name. If the file name is not an\n\t * absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the given class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param classLoader\n\t * an instance of a class loader\n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadDefaultConfiguration(ClassLoader classLoader, String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads user-level configurations from a file name. If the file name is not\n\t * an absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finaly the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the system class loader. See\n\t * {@link #loadConfiguration(ClassLoader, String)} for loading default\n\t * configuration providing a class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadConfiguration(String fileName) throws ConfigurationException;\n\n\t/**\n\t * Loads user-level configurations from a file name. If the file name is not\n\t * an absolute path, the file is searched in the following places:\n\t * <ol>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory,</li>\n\t * <li>current folder,</li>\n\t * <li>the {@value #DEFAULT_CONFIG_FOLDER_NAME} directory in classpath,</li>\n\t * <li>and finally the classpath.</li>\n\t * </ol>\n\t * where classpath is determined by the given class loader.\n\t * \n\t * The configuration is loaded in an incremental fashion; i.e., the loaded\n\t * configuration will be added to (and overriding) the existing default\n\t * configuration.\n\t * <p>\n\t * See {@link #getAppRootDirectory()} and {@link #getDefaultValue(String)}.\n\t * \n\t * @param classLoader\n\t * an instance of a class loader\n\t * @param fileName\n\t * the name of a properties file\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t */\n\tvoid loadConfiguration(ClassLoader classLoader, String fileName) throws ConfigurationException;\n\n\t/**\n\t * Performs any post processing of configuration settings that may be\n\t * required.\n\t * \n\t * This method can be called after manually making changes to the\n\t * configuration values. It should be called automatically after a call to\n\t * {@link IConfiguration#loadConfiguration(String)}.\n\t */\n\tvoid applyConfiguration();\n\n\t/**\n\t * Sets the value of scenario description file name.\n\t * \n\t * @param fileName\n\t * file name\n\t * @see #CONF_SCENARIO_DESCRIPTION_FILE_NAME\n\t */\n\tvoid setScenarioDescriptionFileName(String fileName);\n\n\t/**\n\t * Sets the sceanrio description as the given object. This property in\n\t * effect overrides the value of scenario description file name (\n\t * {@link IConfiguration#CONF_SCENARIO_DESCRIPTION_FILE_NAME}).\n\t * \n\t * @param sceanrioDescription\n\t * an instance of a scenario description\n\t * @see #CONF_SCENARIO_DESCRIPTION\n\t */\n\tvoid setScenarioDescription(Object sceanrioDescription);\n\n\t/**\n\t * Sets the measurement controller URI.\n\t * \n\t * @param uriStr\n\t * a URI as an String\n\t * @throws ConfigurationException\n\t * if initializing the configuration fails\n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tvoid setMeasurementControllerURI(String uriStr) throws ConfigurationException;\n\n\t/**\n\t * Sets the measurement controller class name. This also sets the\n\t * measurement controller URI to be '<code>class://[CLASS_NAME]</code>'.\n\t * \n\t * @param className\n\t * the full name of the class\n\t * @see #CONF_MEASUREMENT_CONTROLLER_CLASS_NAME\n\t */\n\tvoid setMeasurementControllerClassName(String className);\n\n\t/**\n\t * Sets the application name for this executable instance.\n\t * \n\t * @param appName\n\t * an application name\n\t */\n\tvoid setApplicationName(String appName);\n\n\t/**\n\t * Sets the main class that runs this thread. This will also be used in\n\t * finding the root folder\n\t * \n\t * @param mainClass\n\t * class to be set as main class\n\t */\n\tvoid setMainClass(Class<?> mainClass);\n\n\t/**\n\t * Sets the logger configuration file name and triggers logger\n\t * configuration.\n\t * \n\t * @param fileName\n\t * a file name\n\t */\n\tvoid setLoggerConfigFileName(String fileName);\n\n\t/**\n\t * @return Returns the application root directory.\n\t */\n\tString getAppRootDirectory();\n\n\t/**\n\t * Sets the application root directory to the given folder.\n\t * \n\t * @param rootDir\n\t * path to a folder\n\t */\n\tvoid setAppRootDirectory(String rootDir);\n\n\t/**\n\t * @return Returns the application's configuration directory.\n\t */\n\tString getAppConfDirectory();\n\n\t/**\n\t * @return Returns the value of scenario description file name.\n\t * \n\t * @see #CONF_SCENARIO_DESCRIPTION_FILE_NAME\n\t */\n\tString getScenarioDescriptionFileName();\n\n\t/**\n\t * @return returns the sceanrio description as the given object.\n\t * \n\t * @see #CONF_SCENARIO_DESCRIPTION\n\t */\n\tObject getScenarioDescription();\n\n\t/**\n\t * @return Returns the measurement controller URI.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tURI getMeasurementControllerURI();\n\n\t/**\n\t * @return Returns the measurement controller URI as a String.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_URI\n\t */\n\tString getMeasurementControllerURIAsStr();\n\n\t/**\n\t * @return Returns the measurement controller class name.\n\t * \n\t * @see #CONF_MEASUREMENT_CONTROLLER_CLASS_NAME\n\t */\n\tString getMeasurementControllerClassName();\n\n\t/**\n\t * @return Returns the application name for this executable instance.\n\t */\n\tString getApplicationName();\n\n\t/**\n\t * @return Returns the main class that runs this thread. This value must\n\t * have been set by a call to\n\t * {@link IConfiguration#setMainClass(Class)}.\n\t */\n\tClass<?> getMainClass();\n\n\t/**\n\t * Writes the current configuration values into a file.\n\t * \n\t * @param fileName\n\t * the name of the file\n\t * @throws IOException\n\t * if exporting the configuration fails\n\t */\n\tvoid writeConfiguration(String fileName) throws IOException;\n\n\t/**\n\t * Overrides the values of this configuration with those of the given\n\t * configuration.\n\t * \n\t * @param configuration\n\t * with the new values\n\t */\n\t void overwrite(IConfiguration configuration);\n\n\t /**\n\t * Adds a new command-line extension to the configuration component. \n\t * \n\t * The same extension will not be added twice. \n\t * \n\t * @param extension a command-line extension\n\t */\n\t void addCommandLineExtension(ICommandLineArgumentsExtension extension);\n\t \n\t /**\n\t * Removes a new command-line extension from the configuration component. \n\t * \n\t * @param extension a command-line extension\n\t */\n\t void removeCommandLineExtension(ICommandLineArgumentsExtension extension);\n}", "@Override\n\tpublic void configure(AladinScriptActivityConfigurationBean configBean)\n\t\t\tthrows ActivityConfigurationException {\n\t\t\n\t\tif(!( configBean.getTypeOfInput().compareTo(\"File\")==0\n\t\t\t\t|| configBean.getTypeOfInput().compareTo(\"URL\")==0\n\t\t\t\t|| configBean.getTypeOfInput().compareTo(\"String\")==0)){\n\t\t\tthrow new ActivityConfigurationException(\n\t\t\t\t\t\"Invalid input type for the tables\");\n\t\t}\n\t\t\n\t\tif(!( configBean.getTypeOfMode().compareTo(\"gui\")==0\n\t\t\t\t|| configBean.getTypeOfMode().compareTo(\"nogui\")==0)){\n\t\t\tthrow new ActivityConfigurationException(\n\t\t\t\t\t\"Invalid type of process.\");\n\t\t}\n\t\t\n\t\t\n\t\t// Store for getConfiguration(), but you could also make\n\t\t// getConfiguration() return a new bean from other sources\n\t\tthis.configBean = configBean;\n\n\t\t// OPTIONAL: \n\t\t// Do any server-side lookups and configuration, like resolving WSDLs\n\n\t\t// myClient = new MyClient(configBean.getExampleUri());\n\t\t// this.service = myClient.getService(configBean.getExampleString());\n\n\t\t\n\t\t// REQUIRED: (Re)create input/output ports depending on configuration\n\t\tconfigurePorts();\n\t}", "public void setJob(String job) {\r\n\t\t\tthis.job = job;\r\n\t\t}", "AgentPolicyBuilder setJobPriority(JobPriority jobPriority);", "@JsonProperty(\"isOrderJob\")\r\n @JacksonXmlProperty(localName = \"order\", isAttribute = true)\r\n public void setIsOrderJob(String isOrderJob) {\r\n this.isOrderJob = isOrderJob;\r\n }", "public ComponentConfiguration getConfiguration();", "public void setJobProperty(String jobProperty) {\r\n this.jobProperty = jobProperty;\r\n }", "public interface JobManager {\n void startJob(JobConfig<String, JsonRecord> name);\n}", "public SynapseNotebookActivity setConf(Object conf) {\n this.conf = conf;\n return this;\n }", "public void setJob(Job jobNum){\n job = jobNum;\n }", "public void setJobInfo(String jobInfo) {\n this.jobInfo = jobInfo;\n }", "public void configure(JobConf jobConf, MapperConf mapConf)\r\n\t\t\tthrows TwisterException {\r\n\t\tthis.jobConf = jobConf;\r\n\t\tFileData fileData = (FileData) mapConf.getDataPartition();\r\n\t\tthis.image = new StaticImageVectorData();\r\n\t\ttry {\r\n\t\t\tthis.image.loadDataFromTextFile(fileData.getFileName());\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new TwisterException(e);\r\n\t\t}\r\n\t}", "public static Configurable configure() {\n return new RedisManager.ConfigurableImpl();\n }", "public JobManager(){\n //Initialize the job manager for use of the system\n }", "@Override\n public void configure(Context context) {\n this.context = context;\n this.projectConfigure = new ProjectConfigure(context.getString(\"project_conf_path\", \"\"));\n //初始化变量\n ProjectConfigure.BaseConfigure baseSinkConf = projectConfigure.checkUpdate();\n copyBaseSinkConf(baseSinkConf);\n\n Preconditions.checkArgument(this.batchSize > 0, \"batchSize must be greater than 0\");\n\n this.filePath = (String) Preconditions.checkNotNull((Object)context.getString(\"hdfs.path\"), \"hdfs.path is required\");\n if (this.filePath.endsWith(DIRECTORY_DELIMITER)) {\n this.filePath += DIRECTORY_DELIMITER;\n }\n\n if (this.sinkCounter == null) {\n this.sinkCounter = new SinkCounter(this.getName());\n }\n }", "public void injectConfiguration(ComponentConfiguration conf);", "@Override\n\t\tpublic void configure(JobConf job) {\n\t\t\twords = job.get(\"search.word\").split(\"[ \\t]+\");\n\t\t\ttry {\n\t\t\t\tPath[] filemapcache = DistributedCache.getLocalCacheFiles(job);\n\t\t\t\tfor (Path file : filemapcache) {\n\t\t\t\t\tBufferedReader fis = new BufferedReader(new FileReader(\n\t\t\t\t\t\t\tfile.toString()));\n\t\t\t\t\tparseFileMap(fis, filemap);\n\t\t\t\t}\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}", "public void setIsTemplateJob(boolean isTemplateJob) {\n this.isTemplateJob = isTemplateJob;\n }", "void setConfiguration();", "public void setJobId( int jobId ) ;", "public abstract void configure(T object, U configuration);", "private Job getJobConf(String[] args) throws Exception {\n\n\t\tJobInfo jobInfo = new JobInfo() {\n\t\t\t@Override\n\t\t\tpublic Class<? extends Reducer> getCombinerClass() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Class<?> getJarByClass() {\n\t\t\t\treturn TopologicalJob.class;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Class<? extends Mapper> getMapperClass() {\n\t\t\t\treturn TopologicalMapper.class;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Class<?> getOutputKeyClass() {\n\t\t\t\treturn Text.class;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Class<?> getOutputValueClass() {\n\t\t\t\treturn Text.class;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Class<? extends Reducer> getReducerClass() {\n\t\t\t\treturn TopologicalReducer.class;\n\t\t\t}\n\t\t};\n\t\t\n\t\treturn setupJob(\"topologicalsort\", jobInfo);\n\t}", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public Job getHadoopJob() ;", "public void configure(Map<String, String> configuration) throws AlgebricksException;", "public interface Configurable extends AzureConfigurable<Configurable> {\n /**\n * Creates an instance of SqlServer that exposes Compute resource management API entry points.\n *\n * @param credentials the credentials to use\n * @param subscriptionId the subscription\n * @return the SqlServer\n */\n SqlServerManager authenticate(AzureTokenCredentials credentials, String subscriptionId);\n }", "public Dsjob getJobObject() { return job; }", "public void configure(JobConf job) {\n\t\t\tString input_file = job.get(\"map.input.file\");\n\t\t\tString right_mat_str = job.get(\"right_matrix\");\n\n\t\t\tint lzq_index = input_file.indexOf(\"lz_q\");\n\t\t\tint slash_index = input_file.indexOf(\"/\", lzq_index);\n\t\t\tcol = Integer.parseInt( input_file.substring(lzq_index + 4, slash_index) ) - 1;\n\n\t\t\tSystem.out.println(\"VecarrmatCache.MapPass1: makesym=\" + makesym + \", right_matrix=\" + right_mat_str + \", col=\" + col);\n\t\t\tSystem.out.println(\"input_file = \" + input_file);\n\n\t\t\tSystem.out.println(\"Loading right matrix...\");\n\t\t\tRM = read_right_matrix( right_mat_str );\n\t\t\tSystem.out.println(\"Done.\");\n\t\t}", "public static void configureInputFormat(InputFormat inputFormat,\n Configuration conf)\n {\n JobConf jobConf = new JobConf(conf);\n setJobConfIfPossible(inputFormat, jobConf);\n // TextInputFormat is not always JobConfigurable, so we need to explicitly\n // call this here to make sure it gets configured with the\n // compression codecs.\n if (inputFormat instanceof TextInputFormat) {\n ((TextInputFormat) inputFormat).configure(jobConf);\n }\n }", "public void jobToBeExecuted(JobExecutionContext jobExecutionContext) {}", "public JobBuilder() {\r\n job = new Job();\r\n }", "public static Configurable configure() {\n return new SqlVirtualMachineManager.ConfigurableImpl();\n }", "boolean assignJob(JobId jobId) throws RemoteException;", "public JobControllerImpl(ViewContext context, Job job,\n OperationHandleControllerFactory opHandleControllerFactory,\n SavedQueryResourceManager savedQueryResourceManager,\n IATSParser atsParser,\n HdfsApi hdfsApi) {\n this.context = context;\n setJobPOJO(job);\n this.opHandleControllerFactory = opHandleControllerFactory;\n this.savedQueryResourceManager = savedQueryResourceManager;\n this.atsParser = atsParser;\n this.hdfsApi = hdfsApi;\n\n UserLocalConnection connectionLocal = new UserLocalConnection();\n this.hiveConnection = new ConnectionController(opHandleControllerFactory, connectionLocal.get(context));\n }", "@Override\n\tpublic void beforeJob(JobExecution arg0) {\n\t\t\n\t}", "public void setJob(Job job) throws DeviceException {\n \t\ttry {\n \t\t\tcontroller.caput(jobChannel, job.ordinal(), 2);\n \t\t} catch (Throwable e) {\n \t\t\tthrow new DeviceException(\"failed to set JOB for the robot\", e);\n \t\t}\n \t}", "@Override\n public void configure(Configuration conf) throws ConfigurationException\n {\n super.configure( conf );\n lazyLoading = conf.getAttributeAsBoolean( LAZY_LOADING, false);\n getLogger().debug(\"setting lazyLoading: \" + lazyLoading);\n }", "public JobPreference(Integer id) {\n super.id=id;\n }", "public ProcessInfoInner withIsWebJob(Boolean isWebJob) {\n this.isWebJob = isWebJob;\n return this;\n }", "public void setJob(Job job) throws JobEvent, InterruptedException {\n this.job = job;\n\n try {\n\n job.run();\n\n }\n catch (JobEvent | InterruptedException rethrow)\n {\n this.job = null;\n throw rethrow;\n }\n\n }", "public JobBuilder parameters(JobParameters parameters) {\r\n job.setParameters(parameters);\r\n return this;\r\n }", "void setJobName(String jobName);", "@Override\n\t\tpublic void configure(JobConf job) {\n\t\t\twords = job.get(\"search.word\").split(\"[ \\t]+\");\n\t\t}", "@Override\n\tpublic void setConf(Configuration conf) {\n\t\tthis.Conf = conf;\n\t}", "JobClient createJobClient();", "private void initParameters() {\n jobParameters.setSessionSource(getSession(\"source\"));\n jobParameters.setSessionTarget(getSession(\"target\"));\n jobParameters.setAccessDetailsSource(getAccessDetails(\"source\"));\n jobParameters.setAccessDetailsTarget(getAccessDetails(\"target\"));\n jobParameters.setPageSize(Integer.parseInt(MigrationProperties.get(MigrationProperties.PROP_SOURCE_PAGE_SIZE)));\n jobParameters.setQuery(MigrationProperties.get(MigrationProperties.PROP_SOURCE_QUERY));\n jobParameters.setItemList(getFolderStructureItemList());\n jobParameters.setPropertyFilter(getPropertyFilter());\n jobParameters.setReplaceStringInDestinationPath(getReplaceStringArray());\n jobParameters.setNamespacePrefixMap(getNamespacePrefixList());\n jobParameters.setBatchId(getBatchId());\n jobParameters.getStopWatchTotal().start();\n jobParameters.setSuccessAction(MigrationProperties.get(MigrationProperties.PROP_SOURCE_SUCCESS_ACTION));\n jobParameters.setErrorAction(MigrationProperties.get(MigrationProperties.PROP_SOURCE_ERROR_ACTION));\n jobParameters.setSuccessFolder(MigrationProperties.get(MigrationProperties.PROP_SOURCE_SUCCESS_FOLDER) + \"/\" + jobParameters.getBatchId());\n jobParameters.setErrorFolder(MigrationProperties.get(MigrationProperties.PROP_SOURCE_ERROR_FOLDER) + \"/\" + jobParameters.getBatchId());\n jobParameters.setCurrentFolder(getRootFolder());\n jobParameters.setSkipDocuments(Boolean.valueOf(MigrationProperties.get(MigrationProperties.PROP_MIGRATION_COPY_FOLDERS_ONLY)));\n \n }", "public abstract void Configure( DataMap<String, Serializable> configuration);", "void configure(String name, Map<String, Object> configuration);", "public interface ConfigureConfiguration {\n\n\t// A list of names of configuration files\n\t@Option(shortName=\"c\", description = \"Name of one or many configuration \"\n\t\t+ \"files. Parameters in configuration files override each other. If a\"\n\t\t+ \" parameter is provided in more than one file, the first occurrence \"\n\t\t+ \" is used.\"\n\t) \n\tList<File> getConf();\n\tboolean isConf();\n\t\n}", "Configuration getConfiguration();", "Configuration getConfiguration();", "Configuration getConfiguration();", "Configuration getConfiguration();", "public JobDataMap getJobDataMap() {\n if (jobDataMap == null) {\n jobDataMap = new JobDataMap();\n }\n return jobDataMap;\n }", "public AbstractJob(){\n \n }", "public void setHasMoreJobs( boolean hasMoreJobs ) ;", "protected WorkloadConfiguration getConfguration() {\n\t\treturn workloadConfiguration;\n\t}", "public static void setConfValues(Configuration conf) {\n MetastoreConf.setVar(conf, ConfVars.HIVE_TXN_MANAGER, TXN_MANAGER);\n MetastoreConf.setBoolVar(conf, ConfVars.HIVE_SUPPORT_CONCURRENCY, true);\n }", "@Override\n\t\t\tpublic void beforeJob(JobExecution jobExecution) {\n\t\t\t\t\n\t\t\t}", "IngestModuleIngestJobSettings getDefaultIngestJobSettings();", "private static void initializeJob(IGoobiJob goobiJob, String configuredStartTimeProperty,Scheduler sched) throws SchedulerException{\n\t\tlogger.debug(goobiJob.getJobName());\n\t\tJobDetail jobDetail = new JobDetail(goobiJob.getJobName(), null, goobiJob.getClass());\n\t\t\n\t\t\n\t\tif (ConfigMain.getLongParameter(configuredStartTimeProperty, -1) != -1) {\n\t\t\tlong msOfToday = ConfigMain.getLongParameter(configuredStartTimeProperty, -1);\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.set(1984, 8, 11, 0, 0);\n\t\t\tcal.set(Calendar.SECOND, 0);\n\t\t\tcal.set(Calendar.MILLISECOND, 0);\n\n\t\t\tcal.setTime(new Date(cal.getTimeInMillis() + msOfToday));\n\t\t\tint hour = cal.get(Calendar.HOUR_OF_DAY);\n\t\t\tint min = cal.get(Calendar.MINUTE);\n\n\t\t\tTrigger trigger = TriggerUtils.makeDailyTrigger(hour, min);\n\t\t\ttrigger.setStartTime(new Date());\n\t\t\ttrigger.setName(goobiJob.getJobName() + \"_trigger\");\n\n\t\t\tif(logger.isInfoEnabled()){\n\t\t\t\tlogger.info(\"daily Job \" + goobiJob.getJobName() + \" start time: \" + hour + \":\" + min);\n\t\t\t}\n\t\t\tsched.scheduleJob(jobDetail, trigger);\n\t\t}\n\t}", "@Override\n public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> jobProperties) {\n // Not yet implemented...\n }" ]
[ "0.67648625", "0.61353", "0.606248", "0.6054276", "0.59415066", "0.57366127", "0.5723305", "0.5688792", "0.5660034", "0.56461763", "0.55784094", "0.55567276", "0.55255884", "0.53805065", "0.52785474", "0.5235495", "0.52131724", "0.5195234", "0.51659197", "0.51366943", "0.51126355", "0.5106724", "0.50737375", "0.50416505", "0.50391185", "0.5012281", "0.49786186", "0.49684158", "0.4958268", "0.49473482", "0.49473482", "0.49431708", "0.48982903", "0.48936215", "0.48766315", "0.48725158", "0.48597357", "0.48539734", "0.4835498", "0.48274472", "0.4816567", "0.4798151", "0.47966322", "0.47948655", "0.47695354", "0.47574073", "0.47134137", "0.4713136", "0.47026142", "0.4685716", "0.46804765", "0.46793324", "0.46627417", "0.46611327", "0.4655317", "0.46454978", "0.46331477", "0.46203735", "0.46161178", "0.4611578", "0.4611578", "0.4603023", "0.45776162", "0.45772073", "0.457283", "0.45639473", "0.45456013", "0.453148", "0.45206478", "0.45191878", "0.45106426", "0.45091867", "0.45053056", "0.4498192", "0.4497978", "0.44937623", "0.44846973", "0.44831187", "0.44799164", "0.44793254", "0.44749385", "0.44661605", "0.44609913", "0.44512534", "0.44501168", "0.44439805", "0.44363567", "0.44270694", "0.44270694", "0.44270694", "0.44270694", "0.44175094", "0.44143054", "0.44120353", "0.44083065", "0.4407017", "0.44035298", "0.4402489", "0.44008306", "0.4398269" ]
0.7460002
0
Hack to configure InputFormats before they get used.
public static void configureInputFormat(InputFormat inputFormat, Configuration conf) { JobConf jobConf = new JobConf(conf); setJobConfIfPossible(inputFormat, jobConf); // TextInputFormat is not always JobConfigurable, so we need to explicitly // call this here to make sure it gets configured with the // compression codecs. if (inputFormat instanceof TextInputFormat) { ((TextInputFormat) inputFormat).configure(jobConf); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Format[] getSupportedInputFormats()\n {\n return supportedInputFormats;\n }", "public Format setInputFormat(Format input) {\n inputFormat = input;\n return input;\n }", "@Override\n public Format getInputFormat()\n {\n return super.getInputFormat();\n }", "@Override\n public Format setInputFormat(Format format)\n {\n Format inputFormat\n = ((format instanceof VideoFormat)\n && (((VideoFormat) format).getSize() == null))\n ? null // size is required\n : super.setInputFormat(format);\n \n if (logger.isDebugEnabled() && (inputFormat != null))\n logger.debug(\"SwScaler set to input in \" + inputFormat);\n return inputFormat;\n }", "public void setInputFormat(String inputFormat) {\n this.inputFormat = inputFormat;\n }", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "public interface InputFormat {\n /**\n * Return a FileFilter that can be used to identify files which can be restored\n * with this Storage Format. Typically, each input format has its own \n * recognizable file naming convention.\n *\n * @return FileFilter to be used with a javax.swing.JFileChooser\n */\n public javax.swing.filechooser.FileFilter getFileFilter();\n \n /**\n * Return a JFileChooser accessory that can be used to customize the input\n * format.\n *\n * @return A JFileChooser accessory to be used with a javax.swing.JFileChooser\n * Returns null, if no accessory is provided for this format.\n */\n public JComponent getInputFormatAccessory();\n \n /**\n * Reads figures from a file and replaces the children of the drawing\n * with them.\n * <p>\n * This is a convenience method for calling read(File,Drawing,true).\n *\n * @param file The file.\n * @param drawing The drawing.\n */\n public void read(File file, Drawing drawing) throws IOException;\n \n /**\n * Reads figures from a file and adds them to the specified drawing.\n *\n * @param file The file.\n * @param drawing The drawing.\n * @param replace Set this to true, if the contents of the file replaces the\n * contents of the drawing (for example, when loading a drawing from a file).\n * Set this to false, to add the contents of the file to the drawing (for\n * example, when the file has been dropped into the drawing view).\n */\n public void read(File file, Drawing drawing, boolean replace) throws IOException;\n\n /**\n * Reads figures from a file and adds them to the specified drawing.\n *\n * @param in The input stream.\n * @param drawing The drawing.\n * @param replace Set this to true, if the contents of the stream replaces the\n * contents of the drawing (for example, when loading a drawing from a stream).\n * Set this to false, to add the contents of the file to the drawing (for\n * example, when the stream has been dropped into the drawing view).\n */\n public void read(InputStream in, Drawing drawing, boolean replace) throws IOException;\n\n /**\n * Returns true, if this InputFormat can readFigures TransferData using the \n * specified DataFlavor.\n * \n * @param flavor A DataFlavor.\n */\n public boolean isDataFlavorSupported(DataFlavor flavor);\n \n /**\n * Reads figures from the specified Transferable and adds them to the\n * specified drawing.\n * \n * @param t The Transferable. \n * @param drawing The drawing.\n * @param replace Set this to true, if the contents of the transferable\n * replaces the contents of the drawing (for example, when loading a drawing\n * from a transferable). Set this to false, to add the contents of the \n * transferable to the drawing (for example, when the transferable has been\n * dropped or pasted into the drawing view).\n */\n public void read(Transferable t, Drawing drawing, boolean replace) throws UnsupportedFlavorException, IOException;\n}", "protected Format doSetFormat(Format format)\n {\n return null;\n }", "public ClientLoader inputFormat(final String theInputFormat) {\r\n this.inputFormat = checkNotNull(theInputFormat, \"inputFormat is null\");\r\n return this;\r\n }", "public void setInputFormatOptions(InputFormatOptions inputFormatOptions) {\n this.inputFormatOptions = inputFormatOptions;\n }", "@PostConstruct\n\tpublic void readAudioFormats() {\n\t\tlossy = parsePreferenceString(AudioFormatsPreferenceIds.LOSSY_FORMATS);\n\t\tlossless = parsePreferenceString(AudioFormatsPreferenceIds.LOSSLESS_FORMATS);\n\t\twarning = parsePreferenceString(AudioFormatsPreferenceIds.WARNING_FORMATS);\n\t\twarningIfEmpty =\n\t\t\t\tActivator.getDefault().getPreferenceStore()\n\t\t\t\t\t\t.getBoolean(AudioFormatsPreferenceIds.WARNING_EMPTY_FLAG);\n\n\t\taudioFormatIntersectionCheck(lossy, lossless);\n\t}", "public DefaultFormat() {\n }", "public BioFormatsFormat() {\n\t\tcacheReaderClasses();\n\t}", "public static void setTheirDefaultFormat(Format fmt)\n {\n theirDefaultFormat = (Format) fmt.clone();\n }", "Object getFormat();", "public void setOutputFormat(OutputFormat format);", "public interface FormatConverter {\n\n /**\n * Returns the tool's executable full path.\n * \n * @return\n */\n public String getExecutable();\n\n /**\n * Sets the tool's executable full path.\n * \n * @param executable\n */\n public void setExecutable(String executable);\n\n /**\n * Returns the environment variables that are set prior to invoking the tool's executable.\n * \n * @return\n */\n public Map<String, String> getEnvironment();\n\n /**\n * Provides the environment variables that are set prior to invoking the tool's executable.\n * \n * @return\n */\n public void setEnvironment(Map<String, String> environment);\n\n /**\n * Adds an output format among the supported ones.\n * \n * @param format\n */\n public void addFormat(Format format);\n\n /**\n * Get a list of supported output formats.\n *\n * @return\n */\n public List<Format> getFormats();\n\n /**\n * Programmatically removes all formats.\n */\n public void clearFormats();\n\n /**\n * Replaces currently supported formats with the provided list.\n * \n * @param formats\n */\n public void replaceFormats(List<Format> formats);\n\n}", "private void readInputFormat(ConfigLinkedDocument ld, Entry<String, JsonNode> e) {\n String formatIdentifier = str(e);\n Format format = DocumentFormats.getFormat(formatIdentifier);\n if (format == null)\n throw new InvalidInputFormatConfig(\n \"Unknown input format \" + str(e) + \" in linked document \" + ld.getName());\n\n ld.setInputFormatIdentifier(formatIdentifier);\n }", "public Format getInputFormat() {\n return inputFormat;\n }", "Format internalSetFormat(Format format)\n {\n return doSetFormat(format);\n }", "private Formats() {\n }", "public abstract void setImageFormat(String format);", "private FormatUtilities() {}", "@Override\n public String getFormatName() throws IOException {\n return input == null? myDefaultFormat.getName() : getInfo().getFormat().getName();\n }", "@Override\n public Format setOutputFormat(Format format)\n {\n Format outputFormat = super.setOutputFormat(format);\n \n if (logger.isDebugEnabled() && (outputFormat != null))\n logger.debug(\"SwScaler set to output in \" + outputFormat);\n return outputFormat;\n }", "@Override\n\tpublic ImageFormatAllowableConversionList getFormatConfiguration(\n\t\t\tImageFormat format) {\n\t\treturn null;\n\t}", "public void formatChanged()\n {\n // for now, just create formatter from scratch, but later we can just detect changes and act accordingly\n setFormatterFromTextPane(formatContainer.getSelectedFormatter());\n setHasChanged(true);\n }", "private Format()\n {\n super();\n }", "public InputFormatOptions getInputFormatOptions() {\n return this.inputFormatOptions;\n }", "private void setUpFormat() {\n form = (DecimalFormat)NumberFormat.getNumberInstance();\n form.setMaximumFractionDigits(precision);\n }", "private void getSourceFormat() {\n\t\tAudioInputStream ais = null;\n\t\tformat = null;\n\t\ttry {\n\t\t\tais = source.getAudioInputStream();\n\t\t\tformat = ais.getFormat();\n\t\t} catch (AudioSourceException e) {\n\t\t\t// a plugin chain could exist without a functional audio source, so\n\t\t\t// we\n\t\t\t// ctach this exception and set the audio format unknown\n\t\t} finally {\n\t\t\tif (ais != null)\n\t\t\t\ttry {\n\t\t\t\t\tais.close();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// O.K. No chance.\n\t\t\t\t}\n\t\t}\n\t}", "public void clearFormats();", "public void setFormats(Vector<String> formats) {\n\t\tthis.formats = formats;\n\t}", "public void setFormat(String fmt)\n {\n format = fmt;\n }", "public void setFormat(String value) {\n/* 198 */ setValue(\"format\", value);\n/* */ }", "private FormatAndResolutions loadFormatResolutions() {\n\t\tFormatAndResolutions formatResolutionJson = new FormatAndResolutions();\n\t\tformatResolutionJson.setIMAGE_FORMAT(\"\");\n\t\tformatResolutionJson.setSTILL_CAPTURE(\"Disable\");\n\t\tformatResolutionJson.setSUPPORTED_IN_FS(\"Disable\");\n\t\tformatResolutionJson.setSUPPORTED_IN_HS(\"Disable\");\n\t\tformatResolutionJson.setSUPPORTED_IN_SS(\"Disable\");\n\t\tformatResolutionJson.setRESERVED(\"FF\");\n\t\treturn formatResolutionJson;\n\t}", "public void setFormat(Connector connector, Format format);", "protected Format doGetFormat()\n {\n return null;\n }", "private static void customSettingWhenDisabled(){\n if (format == null) setFormat(false);\n if (!format.equals(\"\")) tick(false); // If the setting is not empty, then use our custom format\n }", "@Override\n public void setFormat(Format format) {\n if (format != Format.XML)\n throw new IllegalArgumentException(\"JAXBHandle supports the XML format only\");\n }", "public String getInputFormat() {\n return this.inputFormat;\n }", "public void setFormat(String format) {\r\n _format = format;\r\n }", "public void replaceFormats(List<Format> formats);", "@Override\n public Format[] getSupportedOutputFormats(Format input)\n {\n if(input == null)\n return supportedOutputFormats;\n \n /* if size is set for element 0 (YUVFormat), it is also set \n * for element 1 (RGBFormat) and so on...\n */\n Dimension size = ((VideoFormat)supportedOutputFormats[0]).getSize();\n \n if(size != null)\n return supportedOutputFormats;\n \n /* no specified size set so return the same size as input\n * in output format supported\n */\n size = ((VideoFormat)input).getSize();\n \n return new Format[] { \n new YUVFormat(size, -1, Format.byteArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new YUVFormat(size, -1, Format.intArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new YUVFormat(size, -1, Format.shortArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new RGBFormat(size, -1, Format.byteArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.intArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.shortArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.byteArray, -1.0f,\n 24, -1, -1, -1),\n new RGBFormat(size, -1, Format.intArray, -1.0f,\n 24, -1, -1, -1),\n new RGBFormat(size, -1, Format.shortArray, -1.0f,\n 24, -1, -1, -1),\n };\n }", "private FormattedTextEncoder() {\r\n\t\tsuper();\r\n\t}", "void setOutputFormat(String outputFormat);", "public void setSupportFormat(String supportFormat) {\r\n\t\tthis.supportFormat = supportFormat;\r\n\t}", "public void setFormat(RMFormat aFormat)\n{\n // Add format to first binding\n if((aFormat==null || aFormat instanceof java.text.Format) && getBindingCount()>0)\n getBinding(0).setFormat((java.text.Format)aFormat);\n \n // Pass down to children\n for(int i=0, iMax=getChildCount(); i<iMax; i++)\n getChild(i).setFormat(aFormat);\n}", "String getFormatter();", "public Class<? extends InputFormat> getInputFormatClass() {\n return inputFormatClass;\n }", "public final void updateFormat(CsvFormat format) {\n\t\tnewLine = format.getNormalizedNewline();\n\t\tmultiDelimiter = format.getDelimiterString().toCharArray();\n\t\tif (multiDelimiter.length == 1) {\n\t\t\tmultiDelimiter = null;\n\t\t\tdelimiter = format.getDelimiter();\n\t\t\tdelimiters = new char[]{delimiter, newLine};\n\t\t} else {\n\t\t\tdelimiters = new char[]{multiDelimiter[0], newLine};\n\t\t}\n\t\tquote = format.getQuote();\n\t\tquoteEscape = format.getQuoteEscape();\n\t\tescapeEscape = format.getCharToEscapeQuoteEscaping();\n\t}", "void setFormat(ImageFormat format);", "public void set_standard_format () {\n\t\tf_friendly_format = false;\n\n\t\tmainshock_time = 0L;\n\t\tmainshock_mag = 0.0;\n\t\tmainshock_lat = 0.0;\n\t\tmainshock_lon = 0.0;\n\t\tmainshock_depth = 0.0;\n\n\t\treturn;\n\t}", "@Override final protected Object[] getInputDefaults() { return this.InputDefaults; }", "@Override\n\tpublic String[] getFormats() {\n\t\treturn new String[] {\"yyyy-MM-dd'T'HH:mm:ss\",\"yyyy-MM-dd HH:mm:ss\",\"yyyy-MM-dd HH:mm\",\"yyyy-MM-dd'T'HH:mm\",\"yyyy-MM-dd HH\", \"yyyy-MM-dd\" };\n\t}", "@Test\n\tpublic void testFormats() throws IOException {\n\t\tassertArrayEquals(Formats.FORMATS, ffmpeg.formats().toArray());\n\t\tassertArrayEquals(Formats.FORMATS, ffmpeg.formats().toArray());\n\n\t\tverify(runFunc, times(1)).run(argThatHasItem(\"-formats\"));\n\t}", "@Override\r\n\tpublic void setAudioFormat(AudioFormat format) {\r\n\r\n\t}", "public List<String> getParserFormats();", "@Override\n\tpublic List<ImageFormatAllowableConversionList> getFormatConfigurations() {\n\t\treturn null;\n\t}", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "public void setDateFormats(String dateFormats)\n {\n this.dateFormats = dateFormats;\n }", "protected boolean isShowFormatterSetting() {\n \t\treturn true;\n \t}", "public void setFormatOptions(FormatOptions formatOptions) {\n this.formatOptions = formatOptions;\n }", "public void setFormat(Format format) {\n this.format = format.getIndex();\n }", "public boolean isFormat() {\n\t\treturn isFormat;\n\t}", "public void setDefaultNumberFormat(NumberFormat format)\n {\n valueRenderer.defaultNumberFormat = format;\n }", "public SmartFormater() {\n\t\t\tsimpleFormats[0] = new DecimalFormat(\"###0\");\n\t\t\tsimpleFormats[1] = new DecimalFormat(\"###0.#\");\n\t\t\tsimpleFormats[2] = new DecimalFormat(\"###0.##\");\n\t\t\tsimpleFormats[3] = new DecimalFormat(\"###0.###\");\n\t\t\tsimpleFormats[4] = new DecimalFormat(\"###0.####\");\n\n\t\t\tscientificFormats[0] = new DecimalFormat(\"#.E0\");\n\t\t\tscientificFormats[1] = new DecimalFormat(\"#.#E0\");\n\t\t\tscientificFormats[2] = new DecimalFormat(\"#.##E0\");\n\t\t\tscientificFormats[3] = new DecimalFormat(\"#.###E0\");\n\t\t\tscientificFormats[4] = new DecimalFormat(\"#.####E0\");\n\t\t}", "Format internalGetFormat()\n {\n return doGetFormat();\n }", "public void addFormat(Format format);", "public List<String> getExampleFormats() {\r\n return exampleFormats;\r\n }", "@Override\n public boolean needsFormat()\n {\n return delegates.stream().anyMatch(SplittableInputSource::needsFormat);\n }", "private void checkAndInsertDefaultEntries() {\n\t\tinsertDefaultMediaFormats();\n\t}", "private void updateEditorInputTypes() {\n IEditorPart editorPart = workBenchPart.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();\n if(editorPart instanceof DataMapperDiagramEditor) {\n if(SCHEMA_TYPE_INPUT.equals(this.schemaType)) {\n ((DataMapperDiagramEditor)editorPart).setInputSchemaType(schemaTypeCombo.getText());\n } else if (SCHEMA_TYPE_OUTPUT.equals(this.schemaType)){\n ((DataMapperDiagramEditor)editorPart).setOutputSchemaType(schemaTypeCombo.getText());\n }\n }\n }", "FileFormat getFormat();", "public static Format getTheirDefaultFormat()\n {\n return (Format) theirDefaultFormat.clone();\n }", "@Provides\r\n public DataInput provideInputReader() {\r\n DataInput input = null;\r\n final Reader inRdr = inReader;\r\n if ((inRdr != null) && (inputFormat != null)) {\r\n if (\"csv\".equalsIgnoreCase(inputFormat))\r\n input = new CSVDataInput(inRdr);\r\n else if (\"json\".equalsIgnoreCase(inputFormat))\r\n input = new JSONDataInput(inRdr);\r\n else\r\n throw new IllegalArgumentException(\"Input format \"\r\n + inputFormat + \" not supported.\"\r\n + \" Valid types are csv, json\");\r\n input.verboseOptions(verboseStream, verbose);\r\n }\r\n return input;\r\n }", "public Dataset withFormat(InputFormat format) {\n this.format = format.toString();\n return this;\n }", "public DataFormat createDataFormat() {\n\t\treturn null;\n\t}", "@Test\n public void requestFormatIncreased() {\n assertOpenApiBackwardIncompatible(BASE, \"bc_request_schema_format_increased.yaml\");\n }", "public void setDateFormatOverride(DateFormat formatter) {\n/* 563 */ this.dateFormatOverride = formatter;\n/* 564 */ fireChangeEvent();\n/* */ }", "@Override final protected Class<?>[] getInputTypes() { return this.InputTypes; }", "public static void checkFormatSupported(AudioFormat format) {\n\t\tFloatSampleTools.getFormatType(format);\n\t}", "public List<Format> getFormats();", "protected JsonParser _createParser(DataInput input, IOContext ctxt)\n/* */ throws IOException\n/* */ {\n/* 1329 */ String format = getFormatName();\n/* 1330 */ if (format != \"JSON\") {\n/* 1331 */ throw new UnsupportedOperationException(String.format(\"InputData source not (yet?) support for this format (%s)\", new Object[] { format }));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 1336 */ int firstByte = ByteSourceJsonBootstrapper.skipUTF8BOM(input);\n/* 1337 */ ByteQuadsCanonicalizer can = this._byteSymbolCanonicalizer.makeChild(this._factoryFeatures);\n/* 1338 */ return new UTF8DataInputJsonParser(ctxt, this._parserFeatures, input, this._objectCodec, can, firstByte);\n/* */ }", "@Override\n public void postConfig() {\n Locale locale = new Locale(localeLanguage, localeCountry);\n try {\n formatter = DateTimeFormatter.ofPattern(dateFormat, locale);\n } catch (IllegalArgumentException e) {\n throw new PropertyException(e,\"\",\"dateFormat\",\"dateFormat could not be parsed by DateTimeFormatter\");\n }\n }", "public final void setFormat(AdFormat format) {\n\t\timpl.setFormat(format);\n }", "public JFormattedTextField.AbstractFormatter getFormatter(JFormattedTextField tf) {\n NumberFormatter formatter;\n\n if (tf == xAxisCalibration || tf == yAxisCalibration ||\n tf == zAxisCalibration) {\n // show all numbers\n DecimalFormat format = new DecimalFormat();\n format.setDecimalSeparatorAlwaysShown(true);\n format.setGroupingUsed(true);\n format.setMaximumFractionDigits(12);\n formatter = new NumberFormatter(format);\n } else if (tf == maximumField) {\n DecimalFormat format = new DecimalFormat();\n format.setDecimalSeparatorAlwaysShown(true);\n format.setGroupingUsed(true);\n format.setMinimumFractionDigits(1);\n format.setMaximumFractionDigits(1);\n formatter = new NumberFormatter(format);\n\n } else {\n // show Integer\n NumberFormat format = NumberFormat.getIntegerInstance();\n format.setGroupingUsed(true);\n formatter = new NumberFormatter(format);\n }\n\n // set value ranges\n if (tf == acceleration || tf == deceleration || tf == rotationAcc || tf == rotationDec) {\n formatter.setMinimum(new Integer(0));\n formatter.setMaximum(new Integer(127));\n } else if (tf == velocity || tf == measurementVelocity || tf == rotationVelocity) {\n formatter.setMinimum(new Integer(50));\n formatter.setMaximum(new Integer(20000));\n } else if (tf == measurementPosition || tf == sampleLoadPosition ||\n tf == backgroundPosition\n || tf == axialAFPosition || tf == transverseYAFPosition ||\n tf == measurementPosition) {\n formatter.setMinimum(new Integer(0));\n formatter.setMaximum(new Integer(16777215));\n } else if (tf == rotation) {\n formatter.setMinimum(new Integer(Integer.MIN_VALUE));\n formatter.setMaximum(new Integer(Integer.MAX_VALUE));\n } else if (tf == maximumField) {\n formatter.setMinimum(new Double(1.1));\n formatter.setMaximum(new Double(300.0));\n }\n return formatter;\n }", "public int getFormat()\n {\n return format;\n }", "public boolean hasFormat() {\r\n return hasFormat;\r\n }", "private void insertDefaultMediaFormats() {\n\t\tif (isTableEmpty(Constants.ContentProviderConstants.TableUris.MEDIA_FORMAT_CONTENT_URI)) {\n\t\t\tLogUtils.i(TAG,\n\t\t\t\t\t\"MEDIA_FORMAT table is empty inserting default media formats\");\n\t\t\tinsertMediaValues(Constants.FileFormatConstants.MUSIC_FORMATS);\n\t\t\tinsertMediaValues(Constants.FileFormatConstants.PIX_FORMATS);\n\t\t\tinsertMediaValues(Constants.FileFormatConstants.VIDEO_FORMATS);\n\t\t\tinsertMediaValues(Constants.FileFormatConstants.DOC_FORMATS);\n\t\t} else {\n\t\t\tLogUtils.i(TAG, \"MEDIA_FORMAT table is not empty\");\n\t\t}\n\t}", "public FormatOptions getFormatOptions() {\n return this.formatOptions;\n }", "String getFormat();", "String getFormat();", "String getFormat();", "public void InvalidFormat();", "private DateFormatsConfig getDateFormats()\r\n {\r\n ClasspathPreferencesPersistenceManager manager = new ClasspathPreferencesPersistenceManager();\r\n InternalPreferencesIF preferences = manager.load(MantleConstants.USER_DATE_FORMAT_CONFIG_FILE_TOPIC, null, false);\r\n\r\n DateFormatsConfig config = preferences.getJAXBObject(DateFormatsConfig.class, \"DateFormatConfig\", null);\r\n\r\n return config;\r\n }", "FormatSpecifier(final String[] sa) {\n this.sa = sa;\n }", "public static AudioFormat aidl2apiAudioFormatWithDefault(\n @Nullable AudioConfig audioConfig, boolean isInput) {\n if (audioConfig != null) {\n return AidlConversion.aidl2api_AudioConfig_AudioFormat(audioConfig, isInput);\n }\n return new AudioFormat.Builder().build();\n }" ]
[ "0.7533632", "0.6643867", "0.628379", "0.62673193", "0.6157912", "0.60493934", "0.6037915", "0.5909583", "0.5906032", "0.5884652", "0.58549535", "0.5828536", "0.5827143", "0.57675785", "0.57464343", "0.57387906", "0.57324797", "0.5720535", "0.5681908", "0.56708276", "0.5656441", "0.5644162", "0.56427854", "0.5595718", "0.5590879", "0.5585085", "0.5575927", "0.556573", "0.55421484", "0.5536821", "0.55242366", "0.55088085", "0.5498524", "0.54959786", "0.5467195", "0.5464996", "0.54532385", "0.5447422", "0.54341614", "0.5408188", "0.54069144", "0.54045266", "0.5399212", "0.5356983", "0.5339305", "0.5335462", "0.5318722", "0.5315757", "0.53028107", "0.5295966", "0.52923113", "0.52911466", "0.5289603", "0.5289542", "0.52810544", "0.525251", "0.52435184", "0.5242811", "0.5242061", "0.5239679", "0.5239679", "0.5239679", "0.5237928", "0.5237314", "0.52180046", "0.5194672", "0.5159417", "0.5147703", "0.51257426", "0.5119914", "0.511807", "0.51178795", "0.5108199", "0.5105286", "0.5095456", "0.5074607", "0.5073471", "0.50429505", "0.50374556", "0.5024561", "0.50152117", "0.50097084", "0.5002534", "0.49956328", "0.49954432", "0.49941602", "0.49880847", "0.49867177", "0.49850637", "0.4980727", "0.49796185", "0.49787036", "0.49785784", "0.49657115", "0.49657115", "0.49657115", "0.496032", "0.49551427", "0.49301222", "0.4929046" ]
0.575503
14