query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Retrieve the Forward Label, if Present
public org.drip.state.identifier.ForwardLabel forwardLabel() { org.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel(); return null != floaterLabel && floaterLabel instanceof org.drip.state.identifier.ForwardLabel ? (org.drip.state.identifier.ForwardLabel) floaterLabel : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public org.drip.state.identifier.ForwardLabel forwardLabel()\n\t{\n\t\treturn _lslForward;\n\t}", "Label getLabel();", "Label getLabel();", "Label getLabel();", "default String getLabel() { return ((TensorImpl<?>) this).find(NDFrame.class).map(NDFrame::getLabel).orElse(\"\"); }", "public String getForwardNode() {\r\n\t\ttry {\r\n\t\t\treturn path.getNextNode(procNode);\r\n\t\t} catch (Exception e) {return null; /* In case of an error!*/}\t\t\r\n\t}", "String getLabel();", "String getLabel();", "public L getLabel() {\n\t\tcheckRep();\n\t\treturn this.label;\n\t}", "java.lang.String getLabel();", "public String getLabel() {\n\t String name = getLiteralValue(Foaf.NAME);\n\t \n\t if (name == null) {\n\t name = getLiteralValue(Foaf.GIVENNAME);\n\t }\n\t \n\t if (name == null) {\n\t name = getLiteralValue(RDFS.label);\n\t }\n\t \n\t if (name == null) {\n\t return getURI();\n\t }\n\t return name;\n }", "public java.lang.String getLabel();", "public final Label getLabel() {\n return label;\n }", "public Object getLabel() \n {\n return label;\n }", "public Label getLabel() {\n\t\treturn label;\n\t}", "public Label getLabel() {\n\t\treturn label;\n\t}", "public int getForward() {\n return this.forward;\n }", "public String getNextLabel () {\n return nextLabel;\n }", "public String getLabel()\r\n {\r\n return label;\r\n }", "public String getLabel()\r\n {\r\n return label;\r\n }", "public String getLabel()\n { \n return label;\n }", "DatasetLabel getLabel();", "public String getLabel()\n {\n return label;\n }", "public Label getLabel() {\n return this.label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Label getLabel() {\r\n return label;\r\n }", "public Label getLabel() {\n\t\treturn this.label;\n\t}", "public String getLabel()\n {\n return label;\n }", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() { //gets the label\n\n\t\treturn rawLabel;\n\t}", "public Label\ngetStartLabel();", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\n return label;\n }", "public String getLabel()\n {\n return m_label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public Point getLabelPosition();", "com.microsoft.schemas.xrm._2011.contracts.Label getLabel();", "public String findForward() {\n\t\t\tString result=\"\";\n\t\t\treturn result ;\n\t\t}", "String getLabel() {\n return label;\n }", "public String getLabel() {\n return label == null ? StringUtils.EMPTY : label;\n }", "public boolean hasLabel()\n {\n return _label.isNotNull();\n }", "double getLabel();", "int getLabelOffset();", "public String getLabel() {\n return _label == null ? name() : _label;\n }", "public String getLabel(){\n return label;\n }", "public String getLabel()\n\t{\n\t\treturn label;\n\t}", "@java.lang.Override\n public java.lang.String getLabel() {\n java.lang.Object ref = label_;\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 label_ = s;\n return s;\n }\n }", "com.google.ads.googleads.v6.resources.Label getLabel();", "public final String getLabel() {\n\t\treturn _label;\n\t}", "public String getLabel() {\n\t\treturn myLabel;\n\t}", "private String getLabel() {\n return this.label;\n }", "public java.lang.String getLabel() {\n java.lang.Object ref = label_;\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 label_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public java.lang.Integer getForwardCallIndicator() {\r\n return forwardCallIndicator;\r\n }", "boolean hasLabel();", "boolean hasLabel();", "boolean hasLabel();", "public int getLabel() {\n\t\treturn label;\n\t}", "public int getNodeLabel ();", "public String getLabel() {\n\t\treturn label;\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n return lbl;\r\n }", "public java.lang.String getLabel() {\n\t\treturn this.label;\n\t}", "public String getLabel() {\n return this.label;\n }", "public String getLabel(){\n\t\treturn label;\n\t}", "com.google.protobuf.ByteString\n getLabelBytes();", "public String getLabel() {\n\t\treturn this._label;\n\t}", "private static String getLabel(State from, State to) {\n String label = transitionLabels.get(hashOf(from, to));\n if (label != null)\n return label;\n else\n return \"\";\n }", "public int getLabel(int stateNum) {\n for (int i = 0; i < nodeOffsets.length; i++) {\r\n if (stateNum < nodeOffsets[i])\r\n return i - 1;\r\n }\r\n return nodeOffsets.length - 1;\r\n }", "@Override\r\n\tpublic String getLabel() {\n\t\treturn SummaryGraphUtil.getLocalName(uri);\r\n\t}", "@java.lang.Override\n public com.google.cloud.networkmanagement.v1beta1.ForwardInfo getForward() {\n if (forwardBuilder_ == null) {\n if (stepInfoCase_ == 13) {\n return (com.google.cloud.networkmanagement.v1beta1.ForwardInfo) stepInfo_;\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n } else {\n if (stepInfoCase_ == 13) {\n return forwardBuilder_.getMessage();\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n }\n }", "public Object getLabel() {\n if (this.label != null) {\n return this.label;\n }\n\n return this.getDefaultLabel();\n }", "boolean isForwardPredicted()\n {\n return ((mbType & FORWARD) != 0);\n }", "public\t\tMiPart\t\tgetLabel()\n\t\t{\n\t\treturn(label);\n\t\t}", "public double getLabel() {\n\t\treturn label;\n\t}", "private String labelFeature(int feature) {\r\n\t\treturn label[feature];\r\n\t}", "public String getBackwardNode() {\r\n\t\ttry {\r\n\t\t\treturn path.getPreviousNode(procNode);\r\n\t\t} catch (Exception e) {return null; /* In case of an error!*/}\r\n\t}", "public T2 getLabel() {\r\n\t\treturn label;\r\n\t}", "public com.google.protobuf.ByteString\n getLabelBytes() {\n java.lang.Object ref = label_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n label_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.cloud.networkmanagement.v1beta1.ForwardInfo getForward() {\n if (stepInfoCase_ == 13) {\n return (com.google.cloud.networkmanagement.v1beta1.ForwardInfo) stepInfo_;\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n }", "public String setForward(){\n\t\tif(forward.empty())\n\t\t\treturn null;\n\n\t\treturn forward.pop();\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getLabelBytes() {\n java.lang.Object ref = label_;\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 label_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "private String getLabelNodeAvl(){\n return concatLabel(this.root);\n }", "public String getLabel() {\n return getElement().getChildren()\n .filter(child -> child.getTag().equals(\"label\")).findFirst()\n .get().getText();\n }", "public String getLabelName() {\r\n if( this.jlblHolder != null )\r\n return this.jlblHolder.getText();\r\n else\r\n return label;\r\n }" ]
[ "0.7678048", "0.64264596", "0.64264596", "0.64264596", "0.6333999", "0.6321883", "0.6268819", "0.6268819", "0.6107798", "0.61059695", "0.6049356", "0.60335004", "0.6029269", "0.60101336", "0.599874", "0.599874", "0.5997783", "0.59862393", "0.59825826", "0.59825826", "0.59809667", "0.59640485", "0.5958386", "0.5935582", "0.5932928", "0.59301937", "0.5927512", "0.5915344", "0.59087855", "0.5905171", "0.5905171", "0.5905171", "0.5905171", "0.5903836", "0.5903836", "0.5903836", "0.5897349", "0.5890773", "0.5887483", "0.5883384", "0.5873606", "0.5864437", "0.5864437", "0.5864437", "0.58588254", "0.5856929", "0.5848741", "0.58458865", "0.5843546", "0.5842658", "0.58412886", "0.583334", "0.58320785", "0.5831055", "0.58236635", "0.5819058", "0.5812793", "0.58086747", "0.5800592", "0.5793118", "0.5792102", "0.57916313", "0.57916313", "0.57916313", "0.57916313", "0.57837874", "0.57819164", "0.57819164", "0.57819164", "0.5778091", "0.57778955", "0.57760453", "0.577513", "0.577513", "0.577513", "0.577513", "0.57694745", "0.57620955", "0.57507944", "0.5741671", "0.5717873", "0.5708314", "0.56976587", "0.567454", "0.56655574", "0.5663791", "0.563811", "0.56367475", "0.5613523", "0.56047565", "0.5585918", "0.5579123", "0.55772114", "0.555821", "0.5539384", "0.5537261", "0.55324763", "0.55262405", "0.5514526", "0.5500687" ]
0.78166515
0
Retrieve the OTC Fix Float Label, if Present
public org.drip.state.identifier.OTCFixFloatLabel otcFixFloatLabel() { org.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel(); return null != floaterLabel && floaterLabel instanceof org.drip.state.identifier.OTCFixFloatLabel ? (org.drip.state.identifier.OTCFixFloatLabel) floaterLabel : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static DecimalFormat determineLabelFormat(float val) {\n float absval = Math.abs(val);\n\n DecimalFormat rval = null;\n if (absval == 0) {\n rval = new DecimalFormat(\"0.#\");\n } else if (absval < 0.001 || absval > 1e7) {\n rval = new DecimalFormat(\"0.###E0\");\n } else if (absval < 0.01) {\n rval = new DecimalFormat(\"0.###\");\n } else if (absval < 0.1) {\n rval = new DecimalFormat(\"0.##\");\n } else {\n rval = new DecimalFormat(\"0.#\");\n }\n\n return rval;\n }", "double getLabel();", "public org.drip.state.identifier.FXLabel fxLabel()\n\t{\n\t\treturn _lsPeriod.get (0).fxLabel();\n\t}", "public org.drip.state.identifier.FloaterLabel floaterLabel()\n\t{\n\t\treturn _lsPeriod.get (0).floaterLabel();\n\t}", "public final String getFci() {\n return String.valueOf(fci);\n }", "String getFloat_lit();", "com.microsoft.schemas.xrm._2011.contracts.Label getLabel();", "default String getLabel() { return ((TensorImpl<?>) this).find(NDFrame.class).map(NDFrame::getLabel).orElse(\"\"); }", "public double getLabel() {\n\t\treturn label;\n\t}", "public String getFinshMark() {\r\n return multiplier;\r\n }", "private Optional<String> getRDFSLabelnoPopup(OWLNamedObject oobj) {\n\t\tif (oobj == null) {\r\n\t\t\treturn Optional.empty();\r\n\t\t}\r\n\t\tif (topOrBot(oobj)) {\r\n\t\t\treturn Optional.of(oobj.getIRI().getShortForm());\t\t\t\r\n\t\t}\r\n\t\tif (ontology != null) {\r\n\t\t\tfor (OWLAnnotation annotation : annotationObjects(ontology.getAnnotationAssertionAxioms(oobj.getIRI()), ontology.getOWLOntologyManager().getOWLDataFactory()\r\n\t\t\t\t\t.getRDFSLabel())) {\r\n\t\t\t\tOWLAnnotationValue av = annotation.getValue();\r\n\t\t\t\tcom.google.common.base.Optional<OWLLiteral> ol = av.asLiteral();\r\n\t\t\t\tif (ol.isPresent()) {\r\n\t\t\t\t\treturn Optional.of(ol.get().getLiteral());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Optional.of(oobj.getIRI().getShortForm());\r\n\r\n\r\n\t}", "public double getFeIF() {\n return _avTable.getDouble(ATTR_FE_IF, 0.0);\n }", "java.lang.String getLabel();", "String getLabel();", "String getLabel();", "public String getIsFixPrice();", "public java.lang.String getLabel();", "public org.drip.state.identifier.ForwardLabel forwardLabel()\n\t{\n\t\torg.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel();\n\n\t\treturn null != floaterLabel && floaterLabel instanceof org.drip.state.identifier.ForwardLabel ?\n\t\t\t(org.drip.state.identifier.ForwardLabel) floaterLabel : null;\n\t}", "public T caseFloat(sensorDeploymentLanguage.Float object) {\n\t\treturn null;\n\t}", "private String getLabel(int aValue) {\n\t\tif (fRadix == radix_Hex) {\n\t\t\treturn Format.toHexString(aValue);\n\t\t} else {\n\t\t\tif (fType == type_Float) {\n\t\t\t\treturn \"\" + (double)aValue;\n\t\t\t} else {\n\t\t\t\treturn \"\" + aValue;\n\t\t\t}\n\t\t}\n\t}", "private String getLabelFormat(final Specimen objSpecimen, StringBuffer buffer)\r\n\t{\r\n\t\tString labelFormat = \"\";\r\n\t\tif(objSpecimen.getSpecimenRequirement() != null)\r\n\t\t{\r\n\t\t\tif(objSpecimen.getSpecimenRequirement().getLabelFormat().contains(\"%CP_DEFAULT%\"))\r\n\t\t\t{\r\n//\t\t\t\tlabelFormat=objSpecimen.getSpecimenCollectionGroup().getCollectionProtocolRegistration().getCollectionProtocol().getSpecimenLabelFormat();\r\n\t\t\t\tlabelFormat = getSpecimenLabelFormat(objSpecimen);\r\n\t\t\t}\r\n\t\t\telse if(!objSpecimen.getSpecimenRequirement().getLabelFormat().contains(\"%CP_DEFAULT%\"))\r\n\t\t\t{\r\n\t\t\t\tlabelFormat = objSpecimen.getSpecimenRequirement().getLabelFormat();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if(objSpecimen.getSpecimenRequirement() == null)\r\n\t\t{\r\n\t\t\tlabelFormat = getSpecimenLabelFormat(objSpecimen);\r\n\t\t}\r\n\r\n\t\treturn labelFormat;\r\n\t}", "private Label createScoreFloatLabel(){\n Label text;\n Label.LabelStyle textStyle;\n BitmapFont font = new BitmapFont();\n\n textStyle = new Label.LabelStyle();\n textStyle.font = font;\n\n text = new Label(\"\"+Math.round(playerInput.gameScore),textStyle);\n text.setFontScale(2f*scale,2f*scale);\n text.setAlignment(Align.center);\n text.setPosition(stage.getViewport().getCamera().viewportWidth * 0.5f,\n stage.getViewport().getCamera().viewportHeight * 0.60f);\n return text;\n }", "private static DecimalFormat determineLabelFormat(List<Float> vals) {\n // determine format based on the average difference between the contours\n SortedSet<Float> sortedValues = new TreeSet<Float>(vals);\n Iterator<Float> iter = sortedValues.iterator();\n if (iter.hasNext()) {\n float prevVal = iter.next();\n int count = 0;\n double diffSum = 0;\n while (iter.hasNext()) {\n float val = iter.next();\n diffSum += val - prevVal;\n count++;\n prevVal = val;\n }\n return determineLabelFormat((float) (diffSum / count));\n } else {\n return determineLabelFormat(0.0f);\n }\n\n }", "public T caseFloat(org.uis.lenguajegrafico.lenguajegrafico.Float object)\n {\n return null;\n }", "public T caseURDFAttrFloat(URDFAttrFloat object) {\r\n\t\treturn null;\r\n\t}", "public double getLabel(List<RecordBean> recordBeans){\n for(int i = 0; i < recordBeans.size(); i++){\n if(org.apache.commons.lang3.StringUtils.containsIgnoreCase((String)recordBeans.get(i).getValues().get(\"_label\"), \"Botnet\")){\n return 1;\n }\n }\n return 0;\n }", "private String labelFeature(int feature) {\r\n\t\treturn label[feature];\r\n\t}", "protected String getCntxLabel(ContainableEditPart editPart) {\r\n\t\tif (editPart instanceof StrataRootEditPart)\r\n\t\t\treturn ((TitledArtifactEditPart) editPart).getCommonContextLabel();\r\n\t\telse\r\n//\t\t\treturn strTruncEnd(CodeUnit.getLabelWithContext(getRepo(), editPart.getArtFrag()), \".*\") + \".\";\r\n\t\t\treturn strTruncEnd(CodeUnit.getLabel(getRepo(), editPart.getArtFrag(), null, true), \".*\") + \".\";\r\n\t}", "float getEFloat();", "String getFloatingPointEncoding();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public Double getFNumber()\n\t{\n\t\treturn null;\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn \"float\";\r\n\t}", "public FloatColumn getChemShift19FErr() {\n return (FloatColumn) (isText ? textFields.computeIfAbsent(\"chem_shift_19F_err\", FloatColumn::new) :\n getBinaryColumn(\"chem_shift_19F_err\"));\n }", "public char get_floating_suffix();", "public String m9120f() {\r\n return this.f6008b;\r\n }", "public String kTipText() {\n return \"The value used in the tozero() method.\";\n }", "FeatureCall getFec();", "public FloatColumn getExptlDipolarCouplingTerm() {\n return delegate.getColumn(\"exptl_dipolar_coupling_term\", DelegatingFloatColumn::new);\n }", "public BigDecimal getCIF_NO() {\r\n return CIF_NO;\r\n }", "@Override\n public java.lang.String getLabelToDisplay() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.LABEL_TO_DISPLAY_);\n return (java.lang.String)retnValue;\n }", "public String getCssText() {\n \t\treturn getCssText(unitType, floatValue);\n \t}", "DatasetLabel getLabel();", "public Float getT1B11Fd() {\r\n return t1B11Fd;\r\n }", "public String toFloatString() {\n\t\treturn this.toFloatString(DEFAULT_NUM_DECIMALS);\n\t}", "public String getCpf() {\n return cpf;\n }", "public String getLabel() {\n return TrackerRes.getString(\"ModelFunctionPanel.Label\"); //$NON-NLS-1$\n }", "public BoardCell getLabelCell() {\n\t\treturn null;\n\t}", "@Override\n\t\t\tpublic String getLabel() {\n\t\t\t\treturn null;\n\t\t\t}", "public String getLabelText();", "public static String getRounfOF(Float target) {\n\n return new DecimalFormat(\"0.00\").format(target);\n\n }", "public String getLabel() {\r\n\t\tif (label != null)\r\n\t\t\treturn label;\r\n\t\tif (classSimpleName==null)\r\n\t\t\treturn null;\r\n\t\treturn classSimpleName.replace('.', '_');\r\n\t}", "Label getLabel();", "Label getLabel();", "Label getLabel();", "public java.lang.String getFCO01() {\n return FCO01;\n }", "@Override\n public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {\n return \"\";\n }", "public Float getT1B11Ffs6() {\r\n return t1B11Ffs6;\r\n }", "public String getUSECIF_NUMBER1() {\r\n return USECIF_NUMBER1;\r\n }", "public String getUSECIF_NUMBER1() {\r\n return USECIF_NUMBER1;\r\n }", "public gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Label getLabel() {\r\n return label;\r\n }", "protected StickyNoteFigure getLabel() {\n\t\treturn stickyNote;\n\t}", "public String getLabel() {\n\t String name = getLiteralValue(Foaf.NAME);\n\t \n\t if (name == null) {\n\t name = getLiteralValue(Foaf.GIVENNAME);\n\t }\n\t \n\t if (name == null) {\n\t name = getLiteralValue(RDFS.label);\n\t }\n\t \n\t if (name == null) {\n\t return getURI();\n\t }\n\t return name;\n }", "public Float getBhDlTbfSucr() {\r\n return bhDlTbfSucr;\r\n }", "public JLabel getLblFundaciones() {\r\n\t\treturn lblFundaciones;\r\n\t}", "@Override\n public String toString() {\n return new Apfloat(this.value).toString(true);\n }", "public float getBilanganFloat() /*const*/{\n\t\tassert(getTipeBilangan()==Tipe._float);\n\t\treturn Val.F;\n\t}", "String getShapeLabel();", "public java.lang.CharSequence getOTDFLTUPFNTSCATIND() {\n return OT_DFLT_UPFNT_SCAT_IND;\n }", "public static float getValueFloat()\n {\n return Util.valueFloat;\n }", "public boolean checkPosFloatValues(TextField tempField) { //check if float is positive\n \tString param = \"Dt_devc, Specific_heat, heat of reaction, reference tmp., density and conductivity\";\n \treturn Values.checkPosFloatValues(param, tempField);\n }", "public java.lang.CharSequence getOTDFLTUPFNTSCATIND() {\n return OT_DFLT_UPFNT_SCAT_IND;\n }", "public T2 getLabel() {\r\n\t\treturn label;\r\n\t}", "public int getFE(){\n return this._FE;\n }", "public BigDecimal getCOVERING_ACC_CIF() {\r\n return COVERING_ACC_CIF;\r\n }", "public BigDecimal getCIF_SUB_NO() {\r\n return CIF_SUB_NO;\r\n }", "public BigDecimal getCIF_SUB_NO() {\r\n return CIF_SUB_NO;\r\n }", "public BigDecimal getCIF_SUB_NO() {\r\n return CIF_SUB_NO;\r\n }", "public DrawStringObject\ngetNumberLabel()\n{\n\tVector labelList = this.getLabelList();\n\tif (labelList == null)\n\t\treturn (null);\n\tif ((labelList.size() <= 0) || (labelList.size() > 2))\n\t\treturn (null);\n\tDrawObject drwObj0 = null;\n\tDrawObject drwObj1 = null;\n\tdrwObj0 = (DrawObject)labelList.elementAt(0);\n\tif (labelList.size() == 2)\n\t\tdrwObj1 = (DrawObject)labelList.elementAt(1);\n\tif ((drwObj1 == null) && (drwObj0 instanceof DrawLineObject))\n\t\treturn (null);\n\tif (drwObj1 == null)\n\t\treturn (null);\n\tif ((drwObj0 instanceof DrawLineObject) && (drwObj1 instanceof DrawStringObject))\n\t{\n\t\ttry\n\t\t{\n\t\t\tint val = Integer.parseInt(((DrawStringObject)drwObj1).getDrawString());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\treturn (null);\n\t\t}\n\t\treturn ((DrawStringObject)drwObj1);\n\t}\n\tif ((drwObj1 instanceof DrawLineObject) && (drwObj0 instanceof DrawStringObject))\n\t{\n\t\ttry\n\t\t{\n\t\t\tint val = Integer.parseInt(((DrawStringObject)drwObj0).getDrawString());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\treturn (null);\n\t\t}\n\t\treturn ((DrawStringObject)drwObj0);\n\t}\n\treturn (null);\n}", "@Override\r\n\tpublic float getFloat(String string) {\n\t\treturn 0;\r\n\t}", "public javax.swing.JLabel getLbl00() {\n return lbl00;\n }", "int getLabelOffset();", "String getFpDescription();", "public int getEstimated_label() {\r\n\t\treturn estimated_label;\r\n\t}", "double getFloatingPointField();", "boolean hasFloat();", "public float bottom_clearance_GET()\n { return (float)(Float.intBitsToFloat((int) get_bytes(data, 28, 4))); }", "int getFeatureValue();", "public float getFloat(String name, float defaultValue)\n/* */ {\n/* 984 */ String value = getString(name);\n/* 985 */ if (value == null) {\n/* 986 */ return defaultValue;\n/* */ }\n/* 988 */ return PApplet.parseFloat(value, defaultValue);\n/* */ }", "public float[] getCallout() {\n/* 698 */ COSBase base = getCOSObject().getDictionaryObject(COSName.CL);\n/* 699 */ if (base instanceof COSArray)\n/* */ {\n/* 701 */ return ((COSArray)base).toFloatArray();\n/* */ }\n/* 703 */ return null;\n/* */ }", "public int computeFN(Label classLabel){\n\n\t\tint tp = this.computeTP(classLabel);\n\t\t//the total number of real labels of 'classLabel'\n\t\tint totalReal = this.sumColumn(classLabel);\n\n\t\treturn totalReal - tp;\n\n\t}", "public java.lang.String getMinTemperatureF()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MINTEMPERATUREF$6, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getContextualizedLabel() {\n\t\tString completeLbl = CodeUnit.getLabel(getRepo(), getArtFrag(), null, true);//this.getLabel();\r\n\t\t\r\n\t\t// strip number for anon class (shows in tooltip)\r\n\t\tif (RSECore.isAnonClassName(completeLbl))\r\n\t\t\tcompleteLbl = RSECore.stripAnonNumber(completeLbl);\r\n\t\t\r\n\t\tTitledArtifactEditPart parentTAFEP = this.getParentTAFEP();\r\n\t\tif (parentTAFEP != null) {\r\n\t\t\tString contextLbl = null;\r\n\t\t\tcontextLbl = getCntxLabel(parentTAFEP);\r\n\t\t\tif (completeLbl.startsWith(contextLbl) && !contextLbl.equals(\".\")) {\r\n\t\t\t\tcompleteLbl = completeLbl.substring(contextLbl.length());\r\n\t\t\t}\r\n\t\t}\r\n\t\tcompleteLbl = strTruncEnd(completeLbl, \".*\");\r\n\t\tcompleteLbl = strTruncBeg(completeLbl, \".\");\r\n\t\tif (completeLbl.length() == 0) completeLbl = \".\";\r\n\t\treturn completeLbl;\r\n\t}", "java.lang.String getFmla();", "public float getFloat(String key, float fallback)\n {\n if (key.contains(\".\"))\n {\n String[] pieces = key.split(\"\\\\.\", 2);\n DataSection section = getSection(pieces[0]);\n return section == null ? fallback : section.getFloat(pieces[1], fallback);\n }\n\n if (!data.containsKey(key)) return -1;\n Object obj = data.get(key);\n try\n {\n return Float.parseFloat(obj.toString());\n }\n catch (Exception ex)\n {\n return fallback;\n }\n }", "String floatRead();", "public String getLabel() {\n\t\t// just return item text until we get the grade levels straighted out for\n\t\t// comm_core\n\t\treturn this.itemText;\n\t\t/*\n\t\t * if (this.label == null) { if (this.getLevel() == 1) { this.label =\n\t\t * this.itemText; } else if (this.getIsLeafNode()) { this.label = \"[\" +\n\t\t * this.getGradeRange() + \"] \" + this.itemText; } else { this.label =\n\t\t * this.itemText + \" [\" + this.getGradeRange() + \"]\"; } } return this.label;\n\t\t */\n\t}" ]
[ "0.62034804", "0.6129242", "0.60501325", "0.5913735", "0.5891387", "0.5877262", "0.5795651", "0.57477736", "0.5708618", "0.5683645", "0.5658727", "0.5655863", "0.56417245", "0.55814356", "0.55814356", "0.5575542", "0.55645573", "0.55270755", "0.55164057", "0.55135816", "0.5498767", "0.5486007", "0.5475538", "0.5456868", "0.54408985", "0.54097515", "0.5404823", "0.53702384", "0.53559864", "0.5354164", "0.534418", "0.534418", "0.534418", "0.534418", "0.5337892", "0.53281045", "0.53273773", "0.532441", "0.5324175", "0.53151727", "0.5310684", "0.5309561", "0.530596", "0.52735615", "0.52714074", "0.527049", "0.52602684", "0.5256939", "0.52520233", "0.52491915", "0.5247217", "0.52371216", "0.52256083", "0.52183586", "0.5218126", "0.5207955", "0.5207955", "0.5207955", "0.5200807", "0.520073", "0.5197303", "0.51963663", "0.51963663", "0.5195712", "0.5171912", "0.51718533", "0.5169716", "0.5168528", "0.51684326", "0.51660573", "0.516574", "0.51605606", "0.5152274", "0.5150297", "0.51499", "0.5146141", "0.5145395", "0.5144999", "0.51367", "0.51367", "0.51367", "0.513378", "0.513275", "0.5127357", "0.5126724", "0.5124533", "0.5122889", "0.5107975", "0.5104961", "0.51030934", "0.509395", "0.5091388", "0.5088517", "0.5088065", "0.50861967", "0.50835484", "0.50672895", "0.5065307", "0.5064071", "0.5062783" ]
0.78775287
0
Retrieve the Funding Label
public org.drip.state.identifier.FundingLabel fundingLabel() { return _lsPeriod.get (0).fundingLabel(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public org.drip.state.identifier.FundingLabel fundingLabel()\n\t{\n\t\treturn _lslFunding;\n\t}", "com.microsoft.schemas.xrm._2011.contracts.Label getLabel();", "public JLabel getLblFundaciones() {\r\n\t\treturn lblFundaciones;\r\n\t}", "String getLabel();", "String getLabel();", "public java.lang.String getLabel();", "com.google.ads.googleads.v6.resources.Label getLabel();", "java.lang.String getLabel();", "public String getLabel() {\n\t String name = getLiteralValue(Foaf.NAME);\n\t \n\t if (name == null) {\n\t name = getLiteralValue(Foaf.GIVENNAME);\n\t }\n\t \n\t if (name == null) {\n\t name = getLiteralValue(RDFS.label);\n\t }\n\t \n\t if (name == null) {\n\t return getURI();\n\t }\n\t return name;\n }", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "Label getLabel();", "Label getLabel();", "Label getLabel();", "DatasetLabel getLabel();", "public org.drip.state.identifier.FXLabel fxLabel()\n\t{\n\t\treturn _lsPeriod.get (0).fxLabel();\n\t}", "private String getFundingLabel(String type, Locale locale) {\n String paymentMethodLabel = \"\";\n if (type.equalsIgnoreCase(PdfConstants.PROMO_CREDIT)) {\n paymentMethodLabel = getMessage(locale, \"pdf.receipt.promoCredit\");\n } else if (type.equalsIgnoreCase(PdfConstants.BLACKHAWK)) {\n paymentMethodLabel = getMessage(locale, \"pdf.receipt.reloaditPack\");\n } else if (type.equalsIgnoreCase(PdfConstants.PRECASH)) {\n paymentMethodLabel = getMessage(locale, \"pdf.receipt.evolvePayBucks\");\n } else if (type.equalsIgnoreCase(PdfConstants.INCOMM)) {\n paymentMethodLabel = getMessage(locale, \"pdf.receipt.vanillaReload\");\n }\n return paymentMethodLabel;\n }", "protected static String getLabel( Resource individual ) {\n\t StmtIterator i = individual.listProperties( RDFS.label );\n\t while (i.hasNext()) {\n\t Literal l = i.next().getLiteral();\n\n\t if (l.getLanguage() != null) {\n\t //devuelve el valor del label del recurso\n\t return l.getLexicalForm();\n\t }\n\t }\n\n\t return \"\";\n\t }", "com.microsoft.schemas.xrm._2011.contracts.Label getDescription();", "public L getLabel() {\n\t\tcheckRep();\n\t\treturn this.label;\n\t}", "double getLabel();", "public String getLabel() {\n return getElement().getChildren()\n .filter(child -> child.getTag().equals(\"label\")).findFirst()\n .get().getText();\n }", "public String getLabel()\n { \n return label;\n }", "public String getLabel()\n {\n return label;\n }", "public String getLabelText();", "private String labelFeature(int feature) {\r\n\t\treturn label[feature];\r\n\t}", "public double getLabel() {\n\t\treturn label;\n\t}", "public String getLabel() { //gets the label\n\n\t\treturn rawLabel;\n\t}", "public String getLabel() {\n return label;\n }", "public String getLabel()\r\n {\r\n return label;\r\n }", "public String getLabel()\r\n {\r\n return label;\r\n }", "String nameLabel();", "public String getLabel(){\n return label;\n }", "public String getLabel() {\r\n return lbl;\r\n }", "public String getLabel() {\n return name().toLowerCase().replace(\"_\", \"\");\n }", "public String getLabel() {\n\t\treturn this._label;\n\t}", "public String getLabel() {\n return _label == null ? name() : _label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel()\n {\n return label;\n }", "private String getLabel(int index) throws Exception{\n for (CodyFileReader.Trial t : trials){\n if (t.start <= index && index < t.end) \n return t.label;\n }\n \n return null;\n }", "public final String getLabel() {\n\t\treturn _label;\n\t}", "public String getLabel() {\n return label;\n }", "private String getLabel(String labelAudit) {\n\t\tString label = null;\n\t\tif(labelForAuditLabel.containsKey(labelAudit)) {\n\t\t\tlabel = labelForAuditLabel.get(labelAudit);\n\t\t\tif(label != null) {\n\t\t\t\tif(label.isEmpty())\n\t\t\t\t\tlabel = null;\n\t\t\t\telse\n\t\t\t\t\tlabel = messageSource.getMessage(label, null, Locale.getDefault());\n\t\t\t\t\t//messageSource.getMessage(\"label.dati_verbale\", values, Locale.getDefault())\n\t\t\t}\n\t\t} else {\n\t\t\t//LOGGER.info(\"label_mancante\");\n\t\t\tLOGGER.info(labelAudit);\n\t\t\tlabel = \"??key \" + labelAudit + \" not found??\";\n\t\t}\n\t\treturn label;\n\t}", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public double getLabel(List<RecordBean> recordBeans){\n for(int i = 0; i < recordBeans.size(); i++){\n if(org.apache.commons.lang3.StringUtils.containsIgnoreCase((String)recordBeans.get(i).getValues().get(\"_label\"), \"Botnet\")){\n return 1;\n }\n }\n return 0;\n }", "public String getLabel()\n {\n return m_label;\n }", "public Object getLabel() \n {\n return label;\n }", "String getLabel() {\n return label;\n }", "public\t\tMiPart\t\tgetLabel()\n\t\t{\n\t\treturn(label);\n\t\t}", "public String getLabel(){\n\t\treturn sAnzeige;\n\t}", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\r\n return label;\r\n }", "public int getLabel() {\n\t\treturn label;\n\t}", "public String getLabel(){\n\t\treturn label;\n\t}", "public String getLabel()\n\t{\n\t\treturn label;\n\t}", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n\t\treturn myLabel;\n\t}", "public java.lang.String getLabel() {\n\t\treturn this.label;\n\t}", "public org.drip.state.identifier.EntityCDSLabel creditLabel()\n\t{\n\t\treturn _lsPeriod.get (0).creditLabel();\n\t}", "public String getLabel() {\n\t\t// just return item text until we get the grade levels straighted out for\n\t\t// comm_core\n\t\treturn this.itemText;\n\t\t/*\n\t\t * if (this.label == null) { if (this.getLevel() == 1) { this.label =\n\t\t * this.itemText; } else if (this.getIsLeafNode()) { this.label = \"[\" +\n\t\t * this.getGradeRange() + \"] \" + this.itemText; } else { this.label =\n\t\t * this.itemText + \" [\" + this.getGradeRange() + \"]\"; } } return this.label;\n\t\t */\n\t}", "private String getLabel() {\n return this.label;\n }", "public String getLabel() {\n\t\treturn label;\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public Label getLabel() {\n\t\treturn label;\n\t}", "public Label getLabel() {\n\t\treturn label;\n\t}", "public gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Label getLabel() {\r\n return label;\r\n }", "public com.commercetools.api.models.common.LocalizedString getLabel() {\n return this.label;\n }", "public abstract String getLabel();", "public int getEstimated_label() {\r\n\t\treturn estimated_label;\r\n\t}", "public Label getLabel() {\n return this.label;\n }", "public Label getLabel() {\n\t\treturn this.label;\n\t}", "public String getLabel(int n) {\n return predictionLabels.get(n);\n }", "public T2 getLabel() {\r\n\t\treturn label;\r\n\t}", "public String label() {\n\t\treturn \"LABEL_\" + (labelCount++);\n\t}", "public Label getLabel() {\n return pkgBuilder.getBuildFileLabel();\n }", "public final Label getLabel() {\n return label;\n }", "public String label() {\n return this.label;\n }", "public String toString() {\n return label;\n }", "public LabelModel getLabel(LabelUUID aLabelUUID);", "public org.drip.state.identifier.FloaterLabel floaterLabel()\n\t{\n\t\treturn _lsPeriod.get (0).floaterLabel();\n\t}", "public abstract String getLabelText();", "public String getLabel() {\n return label == null ? StringUtils.EMPTY : label;\n }", "private Optional<String> getRDFSLabelnoPopup(OWLNamedObject oobj) {\n\t\tif (oobj == null) {\r\n\t\t\treturn Optional.empty();\r\n\t\t}\r\n\t\tif (topOrBot(oobj)) {\r\n\t\t\treturn Optional.of(oobj.getIRI().getShortForm());\t\t\t\r\n\t\t}\r\n\t\tif (ontology != null) {\r\n\t\t\tfor (OWLAnnotation annotation : annotationObjects(ontology.getAnnotationAssertionAxioms(oobj.getIRI()), ontology.getOWLOntologyManager().getOWLDataFactory()\r\n\t\t\t\t\t.getRDFSLabel())) {\r\n\t\t\t\tOWLAnnotationValue av = annotation.getValue();\r\n\t\t\t\tcom.google.common.base.Optional<OWLLiteral> ol = av.asLiteral();\r\n\t\t\t\tif (ol.isPresent()) {\r\n\t\t\t\t\treturn Optional.of(ol.get().getLiteral());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Optional.of(oobj.getIRI().getShortForm());\r\n\r\n\r\n\t}", "public String getLabel() {\r\n\t\tif (label != null)\r\n\t\t\treturn label;\r\n\t\tif (classSimpleName==null)\r\n\t\t\treturn null;\r\n\t\treturn classSimpleName.replace('.', '_');\r\n\t}", "@DISPID(32)\r\n\t// = 0x20. The runtime will prefer the VTID if present\r\n\t@VTID(37)\r\n\tjava.lang.String label();", "public String getContextualizedLabel() {\n\t\tString completeLbl = CodeUnit.getLabel(getRepo(), getArtFrag(), null, true);//this.getLabel();\r\n\t\t\r\n\t\t// strip number for anon class (shows in tooltip)\r\n\t\tif (RSECore.isAnonClassName(completeLbl))\r\n\t\t\tcompleteLbl = RSECore.stripAnonNumber(completeLbl);\r\n\t\t\r\n\t\tTitledArtifactEditPart parentTAFEP = this.getParentTAFEP();\r\n\t\tif (parentTAFEP != null) {\r\n\t\t\tString contextLbl = null;\r\n\t\t\tcontextLbl = getCntxLabel(parentTAFEP);\r\n\t\t\tif (completeLbl.startsWith(contextLbl) && !contextLbl.equals(\".\")) {\r\n\t\t\t\tcompleteLbl = completeLbl.substring(contextLbl.length());\r\n\t\t\t}\r\n\t\t}\r\n\t\tcompleteLbl = strTruncEnd(completeLbl, \".*\");\r\n\t\tcompleteLbl = strTruncBeg(completeLbl, \".\");\r\n\t\tif (completeLbl.length() == 0) completeLbl = \".\";\r\n\t\treturn completeLbl;\r\n\t}", "public String toString()\n {\n return label;\n }" ]
[ "0.754628", "0.7325803", "0.6864824", "0.6736176", "0.6736176", "0.6720462", "0.66839826", "0.66748214", "0.65512526", "0.65370566", "0.65370566", "0.65370566", "0.65370566", "0.65060973", "0.65060973", "0.65060973", "0.64391553", "0.6393706", "0.63823843", "0.6359553", "0.63490885", "0.6348079", "0.6336718", "0.6311937", "0.6259812", "0.62526524", "0.62520033", "0.622842", "0.6225234", "0.6215436", "0.61919343", "0.6189448", "0.6189448", "0.61799765", "0.6176961", "0.61682135", "0.61634946", "0.6150293", "0.6148296", "0.61474764", "0.61443657", "0.6140195", "0.6139762", "0.61309093", "0.612606", "0.6123288", "0.6123288", "0.6123288", "0.61206657", "0.61195725", "0.6119515", "0.6115383", "0.6115275", "0.6115137", "0.61085004", "0.61085004", "0.61085004", "0.61085004", "0.61032456", "0.61032456", "0.61032456", "0.6099073", "0.60738355", "0.6070896", "0.60671246", "0.606712", "0.6059538", "0.6056552", "0.604774", "0.60474384", "0.60473496", "0.6040185", "0.60391015", "0.60391015", "0.60391015", "0.60391015", "0.602202", "0.602202", "0.6021386", "0.6009665", "0.60068434", "0.59840053", "0.5976819", "0.5974769", "0.59745723", "0.59438854", "0.5943452", "0.59432834", "0.591315", "0.5912711", "0.5880102", "0.587388", "0.5870684", "0.58617395", "0.5854047", "0.5848199", "0.5839264", "0.5824043", "0.5820497", "0.58171177" ]
0.7773978
0
Retrieve the FX Label
public org.drip.state.identifier.FXLabel fxLabel() { return _lsPeriod.get (0).fxLabel(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLabel() {\n return getElement().getChildren()\n .filter(child -> child.getTag().equals(\"label\")).findFirst()\n .get().getText();\n }", "public java.lang.String getLabel();", "public String getLabelText();", "java.lang.String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel(){\n return label;\n }", "String getLabel();", "String getLabel();", "public String getLabel()\n { \n return label;\n }", "public String getLabelText(){\n\t\treturn syncExec(new StringResult() {\t\t\n\t\t\t@Override\n\t\t\tpublic String run() {\n\t\t\t\tControl[] aux = widget.getParent().getChildren();\n\t\t\t\tfor (Control control : aux) {\n\t\t\t\t\tif (control instanceof CLabel){\n\t\t\t\t\t\treturn ((CLabel)control).getText();\n\t\t\t\t\t}\n\t\t\t\t\tif (control instanceof Label){\n\t\t\t\t\t\treturn ((Label)control).getText();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t}", "public String getLabel() {\n return label;\n }", "public String getLabel() {\r\n return lbl;\r\n }", "public String getLabel() {\n return label;\n }", "public Object getLabel() \n {\n return label;\n }", "public String getLabel()\n {\n return label;\n }", "public String getLabel()\n {\n return label;\n }", "Label getLabel();", "Label getLabel();", "Label getLabel();", "public String getLabel()\r\n {\r\n return label;\r\n }", "public String getLabel()\r\n {\r\n return label;\r\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "private String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel(){\n\t\treturn label;\n\t}", "public String getLabel()\n {\n return m_label;\n }", "public String getLabelName() {\r\n if( this.jlblHolder != null )\r\n return this.jlblHolder.getText();\r\n else\r\n return label;\r\n }", "public String label() {\n return this.label;\n }", "String getLabel() {\n return label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public abstract String getLabelText();", "public String getLabel() {\n return TrackerRes.getString(\"ModelFunctionPanel.Label\"); //$NON-NLS-1$\n }", "public String getLabel() {\n return this.label;\n }", "public Label getLabel() {\n return this.label;\n }", "public String getLabel()\n\t{\n\t\treturn label;\n\t}", "public String getLabel() {\n\t\treturn myLabel;\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\n\t\treturn this._label;\n\t}", "public Label getLabel() {\n\t\treturn label;\n\t}", "public Label getLabel() {\n\t\treturn label;\n\t}", "public JLabel getLabel() {\n return label;\n }", "public String getLabel() {\n\t\treturn label;\n\t}", "public String getLabel() { //gets the label\n\n\t\treturn rawLabel;\n\t}", "public final String getLabel() {\n\t\treturn _label;\n\t}", "String nameLabel();", "public abstract String getLabel();", "public Label getLabel() {\n\t\treturn this.label;\n\t}", "public String getLabel() {\n return _label == null ? name() : _label;\n }", "public CharSequence getSelectedLabel()\n\t{\n\t\treturn _current.label.getText();\n\t}", "public String getLabel() {\r\n return layout.label;\r\n }", "public JLabel getLabel() {\n return this.label;\n }", "public final Label getLabel() {\n return label;\n }", "public java.lang.String getLabel() {\n\t\treturn this.label;\n\t}", "String getFormFieldLabel();", "public String getxLabel() {\n return xLabel;\n }", "@Override\n public String getLabel() {\n return label;\n }", "public Object getLabel() {\n if (this.label != null) {\n return this.label;\n }\n\n return this.getDefaultLabel();\n }", "public double getLabel() {\n\t\treturn label;\n\t}", "public L getLabel() {\n\t\tcheckRep();\n\t\treturn this.label;\n\t}", "public\t\tMiPart\t\tgetLabel()\n\t\t{\n\t\treturn(label);\n\t\t}", "public static LabelTarget label() { throw Extensions.todo(); }", "public T2 getLabel() {\r\n\t\treturn label;\r\n\t}", "public gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Label getLabel() {\r\n return label;\r\n }", "public String getLabel() {\n return label == null ? StringUtils.EMPTY : label;\n }", "com.microsoft.schemas.xrm._2011.contracts.Label getLabel();", "private RLabel getIconLabel() {\n if (iconLabel == null) {\n iconLabel = new RLabel();\n iconLabel.setStyle(\"border-all\");\n iconLabel.setIconUri(\"<%=ivy.cms.cr(\\\"/Icons/Large/error\\\")%>\");\n iconLabel.setStyleProperties(\"{/anchor \\\"NORTHWEST\\\"}\");\n iconLabel.setName(\"iconLabel\");\n }\n return iconLabel;\n }", "public String getLabel() {\n return name().toLowerCase().replace(\"_\", \"\");\n }", "public int getLabel() {\n\t\treturn label;\n\t}", "double getLabel();", "DatasetLabel getLabel();", "public String getLabel() {\n\t String name = getLiteralValue(Foaf.NAME);\n\t \n\t if (name == null) {\n\t name = getLiteralValue(Foaf.GIVENNAME);\n\t }\n\t \n\t if (name == null) {\n\t name = getLiteralValue(RDFS.label);\n\t }\n\t \n\t if (name == null) {\n\t return getURI();\n\t }\n\t return name;\n }", "public String getLabelName() {\n return m_labelName;\n }", "public com.commercetools.api.models.common.LocalizedString getLabel() {\n return this.label;\n }", "@Override\n public java.lang.String getLabelToDisplay() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.LABEL_TO_DISPLAY_);\n return (java.lang.String)retnValue;\n }", "public Label getLabel() {\n return pkgBuilder.getBuildFileLabel();\n }", "java.lang.String getViewsLabel();", "@DISPID(32)\r\n\t// = 0x20. The runtime will prefer the VTID if present\r\n\t@VTID(37)\r\n\tjava.lang.String label();", "public final String aoy() {\n return this.label;\n }", "ReadOnlyStringProperty labelProperty();", "String getShapeLabel();", "private RLabel getProductLabel() {\n if (productLabel == null) {\n productLabel = new RLabel();\n productLabel.setText(\"<%= ivy.cms.co(\\\"/Dialogs/about/product\\\") %>\");\n productLabel.setStyleProperties(\"{/insetsTop \\\"2\\\"}\");\n productLabel.setName(\"productLabel\");\n }\n return productLabel;\n }", "public String toString() {\n return label;\n }", "private RLabel getVersionLabel() {\n if (versionLabel == null) {\n versionLabel = new RLabel();\n versionLabel.setText(\"<%= ivy.cms.co(\\\"/Dialogs/about/productVersion\\\") %>\");\n versionLabel.setStyleProperties(\"{/insetsTop \\\"2\\\"}\");\n versionLabel.setName(\"versionLabel\");\n }\n return versionLabel;\n }", "public String label() {\n\t\treturn \"LABEL_\" + (labelCount++);\n\t}", "private javax.swing.JLabel getLblOSName() {\n\tif (ivjLblOSName == null) {\n\t\ttry {\n\t\t\tivjLblOSName = new javax.swing.JLabel();\n\t\t\tivjLblOSName.setName(\"LblOSName\");\n\t\t\tivjLblOSName.setText(\"Name:\");\n\t\t\tivjLblOSName.setBounds(10, 20, 140, 14);\n\t\t\t// user code begin {1}\n ivjLblOSName.setText(ResourceManager.getResource(PlatformInfoPanel.class, \"LblOSName_text\"));\n\t\t\t// user code end\n\t\t} catch (java.lang.Throwable ivjExc) {\n\t\t\t// user code begin {2}\n\t\t\t// user code end\n\t\t\thandleException(ivjExc);\n\t\t}\n\t}\n\treturn ivjLblOSName;\n}" ]
[ "0.7510083", "0.74692804", "0.7451905", "0.7429578", "0.7350037", "0.7350037", "0.7350037", "0.7350037", "0.7323705", "0.73128736", "0.73128736", "0.7250884", "0.7244965", "0.7228396", "0.7217888", "0.72103876", "0.7208645", "0.71929383", "0.71819675", "0.717678", "0.717678", "0.717678", "0.7176704", "0.7176704", "0.71636856", "0.71583664", "0.71583664", "0.71583664", "0.71420795", "0.7136364", "0.7116924", "0.7116924", "0.7116924", "0.71097213", "0.7080729", "0.7080536", "0.7074971", "0.70688623", "0.70672315", "0.70672315", "0.70672315", "0.70672315", "0.7050627", "0.7020681", "0.70179385", "0.6999153", "0.6990038", "0.6981378", "0.6970362", "0.6970362", "0.6970362", "0.6970362", "0.6938413", "0.6933771", "0.6933771", "0.6930223", "0.69254255", "0.69164765", "0.69089895", "0.6900272", "0.6893723", "0.68545383", "0.6850574", "0.68459195", "0.6842898", "0.6837755", "0.6814944", "0.68011475", "0.67839366", "0.6749875", "0.67420536", "0.6741184", "0.6659968", "0.6652102", "0.6597446", "0.6593795", "0.6579793", "0.65704983", "0.6557862", "0.6554501", "0.6548123", "0.6545074", "0.65396345", "0.64972943", "0.6492906", "0.6487853", "0.6487594", "0.64834803", "0.6451748", "0.64443815", "0.6430513", "0.6423055", "0.6422621", "0.64126915", "0.6400112", "0.63769823", "0.63688", "0.6367614", "0.6345081", "0.63117385" ]
0.76403743
0
Retrieve the Coupon Period List
public java.util.List<org.drip.analytics.cashflow.CompositePeriod> cashFlowPeriod() { return _lsPeriod; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<hr.client.appuser.CouponCenter.AppCoupon> \n getCouponListList();", "hr.client.appuser.CouponCenter.AppCoupon getCouponList(int index);", "public List<Period> getPeriods() throws PeriodNotFoundException;", "public List<CouponData> getExpiredCouponList() {\n LocalDateTime currentDate = LocalDateTime.now();\n\n Optional<List<CouponData>> couponDataList = couponDataJpaRepository.findExpiredCoupon(currentDate);\n\n couponDataList.orElseThrow(()\n -> new CommonException(CommonResultCode.NO_DATA));\n\n return couponDataList.get();\n }", "@Override\n\t/** Returns all Coupons as an array list */\n\tpublic Collection<Coupon> getAllCoupons() throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\t\t// Create list object to fill it later with Coupons\n\t\tCollection<Coupon> colCoup = new ArrayList<>();\n\n\t\ttry {\n\t\t\t// Defining SQL string to retrieve all Coupons via prepared\n\t\t\t// statement\n\t\t\tString getAllCouponsSQL = \"select * from coupon\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(getAllCouponsSQL);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute manipulations\n\t\t\tResultSet resCoup = pstmt.executeQuery();\n\t\t\t// While there is result line in resCoup do lines below\n\t\t\twhile (resCoup.next()) {\n\t\t\t\t// Creating Coupon object to fill it later with data from SQL\n\t\t\t\t// query result and for method to add it to the list and return\n\t\t\t\t// it afterwards\n\t\t\t\tCoupon coupon = new Coupon();\n\t\t\t\t// Set Coupon attributes according to the results in the\n\t\t\t\t// ResultSet\n\t\t\t\tcoupon.setId(resCoup.getInt(\"id\"));\n\t\t\t\tcoupon.setTitle(resCoup.getString(\"title\"));\n\t\t\t\tcoupon.setStart_date(resCoup.getDate(\"start_date\"));\n\t\t\t\tcoupon.setEnd_date(resCoup.getDate(\"end_date\"));\n\t\t\t\tcoupon.setExpired(resCoup.getString(\"expired\"));\n\t\t\t\tcoupon.setType(resCoup.getString(\"type\"));\n\t\t\t\tcoupon.setMessage(resCoup.getString(\"message\"));\n\t\t\t\tcoupon.setPrice(resCoup.getInt(\"price\"));\n\t\t\t\tcoupon.setImage(resCoup.getString(\"image\"));\n\t\t\t\t// Add resulting Coupon to the list\n\t\t\t\tcolCoup.add(coupon);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon retrieval from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupon list retrieve has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\n\t\t// Return resulted list of Coupons\n\t\treturn colCoup;\n\t}", "public org.drip.analytics.cashflow.CompositePeriod lastPeriod()\n\t{\n\t\tjava.util.List<org.drip.analytics.cashflow.CompositePeriod> lsCouponPeriod = periods();\n\n\t\treturn lsCouponPeriod.get (lsCouponPeriod.size() - 1);\n\t}", "@Override\n\t/** Returns all Coupons of selected Company as an array list */\n\tpublic Collection<Coupon> getCouponsByCompany(int compID) throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\t\t// Create list object to fill it later with Coupons\n\t\tCollection<Coupon> colCoup = new ArrayList<>();\n\n\t\ttry {\n\t\t\t// Defining SQL string to retrieve Coupons via prepared statement\n\t\t\tString getCouponsByCompanySQL = \"select * from coupon where id in (select couponid from compcoupon where companyid = ?)\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(getCouponsByCompanySQL);\n\t\t\t// Set Company ID variable that method received into prepared\n\t\t\t// statement\n\t\t\tpstmt.setInt(1, compID);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute manipulations\n\t\t\tResultSet resCoup = pstmt.executeQuery();\n\t\t\t// While there is result line in resCoup do lines below\n\t\t\twhile (resCoup.next()) {\n\t\t\t\t// Creating Coupon object to fill it later with data from SQL\n\t\t\t\t// query result and for method to add it to the list and return\n\t\t\t\t// it afterwards\n\t\t\t\tCoupon coupon = new Coupon();\n\t\t\t\t// Set Coupon attributes according to the results in the\n\t\t\t\t// ResultSet\n\t\t\t\tcoupon.setId(resCoup.getInt(\"id\"));\n\t\t\t\tcoupon.setTitle(resCoup.getString(\"title\"));\n\t\t\t\tcoupon.setStart_date(resCoup.getDate(\"start_date\"));\n\t\t\t\tcoupon.setEnd_date(resCoup.getDate(\"end_date\"));\n\t\t\t\tcoupon.setExpired(resCoup.getString(\"expired\"));\n\t\t\t\tcoupon.setType(resCoup.getString(\"type\"));\n\t\t\t\tcoupon.setMessage(resCoup.getString(\"message\"));\n\t\t\t\tcoupon.setPrice(resCoup.getInt(\"price\"));\n\t\t\t\tcoupon.setImage(resCoup.getString(\"image\"));\n\t\t\t\t// Add resulting Coupon to the list\n\t\t\t\tcolCoup.add(coupon);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon retrieval from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupon list retrieve has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\n\t\t// Return resulted list of Coupons\n\t\treturn colCoup;\n\t}", "public java.util.List<hr.client.appuser.CouponCenter.AppCoupon> getCouponListList() {\n return couponList_;\n }", "public List<Map<String, Object>> getSubscriptionsDueForBilling();", "@Override\n @Cacheable(value=AccountingPeriod.CACHE_NAME, key=\"'{getOpenAccountingPeriods}'\")\n public Collection<AccountingPeriod> getOpenAccountingPeriods() {\n HashMap<String,Object> map = new HashMap<String,Object>();\n map.put(OLEConstants.ACCOUNTING_PERIOD_ACTIVE_INDICATOR_FIELD, Boolean.TRUE);\n\n return businessObjectService.findMatchingOrderBy(AccountingPeriod.class, map, OLEPropertyConstants.ACCTING_PERIOD_UNIV_FISCAL_PERIOD_END_DATE, true);\n }", "public java.lang.String couponCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).couponCurrency();\n\t}", "int getCouponListCount();", "java.util.List<? extends hr.client.appuser.CouponCenter.AppCouponOrBuilder> \n getCouponListOrBuilderList();", "public java.util.List<org.drip.analytics.cashflow.CompositePeriod> periods()\n\t{\n\t\treturn _lsPeriod;\n\t}", "public Collection<Coupon> getCompanyCoupons() {\n return couponRepo.findCouponsByCompanyID(this.companyID);\n }", "private Periodo getPeriodoCorte() {\n String valor = parametrosDao.obtenerTodosParametros().get(\"integrador.periodo.arranque\");\r\n\r\n return Periodo.parse(valor, \"yyyyMM\");\r\n }", "@Override\n\tpublic List<BeanCoupon> loadAllSystemCoupons() throws BaseException {\n\t\tList< BeanCoupon > result=new ArrayList<BeanCoupon>();\n\t\t\n\t\tConnection conn=null;\n\t\ttry {\n\t\t\tconn=DBUtil.getConnection();\n\t\t\tString sql=\"select * from coupon where coupon_end_time > now()\";\n\t\t\tjava.sql.PreparedStatement pst=conn.prepareStatement(sql);\n\t\t\tjava.sql.ResultSet rs=pst.executeQuery();\n\t\t\twhile(rs.next()) {\n\t\t\t\tBeanCoupon cp=new BeanCoupon();\n\t\t\t\tcp.setCoupon_id(rs.getString(1));\n\t\t\t\tcp.setCoupon_content(rs.getString(2));\n\t\t\t\tcp.setCoupon_fit_money(rs.getFloat(3));\n\t\t\t\tcp.setCoupon_price(rs.getFloat(4));\n\t\t\t\tcp.setCoupon_start_time(rs.getTimestamp(5));\n\t\t\t\tcp.setCoupon_end_time(rs.getTimestamp(6));\n\t\t\t\tresult.add(cp);\n\t\t\t}\n\t\t\t\n\t\t\treturn result;\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new DbException(e);\n\t\t}\n\t\tfinally{\n\t\t\tif(conn!=null)\n\t\t\t\ttry {\n\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t}\n\t\t\t\t\n\t}", "@Override\n\t/**\n\t * Returns all Coupons with end date up to value method received as an array\n\t * list sorted descended\n\t */\n\tpublic Collection<Coupon> getCouponsByDate(Date date, int compID) throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\t\t// Create list object to fill it later with Coupons\n\t\tCollection<Coupon> colCoup = new ArrayList<>();\n\n\t\ttry {\n\t\t\t// Defining SQL string to retrieve Coupons via prepared statement\n\t\t\tString getCouponsByEndDateSQL = \"select * from coupon where end_date < ? and id in(select couponid from compcoupon where companyid = ?) order by end_date desc\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(getCouponsByEndDateSQL);\n\t\t\t// Set date variable that method received into prepared statement\n\t\t\tpstmt.setDate(1, getSqlDate(date));\n\t\t\tpstmt.setInt(2, compID);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute manipulations\n\t\t\tResultSet resCoup = pstmt.executeQuery();\n\t\t\t// While there is result line in resCoup do lines below\n\t\t\twhile (resCoup.next()) {\n\t\t\t\t// Creating Coupon object to fill it later with data from SQL\n\t\t\t\t// query result and for method to add it to the list and return\n\t\t\t\t// it afterwards\n\t\t\t\tCoupon coupon = new Coupon();\n\t\t\t\t// Set Coupon attributes according to the results in the\n\t\t\t\t// ResultSet\n\t\t\t\tcoupon.setId(resCoup.getInt(\"id\"));\n\t\t\t\tcoupon.setTitle(resCoup.getString(\"title\"));\n\t\t\t\tcoupon.setStart_date(resCoup.getDate(\"start_date\"));\n\t\t\t\tcoupon.setEnd_date(resCoup.getDate(\"end_date\"));\n\t\t\t\tcoupon.setExpired(resCoup.getString(\"expired\"));\n\t\t\t\tcoupon.setType(resCoup.getString(\"type\"));\n\t\t\t\tcoupon.setMessage(resCoup.getString(\"message\"));\n\t\t\t\tcoupon.setPrice(resCoup.getInt(\"price\"));\n\t\t\t\tcoupon.setImage(resCoup.getString(\"image\"));\n\t\t\t\t// Add resulting Coupon to the list\n\t\t\t\tcolCoup.add(coupon);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon retrieval from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupon list retrieve has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\n\t\t// Return resulted list of Coupons\n\t\treturn colCoup;\n\t}", "public java.util.List<hr.client.appuser.CouponCenter.AppCoupon> getCouponListList() {\n if (couponListBuilder_ == null) {\n return java.util.Collections.unmodifiableList(couponList_);\n } else {\n return couponListBuilder_.getMessageList();\n }\n }", "public Collection<Coupon> getCouponByDate(Date date) throws DbException;", "public DaysAdjustment getExCouponPeriod() {\n return exCouponPeriod;\n }", "List<Coupon> findByOrderByStartDateDesc();", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Maps the coupon value to a key-value list of that coupons attributes.\")\n\n public Object getCoupons() {\n return coupons;\n }", "public Collection<Coupon> getAllPurchasedCoupons() {\r\n\t\treturn db.getCustomer(cust).getCouponHistory();\r\n\t}", "java.util.List<hr.client.appuser.CouponCenter.StreamCouponHistory> \n getStreamCouponHistoryListList();", "@Override\n\t/** Returns all Coupons of selected type as an array list */\n\tpublic Collection<Coupon> getCouponsByType(String coupType, int compID) throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\t\t// Create list object to fill it later with Coupons\n\t\tCollection<Coupon> colCoup = new ArrayList<>();\n\n\t\ttry {\n\t\t\t// Defining SQL string to retrieve Coupons via prepared statement\n\t\t\tString getCouponsByTypeSQL = \"select * from coupon where type = ? and id in(select couponid from compcoupon where companyid = ?)\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(getCouponsByTypeSQL);\n\t\t\t// Set Coupon object type to coupType variable that method received\n\t\t\tpstmt.setString(1, coupType);\n\t\t\tpstmt.setInt(2, compID);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute manipulations\n\t\t\tResultSet resCoup = pstmt.executeQuery();\n\t\t\t// While there is result line in resCoup do lines below\n\t\t\twhile (resCoup.next()) {\n\t\t\t\t// Creating Coupon object to fill it later with data from SQL\n\t\t\t\t// query result and for method to add it to the list and return\n\t\t\t\t// it afterwards\n\t\t\t\tCoupon coupon = new Coupon();\n\t\t\t\t// Set Coupon attributes according to the results in the\n\t\t\t\t// ResultSet\n\t\t\t\tcoupon.setId(resCoup.getInt(\"id\"));\n\t\t\t\tcoupon.setTitle(resCoup.getString(\"title\"));\n\t\t\t\tcoupon.setStart_date(resCoup.getDate(\"start_date\"));\n\t\t\t\tcoupon.setEnd_date(resCoup.getDate(\"end_date\"));\n\t\t\t\tcoupon.setExpired(resCoup.getString(\"expired\"));\n\t\t\t\tcoupon.setType(resCoup.getString(\"type\"));\n\t\t\t\tcoupon.setMessage(resCoup.getString(\"message\"));\n\t\t\t\tcoupon.setPrice(resCoup.getInt(\"price\"));\n\t\t\t\tcoupon.setImage(resCoup.getString(\"image\"));\n\t\t\t\t// Add resulting Coupon to the list\n\t\t\t\tcolCoup.add(coupon);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon retrieval from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupon list retrieve has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\n\t\t// Return resulted list of Coupons\n\t\treturn colCoup;\n\t}", "@Override\n\tpublic List<BeanCoupon> loadAllUserCoupons(BeanUser u) throws BaseException {\n\t\tList< BeanCoupon > result=new ArrayList<BeanCoupon>();\n\t\t\n\t\tConnection conn=null;\n\t\ttry {\n\t\t\n\t\t\tconn=DBUtil.getConnection();\n\t\t\tString sql=\"SELECT * FROM coupon WHERE coupon_id in\"\n\t\t\t\t\t+ \"(SELECT coupon_id FROM user_coupon WHERE user_id=?) \"\n\t\t\t\t\t+ \"and coupon_end_time > now()\";\n\t\t\tjava.sql.PreparedStatement pst=conn.prepareStatement(sql);\n\t\t\tpst.setString(1, u.getUser_id());\n\t\t\tjava.sql.ResultSet rs=pst.executeQuery();\n\t\t\t\n\t\t\twhile(rs.next()) {\n\t\t\t\tBeanCoupon cp=new BeanCoupon();\n\t\t\t\tcp.setCoupon_id(rs.getString(1));\n\t\t\t\tcp.setCoupon_content(rs.getString(2));\n\t\t\t\tcp.setCoupon_fit_money(rs.getFloat(3));\n\t\t\t\tcp.setCoupon_price(rs.getFloat(4));\n\t\t\t\tcp.setCoupon_start_time(rs.getTimestamp(5));\n\t\t\t\tcp.setCoupon_end_time(rs.getTimestamp(6));\n\t\t\t\tresult.add(cp);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new DbException(e);\n\t\t}\n\t\tfinally{\n\t\t\tif(conn!=null)\n\t\t\t\ttry {\n\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t}\n\t\treturn result;\t\n\t}", "public ArrayList<Coupon> getCompanyCoupons() throws SQLException {\r\n\t\tArrayList<Coupon> coupons = couponsDAO.getAllCoupons();\r\n\t\tArrayList<Coupon> coups = new ArrayList<>();\r\n\t\tfor (Coupon coupon : coupons) {\r\n\t\t\tif (companyID == coupon.getCompanyID())\r\n\t\t\t\tcoups.add(coupon);\r\n\t\t}\r\n\t\treturn coups;\r\n\t}", "int getPeriod();", "public final ArrayList<ProductCoupon> getCouponList() {\n return (ArrayList) this.couponList$delegate.getValue();\n }", "@Transactional(readOnly = true) \n public List<PtoPeriodDTO> findAll() {\n log.debug(\"Request to get all PtoPeriods\");\n List<PtoPeriodDTO> result = ptoPeriodRepository.findAll().stream()\n .map(ptoPeriodMapper::ptoPeriodToPtoPeriodDTO)\n .collect(Collectors.toCollection(LinkedList::new));\n\n if(result.isEmpty()){\n \tresult.add(initialPtoPeriod());\n }\n \n return result;\n }", "public Collection<Coupon> getCouponByType(CouponType type) throws DbException;", "public Collection<Coupon> getAllCoupon() throws DbException;", "public int getPeriod() {\n return period;\n }", "public int getCouponListCount() {\n return couponList_.size();\n }", "@WebMethod public Coupon getCoupon(String coupon);", "public List<CXPFactura> buscarFacturas(Periodo p) {\r\n\t\treturn getFacturaDao().buscarFacturas(p);\r\n\t}", "public hr.client.appuser.CouponCenter.AppCoupon getCouponList(int index) {\n if (couponListBuilder_ == null) {\n return couponList_.get(index);\n } else {\n return couponListBuilder_.getMessage(index);\n }\n }", "double getPeriod();", "@Override\n\t/**\n\t * Returns all Coupons with price less than value method received as an\n\t * array list sorted descended\n\t */\n\tpublic Collection<Coupon> getCouponsByPrice(int price, int compID) throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\t\t// Create list object to fill it later with Coupons\n\t\tCollection<Coupon> colCoup = new ArrayList<>();\n\n\t\ttry {\n\t\t\t// Defining SQL string to retrieve Coupons via prepared statement\n\n\t\t\tString getCouponsByPriceSQL = \"select * from coupon where price < ? and id in(select couponid from compcoupon where companyid = ?) order by price desc\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(getCouponsByPriceSQL);\n\t\t\t// Set price variable that method received into prepared statement\n\t\t\tpstmt.setInt(1, price);\n\t\t\tpstmt.setInt(2, compID);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute manipulations\n\t\t\tResultSet resCoup = pstmt.executeQuery();\n\t\t\t// While there is result line in resCoup do lines below\n\t\t\twhile (resCoup.next()) {\n\t\t\t\t// Creating Coupon object to fill it later with data from SQL\n\t\t\t\t// query result and for method to add it to the list and return\n\t\t\t\t// it afterwards\n\t\t\t\tCoupon coupon = new Coupon();\n\t\t\t\t// Set Coupon attributes according to the results in the\n\t\t\t\t// ResultSet\n\t\t\t\tcoupon.setId(resCoup.getInt(\"id\"));\n\t\t\t\tcoupon.setTitle(resCoup.getString(\"title\"));\n\t\t\t\tcoupon.setStart_date(resCoup.getDate(\"start_date\"));\n\t\t\t\tcoupon.setEnd_date(resCoup.getDate(\"end_date\"));\n\t\t\t\tcoupon.setExpired(resCoup.getString(\"expired\"));\n\t\t\t\tcoupon.setType(resCoup.getString(\"type\"));\n\t\t\t\tcoupon.setMessage(resCoup.getString(\"message\"));\n\t\t\t\tcoupon.setPrice(resCoup.getInt(\"price\"));\n\t\t\t\tcoupon.setImage(resCoup.getString(\"image\"));\n\t\t\t\t// Add resulting Coupon to the list\n\t\t\t\tcolCoup.add(coupon);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon retrieval from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupon list retrieve has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\n\t\t// Return resulted list of Coupons\n\t\treturn colCoup;\n\t}", "public hr.client.appuser.CouponCenter.AppCoupon getCouponList(int index) {\n return couponList_.get(index);\n }", "public String getPeriod() {\n return this.period;\n }", "List<Coupon> findByCompanyId(int companyId);", "public String getPeriod() {\n return period;\n }", "public int getPeriod()\r\n\t{\r\n\t\treturn period;\r\n\t}", "public Period getPeriod() {\n return period;\n }", "public Map<String, List<TimePeriodModel>> getAllTimePeriods();", "java.util.List<hr.client.appuser.CouponCenter.ExchangeRecord> \n getExchangeHistoryListList();", "public java.util.List<hr.client.appuser.CouponCenter.AppCoupon.Builder> \n getCouponListBuilderList() {\n return getCouponListFieldBuilder().getBuilderList();\n }", "private void preenchePeriodo() {\n PeriodoDAO pDAO = new PeriodoDAO();\n for (int i = 0; i < pDAO.listar().size(); i++) {\n cbPeriodo.addItem(pDAO.listar().get(i).getDescricao());\n }\n }", "org.hl7.fhir.Period getAppliesPeriod();", "public java.util.List<? extends hr.client.appuser.CouponCenter.AppCouponOrBuilder> \n getCouponListOrBuilderList() {\n return couponList_;\n }", "public org.drip.analytics.date.JulianDate firstCouponDate()\n\t{\n\t\ttry {\n\t\t\treturn new org.drip.analytics.date.JulianDate (_lsPeriod.get (0).endDate());\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "List<SalesConciliation> getSalesConciliation(Company company, Date startDate, Date endDate) throws Exception;", "protected int getNumberOfPeriods()\n {\n return 2;\n }", "List<Company> getFollowing();", "@RequestMapping(path=\"/company/companyStockPrice\")\r\n\t\tpublic List<CompanyStockPrice> getCompanyStockPriceDetails(@RequestBody CompanyPeriodModel companyPeriod){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tList<CompanyStockPrice> companyStockPriceList = null;\r\n\t\t\tif(companyPeriod.getPeriodicity()>0) {\r\n\t\t\t\t LocalDate currentDate = LocalDate.now();\r\n\t\t\t\t companyPeriod.setPeriodToDate(Date.from(currentDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));\r\n\t\t\t\t companyPeriod.setPeriodFromDate(Date.from(currentDate.minusDays(companyPeriod.getPeriodicity()).atStartOfDay(ZoneId.systemDefault()).toInstant()));\t\r\n\t\t\t}\r\n\t\t\tif(companyPeriod.getCompanyList()!=null && companyPeriod.getPeriodFromDate()!=null && companyPeriod.getPeriodToDate()!=null) {\r\n\t\t\t\t\r\n\t\t\t\tcompanyStockPriceList = companyStockPriceService.getCompanyDetails(companyPeriod);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn companyStockPriceList;\r\n\t\t}", "int getStreamCouponHistoryListCount();", "public java.util.List<? extends hr.client.appuser.CouponCenter.AppCouponOrBuilder> \n getCouponListOrBuilderList() {\n if (couponListBuilder_ != null) {\n return couponListBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(couponList_);\n }\n }", "public org.drip.analytics.cashflow.CompositePeriod firstPeriod()\n\t{\n\t\treturn periods().get (0);\n\t}", "public List<String> getDistrictEntitlementPeriod() {\n\t\treturn stateEqualMasterDao.getElementValueList(\"DIST_ENTL_CALC_PERIOD\");\n\t}", "hr.client.appuser.CouponCenter.AppCouponOrBuilder getCouponListOrBuilder(\n int index);", "public List<GLJournalApprovalVO> getAllPeriod(String ClientId, String FromDate, String ToDate) {\n String sqlQuery = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n List<GLJournalApprovalVO> list = null;\n try {\n list = new ArrayList<GLJournalApprovalVO>();\n sqlQuery = \" SELECT c_period.c_period_id AS ID,to_char(c_period.startdate,'dd-MM-YYYY'),c_period.name,c_period.periodno FROM c_period WHERE \"\n + \" AD_CLIENT_ID IN (\" + ClientId\n + \") and c_period.startdate>=TO_DATE(?) and c_period.enddate<=TO_DATE(?) order by c_period.startdate \";\n st = conn.prepareStatement(sqlQuery);\n st.setString(1, FromDate);\n st.setString(2, ToDate);\n log4j.debug(\"period:\" + st.toString());\n rs = st.executeQuery();\n while (rs.next()) {\n GLJournalApprovalVO VO = new GLJournalApprovalVO();\n VO.setId(rs.getString(1));\n VO.setStartdate(rs.getString(2));\n VO.setName(rs.getString(3));\n VO.setPeriod(rs.getString(4));\n list.add(VO);\n\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return list;\n }", "public List<LookUpDetailJson> getPayCycleList() {\r\n\t\tList<LookUpDetailJson> lookUpDetailJsonList = null;\r\n\t\ttry {\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\tInteger currentMonth = cal.get(Calendar.MONTH);\r\n\t\t\tList<Integer> monthsRange = new ArrayList<Integer>();\r\n\t\t\tfor (int i = currentMonth, j = 0; j < 3; j++) {\r\n\t\t\t\tmonthsRange.add(i--);\r\n\t\t\t\tif (i < 0) {\r\n\t\t\t\t\ti = 11;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmonthsRange.add(currentMonth + 1);\r\n\r\n\t\t\tList<LookUpDetails> lookUpDetailList = lookUpRepository.getPayCycleList(monthsRange);\r\n\t\t\tif (lookUpDetailList != null && lookUpDetailList.size() > 0) {\r\n\t\t\t\tlookUpDetailJsonList = new ArrayList<LookUpDetailJson>();\r\n\t\t\t\tfor (LookUpDetails lookUpDetails : lookUpDetailList) {\r\n\t\t\t\t\tlookUpDetailJsonList.add(TransformDomainToJson.getLookUpDetailJson(lookUpDetails));\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\tLOG.error(\"Error at getPayCycleList() in LookUpService:\" + e.getMessage());\r\n\t\t}\r\n\t\treturn lookUpDetailJsonList;\r\n\t}", "List<Coupon> findByEndDateBefore(Date date);", "public int getCouponPerYear() {\n return _couponPerYear;\n }", "@Override\r\n\tpublic ArrayList<BankAccountPO> findBankAccountPOList() {\n\t\tArrayList<BankAccountPO> BankAccountList = new ArrayList<>();\r\n\t\tBankAccountList.add(new BankAccountPO(\"SS141250110\",200000));\r\n\t\treturn BankAccountList;\r\n\t}", "java.util.List<cosmos.base.v1beta1.CoinOuterClass.Coin> \n getFundsList();", "java.util.List<cosmos.base.v1beta1.CoinOuterClass.Coin> \n getFundsList();", "BigInteger getPeriod();", "public List<Integer> getSubscriptionIdsDueForBilling();", "public Long getPeriod() {\n return this.Period;\n }", "public List<Prescription> getPrescriptions(){\n return prescriptionRepository.findAll();\n }", "List<ServiceChargeSubscription> getSCPackageList() throws EOTException;", "public TimePeriod getPeriod();", "public int getChannelPeriod() {\n return channelPeriod;\n }", "public int getHowManyInPeriod();", "List<SimpleTransferVO> paymentVOs(Account account, Period period) throws DaoException;", "public java.lang.String couponDC()\n\t{\n\t\treturn _lsPeriod.get (0).periods().get (0).couponDC();\n\t}", "@Override\n\tpublic java.lang.String getNoticePeriod() {\n\t\treturn _candidate.getNoticePeriod();\n\t}", "List<Curso> obtenerCursos();", "public double getPeriod() {\n return period;\n }", "List<CurrencyDTO> getCurrencies();", "public ArrayList<poolLocation> getCouponList() {\n\n\t\tLoadingDatabasePoolLocation();\n\n\t\tArrayList<poolLocation> temp_CouponList = new ArrayList<poolLocation>();\n\t\t// remove coupons\n\t\tfor (poolLocation location : POOL_LIST) {\n\t\t\tif ((location.getTitle().equals(coupon1ID)\n\t\t\t\t\t|| location.getTitle().equals(coupon2ID) || location\n\t\t\t\t\t.getTitle().equals(coupon3ID))\n\t\t\t\t\t&& location.getIsCouponUsed() == true)\t\t\t\t\t\t// only show coupons which are bought from the mall\n\t\t\t\ttemp_CouponList.add(location);\n\t\t}\n\n\t\treturn temp_CouponList;\n\t\t// return POOL_LIST;\n\t}", "private String[] loadFechasPeriodoReferenciaInicial(){\n\t\t\n\t\tReporteRECReclaIncePendForm form = (ReporteRECReclaIncePendForm) this.formReporte;\n\t\tString [] resultado = new String[2];\n\t\tPais pais = this.mPantallaPrincipalBean.getCurrentCountry();\n\t\tAjaxService ajax = (AjaxService)getBean(\"ajaxService\");\n\t\tresultado[0]=ajax.getFechaInicioPeriodoByPaisMarcaCanal(pais.getCodigo(), Constants.TODAS,Constants.CODIGO_CANAL_DEFAULT, form.getCodigoPeriodoInicial());\n\t\tresultado[1]=ajax.getFechaFinalPeriodoByPaisMarcaCanal(pais.getCodigo(), Constants.TODAS,Constants.CODIGO_CANAL_DEFAULT, form.getCodigoPeriodoInicial());\t\t\n\t\t\n\t\treturn resultado;\n\t\t\n\t}", "public HashMap fetchIncrementPeriod(EmpCredit empCredit){\r\n\t\tHashMap periodMap = new HashMap();\r\n\t\ttry {\r\n\t\t\tString query = \"SELECT HRMS_PROMOTION.PROM_CODE, TO_CHAR(HRMS_PROMOTION.EFFECT_DATE,'MONTH-YYYY') AS PERIOD FROM HRMS_PROMOTION WHERE EMP_CODE=\"\r\n\t\t\t\t+empCredit.getEmpId()+\" AND HRMS_PROMOTION.LOCK_FLAG='Y' ORDER BY HRMS_PROMOTION.PROM_CODE DESC\" ;\r\n\t\t\tObject[][] incPeriodObj = getSqlModel().getSingleResult(query);\r\n\t\t\t\r\n\t\t\tif(incPeriodObj!=null && incPeriodObj.length >0){\r\n\t\t\t\tfor (int i = 0; i < incPeriodObj.length; i++) {\r\n\t\t\t\t\tperiodMap.put(String.valueOf(incPeriodObj[i][0]), String.valueOf(incPeriodObj[i][1]));\r\n\t\r\n\t\t\t\t}\r\n\t\t\tperiodMap = (HashMap<Object, Object>) org.paradyne.lib.Utility.sortMapByValue(periodMap, null, true);\r\n\t\t\t}else{\r\n\t\t\t\tperiodMap.put(\"N/A\",\"N/A\");\r\n\t\t\t}\r\n\t\t\tempCredit.setIncrementHistoryMap(periodMap);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn periodMap;\r\n\t}", "public java.util.List<com.google.analytics.data.v1beta.Cohort> getCohortsList() {\n if (cohortsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(cohorts_);\n } else {\n return cohortsBuilder_.getMessageList();\n }\n }", "public List getBeneficioDeudaList(Map criteria);", "java.util.List<cosmos.base.v1beta1.Coin> \n getTotalDepositList();", "@RequestMapping(value=\"/api/combocustomerinvoicepay\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic List<CustomerInvoiceDto> getDataCombox(){\n\t\treturn customerPayableService.getComboCPayInvoice();\n\t}", "int getCouponStat();", "@Override\n\tpublic ArrayList<Coupon> getCouponByType(Coupon.CouponType type, Company c) throws CouponSystemException {\n\t\tConnection con = cp.getConnection(); // Get the connection\n\n\t\tCoupon coup = new Coupon();\n\t\tArrayList<Coupon> couponList = new ArrayList<>();\n\t\ttry (Statement st = con.createStatement();\n\t\t\t\tResultSet rs = st.executeQuery(\n\t\t\t\t\t\t\"SELECT coupon.* from company_coupon right join coupon on company_coupon.coupon_id = coupon.id where company_coupon.comp_id=\"\n\t\t\t\t\t\t\t\t+ c.getId() + \"and type= '\" + type + \"'\")) {\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tcoup = new Coupon(rs.getString(2), rs.getDate(3), rs.getDate(4), rs.getInt(5),\n\t\t\t\t\t\tCoupon.CouponType.valueOf(rs.getString(6)), rs.getString(7), rs.getDouble(8), rs.getString(9));\n\t\t\t\tcoup.setId(rs.getLong(1));\n\t\t\t\tcouponList.add(coup);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tthrow new CouponSystemException(\"can not read the coupons\", e);\n\t\t} finally {\n\t\t\tcp.returnConnection(con); // return the connection to the Connection pool\n\t\t}\n\t\treturn couponList;\n\t}", "public List<GLJournalApprovalVO> getPeriod(String OrgId, String ClientId, String PeriodId) {\n String sqlQuery = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n List<GLJournalApprovalVO> list = null;\n try {\n list = new ArrayList<GLJournalApprovalVO>();\n sqlQuery = \" SELECT C_PERIOD_ID as id, ((CASE C_PERIOD.isActive WHEN 'N' THEN '**' ELSE '' END) || C_PERIOD.Name) as name FROM C_PERIOD \"\n + \" left join c_year yr on yr.c_year_id = C_PERIOD.c_year_id \"\n + \"\t WHERE C_PERIOD.AD_Org_ID IN (\" + OrgId + \") AND C_PERIOD.AD_Client_ID IN(\"\n + ClientId + \") AND (C_PERIOD.isActive = 'Y' OR C_PERIOD.C_PERIOD_ID = ? )\"\n + \" ORDER BY yr.year , periodno \";\n st = conn.prepareStatement(sqlQuery);\n st.setString(1, PeriodId);\n rs = st.executeQuery();\n while (rs.next()) {\n GLJournalApprovalVO VO = new GLJournalApprovalVO();\n VO.setPeriod(rs.getString(1));\n VO.setPeriodName(rs.getString(2));\n list.add(VO);\n\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n return list;\n }\n return list;\n }", "List getCompanies(OwnCodes ownCodes) throws PopulateDataException;", "public ArrayList<Concert> getConcertList(){\n return concertList;\n }", "public ArrayList<Coupon> getCustomerCoupons() throws Exception {\n\n\t\treturn customersDBDAO.getAllCustomerCoupons(this.getCustomerId());\n\n\t}", "List<Company> getCompanyList() throws DAOException ;", "public ArrayList<Coupon> getCompanyCoupons(Category category) throws SQLException {\r\n\t\tArrayList<Coupon> coupons = couponsDAO.getAllCoupons();\r\n\t\tArrayList<Coupon> coups = new ArrayList<>();\r\n\t\tfor (Coupon coupon : coupons) {\r\n\t\t\tif (companyID == coupon.getCompanyID())\r\n\t\t\t\tif (coupon.getCategory().equals(category))\r\n\t\t\t\t\tcoups.add(coupon);\r\n\t\t}\r\n\t\treturn coups;\r\n\t}", "hr.client.appuser.CouponCenter.StreamCouponHistory getStreamCouponHistoryList(int index);", "@Override\n\tpublic HashSet<Coupon> getAllCoupon() throws ClassNotFoundException, SQLException, ParseException {\n\t\tConnection connection = ConnectionPool.getInstance().getConnection();\n\t\tHashSet<Coupon> collectionCoupon = new HashSet<Coupon>();\n\t\tPreparedStatement statement = connection.prepareStatement(SQLQueryRequest.GET_ALL_COUPON_ID);\n\t\tResultSet resultSet = statement.executeQuery();\n\t\twhile (resultSet.next()) {\n\t\t\tcollectionCoupon.add(getCoupon(resultSet.getLong(1)));\n\t\t}\n\t\tConnectionPool.getInstance().returnConnection(connection);\n\t\treturn collectionCoupon;\n\t}" ]
[ "0.68862456", "0.6355341", "0.6323599", "0.6240389", "0.6123474", "0.608212", "0.6067371", "0.6031185", "0.6003095", "0.5980912", "0.591051", "0.59034914", "0.5888625", "0.584319", "0.5817953", "0.5807437", "0.58058256", "0.5800955", "0.5786275", "0.57850385", "0.57683027", "0.5763561", "0.5734024", "0.572281", "0.5714099", "0.56727606", "0.56416976", "0.5636947", "0.5580809", "0.5577215", "0.5556541", "0.55455154", "0.5541989", "0.5505231", "0.550128", "0.5500503", "0.5500344", "0.5494836", "0.5485409", "0.5482809", "0.5471191", "0.54482776", "0.54412603", "0.5438693", "0.5419493", "0.54161763", "0.54118747", "0.5407088", "0.53989655", "0.53880036", "0.53818786", "0.5374923", "0.5351101", "0.534858", "0.53379744", "0.5330601", "0.53231114", "0.53120077", "0.5300645", "0.52805585", "0.5266695", "0.5265279", "0.52475166", "0.5245692", "0.5234557", "0.523245", "0.522845", "0.5218095", "0.5218095", "0.51939017", "0.51918775", "0.5186636", "0.5180726", "0.5178611", "0.51605177", "0.5151315", "0.51498705", "0.5140911", "0.5136297", "0.5127213", "0.51259696", "0.51186746", "0.5118559", "0.51022214", "0.5088321", "0.5086979", "0.5086543", "0.50852674", "0.5084901", "0.50745744", "0.50686187", "0.5059261", "0.50549924", "0.5049597", "0.5046977", "0.5042415", "0.5024437", "0.5022187", "0.50159574", "0.501037" ]
0.6117422
5
Retrieve the Period Instance enveloping the specified Date
public org.drip.analytics.cashflow.CompositePeriod containingPeriod ( final int iDate) { try { for (org.drip.analytics.cashflow.CompositePeriod cp : _lsPeriod) { if (cp.contains (iDate)) return cp; } } catch (java.lang.Exception e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n @Cacheable(value=AccountingPeriod.CACHE_NAME, key=\"'date='+#p0\")\n public AccountingPeriod getByDate(Date date) {\n Map<String,Object> primaryKeys = new HashMap<String, Object>();\n primaryKeys.put(OLEPropertyConstants.UNIVERSITY_DATE, date);\n UniversityDate universityDate = businessObjectService.findByPrimaryKey(UniversityDate.class, primaryKeys);\n primaryKeys.clear();\n primaryKeys.put(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, universityDate.getUniversityFiscalYear());\n primaryKeys.put(OLEPropertyConstants.UNIVERSITY_FISCAL_PERIOD_CODE, universityDate.getUniversityFiscalAccountingPeriod());\n return businessObjectService.findByPrimaryKey(AccountingPeriod.class, primaryKeys);\n }", "void getCurrentPeriodo();", "abstract public Date getServiceAppointment();", "public interface Period {\n\n\tDate getStart();\n\n\tDate getEnd();\n}", "public TimePeriod getPeriod();", "private Periodo getPeriodoCorte() {\n String valor = parametrosDao.obtenerTodosParametros().get(\"integrador.periodo.arranque\");\r\n\r\n return Periodo.parse(valor, \"yyyyMM\");\r\n }", "org.hl7.fhir.Period getAppliesPeriod();", "public static void testPeriod() {\n LocalDate date1 = LocalDate.now();\n System.out.println(\"Current date: \" + date1);\n\n //add 1 month to the current date\n LocalDate date2 = date1.plus(1, ChronoUnit.MONTHS);\n System.out.println(\"Next month: \" + date2);\n\n Period period = Period.between(date2, date1);\n System.out.println(\"Period: \" + period);\n }", "public void period() {\n\t\tPeriod annually = Period.ofYears(1);\n\t\tPeriod quarterly = Period.ofMonths(3);\n\t\tPeriod everyThreeWeeks = Period.ofWeeks(3);\n\t\tPeriod everyOtherDay = Period.ofDays(2);\n\t\tPeriod everyYearAndAWeek = Period.of(1, 0, 7);\n\t\tLocalDate date = LocalDate.of(2014, Month.JANUARY, 20);\n\t\tdate = date.plus(annually);\n\t\tSystem.out.println(date);\n\t\tSystem.out.println(Period.of(0, 20, 47)); // P20M47D\n\t\tSystem.out.println(Period.of(2, 20, 47)); // P2Y20M47D\n\t}", "double getPeriod();", "public Period getPeriod() {\n return period;\n }", "public Period getNextPeriod() throws PeriodNotFoundException;", "int getPeriod();", "Date getForDate();", "Date getInvoicedDate();", "public org.drip.analytics.cashflow.CompositePeriod firstPeriod()\n\t{\n\t\treturn periods().get (0);\n\t}", "List<Book> getBooksFromPeriod(LocalDate from,LocalDate to);", "public interface IFlexiblePeriod <DATATYPE> extends IPeriodProvider, IHasStartAndEnd <DATATYPE>, Serializable\r\n{\r\n /**\r\n * Check if this object is valid for this specific date.\r\n * \r\n * @param aDate\r\n * The date to be checked. May not be <code>null</code>.\r\n * @return <code>true</code> if this object is valid for this date,\r\n * <code>false</code> otherwise.\r\n */\r\n boolean isValidFor (@Nonnull DATATYPE aDate);\r\n\r\n /**\r\n * This is a shortcut method for checking the validity of the object for the\r\n * current date and time.\r\n * \r\n * @return <code>true</code> if this object is valid for the current date,\r\n * <code>false</code> otherwise.\r\n */\r\n boolean isValidForNow ();\r\n}", "public Period onsetPeriod() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_ONSET_PERIOD);\n }", "public org.hl7.fhir.Period getPeriod()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Period target = null;\n target = (org.hl7.fhir.Period)get_store().find_element_user(PERIOD$2, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "org.hl7.fhir.Period addNewAppliesPeriod();", "public int getPeriod() {\n return period;\n }", "public int getPeriod()\r\n\t{\r\n\t\treturn period;\r\n\t}", "public Date getStartDate();", "public Date getStartDate();", "public int periodIndex (\n\t\tfinal int iDate)\n\t\tthrows java.lang.Exception\n\t{\n\t\tint i = 0;\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : periods()) {\n\t\t\tif (period.contains (iDate)) return i;\n\n\t\t\t++i;\n\t\t}\n\n\t\tthrow new java.lang.Exception (\"BondStream::periodIndex => Input date not in the period set range!\");\n\t}", "ValuationDate getValuationDate();", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "Date getStartDate();", "Date getStartDate();", "Date getStartDate();", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public org.drip.analytics.date.JulianDate effective()\n\t{\n\t\ttry {\n\t\t\treturn new org.drip.analytics.date.JulianDate (_lsPeriod.get (0).startDate());\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "public org.hl7.fhir.Period addNewPeriod()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Period target = null;\n target = (org.hl7.fhir.Period)get_store().add_element_user(PERIOD$2);\n return target;\n }\n }", "LocalDate getDate();", "public void GetAvailableDates()\n\t{\n\t\topenDates = new ArrayList<TimePeriod>(); \n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\t\n\t\t\tString query = \"SELECT startDate, endDate FROM Available WHERE available_hid = '\"+hid+\"'\"; \n\t\t\tResultSet rs = con.stmt.executeQuery(query);\n\t\t\t\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tTimePeriod tp = new TimePeriod(); \n\t\t\t\ttp.stringStart = rs.getString(\"startDate\"); \n\t\t\t\ttp.stringEnd = rs.getString(\"endDate\"); \n\t\t\t\ttp.StringToDate();\n\t\t\t\t\n\t\t\t\topenDates.add(tp); \n\t\t\t}\n\t\t\tcon.closeConnection(); \n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public List<Period> getPeriods() throws PeriodNotFoundException;", "com.google.type.Date getAcquireDate();", "public org.drip.analytics.cashflow.CompositePeriod period (\n\t\tfinal int iIndex)\n\t{\n\t\ttry {\n\t\t\treturn periods().get (iIndex);\n\t\t} catch (java.lang.Exception e) {\n\t\t}\n\n\t\treturn null;\n\t}", "public double getPeriod() {\n return period;\n }", "public LocalDate getStartDate() { return this.startDate; }", "BigInteger getPeriod();", "@Override\n public AccountingPeriod getByStringDate(String dateString) {\n AccountingPeriod acctPeriod;\n try {\n acctPeriod = getByDate(dateTimeService.convertToSqlDate(dateString));\n }\n catch (Exception pe) {\n LOG.error(\"AccountingPeriod getByStringDate unable to convert string \" + dateString + \" into date.\", pe);\n throw new RuntimeException(\"AccountingPeriod getByStringDate unable to convert string \" + dateString + \" into date.\", pe);\n }\n return acctPeriod;\n }", "public String getCurrentPeriod(VariablesSecureApp vars, String OrgId, String ClientId) {\n String CurrentPeriodId = \"\";\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n try {\n conn = OBDal.getInstance().getConnection();\n ps = conn.prepareStatement(\n \"select c_period_id from c_period where to_date(to_char(now(),'dd-MM-yyyy'),'dd-MM-yyyy') between to_date(to_char(startdate,'dd-MM-yyyy'),'dd-MM-yyyy') and to_date(to_char(enddate,'dd-MM-yyyy'),'dd-MM-yyyy') and ad_org_id in(\"\n + OrgId + \") and ad_client_id in(\" + ClientId + \")\");\n rs = ps.executeQuery();\n if (rs.next()) {\n CurrentPeriodId = rs.getString(\"c_period_id\");\n }\n } catch (Exception e) {\n }\n return CurrentPeriodId;\n }", "org.hl7.fhir.Period addNewValuePeriod();", "public static Reservation[] getFromPeriod(Period period) {\r\n \t\t// Set the condition\r\n\t\tString condition = \"period.startTime >= \" + period.start.getTime() + \r\n \t\t\t\t\t \t\t\" AND period.endTime <= \" + period.end.getTime();\r\n \t\t\r\n \t\t// Execute the query\r\n \t\tResultSet result = model.get(\"reservation\", condition, \"period\", \"reservation.period\", \"period.id\");\r\n \r\n \t\t// Examine if the result has any content\r\n \t\tif (getFirstRowInResultSet(result)) {\r\n \t\t\t// Retrieve the results\r\n \t\t\ttry {\r\n \t\t\t\tresult.last();\r\n \t\t\t\tReservation[] arr = new Reservation[result.getRow()];\r\n \t\t\t\tresult.beforeFirst();\r\n \t\t\t\twhile (result.next()) {\r\n \t\t\t\t\tint id \t\t\t = result.getInt(1);\r\n \t\t\t\t\tSystem.out.println(result.getString(\"startTime\"));\r\n \t\t\t\t\t//arr[result.getRow() - 1] = new Reservation(id, customer, period, vehicle);\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\t// Return\r\n \t\t\t\treturn arr;\r\n \t\t\t} catch (SQLException e) {\r\n \t\t\t\tLog.error(\"Unable to retrieve data from result: \" + e);\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tLog.info(\"Query for Reservation with condition returned empty.\");\r\n \t\t}\r\n \t\t\r\n \t\t// Return failure.\r\n \t\treturn null;\r\n \t}", "public List<GLJournalApprovalVO> getAllPeriod(String ClientId, String FromDate, String ToDate) {\n String sqlQuery = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n List<GLJournalApprovalVO> list = null;\n try {\n list = new ArrayList<GLJournalApprovalVO>();\n sqlQuery = \" SELECT c_period.c_period_id AS ID,to_char(c_period.startdate,'dd-MM-YYYY'),c_period.name,c_period.periodno FROM c_period WHERE \"\n + \" AD_CLIENT_ID IN (\" + ClientId\n + \") and c_period.startdate>=TO_DATE(?) and c_period.enddate<=TO_DATE(?) order by c_period.startdate \";\n st = conn.prepareStatement(sqlQuery);\n st.setString(1, FromDate);\n st.setString(2, ToDate);\n log4j.debug(\"period:\" + st.toString());\n rs = st.executeQuery();\n while (rs.next()) {\n GLJournalApprovalVO VO = new GLJournalApprovalVO();\n VO.setId(rs.getString(1));\n VO.setStartdate(rs.getString(2));\n VO.setName(rs.getString(3));\n VO.setPeriod(rs.getString(4));\n list.add(VO);\n\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return list;\n }", "public PeriodFactoryImpl() {\n\t\tsuper();\n\t}", "public Long getPeriod() {\n return this.Period;\n }", "org.hl7.fhir.Period getValuePeriod();", "public LocalDate getDate () {\n\t\treturn DateUtils.toLocalDate(this.start);\n\t}", "public void processDate(boolean periodStart) {\n Calendar cal = Calendar.getInstance();\n if (year == null) {\n year = cal.get(Calendar.YEAR);\n }\n if (week != null) {\n cal.set(Calendar.WEEK_OF_YEAR, week);\n cal.setFirstDayOfWeek(Calendar.MONDAY);\n cal.set(Calendar.DAY_OF_WEEK, (periodStart) ? Calendar.MONDAY : Calendar.SUNDAY);\n week = null;\n month = TimeConstants.MONTHS_EN.split(\",\")[cal.get(Calendar.MONTH)].toLowerCase();\n day = cal.get(Calendar.DAY_OF_MONTH);\n }\n if (season != null) {\n if (\"Spring\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 2 : 4);\n } else if (\"Summer\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 5 : 7);\n } else if (\"Autumn\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 8 : 10);\n } else if (\"Winter\".equalsIgnoreCase(season)) {\n cal.set(Calendar.MONTH, periodStart ? 11 : 1);\n }\n cal.set(Calendar.DAY_OF_MONTH, periodStart ? 1 : cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n month = TimeConstants.MONTHS_EN.split(\",\")[cal.get(Calendar.MONTH)].toLowerCase();\n day = cal.get(Calendar.DAY_OF_MONTH);\n season = null;\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null && day == 99) {\n cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n day = cal.get(Calendar.DAY_OF_MONTH);\n }\n if (day == null) {\n cal.set(Calendar.DAY_OF_MONTH, periodStart ? 1 : cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n day = cal.get(Calendar.DAY_OF_MONTH);\n }\n }", "public CHORE_INFO_PERIOD getPriod();", "public FranchisePayablePeriodVo getFranchisePayablePeriodByDateRange(FranchisePayableFilter filter) throws DaoException {\r\n return select(filter, \"FranchisePayablePeriod.selectByDateRange\");\r\n }", "public String getPeriod() {\n return period;\n }", "public abstract MarketDataBox<LocalDate> getValuationDate();", "List<Venta1> consultarVentaPorFecha(Date desde, Date hasta, Persona cliente) throws Exception;", "public String getPedStrDate(String OrgId, String ClientId, String fromPeriod) {\n String sqlQuery = \"\", startdate = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n try {\n sqlQuery = \" select startdate from c_period where C_PERIOD.AD_Org_ID IN(\" + OrgId\n + \") AND C_PERIOD.AD_Client_ID IN(\" + ClientId + \") and c_year_id =(\"\n + \" select c_year_id from c_period where c_period_id= ?) and periodno ='1' \";\n st = conn.prepareStatement(sqlQuery);\n st.setString(1, fromPeriod);\n rs = st.executeQuery();\n if (rs.next()) {\n startdate = rs.getString(\"startdate\");\n\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return startdate;\n }", "public String getPeriod() {\n return this.period;\n }", "public DayPeriod() {\n\t}", "@Override\n\tpublic String getFiscalPeriod(final String vDate, final Connection connection) throws TaskFailedException\n\t{\n\t\tString fiscalPeriodID = \"null\";\n\t\ttry\n\t\t{\n\t\t\tfinal String query = \"select id from fiscalperiod where ? between startingdate and endingdate\";\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(query);\n\t\t\tpst.setString(0, vDate);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\tfiscalPeriodID = element[0].toString();\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\">>>fiscalPeriodID \" + fiscalPeriodID);\n\t\t\t}\n\t\t\tif (rset == null || rset.size() == 0)\n\t\t\t\tthrow new TaskFailedException(\"fiscal Period Not Found\");\n\t\t} catch (final TaskFailedException e)\n\t\t{\n\t\t\tLOGGER.error(\"fiscal Period Not Found=\" + e.getMessage(), e);\n\t\t\tthrow new TaskFailedException(\"fiscal Period Not Found\");\n } /*\n * catch (final Exception e) {\n * LOGGER.error(\"failed to get fiscalperiodId \" + e.toString(), e);\n * throw new Exception(e.toString()); }\n */\n\t\treturn fiscalPeriodID;\n\t}", "public LocalDate getStart_date(){\n return this.start_date;\n }", "public List<Reserva> getReservasPeriod(String dateOne, String dateTwo){\n /**\n * Instancia de SimpleDateFormat para dar formato correcto a fechas.\n */\n SimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd\");\n /**\n * Crear nuevos objetos Date para recibir fechas fomateadas.\n */\n Date dateOneFormatted = new Date();\n Date dateTwoFormatted = new Date();\n /**\n * Intentar convertir las fechas a objetos Date; mostrar registro de\n * la excepción si no se puede.\n */\n try {\n dateOneFormatted = parser.parse(dateOne);\n dateTwoFormatted = parser.parse(dateTwo);\n } catch (ParseException except) {\n except.printStackTrace();\n }\n /**\n * Si la fecha inicial es anterior a la fecha final, devuelve una lista\n * de Reservas creadas dentro del intervalo de fechas; si no, devuelve\n * un ArrayList vacío.\n */\n if (dateOneFormatted.before(dateTwoFormatted)){\n return repositorioReserva.findAllByStartDateAfterAndStartDateBefore\n (dateOneFormatted, dateTwoFormatted);\n } else {\n return new ArrayList<>();\n }\n }", "public LocalDate getBy() {\n return by;\n }", "Optional<ReportingPeriod> getCurrentReportingPeriod();", "public int getHowManyInPeriod();", "ArrayList<Course> findByDate(LocalDate date);", "private BillingPeriod getBillingPeriod() {\n\t\treturn (BillingPeriod) this.getBean();\n\t}", "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public Date getEarliestStartDate();", "Date getPriorDate();", "public Period getTenor() {\n return _index.getSwapTenor().getPeriod();\n }", "public static Finder<Long, Period> find() {\r\n\t\treturn new Finder<Long, Period>(Long.class, Period.class);\r\n\t}", "public List<Employee> findEmployeesForServiceByDate(LocalDate date) {\n DayOfWeek dayOfWeek = date.getDayOfWeek();\n\n List<Employee> employeeAvailable = new ArrayList<>();\n\n List<Employee> allEmployees = employeeRepository.findAll();\n for (Employee employee: allEmployees) {\n // Check if employee is available on given days and posses certain skills\n if(employee.getDaysAvailable().contains(dayOfWeek)) {\n employeeAvailable.add(employee);\n }\n }\n\n return employeeAvailable;\n }", "public String getStartDate();", "public Period toPeriod(PeriodType type) {\r\n return new Period(getStartMillis(), getEndMillis(), type, getChronology());\r\n }", "long getStartDate();", "public Date getStartDate()\r\n {\r\n return this.startDate;\r\n }", "@Query(\"SELECT id, measured_at FROM measurements WHERE measured_at >= :startDate AND measured_at < :endDate\")\n @TypeConverters({DateConverter.class})\n List<MeasurementEvent> findForPeriodTest(Date startDate, Date endDate);", "public Period bornPeriod() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_BORN_PERIOD);\n }", "List<Appointment> getCurrentlyAppointment();", "public java.sql.Date getDatepr() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((java.sql.Date) __getCache(\"datepr\")));\n }", "Date date(LocalDate date);", "DateConstant createDateConstant();", "@Updatable\n public Integer getPeriod() {\n return period;\n }", "public DTM getProductServiceEffectiveDate() { \r\n\t\tDTM retVal = this.getTypedField(10, 0);\r\n\t\treturn retVal;\r\n }", "public Date getEarliestFinishingDate();", "public List<Order> getOrdersByDate(Date date);", "@Override\r\n\tpublic CinemaCondition getByDate(Date date) {\n\t\tString hql = \"from cinema_condition cc where cc.date = ?\";\r\n\t\tQuery query = this.getCurrentSession().createQuery(hql);\r\n\t\tquery.setParameter(0, date);\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tList<CinemaCondition> cinemaConditions = query.list();\r\n\t\tif(cinemaConditions!=null&&!cinemaConditions.isEmpty()){\r\n\t\t\treturn cinemaConditions.get(0);\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public LocalDate getDate() {\n return date;\n }", "public Date getStart() throws ServiceLocalException {\n\t\treturn (Date) this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.Start);\n\t}", "public Date getStartDate() {\n return startDate;\n }", "public Date getStartDate() {\n return startDate;\n }", "public Date getStartDate() {\n return startDate;\n }", "@Override\n public Date getEffectiveDateForPerDiem(java.sql.Timestamp expenseDate) {\n if (getTripBegin() == null) {\n return new java.sql.Date(getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis());\n }\n return new java.sql.Date(getTripBegin().getTime());\n }", "public LocalDate getDate() {\n return date;\n }", "public LocalDate getDate() {\n return date;\n }" ]
[ "0.6004383", "0.59803575", "0.59118485", "0.5829884", "0.58049774", "0.57996535", "0.5787663", "0.57724804", "0.57394236", "0.573721", "0.56998646", "0.5665379", "0.5659187", "0.5597854", "0.55706847", "0.5539156", "0.5386135", "0.5383041", "0.5380427", "0.5306178", "0.5304627", "0.5303582", "0.52843297", "0.5282962", "0.5282962", "0.5280099", "0.5261337", "0.5243164", "0.5243164", "0.5243164", "0.5243164", "0.52172923", "0.52172923", "0.52172923", "0.5217186", "0.52162117", "0.52146024", "0.5180923", "0.51783556", "0.51758844", "0.5165954", "0.51618224", "0.5156627", "0.5150738", "0.51505435", "0.5149873", "0.5144087", "0.5143426", "0.5142593", "0.51364714", "0.51267105", "0.5124312", "0.51184976", "0.51060086", "0.5086466", "0.5065204", "0.5056094", "0.5051021", "0.5044703", "0.5039354", "0.50375694", "0.50285774", "0.501424", "0.5011701", "0.4996062", "0.49951345", "0.49482676", "0.49318752", "0.49284464", "0.49219203", "0.49186036", "0.49183056", "0.49154645", "0.49047607", "0.4900277", "0.48999274", "0.48978934", "0.48857328", "0.48843175", "0.48801363", "0.4879241", "0.487409", "0.48701757", "0.4864887", "0.48607638", "0.48569298", "0.48556796", "0.48524922", "0.48497576", "0.48494744", "0.48470417", "0.483312", "0.48298517", "0.48296627", "0.48249277", "0.48249277", "0.48249277", "0.48228627", "0.48133036", "0.48133036" ]
0.5689566
11
Retrieve the Initial Notional
public double initialNotional() { return _lsPeriod.get (0).baseNotional(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getNotional() {\n return _notional;\n }", "public long getInitial() {\n return m_Initial;\n }", "public Ndimensional getStartPoint();", "Pair<Integer, Integer> getInitialPosition();", "public BoundCodeDt<ImagingModalityEnum> getModalityFirstRep() {\n\t\tif (getModality().size() == 0) {\n\t\t\taddModality();\n\t\t}\n\t\treturn getModality().get(0);\n\t}", "public P getInitialPosition() {\n return mInitialPosition;\n }", "public P getInitialPosition() {\n return mInitialPosition;\n }", "public P getInitialPosition() {\n return mInitialPosition;\n }", "public Point getInitialPosition()\n {\n return this.initialPosition;\n }", "public double[] initial()\r\n\t{\r\n\t\treturn initial;\r\n\t}", "@Override\n\tpublic Position getInitialPosition() \n\t{\n\t\treturn initialPosition;\n\t}", "public String getInitialPosition() {\n\t\treturn initPos;\n\t}", "public String getMiddleInitial(){\r\n\t\treturn middleInitial;\r\n\t}", "public int[][] getInitialState() {\n\t\treturn this.copyState(this.initialState);\n\t}", "BeliefStateDimension getInitialBeliefState() \n {\n return _initial_belief; \n }", "public int getNorth() {\n return north;\n }", "public int getInitialValue()\n {\n return _init;\n }", "public Constraint getConstraintFirstRep() {\n\t\tif (getConstraint().isEmpty()) {\n\t\t\treturn addConstraint();\n\t\t}\n\t\treturn getConstraint().get(0); \n\t}", "public float getInitialPosition() {\n return initialPosition;\n }", "public Mapping getMappingFirstRep() {\n\t\tif (getMapping().isEmpty()) {\n\t\t\treturn addMapping();\n\t\t}\n\t\treturn getMapping().get(0); \n\t}", "public Position getInitialPixel() {\n\t\treturn initialPixel;\n\t}", "public String getMiddleInitial() {\r\n return middleInitial;\r\n }", "public Grid getEntrance(){\n\t\treturn getpos((byte)2);\n\t}", "public State getMiddleArcState()\n {\n return iconPartStates[1];\n }", "public Tile getInitTile() {\n return new Tile(initItem.type + \"-Init\", initItem.left, initItem.right,\n initItem.up, initItem.down, initItem.center, initItem.coatOfArms, initItem.separatedCities);\n }", "public MoveAddress nextVariationFirstState() {\n MoveAddress other = nextVariation(1);\n return other.firstChild(1, 0);\n }", "public BlockStmt\ngetInitiationPart();", "@Override\n public Shape[][] getInitialArray() {\n return allShapes;\n }", "public int[] getPlayerInitialPosition() \n\t{\n\t\treturn player_initial_position;\n\t}", "public GeoPointND getStartPoint();", "public double getInventoryInitialDepot (int j) {\n\t\t\treturn InventoryInitialDepot[j];\r\n\t\t}", "public EventNode getDummyInitialNode() {\n return dummyInitialNode;\n }", "public int getInitX(){\r\n\t\treturn initX;\r\n\t}", "public City getStartCity() {\n \treturn vertex1;\n }", "public Vector2 getInitLoc() { return initLoc; }", "private Pair<S, S>[] getFirstLastMappingArray() {\n Pair<S, S>[] pairs = new Pair[maxNonTerminal+1];\n Iterator<P> productions = slp.getOrderedProductions().descendingIterator();\n while(productions.hasNext()) {\n P production = productions.next();\n S left = production.getLeft();\n W right = production.getRight();\n\n Pair<S, S> pair = new Pair<>(right.findFirst(s -> true).get(), right.findLast(s -> true).get());\n S a = pair.a.isTerminal() ? pair.a : pairs[pair.a.getId()].a;\n S b = pair.b.isTerminal() ? pair.b : pairs[pair.b.getId()].b;\n\n pairs[left.getId()] = new Pair<>(a, b);\n }\n return pairs;\n }", "public PileupElement getFirst() { return PE1; }", "public Space nextUnsolved(){\n for (int i = 0; i < dimensions[0];i++){\n for (int j = 0; j<dimensions[1];j++){\n if (grids[i][j].labeled==false) return grids[i][j];\n }\n }\n return null;\n }", "public IdentifierDt getIdentifierFirstRep() {\n\t\tif (getIdentifier().isEmpty()) {\n\t\t\treturn addIdentifier();\n\t\t}\n\t\treturn getIdentifier().get(0); \n\t}", "void initial()\n\t{\n\t\tint i;\n\t\tfor(i=0;i<FoodNumber;i++)\n\t\t{\n\t\tinit(i);\n\t\t}\n\t\tGlobalMin=f[0];\n\t for(i=0;i<D;i++)\n\t GlobalParams[i]=Foods[0][i];\n\n\n\t}", "public BoundCodeDt<PropertyRepresentationEnum> getRepresentationFirstRep() {\n\t\tif (getRepresentation().size() == 0) {\n\t\t\taddRepresentation();\n\t\t}\n\t\treturn getRepresentation().get(0);\n\t}", "public NiveauCentreDTO getEntreprise(){\n\t\treturn getNomenclatureDomainService().getNiveauCentreFromLibelle(DonneesStatic.CG_ENTREPRISE);\n\t}", "@Override\n\tprotected String initial() {\n\t\treturn INITIAL;\n\t}", "public WorldCoordinate getBegin() {\r\n\t\treturn this.begin;\r\n\t}", "protected abstract int getInitialValue();", "@Nullable\n public SlideBound getInitialSlideBound() {\n if (mImpl.hasInitialSlideBound()) {\n return ModifiersBuilders.slideBoundFromProto(mImpl.getInitialSlideBound());\n } else {\n return null;\n }\n }", "public int getFirst() {\n return first;\n }", "private List<Integer> getInitialCorners() throws InvalidParametersException {\n\t\t// return getInitialCorners_SezginOversegment();\n\t\treturn getInitialCorners_ShortStrawOversegment();\n\t\t// return getInitialCorners_AllPoints();\n\t}", "public abstract Expression getInitialExpression();", "public T getFirst() {\n\treturn _front.getCargo();\n }", "@Override\r\n public MachineState getInitialState() {\r\n \tclearpropnet();\r\n \tpropNet.getInitProposition().setValue(true);\r\n\t\tMachineState initial = getStateFromBase();\r\n\t\treturn initial;\r\n }", "public QuestRoom getInitialRoom() {\n\t\t\n\t\treturn initialRoom;\n\t}", "private Nation determineNation() {\n String selectedNation = view.getNationsTabPane()\n .getSelectionModel()\n .getSelectedItem()\n .getText()\n .toUpperCase()\n .replace(\" \", \"_\");\n\n return Nation.valueOf(selectedNation);\n }", "public float getFirstNumber(){\n return firstNumber;\n }", "default DiscreteDoubleMap2D nonPositivePart() {\r\n\t\treturn pointWiseMinimum(ZERO);\r\n\t}", "private int[][] initialStateMatrix() {\n return new int[][]{{2,1,-1,3,0,-1},\n {2,-1,-1,3,-1,-1},\n {2,-1,5,4,8,-1},\n {4,-1,-1,-1,-1,-1},\n {4,-1,5,-1,8,-1},\n {7,6,-1,-1,-1,-1},\n {7,-1,-1,-1,-1,-1},\n {7,-1,-1,-1,8,-1},\n {-1,-1,-1,-1,8,-1}};\n }", "public int getInitialConfig() {\n if (initialConfig.equals(\"TOTALSUM\")) {\n return 2;\n }\n if (initialConfig.equals(\"PROBABILISTIC\")) {\n return 1;\n }\n if (initialConfig.equals(\"DETERMINISTIC\")) {\n return 0;\n }\n else {\n throw new IllegalArgumentException(\"Illegal way of generating grid\");\n }\n }", "@XmlElement(\"InitialGap\")\n Expression getInitialGap();", "@Override\n public Intersection getIntersectionNorth(){\n if(!mapLoaded){\n return null;\n }\n return extremIntersection[0];\n }", "public String getFirst(){\n return this.first;\n }", "public int[] reduceInit() {\n return null;\n }", "public Object getFirst() {\n if (first == null)\n return null;\n return first.getInfo();\n }", "public static int getOrigX() {\n return 1;\n }", "public int getConstituentIndex() {\n return this.constituentIndex;\n }", "public static LocNode intialState() {\n\n\t \n\t char[][] newMatrix =copyMatrix(matrix);\n\t \n\t \n\n\t \n\twhile(true) {\n\t\t\t\n\t\t\t\n\t\tint i=getRandomIndex(size);\n\t\tint j=getRandomIndex(size);\n\t\t\n\t if(newMatrix[i][j]=='-') {\n\t \t\n\t \n\t \t newMatrix[i][j]='c' ;\n\t \t \n\t \t \n\t \t updateVisibility(i, j, newMatrix);\n\t \t \n\t \t\n\t \t LocNode intialState= new LocNode(newMatrix, calculateOpjectiveFunction(newMatrix));\n\t \t \n\t \t\n\t \t return intialState;\n\t }\n\t \n\t }\n }", "public ILocation north()\n {\n Location north = new Location(x, y - 1);\n return north;\n }", "N getOrigin();", "public String getFirst(){ return this.first; }", "public int getEmptyX()\n\t{\n\t\treturn x0;\n\t}", "public Vector<Integer> getGiven() {\n\t\treturn null;\n\t}", "public float getInitialBattlePosition()\n {\n return initialBattlePosition;\n }", "public Vertice GetExtremoInicial(){\r\n return this.Vi;\r\n }", "public int getFirst() {\n\t\treturn first;\n\t}", "public InitialValElements getInitialValAccess() {\r\n\t\treturn pInitialVal;\r\n\t}", "@ApiModelProperty(value = \"When present, this field contains recipient's middle initial\")\n public String getRecipientMiddleInitial() {\n return recipientMiddleInitial;\n }", "public Vertice getvInicial() {\r\n return vInicial;\r\n }", "public Ellipse getHead() {\n return _noteHead;\n }", "boolean isIsInitial();", "public String getFirstAppointFlag() {\n return firstAppointFlag;\n }", "public E startState() {\r\n\t\treturn this.values[0];\r\n\t}", "@Override\n public Map<String, Float> getBasicNutrients() {\n return basicNutrients;\n }", "Object firstData() {\n\t\t// por defecto enviamos null\n\t\treturn null;\n\t}", "public int[] getInitialNodes() {\n return IntStream.range(0, links.length)\n .filter(i -> getPreviousNodes(i).length == 0)\n .toArray();\n }", "String getInitials();", "public double getPopulation () { return n.getPopulation(); }", "public double getNorth() {\n return north;\n }", "public short getInitial_y() {\n return initial_y;\n }", "public Integer getFirstGlobalAtt() {\r\n return firstGlobalAtt;\r\n }", "public Model getFirstPatchLocation()\n {\n return super.getFirstPatchLocation();\n }", "public char getInitial() {\n\t\treturn initial;\n\t}", "private CityByDegrees getStartingVertexCity() {\r\n\t\treturn this.startingVertexCity;\r\n\t}", "public WeightedPoint getStart()\n {\n return map.getStart();\n }", "@Override\n public Paint getInitialValue(Shape node) {\n return node.impl_cssGetFillInitialValue();\n }", "public RTWLocation firstN(int n);", "public static List<InitialUnit> dummyStartingPositions (Terrain terra) {\n List<InitialUnit> res = new ArrayList<InitialUnit>();\n for (int i = 0; i < terra.c; i++) {\n for (int j = 0; j < 2; j++) {\n int row = (1 - j) * (terra.r - 1);\n if (terra.terrainAt(row, i) != Terrain.Type.WATER) {\n Unit.Type x = (i%2 == 1 ? Unit.Type.WARRIOR : Unit.Type.ARCHER);\n res.add(new InitialUnit(j, x, new Position(row, i)));\n }\n }\n }\n return res;\n }", "public CompoundInfo getCompoundInfo() {\r\n\treturn formalCompound.getCompoundInfo();\r\n}", "public com.google.search.now.wire.feed.ResponseProto.Response getInitialResponse() {\n return instance.getInitialResponse();\n }", "@Override\n public int getStart() {\n return feature.getStart();\n }", "public void etatInitial(){\r\n\t\t\r\n\t\tfor(int i=0; i<plateau.length;i++){\r\n\t\t\tfor(int j =0; j< plateau[0].length; j++)\r\n\t\t\t{\r\n\t\t\t\tplateau[i][j] = \" \";\r\n\t\t\t}\r\n\t\t}\r\n\t\tplateau[3][3] = \" B \";\r\n\t\tplateau[3][4] = \" N \";\r\n\t\tplateau[4][4] = \" B \";\r\n\t\tplateau[4][3] = \" N \";\r\n\t\t\r\n\t}", "public Obstacle getConstructingObstacle();" ]
[ "0.62292373", "0.59172", "0.58784544", "0.5840878", "0.57342094", "0.57132715", "0.57132715", "0.57132715", "0.570266", "0.56852305", "0.56825584", "0.5658213", "0.5579737", "0.55752975", "0.5560742", "0.5548182", "0.5547017", "0.5449623", "0.5435342", "0.5429598", "0.5421516", "0.54045445", "0.5342344", "0.5314441", "0.5281966", "0.5273185", "0.52717197", "0.525463", "0.5239626", "0.5239144", "0.52330154", "0.5207806", "0.5205363", "0.5197661", "0.51945734", "0.51733965", "0.51645035", "0.5162149", "0.51593477", "0.5158666", "0.5158601", "0.51512975", "0.5131349", "0.51244354", "0.5122114", "0.51104736", "0.5106823", "0.5106353", "0.51045483", "0.50892454", "0.5089143", "0.50847995", "0.5073045", "0.5065607", "0.5056423", "0.5047159", "0.50419945", "0.5036832", "0.503538", "0.50339925", "0.5033569", "0.50287116", "0.5027308", "0.502468", "0.5020091", "0.501389", "0.5001164", "0.49938118", "0.49882364", "0.49851546", "0.49823177", "0.49822453", "0.4981802", "0.49654195", "0.49635497", "0.49630776", "0.49612808", "0.49577698", "0.49555096", "0.49335846", "0.49293706", "0.49277726", "0.49248615", "0.49237496", "0.49204177", "0.49191016", "0.49011314", "0.48989996", "0.48962656", "0.48956597", "0.4889778", "0.48888552", "0.488455", "0.48803195", "0.48783076", "0.48782617", "0.48780394", "0.48768768", "0.487575", "0.48755246" ]
0.70450777
0
Retrieve the Notional corresponding to the specified Date
public double notional ( final int iDate) throws java.lang.Exception { int iEffectiveDate = effective().julian(); int iAdjustedDate = iEffectiveDate > iDate ? iEffectiveDate : iDate; org.drip.analytics.cashflow.CompositePeriod cp = containingPeriod (iAdjustedDate); if (null == cp) throw new java.lang.Exception ("Stream::notional => Invalid Input"); return cp.notional (iAdjustedDate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double notional (\n\t\tfinal int iDate1,\n\t\tfinal int iDate2)\n\t\tthrows java.lang.Exception\n\t{\n\t\torg.drip.analytics.cashflow.CompositePeriod cp = containingPeriod (iDate1);\n\n\t\tif (null == cp || !cp.contains (iDate2))\n\t\t\tthrow new java.lang.Exception (\"Stream::notional => Invalid Inputs\");\n\n\t\torg.drip.quant.common.Array2D notlSchedule = cp.notionalSchedule();\n\n\t\treturn initialNotional() * (null == notlSchedule ? 1. : notlSchedule.y (iDate1, iDate2));\n\t}", "@Select(\"select datetime,currentConfirmedCount,confirmedCount,suspectedCount,curedCount,deadCount from covid19_1 where datetime = #{datetime}\")\n List<Map<String, Object>> getNationalData(String datetime);", "List<InsureUnitTrend> queryInsureDate();", "java.lang.String getFoundingDate();", "public DateInfo getDate() {\r\n\t\treturn new DateInfo(super.getDate());\r\n\t\t//return new DateInfo(maturityDate);\r\n\t}", "List<Map<String, Object>> getIngredients(String productCode, LocalDate date);", "Date getInvoicedDate();", "Date getDataIns();", "@GetMapping(value=\"/gps\", params=\"date\")\n @ResponseBody\n public List<GPSInfo> allFromDate(@RequestParam @DateTimeFormat(pattern = \"yyyy-MM-dd\") LocalDate date) {\n return repository.findByDate(date);\n }", "java.util.Calendar getNextrun();", "public DateInfo getDateInfo() {\n return dateInfo;\n }", "public Map<String, MonthDay> dataFeriadosNacionais(int ano);", "Pair<Date, Date> getForDatesFrame();", "HashMap<String, Double> getPortfolioData(String date);", "public List<Order> getOrdersByDate(Date date);", "public Date getDate(){\n\t\treturn day.date;\n\t}", "public List<NewsBaseInfo> getNewsListByDate(Date date) throws DataAccessException {\n return null;\n }", "@Override\r\n\tpublic Student[] getNearBirthDate(Date date, int days) {\n\t\treturn null;\r\n\t}", "public Date getNextrun() {\n return nextrun;\n }", "private MonthCellWithMonthIndex getMonthCellWithIndexByDate(Date date) {\n\t\tint index = 0;\n\t\tCalendar searchCal = Calendar.getInstance(locale);\n\t\tsearchCal.setTime(date);\n\t\tCalendar actCal = Calendar.getInstance(locale);\n\n\t\tfor (List<List<MonthCellDescriptor>> monthCells : cells) {\n\t\t\tfor (List<MonthCellDescriptor> weekCells : monthCells) {\n\t\t\t\tfor (MonthCellDescriptor actCell : weekCells) {\n\t\t\t\t\tactCal.setTime(actCell.getDate());\n\t\t\t\t\tif (sameDate(actCal, searchCal) && actCell.isSelectable()) {\n\t\t\t\t\t\treturn new MonthCellWithMonthIndex(actCell, index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn null;\n\t}", "private String getIndexDate(String criteriaMet, Map<String, List<Info>> criteria, boolean isAny) {\n\t\tSortedSet<String> date = new TreeSet<String>();\n\t\t\n\t\tString[] crit = criteriaMet.split(\":\");\n\t\tfor(int i=0; i<crit.length; i++) {\n\t\t\tList<Info> info = criteria.get(crit[i]);\n\t\t\tif(info==null) {\n\t\t\t\tSystem.out.println(crit[i] + \" has NO Info\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\t//info includes \"all\" related conditions until it satisfies the criteria\n\t\t\t//so the last element will be the earliest date that satisfies the criteria\n\t\t\tdate.add(info.get(info.size()-1).date);\n\t\t}\n\t\t\n\t\t//date is in order of earliest to latest \n\t\tif(isAny)\n\t\t\treturn date.first();\n\t\telse\n\t\t\treturn date.last();\n\t}", "@Query(\"SELECT d FROM Day d WHERE date = ?1\")\n List<Day> getByDate(Date date);", "public GregorianCalendar getDate() { return date; }", "public Date[] getDates() {\n/* 141 */ return getDateArray(\"date\");\n/* */ }", "@Override\n\tpublic List<InempDiscountPlanEntity> queryInempDiscountPlanEntity(\n\t\t\tDate recevieDate) {\n\t\treturn null;\n\t}", "public Timestamp getDateInvoiced();", "@Override\n public Date getDate() {\n return date;\n }", "@GET\n @Path(\"/{nom}/{date}\")\n @Produces(MediaType.APPLICATION_JSON)\n public EvenementDto getNomDate(@PathParam(\"nom\") String nom, @PathParam(\"date\") String date) {\n DataAccess dataAccess = DataAccess.begin();\n List<EvenementEntity> li = dataAccess.getEventByDate(date);\n dataAccess.closeConnection(true);\n return li.stream().filter(e -> e.getNom().equals(nom)).map(EvenementEntity::convertToDto).collect(Collectors.toList()).get(0);\n }", "public ObservableList<Date> getStudentDays(int studentID);", "public void setDateNaissance(Date dateNaissance)\n {\n this.dateNaissance = dateNaissance;\n }", "Date getForDate();", "@Override\r\n\tpublic CinemaCondition getByDate(Date date) {\n\t\tString hql = \"from cinema_condition cc where cc.date = ?\";\r\n\t\tQuery query = this.getCurrentSession().createQuery(hql);\r\n\t\tquery.setParameter(0, date);\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tList<CinemaCondition> cinemaConditions = query.list();\r\n\t\tif(cinemaConditions!=null&&!cinemaConditions.isEmpty()){\r\n\t\t\treturn cinemaConditions.get(0);\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Override\n\tpublic List<MyFoodDTO> findDate(String mf_date) {\n\t\treturn null;\n\t}", "public MainList getDetailForcast(String date) {\n\t\t\t\n\t\t\tMainList mainLists = new MainList();\n\t\t\tList<Forcast> forcasts = new ArrayList<>();\n\t\t\tList<Forcast> forcastLists = this.mainList.getListItem();\n\t\t\t\n\t\t\tSystem.out.println(\"date>> \"+date);\n\t\t\t\n\t\t\tforcasts = forcastLists.stream().filter(p -> (formatData(p.getDt_txt())).equals(formatData(date))).collect(Collectors.toList());\n\t\t\t\n\t\t\tmainLists.setListItem(forcasts);\n\t\t\tmainLists.setCity(this.mainList.getCity());\n\t\t\t\n\t\t\treturn mainLists;\n\t\t}", "@Override\n @Cacheable(value=AccountingPeriod.CACHE_NAME, key=\"'date='+#p0\")\n public AccountingPeriod getByDate(Date date) {\n Map<String,Object> primaryKeys = new HashMap<String, Object>();\n primaryKeys.put(OLEPropertyConstants.UNIVERSITY_DATE, date);\n UniversityDate universityDate = businessObjectService.findByPrimaryKey(UniversityDate.class, primaryKeys);\n primaryKeys.clear();\n primaryKeys.put(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, universityDate.getUniversityFiscalYear());\n primaryKeys.put(OLEPropertyConstants.UNIVERSITY_FISCAL_PERIOD_CODE, universityDate.getUniversityFiscalAccountingPeriod());\n return businessObjectService.findByPrimaryKey(AccountingPeriod.class, primaryKeys);\n }", "public Date getFechaInclusion()\r\n/* 150: */ {\r\n/* 151:170 */ return this.fechaInclusion;\r\n/* 152: */ }", "public List findRecordsFrom(String informationType, Date date) throws DatabaseException;", "Date getFechaNacimiento();", "public LocalDate getDate() {\n return date;\n }", "public Date getDtInclusao() {\n\t\treturn dtInclusao;\n\t}", "@Override\n public Set<Badminton> dateDetails(int personId, Date date) {\n /**\n * check the date is valid or not\n * start time will always less than end time and end time will always less than or equal to current time\n * date will always less than or equal to current date\n */\n validator.validDate(date);\n try {\n ResultSet resultSet = badmintonDao.dateDetails(personId,date);\n Set<Badminton> setDetails = new HashSet<Badminton>();\n\n /**\n * insert all details in set and return\n */\n while (resultSet.next()) {\n Timing timing = new Timing(resultSet.getTime(\"startTime\"), resultSet.getTime(\"endTime\"),\n resultSet.getDate(\"day\"));\n\n Badminton badminton = new Badminton(resultSet.getInt(\"badminton_id\"), resultSet.getInt(\"personid\"),\n timing, resultSet.getInt(\"numPlayers\"), resultSet.getString(\"result\"));\n\n setDetails.add(badminton);\n }\n return setDetails;\n }catch (SQLException e) {\n throw new ApplicationException(500,\"Sorry, some internal error comes in badminton service\");\n }\n }", "org.apache.xmlbeans.XmlString xgetFoundingDate();", "public Date getInstdte() {\r\n return instdte;\r\n }", "public PaypalIpn[] findWhereIpnDateEquals(Date ipnDate) throws PaypalIpnDaoException\r\n\t{\r\n\t\treturn findByDynamicSelect( SQL_SELECT + \" WHERE ipn_date = ? ORDER BY ipn_date\", new Object[] { ipnDate==null ? null : new java.sql.Timestamp( ipnDate.getTime() ) } );\r\n\t}", "public String getJP_AcctDate();", "org.apache.xmlbeans.XmlDateTime xgetNextrun();", "public Date getInDate() {\r\n return inDate;\r\n }", "public DateWrapper getDate() throws NoSuchElementException {\n return this.dateWrapper.get();\n }", "public Nation getNation() {\n return nation;\n }", "public DaySummary getSummaryForDay(String date){\n String[] values = date.split(\"-\");\n int day = Integer.parseInt(values[0]);\n int month = Integer.parseInt(values[1]);\n int year = Integer.parseInt(values[2]);\n\n LocalDateTime localDateTime1 = LocalDateTime.of(year,month,day,0,0);\n LocalDateTime localDateTime2 = LocalDateTime.of(year,month,day+1,0,0);\n\n Date date1 = Date.from( localDateTime1.atZone( ZoneId.systemDefault()).toInstant());\n Date date2 = Date.from( localDateTime2.atZone( ZoneId.systemDefault()).toInstant());\n return daySummaryRepository.findAllBySummaryDateBetween(date1, date2).get(0);\n }", "public Date getDate()\n {\n return date;\n }", "@Override\n public String toString() {\n return date.format(DateTimeFormatter.ofPattern(\"dd.MM.yyyy\")) + \" - \" + note;\n }", "public Date getFechaNacimiento()\r\n/* 133: */ {\r\n/* 134:242 */ return this.fechaNacimiento;\r\n/* 135: */ }", "@Override\n\tpublic ArrayList<IncomeBillPO> getIncomeByDateAndIns(String date, String institution) throws RemoteException {\n\t\treturn null;\n\t}", "public Date getDate() {\n return date;\n }", "public ArrayList<OverdueNotice> createOverdueNotices(){\n ArrayList<OverdueNotice> overdueList = new ArrayList<OverdueNotice>();\n Set<String> patronNames = this.patron.keySet();\n for (String patronName : patronNames){\n ArrayList<Book> books = this.patron.get(patronName).getBooks();\n for (Book book : books){\n if (book.getDueDate() == (this.calendar.getDate()-1)){\n overdueList.add(new OverdueNotice(this.patron.get(patronName),this.calendar.getDate()));\n break;\n }\n }\n }\n return overdueList;\n }", "public String showTasksOnDate(LocalDate date) {\n int count = 1;\n Optional<ArrayList<Timeable>> current = Optional.ofNullable(dateAndTimeables.get(date));\n if (current.isPresent()) {\n StringBuilder result = new StringBuilder(\"Here are the tasks on this date: \");\n for (Timeable d: current.get()) {\n result.append(\"\\n\").append(count++).append(\". \").append(d);\n }\n return result.toString();\n } else {\n return \"No tasks on this date!\";\n }\n }", "private String getStatusDay(LunarDate date) {\n if (Locale.SIMPLIFIED_CHINESE.equals(Locale.getDefault())\n || Locale.TRADITIONAL_CHINESE.equals(Locale.getDefault())) {\n if (date.holidayIdx != -1) {\n return RenderHelper.getStringFromList(R.array.holiday_array,\n date.holidayIdx);\n }\n if (date.termIdx != -1) {\n return RenderHelper.getStringFromList(R.array.term_array, date.termIdx);\n }\n }\n return getDay(date);\n }", "public LocalDate getDate() {\n return date;\n }", "public LocalDate getDate() {\n return date;\n }", "public int getIndex(Date theDate) {\n\t\tIterator<Entry<Date, Integer>> it = this.wordTrend.getTrends().entrySet().iterator();\n\t\tint n = 0;\n\n\t\twhile (it.hasNext()) {\n\t\t\tDate theCurrentDate = it.next().getKey();\n\t\t\tif (theDate.compareTo(theCurrentDate) == 0) {\n\t\t\t\treturn n;\n\t\t\t}\n\t\t\tn++;\n\t\t}\n\t\treturn -1;\n\t}", "Date NearestEvent(Date d);", "private String getIndexDate(String criteriaMet, Map<String, List<Info>> criteria) {\n\t\tSortedSet<String> date = new TreeSet<String>();\n\t\t\n\t\tString[] crit = criteriaMet.split(\":\");\n\t\tfor(int i=0; i<crit.length; i++) {\n\t\t\tList<Info> info = criteria.get(crit[i]);\n\t\t\tif(info==null) {\n\t\t\t\tSystem.out.println(crit[i] + \" has NO Info\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\t//info includes \"all\" related conditions until it satisfies the criteria\n\t\t\t//so the last element will be the earliest date \n\t\t\tdate.add(info.get(info.size()-1).date);\n\t\t}\n\t\t\n\t\t//date is in order of earliest to latest \n\t\treturn date.last();\n\t}", "public Record getCoverageContiguousEffectiveDate(Record record);", "@Override\r\n\tpublic List<Other> getOtherAll(String date) {\n\t\treturn othermapper.getOtherAll(date);\r\n\t}", "@JSProperty(\"currentDateIndicator\")\n @Nullable\n Unknown getCurrentDateIndicator();", "public LocalDateTime getDate() {\n return this.date;\n }", "public Date getDate()\n {\n return this.date;\n }", "public LocalDateTime getDate() {\n return date;\n }", "private XMLGregorianCalendar getDate(Value segment, Repository repository)\n {\n RepositoryConnection con = null;\n try\n {\n con = getRepositoryConnection(repository);\n \n String adaptorQuery = \"SELECT ?dateValue WHERE { <\" + segment + \"> <http://toif/contains> ?date . \"\n + \"?date <http://toif/date> ?dateValue . }\";\n \n TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery);\n \n TupleQueryResult queryResult = adaptorTupleQuery.evaluate();\n \n while (queryResult.hasNext())\n {\n BindingSet adaptorSet = queryResult.next();\n Value dateValue = adaptorSet.getValue(\"dateValue\");\n \n try\n {\n GregorianCalendar gregorianCalendar = new GregorianCalendar();\n \n DateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n \n Date date = formatter.parse(dateValue.stringValue());\n gregorianCalendar.setTime(date);\n \n XMLGregorianCalendar xmlGrogerianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);\n \n xmlGrogerianCalendar.setTimezone(DatatypeConstants.FIELD_UNDEFINED);\n xmlGrogerianCalendar.setTime(DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,\n DatatypeConstants.FIELD_UNDEFINED);\n \n return xmlGrogerianCalendar;\n }\n catch (DatatypeConfigurationException e)\n {\n e.printStackTrace();\n }\n catch (ParseException e)\n {\n e.printStackTrace();\n }\n \n }\n \n queryResult.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n catch (MalformedQueryException e)\n {\n e.printStackTrace();\n }\n catch (QueryEvaluationException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n con.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n }\n \n return null;\n \n }", "public ArrayList<String> getVacationDay(GregorianCalendar date) throws IOException {\r\n\t\tArrayList<String> vacation = new ArrayList<String>();\r\n\t\tif (calendar.existsVacationDay(date)) {\r\n\t\t\t// getting shifts\r\n\t\t\tArrayList<Turno> shifts = calendar.getShiftsOfADay(date);\r\n\t\t\tfor (Turno t : shifts) {\r\n\t\t\t\t// adding number of doctors\r\n\t\t\t\tvacation.add(Integer.toString(t.getNumberOfDoctors()));\r\n\t\t\t}\r\n\t\t\t// adding special date\r\n\t\t\tvacation.add(shifts.get(0).getSpecialDate());\r\n\t\t\treturn vacation;\r\n\t\t}\r\n\t\telse throw new IOException(\"La fecha no corresponde a ningun dia vacacional \");\t\r\n\t}", "public String getDate(){\n\n return this.date;\n }", "public void printTaskByDate(String date)\n {\n tasks.stream()\n .filter(task -> task.getDate().equals(date))\n .map(task -> task.getDetails())\n .forEach(details -> System.out.println(details)); \n }", "Date getDate();", "Date getDate();", "Date getDate();", "public int getDate(){\n return date;\n }", "public Date getDate() {\n return this.date;\n }", "public Date getDate() {\r\n return date;\r\n }", "public Date getDate() {\r\n return date;\r\n }", "public Date getDate() {\r\n return date;\r\n }", "public StrColumn getDateCoordinates() {\n return delegate.getColumn(\"date_coordinates\", DelegatingStrColumn::new);\n }", "public Date getFechaExclusion()\r\n/* 160: */ {\r\n/* 161:178 */ return this.fechaExclusion;\r\n/* 162: */ }", "public Date getDate(){\n\t\treturn date;\n\t}", "public ArrayList<Seance> getSeances(String date){\n ArrayList<Seance> seancesDate = new ArrayList();\n for(Seance s : seances){\n if(s.getDate().toString().equals(date)){\n seancesDate.add(s);\n }\n }\n return seancesDate;\n }", "public HashMap<String,Weather> getPrecipData() {\n HashMap<String, Weather> result = new HashMap<String, Weather>();\n //String url = NOAA.PRECIP_URL.replace(\"*STARTDATE*\", startDate).replace(\"*ENDDATE*\", endDate);\n try {\n // Get and parse the JSON\n Response res = makeRequest(NOAA.PRECIP_URL);\n JsonParser parser = new JsonParser();\n JsonArray results = parser.parse(res.body().string())\n .getAsJsonObject()\n .getAsJsonArray(\"results\");\n\n // Iterate over results, storing the values un the hashmap,\n // the key is the StationID, the value is a weather object of the\n // conditions and information about the station.\n Iterator<JsonElement> iterator = results.iterator();\n while (iterator.hasNext()) {\n JsonObject e = iterator.next().getAsJsonObject();\n String type = e.get(\"datatype\").getAsString();\n String station = e.get(\"station\").getAsString();\n String attributes = e.get(\"attributes\").getAsString();\n String date = e.get(\"date\").getAsString();\n int value = e.get(\"value\").getAsInt();\n\n result.put(station, new Weather(type, station, attributes, date, value));\n }\n return result;\n } catch (IOException e) {\n e.printStackTrace();\n } catch (IllegalStateException e) {\n e.printStackTrace();\n }\n return null;\n }", "@Override\n\tpublic Calendar getDate(){\n\t\treturn date;\n\t}", "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 }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }", "public Date getDate() {\n return date;\n }" ]
[ "0.5830215", "0.57499677", "0.5525641", "0.542927", "0.5363897", "0.5356984", "0.53260565", "0.52934283", "0.5243731", "0.52255666", "0.5176874", "0.51702315", "0.51647896", "0.51533943", "0.5146923", "0.51226383", "0.5115386", "0.5115037", "0.50323945", "0.5010665", "0.50013036", "0.4993178", "0.49878114", "0.4983628", "0.49819553", "0.49717516", "0.49618265", "0.4961204", "0.4950465", "0.49460167", "0.49389467", "0.49319094", "0.49295402", "0.49243188", "0.4915577", "0.49105912", "0.49089402", "0.4890023", "0.487341", "0.48672104", "0.48641688", "0.48641524", "0.485756", "0.48499173", "0.48438108", "0.48435438", "0.48416743", "0.48402005", "0.48334035", "0.48247808", "0.48239914", "0.48209321", "0.4820687", "0.48175526", "0.4809397", "0.48078942", "0.4806846", "0.48033825", "0.4796984", "0.4796984", "0.47918877", "0.4791304", "0.47897878", "0.47883546", "0.4783739", "0.47810706", "0.47802123", "0.47791433", "0.47786832", "0.477525", "0.47735712", "0.4770208", "0.47677526", "0.47666246", "0.47666246", "0.47666246", "0.47640112", "0.4759871", "0.475748", "0.475748", "0.475748", "0.47571498", "0.47515237", "0.47488242", "0.47429702", "0.47404087", "0.47348636", "0.47342694", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437", "0.4731437" ]
0.64200115
0
Retrieve the Notional aggregated over the Date Pairs
public double notional ( final int iDate1, final int iDate2) throws java.lang.Exception { org.drip.analytics.cashflow.CompositePeriod cp = containingPeriod (iDate1); if (null == cp || !cp.contains (iDate2)) throw new java.lang.Exception ("Stream::notional => Invalid Inputs"); org.drip.quant.common.Array2D notlSchedule = cp.notionalSchedule(); return initialNotional() * (null == notlSchedule ? 1. : notlSchedule.y (iDate1, iDate2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Pair<Date, Date> getForDatesFrame();", "public DateSavingsSumMap toModelType() {\n DateSavingsSumMap modelDssm = new DateSavingsSumMap();\n this.mappings.forEach(\n jdsp -> {\n try {\n modelDssm.add(jdsp.getDate(), jdsp.getSavings());\n } catch (IllegalValueException e) {\n // ignore invalid pairs\n e.printStackTrace();\n }\n });\n return modelDssm;\n }", "public abstract LocalDateDoubleTimeSeries getTimeSeries(ObservableKey key);", "public int trimestre(LocalDate d);", "Map<Date, Integer> getFullImpressions(Step step) throws SQLException;", "@Override\n public List<ExpenceSummary> getReportsForMonth(String owner,int year, int month) {\n\n AggregationResults<ExpenceSummary> results = operations.aggregate(newAggregation(Expence.class, //\n match(where(\"owner\").is(owner))\n // .andOperator(where(\"date\").lte(LocalDateTime.now())\n //.andOperator(where(\"year(date)\").is(year)\n // .andOperator(where(\"date\").regex(\"2016\")\n // .andOperator(where(\"owner\").is(\"admin\")))\n , //\n // unwind(\"items\"), //\n // project(\"id\", \"customerId\", \"items\") //\n // .andExpression(\"'$items.price' * '$items.quantity'\").as(\"lineTotal\"), //\n project()\n .andExpression(\"type\").as(\"type\")\n .andExpression(\"year(date)\").as(\"year\")\n .andExpression(\"month(date)\").as(\"month\")\n .andExpression(\"amount\").as(\"amount\")\n ,\n match(where(\"year\").is(year)\n .andOperator(where(\"month\").is(month))\n )\n // .andOperator(where(\"date\").lte(LocalDateTime.now())\n //.andOperator(where(\"year(date)\").is(year)\n ,\n group(\"type\",\"year\",\"month\")\n\n // .addToSet(\"type\").as(\"type\")//, //\n // .addToSet(\"year\").as(\"year\")//, //\n // .addToSet(\"month\").as(\"month\")//, //\n .sum(\"amount\").as(\"totalAmount\") //\n .count().as(\"count\")\n // project(\"id\", \"items\", \"netAmount\") //\n // .and(\"orderId\").previousOperation() //\n // .andExpression(\"netAmount * [0]\", 1).as(\"taxAmount\") //\n // .andExpression(\"netAmount * (1 + [0])\", 1).as(\"totalAmount\") //\n ), Expence.class,ExpenceSummary.class);\n logger.info(\"getReportsForMonth results.size=\"+results.getMappedResults().size());\n return results.getMappedResults();\n }", "private Map<String, Double> getMetricValues() throws ExceptionBase {\n final Map<String, Double> result = new HashMap<String, Double>();\n Iterator<String> itGroupByValue = null;\n // iterate on numerator values\n itGroupByValue = this.numeratorValues.keySet().iterator();\n while (itGroupByValue.hasNext()) {\n final String groupByValue = itGroupByValue.next();\n if (!Constants.PORTFOLIO.equals(groupByValue) && !result.containsKey(groupByValue)) {\n final Double value = calculateMetricValue(groupByValue);\n result.put(groupByValue, value);\n }\n }\n // iterate on denominator and try to find unsaved group by values\n itGroupByValue = this.denominatorValues.keySet().iterator();\n while (itGroupByValue.hasNext()) {\n final String groupByValue = itGroupByValue.next();\n if (!Constants.PORTFOLIO.equals(groupByValue) && !result.containsKey(groupByValue)) {\n final Double value = calculateMetricValue(groupByValue);\n result.put(groupByValue, value);\n }\n }\n return result;\n }", "@Override\n\tpublic List<Object[]> categoriesDataForDates(LocalDate date) { \n\t\tHashMap<Integer, Category> map = new HashMap<>();\n\t\tList<Category> categories = getAllCategories(); \n\t\tcategories.forEach(c -> {\n\t\t\tmap.put(c.getId(), c); \n\t\t});\n\n\t\tfinal String sql = \"SELECT DATE_FORMAT(dateIncurred,'%Y-%m') as date, \"\n\t\t\t\t+ \"category as cat, Count(*) as count, ROUND(SUM(amount),2) as sum \"\n\t\t\t\t+ \"FROM Transaction \"\n\t\t\t\t+ \"WHERE amount < 0 and (dateIncurred between ? and ?)\"\n\t\t\t\t+ \"GROUP BY Year(dateIncurred) , Month(dateIncurred), category \"\n\t\t\t\t+ \"ORDER BY dateIncurred DESC\";\n\n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession();\n\t\tsession.beginTransaction();\n\t\tSQLQuery query = session.createSQLQuery(sql);\n\n\t\t// TODO: simplify\n\t\tLocalDate from \t\t= date; \n\t\tLocalDate to\t\t= from.plusDays(from.lengthOfMonth() - 1);\n\t\tTimestamp from1 = Timestamp.valueOf(from.atStartOfDay());\n\t\tTimestamp to1\t= Timestamp.valueOf(to.atStartOfDay());\n\t\t\n\t\tquery.setTimestamp(0, from1);\n\t\tquery.setTimestamp(1, to1);\n\t\t\n\t\t/* replace Category_id with the actual category object by fetching the objects from db */ \n\t\tList<Object[]> results = query.list();\n\t\tresults.forEach(o -> {\n\t\t\tif (o[1] != null) { \n\t\t\t\t/* get category id */ \n\t\t\t\tInteger cat_id = Integer.parseInt(o[1].toString());\n\n\t\t\t\t/* put category object in map */ \n\t\t\t\to[1] = map.get(cat_id);\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tsession.getTransaction().commit();\n\t\treturn results;\n\t}", "HashMap<String, Double> getPortfolioData(String date);", "public Map<String, ProposalImpactSeriesValues> getAggregatedSeriesValues(\n List<String> seriesTypes) {\n Map<String, ProposalImpactSeriesValues> seriesTypeToSeriesSumMap =\n new HashMap<>(seriesTypes.size());\n\n for (String seriesType : seriesTypes) {\n seriesTypeToSeriesSumMap.put(seriesType, new ProposalImpactSeriesValues());\n }\n seriesTypeToSeriesSumMap\n .put(ProposalImpactSeries.SERIES_TYPE_RESULT_KEY, new ProposalImpactSeriesValues());\n\n for (ProposalImpactSeries impactSeries : impactSerieses) {\n for (String seriesType : seriesTypes) {\n ProposalImpactSeriesValues integratedSeriesValues =\n seriesTypeToSeriesSumMap.get(seriesType);\n ProposalImpactSeriesValues impactSeriesValues =\n impactSeries.getSeriesValuesForType(ImpactSeriesType.valueOf(seriesType));\n\n // Add up all the impact series values\n integratedSeriesValues.addImpactSeriesValues(impactSeriesValues);\n }\n\n OntologyTermWrapper ontologyRegionTerm = impactSeries.getWhereTerm();\n Map<Integer, Double> yearToValueFactor =\n ONTOLOGY_REGION_TERM_TO_YEAR_TO_VALUE_FACTOR.get(ontologyRegionTerm.getId());\n\n // Aggregate result impact series\n ProposalImpactSeriesValues integratedSeriesValues =\n seriesTypeToSeriesSumMap.get(ProposalImpactSeries.SERIES_TYPE_RESULT_KEY);\n ProposalImpactSeriesValues impactSeriesValues = impactSeries.getResultSeriesValues();\n integratedSeriesValues.addImpactSeriesValues(impactSeriesValues, yearToValueFactor);\n }\n\n return seriesTypeToSeriesSumMap;\n }", "public static TreeMap<String, Double> getAverageData(List<GameEntry> gameEntryList) {\n TreeMap<String, List<Double>> preprocessedDates = new TreeMap<>(); // before calculating average\n TreeMap<String, Double> processedDates = new TreeMap<>(); // after calculating average\n\n // Populate preprocessedDates, with keys being the dates, and values being the List of profits from the dates\n gameEntryList.forEach(gameEntry -> {\n String dateWithoutTime =\n gameEntry.getDate().toString().strip().split(REGEX_TO_SPLIT_DATE_AND_TIME, 2)[0];\n if (!preprocessedDates.containsKey(dateWithoutTime)) {\n preprocessedDates.put(dateWithoutTime, new ArrayList<>());\n }\n preprocessedDates.get(dateWithoutTime).add(gameEntry.getProfit());\n });\n\n // Using preprocessedDates, populate processedDates, with dates as the keys and average profits as the values\n preprocessedDates.forEach((date, listOfProfits) -> {\n Double averageProfit = listOfProfits.stream().mapToDouble(Double::doubleValue).average().orElse(0.00);\n processedDates.put(date, averageProfit);\n });\n\n return processedDates;\n }", "Map<Date, Integer> getFullConversions(Step step) throws SQLException;", "public Map allRatedAndAverage() {\n begin();\n\n return finalRecs;\n }", "public void dailyMapReduce(Date date, String collectionName) {\n\n\t\tDBCollection tweets = mongoOps.getCollection(collectionName);\n\n\t\tCalendar today = Calendar.getInstance();\n\t\ttoday.setTime(date);\n\n\t\ttoday.set(Calendar.HOUR_OF_DAY, 0);\n\t\ttoday.set(Calendar.MINUTE, 0);\n\t\ttoday.set(Calendar.SECOND, 0);\n\n\t\tlong today_beginning_timestamp = today.getTimeInMillis();\n\t\tSystem.out.println(\"Today beginning:\" + today.getTime());\n\n\t\ttoday.set(Calendar.HOUR_OF_DAY, 23);\n\t\ttoday.set(Calendar.MINUTE, 59);\n\t\ttoday.set(Calendar.SECOND, 59);\n\t\tlong today_ending_timestamp = today.getTimeInMillis();\n\t\tSystem.out.println(\"Today ending:\" + today.getTime());\n\n\t\tDBObject condition = new BasicDBObject(2);\n\t\tcondition.put(\"$gte\", Long.toString(today_beginning_timestamp));\n\t\tcondition.put(\"$lt\", Long.toString(today_ending_timestamp));\n\t\tDBObject q = new BasicDBObject(\"timestamp_ms\", condition);\n\t\tDBObject match = new BasicDBObject(\"$match\", q);\n\t\tDBObject output = new BasicDBObject(\"$out\", \"temp\");\n\n\t\t// run aggregation\n\t\tList<DBObject> pipeline = Arrays.asList(match, output);\n\t\ttweets.aggregate(pipeline);\n\n\t\tDBCollection temp = mongoOps.getCollection(\"temp\");\n\n\t\t// map function\n\t\tStringBuilder mapFunction = new StringBuilder(\"function() {\");\n\t\tfor (Field field : Field.values()) {\n\t\t\tif (field == Field.ALL) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmapFunction.append(\"var entity = this.\" + field.toString() + \";\");\n\t\t\tmapFunction\n\t\t\t\t\t.append(\"if ( entity ) { entity = entity.toString().toLowerCase().split(',');\");\n\t\t\tmapFunction.append(\"for ( var i = entity.length -1 ; i>=0 ;--i){\");\n\n\t\t\tif (field.toString() == Field.PERSON.toString()) {\n\t\t\t\tmapFunction\n\t\t\t\t\t\t.append(\"entity[i]=entity[i].replace(/[^a-zA-Z]/g, ' ');\");\n\n\t\t\t} else if (field.toString() == Field.HASHTAG.toString()) {\n\t\t\t\tmapFunction\n\t\t\t\t\t\t.append(\"entity[i]=entity[i].replace(/[`~!@$%^&*()_|+\\\\-=?;:\\\\'\\\".<>\\\\{\\\\}\\\\[\\\\]\\\\\\\\/]/gi, '');\");\n\n\t\t\t} else if (field.toString() != Field.URL.toString()) {\n\t\t\t\tmapFunction\n\t\t\t\t\t\t.append(\"entity[i]=entity[i].replace(/[`~!@#$%^&*()_|+\\\\-=?;:\\\\'\\\".<>\\\\{\\\\}\\\\[\\\\]\\\\\\\\/]/gi, '');\");\n\t\t\t}\n\n\t\t\tmapFunction\n\t\t\t\t\t.append(\"if ( entity[i] && entity[i].trim().length > 0 && entity[i] !== '[]') {\");\n\t\t\tmapFunction.append(\"emit( { id: entity[i].trim(), date: \\\"\"\n\t\t\t\t\t+ counterDateFormat.format(date) + \"\\\", type: \\\"\"\n\t\t\t\t\t+ field.toString() + \"\\\"}, 1);}}}\");\n\n\t\t}\n\t\tmapFunction.append(\"};\");\n\t\tString map = mapFunction.toString();\n\t\tSystem.out.println(map);\n\n\t\t// reduce function\n\t\tString reduce = \"function(key, values) {\" + \"var sum = 0;\"\n\t\t\t\t+ \"values.forEach( function(v) {\" + \"sum += v;\" + \"});\"\n\t\t\t\t+ \"return sum;\" + \"}\";\n\n\t\tSystem.out.println(reduce);\n\n\t\t// run map-reduce on the temporary collection, the output is in the file\n\t\t// named outCollection\n\t\tMapReduceCommand cmd = new MapReduceCommand(temp, map, reduce,\n\t\t\t\tDAILY_COLLECT_NAME, MapReduceCommand.OutputType.MERGE, null);\n\t\ttemp.mapReduce(cmd);\n\n\t\t// delete the temporary collection\n\t\ttemp.drop();\n\t\tSystem.out.println(\"Finished daily mapreduce\");\n\t}", "public double notional (\n\t\tfinal int iDate)\n\t\tthrows java.lang.Exception\n\t{\n\t\tint iEffectiveDate = effective().julian();\n\n\t\tint iAdjustedDate = iEffectiveDate > iDate ? iEffectiveDate : iDate;\n\n\t\torg.drip.analytics.cashflow.CompositePeriod cp = containingPeriod (iAdjustedDate);\n\n\t\tif (null == cp) throw new java.lang.Exception (\"Stream::notional => Invalid Input\");\n\n\t\treturn cp.notional (iAdjustedDate);\n\t}", "@Override\r\n public Map<Integer, Map<Integer, Map<Integer, List<Schedule>>>> calendarOrderTasks() {\r\n List<Schedule> tasks = scheduleRepository.getAllScheduledTasks();\r\n Map<Integer, Map<Integer, Map<Integer, List<Schedule>>>> dateMap = new HashMap<>();\r\n \r\n for (Schedule task : tasks) {\r\n List<Schedule> daySchedule = new ArrayList<>();\r\n String[] timestamp = task.getTimestamp().split(\" \");\r\n String date = timestamp[0];\r\n String[] dateArr = date.split(\"-\");\r\n Integer year = Integer.valueOf(dateArr[0]);\r\n Integer month = Integer.valueOf(dateArr[1]);\r\n Integer day = Integer.valueOf(dateArr[2]);\r\n System.out.println(\"Date arr -> Year: \" + year + \" Month: \" + month + \" Day: \" + day);\r\n \r\n if(dateMap.get(year) == null){\r\n Map<Integer, Map<Integer, List<Schedule>>> monthMap = new HashMap<>();\r\n dateMap.put(year, monthMap);\r\n } \r\n if(dateMap.get(year).get(month) == null){\r\n Map<Integer, List<Schedule>> dayMap = new HashMap<>();\r\n dateMap.get(year).put(month, dayMap);\r\n } \r\n if(dateMap.get(year).get(month).get(day) == null){\r\n List<Schedule> dayTasks = new ArrayList<>();\r\n dateMap.get(year).get(month).put(day, dayTasks);\r\n }\r\n \r\n dateMap.get(year).get(month).get(day).add(task);\r\n }\r\n return dateMap;\r\n }", "public List<SalesOrderAggregatedCreated> selectAll();", "public DaySummary getSummaryForDay(String date){\n String[] values = date.split(\"-\");\n int day = Integer.parseInt(values[0]);\n int month = Integer.parseInt(values[1]);\n int year = Integer.parseInt(values[2]);\n\n LocalDateTime localDateTime1 = LocalDateTime.of(year,month,day,0,0);\n LocalDateTime localDateTime2 = LocalDateTime.of(year,month,day+1,0,0);\n\n Date date1 = Date.from( localDateTime1.atZone( ZoneId.systemDefault()).toInstant());\n Date date2 = Date.from( localDateTime2.atZone( ZoneId.systemDefault()).toInstant());\n return daySummaryRepository.findAllBySummaryDateBetween(date1, date2).get(0);\n }", "Map<Long, Map<Long, Map<Date, Collection<DailyTimePostTotal>>>> calculateDailyTotals(Collection<IncidentResourceVo> incidentResources, Collection<Date> dates);", "Date getDataIns();", "@Override\n public List<Map<String, Serializable>> getResult() {\n Preconditions.checkState(_finish, \"GetResult cannot be called before finish.\");\n List<Map<String, Serializable>> result = new ArrayList<Map<String, Serializable>>(_aggrFuncContextList.size());\n\n for (int i = 0; i < _aggrFuncContextList.size(); i++) {\n result.add(new HashMap<String, Serializable>());\n }\n\n Iterator<Pair<Long, String>> groupKeys = _groupKeyGenerator.getUniqueGroupKeys();\n while (groupKeys.hasNext()) {\n Pair<Long, String> idKeyPair = groupKeys.next();\n String stringGroupKey = idKeyPair.getSecond();\n\n for (int i = 0; i < _aggrFuncContextList.size(); i++) {\n double resultForGroupKey = _resultHolderArray[i].getResultForGroupKey(idKeyPair.getFirst());\n result.get(i).put(stringGroupKey, resultForGroupKey);\n }\n }\n return result;\n }", "public static double getGraidentBasedOnTradingDays(IGraphLine aLine, TreeSet<AbstractGraphPoint> listOfTradingDays) {\r\n double result = 0;\r\n if (null != aLine && null != listOfTradingDays) {\r\n AbstractGraphPoint myCurrStart = aLine.getCurrentC();\r\n AbstractGraphPoint myCurrEnd = aLine.getCurrentE();\r\n if (myCurrStart.getDateAsNumber() != myCurrEnd.getDateAsNumber()) {\r\n// TreeSet<AbstractGraphPoint> tDay = new TreeSet<AbstractGraphPoint>(AbstractGraphPoint.TimeComparator);\r\n// tDay.addAll(listOfTradingDays);\r\n //Calc P1\r\n //Get Market close time on start day\r\n Calendar endTrading = DTUtil.deepCopyCalendar(myCurrStart.getCalDate());\r\n endTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n endTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n endTrading.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n endTrading.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n double p1 = endTrading.getTimeInMillis() - myCurrStart.getCalDate().getTimeInMillis();\r\n //double p1 = endTrading.getTimeInMillis() - (myCurrStart.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR);\r\n //Now calculate P2\r\n //Get Market open time on end day\r\n Calendar startTrading = DTUtil.deepCopyCalendar(myCurrEnd.getCalDate());\r\n startTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n startTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n startTrading.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n startTrading.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - startTrading.getTimeInMillis());\r\n //double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR) - startTrading.getTimeInMillis();\r\n //Now calc P3\r\n //Get count of trading days from list\r\n// int currStartDay = myCurrStart.getDateAsNumber();\r\n// int currEndDay = myCurrEnd.getDateAsNumber();\r\n// NavigableSet<AbstractGraphPoint> subSet = new TreeSet<AbstractGraphPoint>();\r\n// for(AbstractGraphPoint currPoint : tDay){\r\n// int currDay = currPoint.getDateAsNumber();\r\n// if(currDay > currStartDay && currDay < currEndDay){\r\n// subSet.add(currPoint);\r\n// }\r\n// }\r\n NavigableSet<AbstractGraphPoint> subSet = listOfTradingDays.subSet(myCurrStart, false, myCurrEnd, false);\r\n ArrayList<AbstractGraphPoint> theSet = new ArrayList<AbstractGraphPoint>();\r\n theSet.addAll(subSet);\r\n for (AbstractGraphPoint currPoint : theSet) {\r\n if (currPoint.getDateAsNumber() == myCurrStart.getDateAsNumber() || currPoint.getDateAsNumber() == myCurrEnd.getDateAsNumber()) {\r\n subSet.remove(currPoint);\r\n }\r\n }\r\n double dayCount = subSet.size();\r\n double p3 = dayCount * DTUtil.msPerTradingDay();\r\n\r\n //Sum all three parts as deltaX\r\n double deltaX = p1 + p2 + p3;\r\n double deltaY = myCurrEnd.getLastPrice() - myCurrStart.getLastPrice();\r\n\r\n //Gradient is deltaY / deltaX\r\n result = deltaY / deltaX;\r\n\r\n System.out.println(\"Delta Y = \" + deltaY);\r\n System.out.println(\"Delta X = \" + deltaX);\r\n System.out.println(aLine.toString());\r\n } else {\r\n result = aLine.getGradient();\r\n System.out.println(aLine.toString());\r\n }\r\n }\r\n return result;\r\n }", "public void mergingMapReduce(TimePeriod timePeriod) {\n\n\t\tSystem.out.println(\"Starting merging mapreduce...\");\n\n\t\tDBCollection dailyCollection = mongoOps\n\t\t\t\t.getCollection(DAILY_COLLECT_NAME);\n\n\t\tCalendar stDate = Calendar.getInstance();\n\t\tif (timePeriod.equals(TimePeriod.PASTWEEK)) {\n\t\t\tstDate.add(Calendar.DATE, -7);\n\t\t} else if (timePeriod.equals(TimePeriod.PASTMONTH)) {\n\t\t\tstDate.add(Calendar.DATE, -30);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tSystem.out.println(\"Start date: \" + stDate.getTime().toString());\n\n\t\t// create pipeline operations, first with the $match\n\t\tDBObject matchObj = new BasicDBObject(\"_id.date\", new BasicDBObject(\n\t\t\t\t\"$gte\", counterDateFormat.format(stDate.getTime())));\n\t\tDBObject match = new BasicDBObject(\"$match\", matchObj);\n\n\t\t// build the $projection operation\n\t\tDBObject fields = new BasicDBObject(\"_id.id\", 1);\n\t\tfields.put(\"_id.type\", 1);\n\t\tfields.put(\"value\", 1);\n\t\tDBObject project = new BasicDBObject(\"$project\", fields);\n\n\t\t// the $group operation\n\t\tMap<String, Object> dbObjIdMap = new HashMap<String, Object>();\n\t\tdbObjIdMap.put(\"id\", \"$_id.id\");\n\t\tdbObjIdMap.put(\"type\", \"$_id.type\");\n\t\tDBObject groupFields = new BasicDBObject(\"_id\", new BasicDBObject(\n\t\t\t\tdbObjIdMap));\n\t\tgroupFields.put(\"value\", new BasicDBObject(\"$sum\", \"$value\"));\n\t\tDBObject group = new BasicDBObject(\"$group\", groupFields);\n\n\t\t// $out operation\n\t\tDBObject out = new BasicDBObject(\"$out\",\n\t\t\t\t(timePeriod.equals(TimePeriod.PASTWEEK) ? WEEKLY_COLLECT_NAME\n\t\t\t\t\t\t: MONTHLY_COLLECT_NAME));\n\n\t\tList<DBObject> pipeline = Arrays.asList(match, project, group, out);\n\t\tdailyCollection.aggregate(pipeline);\n\n\t\tSystem.out.println(\"Finished merging mapreduce\");\n\t}", "private void extractDataFromOrders(List<Order> orders) {\n ArrayList<LocalDate> orderedListOfMapDays = new ArrayList<LocalDate>();\n HashMap<LocalDate, Integer> dateToCoffeeCaffeineMap = new HashMap<LocalDate, Integer>(), dateToTeaCaffeineMap = new HashMap<LocalDate, Integer>();\n HashMap<LocalDate, Double> dateToCoffeeExpenditureMap = new HashMap<LocalDate, Double>(), dateToTeaExpenditureMap = new HashMap<LocalDate, Double>();\n for (int i = 0; i < 8; i++) {\n LocalDate date = ONE_WEEK_AGO.plusDays(i);\n dateToCoffeeCaffeineMap.put(date, 0);\n dateToTeaCaffeineMap.put(date, 0);\n dateToCoffeeExpenditureMap.put(date, 0.0);\n dateToTeaExpenditureMap.put(date, 0.0);\n orderedListOfMapDays.add(date);\n }\n\n // loop through orders, comparing their days and adding values accordingly\n for (Order order : orders) {\n if (order == null) continue;\n // dates (in milliseconds) from orders are clocked to start of day and converted to dates\n LocalDateTime tempDateResetTime = order.getDate().toInstant()\n .atZone(ZoneId.systemDefault())\n .toLocalDate().atStartOfDay();\n LocalDate tempDate = tempDateResetTime.toLocalDate();\n Log.d(TAG, \"ORDER ON DAY: \" + tempDate);\n\n if (ONE_WEEK_AGO.isBefore(tempDate) || ONE_WEEK_AGO.isEqual(tempDate)) {\n // CAFFEINE\n // coffee caffeine\n int dailyCaffeineFromCoffee = 0;\n dailyCaffeineFromCoffee += (order.getTotalCaffeineFromCoffee(true) > 0 ? order.getTotalCaffeineFromCoffee(true) :\n order.getTotalCaffeineFromCoffee(false) > 0 ? order.getTotalCaffeineFromCoffee(false) : 0);\n dateToCoffeeCaffeineMap.put(tempDate, dateToCoffeeCaffeineMap.get(tempDate) + dailyCaffeineFromCoffee);\n // tea caffeine\n int dailyCaffeineFromTea = 0;\n dailyCaffeineFromTea += (order.getTotalCaffeineFromTea(true) > 0 ? order.getTotalCaffeineFromTea(true) :\n order.getTotalCaffeineFromTea(false) > 0 ? order.getTotalCaffeineFromTea(false) : 0);\n dateToTeaCaffeineMap.put(tempDate, dateToTeaCaffeineMap.get(tempDate) + dailyCaffeineFromTea);\n\n // EXPENDITURES\n // coffee cost\n double dailyExpenditureFromCoffee = 0.0;\n dailyExpenditureFromCoffee += (order.getTotalCostFromCoffee(true) > 0 ? order.getTotalCostFromCoffee(true) :\n order.getTotalCostFromCoffee(false) > 0 ? order.getTotalCostFromCoffee(false) : 0.0);\n dateToCoffeeExpenditureMap.put(tempDate, dateToCoffeeExpenditureMap.get(tempDate) + dailyExpenditureFromCoffee);\n // tea cost\n double dailyExpenditureFromTea = 0.0;\n dailyExpenditureFromTea += (order.getTotalCostFromTea(true) > 0 ? order.getTotalCostFromTea(true) :\n order.getTotalCostFromTea(false) > 0 ? order.getTotalCostFromTea(false) : 0.0);\n dateToTeaExpenditureMap.put(tempDate, dateToTeaExpenditureMap.get(tempDate) + dailyExpenditureFromTea);\n }\n }\n\n // CAFFEINE SERIES\n coffeeCaffeineSeries = new DateIntegerSeries(\"Coffee\");\n teaCaffeineSeries = new DateIntegerSeries(\"Tea\");\n // for formatting, add an empty value at FRONT of series\n coffeeCaffeineSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n teaCaffeineSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n for (int i = 0; i < orderedListOfMapDays.size(); i++) {\n LocalDate localDate = orderedListOfMapDays.get(i);\n Integer coffeeCaffeine = dateToCoffeeCaffeineMap.get(localDate);\n Integer teaCaffeine = dateToTeaCaffeineMap.get(localDate);\n\n Long date = Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime();\n\n coffeeCaffeineSeries.add(date, coffeeCaffeine);\n teaCaffeineSeries.add(date, teaCaffeine);\n }\n // for formatting, add an empty value to BACK of series\n coffeeCaffeineSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n teaCaffeineSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n\n // EXPENDITURE SERIES\n coffeeExpenditureSeries = new DateDoubleSeries(\"Coffee\");\n teaExpenditureSeries = new DateDoubleSeries(\"Tea\");\n // for formatting, add an empty value at FRONT of series\n coffeeExpenditureSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n teaExpenditureSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n for (int i = 0; i < orderedListOfMapDays.size(); i++) {\n LocalDate localDate = orderedListOfMapDays.get(i);\n Double coffeeExpenditure = dateToCoffeeExpenditureMap.get(localDate);\n Double teaExpenditure = dateToTeaExpenditureMap.get(localDate);\n\n Long date = Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime();\n\n coffeeExpenditureSeries.add(date, coffeeExpenditure);\n teaExpenditureSeries.add(date, teaExpenditure);\n }\n // for formatting, add an empty value to BACK of series\n coffeeExpenditureSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n teaExpenditureSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n }", "public Map<String, ProposalImpactSeriesValues> getAggregatedSeriesValues(\n List<String> seriesTypes, OntologyTermWrapper regionOntologyTerm) {\n Map<String, ProposalImpactSeriesValues> seriesTypeToSeriesSumMap =\n new HashMap<>(seriesTypes.size());\n\n for (String seriesType : seriesTypes) {\n seriesTypeToSeriesSumMap.put(seriesType, new ProposalImpactSeriesValues());\n }\n seriesTypeToSeriesSumMap\n .put(ProposalImpactSeries.SERIES_TYPE_RESULT_KEY, new ProposalImpactSeriesValues());\n\n for (ProposalImpactSeries impactSeries : impactSerieses) {\n if (impactSeries.getWhereTerm().equals(regionOntologyTerm)) {\n for (String seriesType : seriesTypes) {\n ProposalImpactSeriesValues integratedSeriesValues =\n seriesTypeToSeriesSumMap.get(seriesType);\n ProposalImpactSeriesValues impactSeriesValues =\n impactSeries.getSeriesValuesForType(ImpactSeriesType.valueOf(seriesType));\n\n // Add up all the impact series values\n integratedSeriesValues.addImpactSeriesValues(impactSeriesValues);\n }\n\n // Aggregate result impact series\n ProposalImpactSeriesValues integratedSeriesValues =\n seriesTypeToSeriesSumMap.get(ProposalImpactSeries.SERIES_TYPE_RESULT_KEY);\n ProposalImpactSeriesValues impactSeriesValues =\n impactSeries.getResultSeriesValues();\n integratedSeriesValues.addImpactSeriesValues(impactSeriesValues);\n }\n }\n\n return seriesTypeToSeriesSumMap;\n }", "Map<Date, Integer> getFullUniques(Step step) throws SQLException;", "public static void mergingMapReduce(TimePeriod timePeriod) {\n\n\t\tSystem.out.println(\"Starting merging mapreduce...\");\n\n\t\tDBCollection dailyCollection = mongoOps\n\t\t\t\t.getCollection(DAILY_COLLECT_NAME);\n\n\t\tCalendar stDate = Calendar.getInstance();\n\t\tif (timePeriod.equals(TimePeriod.PASTWEEK)) {\n\t\t\tstDate.add(Calendar.DATE, -7);\n\t\t} else if (timePeriod.equals(TimePeriod.PASTMONTH)) {\n\t\t\tstDate.add(Calendar.DATE, -30);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tSystem.out.println(\"Start date: \" + stDate.getTime().toString());\n\n\t\t// create pipeline operations, first with the $match\n\t\tDBObject matchObj = new BasicDBObject(\"_id.date\", new BasicDBObject(\n\t\t\t\t\"$gte\", counterDateFormat.format(stDate.getTime())));\n\t\tDBObject match = new BasicDBObject(\"$match\", matchObj);\n\n\t\t// build the $projection operation\n\t\tDBObject fields = new BasicDBObject(\"_id.id\", 1);\n\t\tfields.put(\"_id.type\", 1);\n\t\tfields.put(\"value\", 1);\n\t\tDBObject project = new BasicDBObject(\"$project\", fields);\n\n\t\t// the $group operation\n\t\tMap<String, Object> dbObjIdMap = new HashMap<String, Object>();\n\t\tdbObjIdMap.put(\"id\", \"$_id.id\");\n\t\tdbObjIdMap.put(\"type\", \"$_id.type\");\n\t\tDBObject groupFields = new BasicDBObject(\"_id\", new BasicDBObject(\n\t\t\t\tdbObjIdMap));\n\t\tgroupFields.put(\"value\", new BasicDBObject(\"$sum\", \"$value\"));\n\t\tDBObject group = new BasicDBObject(\"$group\", groupFields);\n\n\t\t// $out operation\n\t\tDBObject out = new BasicDBObject(\"$out\",\n\t\t\t\t(timePeriod.equals(TimePeriod.PASTWEEK) ? WEEKLY_COLLECT_NAME\n\t\t\t\t\t\t: MONTHLY_COLLECT_NAME));\n\n\t\tList<DBObject> pipeline = Arrays.asList(match, project, group, out);\n\t\tdailyCollection.aggregate(pipeline);\n\n\t\tSystem.out.println(\"Finished merging mapreduce\");\n\t}", "public Map<LocalDate,Double> getTradeValuesByDate(List<Trade> tradeList,String tradeType) {\n\t\t\r\n\t\tMap<LocalDate,Double> tradesValueMap= new TreeMap();\r\n\t\tfor(Trade t: tradeList){\r\n\t\t\tif (t.getInstructionType().equalsIgnoreCase(tradeType)) {\r\n\t\t\t\tLocalDate dateKey = t.getSettlementDate();\r\n\t\t\t\tdouble tradeAmount = t.getTotalAmount();\r\n\t\t\t\tif (tradesValueMap.get(dateKey) != null) {\r\n\t\t\t\t\ttradeAmount += tradesValueMap.get(dateKey);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttradesValueMap.put(dateKey, tradeAmount);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn tradesValueMap;\r\n\t}", "private TupleSet aggregate(TupleSet tuples) {\n\t\t\tMap<ScheduleUnit, ScheduleUnit> units = new HashMap<ScheduleUnit, ScheduleUnit>();\n\t\t\tfor (Tuple tuple : tuples) {\n\t\t\t\tScheduleUnit unit = new ScheduleUnit(tuple);\n\t\t\t\tif (!units.containsKey(unit)) {\n\t\t\t\t\tunits.put(unit, unit);\n\t\t\t\t}\n\t\t\t\tunits.get(unit).add(tuple);\n\t\t\t}\n\t\t\tTupleSet aggregate = new BasicTupleSet();\n\t\t\tfor (ScheduleUnit unit : units.keySet()) {\n\t\t\t\tif (unit.insertions.size() > 0 || unit.deletions.size() > 0)\n\t\t\t\t\taggregate.add(unit.tuple());\n\t\t\t}\n\t\t\treturn aggregate;\n\t\t}", "public TreeMap<String, Integer[]> generateAppCategory(Date startDate, Date endDate) {\n\n //Total Usage Time for each appid\n TreeMap<Integer, Double> appResult = new TreeMap<Integer, Double>();\n //Total Usage Time for each category\n TreeMap<String, Double> result = new TreeMap<String, Double>();\n //Total Usage Time and Percent for each category\n TreeMap<String, Integer[]> toResult = new TreeMap<String, Integer[]>();\n\n AppUsageDAO auDAO = new AppUsageDAO();\n ArrayList<User> userList = new ArrayList<User>();\n\n userList = auDAO.retrieveUsers(startDate, endDate);\n for (int i = 0; i < userList.size(); i++) {\n\n User currUser = userList.get(i);\n ArrayList<AppUsage> userUsage = auDAO.retrieveByUser(currUser.getMacAddress(), startDate, endDate);\n Date nextDay = new Date(startDate.getTime() + 60 * 60 * 1000 * 24);\n\n Date oldTime = null;\n if (userUsage.size() > 0) {\n oldTime = userUsage.get(0).getDate();\n if (oldTime.after(nextDay)) {\n nextDay = new Date(nextDay.getTime() + 60 * 60 * 1000 * 24);\n }\n }\n\n for (int j = 1; j < userUsage.size(); j++) {\n AppUsage au = userUsage.get(j);\n Date newTime = au.getDate();\n\n //store oldTime appId\n int appId = userUsage.get(j - 1).getAppId();\n boolean beforeAppeared = false;\n if (newTime.before(nextDay)) {\n beforeAppeared = true;\n\n //difference = usage time of the oldTime appId\n double difference = Utility.secondsBetweenDates(oldTime, newTime);\n\n //If difference less than/equal 2 minutes\n if (difference <= 2 * 60) {\n // add time to the appId\n if (appResult.containsKey(appId)) {\n double value = appResult.get(appId);\n appResult.put(appId, (value + difference));\n } else {\n appResult.put(appId, difference);\n }\n\n } else {\n // add 10sec to appid if > 2 mins\n if (appResult.containsKey(appId)) {\n double value = appResult.get(appId);\n appResult.put(appId, (value + 10));\n } else {\n appResult.put(appId, 10.0);\n }\n\n }\n\n } else {\n nextDay = new Date(nextDay.getTime() + 60 * 60 * 1000 * 24);\n\n if (!beforeAppeared) {\n double diff = Utility.secondsBetweenDates(oldTime, newTime);\n //add time to the appid\n if (diff <= 2 * 60) {\n // add time to the appId\n if (appResult.containsKey(appId)) {\n double value = appResult.get(appId);\n appResult.put(appId, (value + diff));\n } else {\n appResult.put(appId, diff);\n }\n\n } else {\n // add 10sec to appid if > 2 mins\n if (appResult.containsKey(appId)) {\n double value = appResult.get(appId);\n appResult.put(appId, (value + 10));\n } else {\n appResult.put(appId, 10.0);\n }\n\n }\n }\n\n }\n\n oldTime = newTime;\n\n }\n\n //get the appId of the last user usage\n int lastAppId = userUsage.get(userUsage.size() - 1).getAppId();\n\n if (oldTime.before(nextDay)) {\n double difference = Utility.secondsBetweenDates(oldTime, nextDay);\n //add the time difference to last appId\n if (difference < 10) {\n if (appResult.containsKey(lastAppId)) {\n double value = appResult.get(lastAppId);\n appResult.put(lastAppId, (value + difference));\n } else {\n appResult.put(lastAppId, difference);\n }\n } else {\n if (appResult.containsKey(lastAppId)) {\n double value = appResult.get(lastAppId);\n appResult.put(lastAppId, (value + 10));\n } else {\n appResult.put(lastAppId, 10.0);\n }\n }\n } else {\n\n if (appResult.containsKey(lastAppId)) {\n double value = appResult.get(lastAppId);\n appResult.put(lastAppId, (value + 10));\n } else {\n appResult.put(lastAppId, 10.0);\n }\n\n }\n\n //DIVIDE TO GET INTO DAYS\n long days = Utility.daysBetweenDates(startDate, endDate);\n\n AppDAO app = new AppDAO();\n\n //Retrieve appid in each category\n TreeMap<String, ArrayList<Integer>> appCategoryList = app.retrieveByCategory();\n Iterator<String> iter = appCategoryList.keySet().iterator();\n double totTime = 0.0;\n //Sum the total time by category\n while (iter.hasNext()) {\n String key = iter.next();\n //EACH CATEGORY\n ArrayList<Integer> innerList = appCategoryList.get(key);\n double totCatTime = 0.0;\n for (int j = 0; j < innerList.size(); j++) {\n int appid = innerList.get(j);\n double timePerApp = 0.0;\n\n if (appResult.containsKey(appid)) {\n timePerApp = appResult.get(appid);\n\n }\n totCatTime += timePerApp;\n }\n\n double avgCatTime = totCatTime / days;\n\n totTime += avgCatTime;\n result.put(key, avgCatTime);\n }\n\n Iterator<String> iterator = result.keySet().iterator();\n //Calculate the percentage for each category\n while (iterator.hasNext()) {\n\n String name = iterator.next();\n double duration = result.get(name);\n double percent = (duration / totTime) * 100;\n Integer[] arrToReturn = new Integer[2];\n\n arrToReturn[0] = Integer.valueOf(Math.round(duration) + \"\");\n arrToReturn[1] = Integer.valueOf(Math.round(percent) + \"\");\n toResult.put(name, arrToReturn);\n\n }\n\n }\n ArrayList<String> catList = Utility.retrieveCategories();\n\n for (String cat : catList) {\n if (!toResult.containsKey(cat)) {\n Integer[] arrToReturn = new Integer[2];\n arrToReturn[0] = 0;\n arrToReturn[1] = 0;\n toResult.put(cat, arrToReturn);\n }\n }\n return toResult;\n }", "public Date[] getDates() {\n/* 141 */ return getDateArray(\"date\");\n/* */ }", "private Map<String, Map<String,Integer>> combineResults() {\n\t\tMap<String, Map<String,Integer>>maxJointAgreement = new HashMap<>();\n\n\t\tfor (String type : this.entityTypes) {\n\t\t\tMap<String,Integer> allResults = new HashMap<>();\n\t\t\tMap<String,Integer> onlpRes = this.openNLPEntities.get(type);\n\t\t\tMap<String,Integer> cnlpRes = this.coreNLPEntities.get(type);\n\t\t\tMap<String,Integer> nltkRes = this.nltkEntities.get(type);\n\n\t\t\t// Merge individual NER results together\n\t\t\tif (onlpRes != null) {\n\t\t\t\tallResults = maxCountsMapMerge(onlpRes, allResults);\n\t\t\t}\n\t\t\tif (cnlpRes != null) {\n\t\t\t\tallResults = maxCountsMapMerge(cnlpRes, allResults);\n\t\t\t}\n\t\t\tif (nltkRes != null) {\n\t\t\t\tallResults = maxCountsMapMerge(nltkRes, allResults);\n\t\t\t}\n\t\t\tif (!allResults.isEmpty()) {\n\t\t\t\tmaxJointAgreement.put(type, allResults);\n\t\t\t}\n\t\t}\n\t\treturn maxJointAgreement;\n\t}", "@Override\r\n\tpublic int[] getDayPeople() {\n\t\tint[] result = new int[7];\r\n\t\tDate date = DateUtil.getCurrentDate();\r\n\t\tresult[0] = cinemaConditionDao.getDayCount(date);\r\n\t\tfor(int i=0;i<6;i++){\r\n\t\t\tdate = DateUtil.getDayBefore(date);\r\n\t\t\tresult[i+1] = cinemaConditionDao.getDayCount(date);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public String[] getStarDate2(){\n\t\tstardate = new String[3];\n\t\t\n\t\tCalendar originaldate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\tCalendar instancedate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\t\t\t\n\t\t//originaldate.set(2008, 8, 8, 0, 0, 0);\n\t\toriginaldate.set(2162, 0, 4, 0, 0, 0);\n\t\t\n\t\t/*instancedate.add(Calendar.HOUR, 7);\n\t\tinstancedate.add(Calendar.MINUTE, 33);\n\t\tinstancedate.add(Calendar.YEAR, 156);\n\t\tinstancedate.add(Calendar.HOUR, -6*24);\n\t\tinstancedate.add(Calendar.MONTH, -3);*/\n\t\t\n\t\t\n\t\t// Get the represented date in milliseconds\n\t\tlong milis1 = originaldate.getTimeInMillis();\n\t\tlong milis2 = instancedate.getTimeInMillis();\n\t\t\n\t\t// Calculate difference in milliseconds\n\t\tlong diff = milis2 - milis1;\n\t\t \n\t\t// Calculate difference in seconds\n\t\tlong diffSeconds = diff / 1000;\n\t\t \n\t\t// Calculate difference in minutes\n\t\t//long diffMinutes = diff / (60 * 1000);\n\t\t\n\t\t// Calculate difference in hours\n\t\t//long diffHours = diff / (60 * 60 * 1000);\n\t\t\n\t\t// Calculate difference in days\n\t\t//long diffDays = diff / (24 * 60 * 60 * 1000);\n\t\t\n\t\t//double dec = -280000 - ((double)diffSeconds / 17280.0f);\n\t\tdouble dec = ((double)diffSeconds / 17280.0f);\n\t\t\t\t\n\t\tint mantel = (int)Math.ceil(dec/10000.0f);\n\t\t\t\t\n\t\tdouble kropp = (dec + (-(mantel-1)*10000.0f));\n\t\t\n\t\tif(kropp >= 10000) mantel += 2; //Fixing rounding error\n\t\t\n\t\tdouble mantelkropp = ((mantel-1) * 10000.0f) - kropp;\n\t\t\n\t\t/*Log.v(TAG, \"Diff: \" + Long.toString(diff));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(dec));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Integer.toString(mantel));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(kropp));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(mantelkropp));*/\n\t\t\n\t\tdec = mantelkropp;\n\t\t\n\t\tDecimalFormat maxDigitsFormatter;\n\t\tif(dec < 0)\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"#000000.0000\");\n\t\telse\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"0000000.0000\");\n \n try {\n\t stardate[0] = \"[\" + (maxDigitsFormatter.format(dec)).substring(0, 3) + \"]\";\n\t stardate[1] = \" 0\" + (maxDigitsFormatter.format(dec)).substring(3, 9);\n\t stardate[2] = \"\" + (maxDigitsFormatter.format(dec)).substring(9, 11);\n } catch(StringIndexOutOfBoundsException sbe) {\n \tif(DEBUG) Log.v(TAG, \"Could not format \" + sbe);\n \tif(DEBUG) Log.v(TAG, maxDigitsFormatter.format(dec));\n \tstardate[2] = \"--\"; \t \n }\n \n Log.v(TAG, \"Stardate: \" + stardate[0] + stardate[1] + stardate[2]);\n return stardate;\n\t\t\n\t}", "public static List<InvoiceDto> createRevenueFinancialSummary(List<InvoiceDto> dtos)\n {\n HashMap<String, InvoiceDto> map = new HashMap<String, InvoiceDto>();\n List<InvoiceDto> retList = new ArrayList<InvoiceDto>();\n\n for (InvoiceDto dto : dtos) {\n\n String key = String.valueOf(dto.getMonthYear().getYear()) + \"01\";\n\n InvoiceDto entry = null;\n if (map.containsKey(key)) {\n entry = map.get(key);\n } else {\n entry = new InvoiceDto();\n entry.setMonthYear(new MonthYear(key));\n\n entry.setHours(0.0);\n entry.setTotalGross(0.0);\n entry.setTotalRecvGross(0.0);\n map.put(key, entry);\n }\n\n entry.setHours(entry.getHours() + dto.getHours());\n\n entry.setTotalGross(entry.getTotalGross() + dto.getTotalGross());\n if (!DateTimeUtils.isNullDate(dto.getReceivedDate()))\n {\n entry.setTotalRecvGross(entry.getTotalRecvGross() + dto.getTotalGross());\n }\n }\n\n for (String key : map.keySet())\n {\n retList.add(map.get(key));\n }\n\n SortUtils.sortFinancialDto(retList, false);\n\n return retList;\n }", "public ArrayList<DateAndCount> ShowDateAndCount(){\n SQLiteDatabase db = this.getReadableDatabase();\n// Cursor cursor = db.rawQuery(showDateAndCountQuery, null);\n Cursor cursor = db.query(TABLE_CLOTHES, new String[]{COLUMN_ID, COLUMN_CLOTHES_DATE,\n COLUMN_CLOTHES_SHIRTS + \" + \" +COLUMN_CLOTHES_PANTS + \" + \" +COLUMN_CLOTHES_INNERS + \" AS \" +\n COLUMN_CLOTHES_COUNT}, null, null, null, null, null);\n\n ArrayList<DateAndCount> dateAndCount = new ArrayList<>();\n if(cursor.moveToFirst()) {\n do {\n DateAndCount dateAndCount1 = new DateAndCount();\n dateAndCount1.setDate(cursor.getString(1));\n dateAndCount1.setCount(cursor.getInt(2));\n dateAndCount.add(dateAndCount1);\n\n } while (cursor.moveToNext());\n }\n cursor.close();\n\n return dateAndCount;\n }", "public static final double[] reGroup(double[] V1)\n {\n\n\tif(periodNum==24) return V1; //don't need to regroup\n\n//\tVector vec = new Vector(periodNum);\ndouble[]vec = new double[periodNum];\n\t\n\t//for(int i=0;i<periodNum;i++)\n\t// vec.insertElementAt((new Double(0)),i);\n\t\n\tint n = 24/periodNum;\n\tint index =6; //start from 7am\n\n\tfor(int i=0;i<periodNum;i++)\n\t{\n\t double d =0;\n\t for(int j=0;j<n;j++)\n\t {\n\t\tint temp = (index%24);\n\t\td+= V1[temp];\n\t\t\t//((Double)V1.elementAt(temp)).doubleValue();\n\t\tindex++;\n\t }\n\t vec[i] = d;\n\t //vec.addElement(new Double(d));\n\t}\n\n\treturn vec;\n }", "@Override\npublic JsonArray queryStatistics(String date, Employee em) throws Exception {\n\tint [] montharr= {31,28,31,30,31,30,31,31,30,31,30,31};\n\tSystem.out.println(date);\n\tint year;\n\tint month;\n\tif(date.length()==0){\n\t\tmonth = new Date().getMonth()+1;\n\t\tyear= new Date().getYear()+1900;\n\t}else{\n\t\tString[] s=date.split(\"-\");\n\t\tyear=Integer.parseInt(s[0]);\n\t\tmonth=Integer.parseInt(s[1]);\n\t}\n\t\n\t\n\tList<Map<String,Object>> lstMap = new LinkedList<Map<String,Object>>();\n\tfor (int i = 1; i <=montharr[month-1] ; i++) {\n\t\tStringBuffer buffer =new StringBuffer(\"select SUM(c.golds) from consumption c,machineinfo m where c.fmachineid=m.id and m.state!=-1 and c.type=-1 and m.empid=\")\n\t\t\t\t.append(em.getId()).append(\" and year(c.createtime) =\").append(year)\n\t\t\t\t.append(\" and month(c.createtime) =\").append(month).append(\" and day(c.createtime) =\").append(i);;\n\t\t\t\tSystem.out.println(buffer);\n\t\t\t\tMap<String,Object> map = new HashMap<String,Object>();\n\t\t\t\tList<Object> lst = databaseHelper.getResultListBySql(buffer.toString());\n\t\t\t\t\n\t\t\t\tmap.put(\"nums\", lst==null?\"0\":lst.size()==0?\"0\":lst.get(0)==null?\"0\":lst.get(0).toString());\n\t\t\t\tmap.put(\"time\", i+\"日\");\n\t\t\t\tmap.put(\"month\", month);\n\t\t\t\tlstMap.add(map);\n\t}\n\tString result = new Gson().toJson(lstMap);\n\tJsonArray jarr = (JsonArray) new JsonParser().parse(result);\n\treturn jarr;\n}", "public HashMap getEPubDate(){\r\n\t\tHashMap ePubDate=new HashMap();\r\n\t\tList docSumList=eSummaryResult.getDocSum();\r\n\t\t\r\n\t\tfor(Object eachDocSum:docSumList){\r\n\t\t\tArrayList ePubDateList=new ArrayList();\r\n\t\t\tArrayList pubDateList=new ArrayList();\r\n\t\t\tString pmid=((DocSum)eachDocSum).getId().toString();\r\n\t\t\tList itemList=((DocSum)eachDocSum).getItem();\r\n\t\t\tfor(Object eachItem:itemList){\r\n\t\t\t\tString itemName=((Item)eachItem).getName();\r\n\t\t\t\tif(itemName.equalsIgnoreCase(\"EPubDate\")){\r\n\t\t\t\t\tePubDateList=(ArrayList)((Item)eachItem).getContent();\r\n\t\t\t\t}\r\n\t\t\t\tif(itemName.equalsIgnoreCase(\"PubDate\")){\r\n\t\t\t\t\tpubDateList=(ArrayList)((Item)eachItem).getContent();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(!ePubDateList.isEmpty()){\r\n\t\t\t\tePubDate.put(pmid, ePubDateList.get(0));\r\n\t\t\t}else if(!pubDateList.isEmpty()){\r\n\t\t\t\tePubDate.put(pmid, pubDateList.get(0));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn ePubDate;\r\n\t}", "@Override\r\n\tpublic int[] getMonthPeople() {\n\t\tint[] result = new int[12];\r\n\t\tDate date = DateUtil.getCurrentDate();\r\n\t\tDate dateStart = DateUtil.getFirstDay(date);\r\n\t\tDate dateEnd = DateUtil.getLastDay(date);\r\n\t\tresult[0] = cinemaConditionDao.getCount(dateStart, dateEnd);\r\n\t\tfor(int i=0;i<11;i++){\r\n\t\t\tdate = DateUtil.getMonthBefroe(dateStart);\r\n\t\t\tdateStart = DateUtil.getFirstDay(date);\r\n\t\t\tdateEnd = DateUtil.getLastDay(date);\r\n\t\t\tresult[i+1] = cinemaConditionDao.getCount(dateStart, dateEnd);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic List<String> countDate() {\n\t\treturn controlA.countDate();\n\t}", "@Override\n public JSONObject asJson() {\n final long COUNT = 1000;\n try {\n JSONArray da = new JSONArray();\n Set<SingleDot> sortedGraph = new TreeSet<SingleDot>(graph);\n\n for (SingleDot d : sortedGraph) {\n da.put(new JSONArray().put(d.getDate().getTime() / COUNT).put(d.getValue()));\n }\n return new JSONObject().put(\"ticker\", ticker).put(\"graph\", da);\n } catch (JSONException e) {\n throw new RuntimeException(e);\n }\n }", "Map<Date, Float> getFullCTR(Step step) throws SQLException;", "public static void testGrouping(Iterable<WeatherInfo> h){\n Map<String, Long> nrOfDaysByDesc= stream(h.spliterator(), false)\n .collect(groupingBy(WeatherInfo::getWeatherDesc, counting()));\n\n System.out.println(nrOfDaysByDesc);\n\n // temperaturas de um Stream<WeatherInfo> por descrição do estado do tempo\n Map<String, List<Integer>> tempsByDesc = stream(h.spliterator(), false)\n .collect(\n groupingBy(\n WeatherInfo::getWeatherDesc,\n reducing(\n new ArrayList<>(),\n w -> asList(w.getTempC()),\n App::mergeList\n )\n )\n );\n System.out.println( tempsByDesc);\n\n /// !!!! Muito Inefeciente\n tempsByDesc = stream(h.spliterator(), false)\n .collect(\n groupingBy(\n WeatherInfo::getWeatherDesc,\n collectingAndThen(toList(), l -> l.stream().map(WeatherInfo::getTempC).collect(toList()))\n )\n );\n System.out.println(tempsByDesc);\n\n tempsByDesc = stream(h.spliterator(), false)\n .collect(\n groupingBy(\n WeatherInfo::getWeatherDesc,\n mapping(WeatherInfo::getTempC, toList()))\n );\n\n System.out.println(tempsByDesc);\n }", "@Override\r\n\tpublic List<Other> getOtherAll(String date) {\n\t\treturn othermapper.getOtherAll(date);\r\n\t}", "public Map<String, MonthDay> dataFeriadosNacionais(int ano);", "void createColumnsForDay(LocalDate date) {\n DateTime[] fenceposts = getSegmentFenceposts(date);\n for (int i = 0; i + 1 < fenceposts.length; i++) {\n DateTime start = fenceposts[i];\n DateTime stop = fenceposts[i + 1];\n Column column = new Column(start, stop, formatDayNumber(date));\n mColumnsByStartMillis.put(column.start.getMillis(), column);\n }\n }", "List<InsureUnitTrend> queryInsureDate();", "private void calcDataInTable() {\n Calendar tempCal = (Calendar) cal.clone();\n\n tempCal.set(Calendar.DAY_OF_MONTH, 1);\n int dayOfWeek;\n\n if (tempCal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {\n dayOfWeek = 7;\n } else {\n dayOfWeek = tempCal.get(Calendar.DAY_OF_WEEK) - 1;\n }\n\n int dayOfMonth = tempCal.get(Calendar.DAY_OF_MONTH);\n\n for (int j = 0; j < 6; j++) {\n\n for (int i = 0; i < 7; i++) {\n\n if (j != 0) {\n if (dayOfMonth < 32) {\n parsedData[j][i] = Integer.toString(dayOfMonth);\n }\n\n if (dayOfMonth > cal.getActualMaximum(Calendar.DAY_OF_MONTH)) {\n parsedData[j][i] = \"\";\n }\n\n dayOfMonth++;\n\n } else {\n\n if ((j == 0) && (i >= dayOfWeek - 1)) {\n parsedData[j][i] = Integer.toString(dayOfMonth);\n dayOfMonth++;\n } else {\n parsedData[j][i] = \"\";\n }\n\n\n }\n\n }\n\n }\n}", "private static void DoGroupBy()\n\t{\n\n\t\tArrayList<Attribute> inAtts = new ArrayList<Attribute>();\n\t\tinAtts.add(new Attribute(\"Int\", \"o_orderkey\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"o_custkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderstatus\"));\n\t\tinAtts.add(new Attribute(\"Float\", \"o_totalprice\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderdate\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderpriority\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_clerk\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"o_shippriority\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_comment\"));\n\n\t\tArrayList<Attribute> outAtts = new ArrayList<Attribute>();\n\t\toutAtts.add(new Attribute(\"Str\", \"att1\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att2\"));\n\t\toutAtts.add(new Attribute(\"Float\", \"att3\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att4\"));\n\n\t\tArrayList<String> groupingAtts = new ArrayList<String>();\n\t\tgroupingAtts.add(\"o_orderdate\");\n\t\tgroupingAtts.add(\"o_orderstatus\");\n\n\t\tHashMap<String, AggFunc> myAggs = new HashMap<String, AggFunc>();\n\t\tmyAggs.put(\"att1\", new AggFunc(\"none\",\n\t\t\t\t\"Str(\\\"status: \\\") + o_orderstatus\"));\n\t\tmyAggs.put(\"att2\", new AggFunc(\"none\", \"Str(\\\"date: \\\") + o_orderdate\"));\n\t\tmyAggs.put(\"att3\", new AggFunc(\"avg\", \"o_totalprice * Int (100)\"));\n\t\tmyAggs.put(\"att4\", new AggFunc(\"sum\", \"Int (1)\"));\n\n\t\t// run the selection operation\n\t\ttry\n\t\t{\n\t\t\tnew Grouping(inAtts, outAtts, groupingAtts, myAggs, \"orders.tbl\", \"out.tbl\", \"g++\", \"cppDir/\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "private static void groupImperative() {\n\n Map<Currency, List<FinancialTransaction>> transactionsByCurrency = new EnumMap<>(Currency.class);\n for (FinancialTransaction transaction : transactions) {\n Currency currency = transaction.getCurrency();\n transactionsByCurrency.computeIfAbsent(currency, k -> new ArrayList<>()).add(transaction);\n }\n log.info(\"{}\", transactionsByCurrency);\n // Java 7.\n log.info(\"Handling a Map<Currency, List<FinancialTransaction>> via a for-loop (Java 7).\");\n for (Map.Entry<Currency, List<FinancialTransaction>> entry : transactionsByCurrency.entrySet()) {\n log.info(\"****************************************************\");\n log.info(\"Currency: {}\", entry.getKey());\n // Ooops: Java 8 :-) So in this way I can do everything with one of the values, being a List<String>.\n entry.getValue().stream()\n .forEach(financialTransaction -> log.info(\"Name: {}\", financialTransaction));\n }\n }", "public static void conversionsummary (Date startdate, Date enddate, String currencyfrom, String currencyto, List<Time> times){\n List<Double> rates = new ArrayList<>(); // conversion rates of the 2 currencies in the period\n List<String> timesinp = new ArrayList<>(); // the date of those rates added within the period\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n if (times.size() != 0) {\n if (startdate.compareTo(enddate) <= 0) {\n times.sort((i, j) -> i.getDate().compareTo(j.getDate())); // sort the time arraylist according the date of time object from old to new\n try {\n for (int i = 0; i < times.size(); i += 1) {\n // only search time object in the period\n if (startdate.compareTo(sdf.parse(times.get(i).getDate())) <= 0 && enddate.compareTo(sdf.parse(times.get(i).getDate())) >= 0) {\n for (int j = 0; j < times.get(i).getExchanges().size(); j += 1) {\n // find exchange rate between the 2 currencies and put the date of the rate added and the rate to 2 lists.\n if (times.get(i).getExchanges().get(j).getFromCurrency().getName().equals(currencyfrom) && times.get(i).getExchanges().get(j).getToCurrency().getName().equals(currencyto)) {\n rates.add(times.get(i).getExchanges().get(j).getRate());\n timesinp.add(times.get(i).getDate());\n }\n }\n }\n }\n } catch (ParseException e) {\n System.out.println(e);\n }\n if (rates.size()==0){ // if there is no such rate during the period\n System.out.println(\"No exchange rate from \" + currencyfrom + \" to \" + currencyto + \" between \" + sdf.format(startdate) + \" and \" + sdf.format(enddate) + \".\");\n return;\n }\n\n for (int i = 0; i < rates.size(); i += 1) { // print conversion history of the 2 currencies\n System.out.println(timesinp.get(i) + \" \" + rates.get(i));\n }\n\n double mean = rates.stream().mapToDouble(i -> i).average().getAsDouble(); // calculate the mean of all exchange rate of the 2 currencies\n System.out.println(\"average rate: \" + String.format(\"%.2f\", mean));\n\n Collections.sort(rates);// sort by the rate\n if (rates.size() == 1) { // if there is only one exchange rate, this rate is the median\n System.out.println(\"median rate: \" + String.format(\"%.2f\", rates.get(0)));\n } else if (rates.size() % 2 != 0) { // if the number of exchange rate is odd, the n/2th rate is median\n System.out.println(\"median rate: \" + String.format(\"%.2f\", rates.get(rates.size() / 2)));\n } else { // if the number of exchange rate is even, the average of the n/2 th and n/2-1 th rate is the median\n System.out.println(\"median rate: \" + String.format(\"%.2f\", (rates.get(rates.size() / 2) + rates.get(rates.size() / 2 - 1)) / 2));\n }\n\n System.out.println(\"max rate: \" + String.format(\"%.2f\", rates.stream().mapToDouble(i -> i).max().getAsDouble())); // get the max\n System.out.println(\"min rate: \" + String.format(\"%.2f\", rates.stream().mapToDouble(i -> i).min().getAsDouble())); // get the min\n\n // calculate the standard deviation\n double variance = 0.0;\n for (int i = 0; i < rates.size(); i += 1) {\n variance += Math.pow((rates.get(i) - mean), 2);\n }\n double sd = Math.sqrt(variance / rates.size());\n System.out.println(\"standard deviation of rates: \" + String.format(\"%.2f\", sd));\n\n }else{\n System.out.println(\"The end date is earlier than start date, no such period exist, please enter correct period.\");\n }\n }else{\n System.out.println(\"No data in database, please contact admin for help.\");\n }\n\n }", "private void generateMarkedDates() {\n this.markedDates = new HashMap<>();\n for (Task t : logic.getAddressBook().getTaskList()) {\n\n if (markedDates.containsKey(t.getStartDate().getDate())) {\n if (t.getPriority().getPriorityLevel() > markedDates.get(t.getStartDate().getDate())) {\n markedDates.put(t.getStartDate().getDate(), t.getPriority().getPriorityLevel());\n }\n } else {\n markedDates.put(t.getStartDate().getDate(), t.getPriority().getPriorityLevel());\n }\n\n if (markedDates.containsKey(t.getEndDate().getDate())) {\n if (t.getPriority().getPriorityLevel() > markedDates.get(t.getEndDate().getDate())) {\n markedDates.put(t.getEndDate().getDate(), t.getPriority().getPriorityLevel());\n }\n } else {\n markedDates.put(t.getEndDate().getDate(), t.getPriority().getPriorityLevel());\n }\n }\n }", "@Select(\"select datetime,currentConfirmedCount,confirmedCount,suspectedCount,curedCount,deadCount from covid19_1 where datetime = #{datetime}\")\n List<Map<String, Object>> getNationalData(String datetime);", "Aggregators retrieveAggregators() throws RepoxException;", "void calculateData(InputStream gz, Day day) throws IOException, ParseException {\n Reader decoder = new InputStreamReader(gz, \"UTF-8\");\n BufferedReader buffered = new BufferedReader(decoder);\n try {\n buffered.readLine();\n } catch(EOFException e) {\n return;\n }\n String text = buffered.readLine();\n String[] row;\n ArrayList<DataPoint> recentData = new ArrayList<>();\n\n DateFormat df = new SimpleDateFormat(\"y-M-d k:m:s.S\", Locale.ENGLISH);\n DateFormat tf = new SimpleDateFormat(\"k:m:s\");\n Date startDate = df.parse(text.split(\",\")[0]);\n double startTime, lastTime;\n startTime = lastTime = getHourFromTime(tf.format(startDate));\n\n while (text != null && (row = text.split(\",\")).length == 4) {\n try {\n Date newDate = df.parse(row[0]);\n String newTime = tf.format(newDate);\n double newHour = getHourFromTime(newTime);\n final double startHour = lastTime;\n double sumMagnitude = 0.0;\n int count = 0;\n\n while (newHour - startHour < Utils.CHUNK && text != null && (row = text.split(\",\")).length == 4) {\n count++;\n Date datetime;\n\n for (int i = 0; i < recentData.size(); i++) {\n if (newHour - recentData.get(i).getTimeOfDay() < Utils.HIGH_PASS_CHUNK) {\n break;\n }\n recentData.remove(i--);\n }\n\n try {\n datetime = df.parse(row[0]);\n } catch (ParseException e) {\n text = buffered.readLine();\n count--;\n continue;\n }\n\n String time = tf.format(datetime);\n newHour = getHourFromTime(time);\n\n DataPoint data = new DataPoint(newDate.getTime(), Double.parseDouble(row[1]), Double.parseDouble(row[2]), Double.parseDouble(row[3]));\n recentData.add(data);\n\n double averageX = 0, averageY = 0, averageZ = 0;\n for (DataPoint dp : recentData) {\n averageX += dp.x / recentData.size();\n averageY += dp.y / recentData.size();\n averageZ += dp.z / recentData.size();\n }\n\n Double magnitude = Math.sqrt(Math.pow(data.x - averageX, 2) + Math.pow(data.y - averageY, 2) + Math.pow(data.z - averageZ, 2));\n\n sumMagnitude += magnitude;\n text = buffered.readLine();\n }\n\n lastTime += Utils.CHUNK;\n\n Date chunkDate = new Date(startDate.getTime() + (long) ((lastTime - startTime) * 1000 * 60 * 60));\n final Double finalAverage = count == 0 ? null : (Math.floor(sumMagnitude / count * 100) / 100);\n\n day.data.add(new DataPoint(chunkDate.getTime(), finalAverage));\n\n if (Utils.USE_DYNAMIC_HEIGHT) {\n if (finalAverage > Utils.MAX_Y) {\n Utils.MAX_Y = Math.min(finalAverage, Utils.MAX_Y_CAP);\n } else if (finalAverage < Utils.MIN_Y) {\n Utils.MIN_Y = finalAverage;\n }\n }\n } catch (ParseException e) {\n text = buffered.readLine();\n }\n }\n\n while(24 - (lastTime - startTime) > Utils.CHUNK) {\n lastTime += Utils.CHUNK;\n Date chunkDate = new Date(startDate.getTime() + (long)((lastTime - startTime) * 1000 * 60 * 60));\n day.data.add(new DataPoint(chunkDate.getTime(), null));\n }\n\n buffered.close();\n }", "public List<Object[]> getNumFailuresAndDurationByDate(Date startDate, Date endDate) {\n\t\tQuery query = em.createQuery(\"select imsi, count(c), sum(duration) from BaseData c where c.date_time >= :sDate AND c.date_time <= :eDate group by imsi\");\n\t\tquery.setParameter(\"sDate\",startDate);\n\t\tquery.setParameter(\"eDate\", endDate);\n\t\treturn (List<Object[]>)query.getResultList();\n\t}", "List<DataGatherMoment> getDataGatherMoments();", "public List<KeyValue<Integer>> getAvg() {\n\t\tList<KeyValue<Integer>> result = new ArrayList<KeyValue<Integer>>();\n\t\tJavaRDD<Document> rdd = dal.getRDD();\n\t\tList<Tuple2<String, Iterable<Document>>> list = rdd.groupBy(new Function<Document, String>() {\n\t\t\t// 分组\n\t\t\t/**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic String call(Document v1) throws Exception {\n\t\t\t\tString province = v1.getString(\"province\");\n\t\t\t\tDouble price = v1.getDouble(\"unitPrice\");\n\t\t\t\tif (v1.getString(\"province\") != null && price > 0) {\n\t\t\t\t\treturn province;\n\t\t\t\t}\n\t\t\t\treturn \"other\";\n\t\t\t}\n\t\t}).collect();\n\t\tfor (Tuple2<String, Iterable<Document>> tuple2 : list) {\n\t\t\t// 循环遍历,统计平均数\n\t\t\tif (tuple2._1.equals(\"other\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tIterator<Document> iterator = tuple2._2.iterator();\n\t\t\tList<Double> prices = new ArrayList<Double>();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tprices.add(iterator.next().getDouble(\"unitPrice\"));\n\t\t\t}\n\t\t\tdouble sum = dal.getSparkContext().parallelize(prices).reduce(new Function2<Double, Double, Double>() {\n\n\t\t\t\t/**\n\t\t\t\t * \n\t\t\t\t */\n\t\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t\tpublic Double call(Double v1, Double v2) throws Exception {\n\t\t\t\t\treturn v1 + v2;\n\t\t\t\t}\n\t\t\t});\n\t\t\tresult.add(new KeyValue<Integer>(tuple2._1, (int) sum / prices.size()));\n\t\t}\n\t\t// dal.destroy();\n\t\treturn result;\n\t}", "public Map<String, Object> countSalesEvents(String startDate, String endDate);", "private TaskSeriesCollection createCollection2() {\n TaskSeriesCollection result = new TaskSeriesCollection();\n TaskSeries s1 = new TaskSeries(\"S1\");\n Task t1 = new Task(\"Task 1\", new Date(10), new Date(20));\n t1.addSubtask(new Task(\"Task 1A\", new Date(10), new Date(15)));\n t1.addSubtask(new Task(\"Task 1B\", new Date(16), new Date(20)));\n t1.setPercentComplete(0.10);\n s1.add(t1);\n Task t2 = new Task(\"Task 2\", new Date(30), new Date(40));\n t2.addSubtask(new Task(\"Task 2A\", new Date(30), new Date(35)));\n t2.addSubtask(new Task(\"Task 2B\", new Date(36), new Date(40)));\n t2.setPercentComplete(0.20);\n s1.add(t2);\n result.add(s1);\n TaskSeries s2 = new TaskSeries(\"S2\");\n Task t3 = new Task(\"Task 3\", new Date(50), new Date(60));\n t3.addSubtask(new Task(\"Task 3A\", new Date(50), new Date(55)));\n t3.addSubtask(new Task(\"Task 3B\", new Date(56), new Date(60)));\n t3.setPercentComplete(0.30);\n s2.add(t3);\n result.add(s2);\n return result;\n }", "private Map<ImmutableTriple<String, Long, String>, LocalDateTime> getAllCreatedDateFromSource(\n List<SubmittedVariantEntity> duplicateSves) {\n Map<ImmutableTriple<String, Long, String>, LocalDateTime> targetToSourceCreatedDate = duplicateSves\n .stream().collect(Collectors.toMap(this::getKeyForCreatedDate,\n SubmittedVariantEntity::getCreatedDate,\n (cd1, cd2) -> Collections.min(Arrays.asList(cd1, cd2))));\n\n Map<String, List<SubmittedVariantEntity>> svesBySourceAssembly = duplicateSves\n .stream().collect(Collectors.groupingBy(\n sve -> Objects.isNull(sve.getRemappedFrom()) ? \"\" : sve.getRemappedFrom()));\n\n for (Map.Entry<String, List<SubmittedVariantEntity>> asmAndSves : svesBySourceAssembly.entrySet()) {\n String sourceAsm = asmAndSves.getKey();\n List<SubmittedVariantEntity> svesRemappedFromAsm = asmAndSves.getValue();\n\n // If not remapped, stick with the target created date\n if (sourceAsm.equals(\"\")) {\n continue;\n }\n\n // Otherwise query database for source SVEs with same accession in this assembly to get their created date\n List<Long> targetAccessions = svesRemappedFromAsm\n .stream()\n .map(SubmittedVariantEntity::getAccession)\n .collect(Collectors.toList());\n List<SubmittedVariantEntity> allSourceSvesInAsm = mongoTemplate.find(\n query(where(\"seq\").is(sourceAsm).and(\"accession\").in(targetAccessions)),\n SubmittedVariantEntity.class, collection);\n Map<Long, List<SubmittedVariantEntity>> sourceSvesByAccession = allSourceSvesInAsm\n .stream().collect(Collectors.groupingBy(SubmittedVariantEntity::getAccession));\n\n for (SubmittedVariantEntity sve : svesRemappedFromAsm) {\n List<SubmittedVariantEntity> sourceSves = sourceSvesByAccession.get(sve.getAccession());\n targetToSourceCreatedDate.put(getKeyForCreatedDate(sve), getCreatedDateFromSource(sve, sourceSves));\n }\n }\n\n return targetToSourceCreatedDate;\n }", "private static Long[] getTimeInterval(Date date) {\n\n\t\tCalendar calendarStart = GregorianCalendar.getInstance();\n\t\tcalendarStart.setTime(date);\n\t\tcalendarStart.set(Calendar.HOUR_OF_DAY, 0); // ! clear would not reset\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the hour of day !\n\t\tcalendarStart.clear(Calendar.MINUTE);\n\t\tcalendarStart.clear(Calendar.SECOND);\n\t\tcalendarStart.clear(Calendar.MILLISECOND);\n\t\tcalendarStart.set(Calendar.DAY_OF_MONTH, 1);\n\t\t// System.out.println(sdf.format(calendarStart.getTime()));\n\n\t\tCalendar calendarEnd = GregorianCalendar.getInstance();\n\t\tcalendarEnd.setTime(date);\n\t\tcalendarEnd.set(Calendar.HOUR_OF_DAY, 23); // ! clear would not reset\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the hour of day !\n\t\tcalendarEnd.set(Calendar.MINUTE, 59);\n\t\tcalendarEnd.set(Calendar.SECOND, 59);\n\t\tcalendarEnd.clear(Calendar.MILLISECOND);\n\t\tcalendarEnd.set(Calendar.DAY_OF_MONTH,\n\t\t\t\tcalendarStart.getActualMaximum(Calendar.DAY_OF_MONTH));\n\t\t// System.out.println(sdf.format(calendarEnd.getTime()));\n\n\t\tLong[] result = new Long[2];\n\t\tresult[0] = calendarStart.getTimeInMillis();\n\t\tresult[1] = calendarEnd.getTimeInMillis();\n\t\treturn result;\n\t}", "List<CabResponse> getCountByMedallionAndPickupDate(List<String> medallions, Date pickupDate);", "public void dateHashMapSorted() {\n\t\t//array used to store the key values of the unsorted HashMap\n\t\tLocalDate[] unsortedArr = new LocalDate[SORTINGDATES_SIZE];\n\t\n\t\t//adding all the keys to unsortedArr\n\t\tint i = 0;\n\t\tfor (LocalDate key : map.keySet()) {\n\t\t\t\tunsortedArr[i++] = key;\n\t\t\t}\n\t\t\n\t\tfor (int currIndex = 1; currIndex < unsortedArr.length; currIndex++) {\n\t\t\tLocalDate date = unsortedArr[currIndex];\n\t\t\tint k = currIndex - 1;\n\t\t\t\t\n\t\t\t/*\n\t\t\t * while the index for the array stays above 0 and the element in the previous\n\t\t\t * index is greater than the element at the currentIndex\n\t\t\t */\n\t\t\twhile ((k >= 0) && (unsortedArr[k].isAfter(date))) {\n\t\t\t\t//shifting the elements to the right\n\t\t\t\tunsortedArr[k + 1] = unsortedArr[k];\n\t\t\t\t//decrement x to move the other elements over\n\t\t\t\tk--;\t\n\t\t\t}\n\t\t\tunsortedArr[k + 1] = date;\n\t\t}\n\n\t\tfor (i = 0; i < unsortedArr.length; ++i) {\n\t\t\tSystem.out.println(unsortedArr[i]);\n\t\t}\n\t}", "private Object[] importTempChartAussen() {\n ArrayList<String> xValues = new ArrayList<>();\n //values: beinhaltet die x und y Werte als Entry\n ArrayList<Entry> values = new ArrayList<>();\n\n SimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd' '00:00:00\",\n Locale.GERMANY);\n Date d = new Date();\n d.setTime(d.getTime() - 604800000); //604800000ms=7d\n GregorianCalendar datenow = new GregorianCalendar();\n\n //ermittle die maximal Werte der letzten 7 Tage\n String query = \"SELECT datetime, Max(value) AS value FROM temperature where sensorid=1 AND datetime> '\"\n + parser.format(d)\n + \"' GROUP BY SUBSTR(datetime,0,11) ORDER BY datetime\";\n Cursor cr1 = db.getRawQuery(query);\n\n Date date = null;\n String day_of_week;\n SimpleDateFormat sdfDayMonth = new SimpleDateFormat(\"dd.MM\", Locale.GERMANY);\n SimpleDateFormat sdfYearMonthDateHourMinuteSecond = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.GERMANY);\n for (int i = 0; i < cr1.getCount(); i++) {\n //lese jeden Temperaturwert als Date ein und konvertiers dann zu einem GregorianCalendar\n\n try {\n date = sdfYearMonthDateHourMinuteSecond.parse(cr1.getString(cr1.getColumnIndex(\"datetime\")));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n GregorianCalendar g = new GregorianCalendar();\n g.setTime(date);\n\n if (datenow.get(GregorianCalendar.YEAR) == g\n .get(GregorianCalendar.YEAR)\n && datenow.get(GregorianCalendar.DAY_OF_YEAR) == g\n .get(GregorianCalendar.DAY_OF_YEAR)) {\n day_of_week = \"Heute \"; // unsichtbare Zeichen dahinter\n // damits ins Layout passt\n } else if (datenow.get(GregorianCalendar.YEAR) == g\n .get(GregorianCalendar.YEAR) && (datenow.get(GregorianCalendar.DAY_OF_YEAR)) == g\n .get(GregorianCalendar.DAY_OF_YEAR) + 1) {\n\n day_of_week = \"Gestern\";\n\n } else if (datenow.get(GregorianCalendar.YEAR) >= g\n .get(GregorianCalendar.YEAR)\n && datenow.get(GregorianCalendar.DAY_OF_YEAR) - 8 >= g\n .get(GregorianCalendar.DAY_OF_YEAR)) {\n\n day_of_week = sdfDayMonth.format(g.getTime());\n\n } else {\n day_of_week = g.getDisplayName(GregorianCalendar.DAY_OF_WEEK,\n GregorianCalendar.SHORT, Locale.GERMANY);\n }\n xValues.add(day_of_week);\n values.add(new Entry(i, cr1.getFloat(cr1.getColumnIndex(\"value\"))));\n cr1.moveToNext();\n }\n cr1.close();\n\n\n //erstellt ein LineDataSet mit den Objekten und entsprechenden Anpassungen\n LineDataSet set1 = new LineDataSet(values, \"Aussen\");\n // set1.setDrawCubic(true);\n set1.setCubicIntensity(0.2f);\n set1.setDrawCircles(false);\n set1.setLineWidth(2f);\n set1.setHighLightColor(Color.rgb(244, 117, 117));\n // set1.setColor(Color.rgb(104, 241, 175));\n set1.setColor(activity.getSharedPreferences(\"myprefs\", 0).getInt(\n \"trendcurveColorAussen\", Color.WHITE));\n set1.setFillColor(ColorTemplate.getHoloBlue());\n set1.setMode(LineDataSet.Mode.CUBIC_BEZIER);\n\n Object[] result = new Object[2];\n result[0] = set1;\n result[1] = xValues;\n return result;\n }", "@Query(value = \"SELECT DATE(created_on),value FROM lost_products WHERE created_on >= ? AND created_on<= ?\", nativeQuery = true)\n List<Object[]> getLostsBetweenDates(LocalDate startDate, LocalDate endDate);", "@Test\n void BasicTestCase_ContainsAllDays() {\n Solution solObj = new Solution();\n\n // Input Dictionary has all the day\n Map<String, Integer> input0 = Stream.of(new Object[][]{\n {\"2020-01-01\", 4}, {\"2020-01-02\", 4}, {\"2020-01-03\", 6}, {\"2020-01-04\", 8}, {\"2020-01-05\", 2}, {\"2020-01-06\", -6}, {\"2020-01-07\", 2}, {\"2020-01-08\", -2}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\n //output\n Map<String, Integer> expected0 = Stream.of(new Object[][]{\n {\"Mon\", -6}, {\"Tue\", 2}, {\"Wed\", 2}, {\"Thu\", 4}, {\"Fri\", 6}, {\"Sat\", 8}, {\"Sun\", 2}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\n\n LinkedHashMap<String, Integer> result = solObj.dateToDay(input0);\n assertEquals(expected0, result);\n\n }", "public DateTime[] getSegmentFenceposts(LocalDate date) {\n DateTime start = date.toDateTimeAtStartOfDay();\n DateTime stop = date.plusDays(1).toDateTimeAtStartOfDay();\n int[] starts = getSegmentStartTimes();\n DateTime[] fenceposts = new DateTime[starts.length + 1];\n for (int i = 0; i < starts.length; i++) {\n fenceposts[i] = start.plusMillis(starts[i]);\n }\n fenceposts[starts.length] = stop;\n return fenceposts;\n }", "@Override\r\n\tpublic List<SalesAnalysis> getSalesAnalysis(Date fromDate, Date toDate) {\r\n\t\t\r\n\t\tList<SalesAnalysis> salesAnalysisDetails=new ArrayList<>();\r\n\t\tSalesAnalysis salesAnalysis=new SalesAnalysis();\r\n\t\t\r\n\t\t//get orders placed in the given period\r\n\t\tList<Order> orderDetails=orderService.getOrdersBetween(fromDate, toDate);\r\n\t\t\r\n\t\tHashMap<String, Double> purchasePriceDetails=new HashMap<>();\r\n\t\tHashMap<String, Double> salesPriceDetails=new HashMap<>();\r\n\t\tint qty=0;\r\n\t\tdouble salesPrice=0;\r\n\t\tdouble purchasePrice=0;\r\n\t\t\r\n\t\t//get total revenue for period\r\n\t\tdouble totalRevenue=getTotalRevenueBetween(fromDate, toDate);\r\n\t\t\r\n\t\t//get best seller details for the products, category-wise(from PRODUCT table)\r\n\t\tList<Object[]> bestSellerDetails=productService.getBestSellerId();\r\n\t\tSystem.out.println(bestSellerDetails);\r\n\t\t\r\n\t\t\r\n\t\t//for each product category, check sales details\r\n\t\tfor(Object[] object:bestSellerDetails)\t{\r\n\t\t\tString productCategory=(String)object[0];\r\n\t\t\tsalesPrice=0;\r\n\t\t\tpurchasePrice=0;\r\n\t\t\tpurchasePriceDetails.put(productCategory, purchasePrice);\r\n\t\t\tsalesPriceDetails.put(productCategory, salesPrice);\r\n\t\t\t\r\n\t\t\t//for each order, check product category and add details to maps\r\n\t\t\tfor(Order order:orderDetails)\t{\r\n\t\t\t\t\r\n\t\t\t\t//get products in this order\r\n\t\t\t\tList<CartProduct> products=order.getCart().getCartProducts();\r\n\t\t\t\t\r\n\t\t\t\t//getting purchase price details for each product ordered\r\n\t\t\t\tfor(CartProduct product:products)\t{\r\n\t\t\t\t\tif(product.getProduct().getProductCategory().equals(productCategory))\t{\r\n\t\t\t\t\t\tpurchasePrice=purchasePriceDetails.get(productCategory)+\r\n\t\t\t\t\t\t\t\t(product.getProduct().getQuantity()*product.getProduct().getProductPrice());\r\n\t\t\t\t\t\tpurchasePriceDetails.put(productCategory, purchasePrice);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//getting sales price details for each product ordered\r\n\t\t\t\tfor(CartProduct product:products)\t{\r\n\t\t\t\t\tif(product.getProduct().getProductCategory().equals(productCategory))\t{\r\n\t\t\t\t\t\tqty=product.getQuantity();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsalesPrice=salesPriceDetails.get(productCategory)+\r\n\t\t\t\t\t\t\t\t(qty*(100-product.getProduct().getDiscount())*product.getProduct().getProductPrice())/100;\r\n\t\t\t\t\t\tsalesPriceDetails.put(productCategory, salesPrice);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//make SalesAnalysis object using obtained data\r\n\t\t\tsalesAnalysis.setProductCategory(productCategory);\r\n\t\t\tsalesAnalysis.setMerchant(merchantService.getMerchantName((Integer)object[1]));\r\n\t\t\tsalesAnalysis.setProductQuantity(purchasePriceDetails.get(productCategory));\r\n\t\t\tsalesAnalysis.setProductSales(salesPriceDetails.get(productCategory));\r\n\t\t\tsalesAnalysis.setSalesPercent((salesAnalysis.getProductSales()*100)/salesAnalysis.getProductQuantity());\r\n\t\t\tsalesAnalysis.setTotalRevenue(totalRevenue);\r\n\t\t\t\r\n\t\t\t//make a list of sales analysis performed\r\n\t\t\tsalesAnalysisDetails.add(salesAnalysis);\r\n\t\t}\r\n\t\t\r\n\t\treturn salesAnalysisDetails;\r\n\t}", "private Double[] getDayValue24(DayEM dayEm) {\n\n\t Double[] dayValues = new Double[24];\n\n\t /* OPF-610 정규화 관련 처리로 인한 주석\n\t dayValues[0] = (dayEm.getValue_00() == null ? 0 : dayEm.getValue_00());\n\t dayValues[1] = (dayEm.getValue_01() == null ? 0 : dayEm.getValue_01());\n\t dayValues[2] = (dayEm.getValue_02() == null ? 0 : dayEm.getValue_02());\n\t dayValues[3] = (dayEm.getValue_03() == null ? 0 : dayEm.getValue_03());\n\t dayValues[4] = (dayEm.getValue_04() == null ? 0 : dayEm.getValue_04());\n\t dayValues[5] = (dayEm.getValue_05() == null ? 0 : dayEm.getValue_05());\n\t dayValues[6] = (dayEm.getValue_06() == null ? 0 : dayEm.getValue_06());\n\t dayValues[7] = (dayEm.getValue_07() == null ? 0 : dayEm.getValue_07());\n\t dayValues[8] = (dayEm.getValue_08() == null ? 0 : dayEm.getValue_08());\n\t dayValues[9] = (dayEm.getValue_09() == null ? 0 : dayEm.getValue_09());\n\t dayValues[10] = (dayEm.getValue_10() == null ? 0 : dayEm.getValue_10());\n\t dayValues[11] = (dayEm.getValue_11() == null ? 0 : dayEm.getValue_11());\n\t dayValues[12] = (dayEm.getValue_12() == null ? 0 : dayEm.getValue_12());\n\t dayValues[13] = (dayEm.getValue_13() == null ? 0 : dayEm.getValue_13());\n\t dayValues[14] = (dayEm.getValue_14() == null ? 0 : dayEm.getValue_14());\n\t dayValues[15] = (dayEm.getValue_15() == null ? 0 : dayEm.getValue_15());\n\t dayValues[16] = (dayEm.getValue_16() == null ? 0 : dayEm.getValue_16());\n\t dayValues[17] = (dayEm.getValue_17() == null ? 0 : dayEm.getValue_17());\n\t dayValues[18] = (dayEm.getValue_18() == null ? 0 : dayEm.getValue_18());\n\t dayValues[19] = (dayEm.getValue_19() == null ? 0 : dayEm.getValue_19());\n\t dayValues[20] = (dayEm.getValue_20() == null ? 0 : dayEm.getValue_20());\n\t dayValues[21] = (dayEm.getValue_21() == null ? 0 : dayEm.getValue_21());\n\t dayValues[22] = (dayEm.getValue_22() == null ? 0 : dayEm.getValue_22());\n\t dayValues[23] = (dayEm.getValue_23() == null ? 0 : dayEm.getValue_23());\n\t\t\t*/\n\t \n\t return dayValues;\n\t }", "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 public Iterator<? extends Map.Entry<Key, Value>> reduceKV(Iterator<Map.Entry<Key, Value>> iter) {\n Key keyBeforeTT = null, keyAfterTT = null;\n Value valueBeforeTT = null;\n List<Value> valuesAfterTT = new LinkedList<>();\n\n while (iter.hasNext()) {\n Map.Entry<Key, Value> next = iter.next();\n Key k = next.getKey();\n Value v = next.getValue();\n\n if (k.getTimestamp() < tt) {\n if (keyBeforeTT == null || k.getTimestamp() > keyBeforeTT.getTimestamp()) {\n keyBeforeTT = k;\n valueBeforeTT = v;\n }\n } else {\n if (keyAfterTT == null || k.getTimestamp() > keyAfterTT.getTimestamp())\n keyAfterTT = k;\n valuesAfterTT.add(v);\n }\n }\n\n // Entries with ts >= tt are summed together into one entry with the timestamp of the most recent one.\n // If no entry is seen with ts < tt and we are on scan or full majc scope, then no entries are emitted.\n if (sScope == SScope.SCAN_OR_MAJC_FULL && keyBeforeTT == null)\n return null;\n\n // All entries are emitted after applying the above rules.\n if (keyBeforeTT == null && keyAfterTT == null)\n return null;\n else if (keyAfterTT == null)\n return Iterators.singletonIterator(new AbstractMap.SimpleImmutableEntry<>(keyBeforeTT, valueBeforeTT));\n else if (keyBeforeTT == null)\n return Iterators.singletonIterator(new AbstractMap.SimpleImmutableEntry<>(keyAfterTT, summer.reduce(keyAfterTT, valuesAfterTT.iterator())));\n else {\n // emit most recent entry first\n return new PeekingIterator2<Map.Entry<Key, Value>>(\n new AbstractMap.SimpleImmutableEntry<>(keyAfterTT, summer.reduce(keyAfterTT, valuesAfterTT.iterator())),\n new AbstractMap.SimpleImmutableEntry<>(keyBeforeTT, valueBeforeTT)\n );\n }\n }", "public Map<String, ProposalImpactSeriesValues> getAggregatedSeriesValues(\n List<String> seriesTypes, Long regionOntologyTermId, List<Long> sectorOntologyTermIds) {\n\n Map<String, ProposalImpactSeriesValues> seriesTypeToSeriesSumMap =\n new HashMap<>(seriesTypes.size());\n OntologyTermWrapper regionOntologyTerm = StaticContestContext.getOntologyClient()\n .getOntologyTerm(regionOntologyTermId);\n\n for (String seriesType : seriesTypes) {\n seriesTypeToSeriesSumMap.put(seriesType, new ProposalImpactSeriesValues());\n }\n\n for (Long ontologyTermId : sectorOntologyTermIds) {\n seriesTypeToSeriesSumMap\n .put(ontologyTermId.toString(), new ProposalImpactSeriesValues());\n }\n\n seriesTypeToSeriesSumMap\n .put(ProposalImpactSeries.SERIES_TYPE_RESULT_KEY, new ProposalImpactSeriesValues());\n ProposalImpactSeriesValues emptySeries = new ProposalImpactSeriesValues();\n\n for (ProposalImpactSeries impactSeries : impactSerieses) {\n\n if (impactSeries.getWhereTerm().equals(regionOntologyTerm)) {\n\n ProposalImpactSeriesValues impactSeriesValues =\n impactSeries.getResultSeriesValues();\n\n ProposalImpactSeriesValues integratedSeriesValues =\n seriesTypeToSeriesSumMap.get(ProposalImpactSeries.SERIES_TYPE_RESULT_KEY);\n integratedSeriesValues.addImpactSeriesValues(impactSeriesValues);\n\n for (String seriesType : seriesTypes) {\n integratedSeriesValues = seriesTypeToSeriesSumMap.get(seriesType);\n impactSeriesValues = impactSeries.getSeriesValuesForType(ImpactSeriesType.valueOf(seriesType));\n integratedSeriesValues.addImpactSeriesValues(impactSeriesValues);\n }\n\n for (Long sectorOntologyTermId : sectorOntologyTermIds) {\n OntologyTermWrapper sectorOntologyTerm =\n StaticContestContext.getOntologyClient()\n .getOntologyTerm(sectorOntologyTermId);\n integratedSeriesValues =\n seriesTypeToSeriesSumMap.get(sectorOntologyTermId.toString());\n if (!(impactSeries.getWhatTerm().equals(sectorOntologyTerm))) {\n for (Integer year : impactSeriesValues.getYearToValueMap().keySet()) {\n emptySeries.putSeriesValue(year, 0.);\n }\n integratedSeriesValues.addImpactSeriesValues(emptySeries);\n } else {\n integratedSeriesValues.addImpactSeriesValues(impactSeriesValues);\n }\n }\n }\n }\n\n return seriesTypeToSeriesSumMap;\n }", "private List<Object> handleResult(List<Object> resultSet)\n {\n List<Object> result = new ArrayList<>();\n final Expression[] grouping = compilation.getExprGrouping();\n if (grouping != null)\n {\n Comparator<Object> c = new Comparator<>()\n {\n public int compare(Object arg0, Object arg1)\n {\n for (int i = 0; i < grouping.length; i++)\n {\n state.put(candidateAlias, arg0);\n Object a = grouping[i].evaluate(evaluator);\n state.put(candidateAlias, arg1);\n Object b = grouping[i].evaluate(evaluator);\n\n // Put any null values at the end\n if (a == null && b == null)\n {\n return 0;\n }\n else if (a == null)\n {\n return -1;\n }\n else if (b == null)\n {\n return 1;\n }\n else\n {\n int result = ((Comparable)a).compareTo(b);\n if (result != 0)\n {\n return result;\n }\n }\n }\n return 0;\n }\n };\n \n List<List<Object>> groups = new ArrayList<>();\n List<Object> group = new ArrayList<>();\n if (!resultSet.isEmpty())\n {\n groups.add(group);\n }\n for (int i = 0; i < resultSet.size(); i++)\n {\n if (i > 0)\n {\n if (c.compare(resultSet.get(i - 1), resultSet.get(i)) != 0)\n {\n group = new ArrayList<>();\n groups.add(group);\n }\n }\n group.add(resultSet.get(i));\n }\n\n // Apply the result to the generated groups\n for (int i = 0; i < groups.size(); i++)\n {\n group = groups.get(i);\n result.add(result(group));\n }\n }\n else\n {\n boolean aggregates = false;\n Expression[] resultExprs = compilation.getExprResult();\n if (resultExprs.length > 0 && resultExprs[0] instanceof CreatorExpression)\n {\n Expression[] resExpr = ((CreatorExpression)resultExprs[0]).getArguments().toArray(\n new Expression[((CreatorExpression)resultExprs[0]).getArguments().size()]);\n for (int i = 0; i < resExpr.length; i++)\n {\n if (resExpr[i] instanceof InvokeExpression)\n {\n String method = ((InvokeExpression) resExpr[i]).getOperation().toLowerCase();\n if (method.equals(\"count\") || method.equals(\"sum\") || method.equals(\"avg\") || method.equals(\"min\") || method.equals(\"max\"))\n {\n aggregates = true;\n }\n }\n }\n }\n else\n {\n for (int i = 0; i < resultExprs.length; i++)\n {\n if (resultExprs[i] instanceof InvokeExpression)\n {\n String method = ((InvokeExpression)resultExprs[i]).getOperation().toLowerCase();\n if (method.equals(\"count\") || method.equals(\"sum\") || method.equals(\"avg\") || method.equals(\"min\") || method.equals(\"max\"))\n {\n aggregates = true;\n }\n }\n }\n }\n \n if (aggregates)\n {\n result.add(result(resultSet));\n }\n else\n {\n for (int i = 0; i < resultSet.size(); i++)\n {\n result.add(result(resultSet.get(i)));\n }\n }\n }\n\n if (!result.isEmpty() && ((Object[])result.get(0)).length == 1)\n {\n List r = result;\n result = new ArrayList<>();\n for (int i = 0; i < r.size(); i++)\n {\n result.add(((Object[]) r.get(i))[0]);\n }\n }\n return result;\n }", "@Test\n void BasicTestCase_largeNoOfEntries() {\n Solution solObj = new Solution();\n\n\n //Input Dictionary has year as 2100 and more entries\n Map<String, Integer> input1 = Stream.of(new Object[][]{\n {\"2100-02-01\", 1}, {\"2100-02-02\", 2}, {\"2100-02-03\", 3}, {\"2100-02-04\", 10}, {\"2100-02-05\", 11}, {\"2100-02-06\", 12}, {\"2100-02-07\", 13}, {\"2100-02-08\", 7}, {\"2100-02-09\", 8}, {\"2100-02-10\", 9}, {\"2100-02-11\", 10}, {\"2100-02-12\", 11}, {\"2100-02-13\", 12}, {\"2100-02-14\", 13},\n {\"2100-02-15\", 7}, {\"2100-02-16\", 8}, {\"2100-02-17\", 9}, {\"2100-02-18\", 10}, {\"2100-02-19\", 11}, {\"2100-02-20\", 12}, {\"2100-02-21\", 13}, {\"2100-02-22\", 7}, {\"2100-02-23\", 8}, {\"2100-02-24\", 9}, {\"2100-02-25\", 10}, {\"2100-02-26\", 11}, {\"2100-02-27\", 12}, {\"2100-02-28\", 13}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n //output\n Map<String, Integer> expected1 = Stream.of(new Object[][]{\n {\"Mon\", 22}, {\"Tue\", 26}, {\"Wed\", 30}, {\"Thu\", 40}, {\"Fri\", 44}, {\"Sat\", 48}, {\"Sun\", 52}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\n\n LinkedHashMap<String, Integer> result = solObj.dateToDay(input1);\n assertEquals(expected1, result);\n\n }", "private Map<String, Double> groupTransactionsByCreditCard(List<CCTransactionRecord> singleDayTransactions) {\n Map<String, Double> clubbedCCTrxMap = new HashMap<>();\n\n singleDayTransactions.forEach(singleDayTransactionRecord -> {\n\n String ccHashNum = singleDayTransactionRecord.getCcHashNum();\n double trxAmount = singleDayTransactionRecord.getTrxAmount();\n\n if (!clubbedCCTrxMap.containsKey(ccHashNum)) {\n\n clubbedCCTrxMap.put(ccHashNum, trxAmount);\n\n } else {\n\n clubbedCCTrxMap.put(ccHashNum, (clubbedCCTrxMap.get(ccHashNum)) + trxAmount);\n }\n });\n\n clubbedCCTrxMap.forEach((key, value) -> LOGGER.trace(key + \" credit card spent \" + value + \"on that day\"));\n\n return clubbedCCTrxMap;\n }", "public AggregationPeriod aggregation() {\n\t\treturn message.getAggregation();\n\t}", "public ObservableList<Date> getStudentDays(int studentID);", "void compressRDateComponents(final VTimeZone vtz) {\n // Map the similar sub-components together\n final Map<SimilarMapKey, List<Component>> similarMap = new HashMap<>();\n\n for (final Object o: vtz.getObservances()) {\n final Component comp = (Component)o;\n final SimilarMapKey key = new SimilarMapKey(comp);\n\n if (comp.getProperty(Property.RDATE) != null) {\n List<Component> comps = similarMap.get(key);\n\n if (comps == null) {\n comps = new ArrayList<>();\n similarMap.put(key, comps);\n }\n comps.add(comp);\n }\n }\n\n // Merge similar\n for (final List<Component> values: similarMap.values()) {\n if (values.size() > 1) {\n Component mergeTo = null;\n for (final Component mergeFrom: values) {\n if (mergeTo == null) {\n mergeTo = mergeFrom;\n continue;\n }\n\n // Copy RDATE from to and remove from actual timezone\n final Property prop = mergeFrom.getProperty(Property.RDATE);\n mergeTo.getProperties().add(prop);\n vtz.getObservances().remove(mergeFrom);\n }\n }\n }\n }", "@Test\n public void testDate()\n {\n\n testQuery(\n PLANNER_CONFIG_DEFAULT,\n QUERY_CONTEXT_DEFAULT,\n ImmutableList.of(\n new SqlParameter(SqlType.INTEGER, 10),\n new SqlParameter(\n SqlType.DATE,\n \"2999-01-01\"\n )\n ),\n \"SELECT exp(count(*)) + ?, sum(m2) FROM druid.foo WHERE __time >= ?\",\n CalciteTests.REGULAR_USER_AUTH_RESULT,\n ImmutableList.of(Druids.newTimeseriesQueryBuilder()\n .dataSource(CalciteTests.DATASOURCE1)\n .intervals(querySegmentSpec(Intervals.of(\n \"2999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z\")))\n .granularity(Granularities.ALL)\n .aggregators(aggregators(\n new CountAggregatorFactory(\"a0\"),\n new DoubleSumAggregatorFactory(\"a1\", \"m2\")\n ))\n .postAggregators(\n expressionPostAgg(\"p0\", \"(exp(\\\"a0\\\") + 10)\")\n )\n .context(QUERY_CONTEXT_DEFAULT)\n .build()),\n ImmutableList.of(\n new Object[]{11.0, NullHandling.defaultDoubleValue()}\n )\n );\n }", "@Override\n public Object build() {\n return innerAggregationBuilder.getAggregations();\n }", "public Timestamp getDateOrdered();", "@Projection(name=\"summary\", types = TvSeriesSummary.class)\npublic interface TvSeriesSummaryProjection {\n Date getLastUpdateDate();\n}", "Record getShortTermCompEffAndExpDates(Record inputRecord);", "public JavaPairRDD<String, Tuple2<Iterable<Integer>, Iterable<Integer>>> cogroupExample(){\n return firstSet\n .cogroup(secondSet);\n }", "public Map<Number, Double> getThePastPrices(Number stockID, Number stDate, Number enDate) {\n Map<Number, Double> m = new HashMap<Number, Double>();\n\n //get VO instance\n TestStockPricesVOImpl tspVO = getTestStockPricesVO();\n\n //get VC instance\n ViewCriteria vc =\n tspVO.getViewCriteria(\"GetStockPricesInGivenDateRangeCriteria\");\n vc.resetCriteria();\n\n //set All the bind parameters\n tspVO.setBindStockID(stockID);\n tspVO.setBindStartDate(stDate);\n tspVO.setBindEndDate(enDate);\n \n //apply the view criteria\n tspVO.applyViewCriteria(vc);\n \n //execute the view Object programatically\n tspVO.executeQuery();\n System.out.print(\"Row count: \");\n System.out.println(tspVO.getRowCount());\n\n //Iterate through the results\n RowSetIterator it = tspVO.createRowSetIterator(null);\n while (it.hasNext()) {\n TestStockPricesVORowImpl newRow = (TestStockPricesVORowImpl)it.next();\n Number datetracked = newRow.getDatetracked();\n Number timetracked = newRow.getTimetracked();\n Number price = newRow.getPrice();\n \n m.put(datetracked, price.doubleValue());\n }\n it.closeRowSetIterator();\n return m;\n }", "public Series( String name, SortedMap<String, Long> dateCounters, SortedMap<String, Long> totalCounters ) {\n\t\tthis.name = name;\n\t\tthis.type = DEFAULT_TYPE;\n\t\tdata = new ArrayList<Double[]>();\n\t\tfor ( Entry<String, Long> dateCounter : dateCounters.entrySet() ) {\n\t\t\tlong timestamp = DateConverter.dateStringToTimestamp( dateCounter.getKey() );\n\t\t\t// get the total count for this date\n\t\t\tlong total = totalCounters.get( dateCounter.getKey() );\n\t\t\t// Avoid a divide by 0 if we simply don't have data for this time\n\t\t\tif ( total != 0 ) {\n\t\t\t\tdata.add( new Double [] { new Double(timestamp), new Double((double)dateCounter.getValue() / (double)total) * 100d } );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdata.add( new Double [] { new Double(timestamp), 0d } );\n\t\t\t}\n\t\t}\n\t}", "Map<Date, Double> getValues(final FinancialAnalysisParameter financialParameter,\n final Date dateFrom, final Date dateTo);", "List<Map<String, Object>> getIngredients(String productCode, LocalDate date);", "public void aggregateResults()\n\t{\n\t\ttry {\n\t\t\tAggregateableEvaluation aggContNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(0));\n\t\t\tAggregateableEvaluation aggContSMO = new AggregateableEvaluation(this.evalSMOList.get(0));\n\t\t\tAggregateableEvaluation aggDonaNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(15));\n\t\t\tAggregateableEvaluation aggDonaSMO = new AggregateableEvaluation(this.evalSMOList.get(15));\n\t\t\tAggregateableEvaluation aggOffiNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(30));\n\t\t\tAggregateableEvaluation aggOffiSMO = new AggregateableEvaluation(this.evalSMOList.get(30));\n\t\t\tAggregateableEvaluation aggAdviNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(45));\n\t\t\tAggregateableEvaluation aggAdviSMO = new AggregateableEvaluation(this.evalSMOList.get(45));\n\t\t\tAggregateableEvaluation aggMultNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(60));\n\t\t\tAggregateableEvaluation aggMultSMO = new AggregateableEvaluation(this.evalSMOList.get(60));\n\t\t\tAggregateableEvaluation aggGoodNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(75));\n\t\t\tAggregateableEvaluation aggGoodSMO = new AggregateableEvaluation(this.evalSMOList.get(75));\n\t\t\t\n\n\t\t\tfor (int i = 1; i < 15; i++)\n\t\t\t{\n\t\t\t\taggContNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggContSMO.aggregate(this.evalSMOList.get(i));\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 16; i < 30; i++)\n\t\t\t{\n\t\t\t\taggDonaNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggDonaSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 31; i < 45; i++)\n\t\t\t{\n\t\t\t\taggOffiNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggOffiSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 46; i < 60; i++)\n\t\t\t{\n\t\t\t\taggAdviNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggAdviSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 61; i < 75; i++)\n\t\t\t{\n\t\t\t\taggMultNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggMultSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 76; i < 90; i++)\n\t\t\t{\n\t\t\t\taggGoodNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggGoodSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int a = 0; a < 6; a++)\n\t\t\t{\n\t\t\t\tString aggregateText;\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0: aggregateText = \"ContinuingNewsAggregateResults.txt\"; break;\n\t\t\t\tcase 1: aggregateText = \"DonationsAggregateResults.txt\"; break;\n\t\t\t\tcase 2: aggregateText = \"OfficialAggregateResults.txt\"; break;\n\t\t\t\tcase 3: aggregateText = \"AdviceAggregateResults.txt\"; break;\n\t\t\t\tcase 4: aggregateText = \"MultimediaAggregateResults.txt\"; break;\n\t\t\t\tcase 5: aggregateText = \"GoodsAggregateResults.txt\"; break;\n\t\t\t\tdefault: aggregateText = \"CompleteAggregateResults.txt\";\n\t\t\t\t}\n\n\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(aggregateText));\n\t\t\t\tbw.write(\"=== Summary of Naive Bayes ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContNaive.toSummaryString());\n\t\t\t\tbw.write(aggContNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggContNaive.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaNaive.toSummaryString());\n\t\t\t\tbw.write(aggDonaNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaNaive.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiNaive.toSummaryString());\n\t\t\t\tbw.write(aggOffiNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiNaive.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviNaive.toSummaryString());\n\t\t\t\tbw.write(aggAdviNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviNaive.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultNaive.toSummaryString());\n\t\t\t\tbw.write(aggMultNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggMultNaive.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodNaive.toSummaryString());\n\t\t\t\tbw.write(aggGoodNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodNaive.toMatrixString()); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.write(\"=== Summary of SMO ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContSMO.toSummaryString());\n\t\t\t\tbw.write(aggContSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggContSMO.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaSMO.toSummaryString());\n\t\t\t\tbw.write(aggDonaSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaSMO.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiSMO.toSummaryString());\n\t\t\t\tbw.write(aggOffiSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiSMO.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviSMO.toSummaryString());\n\t\t\t\tbw.write(aggAdviSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviSMO.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultSMO.toSummaryString());\n\t\t\t\tbw.write(aggMultSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggMultSMO.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodSMO.toSummaryString());\n\t\t\t\tbw.write(aggGoodSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodSMO.toMatrixString()); \t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.close();\n\t\t\t}\n\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static final double[] cumulate(double[] V){\n\t\n \tdouble[]vec = new double[periodNum];\t\n\t//Vector vec = new Vector(periodNum);\n\t//\tfor(int i=0;i<periodNum;i++)\n\t// vec.insertElementAt((new Double(0)),i);\n\t\n\tdouble sum =0;\n\tfor(int i=0;i<periodNum;i++)\n\t{\n\t sum += V[i];//((Double)V.elementAt(i)).doubleValue();\n\t vec[i] = sum;\n\t //vec.addElement(new Double(sum));\n\t}\n\t\n\treturn vec;\n }", "public DateInfo getDate() {\r\n\t\treturn new DateInfo(super.getDate());\r\n\t\t//return new DateInfo(maturityDate);\r\n\t}", "@Override\n\tprotected void convertChartDataPacksToSciomeSeries(ChartKey[] keys, List<ChartDataPack> chartPacks)\n\t{\n\n\t\tChartKey key = keys[0];\n\t\tList<SciomeSeries<Number, Number>> seriesData = new ArrayList<>();\n\n\t\tfor (ChartDataPack chartDataPack : getChartDataPacks())\n\t\t{\n\t\t\tList<ChartData> doubleList = new ArrayList<>();\n\t\t\tfor (ChartData chartData : chartDataPack.getChartData())\n\t\t\t{\n\t\t\t\tDouble dataPoint = (Double) chartData.getDataPoints().get(key);\n\t\t\t\tif (dataPoint == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tdoubleList.add(chartData);\n\t\t\t}\n\n\t\t\tdoubleList.sort(new Comparator<ChartData>() {\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(ChartData o1, ChartData o2)\n\t\t\t\t{\n\t\t\t\t\treturn ((Double) o1.getDataPoints().get(key))\n\t\t\t\t\t\t\t.compareTo((Double) o2.getDataPoints().get(key));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tint i = 0;\n\t\t\tSciomeSeries<Number, Number> series = new SciomeSeries<>();\n\t\t\tseries.setName(chartDataPack.getName());\n\t\t\tDouble accumulation = 0.0;\n\n\t\t\tint count = 0;\n\t\t\tDouble currentValue = null;\n\t\t\tList<Object> charttableObjectsMasterList = new ArrayList<>();\n\t\t\tList<Object> charttableObjects = new ArrayList<>();\n\t\t\t/*\n\t\t\t * start adding accumulation values\n\t\t\t */\n\n\t\t\t// a list that will store the values associated with the object.\n\t\t\tList<Double> valuesList = new ArrayList<>();\n\t\t\tfor (ChartData value : doubleList)\n\t\t\t{\n\t\t\t\tDouble newValue = (Double) value.getDataPoints().get(key);\n\t\t\t\tif (!newValue.equals(currentValue) && currentValue != null)\n\t\t\t\t{\n\n\t\t\t\t\tif (charttableObjects.size() == 1) // we are in the area before the modulus kicks in.\n\t\t\t\t\t{\n\t\t\t\t\t\tint adds = 0;\n\t\t\t\t\t\tint j = i - 1;\n\t\t\t\t\t\twhile (adds < MAX_PREV_OBJECTS_TO_STORE && j >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcharttableObjects.add(charttableObjectsMasterList.get(j));\n\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t\tadds++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tAccumulationData theData = new AccumulationData(\"\", currentValue, accumulation,\n\t\t\t\t\t\t\tcharttableObjects, valuesList);\n\t\t\t\t\tseries.getData().add(theData);\n\t\t\t\t\tcharttableObjects = new ArrayList<>();\n\t\t\t\t\tvaluesList = new ArrayList<>();\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t\tvaluesList.add(newValue);\n\t\t\t\tcharttableObjects.add(value.getCharttableObject());\n\t\t\t\tcharttableObjectsMasterList.add(value.getCharttableObject());\n\t\t\t\taccumulation++;\n\t\t\t\tcurrentValue = newValue;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t// get the last one\n\t\t\tif (currentValue != null)\n\t\t\t{\n\t\t\t\tAccumulationData theData = new AccumulationData(\"\", currentValue, accumulation,\n\t\t\t\t\t\tcharttableObjects, valuesList);\n\t\t\t\tseries.getData().add(theData);\n\t\t\t}\n\t\t\tseriesData.add(series);\n\n\t\t}\n\n\t\tsetSeriesData(seriesData);\n\n\t}", "int mergeIntervals(Interval arr[], int n) {\n if (n <= 0)\n return 0;\n\n // Create an empty stack of intervals\n Stack<Interval> s = new Stack<>();\n\n // sort the intervals in increasing order of start time\n // sort(arr, arr+n, compareInterval);\n Arrays.sort(arr, (o1, o2) -> {\n return o1.start - o2.start;\n });\n // push the first interval to stack\n s.push(arr[0]);\n\n // Start from the next interval and merge if necessary\n for (int i = 1; i < n; i++) {\n // get interval from stack top\n Interval top = s.peek();\n\n // if current interval is not overlapping with stack top,\n // push it to the stack\n if (top.end < arr[i].start)\n s.push(arr[i]);\n\n // Otherwise update the ending time of top if ending of current\n // interval is more\n else if (top.end < arr[i].end) {\n top.end = arr[i].end;\n s.pop();\n s.push(top);\n }\n }\n\n // Print contents of stack\n\n int count = 0;\n while (!s.empty()) {\n Interval t = s.peek();\n count += (t.end - t.start + 1);\n s.pop();\n }\n System.out.println(count);\n return count;\n }", "Map<Date, Float> getFullCPM(Step step) throws SQLException;", "private Map<String, Double> getValuesForMetricGranularityAndDate(final String metricId,\n final String groupBy, final Date collectDate) {\n final List<MetricTrendValue> values =\n this.trendValueDao.getValuesForGranularityAndDate(metricId, groupBy, collectDate);\n final Map<String, Double> result = new HashMap<String, Double>();\n for (final MetricTrendValue trendValue : values) {\n result.put(trendValue.getGroupByValue(), trendValue.getValue());\n }\n return result;\n }", "public DailyReport genDailyReport(GregorianCalendar date) \n\t\t\tthrows SQLException, ClassNotFoundException, IOException\n\t{\n\t\tif(this.conn == null)\n\t\t\tthis.conn = JDBCConnection.getConnection();\n\n\t\tString sql = \"SELECT I.upc, \\n\" +\n\t\t\t\t \t \" I.category, \\n\" +\n\t\t\t\t \t \" I.price, \\n\" +\n\t\t\t\t \t \" PI.quantity, \\n\" +\n\t\t\t\t \t \" I.price * PI.quantity \\n\" +\n\t\t\t\t \t \"FROM Purchase P, PurchaseItem PI, Item I \\n\" +\n\t\t\t\t \t \"WHERE P.receiptId = PI.receiptId AND \\n\" +\n\t\t\t\t \t \" PI.upc = I.upc AND \\n\" +\n\t\t\t\t \t \" P.pDate = ? \\n\" +\n\t\t\t\t \t \"ORDER BY I.category \\n\";\n\t\tPreparedStatement stmt = conn.prepareStatement(sql);\n\t\tDate temp = new Date(date.get(Calendar.YEAR) - 1900, \n\t\t\t\t\t\t\t date.get(Calendar.MONTH) - 1, \n\t\t\t\t\t\t\t date.get(Calendar.DAY_OF_MONTH));\n\t\tstmt.setDate(1, temp);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tResultSet result = stmt.executeQuery();\n\t\t\tArrayList<Triple<String, ArrayList<ReportItem>, Double>>\n\t\t\t\ttuples = new ArrayList<Triple<String, ArrayList<ReportItem>, Double>>();\n\n\t\t\tif(!result.next())\n\t\t\t//if empty resultset, return empty report\n\t\t\t\treturn new DailyReport(tuples);\n\t\t\t\n\t\t\t//3 Passes:\n\t\t\t//1st: Store everything on the list\n\t\t\tArrayList<ReportItem> raw_list = new ArrayList<ReportItem>();\n\t\t\tdo\n\t\t\t{\n\t\t\t\tString upc = result.getString(1);\n\t\t\t\tString cat = result.getString(2);\n\t\t\t\tdouble price_$ = result.getDouble(3);\n\t\t\t\tint qty_sold = result.getInt(4);\n\t\t\t\tdouble total_$ = result.getDouble(5);\n\n\t\t\t\tReportItem item = new ReportItem(upc, cat, price_$, qty_sold, total_$);\n\t\t\t\traw_list.add(item);\t\n\t\t\t}while(result.next());\n\t\t\t\n\t\t\t//2nd: combine any duplicate item\n\t\t\tArrayList<ReportItem> lst_no_dup = new ArrayList<ReportItem>();\n\t\t\tfor(int row = 0; row < raw_list.size(); row++)\n\t\t\t{\n\t\t\t\tString current_upc = raw_list.get(row).getUPC();\n\t\t\t\tint unit_sold = raw_list.get(row).getUnits();\n\t\t\t\tdouble item_total = raw_list.get(row).getTotalSale();\n\t\t\t\tfor(int fol_row = row + 1; \n\t\t\t\t\tfol_row < raw_list.size() && \n\t\t\t\t\t\t\traw_list.get(fol_row).getUPC().equals(current_upc); \n\t\t\t\t\tfol_row++)\n\t\t\t\t{\n\t\t\t\t\tunit_sold += raw_list.get(fol_row).getUnits();\n\t\t\t\t\titem_total += raw_list.get(fol_row).getTotalSale();\n\t\t\t\t\trow = fol_row;\n\t\t\t\t}\n\t\t\t\tReportItem itm = new ReportItem(raw_list.get(row).getUPC(),\n\t\t\t\t\t\t\t\t\t\t\t\traw_list.get(row).getCategory(),\n\t\t\t\t\t\t\t\t\t\t\t\traw_list.get(row).getUnitPrices(),\n\t\t\t\t\t\t\t\t\t\t\t\tunit_sold, item_total);\n\t\t\t\tlst_no_dup.add(itm);\n\t\t\t}\n\t\t\t\n\t\t\t//3rd: accounting for each category\n\t\t\tfor(int row = 0; row < lst_no_dup.size(); row++)\n\t\t\t{\n\t\t\t\tString current_cat = lst_no_dup.get(row).getCategory();\n\t\t\t\tdouble cat_total = lst_no_dup.get(row).getTotalSale();\n\t\t\t\tint start_ind = row;\n\t\t\t\tint end_ind = row;\n\t\t\t\tfor(int fol_row = row + 1; \n\t\t\t\t\tfol_row < lst_no_dup.size() && \n\t\t\t\t\tlst_no_dup.get(fol_row).getCategory().equals(current_cat);\n\t\t\t\t\tfol_row++)\n\t\t\t\t{\n\t\t\t\t\tcat_total += lst_no_dup.get(fol_row).getTotalSale();\n\t\t\t\t\trow = fol_row;\n\t\t\t\t\tend_ind++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//make a sublist:\n\t\t\t\tArrayList<ReportItem> sublist = new ArrayList<ReportItem>();\n\t\t\t\tfor(int col = start_ind; col <= end_ind; col++)\n\t\t\t\t\tsublist.add(lst_no_dup.get(col));\n\t\t\t\t\n\t\t\t\tTriple<String, ArrayList<ReportItem>, Double>\n\t\t\t\ta_tuple = new Triple<String, ArrayList<ReportItem>, Double>\n\t\t\t\t\t\t\t\t(current_cat, sublist, new Double(cat_total));\n\t\t\t\ttuples.add(a_tuple);\n\t\t\t}\n\t\t\t\n\t\t\treturn new DailyReport(tuples);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstmt.close();\n\t\t}\n\t}", "private Map<Species, Integer> mergeObservedSpeciesMap(List<Map<Species, Integer>> observedSpecies) {\n Map<Species, Integer> mergedMap = new HashMap<>();\n\n for (Map<Species, Integer> watchlist : observedSpecies) {\n for (Species species : watchlist.keySet()) {\n if (mergedMap.containsKey(species)) {\n mergedMap.put(species, mergedMap.get(species) + watchlist.get(species));\n } else {\n mergedMap.put(species, watchlist.get(species));\n }\n }\n }\n return mergedMap;\n }", "private Weet[] toOnArray(Date date) {\n /**\n * Used by getWeetsOn(Date dateOn) for returning an array of weets posted on a given date.\n * A differently named method is here required as the order and type of parameters would otherwise\n * conflict with the method toArray(Date date). Calling the function of type toArray(root, height, dwArray, date)\n * would lead to the execution of an inappropriate Date comparison between the given date and the weet's date.\n */\n c = 0;\n\n Weet[] dwArray = new Weet[size];\n Weet[] chArray = new Weet[c]; \n\n toArray(root, date, height, dwArray);\n chArray = dwArray.clone();\n return chArray;\n }" ]
[ "0.5755842", "0.4892607", "0.4818243", "0.48146477", "0.48043513", "0.4777092", "0.47763124", "0.47581333", "0.47503123", "0.4745598", "0.47343662", "0.46821913", "0.4674756", "0.46663922", "0.46275982", "0.46092623", "0.46051797", "0.45939755", "0.45929897", "0.45900938", "0.45570472", "0.45379296", "0.45357853", "0.45356634", "0.45310184", "0.450858", "0.4502395", "0.4498326", "0.44805643", "0.44765386", "0.44536722", "0.4427279", "0.44016704", "0.4395532", "0.43910468", "0.43807986", "0.43767422", "0.4375083", "0.4372904", "0.43703225", "0.43690675", "0.43559334", "0.4344435", "0.43397722", "0.43243802", "0.43181068", "0.43047372", "0.43014413", "0.42953664", "0.429345", "0.42885974", "0.4284941", "0.42847842", "0.42328668", "0.422794", "0.42265803", "0.4215058", "0.42107624", "0.4199708", "0.41988394", "0.41977015", "0.41864365", "0.41796735", "0.417253", "0.41705388", "0.4170435", "0.4169818", "0.41683137", "0.416584", "0.4146962", "0.41328835", "0.4132046", "0.41317394", "0.4129315", "0.4127988", "0.41207212", "0.41181788", "0.4110872", "0.41079223", "0.4106225", "0.41027415", "0.41023067", "0.410178", "0.4099278", "0.40968454", "0.40926686", "0.4085025", "0.4079178", "0.40728295", "0.40724245", "0.40635288", "0.4060678", "0.40600082", "0.40552035", "0.40539956", "0.40538296", "0.40482214", "0.40481138", "0.40474117", "0.4041069" ]
0.48002407
5
Retrieve the Effective Date
public org.drip.analytics.date.JulianDate effective() { try { return new org.drip.analytics.date.JulianDate (_lsPeriod.get (0).startDate()); } catch (java.lang.Exception e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Date getEffectiveDate() {\r\n return effectiveDate;\r\n }", "public Date getEffectiveDate() {\n return effectiveDate;\n }", "public Date getEffectiveDate() {\n return effectiveDate;\n }", "public Date getEffectiveDate() {\n return effectiveDate;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getEffectiveDate();", "public Date getEffDate() {\r\n return this.effDate;\r\n }", "public Date getEffectivedateTo() {\n return (Date) getAttributeInternal(EFFECTIVEDATETO);\n }", "public DTM getProductServiceEffectiveDate() { \r\n\t\tDTM retVal = this.getTypedField(10, 0);\r\n\t\treturn retVal;\r\n }", "public String getDate_effet() {\r\n\t\treturn date_effet;\r\n\t}", "@Override\n public Date getEffectiveDateForPerDiem(java.sql.Timestamp expenseDate) {\n if (getTripBegin() == null) {\n return new java.sql.Date(getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis());\n }\n return new java.sql.Date(getTripBegin().getTime());\n }", "public java.util.Date getDateEffectiveTo() {\n\t\treturn dateEffectiveTo;\n\t}", "public Date getEFF_DATE() {\r\n return EFF_DATE;\r\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getRenewalEffectiveDate();", "public DTM getPsl10_ProductServiceEffectiveDate() { \r\n\t\tDTM retVal = this.getTypedField(10, 0);\r\n\t\treturn retVal;\r\n }", "Date getEDate();", "public Date getEffectivedateFrom() {\n return (Date) getAttributeInternal(EFFECTIVEDATEFROM);\n }", "ValuationDate getValuationDate();", "@Override\n public Date getEffectiveDateForPerDiem(PerDiemExpense expense) {\n if (getTripBegin() == null) {\n return new java.sql.Date(getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis());\n }\n return new java.sql.Date(getTripBegin().getTime());\n }", "Date getModifyDate();", "public java.util.Date getDateEffectiveFrom() {\n\t\treturn dateEffectiveFrom;\n\t}", "Date getInvoicedDate();", "com.google.type.Date getExpireDate();", "long getTradeDate();", "public ChangeDate getChangeDate() {\n return changeDate;\n }", "public ChangeDate getChangeDate() {\n return changeDate;\n }", "public Date getExpDate() {\n return this.expDate;\n }", "public String getLeavingDate();", "public LocalDate getDate() {\r\n\t\treturn loanDate;\r\n\t}", "public void setEffDate(Date value) {\r\n this.effDate = value;\r\n }", "public DateInfo getDate() {\r\n\t\treturn new DateInfo(super.getDate());\r\n\t\t//return new DateInfo(maturityDate);\r\n\t}", "public void setEffectiveDate(java.util.Date value);", "public java.util.Date getApproveExpenseDate () {\n\t\treturn approveExpenseDate;\n\t}", "Date getExpiredDate();", "@SuppressWarnings(\"unchecked\")\n public <O> Optional<O> effectiveNow() {\n return journal.journal\n .retrieve(BarbelQueries.effectiveNow(journal.id),\n queryOptions(orderBy(ascending(BarbelQueries.EFFECTIVE_FROM))))\n .stream().map(d -> journal.processingState.expose(journal.context, (Bitemporal) d)).findFirst()\n .flatMap(o -> Optional.of((Bitemporal) o));\n }", "public java.util.Date getCivDate () {\n\t\treturn civDate;\n\t}", "public Date getAuditDate() {\n return auditDate;\n }", "public Date getDateModificate() {\n return dateModificate;\n }", "Date getDueDate();", "Date getDueDate();", "public Date getFechaInclusion()\r\n/* 150: */ {\r\n/* 151:170 */ return this.fechaInclusion;\r\n/* 152: */ }", "java.lang.String getFoundingDate();", "public boolean DefaultEffectiveDate() throws Exception {\n\t\tboolean status = false;\n\t\tString sCurrentDate = SCRCommon.ReturnCurrentDate();\n\t\tstatus = common.SafeAction(Common.o.getObject(\"edtAutoIdCardEndorsementEffDate\"), sCurrentDate, \"edt\");\n\t\treturn status;\n\t}", "public Date getRealEstablish() {\r\n return realEstablish;\r\n }", "public Date getFechaExclusion()\r\n/* 160: */ {\r\n/* 161:178 */ return this.fechaExclusion;\r\n/* 162: */ }", "com.google.type.Date getAcquireDate();", "@Override\n public String getResumeDate() {\n return operate_time;\n }", "long getFetchedDate();", "@Override\n\tpublic java.util.Date getModifiedDate() {\n\t\treturn _employee.getModifiedDate();\n\t}", "public java.util.Date getDateOfExamination(){\n return localDateOfExamination;\n }", "public DTM getProductServiceExpirationDate() { \r\n\t\tDTM retVal = this.getTypedField(11, 0);\r\n\t\treturn retVal;\r\n }", "public DateAdp Modified_latest() {return modified_latest;}", "Record getShortTermCompEffAndExpDates(Record inputRecord);", "Date getPriorDate();", "public Date getAppliedDate() {\r\n\t\treturn appliedDate;\r\n\t}", "LocalDate getDate();", "public Date getDepartureDate();", "public String Get_date() \n {\n \n return date;\n }", "public Record getCoverageContiguousEffectiveDate(Record record);", "public Date getIssuanceDate() {\n return (Date) getAttributeInternal(ISSUANCEDATE);\n }", "public Date getEstablishDate() {\r\n return establishDate;\r\n }", "Date getDate();", "Date getDate();", "Date getDate();", "public java.lang.String getPolicyEffectiveDate() {\n return policyEffectiveDate;\n }", "public String getEmotionDate() {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\", Locale.CANADA);\n return dateFormat.format(emotionDate);\n }", "long getDate() { return (act != null ? act.getDate() : 0); }", "public void setEffectiveDate(Date effectiveDate) {\r\n this.effectiveDate = effectiveDate;\r\n }", "public java.sql.Date getDateemission() {\r\n\t\treturn dateemission;\r\n\t}", "public Date getEditDate()\r\n/* */ {\r\n/* 186 */ return this.editDate;\r\n/* */ }", "public Calendar getReturnDate()\n {\n /*New Calendar for Return Date*/\n Calendar dueDate = Calendar.getInstance();\n\n /*Month is Current Month*/\n dueDate.set(today.MONTH, today.get(today.MONTH));\n /*Year is Current Year*/\n dueDate.set(today.YEAR, today.get(today.YEAR));\n /*Due Date is 21 Days Later*/\n dueDate.set(today.DATE, today.get(today.DATE + 21));\n\n return dueDate;\n }", "@Override\n public Date getEffectiveDateForMileageRate(PerDiemExpense expense) {\n if (getTripBegin() == null) {\n return new java.sql.Date(getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis());\n }\n return new java.sql.Date(getTripBegin().getTime());\n }", "public String getReturnDate();", "public java.util.Date getDateExamine () {\n\t\treturn dateExamine;\n\t}", "public Date getAuditDate() {\n\t\treturn auditDate;\n\t}", "public LocalDate getRecommendDate() {\n\t\treturn RecommendDate;\n\t}", "@Override\n public LocalDate getReturnDate() {\n return returnDate;\n }", "String getCoverageExpirationDate(Record inputRecord);", "@Override\n public Date getEffectiveDateForMileageRate(ActualExpense expense) {\n if (getTripBegin() == null) {\n return new java.sql.Date(getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis());\n }\n return new java.sql.Date(getTripBegin().getTime());\n }", "public Date getCreDate() {\n return creDate;\n }", "public String getTgtEffDate() {\n\t\treturn tgtEffDate;\n\t}", "public void setEffectiveDate(Date effectiveDate) {\n this.effectiveDate = effectiveDate;\n }", "public void setEffectiveDate(Date effectiveDate) {\n this.effectiveDate = effectiveDate;\n }", "public void setEffectiveDate(Date effectiveDate) {\n this.effectiveDate = effectiveDate;\n }", "public abstract Date getExpirationDate();", "@Override\n public java.util.Date getModifiedDate() {\n return _partido.getModifiedDate();\n }", "public Date getCocIssueDate() {\n\t\treturn cocIssueDate;\n\t}", "public Date getModifiedDate();", "public Date getModifiedDate();", "public Date getModifiedDate();", "String getPreviousCloseDate();", "public Date getdModifyDate() {\r\n return dModifyDate;\r\n }", "public Date getdModifyDate() {\r\n return dModifyDate;\r\n }", "public java.util.Date getAdjustedDate() {\n\t}", "java.lang.String getToDate();", "@Override\n\tpublic Date getDate() {\n\t\treturn this.description.getDate();\n\t}", "long getEndDate();", "long getEndDate();", "public LocalDate getDate() {\n\t\treturn this.date;\n\t}", "public Date getExpiryDate()\n {\n return expiryDate;\n }", "public java.util.Date getRevisedDate () {\n\t\treturn revisedDate;\n\t}" ]
[ "0.7494322", "0.7490041", "0.7490041", "0.7490041", "0.74815875", "0.71854234", "0.7106792", "0.70981103", "0.7006767", "0.69009805", "0.684399", "0.6820626", "0.67946416", "0.66917694", "0.6679812", "0.6650035", "0.6605467", "0.66026855", "0.6564741", "0.65444803", "0.65081185", "0.6453979", "0.6421679", "0.63855356", "0.63855356", "0.63440526", "0.63058686", "0.63021547", "0.62970334", "0.6285164", "0.62490374", "0.6246951", "0.620534", "0.6182302", "0.6177973", "0.6175187", "0.61619407", "0.61614674", "0.61614674", "0.6158911", "0.6153258", "0.6145502", "0.6142956", "0.61418337", "0.6139717", "0.6130077", "0.6129697", "0.61223984", "0.61129797", "0.61073226", "0.6100157", "0.6092744", "0.60918194", "0.6077763", "0.60754174", "0.6072765", "0.6063448", "0.6059032", "0.6052376", "0.60398155", "0.60375804", "0.60375804", "0.60375804", "0.60230166", "0.60207963", "0.6012875", "0.60110956", "0.60101306", "0.6001176", "0.59975225", "0.5990623", "0.5980822", "0.59777427", "0.5977707", "0.5977327", "0.5975253", "0.5971509", "0.5968621", "0.59679216", "0.5965296", "0.5939756", "0.5939756", "0.5939756", "0.5936287", "0.59362626", "0.593048", "0.59132355", "0.59132355", "0.59132355", "0.59048533", "0.5903633", "0.5903633", "0.59003747", "0.59003055", "0.5899391", "0.58951247", "0.58951247", "0.58936584", "0.5892373", "0.5888564" ]
0.64407796
22
Retrieve the Maturity Date
public org.drip.analytics.date.JulianDate maturity() { try { return new org.drip.analytics.date.JulianDate (_lsPeriod.get (_lsPeriod.size() - 1).endDate()); } catch (java.lang.Exception e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int finalMaturityDate()\n\t{\n\t\treturn _iFinalMaturityDate;\n\t}", "public DateInfo getDate() {\r\n\t\treturn new DateInfo(super.getDate());\r\n\t\t//return new DateInfo(maturityDate);\r\n\t}", "ValuationDate getValuationDate();", "String getCoverageExpirationDate(Record inputRecord);", "public int getMaturity ()\n {\n return maturity;\n }", "public Date getMATURITY_ENTRY_POSTED_DATE() {\r\n return MATURITY_ENTRY_POSTED_DATE;\r\n }", "public java.util.Date getValidityDateOfLicense() {\n return validityDateOfLicense;\n }", "public String getReturnDate();", "@NonNull\n public Integer getDaysToMaturity() {\n return daysToMaturity;\n }", "public LocalDate getDate() {\r\n\t\treturn loanDate;\r\n\t}", "com.google.type.Date getAcquireDate();", "public Date getIssuanceDate() {\n return (Date) getAttributeInternal(ISSUANCEDATE);\n }", "@FXML\r\n\tString getDate() {\r\n\t\t\tLocalDate creditCardExpiryDate = dpCreditCardExpiryDate.getValue();\r\n\t\t\tDateTimeFormatter formattedExpiryDate = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\");\r\n\t\t\treturn formattedExpiryDate.format(creditCardExpiryDate);\r\n\t}", "Date getDate();", "Date getDate();", "Date getDate();", "@Override\n public Date getEffectiveDateForMileageRate(ActualExpense expense) {\n if (getTripBegin() == null) {\n return new java.sql.Date(getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis());\n }\n return new java.sql.Date(getTripBegin().getTime());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getRenewalEffectiveDate();", "public String Get_date() \n {\n \n return date;\n }", "public DTM getProductServiceEffectiveDate() { \r\n\t\tDTM retVal = this.getTypedField(10, 0);\r\n\t\treturn retVal;\r\n }", "long getSettlementDate();", "public Date getCreDate() {\n return creDate;\n }", "public String getReturnDate() {\n\t\treturn returnDateElement.getAttribute(\"value\");\n\t}", "public Date getDate() {\n if ( expiryDate.isSIPDate() ) {\n Calendar c=( (SIPDate)expiryDate ).getJavaCal();\n return c.getTime();\n }\n else return null; \n }", "public Integer getTesuryocalcYmd() {\r\n return tesuryocalcYmd;\r\n }", "public String matureToString() {\r\n\t\tDateInfo maturityDate = new DateInfo(super.getDate());\r\n\t\tint termOfCD= maturityDate.getMatureLength();\r\n\t\tSystem.out.println(\"The super mature date is\"+ super.getDate()+\" The copy mature date is \"+termOfCD);\r\n\t\tString str;\r\n\t\tint yeer, mnth, dey;\r\n\t\t// creates a calendar to hold mature date\r\n\t\tCalendar matureDate = Calendar.getInstance();\r\n\t\tmatureDate.clear();\r\n\r\n\t\t// sets the date of current Cd\r\n\t\tmatureDate.set(Calendar.MONTH, maturityDate.getMonth());\r\n\t\tmatureDate.set(Calendar.YEAR, maturityDate.getYear());\r\n\t\tmatureDate.set(Calendar.DATE, maturityDate.getDay());\r\n\r\n\t\t// passes year month and day to variables\r\n\t\tyeer = matureDate.get(Calendar.YEAR);\r\n\t\tmnth = matureDate.get(Calendar.MONTH);\r\n\t\tdey = matureDate.get(Calendar.DATE);\r\n\r\n\t\t// creates date info\r\n\t\tDateInfo mature = new DateInfo(yeer, mnth, dey);\r\n\r\n\t\t// if the month in mature == 0\r\n\t\tif (mature.getMonth() == 0)\r\n\t\t\t// set the month to 1\r\n\t\t\tmature.setMonth(1);\r\n\r\n\t\t// mature to string\r\n\t\tstr = (\"Updated On: \" + mature);\r\n\r\n\t\t// ADDS TO THE MONTH OF matureDate THE LENGTH OF MATURITY\r\n\t\tmatureDate.add(Calendar.MONTH, +termOfCD);\r\n\r\n\t\t// passes updated year month and day to variables\r\n\t\tint myeer = matureDate.get(Calendar.YEAR);\r\n\t\tint mmnth = matureDate.get(Calendar.MONTH);\r\n\t\tint mdey = matureDate.get(Calendar.DATE);\r\n\r\n\t\t// update mature dateInfo with new info\r\n\t\tmature = new DateInfo(myeer, mmnth, mdey);\r\n\r\n\t\t// if the month == 0 set the month to 1\r\n\t\tif (mature.getMonth() == 0)\r\n\t\t\tmature.setMonth(1);\r\n\t\t// str = str +(\"\\tMatures On: \"+mature+\"\\t Term Of CD: \"+ termOfCD+\"\\n\");\r\n\r\n\t\t// adds the mature date to str\r\n\t\tstr = str + String.format(\"%nMatures On: %s %n%s %s %n\", mature, \"Term Of CD: \", termOfCD);\r\n\r\n\t\t// return str\r\n\t\treturn str;\r\n\r\n\t}", "public java.util.Date getRequestedDate() {\n\t\treturn _dmHistoryMaritime.getRequestedDate();\n\t}", "public DTM getProductServiceExpirationDate() { \r\n\t\tDTM retVal = this.getTypedField(11, 0);\r\n\t\treturn retVal;\r\n }", "public Date getExpDate() {\n return this.expDate;\n }", "@Override\n public Date getEffectiveDateForMileageRate(PerDiemExpense expense) {\n if (getTripBegin() == null) {\n return new java.sql.Date(getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis());\n }\n return new java.sql.Date(getTripBegin().getTime());\n }", "@Override\n public LocalDate getReturnDate() {\n return returnDate;\n }", "public String getDate_effet() {\r\n\t\treturn date_effet;\r\n\t}", "java.lang.String getDate();", "protected Date getReturnDate() \t{ return this.returnDate; }", "LocalDate getDate();", "public Date getParkingCardEXPDATE() {\n return (Date) getAttributeInternal(PARKINGCARDEXPDATE);\n }", "public Timestamp getInitialIssuanceDate() {\n return initialIssuanceDate;\n }", "public Date getAccessionDateDate() {\n\t\tString t = doc.get(\"collaccessiondate\");\n\n\t\tif (t == null)\n\t\t\treturn null;\n\n\t\ttry {\n\t\t\t// Stored in the form 20090207080305\n\t\t\treturn new Date(DateFieldTools.stringToTime(t));\n\t\t} catch (Throwable e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public abstract Date getExpirationDate();", "public Date getEffectiveDate() {\r\n return effectiveDate;\r\n }", "@Override\n public Date getManufactureDate() {\n return manufacturedOn;\n }", "public Date getEffectiveDate() {\n return effectiveDate;\n }", "public Date getEffectiveDate() {\n return effectiveDate;\n }", "public Date getEffectiveDate() {\n return effectiveDate;\n }", "public abstract MarketDataBox<LocalDate> getValuationDate();", "Date getCreateDate();", "Date getCreateDate();", "long getTradeDate();", "public java.util.Date getCivDate () {\n\t\treturn civDate;\n\t}", "public Date getSpecimenToLabDateTime() {\n\t\treturn specimenToLabDateTime;\n\t}", "public Date getEXPIRY_DATE() {\r\n return EXPIRY_DATE;\r\n }", "final public synchronized Date getDate() {\n return new Date(crtime) ;\n }", "String getDate();", "String getDate();", "public GregorianCalendar getReturnDate(){\n\n\t\treturn ReturnDate;\n\t}", "public Date getSignDate() {\n return signDate;\n }", "public String getLastPaymentDate() {\n\t\treturn stateEqualMasterDao.getElementValueList(\"PAYMENT_DATE\").get(0);\n\t}", "public Date getRegistDt() {\n return registDt;\n }", "public Date getExpiryDate()\n {\n return expiryDate;\n }", "public Date getEffDate() {\r\n return this.effDate;\r\n }", "public Timestamp getDateExpiry( )\r\n {\r\n return _tDateExpiry;\r\n }", "@Override\n\tpublic java.util.Date getCreateDate() {\n\t\treturn _scienceApp.getCreateDate();\n\t}", "long getDate();", "public Date getModifierDate() {\n return modifierDate;\n }", "public Date getCreateDate();", "public Date getCreateDate();", "public Date getCreateDate();", "public String getReturningDate() {\r\n return returningDate;\r\n }", "public DTM getPsl10_ProductServiceEffectiveDate() { \r\n\t\tDTM retVal = this.getTypedField(10, 0);\r\n\t\treturn retVal;\r\n }", "public java.util.Date getDateOfExamination(){\n return localDateOfExamination;\n }", "long getExpirationDate();", "public Date getMlSalterdate() {\n return mlSalterdate;\n }", "public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public java.util.Date getSignDate() {\n\t\treturn _tempNoTiceShipMessage.getSignDate();\n\t}", "public Date mo6949c() {\n try {\n Attribute attribute = this.f4352b.getSignedAttributes().get(CMSAttributes.signingTime);\n if (attribute != null) {\n return ASN1UTCTime.getInstance(attribute.getAttrValues().getObjectAt(0)).getDate();\n }\n return null;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "com.google.type.Date getExpireDate();", "@Override\n\tpublic java.util.Date getCreateDate() {\n\t\treturn _candidate.getCreateDate();\n\t}", "public Date getdate() {\n\t\treturn new Date(date.getTime());\n\t}", "public Date getExpiryDate() {\n return expiryDate;\n }", "public Date getCtDate() {\n return ctDate;\n }", "public LocalDate getDate() {\n return date;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getEffectiveDate();", "Date getDueDate();", "Date getDueDate();", "long getLastBonusTicketDate();", "public Date getCocIssueDate() {\n\t\treturn cocIssueDate;\n\t}", "public int getDate() {\n return date ;\n }", "public Date getDate(){\n\t\treturn date;\n\t}", "public Date getVersionDate ();", "public java.sql.Date getChargedate() {\n\treturn chargedate;\n}", "public Date getEFF_DATE() {\r\n return EFF_DATE;\r\n }", "public Date GetDate();", "public DTM getPsl11_ProductServiceExpirationDate() { \r\n\t\tDTM retVal = this.getTypedField(11, 0);\r\n\t\treturn retVal;\r\n }", "public Date getDate()\n\t{\n\t\treturn date;\n\t}", "public Date getRecdate() {\n return recdate;\n }", "public LocalDate getDate() {\n return date;\n }", "public LocalDate getDate() {\n return date;\n }", "public String getDate()\n\t\t{\n\t\t\treturn date;\n\t\t}", "public Calendar getDate()\n {\n return this.dateOfCreation;\n }" ]
[ "0.7634364", "0.68771505", "0.6712855", "0.66949147", "0.6669534", "0.6624322", "0.65533787", "0.65019983", "0.64803207", "0.647726", "0.6417102", "0.64076227", "0.63452256", "0.63313055", "0.63313055", "0.63313055", "0.62907857", "0.6284071", "0.6279999", "0.622612", "0.62177634", "0.6213245", "0.620133", "0.6197629", "0.6185768", "0.61519444", "0.6136083", "0.6134574", "0.61340505", "0.6128599", "0.6126989", "0.6109556", "0.6101513", "0.60939837", "0.6088854", "0.6079465", "0.60794187", "0.60718894", "0.6067303", "0.60663927", "0.60647315", "0.6064227", "0.6064227", "0.6064227", "0.60570526", "0.6028283", "0.6028283", "0.60231304", "0.60231084", "0.598769", "0.59835654", "0.598277", "0.5982384", "0.5982384", "0.59822685", "0.5981413", "0.5981105", "0.59735966", "0.59684336", "0.59666944", "0.5962627", "0.59601265", "0.5957993", "0.59502", "0.594756", "0.594756", "0.594756", "0.5947379", "0.59469825", "0.5942474", "0.593358", "0.59281164", "0.5920882", "0.5920882", "0.5919469", "0.5912984", "0.59117067", "0.59076697", "0.5906918", "0.58960843", "0.5895595", "0.5874829", "0.5871486", "0.58682585", "0.58682585", "0.5867737", "0.58626723", "0.5861098", "0.58589435", "0.58586586", "0.5852007", "0.5851967", "0.58508724", "0.5850202", "0.584711", "0.5844946", "0.58421564", "0.58421564", "0.58390385", "0.5833595" ]
0.74637014
1
Retrieve the First Coupon Pay Date
public org.drip.analytics.date.JulianDate firstCouponDate() { try { return new org.drip.analytics.date.JulianDate (_lsPeriod.get (0).endDate()); } catch (java.lang.Exception e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static final BondStream FromFirstPenultimateCouponDate (\n\t\tfinal int iMaturityDate,\n\t\tfinal int iEffectiveDate,\n\t\tfinal int iFinalMaturityDate,\n\t\tfinal int iFirstCouponDate,\n\t\tfinal int iPenultimateCouponDate,\n\t\tfinal int iFreq,\n\t\tfinal double dblCoupon,\n\t\tfinal java.lang.String strCouponDC,\n\t\tfinal java.lang.String strAccrualDC,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapPay,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapReset,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapMaturity,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapEffective,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapPeriodEnd,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapAccrualEnd,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapPeriodStart,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapAccrualStart,\n\t\tfinal java.lang.String strMaturityType,\n\t\tfinal boolean bPeriodsFromForward,\n\t\tfinal java.lang.String strCalendar,\n\t\tfinal java.lang.String strCurrency,\n\t\tfinal org.drip.state.identifier.FloaterLabel floaterLabel,\n\t\tfinal org.drip.state.identifier.EntityCDSLabel creditLabel)\n\t{\n\t\tjava.util.List<org.drip.analytics.cashflow.CompositePeriod> lsCouponPeriod = null == floaterLabel ?\n\t\t\torg.drip.product.creator.StreamBuilder.FirstPenultimateDateFixedStream (\n\t\t\t\tiEffectiveDate,\n\t\t\t\tiMaturityDate,\n\t\t\t\tiFirstCouponDate,\n\t\t\t\tiPenultimateCouponDate,\n\t\t\t\tiFreq,\n\t\t\t\tdblCoupon,\n\t\t\t\tstrCouponDC,\n\t\t\t\tstrAccrualDC,\n\t\t\t\tdapPay,\n\t\t\t\tdapMaturity,\n\t\t\t\tdapAccrualEnd,\n\t\t\t\tstrCurrency,\n\t\t\t\tcreditLabel\n\t\t\t) : org.drip.product.creator.StreamBuilder.FirstPenultimateDateFloatStream (\n\t\t\t\tiEffectiveDate,\n\t\t\t\tiMaturityDate,\n\t\t\t\tiFirstCouponDate,\n\t\t\t\tiPenultimateCouponDate,\n\t\t\t\tiFreq,\n\t\t\t\tdblCoupon,\n\t\t\t\tdapPay,\n\t\t\t\tdapMaturity,\n\t\t\t\tdapAccrualEnd,\n\t\t\t\tfloaterLabel,\n\t\t\t\tcreditLabel\n\t\t\t);\n\n\t\ttry {\n\t\t\treturn new BondStream (\n\t\t\t\tlsCouponPeriod,\n\t\t\t\tiFinalMaturityDate,\n\t\t\t\tstrMaturityType\n\t\t\t);\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "public String getJP_AcctDate();", "public int firstSettleDate()\n\t{\n\t\treturn _iFirstSettleDate;\n\t}", "public String getRebillNextDate()\n\t{\n\t\tif(response.containsKey(\"next_date\")) {\n\t\t\treturn response.get(\"next_date\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public String getLastPaymentDate() {\n\t\treturn stateEqualMasterDao.getElementValueList(\"PAYMENT_DATE\").get(0);\n\t}", "Date getInvoicedDate();", "Date getNextIncomeDate() throws BankException {\n logger.warning(\"This account does not support this feature\");\n throw new BankException(\"This account does not support this feature\");\n }", "@Override\n\tpublic java.util.Date getPaymentDate() {\n\t\treturn _esfShooterAffiliationChrono.getPaymentDate();\n\t}", "public static String currentdate() {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tDate date = new Date();\n\t\treturn dateFormat.format(date);\n\n\t}", "@Override\n\tpublic Date getFirstLogin() {\n\t\treturn this.firstLogin;\n\t}", "protected Date findFirstGenDate(GenCtx ctx)\n\t{\n\t\treturn EX.assertn(ctx.get(Date.class));\n\t}", "public Date getNextChargeTime() {\n return nextChargeTime;\n }", "public Date getPAYMENT_DATE() {\r\n return PAYMENT_DATE;\r\n }", "public Date getPAYMENT_DATE() {\r\n return PAYMENT_DATE;\r\n }", "public Date getFirstCreationDate() {\n\t\tDate firstCreationDate = null;\n\t\tUrls orderByCreationDate = getUrlsOrderedByCreationDate(true);\n\t\tif (orderByCreationDate.size() > 0) {\n\t\t\tUrl webLink = (Url) orderByCreationDate.first();\n\t\t\tfirstCreationDate = webLink.getCreationDate();\n\t\t}\n\t\treturn firstCreationDate;\n\t}", "public Date getPayDate() {\n\t\treturn payDate;\n\t}", "String getPreviousCloseDate();", "public Date getRealBillingDate(final Context context)\r\n {\r\n Date billingDate = getBillingDate();\r\n\r\n // Only monthly recharge needs prebill\r\n if (isRecurringRecharge() && SafetyUtil.safeEquals(getChargingCycle(), ChargingCycleEnum.MONTHLY) && !getSub().isPrepaid())\r\n {\r\n boolean isPreBilled = false;\r\n \r\n try\r\n {\r\n if (isPreBilled(context))\r\n {\r\n billingDate = CalendarSupportHelper.get(context).getDayBefore(billingDate);\r\n }\r\n }\r\n catch (final Throwable t)\r\n {\r\n LogSupport.minor(context, this, \"invalid SPID\");\r\n /*\r\n * the chance for such such exception is really low, we can afford to ignore\r\n * it.\r\n */\r\n }\r\n \r\n }\r\n if(getSub().isPrepaid())//The billing date is set in context only to modify receive date using bill date in PPSM transaction for prepaid. \r\n context.put(PostpaidSupportMsisdnTransHome.PPSM_BILLING_DATE,billingDate.getTime()); \r\n\r\n\r\n return billingDate;\r\n }", "public Date getCheckoutDate() {\n return checkoutDate;\n }", "public Date getDebitStartDate() {\n return debitStartDate;\n }", "public Date getBuyDate() {\n return DateUtils.copy(buyDate);\n }", "LocalDate getCheckInDate();", "public Timestamp getInitialIssuanceDate() {\n return initialIssuanceDate;\n }", "@Override\n\tpublic Calendar getInitialDate() {\n\t\treturn Calendar.getInstance();\n\t}", "Date getDueDate();", "Date getDueDate();", "public Date getEarliestFinishingDate();", "public Date getCommencDate() {\n return commencDate;\n }", "private void calculatePaymentDate() {\n\t\t\tBmoReqPayType bmoReqPayType = (BmoReqPayType)reqPayTypeListBox.getSelectedBmObject();\n\t\t\tif (bmoReqPayType == null && bmoRequisition.getReqPayTypeId().toInteger() > 0) {\n\t\t\t\tbmoReqPayType = bmoRequisition.getBmoReqPayType();\n\t\t\t}\n\t\t\tif (bmoReqPayType != null) {\n\t\t\t\tif (!deliveryDateBox.getTextBox().getValue().equals(\"\")) {\n\t\t\t\t\tDate dueDate = DateTimeFormat.getFormat(getUiParams().getSFParams().getDateFormat()).parse(deliveryDateBox.getTextBox().getValue());\n\t\t\t\t\tCalendarUtil.addDaysToDate(dueDate, bmoReqPayType.getDays().toInteger());\n\t\t\t\t\tpaymentDateBox.getDatePicker().setValue(dueDate);\n\t\t\t\t\tpaymentDateBox.getTextBox().setValue(GwtUtil.dateToString(dueDate, getSFParams().getDateFormat()));\n\t\t\t\t}\n\t\t\t} else reqPayTypeListBox.setSelectedId(\"-1\");\t\t\t\t\n\t\t}", "public Date getDeliveryStartDate() {\n return (Date)getAttributeInternal(DELIVERYSTARTDATE);\n }", "public Timestamp getDateConfirm() {\n\t\treturn (Timestamp) get_Value(\"DateConfirm\");\n\t}", "public Date getConnectionStartUpDateTime()\n {\n return new Date(fConnectionStartUpDateTime);\n }", "public String getIncomingPaymentDate() {\n return incomingPaymentDate;\n }", "public Timestamp getBPJSRegistrationDate();", "public LocalDate getDateOfPurchase() {\n return dateOfPurchase;\n }", "public Date getBuyDate() {\n\t\treturn buyDate;\n\t}", "public Date getEarliestStartDate();", "long getSettlementDate();", "java.lang.String getOrderDate();", "public java.sql.Date getChargedate() {\n\treturn chargedate;\n}", "public Date getPaySlipDate() {\n return paySlipDate;\n }", "@Override\r\n\tpublic Date getApp_first_logon_dt() {\n\t\treturn super.getApp_first_logon_dt();\r\n\t}", "@SuppressWarnings(\"static-access\")\n\tpublic String getCurrentProcDate() throws Exception {\n\t\t\n\t\tString queryCurrentProcDate = \n\t\t\t\t\"SELECT TOP 1 DI_PROC_DATE\\r\\n\" + \n\t\t\t\t\"FROM [\" + BaseTest.getWebsite() + \"].STAGING.T_STDI_DISBURSEMENTS\\r\\n\" + \n\t\t\t\t\"ORDER BY DI_PROC_DATE DESC;\";\n\t\t\n\t\tconn.createSQLServerConn();\n\t\ttry {\n\t\t\tcurrentProcDate=conn.fetchCurrentProcessDateFromDB(queryCurrentProcDate);\n\t\t} catch(Exception e) {\n\t\t\tReports.logAMessage(LogStatus.ERROR, \"Exception: \" + e.getMessage());\n\t\t\t//System.out.println(\"Exception error: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn currentProcDate;\n\t}", "public Date getAgcProCertiObtDate() {\n\t\treturn agcProCertiObtDate;\n\t}", "public String getPurchaseDate()\n {\n return purchaseDate;\n }", "public Date getDateOfPurchase() {\n return dateOfPurchase;\n }", "public String getPurchaseDate() {\n return purchaseDate;\n }", "public static LocalDate getFirstOfCurrentMonth() {\n\t\treturn LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());\n\t}", "@Override\n\tpublic FdBusinessDate getCurrencyFdBusinessDate() {\n map.put(\"busiTypeCode\",\"02\");\n map.put(\"subBusiType\",\"01\");\n\t\treturn mapper.selectByPK(map);\n\t}", "@SuppressWarnings(\"static-access\")\n\tpublic String getCurrentCycleDate() throws Exception {\n\t\t String queryCurrentCycleDate = \n\t\t\t\t\t\"SELECT TOP 1 PO_CYCLE_DATE\\r\\n\" + \n\t\t\t\t\t\"FROM [\" + BaseTest.getWebsite() + \"].STAGING.T_STPO_POLICY PO\\r\\n\" + \n\t\t\t\t\t\"LEFT JOIN [\" + BaseTest.getWebsite() + \"].STAGING.T_STTR_TRANSACTION TR \" +\n\t\t\t\t\t\"ON PO.PO_POL_NUM = TR.TR_POL_NUM\\r\\n\" + \n\t\t\t\t\t\"WHERE PO.CURRENT_FLAG = 1\\r\\n\" + \n\t\t\t\t\t\"AND TR.CURRENT_FLAG = 1\\r\\n\" + \n\t\t\t\t\t\"ORDER BY PO.PO_CYCLE_DATE DESC;\";\n\t\t \n\t\t conn.createSQLServerConn();\n\t\t try {\n\t\t\t currentCycleDate=conn.fetchCurrentCycleDateFromDB(queryCurrentCycleDate);\n\t\t } catch(Exception e) {\n\t\t\tReports.logAMessage(LogStatus.ERROR, \"Exception: \" + e.getMessage());\n\t\t\t// System.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t }\n\t\t return currentCycleDate;\n\t}", "public static WithAdjuster firstDayOfNextYear() {\n\n return Impl.FIRST_DAY_OF_NEXT_YEAR;\n }", "public StrColumn getRecvdInitialDepositionDate() {\n return delegate.getColumn(\"recvd_initial_deposition_date\", DelegatingStrColumn::new);\n }", "public Date getDate() {\n if ( expiryDate.isSIPDate() ) {\n Calendar c=( (SIPDate)expiryDate ).getJavaCal();\n return c.getTime();\n }\n else return null; \n }", "public java.util.Date getPaymentreceiptdate () {\r\n\t\treturn paymentreceiptdate;\r\n\t}", "public static Date getFirstDate(Date date ) throws ParseException{ \n\t\tString format = \"yyyyMM\";\n\t\tdate = formatStrtoDate( format(date, format) + \"01\", format + \"dd\");\n\t\treturn date;\n\t}", "public String getPurchaseDate() {\r\n\t\treturn PurchaseDate;\r\n\t}", "public Date getFirstRelease() {\n return firstRelease;\n }", "public String getNextDate()\n\t{\n\t\tm_calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() + 1);\n\t\treturn getTodayDate ();\n\n\t}", "public static LocalDate getFirstOfNextMonth() {\n\t\treturn LocalDate.now().with(TemporalAdjusters.firstDayOfNextMonth());\n\t}", "public Date getTransactrateDate() {\n return transactrateDate;\n }", "Date getPriorDate();", "public java.util.Date getPaidDate () {\n\t\treturn paidDate;\n\t}", "private Date getDefaultCenturyStart() {\n\t\tif (defaultCenturyStart == null) {\n\t\t\t// not yet initialized\n\t\t\tinitializeDefaultCenturyStart(defaultCenturyBase);\n\t\t}\n\t\treturn defaultCenturyStart;\n\t}", "public java.lang.String couponCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).couponCurrency();\n\t}", "@Override\r\n\tpublic long getPaidDateTime() {\n\t\treturn 0;\r\n\t}", "public Timestamp getPurchaseDate() {\n return purchaseDate;\n }", "public ZonedDateTime getClaimFromDate() {\n return claimFromDate;\n }", "public Timestamp getDatePromised() {\n\t\treturn (Timestamp) get_Value(\"DatePromised\");\n\t}", "public Timestamp getDatePromised() {\n\t\treturn (Timestamp) get_Value(\"DatePromised\");\n\t}", "Date getStartDate();", "Date getStartDate();", "Date getStartDate();", "@Override\n public Date getTransactionStartDate() {\n return traxStartDate;\n }", "public Date getServiceStartDate() {\n return (Date) getAttributeInternal(SERVICESTARTDATE);\n }", "public String getReturnDate();", "public Timestamp getDateAcct() {\n\t\treturn (Timestamp) get_Value(\"DateAcct\");\n\t}", "String getStartDate();", "public static Date getMinDate() {\n Calendar cal = Calendar.getInstance();\n cal.set(1970, 1, 1, 1, 1, 1);\n return cal.getTime();\n }", "public String getRebillCreationDate()\n\t{\n\t\tif(response.containsKey(\"creation_date\")) {\n\t\t\treturn response.get(\"creation_date\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public org.drip.analytics.cashflow.CompositePeriod firstPeriod()\n\t{\n\t\treturn periods().get (0);\n\t}", "public Date getAutoDate() {\r\n return autoDate;\r\n }", "public PredictDataMoneyTransfer(Date date, Date next)\n\t{\n\t\tthis.date = date;\n\t\tthis.nextTransfer = next;\n\t}", "public Date getFirstSelectionDate()\n/* */ {\n/* 186 */ return isSelectionEmpty() ? null : (Date)this.selectedDates.first();\n/* */ }", "@Override\n\tpublic Date getStartDate() {\n\t\treturn model.getStartDate();\n\t}", "public String getStartDate() {\n SimpleDateFormat formatDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n return formatDate.format(fecha);\n }", "private int getFirstRepresentingDay() {\n\t\tint firstRepresentingDay;\r\n\t\tGregorianCalendar myCalendar = new GregorianCalendar(year, month, 1);\r\n\r\n\t\tint daysofMonth = myCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);\r\n\t\tint firstDayMonth = myCalendar.get(Calendar.DAY_OF_WEEK); // First day of month (relative to the week)\r\n\t\tint globalFirstDayMonth = myCalendar.get(Calendar.DAY_OF_YEAR);\r\n\r\n\t\tif (settings.getBoolean(\"firstDayofWeek\", true)) { //The default option is the week starting on monday\r\n\t\t\tfirstDayMonth = firstDayMonth - 1;\r\n\t\t\tif (firstDayMonth == 0)\r\n\t\t\t\tfirstDayMonth = 7;\r\n\t\t\tfirstRepresentingDay = globalFirstDayMonth - (firstDayMonth - 1);\r\n\t\t}\r\n\t\telse { //else we start the week on Sunday\r\n\t\t\tfirstRepresentingDay = globalFirstDayMonth - (firstDayMonth - 1);\r\n\t\t}\r\n\t\tif (firstDayMonth + daysofMonth < 37)\r\n\t\t\tcount = RingActivity.five_week_calendar;\r\n\t\telse\r\n\t\t\tcount = RingActivity.six_week_calendar;\r\n\r\n\t\treturn firstRepresentingDay;\r\n\t}", "public Timestamp getHC_WorkStartDate2();", "@Override\n\tpublic Date getCreateDate() {\n\t\treturn _second.getCreateDate();\n\t}", "public Date getFirstWaypointTime() {\n\t\treturn TimeParser.strDateTimeToDate(\n\t\t\t\tmDate + \" \" +\n\t\t\t\tmSegmentList.get(0).getWaypointList().get(0).getWaypointTime());\n\t}", "public String getConsentDate() {\n if (null != this.consentDate && this.consentDate.contains(\"T\")) {\n this.consentDate = this.consentDate.split(\"T\")[0];\n }\n return consentDate;\n }", "com.google.type.Date getAcquireDate();", "@Override\n\tpublic java.util.Date getCreateDate() {\n\t\treturn _candidate.getCreateDate();\n\t}", "java.lang.String getStartDate();", "public String getPaymentday() {\n return paymentday;\n }", "public Date getStartDate();", "public Date getStartDate();", "public Date getInitialActivityDate(String siteId) {\n\t\tDate date = null;\n\t\ttry{\n\t\t\tdate = siteService.getSite(siteId).getCreatedDate();\n\t\t}catch(Exception e){\n\t\t\treturn new Date(0);\n\t\t}\n\t\treturn date;\n\t}", "public Date getCateCreated() {\n return cateCreated;\n }", "public Date getStartDate()\n {\n return (Date)getAttributeInternal(STARTDATE);\n }", "public Date getBudgetDate() {\n return (Date) getAttributeInternal(BUDGETDATE);\n }" ]
[ "0.5973829", "0.59540784", "0.58748674", "0.57953525", "0.5738173", "0.5720867", "0.57201076", "0.5711842", "0.56501377", "0.5631325", "0.5630206", "0.5584244", "0.55762225", "0.55762225", "0.55603063", "0.55589443", "0.55451745", "0.5537134", "0.5531814", "0.5510804", "0.5474577", "0.5462427", "0.5444929", "0.54279125", "0.53970045", "0.53970045", "0.5390633", "0.53869075", "0.53800195", "0.53676814", "0.5355216", "0.5350514", "0.5349151", "0.53392637", "0.5339023", "0.5335835", "0.53324777", "0.53313744", "0.53228956", "0.5322169", "0.5320329", "0.52952284", "0.52757555", "0.5260829", "0.52523655", "0.524871", "0.52429324", "0.5232944", "0.52287954", "0.5217865", "0.52132976", "0.521069", "0.5208614", "0.5207955", "0.5207426", "0.52054965", "0.5202889", "0.5200379", "0.5194827", "0.519163", "0.5184596", "0.5184435", "0.51795197", "0.51742786", "0.516169", "0.5157874", "0.5155786", "0.51528853", "0.51528853", "0.514195", "0.514195", "0.514195", "0.5137479", "0.51332027", "0.51300675", "0.51190937", "0.5114792", "0.5114668", "0.5112701", "0.5101535", "0.51004404", "0.5098586", "0.50933605", "0.5080966", "0.5075582", "0.50749743", "0.5071089", "0.50640917", "0.50612706", "0.5060869", "0.5059046", "0.50587803", "0.5054394", "0.5054126", "0.5053734", "0.5053734", "0.50530463", "0.5050245", "0.50490046", "0.50487536" ]
0.7654367
0
Retrieve the Coupon Currency
public java.lang.String couponCurrency() { return _lsPeriod.get (_lsPeriod.size() - 1).couponCurrency(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Currency getCurrency();", "public Currency getCurrency();", "String getTradeCurrency();", "String getSettlementCurrency();", "public String getCurrency() {\n return this.currency;\n }", "public String getCurrency()\r\n {\r\n return currency;\r\n }", "public Pokemon.Currency getCurrency() {\n if (currencyBuilder_ == null) {\n return currency_;\n } else {\n return currencyBuilder_.getMessage();\n }\n }", "public String getCurrency() {\r\n return currency;\r\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "@WebMethod public Coupon getCoupon(String coupon);", "public Currency getCurrency() {\n return currencyCode;\n }", "com.google.ads.googleads.v6.resources.CurrencyConstant getCurrencyConstant();", "@Override\n\tpublic String getCurrency(){\n\t\treturn MARLAY_CURR;\n\t}", "public String getCurrency()\n\t{\n\t\treturn this.currency;\n\t}", "public java.lang.String getCurrency()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURRENCY$10, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getUserCurrency() {\n return sessionData.getUserCurrency();\n }", "Uom getCurrencyUom();", "public BigDecimal getCURRENCY() {\r\n return CURRENCY;\r\n }", "@Override\npublic Currency getCurrency() {\n\treturn balance.getCurrency();\n}", "public java.lang.String getCurrency() {\r\n return currency;\r\n }", "public Currency getCurrency1() {\n return _underlyingForex.getCurrency1();\n }", "public Pokemon.Currency getCurrency() {\n return currency_;\n }", "protected String getCurrency() {\n return currency;\n }", "public java.lang.String getCurrency() {\n return currency;\n }", "public double getCouponRate() {\n return _couponRate;\n }", "Pokemon.Currency getCurrency();", "com.google.protobuf.StringValue getCurrencyCode();", "public Object getCurrency() {\n\t\treturn null;\n\t}", "@Override\n public Currency getCurrency() {\n return currency;\n }", "public double getCouponAmount() {\n return _couponAmount;\n }", "public CurrencyUnit getCurrency() {\r\n return currency;\r\n }", "public String getAccountCurrencyCode() {\r\n return accountCurrencyCode;\r\n }", "public String getCurrencies() {\n\n\t\treturn getJson(API_VERSION, PUBLIC, \"getcurrencies\");\n\t}", "public String getCurrencyCode()\r\n {\r\n return (m_currencyCode);\r\n }", "public String getCurrency() {\n return (String) getAttributeInternal(CURRENCY);\n }", "public String getCurrencyCode() {\n return mCurrencyCode;\n }", "Uom getOrigCurrencyUom();", "public Currency getCurrency() {\n return _iborIndex.getCurrency();\n }", "public String getCurrencyPair() {\n return _ccyPair;\n }", "public BigDecimal getCurrency1() {\n\treturn currency1;\n}", "public CurrencyVO getCurrency() {\n\treturn currency;\n}", "public Currency getCurrency2() {\n return _underlyingForex.getCurrency2();\n }", "@Override\n public String getCurrency() {\n return currency != null ? currency : App.getContext().getString(R.string.example_currency);\n }", "public String getCurrencyCode() {\n return currencyCode;\n }", "public String getCurrency1() {\r\n\t\treturn currency1;\r\n\t}", "public Pokemon.CurrencyOrBuilder getCurrencyOrBuilder() {\n if (currencyBuilder_ != null) {\n return currencyBuilder_.getMessageOrBuilder();\n } else {\n return currency_;\n }\n }", "public Coupon getCoupon(int id) throws DbException;", "java.lang.String getCouponVendor();", "public String getPaymentCurrency() {\n return _paymentCurrency;\n }", "public java.lang.String payCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).payCurrency();\n\t}", "int getCouponStat();", "public de.htwg_konstanz.ebus.framework.wholesaler.vo.Currency getCurrency () {\r\n\t\treturn currency;\r\n\t}", "public String getFromCurrencyCode() {\n return fromCurrencyCode;\n }", "public Currency getCurrency() {\n return _index.getIborIndex().getCurrency();\n }", "EDataType getConductance();", "Money getDiscountValue();", "public String getSplitCurrency() {\r\n\treturn fxndf.getSplitCurrency();\r\n }", "public static Currency getReferenceCurrency() {\n return REFERENCE.get();\n }", "public java.lang.Double getCouponPrice () {\r\n\t\treturn couponPrice;\r\n\t}", "public java.lang.String getChargecurrency() {\n\treturn chargecurrency;\n}", "@Override\n @Nullable\n public Currency getCurrency(String key) {\n return currencies.get(key);\n }", "public BigDecimal getCurrency2() {\n\treturn currency2;\n}", "public BigDecimal getwPrCouponPrice() {\n return wPrCouponPrice;\n }", "@SkipValidation\n public String currencyView() {\n if ((currency != null) && (currency.getHcmoCurrencyId() != null)) {\n currency = currencyService.getCurrency(currency.getHcmoCurrencyId());\n }\n return SUCCESS;\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public String getIsCurrency() {\n return this.isCurrency;\n }", "TokenlyCurrency getCurrencyType();", "int getCouponType();", "public abstract String getCurrencyType();", "java.lang.String getCouponDescription();", "java.lang.String getCouponDescription();", "java.lang.String getCouponContent();", "java.lang.String getCouponContent();", "public org.apache.xmlbeans.XmlString xgetCurrency()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(CURRENCY$10, 0);\n return target;\n }\n }", "@Override\n\tpublic String getCurrencyCode() {\n\t\treturn null;\n\t}", "public java.lang.String getBillingCurrency() {\r\n return billingCurrency;\r\n }", "int getCouponNum();", "public String getCurrencyCd() {\n return (String) getAttributeInternal(CURRENCYCD);\n }", "private BigDecimal getConversion(String toCurrency) {\n Map<String, String> urlPathVariable = new HashMap<>();\n urlPathVariable.put(\"from\", baseCurrency);\n urlPathVariable.put(\"to\", toCurrency);\n\n ResponseEntity<CurrencyConversion> responseEntity = restTemplate.getForEntity(\"http://currency-conversion/api/v1/from/{from}/to/{to}\", CurrencyConversion.class, urlPathVariable);\n return responseEntity.getBody().getConversionRate();\n }", "public BigDecimal getCpMoney() {\n return cpMoney;\n }", "com.google.protobuf.StringValueOrBuilder getCurrencyCodeOrBuilder();", "public String getSettlementCurrency() {\n Object ref = settlementCurrency_;\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 settlementCurrency_ = s;\n }\n return s;\n }\n }", "@Override\n\tpublic Currency getCurrency() {\n\t\treturn null;\n\t}", "com.google.ads.googleads.v6.resources.CurrencyConstantOrBuilder getCurrencyConstantOrBuilder();", "public String getCurrencyCode() {\n\t\treturn currencyCode;\n\t}", "public String getSettlementCurrency() {\n Object ref = settlementCurrency_;\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 settlementCurrency_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getCurrencyid() {\n return currencyid;\n }", "public java.math.BigDecimal getValue_Foreign_Currency() {\r\n return value_Foreign_Currency;\r\n }", "public int getC_Currency_ID();", "public String getCurrencyID() {\n return currencyID;\n }", "public Pokemon.CurrencyOrBuilder getCurrencyOrBuilder() {\n return currency_;\n }", "public String getTradeCurrency() {\n Object ref = tradeCurrency_;\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 tradeCurrency_ = s;\n }\n return s;\n }\n }", "public String getTradeCurrency() {\n Object ref = tradeCurrency_;\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 tradeCurrency_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "java.lang.String getCouponName();", "java.lang.String getCouponName();" ]
[ "0.7571733", "0.73094165", "0.71618336", "0.7159344", "0.70715064", "0.7050811", "0.7045247", "0.6943295", "0.6923539", "0.6923539", "0.6923539", "0.6923539", "0.6920498", "0.69200253", "0.6911765", "0.6904372", "0.6890791", "0.68834555", "0.686384", "0.68291974", "0.6797878", "0.67788136", "0.67673814", "0.6764189", "0.6755015", "0.67172086", "0.6711791", "0.6710086", "0.66858876", "0.66813546", "0.6680426", "0.6659376", "0.65870243", "0.65643", "0.65592146", "0.6557408", "0.65454364", "0.65185046", "0.65034324", "0.6495857", "0.64912903", "0.6483608", "0.6475542", "0.64698386", "0.646001", "0.64555305", "0.64510757", "0.64394987", "0.6431", "0.64307976", "0.6426202", "0.6424098", "0.6388345", "0.63845474", "0.63644737", "0.63283205", "0.6315158", "0.62903744", "0.6286067", "0.62859905", "0.6285049", "0.62695664", "0.62598836", "0.62552255", "0.62507766", "0.62504846", "0.62458", "0.6234157", "0.6234157", "0.6234157", "0.62278587", "0.6221453", "0.6220129", "0.6211134", "0.6201182", "0.6201182", "0.61745846", "0.61745846", "0.6158304", "0.61542356", "0.6148959", "0.6138315", "0.613614", "0.6124185", "0.6112285", "0.6106284", "0.610193", "0.6089534", "0.60840493", "0.607788", "0.60742503", "0.6067716", "0.6051368", "0.6026391", "0.6021218", "0.60127854", "0.6011645", "0.599496", "0.59821236", "0.59821236" ]
0.7669337
0
Retrieve the Pay Currency
public java.lang.String payCurrency() { return _lsPeriod.get (_lsPeriod.size() - 1).payCurrency(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Currency getCurrency();", "String getTradeCurrency();", "public Currency getCurrency();", "String getSettlementCurrency();", "public String getCurrency()\r\n {\r\n return currency;\r\n }", "public String getCurrency() {\n return this.currency;\n }", "public String getCurrency() {\r\n return currency;\r\n }", "public String getPaymentCurrency() {\n return _paymentCurrency;\n }", "public String getCurrency()\n\t{\n\t\treturn this.currency;\n\t}", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public Currency getCurrency() {\n return currencyCode;\n }", "public java.lang.String getCurrency() {\r\n return currency;\r\n }", "@Override\n\tpublic String getCurrency(){\n\t\treturn MARLAY_CURR;\n\t}", "protected String getCurrency() {\n return currency;\n }", "public java.lang.String getCurrency() {\n return currency;\n }", "public Object getCurrency() {\n\t\treturn null;\n\t}", "public String getUserCurrency() {\n return sessionData.getUserCurrency();\n }", "public java.lang.String getCurrency()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURRENCY$10, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "@Override\n public Currency getCurrency() {\n return currency;\n }", "public de.htwg_konstanz.ebus.framework.wholesaler.vo.Currency getCurrency () {\r\n\t\treturn currency;\r\n\t}", "@Override\npublic Currency getCurrency() {\n\treturn balance.getCurrency();\n}", "public String getCurrency() {\n return (String) getAttributeInternal(CURRENCY);\n }", "public BigDecimal getCURRENCY() {\r\n return CURRENCY;\r\n }", "public CurrencyUnit getCurrency() {\r\n return currency;\r\n }", "com.google.ads.googleads.v6.resources.CurrencyConstant getCurrencyConstant();", "public Pokemon.Currency getCurrency() {\n if (currencyBuilder_ == null) {\n return currency_;\n } else {\n return currencyBuilder_.getMessage();\n }\n }", "public String getCurrencyPair() {\n return _ccyPair;\n }", "public CurrencyVO getCurrency() {\n\treturn currency;\n}", "public String getCurrencyCode()\r\n {\r\n return (m_currencyCode);\r\n }", "public String getAccountCurrencyCode() {\r\n return accountCurrencyCode;\r\n }", "TokenlyCurrency getCurrencyType();", "com.google.protobuf.StringValue getCurrencyCode();", "public Pokemon.Currency getCurrency() {\n return currency_;\n }", "public String getCurrencyCode() {\n return currencyCode;\n }", "public String getCurrencyCode() {\n return mCurrencyCode;\n }", "@Override\n @Nullable\n public Currency getCurrency(String key) {\n return currencies.get(key);\n }", "@Override\n public String getCurrency() {\n return currency != null ? currency : App.getContext().getString(R.string.example_currency);\n }", "public abstract String getCurrencyType();", "Uom getCurrencyUom();", "public Currency getCurrency() {\n return _iborIndex.getCurrency();\n }", "public String getCurrencies() {\n\n\t\treturn getJson(API_VERSION, PUBLIC, \"getcurrencies\");\n\t}", "public Currency getCurrency1() {\n return _underlyingForex.getCurrency1();\n }", "public String getSplitCurrency() {\r\n\treturn fxndf.getSplitCurrency();\r\n }", "public String getCurrencyID() {\n return currencyID;\n }", "Pokemon.Currency getCurrency();", "public String getTradeCurrency() {\n Object ref = tradeCurrency_;\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 tradeCurrency_ = s;\n }\n return s;\n }\n }", "public BigDecimal getCurrency1() {\n\treturn currency1;\n}", "com.google.protobuf.ByteString\n getTradeCurrencyBytes();", "public String getTradeCurrency() {\n Object ref = tradeCurrency_;\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 tradeCurrency_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getCurrencyid() {\n return currencyid;\n }", "public Currency getCurrency() {\n return _index.getIborIndex().getCurrency();\n }", "public String getCurrency1() {\r\n\t\treturn currency1;\r\n\t}", "public java.lang.String getReceiveCurrency() {\r\n return receiveCurrency;\r\n }", "public java.lang.String getReceiveCurrency() {\r\n return receiveCurrency;\r\n }", "public String getIsCurrency() {\n return this.isCurrency;\n }", "public Pair<Currency, Currency> getCurrencyPair() {\n return _currencyPair;\n }", "public Pair<Currency, Currency> getCurrencyPair() {\n return _currencyPair;\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public Currency findCurrencyByCode(String currency);", "public java.lang.String getBillingCurrency() {\r\n return billingCurrency;\r\n }", "public String getCurrencyID() {\n return currencyID;\n }", "public String getSettlementCurrency() {\n Object ref = settlementCurrency_;\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 settlementCurrency_ = s;\n }\n return s;\n }\n }", "public com.google.protobuf.ByteString\n getTradeCurrencyBytes() {\n Object ref = tradeCurrency_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n tradeCurrency_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n\tpublic Currency getCurrency() {\n\t\treturn null;\n\t}", "public org.apache.xmlbeans.XmlString xgetCurrency()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(CURRENCY$10, 0);\n return target;\n }\n }", "public String getSettlementCurrency() {\n Object ref = settlementCurrency_;\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 settlementCurrency_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public com.google.protobuf.ByteString\n getTradeCurrencyBytes() {\n Object ref = tradeCurrency_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n tradeCurrency_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getCurrencyCode() {\n\t\treturn currencyCode;\n\t}", "public java.lang.Integer getBasecurrency() {\n\treturn basecurrency;\n}", "public Currency getCurrency2() {\n return _underlyingForex.getCurrency2();\n }", "public java.lang.String couponCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).couponCurrency();\n\t}", "public BigDecimal getCurrency2() {\n\treturn currency2;\n}", "com.google.protobuf.ByteString\n getSettlementCurrencyBytes();", "protected String getCurrencyFromParameters(final FlightPriceRQ flightPriceRQ)\n\t{\n\t\treturn flightPriceRQ.getParameters().getCurrCodes().getCurrCode().get(0).getValue();\n\t}", "public String getCurrencyCd() {\n return (String) getAttributeInternal(CURRENCYCD);\n }", "public java.lang.String getChargecurrency() {\n\treturn chargecurrency;\n}", "public com.google.protobuf.ByteString\n getSettlementCurrencyBytes() {\n Object ref = settlementCurrency_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n settlementCurrency_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "Uom getOrigCurrencyUom();", "public String getFromCurrencyCode() {\n return fromCurrencyCode;\n }", "@Override\n\tpublic String getCurrencyCode() {\n\t\treturn null;\n\t}", "public Pokemon.CurrencyOrBuilder getCurrencyOrBuilder() {\n if (currencyBuilder_ != null) {\n return currencyBuilder_.getMessageOrBuilder();\n } else {\n return currency_;\n }\n }", "public com.google.protobuf.ByteString\n getSettlementCurrencyBytes() {\n Object ref = settlementCurrency_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n settlementCurrency_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public ArmCurrency getLoyaltyBalanceInCurrencyFormat() {\n\t double loyaltyPointsBalance = getLoyaltyBalance();\n\t ArmCurrency rtnVal = new ArmCurrency(loyaltyPointsBalance);\n\t return (rtnVal);\n }", "private BigDecimal getConversion(String toCurrency) {\n Map<String, String> urlPathVariable = new HashMap<>();\n urlPathVariable.put(\"from\", baseCurrency);\n urlPathVariable.put(\"to\", toCurrency);\n\n ResponseEntity<CurrencyConversion> responseEntity = restTemplate.getForEntity(\"http://currency-conversion/api/v1/from/{from}/to/{to}\", CurrencyConversion.class, urlPathVariable);\n return responseEntity.getBody().getConversionRate();\n }", "public JingtumCurrency getPay() {\n\t\tif (this.taker_gets == null && order != null){\n\t\t\treturn order.getTaker_gets();\n\t\t}\n\t\treturn taker_gets;\n\t}", "Long getCurrencyId();", "public String getSalaryCurrency() {\n \treturn salaryCurrency;\n }", "public BigDecimal getPayAmt();", "@SkipValidation\n public String currencyView() {\n if ((currency != null) && (currency.getHcmoCurrencyId() != null)) {\n currency = currencyService.getCurrency(currency.getHcmoCurrencyId());\n }\n return SUCCESS;\n }", "public int getC_Currency_ID();", "@Deprecated(since = CurrencyTests.DEPRECATED_SINCE_3_0, forRemoval = false)\n @Test\n public void getCurrency()\n {\n final Currency currency = Currency.of(CurrencyTests.EUR);\n assertEquals(CurrencyTests.EUR, currency.getCurrency(), CurrencyTests.CURRENCY_CODE_NOT_AS_EXPECTED);\n }", "public static Currency getReferenceCurrency() {\n return REFERENCE.get();\n }", "public String get_currency_name() {\n\t\treturn name;\r\n\t}", "boolean isCurrencyAware();", "com.google.ads.googleads.v6.resources.CurrencyConstantOrBuilder getCurrencyConstantOrBuilder();" ]
[ "0.8309743", "0.8060724", "0.79364353", "0.7788456", "0.7683507", "0.7654515", "0.75904125", "0.75800365", "0.75684303", "0.7562418", "0.7562418", "0.7562418", "0.7562418", "0.7521331", "0.7444008", "0.74006164", "0.73917025", "0.7385094", "0.73603415", "0.73397785", "0.73197037", "0.72234696", "0.72231627", "0.71755517", "0.71619844", "0.71589047", "0.7146107", "0.71294504", "0.7102435", "0.70894647", "0.7083674", "0.7057246", "0.70340335", "0.70217294", "0.701061", "0.6965341", "0.6962408", "0.6950545", "0.6904624", "0.6864655", "0.6845657", "0.68244296", "0.68242115", "0.680189", "0.6798152", "0.67670625", "0.67643034", "0.6750726", "0.6747992", "0.67458177", "0.6731561", "0.6727358", "0.6720453", "0.6716113", "0.6707636", "0.67060924", "0.67060924", "0.6696531", "0.6692388", "0.6692388", "0.66861856", "0.66861856", "0.66861856", "0.6684495", "0.66607374", "0.6645763", "0.66348165", "0.6634322", "0.66126716", "0.66103363", "0.6605644", "0.65974116", "0.6583563", "0.65811074", "0.6579775", "0.65739435", "0.6557084", "0.65414906", "0.6539812", "0.65387595", "0.6521545", "0.6488357", "0.6485135", "0.6478433", "0.64732444", "0.6464365", "0.6448602", "0.6430061", "0.6420468", "0.6408172", "0.64046854", "0.6381426", "0.6372135", "0.6330836", "0.6327115", "0.6323847", "0.63224685", "0.63153666", "0.6312017", "0.63059866" ]
0.7800341
3
Retrieve the Cash Flow Currency Set
public java.util.Set<java.lang.String> cashflowCurrencySet() { java.util.Set<java.lang.String> setCcy = new java.util.HashSet<java.lang.String>(); setCcy.add (payCurrency()); setCcy.add (couponCurrency()); return setCcy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Set<String> getCurrencySet() {\n Set<String> currencySet = new HashSet<>();\n for (int i= 0; i<getDataBase().length;i++){\n currencySet.add(getDataBase()[i][0]);\n }\n return Collections.synchronizedSet(currencySet);\n }", "String getSettlementCurrency();", "public String getCurrencies() {\n\n\t\treturn getJson(API_VERSION, PUBLIC, \"getcurrencies\");\n\t}", "List<CurrencyDTO> getCurrencies();", "public List<ModelCurrency> getModelCurrencyList() {\r\n\t\treturn modelCurrencyList;\r\n\t}", "Currency getCurrency();", "String getTradeCurrency();", "@Override\r\n\tpublic Collection getCashFlows() {\n\t\treturn null;\r\n\t}", "public Currency getCurrency();", "public Currency getCurrency1() {\n return _underlyingForex.getCurrency1();\n }", "Collection<String> getAllSupportedCurrenciesByShops();", "public BigDecimal getCURRENCY() {\r\n return CURRENCY;\r\n }", "public String getCurrency() {\n return this.currency;\n }", "public String getCurrency()\r\n {\r\n return currency;\r\n }", "public Key<CashFlow> getCashflow() {\n\t\treturn cashflow;\n\t}", "public java.lang.String couponCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).couponCurrency();\n\t}", "public Object getCurrency() {\n\t\treturn null;\n\t}", "public String getCashFlow() {\n\n return this.cashFlow;\n }", "@SkipValidation\n public String getAllCurrency() {\n currencyList = currencyService.getAllCurrency();\n return SUCCESS;\n }", "public String getCurrency() {\r\n return currency;\r\n }", "@Override\n\tpublic String getCurrency(){\n\t\treturn MARLAY_CURR;\n\t}", "public String getCurrency()\n\t{\n\t\treturn this.currency;\n\t}", "public String getCurrencyPair() {\n return _ccyPair;\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public String getCurrency() {\n return currency;\n }", "public Currency getCurrency() {\n return currencyCode;\n }", "@Override\n public HttpClientApiLayerEntity getCuotesByCurrencies(String currencies) {\n HttpRequest<?> req = HttpRequest.GET(uri+\"&currencies=\"+currencies);\n return (HttpClientApiLayerEntity) httpClient.retrieve(req, Argument.of(List.class, HttpClientApiLayerEntity.class)).blockingSingle().get(0);\n }", "@Override\n public HttpClientApiLayerEntity getCuotesFromCurrenciesSource(String source) {\n HttpRequest<?> req = HttpRequest.GET(uri+\"&source=\"+source);\n return (HttpClientApiLayerEntity) httpClient.retrieve(req, Argument.of(List.class, HttpClientApiLayerEntity.class)).blockingSingle().get(0);\n\n }", "public String getSplitCurrency() {\r\n\treturn fxndf.getSplitCurrency();\r\n }", "public com.google.protobuf.ByteString\n getSettlementCurrencyBytes() {\n Object ref = settlementCurrency_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n settlementCurrency_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getSettlementCurrency() {\n Object ref = settlementCurrency_;\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 settlementCurrency_ = s;\n }\n return s;\n }\n }", "com.google.protobuf.ByteString\n getSettlementCurrencyBytes();", "public com.google.protobuf.ByteString\n getSettlementCurrencyBytes() {\n Object ref = settlementCurrency_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n settlementCurrency_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "Set<Crate> getCrates();", "public String getSettlementCurrency() {\n Object ref = settlementCurrency_;\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 settlementCurrency_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "@Override\n public Currency getCurrency() {\n return currency;\n }", "public java.lang.String getCurrency() {\r\n return currency;\r\n }", "@Override\n @Nullable\n public Currency getCurrency(String key) {\n return currencies.get(key);\n }", "public Currency getCurrency() {\n return _index.getIborIndex().getCurrency();\n }", "public java.lang.String getCurrency()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURRENCY$10, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "@Override\n\tpublic int getC_Currency_ID() {\n\t\treturn 0;\n\t}", "public java.lang.String getCurrency() {\n return currency;\n }", "public CurrencyUnit getCurrency() {\r\n return currency;\r\n }", "@Override\n\tpublic Currency getCurrency() {\n\t\treturn null;\n\t}", "protected String getCurrency() {\n return currency;\n }", "public BigDecimal getCurrency1() {\n\treturn currency1;\n}", "public abstract String getCurrencyType();", "public String getCurrency() {\n return (String) getAttributeInternal(CURRENCY);\n }", "public List<StokContract> getAll() {\n\t\treturn null;\n\t}", "com.google.ads.googleads.v6.resources.CurrencyConstant getCurrencyConstant();", "public List<Contract> getContract(int crontactno) {\n\t\treturn contractdao.getContract(crontactno);\n\t}", "private void listCurrencies() {\r\n\t\t// Test whether we already have currencies\r\n\t\tif (currencies == null) {\r\n\t\t\t// No, so complain and return\r\n\t\t\tSystem.out.println(\"There are currently no currencies in the system.\");\r\n\t\t\tSystem.out.println(\"Please add at least one currency.\");\r\n\t\t\tSystem.out.println();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Reset the index into the currencies list\r\n\t\tcurrencies.reset();\r\n\t\tCurrency currency;\r\n\t\t// Output all currencies\r\n\t\twhile ((currency = currencies.next()) != null) {\r\n\t\t\tSystem.out.println(currency.getCode());\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "@Override\n\tpublic String getCurrencyCode() {\n\t\treturn null;\n\t}", "public String getCurrency1() {\r\n\t\treturn currency1;\r\n\t}", "public String getCurrencyCd() {\n return (String) getAttributeInternal(CURRENCYCD);\n }", "public List<SermCit> getCits(){\n return citations;\n }", "public CurrencyVO getCurrency() {\n\treturn currency;\n}", "public String getCurrencyCode() {\n return mCurrencyCode;\n }", "public String getCurrencyCode()\r\n {\r\n return (m_currencyCode);\r\n }", "public Pokemon.Currency getCurrency() {\n return currency_;\n }", "public Currency getCurrency() {\n return _iborIndex.getCurrency();\n }", "public List<StokContract> getById(int id) {\n\t\treturn null;\n\t}", "TokenlyCurrency getCurrencyType();", "public BigDecimal getCashMoney() {\n return cashMoney;\n }", "public Currency getCurrency2() {\n return _underlyingForex.getCurrency2();\n }", "public int getC_Currency_ID();", "public static Map<Integer,String> getCurrencyMap(){\n Map<Integer,String> currencyMap = new HashMap<>();\n int temp = 1; // number of first currency\n for (Object s : getCurrencySet()){\n currencyMap.put(temp,s.toString());\n temp++;\n }\n return Collections.synchronizedMap(currencyMap);\n }", "public String getIsCurrency() {\n return this.isCurrency;\n }", "@Override\npublic Currency getCurrency() {\n\treturn balance.getCurrency();\n}", "public String getCurrencyCode() {\n return currencyCode;\n }", "@Override\n public Currency getCurrency() {\n return _index.getCurrency();\n }", "public static Collection selectALLCurrencySplitConfig() {\n\t\t\treturn null;\r\n\t\t}", "public String getCurrencyID() {\n return currencyID;\n }", "public de.htwg_konstanz.ebus.framework.wholesaler.vo.Currency getCurrency () {\r\n\t\treturn currency;\r\n\t}", "private List<CashFlow> getCFs(Scenario s) {\n\t\tCollections.sort(cfs);\r\n\t\treturn cfs;\r\n\t}", "EDataType getConductance();", "public java.lang.String payCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).payCurrency();\n\t}", "@Transactional(readOnly = true)\n public List<Currency> findAll() {\n log.debug(\"Request to get all Currencies\");\n return currencyRepository.findAll();\n }", "public List<String> retrieveAllCurrencieNames() {\n List<String> currenciesAvailable = new ArrayList<>(2);\n getCurrencyBuilder()\n .getCurrencyModels()\n .forEach(currencyModel ->\n currenciesAvailable.add(currencyModel.getCurrencyName()));\n return currenciesAvailable;\n }", "public java.lang.String getChargecurrency() {\n\treturn chargecurrency;\n}", "public BigDecimal getBSCA_ProfitPriceList();", "public String getCurrencyid() {\n return currencyid;\n }", "java.util.List<cosmos.base.v1beta1.Coin> \n getTotalDepositList();", "public org.apache.xmlbeans.XmlString xgetCurrency()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(CURRENCY$10, 0);\n return target;\n }\n }", "com.google.protobuf.StringValue getCurrencyCode();", "public String getCurrencyID() {\n return currencyID;\n }", "public Pokemon.Currency getCurrency() {\n if (currencyBuilder_ == null) {\n return currency_;\n } else {\n return currencyBuilder_.getMessage();\n }\n }", "com.google.protobuf.ByteString\n getTradeCurrencyBytes();", "public Money getAvailableCash(){\n\t\treturn availableCash;\n\t}", "Pokemon.Currency getCurrency();", "public Pair<Currency, Currency> getCurrencyPair() {\n return _currencyPair;\n }", "public Pair<Currency, Currency> getCurrencyPair() {\n return _currencyPair;\n }", "Money getCashSettlementAmount();", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public BigDecimal getCURRENCY_CODE() {\r\n return CURRENCY_CODE;\r\n }", "public java.lang.String getReceiveCurrency() {\r\n return receiveCurrency;\r\n }", "public java.lang.String getReceiveCurrency() {\r\n return receiveCurrency;\r\n }" ]
[ "0.67794895", "0.6603694", "0.6522162", "0.64178836", "0.638596", "0.62932265", "0.6282132", "0.62177587", "0.6214017", "0.6065217", "0.60483265", "0.6012709", "0.5999494", "0.59984475", "0.5984072", "0.59840405", "0.5968861", "0.5952953", "0.5932899", "0.5930334", "0.5928617", "0.59124297", "0.5889812", "0.5853547", "0.5853547", "0.5853547", "0.5853547", "0.5819302", "0.58096313", "0.580337", "0.5789248", "0.5777074", "0.5776793", "0.57588124", "0.57514924", "0.57483375", "0.57388324", "0.57342124", "0.5730429", "0.57265925", "0.5703867", "0.5654682", "0.5641298", "0.5629822", "0.55754393", "0.5574675", "0.5570235", "0.5554813", "0.55499256", "0.5547235", "0.55031943", "0.5499031", "0.54942226", "0.5492347", "0.54762435", "0.5464309", "0.5461734", "0.54464084", "0.5443377", "0.5442843", "0.54385775", "0.542695", "0.5419373", "0.54106295", "0.5406393", "0.54020536", "0.53952634", "0.539426", "0.53835803", "0.5369978", "0.5368258", "0.53642917", "0.5351148", "0.5342989", "0.5335783", "0.5320664", "0.5318504", "0.53106046", "0.53092676", "0.53008753", "0.5298707", "0.529793", "0.5295861", "0.52946424", "0.52860963", "0.52753174", "0.52746737", "0.5270127", "0.52639455", "0.5259331", "0.5243161", "0.5230953", "0.5205613", "0.5205613", "0.5204552", "0.5201351", "0.5201351", "0.5201351", "0.51923746", "0.51923746" ]
0.766823
0
Retrieve the Stream Name
public java.lang.String name() { org.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel(); java.lang.String strTrailer = "::{" + effective() + "->" + maturity() + "}"; if (null != floaterLabel) return "FLOATSTREAM::" + payCurrency() + "::" + floaterLabel.fullyQualifiedName() + strTrailer; return "FIXEDSTREAM::" + payCurrency() + "/" + couponCurrency() + "::" + (12 / freq()) + strTrailer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getStreamName();", "public String getStreamNameString() {\n return streamName;\n }", "public String getName() {\n\treturn (super.getName() + \".\" + stream.getName());\n }", "public String getVideoStreamName() {\n return videoStreamName;\n }", "public String getName() {\n\t\treturn this.recordingProperties.name();\n\t}", "private String determineStream() {\r\n\t\tif (stream == null) {\r\n\t\t\tCcLsstream lsstream = new CcLsstream();\r\n\t\t\tlsstream.setProject(getProject());\r\n\t\t\tlsstream.setFormat(FMT_EXTENED_NAME);\r\n\t\t\tlsstream.setViewTag(determineViewTag());\r\n\t\t\tlsstream.execute();\r\n\t\t\tstream = lsstream.getCommandOutput();\r\n\t\t\tlog(\"Using derived stream [\" + stream + \"]\", Project.MSG_VERBOSE);\r\n\t\t}\r\n\t\treturn stream;\r\n\t}", "public String getName() {\n\t\treturn JWLC.nativeHandler().wlc_output_get_name(this.to());\n\t}", "public String getName() {\n return sname;\n }", "public String getStream(){\n return this.stream;\n }", "public String getName() {\n\t\treturn songName;\n\t}", "public String getSname() {\n return sname;\n }", "public String getStreamId() {\n return this.streamId;\n }", "String get_name() {\n File file = new File(url);\n return file.getName();\n }", "public String getStreamId() {\n return streamId;\n }", "public String allocateUnnamedStream() {\n\t return (UNNAMED_STREAM_PREFIX + (unnamedStreamCount++));\n }", "public String getsName() {\n return sName;\n }", "public static String getName()\n {\n read_if_needed_();\n \n return _get_name;\n }", "public String getName ( ) {\n\t\treturn extract ( handle -> handle.getName ( ) );\n\t}", "public String getSrsName() {\n\t\treturn this.srsName;\n\t}", "public String getName() {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE,\n\t\t\t\tContext.MODE_PRIVATE);\n\t\treturn settings.getString(USERNAME_KEY, null);\n\t}", "public String getName()\n {\n return codecInfo.getName();\n }", "SMFTypeRef getSrcName();", "public String getName() {\n return stid.trim() + std2.trim();\n }", "public String getName()\n {\n return( file );\n }", "java.lang.String getChannelName();", "public String getName()\r\n {\r\n return screenName;\r\n }", "public String getSimpleName() { return FilePathUtils.getFileName(_name); }", "String getName() {\n return getStringStat(playerName);\n }", "public String getName() {\n return _file.getAbsolutePath();\n }", "public String getPlayerName() {\n return props.getProperty(\"name\");\n }", "public String getName() {\n\t\treturn name != null ? name : getDirectory().getName();\n\t}", "public String getName() {\r\n\t\treturn name.get();\r\n\t}", "public String getFileName() {\n return ScreenRecordService.getFileName();\n }", "public String getName() {\n return name.get();\n }", "public String getName()\n\t{\n\t\treturn _fileName;\n\t}", "public java.lang.String getName();", "@Field(1) \n\tpublic Pointer<Byte > Name() {\n\t\treturn this.io.getPointerField(this, 1);\n\t}", "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 String getName() {\n return (String) getObject(\"username\");\n }", "public java.lang.String getName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$26);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "String getDestinationName();", "public String getTopicName() {\n if (activeTopic == null) {\n return \"\";\n } else {\n return TOPIC_HEADER_PRESTRING + activeTopic.getName();\n }\n }", "private void getPlayertName() {\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}", "public String getTopicName() {\n if (topicName.isPresent()) {\n return topicName.get();\n }\n return null;\n }", "public String getQualifiedName() {\n if(probe.getHost() != null) {\n return probe.getHost().getName() + \"/\" + getName();\n } else {\n return \"/\" + getName();\n }\n }", "public final String getName() {\n\treturn name.getName();\n }", "public final String getFileName() {\n\t\treturn m_info.getFileName();\n\t}", "public java.lang.String getName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$6);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public java.lang.String getName()\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(NAME$4);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getName() {\n\t\treturn this.data.getName();\n\t}" ]
[ "0.91045964", "0.8553889", "0.7879215", "0.68989617", "0.64311546", "0.6316381", "0.6279697", "0.6267219", "0.62059844", "0.6142073", "0.6108339", "0.6065308", "0.6030241", "0.59996676", "0.59743726", "0.59728014", "0.5971334", "0.5933252", "0.5874681", "0.58746314", "0.5850339", "0.5843728", "0.5825817", "0.57944405", "0.5786187", "0.57699", "0.5764174", "0.57452977", "0.57412773", "0.57377523", "0.57319164", "0.5719687", "0.57195824", "0.5705154", "0.5683304", "0.56829846", "0.56798595", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56444126", "0.56323916", "0.56245255", "0.5623895", "0.562301", "0.5618445", "0.56153864", "0.5613527", "0.5609596", "0.5607224", "0.55950767", "0.559504", "0.5594786" ]
0.0
-1
Get the Coupon Metrics for the period corresponding to the specified accrual end date
public org.drip.analytics.output.CompositePeriodCouponMetrics coupon ( final int iAccrualEndDate, final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs) { if (null == valParams) return null; org.drip.analytics.cashflow.CompositePeriod cp = containingPeriod (iAccrualEndDate); return null == cp ? null : cp.couponMetrics (valParams.valueDate(), csqs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CostItem[] getCostReport(String start, String end) throws CostManagerException;", "List<SalesConciliation> getSalesConciliation(Company company, Date startDate, Date endDate) throws Exception;", "public JFreeChart getPieChart(String start, String end) throws CostManagerException;", "List<Coupon> findByEndDateBefore(Date date);", "@Override\r\n\tpublic int getCount(Date dateStart, Date dateEnd) {\n\t\tString hql = \"select sum(cc.count) from cinema_condition cc where cc.date >= ? and cc.date <= ?\";\r\n\t\tQuery query = this.getCurrentSession().createQuery(hql);\r\n\t\tquery.setParameter(0, dateStart);\r\n\t\tquery.setParameter(1, dateEnd);\r\n\t\tif(query.uniqueResult()==null){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tint result = ((Long) query.uniqueResult()).intValue();\r\n\t\treturn result;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<GuideStatisticDTO> getGuidesStatisticByPeriod(LocalDateTime start, LocalDateTime end) {\n\t\tStringBuilder query = new StringBuilder(\n\t\t\t\t\"SELECT XS.guide.firstName AS firstName, XS.guide.lastName AS lastName, COUNT(id) AS totalExcursions, \"\n\t\t\t\t\t\t+ \"SUM(XS.details.durationSec) AS excursionsTotalDuration \" + \"FROM Excursion AS XS \"\n\t\t\t\t\t\t+ \"WHERE (XS.start >= :startDate AND XS.end <= :endDate) GROUP BY XS.guide\");\n\t\tSystem.out.println(query.toString());\n\t\tQuery result = sessionFactory.getCurrentSession().createQuery(query.toString());\n\t\tresult.setTimestamp(\"startDate\", Timestamp.valueOf(start));\n\t\tresult.setTimestamp(\"endDate\", Timestamp.valueOf(end));\n\t\tList<GuideStatisticDTO> returnResult = new ArrayList<GuideStatisticDTO>();\n\t\tfor (Object[] obj : (List<Object[]>) result.list()) {\n\t\t\tGuideStatisticDTO listElement = new GuideStatisticDTO();\n\t\t\tlistElement.setFirstName(String.valueOf(obj[0]));\n\t\t\tlistElement.setLastName(String.valueOf(obj[1]));\n\t\t\tlistElement.setTotalExcursions((long) obj[2]);\n\t\t\tlistElement.setExcursionsTotalDuration(LocalTime.MIN.plusSeconds((long) obj[3]));\n\t\t\treturnResult.add(listElement);\n\n\t\t}\n\n\t\treturn returnResult;\n\t\t// return result.list();\n\t}", "hr.client.appuser.CouponCenter.TimeRange getUseTime();", "hr.client.appuser.CouponCenter.TimeRange getUseTime();", "public double getAccrualFactorToNextCoupon() {\n return _factorToNextCoupon;\n }", "public double getCost(int endId) throws IllegalArgumentException, IllegalStateException;", "@Override\n\t/**\n\t * Returns all Coupons with end date up to value method received as an array\n\t * list sorted descended\n\t */\n\tpublic Collection<Coupon> getCouponsByDate(Date date, int compID) throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\t\t// Create list object to fill it later with Coupons\n\t\tCollection<Coupon> colCoup = new ArrayList<>();\n\n\t\ttry {\n\t\t\t// Defining SQL string to retrieve Coupons via prepared statement\n\t\t\tString getCouponsByEndDateSQL = \"select * from coupon where end_date < ? and id in(select couponid from compcoupon where companyid = ?) order by end_date desc\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(getCouponsByEndDateSQL);\n\t\t\t// Set date variable that method received into prepared statement\n\t\t\tpstmt.setDate(1, getSqlDate(date));\n\t\t\tpstmt.setInt(2, compID);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute manipulations\n\t\t\tResultSet resCoup = pstmt.executeQuery();\n\t\t\t// While there is result line in resCoup do lines below\n\t\t\twhile (resCoup.next()) {\n\t\t\t\t// Creating Coupon object to fill it later with data from SQL\n\t\t\t\t// query result and for method to add it to the list and return\n\t\t\t\t// it afterwards\n\t\t\t\tCoupon coupon = new Coupon();\n\t\t\t\t// Set Coupon attributes according to the results in the\n\t\t\t\t// ResultSet\n\t\t\t\tcoupon.setId(resCoup.getInt(\"id\"));\n\t\t\t\tcoupon.setTitle(resCoup.getString(\"title\"));\n\t\t\t\tcoupon.setStart_date(resCoup.getDate(\"start_date\"));\n\t\t\t\tcoupon.setEnd_date(resCoup.getDate(\"end_date\"));\n\t\t\t\tcoupon.setExpired(resCoup.getString(\"expired\"));\n\t\t\t\tcoupon.setType(resCoup.getString(\"type\"));\n\t\t\t\tcoupon.setMessage(resCoup.getString(\"message\"));\n\t\t\t\tcoupon.setPrice(resCoup.getInt(\"price\"));\n\t\t\t\tcoupon.setImage(resCoup.getString(\"image\"));\n\t\t\t\t// Add resulting Coupon to the list\n\t\t\t\tcolCoup.add(coupon);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon retrieval from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupon list retrieve has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\n\t\t// Return resulted list of Coupons\n\t\treturn colCoup;\n\t}", "public DaysAdjustment getExCouponPeriod() {\n return exCouponPeriod;\n }", "public org.drip.analytics.date.JulianDate firstCouponDate()\n\t{\n\t\ttry {\n\t\t\treturn new org.drip.analytics.date.JulianDate (_lsPeriod.get (0).endDate());\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "List<ServicePaymentsStatistics> getServicePaymentStats(Date begin, Date end);", "public Double RevenuePeriod(Instant begin, Instant end) {\n\t\treturn null;\n\t}", "public Collection<Coupon> getCouponByDate(Date date) throws DbException;", "public java.lang.String couponCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).couponCurrency();\n\t}", "public org.drip.analytics.cashflow.CompositePeriod lastPeriod()\n\t{\n\t\tjava.util.List<org.drip.analytics.cashflow.CompositePeriod> lsCouponPeriod = periods();\n\n\t\treturn lsCouponPeriod.get (lsCouponPeriod.size() - 1);\n\t}", "public Chart getContinuationChartOfAccount() {\n return continuationChartOfAccount;\n }", "public Chart getContinuationChartOfAccount() {\n return continuationChartOfAccount;\n }", "public int getEndYear()\n {\n return indicators[indicators.length - 1].getYear();\n }", "public Map<String, Object> countSalesEvents(String startDate, String endDate);", "public double getCostAmong(CustomerAdaptaded start, CustomerAdaptaded[] customers, CustomerAdaptaded end) {\n\t\treturn this.getDistanceTimeCostMatrixDesorderCustomers().getTimeCostAmong(start, customers, end);\n\t}", "List<Coupon> findByOrderByStartDateDesc();", "private static long[] computeExpirationInPeriod(long start, long end) {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTimeInMillis(start);\n\t\tcal.set(Calendar.DAY_OF_MONTH, 1);\n\t\tList<Long> expires = new ArrayList<>();\n\t\tint dayOfWeek;\n\t\tint currentMonth = cal.get(Calendar.MONTH);\n\t\tint countFriday = 0;\n\t\twhile (cal.getTimeInMillis() <= end) {\n\t\t\tdayOfWeek = cal.get(Calendar.DAY_OF_WEEK);\n\t\t\tif (currentMonth != cal.get(Calendar.MONTH)) {\n\t\t\t\tcountFriday = 0;\n\t\t\t\tcurrentMonth = cal.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (dayOfWeek % Calendar.FRIDAY == 0) {\n\t\t\t\t++countFriday;\n\t\t\t\tif (countFriday == 3) {\n\t\t\t\t\texpires.add(cal.getTimeInMillis());\n\t\t\t\t}\n\t\t\t}\n\t\t\tcal.add(Calendar.DAY_OF_MONTH, 1);\n\t\t}\n\t\treturn expires.stream()\n\t\t\t\t.mapToLong(Long::longValue)\n\t\t\t\t.filter((o) -> o >= start)\n\t\t\t\t.toArray();\n\t}", "public int getTotalRate(CustomerType customerType, LocalDate initialDate, LocalDate endDate) {\n return Stream.iterate(initialDate, date -> date.plusDays(1))\n .limit(endDate.getDayOfMonth() - initialDate.getDayOfMonth() + 1)\n .map(date -> {\n if (date.getDayOfWeek().equals(DayOfWeek.SATURDAY) || date.getDayOfWeek().equals(DayOfWeek.SUNDAY))\n return this.rate.get(customerType).getWeekendRate();\n return this.rate.get(customerType).getWeekdayRate();\n })\n .reduce((total, next) -> total + next).get();\n }", "@SuppressWarnings(\"unchecked\")\n public List<ConnectionMeterEvent> findConnectionMeterEventsForPeriod(LocalDate fromDate, LocalDate endDate) {\n StringBuilder queryString = new StringBuilder();\n queryString.append(\"SELECT cme FROM ConnectionMeterEvent cme \");\n queryString.append(\" WHERE cme.dateTime >= :fromDate \");\n // it is inclusive because i add a day to the endDate\n queryString.append(\" AND cme.dateTime < :endDate \");\n\n Query query = getEntityManager().createQuery(queryString.toString());\n query.setParameter(\"fromDate\", fromDate.toDateMidnight().toDateTime().toDate(), TemporalType.TIMESTAMP);\n query.setParameter(\"endDate\", endDate.plusDays(1).toDateMidnight().toDateTime().toDate(), TemporalType.TIMESTAMP);\n\n return query.getResultList();\n }", "com.google.ads.googleads.v14.common.IncomeRangeInfo getIncomeRange();", "public java.lang.String couponDC()\n\t{\n\t\treturn _lsPeriod.get (0).periods().get (0).couponDC();\n\t}", "public Chart getIncomeStreamChartOfAccounts() {\n return incomeStreamChartOfAccounts;\n }", "int getStudentKcalConsumption(long studentId, Date start, Date end);", "@Override\r\n\tpublic List<Price> queryCheng(Date start,Date end) {\n\t\tList<Price> list = homePageDao.queryCheng(start,end);\r\n\t\treturn list;\r\n\t}", "Document generateSpendingCategoryReport(String username, Date start,\n Date end);", "public Chart getFringeBenefitsChartOfAccount() {\n return fringeBenefitsChartOfAccount;\n }", "@Query(\"select c from Coupon c \\n\" +\n \"join CouponCategory coupon_category on coupon_category.couponId = c.id\\n\" +\n \"join Category category on category.id = coupon_category.categoryId\\n\" +\n \"join Activity ac on ac.id = c.activityId \\n\" +\n \"and ac.online = 1 \\n\" +\n \"and ac.startTime < :nowdate\\n\" +\n \"and ac.endTime > :nowdate\\n\" +\n \"where category.id = :cid\")\n List<Coupon> findAllByCategory(Long cid, Date nowdate);", "public Indicator[] getIndicatorForPeriod(int start, int end)\n {\n int index = 0;\n int validStart = indicators[0].getYear();\n int validEnd = indicators[indicators.length - 1].getYear();\n int oldStart = start, oldEnd = end;\n int startIndex = start - validStart;\n int counter = 0;\n\n if (start > end || (start < validStart && end < validStart) || (start > validEnd && end > validEnd))\n {\n throw new IllegalArgumentException(\"Invalid request of start and end year \" + start + \", \" + end +\n \". Valid period for \" + name + \" is \" + validStart + \" to \" + validEnd);\n }\n\n boolean changed = false;\n if (start < indicators[0].getYear())\n {\n changed = true;\n start = indicators[0].getYear();\n }\n\n if (end > indicators[indicators.length - 1].getYear())\n {\n changed = true;\n end = indicators[indicators.length - 1].getYear();\n }\n\n if (changed)\n {\n System.out.println(\"Invalid request of start and end year \" + oldStart + \",\" + oldEnd +\n \". Using valid subperiod for \" + name + \" is \" + start + \" to \" + end);\n }\n\n int numberOfYears = (end - start)+1;\n Indicator[] outputArray = new Indicator[numberOfYears];\n\n for (int i = startIndex; i < numberOfYears; i++)\n {\n outputArray[counter] = indicators[i];\n counter++;\n }\n return outputArray;\n }", "@Override\n public Map<SquadronConfig, Integer> getEndurance() {\n return configuration\n .stream()\n .map(config -> new Pair<>(config, config.getEndurance(performance)))\n .collect(Collectors.toMap(Pair::getKey, Pair::getValue));\n }", "@Override\n public double getDiscount() {\n return (30 /(1 + Math.exp(-1 * (this.years - 2) )))/100;\n }", "public void calculateEndPrice(int TotalPrice, int Discount) {\n\n }", "double getDiscountRate(int catalog_id, int customer_acc_no);", "Map<Date, Float> getFullCPC(Step step) throws SQLException;", "List<MonthlyExpenses> lastMonthExpenses();", "public int getCouponPerYear() {\n return _couponPerYear;\n }", "public Date getEndDate();", "public Date getEndDate();", "private List<Object[]> getAllCompanyVisitedInfoFromDailyReportByStartDateAndEndDate(final Date startDate,\n final Date endDate, final Employee_mst selectedEmployee) {\n return this.dailyRepo\n .getAllCompanyVisitedInfoFromDailyReportByStartDateAndEndDate(selectedEmployee.getEmp_code(), startDate,\n endDate)\n .maxResults(SummaryReportService.MAX_VISITED_COMPANIES_RECORD).getResultList();\n }", "Date getEndDate();", "Date getEndDate();", "public Record getCoverageContiguousEffectiveDate(Record record);", "public Collection<Coupon> getAllPurchasedCoupons() {\r\n\t\treturn db.getCustomer(cust).getCouponHistory();\r\n\t}", "public double getCouponRate() {\n return _couponRate;\n }", "int getCouponStat();", "public ArrayList<IncomeByCustomerDetail> getIncomeByCustomerDetails(\n\t\t\tClientFinanceDate startDate, ClientFinanceDate endDate,\n\t\t\tLong companyId) {\n\t\tSession session = HibernateUtil.getCurrentSession();\n\t\tArrayList<IncomeByCustomerDetail> customerDetails = new ArrayList<IncomeByCustomerDetail>();\n\t\tQuery result = session.getNamedQuery(\"getIncomeByCustomerDetails\")\n\t\t\t\t.setParameter(\"companyId\", companyId)\n\t\t\t\t.setParameter(\"startDate\", startDate.getDate())\n\t\t\t\t.setParameter(\"endDate\", endDate.getDate());\n\t\tList list = result.list();\n\t\tIterator iterator = list.iterator();\n\t\tif (list != null) {\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tObject[] object = (Object[]) iterator.next();\n\t\t\t\tIncomeByCustomerDetail customerDetail = new IncomeByCustomerDetail();\n\t\t\t\tcustomerDetail\n\t\t\t\t\t\t.setId((Long) (object[0] != null ? object[0] : 0));\n\t\t\t\tClientFinanceDate date = new ClientFinanceDate(\n\t\t\t\t\t\t(Long) (object[1] != null ? object[1] : 0));\n\t\t\t\tcustomerDetail.setTransactionDate(date);\n\t\t\t\tcustomerDetail.setTransactionType((Integer) object[2]);\n\t\t\t\tcustomerDetail\n\t\t\t\t\t\t.setTransactionNumber((String) (object[3] != null ? object[3]\n\t\t\t\t\t\t\t\t: \"\"));\n\t\t\t\tcustomerDetail.setName((String) (object[5] != null ? object[5]\n\t\t\t\t\t\t: \"\"));\n\t\t\t\tcustomerDetail\n\t\t\t\t\t\t.setJobName((String) (object[6] != null ? object[6]\n\t\t\t\t\t\t\t\t: \"\"));\n\t\t\t\tcustomerDetail\n\t\t\t\t\t\t.setAccountName((String) (object[7] != null ? object[7]\n\t\t\t\t\t\t\t\t: \"\"));\n\t\t\t\tcustomerDetail\n\t\t\t\t\t\t.setCredit((Double) (object[9] != null ? object[9]\n\t\t\t\t\t\t\t\t: 0.0d));\n\t\t\t\tcustomerDetail.setDebit((Double) (object[8] != null ? object[8]\n\t\t\t\t\t\t: 0.0d));\n\t\t\t\tcustomerDetails.add(customerDetail);\n\t\t\t}\n\t\t}\n\t\treturn customerDetails;\n\t}", "hr.client.appuser.CouponCenter.TimeRange getExchangeTime();", "OffsetDateTime usageEnd();", "public M csmiBirthdayEnd(Object end){this.put(\"csmiBirthdayEnd\", end);return this;}", "EDataType getConductance();", "hr.client.appuser.CouponCenter.TimeRangeOrBuilder getUseTimeOrBuilder();", "hr.client.appuser.CouponCenter.TimeRangeOrBuilder getUseTimeOrBuilder();", "public ArrayList<ReconciliationDiscrepancy> getReconciliationDiscrepancyByAccount(\n\t\t\tlong accountId, ClientFinanceDate start, ClientFinanceDate end,\n\t\t\tlong companyId) {\n\t\tSession session = HibernateUtil.getCurrentSession();\n\t\tArrayList<ReconciliationDiscrepancy> list = new ArrayList<ReconciliationDiscrepancy>();\n\t\tList result = session\n\t\t\t\t.getNamedQuery(\"get.reconcilition.discrepancy.by.account\")\n\t\t\t\t.setParameter(\"companyId\", companyId)\n\t\t\t\t.setParameter(\"startDate\", start.getDate())\n\t\t\t\t.setParameter(\"enteredDate\", end.getDate())\n\t\t\t\t.setParameter(\"accountId\", accountId).list();\n\n\t\tIterator iterator = result.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tObject[] objects = (Object[]) iterator.next();\n\n\t\t\tReconciliationDiscrepancy discrepancy = new ReconciliationDiscrepancy();\n\t\t\tdiscrepancy.setTransactionType((Integer) objects[0]);\n\t\t\tdiscrepancy\n\t\t\t\t\t.setTransactionId((Long) (objects[1] != null ? objects[1]\n\t\t\t\t\t\t\t: 0));\n\t\t\tClientFinanceDate date = new ClientFinanceDate(\n\t\t\t\t\t(Long) (objects[2] != null ? objects[2] : 0));\n\t\t\tdiscrepancy.setTransactionDate(date);\n\n\t\t\tdiscrepancy\n\t\t\t\t\t.setTransactionNumber((String) (objects[3] != null ? objects[3]\n\t\t\t\t\t\t\t: \"\"));\n\t\t\tdiscrepancy.setTransactionAmount((Double) objects[4]);\n\t\t\tdiscrepancy.setReconciliedAmount((Double) objects[5]);\n\t\t\tdiscrepancy\n\t\t\t\t\t.setName((String) (objects[6] != null ? objects[6] : \"\"));\n\n\t\t\tlist.add(discrepancy);\n\t\t}\n\t\treturn list;\n\t}", "public List<CouponData> getExpiredCouponList() {\n LocalDateTime currentDate = LocalDateTime.now();\n\n Optional<List<CouponData>> couponDataList = couponDataJpaRepository.findExpiredCoupon(currentDate);\n\n couponDataList.orElseThrow(()\n -> new CommonException(CommonResultCode.NO_DATA));\n\n return couponDataList.get();\n }", "@RequestMapping(value=\"/generateanalysis\",method=RequestMethod.GET)\r\n\tpublic List<PaymentDetailsBean> transactionAnalysis(Date start, Date end){\r\n \r\n\t\treturn service.transactionAnalysis(start, end);\r\n\t}", "@WebMethod public Coupon getCoupon(String coupon);", "public CreateCertFromCSR setPeriod(Date begin, Date end) {\n beginDate = begin;\n endDate = end;\n return this;\n }", "public KualiDecimal calculatePendActual(boolean isYearEndDocument, String actualFinancialBalanceTypeCd, Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String acctSufficientFundsFinObjCd, List expenditureCodes) {\n KualiDecimal pendActual = calculatePendActual1(isYearEndDocument, actualFinancialBalanceTypeCd, universityFiscalYear, chartOfAccountsCode, accountNumber, acctSufficientFundsFinObjCd, true, expenditureCodes);\n pendActual = pendActual.subtract(calculatePendActual1(isYearEndDocument, actualFinancialBalanceTypeCd, universityFiscalYear, chartOfAccountsCode, accountNumber, acctSufficientFundsFinObjCd, false, expenditureCodes));\n return pendActual;\n }", "public double getRate( ) {\nreturn monthlyInterestRate * 100.0 * MONTHS;\n}", "public final double calculateCarbon() {\n\n if (calories > 2000) {\n allowedCarbonPerYear = 2200 * quantity;\n\n } else {\n allowedCarbonPerYear = 2000 * quantity;\n }\n allowedCarbonPerDay = (double) allowedCarbonPerYear / (double) 365;\n // String strDouble = String.format(\"%.2f\", allowedCarbonPerDay);\n // System.out.println(strDouble);\n return allowedCarbonPerDay;\n\n }", "float getVacationAccrualRate();", "@Override\r\n\tpublic int[] getMonthPeople() {\n\t\tint[] result = new int[12];\r\n\t\tDate date = DateUtil.getCurrentDate();\r\n\t\tDate dateStart = DateUtil.getFirstDay(date);\r\n\t\tDate dateEnd = DateUtil.getLastDay(date);\r\n\t\tresult[0] = cinemaConditionDao.getCount(dateStart, dateEnd);\r\n\t\tfor(int i=0;i<11;i++){\r\n\t\t\tdate = DateUtil.getMonthBefroe(dateStart);\r\n\t\t\tdateStart = DateUtil.getFirstDay(date);\r\n\t\t\tdateEnd = DateUtil.getLastDay(date);\r\n\t\t\tresult[i+1] = cinemaConditionDao.getCount(dateStart, dateEnd);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public int numberOfContractBetween(String start, String end){\r\n\r\n\t\tQuery query = entityManager.createQuery(\r\n\t\t\t\t\"SELECT u FROM Contract u WHERE u.dateStart BETWEEN cast(:start as date) AND cast(:end as date)\");\r\n\t\t\r\n\t\t\r\n\t\tquery.setParameter(\"start\", start);\r\n\t\tquery.setParameter(\"end\", end);\r\n\t\t\r\n\t\treturn query.getResultList().size();\r\n\t\t\r\n\t}", "java.util.List<hr.client.appuser.CouponCenter.AppCoupon> \n getCouponListList();", "public static CouponIborCompoundedDiscountingMethod getInstance() {\n return INSTANCE;\n }", "public LocalDate getEndDate() { return this.endDate; }", "List<ChartBean> returnEmployeeCommunityServicesByDepartmentInstituteCenter();", "abstract double calculateCurrentDiscountRate();", "public Date getEndDate()\r\n {\r\n return this.endDate;\r\n }", "Map<Date, Float> getFullCTR(Step step) throws SQLException;", "int getStreamCouponHistoryListCount();", "public void setEndDate(Date end)\r\n {\r\n this.endDate = end;\r\n }", "public ArrayList<CoronaCase> Analytics(LocalDate lowerbound, LocalDate upperbound)\n\t{\n\t\tArrayList<CoronaCase> temp = new ArrayList<CoronaCase>();\n\t\t\n\t\tfor(int i = 0; i < coronaCase.size(); i++)\n\t\t\tif(coronaCase.get(i).isCaseDateWithin(lowerbound, upperbound, coronaCase.get(i).getDate()))\n\t\t\t\ttemp.add(coronaCase.get(i));\n\t\t\n\t\treturn temp;\n\t}", "PeriodCountCalculator<E> getPeriodCountCalculator();", "@Override\n\tpublic ChartDTO incomeChart(Restaurant restaurant, QueryChartDTO query) {\n\t\tCollection<Visit> found = visitRepository.findForDate(restaurant, query.getStart(), query.getEnd());\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(query.getEnd());\n\t\t cal.set(Calendar.HOUR, 23);\n\t\t cal.set(Calendar.MINUTE, 59);\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd.MM.yyyy\");\n\n\t\tStringBuilder str = new StringBuilder();\n\t\tChartDTO result = new ChartDTO();\n\t\tDate start = query.getStart();\n\t\twhile(true){\n\t\t\tif (start.compareTo(query.getEnd()) > 0)\n\t\t\t\tbreak;\n\t\t\tstr.append(dateFormat.format(start));\n\t\t\tresult.getLabels().add(str.toString());\n\t\t\tresult.getData().add(0.0);\n\t\t\t\n\t\t\tcal.setTime(start);\n\t\t\tcal.add(Calendar.DAY_OF_YEAR, 1);\n\t\t\tstart = cal.getTime();\n\t\t\tstr.delete(0, str.length());\n\t\t}\n\t\t\n\t\tfor (Visit p: found){\n\t\t\tstr.append(dateFormat.format(p.getDate()));\n\t\t\tint index = result.getLabels().indexOf(str.toString()); \n\t\t\tif (index == -1){\n\t\t\t\tresult.getLabels().add(str.toString());\n\t\t\t\tresult.getData().add(p.getBill().getFinal_price());\n\t\t\t} else {\n\t\t\t\tresult.getData().set(index, result.getData().get(index) + p.getBill().getFinal_price());\n\t\t\t}\n\t\t\tstr.delete(0, str.length());\n\t\t}\n\t\t\n\n\t\treturn result;\n\t}", "public String getENDString(int endCost);", "public LocalDate getEnd_date(){\n return this.end_date;\n }", "public java.lang.String accrualDC()\n\t{\n\t\treturn _lsPeriod.get (0).periods().get (0).accrualDC();\n\t}", "private double calcuCMetric() {\n\t\treturn (p-1)/fcost;\n\t}", "@Override\r\n\tpublic List<DispatchAnalysis> getDispatchDetailsBetween(Date fromDate, Date toDate)\t{\r\n\t\t\r\n\t\tList<DispatchAnalysis> dispatchAnalysisDetails=new ArrayList<>();\r\n\t\tDispatchAnalysis dispatchAnalysis=new DispatchAnalysis();\r\n\t\tCalendar c = Calendar.getInstance();\r\n\t\r\n\t\tList<Order> orderDetails=orderService.getOrdersBetween(fromDate, toDate);\r\n\t\tSystem.out.println(orderDetails);\r\n\t\t//for each order placed, get shipment details\r\n\t\tfor(Order order:orderDetails)\t{\r\n\t\t\tList<Shipment> shipmentDetails=order.getShipments();\r\n\t\t\tSystem.out.println(shipmentDetails);\r\n\t\t\t\r\n\t\t\tfor(Shipment shipment:shipmentDetails)\t{\r\n\t\t\t\t\r\n\t\t\t\tc.setTime(order.getOrderDate());\r\n\t\t\t\tc.add(c.DAY_OF_MONTH, 1);\r\n\t\t\t\t\r\n\t\t\t\tdispatchAnalysis.setProductName(shipment.getProduct().getProductName());\r\n\t\t\t\tdispatchAnalysis.setMerchantName(shipment.getProduct().getInventory().getMerchant().getMerchantName());\r\n\t\t\t\t//expected dispatch date of the product is one day after order placed\r\n\t\t\t\tdispatchAnalysis.setExpectedDispatchDate(c.getTime());\r\n\t\t\t\tdispatchAnalysis.setActualDispatchDate(shipment.getDispatchDate());\r\n\t\t\t\tdispatchAnalysis.setDeliveryDate(shipment.getDeliveryDate());\r\n\t\t\t\t\r\n\t\t\t\tdispatchAnalysisDetails.add(dispatchAnalysis);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn dispatchAnalysisDetails;\r\n\t}", "public Date getEndDate() {\n return endDate;\n }", "public Date getEndDate() {\n return endDate;\n }", "public Date getEndDate() {\n return endDate;\n }", "public Date getEndDate() {\n return endDate;\n }", "private PtoPeriodDTO accruePto(PtoPeriodDTO init, Employee employee) {\n\n\t\tDouble hoursAllowed = init.getHoursAllowed().doubleValue();\n\t\tDouble daysInPeriod = init.getDaysInPeriod().doubleValue();\n\t\tDouble dailyAccrual = hoursAllowed / daysInPeriod;\n\n\t\tlog.info(\"Daily Accrual Rate for this PTO Period: \" + dailyAccrual);\n\n\t\t// Check what the current date is, take the number of days difference\n\t\t// Since the beginning of the period\n\t\t\n\t\tDate beginDate = determineBeginDate(employee);\t\t\n\t\tDate endDate = ZonedDateTimeToDateConverter.INSTANCE.convert(init.getEndDate());\n\t\tDate today = ZonedDateTimeToDateConverter.INSTANCE.convert(ZonedDateTime.now());\n\t\t\n\t\tLong diff = today.getTime() - beginDate.getTime();\n\t\tLong daysPassed = (long) ((TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS)));\n\t\tlog.info(\"Days Passed: \" + daysPassed);\n\t\tLong hoursAccrued = (long) ((TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS)) * dailyAccrual);\n\t\tlog.info(\"Hours: \" + hoursAccrued);\n\t\tinit.setHoursAccrued(hoursAccrued);\n\t\tinit = deductTimeOff(init);\n\t\treturn init;\n\t\t\n\t}", "public Date getEndDate() {\r\n return this.endDate;\r\n }", "public abstract List<DailyFollowEventCount> getDailyFollowEventsForBrand(\n\t\t\tString foursquareId, Date start, Date stop);", "long getEndDate();", "long getEndDate();", "public interface CouponService {\n /**\n * 获得可以兑换的优惠券类型\n * @param mid\n * @return\n */\n public List<CouponTypeModel> getCouponTypes(long mid);\n\n /**\n * 获得优惠券使用记录,即已经使用过的优惠券\n * @param mid\n * @return\n */\n public List<CouponModel> getUsedCoupons(long mid, int page, int pageNum);\n\n /**\n * 获得已经使用过的优惠券数目\n * @param mid\n * @return\n */\n public int getUsedCouponTotalNum(long mid);\n\n /**\n * 获得未使用但未过期的优惠券\n * @param mid\n * @param date\n * @return\n */\n public List<CouponModel> getUnusedCoupons(long mid, long date, int page, int pageNum);\n\n /**\n * 获得未使用但未过期的优惠券数目\n * @param mid\n * @param date\n * @return\n */\n public int getUnusedCouponTotalNum(long mid,long date);\n\n /**\n * 获得未使用且已过期的优惠券\n * @param mid\n * @param date\n * @return\n */\n public List<CouponModel> getExpiredCoupons(long mid,long date,int page,int pageNum);\n\n /**\n * 获得未使用且已过期的优惠券数目\n * @param mid\n * @param date\n * @return\n */\n public int getExpiredCouponTotalNum(long mid,long date);\n\n /**\n * 使用积分兑换优惠券\n * @param mid\n * @param type\n * @return\n */\n public void exchangeCoupon(long mid,int type);\n}", "public double getTotalCO2Emissions() {\n totalCO2Emissions = 0;\n Food foodItem;\n\n // Loop through the ArrayList with the 5 Food Categories\n // For each Food Category, loop through the food items and get the CO2e and timesPerWeek\n // Add up the total CO2 emissions for every food item\n // Returns the total CO2 emissions per year\n for(int foodCatIndex=0; foodCatIndex<foodBank.size(); foodCatIndex++){\n foodlist = foodBank.get(foodCatIndex);\n for(int foodNameIndex=0; foodNameIndex<foodlist.getSize(); foodNameIndex++){\n foodItem = foodlist.getFood(foodNameIndex);\n totalCO2Emissions += foodItem.getCo2PerServing() * foodItem.getTimesPerWeek();\n }\n }\n return totalCO2Emissions * NUM_WEEKS_IN_YEAR;\n }", "public HashMap fetchIncrementPeriod(EmpCredit empCredit){\r\n\t\tHashMap periodMap = new HashMap();\r\n\t\ttry {\r\n\t\t\tString query = \"SELECT HRMS_PROMOTION.PROM_CODE, TO_CHAR(HRMS_PROMOTION.EFFECT_DATE,'MONTH-YYYY') AS PERIOD FROM HRMS_PROMOTION WHERE EMP_CODE=\"\r\n\t\t\t\t+empCredit.getEmpId()+\" AND HRMS_PROMOTION.LOCK_FLAG='Y' ORDER BY HRMS_PROMOTION.PROM_CODE DESC\" ;\r\n\t\t\tObject[][] incPeriodObj = getSqlModel().getSingleResult(query);\r\n\t\t\t\r\n\t\t\tif(incPeriodObj!=null && incPeriodObj.length >0){\r\n\t\t\t\tfor (int i = 0; i < incPeriodObj.length; i++) {\r\n\t\t\t\t\tperiodMap.put(String.valueOf(incPeriodObj[i][0]), String.valueOf(incPeriodObj[i][1]));\r\n\t\r\n\t\t\t\t}\r\n\t\t\tperiodMap = (HashMap<Object, Object>) org.paradyne.lib.Utility.sortMapByValue(periodMap, null, true);\r\n\t\t\t}else{\r\n\t\t\t\tperiodMap.put(\"N/A\",\"N/A\");\r\n\t\t\t}\r\n\t\t\tempCredit.setIncrementHistoryMap(periodMap);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn periodMap;\r\n\t}", "public Collection<Coupon> getCompanyCoupons(double maxPrice) {\n return couponRepo.findCouponsByCompanyIDAndPriceLessThanEqual(this.companyID, maxPrice);\n }" ]
[ "0.5494645", "0.54592526", "0.5407877", "0.5356687", "0.5211007", "0.51335466", "0.5057822", "0.5057822", "0.5036173", "0.5008802", "0.49506634", "0.49209055", "0.48347366", "0.48345935", "0.4820547", "0.48131064", "0.48080334", "0.48079365", "0.4788379", "0.4788379", "0.47716472", "0.47663486", "0.4766097", "0.47601306", "0.47534117", "0.47420385", "0.47356814", "0.47278392", "0.47198215", "0.47182256", "0.4715853", "0.47127578", "0.47074014", "0.4690299", "0.46889547", "0.4657963", "0.46548924", "0.46450475", "0.464315", "0.46411774", "0.4639743", "0.46080273", "0.4607609", "0.4605845", "0.4605845", "0.46046412", "0.45924827", "0.45924827", "0.45735788", "0.4566992", "0.4559068", "0.45442554", "0.45419967", "0.45369962", "0.4526129", "0.45232353", "0.45188153", "0.45111325", "0.45111325", "0.4506158", "0.4495327", "0.44952717", "0.44869143", "0.44868562", "0.44819105", "0.44408646", "0.4436218", "0.440263", "0.44006202", "0.4397698", "0.43954816", "0.43893915", "0.43823943", "0.4381595", "0.43777132", "0.4377056", "0.437234", "0.43723273", "0.43708566", "0.4369621", "0.435841", "0.4343279", "0.43413538", "0.43401712", "0.43380558", "0.4334371", "0.43337438", "0.4333739", "0.4333739", "0.4333739", "0.4333739", "0.43327084", "0.43279096", "0.43240035", "0.43172655", "0.43172655", "0.43156695", "0.43151963", "0.4314593", "0.4307925" ]
0.6121659
0
Generate the Calibration Quote Set corresponding to the specified Latent State Array
public org.drip.product.calib.ProductQuoteSet calibQuoteSet ( final org.drip.state.representation.LatentStateSpecification[] aLSS) { try { return null == floaterLabel() ? new org.drip.product.calib.FixedStreamQuoteSet (aLSS) : new org.drip.product.calib.FloatingStreamQuoteSet (aLSS); } catch (java.lang.Exception e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long[] getState() {\n return new long[] {(long)Cg0, (long)Cg1, (long)Cg2,\n (long)Cg3, (long)Cg4, (long)Cg5};\n }", "public Sarsa(int states, int actions, ExplorationPolicy explorationPolicy, boolean randomize) {\n this.states = states;\n this.actions = actions;\n this.explorationPolicy = explorationPolicy;\n\n // Create Q-Array\n /*qvalues = new double[states][];\n for (int i = 0; i < states; i++){\n qvalues[i] = new double[actions];\n }*/\n\n this.qvalues = new double[states][actions];\n this.N = new double[states][actions];\n\n // Randomize\n if (randomize){\n Random r = new Random( );\n for (int i = 0; i < states; i++){\n for (int j = 0; j < actions; j++){\n this.qvalues[i][j] = r.nextDouble()/10;\n }\n }\n }\n }", "public void setState(double[][][] instate) {\r\n this.state = instate;\r\n }", "private double[] getCustomState() {\n double[] state = new double[this.stateLength];\n\n // *** YOUR CODE HERE **********************************************************************\n\n // *** END OF YOUR CODE ********************************************************************\n\n return state;\n }", "public void arrayToState(int[] gX){\r\n int i = 0;\r\n int j = 0;\r\n int count = 0;\r\n while(count < gX.length){\r\n this.setState(i, j, gX[count]);\r\n count++;\r\n if(j == 3){\r\n i++;\r\n j = 0;\r\n }\r\n else\r\n j++;\r\n }\r\n }", "public double[][][] getState() {\r\n return this.state;\r\n }", "public Sudoku(int[][] state) {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\tthis.initialState[i][j] = this.currentState[i][j] = state[i][j];\n\t\t\t}\n\t\t}\n\t}", "public static double[] prepState(double[] b, double[] a,double[] state){\n\t\tdouble kdc = sum(b)/sum(a);\n\t\tdouble[] temp = new double[a.length];\n\t\t//Initialise state if kdc is not infinity or NaN\n\t\tif (Math.abs(kdc) < Double.POSITIVE_INFINITY && !Double.isNaN(kdc)){\n\t\t\t\n\t\t\tfor (int i = 0;i<a.length;++i){\n\t\t\t\ttemp[i] = b[i]-kdc*a[i];\n\t\t\t}\n\t\t\ttemp = reverse(temp);\n\t\t\tfor (int i = 1;i<temp.length;++i){\n\t\t\t\ttemp[i] += temp[i-1];\n\t\t\t}\n\t\t\ttemp = reverse(temp);\n\t\t\tfor (int i = 1;i<temp.length;++i){\n\t\t\t\tstate[i-1] = temp[i];\n\t\t\t}\n\t\t}\n\t\treturn state;\n\t}", "public static ArrayList genStates(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(int n = 0; n<=10; n++){\n for(int b = 0; b<=3; b++){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += notes.get(n);\n state += beat.get(b);\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "public StateTaxes()\n {\n this.stateAbbr = \"\";\n }", "public static int[] getCoordinate(int state) {\n return new int[]{(state % 4), (state / 4)};\n }", "public abstract Case[][] generate();", "protected void initCoefficients() {\n\n\t\tString S = C + \": initCoefficients():\";\n\t\tif (D) {\n\t\t\tSystem.out.println(S + \"Starting\");\n\t\t}\n\n\t\t// Make the ShakeMap coefficients\n\t\tcoefficientsSM.clear();\n\t\t// Note that the coefficients in \"the APPENDIX\" that David Wald sent to me (Ned) on 8/27/07\n\t\t// assume that all logs in their equation are base-10 (in spite of their using \"ln\" for\n\t\t// two of the terms). Thus, thier B1, B2, and Sigma values need to be multiplied by 2.3025.\n\t\t// Also, since their units are gals their B1 needs to have ln(980) subtracted from it\n\t\t// (except for PGV).\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeffSM0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// Note: no sigma values were available for those below (Vince needs to recompute them)\n\t\t// (those above came from Vince via personal communication)\n\t\t// therefore, I multiplied those above by ratio of the sigmas given in the table in\n\t\t// \"the APPENDIX\" David sent to me (Ned). These are labeled as \"Sigma\" in their table\n\t\t// with no further explanation; using the ratios seems reasonable.\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeffSM2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.835318, 0.835318, 0.835318, 1.71773, 0.000, -1.827, -0.608, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.842 / 0.836) * 0.660, (0.842 / 0.836) * 0.328,\n\t\t\t\t(0.842 / 0.836) * 0.737, (0.842 / 0.836) * 0.3948,\n\t\t\t\t(0.842 / 0.836) * 0.836);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.82877, -1.82877, -1.82877, 2.20818, 0.000, -1.211, -0.974, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.988 / 0.836) * 0.660, (0.988 / 0.836) * 0.328,\n\t\t\t\t(0.988 / 0.836) * 0.737, (0.988 / 0.836) * 0.3948,\n\t\t\t\t(0.988 / 0.836) * 0.836);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeffSM4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -4.63102, -4.63102, -4.63102, 2.09305, 0.000, -0.848, -0.890, 760,\n\t\t\t\t6.0,\n\t\t\t\t(1.082 / 0.836) * 0.660, (1.082 / 0.836) * 0.328,\n\t\t\t\t(1.082 / 0.836) * 0.737, (1.082 / 0.836) * 0.3948,\n\t\t\t\t(1.082 / 0.836) * 0.836);\n\t\t// PGV - They actually give PGV coeffs so no scaling of 1-sec SA is needed.\n\t\tBJF_1997_AttenRelCoefficients coeffSM5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, 5.1186, 5.1186, 5.1186, 1.70391, 0.000, -1.386, -0.668, 760, 6.0,\n\t\t\t\t(0.753 / 0.836) * 0.660, (0.753 / 0.836) * 0.328,\n\t\t\t\t(0.753 / 0.836) * 0.737, (0.753 / 0.836) * 0.3948,\n\t\t\t\t(0.753 / 0.836) * 0.836);\n\n\t\t// add these to the list\n\t\tcoefficientsSM.put(coeffSM0.getName(), coeffSM0);\n\t\tcoefficientsSM.put(coeffSM1.getName(), coeffSM1);\n\t\tcoefficientsSM.put(coeffSM2.getName(), coeffSM2);\n\t\tcoefficientsSM.put(coeffSM3.getName(), coeffSM3);\n\t\tcoefficientsSM.put(coeffSM4.getName(), coeffSM4);\n\t\tcoefficientsSM.put(coeffSM5.getName(), coeffSM5);\n\n\t\t// Now make the original BJF 1997 coefficients\n\t\tcoefficientsBJF.clear();\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeff0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, -0.313, -0.117, -0.242, 0.527, 0.000, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeff1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, -0.313, -0.117, -0.242, 0.527, 0, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeff2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.598, 0.803, 0.7, 0.769, -0.161, -0.893, -0.401, 2133, 5.94,\n\t\t\t\t0.440, 0.276, 0.519, 0.048, 0.522);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeff3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.133, -1.009, -1.08, 1.036, -0.032, -0.798, -0.698, 1406, 2.9,\n\t\t\t\t0.474, 0.325, 0.575, 0.214, 0.613);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeff4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -1.699, -1.801, -1.743, 1.085, -0.085, -0.812, -0.655, 1795, 5.85,\n\t\t\t\t0.495, 0.362, 0.613, 0.276, 0.672);\n\t\t// PGV - these are actually from 1-sec SA using the Newmark & Hall (1982). According to the ShakeMap docs this\n\t\t// scaling factor is PGV = (37.27*2.54)*SA1.0\n\t\t// The following formula is slightly more accurate (from Ken Campbell)\n\t\tdouble SA10toPGV = Math.log(981.0 / (2.0 * Math.PI * 1.65));\n\t\tBJF_1997_AttenRelCoefficients coeff5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, -1.133 + SA10toPGV, -1.009 + SA10toPGV, -1.08 + SA10toPGV, 1.036,\n\t\t\t\t-0.032, -0.798, -0.698, 1406, 2.9, 0.474, 0.325, 0.575, 0.214, 0.613);\n\n\t\t// add these to the list\n\t\tcoefficientsBJF.put(coeff0.getName(), coeff0);\n\t\tcoefficientsBJF.put(coeff1.getName(), coeff1);\n\t\tcoefficientsBJF.put(coeff2.getName(), coeff2);\n\t\tcoefficientsBJF.put(coeff3.getName(), coeff3);\n\t\tcoefficientsBJF.put(coeff4.getName(), coeff4);\n\t\tcoefficientsBJF.put(coeff5.getName(), coeff5);\n\n\t}", "public Order(Lamp[] lamps){\n this.lamps = lamps;\n this.isLamp = true;\n calculateCost();\n }", "static void normalize(double[] state) {\r\n double norm = 1/Math.sqrt(state[0]*state[0]+state[2]*state[2]+state[4]*state[4]+state[6]*state[6]);\r\n state[0] *= norm;\r\n state[2] *= norm;\r\n state[4] *= norm;\r\n state[6] *= norm;\r\n }", "public SARSA(int nStates, int nActions, long rngSeed) {\n\t\tsuper(nStates, nActions);\n\n\t\trng=new Random(rngSeed);\n\t\tthis.e = new DenseDoubleMatrix2D( nStates, nActions );\n\t\tthis.q = new DenseDoubleMatrix2D( nStates, nActions );\n\t}", "public void setCorralGates(Gate[] gates, Random selDir) {\n mOut.println(\"Initial gate setup:\");\n for(int i=0; i<gates.length; i++) {\n gates[i].setSwing(selDir.nextInt(3)-1);\n mOut.println(\"Gate \" + i + \": \" + gates[i].toString());\n }\n }", "public ArrayList genStates2(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(String s : notes){\n for(String d : beat){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += s;\n state += d;\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "void state_INIT(){\r\n eccState = INDEX_INIT;\r\n alg_INIT();\r\n INITO.serviceEvent(this);\r\n state_START();\r\n}", "@Override\r\n\tpublic double[] computeLocalUsingPreviousObservations(double states[][]) {\r\n\t\treturn computeLocalUsingPreviousObservations(states, false);\r\n\t}", "public double[] computeLocalJointEntropyUsingPreviousObservations(double states[][]) {\r\n\t\treturn computeLocalJointEntropyUsingPreviousObservations(states, false);\r\n\t}", "@Override\n public void estimateThetas() {\n HashMap<Integer, HashMap<Integer, Double>> newThetaMap = new HashMap<Integer, HashMap<Integer, Double>>();\n HashMap<Integer, HashMap<String, Double>> newThetaMapString = new HashMap<Integer, HashMap<String, Double>>();\n\n // For each city\n ArrayList<HashMap<Integer, HashSet<Integer>>> customersAtTableList = samplerState.getCustomersAtTableList();\n for (int cityId=0; cityId<customersAtTableList.size(); cityId++) {\n // For each table id\n Set<Integer> tableIds = customersAtTableList.get(cityId).keySet();\n for (Integer tableId : tableIds) {\n // get all the observations for this table and add them to the counts\n ArrayList<Double> tableObservations = samplerState.getObservationsFromTable(tableId, cityId);\n\n // Compute the unique tableId used in the thetaMaps\n Integer uniqueTableId = getUniqueTableId(cityId, tableId);\n\n // Initialize the tables's theta vector\n HashMap<Integer, Double> theta = new HashMap<Integer, Double>(); \n HashMap<String, Double> thetaString = new HashMap<String, Double>(); \n\n // add the dirichlet parameters\n ArrayList<Double> dirichletParam = hyperParameters.getDirichletParam();\n for (int j=0; j<dirichletParam.size(); j++) {\n theta.put(j, dirichletParam.get(j));\n thetaString.put(vocabulary.get(j), dirichletParam.get(j));\n }\n\n if (tableObservations != null && tableObservations.size() > 0) {\n for (Double obs : tableObservations) {\n Integer observation = obs.intValue() - 1;\n String observationString = vocabulary.get(observation);\n double currentObservationCount = theta.get(observation);\n theta.put(observation, currentObservationCount + 1);\n thetaString.put(observationString, currentObservationCount + 1); \n }\n }\n\n // get the normalizing constant\n double norm = 0.0;\n for (int j=0; j<hyperParameters.getVocabSize(); j++) {\n norm += theta.get(j);\n }\n\n // divide by the normalizing constant\n for (int j=0; j<hyperParameters.getVocabSize(); j++) {\n String obsStringJ = vocabulary.get(j);\n double thetaJ = theta.get(j) / norm;\n theta.put(j, thetaJ);\n thetaString.put(obsStringJ, thetaJ);\n } \n\n newThetaMap.put(uniqueTableId, theta);\n newThetaMapString.put(uniqueTableId, thetaString);\n }\n }\n\n thetaMap = newThetaMap;\n thetaMapString = newThetaMapString;\n }", "public double[] sequence()\n\t{\n\t\treturn _adblSequence;\n\t}", "private double[] y_landmark(VectorN x, Time t, int p,\r\n VectorN s, int lindex, boolean inoise) {\r\n \r\n // We'll need a Gaussian random number generator\r\n //Random randn = new Random(System.currentTimeMillis()); \t\r\n \r\n double y = 0;\r\n VectorN dydx = new VectorN(x.length);\r\n \r\n // TODO: Do we need t to be relative?\r\n // jd=jd0+t/86400;\r\n \r\n // If the number of states is greater than 6, assume that the \r\n // components 7-9 are the body-fixed coordinates of the landmark, \r\n // otherwise, it is assumed the landmark is known and specified by \r\n // the structure.\r\n CentralBody body = gravbody.get(p);\r\n VectorN lf = null;\r\n if (x.length == 9) {\r\n lf = x.get(6, 3);\r\n \t //Landmark mark = new Landmark(20, x.get(6), x.get(7), x.get(8),LunaRef.R_Luna);\r\n \t //lf = mark.lmf;\r\n }\r\n else {\r\n lf = body.getLandmark(lindex).lmf;\r\n }\r\n \r\n // Compute the coordinate transformation from body-fixed to inertial\r\n ReferenceFrameTranslater xlater = \r\n new ReferenceFrameTranslater(body.bodyFixedRef, body.inertialRef, t);\r\n VectorN li = xlater.translatePoint(lf);\r\n\r\n // Compute the vector from the spacecraft to the landmark\r\n VectorN d = li.minus(x.get(0, 3));\r\n double dmag = d.mag();\r\n VectorN dhat = d.unitVector();\r\n if ((s != null) && (s.length == 3)) {\r\n // Referece unit vector is provided. Compute measurment\r\n // between LOS.\r\n \r\n // Compute predicted measurement cos(theta)\r\n y = dhat.dotProduct(s);\r\n\r\n if (inoise) {\r\n // Assume similar noise as star and zero bias for now\r\n // TODO: Make arnd and abias configurable instead of\r\n // hardcoded.\r\n double arnd=.0034*Math.PI/180.0;\r\n //arnd=.07*Math.PI/180.0;\r\n arnd=Rdeg*Math.PI/180.0;\r\n double abias=0;\r\n y=Math.cos(Math.acos(y)+arnd*rnd.nextGaussian()+abias);\r\n }\r\n\r\n // (1/dmag)*s'*(-eye(3)+dhat*dhat')\r\n VectorN rdot = s.divide(dmag);\r\n Matrix tmp = dhat.outerProduct(dhat).minus(Matrix.identity(3,3));\r\n rdot = rdot.times(tmp);\r\n dydx.set(0, rdot);\r\n // vdot is 0\r\n \r\n if (x.length == 9) {\r\n //VectorN ldot = xlater.translatePointBack(rdot);//.times(-1);\r\n VectorN ldot = xlater.translatePointBack(rdot.times(-1));\r\n dydx.set(6, ldot);\r\n }\r\n }\r\n else {\r\n // No reference unit vector is provided. Compute pseudo range.\r\n \r\n // measurement is tan((D/2)/r)\r\n double D = body.getLandmark(lindex).D;\r\n y=D*.5/dmag;\r\n \r\n if (inoise) {\r\n // 1-sigma noise and bias on angular measurement\r\n double[] noiseFactors = camerr(dmag,p);\r\n double arnd = noiseFactors[0];\r\n double abias = noiseFactors[1];\r\n y=Math.tan(Math.atan(y)+arnd*rnd.nextGaussian()+abias);\r\n }\r\n\r\n double scale = (0.5 * D) / (dmag * dmag * dmag);\r\n VectorN rpart = d.times(scale);\r\n \r\n if (x.length == 9) {\r\n VectorN ldot = xlater.translatePointBack(rpart).times(-1);\r\n dydx.set(6, ldot);\r\n }\r\n }\r\n\r\n // TODO: Do we really want to shmoosh these into one array\r\n // just to return it?\r\n // We combine the angle and the Jacobian into a single array to return it\r\n double[] out = new double[x.length+1];\r\n out[0] = y;\r\n //System.arraycopy(dydx, 0, toReturn, 1, dydx.length);\r\n\t\tfor(int i=1; i<x.length+1; i++) out[i] = dydx.x[i-1];\r\n return out; \r\n }", "public SequencePairAlignment generatePath ()\n\t{\n\t\tif (isGenerative() == false)\n\t\t\tthrow new IllegalStateException (\"Transducer is not generative.\");\n\t\tArrayList initialStates = new ArrayList ();\n\t\tIterator iter = initialStateIterator ();\n\t\twhile (iter.hasNext()) { initialStates.add (iter.next()); }\n\t\t// xxx Not yet finished.\n\t\tthrow new UnsupportedOperationException ();\n\t}", "public MinCQueenState(int[] state) {\r\n super(state);\r\n }", "void init(double t0, double[] y0, double t);", "public State(int stateNum, int[] genes) throws IllegalArgumentEvent {\r\n\t\tthis.stateNum = stateNum;\r\n\t\t\r\n\t\tthis.command = toCommand(genes[0]);\r\n\t\tswitch(this.command){\r\n\t\t//Sense senseDir st1 st2 condition (senseMarker)\r\n\t\tcase SENSE:\r\n\t\t\tif(genes[1] < 0 || genes[1] > 3){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal SenseDir ordinal \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.senseDir = toSenseDir(genes[1]);\r\n\t\t\tthis.turnDir = null;\r\n\t\t\tthis.marker = -1;\r\n\t\t\tthis.p = -1;\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 argument \" +\r\n\t\t\t\t\t\"in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tif(genes[6] < 0 || genes[6] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st2 argument \" +\r\n\t\t\t\t\t\"in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st2 = genes[6];\r\n\t\t\tif(genes[7] < 0 || genes[7] > 9){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal Condition ordinal \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.condition = toCondition(genes[7]);\r\n\t\t\tif(this.condition == Condition.MARKER){\r\n\t\t\t\tif(genes[8] < 0 || genes[8] > 5){\r\n\t\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal SenseMarker \" +\r\n\t\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t\t}\r\n\t\t\t\tthis.senseMarker = genes[8];\r\n\t\t\t}else{\r\n\t\t\t\tthis.senseMarker = -1;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t//Mark marker st1\r\n\t\tcase MARK:\r\n\t\t\tthis.senseDir = null;\r\n\t\t\tthis.turnDir = null;\r\n\t\t\tif(genes[3] < 0 || genes[3] > 5){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal marker \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.marker = genes[3];\r\n\t\t\tthis.p = -1;\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tthis.st2 = -1;\r\n\t\t\tthis.condition = null;\r\n\t\t\tthis.senseMarker = -1;\r\n\t\t\tbreak;\r\n\t\t//Unmark marker st1\r\n\t\tcase UNMARK:\r\n\t\t\tthis.senseDir = null;\r\n\t\t\tthis.turnDir = null;\r\n\t\t\tif(genes[3] < 0 || genes[3] > 5){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal marker \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.marker = genes[3];\r\n\t\t\tthis.p = -1;\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tthis.st2 = -1;\r\n\t\t\tthis.condition = null;\r\n\t\t\tthis.senseMarker = -1;\r\n\t\t\tbreak;\r\n\t\t//PickUp st1 st2\r\n\t\tcase PICKUP:\r\n\t\t\tthis.senseDir = null;\r\n\t\t\tthis.turnDir = null;\r\n\t\t\tthis.marker = -1;\r\n\t\t\tthis.p = -1;\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tif(genes[6] < 0 || genes[6] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st2 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st2 = genes[6];\r\n\t\t\tthis.condition = null;\r\n\t\t\tthis.senseMarker = -1;\r\n\t\t\tbreak;\r\n\t\t//Drop st1\r\n\t\tcase DROP:\r\n\t\t\tthis.senseDir = null;\r\n\t\t\tthis.turnDir = null;\r\n\t\t\tthis.marker = -1;\r\n\t\t\tthis.p = -1;\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tthis.st2 = -1;\r\n\t\t\tthis.condition = null;\r\n\t\t\tthis.senseMarker = -1;\r\n\t\t\tbreak;\r\n\t\t//Turn turnDir st1\r\n\t\tcase TURN:\r\n\t\t\tthis.senseDir = null;\r\n\t\t\tif(genes[2] < 0 || genes[2] > 1){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal TurnDir ordinal \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.turnDir = toTurnDir(genes[2]);\r\n\t\t\tthis.marker = -1;\r\n\t\t\tthis.p = -1;\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tthis.st2 = -1;\r\n\t\t\tthis.condition = null;\r\n\t\t\tthis.senseMarker = -1;\r\n\t\t\tbreak;\r\n\t\t//Move st1 st2\r\n\t\tcase MOVE:\r\n\t\t\tthis.senseDir = null;\r\n\t\t\tthis.turnDir = null;\r\n\t\t\tthis.marker = -1;\r\n\t\t\tthis.p = -1;\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tif(genes[6] < 0 || genes[6] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st2 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st2 = genes[6];\r\n\t\t\tthis.condition = null;\r\n\t\t\tthis.senseMarker = -1;\r\n\t\t\tbreak;\r\n\t\t//Flip p st1 st2\r\n\t\tcase FLIP:\r\n\t\t\tthis.senseDir = null;\r\n\t\t\tthis.turnDir = null;\r\n\t\t\tthis.marker = -1;\r\n\t\t\tif(genes[4] < 1){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal p \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.p = genes[4];\r\n\t\t\tif(genes[5] < 0 || genes[5] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st1 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st1 = genes[5];\r\n\t\t\tif(genes[6] < 0 || genes[6] > max){\r\n\t\t\t\tthrow new IllegalArgumentEvent(\"Illegal st2 \" +\r\n\t\t\t\t\t\"argument in State constructor\");\r\n\t\t\t}\r\n\t\t\tthis.st2 = genes[6];\r\n\t\t\tthis.condition = null;\r\n\t\t\tthis.senseMarker = -1;\r\n\t\t\tbreak;\r\n\t\t//This should never be reached\r\n\t\tdefault:\r\n\t\t\tthrow new IllegalArgumentEvent(\"Illegal Command ordinal \" +\r\n\t\t\t\t\"argument in State constructor\");\r\n\t\t}\r\n\t}", "public State synthesize(SketchProgram sp, Example[] exs, List<State> output_5) {\n\n this.e = new Evaluate(exs);\n\n State initialState = initState(sp);\n q.add(initialState);\n\n // worklist\n while (!q.isEmpty()) {\n {\n\n State currState = q.poll();\n Main.polledStatesCount++;\n\n if (Main.PRINT == 1) System.out.println(\"currState:\" + currState.toString());\n\n if (currState.pp.isCompleteSymbolic()) {\n\n long start_1 = System.currentTimeMillis();\n\n if (Main.SPECIAL_PRINT == 1) System.out.println(\"complete symbolic program:\" + currState.pp);\n\n Expression ex = currState.pp.generateExpression();\n\n // get repeatqueue\n List<OperatorNode> repeatQueue = new ArrayList<>();\n List<OperatorNode> repeatAtLeastQueue = new ArrayList<>();\n currState.pp.startNode.addRepeatNodes(repeatQueue, repeatAtLeastQueue);\n\n if (Main.SOLVER_DEBUG == 1) System.out.println(repeatQueue);\n\n if (ex == null) continue;\n\n ex.generateCompleteFormula(exs);\n if (Main.SOLVER_DEBUG == 1) System.out.println(ex.toString());\n\n ex.generateZ3Expr();\n\n List<BoolExpr> expressionTemplate;\n if (Main.REPEATATLEAST_1_CONSTRAIN) {\n expressionTemplate = ex.generateTemplate(repeatAtLeastQueue);\n } else {\n expressionTemplate = ex.generateTemplate(new ArrayList<>());\n }\n\n for (BoolExpr currExpr : expressionTemplate) {\n\n ex.currExpression = currExpr;\n if (Main.SOLVER_DEBUG == 1) System.out.println(\"curr bool expression:\" + currExpr.toString());\n\n SolveResult solveRes;\n\n while ((solveRes = ex.z3Solve()).satisfiable) {\n\n\n if (Main.SOLVER_DEBUG == 1) System.out.println(\"evaluate solved:\" + currState.pp.toString());\n Main.evaluatedCount++;\n\n // do the partial evaluation on the solved program\n if (currState.pp.evaluateSolvedProgram(ex, solveRes.model, e, repeatQueue)) {\n if (Main.OUTPUT_5 == 1) {\n output_5.add(currState);\n\n if (output_5.size() >= Main.OUTPUT_5_SIZE) {\n return currState;\n } else continue;\n\n } else {\n return currState;\n }\n }\n\n continue;\n\n }\n }\n// assert false;\n long end_1 = System.currentTimeMillis();\n Main.solveTime += (end_1 - start_1) / 1000.0;\n\n continue;\n }\n\n // check closed program\n // only evaluate closed and no symbolic constant program\n long start_2 = System.currentTimeMillis();\n\n if (currState.pp.varNodes.isEmpty() && currState.pp.symbolicConstantNodes.isEmpty()) {\n\n if (Main.DEBUG == 1) System.out.println(\"evaluate closed:\" + currState.pp.toString());\n Main.evaluatedCount++;\n\n if (Main.MODE != 0) {\n\n // check duplicate\n if (currState.checkDuplicate()) continue;\n\n State retState = evaluateRepeatMutate(currState);\n if (retState != null) {\n if (Main.OUTPUT_5 == 1) {\n output_5.add(currState);\n\n if (output_5.size() >= Main.OUTPUT_5_SIZE) {\n return currState;\n } else continue;\n\n } else {\n return currState;\n }\n }\n\n }\n\n if (e.evaluate(currState.pp.getRegex()).result) {\n if (Main.OUTPUT_5 == 1) {\n output_5.add(currState);\n\n if (output_5.size() >= Main.OUTPUT_5_SIZE) {\n return currState;\n } else continue;\n\n } else {\n return currState;\n }\n }\n else continue;\n }\n\n long end_2 = System.currentTimeMillis();\n Main.evaluateTime += (end_2 - start_2) / 1000.0;\n\n // select var node\n long start_3 = System.currentTimeMillis();\n\n VariableNode v;\n\n if (Main.MODE == 0) v = currState.pp.selectVar();\n else v = currState.pp.dr_selectVar();\n\n Node sketch = v.sketch;\n\n if (sketch instanceof TerminalNode) {\n\n\n TerminalNode terminalSketch = (TerminalNode) sketch;\n q.addAll(expandStateTerminalNode(currState, terminalSketch, v));\n\n\n\n } else if (sketch instanceof OperatorNode) {\n\n\n OperatorNode opSketch = (OperatorNode) sketch;\n q.addAll(expandStateOperatorNode(currState, opSketch, v));\n\n\n\n } else if (sketch instanceof SketchNode) {\n\n\n SketchNode skSketch = (SketchNode) sketch;\n\n // check if the current variable has sketch components\n if (skSketch.containsComponents()) {\n\n q.addAll(substitueStateSketch(currState, skSketch.components));\n\n List<NonterminalSymbol> hypothesis = this.grammar.nonterminalSymbols;\n\n for (NonterminalSymbol sym : hypothesis) {\n\n assert (sym instanceof OpNonterminalSymbol);\n OpNonterminalSymbol opSym = (OpNonterminalSymbol) sym;\n\n q.addAll(expandStateOperatorSym(currState, opSym, skSketch));\n\n }\n\n } else {\n\n // free var case\n List<Symbol> hypothesis = selectHypothesis(currState, v, skSketch);\n\n for (Symbol sym : hypothesis) {\n if (sym instanceof TerminalSymbol) {\n\n q.addAll(expandStateTerminalSym(currState, sym));\n\n } else if (sym instanceof OpNonterminalSymbol) {\n\n OpNonterminalSymbol opSym = (OpNonterminalSymbol) sym;\n q.addAll(expandStateOperatorSym(currState, opSym, skSketch));\n }\n }\n }\n\n\n } else if (sketch instanceof RepSketchNode) {\n\n RepSketchNode rsn_sketch = (RepSketchNode) sketch;\n\n // first check if we have the cache\n if (currState.pp.repSketchNodeMap.containsKey(rsn_sketch.sid)) {\n\n currState.pp.substituteVar(v, currState.pp.repSketchNodeMap.get(rsn_sketch.sid));\n q.add(currState);\n\n currState.pp.deselectVar();\n\n\n } else {\n\n // replace variable node with a new RepSketchNode\n RepSketchNode ret = (RepSketchNode) currState.pp.mkRepSketchNode(rsn_sketch.sketch, rsn_sketch.sid, v.parent);\n currState.pp.substituteVar(v, ret);\n currState.pp.deselectVar();\n\n // add to the hashmap\n\n\n // init ret\n VariableNode new_v = (VariableNode) currState.pp.mkVarNode(ret.sketch, ret, (v.depth + 1));\n // make this new node the selected var\n new_v.selected = 1;\n currState.pp.selectedVar = new_v;\n\n ret.expand = new_v;\n\n\n // gist is to repeat the previous process\n Node new_sketch = new_v.sketch;\n\n // TODO: involving creating new states, which needs to be changed\n\n if (new_sketch instanceof TerminalNode) {\n\n List<State> retStates = expandStateTerminalNode(currState, (TerminalNode) new_sketch, new_v);\n\n assert (retStates.size() == 1);\n\n for (State s : retStates) {\n s.pp.repSketchNodeMap.put(ret.sid, ret);\n }\n\n q.addAll(retStates);\n\n } else if (new_sketch instanceof OperatorNode) {\n\n List<State> retStates = expandStateOperatorNode(currState, (OperatorNode) new_sketch, new_v);\n\n assert (retStates.size() == 1);\n\n for (State s : retStates) {\n s.pp.repSketchNodeMap.put(ret.sid, ret);\n }\n\n q.addAll(retStates);\n\n } else if (new_sketch instanceof SketchNode) {\n\n SketchNode new_skSketch = (SketchNode) new_sketch;\n\n // this sketch **must** contains components\n assert (!new_skSketch.components.isEmpty());\n\n q.addAll(substitueStateSketch(currState, new_skSketch.components));\n\n List<NonterminalSymbol> hypothesis = this.grammar.nonterminalSymbols;\n\n for (NonterminalSymbol sym : hypothesis) {\n\n assert (sym instanceof OpNonterminalSymbol);\n OpNonterminalSymbol opSym = (OpNonterminalSymbol) sym;\n\n q.addAll(expandStateOperatorSym(currState, opSym, new_skSketch));\n\n }\n\n } else {\n throw new RuntimeException();\n }\n\n }\n\n } else {\n throw new RuntimeException();\n }\n long end_3 = System.currentTimeMillis();\n Main.enumerateTime += (end_3 - start_3) / 1000.0;\n }\n\n }\n\n return null;\n }", "public abstract List<Scope> generateFactorScopes(State state);", "public StateWolfGoatCabbage(StateWolfGoatCabbage state) {\r\n \tsarray = new int[N];\r\n for(int i=0; i<N; i++) \r\n this.sarray[i] = state.sarray[i];\r\n }", "public purchaseDesign()\n {\n priceArray = new int[5][4];\n }", "private AutomatonFromTable automatonFromTable() {\n \tAutomatonFromTable hypothesis = new AutomatonFromTable(inputs);\n\t\t/*\n\t\t * Number of new states in the hypothesis is the \n\t\t * number of distinct rows in the upper half of the observation table\n\t\t */\n\t\tint noOfNewStates = -1;\n\t\tList<List<String>> distinctStates = new ArrayList<>();\n\t\tIterator<Entry<String, List<String>>> it = observationTableUpper.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tdistinctStates.add(entry.getValue());\n\t\t}\n\t\tnoOfNewStates = new HashSet<>(distinctStates).size();\n\t\t//Adding those many number of states\n\t\tfor(int i=0;i<noOfNewStates;i++){\n\t\t\tif(i==0){\n\t\t\t\thypothesis.addInitialState();\n\t\t\t}else{\n\t\t\t\thypothesis.addState();\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"No.of new states \"+noOfNewStates);\n\t\t\n\t\t\n\t\tList<Transition> prefixStateMap = new ArrayList<>();\n\t\t\n\t\t//Adding the transitions for those states\n\t\tit = observationTableUpper.entrySet().iterator();\n\t\tSystem.out.println(\"Upper table size \"+observationTableUpper);\n\t\tint currentMaxState = 0;\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tString prefix = entry.getKey();\n\t\t\tList<String> results = entry.getValue();\n\t\t\tint currentState = getCurrentState(prefix, prefixStateMap);\n\t\t\tSystem.out.println(\"Current State \"+currentState);\n\t\t\tint nextState;\n\t\t\tif(prefix.contains(\"<>\")){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else if((nextState = checkErrorState(prefix, prefixStateMap))!=-1){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tif(!results.get(i+1).equals(\"-\")){\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Check for two start calls and make sure they end up on the same state.\n\t\t\t\t\t\t * This is Media Player specific and might need to be changed \n\t\t\t\t\t\t * add for conditional checks for other examples. \n\t\t\t\t\t\t * For Android Media Player, calling start after the first call to start\n\t\t\t\t\t\t * doesn't lead to a transition to a new state. So that needs to be specifically handled.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tboolean exceptionCase = false;\n\t\t\t\t\t\tif(prefix.contains(\"$\")){\n\t\t\t\t\t\t\tint lastIndex = prefix.lastIndexOf(\"$\");\n\t\t\t\t\t\t\tString lastCall = prefix.substring(lastIndex+1, prefix.length()-1);\n\t\t\t\t\t\t\tif(lastCall.contains(\"start()\") && results.get(i).contains(\"start()\")){\n\t\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t\t\texceptionCase = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}if(!exceptionCase){\n\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Add all the final transitions to the automaton object\n\t\t */\n\t\tfor(Transition transition: prefixStateMap){\n\t\t\thypothesis.addTransition(transition);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Populate the Tree representation of the Automaton by doing a breadth-first search\n\t\t */\n\t\tint i = 0;\n\t\twhile(i<hypothesis.getNumberStates()){\n\t\t\tList<Transition> successorDetails = new ArrayList<>();\n\t\t\tfor(Transition transition: prefixStateMap){\n\t\t\t\tint startState = transition.getCurrentState();\n\t\t\t\tif(startState==i){\n\t\t\t\t\tsuccessorDetails.add(transition);\n\t\t\t\t\tautomatonTree.put(startState, successorDetails);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(automatonTree);\n\t\treturn hypothesis;\n\t}", "public GameState(int initialStones) \n {\n \tif (initialStones < 1) initialStones = 4;\n \tfor (int i=0; i<6; i++)\n \t\tstate[i] = state[i+7] = initialStones;\n }", "public double[] initial()\r\n\t{\r\n\t\treturn initial;\r\n\t}", "private void generateAutomaton() {\n /**\n * Chars in the positions:\n * 0 -> \"-\"\n * 1 -> \"+\"\n * 2 -> \"/\"\n * 3 -> \"*\"\n * 4 -> \")\"\n * 5 -> \"(\"\n * 6 -> \"=\"\n * 7 -> \";\"\n * 8 -> [0-9]\n * 9 -> [A-Za-z]\n * 10 -> skip (\"\\n\", \"\\r\", \" \", \"\\t\")\n * 11 -> other symbols\n */\n\n automaton = new State[][]{\n /* DEAD */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* START */ {State.SUB, State.PLUS, State.DIV, State.MUL, State.RPAR, State.LPAR, State.EQ, State.SMICOLON, State.INT, State.VAR, State.DEAD, State.DEAD},\n /* SUB */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* PLUS */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* DIV */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* MUL */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* RPAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* LPAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* EQ */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* SMICOLON */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* INT */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.INT, State.DEAD, State.DEAD, State.DEAD},\n /* VAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.VAR, State.VAR, State.DEAD, State.DEAD}\n };\n }", "public int [][] getState() {\n return stateArray;\n }", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "void state_REQState(){\r\n eccState = INDEX_REQState;\r\n alg_REQAlg();\r\n CNF.serviceEvent(this);\r\n state_START();\r\n}", "public void createCariculum(){\n Set<Session> s = new HashSet<>();\n allCombinations.clear();\n RunAlgo(0, s, createModel());\n filteredResults = allCombinations;//check later if need to adjust.\n }", "private static ArrayList<String> makeStatesArray(BigramModel transProb, ArrayList<String> states) {\n\t\tSet set = transProb.unigramMap.keySet();\n\t\tstates = new ArrayList<String>();\n\t\tIterator itr = set.iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString status = (String) itr.next();\n\t\t\tstates.add(status);\n\t\t}\n\t\treturn states;\n\t}", "private int[] generateInitialSolution(){\n int[] initialSolution = new int[tspProblem.getNumberOfCities()];\n ArrayList<Integer> listToGetRandomCities = new ArrayList<Integer>();\n\n for(int i = 0; i <= initialSolution.length - 1; i++){\n listToGetRandomCities.add(i);\n }\n\n for(int i = 0; i <= initialSolution.length - 1; i++){\n initialSolution[i] = getRandomCity(listToGetRandomCities);\n }\n\n return initialSolution;\n }", "private void init(myVector[] _initSt, SnowGlobeWin.SolverType _solv) {\n\t\tcurIDX = 0;\t\t\t\t\t\t\t\t\t//cycling ptr to idx in arrays of current sim values\n\t\t\n\t\taPosition = new myVector[szAcc];\n\t\taLinMomentum = new myVector[szAcc];\n\t\taAngMomentum = new myVector[szAcc];\n\t\taForceAcc = new myVector[szAcc];\n\t\taTorqueAcc = new myVector[szAcc];\n\t\taOldPos = new myVector[szAcc];\n\t\taOldLinMmnt = new myVector[szAcc];\n\t\taOldAngMmnt = new myVector[szAcc];\n\t\taOldForceAcc = new myVector[szAcc];\n\t\taOldTorqueAcc = new myVector[szAcc];\n\t\t\n\t\tfor(int i=0;i<szAcc;++i){\n\t\t\taPosition[i] = new myVector();\n\t\t\taLinMomentum[i] = new myVector();\n\t\t\taAngMomentum[i] = new myVector();\n\t\t\taForceAcc[i] = new myVector();\n\t\t\taTorqueAcc[i] = new myVector();\n\t\t\taOldPos[i] = new myVector();\n\t\t\taOldLinMmnt[i] = new myVector();\n\t\t\taOldAngMmnt[i] = new myVector();\n\t\t\taOldForceAcc[i] = new myVector();\n\t\t\taOldTorqueAcc[i] = new myVector();\n\t\t}\n//\t\taPosition[0].set(_pos);\n//\t\taLinMomentum[0].set(_velocity);\n//\t\taAngMomentum[0].set(_velocity);\n//\t\taForceAcc[0].set(_forceAcc);\n//\t\taTorqueAcc.set(_forceAcc);\n//\t\taOldPos[0].set(_pos);\n//\t\taOldLinMmnt[0].set(_velocity);\n//\t\taOldAngMmnt[0].set(_velocity);\n//\t\taOldForceAcc[0].set(_forceAcc);\n//\t\taOldTorqueAcc[0].set(_forceAcc);\n\t\t\n\t\tsetOrigMass(mass);\n//\t\tinitPos = new myVector(_pos);\n//\t\tinitVel = new myVector(_velocity);\n\t\tsolveType = _solv;\n\t\tsolver = new mySolver( _solv);\n\t}", "public StateofPancakes(StateofPancakes state) {\r\n N = state.N;\r\n\tcurr_state = new int[N];\r\n for(int i=0; i<N; i++) \r\n curr_state[i] = state.curr_state[i];\r\n}", "public int setCurrentState(int[][] state) {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\tthis.currentState[i][j] = state[i][j];\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void buildSettlement() {\n\t\t\r\n\t}", "void initializeQ()\n\t{\n\t\tfor (int i = 0; i < statesCount; i++)\n\t\t{\n\t\t\tthis.q.add(new ArrayList<>());\n\t\t}\n\t\tfor (int i = 0; i < statesCount; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < statesCount; j++)\n\t\t\t{\n\t\t\t\tthis.q.get(i).add(j, rewards.get(i).get(j).doubleValue());\n\t\t\t}\n\t\t}\n\t}", "public DoubleArraySpliterator(double[] param1ArrayOfdouble, int param1Int1, int param1Int2, int param1Int3) {\n/* 1177 */ this.array = param1ArrayOfdouble;\n/* 1178 */ this.index = param1Int1;\n/* 1179 */ this.fence = param1Int2;\n/* 1180 */ this.characteristics = param1Int3 | 0x40 | 0x4000;\n/* */ }", "public int[][] getState(){\r\n return this.state;\r\n }", "static byte[] core_init_state(int size, short seed) {\n\t\tbyte[] p=new byte[size];\n\t\tint total=0,next=0,i;\n\t\tbyte[] buf=null;\n\n\t\tfinal_counts = new int[NUM_CORE_STATES];\n\t\ttrack_counts = new int[NUM_CORE_STATES];\n\n\t\tsize--;\n\t\tnext=0;\n\t\twhile ((total+next+1)<size) {\n\t\t\tif (next>0) {\n\t\t\t\tfor(i=0;i<next;i++)\n\t\t\t\t\tp[total+i]=buf[i];\n\t\t\t\tp[total+i]=',';\n\t\t\t\ttotal+=next+1;\n\t\t\t}\n\t\t\tseed++;\n\t\t\tswitch (seed & 0x7) {\n\t\t\t\tcase 0: /* int */\n\t\t\t\tcase 1: /* int */\n\t\t\t\tcase 2: /* int */\n\t\t\t\t\tbuf=intpat((seed>>3) & 0x3);\n\t\t\t\t\tnext=4;\n\t\t\t\tbreak;\n\t\t\t\tcase 3: /* float */\n\t\t\t\tcase 4: /* float */\n\t\t\t\t\tbuf=floatpat((seed>>3) & 0x3);\n\t\t\t\t\tnext=8;\n\t\t\t\tbreak;\n\t\t\t\tcase 5: /* scientific */\n\t\t\t\tcase 6: /* scientific */\n\t\t\t\t\tbuf=scipat((seed>>3) & 0x3);\n\t\t\t\t\tnext=8;\n\t\t\t\tbreak;\n\t\t\t\tcase 7: /* invalid */\n\t\t\t\t\tbuf=errpat((seed>>3) & 0x3);\n\t\t\t\t\tnext=8;\n\t\t\t\tbreak;\n\t\t\t\tdefault: /* Never happen, just to make some compilers happy */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsize++;\n\t\twhile (total<size) { /* fill the rest with 0 */\n\t\t\tp[total]=0;\n\t\t\ttotal++;\n\t\t}\n\t\treturn p;\n\t}", "public OrderDetails promptNewOrder(State[] states, ProductType[] productTypes, String dateFormat) {\n DateTimeFormatter dateFormatter;\n OrderDetails orderDetails;\n LocalDate date;\n String customerName, selection, listOfStates, listOfProductTypes;\n HashMap<String, State> statesMap;\n State state;\n HashMap<String, ProductType> productTypesMap;\n ProductType productType;\n BigDecimal area;\n \n dateFormatter = DateTimeFormatter.ofPattern(dateFormat);\n \n \n // Prompt the date until the date is a future date\n date = promptDate(\n \"\\nToday's date is \" + LocalDate.now().format(dateFormatter) + \".\\n\" + \n \"Please input a date for the order: (\" + dateFormat + \")\",\n dateFormat\n );\n while(date.compareTo(LocalDate.now()) <= 0) {\n date = promptDate(\n \"Your order's date must be in the future.\\n\\n\" + \n \"Today's date is \" + LocalDate.now().format(dateFormatter) + \".\\n\" +\n \"Please input a date for the order: (\" + dateFormat + \")\",\n dateFormat\n );\n }\n \n \n // Prompt the customer name until it is a valid name\n customerName = promptString(\"\\nPlease input your Customer Name:\");\n while(!customerName.matches(\"[\\\\w\\\\., ]+\")) {\n customerName = promptString(\n \"\\nYour name must contain only [a-zA-Z0-9 ,].\\n\" + \n \"Please input your Customer Name:\"\n );\n }\n \n \n // Display all of the available states\n statesMap = new HashMap(states.length);\n listOfStates = \"\";\n ui.say(\"======== AVAILABLE STATES ========\");\n for (var availableState: states) {\n statesMap.put(availableState.getAbbreviation().toLowerCase(), availableState);\n listOfStates += availableState.getAbbreviation() + \", \";\n }\n listOfStates += \"\\b\\b\";\n ui.say(listOfStates);\n \n // Prompt the state until it is a valid state\n selection = promptString(\"\\nPlease select a State to place the order in:\").toLowerCase();\n while (!statesMap.containsKey(selection)) {\n selection = promptString(\n \"Invalid State.\\n\\n\" + \n \"States: \" + listOfStates + \"\\n\" + \n \"Please select a State to place the order in:\").toLowerCase();\n }\n state = statesMap.get(selection);\n\n \n // Display all of the available product types\n productTypesMap = new HashMap(productTypes.length);\n listOfProductTypes = \"\";\n ui.say(\"======== AVAILABLE STATES ========\");\n for (var availableProductType: productTypes) {\n productTypesMap.put(availableProductType.getName().toLowerCase(), availableProductType);\n listOfProductTypes += availableProductType.getName() + \", \";\n }\n listOfProductTypes += \"\\b\\b\";\n ui.say(listOfProductTypes);\n \n // Prompt the product type until it is a valid product type\n selection = promptString(\"\\nPlease select a Product Type to place the order in:\").toLowerCase();\n while (!productTypesMap.containsKey(selection)) {\n selection = promptString(\n \"Invalid Product Type.\\n\\n\" + \n \"Product Types: \" + listOfProductTypes + \"\\n\" + \n \"Please select a Product Type:\").toLowerCase();\n }\n productType = productTypesMap.get(selection);\n \n \n // Prompt for the area of the Order\n area = promptNumber(\"\\nPlease input an area in square feet:\");\n \n orderDetails = new OrderDetails(\n date, customerName, state, productType, area\n );\n return orderDetails;\n }", "public double[] genEmptyUtilities() {\n\t\tdouble[] util = new double[states.size()];\n\t\tfor(int i = 0;i<util.length;i++)\n\t\t\tutil[i] = 0.0;\n\t\treturn util;\n\t}", "public void setState(DiagramModel state) {\r\n for (Element e : state) {\r\n savedState_.add(0, e.makeCopy());\r\n }\r\n }", "public Stmt\ninitiateArray(\n Exp pArray, Exp pInitExp,\n Exp pFrom, Exp pTo, Subp pSubp );", "void mo15871a(StateT statet);", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "public CoordinateSPhraseSpec(SPhraseSpec... coords) {\n\t\tsuper();\n\t\tthis.coordinator = new CoordinatePhraseSet<SPhraseSpec>(this);\n\t\tthis.coordinator.addCoordinates(coords);\n\t\tthis.externalComp = false;\n\t}", "public TemporalState getSetTemporalState(TemporalState ts, TemporalState last_state, FSA lts, Statement statement, ArrayList<Statement> s,HashSet<TemporalState> initial_states, HashSet<TemporalState> final_states){\n\t\t\tTemporalStateNode node=getSetTemporalStateNode(s);\n\t\t\tTemporalState state=null;\n\t\t\t \n\t\t\t \n\t\t\tboolean fusion=false;\n\t\t\tboolean blem=false;\n\t\t\tfor(TemporalState temp:node.states){\n\t\t\t\tboolean ok=false;\n\t\t\t\tif (mode>=0){\n\t\t\t\t\tif (temp.checkConstraintsCompatibility(ts)){\n\t\t\t\t\t\tok=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (mode==-2){\n\t\t\t\t\t\tok=temp.exactLoChecking(ts,last_state,lts,statement,initial_states,final_states);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tok=temp.approxLoChecking(ts,last_state,lts,statement);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(statement);\n\t\t\t\t//temp.display(false);\n\t\t\t\t//ts.display(false);\n\t\t\t\t\n\t\t\t\tif (ok){\n\t\t\t\t\tstate=temp;\n\t\t\t\t\tfusion=true;\n\t\t\t\t\t//System.out.println(\"fusion \"+ts+\" avec \"+temp);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"pas de fusion de \"+ts+\" avec \"+temp);\n\t\t\t\t\t//System.out.println(\"pas fusion\");\n\t\t\t\t\tblem=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!fusion){\n\t\t\t\tstate=new TemporalState(ts.requiredPast,ts.requiredFuture,ts.ensuredPast,ts.ensuredFuture,ts.past,ts.future);\n\t\t\t\t/*state.beganFutureSequences=ts.beganFutureSequences;\n\t\t\t\tstate.beganPastSequences=ts.beganPastSequences;\n\t\t\t\tstate.forbidenFuture=ts.forbidenFuture;\n\t\t\t\tstate.forbidenPast=ts.forbidenPast;*/\n\t\t\t\tnode.states.add(state);\n\t\t\t\tlts.addState(state);\n\t\t\t}\n\t\t\t\n\t\t\tif (last_state!=null){\n\t\t\t\tTransition tr=new Transition(last_state,statement,state);\n\t\t\t\tlts.addTransition(tr);\n\t\t\t}\n\t\t\t\n\t\t\tif (mode>=0){\n\t\t\t\tif(updateMode==0){\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> requiredFuture=TemporalState.union(state.requiredFuture,ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> past=TemporalState.intersect(state.past,ts.past);\n\t\t\t\t\tHashSet<Sequence> future=TemporalState.intersect(state.future,ts.future);\n\t\t\t\t\tHashSet<Sequence> lrequiredPast=TemporalState.copy(requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\tlrequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(lrequiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tstate.updateRequiredPast(requiredPast);\n\t\t\t\t\tstate.updateRequiredFuture(requiredFuture);\n\t\t\t\t\tstate.updateFuture(future);\n\t\t\t\t\tstate.updatePast(past);\n\t\t\t\t\n\t\t\t\t\tts.updatePast(past);\n\t\t\t\t\tts.updateRequiredFuture(requiredFuture);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\trequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(requiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tHashSet<Sequence> srp=TemporalState.copy(state.requiredPast);\n\t\t\t\t\tHashSet<Sequence> srf=TemporalState.copy(state.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> sp=TemporalState.copy(state.past);\n\t\t\t\t\tHashSet<Sequence> sf=TemporalState.copy(state.future);\n\t\t\t\t\tHashSet<Sequence> trp=TemporalState.copy(ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> trf=TemporalState.copy(ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> tp=TemporalState.copy(ts.past);\n\t\t\t\t\tHashSet<Sequence> tf=TemporalState.copy(ts.future);\n\t\t\t\t\t\n\t\t\t\t\tstate.updateRequiredPast(TemporalState.firstMinusSecond(trp,srp),1);\n\t\t\t\t\tstate.updateRequiredFuture(TemporalState.firstMinusSecond(trf,srf),1);\n\t\t\t\t\tstate.updatePast(TemporalState.firstMinusSecond(sp,tp),1);\n\t\t\t\t\tstate.updateFuture(TemporalState.firstMinusSecond(sf,tf),1);\n\t\t\t\t\t\n\t\t\t\t\tts.updateRequiredFuture(TemporalState.firstMinusSecond(srf,trf),1);\n\t\t\t\t\tts.updatePast(TemporalState.firstMinusSecond(tp,sp),1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t/*if (NewTemporalState.mode>=0){\n\t\t\t\t\n\t\t\t}*/\n\t\t\t/*else{\n\t\t\t\tSystem.out.println(\"Ensure ok\");\n\t\t\t}*/\n\t\t\t//\n\t\t\t//System.out.println(\"fin\"+lts.getStates().size());\n\t\t\t/*if (blem){\n\t\t\t\tGenerateDOT.printDot(lts, \"a.dot\");\n\t\t\t\tReader reader = new InputStreamReader(System.in);\n\t\t\t\tBufferedReader input = new BufferedReader(reader);\n\t\t\t\tSystem.out.print(\"tapez touche pour continuer\");\n\t\t\t\ttry{\n\t\t\t\t\tString ok = input.readLine();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e){System.out.println(e);}\n\t\t\t}*/\n\t\t\t\n\t\t\treturn(state);\n\t\t}", "public static void getInitialStates(int rows, int cols, int [][] states){\n // Create a 2d array for initial state of cells\n states = new int[rows][cols];\n Random rand = new Random();\n int random = rand.nextInt();\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (random%100 <= 100*NUM_CELLS/(rows*cols)){\n states[i][j] = 1;\n }\n else{\n states[i][j] = 0;\n }\n }\n }\n }", "public ValueGenerator(String[] words, int state1, int state2, int state3, int state4,\n\t\t\tint state5) {\n\t\tthis.state1 = state1;\n\t\tthis.state2 = state2;\n\t\tthis.state3 = state3;\n\t\tthis.state4 = state4;\n\t\tthis.state5 = state5;\n\t\tthis.words = words;\n\t\twordJoiner = new WordJoiner();\n\t}", "public ConfidenceAlignment(String sgtFile,String tgsFile,String sgtLexFile,String tgsLexFile){\r\n\t\r\n\t\tLEX = new TranslationLEXICON(sgtLexFile,tgsLexFile);\r\n\t\t\r\n\t\tint sennum = 0;\r\n\t\tdouble score = 0.0;\r\n\t\t// Reading a GZIP file (SGT) \r\n\t\ttry { \r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader\r\n\t\t\t\t\t\t\t\t(new GZIPInputStream(new FileInputStream(sgtFile)),\"UTF8\"));\r\n\t\t\r\n\t\tString one = \"\"; String two =\"\"; String three=\"\"; \r\n\t\twhile((one=br.readLine())!=null){\r\n\t\t\ttwo = br.readLine(); \r\n\t\t\tthree=br.readLine(); \r\n\r\n\t\t\tMatcher m1 = scorepattern.matcher(one);\r\n\t\t\tif (m1.find()) \r\n\t\t\t{\r\n\t\t\t\tscore = Double.parseDouble(m1.group(1));\r\n\t\t\t\t//System.err.println(\"Score:\"+score);\r\n\t\t\t}\r\n\r\n\t\t\tgizaSGT.put(sennum,score); \r\n\t\t\tsennum++;\r\n\t\t}\r\n\t\tbr.close();\r\n\t\tSystem.err.println(\"Loaded \"+sennum+ \" sens from SGT file:\"+sgtFile);\r\n\t\t\r\n\t\t// Reading a GZIP file (TGS)\r\n\t\tsennum = 0; \r\n\t\tbr = new BufferedReader(new InputStreamReader\r\n\t\t\t\t\t\t\t\t(new GZIPInputStream(new FileInputStream(tgsFile)),\"UTF8\")); \r\n\t\twhile((one=br.readLine())!=null){\r\n\t\t\ttwo = br.readLine(); \r\n\t\t\tthree=br.readLine(); \r\n\t\t\t\r\n\t\t\tMatcher m1 = scorepattern.matcher(one);\r\n\t\t\tif (m1.find()) \r\n\t\t\t{\r\n\t\t\t\tscore = Double.parseDouble(m1.group(1));\r\n\t\t\t\t//System.err.println(\"Score:\"+score);\r\n\t\t\t}\r\n\t\t\tgizaTGS.put(sennum,score); \r\n\t\t\tsennum++;\r\n\t\t}\r\n\t\tbr.close();\t\t\r\n\t\t}catch(Exception e){}\r\n\t\tSystem.err.println(\"Loaded \"+sennum+ \" sens from SGT file:\"+sgtFile);\t\r\n\t}", "private double[] generateRandomCoordinates() {\n return generateRandomCoordinates(CoordinateDomain.GEOGRAPHIC, 0.05f);\n }", "private void initState() {\n Arrays.fill(state = new char[this.mystery.length()], '_');\n }", "int mo5866a(State state, String... strArr);", "void resetInitialState(SpacecraftState state)\n throws OrekitException;", "void setFeatureArray(org.landxml.schema.landXML11.FeatureDocument.Feature[] featureArray);", "void setFeatureArray(org.landxml.schema.landXML11.FeatureDocument.Feature[] featureArray);", "public static POMDPState sampleInitialStates(Domain d) {\n\t\tPOMDPState s = new POMDPState();\n\n\t\t//Retrieve object classes from the domain.\n\t\tObjectClass containerClass = d.getObjectClass(Names.CLASS_CONTAINER);\n\t\tObjectClass babyClass = d.getObjectClass(Names.CLASS_BABY);\n\t\tObjectClass contentClass = d.getObjectClass(Names.CLASS_CONTENT);\n\t\tObjectClass humanClass = d.getObjectClass(Names.CLASS_HUMAN);\n\n\t\t//Create all the objects \n\t\tObjectInstance caregiver = new ObjectInstance(humanClass, Names.OBJ_CAREGIVER);\n\t\tObjectInstance baby = new ObjectInstance(babyClass, Names.OBJ_BABY);\n\t\tObjectInstance ointment = new ObjectInstance(contentClass, Names.OBJ_OINTMENT);\n\t\tObjectInstance oldClothes = new ObjectInstance(contentClass, Names.OBJ_OLD_CLOTHES);\n\t\tObjectInstance newClothes = new ObjectInstance(contentClass, Names.OBJ_NEW_CLOTHES);\n\t\tObjectInstance changingTable = new ObjectInstance(containerClass, Names.OBJ_CHANGING_TABLE);\n\t ObjectInstance hamper = new ObjectInstance(containerClass, Names.OBJ_HAMPER);\n\t\tObjectInstance sideTable = new ObjectInstance(containerClass, Names.OBJ_SIDE_TABLE);\n\t ObjectInstance dresser = new ObjectInstance(containerClass, Names.OBJ_DRESSER);\n\n\t\t//Set the \tproper values for objects' attributes\n\t\tchangingTable.setValue(Names.ATTR_OPEN, 1);\n\t hamper.setValue(Names.ATTR_OPEN, 1);\n\t\tsideTable.setValue(Names.ATTR_OPEN, 1);\n\t\tdresser.setValue(Names.ATTR_OPEN, 0);\n\t\tbaby.setValue(Names.ATTR_RASH, new java.util.Random().nextBoolean() ? 1 : 0);\n\n\t\t//Place contents in the proper initial container\n\t\tplaceObject(newClothes, dresser);\n\t\tplaceObject(oldClothes, changingTable);\n\t\tplaceObject(ointment, sideTable);\n\n\t\t//Add objects to the state, and have the caregiver decide on its mental state\n\t\taddObjects(s, caregiver, baby, oldClothes, newClothes, changingTable, hamper, sideTable, dresser, ointment);\n\t\tcaregiverThink(d, s);\n\n\t\t//Et voila\n\t\treturn s;\n\t}", "public HasQuarterStateTest()\n {\n }", "public ArrayList<State> stringArraytoStateArray (ArrayList<String> pArray)\r\n\t{\r\n\t\tArrayList<State> sArray = new ArrayList<State>();\r\n\t\tfor (Iterator<String> iterator = pArray.iterator(); iterator.hasNext();) \r\n\t\t{\r\n\t\t\tString string1 = (String) iterator.next();\r\n\t\t\tState sTemp = new State(string1);\r\n\t\t\tsTemp.toString();\r\n\t\t\tsArray.add(sTemp);\r\n\t\t}\r\n\t\treturn sArray;\r\n\t}", "private double[] y_disk2(VectorN state, double t, int p, double R, int inoise){\r\n\t\t//double jd=this.jd0+t/86400;\r\n\t\t//int lx=state.x.length;\r\n\t\t\r\n\t\tVectorN xr = new VectorN(3);\r\n\t\tVectorN pos = state.get(0,3);\r\n\t\tVectorN xm = new VectorN(3);\r\n//\t\tif (p==BODY_EARTH) //% Earth\r\n//\t\t\txr=pos;\r\n//\t\telse if (p==BODY_MOON){ //% Moon\r\n\t\t\t//* TODO watch units\r\n//\t\t\txm=ephem.get_Geocentric_Moon_pos(\r\n//\t\t\t\t\tTimeUtils.MJDtoJD(Time.TTtoTDB(Time.UTC2TT(mjd0+t/86400)))).times(1000);\r\n\t\t\tCentralBody cbod = gravbody.get(cbody);\r\n\t\t\tCentralBody vbod = gravbody.get(p);\r\n\t\t\tReferenceFrameTranslater xlater = \r\n\t\t new ReferenceFrameTranslater(cbod.inertialRef, vbod.inertialRef, new Time(mjd0+t/86400.0));\r\n\t\t //VectorN li = xlater.translatePoint(lf);\r\n\t\t xr = xlater.translatePoint(pos);\r\n\t\t\t//xr=(pos.minus(xm));\r\n//\t\t} else\r\n\t//\t\tSystem.err.println(\"Parameter must be 1 for Earth or 2 for Moon.\");\r\n\t\t\r\n\t\tdouble r=xr.mag();\r\n\t\tdouble y=R/r; //% sin(half-angle)\t\t\r\n\t\t\r\n\t\tif (y>1){\r\n\t\t\tSystem.out.println(\"R/r greater than 1, pause\");\r\n//\t\t\ttry{\r\n//\t\t\t\tSystem.in.read();\r\n//\t\t\t}catch(Exception e){}\r\n\t\t}\r\n\t\t\r\n\t\t//% Add noise\r\n\t\tif (inoise==1){\r\n\t\t\tdouble[] arnd_abias =camerr(r,p); //% 1-sigma noise and bias on angular measurement\r\n\t\t\tif(type==TYPE_LANDMARK){\r\n\t\t\t\tarnd_abias[0] = arnd_abias[0]*1;\r\n\t\t\t}\r\n\t\t\ty=Math.sin(Math.asin(y)+arnd_abias[0]*randn()+arnd_abias[1]);\r\n\t\t}else{\r\n\t\t\t//y = y + state.x[i_ydiskbias];\r\n\t\t}\r\n\t\t\r\n\t\t//% Compute Jacobian\r\n\t\tVectorN tmp = new VectorN(xr.times(-R/(r*r*r)),new VectorN(3));\r\n\t\tdouble[] dydx = tmp.x;\r\n\t\t\r\n\t\t//% % Assume the bias is on the pseudo measurement rather than angle itself\r\n\t\t//% if lx==8\r\n\t\t//% y=y+x(8);\r\n\t\t//% dydx=[dydx 0 1];\r\n\t\t//% end\r\n\t\t\r\n\t\t\r\n\t\tdouble[] out = new double[state.length+1];\r\n\t\tout[0] = y;\r\n\t\tfor(int i=1; i<7; i++) out[i] = dydx[i-1];\r\n\t\treturn out;\r\n\t}", "private static void generateState() {\n byte[] array = new byte[7]; // length is bounded by 7\n new Random().nextBytes(array);\n STATE = new String(array, Charset.forName(\"UTF-8\"));\n }", "@GetMapping ( BASE_PATH + \"/pharmacies/state/{state}\" )\n public List<Pharmacy> getPharmacies ( @PathVariable ( \"state\" ) final String state ) {\n final List<Pharmacy> all = Pharmacy.getAllinState( state );\n for ( final Pharmacy pharmacy : all ) {\n pharmacy.nullPrescriptions();\n }\n return all;\n }", "public StateTaxes(String stateAbbr)\n {\n this.stateAbbr = stateAbbr;\n }", "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 constructDrawing(){\r\n\r\n resetToEmpty(); // should be empty anyway\r\n\r\n// universe=TFormula.atomicTermsInListOfFormulas(fInterpretation);\r\n \r\n Set <String> universeStrSet=TFormula.atomicTermsInListOfFormulas(fInterpretation);\r\n \r\n universe=\"\";\r\n \r\n for (Iterator i=universeStrSet.iterator();i.hasNext();)\r\n \tuniverse+=i.next();\r\n \r\n\r\n findPropertyExtensions();\r\n\r\n findRelationsExtensions();\r\n\r\n determineLines();\r\n\r\n createProperties();\r\n\r\n createIndividuals();\r\n\r\n createRelations();\r\n\r\n deselect(); //all shapes are created selected\r\n\r\n\r\n fPalette.check(); // some of the names may need updating\r\n\r\n repaint();\r\n\r\n}", "public static void main(String[] args) {\n int[] p0 = {2,9,10};\n int[] p1 = {3,7,15};\n int[] p2 = {5,12,12};\n int[] p3 = {15,20,10};\n int[] p4 = {19,24,8};\n\n int[][] building = new int[5][3];\n building[0] = p0;\n building[1] = p1;\n building[2] = p2;\n building[3] = p3;\n building[4] = p4;\n\n List<int[]> res;\n res = getSkyline(building);\n\n }", "SpacecraftState getInitialState() throws OrekitException;", "@Override\r\n\tpublic void activate() {\n\t\tif(CID==true) {\r\n\t\t\tinter.setState(inter.getResults());\r\n\t\t}\r\n\t}", "public AbstractDoubleMatrix getTransitionMatrixJacobian(AbstractDoubleVector state)\r\n\t{\n\r\n\t\tF.setElement(0, 2, -d*sin);\r\n\t\tF.setElement(1, 2, d*cos);\r\n\r\n\t\treturn F;\r\n\t}", "private void populateStations() throws Exception{\t\n\t\t\n\t\tTreeSet<String> set = new TreeSet<String>();\n\t\tif(quotList != null){\t\t\t\n\t\t\tfor(int i = 0; i < quotList.length; i++){\t\t\t\t\n\t\t\t\tset.add(quotList[i].getStationCode());\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tIterator<String> itr = set.iterator();\n\t\t\twhile(itr.hasNext()){\n\t\t\t\tcbStation.add(itr.next());\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public StationPartition build() {\n for (int i = 0; i < stationSet.length; ++i) {\n stationSet[i] = representative(i);\n }\n\n return new StationPartition(stationSet);\n }", "SentenceHMMState getState() {\n\treturn state;\n }", "void setNewEstimates(double[] estimates);", "public Transducer ()\n\t{\n\t\tsumLatticeFactory = new SumLatticeDefault.Factory();\n\t\tmaxLatticeFactory = new MaxLatticeDefault.Factory();\n\t}", "public WellSetListPOJOBigDecimal(WellSetBigDecimal[] array) {\n for(WellSetBigDecimal set : array) {\n this.wellsets.add(new WellSetPOJOBigDecimal(set));\n }\n }", "@Override\n\tpublic void beginGeneration() {\n\t\tfor(int seqIndex = 0; seqIndex < NUM_SEQUENCES; ++seqIndex) {\n\t\t\tfor(int pieceIndex = 0; pieceIndex < SEQUENCE_LENGTH; ++pieceIndex) {\n\t\t\t\tsequences[seqIndex][pieceIndex] = random.nextInt(State.N_PIECES);\n\t\t\t}\n\t\t}\n\t}", "public CityCountyStruct_ARRAY() \r\n {\r\n super();\r\n this._cityCountyStructList = new java.util.ArrayList<gov.georgia.dhr.dfcs.sacwis.structs.output.CityCountyStruct>();\r\n }", "private int[][] initialStateMatrix() {\n return new int[][]{{2,1,-1,3,0,-1},\n {2,-1,-1,3,-1,-1},\n {2,-1,5,4,8,-1},\n {4,-1,-1,-1,-1,-1},\n {4,-1,5,-1,8,-1},\n {7,6,-1,-1,-1,-1},\n {7,-1,-1,-1,-1,-1},\n {7,-1,-1,-1,8,-1},\n {-1,-1,-1,-1,8,-1}};\n }", "StatePac build();", "private void updateStateOnce() {\n for(int i = 0; i < maskArray.length; i++) {\n for (int j = 0; j < maskArray[i].length; j++) {\n\n if (maskArray[i][j] == 1){\n stateArray[i][j] = stateGenerator.generateElementState();\n }\n\n }\n }\n }", "private void initShape()\n\t{\n\t\tcoords = new int[4][2];\n\t\tcoordsTable = new int [][][] \n\t\t{\n { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },\n { { 0, -1 }, { 0, 0 }, { -1, 0 }, { -1, 1 } },\n { { 0, -1 }, { 0, 0 }, { 1, 0 }, { 1, 1 } },\n { { 0, -1 }, { 0, 0 }, { 0, 1 }, { 0, 2 } },\n { { -1, 0 }, { 0, 0 }, { 1, 0 }, { 0, 1 } },\n { { 0, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } },\n { { -1, -1 }, { 0, -1 }, { 0, 0 }, { 0, 1 } },\n { { 1, -1 }, { 0, -1 }, { 0, 0 }, { 0, 1 } }\n\t\t};\n\t\t\n\t\tsetShape (Tetromino.NOSHAPE);\n\t}", "void setBioAssemblyTrans(int bioAssemblyIndex, int[] inputChainIndices, double[] inputTransform, String name);", "private void initCutContext (SessionState state)\n\t{\n\t\tstate.setAttribute (STATE_CUT_IDS, new Vector ());\n\n\t\tstate.setAttribute (STATE_CUT_FLAG, Boolean.FALSE.toString());\n\n\t}", "public void initState() {\n\n\t\tdouble bsc_p = 0.09; // TODO : doit dependre du souffle !?\n\t\tfor (int i=0; i<n; i++) lambda[i] = 0;\n\t\taddBSCnoise(lambda, bsc_p); \n\t\t// lambda: log likelihood ratio\n\t\tcalc_q0(lambda);\n\n\t\t// initialization of beta\n\t\tfor (int i = 0; i <= m - 1; i++) {\n\t\t\tfor (int j = 0; j <= row_weight[i] - 1; j++) {\n\t\t\t\tbeta[i][j] = 0.0;\n\t\t\t}\n\t\t}\t\t\n\n\t}", "public ReducedFormList(double[] LatticeParamsExp)\r\n {\r\n\r\n DataBase = new ReducedCellInfo[ 45 ];\r\n\r\n for( int i = 0 ; i < 45 ; i++ )\r\n DataBase[i] = new ReducedCellInfo( i , LatticeParamsExp[0] , LatticeParamsExp[1] ,\r\n LatticeParamsExp[2] , LatticeParamsExp[3] , LatticeParamsExp[4] , LatticeParamsExp[5] );\r\n\r\n }", "public DataSet<KeyedStateRow> getKeyedStateRows(Set<String> stateNames) {\n\t\treadKeyedStates();\n\t\tHashSet<String> filtered = new HashSet<>(stateNames);\n\t\treturn allKeyedStateRows.filter(row -> filtered.contains(row.f0));\n\t}", "void setPlanFeatureArray(org.landxml.schema.landXML11.PlanFeatureDocument.PlanFeature[] planFeatureArray);", "private void initialize()\n {\n // Initialize any variables which are time-independent when\n // calculating the ECI coordinates of the satellite.\n m_satInc = orbit.Inclination();\n m_satEcc = orbit.Eccentricity();\n\n m_cosio = Math.cos(m_satInc);\n m_theta2 = m_cosio * m_cosio;\n m_x3thm1 = 3.0 * m_theta2 - 1.0;\n m_eosq = m_satEcc * m_satEcc;\n m_betao2 = 1.0 - m_eosq;\n m_betao = Math.sqrt(m_betao2);\n\n // The \"recovered\" semimajor axis and mean motion.\n m_aodp = orbit.SemiMajor();\n m_xnodp = orbit.MeanMotion();\n\n // For perigee below 156 km, the values of Globals.S and Globals.QOMS2T are altered.\n m_perigee = Globals.Xkmper * (m_aodp * (1.0 - m_satEcc) - Globals.Ae);\n\n m_s4 = Globals.S;\n m_qoms24 = Globals.Qoms2t;\n\n if (m_perigee < 156.0)\n {\n m_s4 = m_perigee - 78.0;\n\n if (m_perigee <= 98.0)\n {\n m_s4 = 20.0;\n }\n\n m_qoms24 = Math.pow((120.0 - m_s4) * Globals.Ae / Globals.Xkmper, 4.0);\n m_s4 = m_s4 / Globals.Xkmper + Globals.Ae;\n }\n\n double pinvsq = 1.0 / (m_aodp * m_aodp * m_betao2 * m_betao2);\n\n m_tsi = 1.0 / (m_aodp - m_s4);\n m_eta = m_aodp * m_satEcc * m_tsi;\n m_etasq = m_eta * m_eta;\n m_eeta = m_satEcc * m_eta;\n\n double psisq = Math.abs(1.0 - m_etasq);\n\n m_coef = m_qoms24 * Math.pow(m_tsi,4.0);\n m_coef1 = m_coef / Math.pow(psisq,3.5);\n\n double c2 = m_coef1 * m_xnodp *\n (m_aodp * (1.0 + 1.5 * m_etasq + m_eeta * (4.0 + m_etasq)) +\n 0.75 * Globals.Ck2 * m_tsi / psisq * m_x3thm1 *\n (8.0 + 3.0 * m_etasq * (8.0 + m_etasq)));\n\n m_c1 = orbit.BStar() * c2;\n m_sinio = Math.sin(m_satInc);\n\n double a3ovk2 = -Globals.Xj3 / Globals.Ck2 * Math.pow(Globals.Ae,3.0);\n\n m_c3 = m_coef * m_tsi * a3ovk2 * m_xnodp * Globals.Ae * m_sinio / m_satEcc;\n m_x1mth2 = 1.0 - m_theta2;\n m_c4 = 2.0 * m_xnodp * m_coef1 * m_aodp * m_betao2 *\n (m_eta * (2.0 + 0.5 * m_etasq) +\n m_satEcc * (0.5 + 2.0 * m_etasq) -\n 2.0 * Globals.Ck2 * m_tsi / (m_aodp * psisq) *\n (-3.0 * m_x3thm1 * (1.0 - 2.0 * m_eeta + m_etasq * (1.5 - 0.5 * m_eeta)) +\n 0.75 * m_x1mth2 *\n (2.0 * m_etasq - m_eeta * (1.0 + m_etasq)) *\n Math.cos(2.0 * orbit.ArgPerigee())));\n\n double theta4 = m_theta2 * m_theta2;\n double temp1 = 3.0 * Globals.Ck2 * pinvsq * m_xnodp;\n double temp2 = temp1 * Globals.Ck2 * pinvsq;\n double temp3 = 1.25 * Globals.Ck4 * pinvsq * pinvsq * m_xnodp;\n\n m_xmdot = m_xnodp + 0.5 * temp1 * m_betao * m_x3thm1 +\n 0.0625 * temp2 * m_betao *\n (13.0 - 78.0 * m_theta2 + 137.0 * theta4);\n\n double x1m5th = 1.0 - 5.0 * m_theta2;\n\n m_omgdot = -0.5 * temp1 * x1m5th + 0.0625 * temp2 *\n (7.0 - 114.0 * m_theta2 + 395.0 * theta4) +\n temp3 * (3.0 - 36.0 * m_theta2 + 49.0 * theta4);\n\n double xhdot1 = -temp1 * m_cosio;\n\n m_xnodot = xhdot1 + (0.5 * temp2 * (4.0 - 19.0 * m_theta2) +\n 2.0 * temp3 * (3.0 - 7.0 * m_theta2)) * m_cosio;\n m_xnodcf = 3.5 * m_betao2 * xhdot1 * m_c1;\n m_t2cof = 1.5 * m_c1;\n m_xlcof = 0.125 * a3ovk2 * m_sinio *\n (3.0 + 5.0 * m_cosio) / (1.0 + m_cosio);\n m_aycof = 0.25 * a3ovk2 * m_sinio;\n m_x7thm1 = 7.0 * m_theta2 - 1.0;\n }", "private void buildSettlement() {\r\n\t\t// client.setCurrentPhase(Constants.PHASE_3);\r\n\t\tlastSettlementNode = clickedNode;\r\n\t\tMessage message = new Message(clickedNode, true, null);\r\n\t\tsendMessage(message);\r\n\t}" ]
[ "0.5106366", "0.49770626", "0.49656534", "0.47379303", "0.47201025", "0.46621522", "0.4617894", "0.4594368", "0.45778507", "0.4559568", "0.45261452", "0.45109373", "0.44938856", "0.44840732", "0.44460425", "0.44299808", "0.44200402", "0.44178247", "0.4411152", "0.439015", "0.43838376", "0.43745112", "0.43646714", "0.4358089", "0.43426844", "0.4329363", "0.432808", "0.43205988", "0.43059704", "0.43031368", "0.42959303", "0.42857763", "0.4277468", "0.42609543", "0.42472103", "0.42440954", "0.4243132", "0.42353538", "0.42320317", "0.42233914", "0.42039227", "0.420002", "0.41983125", "0.418951", "0.41789746", "0.41732544", "0.4167617", "0.41533202", "0.41520995", "0.41458315", "0.41439012", "0.41418338", "0.4129098", "0.41239074", "0.41200796", "0.4115675", "0.4115079", "0.41133225", "0.41128126", "0.4111298", "0.4110826", "0.41090214", "0.41084218", "0.41082418", "0.41032958", "0.4100763", "0.4100763", "0.40982583", "0.40855005", "0.40764266", "0.4074846", "0.40725228", "0.40681526", "0.4067112", "0.40615004", "0.40582937", "0.40578327", "0.40569443", "0.40507403", "0.4047588", "0.40434438", "0.404092", "0.40388095", "0.40387186", "0.4033", "0.40294543", "0.4027382", "0.40166134", "0.40164936", "0.40099192", "0.39967147", "0.39949918", "0.39923543", "0.39896986", "0.3987097", "0.3986218", "0.39845142", "0.39728925", "0.3970965", "0.3968798" ]
0.5243337
0
Retrieve the Stream Coupon Basis
public double basis() { return _lsPeriod.get (0).basis(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getIncomeStreamFinancialCoaCode() {\n return incomeStreamFinancialCoaCode;\n }", "int getCouponStat();", "int getCouponType();", "public java.lang.String couponCurrency()\n\t{\n\t\treturn _lsPeriod.get (_lsPeriod.size() - 1).couponCurrency();\n\t}", "@java.lang.Override\n public godot.wire.Wire.Basis getBasis() {\n return basis_ == null ? godot.wire.Wire.Basis.getDefaultInstance() : basis_;\n }", "public String getCurp(){\r\n return beneficiario[0].toString();\r\n }", "public String getCouleur() {\n return this.COULEUR;\n }", "public String getCouleur() {\n return this.COULEUR;\n }", "public godot.wire.Wire.Basis getBasis() {\n if (basisBuilder_ == null) {\n return basis_ == null ? godot.wire.Wire.Basis.getDefaultInstance() : basis_;\n } else {\n return basisBuilder_.getMessage();\n }\n }", "public Integer getwPrIsCoupon() {\n return wPrIsCoupon;\n }", "java.lang.String getCouponDescription();", "java.lang.String getCouponDescription();", "EDataType getConductance();", "@java.lang.Override\n public godot.wire.Wire.Basis getBasisValue() {\n if (typeCase_ == 13) {\n return (godot.wire.Wire.Basis) type_;\n }\n return godot.wire.Wire.Basis.getDefaultInstance();\n }", "public String getwPrCouponNo() {\n return wPrCouponNo;\n }", "godot.wire.Wire.Basis getBasisValue();", "public double getCouponRate() {\n return _couponRate;\n }", "public Account getIncomeStreamAccount() {\n return incomeStreamAccount;\n }", "public String getCouleur() {\n\t\treturn this.couleur;\n\t}", "@Override\n\tpublic String getCouleur() {\n\t\treturn null;\n\t}", "public int getCouponType() {\n return couponType_;\n }", "public int getCouponStat() {\n return couponStat_;\n }", "String getTradeCurrency();", "java.lang.String getCouponName();", "java.lang.String getCouponName();", "java.lang.String getCouponName();", "public String getIncomeStreamAccountNumber() {\n return incomeStreamAccountNumber;\n }", "@java.lang.Override\n public godot.wire.Wire.BasisOrBuilder getBasisValueOrBuilder() {\n if (typeCase_ == 13) {\n return (godot.wire.Wire.Basis) type_;\n }\n return godot.wire.Wire.Basis.getDefaultInstance();\n }", "java.lang.String getCouponContent();", "java.lang.String getCouponContent();", "@java.lang.Override\n public godot.wire.Wire.BasisOrBuilder getBasisOrBuilder() {\n return getBasis();\n }", "public int getCouponType() {\n return couponType_;\n }", "godot.wire.Wire.BasisOrBuilder getBasisValueOrBuilder();", "public int getCouponStat() {\n return couponStat_;\n }", "@WebMethod public Coupon getCoupon(String coupon);", "int getCouponNum();", "String getSettlementCurrency();", "public godot.wire.Wire.BasisOrBuilder getBasisOrBuilder() {\n if (basisBuilder_ != null) {\n return basisBuilder_.getMessageOrBuilder();\n } else {\n return basis_ == null ?\n godot.wire.Wire.Basis.getDefaultInstance() : basis_;\n }\n }", "public Coupon() {\n\t\tsuper();\n\t\tsetAvailable(true);\n\t}", "java.lang.String getCouponVendor();", "@java.lang.Override\n public godot.wire.Wire.Basis getBasisValue() {\n if (basisValueBuilder_ == null) {\n if (typeCase_ == 13) {\n return (godot.wire.Wire.Basis) type_;\n }\n return godot.wire.Wire.Basis.getDefaultInstance();\n } else {\n if (typeCase_ == 13) {\n return basisValueBuilder_.getMessage();\n }\n return godot.wire.Wire.Basis.getDefaultInstance();\n }\n }", "public java.lang.String couponDC()\n\t{\n\t\treturn _lsPeriod.get (0).periods().get (0).couponDC();\n\t}", "Uom getOrigCurrencyUom();", "public String getCashFlow() {\n\n return this.cashFlow;\n }", "Uom getCurrencyUom();", "public static float getConsumeRate() {\n return consumerate;\n }", "public abstract String getCurrencyType();", "com.google.protobuf.ByteString\n getCouponDescriptionBytes();", "com.google.protobuf.ByteString\n getCouponDescriptionBytes();", "godot.wire.Wire.Basis getBasis();", "@Override\n public String getCPR() {\n return CPR;\n }", "public String getFinancialDocumentBankCode() {\r\n return financialDocumentBankCode;\r\n }", "public Currency getCurrency1() {\n return _underlyingForex.getCurrency1();\n }", "public JP430000.bssv.e1.oracle.ConfirmPurchaseOrderFinancialHeader getFinancial() {\n return financial;\n }", "Currency getCurrency();", "private CurrencyAccessBean determineBaseCurrency() {\n\t// Determine base currency\n\tCurrencyAccessBean crab = null;\n\ttry {\n\t\tNamedValueAccessBean cab = new NamedValueAccessBean();\n\t\tcab.setInitKey_id(\"BASE_CURRENCY\");\n\t\tcab.refreshCopyHelper();\n\n\t\tcrab = new CurrencyAccessBean();\n\t\tcrab.setInitKey_currency(cab.getIntvalue());\n\t\tcrab.refreshCopyHelper();\n\t} catch (Exception ex) {\n\t\tcrab = null;\n\t\tSystem.out.println(\"PLATINUM-SYNC: BASE_CURRENCY constant not found or illegal\");\n\t}\n\treturn crab;\n}", "public StudentFunctionalityController getSfCon() {\n\t\treturn sfCon;\n\t}", "public BigDecimal getCOVERING_ACC_CIF() {\r\n return COVERING_ACC_CIF;\r\n }", "public int getCustomInformationTransferRate();", "public Account getCoor() {\r\n return coor;\r\n }", "@java.lang.Override\n public godot.wire.Wire.BasisOrBuilder getBasisValueOrBuilder() {\n if ((typeCase_ == 13) && (basisValueBuilder_ != null)) {\n return basisValueBuilder_.getMessageOrBuilder();\n } else {\n if (typeCase_ == 13) {\n return (godot.wire.Wire.Basis) type_;\n }\n return godot.wire.Wire.Basis.getDefaultInstance();\n }\n }", "public String getDiscribe() {\n\t\treturn discribe;\n\t}", "public String getSupAcctBank() {\n return supAcctBank;\n }", "@Override\n protected BuiltinExchangeType getExchangeType() {return BuiltinExchangeType.FANOUT;}", "public String getBoatConstruct() {\n return BOATCONSTRUCT[boatConstructIndex];\n }", "public double getCouponAmount() {\n return _couponAmount;\n }", "public int getCouponNum() {\n return couponNum_;\n }", "public Currency getCurrency2() {\n return _underlyingForex.getCurrency2();\n }", "public double getAccrualFactorToNextCoupon() {\n return _factorToNextCoupon;\n }", "public Coupon() {\n }", "CineScopesTransmitter getCineScopesTransmitter();", "EDataType getSusceptance();", "@Override\n public byte getSubtype() {\n return SUBTYPE_COLORED_COINS_BID_ORDER_CANCELLATION;\n }", "public ConciliazionePerBeneficiarioSoggettoConverter() {\n\t\tsuper(ConciliazionePerBeneficiario.class, SiacRConciliazioneBeneficiario.class);\n\t}", "@Override\n public COSStream getCOSObject()\n {\n return stream;\n }", "public BigDecimal getACC_CIF() {\r\n return ACC_CIF;\r\n }", "public int getCouponNum() {\n return couponNum_;\n }", "java.util.List<hr.client.appuser.CouponCenter.StreamCouponHistory> \n getStreamCouponHistoryListList();", "godot.wire.Wire.BasisOrBuilder getBasisOrBuilder();", "public String getSContractNo() {\n return sContractNo;\n }", "com.google.protobuf.ByteString\n getCouponNameBytes();", "com.google.protobuf.ByteString\n getCouponNameBytes();", "com.google.protobuf.ByteString\n getCouponNameBytes();", "public Key<CashFlow> getCashflow() {\n\t\treturn cashflow;\n\t}", "public String getCpf() {\n return cpf;\n }", "java.lang.String getBrokerCommission();", "public String getBillSouce() {\n return billSouce;\n }", "public String getCurrencyPair() {\n return _ccyPair;\n }", "public BigDecimal getwPrCouponPrice() {\n return wPrCouponPrice;\n }", "public String getCHEQUE_BANK() {\r\n return CHEQUE_BANK;\r\n }", "public Currency getCurrency();", "public byte[] getOcf() {\n return ocf;\n }", "public String getSplitCurrency() {\r\n\treturn fxndf.getSplitCurrency();\r\n }", "public String getCuisine(){\n return cuisine;\n }", "public String getwPrPayChannel() {\n return wPrPayChannel;\n }", "public COSStream getCOSObject() {\n/* 202 */ return this.stream;\n/* */ }", "public String getAccountInterestRate(){\n if (currentAccount instanceof SavingAccount){\n Float myFloat;\n myFloat = ((SavingAccount)currentAccount).getInterestRate();\n return myFloat.toString();\n }\n else if (currentAccount instanceof NetSavingAccount){\n Float myFloat;\n myFloat = ((NetSavingAccount)currentAccount).getInterestRate();\n return myFloat.toString();\n }\n else if (currentAccount instanceof ChequeAccount){\n Float myFloat;\n myFloat = ((ChequeAccount)currentAccount).getInterestRate();\n return myFloat.toString();\n }\n else if (currentAccount instanceof FixedAccount){\n Float myFloat;\n myFloat = ((FixedAccount)currentAccount).getInterestRate();\n return myFloat.toString();\n }\n else{\n System.out.println(\"Get Account interestRate not found\");\n return \"error\";\n }\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn super.getCor().equals(\"Branco\") ? \" ♘ \": \" ♞ \";\r\n\t}", "java.lang.String getCouponId();", "public String getDiscounts(){\r\n\t return \"Fines: \" + fines;\r\n }", "com.google.protobuf.ByteString\n getCouponContentBytes();" ]
[ "0.6218416", "0.5815287", "0.5766331", "0.563502", "0.55866957", "0.55527806", "0.5542095", "0.5542095", "0.5522188", "0.54943556", "0.5486817", "0.5486817", "0.54700553", "0.54561204", "0.5452309", "0.54394954", "0.5420144", "0.538395", "0.5367708", "0.5367398", "0.5337157", "0.53130144", "0.5307028", "0.52859217", "0.52859217", "0.52859217", "0.5272983", "0.5259749", "0.52460617", "0.52460617", "0.5243488", "0.5242835", "0.5241218", "0.5233774", "0.5226835", "0.5219256", "0.520652", "0.520147", "0.5193347", "0.51917654", "0.5189654", "0.5184207", "0.51372874", "0.5133342", "0.5129395", "0.5127636", "0.5106329", "0.5099093", "0.5099093", "0.5087274", "0.5085914", "0.50576454", "0.5054602", "0.50540704", "0.5035498", "0.5029195", "0.50232905", "0.5020042", "0.5015555", "0.5015478", "0.50132513", "0.4989296", "0.4988316", "0.49824923", "0.4976971", "0.49705184", "0.49663478", "0.4966234", "0.49641004", "0.4952322", "0.4949227", "0.49456084", "0.49452978", "0.49289063", "0.49208677", "0.49087405", "0.49040103", "0.4899874", "0.489512", "0.48892006", "0.48822597", "0.48822597", "0.48822597", "0.4876307", "0.4870024", "0.48674658", "0.48596674", "0.485653", "0.48506165", "0.48502037", "0.48450622", "0.48443043", "0.48411033", "0.48397046", "0.48367795", "0.48345104", "0.4819253", "0.48175424", "0.4812178", "0.48069662", "0.48067826" ]
0.0
-1
Generate a Value Map for the Stream
public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp) { if (null == valParams || null == csqs) return null; org.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState (fundingLabel()); if (null == dcFunding) return null; long lStart = System.nanoTime(); int iValueDate = valParams.valueDate(); double dblAccrued01 = 0.; double dblTotalCoupon = 0.; double dblCumulativeCouponDCF = 0.; double dblCumulativeCouponAmount = 0.; double dblAccrualCoupon = java.lang.Double.NaN; double dblUnadjustedDirtyPV = 0.; double dblUnadjustedDirtyDV01 = 0.; double dblCompoundingAdjustedDirtyPV = 0.; double dblCompoundingAdjustedDirtyDV01 = 0.; double dblCashPayDF = java.lang.Double.NaN; int iResetDate = java.lang.Integer.MIN_VALUE; double dblFXAdjustedValueNotional = java.lang.Double.NaN; double dblCreditForwardConvexityAdjustedDirtyPV = 0.; double dblCreditForwardConvexityAdjustedDirtyDV01 = 0.; double dblCreditFundingConvexityAdjustedDirtyPV = 0.; double dblCreditFundingConvexityAdjustedDirtyDV01 = 0.; double dblCreditFXConvexityAdjustedDirtyPV = 0.; double dblCreditFXConvexityAdjustedDirtyDV01 = 0.; double dblCumulativeConvexityAdjustedDirtyPV = 0.; double dblCumulativeConvexityAdjustedDirtyDV01 = 0.; double dblForwardFundingConvexityAdjustedDirtyPV = 0.; double dblForwardFundingConvexityAdjustedDirtyDV01 = 0.; double dblForwardFXConvexityAdjustedDirtyPV = 0.; double dblForwardFXConvexityAdjustedDirtyDV01 = 0.; double dblFundingFXConvexityAdjustedDirtyPV = 0.; double dblFundingFXConvexityAdjustedDirtyDV01 = 0.; for (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) { double dblPeriodFX = java.lang.Double.NaN; double dblPeriodNotional = java.lang.Double.NaN; double dblUnadjustedDirtyPeriodDV01 = java.lang.Double.NaN; int iPeriodPayDate = period.payDate(); int iPeriodEndDate = period.endDate(); try { dblPeriodNotional = period.notional (iPeriodEndDate) * period.couponFactor (iPeriodEndDate); dblPeriodFX = period.fx (csqs); } catch (java.lang.Exception e) { e.printStackTrace(); return null; } if (iPeriodPayDate < iValueDate) { org.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iPeriodEndDate, csqs); if (null == cpcm) return null; double dblPeriodDCF = cpcm.dcf(); dblCumulativeCouponDCF += dblPeriodDCF; dblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * cpcm.rate() * dblPeriodDCF; continue; } org.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate, csqs); if (null == cpcm) return null; double dblPeriodDCF = cpcm.dcf(); double dblPeriodFullRate = cpcm.rate(); org.drip.analytics.output.CompositePeriodAccrualMetrics cpam = period.accrualMetrics (iValueDate, csqs); try { if (null != cpam) { dblAccrualCoupon = cpam.rate(); iResetDate = cpam.resetDate(); double dblPeriodAccrualDCF = cpam.dcf(); dblCumulativeCouponDCF += dblPeriodAccrualDCF; dblAccrued01 = 0.0001 * dblPeriodAccrualDCF * dblPeriodNotional * dblPeriodFX; dblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * dblAccrualCoupon * dblPeriodAccrualDCF; } dblUnadjustedDirtyPeriodDV01 = 0.0001 * dblPeriodDCF * dblPeriodNotional * dblPeriodFX * period.survival (csqs) * period.df (csqs); } catch (java.lang.Exception e) { e.printStackTrace(); return null; } double dblCompoundingAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.compounding(); double dblCreditForwardConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.creditForward(); double dblCreditFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.creditFunding(); double dblCreditFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.creditFX(); double dblCumulativeConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.cumulative(); double dblForwardFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.forwardFunding(); double dblForwardFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.forwardFX(); double dblFundingFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.fundingFX(); dblTotalCoupon += dblPeriodFullRate; dblUnadjustedDirtyDV01 += dblUnadjustedDirtyPeriodDV01; dblUnadjustedDirtyPV += dblUnadjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblCompoundingAdjustedDirtyDV01 += dblCompoundingAdjustedDirtyPeriodDV01; dblCompoundingAdjustedDirtyPV += dblCompoundingAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblCreditForwardConvexityAdjustedDirtyDV01 += dblCreditForwardConvexityAdjustedDirtyPeriodDV01; dblCreditForwardConvexityAdjustedDirtyPV += dblCreditForwardConvexityAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblCreditFundingConvexityAdjustedDirtyDV01 += dblCreditFundingConvexityAdjustedDirtyPeriodDV01; dblCreditFundingConvexityAdjustedDirtyPV += dblCreditFundingConvexityAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblCreditFXConvexityAdjustedDirtyDV01 += dblCreditFXConvexityAdjustedDirtyPeriodDV01; dblCreditFXConvexityAdjustedDirtyPV += dblCreditFXConvexityAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblCumulativeConvexityAdjustedDirtyDV01 += dblCumulativeConvexityAdjustedDirtyPeriodDV01; dblCumulativeConvexityAdjustedDirtyPV += dblCumulativeConvexityAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblForwardFundingConvexityAdjustedDirtyDV01 += dblForwardFundingConvexityAdjustedDirtyPeriodDV01; dblForwardFundingConvexityAdjustedDirtyPV += dblForwardFundingConvexityAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblForwardFXConvexityAdjustedDirtyDV01 += dblForwardFXConvexityAdjustedDirtyPeriodDV01; dblForwardFXConvexityAdjustedDirtyPV += dblForwardFXConvexityAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; dblFundingFXConvexityAdjustedDirtyDV01 += dblFundingFXConvexityAdjustedDirtyPeriodDV01; dblFundingFXConvexityAdjustedDirtyPV += dblFundingFXConvexityAdjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate; } try { dblCashPayDF = dcFunding.df (iValueDate); dblFXAdjustedValueNotional = fxAdjustedNotional (iValueDate, csqs); } catch (java.lang.Exception e) { e.printStackTrace(); return null; } dblUnadjustedDirtyPV /= dblCashPayDF; dblUnadjustedDirtyDV01 /= dblCashPayDF; dblCompoundingAdjustedDirtyPV /= dblCashPayDF; dblCompoundingAdjustedDirtyDV01 /= dblCashPayDF; dblCreditForwardConvexityAdjustedDirtyPV /= dblCashPayDF; dblCreditForwardConvexityAdjustedDirtyDV01 /= dblCashPayDF; dblCreditFundingConvexityAdjustedDirtyPV /= dblCashPayDF; dblCreditFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF; dblCreditFXConvexityAdjustedDirtyPV /= dblCashPayDF; dblCreditFXConvexityAdjustedDirtyDV01 /= dblCashPayDF; dblCumulativeConvexityAdjustedDirtyPV /= dblCashPayDF; dblCumulativeConvexityAdjustedDirtyDV01 /= dblCashPayDF; dblForwardFundingConvexityAdjustedDirtyPV /= dblCashPayDF; dblForwardFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF; dblForwardFXConvexityAdjustedDirtyPV /= dblCashPayDF; dblForwardFXConvexityAdjustedDirtyDV01 /= dblCashPayDF; dblFundingFXConvexityAdjustedDirtyPV /= dblCashPayDF; dblFundingFXConvexityAdjustedDirtyDV01 /= dblCashPayDF; double dblAccrued = 0. == dblAccrued01 ? 0. : dblAccrued01 * 10000. * dblAccrualCoupon; double dblUnadjustedCleanPV = dblUnadjustedDirtyPV - dblAccrued; double dblUnadjustedCleanDV01 = dblUnadjustedDirtyDV01 - dblAccrued01; double dblUnadjustedFairPremium = 0.0001 * dblUnadjustedCleanPV / dblUnadjustedCleanDV01; double dblCompoundingAdjustedCleanPV = dblCompoundingAdjustedDirtyPV - dblAccrued; double dblCompoundingAdjustedCleanDV01 = dblCompoundingAdjustedDirtyDV01 - dblAccrued01; double dblCompoundingAdjustedFairPremium = 0.0001 * dblCompoundingAdjustedCleanPV / dblCompoundingAdjustedCleanDV01; double dblCreditForwardConvexityAdjustedCleanPV = dblCreditForwardConvexityAdjustedDirtyPV - dblAccrued; double dblCreditForwardConvexityAdjustedCleanDV01 = dblCreditForwardConvexityAdjustedDirtyDV01 - dblAccrued01; double dblCreditForwardConvexityAdjustedFairPremium = 0.0001 * dblCreditForwardConvexityAdjustedCleanPV / dblCreditForwardConvexityAdjustedCleanDV01; double dblCreditFundingConvexityAdjustedCleanPV = dblCreditFundingConvexityAdjustedDirtyPV - dblAccrued; double dblCreditFundingConvexityAdjustedCleanDV01 = dblCreditFundingConvexityAdjustedDirtyDV01 - dblAccrued01; double dblCreditFundingConvexityAdjustedFairPremium = 0.0001 * dblCreditFundingConvexityAdjustedCleanPV / dblCreditFundingConvexityAdjustedCleanDV01; double dblCreditFXConvexityAdjustedCleanPV = dblCreditFXConvexityAdjustedDirtyPV - dblAccrued; double dblCreditFXConvexityAdjustedCleanDV01 = dblCreditFXConvexityAdjustedDirtyDV01 - dblAccrued01; double dblCreditFXConvexityAdjustedFairPremium = 0.0001 * dblCreditFXConvexityAdjustedCleanPV / dblCreditFXConvexityAdjustedCleanDV01; double dblCumulativeConvexityAdjustedCleanPV = dblCumulativeConvexityAdjustedDirtyPV - dblAccrued; double dblCumulativeConvexityAdjustedCleanDV01 = dblCumulativeConvexityAdjustedDirtyDV01 - dblAccrued01; double dblCumulativeConvexityAdjustedFairPremium = 0.0001 * dblCumulativeConvexityAdjustedCleanPV / dblCumulativeConvexityAdjustedCleanDV01; double dblForwardFundingConvexityAdjustedCleanPV = dblForwardFundingConvexityAdjustedDirtyPV - dblAccrued; double dblForwardFundingConvexityAdjustedCleanDV01 = dblForwardFundingConvexityAdjustedDirtyDV01 - dblAccrued01; double dblForwardFundingConvexityAdjustedFairPremium = 0.0001 * dblForwardFundingConvexityAdjustedCleanPV / dblForwardFundingConvexityAdjustedCleanDV01; double dblForwardFXConvexityAdjustedCleanPV = dblForwardFXConvexityAdjustedDirtyPV - dblAccrued; double dblForwardFXConvexityAdjustedCleanDV01 = dblForwardFXConvexityAdjustedDirtyDV01 - dblAccrued01; double dblForwardFXConvexityAdjustedFairPremium = 0.0001 * dblForwardFXConvexityAdjustedCleanPV / dblForwardFXConvexityAdjustedCleanDV01; double dblFundingFXConvexityAdjustedCleanPV = dblFundingFXConvexityAdjustedDirtyPV - dblAccrued; double dblFundingFXConvexityAdjustedCleanDV01 = dblFundingFXConvexityAdjustedDirtyDV01 - dblAccrued01; double dblFundingFXConvexityAdjustedFairPremium = 0.0001 * dblFundingFXConvexityAdjustedCleanPV / dblFundingFXConvexityAdjustedCleanDV01; org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapResult = new org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>(); mapResult.put ("AccrualCoupon", dblAccrualCoupon); mapResult.put ("Accrued", dblAccrued); mapResult.put ("Accrued01", dblAccrued01); mapResult.put ("CleanDV01", dblCumulativeConvexityAdjustedCleanDV01); mapResult.put ("CleanPV", dblCumulativeConvexityAdjustedCleanPV); mapResult.put ("CompoundingAdjustedCleanDV01", dblCompoundingAdjustedCleanDV01); mapResult.put ("CompoundingAdjustedCleanPV", dblCompoundingAdjustedCleanPV); mapResult.put ("CompoundingAdjustedDirtyPV", dblCompoundingAdjustedDirtyPV); mapResult.put ("CompoundingAdjustedDirtyDV01", dblCompoundingAdjustedDirtyDV01); mapResult.put ("CompoundingAdjustedDirtyPV", dblCompoundingAdjustedDirtyPV); mapResult.put ("CompoundingAdjustedFairPremium", dblCompoundingAdjustedFairPremium); mapResult.put ("CompoundingAdjustedParRate", dblCompoundingAdjustedFairPremium); mapResult.put ("CompoundingAdjustedPV", dblCompoundingAdjustedCleanPV); mapResult.put ("CompoundingAdjustedRate", dblCompoundingAdjustedFairPremium); mapResult.put ("CompoundingAdjustedUpfront", dblCompoundingAdjustedCleanPV); mapResult.put ("CompoundingAdjustmentFactor", dblCompoundingAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("CompoundingAdjustmentPremium", dblCompoundingAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("CompoundingAdjustmentPremiumUpfront", (dblCompoundingAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("CreditForwardConvexityAdjustedCleanDV01", dblCreditForwardConvexityAdjustedCleanDV01); mapResult.put ("CreditForwardConvexityAdjustedCleanPV", dblCreditForwardConvexityAdjustedCleanPV); mapResult.put ("CreditForwardConvexityAdjustedDirtyDV01", dblCreditForwardConvexityAdjustedDirtyDV01); mapResult.put ("CreditForwardConvexityAdjustedDirtyPV", dblCreditForwardConvexityAdjustedDirtyPV); mapResult.put ("CreditForwardConvexityAdjustedDV01", dblCreditForwardConvexityAdjustedDirtyDV01); mapResult.put ("CreditForwardConvexityAdjustedFairPremium", dblCreditForwardConvexityAdjustedFairPremium); mapResult.put ("CreditForwardConvexityAdjustedParRate", dblCreditForwardConvexityAdjustedFairPremium); mapResult.put ("CreditForwardConvexityAdjustedPV", dblCreditForwardConvexityAdjustedCleanPV); mapResult.put ("CreditForwardConvexityAdjustedRate", dblCreditForwardConvexityAdjustedFairPremium); mapResult.put ("CreditForwardConvexityAdjustedUpfront", dblCreditForwardConvexityAdjustedCleanPV); mapResult.put ("CreditForwardConvexityAdjustmentFactor", dblCreditForwardConvexityAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("CreditForwardConvexityAdjustmentPremium", dblCreditForwardConvexityAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("CreditForwardConvexityAdjustmentPremiumUpfront", (dblCreditForwardConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("CreditFundingConvexityAdjustedCleanDV01", dblCreditFundingConvexityAdjustedCleanDV01); mapResult.put ("CreditFundingConvexityAdjustedCleanPV", dblCreditFundingConvexityAdjustedCleanPV); mapResult.put ("CreditFundingConvexityAdjustedDirtyDV01", dblCreditFundingConvexityAdjustedDirtyDV01); mapResult.put ("CreditFundingConvexityAdjustedDirtyPV", dblCreditFundingConvexityAdjustedDirtyPV); mapResult.put ("CreditFundingConvexityAdjustedDV01", dblCreditFundingConvexityAdjustedDirtyDV01); mapResult.put ("CreditFundingConvexityAdjustedFairPremium", dblCreditFundingConvexityAdjustedFairPremium); mapResult.put ("CreditFundingConvexityAdjustedParRate", dblCreditFundingConvexityAdjustedFairPremium); mapResult.put ("CreditFundingConvexityAdjustedPV", dblCreditFundingConvexityAdjustedCleanPV); mapResult.put ("CreditFundingConvexityAdjustedRate", dblCreditFundingConvexityAdjustedFairPremium); mapResult.put ("CreditFundingConvexityAdjustedUpfront", dblCreditFundingConvexityAdjustedCleanPV); mapResult.put ("CreditFundingConvexityAdjustmentFactor", dblCreditFundingConvexityAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("CreditFundingConvexityAdjustmentPremium", dblCreditFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("CreditFundingConvexityAdjustmentPremiumUpfront", (dblCreditFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("CreditFXConvexityAdjustedCleanDV01", dblCreditFXConvexityAdjustedCleanDV01); mapResult.put ("CreditFXConvexityAdjustedCleanPV", dblCreditFXConvexityAdjustedCleanPV); mapResult.put ("CreditFXConvexityAdjustedDirtyDV01", dblCreditFXConvexityAdjustedDirtyDV01); mapResult.put ("CreditFXConvexityAdjustedDirtyPV", dblCreditFXConvexityAdjustedDirtyPV); mapResult.put ("CreditFXConvexityAdjustedDV01", dblCreditFXConvexityAdjustedDirtyDV01); mapResult.put ("CreditFXConvexityAdjustedFairPremium", dblCreditFXConvexityAdjustedFairPremium); mapResult.put ("CreditFXConvexityAdjustedParRate", dblCreditFXConvexityAdjustedFairPremium); mapResult.put ("CreditFXConvexityAdjustedPV", dblCreditFXConvexityAdjustedCleanPV); mapResult.put ("CreditFXConvexityAdjustedRate", dblCreditFXConvexityAdjustedFairPremium); mapResult.put ("CreditFXConvexityAdjustedUpfront", dblCreditFXConvexityAdjustedCleanPV); mapResult.put ("CreditFXConvexityAdjustmentFactor", dblCreditFXConvexityAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("CreditFXConvexityAdjustmentPremium", dblCreditFXConvexityAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("CreditFXConvexityAdjustmentPremiumUpfront", (dblCreditFXConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("CumulativeConvexityAdjustedCleanDV01", dblCumulativeConvexityAdjustedCleanDV01); mapResult.put ("CumulativeConvexityAdjustedCleanPV", dblCumulativeConvexityAdjustedCleanPV); mapResult.put ("CumulativeConvexityAdjustedDirtyDV01", dblCumulativeConvexityAdjustedDirtyDV01); mapResult.put ("CumulativeConvexityAdjustedDirtyPV", dblCumulativeConvexityAdjustedDirtyPV); mapResult.put ("CumulativeConvexityAdjustedDV01", dblCumulativeConvexityAdjustedDirtyDV01); mapResult.put ("CumulativeConvexityAdjustedFairPremium", dblCumulativeConvexityAdjustedFairPremium); mapResult.put ("CumulativeConvexityAdjustedParRate", dblCumulativeConvexityAdjustedFairPremium); mapResult.put ("CumulativeConvexityAdjustedPV", dblCumulativeConvexityAdjustedCleanPV); mapResult.put ("CumulativeConvexityAdjustedRate", dblCumulativeConvexityAdjustedFairPremium); mapResult.put ("CumulativeConvexityAdjustedUpfront", dblCumulativeConvexityAdjustedCleanPV); mapResult.put ("CumulativeConvexityAdjustmentFactor", dblCumulativeConvexityAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("CumulativeConvexityAdjustmentPremium", dblCumulativeConvexityAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("CumulativeConvexityAdjustmentPremiumUpfront", (dblCumulativeConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("CumulativeCouponAmount", dblCumulativeCouponAmount); mapResult.put ("CumulativeCouponDCF", dblCumulativeCouponDCF); mapResult.put ("CV01", dblCumulativeConvexityAdjustedCleanDV01); mapResult.put ("DirtyDV01", dblCumulativeConvexityAdjustedDirtyDV01); mapResult.put ("DirtyPV", dblCumulativeConvexityAdjustedDirtyPV); mapResult.put ("DV01", dblCumulativeConvexityAdjustedCleanDV01); mapResult.put ("FairPremium", dblCumulativeConvexityAdjustedFairPremium); mapResult.put ("Fixing01", dblAccrued01); mapResult.put ("ForwardFundingConvexityAdjustedCleanDV01", dblForwardFundingConvexityAdjustedCleanDV01); mapResult.put ("ForwardFundingConvexityAdjustedCleanPV", dblForwardFundingConvexityAdjustedCleanPV); mapResult.put ("ForwardFundingConvexityAdjustedDirtyDV01", dblForwardFundingConvexityAdjustedDirtyDV01); mapResult.put ("ForwardFundingConvexityAdjustedDirtyPV", dblForwardFundingConvexityAdjustedDirtyPV); mapResult.put ("ForwardFundingConvexityAdjustedDV01", dblForwardFundingConvexityAdjustedDirtyDV01); mapResult.put ("ForwardFundingConvexityAdjustedFairPremium", dblForwardFundingConvexityAdjustedFairPremium); mapResult.put ("ForwardFundingConvexityAdjustedParRate", dblForwardFundingConvexityAdjustedFairPremium); mapResult.put ("ForwardFundingConvexityAdjustedPV", dblForwardFundingConvexityAdjustedCleanPV); mapResult.put ("ForwardFundingConvexityAdjustedRate", dblForwardFundingConvexityAdjustedFairPremium); mapResult.put ("ForwardFundingConvexityAdjustedUpfront", dblForwardFundingConvexityAdjustedCleanPV); mapResult.put ("ForwardFundingConvexityAdjustmentFactor", dblForwardFundingConvexityAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("ForwardFundingConvexityAdjustmentPremium", dblForwardFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("ForwardFundingConvexityAdjustmentPremiumUpfront", (dblForwardFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("ForwardFXConvexityAdjustedCleanDV01", dblForwardFXConvexityAdjustedCleanDV01); mapResult.put ("ForwardFXConvexityAdjustedCleanPV", dblForwardFXConvexityAdjustedCleanPV); mapResult.put ("ForwardFXConvexityAdjustedDirtyDV01", dblForwardFXConvexityAdjustedDirtyDV01); mapResult.put ("ForwardFXConvexityAdjustedDirtyPV", dblForwardFXConvexityAdjustedDirtyPV); mapResult.put ("ForwardFXConvexityAdjustedDV01", dblForwardFXConvexityAdjustedDirtyDV01); mapResult.put ("ForwardFXConvexityAdjustedFairPremium", dblForwardFXConvexityAdjustedFairPremium); mapResult.put ("ForwardFXConvexityAdjustedParRate", dblForwardFXConvexityAdjustedFairPremium); mapResult.put ("ForwardFXConvexityAdjustedPV", dblForwardFXConvexityAdjustedCleanPV); mapResult.put ("ForwardFXConvexityAdjustedRate", dblForwardFXConvexityAdjustedFairPremium); mapResult.put ("ForwardFXConvexityAdjustedUpfront", dblForwardFXConvexityAdjustedCleanPV); mapResult.put ("ForwardFXConvexityAdjustmentFactor", dblForwardFXConvexityAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("ForwardFXConvexityAdjustmentPremium", dblForwardFXConvexityAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("ForwardFXConvexityAdjustmentPremiumUpfront", (dblForwardFXConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("FundingFXConvexityAdjustedCleanDV01", dblFundingFXConvexityAdjustedCleanDV01); mapResult.put ("FundingFXConvexityAdjustedCleanPV", dblFundingFXConvexityAdjustedCleanPV); mapResult.put ("FundingFXConvexityAdjustedDirtyDV01", dblFundingFXConvexityAdjustedDirtyDV01); mapResult.put ("FundingFXConvexityAdjustedDirtyPV", dblFundingFXConvexityAdjustedDirtyPV); mapResult.put ("FundingFXConvexityAdjustedDV01", dblFundingFXConvexityAdjustedDirtyDV01); mapResult.put ("FundingFXConvexityAdjustedFairPremium", dblFundingFXConvexityAdjustedFairPremium); mapResult.put ("FundingFXConvexityAdjustedParRate", dblFundingFXConvexityAdjustedFairPremium); mapResult.put ("FundingFXConvexityAdjustedPV", dblFundingFXConvexityAdjustedCleanPV); mapResult.put ("FundingFXConvexityAdjustedRate", dblFundingFXConvexityAdjustedFairPremium); mapResult.put ("FundingFXConvexityAdjustedUpfront", dblFundingFXConvexityAdjustedCleanPV); mapResult.put ("FundingFXConvexityAdjustmentFactor", dblFundingFXConvexityAdjustedDirtyDV01 / dblUnadjustedDirtyDV01); mapResult.put ("FundingFXConvexityAdjustmentPremium", dblFundingFXConvexityAdjustedCleanPV - dblUnadjustedCleanPV); mapResult.put ("FundingFXConvexityAdjustmentPremiumUpfront", (dblFundingFXConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional); mapResult.put ("ParRate", dblCumulativeConvexityAdjustedFairPremium); mapResult.put ("PV", dblCumulativeConvexityAdjustedCleanPV); mapResult.put ("Rate", dblCumulativeConvexityAdjustedFairPremium); mapResult.put ("ResetDate", (double) iResetDate); mapResult.put ("ResetRate", dblAccrualCoupon - basis()); mapResult.put ("TotalCoupon", dblTotalCoupon); mapResult.put ("UnadjustedCleanDV01", dblUnadjustedCleanDV01); mapResult.put ("UnadjustedCleanPV", dblUnadjustedCleanPV); mapResult.put ("UnadjustedDirtyDV01", dblUnadjustedDirtyDV01); mapResult.put ("UnadjustedDirtyPV", dblUnadjustedDirtyPV); mapResult.put ("UnadjustedFairPremium", dblUnadjustedFairPremium); mapResult.put ("UnadjustedParRate", dblUnadjustedFairPremium); mapResult.put ("UnadjustedPV", dblUnadjustedCleanPV); mapResult.put ("UnadjustedRate", dblUnadjustedFairPremium); mapResult.put ("UnadjustedUpfront", dblUnadjustedCleanPV); mapResult.put ("Upfront", dblCumulativeConvexityAdjustedCleanPV); double dblCompoundingAdjustedCleanPrice = 100. * (1. + (dblCompoundingAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblCreditForwardConvexityAdjustedCleanPrice = 100. * (1. + (dblCreditForwardConvexityAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblCreditFundingConvexityAdjustedCleanPrice = 100. * (1. + (dblCreditFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblCreditFXConvexityAdjustedCleanPrice = 100. * (1. + (dblCreditFXConvexityAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblCumulativeConvexityAdjustedCleanPrice = 100. * (1. + (dblCumulativeConvexityAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblForwardFundingConvexityAdjustedCleanPrice = 100. * (1. + (dblForwardFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblForwardFXConvexityAdjustedCleanPrice = 100. * (1. + (dblForwardFXConvexityAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblFundingFXConvexityAdjustedCleanPrice = 100. * (1. + (dblFundingFXConvexityAdjustedCleanPV / dblFXAdjustedValueNotional)); double dblUnadjustedCleanPrice = 100. * (1. + (dblUnadjustedCleanPV / dblFXAdjustedValueNotional)); mapResult.put ("CleanPrice", dblCumulativeConvexityAdjustedCleanPrice); mapResult.put ("CompoundingAdjustedCleanPrice", dblCompoundingAdjustedCleanPrice); mapResult.put ("CompoundingAdjustedDirtyPrice", 100. * (1. + (dblCompoundingAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("CompoundingAdjustedPrice", dblCompoundingAdjustedCleanPrice); mapResult.put ("CreditForwardConvexityAdjustedCleanPrice", dblCreditForwardConvexityAdjustedCleanPrice); mapResult.put ("CreditForwardConvexityAdjustedDirtyPrice", 100. * (1. + (dblCreditForwardConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("CreditForwardConvexityAdjustedPrice", dblCreditForwardConvexityAdjustedCleanPrice); mapResult.put ("CreditFundingConvexityAdjustedCleanPrice", dblCreditFundingConvexityAdjustedCleanPrice); mapResult.put ("CreditFundingConvexityAdjustedDirtyPrice", 100. * (1. + (dblCreditFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("CreditFundingConvexityAdjustedPrice", dblCreditFundingConvexityAdjustedCleanPrice); mapResult.put ("CreditFXConvexityAdjustedCleanPrice", dblCreditFXConvexityAdjustedCleanPrice); mapResult.put ("CreditFXConvexityAdjustedDirtyPrice", 100. * (1. + (dblCreditFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("CreditFXConvexityAdjustedPrice", dblCreditFXConvexityAdjustedCleanPrice); mapResult.put ("CumulativeConvexityAdjustedCleanPrice", dblCumulativeConvexityAdjustedCleanPrice); mapResult.put ("CumulativeConvexityAdjustedDirtyPrice", 100. * (1. + (dblCumulativeConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("CumulativeConvexityAdjustedPrice", dblCumulativeConvexityAdjustedCleanPrice); mapResult.put ("DirtyPrice", 100. * (1. + (dblCumulativeConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("ForwardFundingConvexityAdjustedCleanPrice", dblForwardFundingConvexityAdjustedCleanPrice); mapResult.put ("ForwardFundingConvexityAdjustedDirtyPrice", 100. * (1. + (dblForwardFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("ForwardFundingConvexityAdjustedPrice", dblForwardFundingConvexityAdjustedCleanPrice); mapResult.put ("ForwardFXConvexityAdjustedCleanPrice", dblForwardFXConvexityAdjustedCleanPrice); mapResult.put ("ForwardFXConvexityAdjustedDirtyPrice", 100. * (1. + (dblForwardFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("ForwardFXConvexityAdjustedPrice", dblForwardFXConvexityAdjustedCleanPrice); mapResult.put ("FundingFXConvexityAdjustedCleanPrice", dblFundingFXConvexityAdjustedCleanPrice); mapResult.put ("FundingFXConvexityAdjustedDirtyPrice", 100. * (1. + (dblFundingFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("FundingFXConvexityAdjustedPrice", dblFundingFXConvexityAdjustedCleanPrice); mapResult.put ("Price", dblCumulativeConvexityAdjustedCleanPrice); mapResult.put ("UnadjustedCleanPrice", dblUnadjustedCleanPrice); mapResult.put ("UnadjustedDirtyPrice", 100. * (1. + (dblUnadjustedDirtyPV / dblFXAdjustedValueNotional))); mapResult.put ("UnadjustedPrice", dblUnadjustedCleanPrice); mapResult.put ("CalcTime", (System.nanoTime() - lStart) * 1.e-09); return mapResult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n void convertStreamBean2MapMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream();\r\n\t\t// Convert stream -> Map<Object, Object> -> Map<String, TransactionBean>\r\n\t\tMap<String, TransactionBean> afterStreamMap = (Map<String, TransactionBean>)transactionBeanStream.peek(System.out::println).collect(Collectors.toMap(p -> p.getValue(), p -> p));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamMap.get(\"r1\").getType());\r\n\t\tassertSame(\"wrong type\", Transaction.Test, afterStreamMap.get(\"r2\").getType());\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamMap.get(\"r3\").getType());\r\n }", "private Map<String, Object> createDefaultMap() {\n Map<String, Object> result = new LinkedHashMap<>();\n result.put(\"stream_speed0\", 1);\n result.put(\"stream_start0\", 0);\n result.put(\"stream_end0\", 7);\n result.put(\"stream_speed1\", -2);\n result.put(\"stream_start1\", 15);\n result.put(\"stream_end1\", 19);\n\n result.put(\"fish_quantity\", numFishes);\n result.put(\"fish_reproduction\", 3);\n result.put(\"fish_live\", 10);\n result.put(\"fish_speed\", 2);\n result.put(\"fish_radius\", 4);\n\n result.put(\"shark_quantity\", numSharks);\n result.put(\"shark_live\", 20);\n result.put(\"shark_hungry\", 7);\n result.put(\"shark_speed\", 2);\n result.put(\"shark_radius\", 5);\n\n return result;\n }", "public MapData(Generator<Pair<K, V>> generator, int quantity) {\n for (int i = 0; i < quantity; i++) {\n Pair<K, V> pair = generator.next();\n put(pair.key, pair.value);\n }\n }", "public Map<T, V> populateMap() {\n Map<T, V> map = new HashMap<>();\n for (int i = 0; i < entryNumber; i++) {\n cacheKeys[i] = (T) Integer.toString(random.nextInt(1000000000));\n String key = cacheKeys[i].toString();\n map.put((T) key, (V) Integer.toString(random.nextInt(1000000000)));\n }\n return map;\n }", "private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}", "private IMapData<Integer, String> getHashMapData2() {\n List<IKeyValueNode<Integer, String>> creationData = ArrayLists.make(\n KeyValueNode.make(1, \"a\"),\n KeyValueNode.make(1, \"a\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(2, \"c\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(3, \"a\"),\n KeyValueNode.make(3, \"b\"),\n KeyValueNode.make(3, \"c\"));\n\n List<IKeyValueNode<Integer, String>> data = ArrayLists.make(\n KeyValueNode.make(1, \"a\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(3, \"c\"));\n\n List<Integer> keys = this.createKeys(data);\n List<String> values = this.createValues(data);\n\n return new MapData<>(\n creationData,\n data,\n keys,\n values);\n }", "private static Map<String, PropertyInfo> createPropertyMap()\r\n {\r\n Map<String, PropertyInfo> map = New.map();\r\n PropertyInfo samplingTime = new PropertyInfo(\"http://www.opengis.net/def/property/OGC/0/SamplingTime\", Date.class,\r\n TimeKey.DEFAULT);\r\n PropertyInfo lat = new PropertyInfo(\"http://sensorml.com/ont/swe/property/Latitude\", Float.class, LatitudeKey.DEFAULT);\r\n PropertyInfo lon = new PropertyInfo(\"http://sensorml.com/ont/swe/property/Longitude\", Float.class, LongitudeKey.DEFAULT);\r\n PropertyInfo alt = new PropertyInfo(\"http://sensorml.com/ont/swe/property/Altitude\", Float.class, AltitudeKey.DEFAULT);\r\n map.put(samplingTime.getProperty(), samplingTime);\r\n map.put(lat.getProperty(), lat);\r\n map.put(lon.getProperty(), lon);\r\n map.put(alt.getProperty(), alt);\r\n map.put(\"lat\", lat);\r\n map.put(\"lon\", lon);\r\n map.put(\"alt\", alt);\r\n return Collections.unmodifiableMap(map);\r\n }", "public MapData(Generator<K> generator, V value, int quantity) {\n for (int i = 0; i < quantity; i++) {\n put(generator.next(), value);\n }\n }", "private static Map<String,List<Integer>> getProvisionIdMapStream(Map<String,List<Integer>> nameMapIdMap,Map<String,Integer> mapIdProbIdMap){\n return null;\n }", "public HashMap<String, NeonValue> getMap();", "KStream<K, V> toStream();", "public static Map<String, String> convertTomap(Stream<String> stream, String delimiter) {\n logger.info(\"converting stream of strings to Map using delimiter : \" + delimiter);\n return stream.filter(current_line -> current_line.length() > 0)\n .map(cl -> cl.split(delimiter))\n .filter(cl -> cl.length > 1)\n .collect(Collectors.toMap(cl -> cl[0].trim(), cl -> cl[1].trim(), (val1, val2) -> val2.trim()));\n }", "ProcessOperation<Map<String, Object>> map();", "@Override\n public Map makeMap() {\n Map<Integer,String> testMap = new HashingMap<>();\n return testMap;\n }", "Object visitMapOfValues(MapOfValuesNode node, Object state);", "public abstract Map<String, Serializable> toMap();", "public Map<String, Integer> getDataMap() {\n\t\tMap<String, Integer> dataMap = new HashMap<>();\n\t\tdataMap.putAll(temperature.getDataMap());\n\t\tdataMap.putAll(wind.getDataMap());\n\t\tdataMap.putAll(precipitation.getDataMap());\n\t\tdataMap.putAll(condition.getDataMap());\n\t\tdataMap.putAll(hazard.getDataMap());\n\t\tdataMap.putAll(wave.getDataMap());\n\t\t\n\t\treturn dataMap;\n\t}", "private IMapData<Integer, String> getLinkedHashMapData2() {\n List<IKeyValueNode<Integer, String>> creationData = ArrayLists.make(\n KeyValueNode.make(3, \"c\"),\n KeyValueNode.make(3, \"c\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(2, \"a\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(1, \"c\"),\n KeyValueNode.make(1, \"b\"),\n KeyValueNode.make(1, \"a\"));\n\n List<IKeyValueNode<Integer, String>> data = ArrayLists.make(\n KeyValueNode.make(3, \"c\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(1, \"a\"));\n\n List<Integer> keys = this.createKeys(data);\n List<String> values = this.createValues(data);\n\n return new MapData<>(\n creationData,\n data,\n keys,\n values);\n }", "private Map getAsMap(BuildStatus bs) {\n String lines[] = bs.toExternalForm().split(\"\\n\");\n Map m = new HashMap();\n for (int i = 0; i < lines.length; i++) {\n String line = lines[i];\n String parts[] = line.split(\"=\");\n String name = parts[0];\n String value = parts[1];\n m.put(name + \"=\", value);\n }\n return m;\n }", "public Map<Integer, Integer> generateMap(int size){\n Map<Integer, Integer> data = new HashMap<>();\n for (int i = 0; i < size; i++){\n data.put(i, i);\n }\n return data;\n }", "@Test\n public void testMap() throws Exception {\n Coder<WindowedValue<Long>> valueCoder =\n WindowedValue.getFullCoder(VarLongCoder.of(), GLOBAL_WINDOW_CODER);\n final ListMultimap<byte[], WindowedValue<Long>> elements =\n ImmutableListMultimap.<byte[], WindowedValue<Long>>builder()\n .put(new byte[] {0x00}, valueInGlobalWindow(12L))\n .put(new byte[] {0x01}, valueInGlobalWindow(22L))\n .put(new byte[] {0x02}, valueInGlobalWindow(32L))\n .put(new byte[] {0x03}, valueInGlobalWindow(42L))\n .put(new byte[] {0x04}, valueInGlobalWindow(52L))\n .put(new byte[] {0x05}, valueInGlobalWindow(62L))\n .build();\n\n final PCollectionView<Map<byte[], Long>> view =\n Pipeline.create()\n .apply(Create.empty(KvCoder.of(ByteArrayCoder.of(), VarLongCoder.of())))\n .apply(View.asMap());\n\n IsmRecordCoder<WindowedValue<Long>> ismCoder =\n IsmRecordCoder.of(\n 1,\n 2,\n ImmutableList.of(\n MetadataKeyCoder.of(ByteArrayCoder.of()),\n GLOBAL_WINDOW_CODER,\n BigEndianLongCoder.of()),\n valueCoder);\n\n Multimap<Integer, IsmRecord<WindowedValue<Long>>> elementsPerShard = forMap(ismCoder, elements);\n List<IsmRecord<WindowedValue<Long>>> firstElements = new ArrayList<>();\n List<IsmRecord<WindowedValue<Long>>> secondElements = new ArrayList<>();\n for (Map.Entry<Integer, Collection<IsmRecord<WindowedValue<Long>>>> entry :\n elementsPerShard.asMap().entrySet()) {\n if (entry.getKey() % 2 == 0) {\n firstElements.addAll(entry.getValue());\n } else {\n secondElements.addAll(entry.getValue());\n }\n }\n // Ensure that each file will have some records.\n checkState(!firstElements.isEmpty());\n checkState(!secondElements.isEmpty());\n\n Source sourceA = initInputFile(firstElements, ismCoder);\n Source sourceB = initInputFile(secondElements, ismCoder);\n\n List<IsmRecord<WindowedValue<Long>>> mapMetadata =\n forMapMetadata(ByteArrayCoder.of(), elements.keySet(), GlobalWindow.INSTANCE);\n Source sourceMeta = initInputFile(mapMetadata, ismCoder);\n\n final IsmSideInputReader reader =\n sideInputReader(view.getTagInternal().getId(), sourceA, sourceB, sourceMeta);\n\n List<Callable<Map<byte[], Long>>> tasks = new ArrayList<>();\n for (int i = 0; i < NUM_THREADS; ++i) {\n tasks.add(\n () -> {\n // Store a strong reference to the returned value so that the logical reference\n // cache is not cleared for this test.\n Map<byte[], Long> value = reader.get(view, GlobalWindow.INSTANCE);\n verifyMap(\n Maps.transformValues(elements.asMap(), new TransformForMap<Long>()),\n value,\n new ComparatorForMap<Long>());\n // Assert that the same value reference was returned showing that it was cached.\n assertSame(reader.get(view, GlobalWindow.INSTANCE), value);\n\n return value;\n });\n }\n\n List<Future<Map<byte[], Long>>> results = pipelineOptions.getExecutorService().invokeAll(tasks);\n Map<byte[], Long> value = results.get(0).get();\n // Assert that all threads got back the same reference\n for (Future<Map<byte[], Long>> result : results) {\n assertSame(value, result.get());\n }\n }", "public Map<K,V> getMap() {\n Map<K,V> results = new HashMap<K,V>(valueMap.size());\n\n synchronized(theLock) {\n for (Map.Entry<K,CacheableObject> entry : valueMap.entrySet()) {\n if (! isExpired(entry.getValue())) {\n results.put(entry.getKey(), entry.getValue().cachedObject);\n }\n }\n }\n\n return results;\n }", "private IMapData<Integer, String> getHashMapData1() {\n List<IKeyValueNode<Integer, String>> creationData = new ArrayList<>();\n List<IKeyValueNode<Integer, String>> data = new ArrayList<>();\n List<Integer> keys = this.createKeys(data);\n List<String> values = this.createValues(data);\n\n return new MapData<>(\n creationData,\n data,\n keys,\n values);\n }", "InfiniteMap<K,V> build();", "protected abstract Map<String, Serializable> getEventKeyAndIdMap();", "@Override\n public Map<String, OEEReport> build() {\n return generators.entrySet().stream().collect(Collectors.toMap(\n entry -> entry.getKey(),\n entry -> entry.getValue().getReport()\n ));\n }", "private Map<Village, Float> createVillageConsumptionMap(List<ConsumptionRecord> records) {\n Map<Village, Float> villagesConsumptionMap = new HashMap<>();\n\n records.forEach(\n consumptionRecord -> {\n var village = consumptionRecord.getCounter().getVillage();\n var currentConsumption = villagesConsumptionMap.getOrDefault(village, 0F);\n villagesConsumptionMap.put(village, currentConsumption + consumptionRecord.getAmount());\n }\n );\n\n return villagesConsumptionMap;\n }", "private void genLoadMapCode(String name, String keyClassSimpleName, String valueClassSimpleName, boolean valueIsPersistable) {\n\n int tabLevel = 1;\n String tabs = tabs(tabLevel);\n\n String keyCppType = cppType(keyClassSimpleName);\n String valueCppType = cppType(valueClassSimpleName);\n\n String mapType = \"std::map< \" + keyCppType + \", \" + valueCppType + \" >\";\n\n load.println(\"\\t// \" + mapType + \" this->\" + name);\n genDebug(load, \"\\tstd::cout << \\\"load \" + mapType + \" \" + name + \"\\\" << std::endl;\");\n\n String vVarName = \"v\" + \"_\" + name;\n String lenVarName = vVarName + \"_length\";\n\n // read the length of the map\n load.println(tabs + \"int \" + lenVarName + \";\");\n\n load.println();\n load.println(tabs + INSTREAM_VAR_NAME + \".readInt(\" + lenVarName + \");\");\n\n genDebugDumpValue(load, lenVarName, tabs);\n\n load.println(tabs + mapType + \"& \" + vVarName + \" = this->\" + name + \";\");\n\n // initialize & pre-allocate the map\n // load.println( tabs + vVarName + \".reserve( \" + lenVarName + \" );\");\n\n load.println();\n load.println(tabs + \"for( int i = 0; i < \" + lenVarName + \"; i++ ){\");\n\n tabs = tabs(++tabLevel);\n\n // load key\n String keyVarName = vVarName + \"_key\";\n load.println(tabs + keyCppType + \" \" + keyVarName + \";\");\n load.println(tabs + genReadCode(keyVarName, keyCppType));\n\n // load value\n String valueVarName = vVarName + \"_value\";\n load.println(tabs + valueCppType + \" \" + valueVarName + \";\");\n\n if (valueIsPersistable) {\n load.println(tabs + valueVarName + \".load( \" + INSTREAM_VAR_NAME + \" );\");\n } else {\n load.println(tabs + genReadCode(valueVarName, valueCppType));\n }\n\n // add the new pair to the map\n load.println(tabs + vVarName + \".insert( std::make_pair( \" + keyVarName + \", \" + valueVarName + \" ));\");\n\n tabs = tabs(--tabLevel);\n load.println(tabs + \"}\");\n }", "protected Map createPropertiesMap() {\n return new HashMap();\n }", "public Map<String, Counter> getMap(){\n\t\treturn map;\n\t}", "private VariableMap getParamMappingAsVariableMap() {\n paramValueEncodings.put(fileNameToIndex.keySet().toString(), \" FileNames\");\n paramValueEncodings.put(functionNameToIndex.keySet().toString(), \" FunctionNames\");\n paramValueEncodings.put(typeToIndex.keySet().toString(), \" Types\");\n\n VariableMap preInversedMap = new VariableMap(paramValueEncodings);\n ImmutableMap<String, String> inversedMap = preInversedMap.getNewNameToOriginalNameMap();\n return new VariableMap(inversedMap);\n }", "@Override\n public Map<String, String> get() {\n\n Map<String, String> hugoMap = Maps.newHashMap();\n try {\n final CSVParser parser = new CSVParser(this.reader, CSVFormat.TDF.withHeader());\n for (CSVRecord record : parser) {\n\n hugoMap.put(record.get(0), record.get(1));\n }\n\n } catch (IOException e) {\n log.error(e.getMessage());\n e.printStackTrace();\n }\n return hugoMap;\n }", "public static Map readingFilesMap(String file) {\n\n Stream<String> lines = null;\n try {\n lines = Files.lines(Paths.get(file));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /* lines = lines.filter(line -> line.trim().length() > 0)\n .map(line -> line.substring(line.lastIndexOf(\" \")));\n*/\n Map map = lines.collect(Collectors.toMap(\n line -> line.substring(line.lastIndexOf(\" \")),\n line -> line.substring(0, line.lastIndexOf(\" \"))\n ));//.forEach(System.out::print);\n //lines.forEach(Collections.list());\n\n map.forEach((k, v) -> {\n System.out.println(\"key:\"+k+ \" Value=\"+v);\n } );\n return map;\n\n //set.forEach(System.out::print);\n\n\n }", "java.util.Map<java.lang.Integer, java.lang.Integer>\n getInfoMap();", "@Override\n protected void map(Object key, Text value, Context context) throws IOException, InterruptedException {\n \n String[] inputArray = value.toString().split(\"::\");\n inputKey.set(Integer.parseInt(inputArray[1]));\n intValue.set(Integer.parseInt(inputArray[2]));\n SortedMapWritable inputValue = new SortedMapWritable();\n inputValue.put(intValue, count);\n context.write(inputKey, inputValue);\n }", "public static Map<String, Object> generateMap(InputStream inputStream) {\n logger.trace(\"Converting XML document [{}]\");\n Map<String, Object> map = asMap(inputStream);\n\n logger.trace(\"Generated JSON: {}\", map);\n return map;\n }", "private Map<String, Object> analysisMap(ArrayList<String> data) {\n Map<String, Object> map = new HashMap<>();\n map.put(DAILY, data);\n return map;\n }", "private void buildMap(VLongArrayListWritable currentVertexValue) {\n verticesMap.clear();\n \n // add vertex ID itself\n verticesMap.put(getVertexId().get(), 1l);\n \n // add IDs of its neighbors\n for (Edge<VLongWritable, IntWritable> edge : getEdges()) {\n verticesMap.put(edge.getDestVertexId().get(), 1l);\n }\n \n // add current results IDs from the vertex value\n if (currentVertexValue == null) {\n return;\n }\n for (int i = 0; i < currentVertexValue.size(); i++) {\n long vid = ((VLongWritable) currentVertexValue.get(i)).get();\n if (!verticesMap.containsKey(vid)) {\n verticesMap.put(vid, 1l);\n }\n }\n }", "Map<String, ?> getOutputData();", "Map getSPEXDataMap();", "java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>\n getEventMetadataMap();", "public void sinkCounterMap(){\n for(int i=1; i<(sinkCounter+1); i++){\n sinkCounterMap.put(i,1); //sink is included in basin count;\n \n }\n }", "public SetupData getMapWithValues() {\n\tSetupData updatedMap = SetupData.create(setupDefinition);\n\n\tfor (String key : panels.keySet()) {\n\t FieldPanel panel = panels.get(key);\n\t FieldValue value = panel.getOption();\n\t if (value == null) {\n\t\tSpecsLogs.getLogger().warning(\"value is null.\");\n\t\t// No valid value for the table\n\t\tcontinue;\n\t }\n\t updatedMap.put(key, value);\n\t}\n\n\treturn updatedMap;\n }", "public StandardValues() {\n super(ForwardingMap.this);\n }", "private void storeValues(int source,\n Map<VWBetw, Double> map,\n DiskBufferDriver output) throws DriverException {\n for (Entry<VWBetw, Double> e : map.entrySet()) {\n storeValue(source, e.getKey().getID(), e.getValue(), output);\n }\n }", "@Test\r\n\tvoid mapMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream();\r\n\t\tStream<Integer> streamInteger = transactionBeanStream.peek(System.out::println).map(TransactionBean::getId);\r\n\t\tList<Integer> afterStreamList = streamInteger.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong value\", 1, afterStreamList.get(0).intValue());\r\n\t\tassertSame(\"wrong value\", 2, afterStreamList.get(1).intValue());\r\n\t\tassertSame(\"wrong value\", 3, afterStreamList.get(2).intValue());\r\n\t}", "public static Map getStudentMap() {\r\n\t\tMap<Integer,Student> stds = new HashMap();\r\n\t\tList<Student> list= new ArrayList<>();\r\n\t\tStudent akash =new Student(\"Akash\",123);\r\n\t\tStudent kalpana =new Student(\"kalpana\",345);\r\n\t\tStudent sasha =new Student(\"sasha\",876);\r\n\t\tStudent prakash =new Student(\"prakasg\",567);\r\n\t\t\r\n\t\tlist.add(prakash);\r\n\t\tlist.add(akash);\r\n\t\tlist.add(sasha);\r\n\t\tlist.add(kalpana);\r\n\t\tIterator<Student> its =list.iterator();\r\n\t\twhile (its.hasNext()) {\r\n\t\t\tStudent st = its.next();// student object from the \"list\" is passed in to st. \r\n\t\t\tstds.put(st.getRoll(),st);// st.getRoll() sends the roll number and st sends the object of the student.\r\n\t\t}\r\n\t\t\r\n\t\treturn stds;\r\n\t}", "public Map<String, String> getValueData(){\n\t\treturn valueCache;\n\t}", "public static void addToMap()\n {\n Map<String, Integer> map = new HashMap<>();\n\n BiConsumer<String, Integer> mapAdderEveryTime = (s, i) -> map.put(s, i);\n\n mapAdderEveryTime.accept(\"key1\", 4);\n mapAdderEveryTime.accept(\"key2\", 4);\n\n BiConsumer<String, Integer> mapAdderIfPresent = (s, i) -> {\n map.computeIfPresent(s, (key, value) -> (value % 4 == 0) ? 0 : value +1);\n };\n\n mapAdderIfPresent.accept(\"key1\", 1);\n\n System.out.println(map);\n }", "private void mapToObjUsingStream() {\n IntStream.range(1, 4)\n .mapToObj(i -> \"a\" + i)\n .forEach(System.out::println);\n }", "private Map<UUID, String> getStreamIdToTableNameMap() {\n Map<UUID, String> streamIdToTableNameMap = new HashMap<>();\n runtime.getTableRegistry().listTables().forEach(tableName -> {\n String name = TableRegistry.getFullyQualifiedTableName(tableName);\n streamIdToTableNameMap.put(CorfuRuntime.getStreamID(name), name);\n });\n return streamIdToTableNameMap;\n }", "java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>\n getStatMetadataMap();", "@SuppressWarnings(\"unchecked\")\n private static <T> Map<String, T> mapOf(Object... inputs) {\n Map<String, T> map = new HashMap<>();\n for (int i = 0; i < inputs.length; i += 2) {\n String key = (String) inputs[i];\n T value = (T) inputs[i + 1];\n map.put(key, value);\n }\n return map;\n }", "@Override\n\tpublic Map<ByteString, Integer> getSeriesMap() {\n\t\treturn null;\n\t}", "public Map<String, Property> keyValueMap(){\n int paddingCount = 1;\n Map<String, Property> result = new HashMap<String, Property>();\n String lastKey = null;\n for (Property parameter : this.getProperties()) {\n String newKey = new String(parameter.getKey());\n if (lastKey != null && lastKey.equalsIgnoreCase(newKey)){\n newKey = newKey + \"_\" + paddingCount++;\n }\n result.put(newKey, new Property(parameter));\n lastKey = newKey;\n }\n return result;\n }", "private IMapData<Integer, String> getLinkedHashMapData1() {\n List<IKeyValueNode<Integer, String>> creationData = new ArrayList<>();\n List<IKeyValueNode<Integer, String>> data = new ArrayList<>();\n List<Integer> keys = this.createKeys(data);\n List<String> values = this.createValues(data);\n\n return new MapData<>(\n creationData,\n data,\n keys,\n values);\n }", "Map<String, String> asMap();", "public static Map<String, String> getMapping() {\r\n\t\treturn data.get();\r\n\t}", "public Map<String, String> toSingleValueMap()\r\n/* 367: */ {\r\n/* 368:538 */ LinkedHashMap<String, String> singleValueMap = new LinkedHashMap(this.headers.size());\r\n/* 369:539 */ for (Map.Entry<String, List<String>> entry : this.headers.entrySet()) {\r\n/* 370:540 */ singleValueMap.put((String)entry.getKey(), (String)((List)entry.getValue()).get(0));\r\n/* 371: */ }\r\n/* 372:542 */ return singleValueMap;\r\n/* 373: */ }", "public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();", "private static Map<String, Integer> getSourceMap() {\n\t\tList<Source> sources = SourceService.findAll();\n\t\tMap<String, Integer> sourceMap = new HashMap<String, Integer>();\n\t\t\n\t\tfor (Source source : sources) {\n\t\t\tsourceMap.put(source.getDomain(), source.getId());\n\t\t}\n\t\t\n\t\treturn sourceMap;\n\t}", "public Map<String, Object> createFldNames2ValsMap(Record record)\n {\n return (createFldNames2ValsMap(record, null));\n }", "public EnumMap<?, SerializableString> internalMap()\n/* */ {\n/* 100 */ EnumMap<?, SerializableString> result = this._asMap;\n/* 101 */ if (result == null)\n/* */ {\n/* 103 */ Map<Enum<?>, SerializableString> map = new LinkedHashMap();\n/* 104 */ for (Enum<?> en : this._values) {\n/* 105 */ map.put(en, this._textual[en.ordinal()]);\n/* */ }\n/* 107 */ result = new EnumMap(map);\n/* */ }\n/* 109 */ return result;\n/* */ }", "public Map<String, Object> state() {\n return Collections.unmodifiableMap(values);\n }", "Stream<DataFrameValue<R,C>> values();", "@Override\n public Stream<ImList<String>> export() {\n return map.entrySet().stream().flatMap(me -> {\n final ImList<String> key = me.getKey().export();\n return me.getValue().stream().map(cal -> key.append(cal.export()));\n });\n }", "public CountingMap() {\n this( new HashMap<K, Integer>() );\n }", "private Map<Field, ValueRef> createFieldValueRefMap() {\n Map<Field, ValueRef> map = new IdentityHashMap<>(fields.size() + 1);\n map.put(NormalField.MISSING, new ValueRef(0, 0));\n return map;\n }", "InfiniteMap<K,V> build(MapTypes type);", "public final Map<String, Object> getInternalMap() {\n\t\treturn values;\n\t}", "public Map<Integer, Data> getDataMap() {\n Map<Integer, Data> result = new HashMap<Integer, Data>();\n for (Integer varIndex : _dataMap.keySet()) {\n List<Data> dataList = _dataMap.get(varIndex);\n result.put(varIndex, dataList.get(dataList.size() - 1));\n }\n return result;\n }", "public static Map<String, Object> toMap() {\n return toMap(null);\n }", "public static Map<String, Long> getSalesMap(Reader reader) throws IOException {\n Map<String, Long> map = new HashMap<>();\n\n Scanner scanner = new Scanner(reader);\n\n scanner.nextLine();\n\n while (scanner.hasNext()) {\n String line = scanner.next();\n if (scanner.hasNextLong()) {\n map.merge(line, scanner.nextLong(), Long::sum);\n }\n }\n\n for(Map.Entry<String, Long> entry: map.entrySet()) {\n System.out.println(entry);\n }\n if (!map.isEmpty()) {\n System.out.println(map);\n }\n\n /* for (Map.Entry<String, Long> entry : map.entrySet()) {\n System.out.println(entry.getKey() + \"=\" + entry.getValue());\n } // но тут не полный вывод. Тут перезапись старых\n */ // ключей новыми\n\n return map;\n }", "public Map<String, Object> getStreamsConfig() {\n // returns a copy of the original properties\n return streamsConfig.originals();\n }", "public static Map<String, Double> getMutMap(){\r\n\t\treturn new HashMap<String, Double>(codeToMutRateMap);\r\n\t}", "public MapSum() {\n map = new HashMap<>();\n }", "@Override\n public Iterator<Entry<Integer, T>> iterator() {\n List<Entry<Integer, T>> pairs = new ArrayList<Entry<Integer, T>>(count);\n\n for(int i = 0; i < count; i++) {\n pairs.add(new MapEntry<T>(extractKey(buckets[i]), (T)data[i]));\n }\n\n return pairs.iterator();\n }", "Map getIDPSTDDataMap();", "public InternalMapWithStateDStream (org.apache.spark.streaming.dstream.DStream<scala.Tuple2<K, V>> parent, org.apache.spark.streaming.StateSpecImpl<K, V, S, E> spec, scala.reflect.ClassTag<K> evidence$6, scala.reflect.ClassTag<V> evidence$7, scala.reflect.ClassTag<S> evidence$8, scala.reflect.ClassTag<E> evidence$9) { throw new RuntimeException(); }", "java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();", "java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();", "public Map<String,Value> collect(TaskRuntimeContext runtimeContext);", "private static <N extends Node> SortedMap<ImmutableContextSet, SortedSet<N>> createMap() {\n return new ConcurrentSkipListMap<>(ContextSetComparator.reverse());\n }", "public static void main(String[] args) {\n\t\tMap<String, List<String>> map = new HashMap<>();\n\t\tList<String> list = new ArrayList<>();\n\t\tmap.put(\"key1\", list);\n\t\tmap.get(\"key1\").add(\"value1\");\n\t\tmap.get(\"key1\").add(\"value2\");\n\t\t\n\n\t\t//(map.get(\"key1\").get(0)).isEqualTo(\"value1\");\n\t\t//(map.get(\"key1\").get(1)).isEqualTo(\"value2\");\n\t\t\n\t\tMap<String, String> map1 = Stream.of(new String[][] {\n\t\t\t { \"Hello\", \"World\" }, \n\t\t\t { \"John\", \"Doe\" }, \n\t\t\t}).collect(Collectors.toMap(data -> data[0], data -> data[1])); \n\t\t//Notice here the data type of key and value of the Map is same.\n\t\t//In order to make it more generic letís take the array of Objects and perform the same operation:\n\t\tMap<String, Integer> map2 = Stream.of(new Object[][] { \n\t\t { \"data1\", 1 }, \n\t\t { \"data2\", 2 }, \n\t\t}).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\t\t//Here, we create a map of the key as String and value as an Integer.\n\t}", "@Test\n public void bigDataInMap() throws Exception {\n\n final byte[] data = new byte[16 * 1024 * 1024]; // 16 MB\n rnd.nextBytes(data); // use random data so that Java does not optimise it away\n data[1] = 0;\n data[3] = 0;\n data[5] = 0;\n\n CollectingSink resultSink = new CollectingSink();\n\n StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();\n env.setParallelism(1);\n\n DataStream<Integer> src = env.fromElements(1, 3, 5);\n\n src.map(\n new MapFunction<Integer, String>() {\n private static final long serialVersionUID = 1L;\n\n @Override\n public String map(Integer value) throws Exception {\n return \"x \" + value + \" \" + data[value];\n }\n })\n .addSink(resultSink);\n\n JobGraph jobGraph = StreamingJobGraphGenerator.createJobGraph(env.getStreamGraph());\n\n final RestClusterClient<StandaloneClusterId> restClusterClient =\n new RestClusterClient<>(\n MINI_CLUSTER_RESOURCE.getClientConfiguration(),\n StandaloneClusterId.getInstance());\n\n try {\n submitJobAndWaitForResult(restClusterClient, jobGraph, getClass().getClassLoader());\n\n List<String> expected = Arrays.asList(\"x 1 0\", \"x 3 0\", \"x 5 0\");\n\n List<String> result = CollectingSink.result;\n\n Collections.sort(expected);\n Collections.sort(result);\n\n assertEquals(expected, result);\n } finally {\n restClusterClient.close();\n }\n }", "public Map<String, Object> buildMap() {\n final Map<String, Object> map = new LinkedHashMap<>();\n map.put(\"maxAttempts\", (double) this.maxAttempts);\n map.put(\"initialBackoff\", formatDuration(requireNonNull(this.initialBackoff, \"initialBackoff\")));\n map.put(\"maxBackoff\", formatDuration(requireNonNull(this.maxBackoff, \"maxBackoff\")));\n map.put(\"backoffMultiplier\", this.backoffMultiplier);\n map.put(\"retryableStatusCodes\", requireNonNull(this.retryableStatusCodes, \"retryableStatusCodes\").stream()\n .map(Code::name)\n .collect(Collectors.toList()));\n return map;\n }", "private static <T> Map<T, String> createSimpleMap(T key, String value) {\n\t\tMap<T, String> map = new HashMap<>();\n\t\tmap.put(key, value);\n\t\treturn map;\n\t}", "public Map<String, String> toMap() {\n Map<String, String> map = new HashMap<String, String>();\n map.put(\"id\", id + \"\");\n map.put(\"name\", name);\n map.put(\"value\", value);\n map.put(\"type\", type);\n map.put(\"description\", description);\n\n return map;\n\n }", "public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }", "public static <K, V> BiValue<K, V> getAny(MapStream<K, V> s) {\n return s.getFirst();\n }", "public Map<String, Integer> toMigrationData() {\n return new HashMap<>(counters);\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 }", "private Map<String, DataContainer> getDataContainerMap() {\r\n\r\n if (this.dataContainerMap == null) {\r\n if (this.dataContainerList == null) {\r\n parse();\r\n }\r\n\r\n this.dataContainerMap = new HashMap<>();\r\n for (DataContainer dataContainer : this.dataContainerList) {\r\n this.dataContainerMap.put(dataContainer.getVariableName(), dataContainer);\r\n }\r\n }\r\n return this.dataContainerMap;\r\n }", "public MapData(Iterable<K> iterable, Generator<V> generator) {\n for (K key: iterable) {\n put(key, generator.next());\n }\n }", "Map<String, ISensor> getSensorMap();", "public static Map mapFrom(Object[][] keyValueSets) {\r\n\t\tMap map = new HashMap(keyValueSets.length);\r\n\t\tfor (int i=0; i<keyValueSets.length; i++) {\r\n\t\t\tmap.put(keyValueSets[i][0], keyValueSets[i][1]);\r\n\t\t}\r\n\t\treturn map;\r\n\t}", "@Override\n public String map(String value) throws Exception {\n String[] values=value.split(Constants.KEYSPLIT); // se obtiene en value cada row del data stream, y se le plica un split de acuerdo al\n //separador y se genera un array\n\n if(validateDataArray(values)){// se valida que el array cumpla con los valores necesarios\n dataTemp=values;// se le asigna el array valido al array_temporal\n generateParquet(dataTemp,Constants.PARQUETFILENAME,indexPostFileName,Constants.HDFSPATH,Constants.AVROSCHEMELOCATION,avroTagsNames);// es el metodo que genera los archivos parquet\n indexPostFileName++;\n }\n return Arrays.asList(dataTemp).toString();// se retorna el array_temporal el cual se va a imprimir en consola\n }", "public Map<Integer, Integer> getMemoryDataMap(){\n return dataMemory.getMemoryMap();\n }", "public static void main(String args[]) \r\n {\n List<Integer> number = Arrays.asList(2,3,4,5); \r\n \r\n // demonstration of map method \r\n List<Integer> square = number.stream().map(x -> x*x). \r\n collect(Collectors.toList()); \r\n System.out.println(\"Square od number using map()\"+square); \r\n \r\n // create a list of String \r\n List<String> names = \r\n Arrays.asList(\"Reflection\",\"Collection\",\"Stream\"); \r\n \r\n // demonstration of filter method \r\n List<String> result = names.stream().filter(s->s.startsWith(\"S\")). \r\n collect(Collectors.toList()); \r\n System.out.println(result); \r\n \r\n // demonstration of sorted method \r\n List<String> show = \r\n names.stream().sorted().collect(Collectors.toList()); \r\n System.out.println(show); \r\n \r\n // create a list of integers \r\n List<Integer> numbers = Arrays.asList(2,3,4,5,2); \r\n \r\n // collect method returns a set \r\n Set<Integer> squareSet = \r\n numbers.stream().map(x->x*x).collect(Collectors.toSet()); \r\n System.out.println(squareSet); \r\n \r\n // demonstration of forEach method \r\n number.stream().map(x->x*x).forEach(y->System.out.println(y)); \r\n \r\n // demonstration of reduce method \r\n int even = \r\n number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); \r\n \r\n System.out.println(even); \r\n \r\n // Create a String with no repeated keys \r\n Stream<String[]> \r\n str = Stream \r\n .of(new String[][] { { \"GFG\", \"GeeksForGeeks\" }, \r\n { \"g\", \"geeks\" }, \r\n { \"G\", \"Geeks\" } }); \r\n\r\n // Convert the String to Map \r\n // using toMap() method \r\n Map<String, String> \r\n map = str.collect( \r\n Collectors.toMap(p -> p[0], p -> p[1])); \r\n\r\n // Print the returned Map \r\n System.out.println(\"Map:\" + map); \r\n }", "private Map<ServiceIdentifier<?>, Map<RegionIdentifier, Double>> aggregateDemandMap(\n ImmutableMap<ServiceIdentifier<?>, ImmutableMap<RegionIdentifier, ImmutableMap<NodeAttribute, Double>>> inferredServerDemand) {\n \n final Map<ServiceIdentifier<?>, Map<RegionIdentifier, Double>> demandMap = new HashMap<>();\n \n for (Entry<ServiceIdentifier<?>, ImmutableMap<RegionIdentifier, ImmutableMap<NodeAttribute, Double>>> serviceEntry : inferredServerDemand.entrySet()) {\n ServiceIdentifier<?> service = serviceEntry.getKey();\n \n for (Entry<RegionIdentifier, ImmutableMap<NodeAttribute, Double>> regionEntry : serviceEntry.getValue().entrySet()) {\n updateKeyKeyLoadMap(demandMap, service, regionEntry.getKey(), sumValues(regionEntry.getValue()), true);\n }\n }\n \n return demandMap;\n }", "@Override\n\t\tpublic void map(Key key, Value value, Context context)\n\t\t\t\tthrows IOException, InterruptedException {\n\t\t\tSortedMap<Key,Value> entries = WholeRowIterator.decodeRow(key, value);\n\t\t\t\n\t\t\t// If we have counts for the given ngram for both time periods, we will have 2 Entrys that look like\n\t\t\t// RowId: ngram\n\t\t\t// CQ: Date Granularity (ex. DAY, HOUR)\n\t\t\t// CF: Date Value (ex. 20120102, 2012010221)\n\t\t\t// Value: count\n\t\t\t// We know the entries are sorted by Key, so the first entry will have the earlier date value \n\t\t\tif ( entries.size() == 2 ) {\n\t\t\t\t\n\t\t\t\t// Read the Entrys and pull out the two counts\n\t\t\t\tlong [] counts = new long[2];\n\t\t\t\tint index = 0;\n\t\t\t\tfor ( Entry<Key,Value> entry : entries.entrySet() ) {\n\t\t\t\t\tcounts[index++] = LongCombiner.VAR_LEN_ENCODER.decode( entry.getValue().get());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Generate a trending score for this ngram\n\t\t\t\tint score = calculateTrendingScore( counts, context );\n\t\t\t\t\n\t\t\t\t// If we have a valid score, write out the score to Accumulo\n\t\t\t\tif ( score > 0 ) {\n\t\t\t\t\t\n\t\t\t\t\tint sortableScore = Integer.MAX_VALUE - score;\n\t\t\t\t\t\n\t\t\t\t\t// RowId is the time we are calculating trends for, i.e. DAY:20120102\n\t\t\t\t\t// CF is Integer.MAX_VALUE - trending score so that we sort the highest scores first\n\t\t\t\t\t// CQ is the ngram\n\t\t\t\t\t// Value is empty\n\t\t\t\t\tString rowId = context.getConfiguration().get(\"rowId\");\n\t\t\t\t\tMutation mutation = new Mutation( rowId );\n\t\t\t\t\tmutation.put( new Text( String.valueOf(sortableScore)), entries.firstKey().getRow(), emptyValue );\n\t\t\t\t\tcontext.write( null, mutation );\n\t\t\t\t}\n\t\t\t}\n\t\t}" ]
[ "0.61544764", "0.6038352", "0.5851085", "0.5802548", "0.5729786", "0.5726409", "0.5696489", "0.56448215", "0.56229496", "0.56027436", "0.5601077", "0.5597323", "0.55518824", "0.54577947", "0.5447762", "0.5424156", "0.5409739", "0.54004914", "0.53968656", "0.53870463", "0.53839755", "0.5378796", "0.53719723", "0.5362979", "0.533864", "0.53381616", "0.53246856", "0.53160954", "0.5307406", "0.527601", "0.52661526", "0.52521396", "0.52471346", "0.5244916", "0.5243983", "0.52428454", "0.52374357", "0.52341473", "0.521768", "0.5201066", "0.51974285", "0.5186807", "0.51858866", "0.51853496", "0.517182", "0.51649725", "0.5162496", "0.516178", "0.5157764", "0.5157225", "0.51487565", "0.51479995", "0.5132101", "0.5125601", "0.51171935", "0.51076", "0.5085336", "0.50847274", "0.50816506", "0.5072607", "0.505179", "0.50507104", "0.5050161", "0.50402147", "0.5034817", "0.5033883", "0.5025674", "0.5025127", "0.5022431", "0.50216925", "0.50198025", "0.5014433", "0.50022686", "0.4999036", "0.49946767", "0.49931267", "0.49874935", "0.49806672", "0.49783805", "0.49702957", "0.49702957", "0.49692547", "0.49667606", "0.49548215", "0.49480185", "0.49367455", "0.49367148", "0.49297813", "0.49166456", "0.4897858", "0.4897436", "0.4895474", "0.4892652", "0.48919755", "0.48877096", "0.48837486", "0.48817694", "0.48799106", "0.4876675", "0.4875199", "0.4872671" ]
0.0
-1
Retrieve the set of the implemented measures
public java.util.Set<java.lang.String> availableMeasures() { java.util.Set<java.lang.String> setstrMeasures = new java.util.TreeSet<java.lang.String>(); setstrMeasures.add ("AccrualCoupon"); setstrMeasures.add ("Accrued"); setstrMeasures.add ("Accrued01"); setstrMeasures.add ("CleanDV01"); setstrMeasures.add ("CleanPV"); setstrMeasures.add ("CompoundingAdjustedCleanDV01"); setstrMeasures.add ("CompoundingAdjustedCleanPV"); setstrMeasures.add ("CompoundingAdjustedDirtyDV01"); setstrMeasures.add ("CompoundingAdjustedDirtyPV"); setstrMeasures.add ("CompoundingAdjustedFairPremium"); setstrMeasures.add ("CompoundingAdjustedParRate"); setstrMeasures.add ("CompoundingAdjustedPV"); setstrMeasures.add ("CompoundingAdjustedRate"); setstrMeasures.add ("CompoundingAdjustedUpfront"); setstrMeasures.add ("CompoundingAdjustmentFactor"); setstrMeasures.add ("CompoundingAdjustmentPremium"); setstrMeasures.add ("CompoundingAdjustmentPremiumUpfront"); setstrMeasures.add ("CreditForwardConvexityAdjustedCleanDV01"); setstrMeasures.add ("CreditForwardConvexityAdjustedCleanPV"); setstrMeasures.add ("CreditForwardConvexityAdjustedDirtyDV01"); setstrMeasures.add ("CreditForwardConvexityAdjustedDirtyPV"); setstrMeasures.add ("CreditForwardConvexityAdjustedDV01"); setstrMeasures.add ("CreditForwardConvexityAdjustedFairPremium"); setstrMeasures.add ("CreditForwardConvexityAdjustedParRate"); setstrMeasures.add ("CreditForwardConvexityAdjustedPV"); setstrMeasures.add ("CreditForwardConvexityAdjustedRate"); setstrMeasures.add ("CreditForwardConvexityAdjustedUpfront"); setstrMeasures.add ("CreditForwardConvexityAdjustmentFactor"); setstrMeasures.add ("CreditForwardConvexityAdjustmentPremium"); setstrMeasures.add ("CreditForwardConvexityAdjustmentPremiumUpfront"); setstrMeasures.add ("CreditFundingConvexityAdjustedCleanDV01"); setstrMeasures.add ("CreditFundingConvexityAdjustedCleanPV"); setstrMeasures.add ("CreditFundingConvexityAdjustedDirtyDV01"); setstrMeasures.add ("CreditFundingConvexityAdjustedDirtyPV"); setstrMeasures.add ("CreditFundingConvexityAdjustedDV01"); setstrMeasures.add ("CreditFundingConvexityAdjustedFairPremium"); setstrMeasures.add ("CreditFundingConvexityAdjustedParRate"); setstrMeasures.add ("CreditFundingConvexityAdjustedPV"); setstrMeasures.add ("CreditFundingConvexityAdjustedRate"); setstrMeasures.add ("CreditFundingConvexityAdjustedUpfront"); setstrMeasures.add ("CreditFundingConvexityAdjustmentFactor"); setstrMeasures.add ("CreditFundingConvexityAdjustmentPremium"); setstrMeasures.add ("CreditFundingConvexityAdjustmentPremiumUpfront"); setstrMeasures.add ("CreditFXConvexityAdjustedCleanDV01"); setstrMeasures.add ("CreditFXConvexityAdjustedCleanPV"); setstrMeasures.add ("CreditFXConvexityAdjustedDirtyDV01"); setstrMeasures.add ("CreditFXConvexityAdjustedDirtyPV"); setstrMeasures.add ("CreditFXConvexityAdjustedDV01"); setstrMeasures.add ("CreditFXConvexityAdjustedFairPremium"); setstrMeasures.add ("CreditFXConvexityAdjustedParRate"); setstrMeasures.add ("CreditFXConvexityAdjustedPV"); setstrMeasures.add ("CreditFXConvexityAdjustedRate"); setstrMeasures.add ("CreditFXConvexityAdjustedUpfront"); setstrMeasures.add ("CreditFXConvexityAdjustmentFactor"); setstrMeasures.add ("CreditFXConvexityAdjustmentPremium"); setstrMeasures.add ("CreditFXConvexityAdjustmentPremiumUpfront"); setstrMeasures.add ("CumulativeConvexityAdjustedCleanDV01"); setstrMeasures.add ("CumulativeConvexityAdjustedCleanPV"); setstrMeasures.add ("CumulativeConvexityAdjustedDirtyDV01"); setstrMeasures.add ("CumulativeConvexityAdjustedDirtyPV"); setstrMeasures.add ("CumulativeConvexityAdjustedDV01"); setstrMeasures.add ("CumulativeConvexityAdjustedFairPremium"); setstrMeasures.add ("CumulativeConvexityAdjustedParRate"); setstrMeasures.add ("CumulativeConvexityAdjustedPV"); setstrMeasures.add ("CumulativeConvexityAdjustedRate"); setstrMeasures.add ("CumulativeConvexityAdjustedUpfront"); setstrMeasures.add ("CumulativeConvexityAdjustmentFactor"); setstrMeasures.add ("CumulativeConvexityAdjustmentPremium"); setstrMeasures.add ("CumulativeConvexityAdjustmentPremiumUpfront"); setstrMeasures.add ("CumulativeCouponAmount"); setstrMeasures.add ("CV01"); setstrMeasures.add ("DirtyDV01"); setstrMeasures.add ("DirtyPV"); setstrMeasures.add ("DV01"); setstrMeasures.add ("FairPremium"); setstrMeasures.add ("Fixing01"); setstrMeasures.add ("ForwardFundingConvexityAdjustedCleanDV01"); setstrMeasures.add ("ForwardFundingConvexityAdjustedCleanPV"); setstrMeasures.add ("ForwardFundingConvexityAdjustedDirtyDV01"); setstrMeasures.add ("ForwardFundingConvexityAdjustedDirtyPV"); setstrMeasures.add ("ForwardFundingConvexityAdjustedDV01"); setstrMeasures.add ("ForwardFundingConvexityAdjustedFairPremium"); setstrMeasures.add ("ForwardFundingConvexityAdjustedParRate"); setstrMeasures.add ("ForwardFundingConvexityAdjustedPV"); setstrMeasures.add ("ForwardFundingConvexityAdjustedRate"); setstrMeasures.add ("ForwardFundingConvexityAdjustedUpfront"); setstrMeasures.add ("ForwardFundingConvexityAdjustmentFactor"); setstrMeasures.add ("ForwardFundingConvexityAdjustmentPremium"); setstrMeasures.add ("ForwardFundingConvexityAdjustmentPremiumUpfront"); setstrMeasures.add ("ForwardFXConvexityAdjustedCleanDV01"); setstrMeasures.add ("ForwardFXConvexityAdjustedCleanPV"); setstrMeasures.add ("ForwardFXConvexityAdjustedDirtyDV01"); setstrMeasures.add ("ForwardFXConvexityAdjustedDirtyPV"); setstrMeasures.add ("ForwardFXConvexityAdjustedDV01"); setstrMeasures.add ("ForwardFXConvexityAdjustedFairPremium"); setstrMeasures.add ("ForwardFXConvexityAdjustedParRate"); setstrMeasures.add ("ForwardFXConvexityAdjustedPV"); setstrMeasures.add ("ForwardFXConvexityAdjustedRate"); setstrMeasures.add ("ForwardFXConvexityAdjustedUpfront"); setstrMeasures.add ("ForwardFXConvexityAdjustmentFactor"); setstrMeasures.add ("ForwardFXConvexityAdjustmentPremium"); setstrMeasures.add ("ForwardFXConvexityAdjustmentPremiumUpfront"); setstrMeasures.add ("FundingFXConvexityAdjustedCleanDV01"); setstrMeasures.add ("FundingFXConvexityAdjustedCleanPV"); setstrMeasures.add ("FundingFXConvexityAdjustedDirtyDV01"); setstrMeasures.add ("FundingFXConvexityAdjustedDirtyPV"); setstrMeasures.add ("FundingFXConvexityAdjustedDV01"); setstrMeasures.add ("FundingFXConvexityAdjustedFairPremium"); setstrMeasures.add ("FundingFXConvexityAdjustedParRate"); setstrMeasures.add ("FundingFXConvexityAdjustedPV"); setstrMeasures.add ("FundingFXConvexityAdjustedRate"); setstrMeasures.add ("FundingFXConvexityAdjustedUpfront"); setstrMeasures.add ("FundingFXConvexityAdjustmentFactor"); setstrMeasures.add ("FundingFXConvexityAdjustmentPremium"); setstrMeasures.add ("FundingFXConvexityAdjustmentPremiumUpfront"); setstrMeasures.add ("ParRate"); setstrMeasures.add ("PV"); setstrMeasures.add ("Rate"); setstrMeasures.add ("ResetDate"); setstrMeasures.add ("ResetRate"); setstrMeasures.add ("TotalCoupon"); setstrMeasures.add ("UnadjustedCleanDV01"); setstrMeasures.add ("UnadjustedCleanPV"); setstrMeasures.add ("UnadjustedDirtyDV01"); setstrMeasures.add ("UnadjustedDirtyPV"); setstrMeasures.add ("UnadjustedFairPremium"); setstrMeasures.add ("UnadjustedParRate"); setstrMeasures.add ("UnadjustedPV"); setstrMeasures.add ("UnadjustedRate"); setstrMeasures.add ("UnadjustedUpfront"); setstrMeasures.add ("Upfront"); return setstrMeasures; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Set<Measure> supportedMeasures();", "@Override\n public List<String> getMeasures() {\n return measures;\n }", "@Override\n public Set<Measure> supportedMeasures() {\n return ImmutableSet.of();\n }", "@Override\n public Enumeration<String> enumerateMeasures() {\n\n Vector<String> newVector = new Vector<String>(3);\n newVector.addElement(\"measureNumRules\");\n newVector.addElement(\"measureNumPositiveRules\");\n newVector.addElement(\"measureNumConditionsInPositiveRules\");\n return newVector.elements();\n }", "@Override\n @XmlElement(name = \"nameOfMeasure\", namespace = LegacyNamespaces.GMD)\n public Collection<InternationalString> getNamesOfMeasure() {\n if (!FilterByVersion.LEGACY_METADATA.accept()) return null;\n return namesOfMeasure = nonNullCollection(namesOfMeasure, InternationalString.class);\n }", "public abstract double getMeasure();", "public final ArrayList<Double> getMeasureValues() {\r\n return this.measureValues;\r\n }", "public synchronized static Set<MeasureUnit> getAvailable() {\n Set<MeasureUnit> result = new HashSet<MeasureUnit>();\n for (String type : new HashSet<String>(MeasureUnit.getAvailableTypes())) {\n for (MeasureUnit unit : MeasureUnit.getAvailable(type)) {\n result.add(unit);\n }\n }\n // Train users not to modify returned set from the start giving us more\n // flexibility for implementation.\n return Collections.unmodifiableSet(result);\n }", "@Override\n public void setMeasures(List<String> measures) {\n this.measures = measures;\n }", "public abstract List<Metric> getMetrics();", "@Schema(description = \"A list of definitions for the measurements for the test defined by this specification\")\n\t@Valid\n\tpublic Set<TestMeasureDefinition> getTestMeasureDefinition() {\n\t\treturn testMeasureDefinition;\n\t}", "public ArrayList<UnitMeasure> getUnitMeasureList(){\n\t\tSession session = HibernateUtils.getSessionFactory().openSession();\n\t\tArrayList<UnitMeasure> list = new ArrayList<UnitMeasure>();\n\t\ttry{\n\t\t\tCriteria cr = session.createCriteria(TblUnitMeasure.class);\n\t\t\tList<TblUnitMeasure> unitmeasures = cr.list();\n\t\t\tif (unitmeasures.size() > 0){\n\t\t\t\tfor (Iterator<TblUnitMeasure> iterator = unitmeasures.iterator(); iterator.hasNext();){\n\t\t\t\t\tTblUnitMeasure tblunitmeasure = iterator.next();\n\t\t\t\t\tUnitMeasure unitmeasure = new UnitMeasure();\n\t\t\t\t\tunitmeasure.convertFromTable(tblunitmeasure);\n\t\t\t\t\tlist.add(unitmeasure);\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(HibernateException e){\n\t\t\tSystem.err.println(\"ERROR IN LIST!!!!!!\");\n\t\t\te.printStackTrace();\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t\treturn list;\n\t}", "Map<String, OperationalSets> getSets();", "public List<KismetMeasuredValue> getMeasuredValues() {\n return this.measuredValues;\n }", "public MeasureDefinition getMeasuredBy() {\n\t\treturn measuredBy;\n\t}", "public List<Measure> getRepeat(){\n\t\treturn meas;\n\t}", "Measure getMeasure ()\n {\n return null;\n }", "private List<Measurer> getMeasurers(String genomeId) {\n List<Measurer> retVal = new ArrayList<Measurer>(this.methods.size());\n Genome genome = this.getGenome(genomeId);\n this.genomeName1 = genome.getName();\n this.taxAnalysis1 = this.taxMethod.new Analysis(genome);\n for (var method : this.methods) {\n var measurer = method.getMeasurer(genome);\n retVal.add(measurer);\n }\n return retVal;\n }", "public MeasureExport getMeasureExport() {\n\t\treturn measureExport;\n\t}", "public interface CurveMeasure extends Measure{\n\t\n\t/**\n\t * Returns a MeasureSet object that contains the measure result to all topic and atValues specified on the run selected. \n\t * @param run - name of run\n\t * @param xValues - atValues array. \n\t * @return MeasureSet - The object that encapsulates the measure result. \n\t * @throws IOException -If happened a problem when open the result file\n\t * @throws InterruptedException - \n\t * @throws InvalidItemNameException - If the data is not a number.\n\t * @throws ItemNotFoundException - If a topic does not exist. \n\t * @throws InvalidItemNameException - If a topics with the same name exists. \n\t */\n\tpublic MeasureSet getValue(String run, String [] xValues)\n\t\t\tthrows IOException, InterruptedException, NumberFormatException, ItemNotFoundException, \n\t\t\tInvalidItemNameException, QrelItemNotFoundException, TopicNotFoundException,\n\t\t\tInvalidQrelFormatException;\n\n\t/**\n\t * Returns a MeasureSet object that contains the measure result to selected topics and atValues specified on the run selected. \n\t * @param run - name of run\n\t * @param xValues - atValues array. \n\t * @param topicNumbers - selected topic name array \n\t * @return MeasureSet - The object that encapsulates the measure result. \n\t * @throws IOException -If happened a problem when open the result file\n\t * @throws InterruptedException - \n\t * @throws InvalidItemNameException - If the data is not a number.\n\t * @throws ItemNotFoundException - If a topic does not exist. \n\t * @throws InvalidItemNameException - If a topics with the same name exists. \n\t */\n\tpublic MeasureSet getValue(String run, String [] xValues, String[] topicNumbers) throws IOException,\n\t\t\tInterruptedException, NumberFormatException, ItemNotFoundException, InvalidItemNameException, \n\t\t\tQrelItemNotFoundException, TopicNotFoundException,\n\t\t\tInvalidQrelFormatException;\n}", "public synchronized static Set<MeasureUnit> getAvailable(String type) {\n populateCache();\n Map<String, MeasureUnit> units = cache.get(type);\n // Train users not to modify returned set from the start giving us more\n // flexibility for implementation.\n return units == null ? Collections.<MeasureUnit>emptySet()\n : Collections.unmodifiableSet(new HashSet<MeasureUnit>(units.values()));\n }", "private static synchronized void initializeMeasureMaps() {\n\t\tintensityMeasuresList=ExerciseIntensityMeasure.getAll();\n\t\tquantityMeasuresList=ExerciseQuantityMeasure.getAll();\n\t\tintensityCodesToNamesMap=new HashMap(intensityMeasuresList.size());\n\t\tquantityCodesToNamesMap=new HashMap(quantityMeasuresList.size());\n\n\t\t// these (and the lists above) come from the db, but they can be static \n\t\t// because they change so infrequently (haven't changed in five years and\n\t\t// counting), and only manually via the db.\n\t\tfor (int i=0; i<intensityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseIntensityMeasure m=(ExerciseIntensityMeasure)intensityMeasuresList.get(i);\n\t\t\tintensityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tfor (int i=0; i<quantityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseQuantityMeasure m=(ExerciseQuantityMeasure)quantityMeasuresList.get(i);\n\t\t\tquantityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tmeasureMapsInitialized=true;\n\t\t\n\t}", "List<QualityDataSetDTO> getQDSElements(String measureId, String verision);", "public DemandSet getDemands() {\n\t\treturn demands;\n\t}", "public ArrayList<Sets> getSets() {\n return this.sets;\n }", "public Set<IS> getFreItemSet();", "public java.util.List<Dimension> getDimensionsAll();", "public CachetMetricList getMetrics() {\n throw new RuntimeException(\"Method not implemented.\");\n }", "public Measure getMeasureId() {\r\n\t\treturn measureId;\r\n\t}", "public String getMeasureResult() {\r\n return measureResult;\r\n }", "private int[] getMeasures(ImageData input, boolean byRows) {\n int[] result = new int[2];\n\n if (byRows) {\n result[0] = input.measures.width;\n result[1] = input.measures.height;\n } else {\n result[0] = input.measures.height;\n result[1] = input.measures.width;\n }\n\n return result;\n }", "public interface Measurable {\n double getMeasure();\n}", "@Test\n\tpublic void testMeasureSimilarity() {\n\t\tList<TimeSeriesSimilarityCollection> res;\n\t\tTimeSeriesSimilarityCollection r;\n\n\t\t// we are interested in measure now\n\t\tevaluator.setSimilarity(true, false, false);\n\n\t\t// add some data\n\t\t// @formatter:off\n\t\t// 01.01.15: (00:00) ++++++++++++ (02:00) Philipp (5)\n\t\t// 31.12.15: (00:00) ++++++++++++ (02:00) Tobias (5)\n\t\t// @formatter:on\n\t\tloadData(\"Philipp\", 5, \"01.01.2015 00:00:00\", \"01.01.2015 02:00:00\");\n\t\tloadData(\"Tobias\", 5, \"31.12.2015 00:00:00\", \"31.12.2015 02:00:00\");\n\n\t\t// get the similar once on a global measure level\n\t\tres = evaluator.evaluateSimilarity(\n\t\t\t\tgetQuery(\"SUM(IDEAS) AS IDEAS\", null), 1);\n\n\t\tassertEquals(1, res.size());\n\t\tr = res.get(0);\n\t\tassertEquals(0.0, r.getMeasureDistance(), 0.0);\n\t\tassertEquals(0.0, r.getTotalDistance(), 0.0);\n\t\t// 1451520000000l == 31 Dec 2015 00:00:00 UTC\n\t\tassertEquals(1451520000000l, ((Date) r.getLabelValue(0)).getTime());\n\n\t\t// add another data package\n\t\t// @formatter:off\n\t\t// 01.01.15: (00:00) ++++++++++++ (02:00) Philipp (5)\n\t\t// 30.11.15: (00:10) +++++ (01:00) Philipp (5)\n\t\t// 31.12.15: (00:00) ++++++++++++ (02:00) Tobias (5)\n\t\t// @formatter:on\n\t\tloadData(\"Philipp\", 5, \"30.11.2015 00:10:00\", \"30.11.2015 01:00:00\");\n\n\t\t// get the similar once on a filtered measure level\n\t\tres = evaluator.evaluateSimilarity(\n\t\t\t\tgetQuery(\"SUM(IDEAS) AS IDEAS\", \"NAME='Philipp'\"), 1);\n\t\tr = res.get(0);\n\t\t// 70 minutes (00:00 - 00:09 and 01:01 - 02:00), each 5 => 350\n\t\tassertEquals(350.0, r.getMeasureDistance(), 0.0);\n\t\tassertEquals(350.0, r.getTotalDistance(), 0.0);\n\t\t// 1448841600000l == 30 Nov 2015 00:00:00 UTC\n\t\tassertEquals(1448841600000l, ((Date) r.getLabelValue(0)).getTime());\n\n\t\t// add another data package\n\t\t// @formatter:off\n\t\t// 01.01.15: (00:00) ++++++++++++ (02:00) Philipp (5)\n\t\t// (00:10) ++++ (00:50) Edison (5)\n\t\t// 30.11.15: (00:00) +++++ (00:50) Edison (5) \n\t\t// (00:10) +++++ (01:00) Philipp (5)\n\t\t// (01:00) ++++++ (02:00) Philipp (5)\n\t\t// 31.12.15: (00:00) ++++++++++++ (02:00) Tobias (5)\n\t\t// @formatter:on\n\t\tloadData(\"Edison\", 5, \"30.11.2015 00:00:00\", \"30.11.2015 00:50:00\");\n\t\tloadData(\"Philipp\", 5, \"30.11.2015 01:00:00\", \"30.11.2015 02:00:00\");\n\t\tloadData(\"Edison\", 5, \"01.01.2015 00:10:00\", \"01.01.2015 00:50:00\");\n\n\t\t// get the similar once on a filtered measure level\n\t\tres = evaluator.evaluateSimilarity(\n\t\t\t\tgetQuery(\"SUM(IDEAS) AS IDEAS\", null), 1);\n\t\tr = res.get(0);\n\t\t// 1 minute (01:00:00), each 5 as value => 5\n\t\tassertEquals(5.0, r.getMeasureDistance(), 0.0);\n\t\tassertEquals(5.0, r.getTotalDistance(), 0.0);\n\t\t// 1448841600000l == 30 Nov 2015 00:00:00 UTC\n\t\tassertEquals(1448841600000l, ((Date) r.getLabelValue(0)).getTime());\n\n\t\t// fire one with dimensions\n\t\t// @formatter:off\n\t\t// 01.01.15: (00:00) ++++++++++++ (02:00) Philipp (5)\n\t\t// (00:10) ++++ (00:50) Edison (5)\n\t\t// 30.11.15: (00:00) +++++ (00:50) Edison (5) \n\t\t// (00:10) +++++ (01:00) Philipp (5)\n\t\t// (01:00) ++++++ (02:00) Philipp (5)\n\t\t// 31.12.15: (00:00) ++++++++++++ (02:00) Tobias (5)\n\t\t// @formatter:on\n\t\tres = evaluator.evaluateSimilarity(\n\t\t\t\tgetQuery(\"MAX(SUM(IDEAS)) AS IDEAS ON TIME.DEF.HOUR\", null), 1);\n\n\t\tassertEquals(1, res.size());\n\t\tr = res.get(0);\n\t\t// 1 minute (01:00:00), each 5 for the whole hour (* 60) as value => 300\n\t\tassertEquals(300.0, r.getMeasureDistance(), 0.0);\n\t\tassertEquals(300.0, r.getTotalDistance(), 0.0);\n\t\tassertEquals(\"R20151130_0000_0059\", r.getLabelValue(0));\n\t}", "private Itemset[] getItemsets() {\n\t\t\treturn frequentItemsets.keySet().toArray(new Itemset[frequentItemsets.size()]);\n\t\t}", "private static MeasureProcessing getMeasureProcessing() {\n if(measure == null) {\n measure = new MeasureProcessing();\n }\n return measure;\n }", "public interface MeasurePropertyType\n\t\t{\n\t\tpublic String getDesc();\n\t\t\n\t\t/**\n\t\t * Which properties, must be fixed and the same for all particles \n\t\t */\n\t\tpublic Set<String> getColumns();\n\t\t\n\t\t/**\n\t\t * Evaluate a stack, store in info. If a particle is not in the list it must be\n\t\t * created. All particles in the map must receive data.\n\t\t */\n\t\tpublic void analyze(ProgressHandle progh, EvStack stackValue, EvStack stackMask, ParticleMeasure.FrameInfo info);\n\t\t}", "public Collection<Experiment> getExperiments();", "public String getMeasureId() {\r\n\t\treturn measureId;\r\n\t}", "public Set<String> getFeatures();", "@ComputerMethod\n private Collection<QIOFrequency> getFrequencies() {\n return FrequencyType.QIO.getManagerWrapper().getPublicManager().getFrequencies();\n }", "io.netifi.proteus.admin.om.Metrics getMetrics();", "@Override\n public int getCurrentMeasure() {\n return this.currentMeasure;\n }", "public abstract CustomMetric[] getCustomMetrics();", "public abstract double getMeasurement();", "public abstract double getMeasurement();", "public ArrayList <TreasureKind> getSpecificVisibleTreasures () {\n \n return this.specificVisibleTreasures; \n }", "@Override\n public DataStoreMetricsReporter getMetrics()\n {\n return metrics;\n }", "FrequentItemSet[] getFrequentItemSets() {\n return frequentItemSets;\n }", "public ArrayList getUnits();", "@Override\n\tpublic void measures() {\n\t\t\n\t\tsetTempo(240);\n\t\t\n\t\tkey = \"G\";\n\t\t\n\t\tmeasure(0);\n\t\t\n\t\taddNote(\"D5q\",A,T);\n\t\t\n\t\taddRest(\"q\",B);\n\t\t\n\t\tmeasure(1);\n\t\t\n\t\taddNotes(\"G5q G5i A5i G5i F5i\",T);\n\t\t\n\t\taddRest(\"q\",B);\n\t\taddNotes(\"B3q G4q\",B);\n\t\t\n\t\tmeasure(2);\n\t\t\n\t\taddNotes(\"E5q E5q E5q\",T);\n\t\t\n\t\taddNotes(\"C4h+E4h\",B);\n\t\taddRest(\"q\",B);\n\t\t\n\t\tmeasure(3);\n\t\t\n\t\taddNotes(\"A5q A5i B5i A5i G5i\",T);\n\t\t\n\t\taddRest(\"q\",B);\n\t\taddNotes(\"C#4q A4q\",B);\n\t\t\n\t\tmeasure(4);\n\t\t\n\t\taddNotes(\"F5q D5q D5q\",T);\n\t\t\n\t\taddNotes(\"D4h+F4h\",B);\n\t\taddRest(\"q\",B);\n\t\t\n\t\tmeasure(5);\n\t\t\n\t\taddNotes(\"B5q B5i C6i B5i A5i\",T);\n\t\t\n\t\taddRest(\"q\",B);\n\t\taddNotes(\"G4q D5q\",B);\n\t\t\n\t\tmeasure(6);\n\t\t\n\t\taddNotes(\"G5q E5q D5i D5i\",T);\n\t\t\n\t\taddNotes(\"C5h+E5h\",B);\n\t\taddRest(\"q\",B);\n\t\t\n\t\tmeasure(7);\n\t\t\n\t\taddNotes(\"E5q A5q F5q\",T);\n\t\t\n\t\taddNotes(\"C5h D5q\",B);\n\t\t\n\t\tmeasure(8);\n\t\t\n\t\taddNotes(\"G5h D5q\",T);\n\t\t\n\t\taddNotes(\"G4h+B4h\",B);\n\t\taddRest(\"q\",B);\n\t\t\n\t\tmeasure(9);\n\t\t\n\t\taddNotes(\"G5q G5q G5q\",T);\n\t\t\n\t\taddNote(\"B4h.\",A,B);\n\t\t\n\t\tmeasure(10);\n\t\t\n\t\taddNotes(\"F5h F5q\",T);\n\t\t\n\t\taddNotes(\"A4h A4q\",B);\n\t\t\n\t\tmeasure(11);\n\t\t\n\t\taddNotes(\"G5q F5q E5q\",T);\n\t\t\n\t\taddNotes(\"B4q A4q G4q\",B);\n\t\t\n\t\tmeasure(12);\n\t\t\n\t\taddNotes(\"D5h A5q\",T);\n\t\t\n\t\taddNotes(\"F4h A4q\",B);\n\t\t\n\t\tmeasure(13);\n\t\t\n\t\taddNotes(\"B5q A5q G5q\",T);\n\t\t\n\t\taddNotes(\"B4q A4q G4q\",B);\n\t\t\n\t\tmeasure(14);\n\t\t\n\t\taddNotes(\"D6q D5q D5i D5i\",T);\n\t\t\n\t\taddNotes(\"D5q D4q\",B);\n\t\taddRest(\"q\",B);\n\t\t\n\t\tmeasure(15);\n\t\t\n\t\taddNotes(\"E5q A5q F5q\",T);\n\t\t\n\t\taddNotes(\"C5h D5q\",B);\n\t\t\n\t\tmeasure(16);\n\t\t\n\t\taddNote(\"G5h\",A,T);\n\t\taddRest(\"q\",T);\n\t\t\n\t\taddNotes(\"G4h+B4h\",B);\n\t\taddRest(\"q\",B);\n\t\t\n\t\tmeasure(17);\n\t}", "private static ArrayList<ChannelMeasure> getChannelMeasures(HttpResponse<String> response){\n\t\tArrayList<ChannelMeasure> items;\n\t\ttry {\n\t\t\titems = new ObjectMapper().readValue(response.body(), new TypeReference<ArrayList<ChannelMeasure>>(){});\n\t\t\treturn items;\n\t\t} catch (JsonMappingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (JsonProcessingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public List<Set> getSets() {\n\t\treturn this.sets;\n\t}", "@Override\n\tpublic int getCount() {\n\t\treturn mMeasuresinfoes.size();\n\t}", "public HashSet<String> getUsefulAttributes() {\n\t\t \n\t\tHashSet<String> attr = new HashSet<>();\n\t\tQuery firstQ = this.rset.get(1); // get first query on rewriting set 'rset'.\n\t\t\n\t\tGrouping gPart = firstQ.getQueryTriple()._1();\n\t attr.addAll(gPart.getUsefulAttributes());\n\t \n\t Measuring mPart = firstQ.getQueryTriple()._2();\n\t attr.addAll(mPart.getMeasuringAttributes());\n\t \n\t\treturn attr;\n\t}", "@Override\n public double getMeasure() {\n return getFuelEffieciency();\n }", "protected Map<String, Double> getFactors() {\n return factors;\n }", "Metrics getMetrics();", "public String getUnitOfMeasure() {\r\n return this.unitOfMeasure;\r\n }", "public Collection getQualityResults()\r\n {\r\n return mQualityResults;\r\n }", "java.util.List<com.google.api.MetricDescriptor> getMetricDescriptorsList();", "public List<Dataset> getDatasets();", "public interface UnitOfMeasureService {\n\n Set<UnitOfMeasureCommand> listAllUoms();\n}", "boolean hasMetricTreatment();", "public abstract Unit getUnits( int dimension );", "public Set<Medicine> loadMedicines();", "protected abstract float getMeasurement();", "@Override\r\n\tpublic List<Units> queryAllHx() {\n\t\treturn adi.queryAllHx();\r\n\t}", "List<ExamGrSubMeta> getAnswerSheetMeta();", "public DisjointSets getSets()\n\t{\n\t\treturn sets;\n\t}", "@Override\n public Metrics getMetrics() {\n return metrics;\n }", "@controllers.PUBLICAPI\r\n\tpublic Collection<MedicalTestFactory> getMedicalTestFactories() {\r\n\t\treturn hospital.getMedicalTests();\r\n\t}", "@Override\n public synchronized Set<FeatureType> getFeatures() {\n return features = nonNullSet(features, FeatureType.class);\n }", "public FeatureSet getFeatures() {\n\treturn features;\n }", "public abstract String getSetSpec();", "private Set calculateTimeSet() {\n List choices = getDataChoices();\n if (choices.isEmpty()) {\n return null;\n }\n Set newSet = null;\n for (int i = 0; i < choices.size(); i++) {\n try {\n VerticalProfileInfo info = getVPInfo(i);\n GridDataInstance dataInstance = info.getDataInstance();\n Set set = GridUtil.getTimeSet(dataInstance.getGrid());\n //System.out.println(\"di.timeset[\"+i+\"] = \" + set);\n if (set != null) {\n if (newSet == null) {\n newSet = set;\n } else {\n newSet = newSet.merge1DSets(set);\n }\n }\n } catch (Exception e) {\n logger.error(\"Problem calculating TimeSet\", e);\n }\n }\n //System.out.println(\"merged time set = \" + newSet);\n return newSet;\n }", "MeasureOrNullListType getQuantityList();", "public Collection<MetricInfo> listMetrics() {\n if (!registeredMetrics.isEmpty()) {\n return registeredMetrics.values();\n }\n return null;\n }", "public List<SetMappingValue> getSets() {\r\n\t\treturn sets;\r\n\t}", "public float getUtilityMeasure() {\n return utilityMeasure;\n }", "public SetOfSensors getSetOfSensors(){\n return sensors;\n }", "public ArrayList<RuleSet> getRuleSets() {\n return ruleSets;\n }", "boolean hasMetric();", "boolean hasMetric();", "public QualityMeasures getQualityMeasures (int pos, String nFile) {\r\n return poblac.getMedidas(pos, nFile);\r\n }", "final Unit getUnits() {\n Unit units = null;\n for ( int i = getDimension(); --i >= 0; ) {\n final Unit check = getUnits( i );\n if ( units == null )\n units = check;\n else if ( !units.equals( check ) )\n return null;\n }\n return units;\n }", "@SuppressWarnings({ \"rawtypes\" })\n\tpublic List<TestSuite> getSuites() {\n\t\tList<List> allSuites = DataManager.openCoverageData();\n\t\tCoverage coverage = new Coverage();\n\t\tList<TestSuite> suites = coverage.getSuiteList(allSuites);\n\t\treturn suites;\n\t}", "public Vector getListSpecializations(){\n Vector listQualifications = new Vector();\n try{\n String sqlGet = \"SELECT * FROM qualification ORDER BY qualification_name\";\n\n ResultSet rsGet = this.queryData(sqlGet);\n int order = 0;\n while(rsGet.next()){\n order++;\n Vector dataSet = new Vector();\n dataSet.add(rsGet.getInt(\"qualification_id\"));\n dataSet.add(rsGet.getString(\"qualification_name\"));\n\n listQualifications.add(dataSet);\n }\n } catch(Exception e){\n System.out.println(e.getMessage());\n }\n return listQualifications;\n }", "public Set<IAspectRead> getReadAspects();", "public int[] getSetsArray()\n\t{\n\t\treturn getSets().getSetsArray();\n\t}", "public int getNumberOfSets();", "@Override\n\tpublic BodyMeasureSummary getSummary(MemberVO m) {\n\t\tMemberVO member = mobileMapper.selectMember(m);\n\t\tSchoolVO school = mobileMapper.selectSchoolById(member.getSchool_id());\n\t\t\n\t\tif(member != null) {\n\t\t\tList<BodyMeasureSummary> list = mobileMapper.selectBodySummary(member);\n\t\t\t\n\t\t\tif(list != null && list.size() > 0) {\n\t\t\t\t//get the lastest measure info.\n\t\t\t\tBodyMeasureSummary summaryVO = list.get(0);\n\t\t\t\t\n\t\t\t\tBodyMeasureGrade gradeVO = new BodyMeasureGrade();\n\t\t\t\tgradeVO.setSex(member.getSex());\n\t\t\t\tgradeVO.setYear(\"2012\");\n\t\t\t\tString schoolGradeId = CommonUtil.getGradeId(member.getSchool_grade(), school.getGubun2());\n\t\t\t\tgradeVO.setSchoolGradeId(schoolGradeId);\n\t\t\t\t\n\t\t\t\t//get height desc\n\t\t\t\tgradeVO.setSection(Constant.Height);\n\t\t\t\tgradeVO.setValue(summaryVO.getHeight());\n\t\t\t\tBodyMeasureGrade heightVO = mobileMapper.selectGradeBySection(gradeVO);\n\t\t\t\tif (heightVO != null) {\n\t\t\t\t\tsummaryVO.setHeightStatus(heightVO.getGradeDesc());\n\t\t\t\t\tsummaryVO.setHeightGradeId(heightVO.getGradeId());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//get Weight desc\n\t\t\t\tgradeVO.setSection(Constant.Weight);\n\t\t\t\tgradeVO.setValue(summaryVO.getWeight());\n\t\t\t\tBodyMeasureGrade weightVO = mobileMapper.selectGradeBySection(gradeVO);\n\t\t\t\tif (weightVO != null) {\n\t\t\t\t\tsummaryVO.setWeightStatus(weightVO.getGradeDesc());\n\t\t\t\t\tsummaryVO.setWeightGradeId(weightVO.getGradeId());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//get BMI desc\n\t\t\t\tgradeVO.setSection(Constant.BMI);\n\t\t\t\tgradeVO.setValue(summaryVO.getBmi());\n\t\t\t\tBodyMeasureGrade bmiVO = mobileMapper.selectGradeBySection(gradeVO);\n\t\t\t\tif(bmiVO != null) {\n\t\t\t\t\tsummaryVO.setBmiStatus(bmiVO.getGradeDesc());\n\t\t\t\t\tsummaryVO.setBmiGradeId(bmiVO.getGradeId());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//get Smoke Status\n\t\t\t\tBodyMeasureGrade smokeVO = mobileMapper.selectSmokerGrade(summaryVO.getPpm());\n\t\t\t\tif (smokeVO != null) {\n\t\t\t\t\tsummaryVO.setSmokeStatus(smokeVO.getGradeDesc());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn summaryVO;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private Set<T> getMemory() { return null; }", "MeasureType getQuantity();", "private Measurement getMeasurements(){\n Measurement measurement = new Measurement();\n\n //set to date of measurement added\n measurement.setDate(new Date());\n\n //retrieve measurement data from edit texts. if edit text is empty make measurement 0;\n String neckString = neckEditText.getText().toString();\n double neck = (!neckString.equals(\"\")) ? Double.parseDouble(neckString) : 0;\n measurement.setNeck(neck);\n\n String chestString = chestEditText.getText().toString();\n double chest = (!chestString.equals(\"\")) ? Double.parseDouble(chestString) : 0;\n measurement.setChest(chest);\n\n String shoulderString = shoulderEditText.getText().toString();\n double shoulders = (!shoulderString.equals(\"\")) ? Double.parseDouble(shoulderString) : 0;\n measurement.setShoulders(shoulders);\n\n String leftArmString = leftArmEditText.getText().toString();\n double leftArm = (!leftArmString.equals(\"\")) ? Double.parseDouble(leftArmString) : 0;\n measurement.setLeftArm(leftArm);\n\n String rightArmString = rightArmEditText.getText().toString();\n double rightArm = (!rightArmString.equals(\"\")) ? Double.parseDouble(rightArmString) : 0;\n measurement.setRightArm(rightArm);\n\n String leftForearmString = leftForearmEditText.getText().toString();\n double leftForearm = (!leftForearmString.equals(\"\")) ? Double.parseDouble(leftForearmString) : 0;\n measurement.setLeftForearm(leftForearm);\n\n String rightForearmString = rightForearmEditText.getText().toString();\n double rightForearm = (!rightForearmString.equals(\"\")) ? Double.parseDouble(rightForearmString) : 0;\n measurement.setRightForearm(rightForearm);\n\n String waistString = waistEditText.getText().toString();\n double waist = (!waistString.equals(\"\")) ? Double.parseDouble(waistString) : 0;\n measurement.setWaist(waist);\n\n String hipsString = hipsEditText.getText().toString();\n double hips = (!hipsString.equals(\"\")) ? Double.parseDouble(hipsString) : 0;\n measurement.setHips(hips);\n\n String leftLegString = leftLegEditText.getText().toString();\n double leftLeg = (!leftLegString.equals(\"\")) ? Double.parseDouble(leftLegString) : 0;\n measurement.setLeftLeg(leftLeg);\n\n String rightLegString = rightLegEditText.getText().toString();\n double rightLeg = (!rightLegString.equals(\"\")) ? Double.parseDouble(rightLegString) : 0;\n measurement.setRightLeg(rightLeg);\n\n String leftCalfString = leftCalfEditText.getText().toString();\n double leftCalf = (!leftCalfString.equals(\"\")) ? Double.parseDouble(leftCalfString) : 0;\n measurement.setLeftCalf(leftCalf);\n\n String rightCalfString = rightCalfEditText.getText().toString();\n double rightCalf = (!rightCalfString.equals(\"\")) ? Double.parseDouble(rightCalfString) : 0;\n measurement.setRightCalf(rightCalf);\n\n String weightString = weightEditText.getText().toString();\n double weight = (!weightString.equals(\"\")) ? Double.parseDouble(weightString) : 0;\n measurement.setWeight(weight);\n\n String bodyFatString = bodyFatEditText.getText().toString();\n double bodyFat = (!bodyFatString.equals(\"\")) ? Double.parseDouble(bodyFatString) : 0;\n measurement.setBodyFat(bodyFat);\n\n //below variables are should be retrieved from the Shared Preferences.\n int age = mSharedPreferences.getInt(Constants.AGE, 0);\n measurement.setAge(age);\n boolean male = mSharedPreferences.getBoolean(Constants.SEX, true);\n measurement.setMale(male);\n String activityLevel = mSharedPreferences.getString(Constants.ACTIVITY, \"\");\n\n if(activityLevel.equals(getString(R.string.sedentary))){\n measurement.setActivityLevel(Calculators.SEDENTERAY);\n } else if(activityLevel.equals(getString(R.string.light))){\n measurement.setActivityLevel(Calculators.LIGHT);\n }else if(activityLevel.equals(getString(R.string.moderate))){\n measurement.setActivityLevel(Calculators.MODERATE);\n }else if(activityLevel.equals(getString(R.string.very_active))){\n measurement.setActivityLevel(Calculators.VERY_ACTIVE);\n }else if(activityLevel.equals(getString(R.string.extremely_active))){\n measurement.setActivityLevel(Calculators.EXTREMELY_ACTIVE);\n }\n\n double height = mSharedPreferences.getFloat(Constants.HEIGHT,0);\n measurement.setHeight(height);\n\n //if weight is more than 0 use the Calculators class to calculate the rest of the measurement variables\n if(weight > 0){\n measurement.setRestingEnergyExpenditure(Calculators.getRestingEnergyExpenditure(weight, height, age, male));\n measurement.setTotalDailyEnergyExpenditure(Calculators.getTotalDailyEnergyExpenditure(measurement.getRestingEnergyExpenditure(), measurement.getActivityLevel()));\n measurement.setProteinAmount(Calculators.getProteinAmount(weight));\n measurement.setFatAmount(Calculators.getFatAmount(measurement.getTotalDailyEnergyExpenditure()));\n measurement.setCarbAmount(Calculators.getCarbAmount(measurement.getProteinAmount(), measurement.getFatAmount(), measurement.getTotalDailyEnergyExpenditure()));\n measurement.setBMI(Calculators.getBMI(height, weight, true));\n measurement.setBMICategory(Calculators.getBMICatagory(measurement.getBMI()));\n measurement.setWaistToHeightRatio(Calculators.waistToHeightRatio(waist, height));\n measurement.setWITHCategory(Calculators.getWTHCatagory(measurement.getWaistToHeightRatio(), male));\n }\n return measurement;\n }", "public Map<Integer, MatrixPartitionMeta> getPartMetas() {\r\n return partMetas;\r\n }", "public List<IndicatorUnitSubgroupModel> getIndicators();", "@Updatable\n public Set<MetricDataQueryResource> getMetric() {\n if (metric == null) {\n metric = new HashSet<>();\n }\n\n return metric;\n }", "public ArrayList getSemUnits();", "private ArrayList<Measurement> getMeasurements() {\n ArrayList<Measurement> measurements = new ArrayList<>();\n Cursor cursor = db.getData();\n\n if (cursor.getCount() == 0) {\n Toast.makeText(this, \"Es wurden noch keine Messungen gemacht.\", Toast.LENGTH_SHORT).show();\n } else {\n while (cursor.moveToNext()) {\n int id = cursor.getInt(cursor.getColumnIndex(\"ID\"));\n double pupil1 = cursor.getDouble(cursor.getColumnIndex(\"Pupil1\"));\n double pupil2 = cursor.getDouble(cursor.getColumnIndex(\"Pupil2\"));\n double difference = cursor.getDouble(cursor.getColumnIndex(\"Difference\"));\n String date = cursor.getString(cursor.getColumnIndex(\"Date\"));\n String filepath = cursor.getString(cursor.getColumnIndex(\"Filepath\"));\n\n measurements.add(new Measurement(id, pupil1, pupil2, difference, date, filepath));\n }\n }\n Collections.reverse(measurements);\n return measurements;\n }", "@SuppressWarnings(\"restriction\")\npublic interface Meter {\n\n Collection<? extends Metric<?>> supportedMetrics();\n\n Collection<? extends Measure<?>> measureData(MonitoredVm vm);\n}" ]
[ "0.8256186", "0.8220706", "0.77369344", "0.7520789", "0.65568066", "0.6492008", "0.64353216", "0.63785416", "0.63099533", "0.6252851", "0.6224013", "0.61058694", "0.60474056", "0.60455203", "0.59263134", "0.5905402", "0.5901735", "0.5867111", "0.58165926", "0.57988834", "0.5792329", "0.5760293", "0.5757833", "0.5756205", "0.570655", "0.5697314", "0.5664998", "0.5629394", "0.56221604", "0.5589792", "0.5579715", "0.5570268", "0.5558427", "0.555638", "0.5553303", "0.55439407", "0.5542125", "0.55398875", "0.55337065", "0.5532157", "0.55284524", "0.5518123", "0.5514818", "0.55033153", "0.55033153", "0.54980254", "0.54909366", "0.54870147", "0.5485696", "0.5480896", "0.5446811", "0.54440737", "0.5436769", "0.5429526", "0.5419363", "0.53843194", "0.5379393", "0.5378538", "0.53784287", "0.5356136", "0.53535324", "0.53440106", "0.53314203", "0.531796", "0.5310182", "0.52959496", "0.5294593", "0.52897215", "0.5279181", "0.5270078", "0.5265134", "0.5264423", "0.52479947", "0.5239332", "0.523931", "0.52362335", "0.52303153", "0.5228074", "0.5227692", "0.52156854", "0.52144986", "0.51957464", "0.51957464", "0.5188956", "0.5187643", "0.51860136", "0.5185056", "0.5184517", "0.5184297", "0.51787096", "0.5176555", "0.5167071", "0.51622415", "0.51582783", "0.51579833", "0.51426446", "0.5134635", "0.51296765", "0.5126212", "0.51244724" ]
0.7814511
2
Compute the PV for the specified Market Parameters
public double pv ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqc, final org.drip.param.valuation.ValuationCustomizationParams vcp) throws java.lang.Exception { if (null == valParams || null == csqc) throw new java.lang.Exception ("Stream::pv => Invalid Inputs"); org.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqc.fundingState (fundingLabel()); if (null == dcFunding) throw new java.lang.Exception ("Stream::pv => Invalid Inputs"); int iValueDate = valParams.valueDate(); double dblCumulativeConvexityAdjustedDirtyPV = 0.; for (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) { int iPeriodPayDate = period.payDate(); if (iPeriodPayDate < iValueDate) continue; org.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate, csqc); if (null == cpcm) throw new java.lang.Exception ("Stream::pv => Invalid Inputs"); int iPeriodEndDate = period.endDate(); dblCumulativeConvexityAdjustedDirtyPV += cpcm.dcf() * period.notional (iPeriodEndDate) * period.couponFactor (iPeriodEndDate) * period.fx (csqc) * period.survival (csqc) * period.df (csqc) * cpcm.cumulative() * cpcm.rate(); } return dblCumulativeConvexityAdjustedDirtyPV / dcFunding.df (iValueDate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double couponPV()\n\t{\n\t\treturn _dblCouponPV;\n\t}", "@Test\n public void test_parameterSensitivity() {\n SimplePriceIndexValues test = SimplePriceIndexValues.of(US_CPI_U, VAL_DATE, CURVE_NOFIX, USCPI_TS);\n InflationRateSensitivity point =\n InflationRateSensitivity.of(PriceIndexObservation.of(US_CPI_U, VAL_MONTH.plusMonths(3)), 1d);\n assertThat(test.parameterSensitivity(point).size()).isEqualTo(1);\n }", "public abstract double calcVolume();", "public abstract double calcVolume();", "float getSurfaceVolatility();", "public IPV getPV(){\n return pvMap.get(IPVWidgetModel.PROP_PVNAME);\n }", "BigDecimal getVolume();", "public static PVProperty getPVProperty() {\n return pvProperty;\n }", "@Override\n\tpublic double getvolume(){\n\t\tdouble[] ab_cross_ac = calculate_vcp(getVector_AB(),getVector_AC());\n\t\t\n\t\t//dot product of ab_cross_ac and ad\n\t\tdouble S = calculate_vdp(ab_cross_ac,getVector_AD());\n\t\t\n\t\t//formula of tetrahedron's volume\n\t\treturn Math.abs(S)/6;\t\n\t}", "public abstract double volume();", "@Override\n public double obtenerVolumen(){\n return (1.0 / 3.0) * c.obtenerArea() * c.obtenerAltura();\n }", "public double indexCouponPV()\n\t{\n\t\treturn _dblIndexCouponPV;\n\t}", "@Override\n public PointSensitivityBuilder pvbpSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider) {\n if (paymentPeriod instanceof RatePaymentPeriod) {\n return ratePaymentPeriodPricer.pvbpSensitivity((RatePaymentPeriod) paymentPeriod, provider);\n } else if (paymentPeriod instanceof KnownAmountSwapPaymentPeriod) {\n return knownAmountPaymentPeriodPricer.pvbpSensitivity((KnownAmountSwapPaymentPeriod) paymentPeriod, provider);\n } else {\n throw new IllegalArgumentException(\"Unknown PaymentPeriod type: \" + paymentPeriod.getClass().getSimpleName());\n }\n }", "public abstract float volume();", "double getPValue();", "public IPV getPV(String pvPropId){\n return pvMap.get(pvPropId);\n }", "private void calculateVolume() {\n\n\t\t/*\n\n\t\t */\n\t\tfor(int i=0; i<this._prismoidsLength.size(); i++) \n\t\t\tthis._prismoidsVolumes.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tthis._prismoidsLength.get(i).divide(3)\n\t\t\t\t\t\t\t.times(\n\t\t\t\t\t\t\t\t\tthis._prismoidsSectionsAreas.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t\t\t+ this._prismoidsSectionsAreas.get(i+1).getEstimatedValue()\n\t\t\t\t\t\t\t\t\t+ Math.sqrt(\n\t\t\t\t\t\t\t\t\t\t\tthis._prismoidsSectionsAreas.get(i)\n\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsSectionsAreas.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue()\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t).getEstimatedValue(),\n\t\t\t\t\t\t\tSI.CUBIC_METRE\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\n\t\tfor(int i=0; i<this._prismoidsVolumes.size(); i++)\n\t\t\tthis._fuelVolume = this._fuelVolume\n\t\t\t\t\t\t\t\t\t\t.plus(this._prismoidsVolumes.get(i));\n\t\tthis._fuelVolume = this._fuelVolume.times(2);\n\t\t\n\t}", "@Test\n /**\n * Tests the present value computation.\n */\n public void presentValue() {\n final MultipleCurrencyAmount pv = METHOD.presentValue(FX, CURVES);\n final CurrencyAmount ca1 = CurrencyAmount.of(CUR_1, PAY_1.accept(PVC_IR, CURVES));\n final CurrencyAmount ca2 = CurrencyAmount.of(CUR_2, PAY_2.accept(PVC_IR, CURVES));\n assertEquals(ca1, pv.getCurrencyAmount(CUR_1));\n assertEquals(ca2, pv.getCurrencyAmount(CUR_2));\n }", "public void calcVolume() {\n this.vol = (0.6666666666666667 * Math.PI) * Math.pow(r, 3);\n }", "public interface PVPlant extends ElectricityGenerator {\n\n\t/**\n\t * Total area of the panels.\n\t */\n\tAreaResource panelArea();\n\n\t/**\n\t * Inclination of the modules in degrees. <br>\n\t * 0 : horizontal <br>\n\t * 90 : vertical.\n\t */\n\tAngleResource inclination();\n\n\t/**\n\t * Azimuthal orientation of the modules, from 0° to 360°. <br>\n\t */\n\tGeographicDirectionSensor azimuth();\n\n\t/**\n\t * Change in panel output power per temperature unit. Unit = 1/K. <br>\n\t * Note that this quantity is normally given in %/K instead of 1/K (factor 100 difference!). <br>\n\t * In practice, this value is temperature dependent. TODO\n\t * */\n\tFloatResource temperatureCoefficient();\n\n\t/**\n\t * Nominal Operating Cell Temperature (TNOCT), <br>\n\t * defined as the mean panel cell temperature for an open-rack mounted module in idle operation @ solar irradiance\n\t * of 800 W/m2 on the panel surface, ambient temperature of 20°C, wind speed of 1 m/s.\n\t */\n\tTemperatureResource nominalOperatingCellTemperature();\n\n\t/**\n\t * Solar panel installation type <br>\n\t * 1: roof mount <br>\n\t * 2: free standing <br>\n\t * 3: building integrated PV <br>\n\t * 10: flush mount roof installation (panels have the same orientation as the roof, panels close to roof) <br>\n\t * 11: open-rack roof installation <br>\n\t * 20: open-rack free standing <br>\n\t * 21: pole-mounted free standing\n\t */\n\tIntegerResource installationType();\n\n\t/**\n\t * 1: fixed installation, no tracking <br>\n\t * 2: single-axis tracking: horizontal <br>\n\t * 2: single-axis tracking: vertical <br>\n\t * 3: dual-axis tracking\n\t * */\n\tIntegerResource tracking();\n}", "public int getPesoV() \r\n\t\t{\r\n\t\t\treturn PesoV;\r\n\t\t}", "@Override\n\tpublic void calcularVolume() {\n\t\t\n\t}", "protected double calc_virial_pressure() {\n\t\tint i,j,iTot;\n\t\tdouble dr2,fij,rij,TotFdotR;\n\t\tdouble vp;\n\t\t\n\t\t/* Calculate sum(f.r): */\n\t\tTotFdotR = 0.0; iTot = 0;\n\t\tfor(i=0; i<n; i++) {\n\t\t\tfor(j=0; j<n; j++) {\n\t\t\t\tif ( i != j ) {\n\t\t\t\t\tdr2 = ij_sep2(i,j,c_lat,CUR_POS);\n\t\t\t\t\trij = Math.sqrt(dr2);\n\t\t\t\t\tfij = -12.0*4.0*Math.pow(diameter,12.0)/Math.pow(rij,13.0)\n\t\t\t\t\t+6.0*4.0*Math.pow(diameter,6.0)/Math.pow(rij,7.0);\n\t\t\t\t\tTotFdotR += fij*rij;\n\t\t\t\t\tiTot++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//TotFdotR /= (double)iTot;\n\t\tTotFdotR /= -2.0;\n\t\t\n\t\t/* Calc total virial: */\n\t\tvp = Math.sqrt(2.0)*calc_sys_density()/beta +\n\t\tMath.pow(diameter,3.0)*TotFdotR/(3.0*box[c_lat].x*box[c_lat].y*box[c_lat].z);\n\t\t\n\t\t/* check line */\n\t\t//System.out.printf(\" VPi %f %f %f\\n\",calc_density()/beta, TotFdotR/(3.0*box.x*box.y*box.z),vp);\n\t\t\n\t\treturn(vp);\n\t}", "@Test\n public void presentValueCurveSensitivity() {\n final MultipleCurrencyParameterSensitivity pvpsDepositExact = PSC.calculateSensitivity(CPN_ON_COMPOUNDED, MULTICURVES,\n MULTICURVES.getAllNames());\n final MultipleCurrencyParameterSensitivity pvpsDepositFD = PSC_DSC_FD.calculateSensitivity(CPN_ON_COMPOUNDED, MULTICURVES);\n AssertSensitivityObjects.assertEquals(\"CouponONCompoundedDiscountingMethod: presentValueCurveSensitivity \", pvpsDepositExact,\n pvpsDepositFD, TOLERANCE_PV_DELTA);\n }", "public void setPV(PDAction pv) {\n/* 324 */ this.actions.setItem(\"PV\", (COSObjectable)pv);\n/* */ }", "public static native void OpenMM_AmoebaWcaDispersionForce_getParticleParameters(PointerByReference target, int particleIndex, DoubleByReference radius, DoubleByReference epsilon);", "public abstract double getVolume();", "public void getProjVolume() {\n projVolume = (4/3) * 3.14 * pow(projRadius, 3);\n }", "public double volume () {return (4/3)*Math.PI*this.r*this.r*this.r;}", "@Test public void volumeTest()\n {\n PentagonalPyramid[] pArray = new PentagonalPyramid[100];\n PentagonalPyramid p1 = new PentagonalPyramid(\"PP1\", 1, 2);\n PentagonalPyramid p2 = new PentagonalPyramid(\"PP1\", 2, 3);\n PentagonalPyramid p3 = new PentagonalPyramid(\"PP1\", 3, 4);\n pArray[0] = p1;\n pArray[1] = p2;\n pArray[2] = p3;\n \n PentagonalPyramidList2 pList = new PentagonalPyramidList2(\"ListName\", \n pArray, 3);\n \n Assert.assertEquals(28.67462334314945, pList.totalVolume(), 0.00001);\n Assert.assertEquals(9.558207781049816, pList.averageVolume(), 0.00001);\n \n PentagonalPyramidList2 pList2 = new PentagonalPyramidList2(\"ListName\", \n null, 0);\n Assert.assertEquals(0.0, pList2.averageVolume(), 0.00001);\n \n }", "public void calcularPesos(){\r\n StructursDecisors.weightsDecisors=new ArrayList();\r\n double [][] matrizEigenvectors=createMatriz();\r\n for(int i=0; i<Structurs.names.size();i++)\r\n for(int j=0; j<StructursDecisors.names.size(); j++)\r\n System.out.println(\"MatrizEigenvector[\"+i+\"][\"+j+\"]\"+\"=\"+matrizEigenvectors[i][j]);\r\n double eigenvectorCriterios[]=new double[Structurs.eigenvector.size()];\r\n for(int i=0; i<Structurs.eigenvector.size(); i++)\r\n eigenvectorCriterios[i]=(double) Structurs.eigenvector.get(i);\r\n double []vectorPesos=createArrayPesos(matrizEigenvectors, eigenvectorCriterios);\r\n \r\n }", "public static native void OpenMM_AmoebaVdwForce_getParticleParameters(PointerByReference target, int particleIndex, IntByReference parentIndex, DoubleByReference sigma, DoubleByReference epsilon, DoubleByReference reductionFactor, IntByReference isAlchemical);", "public static Float getPrixTva() {\n return PRIX_TVA;\n }", "public static native void OpenMM_AmoebaWcaDispersionForce_getParticleParameters(PointerByReference target, int particleIndex, DoubleBuffer radius, DoubleBuffer epsilon);", "public static void main(String[] args){\n double precio_producto = 150;\n double iva = 0.13;\n double total = 0;\n \n total= precio_producto * iva;\n System.out.println(\"El iva del producto: $ \"+total);\n \n \n \n }", "public float getVolum() {\n return volum;\n }", "public double getMarketValue()\n {\n return this.totalShares * super.getCurrentPrice();\n }", "@Override\r\n\tpublic double getVET() {\r\n\t\treturn getTMB() * getFatorAtividadeFisica();\r\n\t}", "protected void Initialize (double[] pars) {\n for (int j = 0; j < scalarn; j++) {\n vectorXBeta[j] = 0;\n for (int i = 0; i <= scalarK; i++)\n vectorXBeta[j] += matrixX[j][i] * pars[i];\n }\n\n double y;\n for (int j = 0; j < scalarn; j++) {\n // Yjk, Phijk, Njk\n if (vectorY[j] == scalarM) {\n vectorPhiDiff[j] = 1.0;\n vectorNk[j] = 0.0;\n vectorNYk[j] = 0.0;\n } else {\n if (vectorY[j] == 1)\n y = 0.0 - vectorXBeta[j];\n else\n // pars[scalarK+1] is for mu_2 and\n y = pars[scalarK + vectorY[j] - 1] - vectorXBeta[j];\n vectorPhiDiff[j] = NormalDistribution.CDF (y);\n vectorNk[j] = NormalDistribution.PDF (y);\n vectorNYk[j] = vectorNk[j] * y;\n }\n\n // Yj(k-1), Phij(k-1), Nj(k-1)\n if (vectorY[j] == 1) {\n vectorNk1[j] = 0.0;\n vectorNYk1[j] = 0.0;\n } else {\n if (vectorY[j] == 2)\n y = 0.0 - vectorXBeta[j];\n else\n y = pars[scalarK + vectorY[j] - 2] - vectorXBeta[j];\n vectorPhiDiff[j] = vectorPhiDiff[j] - NormalDistribution.CDF (y);\n vectorNk1[j] = NormalDistribution.PDF (y);\n vectorNYk1[j] = vectorNk1[j] * y;\n }\n }\n }", "@Override\n public double computeProfitUsingRisk() {\n return (getVehiclePerformance() / getVehiclePrice()) * evaluateRisk();\n }", "double volume(){\n\n return widgh*height*depth;\n\n }", "public static native void OpenMM_AmoebaVdwForce_getParticleParameters(PointerByReference target, int particleIndex, IntBuffer parentIndex, DoubleBuffer sigma, DoubleBuffer epsilon, DoubleBuffer reductionFactor, IntBuffer isAlchemical);", "public PDAction getPV() {\n/* 307 */ COSDictionary pv = (COSDictionary)this.actions.getDictionaryObject(\"PV\");\n/* 308 */ PDAction retval = null;\n/* 309 */ if (pv != null)\n/* */ {\n/* 311 */ retval = PDActionFactory.createAction(pv);\n/* */ }\n/* 313 */ return retval;\n/* */ }", "@Test\n public void presentValueMarketSensitivityMethodVsCalculator() {\n final MultipleCurrencyMulticurveSensitivity pvcsMethod = METHOD_CPN_ON.presentValueCurveSensitivity(CPN_ON_COMPOUNDED, MULTICURVES);\n final MultipleCurrencyMulticurveSensitivity pvcsCalculator = CPN_ON_COMPOUNDED.accept(PVCSDC, MULTICURVES);\n AssertSensitivityObjects.assertEquals(\"CouponFixedDiscountingMarketMethod: presentValueMarketSensitivity\", pvcsMethod, pvcsCalculator,\n TOLERANCE_DELTA);\n }", "public double calcVolume(){\n double area=calcArea(); // calcArea of superclass used\r\n return area*h;\r\n }", "public double get_volume(double r) {\n\t\treturn (Math.PI)*r*r*r*2/3;\t\t//dont 2/3*(Math.PI)*r*r*r -> ans 0\n\t}", "double volume(){\n return width*height*depth;\n }", "public abstract void assign(ParameterVector pv) throws SolverException;", "public Boolean isPPV()\n\t{\n\t\treturn ppv;\n\t}", "@Override\n public PointSensitivityBuilder presentValueSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider) {\n if (paymentPeriod instanceof RatePaymentPeriod) {\n return ratePaymentPeriodPricer.presentValueSensitivity((RatePaymentPeriod) paymentPeriod, provider);\n } else if (paymentPeriod instanceof KnownAmountSwapPaymentPeriod) {\n return knownAmountPaymentPeriodPricer.presentValueSensitivity((KnownAmountSwapPaymentPeriod) paymentPeriod, provider);\n } else {\n throw new IllegalArgumentException(\"Unknown PaymentPeriod type: \" + paymentPeriod.getClass().getSimpleName());\n }\n }", "public int volume() {\r\n int xLength = this.getMaximumPoint().getBlockX() - this.getMinimumPoint().getBlockX() + 1;\r\n int yLength = this.getMaximumPoint().getBlockY() - this.getMinimumPoint().getBlockY() + 1;\r\n int zLength = this.getMaximumPoint().getBlockZ() - this.getMinimumPoint().getBlockZ() + 1;\r\n\r\n int volume = xLength * yLength * zLength;\r\n return volume;\r\n }", "public double getCyclinderVolume();", "public double getV() {\r\n\t\treturn v;\t\r\n\t\t}", "public Float getVolume() throws DynamicCallException, ExecutionException {\n return (Float)call(\"getVolume\").get();\n }", "public Vect3 PerpR() {\n\t\treturn new Vect3(y,-x,0);\n\t}", "float dot(IVec3 v);", "public int calcMarketPrice() {\r\n player = Context.getInstance().getPlayer();\r\n //Random r = new Random();\r\n int techLevel = player.getCurrentPlanet().getTechLevel();\r\n Event event = player.getCurrentPlanet().getEvent();\r\n Resource resource = player.getCurrentPlanet().getResource();\r\n double price = basePrice;\r\n price += (ipl * (techLevel - mtlb)) + variance;\r\n if (player.getCurrentPlanet().getTechLevel() == this.ttp) {\r\n price *= Context.TECH_PRICE_MULT;\r\n }\r\n if (event.equals(this.ie)) {\r\n price *= event.getUpMult();\r\n } else if (event.equals(this.de)) {\r\n price *= event.getDownMult();\r\n }\r\n if (resource.equals(this.cr)) {\r\n price *= resource.getDownMult();\r\n } else if (resource.equals(this.er)) {\r\n price *= resource.getUpMult();\r\n }\r\n price *= (((double) player.getTrader() / DFIFTY) + 1.0);\r\n int finalPrice = (int) price;\r\n if (player.getTrader() > 0) {\r\n double discountedPrice = price;\r\n double trader = (double) player.getTrader();\r\n discountedPrice -= (price) * (4.0 * trader / PERCENT);\r\n return (int) discountedPrice;\r\n } else {\r\n return finalPrice;\r\n }\r\n }", "public BigDecimal getPercentageProfitPLimit();", "BigDecimal getVolumeTraded();", "BigDecimal computeBasicRiskPremiumValue(Double coverValue, Double riskValueInNumPerc);", "public void setPercepcion(double param){\n \n this.localPercepcion=param;\n \n\n }", "@Override\n public PointSensitivityBuilder forecastValueSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider) {\n if (paymentPeriod instanceof RatePaymentPeriod) {\n return ratePaymentPeriodPricer.forecastValueSensitivity((RatePaymentPeriod) paymentPeriod, provider);\n } else if (paymentPeriod instanceof KnownAmountSwapPaymentPeriod) {\n return knownAmountPaymentPeriodPricer.forecastValueSensitivity((KnownAmountSwapPaymentPeriod) paymentPeriod, provider);\n } else {\n throw new IllegalArgumentException(\"Unknown PaymentPeriod type: \" + paymentPeriod.getClass().getSimpleName());\n }\n }", "double volume() {\n\t\treturn 0;\n\t}", "double volume() {\n\treturn width*height*depth;\n}", "private int getVol() {\r\n\r\n\t\treturn dayVolume;\r\n\t}", "public double getVolume() { return volume; }", "public BigDecimal getMarketPrice() {\n return marketPrice;\n }", "public static native void OpenMM_AmoebaPiTorsionForce_getPiTorsionParameters(PointerByReference target, int index, IntByReference particle1, IntByReference particle2, IntByReference particle3, IntByReference particle4, IntByReference particle5, IntByReference particle6, DoubleByReference k);", "@Override\n\tpublic float volume() {\n\t\treturn (float) ((4/3) * Math.PI * Math.pow(radius, 3));\n\t}", "@Test\n\tpublic void perpVector3D() {\n\t\tVector3f v1 = new Vector3f(this.random.nextDouble(), this.random.nextDouble(), this.random.nextDouble());\n\t\tVector3f v2 = new Vector3f(this.random.nextDouble(), this.random.nextDouble(), this.random.nextDouble());\n\t\t\n\t\tdouble dotProduct = v1.dot(v2);\n\t\tdouble perpProduct = Math.abs(v1.perp(v2));\n\t\tdouble angle = v1.angle(v2);\n\t\t\n\t\tassertEpsilonEquals(Math.tan(angle),perpProduct/dotProduct);\n\t\t\n\t}", "@Override\n\tpublic double GetValue() {\n\t\tdouble spot = inputs.getSpot();\n\t\tdouble strike = inputs.getStrike();\n\t\tdouble vol = inputs.getVol();\n\t\tint noSteps=inputs.getNoSteps();\n\t\tdouble expiry=inputs.getExpiry();\n\t OptionType type=inputs.getType();\n\t ExerciseType exercise=inputs.getExercise();\n\t InterestRate interestRate=inputs.getR();\n\t\t\n\t double timestep = expiry/noSteps;\n\t double DF = Math.exp(-interestRate.GetRate(1.)*timestep);\n\t double temp1 = Math.exp((interestRate.GetRate(1.) + vol * vol)*timestep);\n\t double temp2 = 0.5 * (DF + temp1);\n\t double up = temp2 + Math.sqrt(temp2*temp2 - 1);\n\t double down = 1/ up;\n\t double probaUp = (Math.exp(interestRate.GetRate(1.) * timestep) - down)/(up -down) ;\n\t double probaDown = 1 - probaUp;\n\n\t //stock price tree\n\t\tstockPrice[0][0]=spot;\n\t for (int n = 1; n <= noSteps; n ++) {\n for (int j = n; j > 0; j--){\n \tstockPrice[j][n] = up * stockPrice[j-1][n-1];\n }\n \t\tstockPrice[0][n] = down * stockPrice[0][n-1];\n }\n\t \n\t //last column set payoffs\n\t\tfor (int j = 0; j <= noSteps; j++) {\n\t\t\t\tif(type.equals(OptionType.CALL)) {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(this.stockPrice[j][noSteps] - strike, .0);\n\t\t\t\t}else {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(strike - this.stockPrice[j][noSteps], .0);\n\t\t\t\t}\n\t\t}\n\n\t\t\n\t //payoff tree in backwardation\n\t \n\t for (int i = noSteps ; i >= 1; i--) {\n for (int j = 0; j <= i-1; j++) {\n\t \tif(exercise.equals(ExerciseType.AMERICAN)) { \n\t //American\t\n\t \t\tif(type.equals(OptionType.CALL)) {\n\t \t\t\t\tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(this.stockPrice[j][i-1] - strike, .0));\n\t \t\t\t\n\t \t\t}else \tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(strike - this.stockPrice[j][i-1] , .0));\n\t \t}else { \n\t \t\t\t//European put and call option\n\t \t\t\t\tpayOff[j][i-1] = DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]);\n\t }\n }\n }\n\t \n\t double deltaUp = (payOff[0][2]-payOff[1][2])/(stockPrice[0][2]-stockPrice[1][2]);\n\t double deltaDown = (payOff[1][2]-payOff[2][2])/(stockPrice[1][2]-stockPrice[2][2]);\n\t delta = (deltaUp + deltaDown) /2;\n\t gamma = (deltaUp-deltaDown)/((stockPrice[0][2]-stockPrice[2][2])/2);\n\t theta = (payOff[1][2]-payOff[0][0])/(365*2*timestep);//time in days\n\t \n\t long rounded = Math.round(payOff[0][0]*10000);\n\t return rounded/10000.0;\n\t}", "public abstract double var (\n\t\tfinal double confidenceLevel)\n\t\tthrows java.lang.Exception;", "public float getVolumeMultiplier();", "public double getStockFinal(long pv) {\n float entree = 0 ;\n float sortie = 0 ;\n\n ArrayList<Produit> produits = null ;\n if (pv==0) produits = produitDAO.getAll();\n else produits = produitDAO.getAllByPv(pv) ;\n\n ArrayList<Mouvement> mouvements = null;\n\n double valeur = 0 ;\n double total = 0 ;\n double quantite = 0 ;\n double cmpu = 0 ;\n double restant = 0 ;\n double qsortie = 0 ;\n double qentree = 0 ;\n // Vente par produit\n Mouvement mouvement = null ;\n Operation operation = null ;\n\n for (int i = 0; i < produits.size(); i++) {\n try {\n mouvements = mouvementDAO.getManyByProductInterval(produits.get(i).getId_externe(),DAOBase.formatter2.parse(datedebut),DAOBase.formatter2.parse(datefin)) ;\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n if (mouvements != null){\n valeur = 0 ;\n quantite = 0 ;\n restant = 0 ;\n qentree = 0 ;\n cmpu = 0 ;\n qsortie = 0 ;\n\n for (int j = 0; j < mouvements.size(); j++) {\n mouvement = mouvements.get(j) ;\n operation = operationDAO.getOne(mouvement.getOperation_id()) ;\n if (operation==null || (operation.getAnnuler()==1 && operation.getDateannulation().before(new Date())) || operation.getTypeOperation_id().startsWith(OperationDAO.CMD)) continue;\n\n //if (pv!=0 && caisseDAO.getOne(operation.getCaisse_id()).getPointVente_id()!=pv) continue;\n if (j==0)\n if (mouvement.getRestant()==mouvement.getQuantite() && mouvement.getEntree()==0){\n restant = 0 ;\n }\n else restant = mouvement.getRestant() ;\n\n if (mouvement.getEntree()==0) {\n valeur -= mouvement.getPrixA() * mouvement.getQuantite() ;\n qentree += mouvement.getQuantite() ;\n cmpu = mouvement.getPrixA() ;\n }\n else {\n valeur += mouvement.getCmup() * mouvement.getQuantite() ;\n qsortie += mouvement.getQuantite() ;\n }\n /*\n if (restant!=0) cmpu = valeur / restant ;\n else cmpu = mouvement.getCmup() ;\n */\n }\n\n quantite = restant + qentree - qsortie ;\n total+=Math.abs(valeur) ;\n }\n }\n\n return total;\n }", "public static native void OpenMM_AmoebaWcaDispersionForce_setParticleParameters(PointerByReference target, int particleIndex, double radius, double epsilon);", "public Integer getPrice(VideoTypeEnum videoTypeId);", "void setIVA(float iva);", "public long getPropertyVolumeUnity();", "public double getPrecioVenta() {\n return precioVenta;\n }", "public void setPesoV(int pesoV) \r\n\t\t{\r\n\t\t\tPesoV = pesoV;\r\n\t\t}", "@ApiModelProperty(value = \"The number of shares exchanged during the trading day on the exchange.\")\n public BigDecimal getVolume() {\n return volume;\n }", "public int vol() {\r\n\t\treturn 3;\r\n\t}", "public double getVolga() {\r\n return volga;\r\n }", "public long getPropertyVolume();", "public abstract double var (\n\t\tfinal int confidenceCount)\n\t\tthrows java.lang.Exception;", "@Override\r\n public double obtenerVolumen() {\n return Math.pow(getA(), 3);//eleva al cubo\r\n }", "public void sample_V() {\n\t\t//Note, sumV and sumVVT are update in the update function itself. Hence, when\n\t\t//sample_V is called after the 1 iteration of all vertices, we already have the sum.\n\t\t\n\t\t//meanV = (SUM V_j)/N\n\t\tRealVector meanV = params.sumV.mapMultiply(1.0/datasetDesc.getNumItems());\n\t\t//meanS = (SUM (V_j*V_j')/N)\n\t\tRealMatrix meanS = params.sumVVT.scalarMultiply(1.0/datasetDesc.getNumItems());\n\t\t\n\t\t//mu0 = (beta0*mu0 + meanV)/(beta0 + N)\n\t\tRealVector mu0_ = (params.mu0_V.mapMultiply(params.beta0_V).add(meanV)).mapDivide((params.beta0_V + datasetDesc.getNumItems()));\n\t\t\n\t\tdouble beta0_ = params.beta0_V + datasetDesc.getNumItems();\n\t\tint nu0_ = params.nu0_V + datasetDesc.getNumItems();\n\t\t\n\t\t//W0 = inv( inv(W0) + N*meanS + (beta0*N/(beta0 + N))(mu0 - meanU)*(mu0 - meanU)'\n\t\tRealVector tmp = params.mu0_V.subtract(meanV);\n\t\tRealMatrix mu0_d_meanV_T = tmp.outerProduct(tmp); \n\t\tmu0_d_meanV_T = mu0_d_meanV_T.scalarMultiply((params.beta0_V*datasetDesc.getNumItems()/(params.beta0_V + datasetDesc.getNumItems())));\n\t\tRealMatrix invW0_ = params.invW0_V.add(params.sumVVT).add(mu0_d_meanV_T);\n\n\t\t//Update all the values.\n\t\tparams.mu0_V = mu0_;\n\t\tparams.beta0_V = beta0_;\n\t\tparams.nu0_V = nu0_;\n\t\tparams.invW0_V = invW0_;\n\t\tparams.W0_V = (new LUDecompositionImpl(invW0_)).getSolver().getInverse();\n\t\t\n\t\t//Sample lambda_V and mu_V from the Gaussian Wishart distribution\n\t\t// http://en.wikipedia.org/wiki/Normal-Wishart_distribution#Generating_normal-Wishart_random_variates\n\t\t//Draw lambda_V from Wishart distribution with scale matrix w0_U.\n\t\tparams.lambda_V = sampleWishart(params.invW0_V, params.nu0_V);\n\t\t//Compute cov = inv(beta0*lambda) \n\t\tRealMatrix cov = (new LUDecompositionImpl(params.lambda_V.scalarMultiply(params.beta0_V))).getSolver().getInverse();\n\t\t//Draw mu_V from multivariate normal dist with mean mu0_V and covariance inv(beta0_V*lambda)\n\t\tMultivariateNormalDistribution dist = new MultivariateNormalDistribution(params.mu0_V.toArray(), \n\t\t\t\tcov.getData());\n\t\tparams.mu_V = new ArrayRealVector(dist.sample());\n\t\t\n\t\t//Reset the sum of latent factors.\n\t\tparams.sumV.mapMultiply(0);\n\t\tparams.sumVVT.scalarMultiply(0);\n\t}", "private double Volume() {\n\t\tdouble volume = (4f / 3f) * Math.PI * Math.pow(_radius, 3);\n\t\treturn volume;\n\t}", "public double getVolume() {\n return super.getLado1() * super.getLado2() * this.altura;\n }", "double calculatePrice(VehicleType vehicleType, Date entryTime, Date exitTime);", "public BigDecimal getPercentageProfitPStd();", "public double calculatePrice(){\r\n\t\treturn getBasePrice()+getBasePrice()*getVat()+(getBasePrice()+getBasePrice()*getVat())*0.3;\r\n\t}", "public float PL() { //negative for a loss and positive for a win.\r\n\t\tif (!isClosed()) {\r\n\t\t\tSystem.err.println(\"Cannot compute PL if trade is on\");\r\n\t\t\treturn -1f;\r\n\t\t}\r\n\t\tif (dir == Direction.SHORT) {\r\n\t\t\treturn (entryPrice - exitPrice) * numberOfShares;\r\n\t\t}\r\n\t\t//Long\r\n\t\treturn (exitPrice - entryPrice) * numberOfShares;\r\n\t}", "public static GenericVolatilitySurfacePeriodParameterMetadata of(\n Period period,\n Strike strike,\n String label) {\n\n return new GenericVolatilitySurfacePeriodParameterMetadata(period, strike, label);\n }", "abstract int estimationParameter1();", "double volume()\n\t{\n\t\t\n\t\treturn width*height*depth;\n\t\t\n\t}", "public java.math.BigDecimal getValTotBolPrecIgSup3uvt() {\n\t\treturn valTotBolPrecIgSup3uvt;\n\t}", "public void calculatePF() {\r\n\t\tfloat pfRate = 10.5f;\r\n\t\tSystem.out.println(\"The PF rate of the employee is \"+pfRate);\r\n\t\tdisplay();\r\n\t}", "public void setVolum(float value) {\n this.volum = value;\n }", "public void setPremAmt(BigDecimal premAmt) {\n\t\tthis.premAmt = premAmt;\n\t}" ]
[ "0.57223845", "0.568636", "0.5402192", "0.5402192", "0.53874844", "0.5357304", "0.5326472", "0.5324077", "0.5302959", "0.5244701", "0.52299964", "0.5186419", "0.5170881", "0.5161554", "0.5157274", "0.5147524", "0.5141194", "0.5128022", "0.5090648", "0.5084561", "0.50800025", "0.5061328", "0.50567806", "0.5050984", "0.5039501", "0.5011353", "0.49664548", "0.4960754", "0.49520195", "0.49484396", "0.49392307", "0.49283907", "0.49242288", "0.49239206", "0.49050632", "0.48910135", "0.48815992", "0.4878624", "0.4873419", "0.48694873", "0.48582342", "0.483647", "0.48280707", "0.48153386", "0.47986412", "0.47959033", "0.4788251", "0.47731724", "0.47536862", "0.47465268", "0.47412997", "0.47323224", "0.47298288", "0.47233552", "0.46989733", "0.4692065", "0.46829918", "0.46780065", "0.46740422", "0.4670419", "0.46690646", "0.46616584", "0.46616185", "0.46543086", "0.46442017", "0.46382317", "0.46298704", "0.46269953", "0.46265602", "0.4622896", "0.4618053", "0.4611314", "0.461025", "0.4609106", "0.46061972", "0.46044025", "0.46041134", "0.46007323", "0.45979208", "0.45978", "0.4593043", "0.45851734", "0.458495", "0.45825493", "0.45825478", "0.45758045", "0.4573456", "0.4566984", "0.4566708", "0.45555487", "0.4550704", "0.4549479", "0.45489568", "0.45477307", "0.45455456", "0.45411915", "0.4539143", "0.45386264", "0.4535664", "0.45342764" ]
0.4783883
47
Generate the State Loading Constraints for the Forward Latent State
public org.drip.state.estimator.PredictorResponseWeightConstraint forwardPRWC ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp, final org.drip.product.calib.ProductQuoteSet pqs) { if (null == valParams || null == pqs) return null; org.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel(); org.drip.state.identifier.ForwardLabel forwardLabel = null != floaterLabel && floaterLabel instanceof org.drip.state.identifier.ForwardLabel ? (org.drip.state.identifier.ForwardLabel) floaterLabel : null; if ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) || (null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet))) return null; int iValueDate = valParams.valueDate(); if (iValueDate >= maturity().julian()) return null; double dblCleanPV = 0.; try { if (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) { org.drip.product.calib.FloatingStreamQuoteSet fsqs = (org.drip.product.calib.FloatingStreamQuoteSet) pqs; if (fsqs.containsPV()) dblCleanPV = fsqs.pv(); } else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) { org.drip.product.calib.FixedStreamQuoteSet fsqs = (org.drip.product.calib.FixedStreamQuoteSet) pqs; if (fsqs.containsPV()) dblCleanPV = fsqs.pv(); } } catch (java.lang.Exception e) { e.printStackTrace(); return null; } org.drip.state.estimator.PredictorResponseWeightConstraint prwc = new org.drip.state.estimator.PredictorResponseWeightConstraint(); for (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) { int iPeriodEndDate = period.endDate(); if (iPeriodEndDate < iValueDate) continue; org.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardPRWC (iValueDate, csqs, pqs); if (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null; } if (!prwc.updateValue (dblCleanPV)) return null; if (!prwc.updateDValueDManifestMeasure ("PV", 1.)) return null; return prwc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\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\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public static void main(String[] args) throws UnsatisfiableConstraintSetException{\n\t\tint order = 1;\n\t\tBidirectionalVariableOrderPrefixIDMap<CharacterToken> statesByIndex = new BidirectionalVariableOrderPrefixIDMap<CharacterToken>(order);\n\t\t\n\t\tfinal CharacterToken cToken = new CharacterToken('C');\n\t\tint cID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(cToken)));\n\t\tfinal CharacterToken dToken = new CharacterToken('D');\n\t\tint dID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(dToken)));\n\t\tfinal CharacterToken eToken = new CharacterToken('E');\n\t\tint eID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(eToken)));\n\t\t\n\t\tMap<Integer, Map<Integer, Double>> transitions = new HashMap<Integer, Map<Integer, Double>>();\n\t\t\n\t\tMap<Integer, Double> priors = new HashMap<Integer, Double>();\n\t\tpriors.put(cID, .5);\n\t\tpriors.put(dID, 1.0/6);\n\t\tpriors.put(eID, 1.0/3);\n\n\t\tfinal HashMap<Integer, Double> transFromC = new HashMap<Integer, Double>();\n\t\ttransFromC.put(cID, .5);\n\t\ttransFromC.put(dID, .25);\n\t\ttransFromC.put(eID, .25);\n\t\ttransitions.put(cID, transFromC);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromD = new HashMap<Integer, Double>();\n\t\ttransFromD.put(cID, .5);\n//\t\ttransFromD.put(dID, 0.);\n\t\ttransFromD.put(eID, .5);\n\t\ttransitions.put(dID, transFromD);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromE = new HashMap<Integer, Double>();\n\t\ttransFromE.put(cID, .5);\n\t\ttransFromE.put(dID, .25);\n\t\ttransFromE.put(eID, .25);\n\t\ttransitions.put(eID, transFromE);\n\t\t\n\t\tSparseVariableOrderMarkovModel<CharacterToken> model = new SparseVariableOrderMarkovModel<CharacterToken>(statesByIndex, priors, transitions);\n\t\t\n\t\tCharacterToken[][] seqs = new CharacterToken[][] {\n\t\t\tnew CharacterToken[]{cToken, cToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, cToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, eToken, dToken}\n\t\t};\n\n\t\tSystem.out.println(\"UNCONSTRAINED:\");\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + model.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + model.generate(4));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"CONSTRAINED:\");\n\t\t\n\t\tint length = 4;\n\t\tList<List<ConditionedConstraint<CharacterToken>>> constraints = new ArrayList<List<ConditionedConstraint<CharacterToken>>>(); \n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tconstraints.add(new ArrayList<ConditionedConstraint<CharacterToken>>());\n\t\t}\n\t\tconstraints.get(3).add(new ConditionedConstraint<>(new CharacterTokenConstraint<CharacterToken>(new CharacterToken('D')),true));\n\t\t\n\t\tSparseVariableOrderNHMMMultiThreaded<CharacterToken> constrainedModel = null;\n\t\ttry {\n\t\t\tconstrainedModel = new SparseVariableOrderNHMMMultiThreaded<CharacterToken>(model, length, constraints);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + constrainedModel.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + constrainedModel.generate(4));\n\t\t}\n\t}", "int nParametricStates();", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\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\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "private static void setUpInit(Map<GdlSentence, ExternalizedStateComponent> components,\n\t\t\tExternalizedStateConstant trueComponent, ExternalizedStateConstant falseComponent) {\n\t\tExternalizedStateProposition initProposition = new ExternalizedStateProposition(GdlPool.getProposition(INIT_CAPS));\n\t\tfor(Entry<GdlSentence, ExternalizedStateComponent> entry : components.entrySet()) {\n\t\t\t//Is this something that will be true?\n\t\t\tif(entry.getValue() == trueComponent) {\n\t\t\t\tif(entry.getKey().getName().equals(INIT)) {\n\t\t\t\t\t//Find the corresponding true sentence\n\t\t\t\t\tGdlSentence trueSentence = GdlPool.getRelation(TRUE, entry.getKey().getBody());\n\t\t\t\t\t//System.out.println(\"True sentence from init: \" + trueSentence);\n\t\t\t\t\tExternalizedStateComponent trueSentenceComponent = components.get(trueSentence);\n\t\t\t\t\tif(trueSentenceComponent.getInputs().isEmpty()) {\n\t\t\t\t\t\t//Case where there is no transition input\n\t\t\t\t\t\t//Add the transition input, connect to init, continue loop\n\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\tExternalizedStateTransition transition = new ExternalizedStateTransition(true);\n\t\t\t\t\t\t//init goes into transition\n\t\t\t\t\t\ttransition.addInput(initProposition);\n\t\t\t\t\t\tinitProposition.addOutput(transition);\n\t\t\t\t\t\t//transition goes into component\n\t\t\t\t\t\ttrueSentenceComponent.addInput(transition);\n\t\t\t\t\t\ttransition.addOutput(trueSentenceComponent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//The transition already exists\n\t\t\t\t\t\tExternalizedStateComponent transition = trueSentenceComponent.getSingleInput();\n\n\t\t\t\t\t\t//We want to add init as a thing that precedes the transition\n\t\t\t\t\t\t//Disconnect existing input\n\t\t\t\t\t\tExternalizedStateComponent input = transition.getSingleInput();\n\t\t\t\t\t\t//input and init go into or, or goes into transition\n\t\t\t\t\t\tinput.removeOutput(transition);\n\t\t\t\t\t\ttransition.removeInput(input);\n\t\t\t\t\t\tList<ExternalizedStateComponent> orInputs = new ArrayList<ExternalizedStateComponent>(2);\n\t\t\t\t\t\torInputs.add(input);\n\t\t\t\t\t\torInputs.add(initProposition);\n\t\t\t\t\t\torify(orInputs, transition, falseComponent);\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\t((ExternalizedStateTransition) transition).setDependingOnInit(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void initTransitions() {\n s0.addTransition(htThr, s1, startStep);\n\n s1.addTransition(htPosPeekThr, s2, null);\n s1.addTransition(ltThr, s4, null);\n\n s2.addTransition(ltNegPeekThr, s3, null);\n\n s3.addTransition(htNegPeekThr, s5, null);\n\n s4.addTransition(ltThr, s0, null);\n s4.addTransition(htThr, s1, null);\n\n s5.addTransition(ltNegPeekThr, s3, null);\n s5.addTransition(htNegThr, s6, endStep);\n\n s6.addTransition(ltThr, s0, null);\n }", "StatePac build();", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "private void generateSteps() {\n for (GlobalState g : this.globalStates) {\n List<String> faults = g.getPendingFaults(); \n if(faults.isEmpty()) {\n // Identifying all available operation transitions (when there \n // are no faults), and adding them as steps\n List<String> gSatisfiableReqs = g.getSatisfiableReqs();\n \n for(Node n : nodes) {\n String nName = n.getName();\n String nState = g.getStateOf(nName);\n List<Transition> nTau = n.getProtocol().getTau().get(nState);\n for(Transition t : nTau) {\n boolean firable = true;\n for(String req : t.getRequirements()) {\n if(!(gSatisfiableReqs.contains(n.getName() + \"/\" + req)))\n firable = false;\n }\n if(firable) {\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, t.getTargetState());\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,t.getOperation(),next));\n }\n }\n }\n } else {\n // Identifying all settling handlers for handling the faults\n // pending in this global state\n for(Node n: nodes) {\n // Computing the \"targetState\" of the settling handler for n\n String targetState = null;\n \n String nName = n.getName();\n String nState = g.getStateOf(nName);\n Map<String,List<String>> nRho = n.getProtocol().getRho();\n \n List<String> nFaults = new ArrayList();\n for(String req : nRho.get(nState)) {\n if(faults.contains(nName + \"/\" + req)) \n nFaults.add(req);\n }\n\n // TODO : Assuming handlers to be complete \n\n if(nFaults.size() > 0) {\n Map<String,List<String>> nPhi = n.getProtocol().getPhi();\n for(String handlingState : nPhi.get(nState)) {\n // Check if handling state is handling all faults\n boolean handles = true;\n for(String req : nRho.get(handlingState)) {\n if(nFaults.contains(req))\n handles = false;\n }\n\n // TODO : Assuming handlers to be race-free\n\n // Updating targetState (if the handlingState is \n // assuming a bigger set of requirements)\n if(handles) {\n if(targetState == null || nRho.get(handlingState).size() > nRho.get(targetState).size())\n targetState = handlingState;\n }\n }\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, targetState);\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,next));\n }\n }\n }\n }\n }", "private String transitionGenerate( String oldguard,String newguard,String markguard,List<Statement> statements, int previousmark,Automaton a,Map<String, Type> b,String pre ,int layer, boolean Else) throws PrismGeneratorException, ValidationException {\n String transition = \"\";\n //The lable of the current statement\n int statlable =0;\n //The lable of the current transition\n int layermark = transitionmark;\n String guard = oldguard;\n if(!newguard.isEmpty()){\n guard += (\" & \" + newguard);\n if(!markguard.isEmpty()){\n guard += ( \" & \" + markguard);\n }\n }\n\n String newpre = \"v\"+pre;\n //The define of the virtual variables used in this level\n String transitionend = pre+\"transitionend\";\n if(layer > maxlayer) {\n\n globalDeclarations += pre+\"transitionend : bool init true;\\n\";\n maxlayer = layer;\n for (Declaration var : a.getLocalVars().getDeclarationList()) {\n assert var instanceof VariableDeclaration;\n Type newtype = null;\n\n if(!(b==null)){\n\n if (b.containsKey(((VariableDeclaration) var).getType().toString())){\n newtype = b.get(((VariableDeclaration) var).getType().toString());\n }else{\n newtype = ((VariableDeclaration) var).getType();\n }\n }else{\n newtype = ((VariableDeclaration) var).getType();\n }\n String strType = typeGenerate(newtype);\n\n for (String name : var.getIdentifiers()) {\n\n switch (strType){\n case \"init\":\n Type inibasetype = ((InitType) newtype).getBaseType();\n String basestrtype = typeGenerate(inibasetype);\n switch (basestrtype){\n case \"int\":\n\n globalDeclarations += (newpre + name + \" : \"+typeGenerate(inibasetype)+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue()) +\";\\n\");\n break;\n case \"[%s..%s]\":\n BoundedIntType boundedtype = (BoundedIntType) inibasetype;\n String upper = boundedtype.getUpperBound().toString();\n String lower = boundedtype.getLowerBound().toString();\n globalDeclarations +=(newpre + name + \":\"+String.format(basestrtype,lower,upper )+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue()) +\";\\n\");\n break;\n case \"bool\":\n globalDeclarations +=(newpre + name + \":\"+strType+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue())+\";\\n\");\n break;\n }\n break;\n case \"int\":\n\n globalDeclarations += (newpre + name + \":\"+strType+\";\\n\");\n break;\n case \"[%s..%s]\":\n BoundedIntType boundedtype = (BoundedIntType) newtype;\n String upper = boundedtype.getUpperBound().toString();\n String lower = boundedtype.getLowerBound().toString();\n globalDeclarations +=(newpre + name + \":\"+String.format(strType,lower, upper)+\";\\n\");\n\n break;\n case \"bool\":\n globalDeclarations +=(newpre + name + \":\"+strType+\";\\n\");\n\n break;\n case \"enum\":\n int i = 0;\n for(String item : ((EnumType)(newtype)).getItems()){\n globalDeclarations +=(newpre + item+String.format(\" : int init %d;\", i)+\"\\n\");\n i++;\n\n }\n globalDeclarations +=(newpre + name+\" : int;\"+\"\\n\");\n\n break;\n case \"list\":\n Type basetype = ((ListType)(newtype)).getBaseType();\n Term key = ((ListType)(newtype)).getCapacity();\n if((!(basetype instanceof IntType))||(!(basetype instanceof BoolType))||(!((key instanceof IntValue)))){\n java.lang.System.err.println(\"The type of the list is not supported.\");\n }\n if((((IntValue)((IntValue) key)).getValue()==0)){\n java.lang.System.err.println(\"The length of the list must greater than 0.\");\n }\n for(int j=0 ; j < (((IntValue)((IntValue) key)).getValue()); j++){\n globalDeclarations +=(newpre + String.format(\"%s%d\",name,j)+\" : int;\\n\");\n\n }\n break;\n }\n }\n }\n }\n\n // assign the virtual variables\n String rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", newpre + var, pre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\", layermark,statlable)+ \" & \" + transitionend +\" = true\"+ \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \"&\"+\"(\"+ transitionend + \"' = false);\"+ \"\\n\");\n ++statlable;\n\n for (Statement s : statements) {\n if (s instanceof SynchronizingStatement) {\n java.lang.System.err.println(\"A sync statement is not supposed to show up when generating codes.\");\n } else if (s instanceof AssignmentStatement) {\n rel = \"\";\n\n rel += virtualtermGenerate(((AssignmentStatement) s).getTarget(), 0,newpre,b) +\"'\"+\n \" = \" + virtualtermGenerate(((AssignmentStatement) s).getExpr(), 0,newpre,b);\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\", layermark,statlable) + \" -> \" + \"(\"+ rel +\")\" +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1);\", layermark,layermark)+ \"\\n\");\n ++statlable;\n\n }else if(s instanceof IteStatement){\n ++transitionmark;\n globalDeclarations += String.format(\"transitionmark%d :int init 0;\\n\", transitionmark);\n String newguard_ = virtualtermGenerate(((IteStatement) s).getCondition(), 0,newpre,b);\n String markguard_ = String.format(\"transitionmark%d=%d\", layermark,statlable);\n List newstatements = ((IteStatement) s).getThenStmts();\n List elstatements = ((IteStatement) s).getElseStmts();\n if(elstatements != null){\n transition += transitionGenerate(guard,newguard_,markguard_,newstatements,layermark,a,b,newpre,layer+1,true);\n ++transitionmark;\n globalDeclarations += String.format(\"transitionmark%d :int init 0;\\n\", transitionmark);\n transition += transitionGenerate(guard,\"!(\"+newguard_+\")\",markguard_,elstatements,layermark,a,b,newpre,layer+1,true);\n ++statlable;\n }else{\n transition += transitionGenerate(guard,newguard_,markguard_,newstatements,layermark,a,b,newpre,layer+1,false);\n ++statlable;\n }\n }\n else {\n throw PrismGeneratorException.UnhandledStatement(s);\n }\n }\n\n\n int max = 0;\n for(Statement s : statements){\n ++max;\n }\n ++max;\n\n\n if(layer > 1){\n //if the IteStatement is not implemented then change the transitionmark to the max\n if(Else == false) {\n transition += (\"[] \" + oldguard + \" & \" + \"!(\" + newguard + \")\" + \" & \" + markguard + \" & \" + String.format(\"transitionmark%d=%d\", layermark, 0) + \" -> \" +\n String.format(\"(transitionmark%d' = %d);\", layermark, max) + \"\\n\");\n }\n // assign the variables\n rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", pre + var, newpre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\",layermark, max) + \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1);\", layermark,layermark)+ \"\\n\");\n ++statlable;\n\n //Prevent label duplication\n transition += (\"[] \" +markguard+ String.format(\" & transitionmark%d=%d\", layermark,max+1) + \" -> \" +\n String.format(\"(transitionmark%d' = transitionmark%d + 1)&\", previousmark,previousmark)+\n String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \"&\"+\"(\"+transitionend+\"' = true)\"+\";\\n\");\n }else{\n\n // assign the variables\n rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", pre + var, newpre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\",layermark, max) + \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \";\\n\");\n ++statlable;\n\n //initialize all the transitionmarks we had used\n rel = \"\";\n for(int i = 0 ; i<=transitionmark;i++){\n rel += String.format(\"(transitionmark%d' = 0)\", i)+\"&\";\n }\n rel = (rel.substring(0,rel.length()-1));\n transition += (\"[] \" + String.format(\"transitionmark%d=%d\", layermark,max+1)+ \" -> \" + rel +\n \"&\"+\"(\"+transitionend+\"' = true)\"+\";\\n\");\n }\n\n return transition;\n }", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "void state_REQState(){\r\n eccState = INDEX_REQState;\r\n alg_REQAlg();\r\n CNF.serviceEvent(this);\r\n state_START();\r\n}", "SpacecraftState getInitialState() throws OrekitException;", "public State(Variable[][] old){\n complete = false;\n int minSize = 6;\n table = new Variable[5][5];\n for (int i=0;i<5;i++){\n for (int j=0;j<5;j++){\n table[i][j] = new Variable(old[i][j]);\n if (table[i][j].domains.size()<minSize&&!table[i][j].visited){\n minSize = table[i][j].domains.size();\n onOperate = table[i][j];\n }\n }\n }\n onOperate.iterator = onOperate.domains.iterator();\n onOperate.visited = true;\n }", "private boolean isFeasibleState(int[] state){\n if((state[0] <= totalMissionaries && state[0] >= 0)&&(state[1] <= totalCannibals && state[1] >= 0)) {\n return true;\n }\n return false;\n }", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "@Test\n\tpublic void test() {\n\t\tRandomVariableDefinition RV_DEF_X = new RandomVariableDefinition(\"DEF_X\", Arrays.asList(\"x0\", \"x1\", \"x2\"));\n\t\tRandomVariableDefinition RV_DEF_Y = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"y0\", \"y1\"));\n\t\tRandomVariableDefinition RV_DEF_Z = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"z0\", \"z1\"));\n\n\t\t///////////////////////////////////\n\t\t// define the local probability models\n\t\tLocalProbabilityModel X = new LocalProbabilityModel(\"X\");\n\t\tLocalProbabilityModel Y = new LocalProbabilityModel(\"Y\");\n\t\tLocalProbabilityModel Z = new LocalProbabilityModel(\"Z\");\n\t\tLocalProbabilityModel X1 = new LocalProbabilityModel(\"X1\");\n\t\tLocalProbabilityModel X2 = new LocalProbabilityModel(\"X2\");\n\t\tLocalProbabilityModel X3 = new LocalProbabilityModel(\"X3\");\n\t\tLocalProbabilityModel X7 = new LocalProbabilityModel(\"X7\");\n\t\t\n\t\t////////////////////////////////\n\t\t// specify target variable type, and dependencies\n\t\t\n\t\t// two a-priori variables - target only, no dependencies\n\t\tX.setTargetAndDependencies(RV_DEF_X, null);\n\t\tY.setTargetAndDependencies(RV_DEF_Y, null);\n\t\t\n\t\t// a LPM conditionally dependent on two variables\n\t\tZ.setTargetAndDependencies(RV_DEF_Z, Arrays.asList(X, Y));\n\n\t\t// a LPM conditionally dependent on several variables of the same type\n\t\tX3.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X1, X2));\n\n\t\t// a LPM conditionally dependent on itself (i.e. a state variable)\n\t\tX7.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X7));\n\n\t\n\t\t// the first has no dependencies just values\n\t\tX.setValue(\"x0\", 0.6);\n\t\tX.setValue(\"x1\", 0.1);\n\t\tX.setValue(\"x2\", 0.1);\n\n\t\t// the second has dependencies\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\n\t\t// the third has a recurrent dependency\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\t\n\t\t\n\t\t\n\t\t/* NOTE - should we enforce that a conditional probability should always be 'set' with requirement that the conditioning variables should all be identified ? */\n\t\t// this would be Z.setValue(\n\t//\tZ.setValue(Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")),\n\t//\t\t\tArrays.asList(\n\t//\t\t\t\t\t\"z0\", 0.5,\n\t//\t\t\t\t\t\"z1\", 0.3,\n\t//\t\t\t\t\t\"z2\", 0.7));\n\n\n\n\t\tString s = Z.toString();\n\t\tSystem.out.println(\"==============\\n\" + s);\n\n\t\tSystem.out.println(\"done\");\n\n\n\t}", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public HashMap<String,ArrayList<Rule_in_State>> get_rules_of_next_state() throws Exception;", "protected void computeInitialTournamentState(int roundNumber) {\n\t\tcomputePresentPleyers();\n\t\tcomputeCurrentResults(roundNumber);\n\t\tcomputeCollorHistory(roundNumber);\n\t\tcomputePartnersHistory(roundNumber);\n\t\tcomputeUpfloatCounts(roundNumber);\n\t\tcomputeDlownFloatCounts(roundNumber);\n\t}", "public void initState() {\n\n\t\tdouble bsc_p = 0.09; // TODO : doit dependre du souffle !?\n\t\tfor (int i=0; i<n; i++) lambda[i] = 0;\n\t\taddBSCnoise(lambda, bsc_p); \n\t\t// lambda: log likelihood ratio\n\t\tcalc_q0(lambda);\n\n\t\t// initialization of beta\n\t\tfor (int i = 0; i <= m - 1; i++) {\n\t\t\tfor (int j = 0; j <= row_weight[i] - 1; j++) {\n\t\t\t\tbeta[i][j] = 0.0;\n\t\t\t}\n\t\t}\t\t\n\n\t}", "public State(Variable[][] old, boolean bool){\n complete = false;\n int minSize = 6;\n table = new Variable[5][5];\n for (int i=0;i<5;i++){\n for (int j=0;j<5;j++){\n table[i][j] = new Variable(old[i][j]);\n if (!table[i][j].visited){\n onOperate = table[i][j];\n }\n }\n }\n onOperate.iterator = onOperate.domains.iterator();\n onOperate.visited = true;\n }", "private void setInitialAndFinalStates() {\n for (int i = 0; i < dfaStates.size(); i++) {\n List<State> currStateList = dfaStates.get(i);\n for (int j = 0; j < currStateList.size(); j++) {\n if (currStateList.get(j).getFinal()) {\n if (!finalStates.contains(dfaStatesWithNumbering.get(currStateList))) {\n finalStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n if (currStateList.get(j).getInitial()) {\n initialStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n }\n }", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "void createRuleStartAndStopATNStates() {\n atn.ruleToStartState = new RuleStartState[g.rules.size()];\n atn.ruleToStopState = new RuleStopState[g.rules.size()];\n for (Rule r : g.rules.values()) {\n RuleStartState start = newState(RuleStartState.class, r.ast);\n RuleStopState stop = newState(RuleStopState.class, r.ast);\n start.stopState = stop;\n start.isLeftRecursiveRule = r instanceof LeftRecursiveRule;\n start.setRuleIndex(r.index);\n stop.setRuleIndex(r.index);\n atn.ruleToStartState[r.index] = start;\n atn.ruleToStopState[r.index] = stop;\n }\n }", "private void initializeMaps(){\n\t\t\n\t\tsteps = new HashMap<Integer, Set<PlanGraphStep>>();\n\t\tfacts = new HashMap<Integer, Set<PlanGraphLiteral>>();\n\t\tinconsistencies = new HashMap<Integer, Set<LPGInconsistency>>();\n\t\t\n\t\tfor(int i = 0; i <= maxLevel; i++) {\n\t\t\tsteps.put(i, new HashSet<PlanGraphStep>());\n\t\t\tfacts.put(i, new HashSet<PlanGraphLiteral>());\n\t\t\tinconsistencies.put(i, new HashSet<LPGInconsistency>());\n\t\t}\n\t\t\n\t\t/* This level holds only the special action end which has the goals as preconditions */\n\t\tsteps.put(maxLevel + 1, new HashSet<PlanGraphStep>());\n\t}", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "@Override\r\n\tpublic void init() {\n\r\n\t PetriNet _net = new PetriNet(this, \"PhilosopherNet\", true, true);\r\n\t ContDistExponential dist1 = new ContDistExponential(this, \"waitdist1\", 2, true, true);\r\n\t ContDistExponential dist2 = new ContDistExponential(this, \"waitdist1\", 3, true, true);\r\n\t ContDistExponential dist3 = new ContDistExponential(this, \"durdist1\", 3, true, true);\r\n\r\n\t\t// Declaration of the used types of Tokens. These have to be objects\r\n\t\t// implementing the TokenType interface. Note that there is only one\r\n\t\t// object for each type, no matter how many Tokens of that type may\r\n\t\t// exist. A different object (even of the same class) always declares a\r\n\t\t// new, different type of token.\r\n\t\t\r\n\t\tTokenType type1 = new Fork();\r\n\t\tTokenType type2 = new Fork();\r\n\t\tTokenType type3 = new Fork();\r\n\t\tTokenType type4 = new Fork();\r\n\t\tTokenType type5 = new Fork();\r\n\t\tMap<TokenType, Integer> tokens = TokenMultiSetTools.arrayToMap(\r\n\t\t\t\tnew TokenType[] { type1, type2, type3, type4, type5 },\r\n\t\t\t\tnew int[] { 1, 1, 1, 1, 1 });\r\n\r\n\t\tPlace p1 = new Place(this, _net, \"p1\", tokens, true, true, true);\r\n\r\n\t\tTransitionMode t1 = new TransitionMode(this, _net, \"t1\", dist1, dist3, true, true);\r\n\t\tTransitionMode t2 = new TransitionMode(this, _net, \"t2\", dist2, dist3, true, true);\r\n\t\tTransitionMode t3 = new TransitionMode(this, _net, \"t3\", dist1, dist3, true, true);\r\n\t\tTransitionMode t4 = new TransitionMode(this, _net, \"t4\", dist2, dist3, true, true);\r\n\t\tTransitionMode t5 = new TransitionMode(this, _net, \"t5\", dist1, dist3, true, true);\r\n\r\n\t\tTransition trans = new Transition(this, _net, \"Mahlzeit\", true, true);\r\n\t\ttrans.addTransitionMode(t1);\r\n\t\ttrans.addTransitionMode(t2);\r\n\t\ttrans.addTransitionMode(t3);\r\n\t\ttrans.addTransitionMode(t4);\r\n\t\ttrans.addTransitionMode(t5);\r\n\r\n\t\tt1.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type1,\r\n\t\t\t\ttype2 }, new int[] { 1, 1 }));\r\n\t\tt1.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type1,\r\n\t\t\t\ttype2 }, new int[] { 1, 1 }));\r\n\r\n\t\tt2.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type2,\r\n\t\t\t\ttype3 }, new int[] { 1, 1 }));\r\n\t\tt2.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type2,\r\n\t\t\t\ttype3 }, new int[] { 1, 1 }));\r\n\r\n\t\tt3.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type3,\r\n\t\t\t\ttype4 }, new int[] { 1, 1 }));\r\n\t\tt3.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type3,\r\n\t\t\t\ttype4 }, new int[] { 1, 1 }));\r\n\r\n\t\tt4.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type4,\r\n\t\t\t\ttype5 }, new int[] { 1, 1 }));\r\n\t\tt4.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type4,\r\n\t\t\t\ttype5 }, new int[] { 1, 1 }));\r\n\r\n\t\tt5.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type5,\r\n\t\t\t\ttype1 }, new int[] { 1, 1 }));\r\n\t\tt5.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type5,\r\n\t\t\t\ttype1 }, new int[] { 1, 1 }));\r\n\r\n\t}", "public static void MCLSPIFB(){\n\t\tMountainCar mcGen = new MountainCar(); // default: reward 100 on the right side and 0 everywhere else\n\t\t\n\t\t\n\t\t// Define terminal function and reward function\t\n\t\tStateConditionTest terminalTest = new StateConditionTest() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean satisfies(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\t\n\t\tTerminalFunction tf = new TerminalFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean isTerminal(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn terminalTest.satisfies(s);\n\t\t\t}\n\t\t};\n\t\t\n\t\tRewardFunction rf = /*new GoalBasedRF(tf, 100, 0);*/\n\t\t\t\tnew RewardFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic double reward(State s1, Action a, State s2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s2.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn 100;\n\t\t\t\t}\n\t\t\t\tif ((Double)s2.get(\"x\") == mcGen.physParams.xmin) {\n\t\t\t\t\treturn -100;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t};\n\t\tmcGen.setRf(rf);\n\t\tSADomain domain = mcGen.generateDomain();\n\t\tSystem.out.println(\"physParams:\\n===========================\");\n\t\tSystem.out.println(\"xmin:\" + mcGen.physParams.xmin + \", xmax:\" + mcGen.physParams.xmax + \", vallypos:\" + mcGen.physParams.valleyPos());\n\t\tSystem.out.println(\"vmin:\" + mcGen.physParams.vmin + \", vmax:\" + mcGen.physParams.vmax);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate data from random state\n\t\tStateGenerator rstateGenerator = new MCRandomStateGenerator(mcGen.physParams);\n\t\tSARSCollector collector = new SARSCollector.UniformRandomSARSCollector(domain);\n\t\tSARSData dataset = collector.collectNInstances(rstateGenerator, domain.getModel(), 5000, 20, null);\n\n\t\t\n\t\tSARS xData = dataset.get(0);\n\t\tMCState xState = (MCState) xData.s;\n\t\tMCState xState2 = (MCState) xData.sp;\n\t\tSystem.out.println(\"s: x:\" + xState.x\n\t\t\t\t+ \", v:\" + xState.v + \n\t\t\t\t\", action:\" + xData.a.actionName() + \n\t\t\t\t\", reward:\" + xData.r);\n\t\tSystem.out.println(\"s': x:\" + xState2.x\n\t\t\t\t+ \", v:\" + xState2.v);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate 5000 SARS tuple instances for our dataset.\n\t\t// Car state generator for no more than 20 steps at a time or until we hit a terminal state.\n\t\t\n\t\t// Generate Fourier Basis\n\t\t// Fourier Basis: mapping from states to features\n\t\tNormalizedVariableFeatures inputFeatures = new NormalizedVariableFeatures()\n\t\t\t\t.variableDomain(\"x\", new VariableDomain(mcGen.physParams.xmin, mcGen.physParams.xmax))\n\t\t\t\t.variableDomain(\"v\", new VariableDomain(mcGen.physParams.vmin, mcGen.physParams.vmax));\n\t\tFourierBasis fBasis = new FourierBasis(inputFeatures, 4); // order(4) means the number of basis functions\n\t\t\n\t\t// Instantiate LSPI\n\t\t// LSPI needs mapping from state to action features, so\n\t\t// first define a state feature representation, \n\t\t// and then construct state-action features by taking the cross product of those features with each action\n\t\tLSPI lspi = new LSPI(domain, 0.99, new DenseCrossProductFeatures(fBasis, 3), dataset); // 3: number of actions: FORWARD, COSTA, BACKWARD\n\t\tPolicy policy = lspi.runPolicyIteration(30, 1e-6);\n\t\t\n\t\t// Visualization\n\t\tMCState laststate = new MCState(mcGen.physParams.valleyPos(), 0);\n\t\tSystem.out.println(\"===========================\\nState process according to policy:\\n\");\n\n\t\t\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tif (terminalTest.satisfies(laststate)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tAction curAction = policy.action(laststate);\n\t\t\tMCModel model = new MCModel(mcGen.physParams);\n\t\t\tMCState curState = (MCState) model.sample(laststate, curAction);\n\t\t\tif (i % 10 == 0) {\n\t\t\t\tSystem.out.println(\"State \" + i +\n\t\t\t\t\t\t\":\\tx = \" + laststate.x + \n\t\t\t\t\t\t\";\\tv = \" + laststate.v + \n\t\t\t\t\t\t\";\\taction = \" + curAction.actionName());\n\t\t\t}\t\t\t\n\t\t\tlaststate = curState;\n\t\t}\n\t\tVisualizer visualizer = MountainCarVisualizer.getVisualizer(mcGen);\n\t\tVisualActionObserver vo = new VisualActionObserver(visualizer);\n\t\tvo.initGUI();\n\t\t\n\t\tSimulatedEnvironment environment = new SimulatedEnvironment(domain, new MCState(mcGen.physParams.valleyPos(), 0));\n\t\tenvironment.addObservers(vo);\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tPolicyUtils.rollout(policy, environment);\n\t\t\tenvironment.resetEnvironment();\n\t\t}\n\t\tSystem.out.println(\"Finished\");\n\t\tSystem.out.println(policy.action(new MCState(0.05, -8)));\n\t}", "public G20ConstraintFunction_h8() {\n }", "public List<String> getSequentialPlan() {\n // ==========================================\n // Computing the (cheapest) sequence of steps\n // ==========================================\n \n // Maps of steps and cost from the global state s to the others\n Map<GlobalState,List<Step>> steps = new HashMap();\n steps.put(current,new ArrayList());\n Map<GlobalState,Integer> costs = new HashMap();\n costs.put(current,0);\n // List of visited states\n List<GlobalState> visited = new ArrayList();\n visited.add(current);\n\n // List of global states still to be visited\n List<GlobalState> toBeVisited = new ArrayList();\n \n // Adding the states reachable from start to \"toBeVisited\"\n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations towards \"next\" \n List<Step> stepSeq = new ArrayList();\n stepSeq.add(step);\n steps.put(next,stepSeq);\n // Adding the cost of the sequence of operation towards \"next\"\n costs.put(next,step.getCost());\n toBeVisited.add(next);\n }\n \n // Exploring the graph of global states by exploiting \"toBeVisited\"\n while(toBeVisited.size() > 0) {\n // Removing the first global state to be visited and marking it\n // as visited\n GlobalState current = toBeVisited.remove(0);\n visited.add(current);\n \n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations from \"start\" to \"next\"\n // (if more convenient)\n int nextCost = costs.get(current) + step.getCost();\n if(visited.contains(next)) {\n // If current path is cheaper, updates \"steps\" and \"costs\"\n if(costs.get(next) > nextCost) {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next,nextCost);\n }\n } else {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next, nextCost);\n if(!(toBeVisited.contains(next))) toBeVisited.add(next);\n }\n }\n }\n \n // ====================================================\n // Computing the sequence of operations from \"s\" to \"t\"\n // ====================================================\n // If no plan is available, return null\n if(steps.get(target) == null) \n return null;\n // Otherwise, return the corresponding sequence of operations\n List<String> opSequence = new ArrayList();\n for(Step step : steps.get(target)) {\n if(!(step.getReason().contains(Step.handling))) {\n opSequence.add(step.getReason());\n }\n }\n return opSequence;\n }", "@Internal\n\tpublic static <T> Map<String, State<T>> migrateGraph(State<T> oldStartState) {\n\t\tState<T> oldFirst = oldStartState;\n\t\tState<T> oldSecond = oldStartState.getStateTransitions().iterator().next().getTargetState();\n\n\t\tStateTransition<T> oldFirstToSecondTake = Iterators.find(\n\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t}\n\n\t\t\t});\n\n\t\tStateTransition<T> oldFirstIgnore = Iterators.find(\n\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.IGNORE;\n\t\t\t\t}\n\n\t\t\t}, null);\n\n\t\tStateTransition<T> oldSecondToThirdTake = Iterators.find(\n\t\t\toldSecond.getStateTransitions().iterator(),\n\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t}\n\n\t\t\t}, null);\n\n\t\tfinal Map<String, State<T>> convertedStates = new HashMap<>();\n\t\tState<T> newSecond;\n\t\tState<T> newFirst = new State<>(oldSecond.getName(), State.StateType.Start);\n\t\tconvertedStates.put(newFirst.getName(), newFirst);\n\t\twhile (oldSecondToThirdTake != null) {\n\n\t\t\tnewSecond = new State<T>(oldSecondToThirdTake.getTargetState().getName(), State.StateType.Normal);\n\t\t\tconvertedStates.put(newSecond.getName(), newSecond);\n\t\t\tnewFirst.addTake(newSecond, oldFirstToSecondTake.getCondition());\n\n\t\t\tif (oldFirstIgnore != null) {\n\t\t\t\tnewFirst.addIgnore(oldFirstIgnore.getCondition());\n\t\t\t}\n\n\t\t\toldFirst = oldSecond;\n\n\t\t\toldFirstToSecondTake = Iterators.find(\n\t\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\toldFirstIgnore = Iterators.find(\n\t\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.IGNORE;\n\t\t\t\t\t}\n\n\t\t\t\t}, null);\n\n\t\t\toldSecond = oldSecondToThirdTake.getTargetState();\n\n\t\t\toldSecondToThirdTake = Iterators.find(\n\t\t\t\toldSecond.getStateTransitions().iterator(),\n\t\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t\t}\n\n\t\t\t\t}, null);\n\n\t\t\tnewFirst = newSecond;\n\t\t}\n\n\t\tfinal State<T> endingState = new State<>(ENDING_STATE_NAME, State.StateType.Final);\n\n\t\tnewFirst.addTake(endingState, oldFirstToSecondTake.getCondition());\n\n\t\tif (oldFirstIgnore != null) {\n\t\t\tnewFirst.addIgnore(oldFirstIgnore.getCondition());\n\t\t}\n\n\t\tconvertedStates.put(endingState.getName(), endingState);\n\n\t\treturn convertedStates;\n\t}", "T transformToAndValidateInitialState(VendingMachine vendingMachine);", "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "public ConvergenceInputModelState()\n {\n this.inputModelReady = false;\n this.systemUpdated = false;\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18656, \"facing=north\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18657, \"facing=north\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18658, \"facing=south\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18659, \"facing=south\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18660, \"facing=west\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18661, \"facing=west\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18662, \"facing=east\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18663, \"facing=east\", \"waterlogged=false\"));\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void translate(){\n\t\tnodeSigs();\n\t\tedgeSigs();\n\t\tpre_source_valid();\n\t\tList<Object> constraints = new ArrayList<Object>();\n\t\tconstraints.addAll(hash.keySet());\n\t\tfor (int i = 0; i < constraints.size() ; i++) {\n\t\t\tfor (int j = i + 1; j < constraints.size() ; j++) {\n\t\t\t\tObject iter = constraints.get(i), iter1 = constraints.get(j);\n\t\t\t\tObject[] overlap = findOverlap(iter, iter1);\n\t\t\t\tif(overlap == null) continue;\n\t\t\t\talloycommands.add(new Object[]{iter, iter1});\n\t\t\t\tbuffer.append(\"run{(\" + hash.get(iter) + \"[] and not \" + hash.get(iter1) + \"[]) or (not \" + hash.get(iter) + \"[] and \" + hash.get(iter1) + \"[])} for 0 but \");\n\t\t\t\tList<Node> nodes = (List<Node>) overlap[0];\n\t\t\t\tList<Arrow> edges = (List<Arrow>) overlap[1];\n\t\t\t\tList<String> strings = new ArrayList<String>();\n\t\t\t\tfor(Node in : nodes){\n\t\t\t\t\tstrings.add(nodeSig(in));\n\t\t\t\t}\n\t\t\t\tfor(Arrow ie : edges){\n\t\t\t\t\tstrings.add(edgeSig(ie));\n\t\t\t\t}\n\t\t\t\tbuffer.append(\"5 \" + strings.get(0));\n\t\t\t\tfor (int k = 1; k < strings.size(); k++) {\n\t\t\t\t\tbuffer.append(\", 5 \" + strings.get(k));\n\t\t\t\t}\n\t\t\t\tbuffer.append(LINE);\n\t\t\t}\n\t\t}\n//\t\tif(check == null)\n//\t\t\tbuffer.append(\"run {}\");\n//\t\telse\n//\t\t\ttranslate(check, \"check\");\n//\t\tbuffer.append(\" for 5\");\n\t\t\t\n\t}", "private void loadRandomState() {\n patternName = \"Random\";\n\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n\n generations = 0;\n }", "public void buildModel() {\n double loss_pre = Double.MAX_VALUE;\n for (int iter = 0; iter < maxIter; iter ++) {\n Long start = System.currentTimeMillis();\n if (showProgress)\n System.out.println(\"Iteration \"+(iter+1)+\" started\");\n // Update user latent vectors\n IntStream.range(0,userCount).parallel().peek(i->update_user(i)).forEach(j->{});\n /*\n for (int u = 0; u < userCount; u ++) {\n update_user(u);\n }\n */\n if (showProgress) {\n System.out.println(\"Users updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n IntStream.range(0,itemCount).parallel().peek(i->update_item(i)).forEach(j->{});\n // Update item latent vectors\n /*\n for (int i = 0; i < itemCount; i ++) {\n update_item(i);\n }\n */\n if (showProgress) {\n System.out.println(\"Items updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n // Show loss\n if (showLoss)\n loss_pre = showLoss(iter, start, loss_pre);\n\n\n } // end for iter\n\n }", "private AutomatonFromTable automatonFromTable() {\n \tAutomatonFromTable hypothesis = new AutomatonFromTable(inputs);\n\t\t/*\n\t\t * Number of new states in the hypothesis is the \n\t\t * number of distinct rows in the upper half of the observation table\n\t\t */\n\t\tint noOfNewStates = -1;\n\t\tList<List<String>> distinctStates = new ArrayList<>();\n\t\tIterator<Entry<String, List<String>>> it = observationTableUpper.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tdistinctStates.add(entry.getValue());\n\t\t}\n\t\tnoOfNewStates = new HashSet<>(distinctStates).size();\n\t\t//Adding those many number of states\n\t\tfor(int i=0;i<noOfNewStates;i++){\n\t\t\tif(i==0){\n\t\t\t\thypothesis.addInitialState();\n\t\t\t}else{\n\t\t\t\thypothesis.addState();\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"No.of new states \"+noOfNewStates);\n\t\t\n\t\t\n\t\tList<Transition> prefixStateMap = new ArrayList<>();\n\t\t\n\t\t//Adding the transitions for those states\n\t\tit = observationTableUpper.entrySet().iterator();\n\t\tSystem.out.println(\"Upper table size \"+observationTableUpper);\n\t\tint currentMaxState = 0;\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tString prefix = entry.getKey();\n\t\t\tList<String> results = entry.getValue();\n\t\t\tint currentState = getCurrentState(prefix, prefixStateMap);\n\t\t\tSystem.out.println(\"Current State \"+currentState);\n\t\t\tint nextState;\n\t\t\tif(prefix.contains(\"<>\")){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else if((nextState = checkErrorState(prefix, prefixStateMap))!=-1){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tif(!results.get(i+1).equals(\"-\")){\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Check for two start calls and make sure they end up on the same state.\n\t\t\t\t\t\t * This is Media Player specific and might need to be changed \n\t\t\t\t\t\t * add for conditional checks for other examples. \n\t\t\t\t\t\t * For Android Media Player, calling start after the first call to start\n\t\t\t\t\t\t * doesn't lead to a transition to a new state. So that needs to be specifically handled.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tboolean exceptionCase = false;\n\t\t\t\t\t\tif(prefix.contains(\"$\")){\n\t\t\t\t\t\t\tint lastIndex = prefix.lastIndexOf(\"$\");\n\t\t\t\t\t\t\tString lastCall = prefix.substring(lastIndex+1, prefix.length()-1);\n\t\t\t\t\t\t\tif(lastCall.contains(\"start()\") && results.get(i).contains(\"start()\")){\n\t\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t\t\texceptionCase = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}if(!exceptionCase){\n\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Add all the final transitions to the automaton object\n\t\t */\n\t\tfor(Transition transition: prefixStateMap){\n\t\t\thypothesis.addTransition(transition);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Populate the Tree representation of the Automaton by doing a breadth-first search\n\t\t */\n\t\tint i = 0;\n\t\twhile(i<hypothesis.getNumberStates()){\n\t\t\tList<Transition> successorDetails = new ArrayList<>();\n\t\t\tfor(Transition transition: prefixStateMap){\n\t\t\t\tint startState = transition.getCurrentState();\n\t\t\t\tif(startState==i){\n\t\t\t\t\tsuccessorDetails.add(transition);\n\t\t\t\t\tautomatonTree.put(startState, successorDetails);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(automatonTree);\n\t\treturn hypothesis;\n\t}", "private void initProbs(final double recombinationProb, final double errorProb) {\n\n initialProbs = new EnumMap<>(IBDState.class);\n initialProbs.put(IBDState.ZERO, Math.log10(.33));\n initialProbs.put(IBDState.ONE, Math.log10(.33));\n initialProbs.put(IBDState.TWO, Math.log10(.33));\n\n transitionProbs = new EnumMap<>(IBDState.class);\n transitionProbs.put(IBDState.ZERO, new Double[]{Math.log10((1 - recombinationProb) - (errorProb / 2)), Math.log10(recombinationProb - (errorProb / 2)), Math.log10(errorProb)});\n transitionProbs.put(IBDState.ONE, new Double[]{Math.log10((recombinationProb / 2)), Math.log10(1 - recombinationProb), Math.log10(recombinationProb / 2)});\n transitionProbs.put(IBDState.TWO, new Double[]{Math.log10(errorProb), Math.log10(recombinationProb - (errorProb / 2)), Math.log10((1 - recombinationProb) - (errorProb / 2))});\n }", "BGPv4FSMState state();", "@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 }", "private void setupDFA() {\r\n\t\tcurrentState = 0;\r\n\t\tif (actor.getScheduleFSM() == null) {\r\n\t\t\t// generate trivial DFA in case there is no schedule fsm.\r\n\t\t\t// 1. only one state\r\n\t\t\t// 2. all actions are eligible\r\n\t\t\t// 3. the successor state is always the same\r\n\t\t\teligibleActions = new Action [][] {actions};\r\n\t\t\tsuccessorState = new int [1] [actions.length];\r\n\t\t\tfor (int i = 0; i < actions.length; i++) {\r\n\t\t\t\tsuccessorState[0][i] = 0;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSet stateSets = new HashSet();\r\n\t\t// put initial state into set of state sets\r\n\t\tSet initialState = Collections.singleton(actor.getScheduleFSM().getInitialState());\r\n\t\tstateSets.add(initialState);\r\n\t\tint previousSize = 0;\r\n\t\t// iterate until fixed-point, i.e. we cannot reach any new state set\r\n\t\twhile (previousSize != stateSets.size()) {\r\n\t\t\tpreviousSize = stateSets.size();\r\n\t\t\t// for each action...\r\n\t\t\tfor (int i = 0; i < actions.length; i ++) {\r\n\t\t\t\tSet nextStates = new HashSet();\r\n\t\t\t\t// ... compute the set of states that can be reached through it... \r\n\t\t\t\tfor (Iterator j = stateSets.iterator(); j.hasNext(); ) {\r\n\t\t\t\t\tSet s = (Set) j.next();\r\n\t\t\t\t\tif (isEligibleAction(s, actions[i])) {\r\n\t\t\t\t\t\tnextStates.add(computeNextStateSet(s, actions[i]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add them to the state set\r\n\t\t\t\tstateSets.addAll(nextStates);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// The set of all reachable state sets is the state space of the NDA. \r\n\t\tndaStateSets = (Set []) new ArrayList(stateSets).toArray(new Set[stateSets.size()]);\r\n\t\t// Make sure the initial state is state 0.\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tif (ndaStateSets[i].equals(initialState)) {\r\n\t\t\t\tSet s = ndaStateSets[i];\r\n\t\t\t\tndaStateSets[i] = ndaStateSets[0];\r\n\t\t\t\tndaStateSets[0] = s;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\teligibleActions = new Action [ndaStateSets.length] [];\r\n\t\tsuccessorState = new int [ndaStateSets.length] [];\r\n\t\t// For each state set (i.e. each NDA state), identify the eligible actions,\r\n\t\t// and also the successor state set (i.e. the successor state in the NDA).\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tList ea = new ArrayList();\r\n\t\t\tList ss = new ArrayList();\r\n\t\t\tfor (int j = 0; j < actions.length; j++) {\r\n\t\t\t\tif (isEligibleAction(ndaStateSets[i], actions[j])) {\r\n\t\t\t\t\tea.add(actions[j]);\r\n\t\t\t\t\tss.add(computeNextStateSet(ndaStateSets[i], actions[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\teligibleActions[i] = (Action []) ea.toArray(new Action[ea.size()]);\r\n\t\t\tList ds = Arrays.asList(ndaStateSets); // so we can use List.indexOf()\r\n\t\t\tsuccessorState[i] = new int [ss.size()];\r\n\t\t\t// locta the NDA successor state in array\r\n\t\t\tfor (int j = 0; j < ss.size(); j++) {\r\n\t\t\t\tsuccessorState[i][j] = ds.indexOf(ss.get(j));\r\n\t\t\t\t\r\n\t\t\t\t// must be in array, because we iterated until reaching a fixed point.\r\n\t\t\t\tassert successorState[i][j] >= 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5568, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5569, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5570, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5571, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5572, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5573, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5574, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5575, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5576, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5577, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5578, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5579, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5580, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5581, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5582, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5583, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5584, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5585, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5586, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5587, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5588, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5589, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5590, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5591, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5592, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5593, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5594, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5595, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5596, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5597, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5598, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5599, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5600, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5601, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5602, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5603, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5604, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5605, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5606, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5607, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5608, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5609, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5610, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5611, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5612, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5613, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5614, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5615, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5616, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5617, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5618, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5619, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5620, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5621, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5622, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5623, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5624, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5625, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5626, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5627, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5628, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5629, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5630, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5631, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5632, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5633, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5634, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5635, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5636, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5637, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5638, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5639, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5640, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5641, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5642, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5643, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5644, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5645, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5646, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5647, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n }", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "SXEstimate(Pcfg grammar) {\n super(grammar);\n this.outsideCache = new Long2DoubleOpenHashMap();\n this.insideCache = new Long2DoubleOpenHashMap();\n }", "private void initializeSingleSource(Graph<V> G, Integer s) {\n for (int v = 0; v < G.getVertexCount(); v++) {\n G.getVertex(v).setEstimate(1.0f / 0.0f); // Infinity\n G.getVertex(v).setPredecessor(null);\n }\n G.getVertex(s).setEstimate(0);\n }", "protected abstract void attemptFeasibleInitialization(Solution solution);", "public TemporalState getSetTemporalState(TemporalState ts, TemporalState last_state, FSA lts, Statement statement, ArrayList<Statement> s,HashSet<TemporalState> initial_states, HashSet<TemporalState> final_states){\n\t\t\tTemporalStateNode node=getSetTemporalStateNode(s);\n\t\t\tTemporalState state=null;\n\t\t\t \n\t\t\t \n\t\t\tboolean fusion=false;\n\t\t\tboolean blem=false;\n\t\t\tfor(TemporalState temp:node.states){\n\t\t\t\tboolean ok=false;\n\t\t\t\tif (mode>=0){\n\t\t\t\t\tif (temp.checkConstraintsCompatibility(ts)){\n\t\t\t\t\t\tok=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (mode==-2){\n\t\t\t\t\t\tok=temp.exactLoChecking(ts,last_state,lts,statement,initial_states,final_states);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tok=temp.approxLoChecking(ts,last_state,lts,statement);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(statement);\n\t\t\t\t//temp.display(false);\n\t\t\t\t//ts.display(false);\n\t\t\t\t\n\t\t\t\tif (ok){\n\t\t\t\t\tstate=temp;\n\t\t\t\t\tfusion=true;\n\t\t\t\t\t//System.out.println(\"fusion \"+ts+\" avec \"+temp);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"pas de fusion de \"+ts+\" avec \"+temp);\n\t\t\t\t\t//System.out.println(\"pas fusion\");\n\t\t\t\t\tblem=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!fusion){\n\t\t\t\tstate=new TemporalState(ts.requiredPast,ts.requiredFuture,ts.ensuredPast,ts.ensuredFuture,ts.past,ts.future);\n\t\t\t\t/*state.beganFutureSequences=ts.beganFutureSequences;\n\t\t\t\tstate.beganPastSequences=ts.beganPastSequences;\n\t\t\t\tstate.forbidenFuture=ts.forbidenFuture;\n\t\t\t\tstate.forbidenPast=ts.forbidenPast;*/\n\t\t\t\tnode.states.add(state);\n\t\t\t\tlts.addState(state);\n\t\t\t}\n\t\t\t\n\t\t\tif (last_state!=null){\n\t\t\t\tTransition tr=new Transition(last_state,statement,state);\n\t\t\t\tlts.addTransition(tr);\n\t\t\t}\n\t\t\t\n\t\t\tif (mode>=0){\n\t\t\t\tif(updateMode==0){\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> requiredFuture=TemporalState.union(state.requiredFuture,ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> past=TemporalState.intersect(state.past,ts.past);\n\t\t\t\t\tHashSet<Sequence> future=TemporalState.intersect(state.future,ts.future);\n\t\t\t\t\tHashSet<Sequence> lrequiredPast=TemporalState.copy(requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\tlrequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(lrequiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tstate.updateRequiredPast(requiredPast);\n\t\t\t\t\tstate.updateRequiredFuture(requiredFuture);\n\t\t\t\t\tstate.updateFuture(future);\n\t\t\t\t\tstate.updatePast(past);\n\t\t\t\t\n\t\t\t\t\tts.updatePast(past);\n\t\t\t\t\tts.updateRequiredFuture(requiredFuture);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\trequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(requiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tHashSet<Sequence> srp=TemporalState.copy(state.requiredPast);\n\t\t\t\t\tHashSet<Sequence> srf=TemporalState.copy(state.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> sp=TemporalState.copy(state.past);\n\t\t\t\t\tHashSet<Sequence> sf=TemporalState.copy(state.future);\n\t\t\t\t\tHashSet<Sequence> trp=TemporalState.copy(ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> trf=TemporalState.copy(ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> tp=TemporalState.copy(ts.past);\n\t\t\t\t\tHashSet<Sequence> tf=TemporalState.copy(ts.future);\n\t\t\t\t\t\n\t\t\t\t\tstate.updateRequiredPast(TemporalState.firstMinusSecond(trp,srp),1);\n\t\t\t\t\tstate.updateRequiredFuture(TemporalState.firstMinusSecond(trf,srf),1);\n\t\t\t\t\tstate.updatePast(TemporalState.firstMinusSecond(sp,tp),1);\n\t\t\t\t\tstate.updateFuture(TemporalState.firstMinusSecond(sf,tf),1);\n\t\t\t\t\t\n\t\t\t\t\tts.updateRequiredFuture(TemporalState.firstMinusSecond(srf,trf),1);\n\t\t\t\t\tts.updatePast(TemporalState.firstMinusSecond(tp,sp),1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t/*if (NewTemporalState.mode>=0){\n\t\t\t\t\n\t\t\t}*/\n\t\t\t/*else{\n\t\t\t\tSystem.out.println(\"Ensure ok\");\n\t\t\t}*/\n\t\t\t//\n\t\t\t//System.out.println(\"fin\"+lts.getStates().size());\n\t\t\t/*if (blem){\n\t\t\t\tGenerateDOT.printDot(lts, \"a.dot\");\n\t\t\t\tReader reader = new InputStreamReader(System.in);\n\t\t\t\tBufferedReader input = new BufferedReader(reader);\n\t\t\t\tSystem.out.print(\"tapez touche pour continuer\");\n\t\t\t\ttry{\n\t\t\t\t\tString ok = input.readLine();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e){System.out.println(e);}\n\t\t\t}*/\n\t\t\t\n\t\t\treturn(state);\n\t\t}", "public void InitializeConstraints(boundkey[] bkc, double[] blc, NodesVector nvector, PipesVector pvector,\n\t\t\tTapsVector tvector, double outflow, double PrixMax, double lcom) {\n\t\tNodes nodes;\n\t\tPipes pipes;\n\t\tTaps taps;\n\n\t\t/* Contraintes sur les Nodes - taps */\n\t\tfor (int i = 0; i < (NbNodes - NbTaps - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\tCste[i] = -nodes.height;\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les Taps */\n\t\tfor (int i = NbNodes - NbTaps - 1; i < (NbNodes - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\ttaps = (Taps) tvector.elementAt(i - (NbNodes - NbTaps - 1));\n\n\t\t\tif (taps.orifice == Orifices.MAXDIAM) {\n\t\t\t\tCste[i] = -nodes.height - ((outflow * outflow) / taps.faucetCoef);\n\t\t\t} else {\n\t\t\t\tCste[i] = (-nodes.height\n\t\t\t\t\t\t- (outflow * outflow * ((1 / taps.faucetCoef) + Math.pow(CoefOrif / taps.orifice, 4))));\n\t\t\t}\n\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les longueurs des Pipes */\n\t\tfor (int i = NbNodes - 1; i < (m - 1); i++) {\n\t\t\tpipes = (Pipes) pvector.elementAt(i - NbNodes + 1);\n\n\t\t\tCste[i] = pipes.length;\n\n\t\t\tbkc[i] = mosek.boundkey.fx;\n\t\t\tblc[i] = Cste[i];\n\t\t}\n\n\t\t/* contrainte de prix max */\n\t\tCste[m - 1] = PrixMax;\n\t\tbkc[m - 1] = mosek.boundkey.up;\n\t\tblc[m - 1] = -1.0e30;\n\t}", "State(Main aMain) {\n\tmain = aMain;\n\tback = Integer.parseInt(main.myProps.getProperty(\"yesterdays\"));\n\tfront = Integer.parseInt(main.myProps.getProperty(\"tomorrows\"));\n\tmaps = new Hashtable();\n availWeath = new Hashtable();\n\n main.myFrw.listen(new MapListener(), ScaledMap.TYPE, null);\n main.myFrw.announce(this);\n stateDoc = Framework.parse(main.myPath + \"state.xml\", \"state\");\n availWeath = loadFromDoc();\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15071, \"face=floor\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15072, \"face=floor\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15073, \"face=floor\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15074, \"face=floor\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15075, \"face=wall\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15076, \"face=wall\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15077, \"face=wall\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15078, \"face=wall\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15079, \"face=ceiling\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15080, \"face=ceiling\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15081, \"face=ceiling\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15082, \"face=ceiling\", \"facing=east\"));\n }", "public void trainingPreprocessing() {\n neuralNetAndDataSet = new NeuralNetAndDataSet(neuralNetwork, trainingSet);\n trainingController = new TrainingController(neuralNetAndDataSet);\n neuralNetwork.getLearningRule().addListener(this);\n trainingController.setLmsParams(0.7, 0.01, 0);\n LMS learningRule = (LMS) this.neuralNetAndDataSet.getNetwork().getLearningRule();\n if (learningRule instanceof MomentumBackpropagation) {\n ((MomentumBackpropagation) learningRule).setMomentum(0.2);\n }\n }", "IfaceState createState(int nlocal,IfaceSafetyStatus sts);", "<C, S> StateExp<C, S> createStateExp();", "public TStateTable () {\r\n\t m_users = new TIDIndex();\r\n\t m_resources = new TIDIndex();\r\n\t m_associations = new TUseStatus[INITIAL_MAX_RESOURCES_COUNT][INITIAL_MAX_USERS_COUNT];\r\n\t for (int a=0; a<INITIAL_MAX_RESOURCES_COUNT; a++)\r\n\t for (int b=0; b<INITIAL_MAX_USERS_COUNT; b++)\r\n\t m_associations[a][b] = null;\r\n\t m_current_max_users = INITIAL_MAX_USERS_COUNT;\r\n\t m_current_max_resources = INITIAL_MAX_RESOURCES_COUNT;\r\n\t m_current_users_count = 0;\r\n\t m_current_resources_count = 0;\r\n }", "public void preCalculateCollisions(){\n for(int i = 0; i < ALL_POSSIBLE_STATES.length; i++){\n collisions[i] = new StateMapEntry();\n collisions[i].incomingState = ALL_POSSIBLE_STATES[i];\n collisions[i].resultingState = calculateAllPossibleOutboundStates(ALL_POSSIBLE_STATES[i], ALL_POSSIBLE_STATES);\n //collisions[i].print();\n }\n }", "public Graph calculateEnforcedGraph(Vector2 robotTarget) {\n\n Graph g = this.clone();\n // Clear enforce values of all states.\n for (State s : g.states) {\n s.enforceValue = -1;\n }\n\n List<State> targetStates = g.findStatesForRobotPosition(robotTarget);\n System.out.println(robotTarget);\n\n // Set enforce value to 0 for targetstates.\n for (State s : targetStates)\n s.enforceValue = 0;\n\n // Go from here and calculate more enforce values for 1-acceptance\n Queue<State> calcStack = new LinkedBlockingQueue<>(targetStates);\n\n while (!calcStack.isEmpty()) {\n State enfI = calcStack.poll();\n //if (enfI.equals(initialState)) continue;\n\n List<Transition> transitionsTo = g.getTransitionsTo(enfI);\n for (Transition t : transitionsTo) {\n State enfIP1 = t.from;\n if (enfIP1.isRobotState) {\n // At least one transition is enough for this\n if (enfIP1.enforceValue == -1) {\n enfIP1.enforceValue = enfI.enforceValue + 1;\n calcStack.add(enfIP1);\n }\n } else {\n List<Transition> fromTransitions = g.getTransitionsFrom(enfIP1);\n // All transitions from this eumel have to lead into a lower value enforce.\n int enforceValue = enfI.enforceValue + 1;\n boolean enforceable = true;\n for (Transition trans : fromTransitions) {\n if (trans.to.enforceValue == -1 || trans.to.enforceValue >= enforceValue)\n enforceable = false;\n }\n\n if (enforceable && enfIP1.enforceValue == -1) {\n enfIP1.enforceValue = enforceValue;\n calcStack.add(enfIP1);\n }\n }\n }\n }\n\n\n // Now let's calculate Enforce+\n boolean statesChanged = true;\n while (statesChanged) {\n statesChanged = false;\n\n for (State s : g.states.stream().filter(s -> s.enforceValue == -1).collect(Collectors.toList())) {\n // Find the states from which we can enforce a step to Enforce in 1\n if (s.isRobotState) {\n // We need at least one Transitions which leads into enforce. We will then choose the lowest of it.\n List<Transition> transitions = g.getTransitionsFrom(s);\n Optional<Transition> cheapestTransition = transitions.stream().filter(t -> t.to.enforceValue != -1).min(Comparator.comparingInt(o -> o.to.enforceValue));\n if (cheapestTransition.isPresent()) {\n // We found a way into enforce. We can now set an enforce value on this!\n System.out.println(\"Renf+\");\n statesChanged = true;\n s.enforceValue = cheapestTransition.get().to.enforceValue + 1;\n }\n } else {\n // All the transitions coming from this have to lead into enforce. Let's check.\n List<Transition> transitions = g.getTransitionsFrom(s);\n boolean leadsToEnforce = transitions.stream().noneMatch(t -> t.to.enforceValue == -1);\n if (leadsToEnforce) {\n\n Optional<Integer> newEnforce = transitions.stream().map((transition) -> transition.to.enforceValue).max(Comparator.comparingInt(o -> o));\n if(newEnforce.isPresent()) {\n s.enforceValue = newEnforce.get() + 1;\n System.out.println(\"Cenf+\");\n statesChanged = true;\n }\n }\n }\n }\n\n }\n\n // Eliminate Transitions for Buechi-Acceptance\n\n /*List<State> unreachableStates = new ArrayList<>();\n\n // Remove all states with an enforce value of -1, as the cannot be reached\n Iterator<State> it = g.states.iterator();\n while (it.hasNext()) {\n State s = it.next();\n if (s.enforceValue == -1) {\n it.remove();\n unreachableStates.add(s);\n }\n }\n\n g.transitions.removeIf(t -> unreachableStates.contains(t.from) || unreachableStates.contains(t.to));*/\n\n return g;\n }", "public interface AutoSparseState {\n /**\n * @return The root path of the working copy this state tracks.\n */\n Path getSCRoot();\n\n /**\n * Query the source control manifest for information on a file.\n * @param path the file to get the manifest information for\n * @return a {@link ManifestInfo} instance if this file is under source control, null otherwise.\n */\n @Nullable\n ManifestInfo getManifestInfoForFile(Path path);\n\n /**\n * Query if a file is available in the source control manifest (and is thus tracked by source\n * control)\n * @param path to a file or directory\n * @return true if the path is a file that exists in the manifest, or a directory that contains\n * files that are in the manifest.\n */\n boolean existsInManifest(Path path);\n\n /**\n * Add a path that should, at some point in the future, be part of the working copy sparse\n * profile.\n * @param path The path to a source-control managed file or directory to be added\n */\n void addToSparseProfile(Path path);\n\n /**\n * Update the working copy to include new paths added to the sparse profile. Paths added with\n * <code>addToSparseProfile</code> will now be physically available on the filesystem.\n */\n void materialiseSparseProfile() throws IOException, InterruptedException;\n}", "public interface StatePac {\n\n /**\n * Identify the leaf of StatePac.\n */\n public enum LeafIdentifier {\n /**\n * Represents operationalState.\n */\n OPERATIONALSTATE(1),\n /**\n * Represents administrativeControl.\n */\n ADMINISTRATIVECONTROL(2),\n /**\n * Represents adminsatratveState.\n */\n ADMINSATRATVESTATE(3),\n /**\n * Represents lifecycleState.\n */\n LIFECYCLESTATE(4);\n\n private int leafIndex;\n\n public int getLeafIndex() {\n return leafIndex;\n }\n\n LeafIdentifier(int value) {\n this.leafIndex = value;\n }\n }\n\n /**\n * Returns the attribute operationalState.\n *\n * @return operationalState value of operationalState\n */\n OperationalState operationalState();\n\n /**\n * Returns the attribute administrativeControl.\n *\n * @return administrativeControl value of administrativeControl\n */\n AdministrativeControl administrativeControl();\n\n /**\n * Returns the attribute adminsatratveState.\n *\n * @return adminsatratveState value of adminsatratveState\n */\n AdministrativeState adminsatratveState();\n\n /**\n * Returns the attribute lifecycleState.\n *\n * @return lifecycleState value of lifecycleState\n */\n LifecycleState lifecycleState();\n\n /**\n * Returns the attribute valueLeafFlags.\n *\n * @return valueLeafFlags value of valueLeafFlags\n */\n BitSet valueLeafFlags();\n\n /**\n * Returns the attribute yangStatePacOpType.\n *\n * @return yangStatePacOpType value of yangStatePacOpType\n */\n OnosYangOpType yangStatePacOpType();\n\n /**\n * Returns the attribute selectLeafFlags.\n *\n * @return selectLeafFlags value of selectLeafFlags\n */\n BitSet selectLeafFlags();\n\n /**\n * Returns the attribute yangAugmentedInfoMap.\n *\n * @return yangAugmentedInfoMap value of yangAugmentedInfoMap\n */\n Map<Class<?>, Object> yangAugmentedInfoMap();\n\n\n /**\n * Returns the attribute yangAugmentedInfo.\n *\n * @param classObject value of yangAugmentedInfo\n * @return yangAugmentedInfo\n */\n Object yangAugmentedInfo(Class classObject);\n\n /**\n * Checks if the leaf value is set.\n *\n * @param leaf leaf whose value status needs to checked\n * @return result of leaf value set in object\n */\n boolean isLeafValueSet(LeafIdentifier leaf);\n\n /**\n * Checks if the leaf is set to be a selected leaf.\n *\n * @param leaf if leaf needs to be selected\n * @return result of leaf value set in object\n */\n boolean isSelectLeaf(LeafIdentifier leaf);\n\n /**\n * Builder for statePac.\n */\n interface StatePacBuilder {\n /**\n * Returns the attribute operationalState.\n *\n * @return operationalState value of operationalState\n */\n OperationalState operationalState();\n\n /**\n * Returns the attribute administrativeControl.\n *\n * @return administrativeControl value of administrativeControl\n */\n AdministrativeControl administrativeControl();\n\n /**\n * Returns the attribute adminsatratveState.\n *\n * @return adminsatratveState value of adminsatratveState\n */\n AdministrativeState adminsatratveState();\n\n /**\n * Returns the attribute lifecycleState.\n *\n * @return lifecycleState value of lifecycleState\n */\n LifecycleState lifecycleState();\n\n /**\n * Returns the attribute valueLeafFlags.\n *\n * @return valueLeafFlags value of valueLeafFlags\n */\n BitSet valueLeafFlags();\n\n /**\n * Returns the attribute yangStatePacOpType.\n *\n * @return yangStatePacOpType value of yangStatePacOpType\n */\n OnosYangOpType yangStatePacOpType();\n\n /**\n * Returns the attribute selectLeafFlags.\n *\n * @return selectLeafFlags value of selectLeafFlags\n */\n BitSet selectLeafFlags();\n\n /**\n * Returns the attribute yangAugmentedInfoMap.\n *\n * @return yangAugmentedInfoMap value of yangAugmentedInfoMap\n */\n Map<Class<?>, Object> yangAugmentedInfoMap();\n\n /**\n * Returns the builder object of operationalState.\n *\n * @param operationalState value of operationalState\n * @return operationalState\n */\n StatePacBuilder operationalState(OperationalState operationalState);\n\n /**\n * Returns the builder object of administrativeControl.\n *\n * @param administrativeControl value of administrativeControl\n * @return administrativeControl\n */\n StatePacBuilder administrativeControl(AdministrativeControl administrativeControl);\n\n /**\n * Returns the builder object of adminsatratveState.\n *\n * @param adminsatratveState value of adminsatratveState\n * @return adminsatratveState\n */\n StatePacBuilder adminsatratveState(AdministrativeState adminsatratveState);\n\n /**\n * Returns the builder object of lifecycleState.\n *\n * @param lifecycleState value of lifecycleState\n * @return lifecycleState\n */\n StatePacBuilder lifecycleState(LifecycleState lifecycleState);\n\n /**\n * Returns the builder object of yangStatePacOpType.\n *\n * @param yangStatePacOpType value of yangStatePacOpType\n * @return yangStatePacOpType\n */\n StatePacBuilder yangStatePacOpType(OnosYangOpType yangStatePacOpType);\n\n /**\n * Sets the value of yangAugmentedInfo.\n *\n * @param value value of yangAugmentedInfo\n * @param classObject value of yangAugmentedInfo\n */\n StatePacBuilder addYangAugmentedInfo(Object value, Class classObject);\n\n /**\n * Returns the attribute yangAugmentedInfo.\n *\n * @param classObject value of yangAugmentedInfo\n * @return yangAugmentedInfo\n */\n Object yangAugmentedInfo(Class classObject);\n /**\n * Set a leaf to be selected.\n *\n * @param leaf leaf needs to be selected\n * @return builder object for select leaf\n */\n StatePacBuilder selectLeaf(LeafIdentifier leaf);\n\n /**\n * Builds object of statePac.\n *\n * @return statePac\n */\n StatePac build();\n }\n}", "@Override\n\tpublic void loadStateImages() {\n\t\tif (imageFilename[0][0] != null)\n\t\t\tthis.addStateImage(imageFilename[0][0], 0, 0);\n\t\tif (imageFilename[0][1] != null)\n\t\t\tthis.addStateImage(imageFilename[0][1], 1, 0);\n\t\tif (imageFilename[1][0] != null)\n\t\t\tthis.addStateImage(imageFilename[1][0], 0, 1);\n\t\tif (imageFilename[1][1] != null)\n\t\t\tthis.addStateImage(imageFilename[1][1], 1, 1);\n\t}", "public static int getStartState() {\n int startState = 1;\n int n = 1;\n for (int i = 2; i <= state; i ++) {\n if (stateList.get(i).getN1() == n || stateList.get(i).getN2() == n) {\n startState = i;\n n = i;\n }\n }\n return startState;\n }", "protected void updateBaseline(TreeSet<StateTransition> stateTransitions) {\n if (!useBaseline) return;\n\n int size = stateTransitions.size();\n\n double mean = 0;\n for (StateTransition stateTransition : stateTransitions) mean += stateTransition.tdTarget;\n mean /= size;\n averageMean = averageMean == Double.MIN_VALUE ? mean : tau * averageMean + (1 - tau) * mean;\n\n double std = 0;\n for (StateTransition stateTransition : stateTransitions) std += Math.pow(stateTransition.tdTarget - mean, 2);\n std = Math.sqrt(std / (size - 1));\n averageStandardDeviation = averageStandardDeviation == Double.MIN_VALUE ? std : tau * averageStandardDeviation + (1 - tau) * std;\n\n for (StateTransition stateTransition : stateTransitions) {\n stateTransition.tdTarget = (stateTransition.tdTarget - averageMean) / averageStandardDeviation;\n }\n }", "public Solver(WorldState initial) {\n solution = new ArrayList<>();\n\n // create a priority queue of search nodes\n MinPQ<SNode> pq = new MinPQ<>();\n\n // insert an “initial search node” into the priority queue\n SNode start = new SNode(initial, 0, null);\n pq.insert(start);\n\n // If the search node with minimum priority is the goal node, then we’re done.\n while (!pq.min().ws.isGoal()) {\n\n // Remove the search node with minimum priority.\n SNode X = pq.delMin();\n\n // for each neighbor of X’s world state, create a new search node and\n // insert it into the priority queue.\n for (WorldState nb: X.ws.neighbors()) {\n\n // critical optimization\n if (X.prev == null || !(nb.equals(X.prev.ws))) {\n SNode nbNode = new SNode(nb, X.numberOfMove + 1, X);\n pq.insert(nbNode);\n }\n }\n }\n\n // generate the solution\n SNode goal = pq.min();\n while (goal != null) {\n solution.add(0, goal.ws);\n goal = goal.prev;\n }\n }", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "public RestrictedBoltzmannMachine(Path p) throws IOException{\n\n\t\t/*\n\t\tinputFile format:\n\t\t[\n\t\tA B C D\n\t\tx b1\n\t\ty b2\n\t\t.\n\t\t.\n\t\t.\n\t\tx0 y0 w0\n\t\tx1 y1 w1\n\t\tx2 y2 w2\n\t\t.\n\t\t.\n\t\t.\n\t\t]\n\n\t\tA : entitiesNumber;\n\t\tB : visibleEntitiesNumber;\n\t\tC : hiddenEntitiesNumber;\n\t\tD : connectionsDescribed\n\n\t\tx bi : bias bi on entity x\n\n\t\txi yi wi : connection between visible entity xi and hidden entity yi weighted by wi\n\n\t\t */\n\n\t\tint[] informations = new int[4];\n\t\t/*\n\t\t * informations:\n\t\t * \n\t\t * 0 : entitiesNumber;\n\t\t * 1 : visibleEntitiesNumber;\n\t\t * 2 : hiddenEntitiesNumber;\n\t\t * 3 : connectionsDescribed\n\t\t */\n\n\t\tint lineCptTemp = 0;\n\n\t\tfor(String line : Files.readAllLines(p)) {\n\t\t\tif(lineCptTemp ==0){\n\t\t\t\tint partCpt = 0;\n\t\t\t\tfor (String part : line.split(\"\\\\s+\")) {\n\t\t\t\t\tint i = Integer.valueOf(part);\n\t\t\t\t\tinformations[partCpt] = i;\n\t\t\t\t\tpartCpt++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tlineCptTemp++;\n\t\t}\n\n\t\tthis.layers = new Entity[2][];\n\t\tfor(int i = 0; i < 2; i++){\n\t\t\tthis.layers[i] = new Entity[informations[i + 1]];\n\t\t}\n\n\t\tthis.connections = new double[informations[1]][informations[2]];\n\n\t\tfor(int i = 0; i < this.connections.length; i++){\n\t\t\tfor(int j = 0; j < this.connections[0].length; j++){\n\t\t\t\tthis.connections[i][j] = 0;\n\t\t\t}\n\t\t}\n\n\t\tint lineCpt = 0; // line indicator\n\n\t\tfor (String line : Files.readAllLines(p)) {\n\n\t\t\tif(lineCpt ==0){\n\t\t\t\tint partCpt = 0;\n\t\t\t\tfor (String part : line.split(\"\\\\s+\")) {\n\t\t\t\t\tint i = Integer.valueOf(part);\n\t\t\t\t\tinformations[partCpt] = i;\n\t\t\t\t\tpartCpt++;\n\t\t\t\t}\n\n\t\t\t} else if(lineCpt < informations[0] + 1){\n\n\t\t\t\t// Entity Creation\n\n\t\t\t\tint partCpt = 0;\n\t\t\t\tdouble bias = 0;\n\t\t\t\tboolean setBias = false;\n\t\t\t\tint entityNumber = 0;\n\n\t\t\t\tfor (String part : line.split(\"\\\\s+\")) {\n\t\t\t\t\tif(partCpt == 0){\n\t\t\t\t\t\tInteger i = Integer.valueOf(part);\n\t\t\t\t\t\tentityNumber = i;\n\n\t\t\t\t\t}\n\t\t\t\t\tif(partCpt == 1){\n\t\t\t\t\t\tsetBias = true;\n\t\t\t\t\t\tInteger i = Integer.valueOf(part);\n\t\t\t\t\t\tbias = i;\n\t\t\t\t\t}\n\t\t\t\t\tpartCpt++;\n\t\t\t\t}\n\n\t\t\t\tint layer = 0;\n\t\t\t\tif(entityNumber >= informations[1]){ //if the entity is hidden\n\t\t\t\t\tlayer = 1;\n\t\t\t\t\tentityNumber -= informations[1];\n\t\t\t\t}\n\t\t\t\tthis.layers[layer][entityNumber] = new Entity(entityNumber, bias);\t\t\n\n\t\t\t} else {\t\n\t\t\t\tint partCpt = 0;\n\t\t\t\tdouble weight = 0;\n\t\t\t\tboolean setWeight = false;\n\n\t\t\t\tint[] connectedEntities = new int[2];\n\n\t\t\t\tfor (String part : line.split(\"\\\\s+\")) {\n\t\t\t\t\tif(partCpt < 2){\n\t\t\t\t\t\tInteger i = Integer.valueOf(part);\n\t\t\t\t\t\tconnectedEntities[partCpt] = i;\n\n\t\t\t\t\t}\n\t\t\t\t\tif(partCpt == 3){\n\t\t\t\t\t\tsetWeight = true;\n\t\t\t\t\t\tInteger i = Integer.valueOf(part);\n\t\t\t\t\t\tweight = i;\n\t\t\t\t\t}\n\t\t\t\t\tpartCpt++;\n\t\t\t\t}\n\n\t\t\t\t//Connection creation\n\n\t\t\t\tthis.connections[connectedEntities[0]][connectedEntities[1]] = weight;\n\t\t\t}\n\t\t\tlineCpt++;\n\t\t}\n\t\tthis.connectionsGradient = new double[this.connections.length][this.connections[0].length];\n\n\t\tthis.biasGradient = new double[2][];\n\t\tthis.biasGradient[0] = new double[this.layers[0].length];\n\t\tthis.biasGradient[1] = new double[this.layers[1].length];\n\n\t}", "public void constrastiveDivergence(int iterations){\n\t\t//the iterations start from visible to hidden (layers[1] -> layers [2])\n\n\t\tint iterCpt = 0;\n\t\t//int[][] states = new int[2][];\n\t\t//states[0] = this.getLayerState(0);\n\t\t//states[1] = this.getLayerState(1);\n\n\t\twhile(iterCpt < iterations){\n\n\t\t\tint layerToUpdate = (iterCpt + 1) % 2;\n\t\t\t//states[layerToUpdate] = this.getLayerState(layerToUpdate);\n\t\t\tthis.layerUpdate(layerToUpdate);\n\t\t\titerCpt++;\n\t\t}\n\t}", "public abstract List<Scope> generateFactorScopes(State state);", "void state_INIT(){\r\n eccState = INDEX_INIT;\r\n alg_INIT();\r\n INITO.serviceEvent(this);\r\n state_START();\r\n}", "public void loading() {\n if (state == null) {\n state = new NodeState();\n }\n state.setState(ENodeState.Loading);\n }", "public void loadStart()\n {\n score = 0;\n clear();\n HashMap<Location, State> start = gm.start();\n for (Location add : start.keySet())\n addToBoard(add, start.get(add));\n }", "@Override\n public void train() {\n actual = observations.toArray();\n min_val_error = Double.MAX_VALUE;\n if (findDecayConstant)\n for (float alpha = 0f; alpha <= 1f; alpha += 0.01f)\n initializeAndTrainModel(alpha);\n else\n initializeAndTrainModel(optAlpha);\n }", "public static POMDPState sampleInitialStates(Domain d) {\n\t\tPOMDPState s = new POMDPState();\n\n\t\t//Retrieve object classes from the domain.\n\t\tObjectClass containerClass = d.getObjectClass(Names.CLASS_CONTAINER);\n\t\tObjectClass babyClass = d.getObjectClass(Names.CLASS_BABY);\n\t\tObjectClass contentClass = d.getObjectClass(Names.CLASS_CONTENT);\n\t\tObjectClass humanClass = d.getObjectClass(Names.CLASS_HUMAN);\n\n\t\t//Create all the objects \n\t\tObjectInstance caregiver = new ObjectInstance(humanClass, Names.OBJ_CAREGIVER);\n\t\tObjectInstance baby = new ObjectInstance(babyClass, Names.OBJ_BABY);\n\t\tObjectInstance ointment = new ObjectInstance(contentClass, Names.OBJ_OINTMENT);\n\t\tObjectInstance oldClothes = new ObjectInstance(contentClass, Names.OBJ_OLD_CLOTHES);\n\t\tObjectInstance newClothes = new ObjectInstance(contentClass, Names.OBJ_NEW_CLOTHES);\n\t\tObjectInstance changingTable = new ObjectInstance(containerClass, Names.OBJ_CHANGING_TABLE);\n\t ObjectInstance hamper = new ObjectInstance(containerClass, Names.OBJ_HAMPER);\n\t\tObjectInstance sideTable = new ObjectInstance(containerClass, Names.OBJ_SIDE_TABLE);\n\t ObjectInstance dresser = new ObjectInstance(containerClass, Names.OBJ_DRESSER);\n\n\t\t//Set the \tproper values for objects' attributes\n\t\tchangingTable.setValue(Names.ATTR_OPEN, 1);\n\t hamper.setValue(Names.ATTR_OPEN, 1);\n\t\tsideTable.setValue(Names.ATTR_OPEN, 1);\n\t\tdresser.setValue(Names.ATTR_OPEN, 0);\n\t\tbaby.setValue(Names.ATTR_RASH, new java.util.Random().nextBoolean() ? 1 : 0);\n\n\t\t//Place contents in the proper initial container\n\t\tplaceObject(newClothes, dresser);\n\t\tplaceObject(oldClothes, changingTable);\n\t\tplaceObject(ointment, sideTable);\n\n\t\t//Add objects to the state, and have the caregiver decide on its mental state\n\t\taddObjects(s, caregiver, baby, oldClothes, newClothes, changingTable, hamper, sideTable, dresser, ointment);\n\t\tcaregiverThink(d, s);\n\n\t\t//Et voila\n\t\treturn s;\n\t}", "private List<State> substitueStateSketch(State oldState, Set<Node> components) {\n\n// long start = System.currentTimeMillis();\n\n List<State> ret = new ArrayList<>();\n\n for (Node sk : components) {\n\n State newState = new State(oldState);\n VariableNode v = newState.pp.findSelectedVar();\n v.sketch = sk;\n\n if (sk instanceof NullaryTerminalNode) {\n\n NullaryTerminalNode n = (NullaryTerminalNode) sk;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n if (n.sym.name.equals(\"<any>\")) continue;\n } else if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n newState.cost += Main.NOT_TERMINAL_PATTERN;\n }\n }\n\n newState.pp.numNullaryTerminals++;\n } else if (sk instanceof OperatorNode) {\n if (((OperatorNode) sk).special) newState.cost += Main.SPECIAL_REPEATATLEAST_1;\n\n String opName = ((OperatorNode) sk).operatorName;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n if (!(opName.equals(\"startwith\") || opName.equals(\"endwith\") || opName.equals(\"contain\"))) {\n newState.cost += Main.NOT_NOT_CONTAIN_SW_EW_PATTERN;\n }\n }\n }\n } else {\n\n // do not continue if we are trying to replace argument of notcc with a op node\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n continue;\n }\n }\n }\n\n newState.pp.numOperatorSketch++; // TODO: it might be a problem if we have a rf sketch such as concat(v:contain(v:?{<num>}))\n newState.pp.deselectVar();\n if (evalApprox(newState)) ret.add(newState);\n\n }\n\n return ret;\n\n }", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "public void test4_b_parametric() { // Schedule found: (m + 1)i + j + (-m - 2)\n\t\t/* RelTrafo1: (i, j) - (i, j - 1) = (0, 1)\n\t\t * RelTrafo2: (i, j) - (i - 1, j + m) = (1, -m)\n\t\t * (m + 1) - m + (-m - 2) = -m - 1\n\t\t *//*\n\t\tGDGraph gdGraph = new GDGraph();\n\t\tGDGVertex gdVertex = gdGraph.addVertex();\n\t\tGDGEdge gdEdge1 = gdGraph.addEdge(gdVertex, gdVertex);\n\t\tGDGEdge gdEdge2 = gdGraph.addEdge(gdVertex, gdVertex);\n\n\t\tgdEdge1.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i, j - 1) \n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1},\n\t\t\t\t{ 0, 0, 0, 1}\n });\n\t\tgdEdge1.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (0..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdEdge2.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i - 1, j + m) \n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 1, 0},\n\t\t\t\t{ 0, 0, 0, 1}\n });\t\t\n\t\tgdEdge2.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 0..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, 0}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdVertex.computationDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\t\t\n\t\tgdGraph.calculateFeautrierSchedule(true, true);\n\t\n\t\tgdGraph.<Rational>codeGeneration(Rational.ZERO, Rational.ONE);\n\t*/}", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public FFANNAdaptiveBackPropagationJSP()\n\t{\n\t\t//run(network, numberInputNeurons, numberHiddenNeurons, numberOutputNeurons, trainingSet);\n\t}", "@Override\n\tpublic void stablize() {\n\n\t}", "public interface State extends Comparable {\n\n\t/**\n\t * Computes the h value - heuristic grade for this state. This\n\t * method is called only once in the StateImpl class at the moment of\n\t * object creation, the value is stored in an inner variable, and then\n\t * be accessed by getH() method.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double computeHeuristicGrade();\n\n\t/**\n\t * Returns the h value - heuristic grade for this state.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double getH();\n\n\t/**\n\t * Returns the g value - cost of reaching this state from initial state.\n\t *\n\t * @return g value - cost of reaching this state from initial state\n\t */\n\tpublic double getG();\n\n\t/**\n\t * Sets the g value.\n\t *\n\t * @param aG value to be set\n\t */\n\tpublic void setG(double aG);\n\n\t/**\n\t * Returns the f value - sum of g and h values (f = g + h).\n\t *\n\t * @return f value\n\t */\n\tpublic double getF();\n\n\t/**\n\t * Returns the hash code for this state.\n\t *\n\t * @return hash code for this state\n\t */\n\tpublic String getHashCode();\n\n\t/**\n\t * Returns a list of children of this state (in the search tree).\n\t *\n\t * @return list of children of this state\n\t */\n\tpublic List<State> getChildren();\n\n\t/**\n\t * Sets the reference to the children of this state.\n\t *\n\t * @param aChildren reference to the children to be set\n\t */\n\tpublic void setChildren(List<State> aChildren);\n\n\t/**\n\t * Returns the reference to the parent of this state (in the tree)\n\t * or null if this state is the root.\n\t *\n\t * @return reference to the parent of this state\n\t */\n\tpublic State getParent();\n\n\t/**\n\t * Sets the reference to the parent of this state.\n\t *\n\t * @param aParent reference to the parent of this state to be set\n\t */\n\tpublic void setParent(State aParent);\n\n\t/**\n\t * Returns the boolean showing wether this state is admissible.\n\t * (E.g. in sudoku search some states may be inadmissible, so\n\t * their children should not be considered further.)\n\t *\n\t * @return boolean showing wether this state is admissible\n\t */\n\tpublic boolean isAdmissible();\n\n\t/**\n\t * Useful method for games searching algorithms.\n\t * Returns the string name of the root move (at the top of the\n\t * tree) that led to reaching this state.\n\t *\n\t * @return string representing the root move\n\t */\n\tpublic String getRootMove();\n\n\t/**\n\t * Sets the string name of the root move.\n\t *\n\t * @param aMove string name of the root move to be set.\n\t */\n\tpublic void setRootMove(String aMove);\n\n\t/**\n\t * Returns the guaranteed minimum score (payoff) for the maximizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed minimum score for the maximizing player\n\t */\n\tpublic double getAlpha();\n\n\t/**\n\t * Sets the new value for alpha.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aAlpha new value to be set\n\t */\n\tpublic void setAlpha(double aAlpha);\n\n\t/**\n\t * Returns the guaranteed maximum score (loss) for the minimizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed maximum score for the minimizing player\n\t */\n\tpublic double getBeta();\n\n\t/**\n\t * Sets the new value for beta.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aBeta new value to be set\n\t */\n\tpublic void setBeta(double aBeta);\n\n\t/**\n\t * Returns the depth property (how deep in the tree is this state).\n\t *\n\t * @return depth property\n\t */\n\tpublic double getDepth();\n\n\t/**\n\t * Sets the depth property.\n\t *\n\t * @param aDepth depth value to be set\n\t */\n\tpublic void setDepth(double aDepth);\n\n public boolean isSolved();\n}", "void initializeStateOrder( int nIdWorkflow );", "public static void runStaticSimulation(String path) {\n HashMap<String, Integer> lowerBounds = readInFJSSBounds();\n\n Objective objective = MAKESPAN;\n// List<AbstractRule> sequencingRules = new ArrayList();\n// List<AbstractRule> routingRules = new ArrayList();\n\n //objectives.add(Objective.MAKESPAN);\n //AbstractRule sequencingRule = new FCFS(RuleType.SEQUENCING);\n AbstractRule sequencingRule = new FCFS(RuleType.SEQUENCING);\n AbstractRule routingRule = new WIQ(RuleType.ROUTING);\n System.out.println(\"Running static simulation for objective: \"+objective.getName());\n System.out.println(\"Sequencing rule: \"+sequencingRule.getName());\n System.out.println(\"Routing rule: \"+routingRule.getName());\n\n //routingRules.add(GPRule.readFromLispExpression(RuleType.ROUTING,\" (+ (max WIQ DD) (- (/ AT PT) (min SL NOR)))\"));\n\n //routingRules.add(new SBT(RuleType.ROUTING));\n //sequencingRules.add(GPRule.readFromLispExpression(RuleType.SEQUENCING,\" (+ (min (min (max (min WIQ t) (max NOR SL)) MRT) (max DD WKR)) (* (+ SL SL) (- WIQ PT)))\"));\n //sequencingRules.add(GPRule.readFromLispExpression(RuleType.SEQUENCING,\" (/ WKR rDD)\"));\n// routingRules.add(GPRule.readFromLispExpression(RuleType.ROUTING,\" (max (max NINQ PT) (max (- (/ (min t NINQ)\" +\n// \" (max AT W)) (min (max NOR FDD) (* MRT (- SL W)))) AT))\"));\n\n// sequencingRules.add(new AVPRO(RuleType.SEQUENCING));\n// sequencingRules.add(new CR(RuleType.SEQUENCING));\n// sequencingRules.add(new EDD(RuleType.SEQUENCING));\n// sequencingRules.add(new FCFS(RuleType.SEQUENCING));\n// sequencingRules.add(new FDD(RuleType.SEQUENCING));\n// sequencingRules.add(new LCFS(RuleType.SEQUENCING));\n// sequencingRules.add(new LPT(RuleType.SEQUENCING));\n// sequencingRules.add(new LWKR(RuleType.SEQUENCING));\n// sequencingRules.add(new MOPNR(RuleType.SEQUENCING));\n// sequencingRules.add(new MWKR(RuleType.SEQUENCING));\n// sequencingRules.add(new NPT(RuleType.SEQUENCING));\n// sequencingRules.add(new PW(RuleType.SEQUENCING));\n// sequencingRules.add(new SL(RuleType.SEQUENCING));\n// sequencingRules.add(new Slack(RuleType.SEQUENCING));\n// sequencingRules.add(new SPT(RuleType.SEQUENCING));\n//\n// sequencingRules.add(new ATC(RuleType.SEQUENCING));\n// sequencingRules.add(new COVERT(RuleType.SEQUENCING));\n// sequencingRules.add(new CRplusPT(RuleType.SEQUENCING));\n// sequencingRules.add(new LWKRplusPT(RuleType.SEQUENCING));\n// sequencingRules.add(new OPFSLKperPT(RuleType.SEQUENCING));\n// sequencingRules.add(new PTplusPW(RuleType.SEQUENCING));\n// sequencingRules.add(new PTplusPWplusFDD(RuleType.SEQUENCING));\n// sequencingRules.add(new SlackperOPN(RuleType.SEQUENCING));\n// sequencingRules.add(new SlackperRPTplusPT(RuleType.SEQUENCING));\n//\n// sequencingRules.add(new WATC(RuleType.SEQUENCING));\n// sequencingRules.add(new WCOVERT(RuleType.SEQUENCING));\n// sequencingRules.add(new WSPT(RuleType.SEQUENCING));\n//\n// //add work center specific rules, as other rules will always give the same values\n// routingRules.add(new LBT(RuleType.ROUTING));\n// routingRules.add(new LRT(RuleType.ROUTING));\n// routingRules.add(new NIQ(RuleType.ROUTING));\n// routingRules.add(new SBT(RuleType.ROUTING));\n// routingRules.add(new SRT(RuleType.ROUTING));\n// routingRules.add(new WIQ(RuleType.ROUTING));\n\n //get the Filenames of all static FJSS instances in the relevant directory\n List<Path> directoryNames = getDirectoryNames(new ArrayList(), Paths.get(path),\".fjs\");\n\n //List<String> instanceFileNames = getFileNames(new ArrayList(), Paths.get(path), \".fjs\");\n for (int i = 0; i < directoryNames.size(); ++i) {\n Path directoryName = directoryNames.get(i);\n List<String> instanceFileNames = getFileNames(new ArrayList(), directoryName, \".fjs\");\n int numInstances = instanceFileNames.size();\n System.out.println(numInstances +\" FJSS instances in \"+directoryName.toString());\n double[] makeSpanRatios = new double[numInstances];\n for (int j = 0; j < numInstances; ++j) {\n String instanceFileName = instanceFileNames.get(j);\n //System.out.println(\"\\nInstance \"+(i+1)+\" - Path: \"+instanceFileName);\n double objectiveVal =\n calculateFitness(instanceFileName, objective, sequencingRule, routingRule);\n String formattedFileName = formatFileName(instanceFileName);\n double lowerBound = lowerBounds.get(formattedFileName);\n double ratio = objectiveVal/lowerBound;\n makeSpanRatios[j] = ratio;\n }\n double ratioSum = 0.0;\n for (int j = 0; j < numInstances; ++j) {\n ratioSum += makeSpanRatios[j];\n }\n System.out.println(\"Mean lb/objective value is: \"+ratioSum/numInstances);\n System.out.println();\n }\n\n //want to be able to feed in a sequencing rule and a routing rule\n //and be able to find out the makespan of that pair on a given instance\n //should then store that, as well a ratio of that to the lower bound,\n //in a file, and aggregate by directory\n\n //EvaluateOutput(\"/out/rule_comparisons/\", \"RR\");\n }", "public static ArrayList genStates(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(int n = 0; n<=10; n++){\n for(int b = 0; b<=3; b++){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += notes.get(n);\n state += beat.get(b);\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "private void loadRules() throws DataNormalizationException {\n\t\tloadRules(TableVersion.COMMITTED);\n\t}", "@Override\n\tpublic void stateMachineMetaGame(long timeout)\n\t\t\tthrows TransitionDefinitionException, MoveDefinitionException,\n\t\t\tGoalDefinitionException {\n\n\t\tif (propNetCreationTime == 0)\n\t\t\tpropNetCreationTime = 1;\n\t\tlong estimatedThreadsToCreate = (timeout - System.currentTimeMillis())\n\t\t\t\t/ propNetCreationTime;\n\t\tSystem.out.println(\"Estimating I can create \"\n\t\t\t\t+ estimatedThreadsToCreate + \" propNets in given time.\");\n\t\t// int MAX_NUM_THREADS = 4;\n\t\tfor (int i = 1; i < Math\n\t\t\t\t.min(BryceMonteCarloTreeSearch_NoMiniMax_MultiThreaded.MAX_NUM_THREADS,\n\t\t\t\t\t\testimatedThreadsToCreate); i++) {\n\t\t\tFirstPropNetStateMachine first = new FirstPropNetStateMachine();\n\t\t\tfirst.initialize(((FirstPropNetStateMachine) stateMachines.get(0))\n\t\t\t\t\t.getDescription());\n\t\t\tstateMachines.add(first);\n\t\t\tSystem.out.println(\"added new prop machine: \" + i);\n\t\t\tif (System.currentTimeMillis() > timeout)\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void activate() {\t\t\n\t\t// Put activation code here (computing output based on the network's inputs)\n }", "LoadConstraintType getLoadConstraint();", "private LinearAVF() {\n this.booleanValueFunctions = new EnumMap<>(Criterion.class);\n this.linearValueFunctions = new EnumMap<>(Criterion.class);\n this.reversedValueFunctions = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasBooleanDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasDoubleDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n this.weight = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values()).forEach(criterion -> weight.put(criterion, 0.0d));\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6900, \"inverted=true\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6901, \"inverted=true\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6902, \"inverted=true\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6903, \"inverted=true\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6904, \"inverted=true\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6905, \"inverted=true\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6906, \"inverted=true\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6907, \"inverted=true\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6908, \"inverted=true\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6909, \"inverted=true\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6910, \"inverted=true\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6911, \"inverted=true\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6912, \"inverted=true\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6913, \"inverted=true\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6914, \"inverted=true\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6915, \"inverted=true\", \"power=15\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6916, \"inverted=false\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6917, \"inverted=false\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6918, \"inverted=false\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6919, \"inverted=false\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6920, \"inverted=false\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6921, \"inverted=false\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6922, \"inverted=false\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6923, \"inverted=false\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6924, \"inverted=false\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6925, \"inverted=false\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6926, \"inverted=false\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6927, \"inverted=false\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6928, \"inverted=false\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6929, \"inverted=false\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6930, \"inverted=false\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6931, \"inverted=false\", \"power=15\"));\n }", "BeliefStateDimension getInitialBeliefState() \n {\n return _initial_belief; \n }", "public long[] getState() {\n return new long[] {(long)Cg0, (long)Cg1, (long)Cg2,\n (long)Cg3, (long)Cg4, (long)Cg5};\n }", "void createInitialBeliefState( )\n throws BelievabilityException\n {\n if ( _asset_dim_model == null )\n throw new BelievabilityException\n ( \"POMDPAssetDimensionModel.createInitialBeliefState()\",\n \"Asset model is NULL\" );\n \n if ( _logger.isDetailEnabled() )\n _logger.detail( \"\\tCreating POMDP iinitial belief for dimension: \" \n + _asset_dim_model.getStateDimensionName( ) );\n\n int num_vals = _asset_dim_model.getNumStateDimValues( );\n \n if ( num_vals < 0 )\n throw new BelievabilityException\n ( \"POMDPAssetDimensionModel.createInitialBeliefState()\",\n \"Asset model returning zero values: \"\n + _asset_dim_model.getStateDimensionName( ) );\n \n double[] belief_prob = new double[num_vals];\n \n int default_idx = _asset_dim_model.getDefaultStateIndex( );\n \n if ( default_idx < 0 )\n throw new BelievabilityException\n ( \"POMDPAssetDimensionModel.createInitialBeliefState()\",\n \"Asset model returning invalid default value: \"\n + _asset_dim_model.getStateDimensionName( ) );\n\n // We assume that each asset state dimension starts off\n // deterministically in a single possible state value.\n //\n belief_prob[default_idx] = 1.0;\n \n _initial_belief = new BeliefStateDimension( _asset_dim_model,\n belief_prob,\n null );\n\n }", "public Activation_Linear_Range_0_1() {\r\n this.slope = new VDouble(new RealNumber(1), new VDoubleNoUpdate());\r\n this.c = new VDouble(new RealNumber(0), new VDoubleNoUpdate());\r\n }", "public ShortestPathStateSpaceValidator(StateValidator validator) {\n\t\tsuper();\n\t\tif (validator==null) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tthis.validator = validator;\n\t}", "public LPSolution solve(double[][] xResults, double[][] yResults) throws GRBException {\n\t\tdouble intFeasTol = mSettings.getIntegralityTolerance();\n\t\tdouble feasTol = mSettings.getFeasibilityTolerance();\n\n\t\tGRBEnv env = new GRBEnv();\n\t\tGRBModel model = new GRBModel(env);\n\n\t\tGRBSolverUtils.configureToleranceParameters(model, intFeasTol, feasTol);\n\n\t\tint n = mExplicitMDP.getNumStates();\n\t\tint m = mExplicitMDP.getNumActions();\n\n\t\t// Initial state distribution\n\t\tdouble[] alpha = new double[n];\n\t\tArrays.fill(alpha, 1.0 / n);\n\n\t\t// Create variables: x_ia\n\t\t// Lower bound on variables: x_ia >= 0\n\t\tGRBVar[][] xVars = GRBSolverUtils.createOptimizationVars(\"x\", GRB.CONTINUOUS, n, m, 0.0,\n\t\t\t\tDouble.POSITIVE_INFINITY, model);\n\n\t\t// Create variables: y_ia\n\t\t// Lower bound on variables: y_ia >= 0\n\t\tGRBVar[][] yVars = GRBSolverUtils.createOptimizationVars(\"y\", GRB.CONTINUOUS, n, m, 0.0,\n\t\t\t\tDouble.POSITIVE_INFINITY, model);\n\n\t\t// Create variables: Deltax_ia (binary)\n\t\tString deltaxVarName = \"Deltax\";\n\t\tGRBVar[][] deltaxVars = GRBSolverUtils.createOptimizationVars(deltaxVarName, GRB.BINARY, n, m, 0.0, 1.0, model);\n\n\t\t// Create variables: Deltay_ia (binary)\n\t\tString deltayVarName = \"Deltay\";\n\t\tGRBVar[][] deltayVars = GRBSolverUtils.createOptimizationVars(deltayVarName, GRB.BINARY, n, m, 0.0, 1.0, model);\n\n\t\t// Set optimization objective\n\t\tGRBSolverUtils.setOptimizationObjective(mExplicitMDP, xVars, model);\n\n\t\t// Add constraints\n\t\taddC1Constraints(xVars, model);\n\t\taddC2Constraints(alpha, xVars, yVars, model);\n\n\t\t// Add constraints to ensure deterministic solution policy\n\t\tGRBSolverUtils.addDeltaConstraints(mExplicitMDP, deltaxVarName, deltaxVars, model);\n\t\tGRBSolverUtils.addDeltaConstraints(mExplicitMDP, deltayVarName, deltayVars, model);\n\n\t\t// For average-cost MDP, sum_i,a (x_ia) = 1; therefore, we can use X = 1\n\t\tGRBSolverUtils.addVarDeltaConstraints(1.0, mExplicitMDP, \"x\", xVars, deltaxVarName, deltaxVars, model);\n\n\t\t// Similarly, we use Y = 1\n\t\tGRBSolverUtils.addVarDeltaConstraints(1.0, mExplicitMDP, \"y\", yVars, deltayVarName, deltayVars, model);\n\n\t\t// Add (upper/lower bound) cost constraints, if any\n\t\tif (mSoftConstraints != null) {\n\t\t\t// Soft constraints\n\t\t\tCostConstraintUtils.addSoftCostConstraints(mSoftConstraints, mHardConstraints, mExplicitMDP, xVars, model);\n\t\t} else if (mHardConstraints != null) {\n\t\t\t// Hard constraints\n\t\t\tCostConstraintUtils.addHardCostConstraints(mHardConstraints, mExplicitMDP, xVars, model);\n\t\t}\n\n\t\t// Solve optimization problem for x_ia, y_ia, and Delta_ia\n\t\tmodel.optimize();\n\n\t\tint numSolutions = model.get(GRB.IntAttr.SolCount);\n\t\tdouble objectiveValue = -1;\n\n\t\tif (numSolutions > 0) {\n\t\t\t// Solution found\n\n\t\t\t// Objective value: sum_i,a (c_ia * x_ia)\n\t\t\tobjectiveValue = model.get(GRB.DoubleAttr.ObjVal);\n\n\t\t\t// Query results: optimal values of x_ia, y_ia, and Delta_ia\n\t\t\tdouble[][] grbXResults = model.get(GRB.DoubleAttr.X, xVars);\n\t\t\tdouble[][] grbYResults = model.get(GRB.DoubleAttr.X, yVars);\n\t\t\tdouble[][] grbDeltaxResults = model.get(GRB.DoubleAttr.X, deltaxVars);\n\t\t\tdouble[][] grbDeltayResults = model.get(GRB.DoubleAttr.X, deltayVars);\n\n\t\t\t// Copy x_ia and y_ia results to the return parameters\n\t\t\tSystem.arraycopy(grbXResults, 0, xResults, 0, grbXResults.length);\n\t\t\tSystem.arraycopy(grbYResults, 0, yResults, 0, grbYResults.length);\n\n\t\t\t// Consistency checks\n\t\t\tverifyAllConstraints(grbXResults, grbYResults, grbDeltaxResults, grbDeltayResults, alpha);\n\t\t\tassert GRBSolverUtils.consistencyCheckResults(grbXResults, grbDeltaxResults, mExplicitMDP, feasTol);\n\t\t\tassert GRBSolverUtils.consistencyCheckResults(grbYResults, grbDeltayResults, mExplicitMDP, feasTol);\n\t\t}\n\n\t\t// Dispose of model and environment\n\t\tmodel.dispose();\n\t\tenv.dispose();\n\n\t\t// LP solution\n\t\tLPSolution solution = new LPSolution(numSolutions > 0, objectiveValue);\n\t\tsolution.addSolution(\"x\", xResults);\n\t\tsolution.addSolution(\"y\", yResults);\n\t\treturn solution;\n\t}", "SpacecraftState propagate(AbsoluteDate start, AbsoluteDate target) throws OrekitException;", "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 }" ]
[ "0.56771815", "0.5336378", "0.5329037", "0.52981037", "0.5233846", "0.5115891", "0.5102483", "0.5049701", "0.5023344", "0.4993071", "0.49926987", "0.49572027", "0.4952929", "0.49195555", "0.49186864", "0.49076033", "0.48895702", "0.48561865", "0.4846372", "0.4840333", "0.48385462", "0.48155674", "0.48133737", "0.47973794", "0.47897786", "0.47844648", "0.47813833", "0.47785243", "0.47716004", "0.4770253", "0.47649962", "0.4764727", "0.47420904", "0.4721645", "0.4720125", "0.47192603", "0.47126886", "0.47047898", "0.46977833", "0.46772894", "0.46725157", "0.46589458", "0.46560374", "0.4652743", "0.46489978", "0.46476388", "0.46303886", "0.4628816", "0.46233943", "0.46232995", "0.46223068", "0.46105656", "0.4597896", "0.45875037", "0.4585193", "0.4581593", "0.4581227", "0.45796505", "0.4574634", "0.45674342", "0.45668215", "0.45616904", "0.45476097", "0.4537607", "0.4532645", "0.45251578", "0.4517141", "0.45117673", "0.45079362", "0.44980085", "0.4489057", "0.44826585", "0.44792664", "0.44762075", "0.4475772", "0.44755158", "0.44729397", "0.44684422", "0.44611418", "0.44511852", "0.4449067", "0.44433683", "0.44394588", "0.44378302", "0.44335085", "0.44330305", "0.44282112", "0.4421507", "0.44203734", "0.44182467", "0.4418049", "0.4416576", "0.44143274", "0.44062144", "0.43975794", "0.43878874", "0.43877235", "0.43871722", "0.43824846", "0.43797183", "0.4377613" ]
0.0
-1
Generate the State Loading Constraints for the Funding Latent State
public org.drip.state.estimator.PredictorResponseWeightConstraint fundingPRWC ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp, final org.drip.product.calib.ProductQuoteSet pqs) { if (null == valParams || null == pqs) return null; org.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel(); if ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) || (null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet))) return null; int iValueDate = valParams.valueDate(); if (iValueDate >= maturity().julian()) return null; double dblCleanPV = 0.; try { if (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) { org.drip.product.calib.FloatingStreamQuoteSet fsqs = (org.drip.product.calib.FloatingStreamQuoteSet) pqs; if (fsqs.containsPV()) dblCleanPV = fsqs.pv(); } else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) { org.drip.product.calib.FixedStreamQuoteSet fsqs = (org.drip.product.calib.FixedStreamQuoteSet) pqs; if (fsqs.containsPV()) dblCleanPV = fsqs.pv(); } } catch (java.lang.Exception e) { e.printStackTrace(); return null; } org.drip.state.estimator.PredictorResponseWeightConstraint prwc = new org.drip.state.estimator.PredictorResponseWeightConstraint(); for (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) { int iPeriodEndDate = period.endDate(); if (iPeriodEndDate < iValueDate) continue; org.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.fundingPRWC (iValueDate, csqs, pqs); if (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null; } if (!prwc.updateValue (dblCleanPV)) return null; if (!prwc.updateDValueDManifestMeasure ("PV", 1.)) return null; return prwc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\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\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "int nParametricStates();", "private boolean isFeasibleState(int[] state){\n if((state[0] <= totalMissionaries && state[0] >= 0)&&(state[1] <= totalCannibals && state[1] >= 0)) {\n return true;\n }\n return false;\n }", "public static void main(String[] args) throws UnsatisfiableConstraintSetException{\n\t\tint order = 1;\n\t\tBidirectionalVariableOrderPrefixIDMap<CharacterToken> statesByIndex = new BidirectionalVariableOrderPrefixIDMap<CharacterToken>(order);\n\t\t\n\t\tfinal CharacterToken cToken = new CharacterToken('C');\n\t\tint cID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(cToken)));\n\t\tfinal CharacterToken dToken = new CharacterToken('D');\n\t\tint dID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(dToken)));\n\t\tfinal CharacterToken eToken = new CharacterToken('E');\n\t\tint eID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(eToken)));\n\t\t\n\t\tMap<Integer, Map<Integer, Double>> transitions = new HashMap<Integer, Map<Integer, Double>>();\n\t\t\n\t\tMap<Integer, Double> priors = new HashMap<Integer, Double>();\n\t\tpriors.put(cID, .5);\n\t\tpriors.put(dID, 1.0/6);\n\t\tpriors.put(eID, 1.0/3);\n\n\t\tfinal HashMap<Integer, Double> transFromC = new HashMap<Integer, Double>();\n\t\ttransFromC.put(cID, .5);\n\t\ttransFromC.put(dID, .25);\n\t\ttransFromC.put(eID, .25);\n\t\ttransitions.put(cID, transFromC);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromD = new HashMap<Integer, Double>();\n\t\ttransFromD.put(cID, .5);\n//\t\ttransFromD.put(dID, 0.);\n\t\ttransFromD.put(eID, .5);\n\t\ttransitions.put(dID, transFromD);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromE = new HashMap<Integer, Double>();\n\t\ttransFromE.put(cID, .5);\n\t\ttransFromE.put(dID, .25);\n\t\ttransFromE.put(eID, .25);\n\t\ttransitions.put(eID, transFromE);\n\t\t\n\t\tSparseVariableOrderMarkovModel<CharacterToken> model = new SparseVariableOrderMarkovModel<CharacterToken>(statesByIndex, priors, transitions);\n\t\t\n\t\tCharacterToken[][] seqs = new CharacterToken[][] {\n\t\t\tnew CharacterToken[]{cToken, cToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, cToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, eToken, dToken}\n\t\t};\n\n\t\tSystem.out.println(\"UNCONSTRAINED:\");\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + model.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + model.generate(4));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"CONSTRAINED:\");\n\t\t\n\t\tint length = 4;\n\t\tList<List<ConditionedConstraint<CharacterToken>>> constraints = new ArrayList<List<ConditionedConstraint<CharacterToken>>>(); \n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tconstraints.add(new ArrayList<ConditionedConstraint<CharacterToken>>());\n\t\t}\n\t\tconstraints.get(3).add(new ConditionedConstraint<>(new CharacterTokenConstraint<CharacterToken>(new CharacterToken('D')),true));\n\t\t\n\t\tSparseVariableOrderNHMMMultiThreaded<CharacterToken> constrainedModel = null;\n\t\ttry {\n\t\t\tconstrainedModel = new SparseVariableOrderNHMMMultiThreaded<CharacterToken>(model, length, constraints);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + constrainedModel.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + constrainedModel.generate(4));\n\t\t}\n\t}", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\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\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "StatePac build();", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private String transitionGenerate( String oldguard,String newguard,String markguard,List<Statement> statements, int previousmark,Automaton a,Map<String, Type> b,String pre ,int layer, boolean Else) throws PrismGeneratorException, ValidationException {\n String transition = \"\";\n //The lable of the current statement\n int statlable =0;\n //The lable of the current transition\n int layermark = transitionmark;\n String guard = oldguard;\n if(!newguard.isEmpty()){\n guard += (\" & \" + newguard);\n if(!markguard.isEmpty()){\n guard += ( \" & \" + markguard);\n }\n }\n\n String newpre = \"v\"+pre;\n //The define of the virtual variables used in this level\n String transitionend = pre+\"transitionend\";\n if(layer > maxlayer) {\n\n globalDeclarations += pre+\"transitionend : bool init true;\\n\";\n maxlayer = layer;\n for (Declaration var : a.getLocalVars().getDeclarationList()) {\n assert var instanceof VariableDeclaration;\n Type newtype = null;\n\n if(!(b==null)){\n\n if (b.containsKey(((VariableDeclaration) var).getType().toString())){\n newtype = b.get(((VariableDeclaration) var).getType().toString());\n }else{\n newtype = ((VariableDeclaration) var).getType();\n }\n }else{\n newtype = ((VariableDeclaration) var).getType();\n }\n String strType = typeGenerate(newtype);\n\n for (String name : var.getIdentifiers()) {\n\n switch (strType){\n case \"init\":\n Type inibasetype = ((InitType) newtype).getBaseType();\n String basestrtype = typeGenerate(inibasetype);\n switch (basestrtype){\n case \"int\":\n\n globalDeclarations += (newpre + name + \" : \"+typeGenerate(inibasetype)+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue()) +\";\\n\");\n break;\n case \"[%s..%s]\":\n BoundedIntType boundedtype = (BoundedIntType) inibasetype;\n String upper = boundedtype.getUpperBound().toString();\n String lower = boundedtype.getLowerBound().toString();\n globalDeclarations +=(newpre + name + \":\"+String.format(basestrtype,lower,upper )+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue()) +\";\\n\");\n break;\n case \"bool\":\n globalDeclarations +=(newpre + name + \":\"+strType+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue())+\";\\n\");\n break;\n }\n break;\n case \"int\":\n\n globalDeclarations += (newpre + name + \":\"+strType+\";\\n\");\n break;\n case \"[%s..%s]\":\n BoundedIntType boundedtype = (BoundedIntType) newtype;\n String upper = boundedtype.getUpperBound().toString();\n String lower = boundedtype.getLowerBound().toString();\n globalDeclarations +=(newpre + name + \":\"+String.format(strType,lower, upper)+\";\\n\");\n\n break;\n case \"bool\":\n globalDeclarations +=(newpre + name + \":\"+strType+\";\\n\");\n\n break;\n case \"enum\":\n int i = 0;\n for(String item : ((EnumType)(newtype)).getItems()){\n globalDeclarations +=(newpre + item+String.format(\" : int init %d;\", i)+\"\\n\");\n i++;\n\n }\n globalDeclarations +=(newpre + name+\" : int;\"+\"\\n\");\n\n break;\n case \"list\":\n Type basetype = ((ListType)(newtype)).getBaseType();\n Term key = ((ListType)(newtype)).getCapacity();\n if((!(basetype instanceof IntType))||(!(basetype instanceof BoolType))||(!((key instanceof IntValue)))){\n java.lang.System.err.println(\"The type of the list is not supported.\");\n }\n if((((IntValue)((IntValue) key)).getValue()==0)){\n java.lang.System.err.println(\"The length of the list must greater than 0.\");\n }\n for(int j=0 ; j < (((IntValue)((IntValue) key)).getValue()); j++){\n globalDeclarations +=(newpre + String.format(\"%s%d\",name,j)+\" : int;\\n\");\n\n }\n break;\n }\n }\n }\n }\n\n // assign the virtual variables\n String rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", newpre + var, pre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\", layermark,statlable)+ \" & \" + transitionend +\" = true\"+ \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \"&\"+\"(\"+ transitionend + \"' = false);\"+ \"\\n\");\n ++statlable;\n\n for (Statement s : statements) {\n if (s instanceof SynchronizingStatement) {\n java.lang.System.err.println(\"A sync statement is not supposed to show up when generating codes.\");\n } else if (s instanceof AssignmentStatement) {\n rel = \"\";\n\n rel += virtualtermGenerate(((AssignmentStatement) s).getTarget(), 0,newpre,b) +\"'\"+\n \" = \" + virtualtermGenerate(((AssignmentStatement) s).getExpr(), 0,newpre,b);\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\", layermark,statlable) + \" -> \" + \"(\"+ rel +\")\" +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1);\", layermark,layermark)+ \"\\n\");\n ++statlable;\n\n }else if(s instanceof IteStatement){\n ++transitionmark;\n globalDeclarations += String.format(\"transitionmark%d :int init 0;\\n\", transitionmark);\n String newguard_ = virtualtermGenerate(((IteStatement) s).getCondition(), 0,newpre,b);\n String markguard_ = String.format(\"transitionmark%d=%d\", layermark,statlable);\n List newstatements = ((IteStatement) s).getThenStmts();\n List elstatements = ((IteStatement) s).getElseStmts();\n if(elstatements != null){\n transition += transitionGenerate(guard,newguard_,markguard_,newstatements,layermark,a,b,newpre,layer+1,true);\n ++transitionmark;\n globalDeclarations += String.format(\"transitionmark%d :int init 0;\\n\", transitionmark);\n transition += transitionGenerate(guard,\"!(\"+newguard_+\")\",markguard_,elstatements,layermark,a,b,newpre,layer+1,true);\n ++statlable;\n }else{\n transition += transitionGenerate(guard,newguard_,markguard_,newstatements,layermark,a,b,newpre,layer+1,false);\n ++statlable;\n }\n }\n else {\n throw PrismGeneratorException.UnhandledStatement(s);\n }\n }\n\n\n int max = 0;\n for(Statement s : statements){\n ++max;\n }\n ++max;\n\n\n if(layer > 1){\n //if the IteStatement is not implemented then change the transitionmark to the max\n if(Else == false) {\n transition += (\"[] \" + oldguard + \" & \" + \"!(\" + newguard + \")\" + \" & \" + markguard + \" & \" + String.format(\"transitionmark%d=%d\", layermark, 0) + \" -> \" +\n String.format(\"(transitionmark%d' = %d);\", layermark, max) + \"\\n\");\n }\n // assign the variables\n rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", pre + var, newpre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\",layermark, max) + \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1);\", layermark,layermark)+ \"\\n\");\n ++statlable;\n\n //Prevent label duplication\n transition += (\"[] \" +markguard+ String.format(\" & transitionmark%d=%d\", layermark,max+1) + \" -> \" +\n String.format(\"(transitionmark%d' = transitionmark%d + 1)&\", previousmark,previousmark)+\n String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \"&\"+\"(\"+transitionend+\"' = true)\"+\";\\n\");\n }else{\n\n // assign the variables\n rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", pre + var, newpre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\",layermark, max) + \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \";\\n\");\n ++statlable;\n\n //initialize all the transitionmarks we had used\n rel = \"\";\n for(int i = 0 ; i<=transitionmark;i++){\n rel += String.format(\"(transitionmark%d' = 0)\", i)+\"&\";\n }\n rel = (rel.substring(0,rel.length()-1));\n transition += (\"[] \" + String.format(\"transitionmark%d=%d\", layermark,max+1)+ \" -> \" + rel +\n \"&\"+\"(\"+transitionend+\"' = true)\"+\";\\n\");\n }\n\n return transition;\n }", "public abstract List<Scope> generateFactorScopes(State state);", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "private AutomatonFromTable automatonFromTable() {\n \tAutomatonFromTable hypothesis = new AutomatonFromTable(inputs);\n\t\t/*\n\t\t * Number of new states in the hypothesis is the \n\t\t * number of distinct rows in the upper half of the observation table\n\t\t */\n\t\tint noOfNewStates = -1;\n\t\tList<List<String>> distinctStates = new ArrayList<>();\n\t\tIterator<Entry<String, List<String>>> it = observationTableUpper.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tdistinctStates.add(entry.getValue());\n\t\t}\n\t\tnoOfNewStates = new HashSet<>(distinctStates).size();\n\t\t//Adding those many number of states\n\t\tfor(int i=0;i<noOfNewStates;i++){\n\t\t\tif(i==0){\n\t\t\t\thypothesis.addInitialState();\n\t\t\t}else{\n\t\t\t\thypothesis.addState();\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"No.of new states \"+noOfNewStates);\n\t\t\n\t\t\n\t\tList<Transition> prefixStateMap = new ArrayList<>();\n\t\t\n\t\t//Adding the transitions for those states\n\t\tit = observationTableUpper.entrySet().iterator();\n\t\tSystem.out.println(\"Upper table size \"+observationTableUpper);\n\t\tint currentMaxState = 0;\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tString prefix = entry.getKey();\n\t\t\tList<String> results = entry.getValue();\n\t\t\tint currentState = getCurrentState(prefix, prefixStateMap);\n\t\t\tSystem.out.println(\"Current State \"+currentState);\n\t\t\tint nextState;\n\t\t\tif(prefix.contains(\"<>\")){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else if((nextState = checkErrorState(prefix, prefixStateMap))!=-1){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tif(!results.get(i+1).equals(\"-\")){\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Check for two start calls and make sure they end up on the same state.\n\t\t\t\t\t\t * This is Media Player specific and might need to be changed \n\t\t\t\t\t\t * add for conditional checks for other examples. \n\t\t\t\t\t\t * For Android Media Player, calling start after the first call to start\n\t\t\t\t\t\t * doesn't lead to a transition to a new state. So that needs to be specifically handled.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tboolean exceptionCase = false;\n\t\t\t\t\t\tif(prefix.contains(\"$\")){\n\t\t\t\t\t\t\tint lastIndex = prefix.lastIndexOf(\"$\");\n\t\t\t\t\t\t\tString lastCall = prefix.substring(lastIndex+1, prefix.length()-1);\n\t\t\t\t\t\t\tif(lastCall.contains(\"start()\") && results.get(i).contains(\"start()\")){\n\t\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t\t\texceptionCase = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}if(!exceptionCase){\n\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Add all the final transitions to the automaton object\n\t\t */\n\t\tfor(Transition transition: prefixStateMap){\n\t\t\thypothesis.addTransition(transition);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Populate the Tree representation of the Automaton by doing a breadth-first search\n\t\t */\n\t\tint i = 0;\n\t\twhile(i<hypothesis.getNumberStates()){\n\t\t\tList<Transition> successorDetails = new ArrayList<>();\n\t\t\tfor(Transition transition: prefixStateMap){\n\t\t\t\tint startState = transition.getCurrentState();\n\t\t\t\tif(startState==i){\n\t\t\t\t\tsuccessorDetails.add(transition);\n\t\t\t\t\tautomatonTree.put(startState, successorDetails);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(automatonTree);\n\t\treturn hypothesis;\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18656, \"facing=north\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18657, \"facing=north\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18658, \"facing=south\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18659, \"facing=south\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18660, \"facing=west\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18661, \"facing=west\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18662, \"facing=east\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18663, \"facing=east\", \"waterlogged=false\"));\n }", "void state_REQState(){\r\n eccState = INDEX_REQState;\r\n alg_REQAlg();\r\n CNF.serviceEvent(this);\r\n state_START();\r\n}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5568, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5569, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5570, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5571, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5572, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5573, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5574, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5575, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5576, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5577, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5578, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5579, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5580, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5581, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5582, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5583, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5584, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5585, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5586, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5587, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5588, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5589, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5590, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5591, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5592, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5593, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5594, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5595, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5596, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5597, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5598, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5599, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5600, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5601, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5602, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5603, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5604, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5605, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5606, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5607, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5608, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5609, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5610, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5611, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5612, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5613, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5614, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5615, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5616, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5617, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5618, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5619, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5620, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5621, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5622, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5623, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5624, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5625, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5626, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5627, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5628, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5629, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5630, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5631, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5632, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5633, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5634, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5635, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5636, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5637, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5638, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5639, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5640, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5641, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5642, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5643, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5644, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5645, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5646, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5647, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n }", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public HashMap<String,ArrayList<Rule_in_State>> get_rules_of_next_state() throws Exception;", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "private void loadRandomState() {\n patternName = \"Random\";\n\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n\n generations = 0;\n }", "@Test\n\tpublic void test() {\n\t\tRandomVariableDefinition RV_DEF_X = new RandomVariableDefinition(\"DEF_X\", Arrays.asList(\"x0\", \"x1\", \"x2\"));\n\t\tRandomVariableDefinition RV_DEF_Y = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"y0\", \"y1\"));\n\t\tRandomVariableDefinition RV_DEF_Z = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"z0\", \"z1\"));\n\n\t\t///////////////////////////////////\n\t\t// define the local probability models\n\t\tLocalProbabilityModel X = new LocalProbabilityModel(\"X\");\n\t\tLocalProbabilityModel Y = new LocalProbabilityModel(\"Y\");\n\t\tLocalProbabilityModel Z = new LocalProbabilityModel(\"Z\");\n\t\tLocalProbabilityModel X1 = new LocalProbabilityModel(\"X1\");\n\t\tLocalProbabilityModel X2 = new LocalProbabilityModel(\"X2\");\n\t\tLocalProbabilityModel X3 = new LocalProbabilityModel(\"X3\");\n\t\tLocalProbabilityModel X7 = new LocalProbabilityModel(\"X7\");\n\t\t\n\t\t////////////////////////////////\n\t\t// specify target variable type, and dependencies\n\t\t\n\t\t// two a-priori variables - target only, no dependencies\n\t\tX.setTargetAndDependencies(RV_DEF_X, null);\n\t\tY.setTargetAndDependencies(RV_DEF_Y, null);\n\t\t\n\t\t// a LPM conditionally dependent on two variables\n\t\tZ.setTargetAndDependencies(RV_DEF_Z, Arrays.asList(X, Y));\n\n\t\t// a LPM conditionally dependent on several variables of the same type\n\t\tX3.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X1, X2));\n\n\t\t// a LPM conditionally dependent on itself (i.e. a state variable)\n\t\tX7.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X7));\n\n\t\n\t\t// the first has no dependencies just values\n\t\tX.setValue(\"x0\", 0.6);\n\t\tX.setValue(\"x1\", 0.1);\n\t\tX.setValue(\"x2\", 0.1);\n\n\t\t// the second has dependencies\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\n\t\t// the third has a recurrent dependency\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\t\n\t\t\n\t\t\n\t\t/* NOTE - should we enforce that a conditional probability should always be 'set' with requirement that the conditioning variables should all be identified ? */\n\t\t// this would be Z.setValue(\n\t//\tZ.setValue(Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")),\n\t//\t\t\tArrays.asList(\n\t//\t\t\t\t\t\"z0\", 0.5,\n\t//\t\t\t\t\t\"z1\", 0.3,\n\t//\t\t\t\t\t\"z2\", 0.7));\n\n\n\n\t\tString s = Z.toString();\n\t\tSystem.out.println(\"==============\\n\" + s);\n\n\t\tSystem.out.println(\"done\");\n\n\n\t}", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void initiaLizeRequirements() {\n\n\t\ttry {\n\t\t\tstFoodDataEntry = cnFoodDataEntry.createStatement();\n\n\t\t\tString sql = \"select energysourceid, unit, conversionfactor from energysourcedetail where energysourceid in (select sourceid from energysource where energytypeid =\"\n\t\t\t\t\t+ FOOD + \") order by energysourceid asc\";\n\t\t\trsFoodDataEntry = stFoodDataEntry.executeQuery(sql);\n\n\t\t\tMap<String, Double> unitConversionF = null;\n\t\t\t// List<Map<String, Double>> listUnitConversionF;\n\t\t\tenergySourceDetail = new LinkedHashMap<Integer, Map<String, Double>>();\n\n\t\t\tint energysourceId;\n\t\t\tString unit;\n\t\t\tDouble coversionFactor;\n\n\t\t\twhile (rsFoodDataEntry.next()) {\n\t\t\t\tenergysourceId = rsFoodDataEntry.getInt(\"energysourceid\");\n\t\t\t\tunit = rsFoodDataEntry.getString(\"unit\");\n\t\t\t\tcoversionFactor = rsFoodDataEntry.getDouble(\"conversionfactor\");\n\n\t\t\t\tif (energySourceDetail.containsKey(energysourceId)) {\n\t\t\t\t\tenergySourceDetail.remove(energysourceId);\n\t\t\t\t} else {\n\t\t\t\t\tunitConversionF = new LinkedHashMap<String, Double>();\n\t\t\t\t}\n\t\t\t\tunitConversionF.put(unit, coversionFactor);\n\t\t\t\tenergySourceDetail.put(energysourceId, unitConversionF);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public State(Variable[][] old){\n complete = false;\n int minSize = 6;\n table = new Variable[5][5];\n for (int i=0;i<5;i++){\n for (int j=0;j<5;j++){\n table[i][j] = new Variable(old[i][j]);\n if (table[i][j].domains.size()<minSize&&!table[i][j].visited){\n minSize = table[i][j].domains.size();\n onOperate = table[i][j];\n }\n }\n }\n onOperate.iterator = onOperate.domains.iterator();\n onOperate.visited = true;\n }", "private void initProbs(final double recombinationProb, final double errorProb) {\n\n initialProbs = new EnumMap<>(IBDState.class);\n initialProbs.put(IBDState.ZERO, Math.log10(.33));\n initialProbs.put(IBDState.ONE, Math.log10(.33));\n initialProbs.put(IBDState.TWO, Math.log10(.33));\n\n transitionProbs = new EnumMap<>(IBDState.class);\n transitionProbs.put(IBDState.ZERO, new Double[]{Math.log10((1 - recombinationProb) - (errorProb / 2)), Math.log10(recombinationProb - (errorProb / 2)), Math.log10(errorProb)});\n transitionProbs.put(IBDState.ONE, new Double[]{Math.log10((recombinationProb / 2)), Math.log10(1 - recombinationProb), Math.log10(recombinationProb / 2)});\n transitionProbs.put(IBDState.TWO, new Double[]{Math.log10(errorProb), Math.log10(recombinationProb - (errorProb / 2)), Math.log10((1 - recombinationProb) - (errorProb / 2))});\n }", "public G20ConstraintFunction_h8() {\n }", "public interface StatePac {\n\n /**\n * Identify the leaf of StatePac.\n */\n public enum LeafIdentifier {\n /**\n * Represents operationalState.\n */\n OPERATIONALSTATE(1),\n /**\n * Represents administrativeControl.\n */\n ADMINISTRATIVECONTROL(2),\n /**\n * Represents adminsatratveState.\n */\n ADMINSATRATVESTATE(3),\n /**\n * Represents lifecycleState.\n */\n LIFECYCLESTATE(4);\n\n private int leafIndex;\n\n public int getLeafIndex() {\n return leafIndex;\n }\n\n LeafIdentifier(int value) {\n this.leafIndex = value;\n }\n }\n\n /**\n * Returns the attribute operationalState.\n *\n * @return operationalState value of operationalState\n */\n OperationalState operationalState();\n\n /**\n * Returns the attribute administrativeControl.\n *\n * @return administrativeControl value of administrativeControl\n */\n AdministrativeControl administrativeControl();\n\n /**\n * Returns the attribute adminsatratveState.\n *\n * @return adminsatratveState value of adminsatratveState\n */\n AdministrativeState adminsatratveState();\n\n /**\n * Returns the attribute lifecycleState.\n *\n * @return lifecycleState value of lifecycleState\n */\n LifecycleState lifecycleState();\n\n /**\n * Returns the attribute valueLeafFlags.\n *\n * @return valueLeafFlags value of valueLeafFlags\n */\n BitSet valueLeafFlags();\n\n /**\n * Returns the attribute yangStatePacOpType.\n *\n * @return yangStatePacOpType value of yangStatePacOpType\n */\n OnosYangOpType yangStatePacOpType();\n\n /**\n * Returns the attribute selectLeafFlags.\n *\n * @return selectLeafFlags value of selectLeafFlags\n */\n BitSet selectLeafFlags();\n\n /**\n * Returns the attribute yangAugmentedInfoMap.\n *\n * @return yangAugmentedInfoMap value of yangAugmentedInfoMap\n */\n Map<Class<?>, Object> yangAugmentedInfoMap();\n\n\n /**\n * Returns the attribute yangAugmentedInfo.\n *\n * @param classObject value of yangAugmentedInfo\n * @return yangAugmentedInfo\n */\n Object yangAugmentedInfo(Class classObject);\n\n /**\n * Checks if the leaf value is set.\n *\n * @param leaf leaf whose value status needs to checked\n * @return result of leaf value set in object\n */\n boolean isLeafValueSet(LeafIdentifier leaf);\n\n /**\n * Checks if the leaf is set to be a selected leaf.\n *\n * @param leaf if leaf needs to be selected\n * @return result of leaf value set in object\n */\n boolean isSelectLeaf(LeafIdentifier leaf);\n\n /**\n * Builder for statePac.\n */\n interface StatePacBuilder {\n /**\n * Returns the attribute operationalState.\n *\n * @return operationalState value of operationalState\n */\n OperationalState operationalState();\n\n /**\n * Returns the attribute administrativeControl.\n *\n * @return administrativeControl value of administrativeControl\n */\n AdministrativeControl administrativeControl();\n\n /**\n * Returns the attribute adminsatratveState.\n *\n * @return adminsatratveState value of adminsatratveState\n */\n AdministrativeState adminsatratveState();\n\n /**\n * Returns the attribute lifecycleState.\n *\n * @return lifecycleState value of lifecycleState\n */\n LifecycleState lifecycleState();\n\n /**\n * Returns the attribute valueLeafFlags.\n *\n * @return valueLeafFlags value of valueLeafFlags\n */\n BitSet valueLeafFlags();\n\n /**\n * Returns the attribute yangStatePacOpType.\n *\n * @return yangStatePacOpType value of yangStatePacOpType\n */\n OnosYangOpType yangStatePacOpType();\n\n /**\n * Returns the attribute selectLeafFlags.\n *\n * @return selectLeafFlags value of selectLeafFlags\n */\n BitSet selectLeafFlags();\n\n /**\n * Returns the attribute yangAugmentedInfoMap.\n *\n * @return yangAugmentedInfoMap value of yangAugmentedInfoMap\n */\n Map<Class<?>, Object> yangAugmentedInfoMap();\n\n /**\n * Returns the builder object of operationalState.\n *\n * @param operationalState value of operationalState\n * @return operationalState\n */\n StatePacBuilder operationalState(OperationalState operationalState);\n\n /**\n * Returns the builder object of administrativeControl.\n *\n * @param administrativeControl value of administrativeControl\n * @return administrativeControl\n */\n StatePacBuilder administrativeControl(AdministrativeControl administrativeControl);\n\n /**\n * Returns the builder object of adminsatratveState.\n *\n * @param adminsatratveState value of adminsatratveState\n * @return adminsatratveState\n */\n StatePacBuilder adminsatratveState(AdministrativeState adminsatratveState);\n\n /**\n * Returns the builder object of lifecycleState.\n *\n * @param lifecycleState value of lifecycleState\n * @return lifecycleState\n */\n StatePacBuilder lifecycleState(LifecycleState lifecycleState);\n\n /**\n * Returns the builder object of yangStatePacOpType.\n *\n * @param yangStatePacOpType value of yangStatePacOpType\n * @return yangStatePacOpType\n */\n StatePacBuilder yangStatePacOpType(OnosYangOpType yangStatePacOpType);\n\n /**\n * Sets the value of yangAugmentedInfo.\n *\n * @param value value of yangAugmentedInfo\n * @param classObject value of yangAugmentedInfo\n */\n StatePacBuilder addYangAugmentedInfo(Object value, Class classObject);\n\n /**\n * Returns the attribute yangAugmentedInfo.\n *\n * @param classObject value of yangAugmentedInfo\n * @return yangAugmentedInfo\n */\n Object yangAugmentedInfo(Class classObject);\n /**\n * Set a leaf to be selected.\n *\n * @param leaf leaf needs to be selected\n * @return builder object for select leaf\n */\n StatePacBuilder selectLeaf(LeafIdentifier leaf);\n\n /**\n * Builds object of statePac.\n *\n * @return statePac\n */\n StatePac build();\n }\n}", "public TStateTable () {\r\n\t m_users = new TIDIndex();\r\n\t m_resources = new TIDIndex();\r\n\t m_associations = new TUseStatus[INITIAL_MAX_RESOURCES_COUNT][INITIAL_MAX_USERS_COUNT];\r\n\t for (int a=0; a<INITIAL_MAX_RESOURCES_COUNT; a++)\r\n\t for (int b=0; b<INITIAL_MAX_USERS_COUNT; b++)\r\n\t m_associations[a][b] = null;\r\n\t m_current_max_users = INITIAL_MAX_USERS_COUNT;\r\n\t m_current_max_resources = INITIAL_MAX_RESOURCES_COUNT;\r\n\t m_current_users_count = 0;\r\n\t m_current_resources_count = 0;\r\n }", "public static POMDPState sampleInitialStates(Domain d) {\n\t\tPOMDPState s = new POMDPState();\n\n\t\t//Retrieve object classes from the domain.\n\t\tObjectClass containerClass = d.getObjectClass(Names.CLASS_CONTAINER);\n\t\tObjectClass babyClass = d.getObjectClass(Names.CLASS_BABY);\n\t\tObjectClass contentClass = d.getObjectClass(Names.CLASS_CONTENT);\n\t\tObjectClass humanClass = d.getObjectClass(Names.CLASS_HUMAN);\n\n\t\t//Create all the objects \n\t\tObjectInstance caregiver = new ObjectInstance(humanClass, Names.OBJ_CAREGIVER);\n\t\tObjectInstance baby = new ObjectInstance(babyClass, Names.OBJ_BABY);\n\t\tObjectInstance ointment = new ObjectInstance(contentClass, Names.OBJ_OINTMENT);\n\t\tObjectInstance oldClothes = new ObjectInstance(contentClass, Names.OBJ_OLD_CLOTHES);\n\t\tObjectInstance newClothes = new ObjectInstance(contentClass, Names.OBJ_NEW_CLOTHES);\n\t\tObjectInstance changingTable = new ObjectInstance(containerClass, Names.OBJ_CHANGING_TABLE);\n\t ObjectInstance hamper = new ObjectInstance(containerClass, Names.OBJ_HAMPER);\n\t\tObjectInstance sideTable = new ObjectInstance(containerClass, Names.OBJ_SIDE_TABLE);\n\t ObjectInstance dresser = new ObjectInstance(containerClass, Names.OBJ_DRESSER);\n\n\t\t//Set the \tproper values for objects' attributes\n\t\tchangingTable.setValue(Names.ATTR_OPEN, 1);\n\t hamper.setValue(Names.ATTR_OPEN, 1);\n\t\tsideTable.setValue(Names.ATTR_OPEN, 1);\n\t\tdresser.setValue(Names.ATTR_OPEN, 0);\n\t\tbaby.setValue(Names.ATTR_RASH, new java.util.Random().nextBoolean() ? 1 : 0);\n\n\t\t//Place contents in the proper initial container\n\t\tplaceObject(newClothes, dresser);\n\t\tplaceObject(oldClothes, changingTable);\n\t\tplaceObject(ointment, sideTable);\n\n\t\t//Add objects to the state, and have the caregiver decide on its mental state\n\t\taddObjects(s, caregiver, baby, oldClothes, newClothes, changingTable, hamper, sideTable, dresser, ointment);\n\t\tcaregiverThink(d, s);\n\n\t\t//Et voila\n\t\treturn s;\n\t}", "protected void computeInitialTournamentState(int roundNumber) {\n\t\tcomputePresentPleyers();\n\t\tcomputeCurrentResults(roundNumber);\n\t\tcomputeCollorHistory(roundNumber);\n\t\tcomputePartnersHistory(roundNumber);\n\t\tcomputeUpfloatCounts(roundNumber);\n\t\tcomputeDlownFloatCounts(roundNumber);\n\t}", "private void generateSteps() {\n for (GlobalState g : this.globalStates) {\n List<String> faults = g.getPendingFaults(); \n if(faults.isEmpty()) {\n // Identifying all available operation transitions (when there \n // are no faults), and adding them as steps\n List<String> gSatisfiableReqs = g.getSatisfiableReqs();\n \n for(Node n : nodes) {\n String nName = n.getName();\n String nState = g.getStateOf(nName);\n List<Transition> nTau = n.getProtocol().getTau().get(nState);\n for(Transition t : nTau) {\n boolean firable = true;\n for(String req : t.getRequirements()) {\n if(!(gSatisfiableReqs.contains(n.getName() + \"/\" + req)))\n firable = false;\n }\n if(firable) {\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, t.getTargetState());\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,t.getOperation(),next));\n }\n }\n }\n } else {\n // Identifying all settling handlers for handling the faults\n // pending in this global state\n for(Node n: nodes) {\n // Computing the \"targetState\" of the settling handler for n\n String targetState = null;\n \n String nName = n.getName();\n String nState = g.getStateOf(nName);\n Map<String,List<String>> nRho = n.getProtocol().getRho();\n \n List<String> nFaults = new ArrayList();\n for(String req : nRho.get(nState)) {\n if(faults.contains(nName + \"/\" + req)) \n nFaults.add(req);\n }\n\n // TODO : Assuming handlers to be complete \n\n if(nFaults.size() > 0) {\n Map<String,List<String>> nPhi = n.getProtocol().getPhi();\n for(String handlingState : nPhi.get(nState)) {\n // Check if handling state is handling all faults\n boolean handles = true;\n for(String req : nRho.get(handlingState)) {\n if(nFaults.contains(req))\n handles = false;\n }\n\n // TODO : Assuming handlers to be race-free\n\n // Updating targetState (if the handlingState is \n // assuming a bigger set of requirements)\n if(handles) {\n if(targetState == null || nRho.get(handlingState).size() > nRho.get(targetState).size())\n targetState = handlingState;\n }\n }\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, targetState);\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,next));\n }\n }\n }\n }\n }", "private void initializeMaps(){\n\t\t\n\t\tsteps = new HashMap<Integer, Set<PlanGraphStep>>();\n\t\tfacts = new HashMap<Integer, Set<PlanGraphLiteral>>();\n\t\tinconsistencies = new HashMap<Integer, Set<LPGInconsistency>>();\n\t\t\n\t\tfor(int i = 0; i <= maxLevel; i++) {\n\t\t\tsteps.put(i, new HashSet<PlanGraphStep>());\n\t\t\tfacts.put(i, new HashSet<PlanGraphLiteral>());\n\t\t\tinconsistencies.put(i, new HashSet<LPGInconsistency>());\n\t\t}\n\t\t\n\t\t/* This level holds only the special action end which has the goals as preconditions */\n\t\tsteps.put(maxLevel + 1, new HashSet<PlanGraphStep>());\n\t}", "@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 }", "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 minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "private static void generateState() {\n byte[] array = new byte[7]; // length is bounded by 7\n new Random().nextBytes(array);\n STATE = new String(array, Charset.forName(\"UTF-8\"));\n }", "public static void MCLSPIFB(){\n\t\tMountainCar mcGen = new MountainCar(); // default: reward 100 on the right side and 0 everywhere else\n\t\t\n\t\t\n\t\t// Define terminal function and reward function\t\n\t\tStateConditionTest terminalTest = new StateConditionTest() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean satisfies(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\t\n\t\tTerminalFunction tf = new TerminalFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean isTerminal(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn terminalTest.satisfies(s);\n\t\t\t}\n\t\t};\n\t\t\n\t\tRewardFunction rf = /*new GoalBasedRF(tf, 100, 0);*/\n\t\t\t\tnew RewardFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic double reward(State s1, Action a, State s2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s2.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn 100;\n\t\t\t\t}\n\t\t\t\tif ((Double)s2.get(\"x\") == mcGen.physParams.xmin) {\n\t\t\t\t\treturn -100;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t};\n\t\tmcGen.setRf(rf);\n\t\tSADomain domain = mcGen.generateDomain();\n\t\tSystem.out.println(\"physParams:\\n===========================\");\n\t\tSystem.out.println(\"xmin:\" + mcGen.physParams.xmin + \", xmax:\" + mcGen.physParams.xmax + \", vallypos:\" + mcGen.physParams.valleyPos());\n\t\tSystem.out.println(\"vmin:\" + mcGen.physParams.vmin + \", vmax:\" + mcGen.physParams.vmax);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate data from random state\n\t\tStateGenerator rstateGenerator = new MCRandomStateGenerator(mcGen.physParams);\n\t\tSARSCollector collector = new SARSCollector.UniformRandomSARSCollector(domain);\n\t\tSARSData dataset = collector.collectNInstances(rstateGenerator, domain.getModel(), 5000, 20, null);\n\n\t\t\n\t\tSARS xData = dataset.get(0);\n\t\tMCState xState = (MCState) xData.s;\n\t\tMCState xState2 = (MCState) xData.sp;\n\t\tSystem.out.println(\"s: x:\" + xState.x\n\t\t\t\t+ \", v:\" + xState.v + \n\t\t\t\t\", action:\" + xData.a.actionName() + \n\t\t\t\t\", reward:\" + xData.r);\n\t\tSystem.out.println(\"s': x:\" + xState2.x\n\t\t\t\t+ \", v:\" + xState2.v);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate 5000 SARS tuple instances for our dataset.\n\t\t// Car state generator for no more than 20 steps at a time or until we hit a terminal state.\n\t\t\n\t\t// Generate Fourier Basis\n\t\t// Fourier Basis: mapping from states to features\n\t\tNormalizedVariableFeatures inputFeatures = new NormalizedVariableFeatures()\n\t\t\t\t.variableDomain(\"x\", new VariableDomain(mcGen.physParams.xmin, mcGen.physParams.xmax))\n\t\t\t\t.variableDomain(\"v\", new VariableDomain(mcGen.physParams.vmin, mcGen.physParams.vmax));\n\t\tFourierBasis fBasis = new FourierBasis(inputFeatures, 4); // order(4) means the number of basis functions\n\t\t\n\t\t// Instantiate LSPI\n\t\t// LSPI needs mapping from state to action features, so\n\t\t// first define a state feature representation, \n\t\t// and then construct state-action features by taking the cross product of those features with each action\n\t\tLSPI lspi = new LSPI(domain, 0.99, new DenseCrossProductFeatures(fBasis, 3), dataset); // 3: number of actions: FORWARD, COSTA, BACKWARD\n\t\tPolicy policy = lspi.runPolicyIteration(30, 1e-6);\n\t\t\n\t\t// Visualization\n\t\tMCState laststate = new MCState(mcGen.physParams.valleyPos(), 0);\n\t\tSystem.out.println(\"===========================\\nState process according to policy:\\n\");\n\n\t\t\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tif (terminalTest.satisfies(laststate)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tAction curAction = policy.action(laststate);\n\t\t\tMCModel model = new MCModel(mcGen.physParams);\n\t\t\tMCState curState = (MCState) model.sample(laststate, curAction);\n\t\t\tif (i % 10 == 0) {\n\t\t\t\tSystem.out.println(\"State \" + i +\n\t\t\t\t\t\t\":\\tx = \" + laststate.x + \n\t\t\t\t\t\t\";\\tv = \" + laststate.v + \n\t\t\t\t\t\t\";\\taction = \" + curAction.actionName());\n\t\t\t}\t\t\t\n\t\t\tlaststate = curState;\n\t\t}\n\t\tVisualizer visualizer = MountainCarVisualizer.getVisualizer(mcGen);\n\t\tVisualActionObserver vo = new VisualActionObserver(visualizer);\n\t\tvo.initGUI();\n\t\t\n\t\tSimulatedEnvironment environment = new SimulatedEnvironment(domain, new MCState(mcGen.physParams.valleyPos(), 0));\n\t\tenvironment.addObservers(vo);\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tPolicyUtils.rollout(policy, environment);\n\t\t\tenvironment.resetEnvironment();\n\t\t}\n\t\tSystem.out.println(\"Finished\");\n\t\tSystem.out.println(policy.action(new MCState(0.05, -8)));\n\t}", "BGPv4FSMState state();", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6900, \"inverted=true\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6901, \"inverted=true\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6902, \"inverted=true\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6903, \"inverted=true\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6904, \"inverted=true\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6905, \"inverted=true\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6906, \"inverted=true\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6907, \"inverted=true\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6908, \"inverted=true\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6909, \"inverted=true\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6910, \"inverted=true\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6911, \"inverted=true\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6912, \"inverted=true\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6913, \"inverted=true\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6914, \"inverted=true\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6915, \"inverted=true\", \"power=15\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6916, \"inverted=false\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6917, \"inverted=false\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6918, \"inverted=false\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6919, \"inverted=false\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6920, \"inverted=false\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6921, \"inverted=false\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6922, \"inverted=false\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6923, \"inverted=false\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6924, \"inverted=false\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6925, \"inverted=false\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6926, \"inverted=false\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6927, \"inverted=false\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6928, \"inverted=false\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6929, \"inverted=false\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6930, \"inverted=false\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6931, \"inverted=false\", \"power=15\"));\n }", "private static void setUpInit(Map<GdlSentence, ExternalizedStateComponent> components,\n\t\t\tExternalizedStateConstant trueComponent, ExternalizedStateConstant falseComponent) {\n\t\tExternalizedStateProposition initProposition = new ExternalizedStateProposition(GdlPool.getProposition(INIT_CAPS));\n\t\tfor(Entry<GdlSentence, ExternalizedStateComponent> entry : components.entrySet()) {\n\t\t\t//Is this something that will be true?\n\t\t\tif(entry.getValue() == trueComponent) {\n\t\t\t\tif(entry.getKey().getName().equals(INIT)) {\n\t\t\t\t\t//Find the corresponding true sentence\n\t\t\t\t\tGdlSentence trueSentence = GdlPool.getRelation(TRUE, entry.getKey().getBody());\n\t\t\t\t\t//System.out.println(\"True sentence from init: \" + trueSentence);\n\t\t\t\t\tExternalizedStateComponent trueSentenceComponent = components.get(trueSentence);\n\t\t\t\t\tif(trueSentenceComponent.getInputs().isEmpty()) {\n\t\t\t\t\t\t//Case where there is no transition input\n\t\t\t\t\t\t//Add the transition input, connect to init, continue loop\n\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\tExternalizedStateTransition transition = new ExternalizedStateTransition(true);\n\t\t\t\t\t\t//init goes into transition\n\t\t\t\t\t\ttransition.addInput(initProposition);\n\t\t\t\t\t\tinitProposition.addOutput(transition);\n\t\t\t\t\t\t//transition goes into component\n\t\t\t\t\t\ttrueSentenceComponent.addInput(transition);\n\t\t\t\t\t\ttransition.addOutput(trueSentenceComponent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//The transition already exists\n\t\t\t\t\t\tExternalizedStateComponent transition = trueSentenceComponent.getSingleInput();\n\n\t\t\t\t\t\t//We want to add init as a thing that precedes the transition\n\t\t\t\t\t\t//Disconnect existing input\n\t\t\t\t\t\tExternalizedStateComponent input = transition.getSingleInput();\n\t\t\t\t\t\t//input and init go into or, or goes into transition\n\t\t\t\t\t\tinput.removeOutput(transition);\n\t\t\t\t\t\ttransition.removeInput(input);\n\t\t\t\t\t\tList<ExternalizedStateComponent> orInputs = new ArrayList<ExternalizedStateComponent>(2);\n\t\t\t\t\t\torInputs.add(input);\n\t\t\t\t\t\torInputs.add(initProposition);\n\t\t\t\t\t\torify(orInputs, transition, falseComponent);\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\t((ExternalizedStateTransition) transition).setDependingOnInit(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15071, \"face=floor\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15072, \"face=floor\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15073, \"face=floor\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15074, \"face=floor\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15075, \"face=wall\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15076, \"face=wall\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15077, \"face=wall\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15078, \"face=wall\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15079, \"face=ceiling\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15080, \"face=ceiling\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15081, \"face=ceiling\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15082, \"face=ceiling\", \"facing=east\"));\n }", "public void initState() {\n\n\t\tdouble bsc_p = 0.09; // TODO : doit dependre du souffle !?\n\t\tfor (int i=0; i<n; i++) lambda[i] = 0;\n\t\taddBSCnoise(lambda, bsc_p); \n\t\t// lambda: log likelihood ratio\n\t\tcalc_q0(lambda);\n\n\t\t// initialization of beta\n\t\tfor (int i = 0; i <= m - 1; i++) {\n\t\t\tfor (int j = 0; j <= row_weight[i] - 1; j++) {\n\t\t\t\tbeta[i][j] = 0.0;\n\t\t\t}\n\t\t}\t\t\n\n\t}", "public State(Variable[][] old, boolean bool){\n complete = false;\n int minSize = 6;\n table = new Variable[5][5];\n for (int i=0;i<5;i++){\n for (int j=0;j<5;j++){\n table[i][j] = new Variable(old[i][j]);\n if (!table[i][j].visited){\n onOperate = table[i][j];\n }\n }\n }\n onOperate.iterator = onOperate.domains.iterator();\n onOperate.visited = true;\n }", "public void InitializeConstraints(boundkey[] bkc, double[] blc, NodesVector nvector, PipesVector pvector,\n\t\t\tTapsVector tvector, double outflow, double PrixMax, double lcom) {\n\t\tNodes nodes;\n\t\tPipes pipes;\n\t\tTaps taps;\n\n\t\t/* Contraintes sur les Nodes - taps */\n\t\tfor (int i = 0; i < (NbNodes - NbTaps - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\tCste[i] = -nodes.height;\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les Taps */\n\t\tfor (int i = NbNodes - NbTaps - 1; i < (NbNodes - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\ttaps = (Taps) tvector.elementAt(i - (NbNodes - NbTaps - 1));\n\n\t\t\tif (taps.orifice == Orifices.MAXDIAM) {\n\t\t\t\tCste[i] = -nodes.height - ((outflow * outflow) / taps.faucetCoef);\n\t\t\t} else {\n\t\t\t\tCste[i] = (-nodes.height\n\t\t\t\t\t\t- (outflow * outflow * ((1 / taps.faucetCoef) + Math.pow(CoefOrif / taps.orifice, 4))));\n\t\t\t}\n\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les longueurs des Pipes */\n\t\tfor (int i = NbNodes - 1; i < (m - 1); i++) {\n\t\t\tpipes = (Pipes) pvector.elementAt(i - NbNodes + 1);\n\n\t\t\tCste[i] = pipes.length;\n\n\t\t\tbkc[i] = mosek.boundkey.fx;\n\t\t\tblc[i] = Cste[i];\n\t\t}\n\n\t\t/* contrainte de prix max */\n\t\tCste[m - 1] = PrixMax;\n\t\tbkc[m - 1] = mosek.boundkey.up;\n\t\tblc[m - 1] = -1.0e30;\n\t}", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "private void setInitialAndFinalStates() {\n for (int i = 0; i < dfaStates.size(); i++) {\n List<State> currStateList = dfaStates.get(i);\n for (int j = 0; j < currStateList.size(); j++) {\n if (currStateList.get(j).getFinal()) {\n if (!finalStates.contains(dfaStatesWithNumbering.get(currStateList))) {\n finalStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n if (currStateList.get(j).getInitial()) {\n initialStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n }\n }", "public void randomizeState() {\n\t\t//System.out.print(\"Randomizing State: \");\n\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\tfor(int i = 0; i<9; i++)// adds 0-8 to list\n\t\t\tlst.add(i);\n\t\tCollections.shuffle(lst);//randomizes list\n\t\tString str=\"\";\n\t\tfor(Integer i : lst)\n\t\t\tstr += String.valueOf(i);\n\t\t//System.out.println(str);\n\t\tcurrent = new PuzzleState(str,current.getString(current.getGoalState()));\n\t\t//pathCost++;\n\t}", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "SpacecraftState getInitialState() throws OrekitException;", "public static ArrayList genStates(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(int n = 0; n<=10; n++){\n for(int b = 0; b<=3; b++){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += notes.get(n);\n state += beat.get(b);\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "public long[] getState() {\n return new long[] {(long)Cg0, (long)Cg1, (long)Cg2,\n (long)Cg3, (long)Cg4, (long)Cg5};\n }", "IfaceState createState(int nlocal,IfaceSafetyStatus sts);", "public TemporalState getSetTemporalState(TemporalState ts, TemporalState last_state, FSA lts, Statement statement, ArrayList<Statement> s,HashSet<TemporalState> initial_states, HashSet<TemporalState> final_states){\n\t\t\tTemporalStateNode node=getSetTemporalStateNode(s);\n\t\t\tTemporalState state=null;\n\t\t\t \n\t\t\t \n\t\t\tboolean fusion=false;\n\t\t\tboolean blem=false;\n\t\t\tfor(TemporalState temp:node.states){\n\t\t\t\tboolean ok=false;\n\t\t\t\tif (mode>=0){\n\t\t\t\t\tif (temp.checkConstraintsCompatibility(ts)){\n\t\t\t\t\t\tok=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (mode==-2){\n\t\t\t\t\t\tok=temp.exactLoChecking(ts,last_state,lts,statement,initial_states,final_states);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tok=temp.approxLoChecking(ts,last_state,lts,statement);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(statement);\n\t\t\t\t//temp.display(false);\n\t\t\t\t//ts.display(false);\n\t\t\t\t\n\t\t\t\tif (ok){\n\t\t\t\t\tstate=temp;\n\t\t\t\t\tfusion=true;\n\t\t\t\t\t//System.out.println(\"fusion \"+ts+\" avec \"+temp);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"pas de fusion de \"+ts+\" avec \"+temp);\n\t\t\t\t\t//System.out.println(\"pas fusion\");\n\t\t\t\t\tblem=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!fusion){\n\t\t\t\tstate=new TemporalState(ts.requiredPast,ts.requiredFuture,ts.ensuredPast,ts.ensuredFuture,ts.past,ts.future);\n\t\t\t\t/*state.beganFutureSequences=ts.beganFutureSequences;\n\t\t\t\tstate.beganPastSequences=ts.beganPastSequences;\n\t\t\t\tstate.forbidenFuture=ts.forbidenFuture;\n\t\t\t\tstate.forbidenPast=ts.forbidenPast;*/\n\t\t\t\tnode.states.add(state);\n\t\t\t\tlts.addState(state);\n\t\t\t}\n\t\t\t\n\t\t\tif (last_state!=null){\n\t\t\t\tTransition tr=new Transition(last_state,statement,state);\n\t\t\t\tlts.addTransition(tr);\n\t\t\t}\n\t\t\t\n\t\t\tif (mode>=0){\n\t\t\t\tif(updateMode==0){\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> requiredFuture=TemporalState.union(state.requiredFuture,ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> past=TemporalState.intersect(state.past,ts.past);\n\t\t\t\t\tHashSet<Sequence> future=TemporalState.intersect(state.future,ts.future);\n\t\t\t\t\tHashSet<Sequence> lrequiredPast=TemporalState.copy(requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\tlrequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(lrequiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tstate.updateRequiredPast(requiredPast);\n\t\t\t\t\tstate.updateRequiredFuture(requiredFuture);\n\t\t\t\t\tstate.updateFuture(future);\n\t\t\t\t\tstate.updatePast(past);\n\t\t\t\t\n\t\t\t\t\tts.updatePast(past);\n\t\t\t\t\tts.updateRequiredFuture(requiredFuture);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\trequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(requiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tHashSet<Sequence> srp=TemporalState.copy(state.requiredPast);\n\t\t\t\t\tHashSet<Sequence> srf=TemporalState.copy(state.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> sp=TemporalState.copy(state.past);\n\t\t\t\t\tHashSet<Sequence> sf=TemporalState.copy(state.future);\n\t\t\t\t\tHashSet<Sequence> trp=TemporalState.copy(ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> trf=TemporalState.copy(ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> tp=TemporalState.copy(ts.past);\n\t\t\t\t\tHashSet<Sequence> tf=TemporalState.copy(ts.future);\n\t\t\t\t\t\n\t\t\t\t\tstate.updateRequiredPast(TemporalState.firstMinusSecond(trp,srp),1);\n\t\t\t\t\tstate.updateRequiredFuture(TemporalState.firstMinusSecond(trf,srf),1);\n\t\t\t\t\tstate.updatePast(TemporalState.firstMinusSecond(sp,tp),1);\n\t\t\t\t\tstate.updateFuture(TemporalState.firstMinusSecond(sf,tf),1);\n\t\t\t\t\t\n\t\t\t\t\tts.updateRequiredFuture(TemporalState.firstMinusSecond(srf,trf),1);\n\t\t\t\t\tts.updatePast(TemporalState.firstMinusSecond(tp,sp),1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t/*if (NewTemporalState.mode>=0){\n\t\t\t\t\n\t\t\t}*/\n\t\t\t/*else{\n\t\t\t\tSystem.out.println(\"Ensure ok\");\n\t\t\t}*/\n\t\t\t//\n\t\t\t//System.out.println(\"fin\"+lts.getStates().size());\n\t\t\t/*if (blem){\n\t\t\t\tGenerateDOT.printDot(lts, \"a.dot\");\n\t\t\t\tReader reader = new InputStreamReader(System.in);\n\t\t\t\tBufferedReader input = new BufferedReader(reader);\n\t\t\t\tSystem.out.print(\"tapez touche pour continuer\");\n\t\t\t\ttry{\n\t\t\t\t\tString ok = input.readLine();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e){System.out.println(e);}\n\t\t\t}*/\n\t\t\t\n\t\t\treturn(state);\n\t\t}", "State(Main aMain) {\n\tmain = aMain;\n\tback = Integer.parseInt(main.myProps.getProperty(\"yesterdays\"));\n\tfront = Integer.parseInt(main.myProps.getProperty(\"tomorrows\"));\n\tmaps = new Hashtable();\n availWeath = new Hashtable();\n\n main.myFrw.listen(new MapListener(), ScaledMap.TYPE, null);\n main.myFrw.announce(this);\n stateDoc = Framework.parse(main.myPath + \"state.xml\", \"state\");\n availWeath = loadFromDoc();\n }", "public static void runStaticSimulation(String path) {\n HashMap<String, Integer> lowerBounds = readInFJSSBounds();\n\n Objective objective = MAKESPAN;\n// List<AbstractRule> sequencingRules = new ArrayList();\n// List<AbstractRule> routingRules = new ArrayList();\n\n //objectives.add(Objective.MAKESPAN);\n //AbstractRule sequencingRule = new FCFS(RuleType.SEQUENCING);\n AbstractRule sequencingRule = new FCFS(RuleType.SEQUENCING);\n AbstractRule routingRule = new WIQ(RuleType.ROUTING);\n System.out.println(\"Running static simulation for objective: \"+objective.getName());\n System.out.println(\"Sequencing rule: \"+sequencingRule.getName());\n System.out.println(\"Routing rule: \"+routingRule.getName());\n\n //routingRules.add(GPRule.readFromLispExpression(RuleType.ROUTING,\" (+ (max WIQ DD) (- (/ AT PT) (min SL NOR)))\"));\n\n //routingRules.add(new SBT(RuleType.ROUTING));\n //sequencingRules.add(GPRule.readFromLispExpression(RuleType.SEQUENCING,\" (+ (min (min (max (min WIQ t) (max NOR SL)) MRT) (max DD WKR)) (* (+ SL SL) (- WIQ PT)))\"));\n //sequencingRules.add(GPRule.readFromLispExpression(RuleType.SEQUENCING,\" (/ WKR rDD)\"));\n// routingRules.add(GPRule.readFromLispExpression(RuleType.ROUTING,\" (max (max NINQ PT) (max (- (/ (min t NINQ)\" +\n// \" (max AT W)) (min (max NOR FDD) (* MRT (- SL W)))) AT))\"));\n\n// sequencingRules.add(new AVPRO(RuleType.SEQUENCING));\n// sequencingRules.add(new CR(RuleType.SEQUENCING));\n// sequencingRules.add(new EDD(RuleType.SEQUENCING));\n// sequencingRules.add(new FCFS(RuleType.SEQUENCING));\n// sequencingRules.add(new FDD(RuleType.SEQUENCING));\n// sequencingRules.add(new LCFS(RuleType.SEQUENCING));\n// sequencingRules.add(new LPT(RuleType.SEQUENCING));\n// sequencingRules.add(new LWKR(RuleType.SEQUENCING));\n// sequencingRules.add(new MOPNR(RuleType.SEQUENCING));\n// sequencingRules.add(new MWKR(RuleType.SEQUENCING));\n// sequencingRules.add(new NPT(RuleType.SEQUENCING));\n// sequencingRules.add(new PW(RuleType.SEQUENCING));\n// sequencingRules.add(new SL(RuleType.SEQUENCING));\n// sequencingRules.add(new Slack(RuleType.SEQUENCING));\n// sequencingRules.add(new SPT(RuleType.SEQUENCING));\n//\n// sequencingRules.add(new ATC(RuleType.SEQUENCING));\n// sequencingRules.add(new COVERT(RuleType.SEQUENCING));\n// sequencingRules.add(new CRplusPT(RuleType.SEQUENCING));\n// sequencingRules.add(new LWKRplusPT(RuleType.SEQUENCING));\n// sequencingRules.add(new OPFSLKperPT(RuleType.SEQUENCING));\n// sequencingRules.add(new PTplusPW(RuleType.SEQUENCING));\n// sequencingRules.add(new PTplusPWplusFDD(RuleType.SEQUENCING));\n// sequencingRules.add(new SlackperOPN(RuleType.SEQUENCING));\n// sequencingRules.add(new SlackperRPTplusPT(RuleType.SEQUENCING));\n//\n// sequencingRules.add(new WATC(RuleType.SEQUENCING));\n// sequencingRules.add(new WCOVERT(RuleType.SEQUENCING));\n// sequencingRules.add(new WSPT(RuleType.SEQUENCING));\n//\n// //add work center specific rules, as other rules will always give the same values\n// routingRules.add(new LBT(RuleType.ROUTING));\n// routingRules.add(new LRT(RuleType.ROUTING));\n// routingRules.add(new NIQ(RuleType.ROUTING));\n// routingRules.add(new SBT(RuleType.ROUTING));\n// routingRules.add(new SRT(RuleType.ROUTING));\n// routingRules.add(new WIQ(RuleType.ROUTING));\n\n //get the Filenames of all static FJSS instances in the relevant directory\n List<Path> directoryNames = getDirectoryNames(new ArrayList(), Paths.get(path),\".fjs\");\n\n //List<String> instanceFileNames = getFileNames(new ArrayList(), Paths.get(path), \".fjs\");\n for (int i = 0; i < directoryNames.size(); ++i) {\n Path directoryName = directoryNames.get(i);\n List<String> instanceFileNames = getFileNames(new ArrayList(), directoryName, \".fjs\");\n int numInstances = instanceFileNames.size();\n System.out.println(numInstances +\" FJSS instances in \"+directoryName.toString());\n double[] makeSpanRatios = new double[numInstances];\n for (int j = 0; j < numInstances; ++j) {\n String instanceFileName = instanceFileNames.get(j);\n //System.out.println(\"\\nInstance \"+(i+1)+\" - Path: \"+instanceFileName);\n double objectiveVal =\n calculateFitness(instanceFileName, objective, sequencingRule, routingRule);\n String formattedFileName = formatFileName(instanceFileName);\n double lowerBound = lowerBounds.get(formattedFileName);\n double ratio = objectiveVal/lowerBound;\n makeSpanRatios[j] = ratio;\n }\n double ratioSum = 0.0;\n for (int j = 0; j < numInstances; ++j) {\n ratioSum += makeSpanRatios[j];\n }\n System.out.println(\"Mean lb/objective value is: \"+ratioSum/numInstances);\n System.out.println();\n }\n\n //want to be able to feed in a sequencing rule and a routing rule\n //and be able to find out the makespan of that pair on a given instance\n //should then store that, as well a ratio of that to the lower bound,\n //in a file, and aggregate by directory\n\n //EvaluateOutput(\"/out/rule_comparisons/\", \"RR\");\n }", "public BranchAndBound() {\n this.timeFi = Long.parseLong(\"2000000000000\");;\n this.numSoluciones = 0;\n }", "public String toString()\n {\n \tint tempIndex;\n \tStringBuilder statesStr = new StringBuilder(\"States: { \");\n \tfor(ComplexState state: states)\n \t\tstatesStr.append(state.getName() + \", \");\n\t\ttempIndex = statesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tstatesStr.deleteCharAt(statesStr.lastIndexOf(\",\"));\n \tstatesStr.append(\"}\\n\");\n \tStringBuilder initStatesStr = new StringBuilder(\"Initial states: { \");\n \tfor(ComplexState state: initialStates)\n \t\tinitStatesStr.append(state.getName() + \", \");\n \ttempIndex = initStatesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tinitStatesStr.deleteCharAt(initStatesStr.lastIndexOf(\",\"));\n \tinitStatesStr.append(\"}\\n\");\n \tStringBuilder transitionFuncStr = new StringBuilder(\"Transition relation: { \");\n \tArrayList<ComplexState> destStates = new ArrayList<ComplexState>();\n \tfor(ComplexState srcState: states) \n \t{\n \t\tdestStates = transitionRelation.get(srcState);\n \t\tif(destStates != null)\n\t \t\tfor(ComplexState destState: destStates)\n\t \t\t\ttransitionFuncStr.append(\"( \" + srcState.getName() + \", \" + destState.getName() + \" ), \" );\t\n \t}\n \ttempIndex = transitionFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\ttransitionFuncStr.deleteCharAt(transitionFuncStr.lastIndexOf(\",\"));\n \ttransitionFuncStr.append(\"}\\n\");\n \tStringBuilder labelingFuncStr = new StringBuilder(\"Labeling function: { \");\n \tArrayList<AtomicProp> atomicProps = new ArrayList<AtomicProp>();\n \tfor(ComplexState state: states) \n \t{\n \t\tlabelingFuncStr.append(\"( \" + state.getName() + \", { \");\n \t\tatomicProps = state.getLabels();\n \t\tif(atomicProps != null)\n \t\t\tfor(AtomicProp ap: state.getLabels())\n \t\t\t\tlabelingFuncStr.append(ap.getName() + \", \");\n \t\ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \t\tlabelingFuncStr.append(\"} ), \");\n \t}\n \ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \tlabelingFuncStr.append(\"}\\n\"); \t\n \tString result = statesStr.toString() + initStatesStr.toString() + transitionFuncStr.toString() + labelingFuncStr.toString() + \"Type: \" + type.toString();\n \treturn result;\n }", "@Override\r\n\tpublic void init() { \r\n\t\t\r\n\t\tsession = -1;\r\n\t\t\r\n\t\tProgressDif = 0;\r\n\t\tnoisFact = 0;\r\n\t\tcompromiseFact = 0;\r\n\t\t\r\n\t\tcompromiseLearn = 20;\r\n\t\tprogressLearn = 10;\r\n\t\tnoisLearn = 0.2;\r\n\t\t\r\n\t\treservationPanic = 0.2;\r\n\t\tmyBids = new ArrayList<Pair<Bid,Double>>();\r\n\t\topponentBidsA = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\t\topponentBidsB = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\r\n\t\tdf = utilitySpace.getDiscountFactor();\r\n\t\tif (df==0) df = 1; \r\n\r\n\t\ttry {\r\n\t\t\tinitStates();\r\n\t\t} catch (Exception e) {\r\n \t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t}", "public void preCalculateCollisions(){\n for(int i = 0; i < ALL_POSSIBLE_STATES.length; i++){\n collisions[i] = new StateMapEntry();\n collisions[i].incomingState = ALL_POSSIBLE_STATES[i];\n collisions[i].resultingState = calculateAllPossibleOutboundStates(ALL_POSSIBLE_STATES[i], ALL_POSSIBLE_STATES);\n //collisions[i].print();\n }\n }", "T transformToAndValidateInitialState(VendingMachine vendingMachine);", "public int \r\nomStudent_ObjectConstraints( View mStudent,\r\n Integer Event,\r\n Integer State )\r\n{\r\n zVIEW wXferO = new zVIEW( );\r\n int RESULT = 0;\r\n //:VIEW lTermLST BASED ON LOD lTermLST\r\n zVIEW lTermLST = new zVIEW( );\r\n //:VIEW lTermLST2 BASED ON LOD lTermLST\r\n zVIEW lTermLST2 = new zVIEW( );\r\n //:VIEW mUser BASED ON LOD mUser\r\n zVIEW mUser = new zVIEW( );\r\n //:VIEW mStudentT BASED ON LOD mStudent\r\n zVIEW mStudentT = new zVIEW( );\r\n //:VIEW sAppMgr BASED ON LOD sAppMgr\r\n zVIEW sAppMgr = new zVIEW( );\r\n //:VIEW mStuChgH BASED ON LOD mStuChgH\r\n zVIEW mStuChgH = new zVIEW( );\r\n //:VIEW mStuChgH2 BASED ON LOD mStuChgH\r\n zVIEW mStuChgH2 = new zVIEW( );\r\n //:VIEW mStuChgL BASED ON LOD mStuChgL\r\n zVIEW mStuChgL = new zVIEW( );\r\n //:STRING ( 20 ) szCollegeTerm\r\n String szCollegeTerm = null;\r\n //:STRING ( 50 ) szAnticipatedGradPeriod\r\n String szAnticipatedGradPeriod = null;\r\n //:STRING ( 50 ) szOriginalValue\r\n String szOriginalValue = null;\r\n //:STRING ( 50 ) szNewValue\r\n String szNewValue = null;\r\n //:STRING ( 1 ) szChangeFlag\r\n String szChangeFlag = null;\r\n //:STRING ( 8 ) szCurrentDate\r\n String szCurrentDate = null;\r\n //:STRING ( 1 ) szCurrentAcademicLevel\r\n String szCurrentAcademicLevel = null;\r\n //:SHORT nRC\r\n int nRC = 0;\r\n int lTempInteger_0 = 0;\r\n String szTempString_0 = null;\r\n int lTempInteger_1 = 0;\r\n String szTempString_1 = null;\r\n int lTempInteger_2 = 0;\r\n int lTempInteger_3 = 0;\r\n int lTempInteger_4 = 0;\r\n int lTempInteger_5 = 0;\r\n int lTempInteger_6 = 0;\r\n int lTempInteger_7 = 0;\r\n int lTempInteger_8 = 0;\r\n int lTempInteger_9 = 0;\r\n int lTempInteger_10 = 0;\r\n int lTempInteger_11 = 0;\r\n int lTempInteger_12 = 0;\r\n int lTempInteger_13 = 0;\r\n int lTempInteger_14 = 0;\r\n int lTempInteger_15 = 0;\r\n int lTempInteger_16 = 0;\r\n int lTempInteger_17 = 0;\r\n int lTempInteger_18 = 0;\r\n int lTempInteger_19 = 0;\r\n int lTempInteger_20 = 0;\r\n int lTempInteger_21 = 0;\r\n zVIEW vTempViewVar_0 = new zVIEW( );\r\n int lTempInteger_22 = 0;\r\n\r\n RESULT = GetViewByName( wXferO, \"wXferO\", mStudent, zLEVEL_TASK );\r\n\r\n //:CASE Event\r\n switch( Event )\r\n { \r\n //:OF zOCE_ACTIVATE:\r\n case zOCE_ACTIVATE :\r\n\r\n// if ( lTempInteger_16 == 0 )\r\n// return 0;\r\n// \r\n// View v = mStudent.activateOiFromFile( \"mStudent\", \"testdata/ZENCAs/mstudent_ac.por\" );\r\n// boolean c = v.equalsOi( mStudent );\r\n \r\n //:// Order the Retention, Transcript and Residency data in reverse date order.\r\n //:OrderEntityForView( mStudent, \"RetentionRisk\", \"CreationDate D\" )\r\n OrderEntityForView( mStudent, \"RetentionRisk\", \"CreationDate D\" );\r\n //:OrderEntityForView( mStudent, \"TranscriptRequest\", \"CreationDate D\" )\r\n OrderEntityForView( mStudent, \"TranscriptRequest\", \"CreationDate D\" );\r\n //:OrderEntityForView( mStudent, \"TermOfResidence\", \"BeginDate D\" )\r\n OrderEntityForView( mStudent, \"TermOfResidence\", \"BeginDate D\" );\r\n\r\n //:// Order Student Major/Degree Track according to Ranking.\r\n //:IF mStudent.StudentMajorDegreeTrack EXISTS\r\n lTempInteger_0 = CheckExistenceOfEntity( mStudent, \"StudentMajorDegreeTrack\" );\r\n if ( lTempInteger_0 == 0 )\r\n { \r\n //:IF mStudent.StudentMajorDegreeTrack.Ranking > 0\r\n if ( CompareAttributeToInteger( mStudent, \"StudentMajorDegreeTrack\", \"Ranking\", 0 ) > 0 )\r\n { \r\n //:OrderEntityForView( mStudent, \"StudentMajorDegreeTrack\", \"Ranking A\" )\r\n OrderEntityForView( mStudent, \"StudentMajorDegreeTrack\", \"Ranking A\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Build Chapel Attendance Summary entries.\r\n //:GET VIEW lTermLST NAMED \"lTermLST\"\r\n RESULT = GetViewByName( lTermLST, \"lTermLST\", mStudent, zLEVEL_TASK );\r\n //:CreateViewFromView( lTermLST2, lTermLST )\r\n CreateViewFromView( lTermLST2, lTermLST );\r\n //:FOR EACH mStudent.ChapelSession \r\n RESULT = mStudent.cursor( \"ChapelSession\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:SET CURSOR FIRST mStudent.ChapelAttendanceByTerm \r\n //: WHERE mStudent.ChapelAttendanceByTerm.CollegeTerm = mStudent.CollegeTerm.YearSemester \r\n {StringBuilder sb_szTempString_0;\r\n if ( szTempString_0 == null )\r\n sb_szTempString_0 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_0 = new StringBuilder( szTempString_0 );\r\n GetStringFromAttribute( sb_szTempString_0, mStudent, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_0 = sb_szTempString_0.toString( );}\r\n RESULT = mStudent.cursor( \"ChapelAttendanceByTerm\" ).setFirst( \"CollegeTerm\", szTempString_0 ).toInt();\r\n //:IF RESULT < zCURSOR_SET\r\n if ( RESULT < zCURSOR_SET )\r\n { \r\n //:CREATE ENTITY mStudent.ChapelAttendanceByTerm\r\n RESULT = CreateEntity( mStudent, \"ChapelAttendanceByTerm\", zPOS_AFTER );\r\n //:// We keep CollegeYear and Semester for sorting purposes.\r\n //:szCollegeTerm = mStudent.CollegeTerm.YearSemester\r\n {MutableInt mi_lTempInteger_1 = new MutableInt( lTempInteger_1 );\r\n StringBuilder sb_szCollegeTerm;\r\n if ( szCollegeTerm == null )\r\n sb_szCollegeTerm = new StringBuilder( 32 );\r\n else\r\n sb_szCollegeTerm = new StringBuilder( szCollegeTerm );\r\n GetVariableFromAttribute( sb_szCollegeTerm, mi_lTempInteger_1, 'S', 21, mStudent, \"CollegeTerm\", \"YearSemester\", \"\", 0 );\r\n lTempInteger_1 = mi_lTempInteger_1.intValue( );\r\n szCollegeTerm = sb_szCollegeTerm.toString( );}\r\n //:mStudent.ChapelAttendanceByTerm.CollegeTerm = szCollegeTerm\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeTerm\", szCollegeTerm );\r\n //:mStudent.ChapelAttendanceByTerm.CollegeYear = szCollegeTerm[1:9]\r\n {StringBuilder sb_szTempString_0;\r\n if ( szTempString_0 == null )\r\n sb_szTempString_0 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_0 = new StringBuilder( szTempString_0 );\r\n ZeidonStringCopy( sb_szTempString_0, 1, 0, szCollegeTerm, 1, 9, 21 );\r\n szTempString_0 = sb_szTempString_0.toString( );}\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear\", szTempString_0 );\r\n //:mStudent.ChapelAttendanceByTerm.Semester = mStudent.CollegeTerm.Semester\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"Semester\", mStudent, \"CollegeTerm\", \"Semester\" );\r\n //:SET CURSOR FIRST lTermLST2.CollegeTerm WHERE lTermLST2.CollegeTerm.YearSemester = mStudent.CollegeTerm.YearSemester \r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n GetStringFromAttribute( sb_szTempString_1, mStudent, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n RESULT = lTermLST2.cursor( \"CollegeTerm\" ).setFirst( \"YearSemester\", szTempString_1 ).toInt();\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequired = lTermLST2.CollegeTerm.NumberOfChapelsRequired\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequired\", lTermLST2, \"CollegeTerm\", \"NumberOfChapelsRequired\" );\r\n } \r\n\r\n //:END\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsAttended = mStudent.ChapelAttendanceByTerm.TotalChapelsAttended + 1\r\n {MutableInt mi_lTempInteger_2 = new MutableInt( lTempInteger_2 );\r\n GetIntegerFromAttribute( mi_lTempInteger_2, mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsAttended\" );\r\n lTempInteger_2 = mi_lTempInteger_2.intValue( );}\r\n lTempInteger_3 = lTempInteger_2 + 1;\r\n SetAttributeFromInteger( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsAttended\", lTempInteger_3 );\r\n RESULT = mStudent.cursor( \"ChapelSession\" ).setNext().toInt();\r\n } \r\n\r\n //:END\r\n //:FOR EACH mStudent.OverrideChapelRequirement\r\n RESULT = mStudent.cursor( \"OverrideChapelRequirement\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:SET CURSOR FIRST lTermLST2.CollegeTerm WHERE lTermLST2.CollegeTerm.ID = mStudent.OverrideChapelReqCollegeTerm.ID \r\n {MutableInt mi_lTempInteger_4 = new MutableInt( lTempInteger_4 );\r\n GetIntegerFromAttribute( mi_lTempInteger_4, mStudent, \"OverrideChapelReqCollegeTerm\", \"ID\" );\r\n lTempInteger_4 = mi_lTempInteger_4.intValue( );}\r\n RESULT = lTermLST2.cursor( \"CollegeTerm\" ).setFirst( \"ID\", lTempInteger_4 ).toInt();\r\n //:SET CURSOR FIRST mStudent.ChapelAttendanceByTerm WHERE mStudent.ChapelAttendanceByTerm.CollegeTerm = lTermLST2.CollegeTerm.YearSemester\r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n GetStringFromAttribute( sb_szTempString_1, lTermLST2, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n RESULT = mStudent.cursor( \"ChapelAttendanceByTerm\" ).setFirst( \"CollegeTerm\", szTempString_1 ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:// A ChapelAttendanceByTerm entity already exists for the Term, just add the Override value.\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequiredOverride = mStudent.OverrideChapelRequirement.NumberOfChapelsRequiredForTerm\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequiredOverride\", mStudent, \"OverrideChapelRequirement\", \"NumberOfChapelsRequiredForTerm\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// We need to add the ChapelAttendanceByTerm for the Override Term.\r\n //:CREATE ENTITY mStudent.ChapelAttendanceByTerm\r\n RESULT = CreateEntity( mStudent, \"ChapelAttendanceByTerm\", zPOS_AFTER );\r\n //:szCollegeTerm = lTermLST2.CollegeTerm.YearSemester \r\n {MutableInt mi_lTempInteger_5 = new MutableInt( lTempInteger_5 );\r\n StringBuilder sb_szCollegeTerm;\r\n if ( szCollegeTerm == null )\r\n sb_szCollegeTerm = new StringBuilder( 32 );\r\n else\r\n sb_szCollegeTerm = new StringBuilder( szCollegeTerm );\r\n GetVariableFromAttribute( sb_szCollegeTerm, mi_lTempInteger_5, 'S', 21, lTermLST2, \"CollegeTerm\", \"YearSemester\", \"\", 0 );\r\n lTempInteger_5 = mi_lTempInteger_5.intValue( );\r\n szCollegeTerm = sb_szCollegeTerm.toString( );}\r\n //:mStudent.ChapelAttendanceByTerm.CollegeTerm = szCollegeTerm\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeTerm\", szCollegeTerm );\r\n //:mStudent.ChapelAttendanceByTerm.CollegeYear = szCollegeTerm[1:9]\r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n ZeidonStringCopy( sb_szTempString_1, 1, 0, szCollegeTerm, 1, 9, 21 );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear\", szTempString_1 );\r\n //:mStudent.ChapelAttendanceByTerm.Semester = lTermLST2.CollegeTerm.Semester \r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"Semester\", lTermLST2, \"CollegeTerm\", \"Semester\" );\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequired = lTermLST2.CollegeTerm.NumberOfChapelsRequired \r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequired\", lTermLST2, \"CollegeTerm\", \"NumberOfChapelsRequired\" );\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequiredOverride = mStudent.OverrideChapelRequirement.NumberOfChapelsRequiredForTerm\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequiredOverride\", mStudent, \"OverrideChapelRequirement\", \"NumberOfChapelsRequiredForTerm\" );\r\n } \r\n\r\n RESULT = mStudent.cursor( \"OverrideChapelRequirement\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:DropView( lTermLST2 )\r\n DropView( lTermLST2 );\r\n //:OrderEntityForView( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear D Semester D\" )\r\n OrderEntityForView( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear D Semester D\" );\r\n //:OrderEntityForView( mStudent, \"ChapelSession\", \"Date D\" )\r\n OrderEntityForView( mStudent, \"ChapelSession\", \"Date D\" );\r\n\r\n //:// Generate Degree1 and Degree2 relationships.\r\n //:FOR EACH mStudent.StudentMajorDegreeTrack \r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.DegreeTrackCollegeDegree EXISTS\r\n lTempInteger_6 = CheckExistenceOfEntity( mStudent, \"DegreeTrackCollegeDegree\" );\r\n if ( lTempInteger_6 == 0 )\r\n { \r\n //:IF mStudent.CollegeDegree1 EXISTS\r\n lTempInteger_7 = CheckExistenceOfEntity( mStudent, \"CollegeDegree1\" );\r\n if ( lTempInteger_7 == 0 )\r\n { \r\n //:IF mStudent.CollegeDegree1.ID != mStudent.DegreeTrackCollegeDegree.ID \r\n if ( CompareAttributeToAttribute( mStudent, \"CollegeDegree1\", \"ID\", mStudent, \"DegreeTrackCollegeDegree\", \"ID\" ) != 0 )\r\n { \r\n //:IF mStudent.CollegeDegree2 DOES NOT EXIST\r\n lTempInteger_8 = CheckExistenceOfEntity( mStudent, \"CollegeDegree2\" );\r\n if ( lTempInteger_8 != 0 )\r\n { \r\n //:INCLUDE mStudent.CollegeDegree2 FROM mStudent.DegreeTrackCollegeDegree\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CollegeDegree2\", mStudent, \"DegreeTrackCollegeDegree\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:INCLUDE mStudent.CollegeDegree1 FROM mStudent.DegreeTrackCollegeDegree\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CollegeDegree1\", mStudent, \"DegreeTrackCollegeDegree\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END \r\n } \r\n\r\n //:END\r\n\r\n //:// Build display subobject of Transcript Requests.\r\n //:FOR EACH mStudent.TranscriptRequest\r\n RESULT = mStudent.cursor( \"TranscriptRequest\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:INCLUDE mStudent.DisplayTranscriptRequest FROM mStudent.TranscriptRequest \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"DisplayTranscriptRequest\", mStudent, \"TranscriptRequest\", zPOS_AFTER );\r\n RESULT = mStudent.cursor( \"TranscriptRequest\" ).setNext().toInt();\r\n } \r\n\r\n //:END\r\n //:OrderEntityForView( mStudent, \"DisplayTranscriptRequest\", \"ID A\" )\r\n OrderEntityForView( mStudent, \"DisplayTranscriptRequest\", \"ID A\" );\r\n\r\n //:// Build derived paths for Degree Candidacy relationship to StudentMajorDegreeTrack and CurrentDegreeCandidacy.\r\n //:FOR EACH mStudent.StudentMajorDegreeTrack \r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.SMDT_DegreeCandidacy EXISTS\r\n lTempInteger_9 = CheckExistenceOfEntity( mStudent, \"SMDT_DegreeCandidacy\" );\r\n if ( lTempInteger_9 == 0 )\r\n { \r\n //:SET CURSOR FIRST mStudent.DegreeCandidacy WHERE mStudent.DegreeCandidacy.ID = mStudent.SMDT_DegreeCandidacy.ID \r\n {MutableInt mi_lTempInteger_10 = new MutableInt( lTempInteger_10 );\r\n GetIntegerFromAttribute( mi_lTempInteger_10, mStudent, \"SMDT_DegreeCandidacy\", \"ID\" );\r\n lTempInteger_10 = mi_lTempInteger_10.intValue( );}\r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst( \"ID\", lTempInteger_10 ).toInt();\r\n //:INCLUDE mStudent.MajorTrackDegreeCandidacy FROM mStudent.DegreeCandidacy \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"MajorTrackDegreeCandidacy\", mStudent, \"DegreeCandidacy\", zPOS_AFTER );\r\n //:INCLUDE mStudent.DC_StudentMajorDegreeTrack FROM mStudent.StudentMajorDegreeTrack \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"DC_StudentMajorDegreeTrack\", mStudent, \"StudentMajorDegreeTrack\", zPOS_AFTER );\r\n } \r\n\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:IF mStudent.DegreeCandidacy EXISTS\r\n lTempInteger_11 = CheckExistenceOfEntity( mStudent, \"DegreeCandidacy\" );\r\n if ( lTempInteger_11 == 0 )\r\n { \r\n //:// Se need to set a work date to be used in sorting DegreeCandidacy entries in descending date order, so that the\r\n //:// most recent entry will be first. If there is a null entry, make it first.\r\n //:FOR EACH mStudent.DegreeCandidacy \r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.DC_GraduationDate EXISTS\r\n lTempInteger_12 = CheckExistenceOfEntity( mStudent, \"DC_GraduationDate\" );\r\n if ( lTempInteger_12 == 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DC_GraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DC_GraduationDate\", \"Date\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_13 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_13 == 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DC_AnticipatedGraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DC_AnticipatedGraduationDate\", \"Date\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.DegreeCandidacy.ReceivedDate != \"\"\r\n if ( CompareAttributeToString( mStudent, \"DegreeCandidacy\", \"ReceivedDate\", \"\" ) != 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DegreeCandidacy.ReceivedDate\r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DegreeCandidacy\", \"ReceivedDate\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = \"21000101\"\r\n SetAttributeFromString( mStudent, \"DegreeCandidacy\", \"wSortDate\", \"21000101\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:OrderEntityForView( mStudent, \"DegreeCandidacy\", \"wSortDate D\" )\r\n OrderEntityForView( mStudent, \"DegreeCandidacy\", \"wSortDate D\" );\r\n //:SET CURSOR FIRST mStudent.DegreeCandidacy \r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst().toInt();\r\n //:INCLUDE mStudent.CurrentDegreeCandidacy FROM mStudent.DegreeCandidacy \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CurrentDegreeCandidacy\", mStudent, \"DegreeCandidacy\", zPOS_AFTER );\r\n //:IF mStudent.DC_StudentMajorDegreeTrack EXISTS \r\n lTempInteger_14 = CheckExistenceOfEntity( mStudent, \"DC_StudentMajorDegreeTrack\" );\r\n if ( lTempInteger_14 == 0 )\r\n { \r\n //:INCLUDE mStudent.CDC_StudentMajorDegreeTrack FROM mStudent.DC_StudentMajorDegreeTrack \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CDC_StudentMajorDegreeTrack\", mStudent, \"DC_StudentMajorDegreeTrack\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Drop any Private Categories that are not from this Functional Area.\r\n //:nRC = GetViewByName( sAppMgr, \"sAppMgr\", mStudent, zLEVEL_APPLICATION )\r\n nRC = GetViewByName( sAppMgr, \"sAppMgr\", mStudent, zLEVEL_APPLICATION );\r\n //:IF nRC >= 0 \r\n if ( nRC >= 0 )\r\n { \r\n //:FOR EACH mStudent.Category \r\n RESULT = mStudent.cursor( \"Category\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.Category.PrivateToFunctionalAreaFlag = \"Y\"\r\n if ( CompareAttributeToString( mStudent, \"Category\", \"PrivateToFunctionalAreaFlag\", \"Y\" ) == 0 )\r\n { \r\n //:IF mStudent.Category.FunctionalArea != sAppMgr.FunctionalArea.FunctionalAreaName \r\n if ( CompareAttributeToAttribute( mStudent, \"Category\", \"FunctionalArea\", sAppMgr, \"FunctionalArea\", \"FunctionalAreaName\" ) != 0 )\r\n { \r\n //:DropEntity( mStudent, \"Category\", zREPOS_NONE )\r\n DropEntity( mStudent, \"Category\", zREPOS_NONE );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"Category\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Keep Legal Name for change comparison on COMMIT.\r\n //:mStudent.Student.wOriginalLegalName = mStudent.Student.LegalName\r\n SetAttributeFromAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n break ;\r\n\r\n //: /* end zOCE_ACTIVATE */\r\n //:OF zOCE_ACTIVATE_EMPTY:\r\n case zOCE_ACTIVATE_EMPTY :\r\n break ;\r\n\r\n //: /* end zOCE_ACTIVATE_EMPTY */\r\n //:OF zOCE_COMMIT:\r\n case zOCE_COMMIT :\r\n\r\n \t /*\r\n //:IF mStudent.Student EXISTS\r\n lTempInteger_15 = CheckExistenceOfEntity( mStudent, \"Student\" );\r\n if ( lTempInteger_15 == 0 )\r\n { \r\n\r\n //:// If the Legal Name has been changed, create change entry.\r\n //:IF mStudent.Student.wOriginalLegalName != mStudent.Student.LegalName\r\n if ( CompareAttributeToAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" ) != 0 )\r\n { \r\n //:CREATE ENTITY mStudent.PersonalDataModification \r\n RESULT = CreateEntity( mStudent, \"PersonalDataModification\", zPOS_AFTER );\r\n //:mStudent.PersonalDataModification.OriginalLegalName = mStudent.Student.wOriginalLegalName \r\n SetAttributeFromAttribute( mStudent, \"PersonalDataModification\", \"OriginalLegalName\", mStudent, \"Student\", \"wOriginalLegalName\" );\r\n //:mStudent.PersonalDataModification.NewLegalName = mStudent.Student.LegalName \r\n SetAttributeFromAttribute( mStudent, \"PersonalDataModification\", \"NewLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n //:SetAttributeFromCurrentDateTime( mStudent, \"PersonalDataModification\", \"ModifiedDateTime\" )\r\n //:GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION )\r\n GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION );\r\n //:INCLUDE mStudent.PersonalDataModificationUser FROM mUser.User\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"PersonalDataModificationUser\", mUser, \"User\", zPOS_AFTER );\r\n //:mStudent.Student.wOriginalLegalName = mStudent.Student.LegalName\r\n SetAttributeFromAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n } \r\n\r\n //:END\r\n\r\n //:// Set Graduation Dates in StudentMajorDegreeTrack entries, if a Graduation Date has been set in associated Degree Candidacy.\r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:FOR EACH mStudentT.StudentMajorDegreeTrack \r\n RESULT = mStudentT.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudentT.SMDT_GraduationDate EXISTS\r\n lTempInteger_16 = CheckExistenceOfEntity( mStudentT, \"SMDT_GraduationDate\" );\r\n if ( lTempInteger_16 == 0 )\r\n { \r\n //:IF mStudentT.StudentMajorDegreeTrack.GraduationDate != mStudentT.SMDT_GraduationDate.Date \r\n if ( CompareAttributeToAttribute( mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\", mStudentT, \"SMDT_GraduationDate\", \"Date\" ) != 0 )\r\n { \r\n //:mStudentT.StudentMajorDegreeTrack.GraduationDate = mStudentT.SMDT_GraduationDate.Date\r\n SetAttributeFromAttribute( mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\", mStudentT, \"SMDT_GraduationDate\", \"Date\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudentT.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n\r\n //:// For students that ARE NOT Undergraduate Main Campus, always set ResidencyStatus to Commuter.\r\n //:szCurrentAcademicLevel = mStudent.Student.CurrentLevel\r\n {MutableInt mi_lTempInteger_17 = new MutableInt( lTempInteger_17 );\r\n StringBuilder sb_szCurrentAcademicLevel;\r\n if ( szCurrentAcademicLevel == null )\r\n sb_szCurrentAcademicLevel = new StringBuilder( 32 );\r\n else\r\n sb_szCurrentAcademicLevel = new StringBuilder( szCurrentAcademicLevel );\r\n GetVariableFromAttribute( sb_szCurrentAcademicLevel, mi_lTempInteger_17, 'S', 2, mStudent, \"Student\", \"CurrentLevel\", \"\", 0 );\r\n lTempInteger_17 = mi_lTempInteger_17.intValue( );\r\n szCurrentAcademicLevel = sb_szCurrentAcademicLevel.toString( );}\r\n //:IF mStudent.AdministrativeDivision.ID = 1 AND\r\n //:( szCurrentAcademicLevel = \"1\" OR // Freshman\r\n //:szCurrentAcademicLevel = \"2\" OR // Sophomore\r\n //:szCurrentAcademicLevel = \"3\" OR // Junior\r\n //:szCurrentAcademicLevel = \"4\" OR // Senior\r\n //:szCurrentAcademicLevel = \"7\" OR // Special\r\n //:szCurrentAcademicLevel = \"8\" OR // Freshman-2\r\n //:szCurrentAcademicLevel = \"9\" ) // 5-Yr Senior\r\n if ( CompareAttributeToInteger( mStudent, \"AdministrativeDivision\", \"ID\", 1 ) == 0 && ( ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"1\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"2\", 1, 0, 2 ) == 0 ||\r\n ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"3\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"4\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"7\", 1, 0, 2 ) == 0 ||\r\n ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"8\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"9\", 1, 0, 2 ) == 0 ) )\r\n { \r\n\r\n //:// This is case where student is Main Campus undergraduate.\r\n\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.Student.ResidencyStatus != \"C\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"ResidencyStatus\", \"C\" ) != 0 )\r\n { \r\n //:mStudent.Student.ResidencyStatus = \"C\"\r\n SetAttributeFromString( mStudent, \"Student\", \"ResidencyStatus\", \"C\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Automatically set Student graduation date attributes.\r\n //:IF mStudent.Student.UndergradGraduationDate = \"\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"UndergradGraduationDate\", \"\" ) == 0 )\r\n { \r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:SET CURSOR FIRST mStudentT.DegreeMajorCollege WHERE mStudentT.DegreeMajorCollege.Type = \"U\"\r\n RESULT = mStudentT.cursor( \"DegreeMajorCollege\" ).setFirst( \"Type\", \"U\" ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:mStudent.Student.UndergradGraduationDate = mStudentT.StudentMajorDegreeTrack.GraduationDate \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"UndergradGraduationDate\", mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\" );\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n } \r\n\r\n //:END\r\n //:IF mStudent.Student.GradGraduationDate = \"\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"GradGraduationDate\", \"\" ) == 0 )\r\n { \r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:SET CURSOR FIRST mStudentT.DegreeMajorCollege WHERE mStudentT.DegreeMajorCollege.Type = \"G\"\r\n RESULT = mStudentT.cursor( \"DegreeMajorCollege\" ).setFirst( \"Type\", \"G\" ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:mStudent.Student.GradGraduationDate = mStudentT.StudentMajorDegreeTrack.GraduationDate \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"GradGraduationDate\", mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\" );\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n } \r\n\r\n //:END\r\n\r\n //:// If the Anticipated Grad Date exists, force the Clearing House Grad Date to that value.\r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_18 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_18 == 0 )\r\n { \r\n //:mStudent.Student.ClearingHouseGradDate = mStudent.DC_AnticipatedGraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"ClearingHouseGradDate\", mStudent, \"DC_AnticipatedGraduationDate\", \"Date\" );\r\n } \r\n\r\n //:END\r\n\r\n //:// REGULAR CHANGE LOG\r\n //:// Create the Change Log entry.\r\n //:GenerateTransactionEntryWDesc( mStudent, \"General Student Data\" )\r\n\r\n //:// STUDENT CHANGE LOG AND HISTORY\r\n //:// Generate Student Change Log entries, if something has changed. We will determine this by looking at\r\n //:// the last StudentChangeHistory entry and comparing its values.\r\n //:szAnticipatedGradPeriod = \"\"\r\n {StringBuilder sb_szAnticipatedGradPeriod;\r\n if ( szAnticipatedGradPeriod == null )\r\n sb_szAnticipatedGradPeriod = new StringBuilder( 32 );\r\n else\r\n sb_szAnticipatedGradPeriod = new StringBuilder( szAnticipatedGradPeriod );\r\n ZeidonStringCopy( sb_szAnticipatedGradPeriod, 1, 0, \"\", 1, 0, 51 );\r\n szAnticipatedGradPeriod = sb_szAnticipatedGradPeriod.toString( );}\r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_19 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_19 == 0 )\r\n { \r\n //:szAnticipatedGradPeriod = mStudent.DC_AnticipatedGraduationDate.Name \r\n {MutableInt mi_lTempInteger_20 = new MutableInt( lTempInteger_20 );\r\n StringBuilder sb_szAnticipatedGradPeriod;\r\n if ( szAnticipatedGradPeriod == null )\r\n sb_szAnticipatedGradPeriod = new StringBuilder( 32 );\r\n else\r\n sb_szAnticipatedGradPeriod = new StringBuilder( szAnticipatedGradPeriod );\r\n GetVariableFromAttribute( sb_szAnticipatedGradPeriod, mi_lTempInteger_20, 'S', 51, mStudent, \"DC_AnticipatedGraduationDate\", \"Name\", \"\", 0 );\r\n lTempInteger_20 = mi_lTempInteger_20.intValue( );\r\n szAnticipatedGradPeriod = sb_szAnticipatedGradPeriod.toString( );}\r\n } \r\n\r\n //:END\r\n //:ACTIVATE mStuChgH WHERE mStuChgH.StudentChangeHistory.LastDate = \"\"\r\n //: AND mStuChgH.Student.ID = mStudent.Student.ID \r\n {MutableInt mi_lTempInteger_21 = new MutableInt( lTempInteger_21 );\r\n GetIntegerFromAttribute( mi_lTempInteger_21, mStudent, \"Student\", \"ID\" );\r\n lTempInteger_21 = mi_lTempInteger_21.intValue( );}\r\n omStudent_fnLocalBuildQual_0( mStudent, vTempViewVar_0, lTempInteger_21 );\r\n RESULT = ActivateObjectInstance( mStuChgH, \"mStuChgH\", mStudent, vTempViewVar_0, zSINGLE );\r\n DropView( vTempViewVar_0 );\r\n //:IF RESULT < 0\r\n if ( RESULT < 0 )\r\n { \r\n //:// Since no history record has yet been created, create it here.\r\n //:ACTIVATE mStuChgH EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgH, \"mStuChgH\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgH.StudentChangeHistory \r\n RESULT = CreateEntity( mStuChgH, \"StudentChangeHistory\", zPOS_AFTER );\r\n //:mStuChgH.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:SetAttributeFromCurrentDateTime( mStuChgH, \"StudentChangeHistory\", \"FirstDate\" ) \r\n //:INCLUDE mStuChgH.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgH, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// There is a History entry, so see if anything has changed.\r\n //:szChangeFlag = \"\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n //:GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION )\r\n GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION );\r\n\r\n //:// Student Status\r\n //:IF mStuChgH.StudentChangeHistory.StudentStatus != mStudent.Student.Status \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"Status\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"Status\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"StudentStatus\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"StudentStatus\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Classification (CurrentLevel)\r\n //:IF mStuChgH.StudentChangeHistory.Classification != mStudent.Student.CurrentLevel \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"Classification\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"Classification\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"CurrentLevel\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"CurrentLevel\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"Classification\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"Classification\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Residency Status\r\n //:IF mStuChgH.StudentChangeHistory.ResidencyStatus != mStudent.Student.ResidencyStatus \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"ResidencyStatus\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"ResidencyStatus\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"ResidencyStatus\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"ResidencyStatus\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Financial Hold Flag\r\n //:IF mStuChgH.StudentChangeHistory.FinancialHoldFlag != mStudent.Student.FinancialHoldFlag \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"FinancialHoldFlag\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"FinancialHoldFlag\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"FinancialHoldFlag\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"FinancialHoldFlag\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Administrative Division\r\n //:IF mStuChgH.StudentChangeHistory.AdministrativeDivisionName != mStudent.AdministrativeDivision.Name \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"AdministrativeDivisionName\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"AdministrativeDivisionName\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = mStuChgH.StudentChangeHistory.AdministrativeDivisionName\r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\" );\r\n //:mStuChgL.StudentChangeLog.NewValue = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"NewValue\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Anticipated Graduation Period\r\n //:IF mStuChgH.StudentChangeHistory.AnticipatedGradPeriod != szAnticipatedGradPeriod\r\n if ( CompareAttributeToString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"AnticipatedGradPeriod\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"AnticipatedGradPeriod\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = mStuChgH.StudentChangeHistory.AnticipatedGradPeriod\r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\" );\r\n //:mStuChgL.StudentChangeLog.NewValue = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szAnticipatedGradPeriod );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// If any of the key attributes have changed, then we will:\r\n //:// 1. Create a new Student Change History entry, if the current one was not created today.\r\n //:// 2. Update the current Student Change History entry, if it was created today.\r\n //:IF szChangeFlag = \"Y\"\r\n if ( ZeidonStringCompare( szChangeFlag, 1, 0, \"Y\", 1, 0, 2 ) == 0 )\r\n { \r\n //:szCurrentDate = wXferO.Root.dCurrentDate\r\n {MutableInt mi_lTempInteger_22 = new MutableInt( lTempInteger_22 );\r\n StringBuilder sb_szCurrentDate;\r\n if ( szCurrentDate == null )\r\n sb_szCurrentDate = new StringBuilder( 32 );\r\n else\r\n sb_szCurrentDate = new StringBuilder( szCurrentDate );\r\n GetVariableFromAttribute( sb_szCurrentDate, mi_lTempInteger_22, 'S', 9, wXferO, \"Root\", \"dCurrentDate\", \"\", 0 );\r\n lTempInteger_22 = mi_lTempInteger_22.intValue( );\r\n szCurrentDate = sb_szCurrentDate.toString( );}\r\n //:IF mStuChgH.StudentChangeHistory.FirstDate = szCurrentDate\r\n if ( CompareAttributeToString( mStuChgH, \"StudentChangeHistory\", \"FirstDate\", szCurrentDate ) == 0 )\r\n { \r\n //:// The entry was created today, so just update it.\r\n //:// Note that we can just set all the attributes, without regard to which ones changed,\r\n //:// since this entity is a record of attribute values as of this point in time.\r\n //:mStuChgH.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:COMMIT mStuChgH\r\n RESULT = CommitObjectInstance( mStuChgH );\r\n //:DropObjectInstance( mStuChgH )\r\n DropObjectInstance( mStuChgH );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// The entry was created earlier, so create a new entry with the new values\r\n //:ACTIVATE mStuChgH2 EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgH2, \"mStuChgH\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgH2.StudentChangeHistory \r\n RESULT = CreateEntity( mStuChgH2, \"StudentChangeHistory\", zPOS_AFTER );\r\n //:mStuChgH2.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH2.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH2.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH2.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH2.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH2.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH2, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:SetAttributeFromCurrentDateTime( mStuChgH2, \"StudentChangeHistory\", \"FirstDate\" )\r\n //:INCLUDE mStuChgH2.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgH2, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n\r\n //:// Set the LastDate attribute in the previous history entry to yesterday.\r\n //:SetAttributeFromCurrentDateTime( wXferO, \"Root\", \"WorkDate\" )\r\n //:mStuChgH.StudentChangeHistory.LastDate = wXferO.Root.WorkDate \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"LastDate\", wXferO, \"Root\", \"WorkDate\" );\r\n\r\n //:COMMIT mStuChgH\r\n RESULT = CommitObjectInstance( mStuChgH );\r\n //:COMMIT mStuChgH2\r\n RESULT = CommitObjectInstance( mStuChgH2 );\r\n //:DropObjectInstance( mStuChgH2 )\r\n DropObjectInstance( mStuChgH2 );\r\n //:DropObjectInstance( mStuChgH )\r\n DropObjectInstance( mStuChgH );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n*/\r\n\r\n //:END\r\n break ;\r\n\r\n //: /* end zOCE_COMMIT */\r\n //:OF zOCE_DROPOI:\r\n case zOCE_DROPOI :\r\n break ;\r\n } \r\n\r\n\r\n //: /* end zOCE_DROPOI */\r\n //:END /* case */\r\n return( 0 );\r\n// END\r\n}", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "private void initState() {\r\n double metaintensity=0;\r\n double diffr=0;\r\n for(int ii=0; ii < Config.numberOfSeeds; ii++)\r\n {\r\n Cur_state[ii] = this.seeds[ii].getDurationMilliSec();\r\n// Zeit2 = this.seeds[1].getDurationMilliSec();\r\n// Zeit3 = this.seeds[2].getDurationMilliSec();\r\n// LogTool.print(\"Zeit 1 : \" + Zeit1 + \"Zeit 2 : \" + Zeit2 + \"Zeit 3 : \" + Zeit3, \"notification\");\r\n// LogTool.print(\"initState: Dwelltime Seed \" + ii + \" : \" + Cur_state[ii], \"notification\");\r\n// Cur_state[0] = Zeit1;\r\n// Cur_state[1] = Zeit2;\r\n// Cur_state[2] = Zeit3;\r\n }\r\n \r\n if ((Config.SACostFunctionType==3)||(Config.SACostFunctionType==1)) {\r\n for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) {\r\n for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n// this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n this.body2[x][y][z].metavalue = 0.0;\r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n metaintensity = this.body2[x][y][z].radiationIntensityNoTime((this.seeds2[i].getCoordinate()));\r\n // radiationIntensityNoTime(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (metaintensity>0) {\r\n // LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n // this.body2[x][y][z].addCurrentDosis(metaintensity);\r\n this.body2[x][y][z].metavalue += metaintensity; \r\n// Das ist implementation one\r\n } \r\n } \r\n }\r\n }\r\n// this.body = this.body2;\r\n } else {\r\n \r\n // for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) { \r\n for(int x=0; x < Solver.dimensions[0]; x+= Config.scaleFactor) {\r\n // for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int y=0; y < Solver.dimensions[1]; y+= Config.scaleFactor) {\r\n // for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n for(int z=0; z < Solver.dimensions[2]; z+= Config.scaleFactor) {\r\n // this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n this.body2[x][y][z].metavalue = 0.0;\r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n metaintensity = this.body2[x][y][z].radiationIntensityNoTime((this.seeds2[i].getCoordinate()));\r\n // radiationIntensityNoTime(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (metaintensity>0) {\r\n // LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n // this.body2[x][y][z].addCurrentDosis(metaintensity);\r\n this.body2[x][y][z].metavalue += metaintensity;\r\n this.body[x][y][z].metavalue = 0; \r\n this.body[x][y][z].metavalue += this.body2[x][y][z].metavalue;\r\n // Das ist implementation one\r\n } \r\n } \r\n }\r\n }\r\n// this.body = this.body2;\r\n diffr = ((this.body[43][43][43].metavalue)-(this.body2[43][43][43].metavalue));\r\n LogTool.print(\"Shallowcopy Check, value should be 0 :\" + diffr + \"@ 43,43,43 \",\"notification\");\r\n }\r\n }", "public List<String> getSequentialPlan() {\n // ==========================================\n // Computing the (cheapest) sequence of steps\n // ==========================================\n \n // Maps of steps and cost from the global state s to the others\n Map<GlobalState,List<Step>> steps = new HashMap();\n steps.put(current,new ArrayList());\n Map<GlobalState,Integer> costs = new HashMap();\n costs.put(current,0);\n // List of visited states\n List<GlobalState> visited = new ArrayList();\n visited.add(current);\n\n // List of global states still to be visited\n List<GlobalState> toBeVisited = new ArrayList();\n \n // Adding the states reachable from start to \"toBeVisited\"\n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations towards \"next\" \n List<Step> stepSeq = new ArrayList();\n stepSeq.add(step);\n steps.put(next,stepSeq);\n // Adding the cost of the sequence of operation towards \"next\"\n costs.put(next,step.getCost());\n toBeVisited.add(next);\n }\n \n // Exploring the graph of global states by exploiting \"toBeVisited\"\n while(toBeVisited.size() > 0) {\n // Removing the first global state to be visited and marking it\n // as visited\n GlobalState current = toBeVisited.remove(0);\n visited.add(current);\n \n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations from \"start\" to \"next\"\n // (if more convenient)\n int nextCost = costs.get(current) + step.getCost();\n if(visited.contains(next)) {\n // If current path is cheaper, updates \"steps\" and \"costs\"\n if(costs.get(next) > nextCost) {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next,nextCost);\n }\n } else {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next, nextCost);\n if(!(toBeVisited.contains(next))) toBeVisited.add(next);\n }\n }\n }\n \n // ====================================================\n // Computing the sequence of operations from \"s\" to \"t\"\n // ====================================================\n // If no plan is available, return null\n if(steps.get(target) == null) \n return null;\n // Otherwise, return the corresponding sequence of operations\n List<String> opSequence = new ArrayList();\n for(Step step : steps.get(target)) {\n if(!(step.getReason().contains(Step.handling))) {\n opSequence.add(step.getReason());\n }\n }\n return opSequence;\n }", "private interface WorkPlan {\n Stage PREINIT = new Stage(Messages.LaunchInitializationProcedure_UPDATE_DEBUGGER_STATE, 0.1f);\n Stage SET_OPTIONS = new Stage(Messages.LaunchInitializationProcedure_SET_OPTIONS, 1f);\n Stage LOAD_SCRIPTS = new Stage(Messages.LaunchInitializationProcedure_LOAD_SCRIPTS, 1f);\n Stage SYNCHRONIZE_BREAKPOINTS =\n new Stage(Messages.LaunchInitializationProcedure_SYNCHRONIZE_BREAKPOINTS, 1f);\n\n boolean IS_INITIZALIZED = ProgressUtil.layoutProgressPlan(PREINIT, SET_OPTIONS, LOAD_SCRIPTS,\n SYNCHRONIZE_BREAKPOINTS);\n }", "private void createConstraintsForSingleton() {\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() < 2)\n \t\t\t\tcontinue;\n \n \t\t\tCollection conflictingVersions = conflictingEntries.values();\n \t\t\tString singletonRule = \"\"; //$NON-NLS-1$\n \t\t\tArrayList nonSingleton = new ArrayList();\n \t\t\tint countSingleton = 0;\n \t\t\tfor (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {\n \t\t\t\tIInstallableUnit conflictElt = (IInstallableUnit) conflictIterator.next();\n \t\t\t\tif (conflictElt.isSingleton()) {\n \t\t\t\t\tsingletonRule += \" -1 \" + getVariable(conflictElt); //$NON-NLS-1$\n \t\t\t\t\tcountSingleton++;\n \t\t\t\t} else {\n \t\t\t\t\tnonSingleton.add(conflictElt);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (countSingleton == 0)\n \t\t\t\tcontinue;\n \n \t\t\tfor (Iterator iterator2 = nonSingleton.iterator(); iterator2.hasNext();) {\n \t\t\t\tconstraints.add(singletonRule + \" -1 \" + getVariable((IInstallableUnit) iterator2.next()) + \" >= -1;\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t\tsingletonRule += \" >= -1;\"; //$NON-NLS-1$\n \t\t\tconstraints.add(singletonRule);\n \t\t}\n \t}", "public interface State extends Comparable {\n\n\t/**\n\t * Computes the h value - heuristic grade for this state. This\n\t * method is called only once in the StateImpl class at the moment of\n\t * object creation, the value is stored in an inner variable, and then\n\t * be accessed by getH() method.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double computeHeuristicGrade();\n\n\t/**\n\t * Returns the h value - heuristic grade for this state.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double getH();\n\n\t/**\n\t * Returns the g value - cost of reaching this state from initial state.\n\t *\n\t * @return g value - cost of reaching this state from initial state\n\t */\n\tpublic double getG();\n\n\t/**\n\t * Sets the g value.\n\t *\n\t * @param aG value to be set\n\t */\n\tpublic void setG(double aG);\n\n\t/**\n\t * Returns the f value - sum of g and h values (f = g + h).\n\t *\n\t * @return f value\n\t */\n\tpublic double getF();\n\n\t/**\n\t * Returns the hash code for this state.\n\t *\n\t * @return hash code for this state\n\t */\n\tpublic String getHashCode();\n\n\t/**\n\t * Returns a list of children of this state (in the search tree).\n\t *\n\t * @return list of children of this state\n\t */\n\tpublic List<State> getChildren();\n\n\t/**\n\t * Sets the reference to the children of this state.\n\t *\n\t * @param aChildren reference to the children to be set\n\t */\n\tpublic void setChildren(List<State> aChildren);\n\n\t/**\n\t * Returns the reference to the parent of this state (in the tree)\n\t * or null if this state is the root.\n\t *\n\t * @return reference to the parent of this state\n\t */\n\tpublic State getParent();\n\n\t/**\n\t * Sets the reference to the parent of this state.\n\t *\n\t * @param aParent reference to the parent of this state to be set\n\t */\n\tpublic void setParent(State aParent);\n\n\t/**\n\t * Returns the boolean showing wether this state is admissible.\n\t * (E.g. in sudoku search some states may be inadmissible, so\n\t * their children should not be considered further.)\n\t *\n\t * @return boolean showing wether this state is admissible\n\t */\n\tpublic boolean isAdmissible();\n\n\t/**\n\t * Useful method for games searching algorithms.\n\t * Returns the string name of the root move (at the top of the\n\t * tree) that led to reaching this state.\n\t *\n\t * @return string representing the root move\n\t */\n\tpublic String getRootMove();\n\n\t/**\n\t * Sets the string name of the root move.\n\t *\n\t * @param aMove string name of the root move to be set.\n\t */\n\tpublic void setRootMove(String aMove);\n\n\t/**\n\t * Returns the guaranteed minimum score (payoff) for the maximizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed minimum score for the maximizing player\n\t */\n\tpublic double getAlpha();\n\n\t/**\n\t * Sets the new value for alpha.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aAlpha new value to be set\n\t */\n\tpublic void setAlpha(double aAlpha);\n\n\t/**\n\t * Returns the guaranteed maximum score (loss) for the minimizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed maximum score for the minimizing player\n\t */\n\tpublic double getBeta();\n\n\t/**\n\t * Sets the new value for beta.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aBeta new value to be set\n\t */\n\tpublic void setBeta(double aBeta);\n\n\t/**\n\t * Returns the depth property (how deep in the tree is this state).\n\t *\n\t * @return depth property\n\t */\n\tpublic double getDepth();\n\n\t/**\n\t * Sets the depth property.\n\t *\n\t * @param aDepth depth value to be set\n\t */\n\tpublic void setDepth(double aDepth);\n\n public boolean isSolved();\n}", "private void initializeProblemState()\r\n {\r\n\r\n problemState = new JTextArea(problem.getCurrentState().toString());\r\n problemState.setFont(new Font(Font.MONOSPACED, Font.BOLD, 24));\r\n finalProblemState = new JTextArea(problem.getFinalState().toString());\r\n finalProblemState.setFont(problemState.getFont());\r\n finalStateLabel.setBorder(new TitledBorder(\"Final State\"));\r\n finalStateLabel.setLayout(new FlowLayout());\r\n stateLabel.setBorder(new TitledBorder(\"Current State\"));\r\n stateLabel.setLayout(new FlowLayout());\r\n\r\n if (canvas != null)\r\n {\r\n stateLabel.add(canvas);\r\n canvas.render();\r\n stateLabel.setPreferredSize(new Dimension(canvas.getPreferredSize().width\r\n + DEFAULT_BUTTON_SPACING * 5,\r\n canvas.getPreferredSize().height + DEFAULT_BUTTON_SPACING * 5\r\n ));\r\n } else\r\n {\r\n stateLabel.add(problemState);\r\n stateLabel.setPreferredSize(new Dimension(problemState.getPreferredSize().width\r\n + (problemState.getFont().getSize() / 2),\r\n problemState.getPreferredSize().height + problemState.getFont().getSize() * 5 / 4));\r\n }\r\n if (finalStateCanvas != null)\r\n {\r\n finalStateLabel.add(finalStateCanvas);\r\n finalStateCanvas.render();\r\n finalStateLabel.setPreferredSize(stateLabel.getPreferredSize());\r\n } else\r\n {\r\n finalStateLabel.add(finalProblemState);\r\n finalStateLabel.setPreferredSize(stateLabel.getPreferredSize());\r\n }\r\n }", "public static FA parseFromFile(String path) throws Exception {\n\t\ttry {\n\t\t\tSet<State> states = new HashSet<>();\n\t\t\tSet<Character> alphabet = new HashSet<>();\n\t\t\tSet<Triple<State,Character,State>> transitions = new HashSet<>();\n\t\t\tString departureStName = null;\n\t\t\tString arrivalStName = null;\n\t\t\tSet<String> finalStsNames = new HashSet<>();\n\t\t\tString initialStName = \"\";\n\t\t\tState initialState = null;\n\t\t\tScanner firstScanner = new Scanner(new File(\"tp1/Automatas/\"+path+\".dot\"));\n\t\t\twhile(firstScanner.hasNextLine()) {\n\t\t\t\tString line = firstScanner.nextLine().replaceAll(\"\\\\s+\",\"\");\n\t\t\t\tif (line.contains(\"[shape=doublecircle]\")) {\n\t\t\t\t\tString newLine = line.replace('[', '/');\n\t\t\t\t\tString[] res = newLine.split(\"/\");\n\t\t\t\t\tfinalStsNames.add(res[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfirstScanner.close();\n\t\t\tScanner secondScanner = new Scanner(new File(\"tp1/Automatas/\"+path+\".dot\"));\n\t\t\twhile(secondScanner.hasNextLine()) {\n\t\t\t\tString line = secondScanner.nextLine().replaceAll(\"\\\\s+\",\"\");\n\t\t\t\tif (line.contains(\"inic->\")) {\n\t\t\t\t\tString[] res = line.split(\"->\");\n\t\t\t\t\tinitialStName = res[1].substring(0, res[1].length()-1);\n\t\t\t\t\tif (finalStsNames.contains(initialStName))\n\t\t\t\t\t\tinitialState = new State(initialStName, true, true);\n\t\t\t\t\telse\n\t\t\t\t\t\tinitialState = new State(initialStName, true, false);\n\t\t\t\t\tstates.add(initialState);\n\t\t\t\t}\n\t\t\t\telse if (line.contains(\"->\")) {\n\t\t\t\t\tString newLine = line.replaceAll(\"[->=]\",\"/\");\n\t\t\t\t\tnewLine = newLine.replace('[','/').replace('\"','/');\n\t\t\t\t\tString[] res = newLine.split(\"/\");\n\t\t\t\t\tdepartureStName = res[0];\n\t\t\t\t\tarrivalStName = res[2];\n\t\t\t\t\tCharacter symbol = res[5].charAt(0);\n\t\t\t\t\tState departureState;\n\t\t\t\t\tState arrivalState;\n\t\t\t\t\tif (departureStName.equals(initialStName)) {\n\t\t\t\t\t\tdepartureState = initialState;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (finalStsNames.contains(departureStName))\n\t\t\t\t\t\t\tdepartureState = new State(departureStName, false, true);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdepartureState = new State(departureStName, false, false);\n\t\t\t\t\t\tstates.add(departureState);\n\t\t\t\t\t}\n\t\t\t\t\tif (arrivalStName.equals(initialStName)) {\n\t\t\t\t\t\tarrivalState = initialState;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (finalStsNames.contains(arrivalStName))\n\t\t\t\t\t\t\tarrivalState = new State(arrivalStName, false, true);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tarrivalState = new State(arrivalStName, false, false);\n\t\t\t\t\t\tstates.add(arrivalState);\n\t\t\t\t\t}\n\t\t\t\t\talphabet.add(symbol);\n\t\t\t\t\ttransitions.add(new Triple<>(departureState,symbol,arrivalState));\n\t\t\t\t}\n\t\t\t}\n\t\t\tsecondScanner.close();\n\t\t\tif (alphabet.contains(Lambda))\n\t\t\t\treturn new NFALambda(states, alphabet, transitions);\n\t\t\telse {\n\t\t\t\tfor (Triple<State,Character,State> t1 : transitions) {\n\t\t\t\t\tfor (Triple<State,Character,State> t2 : transitions) {\n\t\t\t\t\t\tif (t1.first().equals(t2.first()) && t1.second().equals(t2.second()) && !t1.third().equals(t2.third())) {\n\t\t\t\t\t\t\treturn new NFA(states, alphabet, transitions);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new DFA(states, alphabet, transitions);\n\t\t\t}\n\t\t}\n\t\tcatch(FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "void createRuleStartAndStopATNStates() {\n atn.ruleToStartState = new RuleStartState[g.rules.size()];\n atn.ruleToStopState = new RuleStopState[g.rules.size()];\n for (Rule r : g.rules.values()) {\n RuleStartState start = newState(RuleStartState.class, r.ast);\n RuleStopState stop = newState(RuleStopState.class, r.ast);\n start.stopState = stop;\n start.isLeftRecursiveRule = r instanceof LeftRecursiveRule;\n start.setRuleIndex(r.index);\n stop.setRuleIndex(r.index);\n atn.ruleToStartState[r.index] = start;\n atn.ruleToStopState[r.index] = stop;\n }\n }", "private List<State> substitueStateSketch(State oldState, Set<Node> components) {\n\n// long start = System.currentTimeMillis();\n\n List<State> ret = new ArrayList<>();\n\n for (Node sk : components) {\n\n State newState = new State(oldState);\n VariableNode v = newState.pp.findSelectedVar();\n v.sketch = sk;\n\n if (sk instanceof NullaryTerminalNode) {\n\n NullaryTerminalNode n = (NullaryTerminalNode) sk;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n if (n.sym.name.equals(\"<any>\")) continue;\n } else if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n newState.cost += Main.NOT_TERMINAL_PATTERN;\n }\n }\n\n newState.pp.numNullaryTerminals++;\n } else if (sk instanceof OperatorNode) {\n if (((OperatorNode) sk).special) newState.cost += Main.SPECIAL_REPEATATLEAST_1;\n\n String opName = ((OperatorNode) sk).operatorName;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n if (!(opName.equals(\"startwith\") || opName.equals(\"endwith\") || opName.equals(\"contain\"))) {\n newState.cost += Main.NOT_NOT_CONTAIN_SW_EW_PATTERN;\n }\n }\n }\n } else {\n\n // do not continue if we are trying to replace argument of notcc with a op node\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n continue;\n }\n }\n }\n\n newState.pp.numOperatorSketch++; // TODO: it might be a problem if we have a rf sketch such as concat(v:contain(v:?{<num>}))\n newState.pp.deselectVar();\n if (evalApprox(newState)) ret.add(newState);\n\n }\n\n return ret;\n\n }", "<C, S> StateExp<C, S> createStateExp();", "private void generateAutomaton() {\n /**\n * Chars in the positions:\n * 0 -> \"-\"\n * 1 -> \"+\"\n * 2 -> \"/\"\n * 3 -> \"*\"\n * 4 -> \")\"\n * 5 -> \"(\"\n * 6 -> \"=\"\n * 7 -> \";\"\n * 8 -> [0-9]\n * 9 -> [A-Za-z]\n * 10 -> skip (\"\\n\", \"\\r\", \" \", \"\\t\")\n * 11 -> other symbols\n */\n\n automaton = new State[][]{\n /* DEAD */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* START */ {State.SUB, State.PLUS, State.DIV, State.MUL, State.RPAR, State.LPAR, State.EQ, State.SMICOLON, State.INT, State.VAR, State.DEAD, State.DEAD},\n /* SUB */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* PLUS */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* DIV */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* MUL */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* RPAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* LPAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* EQ */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* SMICOLON */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* INT */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.INT, State.DEAD, State.DEAD, State.DEAD},\n /* VAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.VAR, State.VAR, State.DEAD, State.DEAD}\n };\n }", "private static String getStateInput() {\n\t\treturn getQuery(\"Valid State\");\n\t}", "@Test\n public void genNeighStateProbability() {\n double[] metrics = new double[STATES.length * STATES.length];\n double sum = 0;\n Random rand = new Random();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (x == y) {\n metrics[i] = 0;\n } else {\n double d = Math.abs(rand.nextGaussian());//Math.exp(-Math.abs(STATES[x] - STATES[y]) / 3) * Math.abs(rand.nextGaussian());\n metrics[i] = d;\n sum += d;\n }\n }\n final double finalSum = sum;\n metrics = DoubleStream.of(metrics).map(d -> d / finalSum).toArray();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (metrics[i] > 0.01) {\n System.out.printf(\"%d:%d:%.4f\\n\", STATES[x], STATES[y], metrics[i]);\n }\n }\n }", "public static int getStartState() {\n int startState = 1;\n int n = 1;\n for (int i = 2; i <= state; i ++) {\n if (stateList.get(i).getN1() == n || stateList.get(i).getN2() == n) {\n startState = i;\n n = i;\n }\n }\n return startState;\n }", "public boolean isUnsat(ConstraintsState pConstraints, String pFunctionName)\n throws SolverException, InterruptedException, UnrecognizedCCodeException {\n\n if (!pConstraints.isEmpty()) {\n try {\n timeForSatChecks.start();\n Set<Constraint> relevantConstraints = new HashSet<>();\n if (performMinimalSatCheck && pConstraints.getLastAddedConstraint().isPresent()) {\n try {\n timeForIndependentComputation.start();\n Constraint lastConstraint = pConstraints.getLastAddedConstraint().get();\n Set<Constraint> leftOverConstraints = new HashSet<>(pConstraints);\n Set<SymbolicIdentifier> newRelevantIdentifiers = lastConstraint.accept(locator);\n Set<SymbolicIdentifier> relevantIdentifiers;\n do {\n relevantIdentifiers = ImmutableSet.copyOf(newRelevantIdentifiers);\n Iterator<Constraint> it = leftOverConstraints.iterator();\n while (it.hasNext()) {\n Constraint currentC = it.next();\n Set<SymbolicIdentifier> containedIdentifiers = currentC.accept(locator);\n if (!Sets.intersection(containedIdentifiers, relevantIdentifiers).isEmpty()) {\n newRelevantIdentifiers = Sets.union(newRelevantIdentifiers, containedIdentifiers);\n relevantConstraints.add(currentC);\n it.remove();\n }\n }\n } while (!newRelevantIdentifiers.equals(relevantIdentifiers));\n\n } finally {\n timeForIndependentComputation.stop();\n }\n\n } else {\n relevantConstraints = pConstraints;\n }\n\n BooleanFormula constraintsAsFormula =\n getFullFormula(\n relevantConstraints, pConstraints.getDefiniteAssignment(), pFunctionName);\n prover = solver.newProverEnvironment(ProverOptions.GENERATE_MODELS);\n prover.push(constraintsAsFormula);\n\n Boolean unsat = null; // assign null to fail fast if assignment is missed\n ImmutableList<ValueAssignment> modelAsAssignment = pConstraints.getModel();\n ImmutableList<ValueAssignment> newModelAsAssignment = ImmutableList.of();\n if (useLastModel) {\n BooleanFormula lastModel =\n modelAsAssignment\n .stream()\n .map(ValueAssignment::getAssignmentAsFormula)\n .collect(booleanFormulaManager.toConjunction());\n prover.push(lastModel);\n unsat = prover.isUnsat();\n if (!unsat) {\n // get this before popping the model assignment ; the operation will be invalid\n // otherwise\n newModelAsAssignment = prover.getModelAssignments();\n }\n // We have to remove the model assignment before resolving definite assignments, below.\n prover.pop(); // Remove model assignment from prover\n }\n\n boolean gotResultFromCache = false;\n\n if (!useLastModel || (unsat && !modelAsAssignment.isEmpty())) {\n // if the last model does not fulfill the formula, and the last model actually\n // is some variable assignment (i.e., model != true), then we check the formula\n // for satisfiability without any assignments, again.\n CacheResult res = cache.getCachedResult(pConstraints);\n\n if (res.isUnsat()) {\n unsat = true;\n gotResultFromCache = true;\n } else if (res.isSat()) {\n unsat = false;\n gotResultFromCache = true;\n pConstraints.setModel(res.getModelAssignment());\n } else {\n prover.close();\n prover = solver.newProverEnvironment(ProverOptions.GENERATE_MODELS);\n prover.push(constraintsAsFormula);\n unsat = prover.isUnsat();\n\n if (!unsat) {\n newModelAsAssignment = prover.getModelAssignments();\n }\n }\n }\n\n if (!gotResultFromCache) {\n if (!unsat) {\n pConstraints.setModel(newModelAsAssignment);\n cache.addSat(pConstraints, newModelAsAssignment);\n // doing this while the complete formula is still on the prover environment stack is\n // cheaper than performing another complete SAT check when the assignment is really\n // requested\n if (resolveDefinites) {\n resolveDefiniteAssignments(pConstraints, newModelAsAssignment, pFunctionName);\n }\n\n } else {\n cache.addUnsat(pConstraints);\n }\n }\n\n return unsat;\n\n } finally {\n closeProver();\n timeForSatChecks.stop();\n }\n\n } else {\n return false;\n }\n }", "private AFD buildAFD() {\n\t\tfor (Cerradura cerradura : cerraduras) {\n\t\t\tEstado origen = getState(cerradura);\n\t\t\tEstado destino = null;\n\n\t\t\tfor (pol.una.py.model.lexico.Cerradura.Subconjunto conjunto : cerradura\n\t\t\t\t\t.getSubconjuntos()) {\n\t\t\t\tString codigoUnico = conjunto.getCodCerradura();\n\t\t\t\t// Conjunto vacio\n\t\t\t\tif (codigoUnico.equals(\"{}\")) {\n\t\t\t\t\tdestino = getStateError();\n\t\t\t\t} else {\n\t\t\t\t\tdestino = getState(getCerradura(codigoUnico));\n\n\t\t\t\t}\n\t\t\t\torigen.addTransition(new Transicion(origen, destino, conjunto\n\t\t\t\t\t\t.getSymbol()));\n\n\t\t\t}\n\t\t\tautomata.addEstado(origen);\n\t\t}\n\t\t// Puede darse el caso de que el estado inicial del AFN no sea mas un\n\t\t// estado inicial, sino un estado de aceptacion. Si no es un estado de\n\t\t// aceptacion, indicamos que es el estado inicial.\n\t\tif (!automata.getInitState().isAcceptation()) {\n\t\t\tautomata.getInitState().setInit(true);\n\t\t}\n\t\treturn automata;\n\t}", "public TestPN2SCValidationBWD() {\r\n\t\tsuper(PetriNetLanguagePackage.eINSTANCE,\r\n\t\t\t\tPetriNetToStatechartIntegrationPackage.eINSTANCE,\r\n\t\t\t\tStatechartLanguagePackage.eINSTANCE);\r\n\t}", "public void buildQuery() {\n\t\tif (constraints.propertyNodes.isEmpty()) {\n\t\t\tconstraints.propertyNodes.add(new AssertStmt(new IntLiteral(1)));\n\t\t}\n\t\t\n\t\tStringBuilder query = new StringBuilder();\n\t\tquery.append(\"(set-logic QF_BV)\\n\");\n\t\t\n\t\tquery.append(\"(define-fun tobv32 ((p Bool)) (_ BitVec 32) (ite p (_ bv1 32) (_ bv0 32)))\\n\");\n\t\tquery.append(\"(define-fun tobool ((p (_ BitVec 32))) Bool (not (= p (_ bv0 32))))\\n\");\n\t\t// Defined more functions above (for convenience), as needed.\n\t\t\n\t\tfor (String varName : constraints.variableNames) {\n\t\t\tquery.append(\"(declare-fun \" + varName + \" () (_ BitVec 32))\\n\");\n\t\t}\n\t\tfor (int i = 0; i < constraints.propertyNodes.size(); ++i) {\n\t\t\tquery.append(\"(declare-fun \" + propName(i) + \" () Bool)\\n\");\n\t\t}\n\t\tfor (AssignStmt stmt : constraints.transitionNodes) {\n\t\t\tquery.append(\"(assert (= \" + stmt.getLhs().getName() + \" \" +\n\t\t\t\t\texprConverter.visit(stmt.getRhs()) + \"))\\n\");\n\t\t}\n\t\tfor (int i = 0; i < constraints.propertyNodes.size(); ++i) {\n\t\t\tAssertStmt stmt = constraints.propertyNodes.get(i);\n\t\t\tif (stmt.isHoudini())\n\t\t\t\thoudiniConditions.add(i);\n\t\t\tif (stmt.isUnwinding())\n\t\t\t\tunwindingConditions.add(propName(i));\n\t\t\t\n \t\t\tString assertionQuery = \"(not (tobool \" + exprConverter.visit(stmt.getCondition()) + \"))\";\n\t\t\tquery.append(\"(assert (= \" + propName(i) + \" \" + assertionQuery + \"))\\n\");\n\t\t}\n\t\tquery.append(\"(assert (or\" + getAllProps() + \"))\\n\");\n\t\t\n\t\tquery.append(\"\\n(check-sat)\\n\");\n\t\t// append all unwinding conditions\n\t\tquery.append(\"(get-value (\" + getAllProps() + \" ))\\n\");\n\t\t\n\t\tqueryString = query.toString();\n\t}", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void translate(){\n\t\tnodeSigs();\n\t\tedgeSigs();\n\t\tpre_source_valid();\n\t\tList<Object> constraints = new ArrayList<Object>();\n\t\tconstraints.addAll(hash.keySet());\n\t\tfor (int i = 0; i < constraints.size() ; i++) {\n\t\t\tfor (int j = i + 1; j < constraints.size() ; j++) {\n\t\t\t\tObject iter = constraints.get(i), iter1 = constraints.get(j);\n\t\t\t\tObject[] overlap = findOverlap(iter, iter1);\n\t\t\t\tif(overlap == null) continue;\n\t\t\t\talloycommands.add(new Object[]{iter, iter1});\n\t\t\t\tbuffer.append(\"run{(\" + hash.get(iter) + \"[] and not \" + hash.get(iter1) + \"[]) or (not \" + hash.get(iter) + \"[] and \" + hash.get(iter1) + \"[])} for 0 but \");\n\t\t\t\tList<Node> nodes = (List<Node>) overlap[0];\n\t\t\t\tList<Arrow> edges = (List<Arrow>) overlap[1];\n\t\t\t\tList<String> strings = new ArrayList<String>();\n\t\t\t\tfor(Node in : nodes){\n\t\t\t\t\tstrings.add(nodeSig(in));\n\t\t\t\t}\n\t\t\t\tfor(Arrow ie : edges){\n\t\t\t\t\tstrings.add(edgeSig(ie));\n\t\t\t\t}\n\t\t\t\tbuffer.append(\"5 \" + strings.get(0));\n\t\t\t\tfor (int k = 1; k < strings.size(); k++) {\n\t\t\t\t\tbuffer.append(\", 5 \" + strings.get(k));\n\t\t\t\t}\n\t\t\t\tbuffer.append(LINE);\n\t\t\t}\n\t\t}\n//\t\tif(check == null)\n//\t\t\tbuffer.append(\"run {}\");\n//\t\telse\n//\t\t\ttranslate(check, \"check\");\n//\t\tbuffer.append(\" for 5\");\n\t\t\t\n\t}", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "private byte[] calculateAllPossibleOutboundStates(byte state, byte[] allPossible){\n int stateNumParticles = calcNumParticlesInState(state);\n int[] stateMomentum = calculateMomentum(state);\n ArrayList<Byte> possibleStates = new ArrayList<>();\n for(byte poss:allPossible){\n int possNumPart = calcNumParticlesInState(poss);\n if(possNumPart==stateNumParticles){\n int[] possMomentum = calculateMomentum(poss);\n if(compareMomenta(possMomentum, stateMomentum)){\n possibleStates.add(poss);\n }\n }\n }\n byte[] ret = new byte[possibleStates.size()];\n int i = 0;\n for(Byte b:possibleStates){\n ret[i++] = b.byteValue();\n }\n return ret;\n }", "public TemplateState(Template template, boolean comparesSatisfied, \r\n boolean indicatorsSatisfied, boolean triggersSatisfied,\r\n int totalNrOfPreconditions, int nrOfMissingPreconditions) {\r\n this.template = template;\r\n this.comparesSatisfied = comparesSatisfied;\r\n this.indicatorsSatisfied = indicatorsSatisfied;\r\n this.triggersSatisfied = triggersSatisfied;\r\n this.totalNrOfPreconditions = totalNrOfPreconditions;\r\n this.nrOfMissingPreconditions = nrOfMissingPreconditions;\r\n }", "private Map<String, Feature> initializeFeatures(GameState state) {\n // initializes the features (values will be set within getFeatures)\n Map<String, Feature> features = new HashMap<>();\n\n // adds the 'global' features\n features.put(FeatureNames.RESOURCES_OWN, new Feature(FeatureNames.RESOURCES_OWN, 0, 0, 20));\n features.put(FeatureNames.RESOURCES_OPP, new Feature(FeatureNames.RESOURCES_OPP, 0, 0, 20));\n features.put(FeatureNames.GAME_TIME, new Feature(FeatureNames.GAME_TIME, 0, 0, 12000));\n features.put(FeatureNames.BIAS, new Feature(FeatureNames.BIAS, 1, 0, 1));\n\n // adds the 'per-quadrant' features\n int horizQuadLength = state.getPhysicalGameState().getWidth() / numQuadrants;\n int vertQuadLength = state.getPhysicalGameState().getHeight() / numQuadrants;\n\n int tilesPerQuadrant = horizQuadLength * vertQuadLength;\n\n // FIXME hardcoded to the HP of the base (which is the highest in microRTS)\n int maxHitPoints = 10;\n\n // the first two for traverse the quadrants\n for (int horizQuad = 0; horizQuad < numQuadrants; horizQuad++) {\n for (int vertQuad = 0; vertQuad < numQuadrants; vertQuad++) {\n\n // the third for traverses the players\n for (int player = 0; player < 2; player++) {\n String healthFeatName = FeatureNames.avgHealthPerQuad(horizQuad, vertQuad, player);\n\n features.put(healthFeatName, new Feature(healthFeatName, 0, 0, tilesPerQuadrant * maxHitPoints));\n\n // the fourth for traverses the unit types\n for (UnitType type : state.getUnitTypeTable().getUnitTypes()) {\n if (type.isResource)\n continue; // ignores resources\n String countFeatName = FeatureNames.unitsOfTypePerQuad(horizQuad, vertQuad, player, type);\n features.put(countFeatName, new Feature(countFeatName, 0, 0, tilesPerQuadrant));\n }\n }\n }\n }\n\n return features;\n }", "private void setupDFA() {\r\n\t\tcurrentState = 0;\r\n\t\tif (actor.getScheduleFSM() == null) {\r\n\t\t\t// generate trivial DFA in case there is no schedule fsm.\r\n\t\t\t// 1. only one state\r\n\t\t\t// 2. all actions are eligible\r\n\t\t\t// 3. the successor state is always the same\r\n\t\t\teligibleActions = new Action [][] {actions};\r\n\t\t\tsuccessorState = new int [1] [actions.length];\r\n\t\t\tfor (int i = 0; i < actions.length; i++) {\r\n\t\t\t\tsuccessorState[0][i] = 0;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSet stateSets = new HashSet();\r\n\t\t// put initial state into set of state sets\r\n\t\tSet initialState = Collections.singleton(actor.getScheduleFSM().getInitialState());\r\n\t\tstateSets.add(initialState);\r\n\t\tint previousSize = 0;\r\n\t\t// iterate until fixed-point, i.e. we cannot reach any new state set\r\n\t\twhile (previousSize != stateSets.size()) {\r\n\t\t\tpreviousSize = stateSets.size();\r\n\t\t\t// for each action...\r\n\t\t\tfor (int i = 0; i < actions.length; i ++) {\r\n\t\t\t\tSet nextStates = new HashSet();\r\n\t\t\t\t// ... compute the set of states that can be reached through it... \r\n\t\t\t\tfor (Iterator j = stateSets.iterator(); j.hasNext(); ) {\r\n\t\t\t\t\tSet s = (Set) j.next();\r\n\t\t\t\t\tif (isEligibleAction(s, actions[i])) {\r\n\t\t\t\t\t\tnextStates.add(computeNextStateSet(s, actions[i]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add them to the state set\r\n\t\t\t\tstateSets.addAll(nextStates);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// The set of all reachable state sets is the state space of the NDA. \r\n\t\tndaStateSets = (Set []) new ArrayList(stateSets).toArray(new Set[stateSets.size()]);\r\n\t\t// Make sure the initial state is state 0.\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tif (ndaStateSets[i].equals(initialState)) {\r\n\t\t\t\tSet s = ndaStateSets[i];\r\n\t\t\t\tndaStateSets[i] = ndaStateSets[0];\r\n\t\t\t\tndaStateSets[0] = s;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\teligibleActions = new Action [ndaStateSets.length] [];\r\n\t\tsuccessorState = new int [ndaStateSets.length] [];\r\n\t\t// For each state set (i.e. each NDA state), identify the eligible actions,\r\n\t\t// and also the successor state set (i.e. the successor state in the NDA).\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tList ea = new ArrayList();\r\n\t\t\tList ss = new ArrayList();\r\n\t\t\tfor (int j = 0; j < actions.length; j++) {\r\n\t\t\t\tif (isEligibleAction(ndaStateSets[i], actions[j])) {\r\n\t\t\t\t\tea.add(actions[j]);\r\n\t\t\t\t\tss.add(computeNextStateSet(ndaStateSets[i], actions[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\teligibleActions[i] = (Action []) ea.toArray(new Action[ea.size()]);\r\n\t\t\tList ds = Arrays.asList(ndaStateSets); // so we can use List.indexOf()\r\n\t\t\tsuccessorState[i] = new int [ss.size()];\r\n\t\t\t// locta the NDA successor state in array\r\n\t\t\tfor (int j = 0; j < ss.size(); j++) {\r\n\t\t\t\tsuccessorState[i][j] = ds.indexOf(ss.get(j));\r\n\t\t\t\t\r\n\t\t\t\t// must be in array, because we iterated until reaching a fixed point.\r\n\t\t\t\tassert successorState[i][j] >= 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public State (){\n for ( int i = 0 ; i < 5; i ++){\n philosopherNum[i] = i;\n currentState[i] = \"thinking\";\n conditions[i] = mutex.newCondition();\n }\n }", "private int computeState() {\n int state;\n if (corePd)\n state = 1; //power down state\n else\n state = 2; // core, e.g. crystal on state\n if (!corePd && !biasPd)\n state = 3; // crystal and bias on state\n if (!corePd && !biasPd && !fsPd)\n state = 4; // crystal, bias and synth. on\n if (!corePd && !biasPd && !fsPd && !rxtx && !rxPd)\n state = 5; // receive state\n if (!corePd && !biasPd && !fsPd && rxtx && !txPd)\n state = PA_POW_reg.getPower() + 6;\n return state;\n }", "private void initTransitions() {\n s0.addTransition(htThr, s1, startStep);\n\n s1.addTransition(htPosPeekThr, s2, null);\n s1.addTransition(ltThr, s4, null);\n\n s2.addTransition(ltNegPeekThr, s3, null);\n\n s3.addTransition(htNegPeekThr, s5, null);\n\n s4.addTransition(ltThr, s0, null);\n s4.addTransition(htThr, s1, null);\n\n s5.addTransition(ltNegPeekThr, s3, null);\n s5.addTransition(htNegThr, s6, endStep);\n\n s6.addTransition(ltThr, s0, null);\n }", "void state_INIT(){\r\n eccState = INDEX_INIT;\r\n alg_INIT();\r\n INITO.serviceEvent(this);\r\n state_START();\r\n}", "void createInitialBeliefState( )\n throws BelievabilityException\n {\n if ( _asset_dim_model == null )\n throw new BelievabilityException\n ( \"POMDPAssetDimensionModel.createInitialBeliefState()\",\n \"Asset model is NULL\" );\n \n if ( _logger.isDetailEnabled() )\n _logger.detail( \"\\tCreating POMDP iinitial belief for dimension: \" \n + _asset_dim_model.getStateDimensionName( ) );\n\n int num_vals = _asset_dim_model.getNumStateDimValues( );\n \n if ( num_vals < 0 )\n throw new BelievabilityException\n ( \"POMDPAssetDimensionModel.createInitialBeliefState()\",\n \"Asset model returning zero values: \"\n + _asset_dim_model.getStateDimensionName( ) );\n \n double[] belief_prob = new double[num_vals];\n \n int default_idx = _asset_dim_model.getDefaultStateIndex( );\n \n if ( default_idx < 0 )\n throw new BelievabilityException\n ( \"POMDPAssetDimensionModel.createInitialBeliefState()\",\n \"Asset model returning invalid default value: \"\n + _asset_dim_model.getStateDimensionName( ) );\n\n // We assume that each asset state dimension starts off\n // deterministically in a single possible state value.\n //\n belief_prob[default_idx] = 1.0;\n \n _initial_belief = new BeliefStateDimension( _asset_dim_model,\n belief_prob,\n null );\n\n }", "void blockState(BooleanFormula pState, int pMaxLevel, CFANode pLocation);", "public void updateState(){\n\t\t\n\t\t\n\t\t\n\t\tArrayList<String> toAdd = new ArrayList<String>();\n\t\tArrayList<String> toRemove = new ArrayList<String>();\n\n\t\tthis.lastAdded.clear();\n\t\tthis.lastFulfilled.clear();\n\t\tthis.lastViolated.clear();\n\t\t\n\t\ttry {\n\n\t\t\tdo{\n\t\t\t\ttoAdd.clear();\n\t\t\t\ttoRemove.clear();\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iActive = reasoner.findall(\"xactive(A,Fa,Fm,Fd,Fr,Timeout)&not(as(A,Fa,Fm,Fd,Fr,Timeout))\");\n\t\t\t\twhile(iActive.hasNext()){\n\t\t\t\t\tUnifier un = iActive.next();\n\t\t\t\t\ttoAdd.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+ adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastAdded.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+ adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iViol = reasoner.findall(\"xviol(A,Fa,Fm,Fd,Fr,Timeout)&not(vs(A,Fa,Fm,Fd,Fr,Timeout))\");\n\t\t\t\twhile(iViol.hasNext()){\n\t\t\t\t\tUnifier un = iViol.next();\n\t\t\t\t\ttoAdd.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastViolated.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iDeactF = reasoner.findall(\"xdeact_f(A,Fa,Fm,Fd,Fr,Timeout)\");\n\t\t\t\twhile(iDeactF.hasNext()){\n\t\t\t\t\tUnifier un = iDeactF.next();\n\t\t\t\t\ttoAdd.add(\"ds(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString()+\",\"+un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastFulfilled.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iDeactR = reasoner.findall(\"xdeact_r(A,Fa,Fm,Fd,Fr,Timeout)\");\n\t\t\t\twhile(iDeactR.hasNext()){\n\t\t\t\t\tUnifier un = iDeactR.next();\n\t\t\t\t\ttoAdd.add(\"ds(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastFulfilled.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iFailed = reasoner.findall(\"xfailed(A,Fa,Fm,Fd,Fr,Timeout)\");\n\t\t\t\twhile(iFailed.hasNext()){\n\t\t\t\t\tUnifier un = iFailed.next();\n\t\t\t\t\ttoAdd.add(\"fs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//norms deactivated (fulfilled) whose maintenance condition does not hold can be removed.\n\t\t\t\t//if they are not removed, new instances of the same norm are not activated\n\t\t\t\tIterator<Unifier> iDeactivated_to_remove = reasoner.findall(\"ds(A,Fa,Fm,Fd,Fr,Timeout)&not(Fm)\");\n\t\t\t\twhile(iDeactivated_to_remove.hasNext()){\n\t\t\t\t\tUnifier un = iDeactivated_to_remove.next();\n\t\t\t\t\ttoRemove.add(\"ds(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tfor(String s:toAdd){\n\t\t\t\t\treasoner.assertValue(s);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(String s:toRemove){\n\t\t\t\t\treasoner.retract(s);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}while(toAdd.size()>0|toRemove.size()>0);\t\t\t\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "protected abstract void attemptFeasibleInitialization(Solution solution);", "LoadConstraintType getLoadConstraint();", "void mo15871a(StateT statet);", "LabState state();" ]
[ "0.5656169", "0.55079234", "0.5472892", "0.54528224", "0.5403826", "0.5343341", "0.52920365", "0.52351385", "0.52276003", "0.51735127", "0.5171785", "0.51133263", "0.5094659", "0.5023714", "0.50145715", "0.50100875", "0.50091165", "0.49993885", "0.498671", "0.4979749", "0.4979585", "0.4970854", "0.49695972", "0.49628407", "0.4951954", "0.49443808", "0.4919777", "0.49172807", "0.49116322", "0.48830462", "0.48808965", "0.4879225", "0.48706505", "0.48587444", "0.48586076", "0.48421302", "0.4828196", "0.48274022", "0.4820703", "0.48198467", "0.48178965", "0.481647", "0.48125154", "0.48030266", "0.48029968", "0.47924143", "0.47840774", "0.4783177", "0.47743085", "0.4759712", "0.47520044", "0.47512376", "0.47511876", "0.47456923", "0.47335812", "0.47275835", "0.47269657", "0.47238144", "0.47206208", "0.47155955", "0.4715474", "0.47093508", "0.47090113", "0.47037914", "0.46985963", "0.46913663", "0.46881336", "0.46866328", "0.4681964", "0.46691447", "0.46582752", "0.46485272", "0.46422762", "0.4641476", "0.46361285", "0.46355346", "0.4634991", "0.46257722", "0.46206683", "0.46148944", "0.46139497", "0.45903334", "0.45785588", "0.45771006", "0.45697352", "0.45694357", "0.45653445", "0.45628473", "0.456206", "0.45528805", "0.4550296", "0.45496368", "0.4545727", "0.45446822", "0.4541963", "0.45345083", "0.4522175", "0.45211163", "0.45173457", "0.4512415", "0.45107326" ]
0.0
-1
Generate the State Loading Constraints for the Merged Forward/Funding Latent State
public org.drip.state.estimator.PredictorResponseWeightConstraint fundingForwardPRWC ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp, final org.drip.product.calib.ProductQuoteSet pqs) { if (null == valParams || null == pqs) return null; org.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel(); if ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) || (null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet))) return null; int iValueDate = valParams.valueDate(); if (iValueDate >= maturity().julian()) return null; double dblCleanPV = 0.; try { if (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) { org.drip.product.calib.FloatingStreamQuoteSet fsqs = (org.drip.product.calib.FloatingStreamQuoteSet) pqs; if (fsqs.containsPV()) dblCleanPV = fsqs.pv(); } else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) { org.drip.product.calib.FixedStreamQuoteSet fsqs = (org.drip.product.calib.FixedStreamQuoteSet) pqs; if (fsqs.containsPV()) dblCleanPV = fsqs.pv(); } } catch (java.lang.Exception e) { e.printStackTrace(); return null; } org.drip.state.estimator.PredictorResponseWeightConstraint prwc = new org.drip.state.estimator.PredictorResponseWeightConstraint(); for (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) { int iPeriodEndDate = period.endDate(); if (iPeriodEndDate < iValueDate) continue; org.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardFundingPRWC (iValueDate, csqs, pqs); if (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null; } if (!prwc.updateValue (dblCleanPV)) return null; if (!prwc.updateDValueDManifestMeasure ("PV", 1.)) return null; return prwc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\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\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\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\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public static void main(String[] args) throws UnsatisfiableConstraintSetException{\n\t\tint order = 1;\n\t\tBidirectionalVariableOrderPrefixIDMap<CharacterToken> statesByIndex = new BidirectionalVariableOrderPrefixIDMap<CharacterToken>(order);\n\t\t\n\t\tfinal CharacterToken cToken = new CharacterToken('C');\n\t\tint cID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(cToken)));\n\t\tfinal CharacterToken dToken = new CharacterToken('D');\n\t\tint dID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(dToken)));\n\t\tfinal CharacterToken eToken = new CharacterToken('E');\n\t\tint eID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(eToken)));\n\t\t\n\t\tMap<Integer, Map<Integer, Double>> transitions = new HashMap<Integer, Map<Integer, Double>>();\n\t\t\n\t\tMap<Integer, Double> priors = new HashMap<Integer, Double>();\n\t\tpriors.put(cID, .5);\n\t\tpriors.put(dID, 1.0/6);\n\t\tpriors.put(eID, 1.0/3);\n\n\t\tfinal HashMap<Integer, Double> transFromC = new HashMap<Integer, Double>();\n\t\ttransFromC.put(cID, .5);\n\t\ttransFromC.put(dID, .25);\n\t\ttransFromC.put(eID, .25);\n\t\ttransitions.put(cID, transFromC);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromD = new HashMap<Integer, Double>();\n\t\ttransFromD.put(cID, .5);\n//\t\ttransFromD.put(dID, 0.);\n\t\ttransFromD.put(eID, .5);\n\t\ttransitions.put(dID, transFromD);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromE = new HashMap<Integer, Double>();\n\t\ttransFromE.put(cID, .5);\n\t\ttransFromE.put(dID, .25);\n\t\ttransFromE.put(eID, .25);\n\t\ttransitions.put(eID, transFromE);\n\t\t\n\t\tSparseVariableOrderMarkovModel<CharacterToken> model = new SparseVariableOrderMarkovModel<CharacterToken>(statesByIndex, priors, transitions);\n\t\t\n\t\tCharacterToken[][] seqs = new CharacterToken[][] {\n\t\t\tnew CharacterToken[]{cToken, cToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, cToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, eToken, dToken}\n\t\t};\n\n\t\tSystem.out.println(\"UNCONSTRAINED:\");\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + model.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + model.generate(4));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"CONSTRAINED:\");\n\t\t\n\t\tint length = 4;\n\t\tList<List<ConditionedConstraint<CharacterToken>>> constraints = new ArrayList<List<ConditionedConstraint<CharacterToken>>>(); \n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tconstraints.add(new ArrayList<ConditionedConstraint<CharacterToken>>());\n\t\t}\n\t\tconstraints.get(3).add(new ConditionedConstraint<>(new CharacterTokenConstraint<CharacterToken>(new CharacterToken('D')),true));\n\t\t\n\t\tSparseVariableOrderNHMMMultiThreaded<CharacterToken> constrainedModel = null;\n\t\ttry {\n\t\t\tconstrainedModel = new SparseVariableOrderNHMMMultiThreaded<CharacterToken>(model, length, constraints);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + constrainedModel.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + constrainedModel.generate(4));\n\t\t}\n\t}", "private boolean isFeasibleState(int[] state){\n if((state[0] <= totalMissionaries && state[0] >= 0)&&(state[1] <= totalCannibals && state[1] >= 0)) {\n return true;\n }\n return false;\n }", "StatePac build();", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "int nParametricStates();", "private String transitionGenerate( String oldguard,String newguard,String markguard,List<Statement> statements, int previousmark,Automaton a,Map<String, Type> b,String pre ,int layer, boolean Else) throws PrismGeneratorException, ValidationException {\n String transition = \"\";\n //The lable of the current statement\n int statlable =0;\n //The lable of the current transition\n int layermark = transitionmark;\n String guard = oldguard;\n if(!newguard.isEmpty()){\n guard += (\" & \" + newguard);\n if(!markguard.isEmpty()){\n guard += ( \" & \" + markguard);\n }\n }\n\n String newpre = \"v\"+pre;\n //The define of the virtual variables used in this level\n String transitionend = pre+\"transitionend\";\n if(layer > maxlayer) {\n\n globalDeclarations += pre+\"transitionend : bool init true;\\n\";\n maxlayer = layer;\n for (Declaration var : a.getLocalVars().getDeclarationList()) {\n assert var instanceof VariableDeclaration;\n Type newtype = null;\n\n if(!(b==null)){\n\n if (b.containsKey(((VariableDeclaration) var).getType().toString())){\n newtype = b.get(((VariableDeclaration) var).getType().toString());\n }else{\n newtype = ((VariableDeclaration) var).getType();\n }\n }else{\n newtype = ((VariableDeclaration) var).getType();\n }\n String strType = typeGenerate(newtype);\n\n for (String name : var.getIdentifiers()) {\n\n switch (strType){\n case \"init\":\n Type inibasetype = ((InitType) newtype).getBaseType();\n String basestrtype = typeGenerate(inibasetype);\n switch (basestrtype){\n case \"int\":\n\n globalDeclarations += (newpre + name + \" : \"+typeGenerate(inibasetype)+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue()) +\";\\n\");\n break;\n case \"[%s..%s]\":\n BoundedIntType boundedtype = (BoundedIntType) inibasetype;\n String upper = boundedtype.getUpperBound().toString();\n String lower = boundedtype.getLowerBound().toString();\n globalDeclarations +=(newpre + name + \":\"+String.format(basestrtype,lower,upper )+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue()) +\";\\n\");\n break;\n case \"bool\":\n globalDeclarations +=(newpre + name + \":\"+strType+\n String.format(\" init %s\",((InitType)(newtype)).getInitValue())+\";\\n\");\n break;\n }\n break;\n case \"int\":\n\n globalDeclarations += (newpre + name + \":\"+strType+\";\\n\");\n break;\n case \"[%s..%s]\":\n BoundedIntType boundedtype = (BoundedIntType) newtype;\n String upper = boundedtype.getUpperBound().toString();\n String lower = boundedtype.getLowerBound().toString();\n globalDeclarations +=(newpre + name + \":\"+String.format(strType,lower, upper)+\";\\n\");\n\n break;\n case \"bool\":\n globalDeclarations +=(newpre + name + \":\"+strType+\";\\n\");\n\n break;\n case \"enum\":\n int i = 0;\n for(String item : ((EnumType)(newtype)).getItems()){\n globalDeclarations +=(newpre + item+String.format(\" : int init %d;\", i)+\"\\n\");\n i++;\n\n }\n globalDeclarations +=(newpre + name+\" : int;\"+\"\\n\");\n\n break;\n case \"list\":\n Type basetype = ((ListType)(newtype)).getBaseType();\n Term key = ((ListType)(newtype)).getCapacity();\n if((!(basetype instanceof IntType))||(!(basetype instanceof BoolType))||(!((key instanceof IntValue)))){\n java.lang.System.err.println(\"The type of the list is not supported.\");\n }\n if((((IntValue)((IntValue) key)).getValue()==0)){\n java.lang.System.err.println(\"The length of the list must greater than 0.\");\n }\n for(int j=0 ; j < (((IntValue)((IntValue) key)).getValue()); j++){\n globalDeclarations +=(newpre + String.format(\"%s%d\",name,j)+\" : int;\\n\");\n\n }\n break;\n }\n }\n }\n }\n\n // assign the virtual variables\n String rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", newpre + var, pre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\", layermark,statlable)+ \" & \" + transitionend +\" = true\"+ \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \"&\"+\"(\"+ transitionend + \"' = false);\"+ \"\\n\");\n ++statlable;\n\n for (Statement s : statements) {\n if (s instanceof SynchronizingStatement) {\n java.lang.System.err.println(\"A sync statement is not supposed to show up when generating codes.\");\n } else if (s instanceof AssignmentStatement) {\n rel = \"\";\n\n rel += virtualtermGenerate(((AssignmentStatement) s).getTarget(), 0,newpre,b) +\"'\"+\n \" = \" + virtualtermGenerate(((AssignmentStatement) s).getExpr(), 0,newpre,b);\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\", layermark,statlable) + \" -> \" + \"(\"+ rel +\")\" +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1);\", layermark,layermark)+ \"\\n\");\n ++statlable;\n\n }else if(s instanceof IteStatement){\n ++transitionmark;\n globalDeclarations += String.format(\"transitionmark%d :int init 0;\\n\", transitionmark);\n String newguard_ = virtualtermGenerate(((IteStatement) s).getCondition(), 0,newpre,b);\n String markguard_ = String.format(\"transitionmark%d=%d\", layermark,statlable);\n List newstatements = ((IteStatement) s).getThenStmts();\n List elstatements = ((IteStatement) s).getElseStmts();\n if(elstatements != null){\n transition += transitionGenerate(guard,newguard_,markguard_,newstatements,layermark,a,b,newpre,layer+1,true);\n ++transitionmark;\n globalDeclarations += String.format(\"transitionmark%d :int init 0;\\n\", transitionmark);\n transition += transitionGenerate(guard,\"!(\"+newguard_+\")\",markguard_,elstatements,layermark,a,b,newpre,layer+1,true);\n ++statlable;\n }else{\n transition += transitionGenerate(guard,newguard_,markguard_,newstatements,layermark,a,b,newpre,layer+1,false);\n ++statlable;\n }\n }\n else {\n throw PrismGeneratorException.UnhandledStatement(s);\n }\n }\n\n\n int max = 0;\n for(Statement s : statements){\n ++max;\n }\n ++max;\n\n\n if(layer > 1){\n //if the IteStatement is not implemented then change the transitionmark to the max\n if(Else == false) {\n transition += (\"[] \" + oldguard + \" & \" + \"!(\" + newguard + \")\" + \" & \" + markguard + \" & \" + String.format(\"transitionmark%d=%d\", layermark, 0) + \" -> \" +\n String.format(\"(transitionmark%d' = %d);\", layermark, max) + \"\\n\");\n }\n // assign the variables\n rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", pre + var, newpre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\",layermark, max) + \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1);\", layermark,layermark)+ \"\\n\");\n ++statlable;\n\n //Prevent label duplication\n transition += (\"[] \" +markguard+ String.format(\" & transitionmark%d=%d\", layermark,max+1) + \" -> \" +\n String.format(\"(transitionmark%d' = transitionmark%d + 1)&\", previousmark,previousmark)+\n String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \"&\"+\"(\"+transitionend+\"' = true)\"+\";\\n\");\n }else{\n\n // assign the variables\n rel = \"\";\n for (String var: variables){\n rel += ( String.format(\"(%s' = %s)&\", pre + var, newpre + var ) );\n }\n rel = (rel.substring(0, rel.length()-1));\n transition += (\"[] \" +guard +\" & \"+ String.format(\"transitionmark%d=%d\",layermark, max) + \" -> \" + rel +\n \"&\"+ String.format(\"(transitionmark%d' = transitionmark%d + 1)\", layermark,layermark)+\n \";\\n\");\n ++statlable;\n\n //initialize all the transitionmarks we had used\n rel = \"\";\n for(int i = 0 ; i<=transitionmark;i++){\n rel += String.format(\"(transitionmark%d' = 0)\", i)+\"&\";\n }\n rel = (rel.substring(0,rel.length()-1));\n transition += (\"[] \" + String.format(\"transitionmark%d=%d\", layermark,max+1)+ \" -> \" + rel +\n \"&\"+\"(\"+transitionend+\"' = true)\"+\";\\n\");\n }\n\n return transition;\n }", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "private void initProbs(final double recombinationProb, final double errorProb) {\n\n initialProbs = new EnumMap<>(IBDState.class);\n initialProbs.put(IBDState.ZERO, Math.log10(.33));\n initialProbs.put(IBDState.ONE, Math.log10(.33));\n initialProbs.put(IBDState.TWO, Math.log10(.33));\n\n transitionProbs = new EnumMap<>(IBDState.class);\n transitionProbs.put(IBDState.ZERO, new Double[]{Math.log10((1 - recombinationProb) - (errorProb / 2)), Math.log10(recombinationProb - (errorProb / 2)), Math.log10(errorProb)});\n transitionProbs.put(IBDState.ONE, new Double[]{Math.log10((recombinationProb / 2)), Math.log10(1 - recombinationProb), Math.log10(recombinationProb / 2)});\n transitionProbs.put(IBDState.TWO, new Double[]{Math.log10(errorProb), Math.log10(recombinationProb - (errorProb / 2)), Math.log10((1 - recombinationProb) - (errorProb / 2))});\n }", "protected void computeInitialTournamentState(int roundNumber) {\n\t\tcomputePresentPleyers();\n\t\tcomputeCurrentResults(roundNumber);\n\t\tcomputeCollorHistory(roundNumber);\n\t\tcomputePartnersHistory(roundNumber);\n\t\tcomputeUpfloatCounts(roundNumber);\n\t\tcomputeDlownFloatCounts(roundNumber);\n\t}", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "@Test\n\tpublic void test() {\n\t\tRandomVariableDefinition RV_DEF_X = new RandomVariableDefinition(\"DEF_X\", Arrays.asList(\"x0\", \"x1\", \"x2\"));\n\t\tRandomVariableDefinition RV_DEF_Y = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"y0\", \"y1\"));\n\t\tRandomVariableDefinition RV_DEF_Z = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"z0\", \"z1\"));\n\n\t\t///////////////////////////////////\n\t\t// define the local probability models\n\t\tLocalProbabilityModel X = new LocalProbabilityModel(\"X\");\n\t\tLocalProbabilityModel Y = new LocalProbabilityModel(\"Y\");\n\t\tLocalProbabilityModel Z = new LocalProbabilityModel(\"Z\");\n\t\tLocalProbabilityModel X1 = new LocalProbabilityModel(\"X1\");\n\t\tLocalProbabilityModel X2 = new LocalProbabilityModel(\"X2\");\n\t\tLocalProbabilityModel X3 = new LocalProbabilityModel(\"X3\");\n\t\tLocalProbabilityModel X7 = new LocalProbabilityModel(\"X7\");\n\t\t\n\t\t////////////////////////////////\n\t\t// specify target variable type, and dependencies\n\t\t\n\t\t// two a-priori variables - target only, no dependencies\n\t\tX.setTargetAndDependencies(RV_DEF_X, null);\n\t\tY.setTargetAndDependencies(RV_DEF_Y, null);\n\t\t\n\t\t// a LPM conditionally dependent on two variables\n\t\tZ.setTargetAndDependencies(RV_DEF_Z, Arrays.asList(X, Y));\n\n\t\t// a LPM conditionally dependent on several variables of the same type\n\t\tX3.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X1, X2));\n\n\t\t// a LPM conditionally dependent on itself (i.e. a state variable)\n\t\tX7.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X7));\n\n\t\n\t\t// the first has no dependencies just values\n\t\tX.setValue(\"x0\", 0.6);\n\t\tX.setValue(\"x1\", 0.1);\n\t\tX.setValue(\"x2\", 0.1);\n\n\t\t// the second has dependencies\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\n\t\t// the third has a recurrent dependency\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\t\n\t\t\n\t\t\n\t\t/* NOTE - should we enforce that a conditional probability should always be 'set' with requirement that the conditioning variables should all be identified ? */\n\t\t// this would be Z.setValue(\n\t//\tZ.setValue(Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")),\n\t//\t\t\tArrays.asList(\n\t//\t\t\t\t\t\"z0\", 0.5,\n\t//\t\t\t\t\t\"z1\", 0.3,\n\t//\t\t\t\t\t\"z2\", 0.7));\n\n\n\n\t\tString s = Z.toString();\n\t\tSystem.out.println(\"==============\\n\" + s);\n\n\t\tSystem.out.println(\"done\");\n\n\n\t}", "public State(Variable[][] old){\n complete = false;\n int minSize = 6;\n table = new Variable[5][5];\n for (int i=0;i<5;i++){\n for (int j=0;j<5;j++){\n table[i][j] = new Variable(old[i][j]);\n if (table[i][j].domains.size()<minSize&&!table[i][j].visited){\n minSize = table[i][j].domains.size();\n onOperate = table[i][j];\n }\n }\n }\n onOperate.iterator = onOperate.domains.iterator();\n onOperate.visited = true;\n }", "private static void setUpInit(Map<GdlSentence, ExternalizedStateComponent> components,\n\t\t\tExternalizedStateConstant trueComponent, ExternalizedStateConstant falseComponent) {\n\t\tExternalizedStateProposition initProposition = new ExternalizedStateProposition(GdlPool.getProposition(INIT_CAPS));\n\t\tfor(Entry<GdlSentence, ExternalizedStateComponent> entry : components.entrySet()) {\n\t\t\t//Is this something that will be true?\n\t\t\tif(entry.getValue() == trueComponent) {\n\t\t\t\tif(entry.getKey().getName().equals(INIT)) {\n\t\t\t\t\t//Find the corresponding true sentence\n\t\t\t\t\tGdlSentence trueSentence = GdlPool.getRelation(TRUE, entry.getKey().getBody());\n\t\t\t\t\t//System.out.println(\"True sentence from init: \" + trueSentence);\n\t\t\t\t\tExternalizedStateComponent trueSentenceComponent = components.get(trueSentence);\n\t\t\t\t\tif(trueSentenceComponent.getInputs().isEmpty()) {\n\t\t\t\t\t\t//Case where there is no transition input\n\t\t\t\t\t\t//Add the transition input, connect to init, continue loop\n\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\tExternalizedStateTransition transition = new ExternalizedStateTransition(true);\n\t\t\t\t\t\t//init goes into transition\n\t\t\t\t\t\ttransition.addInput(initProposition);\n\t\t\t\t\t\tinitProposition.addOutput(transition);\n\t\t\t\t\t\t//transition goes into component\n\t\t\t\t\t\ttrueSentenceComponent.addInput(transition);\n\t\t\t\t\t\ttransition.addOutput(trueSentenceComponent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//The transition already exists\n\t\t\t\t\t\tExternalizedStateComponent transition = trueSentenceComponent.getSingleInput();\n\n\t\t\t\t\t\t//We want to add init as a thing that precedes the transition\n\t\t\t\t\t\t//Disconnect existing input\n\t\t\t\t\t\tExternalizedStateComponent input = transition.getSingleInput();\n\t\t\t\t\t\t//input and init go into or, or goes into transition\n\t\t\t\t\t\tinput.removeOutput(transition);\n\t\t\t\t\t\ttransition.removeInput(input);\n\t\t\t\t\t\tList<ExternalizedStateComponent> orInputs = new ArrayList<ExternalizedStateComponent>(2);\n\t\t\t\t\t\torInputs.add(input);\n\t\t\t\t\t\torInputs.add(initProposition);\n\t\t\t\t\t\torify(orInputs, transition, falseComponent);\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\t((ExternalizedStateTransition) transition).setDependingOnInit(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "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 preCalculateCollisions(){\n for(int i = 0; i < ALL_POSSIBLE_STATES.length; i++){\n collisions[i] = new StateMapEntry();\n collisions[i].incomingState = ALL_POSSIBLE_STATES[i];\n collisions[i].resultingState = calculateAllPossibleOutboundStates(ALL_POSSIBLE_STATES[i], ALL_POSSIBLE_STATES);\n //collisions[i].print();\n }\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5568, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5569, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5570, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5571, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5572, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5573, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5574, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5575, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5576, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5577, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5578, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5579, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5580, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5581, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5582, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5583, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5584, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5585, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5586, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5587, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5588, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5589, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5590, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5591, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5592, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5593, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5594, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5595, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5596, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5597, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5598, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5599, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5600, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5601, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5602, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5603, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5604, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5605, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5606, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5607, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5608, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5609, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5610, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5611, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5612, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5613, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5614, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5615, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5616, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5617, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5618, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5619, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5620, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5621, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5622, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5623, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5624, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5625, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5626, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5627, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5628, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5629, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5630, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5631, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5632, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5633, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5634, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5635, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5636, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5637, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5638, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5639, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5640, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5641, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5642, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5643, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5644, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5645, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5646, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5647, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n }", "public void InitializeConstraints(boundkey[] bkc, double[] blc, NodesVector nvector, PipesVector pvector,\n\t\t\tTapsVector tvector, double outflow, double PrixMax, double lcom) {\n\t\tNodes nodes;\n\t\tPipes pipes;\n\t\tTaps taps;\n\n\t\t/* Contraintes sur les Nodes - taps */\n\t\tfor (int i = 0; i < (NbNodes - NbTaps - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\tCste[i] = -nodes.height;\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les Taps */\n\t\tfor (int i = NbNodes - NbTaps - 1; i < (NbNodes - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\ttaps = (Taps) tvector.elementAt(i - (NbNodes - NbTaps - 1));\n\n\t\t\tif (taps.orifice == Orifices.MAXDIAM) {\n\t\t\t\tCste[i] = -nodes.height - ((outflow * outflow) / taps.faucetCoef);\n\t\t\t} else {\n\t\t\t\tCste[i] = (-nodes.height\n\t\t\t\t\t\t- (outflow * outflow * ((1 / taps.faucetCoef) + Math.pow(CoefOrif / taps.orifice, 4))));\n\t\t\t}\n\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les longueurs des Pipes */\n\t\tfor (int i = NbNodes - 1; i < (m - 1); i++) {\n\t\t\tpipes = (Pipes) pvector.elementAt(i - NbNodes + 1);\n\n\t\t\tCste[i] = pipes.length;\n\n\t\t\tbkc[i] = mosek.boundkey.fx;\n\t\t\tblc[i] = Cste[i];\n\t\t}\n\n\t\t/* contrainte de prix max */\n\t\tCste[m - 1] = PrixMax;\n\t\tbkc[m - 1] = mosek.boundkey.up;\n\t\tblc[m - 1] = -1.0e30;\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18656, \"facing=north\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18657, \"facing=north\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18658, \"facing=south\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18659, \"facing=south\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18660, \"facing=west\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18661, \"facing=west\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18662, \"facing=east\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18663, \"facing=east\", \"waterlogged=false\"));\n }", "public State(Variable[][] old, boolean bool){\n complete = false;\n int minSize = 6;\n table = new Variable[5][5];\n for (int i=0;i<5;i++){\n for (int j=0;j<5;j++){\n table[i][j] = new Variable(old[i][j]);\n if (!table[i][j].visited){\n onOperate = table[i][j];\n }\n }\n }\n onOperate.iterator = onOperate.domains.iterator();\n onOperate.visited = true;\n }", "private void mergeStates() {\n ArrayList<DFAState> newStates = new ArrayList<DFAState>();\r\n HashSet<Integer> newAcceptStates = new HashSet<Integer>();\r\n HashMap<Integer, Integer> merged = new HashMap<Integer, Integer>();\r\n ArrayList<ArrayList<Integer>> mergeGroups = new ArrayList<ArrayList<Integer>>();\r\n for (int i = 0; i < D.length; i++) {\r\n if (merged.get(i) != null || states[i] == null) {\r\n continue;\r\n }\r\n\r\n DFAState state = states[i];\r\n\r\n ArrayList<Integer> toMerge = new ArrayList<Integer>();\r\n for (int j = i + 1; j < D.length; j++) {\r\n if (!D[i][j]) {\r\n toMerge.add(j);\r\n merged.put(j, i);\r\n }\r\n }\r\n\r\n // renumber existing transitions\r\n for (int j = 0; j < state.transitions.size(); j++) {\r\n Integer transition = state.transitions.get(j);\r\n if (merged.containsKey(transition)) {\r\n state.transitions.set(j, merged.get(transition));\r\n }\r\n }\r\n\r\n if (acceptStates.contains(i)) {\r\n newAcceptStates.add(i);\r\n }\r\n toMerge.add(i);\r\n mergeGroups.add(toMerge);\r\n newStates.add(state);\r\n }\r\n\r\n renumberStates(mergeGroups, newAcceptStates);\r\n\r\n // replace attributes\r\n DFAState[] newStatesArray = new DFAState[newStates.size()];\r\n newStatesArray = newStates.toArray(newStatesArray);\r\n states = newStatesArray;\r\n acceptStates = newAcceptStates;\r\n }", "private void setInitialAndFinalStates() {\n for (int i = 0; i < dfaStates.size(); i++) {\n List<State> currStateList = dfaStates.get(i);\n for (int j = 0; j < currStateList.size(); j++) {\n if (currStateList.get(j).getFinal()) {\n if (!finalStates.contains(dfaStatesWithNumbering.get(currStateList))) {\n finalStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n if (currStateList.get(j).getInitial()) {\n initialStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n }\n }", "public static void MCLSPIFB(){\n\t\tMountainCar mcGen = new MountainCar(); // default: reward 100 on the right side and 0 everywhere else\n\t\t\n\t\t\n\t\t// Define terminal function and reward function\t\n\t\tStateConditionTest terminalTest = new StateConditionTest() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean satisfies(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\t\n\t\tTerminalFunction tf = new TerminalFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean isTerminal(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn terminalTest.satisfies(s);\n\t\t\t}\n\t\t};\n\t\t\n\t\tRewardFunction rf = /*new GoalBasedRF(tf, 100, 0);*/\n\t\t\t\tnew RewardFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic double reward(State s1, Action a, State s2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s2.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn 100;\n\t\t\t\t}\n\t\t\t\tif ((Double)s2.get(\"x\") == mcGen.physParams.xmin) {\n\t\t\t\t\treturn -100;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t};\n\t\tmcGen.setRf(rf);\n\t\tSADomain domain = mcGen.generateDomain();\n\t\tSystem.out.println(\"physParams:\\n===========================\");\n\t\tSystem.out.println(\"xmin:\" + mcGen.physParams.xmin + \", xmax:\" + mcGen.physParams.xmax + \", vallypos:\" + mcGen.physParams.valleyPos());\n\t\tSystem.out.println(\"vmin:\" + mcGen.physParams.vmin + \", vmax:\" + mcGen.physParams.vmax);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate data from random state\n\t\tStateGenerator rstateGenerator = new MCRandomStateGenerator(mcGen.physParams);\n\t\tSARSCollector collector = new SARSCollector.UniformRandomSARSCollector(domain);\n\t\tSARSData dataset = collector.collectNInstances(rstateGenerator, domain.getModel(), 5000, 20, null);\n\n\t\t\n\t\tSARS xData = dataset.get(0);\n\t\tMCState xState = (MCState) xData.s;\n\t\tMCState xState2 = (MCState) xData.sp;\n\t\tSystem.out.println(\"s: x:\" + xState.x\n\t\t\t\t+ \", v:\" + xState.v + \n\t\t\t\t\", action:\" + xData.a.actionName() + \n\t\t\t\t\", reward:\" + xData.r);\n\t\tSystem.out.println(\"s': x:\" + xState2.x\n\t\t\t\t+ \", v:\" + xState2.v);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate 5000 SARS tuple instances for our dataset.\n\t\t// Car state generator for no more than 20 steps at a time or until we hit a terminal state.\n\t\t\n\t\t// Generate Fourier Basis\n\t\t// Fourier Basis: mapping from states to features\n\t\tNormalizedVariableFeatures inputFeatures = new NormalizedVariableFeatures()\n\t\t\t\t.variableDomain(\"x\", new VariableDomain(mcGen.physParams.xmin, mcGen.physParams.xmax))\n\t\t\t\t.variableDomain(\"v\", new VariableDomain(mcGen.physParams.vmin, mcGen.physParams.vmax));\n\t\tFourierBasis fBasis = new FourierBasis(inputFeatures, 4); // order(4) means the number of basis functions\n\t\t\n\t\t// Instantiate LSPI\n\t\t// LSPI needs mapping from state to action features, so\n\t\t// first define a state feature representation, \n\t\t// and then construct state-action features by taking the cross product of those features with each action\n\t\tLSPI lspi = new LSPI(domain, 0.99, new DenseCrossProductFeatures(fBasis, 3), dataset); // 3: number of actions: FORWARD, COSTA, BACKWARD\n\t\tPolicy policy = lspi.runPolicyIteration(30, 1e-6);\n\t\t\n\t\t// Visualization\n\t\tMCState laststate = new MCState(mcGen.physParams.valleyPos(), 0);\n\t\tSystem.out.println(\"===========================\\nState process according to policy:\\n\");\n\n\t\t\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tif (terminalTest.satisfies(laststate)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tAction curAction = policy.action(laststate);\n\t\t\tMCModel model = new MCModel(mcGen.physParams);\n\t\t\tMCState curState = (MCState) model.sample(laststate, curAction);\n\t\t\tif (i % 10 == 0) {\n\t\t\t\tSystem.out.println(\"State \" + i +\n\t\t\t\t\t\t\":\\tx = \" + laststate.x + \n\t\t\t\t\t\t\";\\tv = \" + laststate.v + \n\t\t\t\t\t\t\";\\taction = \" + curAction.actionName());\n\t\t\t}\t\t\t\n\t\t\tlaststate = curState;\n\t\t}\n\t\tVisualizer visualizer = MountainCarVisualizer.getVisualizer(mcGen);\n\t\tVisualActionObserver vo = new VisualActionObserver(visualizer);\n\t\tvo.initGUI();\n\t\t\n\t\tSimulatedEnvironment environment = new SimulatedEnvironment(domain, new MCState(mcGen.physParams.valleyPos(), 0));\n\t\tenvironment.addObservers(vo);\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tPolicyUtils.rollout(policy, environment);\n\t\t\tenvironment.resetEnvironment();\n\t\t}\n\t\tSystem.out.println(\"Finished\");\n\t\tSystem.out.println(policy.action(new MCState(0.05, -8)));\n\t}", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "private void generateSteps() {\n for (GlobalState g : this.globalStates) {\n List<String> faults = g.getPendingFaults(); \n if(faults.isEmpty()) {\n // Identifying all available operation transitions (when there \n // are no faults), and adding them as steps\n List<String> gSatisfiableReqs = g.getSatisfiableReqs();\n \n for(Node n : nodes) {\n String nName = n.getName();\n String nState = g.getStateOf(nName);\n List<Transition> nTau = n.getProtocol().getTau().get(nState);\n for(Transition t : nTau) {\n boolean firable = true;\n for(String req : t.getRequirements()) {\n if(!(gSatisfiableReqs.contains(n.getName() + \"/\" + req)))\n firable = false;\n }\n if(firable) {\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, t.getTargetState());\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,t.getOperation(),next));\n }\n }\n }\n } else {\n // Identifying all settling handlers for handling the faults\n // pending in this global state\n for(Node n: nodes) {\n // Computing the \"targetState\" of the settling handler for n\n String targetState = null;\n \n String nName = n.getName();\n String nState = g.getStateOf(nName);\n Map<String,List<String>> nRho = n.getProtocol().getRho();\n \n List<String> nFaults = new ArrayList();\n for(String req : nRho.get(nState)) {\n if(faults.contains(nName + \"/\" + req)) \n nFaults.add(req);\n }\n\n // TODO : Assuming handlers to be complete \n\n if(nFaults.size() > 0) {\n Map<String,List<String>> nPhi = n.getProtocol().getPhi();\n for(String handlingState : nPhi.get(nState)) {\n // Check if handling state is handling all faults\n boolean handles = true;\n for(String req : nRho.get(handlingState)) {\n if(nFaults.contains(req))\n handles = false;\n }\n\n // TODO : Assuming handlers to be race-free\n\n // Updating targetState (if the handlingState is \n // assuming a bigger set of requirements)\n if(handles) {\n if(targetState == null || nRho.get(handlingState).size() > nRho.get(targetState).size())\n targetState = handlingState;\n }\n }\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, targetState);\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,next));\n }\n }\n }\n }\n }", "boolean solveBranchingModel(BranchingConstraintSet targetSet) {\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n Map<String, Double> terms = new HashMap<>();\n terms.put(branching.branchingVarName, 1.0);\n\n if (branching.branchingType == ConstraintType.LEQL)\n origin.addConstraint(branching.name, terms, branching.branchingType, -Double.MAX_VALUE, branching.bound);\n else\n origin.addConstraint(branching.name, terms, branching.branchingType, branching.bound, Double.MAX_VALUE);\n\n }\n\n origin.solveLP();\n\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n origin.removeConstraint(branching.name);\n }\n\n if (origin.getStatus() == Model.Status.OPTIMAL) {\n// System.out.println(\"Objective: \" + origin.getOptimum()); /* Get objective value */\n if (integerSolution()) {\n if (origin.getOptimum() < ub)\n ub = origin.getOptimum();\n return false;\n } else {\n if (origin.getOptimum() > lb)\n lb = origin.getOptimum();\n return true;\n }\n } else {\n System.out.println(\"Current branch is infeasible!\");\n return false;\n }\n }", "public TemporalState getSetTemporalState(TemporalState ts, TemporalState last_state, FSA lts, Statement statement, ArrayList<Statement> s,HashSet<TemporalState> initial_states, HashSet<TemporalState> final_states){\n\t\t\tTemporalStateNode node=getSetTemporalStateNode(s);\n\t\t\tTemporalState state=null;\n\t\t\t \n\t\t\t \n\t\t\tboolean fusion=false;\n\t\t\tboolean blem=false;\n\t\t\tfor(TemporalState temp:node.states){\n\t\t\t\tboolean ok=false;\n\t\t\t\tif (mode>=0){\n\t\t\t\t\tif (temp.checkConstraintsCompatibility(ts)){\n\t\t\t\t\t\tok=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (mode==-2){\n\t\t\t\t\t\tok=temp.exactLoChecking(ts,last_state,lts,statement,initial_states,final_states);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tok=temp.approxLoChecking(ts,last_state,lts,statement);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(statement);\n\t\t\t\t//temp.display(false);\n\t\t\t\t//ts.display(false);\n\t\t\t\t\n\t\t\t\tif (ok){\n\t\t\t\t\tstate=temp;\n\t\t\t\t\tfusion=true;\n\t\t\t\t\t//System.out.println(\"fusion \"+ts+\" avec \"+temp);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"pas de fusion de \"+ts+\" avec \"+temp);\n\t\t\t\t\t//System.out.println(\"pas fusion\");\n\t\t\t\t\tblem=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!fusion){\n\t\t\t\tstate=new TemporalState(ts.requiredPast,ts.requiredFuture,ts.ensuredPast,ts.ensuredFuture,ts.past,ts.future);\n\t\t\t\t/*state.beganFutureSequences=ts.beganFutureSequences;\n\t\t\t\tstate.beganPastSequences=ts.beganPastSequences;\n\t\t\t\tstate.forbidenFuture=ts.forbidenFuture;\n\t\t\t\tstate.forbidenPast=ts.forbidenPast;*/\n\t\t\t\tnode.states.add(state);\n\t\t\t\tlts.addState(state);\n\t\t\t}\n\t\t\t\n\t\t\tif (last_state!=null){\n\t\t\t\tTransition tr=new Transition(last_state,statement,state);\n\t\t\t\tlts.addTransition(tr);\n\t\t\t}\n\t\t\t\n\t\t\tif (mode>=0){\n\t\t\t\tif(updateMode==0){\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> requiredFuture=TemporalState.union(state.requiredFuture,ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> past=TemporalState.intersect(state.past,ts.past);\n\t\t\t\t\tHashSet<Sequence> future=TemporalState.intersect(state.future,ts.future);\n\t\t\t\t\tHashSet<Sequence> lrequiredPast=TemporalState.copy(requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\tlrequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(lrequiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tstate.updateRequiredPast(requiredPast);\n\t\t\t\t\tstate.updateRequiredFuture(requiredFuture);\n\t\t\t\t\tstate.updateFuture(future);\n\t\t\t\t\tstate.updatePast(past);\n\t\t\t\t\n\t\t\t\t\tts.updatePast(past);\n\t\t\t\t\tts.updateRequiredFuture(requiredFuture);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\trequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(requiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tHashSet<Sequence> srp=TemporalState.copy(state.requiredPast);\n\t\t\t\t\tHashSet<Sequence> srf=TemporalState.copy(state.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> sp=TemporalState.copy(state.past);\n\t\t\t\t\tHashSet<Sequence> sf=TemporalState.copy(state.future);\n\t\t\t\t\tHashSet<Sequence> trp=TemporalState.copy(ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> trf=TemporalState.copy(ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> tp=TemporalState.copy(ts.past);\n\t\t\t\t\tHashSet<Sequence> tf=TemporalState.copy(ts.future);\n\t\t\t\t\t\n\t\t\t\t\tstate.updateRequiredPast(TemporalState.firstMinusSecond(trp,srp),1);\n\t\t\t\t\tstate.updateRequiredFuture(TemporalState.firstMinusSecond(trf,srf),1);\n\t\t\t\t\tstate.updatePast(TemporalState.firstMinusSecond(sp,tp),1);\n\t\t\t\t\tstate.updateFuture(TemporalState.firstMinusSecond(sf,tf),1);\n\t\t\t\t\t\n\t\t\t\t\tts.updateRequiredFuture(TemporalState.firstMinusSecond(srf,trf),1);\n\t\t\t\t\tts.updatePast(TemporalState.firstMinusSecond(tp,sp),1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t/*if (NewTemporalState.mode>=0){\n\t\t\t\t\n\t\t\t}*/\n\t\t\t/*else{\n\t\t\t\tSystem.out.println(\"Ensure ok\");\n\t\t\t}*/\n\t\t\t//\n\t\t\t//System.out.println(\"fin\"+lts.getStates().size());\n\t\t\t/*if (blem){\n\t\t\t\tGenerateDOT.printDot(lts, \"a.dot\");\n\t\t\t\tReader reader = new InputStreamReader(System.in);\n\t\t\t\tBufferedReader input = new BufferedReader(reader);\n\t\t\t\tSystem.out.print(\"tapez touche pour continuer\");\n\t\t\t\ttry{\n\t\t\t\t\tString ok = input.readLine();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e){System.out.println(e);}\n\t\t\t}*/\n\t\t\t\n\t\t\treturn(state);\n\t\t}", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "void state_REQState(){\r\n eccState = INDEX_REQState;\r\n alg_REQAlg();\r\n CNF.serviceEvent(this);\r\n state_START();\r\n}", "private List<State> substitueStateSketch(State oldState, Set<Node> components) {\n\n// long start = System.currentTimeMillis();\n\n List<State> ret = new ArrayList<>();\n\n for (Node sk : components) {\n\n State newState = new State(oldState);\n VariableNode v = newState.pp.findSelectedVar();\n v.sketch = sk;\n\n if (sk instanceof NullaryTerminalNode) {\n\n NullaryTerminalNode n = (NullaryTerminalNode) sk;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n if (n.sym.name.equals(\"<any>\")) continue;\n } else if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n newState.cost += Main.NOT_TERMINAL_PATTERN;\n }\n }\n\n newState.pp.numNullaryTerminals++;\n } else if (sk instanceof OperatorNode) {\n if (((OperatorNode) sk).special) newState.cost += Main.SPECIAL_REPEATATLEAST_1;\n\n String opName = ((OperatorNode) sk).operatorName;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n if (!(opName.equals(\"startwith\") || opName.equals(\"endwith\") || opName.equals(\"contain\"))) {\n newState.cost += Main.NOT_NOT_CONTAIN_SW_EW_PATTERN;\n }\n }\n }\n } else {\n\n // do not continue if we are trying to replace argument of notcc with a op node\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n continue;\n }\n }\n }\n\n newState.pp.numOperatorSketch++; // TODO: it might be a problem if we have a rf sketch such as concat(v:contain(v:?{<num>}))\n newState.pp.deselectVar();\n if (evalApprox(newState)) ret.add(newState);\n\n }\n\n return ret;\n\n }", "private AutomatonFromTable automatonFromTable() {\n \tAutomatonFromTable hypothesis = new AutomatonFromTable(inputs);\n\t\t/*\n\t\t * Number of new states in the hypothesis is the \n\t\t * number of distinct rows in the upper half of the observation table\n\t\t */\n\t\tint noOfNewStates = -1;\n\t\tList<List<String>> distinctStates = new ArrayList<>();\n\t\tIterator<Entry<String, List<String>>> it = observationTableUpper.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tdistinctStates.add(entry.getValue());\n\t\t}\n\t\tnoOfNewStates = new HashSet<>(distinctStates).size();\n\t\t//Adding those many number of states\n\t\tfor(int i=0;i<noOfNewStates;i++){\n\t\t\tif(i==0){\n\t\t\t\thypothesis.addInitialState();\n\t\t\t}else{\n\t\t\t\thypothesis.addState();\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"No.of new states \"+noOfNewStates);\n\t\t\n\t\t\n\t\tList<Transition> prefixStateMap = new ArrayList<>();\n\t\t\n\t\t//Adding the transitions for those states\n\t\tit = observationTableUpper.entrySet().iterator();\n\t\tSystem.out.println(\"Upper table size \"+observationTableUpper);\n\t\tint currentMaxState = 0;\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tString prefix = entry.getKey();\n\t\t\tList<String> results = entry.getValue();\n\t\t\tint currentState = getCurrentState(prefix, prefixStateMap);\n\t\t\tSystem.out.println(\"Current State \"+currentState);\n\t\t\tint nextState;\n\t\t\tif(prefix.contains(\"<>\")){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else if((nextState = checkErrorState(prefix, prefixStateMap))!=-1){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tif(!results.get(i+1).equals(\"-\")){\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Check for two start calls and make sure they end up on the same state.\n\t\t\t\t\t\t * This is Media Player specific and might need to be changed \n\t\t\t\t\t\t * add for conditional checks for other examples. \n\t\t\t\t\t\t * For Android Media Player, calling start after the first call to start\n\t\t\t\t\t\t * doesn't lead to a transition to a new state. So that needs to be specifically handled.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tboolean exceptionCase = false;\n\t\t\t\t\t\tif(prefix.contains(\"$\")){\n\t\t\t\t\t\t\tint lastIndex = prefix.lastIndexOf(\"$\");\n\t\t\t\t\t\t\tString lastCall = prefix.substring(lastIndex+1, prefix.length()-1);\n\t\t\t\t\t\t\tif(lastCall.contains(\"start()\") && results.get(i).contains(\"start()\")){\n\t\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t\t\texceptionCase = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}if(!exceptionCase){\n\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Add all the final transitions to the automaton object\n\t\t */\n\t\tfor(Transition transition: prefixStateMap){\n\t\t\thypothesis.addTransition(transition);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Populate the Tree representation of the Automaton by doing a breadth-first search\n\t\t */\n\t\tint i = 0;\n\t\twhile(i<hypothesis.getNumberStates()){\n\t\t\tList<Transition> successorDetails = new ArrayList<>();\n\t\t\tfor(Transition transition: prefixStateMap){\n\t\t\t\tint startState = transition.getCurrentState();\n\t\t\t\tif(startState==i){\n\t\t\t\t\tsuccessorDetails.add(transition);\n\t\t\t\t\tautomatonTree.put(startState, successorDetails);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(automatonTree);\n\t\treturn hypothesis;\n\t}", "public BranchAndBound() {\n this.timeFi = Long.parseLong(\"2000000000000\");;\n this.numSoluciones = 0;\n }", "public HashMap<String,ArrayList<Rule_in_State>> get_rules_of_next_state() throws Exception;", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public G20ConstraintFunction_h8() {\n }", "public static int getStartState() {\n int startState = 1;\n int n = 1;\n for (int i = 2; i <= state; i ++) {\n if (stateList.get(i).getN1() == n || stateList.get(i).getN2() == n) {\n startState = i;\n n = i;\n }\n }\n return startState;\n }", "T transformToAndValidateInitialState(VendingMachine vendingMachine);", "public Graph calculateEnforcedGraph(Vector2 robotTarget) {\n\n Graph g = this.clone();\n // Clear enforce values of all states.\n for (State s : g.states) {\n s.enforceValue = -1;\n }\n\n List<State> targetStates = g.findStatesForRobotPosition(robotTarget);\n System.out.println(robotTarget);\n\n // Set enforce value to 0 for targetstates.\n for (State s : targetStates)\n s.enforceValue = 0;\n\n // Go from here and calculate more enforce values for 1-acceptance\n Queue<State> calcStack = new LinkedBlockingQueue<>(targetStates);\n\n while (!calcStack.isEmpty()) {\n State enfI = calcStack.poll();\n //if (enfI.equals(initialState)) continue;\n\n List<Transition> transitionsTo = g.getTransitionsTo(enfI);\n for (Transition t : transitionsTo) {\n State enfIP1 = t.from;\n if (enfIP1.isRobotState) {\n // At least one transition is enough for this\n if (enfIP1.enforceValue == -1) {\n enfIP1.enforceValue = enfI.enforceValue + 1;\n calcStack.add(enfIP1);\n }\n } else {\n List<Transition> fromTransitions = g.getTransitionsFrom(enfIP1);\n // All transitions from this eumel have to lead into a lower value enforce.\n int enforceValue = enfI.enforceValue + 1;\n boolean enforceable = true;\n for (Transition trans : fromTransitions) {\n if (trans.to.enforceValue == -1 || trans.to.enforceValue >= enforceValue)\n enforceable = false;\n }\n\n if (enforceable && enfIP1.enforceValue == -1) {\n enfIP1.enforceValue = enforceValue;\n calcStack.add(enfIP1);\n }\n }\n }\n }\n\n\n // Now let's calculate Enforce+\n boolean statesChanged = true;\n while (statesChanged) {\n statesChanged = false;\n\n for (State s : g.states.stream().filter(s -> s.enforceValue == -1).collect(Collectors.toList())) {\n // Find the states from which we can enforce a step to Enforce in 1\n if (s.isRobotState) {\n // We need at least one Transitions which leads into enforce. We will then choose the lowest of it.\n List<Transition> transitions = g.getTransitionsFrom(s);\n Optional<Transition> cheapestTransition = transitions.stream().filter(t -> t.to.enforceValue != -1).min(Comparator.comparingInt(o -> o.to.enforceValue));\n if (cheapestTransition.isPresent()) {\n // We found a way into enforce. We can now set an enforce value on this!\n System.out.println(\"Renf+\");\n statesChanged = true;\n s.enforceValue = cheapestTransition.get().to.enforceValue + 1;\n }\n } else {\n // All the transitions coming from this have to lead into enforce. Let's check.\n List<Transition> transitions = g.getTransitionsFrom(s);\n boolean leadsToEnforce = transitions.stream().noneMatch(t -> t.to.enforceValue == -1);\n if (leadsToEnforce) {\n\n Optional<Integer> newEnforce = transitions.stream().map((transition) -> transition.to.enforceValue).max(Comparator.comparingInt(o -> o));\n if(newEnforce.isPresent()) {\n s.enforceValue = newEnforce.get() + 1;\n System.out.println(\"Cenf+\");\n statesChanged = true;\n }\n }\n }\n }\n\n }\n\n // Eliminate Transitions for Buechi-Acceptance\n\n /*List<State> unreachableStates = new ArrayList<>();\n\n // Remove all states with an enforce value of -1, as the cannot be reached\n Iterator<State> it = g.states.iterator();\n while (it.hasNext()) {\n State s = it.next();\n if (s.enforceValue == -1) {\n it.remove();\n unreachableStates.add(s);\n }\n }\n\n g.transitions.removeIf(t -> unreachableStates.contains(t.from) || unreachableStates.contains(t.to));*/\n\n return g;\n }", "private void checkRequiredSemaphores() {\n if (car.start == 1){\n if (car.end == 2)\n requiredSemaphores.add(Street.sw);\n else if (car.end == 3){\n requiredSemaphores.add(Street.sw);\n requiredSemaphores.add(Street.se);\n }\n // end = 4\n else {\n requiredSemaphores.add(Street.sw);\n requiredSemaphores.add(Street.se);\n requiredSemaphores.add(Street.ne);\n }\n }\n else if (car.start == 2){\n if (car.end == 3)\n requiredSemaphores.add(Street.se);\n else if (car.end == 4){\n requiredSemaphores.add(Street.se);\n requiredSemaphores.add(Street.ne);\n }\n // end = 1\n else {\n requiredSemaphores.add(Street.se);\n requiredSemaphores.add(Street.ne);\n requiredSemaphores.add(Street.nw);\n }\n }\n else if (car.start == 3){\n if (car.end == 4)\n requiredSemaphores.add(Street.ne);\n else if (car.end == 1){\n requiredSemaphores.add(Street.ne);\n requiredSemaphores.add(Street.nw);\n }\n // end = 2\n else{\n requiredSemaphores.add(Street.ne);\n requiredSemaphores.add(Street.nw);\n requiredSemaphores.add(Street.sw);\n }\n }\n // start = 4\n else{\n if (car.end == 1)\n requiredSemaphores.add(Street.nw);\n else if (car.end == 2){\n requiredSemaphores.add(Street.nw);\n requiredSemaphores.add(Street.sw);\n }\n // end = 3\n else {\n requiredSemaphores.add(Street.nw);\n requiredSemaphores.add(Street.sw);\n requiredSemaphores.add(Street.se);\n }\n }\n }", "private void calculateStatesPartialsPruning(int iNode1, int iNode2, int iNode3) {\n\t\t// prepare the stack\n\t\tm_nOperation[m_nTopOfStack] = OPERATION_SP;\n\t\tif (m_fPartials[m_iCurrentPartials[iNode1]][iNode1] != null && m_fPartials[m_iCurrentPartials[iNode2]][iNode2] != null) {\n\t\t\t// for handling ambiguities\n\t\t\tm_nOperation[m_nTopOfStack] = OPERATION_PP;\n\t\t}\n\t\tm_nNode1[m_nTopOfStack] = iNode1;\n\t\tm_nNode2[m_nTopOfStack] = iNode2;\n\t\tm_nNode3[m_nTopOfStack] = iNode3;\n\t\tm_nTopOfStack++;\n\t}", "public static POMDPState sampleInitialStates(Domain d) {\n\t\tPOMDPState s = new POMDPState();\n\n\t\t//Retrieve object classes from the domain.\n\t\tObjectClass containerClass = d.getObjectClass(Names.CLASS_CONTAINER);\n\t\tObjectClass babyClass = d.getObjectClass(Names.CLASS_BABY);\n\t\tObjectClass contentClass = d.getObjectClass(Names.CLASS_CONTENT);\n\t\tObjectClass humanClass = d.getObjectClass(Names.CLASS_HUMAN);\n\n\t\t//Create all the objects \n\t\tObjectInstance caregiver = new ObjectInstance(humanClass, Names.OBJ_CAREGIVER);\n\t\tObjectInstance baby = new ObjectInstance(babyClass, Names.OBJ_BABY);\n\t\tObjectInstance ointment = new ObjectInstance(contentClass, Names.OBJ_OINTMENT);\n\t\tObjectInstance oldClothes = new ObjectInstance(contentClass, Names.OBJ_OLD_CLOTHES);\n\t\tObjectInstance newClothes = new ObjectInstance(contentClass, Names.OBJ_NEW_CLOTHES);\n\t\tObjectInstance changingTable = new ObjectInstance(containerClass, Names.OBJ_CHANGING_TABLE);\n\t ObjectInstance hamper = new ObjectInstance(containerClass, Names.OBJ_HAMPER);\n\t\tObjectInstance sideTable = new ObjectInstance(containerClass, Names.OBJ_SIDE_TABLE);\n\t ObjectInstance dresser = new ObjectInstance(containerClass, Names.OBJ_DRESSER);\n\n\t\t//Set the \tproper values for objects' attributes\n\t\tchangingTable.setValue(Names.ATTR_OPEN, 1);\n\t hamper.setValue(Names.ATTR_OPEN, 1);\n\t\tsideTable.setValue(Names.ATTR_OPEN, 1);\n\t\tdresser.setValue(Names.ATTR_OPEN, 0);\n\t\tbaby.setValue(Names.ATTR_RASH, new java.util.Random().nextBoolean() ? 1 : 0);\n\n\t\t//Place contents in the proper initial container\n\t\tplaceObject(newClothes, dresser);\n\t\tplaceObject(oldClothes, changingTable);\n\t\tplaceObject(ointment, sideTable);\n\n\t\t//Add objects to the state, and have the caregiver decide on its mental state\n\t\taddObjects(s, caregiver, baby, oldClothes, newClothes, changingTable, hamper, sideTable, dresser, ointment);\n\t\tcaregiverThink(d, s);\n\n\t\t//Et voila\n\t\treturn s;\n\t}", "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15071, \"face=floor\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15072, \"face=floor\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15073, \"face=floor\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15074, \"face=floor\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15075, \"face=wall\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15076, \"face=wall\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15077, \"face=wall\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15078, \"face=wall\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15079, \"face=ceiling\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15080, \"face=ceiling\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15081, \"face=ceiling\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15082, \"face=ceiling\", \"facing=east\"));\n }", "BGPv4FSMState state();", "private void initializeMaps(){\n\t\t\n\t\tsteps = new HashMap<Integer, Set<PlanGraphStep>>();\n\t\tfacts = new HashMap<Integer, Set<PlanGraphLiteral>>();\n\t\tinconsistencies = new HashMap<Integer, Set<LPGInconsistency>>();\n\t\t\n\t\tfor(int i = 0; i <= maxLevel; i++) {\n\t\t\tsteps.put(i, new HashSet<PlanGraphStep>());\n\t\t\tfacts.put(i, new HashSet<PlanGraphLiteral>());\n\t\t\tinconsistencies.put(i, new HashSet<LPGInconsistency>());\n\t\t}\n\t\t\n\t\t/* This level holds only the special action end which has the goals as preconditions */\n\t\tsteps.put(maxLevel + 1, new HashSet<PlanGraphStep>());\n\t}", "@Override\n public void calculatePartials(int iNode1, int iNode2, int iNode3) {\n if (m_iStates[iNode1] != null) {\n if (m_iStates[iNode2] != null) {\n calculateStatesStatesPruning(iNode1, iNode2, iNode3);\n } else {\n calculateStatesPartialsPruning(iNode1, iNode2, iNode3);\n }\n } else {\n if (m_iStates[iNode2] != null) {\n calculateStatesPartialsPruning(iNode2, iNode1, iNode3);\n } else {\n calculatePartialsPartialsPruning(iNode1, iNode2, iNode3);\n }\n }\n\n }", "public Strategy<S, Integer> buildStrategy() {\n\t\tStrategy<S, Integer> result = new Strategy<S, Integer>();\n\n\t\tSet<S> winningStates = this.getWinningStates();\n\n\t\tfor (S state : losingStates) {\n\t\t\tStrategyState<S, Integer> source = new StrategyState<S, Integer>(\n\t\t\t\t\tstate, DUMMY_GOAL);\n\t\t\tSet<StrategyState<S, Integer>> successors = new HashSet<StrategyState<S, Integer>>();\n\t\t\t// if its uncontrollable and winning it must have winning succesors\n\t\t\tfor (S succ : this.game.getSuccessors(state)) {\n\t\t\t\tif (!winningStates.contains(succ)) {\n\t\t\t\t\tStrategyState<S, Integer> target = new StrategyState<S, Integer>(\n\t\t\t\t\t\t\tsucc, DUMMY_GOAL);\n\t\t\t\t\tsuccessors.add(target);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.addSuccessors(source, successors);\n\t\t}\n\t\treturn result;\n\t}", "@Internal\n\tpublic static <T> Map<String, State<T>> migrateGraph(State<T> oldStartState) {\n\t\tState<T> oldFirst = oldStartState;\n\t\tState<T> oldSecond = oldStartState.getStateTransitions().iterator().next().getTargetState();\n\n\t\tStateTransition<T> oldFirstToSecondTake = Iterators.find(\n\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t}\n\n\t\t\t});\n\n\t\tStateTransition<T> oldFirstIgnore = Iterators.find(\n\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.IGNORE;\n\t\t\t\t}\n\n\t\t\t}, null);\n\n\t\tStateTransition<T> oldSecondToThirdTake = Iterators.find(\n\t\t\toldSecond.getStateTransitions().iterator(),\n\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t}\n\n\t\t\t}, null);\n\n\t\tfinal Map<String, State<T>> convertedStates = new HashMap<>();\n\t\tState<T> newSecond;\n\t\tState<T> newFirst = new State<>(oldSecond.getName(), State.StateType.Start);\n\t\tconvertedStates.put(newFirst.getName(), newFirst);\n\t\twhile (oldSecondToThirdTake != null) {\n\n\t\t\tnewSecond = new State<T>(oldSecondToThirdTake.getTargetState().getName(), State.StateType.Normal);\n\t\t\tconvertedStates.put(newSecond.getName(), newSecond);\n\t\t\tnewFirst.addTake(newSecond, oldFirstToSecondTake.getCondition());\n\n\t\t\tif (oldFirstIgnore != null) {\n\t\t\t\tnewFirst.addIgnore(oldFirstIgnore.getCondition());\n\t\t\t}\n\n\t\t\toldFirst = oldSecond;\n\n\t\t\toldFirstToSecondTake = Iterators.find(\n\t\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\toldFirstIgnore = Iterators.find(\n\t\t\t\toldFirst.getStateTransitions().iterator(),\n\t\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.IGNORE;\n\t\t\t\t\t}\n\n\t\t\t\t}, null);\n\n\t\t\toldSecond = oldSecondToThirdTake.getTargetState();\n\n\t\t\toldSecondToThirdTake = Iterators.find(\n\t\t\t\toldSecond.getStateTransitions().iterator(),\n\t\t\t\tnew Predicate<StateTransition<T>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean apply(@Nullable StateTransition<T> input) {\n\t\t\t\t\t\treturn input != null && input.getAction() == StateTransitionAction.TAKE;\n\t\t\t\t\t}\n\n\t\t\t\t}, null);\n\n\t\t\tnewFirst = newSecond;\n\t\t}\n\n\t\tfinal State<T> endingState = new State<>(ENDING_STATE_NAME, State.StateType.Final);\n\n\t\tnewFirst.addTake(endingState, oldFirstToSecondTake.getCondition());\n\n\t\tif (oldFirstIgnore != null) {\n\t\t\tnewFirst.addIgnore(oldFirstIgnore.getCondition());\n\t\t}\n\n\t\tconvertedStates.put(endingState.getName(), endingState);\n\n\t\treturn convertedStates;\n\t}", "private synchronized void initStateMachine() {\n next = start;\n Deque<StateInfo> stack = getNextToAncestorStackLocked();\n\n // Enter all the states of the new branch.\n while (stack.size() > 0) {\n current = stack.pop();\n current.active = true;\n current.state.enter();\n }\n next = null;\n }", "private void loadRandomState() {\n patternName = \"Random\";\n\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n\n generations = 0;\n }", "public void initState() {\n\n\t\tdouble bsc_p = 0.09; // TODO : doit dependre du souffle !?\n\t\tfor (int i=0; i<n; i++) lambda[i] = 0;\n\t\taddBSCnoise(lambda, bsc_p); \n\t\t// lambda: log likelihood ratio\n\t\tcalc_q0(lambda);\n\n\t\t// initialization of beta\n\t\tfor (int i = 0; i <= m - 1; i++) {\n\t\t\tfor (int j = 0; j <= row_weight[i] - 1; j++) {\n\t\t\t\tbeta[i][j] = 0.0;\n\t\t\t}\n\t\t}\t\t\n\n\t}", "interface WithState {\n /**\n * Specifies the state property: If specified, the value must be Shipping, which tells the Import/Export\n * service that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties\n * must have been set either in this request or in a previous request, otherwise the request will fail. .\n *\n * @param state If specified, the value must be Shipping, which tells the Import/Export service that the\n * package for the job has been shipped. The ReturnAddress and DeliveryPackage properties must have been\n * set either in this request or in a previous request, otherwise the request will fail.\n * @return the next definition stage.\n */\n Update withState(String state);\n }", "public abstract List<Scope> generateFactorScopes(State state);", "public LPSolution solve(double[][] xResults, double[][] yResults) throws GRBException {\n\t\tdouble intFeasTol = mSettings.getIntegralityTolerance();\n\t\tdouble feasTol = mSettings.getFeasibilityTolerance();\n\n\t\tGRBEnv env = new GRBEnv();\n\t\tGRBModel model = new GRBModel(env);\n\n\t\tGRBSolverUtils.configureToleranceParameters(model, intFeasTol, feasTol);\n\n\t\tint n = mExplicitMDP.getNumStates();\n\t\tint m = mExplicitMDP.getNumActions();\n\n\t\t// Initial state distribution\n\t\tdouble[] alpha = new double[n];\n\t\tArrays.fill(alpha, 1.0 / n);\n\n\t\t// Create variables: x_ia\n\t\t// Lower bound on variables: x_ia >= 0\n\t\tGRBVar[][] xVars = GRBSolverUtils.createOptimizationVars(\"x\", GRB.CONTINUOUS, n, m, 0.0,\n\t\t\t\tDouble.POSITIVE_INFINITY, model);\n\n\t\t// Create variables: y_ia\n\t\t// Lower bound on variables: y_ia >= 0\n\t\tGRBVar[][] yVars = GRBSolverUtils.createOptimizationVars(\"y\", GRB.CONTINUOUS, n, m, 0.0,\n\t\t\t\tDouble.POSITIVE_INFINITY, model);\n\n\t\t// Create variables: Deltax_ia (binary)\n\t\tString deltaxVarName = \"Deltax\";\n\t\tGRBVar[][] deltaxVars = GRBSolverUtils.createOptimizationVars(deltaxVarName, GRB.BINARY, n, m, 0.0, 1.0, model);\n\n\t\t// Create variables: Deltay_ia (binary)\n\t\tString deltayVarName = \"Deltay\";\n\t\tGRBVar[][] deltayVars = GRBSolverUtils.createOptimizationVars(deltayVarName, GRB.BINARY, n, m, 0.0, 1.0, model);\n\n\t\t// Set optimization objective\n\t\tGRBSolverUtils.setOptimizationObjective(mExplicitMDP, xVars, model);\n\n\t\t// Add constraints\n\t\taddC1Constraints(xVars, model);\n\t\taddC2Constraints(alpha, xVars, yVars, model);\n\n\t\t// Add constraints to ensure deterministic solution policy\n\t\tGRBSolverUtils.addDeltaConstraints(mExplicitMDP, deltaxVarName, deltaxVars, model);\n\t\tGRBSolverUtils.addDeltaConstraints(mExplicitMDP, deltayVarName, deltayVars, model);\n\n\t\t// For average-cost MDP, sum_i,a (x_ia) = 1; therefore, we can use X = 1\n\t\tGRBSolverUtils.addVarDeltaConstraints(1.0, mExplicitMDP, \"x\", xVars, deltaxVarName, deltaxVars, model);\n\n\t\t// Similarly, we use Y = 1\n\t\tGRBSolverUtils.addVarDeltaConstraints(1.0, mExplicitMDP, \"y\", yVars, deltayVarName, deltayVars, model);\n\n\t\t// Add (upper/lower bound) cost constraints, if any\n\t\tif (mSoftConstraints != null) {\n\t\t\t// Soft constraints\n\t\t\tCostConstraintUtils.addSoftCostConstraints(mSoftConstraints, mHardConstraints, mExplicitMDP, xVars, model);\n\t\t} else if (mHardConstraints != null) {\n\t\t\t// Hard constraints\n\t\t\tCostConstraintUtils.addHardCostConstraints(mHardConstraints, mExplicitMDP, xVars, model);\n\t\t}\n\n\t\t// Solve optimization problem for x_ia, y_ia, and Delta_ia\n\t\tmodel.optimize();\n\n\t\tint numSolutions = model.get(GRB.IntAttr.SolCount);\n\t\tdouble objectiveValue = -1;\n\n\t\tif (numSolutions > 0) {\n\t\t\t// Solution found\n\n\t\t\t// Objective value: sum_i,a (c_ia * x_ia)\n\t\t\tobjectiveValue = model.get(GRB.DoubleAttr.ObjVal);\n\n\t\t\t// Query results: optimal values of x_ia, y_ia, and Delta_ia\n\t\t\tdouble[][] grbXResults = model.get(GRB.DoubleAttr.X, xVars);\n\t\t\tdouble[][] grbYResults = model.get(GRB.DoubleAttr.X, yVars);\n\t\t\tdouble[][] grbDeltaxResults = model.get(GRB.DoubleAttr.X, deltaxVars);\n\t\t\tdouble[][] grbDeltayResults = model.get(GRB.DoubleAttr.X, deltayVars);\n\n\t\t\t// Copy x_ia and y_ia results to the return parameters\n\t\t\tSystem.arraycopy(grbXResults, 0, xResults, 0, grbXResults.length);\n\t\t\tSystem.arraycopy(grbYResults, 0, yResults, 0, grbYResults.length);\n\n\t\t\t// Consistency checks\n\t\t\tverifyAllConstraints(grbXResults, grbYResults, grbDeltaxResults, grbDeltayResults, alpha);\n\t\t\tassert GRBSolverUtils.consistencyCheckResults(grbXResults, grbDeltaxResults, mExplicitMDP, feasTol);\n\t\t\tassert GRBSolverUtils.consistencyCheckResults(grbYResults, grbDeltayResults, mExplicitMDP, feasTol);\n\t\t}\n\n\t\t// Dispose of model and environment\n\t\tmodel.dispose();\n\t\tenv.dispose();\n\n\t\t// LP solution\n\t\tLPSolution solution = new LPSolution(numSolutions > 0, objectiveValue);\n\t\tsolution.addSolution(\"x\", xResults);\n\t\tsolution.addSolution(\"y\", yResults);\n\t\treturn solution;\n\t}", "public interface StatePac {\n\n /**\n * Identify the leaf of StatePac.\n */\n public enum LeafIdentifier {\n /**\n * Represents operationalState.\n */\n OPERATIONALSTATE(1),\n /**\n * Represents administrativeControl.\n */\n ADMINISTRATIVECONTROL(2),\n /**\n * Represents adminsatratveState.\n */\n ADMINSATRATVESTATE(3),\n /**\n * Represents lifecycleState.\n */\n LIFECYCLESTATE(4);\n\n private int leafIndex;\n\n public int getLeafIndex() {\n return leafIndex;\n }\n\n LeafIdentifier(int value) {\n this.leafIndex = value;\n }\n }\n\n /**\n * Returns the attribute operationalState.\n *\n * @return operationalState value of operationalState\n */\n OperationalState operationalState();\n\n /**\n * Returns the attribute administrativeControl.\n *\n * @return administrativeControl value of administrativeControl\n */\n AdministrativeControl administrativeControl();\n\n /**\n * Returns the attribute adminsatratveState.\n *\n * @return adminsatratveState value of adminsatratveState\n */\n AdministrativeState adminsatratveState();\n\n /**\n * Returns the attribute lifecycleState.\n *\n * @return lifecycleState value of lifecycleState\n */\n LifecycleState lifecycleState();\n\n /**\n * Returns the attribute valueLeafFlags.\n *\n * @return valueLeafFlags value of valueLeafFlags\n */\n BitSet valueLeafFlags();\n\n /**\n * Returns the attribute yangStatePacOpType.\n *\n * @return yangStatePacOpType value of yangStatePacOpType\n */\n OnosYangOpType yangStatePacOpType();\n\n /**\n * Returns the attribute selectLeafFlags.\n *\n * @return selectLeafFlags value of selectLeafFlags\n */\n BitSet selectLeafFlags();\n\n /**\n * Returns the attribute yangAugmentedInfoMap.\n *\n * @return yangAugmentedInfoMap value of yangAugmentedInfoMap\n */\n Map<Class<?>, Object> yangAugmentedInfoMap();\n\n\n /**\n * Returns the attribute yangAugmentedInfo.\n *\n * @param classObject value of yangAugmentedInfo\n * @return yangAugmentedInfo\n */\n Object yangAugmentedInfo(Class classObject);\n\n /**\n * Checks if the leaf value is set.\n *\n * @param leaf leaf whose value status needs to checked\n * @return result of leaf value set in object\n */\n boolean isLeafValueSet(LeafIdentifier leaf);\n\n /**\n * Checks if the leaf is set to be a selected leaf.\n *\n * @param leaf if leaf needs to be selected\n * @return result of leaf value set in object\n */\n boolean isSelectLeaf(LeafIdentifier leaf);\n\n /**\n * Builder for statePac.\n */\n interface StatePacBuilder {\n /**\n * Returns the attribute operationalState.\n *\n * @return operationalState value of operationalState\n */\n OperationalState operationalState();\n\n /**\n * Returns the attribute administrativeControl.\n *\n * @return administrativeControl value of administrativeControl\n */\n AdministrativeControl administrativeControl();\n\n /**\n * Returns the attribute adminsatratveState.\n *\n * @return adminsatratveState value of adminsatratveState\n */\n AdministrativeState adminsatratveState();\n\n /**\n * Returns the attribute lifecycleState.\n *\n * @return lifecycleState value of lifecycleState\n */\n LifecycleState lifecycleState();\n\n /**\n * Returns the attribute valueLeafFlags.\n *\n * @return valueLeafFlags value of valueLeafFlags\n */\n BitSet valueLeafFlags();\n\n /**\n * Returns the attribute yangStatePacOpType.\n *\n * @return yangStatePacOpType value of yangStatePacOpType\n */\n OnosYangOpType yangStatePacOpType();\n\n /**\n * Returns the attribute selectLeafFlags.\n *\n * @return selectLeafFlags value of selectLeafFlags\n */\n BitSet selectLeafFlags();\n\n /**\n * Returns the attribute yangAugmentedInfoMap.\n *\n * @return yangAugmentedInfoMap value of yangAugmentedInfoMap\n */\n Map<Class<?>, Object> yangAugmentedInfoMap();\n\n /**\n * Returns the builder object of operationalState.\n *\n * @param operationalState value of operationalState\n * @return operationalState\n */\n StatePacBuilder operationalState(OperationalState operationalState);\n\n /**\n * Returns the builder object of administrativeControl.\n *\n * @param administrativeControl value of administrativeControl\n * @return administrativeControl\n */\n StatePacBuilder administrativeControl(AdministrativeControl administrativeControl);\n\n /**\n * Returns the builder object of adminsatratveState.\n *\n * @param adminsatratveState value of adminsatratveState\n * @return adminsatratveState\n */\n StatePacBuilder adminsatratveState(AdministrativeState adminsatratveState);\n\n /**\n * Returns the builder object of lifecycleState.\n *\n * @param lifecycleState value of lifecycleState\n * @return lifecycleState\n */\n StatePacBuilder lifecycleState(LifecycleState lifecycleState);\n\n /**\n * Returns the builder object of yangStatePacOpType.\n *\n * @param yangStatePacOpType value of yangStatePacOpType\n * @return yangStatePacOpType\n */\n StatePacBuilder yangStatePacOpType(OnosYangOpType yangStatePacOpType);\n\n /**\n * Sets the value of yangAugmentedInfo.\n *\n * @param value value of yangAugmentedInfo\n * @param classObject value of yangAugmentedInfo\n */\n StatePacBuilder addYangAugmentedInfo(Object value, Class classObject);\n\n /**\n * Returns the attribute yangAugmentedInfo.\n *\n * @param classObject value of yangAugmentedInfo\n * @return yangAugmentedInfo\n */\n Object yangAugmentedInfo(Class classObject);\n /**\n * Set a leaf to be selected.\n *\n * @param leaf leaf needs to be selected\n * @return builder object for select leaf\n */\n StatePacBuilder selectLeaf(LeafIdentifier leaf);\n\n /**\n * Builds object of statePac.\n *\n * @return statePac\n */\n StatePac build();\n }\n}", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "public LinkedList<State> getNextAvailableStates() {\n LinkedList<Integer> currentSide = new LinkedList<>();\n LinkedList<Integer> otherSide = new LinkedList<>();\n LinkedList<State> newStates = new LinkedList<>();\n if(isLeft) {\n if(leftSide != null) currentSide = new LinkedList<>(leftSide);\n if(rightSide != null) otherSide = new LinkedList<>(rightSide);\n } else {\n if (rightSide != null) currentSide = new LinkedList<>(rightSide);\n if (leftSide != null) otherSide = new LinkedList<>(leftSide);\n }\n\n // add one people to the other side of the bridge\n for (int index=0; index< currentSide.size(); index++) {\n LinkedList<Integer> newCurrentSide = new LinkedList<>(currentSide);\n LinkedList<Integer> newOtherSide = new LinkedList<>(otherSide);\n int firstPeopleMoved = newCurrentSide.remove(index);\n newOtherSide.add(firstPeopleMoved);\n State state = (isLeft) ? new State(newCurrentSide, newOtherSide, !isLeft,timeTaken+firstPeopleMoved, depth+1, highestSpeed) :\n new State(newOtherSide, newCurrentSide, !isLeft, timeTaken+firstPeopleMoved, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n String currentAction = \"move \" + firstPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this); // copy all the previous actions from the parent\n state.addActions(currentAction); // add new action to state generated by parent\n // add to the new states of list\n newStates.add(state);\n // add two people to the other side of the bridge\n for (int second=0; second < newCurrentSide.size(); second++) {\n LinkedList<Integer> newSecondCurrentSide = new LinkedList<>(newCurrentSide);\n LinkedList<Integer> newSecondOtherSide = new LinkedList<>(newOtherSide);\n int secondPeopleMoved = newSecondCurrentSide.remove(second);\n newSecondOtherSide.add(secondPeopleMoved);\n int slowerSpeed = (firstPeopleMoved > secondPeopleMoved) ? firstPeopleMoved : secondPeopleMoved;\n state = (isLeft) ? new State(newSecondCurrentSide, newSecondOtherSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed) :\n new State(newSecondOtherSide, newSecondCurrentSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved, secondPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n currentAction = \"move \"+ firstPeopleMoved + \" \" + secondPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this);\n state.addActions(currentAction);\n // add to the new states of list\n newStates.add(state);\n }\n\n }\n return newStates;\n }", "private void initTransitions() {\n s0.addTransition(htThr, s1, startStep);\n\n s1.addTransition(htPosPeekThr, s2, null);\n s1.addTransition(ltThr, s4, null);\n\n s2.addTransition(ltNegPeekThr, s3, null);\n\n s3.addTransition(htNegPeekThr, s5, null);\n\n s4.addTransition(ltThr, s0, null);\n s4.addTransition(htThr, s1, null);\n\n s5.addTransition(ltNegPeekThr, s3, null);\n s5.addTransition(htNegThr, s6, endStep);\n\n s6.addTransition(ltThr, s0, null);\n }", "public BistableParams(){\n\t\tMinDiffGrpPhyloDist = 0.5;\n\t\tMaxSameGrpPhyloDist= 0.3;\n\t\tMaxContentDiss = 0;\n\t\tMinGrpMemSize = 3;\n\t\tMinOpSize = 3;\n\t}", "public long[] getState() {\n return new long[] {(long)Cg0, (long)Cg1, (long)Cg2,\n (long)Cg3, (long)Cg4, (long)Cg5};\n }", "private void initiaLizeRequirements() {\n\n\t\ttry {\n\t\t\tstFoodDataEntry = cnFoodDataEntry.createStatement();\n\n\t\t\tString sql = \"select energysourceid, unit, conversionfactor from energysourcedetail where energysourceid in (select sourceid from energysource where energytypeid =\"\n\t\t\t\t\t+ FOOD + \") order by energysourceid asc\";\n\t\t\trsFoodDataEntry = stFoodDataEntry.executeQuery(sql);\n\n\t\t\tMap<String, Double> unitConversionF = null;\n\t\t\t// List<Map<String, Double>> listUnitConversionF;\n\t\t\tenergySourceDetail = new LinkedHashMap<Integer, Map<String, Double>>();\n\n\t\t\tint energysourceId;\n\t\t\tString unit;\n\t\t\tDouble coversionFactor;\n\n\t\t\twhile (rsFoodDataEntry.next()) {\n\t\t\t\tenergysourceId = rsFoodDataEntry.getInt(\"energysourceid\");\n\t\t\t\tunit = rsFoodDataEntry.getString(\"unit\");\n\t\t\t\tcoversionFactor = rsFoodDataEntry.getDouble(\"conversionfactor\");\n\n\t\t\t\tif (energySourceDetail.containsKey(energysourceId)) {\n\t\t\t\t\tenergySourceDetail.remove(energysourceId);\n\t\t\t\t} else {\n\t\t\t\t\tunitConversionF = new LinkedHashMap<String, Double>();\n\t\t\t\t}\n\t\t\t\tunitConversionF.put(unit, coversionFactor);\n\t\t\t\tenergySourceDetail.put(energysourceId, unitConversionF);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void buildModel() {\n double loss_pre = Double.MAX_VALUE;\n for (int iter = 0; iter < maxIter; iter ++) {\n Long start = System.currentTimeMillis();\n if (showProgress)\n System.out.println(\"Iteration \"+(iter+1)+\" started\");\n // Update user latent vectors\n IntStream.range(0,userCount).parallel().peek(i->update_user(i)).forEach(j->{});\n /*\n for (int u = 0; u < userCount; u ++) {\n update_user(u);\n }\n */\n if (showProgress) {\n System.out.println(\"Users updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n IntStream.range(0,itemCount).parallel().peek(i->update_item(i)).forEach(j->{});\n // Update item latent vectors\n /*\n for (int i = 0; i < itemCount; i ++) {\n update_item(i);\n }\n */\n if (showProgress) {\n System.out.println(\"Items updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n // Show loss\n if (showLoss)\n loss_pre = showLoss(iter, start, loss_pre);\n\n\n } // end for iter\n\n }", "public List<String> getSequentialPlan() {\n // ==========================================\n // Computing the (cheapest) sequence of steps\n // ==========================================\n \n // Maps of steps and cost from the global state s to the others\n Map<GlobalState,List<Step>> steps = new HashMap();\n steps.put(current,new ArrayList());\n Map<GlobalState,Integer> costs = new HashMap();\n costs.put(current,0);\n // List of visited states\n List<GlobalState> visited = new ArrayList();\n visited.add(current);\n\n // List of global states still to be visited\n List<GlobalState> toBeVisited = new ArrayList();\n \n // Adding the states reachable from start to \"toBeVisited\"\n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations towards \"next\" \n List<Step> stepSeq = new ArrayList();\n stepSeq.add(step);\n steps.put(next,stepSeq);\n // Adding the cost of the sequence of operation towards \"next\"\n costs.put(next,step.getCost());\n toBeVisited.add(next);\n }\n \n // Exploring the graph of global states by exploiting \"toBeVisited\"\n while(toBeVisited.size() > 0) {\n // Removing the first global state to be visited and marking it\n // as visited\n GlobalState current = toBeVisited.remove(0);\n visited.add(current);\n \n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations from \"start\" to \"next\"\n // (if more convenient)\n int nextCost = costs.get(current) + step.getCost();\n if(visited.contains(next)) {\n // If current path is cheaper, updates \"steps\" and \"costs\"\n if(costs.get(next) > nextCost) {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next,nextCost);\n }\n } else {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next, nextCost);\n if(!(toBeVisited.contains(next))) toBeVisited.add(next);\n }\n }\n }\n \n // ====================================================\n // Computing the sequence of operations from \"s\" to \"t\"\n // ====================================================\n // If no plan is available, return null\n if(steps.get(target) == null) \n return null;\n // Otherwise, return the corresponding sequence of operations\n List<String> opSequence = new ArrayList();\n for(Step step : steps.get(target)) {\n if(!(step.getReason().contains(Step.handling))) {\n opSequence.add(step.getReason());\n }\n }\n return opSequence;\n }", "public int \r\nomStudent_ObjectConstraints( View mStudent,\r\n Integer Event,\r\n Integer State )\r\n{\r\n zVIEW wXferO = new zVIEW( );\r\n int RESULT = 0;\r\n //:VIEW lTermLST BASED ON LOD lTermLST\r\n zVIEW lTermLST = new zVIEW( );\r\n //:VIEW lTermLST2 BASED ON LOD lTermLST\r\n zVIEW lTermLST2 = new zVIEW( );\r\n //:VIEW mUser BASED ON LOD mUser\r\n zVIEW mUser = new zVIEW( );\r\n //:VIEW mStudentT BASED ON LOD mStudent\r\n zVIEW mStudentT = new zVIEW( );\r\n //:VIEW sAppMgr BASED ON LOD sAppMgr\r\n zVIEW sAppMgr = new zVIEW( );\r\n //:VIEW mStuChgH BASED ON LOD mStuChgH\r\n zVIEW mStuChgH = new zVIEW( );\r\n //:VIEW mStuChgH2 BASED ON LOD mStuChgH\r\n zVIEW mStuChgH2 = new zVIEW( );\r\n //:VIEW mStuChgL BASED ON LOD mStuChgL\r\n zVIEW mStuChgL = new zVIEW( );\r\n //:STRING ( 20 ) szCollegeTerm\r\n String szCollegeTerm = null;\r\n //:STRING ( 50 ) szAnticipatedGradPeriod\r\n String szAnticipatedGradPeriod = null;\r\n //:STRING ( 50 ) szOriginalValue\r\n String szOriginalValue = null;\r\n //:STRING ( 50 ) szNewValue\r\n String szNewValue = null;\r\n //:STRING ( 1 ) szChangeFlag\r\n String szChangeFlag = null;\r\n //:STRING ( 8 ) szCurrentDate\r\n String szCurrentDate = null;\r\n //:STRING ( 1 ) szCurrentAcademicLevel\r\n String szCurrentAcademicLevel = null;\r\n //:SHORT nRC\r\n int nRC = 0;\r\n int lTempInteger_0 = 0;\r\n String szTempString_0 = null;\r\n int lTempInteger_1 = 0;\r\n String szTempString_1 = null;\r\n int lTempInteger_2 = 0;\r\n int lTempInteger_3 = 0;\r\n int lTempInteger_4 = 0;\r\n int lTempInteger_5 = 0;\r\n int lTempInteger_6 = 0;\r\n int lTempInteger_7 = 0;\r\n int lTempInteger_8 = 0;\r\n int lTempInteger_9 = 0;\r\n int lTempInteger_10 = 0;\r\n int lTempInteger_11 = 0;\r\n int lTempInteger_12 = 0;\r\n int lTempInteger_13 = 0;\r\n int lTempInteger_14 = 0;\r\n int lTempInteger_15 = 0;\r\n int lTempInteger_16 = 0;\r\n int lTempInteger_17 = 0;\r\n int lTempInteger_18 = 0;\r\n int lTempInteger_19 = 0;\r\n int lTempInteger_20 = 0;\r\n int lTempInteger_21 = 0;\r\n zVIEW vTempViewVar_0 = new zVIEW( );\r\n int lTempInteger_22 = 0;\r\n\r\n RESULT = GetViewByName( wXferO, \"wXferO\", mStudent, zLEVEL_TASK );\r\n\r\n //:CASE Event\r\n switch( Event )\r\n { \r\n //:OF zOCE_ACTIVATE:\r\n case zOCE_ACTIVATE :\r\n\r\n// if ( lTempInteger_16 == 0 )\r\n// return 0;\r\n// \r\n// View v = mStudent.activateOiFromFile( \"mStudent\", \"testdata/ZENCAs/mstudent_ac.por\" );\r\n// boolean c = v.equalsOi( mStudent );\r\n \r\n //:// Order the Retention, Transcript and Residency data in reverse date order.\r\n //:OrderEntityForView( mStudent, \"RetentionRisk\", \"CreationDate D\" )\r\n OrderEntityForView( mStudent, \"RetentionRisk\", \"CreationDate D\" );\r\n //:OrderEntityForView( mStudent, \"TranscriptRequest\", \"CreationDate D\" )\r\n OrderEntityForView( mStudent, \"TranscriptRequest\", \"CreationDate D\" );\r\n //:OrderEntityForView( mStudent, \"TermOfResidence\", \"BeginDate D\" )\r\n OrderEntityForView( mStudent, \"TermOfResidence\", \"BeginDate D\" );\r\n\r\n //:// Order Student Major/Degree Track according to Ranking.\r\n //:IF mStudent.StudentMajorDegreeTrack EXISTS\r\n lTempInteger_0 = CheckExistenceOfEntity( mStudent, \"StudentMajorDegreeTrack\" );\r\n if ( lTempInteger_0 == 0 )\r\n { \r\n //:IF mStudent.StudentMajorDegreeTrack.Ranking > 0\r\n if ( CompareAttributeToInteger( mStudent, \"StudentMajorDegreeTrack\", \"Ranking\", 0 ) > 0 )\r\n { \r\n //:OrderEntityForView( mStudent, \"StudentMajorDegreeTrack\", \"Ranking A\" )\r\n OrderEntityForView( mStudent, \"StudentMajorDegreeTrack\", \"Ranking A\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Build Chapel Attendance Summary entries.\r\n //:GET VIEW lTermLST NAMED \"lTermLST\"\r\n RESULT = GetViewByName( lTermLST, \"lTermLST\", mStudent, zLEVEL_TASK );\r\n //:CreateViewFromView( lTermLST2, lTermLST )\r\n CreateViewFromView( lTermLST2, lTermLST );\r\n //:FOR EACH mStudent.ChapelSession \r\n RESULT = mStudent.cursor( \"ChapelSession\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:SET CURSOR FIRST mStudent.ChapelAttendanceByTerm \r\n //: WHERE mStudent.ChapelAttendanceByTerm.CollegeTerm = mStudent.CollegeTerm.YearSemester \r\n {StringBuilder sb_szTempString_0;\r\n if ( szTempString_0 == null )\r\n sb_szTempString_0 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_0 = new StringBuilder( szTempString_0 );\r\n GetStringFromAttribute( sb_szTempString_0, mStudent, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_0 = sb_szTempString_0.toString( );}\r\n RESULT = mStudent.cursor( \"ChapelAttendanceByTerm\" ).setFirst( \"CollegeTerm\", szTempString_0 ).toInt();\r\n //:IF RESULT < zCURSOR_SET\r\n if ( RESULT < zCURSOR_SET )\r\n { \r\n //:CREATE ENTITY mStudent.ChapelAttendanceByTerm\r\n RESULT = CreateEntity( mStudent, \"ChapelAttendanceByTerm\", zPOS_AFTER );\r\n //:// We keep CollegeYear and Semester for sorting purposes.\r\n //:szCollegeTerm = mStudent.CollegeTerm.YearSemester\r\n {MutableInt mi_lTempInteger_1 = new MutableInt( lTempInteger_1 );\r\n StringBuilder sb_szCollegeTerm;\r\n if ( szCollegeTerm == null )\r\n sb_szCollegeTerm = new StringBuilder( 32 );\r\n else\r\n sb_szCollegeTerm = new StringBuilder( szCollegeTerm );\r\n GetVariableFromAttribute( sb_szCollegeTerm, mi_lTempInteger_1, 'S', 21, mStudent, \"CollegeTerm\", \"YearSemester\", \"\", 0 );\r\n lTempInteger_1 = mi_lTempInteger_1.intValue( );\r\n szCollegeTerm = sb_szCollegeTerm.toString( );}\r\n //:mStudent.ChapelAttendanceByTerm.CollegeTerm = szCollegeTerm\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeTerm\", szCollegeTerm );\r\n //:mStudent.ChapelAttendanceByTerm.CollegeYear = szCollegeTerm[1:9]\r\n {StringBuilder sb_szTempString_0;\r\n if ( szTempString_0 == null )\r\n sb_szTempString_0 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_0 = new StringBuilder( szTempString_0 );\r\n ZeidonStringCopy( sb_szTempString_0, 1, 0, szCollegeTerm, 1, 9, 21 );\r\n szTempString_0 = sb_szTempString_0.toString( );}\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear\", szTempString_0 );\r\n //:mStudent.ChapelAttendanceByTerm.Semester = mStudent.CollegeTerm.Semester\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"Semester\", mStudent, \"CollegeTerm\", \"Semester\" );\r\n //:SET CURSOR FIRST lTermLST2.CollegeTerm WHERE lTermLST2.CollegeTerm.YearSemester = mStudent.CollegeTerm.YearSemester \r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n GetStringFromAttribute( sb_szTempString_1, mStudent, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n RESULT = lTermLST2.cursor( \"CollegeTerm\" ).setFirst( \"YearSemester\", szTempString_1 ).toInt();\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequired = lTermLST2.CollegeTerm.NumberOfChapelsRequired\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequired\", lTermLST2, \"CollegeTerm\", \"NumberOfChapelsRequired\" );\r\n } \r\n\r\n //:END\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsAttended = mStudent.ChapelAttendanceByTerm.TotalChapelsAttended + 1\r\n {MutableInt mi_lTempInteger_2 = new MutableInt( lTempInteger_2 );\r\n GetIntegerFromAttribute( mi_lTempInteger_2, mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsAttended\" );\r\n lTempInteger_2 = mi_lTempInteger_2.intValue( );}\r\n lTempInteger_3 = lTempInteger_2 + 1;\r\n SetAttributeFromInteger( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsAttended\", lTempInteger_3 );\r\n RESULT = mStudent.cursor( \"ChapelSession\" ).setNext().toInt();\r\n } \r\n\r\n //:END\r\n //:FOR EACH mStudent.OverrideChapelRequirement\r\n RESULT = mStudent.cursor( \"OverrideChapelRequirement\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:SET CURSOR FIRST lTermLST2.CollegeTerm WHERE lTermLST2.CollegeTerm.ID = mStudent.OverrideChapelReqCollegeTerm.ID \r\n {MutableInt mi_lTempInteger_4 = new MutableInt( lTempInteger_4 );\r\n GetIntegerFromAttribute( mi_lTempInteger_4, mStudent, \"OverrideChapelReqCollegeTerm\", \"ID\" );\r\n lTempInteger_4 = mi_lTempInteger_4.intValue( );}\r\n RESULT = lTermLST2.cursor( \"CollegeTerm\" ).setFirst( \"ID\", lTempInteger_4 ).toInt();\r\n //:SET CURSOR FIRST mStudent.ChapelAttendanceByTerm WHERE mStudent.ChapelAttendanceByTerm.CollegeTerm = lTermLST2.CollegeTerm.YearSemester\r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n GetStringFromAttribute( sb_szTempString_1, lTermLST2, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n RESULT = mStudent.cursor( \"ChapelAttendanceByTerm\" ).setFirst( \"CollegeTerm\", szTempString_1 ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:// A ChapelAttendanceByTerm entity already exists for the Term, just add the Override value.\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequiredOverride = mStudent.OverrideChapelRequirement.NumberOfChapelsRequiredForTerm\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequiredOverride\", mStudent, \"OverrideChapelRequirement\", \"NumberOfChapelsRequiredForTerm\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// We need to add the ChapelAttendanceByTerm for the Override Term.\r\n //:CREATE ENTITY mStudent.ChapelAttendanceByTerm\r\n RESULT = CreateEntity( mStudent, \"ChapelAttendanceByTerm\", zPOS_AFTER );\r\n //:szCollegeTerm = lTermLST2.CollegeTerm.YearSemester \r\n {MutableInt mi_lTempInteger_5 = new MutableInt( lTempInteger_5 );\r\n StringBuilder sb_szCollegeTerm;\r\n if ( szCollegeTerm == null )\r\n sb_szCollegeTerm = new StringBuilder( 32 );\r\n else\r\n sb_szCollegeTerm = new StringBuilder( szCollegeTerm );\r\n GetVariableFromAttribute( sb_szCollegeTerm, mi_lTempInteger_5, 'S', 21, lTermLST2, \"CollegeTerm\", \"YearSemester\", \"\", 0 );\r\n lTempInteger_5 = mi_lTempInteger_5.intValue( );\r\n szCollegeTerm = sb_szCollegeTerm.toString( );}\r\n //:mStudent.ChapelAttendanceByTerm.CollegeTerm = szCollegeTerm\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeTerm\", szCollegeTerm );\r\n //:mStudent.ChapelAttendanceByTerm.CollegeYear = szCollegeTerm[1:9]\r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n ZeidonStringCopy( sb_szTempString_1, 1, 0, szCollegeTerm, 1, 9, 21 );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear\", szTempString_1 );\r\n //:mStudent.ChapelAttendanceByTerm.Semester = lTermLST2.CollegeTerm.Semester \r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"Semester\", lTermLST2, \"CollegeTerm\", \"Semester\" );\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequired = lTermLST2.CollegeTerm.NumberOfChapelsRequired \r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequired\", lTermLST2, \"CollegeTerm\", \"NumberOfChapelsRequired\" );\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequiredOverride = mStudent.OverrideChapelRequirement.NumberOfChapelsRequiredForTerm\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequiredOverride\", mStudent, \"OverrideChapelRequirement\", \"NumberOfChapelsRequiredForTerm\" );\r\n } \r\n\r\n RESULT = mStudent.cursor( \"OverrideChapelRequirement\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:DropView( lTermLST2 )\r\n DropView( lTermLST2 );\r\n //:OrderEntityForView( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear D Semester D\" )\r\n OrderEntityForView( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear D Semester D\" );\r\n //:OrderEntityForView( mStudent, \"ChapelSession\", \"Date D\" )\r\n OrderEntityForView( mStudent, \"ChapelSession\", \"Date D\" );\r\n\r\n //:// Generate Degree1 and Degree2 relationships.\r\n //:FOR EACH mStudent.StudentMajorDegreeTrack \r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.DegreeTrackCollegeDegree EXISTS\r\n lTempInteger_6 = CheckExistenceOfEntity( mStudent, \"DegreeTrackCollegeDegree\" );\r\n if ( lTempInteger_6 == 0 )\r\n { \r\n //:IF mStudent.CollegeDegree1 EXISTS\r\n lTempInteger_7 = CheckExistenceOfEntity( mStudent, \"CollegeDegree1\" );\r\n if ( lTempInteger_7 == 0 )\r\n { \r\n //:IF mStudent.CollegeDegree1.ID != mStudent.DegreeTrackCollegeDegree.ID \r\n if ( CompareAttributeToAttribute( mStudent, \"CollegeDegree1\", \"ID\", mStudent, \"DegreeTrackCollegeDegree\", \"ID\" ) != 0 )\r\n { \r\n //:IF mStudent.CollegeDegree2 DOES NOT EXIST\r\n lTempInteger_8 = CheckExistenceOfEntity( mStudent, \"CollegeDegree2\" );\r\n if ( lTempInteger_8 != 0 )\r\n { \r\n //:INCLUDE mStudent.CollegeDegree2 FROM mStudent.DegreeTrackCollegeDegree\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CollegeDegree2\", mStudent, \"DegreeTrackCollegeDegree\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:INCLUDE mStudent.CollegeDegree1 FROM mStudent.DegreeTrackCollegeDegree\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CollegeDegree1\", mStudent, \"DegreeTrackCollegeDegree\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END \r\n } \r\n\r\n //:END\r\n\r\n //:// Build display subobject of Transcript Requests.\r\n //:FOR EACH mStudent.TranscriptRequest\r\n RESULT = mStudent.cursor( \"TranscriptRequest\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:INCLUDE mStudent.DisplayTranscriptRequest FROM mStudent.TranscriptRequest \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"DisplayTranscriptRequest\", mStudent, \"TranscriptRequest\", zPOS_AFTER );\r\n RESULT = mStudent.cursor( \"TranscriptRequest\" ).setNext().toInt();\r\n } \r\n\r\n //:END\r\n //:OrderEntityForView( mStudent, \"DisplayTranscriptRequest\", \"ID A\" )\r\n OrderEntityForView( mStudent, \"DisplayTranscriptRequest\", \"ID A\" );\r\n\r\n //:// Build derived paths for Degree Candidacy relationship to StudentMajorDegreeTrack and CurrentDegreeCandidacy.\r\n //:FOR EACH mStudent.StudentMajorDegreeTrack \r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.SMDT_DegreeCandidacy EXISTS\r\n lTempInteger_9 = CheckExistenceOfEntity( mStudent, \"SMDT_DegreeCandidacy\" );\r\n if ( lTempInteger_9 == 0 )\r\n { \r\n //:SET CURSOR FIRST mStudent.DegreeCandidacy WHERE mStudent.DegreeCandidacy.ID = mStudent.SMDT_DegreeCandidacy.ID \r\n {MutableInt mi_lTempInteger_10 = new MutableInt( lTempInteger_10 );\r\n GetIntegerFromAttribute( mi_lTempInteger_10, mStudent, \"SMDT_DegreeCandidacy\", \"ID\" );\r\n lTempInteger_10 = mi_lTempInteger_10.intValue( );}\r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst( \"ID\", lTempInteger_10 ).toInt();\r\n //:INCLUDE mStudent.MajorTrackDegreeCandidacy FROM mStudent.DegreeCandidacy \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"MajorTrackDegreeCandidacy\", mStudent, \"DegreeCandidacy\", zPOS_AFTER );\r\n //:INCLUDE mStudent.DC_StudentMajorDegreeTrack FROM mStudent.StudentMajorDegreeTrack \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"DC_StudentMajorDegreeTrack\", mStudent, \"StudentMajorDegreeTrack\", zPOS_AFTER );\r\n } \r\n\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:IF mStudent.DegreeCandidacy EXISTS\r\n lTempInteger_11 = CheckExistenceOfEntity( mStudent, \"DegreeCandidacy\" );\r\n if ( lTempInteger_11 == 0 )\r\n { \r\n //:// Se need to set a work date to be used in sorting DegreeCandidacy entries in descending date order, so that the\r\n //:// most recent entry will be first. If there is a null entry, make it first.\r\n //:FOR EACH mStudent.DegreeCandidacy \r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.DC_GraduationDate EXISTS\r\n lTempInteger_12 = CheckExistenceOfEntity( mStudent, \"DC_GraduationDate\" );\r\n if ( lTempInteger_12 == 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DC_GraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DC_GraduationDate\", \"Date\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_13 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_13 == 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DC_AnticipatedGraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DC_AnticipatedGraduationDate\", \"Date\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.DegreeCandidacy.ReceivedDate != \"\"\r\n if ( CompareAttributeToString( mStudent, \"DegreeCandidacy\", \"ReceivedDate\", \"\" ) != 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DegreeCandidacy.ReceivedDate\r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DegreeCandidacy\", \"ReceivedDate\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = \"21000101\"\r\n SetAttributeFromString( mStudent, \"DegreeCandidacy\", \"wSortDate\", \"21000101\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:OrderEntityForView( mStudent, \"DegreeCandidacy\", \"wSortDate D\" )\r\n OrderEntityForView( mStudent, \"DegreeCandidacy\", \"wSortDate D\" );\r\n //:SET CURSOR FIRST mStudent.DegreeCandidacy \r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst().toInt();\r\n //:INCLUDE mStudent.CurrentDegreeCandidacy FROM mStudent.DegreeCandidacy \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CurrentDegreeCandidacy\", mStudent, \"DegreeCandidacy\", zPOS_AFTER );\r\n //:IF mStudent.DC_StudentMajorDegreeTrack EXISTS \r\n lTempInteger_14 = CheckExistenceOfEntity( mStudent, \"DC_StudentMajorDegreeTrack\" );\r\n if ( lTempInteger_14 == 0 )\r\n { \r\n //:INCLUDE mStudent.CDC_StudentMajorDegreeTrack FROM mStudent.DC_StudentMajorDegreeTrack \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CDC_StudentMajorDegreeTrack\", mStudent, \"DC_StudentMajorDegreeTrack\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Drop any Private Categories that are not from this Functional Area.\r\n //:nRC = GetViewByName( sAppMgr, \"sAppMgr\", mStudent, zLEVEL_APPLICATION )\r\n nRC = GetViewByName( sAppMgr, \"sAppMgr\", mStudent, zLEVEL_APPLICATION );\r\n //:IF nRC >= 0 \r\n if ( nRC >= 0 )\r\n { \r\n //:FOR EACH mStudent.Category \r\n RESULT = mStudent.cursor( \"Category\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.Category.PrivateToFunctionalAreaFlag = \"Y\"\r\n if ( CompareAttributeToString( mStudent, \"Category\", \"PrivateToFunctionalAreaFlag\", \"Y\" ) == 0 )\r\n { \r\n //:IF mStudent.Category.FunctionalArea != sAppMgr.FunctionalArea.FunctionalAreaName \r\n if ( CompareAttributeToAttribute( mStudent, \"Category\", \"FunctionalArea\", sAppMgr, \"FunctionalArea\", \"FunctionalAreaName\" ) != 0 )\r\n { \r\n //:DropEntity( mStudent, \"Category\", zREPOS_NONE )\r\n DropEntity( mStudent, \"Category\", zREPOS_NONE );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"Category\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Keep Legal Name for change comparison on COMMIT.\r\n //:mStudent.Student.wOriginalLegalName = mStudent.Student.LegalName\r\n SetAttributeFromAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n break ;\r\n\r\n //: /* end zOCE_ACTIVATE */\r\n //:OF zOCE_ACTIVATE_EMPTY:\r\n case zOCE_ACTIVATE_EMPTY :\r\n break ;\r\n\r\n //: /* end zOCE_ACTIVATE_EMPTY */\r\n //:OF zOCE_COMMIT:\r\n case zOCE_COMMIT :\r\n\r\n \t /*\r\n //:IF mStudent.Student EXISTS\r\n lTempInteger_15 = CheckExistenceOfEntity( mStudent, \"Student\" );\r\n if ( lTempInteger_15 == 0 )\r\n { \r\n\r\n //:// If the Legal Name has been changed, create change entry.\r\n //:IF mStudent.Student.wOriginalLegalName != mStudent.Student.LegalName\r\n if ( CompareAttributeToAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" ) != 0 )\r\n { \r\n //:CREATE ENTITY mStudent.PersonalDataModification \r\n RESULT = CreateEntity( mStudent, \"PersonalDataModification\", zPOS_AFTER );\r\n //:mStudent.PersonalDataModification.OriginalLegalName = mStudent.Student.wOriginalLegalName \r\n SetAttributeFromAttribute( mStudent, \"PersonalDataModification\", \"OriginalLegalName\", mStudent, \"Student\", \"wOriginalLegalName\" );\r\n //:mStudent.PersonalDataModification.NewLegalName = mStudent.Student.LegalName \r\n SetAttributeFromAttribute( mStudent, \"PersonalDataModification\", \"NewLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n //:SetAttributeFromCurrentDateTime( mStudent, \"PersonalDataModification\", \"ModifiedDateTime\" )\r\n //:GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION )\r\n GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION );\r\n //:INCLUDE mStudent.PersonalDataModificationUser FROM mUser.User\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"PersonalDataModificationUser\", mUser, \"User\", zPOS_AFTER );\r\n //:mStudent.Student.wOriginalLegalName = mStudent.Student.LegalName\r\n SetAttributeFromAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n } \r\n\r\n //:END\r\n\r\n //:// Set Graduation Dates in StudentMajorDegreeTrack entries, if a Graduation Date has been set in associated Degree Candidacy.\r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:FOR EACH mStudentT.StudentMajorDegreeTrack \r\n RESULT = mStudentT.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudentT.SMDT_GraduationDate EXISTS\r\n lTempInteger_16 = CheckExistenceOfEntity( mStudentT, \"SMDT_GraduationDate\" );\r\n if ( lTempInteger_16 == 0 )\r\n { \r\n //:IF mStudentT.StudentMajorDegreeTrack.GraduationDate != mStudentT.SMDT_GraduationDate.Date \r\n if ( CompareAttributeToAttribute( mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\", mStudentT, \"SMDT_GraduationDate\", \"Date\" ) != 0 )\r\n { \r\n //:mStudentT.StudentMajorDegreeTrack.GraduationDate = mStudentT.SMDT_GraduationDate.Date\r\n SetAttributeFromAttribute( mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\", mStudentT, \"SMDT_GraduationDate\", \"Date\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudentT.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n\r\n //:// For students that ARE NOT Undergraduate Main Campus, always set ResidencyStatus to Commuter.\r\n //:szCurrentAcademicLevel = mStudent.Student.CurrentLevel\r\n {MutableInt mi_lTempInteger_17 = new MutableInt( lTempInteger_17 );\r\n StringBuilder sb_szCurrentAcademicLevel;\r\n if ( szCurrentAcademicLevel == null )\r\n sb_szCurrentAcademicLevel = new StringBuilder( 32 );\r\n else\r\n sb_szCurrentAcademicLevel = new StringBuilder( szCurrentAcademicLevel );\r\n GetVariableFromAttribute( sb_szCurrentAcademicLevel, mi_lTempInteger_17, 'S', 2, mStudent, \"Student\", \"CurrentLevel\", \"\", 0 );\r\n lTempInteger_17 = mi_lTempInteger_17.intValue( );\r\n szCurrentAcademicLevel = sb_szCurrentAcademicLevel.toString( );}\r\n //:IF mStudent.AdministrativeDivision.ID = 1 AND\r\n //:( szCurrentAcademicLevel = \"1\" OR // Freshman\r\n //:szCurrentAcademicLevel = \"2\" OR // Sophomore\r\n //:szCurrentAcademicLevel = \"3\" OR // Junior\r\n //:szCurrentAcademicLevel = \"4\" OR // Senior\r\n //:szCurrentAcademicLevel = \"7\" OR // Special\r\n //:szCurrentAcademicLevel = \"8\" OR // Freshman-2\r\n //:szCurrentAcademicLevel = \"9\" ) // 5-Yr Senior\r\n if ( CompareAttributeToInteger( mStudent, \"AdministrativeDivision\", \"ID\", 1 ) == 0 && ( ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"1\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"2\", 1, 0, 2 ) == 0 ||\r\n ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"3\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"4\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"7\", 1, 0, 2 ) == 0 ||\r\n ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"8\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"9\", 1, 0, 2 ) == 0 ) )\r\n { \r\n\r\n //:// This is case where student is Main Campus undergraduate.\r\n\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.Student.ResidencyStatus != \"C\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"ResidencyStatus\", \"C\" ) != 0 )\r\n { \r\n //:mStudent.Student.ResidencyStatus = \"C\"\r\n SetAttributeFromString( mStudent, \"Student\", \"ResidencyStatus\", \"C\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Automatically set Student graduation date attributes.\r\n //:IF mStudent.Student.UndergradGraduationDate = \"\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"UndergradGraduationDate\", \"\" ) == 0 )\r\n { \r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:SET CURSOR FIRST mStudentT.DegreeMajorCollege WHERE mStudentT.DegreeMajorCollege.Type = \"U\"\r\n RESULT = mStudentT.cursor( \"DegreeMajorCollege\" ).setFirst( \"Type\", \"U\" ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:mStudent.Student.UndergradGraduationDate = mStudentT.StudentMajorDegreeTrack.GraduationDate \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"UndergradGraduationDate\", mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\" );\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n } \r\n\r\n //:END\r\n //:IF mStudent.Student.GradGraduationDate = \"\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"GradGraduationDate\", \"\" ) == 0 )\r\n { \r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:SET CURSOR FIRST mStudentT.DegreeMajorCollege WHERE mStudentT.DegreeMajorCollege.Type = \"G\"\r\n RESULT = mStudentT.cursor( \"DegreeMajorCollege\" ).setFirst( \"Type\", \"G\" ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:mStudent.Student.GradGraduationDate = mStudentT.StudentMajorDegreeTrack.GraduationDate \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"GradGraduationDate\", mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\" );\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n } \r\n\r\n //:END\r\n\r\n //:// If the Anticipated Grad Date exists, force the Clearing House Grad Date to that value.\r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_18 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_18 == 0 )\r\n { \r\n //:mStudent.Student.ClearingHouseGradDate = mStudent.DC_AnticipatedGraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"ClearingHouseGradDate\", mStudent, \"DC_AnticipatedGraduationDate\", \"Date\" );\r\n } \r\n\r\n //:END\r\n\r\n //:// REGULAR CHANGE LOG\r\n //:// Create the Change Log entry.\r\n //:GenerateTransactionEntryWDesc( mStudent, \"General Student Data\" )\r\n\r\n //:// STUDENT CHANGE LOG AND HISTORY\r\n //:// Generate Student Change Log entries, if something has changed. We will determine this by looking at\r\n //:// the last StudentChangeHistory entry and comparing its values.\r\n //:szAnticipatedGradPeriod = \"\"\r\n {StringBuilder sb_szAnticipatedGradPeriod;\r\n if ( szAnticipatedGradPeriod == null )\r\n sb_szAnticipatedGradPeriod = new StringBuilder( 32 );\r\n else\r\n sb_szAnticipatedGradPeriod = new StringBuilder( szAnticipatedGradPeriod );\r\n ZeidonStringCopy( sb_szAnticipatedGradPeriod, 1, 0, \"\", 1, 0, 51 );\r\n szAnticipatedGradPeriod = sb_szAnticipatedGradPeriod.toString( );}\r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_19 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_19 == 0 )\r\n { \r\n //:szAnticipatedGradPeriod = mStudent.DC_AnticipatedGraduationDate.Name \r\n {MutableInt mi_lTempInteger_20 = new MutableInt( lTempInteger_20 );\r\n StringBuilder sb_szAnticipatedGradPeriod;\r\n if ( szAnticipatedGradPeriod == null )\r\n sb_szAnticipatedGradPeriod = new StringBuilder( 32 );\r\n else\r\n sb_szAnticipatedGradPeriod = new StringBuilder( szAnticipatedGradPeriod );\r\n GetVariableFromAttribute( sb_szAnticipatedGradPeriod, mi_lTempInteger_20, 'S', 51, mStudent, \"DC_AnticipatedGraduationDate\", \"Name\", \"\", 0 );\r\n lTempInteger_20 = mi_lTempInteger_20.intValue( );\r\n szAnticipatedGradPeriod = sb_szAnticipatedGradPeriod.toString( );}\r\n } \r\n\r\n //:END\r\n //:ACTIVATE mStuChgH WHERE mStuChgH.StudentChangeHistory.LastDate = \"\"\r\n //: AND mStuChgH.Student.ID = mStudent.Student.ID \r\n {MutableInt mi_lTempInteger_21 = new MutableInt( lTempInteger_21 );\r\n GetIntegerFromAttribute( mi_lTempInteger_21, mStudent, \"Student\", \"ID\" );\r\n lTempInteger_21 = mi_lTempInteger_21.intValue( );}\r\n omStudent_fnLocalBuildQual_0( mStudent, vTempViewVar_0, lTempInteger_21 );\r\n RESULT = ActivateObjectInstance( mStuChgH, \"mStuChgH\", mStudent, vTempViewVar_0, zSINGLE );\r\n DropView( vTempViewVar_0 );\r\n //:IF RESULT < 0\r\n if ( RESULT < 0 )\r\n { \r\n //:// Since no history record has yet been created, create it here.\r\n //:ACTIVATE mStuChgH EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgH, \"mStuChgH\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgH.StudentChangeHistory \r\n RESULT = CreateEntity( mStuChgH, \"StudentChangeHistory\", zPOS_AFTER );\r\n //:mStuChgH.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:SetAttributeFromCurrentDateTime( mStuChgH, \"StudentChangeHistory\", \"FirstDate\" ) \r\n //:INCLUDE mStuChgH.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgH, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// There is a History entry, so see if anything has changed.\r\n //:szChangeFlag = \"\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n //:GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION )\r\n GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION );\r\n\r\n //:// Student Status\r\n //:IF mStuChgH.StudentChangeHistory.StudentStatus != mStudent.Student.Status \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"Status\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"Status\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"StudentStatus\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"StudentStatus\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Classification (CurrentLevel)\r\n //:IF mStuChgH.StudentChangeHistory.Classification != mStudent.Student.CurrentLevel \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"Classification\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"Classification\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"CurrentLevel\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"CurrentLevel\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"Classification\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"Classification\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Residency Status\r\n //:IF mStuChgH.StudentChangeHistory.ResidencyStatus != mStudent.Student.ResidencyStatus \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"ResidencyStatus\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"ResidencyStatus\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"ResidencyStatus\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"ResidencyStatus\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Financial Hold Flag\r\n //:IF mStuChgH.StudentChangeHistory.FinancialHoldFlag != mStudent.Student.FinancialHoldFlag \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"FinancialHoldFlag\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"FinancialHoldFlag\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"FinancialHoldFlag\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"FinancialHoldFlag\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Administrative Division\r\n //:IF mStuChgH.StudentChangeHistory.AdministrativeDivisionName != mStudent.AdministrativeDivision.Name \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"AdministrativeDivisionName\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"AdministrativeDivisionName\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = mStuChgH.StudentChangeHistory.AdministrativeDivisionName\r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\" );\r\n //:mStuChgL.StudentChangeLog.NewValue = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"NewValue\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Anticipated Graduation Period\r\n //:IF mStuChgH.StudentChangeHistory.AnticipatedGradPeriod != szAnticipatedGradPeriod\r\n if ( CompareAttributeToString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"AnticipatedGradPeriod\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"AnticipatedGradPeriod\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = mStuChgH.StudentChangeHistory.AnticipatedGradPeriod\r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\" );\r\n //:mStuChgL.StudentChangeLog.NewValue = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szAnticipatedGradPeriod );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// If any of the key attributes have changed, then we will:\r\n //:// 1. Create a new Student Change History entry, if the current one was not created today.\r\n //:// 2. Update the current Student Change History entry, if it was created today.\r\n //:IF szChangeFlag = \"Y\"\r\n if ( ZeidonStringCompare( szChangeFlag, 1, 0, \"Y\", 1, 0, 2 ) == 0 )\r\n { \r\n //:szCurrentDate = wXferO.Root.dCurrentDate\r\n {MutableInt mi_lTempInteger_22 = new MutableInt( lTempInteger_22 );\r\n StringBuilder sb_szCurrentDate;\r\n if ( szCurrentDate == null )\r\n sb_szCurrentDate = new StringBuilder( 32 );\r\n else\r\n sb_szCurrentDate = new StringBuilder( szCurrentDate );\r\n GetVariableFromAttribute( sb_szCurrentDate, mi_lTempInteger_22, 'S', 9, wXferO, \"Root\", \"dCurrentDate\", \"\", 0 );\r\n lTempInteger_22 = mi_lTempInteger_22.intValue( );\r\n szCurrentDate = sb_szCurrentDate.toString( );}\r\n //:IF mStuChgH.StudentChangeHistory.FirstDate = szCurrentDate\r\n if ( CompareAttributeToString( mStuChgH, \"StudentChangeHistory\", \"FirstDate\", szCurrentDate ) == 0 )\r\n { \r\n //:// The entry was created today, so just update it.\r\n //:// Note that we can just set all the attributes, without regard to which ones changed,\r\n //:// since this entity is a record of attribute values as of this point in time.\r\n //:mStuChgH.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:COMMIT mStuChgH\r\n RESULT = CommitObjectInstance( mStuChgH );\r\n //:DropObjectInstance( mStuChgH )\r\n DropObjectInstance( mStuChgH );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// The entry was created earlier, so create a new entry with the new values\r\n //:ACTIVATE mStuChgH2 EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgH2, \"mStuChgH\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgH2.StudentChangeHistory \r\n RESULT = CreateEntity( mStuChgH2, \"StudentChangeHistory\", zPOS_AFTER );\r\n //:mStuChgH2.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH2.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH2.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH2.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH2.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH2.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH2, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:SetAttributeFromCurrentDateTime( mStuChgH2, \"StudentChangeHistory\", \"FirstDate\" )\r\n //:INCLUDE mStuChgH2.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgH2, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n\r\n //:// Set the LastDate attribute in the previous history entry to yesterday.\r\n //:SetAttributeFromCurrentDateTime( wXferO, \"Root\", \"WorkDate\" )\r\n //:mStuChgH.StudentChangeHistory.LastDate = wXferO.Root.WorkDate \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"LastDate\", wXferO, \"Root\", \"WorkDate\" );\r\n\r\n //:COMMIT mStuChgH\r\n RESULT = CommitObjectInstance( mStuChgH );\r\n //:COMMIT mStuChgH2\r\n RESULT = CommitObjectInstance( mStuChgH2 );\r\n //:DropObjectInstance( mStuChgH2 )\r\n DropObjectInstance( mStuChgH2 );\r\n //:DropObjectInstance( mStuChgH )\r\n DropObjectInstance( mStuChgH );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n*/\r\n\r\n //:END\r\n break ;\r\n\r\n //: /* end zOCE_COMMIT */\r\n //:OF zOCE_DROPOI:\r\n case zOCE_DROPOI :\r\n break ;\r\n } \r\n\r\n\r\n //: /* end zOCE_DROPOI */\r\n //:END /* case */\r\n return( 0 );\r\n// END\r\n}", "public TStateTable () {\r\n\t m_users = new TIDIndex();\r\n\t m_resources = new TIDIndex();\r\n\t m_associations = new TUseStatus[INITIAL_MAX_RESOURCES_COUNT][INITIAL_MAX_USERS_COUNT];\r\n\t for (int a=0; a<INITIAL_MAX_RESOURCES_COUNT; a++)\r\n\t for (int b=0; b<INITIAL_MAX_USERS_COUNT; b++)\r\n\t m_associations[a][b] = null;\r\n\t m_current_max_users = INITIAL_MAX_USERS_COUNT;\r\n\t m_current_max_resources = INITIAL_MAX_RESOURCES_COUNT;\r\n\t m_current_users_count = 0;\r\n\t m_current_resources_count = 0;\r\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 }", "private AFD buildAFD() {\n\t\tfor (Cerradura cerradura : cerraduras) {\n\t\t\tEstado origen = getState(cerradura);\n\t\t\tEstado destino = null;\n\n\t\t\tfor (pol.una.py.model.lexico.Cerradura.Subconjunto conjunto : cerradura\n\t\t\t\t\t.getSubconjuntos()) {\n\t\t\t\tString codigoUnico = conjunto.getCodCerradura();\n\t\t\t\t// Conjunto vacio\n\t\t\t\tif (codigoUnico.equals(\"{}\")) {\n\t\t\t\t\tdestino = getStateError();\n\t\t\t\t} else {\n\t\t\t\t\tdestino = getState(getCerradura(codigoUnico));\n\n\t\t\t\t}\n\t\t\t\torigen.addTransition(new Transicion(origen, destino, conjunto\n\t\t\t\t\t\t.getSymbol()));\n\n\t\t\t}\n\t\t\tautomata.addEstado(origen);\n\t\t}\n\t\t// Puede darse el caso de que el estado inicial del AFN no sea mas un\n\t\t// estado inicial, sino un estado de aceptacion. Si no es un estado de\n\t\t// aceptacion, indicamos que es el estado inicial.\n\t\tif (!automata.getInitState().isAcceptation()) {\n\t\t\tautomata.getInitState().setInit(true);\n\t\t}\n\t\treturn automata;\n\t}", "SpacecraftState getInitialState() throws OrekitException;", "public ConvergenceInputModelState()\n {\n this.inputModelReady = false;\n this.systemUpdated = false;\n }", "private byte[] calculateAllPossibleOutboundStates(byte state, byte[] allPossible){\n int stateNumParticles = calcNumParticlesInState(state);\n int[] stateMomentum = calculateMomentum(state);\n ArrayList<Byte> possibleStates = new ArrayList<>();\n for(byte poss:allPossible){\n int possNumPart = calcNumParticlesInState(poss);\n if(possNumPart==stateNumParticles){\n int[] possMomentum = calculateMomentum(poss);\n if(compareMomenta(possMomentum, stateMomentum)){\n possibleStates.add(poss);\n }\n }\n }\n byte[] ret = new byte[possibleStates.size()];\n int i = 0;\n for(Byte b:possibleStates){\n ret[i++] = b.byteValue();\n }\n return ret;\n }", "void createRuleStartAndStopATNStates() {\n atn.ruleToStartState = new RuleStartState[g.rules.size()];\n atn.ruleToStopState = new RuleStopState[g.rules.size()];\n for (Rule r : g.rules.values()) {\n RuleStartState start = newState(RuleStartState.class, r.ast);\n RuleStopState stop = newState(RuleStopState.class, r.ast);\n start.stopState = stop;\n start.isLeftRecursiveRule = r instanceof LeftRecursiveRule;\n start.setRuleIndex(r.index);\n stop.setRuleIndex(r.index);\n atn.ruleToStartState[r.index] = start;\n atn.ruleToStopState[r.index] = stop;\n }\n }", "public interface State extends Comparable {\n\n\t/**\n\t * Computes the h value - heuristic grade for this state. This\n\t * method is called only once in the StateImpl class at the moment of\n\t * object creation, the value is stored in an inner variable, and then\n\t * be accessed by getH() method.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double computeHeuristicGrade();\n\n\t/**\n\t * Returns the h value - heuristic grade for this state.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double getH();\n\n\t/**\n\t * Returns the g value - cost of reaching this state from initial state.\n\t *\n\t * @return g value - cost of reaching this state from initial state\n\t */\n\tpublic double getG();\n\n\t/**\n\t * Sets the g value.\n\t *\n\t * @param aG value to be set\n\t */\n\tpublic void setG(double aG);\n\n\t/**\n\t * Returns the f value - sum of g and h values (f = g + h).\n\t *\n\t * @return f value\n\t */\n\tpublic double getF();\n\n\t/**\n\t * Returns the hash code for this state.\n\t *\n\t * @return hash code for this state\n\t */\n\tpublic String getHashCode();\n\n\t/**\n\t * Returns a list of children of this state (in the search tree).\n\t *\n\t * @return list of children of this state\n\t */\n\tpublic List<State> getChildren();\n\n\t/**\n\t * Sets the reference to the children of this state.\n\t *\n\t * @param aChildren reference to the children to be set\n\t */\n\tpublic void setChildren(List<State> aChildren);\n\n\t/**\n\t * Returns the reference to the parent of this state (in the tree)\n\t * or null if this state is the root.\n\t *\n\t * @return reference to the parent of this state\n\t */\n\tpublic State getParent();\n\n\t/**\n\t * Sets the reference to the parent of this state.\n\t *\n\t * @param aParent reference to the parent of this state to be set\n\t */\n\tpublic void setParent(State aParent);\n\n\t/**\n\t * Returns the boolean showing wether this state is admissible.\n\t * (E.g. in sudoku search some states may be inadmissible, so\n\t * their children should not be considered further.)\n\t *\n\t * @return boolean showing wether this state is admissible\n\t */\n\tpublic boolean isAdmissible();\n\n\t/**\n\t * Useful method for games searching algorithms.\n\t * Returns the string name of the root move (at the top of the\n\t * tree) that led to reaching this state.\n\t *\n\t * @return string representing the root move\n\t */\n\tpublic String getRootMove();\n\n\t/**\n\t * Sets the string name of the root move.\n\t *\n\t * @param aMove string name of the root move to be set.\n\t */\n\tpublic void setRootMove(String aMove);\n\n\t/**\n\t * Returns the guaranteed minimum score (payoff) for the maximizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed minimum score for the maximizing player\n\t */\n\tpublic double getAlpha();\n\n\t/**\n\t * Sets the new value for alpha.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aAlpha new value to be set\n\t */\n\tpublic void setAlpha(double aAlpha);\n\n\t/**\n\t * Returns the guaranteed maximum score (loss) for the minimizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed maximum score for the minimizing player\n\t */\n\tpublic double getBeta();\n\n\t/**\n\t * Sets the new value for beta.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aBeta new value to be set\n\t */\n\tpublic void setBeta(double aBeta);\n\n\t/**\n\t * Returns the depth property (how deep in the tree is this state).\n\t *\n\t * @return depth property\n\t */\n\tpublic double getDepth();\n\n\t/**\n\t * Sets the depth property.\n\t *\n\t * @param aDepth depth value to be set\n\t */\n\tpublic void setDepth(double aDepth);\n\n public boolean isSolved();\n}", "LoadConstraintType getLoadConstraint();", "private void createConstraintsForSingleton() {\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() < 2)\n \t\t\t\tcontinue;\n \n \t\t\tCollection conflictingVersions = conflictingEntries.values();\n \t\t\tString singletonRule = \"\"; //$NON-NLS-1$\n \t\t\tArrayList nonSingleton = new ArrayList();\n \t\t\tint countSingleton = 0;\n \t\t\tfor (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {\n \t\t\t\tIInstallableUnit conflictElt = (IInstallableUnit) conflictIterator.next();\n \t\t\t\tif (conflictElt.isSingleton()) {\n \t\t\t\t\tsingletonRule += \" -1 \" + getVariable(conflictElt); //$NON-NLS-1$\n \t\t\t\t\tcountSingleton++;\n \t\t\t\t} else {\n \t\t\t\t\tnonSingleton.add(conflictElt);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (countSingleton == 0)\n \t\t\t\tcontinue;\n \n \t\t\tfor (Iterator iterator2 = nonSingleton.iterator(); iterator2.hasNext();) {\n \t\t\t\tconstraints.add(singletonRule + \" -1 \" + getVariable((IInstallableUnit) iterator2.next()) + \" >= -1;\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t\tsingletonRule += \" >= -1;\"; //$NON-NLS-1$\n \t\t\tconstraints.add(singletonRule);\n \t\t}\n \t}", "private static void populateBlocks() {\n\n //TODO set sensors for each\n\n /* Path A */\n SW1A.setProceeding(new Block[]{SW2A, STA1Z, SW2B});\n SW1A.setPreceding(new Block[]{PTH5A});\n\n SW2A.setProceeding(new Block[]{LD1A});\n SW2A.setPreceding(new Block[]{SW1A});\n\n SW3A.setProceeding(new Block[]{SW4A});\n SW3A.setPreceding(new Block[]{LD1A});\n\n SW4A.setProceeding(new Block[]{PTH1A});\n SW4A.setPreceding(new Block[]{SW3A, STA1Z, SW3B});\n\n PTH1A.setProceeding(new Block[]{PTH2A});\n PTH1A.setPreceding(new Block[]{SW4A});\n\n PTH2A.setProceeding(new Block[]{PTH3A});\n PTH2A.setPreceding(new Block[]{PTH1A});\n\n PTH3A.setProceeding(new Block[]{PTH4A});\n PTH3A.setPreceding(new Block[]{PTH2A});\n\n PTH4A.setProceeding(new Block[]{PTH5A});\n PTH4A.setPreceding(new Block[]{PTH3A});\n\n PTH5A.setProceeding(new Block[]{SW1A});\n PTH5A.setPreceding(new Block[]{PTH4A});\n\n LD1A.setProceeding(new Block[]{SW3A});\n LD1A.setPreceding(new Block[]{SW2A});\n\n\n /* Station */\n STA1Z.setProceeding(new Block[]{SW4A});\n STA1Z.setPreceding(new Block[]{SW1A});\n\n\n /* Path B */\n //TODO path B items aren't in yet\n LD1B.setProceeding(new Block[]{SW3B});\n LD1B.setPreceding(new Block[]{SW2B});\n\n SW2B.setProceeding(new Block[]{LD1B});\n SW2B.setPreceding(new Block[]{SW1B});\n\n SW3B.setProceeding(new Block[]{SW4B});\n SW3B.setPreceding(new Block[]{LD1B});\n\n\n /* Maintenance Bay */\n //TODO maintenance bay items aren't in yet\n\n\n\n\n /* Set up array */\n blocksArray = new Block[] {}; //TODO fill\n }", "protected void updateBaseline(TreeSet<StateTransition> stateTransitions) {\n if (!useBaseline) return;\n\n int size = stateTransitions.size();\n\n double mean = 0;\n for (StateTransition stateTransition : stateTransitions) mean += stateTransition.tdTarget;\n mean /= size;\n averageMean = averageMean == Double.MIN_VALUE ? mean : tau * averageMean + (1 - tau) * mean;\n\n double std = 0;\n for (StateTransition stateTransition : stateTransitions) std += Math.pow(stateTransition.tdTarget - mean, 2);\n std = Math.sqrt(std / (size - 1));\n averageStandardDeviation = averageStandardDeviation == Double.MIN_VALUE ? std : tau * averageStandardDeviation + (1 - tau) * std;\n\n for (StateTransition stateTransition : stateTransitions) {\n stateTransition.tdTarget = (stateTransition.tdTarget - averageMean) / averageStandardDeviation;\n }\n }", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "private void initState() {\r\n double metaintensity=0;\r\n double diffr=0;\r\n for(int ii=0; ii < Config.numberOfSeeds; ii++)\r\n {\r\n Cur_state[ii] = this.seeds[ii].getDurationMilliSec();\r\n// Zeit2 = this.seeds[1].getDurationMilliSec();\r\n// Zeit3 = this.seeds[2].getDurationMilliSec();\r\n// LogTool.print(\"Zeit 1 : \" + Zeit1 + \"Zeit 2 : \" + Zeit2 + \"Zeit 3 : \" + Zeit3, \"notification\");\r\n// LogTool.print(\"initState: Dwelltime Seed \" + ii + \" : \" + Cur_state[ii], \"notification\");\r\n// Cur_state[0] = Zeit1;\r\n// Cur_state[1] = Zeit2;\r\n// Cur_state[2] = Zeit3;\r\n }\r\n \r\n if ((Config.SACostFunctionType==3)||(Config.SACostFunctionType==1)) {\r\n for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) {\r\n for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n// this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n this.body2[x][y][z].metavalue = 0.0;\r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n metaintensity = this.body2[x][y][z].radiationIntensityNoTime((this.seeds2[i].getCoordinate()));\r\n // radiationIntensityNoTime(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (metaintensity>0) {\r\n // LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n // this.body2[x][y][z].addCurrentDosis(metaintensity);\r\n this.body2[x][y][z].metavalue += metaintensity; \r\n// Das ist implementation one\r\n } \r\n } \r\n }\r\n }\r\n// this.body = this.body2;\r\n } else {\r\n \r\n // for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) { \r\n for(int x=0; x < Solver.dimensions[0]; x+= Config.scaleFactor) {\r\n // for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int y=0; y < Solver.dimensions[1]; y+= Config.scaleFactor) {\r\n // for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n for(int z=0; z < Solver.dimensions[2]; z+= Config.scaleFactor) {\r\n // this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n this.body2[x][y][z].metavalue = 0.0;\r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n metaintensity = this.body2[x][y][z].radiationIntensityNoTime((this.seeds2[i].getCoordinate()));\r\n // radiationIntensityNoTime(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (metaintensity>0) {\r\n // LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n // this.body2[x][y][z].addCurrentDosis(metaintensity);\r\n this.body2[x][y][z].metavalue += metaintensity;\r\n this.body[x][y][z].metavalue = 0; \r\n this.body[x][y][z].metavalue += this.body2[x][y][z].metavalue;\r\n // Das ist implementation one\r\n } \r\n } \r\n }\r\n }\r\n// this.body = this.body2;\r\n diffr = ((this.body[43][43][43].metavalue)-(this.body2[43][43][43].metavalue));\r\n LogTool.print(\"Shallowcopy Check, value should be 0 :\" + diffr + \"@ 43,43,43 \",\"notification\");\r\n }\r\n }", "IfaceState createState(int nlocal,IfaceSafetyStatus sts);", "private void calculateStatesStatesPruning(int iNode1, int iNode2, int iNode3) {\n\t\t// prepare the stack\n\t\tm_nOperation[m_nTopOfStack] = OPERATION_SS;\n\t\tif (m_fPartials[m_iCurrentPartials[iNode1]][iNode1] != null && m_fPartials[m_iCurrentPartials[iNode2]][iNode2] != null) {\n\t\t\t// for handling ambiguities\n\t\t\tm_nOperation[m_nTopOfStack] = OPERATION_PP;\n\t\t}\n\t\t\n\t\tm_nNode1[m_nTopOfStack] = iNode1;\n\t\tm_nNode2[m_nTopOfStack] = iNode2;\n\t\tm_nNode3[m_nTopOfStack] = iNode3;\n\t\tm_nTopOfStack++;\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6900, \"inverted=true\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6901, \"inverted=true\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6902, \"inverted=true\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6903, \"inverted=true\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6904, \"inverted=true\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6905, \"inverted=true\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6906, \"inverted=true\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6907, \"inverted=true\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6908, \"inverted=true\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6909, \"inverted=true\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6910, \"inverted=true\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6911, \"inverted=true\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6912, \"inverted=true\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6913, \"inverted=true\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6914, \"inverted=true\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6915, \"inverted=true\", \"power=15\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6916, \"inverted=false\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6917, \"inverted=false\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6918, \"inverted=false\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6919, \"inverted=false\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6920, \"inverted=false\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6921, \"inverted=false\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6922, \"inverted=false\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6923, \"inverted=false\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6924, \"inverted=false\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6925, \"inverted=false\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6926, \"inverted=false\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6927, \"inverted=false\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6928, \"inverted=false\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6929, \"inverted=false\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6930, \"inverted=false\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6931, \"inverted=false\", \"power=15\"));\n }", "public String toString()\n {\n \tint tempIndex;\n \tStringBuilder statesStr = new StringBuilder(\"States: { \");\n \tfor(ComplexState state: states)\n \t\tstatesStr.append(state.getName() + \", \");\n\t\ttempIndex = statesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tstatesStr.deleteCharAt(statesStr.lastIndexOf(\",\"));\n \tstatesStr.append(\"}\\n\");\n \tStringBuilder initStatesStr = new StringBuilder(\"Initial states: { \");\n \tfor(ComplexState state: initialStates)\n \t\tinitStatesStr.append(state.getName() + \", \");\n \ttempIndex = initStatesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tinitStatesStr.deleteCharAt(initStatesStr.lastIndexOf(\",\"));\n \tinitStatesStr.append(\"}\\n\");\n \tStringBuilder transitionFuncStr = new StringBuilder(\"Transition relation: { \");\n \tArrayList<ComplexState> destStates = new ArrayList<ComplexState>();\n \tfor(ComplexState srcState: states) \n \t{\n \t\tdestStates = transitionRelation.get(srcState);\n \t\tif(destStates != null)\n\t \t\tfor(ComplexState destState: destStates)\n\t \t\t\ttransitionFuncStr.append(\"( \" + srcState.getName() + \", \" + destState.getName() + \" ), \" );\t\n \t}\n \ttempIndex = transitionFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\ttransitionFuncStr.deleteCharAt(transitionFuncStr.lastIndexOf(\",\"));\n \ttransitionFuncStr.append(\"}\\n\");\n \tStringBuilder labelingFuncStr = new StringBuilder(\"Labeling function: { \");\n \tArrayList<AtomicProp> atomicProps = new ArrayList<AtomicProp>();\n \tfor(ComplexState state: states) \n \t{\n \t\tlabelingFuncStr.append(\"( \" + state.getName() + \", { \");\n \t\tatomicProps = state.getLabels();\n \t\tif(atomicProps != null)\n \t\t\tfor(AtomicProp ap: state.getLabels())\n \t\t\t\tlabelingFuncStr.append(ap.getName() + \", \");\n \t\ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \t\tlabelingFuncStr.append(\"} ), \");\n \t}\n \ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \tlabelingFuncStr.append(\"}\\n\"); \t\n \tString result = statesStr.toString() + initStatesStr.toString() + transitionFuncStr.toString() + labelingFuncStr.toString() + \"Type: \" + type.toString();\n \treturn result;\n }", "private void loadRules() throws DataNormalizationException {\n\t\tloadRules(TableVersion.COMMITTED);\n\t}", "public static FA parseFromFile(String path) throws Exception {\n\t\ttry {\n\t\t\tSet<State> states = new HashSet<>();\n\t\t\tSet<Character> alphabet = new HashSet<>();\n\t\t\tSet<Triple<State,Character,State>> transitions = new HashSet<>();\n\t\t\tString departureStName = null;\n\t\t\tString arrivalStName = null;\n\t\t\tSet<String> finalStsNames = new HashSet<>();\n\t\t\tString initialStName = \"\";\n\t\t\tState initialState = null;\n\t\t\tScanner firstScanner = new Scanner(new File(\"tp1/Automatas/\"+path+\".dot\"));\n\t\t\twhile(firstScanner.hasNextLine()) {\n\t\t\t\tString line = firstScanner.nextLine().replaceAll(\"\\\\s+\",\"\");\n\t\t\t\tif (line.contains(\"[shape=doublecircle]\")) {\n\t\t\t\t\tString newLine = line.replace('[', '/');\n\t\t\t\t\tString[] res = newLine.split(\"/\");\n\t\t\t\t\tfinalStsNames.add(res[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfirstScanner.close();\n\t\t\tScanner secondScanner = new Scanner(new File(\"tp1/Automatas/\"+path+\".dot\"));\n\t\t\twhile(secondScanner.hasNextLine()) {\n\t\t\t\tString line = secondScanner.nextLine().replaceAll(\"\\\\s+\",\"\");\n\t\t\t\tif (line.contains(\"inic->\")) {\n\t\t\t\t\tString[] res = line.split(\"->\");\n\t\t\t\t\tinitialStName = res[1].substring(0, res[1].length()-1);\n\t\t\t\t\tif (finalStsNames.contains(initialStName))\n\t\t\t\t\t\tinitialState = new State(initialStName, true, true);\n\t\t\t\t\telse\n\t\t\t\t\t\tinitialState = new State(initialStName, true, false);\n\t\t\t\t\tstates.add(initialState);\n\t\t\t\t}\n\t\t\t\telse if (line.contains(\"->\")) {\n\t\t\t\t\tString newLine = line.replaceAll(\"[->=]\",\"/\");\n\t\t\t\t\tnewLine = newLine.replace('[','/').replace('\"','/');\n\t\t\t\t\tString[] res = newLine.split(\"/\");\n\t\t\t\t\tdepartureStName = res[0];\n\t\t\t\t\tarrivalStName = res[2];\n\t\t\t\t\tCharacter symbol = res[5].charAt(0);\n\t\t\t\t\tState departureState;\n\t\t\t\t\tState arrivalState;\n\t\t\t\t\tif (departureStName.equals(initialStName)) {\n\t\t\t\t\t\tdepartureState = initialState;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (finalStsNames.contains(departureStName))\n\t\t\t\t\t\t\tdepartureState = new State(departureStName, false, true);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdepartureState = new State(departureStName, false, false);\n\t\t\t\t\t\tstates.add(departureState);\n\t\t\t\t\t}\n\t\t\t\t\tif (arrivalStName.equals(initialStName)) {\n\t\t\t\t\t\tarrivalState = initialState;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (finalStsNames.contains(arrivalStName))\n\t\t\t\t\t\t\tarrivalState = new State(arrivalStName, false, true);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tarrivalState = new State(arrivalStName, false, false);\n\t\t\t\t\t\tstates.add(arrivalState);\n\t\t\t\t\t}\n\t\t\t\t\talphabet.add(symbol);\n\t\t\t\t\ttransitions.add(new Triple<>(departureState,symbol,arrivalState));\n\t\t\t\t}\n\t\t\t}\n\t\t\tsecondScanner.close();\n\t\t\tif (alphabet.contains(Lambda))\n\t\t\t\treturn new NFALambda(states, alphabet, transitions);\n\t\t\telse {\n\t\t\t\tfor (Triple<State,Character,State> t1 : transitions) {\n\t\t\t\t\tfor (Triple<State,Character,State> t2 : transitions) {\n\t\t\t\t\t\tif (t1.first().equals(t2.first()) && t1.second().equals(t2.second()) && !t1.third().equals(t2.third())) {\n\t\t\t\t\t\t\treturn new NFA(states, alphabet, transitions);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new DFA(states, alphabet, transitions);\n\t\t\t}\n\t\t}\n\t\tcatch(FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "@Override\r\n\tpublic void init() {\n\r\n\t PetriNet _net = new PetriNet(this, \"PhilosopherNet\", true, true);\r\n\t ContDistExponential dist1 = new ContDistExponential(this, \"waitdist1\", 2, true, true);\r\n\t ContDistExponential dist2 = new ContDistExponential(this, \"waitdist1\", 3, true, true);\r\n\t ContDistExponential dist3 = new ContDistExponential(this, \"durdist1\", 3, true, true);\r\n\r\n\t\t// Declaration of the used types of Tokens. These have to be objects\r\n\t\t// implementing the TokenType interface. Note that there is only one\r\n\t\t// object for each type, no matter how many Tokens of that type may\r\n\t\t// exist. A different object (even of the same class) always declares a\r\n\t\t// new, different type of token.\r\n\t\t\r\n\t\tTokenType type1 = new Fork();\r\n\t\tTokenType type2 = new Fork();\r\n\t\tTokenType type3 = new Fork();\r\n\t\tTokenType type4 = new Fork();\r\n\t\tTokenType type5 = new Fork();\r\n\t\tMap<TokenType, Integer> tokens = TokenMultiSetTools.arrayToMap(\r\n\t\t\t\tnew TokenType[] { type1, type2, type3, type4, type5 },\r\n\t\t\t\tnew int[] { 1, 1, 1, 1, 1 });\r\n\r\n\t\tPlace p1 = new Place(this, _net, \"p1\", tokens, true, true, true);\r\n\r\n\t\tTransitionMode t1 = new TransitionMode(this, _net, \"t1\", dist1, dist3, true, true);\r\n\t\tTransitionMode t2 = new TransitionMode(this, _net, \"t2\", dist2, dist3, true, true);\r\n\t\tTransitionMode t3 = new TransitionMode(this, _net, \"t3\", dist1, dist3, true, true);\r\n\t\tTransitionMode t4 = new TransitionMode(this, _net, \"t4\", dist2, dist3, true, true);\r\n\t\tTransitionMode t5 = new TransitionMode(this, _net, \"t5\", dist1, dist3, true, true);\r\n\r\n\t\tTransition trans = new Transition(this, _net, \"Mahlzeit\", true, true);\r\n\t\ttrans.addTransitionMode(t1);\r\n\t\ttrans.addTransitionMode(t2);\r\n\t\ttrans.addTransitionMode(t3);\r\n\t\ttrans.addTransitionMode(t4);\r\n\t\ttrans.addTransitionMode(t5);\r\n\r\n\t\tt1.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type1,\r\n\t\t\t\ttype2 }, new int[] { 1, 1 }));\r\n\t\tt1.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type1,\r\n\t\t\t\ttype2 }, new int[] { 1, 1 }));\r\n\r\n\t\tt2.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type2,\r\n\t\t\t\ttype3 }, new int[] { 1, 1 }));\r\n\t\tt2.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type2,\r\n\t\t\t\ttype3 }, new int[] { 1, 1 }));\r\n\r\n\t\tt3.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type3,\r\n\t\t\t\ttype4 }, new int[] { 1, 1 }));\r\n\t\tt3.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type3,\r\n\t\t\t\ttype4 }, new int[] { 1, 1 }));\r\n\r\n\t\tt4.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type4,\r\n\t\t\t\ttype5 }, new int[] { 1, 1 }));\r\n\t\tt4.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type4,\r\n\t\t\t\ttype5 }, new int[] { 1, 1 }));\r\n\r\n\t\tt5.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type5,\r\n\t\t\t\ttype1 }, new int[] { 1, 1 }));\r\n\t\tt5.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type5,\r\n\t\t\t\ttype1 }, new int[] { 1, 1 }));\r\n\r\n\t}", "protected void MemorizeBestSource() {\n int i, j;\n\n bestUnchanged = true;\n for (i = 0; i < FoodNumber; i++) {\n if (f[i] < GlobalMin) {\n GlobalMin = f[i];\n for (j = 0; j < D; j++) {\n GlobalParams[j] = Foods[i][j];\n GlobalSalesman[j] = Salesmans[i][j];\n }\n bestUnchanged = false;\n }\n }\n }", "@Override\r\n\tpublic void init() { \r\n\t\t\r\n\t\tsession = -1;\r\n\t\t\r\n\t\tProgressDif = 0;\r\n\t\tnoisFact = 0;\r\n\t\tcompromiseFact = 0;\r\n\t\t\r\n\t\tcompromiseLearn = 20;\r\n\t\tprogressLearn = 10;\r\n\t\tnoisLearn = 0.2;\r\n\t\t\r\n\t\treservationPanic = 0.2;\r\n\t\tmyBids = new ArrayList<Pair<Bid,Double>>();\r\n\t\topponentBidsA = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\t\topponentBidsB = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\r\n\t\tdf = utilitySpace.getDiscountFactor();\r\n\t\tif (df==0) df = 1; \r\n\r\n\t\ttry {\r\n\t\t\tinitStates();\r\n\t\t} catch (Exception e) {\r\n \t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t}", "private void enterSequence_mainRegion_State1_default() {\n\t\tnextStateIndex = 0;\n\t\tstateVector[0] = State.mainRegion_State1;\n\t}", "public boolean isUnsat(ConstraintsState pConstraints, String pFunctionName)\n throws SolverException, InterruptedException, UnrecognizedCCodeException {\n\n if (!pConstraints.isEmpty()) {\n try {\n timeForSatChecks.start();\n Set<Constraint> relevantConstraints = new HashSet<>();\n if (performMinimalSatCheck && pConstraints.getLastAddedConstraint().isPresent()) {\n try {\n timeForIndependentComputation.start();\n Constraint lastConstraint = pConstraints.getLastAddedConstraint().get();\n Set<Constraint> leftOverConstraints = new HashSet<>(pConstraints);\n Set<SymbolicIdentifier> newRelevantIdentifiers = lastConstraint.accept(locator);\n Set<SymbolicIdentifier> relevantIdentifiers;\n do {\n relevantIdentifiers = ImmutableSet.copyOf(newRelevantIdentifiers);\n Iterator<Constraint> it = leftOverConstraints.iterator();\n while (it.hasNext()) {\n Constraint currentC = it.next();\n Set<SymbolicIdentifier> containedIdentifiers = currentC.accept(locator);\n if (!Sets.intersection(containedIdentifiers, relevantIdentifiers).isEmpty()) {\n newRelevantIdentifiers = Sets.union(newRelevantIdentifiers, containedIdentifiers);\n relevantConstraints.add(currentC);\n it.remove();\n }\n }\n } while (!newRelevantIdentifiers.equals(relevantIdentifiers));\n\n } finally {\n timeForIndependentComputation.stop();\n }\n\n } else {\n relevantConstraints = pConstraints;\n }\n\n BooleanFormula constraintsAsFormula =\n getFullFormula(\n relevantConstraints, pConstraints.getDefiniteAssignment(), pFunctionName);\n prover = solver.newProverEnvironment(ProverOptions.GENERATE_MODELS);\n prover.push(constraintsAsFormula);\n\n Boolean unsat = null; // assign null to fail fast if assignment is missed\n ImmutableList<ValueAssignment> modelAsAssignment = pConstraints.getModel();\n ImmutableList<ValueAssignment> newModelAsAssignment = ImmutableList.of();\n if (useLastModel) {\n BooleanFormula lastModel =\n modelAsAssignment\n .stream()\n .map(ValueAssignment::getAssignmentAsFormula)\n .collect(booleanFormulaManager.toConjunction());\n prover.push(lastModel);\n unsat = prover.isUnsat();\n if (!unsat) {\n // get this before popping the model assignment ; the operation will be invalid\n // otherwise\n newModelAsAssignment = prover.getModelAssignments();\n }\n // We have to remove the model assignment before resolving definite assignments, below.\n prover.pop(); // Remove model assignment from prover\n }\n\n boolean gotResultFromCache = false;\n\n if (!useLastModel || (unsat && !modelAsAssignment.isEmpty())) {\n // if the last model does not fulfill the formula, and the last model actually\n // is some variable assignment (i.e., model != true), then we check the formula\n // for satisfiability without any assignments, again.\n CacheResult res = cache.getCachedResult(pConstraints);\n\n if (res.isUnsat()) {\n unsat = true;\n gotResultFromCache = true;\n } else if (res.isSat()) {\n unsat = false;\n gotResultFromCache = true;\n pConstraints.setModel(res.getModelAssignment());\n } else {\n prover.close();\n prover = solver.newProverEnvironment(ProverOptions.GENERATE_MODELS);\n prover.push(constraintsAsFormula);\n unsat = prover.isUnsat();\n\n if (!unsat) {\n newModelAsAssignment = prover.getModelAssignments();\n }\n }\n }\n\n if (!gotResultFromCache) {\n if (!unsat) {\n pConstraints.setModel(newModelAsAssignment);\n cache.addSat(pConstraints, newModelAsAssignment);\n // doing this while the complete formula is still on the prover environment stack is\n // cheaper than performing another complete SAT check when the assignment is really\n // requested\n if (resolveDefinites) {\n resolveDefiniteAssignments(pConstraints, newModelAsAssignment, pFunctionName);\n }\n\n } else {\n cache.addUnsat(pConstraints);\n }\n }\n\n return unsat;\n\n } finally {\n closeProver();\n timeForSatChecks.stop();\n }\n\n } else {\n return false;\n }\n }", "public void generateCost() throws StandardException {\n\n double baseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE);\n double filterBaseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE,QualifierPhase.FILTER_BASE);\n double projectionSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.FILTER_PROJECTION);\n double totalSelectivity = computeTotalSelectivity(selectivityHolder);\n\n assert filterBaseTableSelectivity >= 0 && filterBaseTableSelectivity <= 1.0:\"filterBaseTableSelectivity Out of Bounds -> \" + filterBaseTableSelectivity;\n assert baseTableSelectivity >= 0 && baseTableSelectivity <= 1.0:\"baseTableSelectivity Out of Bounds -> \" + baseTableSelectivity;\n assert projectionSelectivity >= 0 && projectionSelectivity <= 1.0:\"projectionSelectivity Out of Bounds -> \" + projectionSelectivity;\n assert totalSelectivity >= 0 && totalSelectivity <= 1.0:\"totalSelectivity Out of Bounds -> \" + totalSelectivity;\n\n // Total Row Count from the Base Conglomerate\n double totalRowCount = scc.baseRowCount();\n assert totalRowCount >= 0 : \"totalRowCount cannot be negative -> \" + totalRowCount;\n // Rows Returned is always the totalSelectivity (Conglomerate Independent)\n scanCost.setEstimatedRowCount(Math.round(totalRowCount*totalSelectivity));\n\n double baseTableAverageRowWidth = scc.getBaseTableAvgRowWidth();\n double baseTableColumnSizeFactor = scc.baseTableColumnSizeFactor(totalColumns);\n\n // We use the base table so the estimated heap size and remote cost are the same for all conglomerates\n double colSizeFactor = baseTableAverageRowWidth*baseTableColumnSizeFactor;\n assert baseTableAverageRowWidth >= 0 : \"baseTableAverageRowWidth cannot be negative -> \" + baseTableAverageRowWidth;\n assert baseTableColumnSizeFactor >= 0 : \"baseTableColumnSizeFactor cannot be negative -> \" + baseTableColumnSizeFactor;\n\n double openLatency = scc.getOpenLatency();\n double closeLatency = scc.getCloseLatency();\n double localLatency = scc.getLocalLatency();\n double remoteLatency = scc.getRemoteLatency();\n double remoteCost = openLatency + closeLatency + totalRowCount*totalSelectivity*remoteLatency*(1+colSizeFactor/100d);\n assert openLatency >= 0 : \"openLatency cannot be negative -> \" + openLatency;\n assert closeLatency >= 0 : \"closeLatency cannot be negative -> \" + closeLatency;\n assert localLatency >= 0 : \"localLatency cannot be negative -> \" + localLatency;\n assert remoteLatency >= 0 : \"remoteLatency cannot be negative -> \" + remoteLatency;\n assert remoteCost >= 0 : \"remoteCost cannot be negative -> \" + remoteCost;\n // Heap Size is the avg row width of the columns for the base table*total rows\n // Average Row Width\n // This should be the same for every conglomerate path\n scanCost.setEstimatedHeapSize((long)(totalRowCount*totalSelectivity*colSizeFactor));\n // Should be the same for each conglomerate\n scanCost.setRemoteCost((long)remoteCost);\n // Base Cost + LookupCost + Projection Cost\n double congAverageWidth = scc.getConglomerateAvgRowWidth();\n double baseCost = openLatency+closeLatency+(totalRowCount*baseTableSelectivity*localLatency*(1+congAverageWidth/100d));\n assert congAverageWidth >= 0 : \"congAverageWidth cannot be negative -> \" + congAverageWidth;\n assert baseCost >= 0 : \"baseCost cannot be negative -> \" + baseCost;\n scanCost.setFromBaseTableRows(filterBaseTableSelectivity * totalRowCount);\n scanCost.setFromBaseTableCost(baseCost);\n double lookupCost;\n if (lookupColumns == null)\n lookupCost = 0.0d;\n else {\n lookupCost = totalRowCount*filterBaseTableSelectivity*(openLatency+closeLatency);\n scanCost.setIndexLookupRows(filterBaseTableSelectivity*totalRowCount);\n scanCost.setIndexLookupCost(lookupCost+baseCost);\n }\n assert lookupCost >= 0 : \"lookupCost cannot be negative -> \" + lookupCost;\n\n double projectionCost;\n if (projectionSelectivity == 1.0d)\n projectionCost = 0.0d;\n else {\n projectionCost = totalRowCount * filterBaseTableSelectivity * localLatency * colSizeFactor*1d/1000d;\n scanCost.setProjectionRows(scanCost.getEstimatedRowCount());\n scanCost.setProjectionCost(lookupCost+baseCost+projectionCost);\n }\n assert projectionCost >= 0 : \"projectionCost cannot be negative -> \" + projectionCost;\n\n double localCost = baseCost+lookupCost+projectionCost;\n assert localCost >= 0 : \"localCost cannot be negative -> \" + localCost;\n scanCost.setLocalCost(localCost);\n scanCost.setNumPartitions(scc.getNumPartitions());\n scanCost.setLocalCostPerPartition((baseCost + lookupCost + projectionCost)/scc.getNumPartitions());\n }", "public void updateState(){\n\t\t\n\t\t\n\t\t\n\t\tArrayList<String> toAdd = new ArrayList<String>();\n\t\tArrayList<String> toRemove = new ArrayList<String>();\n\n\t\tthis.lastAdded.clear();\n\t\tthis.lastFulfilled.clear();\n\t\tthis.lastViolated.clear();\n\t\t\n\t\ttry {\n\n\t\t\tdo{\n\t\t\t\ttoAdd.clear();\n\t\t\t\ttoRemove.clear();\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iActive = reasoner.findall(\"xactive(A,Fa,Fm,Fd,Fr,Timeout)&not(as(A,Fa,Fm,Fd,Fr,Timeout))\");\n\t\t\t\twhile(iActive.hasNext()){\n\t\t\t\t\tUnifier un = iActive.next();\n\t\t\t\t\ttoAdd.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+ adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastAdded.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+ adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iViol = reasoner.findall(\"xviol(A,Fa,Fm,Fd,Fr,Timeout)&not(vs(A,Fa,Fm,Fd,Fr,Timeout))\");\n\t\t\t\twhile(iViol.hasNext()){\n\t\t\t\t\tUnifier un = iViol.next();\n\t\t\t\t\ttoAdd.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastViolated.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iDeactF = reasoner.findall(\"xdeact_f(A,Fa,Fm,Fd,Fr,Timeout)\");\n\t\t\t\twhile(iDeactF.hasNext()){\n\t\t\t\t\tUnifier un = iDeactF.next();\n\t\t\t\t\ttoAdd.add(\"ds(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString()+\",\"+un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastFulfilled.add(\"as(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iDeactR = reasoner.findall(\"xdeact_r(A,Fa,Fm,Fd,Fr,Timeout)\");\n\t\t\t\twhile(iDeactR.hasNext()){\n\t\t\t\t\tUnifier un = iDeactR.next();\n\t\t\t\t\ttoAdd.add(\"ds(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\tthis.lastFulfilled.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIterator<Unifier> iFailed = reasoner.findall(\"xfailed(A,Fa,Fm,Fd,Fr,Timeout)\");\n\t\t\t\twhile(iFailed.hasNext()){\n\t\t\t\t\tUnifier un = iFailed.next();\n\t\t\t\t\ttoAdd.add(\"fs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t\ttoRemove.add(\"vs(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//norms deactivated (fulfilled) whose maintenance condition does not hold can be removed.\n\t\t\t\t//if they are not removed, new instances of the same norm are not activated\n\t\t\t\tIterator<Unifier> iDeactivated_to_remove = reasoner.findall(\"ds(A,Fa,Fm,Fd,Fr,Timeout)&not(Fm)\");\n\t\t\t\twhile(iDeactivated_to_remove.hasNext()){\n\t\t\t\t\tUnifier un = iDeactivated_to_remove.next();\n\t\t\t\t\ttoRemove.add(\"ds(\"+adaptTerm(un.get(\"A\").toString())+\",\"+adaptTerm(un.get(\"Fa\").toString())+\",\"+adaptTerm(un.get(\"Fm\").toString())+\",\"+adaptTerm(un.get(\"Fd\").toString())+\",\"+adaptTerm(un.get(\"Fr\").toString())+\",\"+adaptTerm(un.get(\"Timeout\").toString())+\")\");\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tfor(String s:toAdd){\n\t\t\t\t\treasoner.assertValue(s);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(String s:toRemove){\n\t\t\t\t\treasoner.retract(s);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}while(toAdd.size()>0|toRemove.size()>0);\t\t\t\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "void onPartialSchedule(State state, Bound bound);", "@Override\n\tpublic void stablize() {\n\n\t}" ]
[ "0.5495977", "0.53509593", "0.53213596", "0.5274447", "0.5121231", "0.5084851", "0.50842166", "0.5065969", "0.5036651", "0.49918306", "0.49856636", "0.49622568", "0.49457937", "0.49094322", "0.48996636", "0.48849663", "0.48826113", "0.4863468", "0.48526835", "0.48257053", "0.47989205", "0.47896457", "0.4778628", "0.47603524", "0.47507164", "0.47061604", "0.47016394", "0.4700927", "0.469209", "0.4689031", "0.4681063", "0.46635887", "0.46552524", "0.4650262", "0.46477243", "0.46444243", "0.46434823", "0.46414354", "0.46362177", "0.46360388", "0.46189335", "0.46082345", "0.460437", "0.46034855", "0.4596879", "0.45917985", "0.45830935", "0.45822278", "0.45758054", "0.45609418", "0.45604286", "0.45593524", "0.45572183", "0.4553125", "0.45520872", "0.4530229", "0.45238364", "0.4520405", "0.45193017", "0.4516147", "0.4513819", "0.45129025", "0.45117837", "0.45095327", "0.45083588", "0.4498581", "0.44971478", "0.44961149", "0.44890967", "0.44871938", "0.44866437", "0.4481694", "0.44761875", "0.4475957", "0.44746798", "0.44733423", "0.447321", "0.4467357", "0.44659758", "0.44637603", "0.44542882", "0.44492215", "0.4438055", "0.44309697", "0.44307673", "0.44221523", "0.44191447", "0.44177076", "0.4412105", "0.44120347", "0.44074798", "0.4403471", "0.44016162", "0.43963253", "0.43961576", "0.4391864", "0.43908504", "0.43885332", "0.4386678", "0.43804494", "0.43754005" ]
0.0
-1
Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Nonmerged FX Curve FX Forward Latent State from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
public org.drip.state.estimator.PredictorResponseWeightConstraint fxPRWC ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp, final org.drip.product.calib.ProductQuoteSet pqs) { if (null == valParams) return null; int iValueDate = valParams.valueDate(); org.drip.state.estimator.PredictorResponseWeightConstraint prwc = new org.drip.state.estimator.PredictorResponseWeightConstraint(); for (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) { int iPeriodEndDate = period.endDate(); if (iPeriodEndDate < iValueDate) continue; org.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.fxPRWC (iValueDate, csqs, pqs); if (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null; } return prwc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "public org.drip.state.estimator.PredictorResponseWeightConstraint fundingForwardPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel();\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardFundingPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "private void addC1Constraints(GRBVar[][] xVars, GRBModel model) throws GRBException {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tString constraintName = \"constraintC1_\" + i;\n\t\t\t// out_x(i) - in_x(i) = 0\n\t\t\tGRBLinExpr constraintLinExpr = new GRBLinExpr();\n\n\t\t\t// Expression += out_x(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Expression -= in_x(i)\n\t\t\tGRBSolverUtils.addInTerm(i, -1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Add constraint\n\t\t\tmodel.addConstr(constraintLinExpr, GRB.EQUAL, 0, constraintName);\n\t\t}\n\t}", "public void controlPointsChanged(List<Coordinates> lcp) {\n // sort the control points by x position.\n // this makes things easier later when we paint the function.\n lcp.sort(\n (point1,point2) -> Integer.compare(point1.getX(),point2.getX())\n );\n\n // collect the points in an array before doing the calculations.\n // again, this makes things easier for us.\n controlPoints=lcp.toArray(new Coordinates[0]);\n n=controlPoints.length;\n if(n<2) {\n // nothing to do here\n return;\n }\n double []X = new double[n];\n double []Y = new double[n];\n for(int i =0;i<n;i++){\n \tX[i]=controlPoints[i].getX();\n \tY[i]=controlPoints[i].getY();\n }\n // Construct the linear system S*C=T with n-2 equations.\n // The matrix S contains the left hand side of the equations on slide 13.\n // The matrix Z contains the right hand side of the equations on slide 13.\n double[][] S=new double[n-2][n-2];\n double[] Z=new double[n-2];\n \n // Fill the matrix S and the vector Z and solve S*C=T to get c_2 to c_{n-1}.\n for(int i = 0; i< n-3;i++){\n \tS[i][i]=2*delta(X,i+1,0);\n \tS[i+1][i]=delta(X,i+2,-1);\n \tS[i][i+1]=delta(X,i+1,1);\n \tZ[i]=z(Y,X,i);\n }\n S[n-2][n-2]=2*delta(X,n-1,0);\n \n C= EliminationGaussLegendre.solve(S, Z);\n \n // Calculate the n-1 coefficients b_i and d_i.\n // Note that you need all c_i here (but you know that c_1 and c_n are zero).\n //a_i = y_i;\n for(int i=1 ; i<n ; i++){\n \tD[i-1]=d(Y,X,i-1);\n \tB[i-1]=b(Y,C,X,i-1);\n }\n \n }", "private double[] design_lpf(double Fp,\n double Fc,\n double Fn,\n boolean allow_aliasing,\n double att,\n int[] num_taps,\n int k) {\n double tr_bw, beta;\n\n if (allow_aliasing) {\n Fc += (Fc - Fp) * TO_3dB;\n }\n Fp /= Fn;\n Fc /= Fn; // Normalise to Fn = 1\n tr_bw = TO_6dB * (Fc - Fp); // Transition band-width: 6dB to stop points\n\n if (num_taps[0] == 0) { // TODO this could be cleaner, esp. for k != 0\n double n160 = (.0425 * att - 1.4) / tr_bw; // Half order for att = 160\n int n = (int) (n160 * (16.556 / (att - 39.6) + .8625) + .5); // For att [80,160)\n num_taps[0] = k != 0 ? 2 * n : 2 * (n + (n & 1)) + 1; // =1 %4 (0 phase 1/2 band)\n }\n assert att >= 80;\n beta = att < 100 ? .1102 * (att - 8.7) : .1117 * att - 1.11;\n if (k != 0) {\n num_taps[0] = num_taps[0] * k - 1;\n } else {\n k = 1;\n }\n return make_lpf(num_taps[0], (Fc - tr_bw) / k, beta, k);\n }", "public void calculateCG() {\n\n\t\t//-------------------------------------------------------------\n\t\t// Lateral faces xCG calculation (LFR = Local Reference Frame):\n\t\tList<Double[]> xCGLateralFacesLFRList = new ArrayList<Double[]>();\n\t\t\n\t\tfor(int i=0; i<this._prismoidsLength.size(); i++) {\n\t\t\t\n\t\t\tDouble[] xCGLateralFacesLFR = new Double[4];\n\t\t\t\n\t\t\txCGLateralFacesLFR[0] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[1] = this._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[2] = this._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i+1).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[3] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFRList.add(xCGLateralFacesLFR);\n\t\t}\n\t\t\n\t\t//-------------------------------------------------------------\n\t\t// Calculation of the Xcg coordinates of each prismoid in wing LRF.\n\t\t\n\t\tList<Amount<Length>> xCGPrismoidsList = new ArrayList<Amount<Length>>();\n\t\t\n\t\tfor(int i=0; i<xCGLateralFacesLFRList.size(); i++) {\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseY = new double[2];\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseY = new double[2];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceSpanwiseX[0] = this._fuelTankStations.get(i).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseX[1] = this._fuelTankStations.get(i+1).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[0];\n\t\t\txCGSegmentOppositeFaceSpanwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i+1).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[2];\n\n\t\t\txCGSegmentOppositeFaceChordwiseX[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[3]; \n\t\t\txCGSegmentOppositeFaceChordwiseX[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[1];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceChordwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\txCGSegmentOppositeFaceChordwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ ((this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getSecondarySparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()));\n\n\t\t\t// check if the chordwise X array is monotonic increasing\n\t\t\tif(xCGSegmentOppositeFaceChordwiseX[1] - xCGSegmentOppositeFaceChordwiseX[0] < 0.0001)\n\t\t\t\txCGSegmentOppositeFaceChordwiseX[0] -= 0.0001; \n\t\t\t\n\t\t\t// now that the segments coordinates are calculated, we have to intersect these latter.\n\t\t\txCGPrismoidsList.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tMyMathUtils.getInterpolatedValue1DLinear(\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseX,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseY,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceChordwiseX[0]),\n\t\t\t\t\t\t\tSI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n xCG list = \" + xCGPrismoidsList);\n\t\t\n\t\t_xCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\tfor(int i=0; i<this._prismoidsVolumes.size(); i++)\n\t\t\t_xCGLRF = _xCGLRF.plus(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tthis._prismoidsVolumes.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t*xCGPrismoidsList.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t, SI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t_xCGLRF = _xCGLRF.divide(this._fuelVolume.divide(2).getEstimatedValue());\n\t\t_xCG = _xCGLRF.plus(_theWing.getXApexConstructionAxes());\n\t\t\n\t\t_yCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t_yCG = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\t_zCGLRF = _theWing.getTheBalanceManager().getCG().getZLRF();\n\t\t_zCG = _theWing.getTheBalanceManager().getCG().getZBRF();\n\t\t\n\t\t_cG = new CenterOfGravity();\n\t\t_cG.setX0(_theWing.getXApexConstructionAxes().to(SI.METER));\n\t\t_cG.setY0(_theWing.getYApexConstructionAxes().to(SI.METER));\n\t\t_cG.setZ0(_theWing.getZApexConstructionAxes().to(SI.METER));\n\t\t_cG.setXLRF(_xCGLRF.to(SI.METER));\n\t\t_cG.setYLRF(_yCGLRF.to(SI.METER));\n\t\t_cG.setZLRF(_zCGLRF.to(SI.METER));\n\t\t\n\t\t_cG.calculateCGinBRF(ComponentEnum.FUEL_TANK);\n\t\t\n\t}", "public org.drip.state.estimator.PredictorResponseWeightConstraint forwardPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel();\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = null != floaterLabel && floaterLabel instanceof\n\t\t\torg.drip.state.identifier.ForwardLabel ? (org.drip.state.identifier.ForwardLabel) floaterLabel :\n\t\t\t\tnull;\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "public static final org.drip.state.forward.ForwardCurve ShapePreservingForwardCurve (\n\t\tfinal org.drip.state.inference.LinearLatentStateCalibrator llsc,\n\t\tfinal org.drip.state.inference.LatentStateStretchSpec[] aStretchSpec,\n\t\tfinal org.drip.state.identifier.ForwardLabel fri,\n\t\tfinal org.drip.param.valuation.ValuationParams valParam,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParam,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams quotingParam,\n\t\tfinal double dblEpochResponse)\n\t{\n\t\tif (null == llsc) return null;\n\n\t\ttry {\n\t\t\torg.drip.state.forward.ForwardCurve fc = new org.drip.state.curve.BasisSplineForwardRate (fri,\n\t\t\t\tllsc.calibrateSpan (aStretchSpec, dblEpochResponse, valParam, pricerParam, quotingParam,\n\t\t\t\t\tcsqs));\n\n\t\t\treturn fc.setCCIS (new org.drip.analytics.input.LatentStateShapePreservingCCIS (llsc,\n\t\t\t\taStretchSpec, valParam, pricerParam, quotingParam, csqs)) ? fc : null;\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "public org.drip.state.estimator.PredictorResponseWeightConstraint fundingPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel();\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.fundingPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "public double[] ConsumptionDecisionRule(double[] Kt, double[] Zt) {\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0]);\r\n\t\tdouble[] result = new double[N];\r\n\t\tdouble[] W_t = new double[N];\r\n\t\t// double[] result = Kt;\r\n\t\t// fact[9] = iT / (double) T;\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\r\n\t\t\t// Compute wage\r\n\t\t\tW_t[i] = (1 - delta) * Kt[i] + Zt[i] * Math.pow(Kt[i], alpha);\r\n\t\t\t// LOGGER.info(\"Kt[i]=\" + Kt[i] + \" , W_t=\" + W_t);\r\n\r\n\t\t\t// fact[0] = Kt[i];\r\n\t\t\t// fact[1] = Zt[i];\r\n\t\t\t// fact[2] = W_t[i];\r\n\r\n\t\t\t// result[i] = (W_t[i] * 0.34);\r\n\r\n\t\t\t// S[sc=640619,15461196 at 2000, 3x[C 0,35 [], C 0,256 [6], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.256 * factValues[6] - 0.032 * factValues[4]);\r\n\t\t\t// S[sc=673175,23434734 at 2000, 4x[C 0,448 [6], C 0,35 [], C -0,192 [8, 8, 8], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.448 * fact[6] - 0.192 * fact[8] * fact[8] * fact[8] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=684511.51178919 at 5000, 6x[C 0.576 [6], C 0.35 [], C -0.256 [4, 5, 8], C -0.128 [8, 8, 8], C 0.032\r\n\t\t\t// [3], C -0.032 [4]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35 + 0.576 * fact[6] - 0.256 * fact[4] * fact[5] * fact[8] - 0.128 * fact[8] * fact[8] * fact[8] +\r\n\t\t\t// 0.032\r\n\t\t\t// * fact[3] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=713249.61733519 at 17000, 10x[C 0.57042768 [6], C -0.42834052 [4, 5, 8], C 0.35726662 [], C\r\n\t\t\t// -0.19234839 [8, 8, 8], C 0.0618062 [3], C 0.03906074 [3, 3], C -0.0354908 [6, 8, 8], C -0.032 [4], C\r\n\t\t\t// 0.02872478 [3, 6, 6], C -0.01470091 [4, 8]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35726662 + 0.57042768 * fact[3] - 0.42834052 * fact[1] * fact[2] * fact[5] - 0.19234839 * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// * fact[5] + 0.0618062 * fact[2] + 0.03906074 * fact[2] * fact[2] - 0.0354908 * fact[3] * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// - 0.032 * fact[1] + 0.02872478 * fact[0] * fact[3] * fact[3] - 0.01470091 * fact[1] * fact[5]);\r\n\t\t\tresult[i] = W_t[i]\r\n\t\t\t\t\t* ( //\r\n\t\t\t\t\t0.40334336 + 0.22997859 * fact[3] + 0.21837595 * fact[3] * fact[3] + 0.15973829 * fact[3] * fact[4] + -0.10161004\r\n\t\t\t\t\t\t\t* fact[1] * fact[5] + -0.020384 * fact[1] * fact[1] * fact[5]\r\n\t\t\t);\r\n\t\t\t// Keep only valid solutions\r\n\t\t\tresult[i] = Math.max(result[i], VERY_SMALL * W_t[i]);\r\n\t\t\t// to have a valid result\r\n\t\t\tresult[i] = Math.min(result[i], W_t[i] * (1.0 - VERY_SMALL));\r\n\t\t}\r\n\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0] + \" , \" + result[0] + \" for \" + iT);\r\n\t\t// int s = 0;\r\n\t\t// LOGGER.info(\"Kt[\" + s + \"]=\" + Kt[s] + \" , Zt[]=\" + Zt[s] + \" , W_t[]=\" + W_t[s] + \" , \" + result[s] +\r\n\t\t// \" for \" + iT);\r\n\t\tiT++;\r\n\t\treturn result;\r\n\t}", "public double constrainDemand(double slope, double trialprice)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to constrainDemand : \" + \"Agent\");\r\n/* 175 */ if (this.demand > 0.0D) {\r\n/* 176 */ if (this.demand * trialprice > this.cash - this.mincash)\r\n/* */ {\r\n/* 178 */ if (this.cash - this.mincash > 0.0D) {\r\n/* 179 */ this.demand = ((this.cash - this.mincash) / trialprice);\r\n/* 180 */ slope = -this.demand / trialprice;\r\n/* */ }\r\n/* */ else\r\n/* */ {\r\n/* 184 */ this.demand = 0.0D;\r\n/* 185 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* */ }\r\n/* 192 */ else if ((this.demand < 0.0D) && (this.demand + this.position < this.minholding))\r\n/* */ {\r\n/* */ \r\n/* 195 */ this.demand = (this.minholding - this.position);\r\n/* 196 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* 200 */ return this.demand;\r\n/* */ }", "public static void model1() {\n try {\n IloCplex cplex = new IloCplex();\n \n //variables\n IloNumVar x = cplex.numVar(0, Double.MAX_VALUE, \"x\"); //x >= 0\n IloNumVar y = cplex.numVar(0, Double.MAX_VALUE, \"y\"); //y >= 0\n \n //expressions\n IloLinearNumExpr objective = cplex.linearNumExpr();\n objective.addTerm(0.12, x);\n objective.addTerm(0.15, y);\n \n //define objective\n cplex.addMinimize(objective);\n \n //define constraints\n cplex.addGe(cplex.sum(cplex.prod(60, x), cplex.prod(60, y)), 300);\n cplex.addGe(cplex.sum(cplex.prod(12, x), cplex.prod(6, y)), 36);\n cplex.addGe(cplex.sum(cplex.prod(10, x), cplex.prod(30, y)), 90);\n \n //solve\n if (cplex.solve()) {\n System.out.println(\"Obj = \" + cplex.getObjValue());\n System.out.println(\"Obj = \" + cplex.getValue(objective));\n System.out.println(\"x = \" + cplex.getValue(x));\n System.out.println(\"y = \" + cplex.getValue(y));\n } else {\n System.out.println(\"Solution not found.\");\n }\n } catch (IloException ex) {\n ex.printStackTrace();\n }\n }", "@Override\n public void train() {\n actual = observations.toArray();\n min_val_error = Double.MAX_VALUE;\n if (findDecayConstant)\n for (float alpha = 0f; alpha <= 1f; alpha += 0.01f)\n initializeAndTrainModel(alpha);\n else\n initializeAndTrainModel(optAlpha);\n }", "@Override\n\tpublic List<Variable> applyConstraints(List<Variable> variableList) {\n\t\tconstraintVariables.clear();\n\t\tvariables.clear();\n\n\t\tthis.variables = variableList;\n\n\t\tSystem.out.println(\"GAC:\");\n\n\t\treduceArc();\n\n\t\tsolved = GACSolve(queue.poll().number,variables);\n\n\t\tif (!solved){\n\t\t\tSystem.out.println(\"cannot be solved\");\n\t\t}\n\n\t\treturn variables;\n\t}", "private LinearAVF() {\n this.booleanValueFunctions = new EnumMap<>(Criterion.class);\n this.linearValueFunctions = new EnumMap<>(Criterion.class);\n this.reversedValueFunctions = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasBooleanDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasDoubleDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n this.weight = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values()).forEach(criterion -> weight.put(criterion, 0.0d));\n }", "public void calculateCoefficients(){\n\t\tdlt2d = null;\t//Get rid of existing calibration\n\t\tdouble[][] global = new double[calibrationFrame.data.size()-1][2]; //Global coordinates of the calibration object\n\t\tdouble[][] digitizedPoints = new double[calibrationFrame.data.size()-1][2];\n\t\t/*Copy the calibration object*/\n\t\tfor (int r = 0; r< calibrationFrame.data.size()-1;++r){\n\t\t\tfor (int c = 0; c<2;++c){\n\t\t\t\tSystem.out.println(calibrationFrame.data.get(r+1).get(c+1));\n\t\t\t\tglobal[r][c] = Double.parseDouble(calibrationFrame.data.get(r+1).get(c+1));\n\t\t\t}\n\t\t}\n\t\t/*Copy the calibration points*/\n\t\tfor (int r = 0; r< digitizedPoints.length;++r){\n\t\t\tfor (int c = 0; c< digitizedPoints[r].length;++c){\n\t\t\t\tdigitizedPoints[r][c] = (double) digitizedCalibration[r][c];\n\t\t\t}\n\t\t}\n\n\t\tdigitizedCalibration = null;\n\t\tdlt2d = new DLT2D(global,digitizedPoints);\n\t\t/*Print coefficients...*/\n\t\tMatrix coeffs = dlt2d.getCurrentDltCoefficients();\n\t\tString resultString = \"Coefficients\\n\";\n\t\tfor (int i = 0; i< coeffs.getRowDimension();++i){\n\t\t\tresultString += \"\\tCoeff \"+i+\": \"+Double.toString(coeffs.get(i,0))+\"\\n\";\n\t\t}\n\t\tSystem.out.println(resultString);\t\t\n\t\tstatus.setText(new String(\"2D DLT coefficients\"));\n\t\t/*Create text pane for coordinates*/\n\t\tpointFrame = new SaveableFrame(this);\n\t\tpointFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tpointFrame.pack();\n\t\tpointFrame.setLocation(10, 600);\n\t\tpointFrame.setVisible(true);\t\n\t\t\n\t\t\n\t}", "public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t{\n\t\tif (null == valParams || null == csqs) return null;\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState (fundingLabel());\n\n\t\tif (null == dcFunding) return null;\n\n\t\tlong lStart = System.nanoTime();\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tdouble dblAccrued01 = 0.;\n\t\tdouble dblTotalCoupon = 0.;\n\t\tdouble dblCumulativeCouponDCF = 0.;\n\t\tdouble dblCumulativeCouponAmount = 0.;\n\t\tdouble dblAccrualCoupon = java.lang.Double.NaN;\n\t\tdouble dblUnadjustedDirtyPV = 0.;\n\t\tdouble dblUnadjustedDirtyDV01 = 0.;\n\t\tdouble dblCompoundingAdjustedDirtyPV = 0.;\n\t\tdouble dblCompoundingAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCashPayDF = java.lang.Double.NaN;\n\t\tint iResetDate = java.lang.Integer.MIN_VALUE;\n\t\tdouble dblFXAdjustedValueNotional = java.lang.Double.NaN;\n\t\tdouble dblCreditForwardConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditForwardConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCreditFundingConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditFundingConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCreditFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditFXConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCumulativeConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCumulativeConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblForwardFundingConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblForwardFundingConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblForwardFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblForwardFXConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblFundingFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblFundingFXConvexityAdjustedDirtyDV01 = 0.;\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tdouble dblPeriodFX = java.lang.Double.NaN;\n\t\t\tdouble dblPeriodNotional = java.lang.Double.NaN;\n\t\t\tdouble dblUnadjustedDirtyPeriodDV01 = java.lang.Double.NaN;\n\n\t\t\tint iPeriodPayDate = period.payDate();\n\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\ttry {\n\t\t\t\tdblPeriodNotional = period.notional (iPeriodEndDate) * period.couponFactor (iPeriodEndDate);\n\n\t\t\t\tdblPeriodFX = period.fx (csqs);\n\t\t\t} catch (java.lang.Exception e) {\n\t\t\t\te.printStackTrace();\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (iPeriodPayDate < iValueDate) {\n\t\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics\n\t\t\t\t\t(iPeriodEndDate, csqs);\n\n\t\t\t\tif (null == cpcm) return null;\n\n\t\t\t\tdouble dblPeriodDCF = cpcm.dcf();\n\n\t\t\t\tdblCumulativeCouponDCF += dblPeriodDCF;\n\n\t\t\t\tdblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * cpcm.rate() * dblPeriodDCF;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate,\n\t\t\t\tcsqs);\n\n\t\t\tif (null == cpcm) return null;\n\n\t\t\tdouble dblPeriodDCF = cpcm.dcf();\n\n\t\t\tdouble dblPeriodFullRate = cpcm.rate();\n\n\t\t\torg.drip.analytics.output.CompositePeriodAccrualMetrics cpam = period.accrualMetrics (iValueDate,\n\t\t\t\tcsqs);\n\n\t\t\ttry {\n\t\t\t\tif (null != cpam) {\n\t\t\t\t\tdblAccrualCoupon = cpam.rate();\n\n\t\t\t\t\tiResetDate = cpam.resetDate();\n\n\t\t\t\t\tdouble dblPeriodAccrualDCF = cpam.dcf();\n\n\t\t\t\t\tdblCumulativeCouponDCF += dblPeriodAccrualDCF;\n\t\t\t\t\tdblAccrued01 = 0.0001 * dblPeriodAccrualDCF * dblPeriodNotional * dblPeriodFX;\n\n\t\t\t\t\tdblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * dblAccrualCoupon *\n\t\t\t\t\t\tdblPeriodAccrualDCF;\n\t\t\t\t}\n\n\t\t\t\tdblUnadjustedDirtyPeriodDV01 = 0.0001 * dblPeriodDCF * dblPeriodNotional * dblPeriodFX *\n\t\t\t\t\tperiod.survival (csqs) * period.df (csqs);\n\t\t\t} catch (java.lang.Exception e) {\n\t\t\t\te.printStackTrace();\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tdouble dblCompoundingAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.compounding();\n\n\t\t\tdouble dblCreditForwardConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditForward();\n\n\t\t\tdouble dblCreditFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditFunding();\n\n\t\t\tdouble dblCreditFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditFX();\n\n\t\t\tdouble dblCumulativeConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.cumulative();\n\n\t\t\tdouble dblForwardFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.forwardFunding();\n\n\t\t\tdouble dblForwardFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.forwardFX();\n\n\t\t\tdouble dblFundingFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.fundingFX();\n\n\t\t\tdblTotalCoupon += dblPeriodFullRate;\n\t\t\tdblUnadjustedDirtyDV01 += dblUnadjustedDirtyPeriodDV01;\n\t\t\tdblUnadjustedDirtyPV += dblUnadjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate;\n\t\t\tdblCompoundingAdjustedDirtyDV01 += dblCompoundingAdjustedDirtyPeriodDV01;\n\t\t\tdblCompoundingAdjustedDirtyPV += dblCompoundingAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblCreditForwardConvexityAdjustedDirtyDV01 += dblCreditForwardConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditForwardConvexityAdjustedDirtyPV += dblCreditForwardConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblCreditFundingConvexityAdjustedDirtyDV01 += dblCreditFundingConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditFundingConvexityAdjustedDirtyPV += dblCreditFundingConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblCreditFXConvexityAdjustedDirtyDV01 += dblCreditFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditFXConvexityAdjustedDirtyPV += dblCreditFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblCumulativeConvexityAdjustedDirtyDV01 += dblCumulativeConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCumulativeConvexityAdjustedDirtyPV += dblCumulativeConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblForwardFundingConvexityAdjustedDirtyDV01 += dblForwardFundingConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblForwardFundingConvexityAdjustedDirtyPV += dblForwardFundingConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblForwardFXConvexityAdjustedDirtyDV01 += dblForwardFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblForwardFXConvexityAdjustedDirtyPV += dblForwardFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblFundingFXConvexityAdjustedDirtyDV01 += dblFundingFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblFundingFXConvexityAdjustedDirtyPV += dblFundingFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t}\n\n\t\ttry {\n\t\t\tdblCashPayDF = dcFunding.df (iValueDate);\n\n\t\t\tdblFXAdjustedValueNotional = fxAdjustedNotional (iValueDate, csqs);\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\tdblUnadjustedDirtyPV /= dblCashPayDF;\n\t\tdblUnadjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCompoundingAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCompoundingAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditForwardConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditForwardConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditFundingConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCumulativeConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCumulativeConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblForwardFundingConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblForwardFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblForwardFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblForwardFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblFundingFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblFundingFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdouble dblAccrued = 0. == dblAccrued01 ? 0. : dblAccrued01 * 10000. * dblAccrualCoupon;\n\t\tdouble dblUnadjustedCleanPV = dblUnadjustedDirtyPV - dblAccrued;\n\t\tdouble dblUnadjustedCleanDV01 = dblUnadjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblUnadjustedFairPremium = 0.0001 * dblUnadjustedCleanPV / dblUnadjustedCleanDV01;\n\t\tdouble dblCompoundingAdjustedCleanPV = dblCompoundingAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCompoundingAdjustedCleanDV01 = dblCompoundingAdjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblCompoundingAdjustedFairPremium = 0.0001 * dblCompoundingAdjustedCleanPV /\n\t\t\tdblCompoundingAdjustedCleanDV01;\n\t\tdouble dblCreditForwardConvexityAdjustedCleanPV = dblCreditForwardConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblCreditForwardConvexityAdjustedCleanDV01 = dblCreditForwardConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCreditForwardConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblCreditForwardConvexityAdjustedCleanPV / dblCreditForwardConvexityAdjustedCleanDV01;\n\t\tdouble dblCreditFundingConvexityAdjustedCleanPV = dblCreditFundingConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblCreditFundingConvexityAdjustedCleanDV01 = dblCreditFundingConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCreditFundingConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblCreditFundingConvexityAdjustedCleanPV / dblCreditFundingConvexityAdjustedCleanDV01;\n\t\tdouble dblCreditFXConvexityAdjustedCleanPV = dblCreditFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCreditFXConvexityAdjustedCleanDV01 = dblCreditFXConvexityAdjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblCreditFXConvexityAdjustedFairPremium = 0.0001 * dblCreditFXConvexityAdjustedCleanPV /\n\t\t\tdblCreditFXConvexityAdjustedCleanDV01;\n\t\tdouble dblCumulativeConvexityAdjustedCleanPV = dblCumulativeConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCumulativeConvexityAdjustedCleanDV01 = dblCumulativeConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCumulativeConvexityAdjustedFairPremium = 0.0001 * dblCumulativeConvexityAdjustedCleanPV /\n\t\t\tdblCumulativeConvexityAdjustedCleanDV01;\n\t\tdouble dblForwardFundingConvexityAdjustedCleanPV = dblForwardFundingConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblForwardFundingConvexityAdjustedCleanDV01 = dblForwardFundingConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblForwardFundingConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblForwardFundingConvexityAdjustedCleanPV / dblForwardFundingConvexityAdjustedCleanDV01;\n\t\tdouble dblForwardFXConvexityAdjustedCleanPV = dblForwardFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblForwardFXConvexityAdjustedCleanDV01 = dblForwardFXConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblForwardFXConvexityAdjustedFairPremium = 0.0001 * dblForwardFXConvexityAdjustedCleanPV /\n\t\t\tdblForwardFXConvexityAdjustedCleanDV01;\n\t\tdouble dblFundingFXConvexityAdjustedCleanPV = dblFundingFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblFundingFXConvexityAdjustedCleanDV01 = dblFundingFXConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblFundingFXConvexityAdjustedFairPremium = 0.0001 * dblFundingFXConvexityAdjustedCleanPV /\n\t\t\tdblFundingFXConvexityAdjustedCleanDV01;\n\n\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapResult = new\n\t\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>();\n\n\t\tmapResult.put (\"AccrualCoupon\", dblAccrualCoupon);\n\n\t\tmapResult.put (\"Accrued\", dblAccrued);\n\n\t\tmapResult.put (\"Accrued01\", dblAccrued01);\n\n\t\tmapResult.put (\"CleanDV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CleanPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanDV01\", dblCompoundingAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanPV\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPV\", dblCompoundingAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyDV01\", dblCompoundingAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPV\", dblCompoundingAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedFairPremium\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedParRate\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedPV\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedRate\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedUpfront\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustmentFactor\", dblCompoundingAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustmentPremium\", dblCompoundingAdjustedCleanPV - dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustmentPremiumUpfront\", (dblCompoundingAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanDV01\",\n\t\t\tdblCreditForwardConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanPV\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyDV01\",\n\t\t\tdblCreditForwardConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyPV\", dblCreditForwardConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDV01\", dblCreditForwardConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedFairPremium\",\n\t\t\tdblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedParRate\",\n\t\t\tdblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedPV\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedRate\", dblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedUpfront\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentFactor\", dblCreditForwardConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentPremium\", dblCreditForwardConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblCreditForwardConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanDV01\",\n\t\t\tdblCreditFundingConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanPV\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyDV01\",\n\t\t\tdblCreditFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyPV\", dblCreditFundingConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDV01\", dblCreditFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedFairPremium\",\n\t\t\tdblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedParRate\",\n\t\t\tdblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedPV\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedRate\", dblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedUpfront\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentFactor\", dblCreditFundingConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentPremium\", dblCreditFundingConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblCreditFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanDV01\", dblCreditFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanPV\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyDV01\", dblCreditFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyPV\", dblCreditFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDV01\", dblCreditFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedFairPremium\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedParRate\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedPV\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedRate\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedUpfront\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentFactor\", dblCreditFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentPremium\", dblCreditFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentPremiumUpfront\", (dblCreditFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanDV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyPV\", dblCumulativeConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedFairPremium\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedParRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedUpfront\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentFactor\", dblCumulativeConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentPremium\", dblCumulativeConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentPremiumUpfront\", (dblCumulativeConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CumulativeCouponAmount\", dblCumulativeCouponAmount);\n\n\t\tmapResult.put (\"CumulativeCouponDCF\", dblCumulativeCouponDCF);\n\n\t\tmapResult.put (\"CV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"DirtyDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"DirtyPV\", dblCumulativeConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"DV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"FairPremium\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"Fixing01\", dblAccrued01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanDV01\",\n\t\t\tdblForwardFundingConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanPV\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyDV01\",\n\t\t\tdblForwardFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyPV\", dblForwardFundingConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDV01\", dblForwardFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedFairPremium\",\n\t\t\tdblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedParRate\",\n\t\t\tdblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedPV\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedRate\", dblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedUpfront\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentFactor\", dblForwardFundingConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentPremium\", dblForwardFundingConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblForwardFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanDV01\", dblForwardFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanPV\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyDV01\", dblForwardFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyPV\", dblForwardFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDV01\", dblForwardFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedFairPremium\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedParRate\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedPV\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedRate\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedUpfront\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentFactor\", dblForwardFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentPremium\", dblForwardFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentPremiumUpfront\", (dblForwardFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanDV01\", dblFundingFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanPV\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyDV01\", dblFundingFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyPV\", dblFundingFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDV01\", dblFundingFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedFairPremium\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedParRate\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedPV\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedRate\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedUpfront\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentFactor\", dblFundingFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentPremium\", dblFundingFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentPremiumUpfront\", (dblFundingFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"ParRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"PV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"Rate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ResetDate\", (double) iResetDate);\n\n\t\tmapResult.put (\"ResetRate\", dblAccrualCoupon - basis());\n\n\t\tmapResult.put (\"TotalCoupon\", dblTotalCoupon);\n\n\t\tmapResult.put (\"UnadjustedCleanDV01\", dblUnadjustedCleanDV01);\n\n\t\tmapResult.put (\"UnadjustedCleanPV\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"UnadjustedDirtyDV01\", dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"UnadjustedDirtyPV\", dblUnadjustedDirtyPV);\n\n\t\tmapResult.put (\"UnadjustedFairPremium\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedParRate\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedPV\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"UnadjustedRate\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedUpfront\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"Upfront\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tdouble dblCompoundingAdjustedCleanPrice = 100. * (1. + (dblCompoundingAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblCreditForwardConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblCreditForwardConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblCreditFundingConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblCreditFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblCreditFXConvexityAdjustedCleanPrice = 100. * (1. + (dblCreditFXConvexityAdjustedCleanPV\n\t\t\t/ dblFXAdjustedValueNotional));\n\t\tdouble dblCumulativeConvexityAdjustedCleanPrice = 100. * (1. + (dblCumulativeConvexityAdjustedCleanPV\n\t\t\t/ dblFXAdjustedValueNotional));\n\t\tdouble dblForwardFundingConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblForwardFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblForwardFXConvexityAdjustedCleanPrice = 100. * (1. + (dblForwardFXConvexityAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblFundingFXConvexityAdjustedCleanPrice = 100. * (1. + (dblFundingFXConvexityAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblUnadjustedCleanPrice = 100. * (1. + (dblUnadjustedCleanPV / dblFXAdjustedValueNotional));\n\n\t\tmapResult.put (\"CleanPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanPrice\", dblCompoundingAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPrice\", 100. * (1. + (dblCompoundingAdjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CompoundingAdjustedPrice\", dblCompoundingAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanPrice\",\n\t\t\tdblCreditForwardConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditForwardConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedPrice\", dblCreditForwardConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanPrice\",\n\t\t\tdblCreditFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedPrice\", dblCreditFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanPrice\", dblCreditFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedPrice\", dblCreditFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCumulativeConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"DirtyPrice\", 100. * (1. + (dblCumulativeConvexityAdjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanPrice\",\n\t\t\tdblForwardFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblForwardFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedPrice\", dblForwardFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanPrice\", dblForwardFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblForwardFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedPrice\", dblForwardFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanPrice\", dblFundingFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblFundingFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedPrice\", dblFundingFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"Price\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"UnadjustedCleanPrice\", dblUnadjustedCleanPrice);\n\n\t\tmapResult.put (\"UnadjustedDirtyPrice\", 100. * (1. + (dblUnadjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"UnadjustedPrice\", dblUnadjustedCleanPrice);\n\n\t\tmapResult.put (\"CalcTime\", (System.nanoTime() - lStart) * 1.e-09);\n\n\t\treturn mapResult;\n\t}", "@Override\n public CNF transformCNF(CNF cnf) throws QueryContradictoryException {\n HashMap<TimeSelector, Long> lowerBounds = new HashMap<>();\n /*\n * stores the newly inferred upper bounds for time selectors\n */\n HashMap<TimeSelector, Long> upperBounds = new HashMap<>();\n // clauses (not) to consider\n List<CNFElement> relevantClauses = cnf.getPredicates().stream()\n .filter(this::isRelevantClause)\n .collect(Collectors.toList());\n List<CNFElement> otherClauses = cnf.getPredicates().stream()\n .filter(clause -> !isRelevantClause(clause))\n .collect(Collectors.toList());\n List<ComparisonExpression> relevantComparisons = relevantClauses.stream()\n .map(clause -> clause.getPredicates().get(0))\n .collect(Collectors.toList());\n\n // stores all tuples (a,b) with a=b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cEq = new HashMap<>();\n // stores all tuples (a,b) with a<=b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cLeq = new HashMap<>();\n // stores all tuples (a,b) with a<b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cLt = new HashMap<>();\n // stores all tuples (a,b) with a!=b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cNeq = new HashMap<>();\n\n\n // init bounds\n for (ComparisonExpression comp : relevantComparisons) {\n ComparableExpression lhs = comp.getLhs().getWrappedComparable();\n ComparableExpression rhs = comp.getRhs().getWrappedComparable();\n Comparator comparator = comp.getComparator();\n if (comp.getLhs() instanceof TimeSelectorComparable) {\n lowerBounds.put((TimeSelector) lhs, TemporalElement.DEFAULT_TIME_FROM);\n upperBounds.put((TimeSelector) lhs, TemporalElement.DEFAULT_TIME_TO);\n }\n if (comp.getRhs() instanceof TimeSelectorComparable) {\n lowerBounds.put((TimeSelector) rhs, TemporalElement.DEFAULT_TIME_FROM);\n upperBounds.put((TimeSelector) rhs, TemporalElement.DEFAULT_TIME_TO);\n }\n // init c-relations\n if (comparator.equals(EQ)) {\n cEq.putIfAbsent(lhs, new HashSet<>());\n cEq.putIfAbsent(rhs, new HashSet<>());\n cEq.get(lhs).add(rhs);\n cEq.get(rhs).add(lhs);\n } else if (comparator.equals(Comparator.LTE)) {\n cLeq.putIfAbsent(lhs, new HashSet<>());\n cLeq.get(lhs).add(rhs);\n } else if (comparator.equals(Comparator.LT)) {\n cLt.putIfAbsent(lhs, new HashSet<>());\n cLt.get(lhs).add(rhs);\n } else if (comparator.equals(Comparator.NEQ)) {\n cNeq.putIfAbsent(lhs, new HashSet<>());\n cNeq.get(lhs).add(rhs);\n }\n }\n\n // compute closures for =,<,<=\n List<HashMap<ComparableExpression, HashSet<ComparableExpression>>> closures =\n computeClosureRelations(cEq, cLeq, cLt);\n\n checkLtContradictions(closures.get(2));\n // infer new bounds\n List<HashMap<TimeSelector, Long>> newBounds = updateEq(closures.get(0), lowerBounds, upperBounds);\n newBounds = updateLeq(closures.get(1), newBounds.get(0), newBounds.get(1));\n newBounds = updateLt(closures.get(2), newBounds.get(0), newBounds.get(1));\n\n // check them for contradictions with NEQ clauses\n checkNeqContradictions(cNeq, newBounds.get(0), newBounds.get(1));\n // filter redundant clauses like a.tx_from <= a.tx_to and comparisons between selectors and literals\n List<ComparisonExpression> remainingOldComparisons = filterRedundantComparisons(relevantComparisons);\n // construct new clauses\n List<ComparisonExpression> newComparisons = comparisons(newBounds.get(0), newBounds.get(1));\n\n // construct the CNF\n List<CNFElement> remainingOldClauses = remainingOldComparisons.stream()\n .map(comparison -> new CNFElement(Collections.singletonList(comparison)))\n .collect(Collectors.toList());\n List<CNFElement> newClauses = newComparisons.stream()\n .map(comparison -> new CNFElement(Collections.singletonList(comparison)))\n .collect(Collectors.toList());\n\n List<CNFElement> allClauses = otherClauses;\n allClauses.addAll(remainingOldClauses);\n allClauses.addAll(newClauses);\n return new CNF(allClauses);\n }", "public CXLContract(double cededPremiumFixed, double attachmentPoint, double limit, double aggregateDeductible,\n double aggregateLimit, IStabilizationStrategy stabilization,\n List<Double> reinstatementPremiumFactors, IRIPremiumSplitStrategy riPremiumSplit,\n IBoundaryIndexStrategy boundaryIndex, List<FactorsPacket> factors, IPeriodCounter periodCounter) {\n super(cededPremiumFixed, attachmentPoint, limit, aggregateDeductible, aggregateLimit, stabilization,\n reinstatementPremiumFactors, riPremiumSplit, boundaryIndex, factors, periodCounter);\n }", "public double[][] calcCondStateProbs(char[] outcome, double[][] forwards, double[][] backwards) {\r\n\t\t// initialize return variable\r\n\t\tdouble[][] conditional = new double[states.length][outcome.length];\r\n\t\t\r\n\t\t// initialize the probability of this outcome to 0\r\n\t\tdouble outcomeProb = 0;\r\n\t\t// loop over all nodes in the last column\r\n\t\tfor (int i = 0; i < states.length; ++i)\r\n\t\t\t// add this node's probability to the overall probability\r\n\t\t\toutcomeProb += forwards[i][outcome.length - 1];\r\n\t\t\r\n\t\t// loop over all cells in the Viterbi graph\r\n\t\tfor (int row = 0; row < states.length; ++row) for (int col = 0; col < outcome.length; ++col)\r\n\t\t\t// calculate conditional probability of using this state in this column\r\n\t\t\tconditional[row][col] = forwards[row][col] * backwards[row][col] / outcomeProb;\r\n\t\t\t\r\n\t\t\r\n\t\treturn conditional;\r\n\t}", "protected void addConstraints() throws IloException {\n// Constrain (2)\n for (int i = 0; i < m; i++) {\n IloLinearNumExpr expr_2 = model.linearNumExpr();\n for (int j = 0; j < n; j++) {\n expr_2.addTerm(x[i][j], 1);\n }\n model.addLe(expr_2, supply[i]);\n }\n\n // Constrain (3)\n for (int j = 0; j < n; j++) {\n IloLinearNumExpr expr_3 = model.linearNumExpr();\n for (int i = 0; i < m; i++) {\n expr_3.addTerm(x[i][j], 1);\n }\n model.addEq(expr_3, demands[j]);\n }\n }", "@Test\n public void testPrediction1() throws Exception {\n\n final CalUtils.InstantGenerator instantGenerator =\n new LocalTimeMinutes(5);\n \n final double coreDailyVols[][] = new double[][] {\n new double[] {55219 , 262256 , 202661 , 218359 , 178244 , 99610 , 92348 , 124795 , 214370 , 153854 , 204116 , 173501 , 85390 , 156835 , 108070 , 23755 , 118573 , 70117 , 55768 , 52643 , 71485 , 407645 , 442909 , 129109 , 188896 , 79590 , 422121 , 290067 , 227955 , 69257 , 41634 , 446002 , 579188 , 86237 , 1606794 , 83676 , 166393 , 84987 , 875905 , 117013 , 399084 , 116190 , 149507 , 207221 , 60857 , 155612 , 448006 , 198637 , 67695 , 65423 , 180038 , 88774 , 80273 , 86065 , 85231 , 38867 , 29330 , 116353 , 26887 , 34170 , 102518 , 72246 , 21274 , 70752 , 37912 , 49367 , 100472 , 49461 , 41735 , 45795 , 36578 , 311945 , 249039 , 70487 , 121906 , 136424 , 195136 , 166308 , 331734 , 343180 , 419616 , 104613 , 1354058 , 162678 , 141067 , 147039 , 149115 , 271162 , 543989 , 184421 , 340679 , 201939 , 293860 , 171035 , 263964 , 260198 , 428087 , 565126 , 385874 , 547890 , 384416 , 256696 , 0 , 4738359},\n new double[] {1298630 , 678084 , 488607 , 224766 , 434263 , 356933 , 576571 , 219236 , 252805 , 414776 , 166828 , 174665 , 146281 , 110944 , 145234 , 179739 , 253111 , 175685 , 64925 , 216682 , 494507 , 100205 , 67371 , 101019 , 158026 , 316281 , 334067 , 954850 , 115547 , 163051 , 130303 , 107600 , 1407996 , 90357 , 110452 , 451866 , 238004 , 3096215 , 2672803 , 190170 , 111282 , 107135 , 453389 , 60821 , 98292 , 1310864 , 1132267 , 241907 , 89915 , 175676 , 61621 , 521553 , 212388 , 288651 , 193578 , 272161 , 256777 , 236382 , 802159 , 230248 , 387068 , 160647 , 106999 , 391933 , 465080 , 374577 , 340378 , 330708 , 416320 , 200347 , 251986 , 336664 , 311970 , 600559 , 508011 , 922379 , 311581 , 352459 , 508727 , 159316 , 1355635 , 246541 , 389672 , 805957 , 370754 , 382556 , 316971 , 564228 , 437166 , 277733 , 1284505 , 1763095 , 169661 , 280682 , 969102 , 540315 , 451895 , 308036 , 715130 , 642966 , 981563 , 900778 , 0 , 7155528},\n new double[] {679280 , 229518 , 346536 , 347215 , 316025 , 313890 , 235844 , 199995 , 1920617 , 129356 , 172084 , 207860 , 317578 , 10369008 , 480990 , 1403537 , 1021730 , 156125 , 94833 , 366987 , 145687 , 322957 , 328120 , 66657 , 176001 , 271003 , 133121 , 558624 , 264638 , 638663 , 165080 , 129439 , 5126344 , 5438632 , 248806 , 250616 , 112716 , 54523 , 198097 , 67772 , 1414565 , 244509 , 246205 , 151540 , 98584 , 51217 , 94193 , 111763 , 104726 , 45880 , 64242 , 78893 , 60706 , 48117 , 133085 , 101941 , 5103803 , 5084823 , 168230 , 75537 , 815036 , 73409 , 422412 , 437127 , 115802 , 326536 , 54707 , 81759 , 94420 , 208637 , 50361 , 1458556 , 84257 , 129114 , 54632 , 105873 , 57165 , 77578 , 233302 , 195560 , 134194 , 180928 , 140433 , 123154 , 221422 , 339866 , 1343886 , 114699 , 170052 , 150679 , 181731 , 160943 , 192590 , 125556 , 132656 , 154740 , 320932 , 140929 , 117889 , 381656 , 393635 , 306177 , 0 , 21629250},\n new double[] {526909 , 167180 , 199570 , 149154 , 142141 , 320881 , 223750 , 102275 , 258400 , 202197 , 120202 , 93404 , 178631 , 106401 , 346186 , 231729 , 163656 , 1622531 , 125689 , 2656587 , 5336032 , 2385985 , 335692 , 86118 , 130551 , 99047 , 81695 , 98846 , 238413 , 4831684 , 293262 , 124652 , 106642 , 112048 , 14284646 , 111209 , 2204635 , 128940 , 83395 , 134816 , 116320 , 65412 , 165020 , 126511 , 92217 , 111751 , 47320 , 82219 , 19044177 , 70827 , 21676 , 211214 , 103108 , 22771 , 61629 , 4816563 , 63806 , 33989 , 130104 , 146897 , 15046441 , 44977 , 40889 , 54584 , 54591 , 76634 , 238536 , 68583 , 110591 , 75012 , 503760 , 209479 , 217929 , 86397 , 102284 , 81878 , 252785 , 135884 , 129149 , 112760 , 266851 , 110863 , 67866 , 55205 , 150165 , 699438 , 184450 , 270270 , 4270036 , 345303 , 895116 , 217142 , 145398 , 301231 , 10260595 , 136317 , 442910 , 371357 , 189023 , 538928 , 438973 , 926728 , 9137 , 8879481},\n new double[] {1318228 , 1391326 , 574558 , 441739 , 719144 , 522626 , 404351 , 383602 , 490710 , 284952 , 2984474 , 216339 , 10220195 , 247067 , 166223 , 224310 , 10181837 , 126161 , 9764418 , 692337 , 25907353 , 1518741 , 1179929 , 120730 , 10173292 , 290045 , 19824327 , 402527 , 277859 , 3116841 , 7164061 , 332021 , 10560006 , 2334129 , 121753 , 200177 , 246402 , 10106648 , 1137272 , 2084673 , 461849 , 125108 , 465907 , 156972 , 139083 , 127389 , 237263 , 311691 , 156536 , 155322 , 133368 , 329715 , 256088 , 116835 , 5192615 , 823762 , 183836 , 1110239 , 2414836 , 385072 , 599637 , 387285 , 291580 , 2796924 , 12977051 , 338582 , 884415 , 525622 , 322587 , 223348 , 668858 , 143039 , 627590 , 239797 , 232788 , 256503 , 209425 , 375474 , 558106 , 290991 , 1176648 , 286550 , 149539 , 297435 , 602136 , 152733 , 212363 , 178992 , 179644 , 295428 , 933636 , 349405 , 660749 , 226061 , 868852 , 318539 , 469303 , 538061 , 273643 , 444084 , 347730 , 825808 , 12011 , 7792372}};\n\n final SimpleDateFormat dateBuilder = new SimpleDateFormat(\"yyyy-MM-dd\");\n final Calendar moments[] = new Calendar[] { Calendar.getInstance(), \n Calendar.getInstance(), Calendar.getInstance(), \n Calendar.getInstance(), Calendar.getInstance(),\n Calendar.getInstance() };\n\n moments[0].setTime(dateBuilder.parse(\"2011-10-26\"));\n moments[1].setTime(dateBuilder.parse(\"2011-10-27\"));\n moments[2].setTime(dateBuilder.parse(\"2011-10-28\"));\n moments[3].setTime(dateBuilder.parse(\"2011-10-30\"));\n moments[4].setTime(dateBuilder.parse(\"2011-11-01\"));\n moments[5].setTime(dateBuilder.parse(\"2011-11-02\"));\n\n // Nomralize data to sum 100 (i.e., have an expectance of 100/104)\n for(int i=0; i<5; i++) {\n double sum = 0;\n for(int j=0; j<104; j++) sum += coreDailyVols[i][j];\n for(int j=0; j<104; j++) {\n coreDailyVols[i][j] = coreDailyVols[i][j]*100 / sum;\n }\n }\n\n final double[][] synthesizedDailyVols = new double[\n coreDailyVols.length][instantGenerator.maxInstantValue()];\n final Calendar openTime = Calendar.getInstance();\n final int n = 9*60 / 5;\n final int m = n + coreDailyVols[0].length;\n for(int i=0; i<5; i++) {\n for(int j=0; j<n; j++) {\n synthesizedDailyVols[i][j] = Double.NaN;\n }\n for(int j=0; j<coreDailyVols[i].length; j++) {\n synthesizedDailyVols[i][j+n] = coreDailyVols[i][j];\n }\n for(int j=m; j<instantGenerator.maxInstantValue(); j++) {\n synthesizedDailyVols[i][j] = Double.NaN;\n }\n }\n\n\n final Predictor predictor = new PCAPredictorTransposed(\n instantGenerator, 5);\n for(int i=0; i<5; i++) {\n predictor.learnVector(moments[i], synthesizedDailyVols[i]);\n }\n final double prediction[] = predictor.predictVector(moments[5]);\n final double coreExpectedPrediction[] = new double[] {\n0.21383323, -0.08665493, -0.28527934, -0.45293966, -0.35525111, -0.49117788,\n-0.38114565, -0.60141152, -0.09029406, -0.44815719, -0.45152723, -0.58079146,\n-0.29110153, 1.54262599, -0.59900211, -0.48107804, -0.03280398, -0.59369964,\n-0.44886852, -0.43868587, 0.88745208, -0.10900099, -0.26251035, -0.71557572,\n-0.20051598, -0.57674404, 0.53793693, 0.15857465, -0.53212067, -0.13529962,\n-0.49171709, -0.32334222, 2.16101856, 0.46824882, 2.13337330, -0.48802957,\n-0.40084079, 1.62077396, 1.93080019, -0.59114756, -0.09429057, -0.68952951,\n-0.39819841, -0.63019599, -0.78762027, 0.12458423, 0.34847712, -0.52481068,\n0.69730449, -0.74290105, -0.68866588, -0.45964670, -0.69174165, -0.64825389,\n-0.49908622, -0.30049621, 0.35726449, 0.47210113, -0.25058065, -0.72112704,\n0.79345044, -0.73245678, -0.75581875, -0.40885896, -0.08033429, -0.56030291,\n-0.54967743, -0.63571829, -0.58889882, -0.71099478, -0.67055922, -0.03850658,\n-0.40339282, -0.43003588, -0.44813762, -0.14347007, -0.48441216, -0.48851502,\n-0.15427010, -0.39484463, 0.52701151, -0.61335693, 0.89776479, -0.18821502,\n-0.46457371, -0.39850394, -0.26234640, -0.21535441, 0.33669589, -0.48879971,\n0.43892192, 0.52101182, -0.42851659, -0.51364225, 0.85831207, -0.24052028,\n-0.04192086, -0.02287821, 0.01522206, 0.24307671, 0.27369478, 0.11058009,\n-0.95575786, 14.90733910 };\n final double synthesizedExpectedPrediction[] = new double[\n instantGenerator.maxInstantValue()];\n for(int j=0; j<n; j++) {\n synthesizedExpectedPrediction[j] = Double.NaN;\n }\n for(int j=0; j<coreExpectedPrediction.length; j++) {\n synthesizedExpectedPrediction[j+n] = coreExpectedPrediction[j];\n }\n for(int j=m; j<instantGenerator.maxInstantValue(); j++) {\n synthesizedExpectedPrediction[j] = Double.NaN;\n }\n\n assertEquals(prediction.length, synthesizedExpectedPrediction.length);\n\n for(int i=0; i<prediction.length; i++) {\n assertEquals(prediction[i], synthesizedExpectedPrediction[i], \n 0.0001d);\n }\n System.out.println(\"Ok\");\n }", "public abstract ArrayList< Double > getObjectiveCoefs();", "public void cp_computeFlow () { \n double effaoa = effective_aoa();\n if (!can_do_gui_updates && current_part.foil.fast_coeffs()) {\n solver.set_q0();\n current_part.cl = solver.get_Cl(effaoa);\n } else {\n solver.getFreeStream();\n solver.getCirculation(effaoa, current_part.thickness, current_part.camber);\n solver.compute_foil_geometry(effaoa);\n current_part.cl = solver.get_Cl(effaoa);\n solver.genFlow(effaoa);\n } \n \n current_part.cm = current_part.compute_cm(effaoa);\n\n // test: is this the same value getCl_plot gives?\n // if (false) {\n // double getCl_plot_val = out_top.plot.getCl_plot(current_part.camber/25, current_part.thickness/25, effaoa);\n // if (getCl_plot_val != current_part.cl) {\n // System.out.println(\"-- getCl_plot_val: \" + getCl_plot_val + \"yet current_part.cl: \" + current_part.cl);\n // }\n // track_current_part.cl_changes();\n // }\n\n current_part.reynolds = foil_is_cylinder_or_ball(current_part.foil) \n ? velocity/vconv * 2 * radius/lconv * rho_EN / viscos\n : velocity/vconv * current_part.chord/lconv * rho_EN / viscos;\n\n if (can_do_gui_updates)\n solver.getProbe();\n\n double camd = current_part.camber;\n double alfd = effaoa; // effective_aoa();\n // attempt to fix symmetry problem\n if (fix_symmetry_problem && camd < 0.0) alfd = - alfd;\n \n // this saved current_part's cd, cd_profile and cd_aux\n solver.get_Cd(alfd); \n }", "public void calcInc(int np)\n\t{\n \n findSpecEq();\n int nofc=numberOfComponents;\n fvec.timesEquals(0.0);\n fvec.set(nofc+1,0,1.0);\n Matrix dxds=Jac.solve(fvec);\n if (np<5)\n {\n double dp=0.01;\n ds=dp/dxds.get(nofc+1,0);\n Xgij.setMatrix(0,nofc+1,np-1,np-1,u);\n dxds.timesEquals(ds);\n // dxds.print(0,10);\n u.plusEquals(dxds);\n // Xgij.print(0,10);\n// u.print(0,10);\n }\n else\n {\n //System.out.println(\"iter \" +iter + \" np \" + np);\n if (iter>6)\n { \n ds *= 0.5;\n System.out.println(\"ds > 6\");\n }\n \n else\n {\n if (iter<3) {\n ds *= 1.5;\n }\n if (iter==3) {\n ds *= 1.1;\n }\n if (iter==4) {\n ds *= 1.0;\n }\n if (iter>4) {\n ds *= 0.5;\n }\n \n// Now we check wheater this ds is greater than dTmax and dPmax.\n if(Math.abs(system.getTemperature()*dxds.get(nofc,0)*ds)>dTmax){\n // System.out.println(\"true T\");\n ds=sign(dTmax/system.getTemperature()/Math.abs(dxds.get(nofc,0)),ds);\n }\n \n if(Math.abs(system.getPressure()*dxds.get(nofc+1,0)*ds)>dPmax)\n {\n ds=sign(dPmax/system.getPressure()/Math.abs(dxds.get(nofc+1,0)),ds);\n // System.out.println(\"true P\");\n }\n if (etterCP2) {\n etterCP2=false;\n ds = 0.5*ds;\n }\n \n Xgij.setMatrix(0,nofc+1,0,2,Xgij.getMatrix(0,nofc+1,1,3)); \n Xgij.setMatrix(0,nofc+1,3,3,u);\n s.setMatrix(0,0,0,3,Xgij.getMatrix(speceq,speceq,0,3));\n // s.print(0,10);\n // System.out.println(\"ds1 : \" + ds);\n calcInc2(np);\n // System.out.println(\"ds2 : \" + ds);\n \n// Here we find the next point from the polynomial.\n \n }\n }\n }", "public static void MCLSPIFB(){\n\t\tMountainCar mcGen = new MountainCar(); // default: reward 100 on the right side and 0 everywhere else\n\t\t\n\t\t\n\t\t// Define terminal function and reward function\t\n\t\tStateConditionTest terminalTest = new StateConditionTest() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean satisfies(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\t\n\t\tTerminalFunction tf = new TerminalFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean isTerminal(State s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn terminalTest.satisfies(s);\n\t\t\t}\n\t\t};\n\t\t\n\t\tRewardFunction rf = /*new GoalBasedRF(tf, 100, 0);*/\n\t\t\t\tnew RewardFunction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic double reward(State s1, Action a, State s2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif ((Double)s2.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn 100;\n\t\t\t\t}\n\t\t\t\tif ((Double)s2.get(\"x\") == mcGen.physParams.xmin) {\n\t\t\t\t\treturn -100;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t};\n\t\tmcGen.setRf(rf);\n\t\tSADomain domain = mcGen.generateDomain();\n\t\tSystem.out.println(\"physParams:\\n===========================\");\n\t\tSystem.out.println(\"xmin:\" + mcGen.physParams.xmin + \", xmax:\" + mcGen.physParams.xmax + \", vallypos:\" + mcGen.physParams.valleyPos());\n\t\tSystem.out.println(\"vmin:\" + mcGen.physParams.vmin + \", vmax:\" + mcGen.physParams.vmax);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate data from random state\n\t\tStateGenerator rstateGenerator = new MCRandomStateGenerator(mcGen.physParams);\n\t\tSARSCollector collector = new SARSCollector.UniformRandomSARSCollector(domain);\n\t\tSARSData dataset = collector.collectNInstances(rstateGenerator, domain.getModel(), 5000, 20, null);\n\n\t\t\n\t\tSARS xData = dataset.get(0);\n\t\tMCState xState = (MCState) xData.s;\n\t\tMCState xState2 = (MCState) xData.sp;\n\t\tSystem.out.println(\"s: x:\" + xState.x\n\t\t\t\t+ \", v:\" + xState.v + \n\t\t\t\t\", action:\" + xData.a.actionName() + \n\t\t\t\t\", reward:\" + xData.r);\n\t\tSystem.out.println(\"s': x:\" + xState2.x\n\t\t\t\t+ \", v:\" + xState2.v);\n\t\tSystem.out.println(\"===========================\");\n\t\t\n\t\t// Generate 5000 SARS tuple instances for our dataset.\n\t\t// Car state generator for no more than 20 steps at a time or until we hit a terminal state.\n\t\t\n\t\t// Generate Fourier Basis\n\t\t// Fourier Basis: mapping from states to features\n\t\tNormalizedVariableFeatures inputFeatures = new NormalizedVariableFeatures()\n\t\t\t\t.variableDomain(\"x\", new VariableDomain(mcGen.physParams.xmin, mcGen.physParams.xmax))\n\t\t\t\t.variableDomain(\"v\", new VariableDomain(mcGen.physParams.vmin, mcGen.physParams.vmax));\n\t\tFourierBasis fBasis = new FourierBasis(inputFeatures, 4); // order(4) means the number of basis functions\n\t\t\n\t\t// Instantiate LSPI\n\t\t// LSPI needs mapping from state to action features, so\n\t\t// first define a state feature representation, \n\t\t// and then construct state-action features by taking the cross product of those features with each action\n\t\tLSPI lspi = new LSPI(domain, 0.99, new DenseCrossProductFeatures(fBasis, 3), dataset); // 3: number of actions: FORWARD, COSTA, BACKWARD\n\t\tPolicy policy = lspi.runPolicyIteration(30, 1e-6);\n\t\t\n\t\t// Visualization\n\t\tMCState laststate = new MCState(mcGen.physParams.valleyPos(), 0);\n\t\tSystem.out.println(\"===========================\\nState process according to policy:\\n\");\n\n\t\t\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tif (terminalTest.satisfies(laststate)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tAction curAction = policy.action(laststate);\n\t\t\tMCModel model = new MCModel(mcGen.physParams);\n\t\t\tMCState curState = (MCState) model.sample(laststate, curAction);\n\t\t\tif (i % 10 == 0) {\n\t\t\t\tSystem.out.println(\"State \" + i +\n\t\t\t\t\t\t\":\\tx = \" + laststate.x + \n\t\t\t\t\t\t\";\\tv = \" + laststate.v + \n\t\t\t\t\t\t\";\\taction = \" + curAction.actionName());\n\t\t\t}\t\t\t\n\t\t\tlaststate = curState;\n\t\t}\n\t\tVisualizer visualizer = MountainCarVisualizer.getVisualizer(mcGen);\n\t\tVisualActionObserver vo = new VisualActionObserver(visualizer);\n\t\tvo.initGUI();\n\t\t\n\t\tSimulatedEnvironment environment = new SimulatedEnvironment(domain, new MCState(mcGen.physParams.valleyPos(), 0));\n\t\tenvironment.addObservers(vo);\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tPolicyUtils.rollout(policy, environment);\n\t\t\tenvironment.resetEnvironment();\n\t\t}\n\t\tSystem.out.println(\"Finished\");\n\t\tSystem.out.println(policy.action(new MCState(0.05, -8)));\n\t}", "public void InitializeConstraints(boundkey[] bkc, double[] blc, NodesVector nvector, PipesVector pvector,\n\t\t\tTapsVector tvector, double outflow, double PrixMax, double lcom) {\n\t\tNodes nodes;\n\t\tPipes pipes;\n\t\tTaps taps;\n\n\t\t/* Contraintes sur les Nodes - taps */\n\t\tfor (int i = 0; i < (NbNodes - NbTaps - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\tCste[i] = -nodes.height;\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les Taps */\n\t\tfor (int i = NbNodes - NbTaps - 1; i < (NbNodes - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\ttaps = (Taps) tvector.elementAt(i - (NbNodes - NbTaps - 1));\n\n\t\t\tif (taps.orifice == Orifices.MAXDIAM) {\n\t\t\t\tCste[i] = -nodes.height - ((outflow * outflow) / taps.faucetCoef);\n\t\t\t} else {\n\t\t\t\tCste[i] = (-nodes.height\n\t\t\t\t\t\t- (outflow * outflow * ((1 / taps.faucetCoef) + Math.pow(CoefOrif / taps.orifice, 4))));\n\t\t\t}\n\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les longueurs des Pipes */\n\t\tfor (int i = NbNodes - 1; i < (m - 1); i++) {\n\t\t\tpipes = (Pipes) pvector.elementAt(i - NbNodes + 1);\n\n\t\t\tCste[i] = pipes.length;\n\n\t\t\tbkc[i] = mosek.boundkey.fx;\n\t\t\tblc[i] = Cste[i];\n\t\t}\n\n\t\t/* contrainte de prix max */\n\t\tCste[m - 1] = PrixMax;\n\t\tbkc[m - 1] = mosek.boundkey.up;\n\t\tblc[m - 1] = -1.0e30;\n\t}", "private void convertReqsInCriterions(){\n\t\tArrayList<Criterion> criteria = this.data.getCriteria();\n\t\t\n\t\tfor(Requirement req : this.data.getRequirements()){\n\t\t\tif(req.isCriterion()){\n\t\t\t\t//create new criterion\n\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\telse\n\t\t\t\t\t//this is a price requirement\n\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\n\t\t\t\tString[] msg = {crit.getName(), \"General\"};\n\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t}\n\t\t\t\t//get the criterion preference direction\n\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcriteria.add(crit);\n\t\t\t}\n\t\t}\n\t\tthis.data.setCriteria(criteria);\n\t\t\n\t\t//convert each serpiceTemplate requirements\n\t\tfor(ServiceTemplate template : this.data.getServiceTemplates()){\n\t\t\tArrayList<Criterion> templateCriteria = template.getCriteria();\n\t\t\tfor(Requirement req: template.getRequirements()){\n\t\t\t\tif(req.isCriterion()){\n\t\t\t\t\t//create new criterion\n\t\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\t\telse\n\t\t\t\t\t\t//this is a price requirement\n\t\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\t\n\t\t\t\t\tString[] msg = {crit.getName(), template.getType()};\n\t\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//get the criterion preference direction\n\t\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\ttemplateCriteria.add(crit);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemplate.setCriteria(templateCriteria);\n\t\t}\n\t}", "public double pv (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqc,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t\tthrows java.lang.Exception\n\t{\n\t\tif (null == valParams || null == csqc)\n\t\t\tthrow new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqc.fundingState (fundingLabel());\n\n\t\tif (null == dcFunding) throw new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tdouble dblCumulativeConvexityAdjustedDirtyPV = 0.;\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodPayDate = period.payDate();\n\n\t\t\tif (iPeriodPayDate < iValueDate) continue;\n\n\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate,\n\t\t\t\tcsqc);\n\n\t\t\tif (null == cpcm) throw new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tdblCumulativeConvexityAdjustedDirtyPV += cpcm.dcf() * period.notional (iPeriodEndDate) *\n\t\t\t\tperiod.couponFactor (iPeriodEndDate) * period.fx (csqc) * period.survival (csqc) *\n\t\t\t\t\tperiod.df (csqc) * cpcm.cumulative() * cpcm.rate();\n\t\t}\n\n\t\treturn dblCumulativeConvexityAdjustedDirtyPV / dcFunding.df (iValueDate);\n\t}", "public void generateCost() throws StandardException {\n\n double baseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE);\n double filterBaseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE,QualifierPhase.FILTER_BASE);\n double projectionSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.FILTER_PROJECTION);\n double totalSelectivity = computeTotalSelectivity(selectivityHolder);\n\n assert filterBaseTableSelectivity >= 0 && filterBaseTableSelectivity <= 1.0:\"filterBaseTableSelectivity Out of Bounds -> \" + filterBaseTableSelectivity;\n assert baseTableSelectivity >= 0 && baseTableSelectivity <= 1.0:\"baseTableSelectivity Out of Bounds -> \" + baseTableSelectivity;\n assert projectionSelectivity >= 0 && projectionSelectivity <= 1.0:\"projectionSelectivity Out of Bounds -> \" + projectionSelectivity;\n assert totalSelectivity >= 0 && totalSelectivity <= 1.0:\"totalSelectivity Out of Bounds -> \" + totalSelectivity;\n\n // Total Row Count from the Base Conglomerate\n double totalRowCount = scc.baseRowCount();\n assert totalRowCount >= 0 : \"totalRowCount cannot be negative -> \" + totalRowCount;\n // Rows Returned is always the totalSelectivity (Conglomerate Independent)\n scanCost.setEstimatedRowCount(Math.round(totalRowCount*totalSelectivity));\n\n double baseTableAverageRowWidth = scc.getBaseTableAvgRowWidth();\n double baseTableColumnSizeFactor = scc.baseTableColumnSizeFactor(totalColumns);\n\n // We use the base table so the estimated heap size and remote cost are the same for all conglomerates\n double colSizeFactor = baseTableAverageRowWidth*baseTableColumnSizeFactor;\n assert baseTableAverageRowWidth >= 0 : \"baseTableAverageRowWidth cannot be negative -> \" + baseTableAverageRowWidth;\n assert baseTableColumnSizeFactor >= 0 : \"baseTableColumnSizeFactor cannot be negative -> \" + baseTableColumnSizeFactor;\n\n double openLatency = scc.getOpenLatency();\n double closeLatency = scc.getCloseLatency();\n double localLatency = scc.getLocalLatency();\n double remoteLatency = scc.getRemoteLatency();\n double remoteCost = openLatency + closeLatency + totalRowCount*totalSelectivity*remoteLatency*(1+colSizeFactor/100d);\n assert openLatency >= 0 : \"openLatency cannot be negative -> \" + openLatency;\n assert closeLatency >= 0 : \"closeLatency cannot be negative -> \" + closeLatency;\n assert localLatency >= 0 : \"localLatency cannot be negative -> \" + localLatency;\n assert remoteLatency >= 0 : \"remoteLatency cannot be negative -> \" + remoteLatency;\n assert remoteCost >= 0 : \"remoteCost cannot be negative -> \" + remoteCost;\n // Heap Size is the avg row width of the columns for the base table*total rows\n // Average Row Width\n // This should be the same for every conglomerate path\n scanCost.setEstimatedHeapSize((long)(totalRowCount*totalSelectivity*colSizeFactor));\n // Should be the same for each conglomerate\n scanCost.setRemoteCost((long)remoteCost);\n // Base Cost + LookupCost + Projection Cost\n double congAverageWidth = scc.getConglomerateAvgRowWidth();\n double baseCost = openLatency+closeLatency+(totalRowCount*baseTableSelectivity*localLatency*(1+congAverageWidth/100d));\n assert congAverageWidth >= 0 : \"congAverageWidth cannot be negative -> \" + congAverageWidth;\n assert baseCost >= 0 : \"baseCost cannot be negative -> \" + baseCost;\n scanCost.setFromBaseTableRows(filterBaseTableSelectivity * totalRowCount);\n scanCost.setFromBaseTableCost(baseCost);\n double lookupCost;\n if (lookupColumns == null)\n lookupCost = 0.0d;\n else {\n lookupCost = totalRowCount*filterBaseTableSelectivity*(openLatency+closeLatency);\n scanCost.setIndexLookupRows(filterBaseTableSelectivity*totalRowCount);\n scanCost.setIndexLookupCost(lookupCost+baseCost);\n }\n assert lookupCost >= 0 : \"lookupCost cannot be negative -> \" + lookupCost;\n\n double projectionCost;\n if (projectionSelectivity == 1.0d)\n projectionCost = 0.0d;\n else {\n projectionCost = totalRowCount * filterBaseTableSelectivity * localLatency * colSizeFactor*1d/1000d;\n scanCost.setProjectionRows(scanCost.getEstimatedRowCount());\n scanCost.setProjectionCost(lookupCost+baseCost+projectionCost);\n }\n assert projectionCost >= 0 : \"projectionCost cannot be negative -> \" + projectionCost;\n\n double localCost = baseCost+lookupCost+projectionCost;\n assert localCost >= 0 : \"localCost cannot be negative -> \" + localCost;\n scanCost.setLocalCost(localCost);\n scanCost.setNumPartitions(scc.getNumPartitions());\n scanCost.setLocalCostPerPartition((baseCost + lookupCost + projectionCost)/scc.getNumPartitions());\n }", "public double costNEX() {\r\n double diff=0;\r\n double intensity=0;\r\n \r\n for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) {\r\n for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n\r\n this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n intensity = this.body2[x][y][z].radiationIntensity(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (intensity>0) {\r\n// LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n this.body2[x][y][z].addCurrentDosis(intensity);\r\n } \r\n diff += Math.pow((this.body2[x][y][z].getGoalDosis()-this.body2[x][y][z].getCurrentDosis()),2);\r\n// LogTool.print(\" diffdose \" + (Looper.body2[x][y][z].getGoalDosis()-Looper.body2[x][y][z].getCurrentDosis()),\"notification\");\r\n } \r\n }\r\n }\r\n return Math.sqrt(diff);\r\n// return Math.random();\r\n }", "private static FXForwardSecurity createFxForwardSecurity() {\n\n Currency payCurrency = Currency.GBP;\n Currency recCurrency = Currency.USD;\n\n double payAmount = 1_000_000;\n double recAmount = 1_600_000;\n\n ZonedDateTime forwardDate = DateUtils.getUTCDate(2019, 2, 4);\n\n ExternalId region = ExternalSchemes.currencyRegionId(Currency.GBP);\n\n FXForwardSecurity fxForwardSecurity = new FXForwardSecurity(payCurrency, payAmount, recCurrency, recAmount, forwardDate, region);\n\n return fxForwardSecurity;\n }", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "public JSONObject getCNForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n List<Object> cnData = accEntityGstDao.getCNDNWithInvoiceDetailsInSql(reqParams);\n List<Object> cnWithoutInventory = accEntityGstDao.getCNAgainstCustomer(reqParams);\n if (cnWithoutInventory != null && !cnWithoutInventory.isEmpty()) {\n cnData.addAll(cnWithoutInventory);\n }\n /**\n * Add data for Cash Sales refund \n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"paymententitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"paymententityValue\"));\n List<Object> refundlist = accEntityGstDao.getCashRefundWithInvoiceDetailsInSql(reqParams);\n if (refundlist != null && refundlist.size() > 0) {\n cnData.addAll(refundlist);\n } \n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n\n totalAmountCN = (Double) data[3];\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\",authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n jSONObject = accGSTReportService.getCreditNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n }\n return jSONObject;\n }", "Double getFrictionCoefficient();", "private void generalizeCSARequirements(){\n\t\tArrayList<ServiceTemplate> comps = new ArrayList<ServiceTemplate>() ;\n\t\tArrayList<Requirement> reqs = new ArrayList<Requirement>() ;\n\t\t\n\t\tcomps = this.data.getServiceTemplates();\n\t\treqs = this.data.getRequirements();\n\t\t\n\t\tfor(ServiceTemplate c : comps){\n\t\t\tfor(Requirement r : reqs){\n\t\t\t\tRequirement temp = new Requirement();\n\t\t\t\ttry {\n\t\t\t\t\tBeanUtils.copyProperties(temp, r);\n\t\t\t\t\t//System.out.println(r.toString());\n\t\t\t\t\t//System.out.println(temp.toString());\n\t\t\t\t\tc.addReq(temp);\n\t\t\t\t} catch (IllegalAccessException | InvocationTargetException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public Activation_Linear_Range_0_1() {\r\n this.slope = new VDouble(new RealNumber(1), new VDoubleNoUpdate());\r\n this.c = new VDouble(new RealNumber(0), new VDoubleNoUpdate());\r\n }", "private void fillTrialConditionsData() {\n List<Condition> trialConditions = new ArrayList<Condition>();\n\n int instanceCounter = 1;\n for (Condition condition : this.workbookStudy.getConditions()) {\n if (condition.getDataType().equals(DATA_TYPE_CHAR)) {\n// LevelC levelCFilter = new LevelC(true);\n// LevelCPK levelCPK = new LevelCPK();\n// levelCPK.setLabelid(condition.getLabelId());\n// levelCFilter.setFactorid(condition.getFactorId());\n// levelCFilter.setLevelCPK(levelCPK);\n// List<LevelC> levelCList = this.servicioApp.getListLevelC(levelCFilter, 0, 0, false);\n List<LevelC> levelCList = condition.getFactor().getLevelsC();\n instanceCounter = 1;\n for (LevelC levelC : levelCList) {\n try {\n Condition conditionToAdd = new Condition();\n BeanUtilsBean.getInstance().copyProperties(conditionToAdd, condition);\n conditionToAdd.setValue(levelC.getLvalue());\n conditionToAdd.setInstance(instanceCounter);\n conditionToAdd.setLevelNo(levelC.getLevelCPK().getLevelno());\n trialConditions.add(conditionToAdd);\n instanceCounter++;\n } catch (IllegalAccessException ex) {\n Exceptions.printStackTrace(ex);\n } catch (InvocationTargetException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n } else if (condition.getDataType().equals(DATA_TYPE_NUMERIC)) {\n// LevelN levelNFilter = new LevelN(true);\n// LevelNPK levelnPK = new LevelNPK();\n// levelnPK.setLabelid(condition.getLabelId());\n// levelNFilter.setFactorid(condition.getFactorId());\n// levelNFilter.setLevelNPK(levelnPK);\n// List<LevelN> levelNList = this.servicioApp.getListLevelN(levelNFilter, 0, 0, false);\n List<LevelN> levelNList = condition.getFactor().getLevelsN();\n instanceCounter = 1;\n for (LevelN levelN : levelNList) {\n try {\n Condition conditionToAdd = new Condition();\n BeanUtilsBean.getInstance().copyProperties(conditionToAdd, condition);\n conditionToAdd.setValue(DecimalUtils.getValueAsString(levelN.getLvalue()));\n conditionToAdd.setInstance(instanceCounter);\n conditionToAdd.setLevelNo(levelN.getLevelNPK().getLevelno());\n trialConditions.add(conditionToAdd);\n instanceCounter++;\n } catch (IllegalAccessException ex) {\n Exceptions.printStackTrace(ex);\n } catch (InvocationTargetException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n }\n }\n\n Comparator<Condition> conditionComparator = new Comparator<Condition>() {\n\n @Override\n public int compare(Condition o1, Condition o2) {\n return o1.getInstance().compareTo(o2.getInstance());\n }\n };\n\n Collections.sort(trialConditions, conditionComparator);\n\n this.workbookStudy.setConditionsData(trialConditions);\n }", "@Override\n public void forecast(int numFuturePoints) {\n\n int startPoint = 0, endPoint = actual.length;\n double lastValue = actual[startPoint],forecast;\n double[][] trainMatrix = new double[trainPoints + validationPoints][2];\n trainMatrix[0][0] = actual[startPoint];\n trainMatrix[0][1] = lastValue;\n\n for (int i = startPoint + 1; i < endPoint; i++) {\n forecast = lastValue;\n\n trainMatrix[i][0] = actual[i];\n trainMatrix[i][1] = forecast;\n\n lastValue = optAlpha * actual[i] + (1 - optAlpha) * lastValue;\n }\n\n errorBound = ErrorBoundsHandler.computeErrorBoundInterval(trainMatrix);\n\n forecastDataSet = new DataSet();\n startPoint = actual.length;\n Observation observation;\n double forecastValue, lowerBound, upperBound;\n\n for (int i = startPoint; i < startPoint + numFuturePoints; i++) {\n forecastValue = lastValue;\n\n lastValue = optAlpha * forecastValue + (1 - optAlpha) * lastValue;\n\n if (forecastValue < 0) {\n forecastValue = 0l;\n lowerBound = 0l;\n upperBound = 0l;\n } else {\n forecastValue = BiasnessHandler.adjustBiasness(forecastValue, accuracyIndicators.getBias());\n lowerBound = forecastValue - errorBound;\n upperBound = forecastValue + errorBound;\n }\n\n observation = new Observation();\n observation.setIndependentValue(IndependentVariable.SLICE, i - startPoint);\n observation.setDependentValue(forecastValue);\n observation.setLowerDependentValue(lowerBound > 0 ? lowerBound : 0);\n observation.setUpperDependentValue(upperBound);\n forecastDataSet.add(observation);\n\n }\n }", "public boolean isUnsat(ConstraintsState pConstraints, String pFunctionName)\n throws SolverException, InterruptedException, UnrecognizedCCodeException {\n\n if (!pConstraints.isEmpty()) {\n try {\n timeForSatChecks.start();\n Set<Constraint> relevantConstraints = new HashSet<>();\n if (performMinimalSatCheck && pConstraints.getLastAddedConstraint().isPresent()) {\n try {\n timeForIndependentComputation.start();\n Constraint lastConstraint = pConstraints.getLastAddedConstraint().get();\n Set<Constraint> leftOverConstraints = new HashSet<>(pConstraints);\n Set<SymbolicIdentifier> newRelevantIdentifiers = lastConstraint.accept(locator);\n Set<SymbolicIdentifier> relevantIdentifiers;\n do {\n relevantIdentifiers = ImmutableSet.copyOf(newRelevantIdentifiers);\n Iterator<Constraint> it = leftOverConstraints.iterator();\n while (it.hasNext()) {\n Constraint currentC = it.next();\n Set<SymbolicIdentifier> containedIdentifiers = currentC.accept(locator);\n if (!Sets.intersection(containedIdentifiers, relevantIdentifiers).isEmpty()) {\n newRelevantIdentifiers = Sets.union(newRelevantIdentifiers, containedIdentifiers);\n relevantConstraints.add(currentC);\n it.remove();\n }\n }\n } while (!newRelevantIdentifiers.equals(relevantIdentifiers));\n\n } finally {\n timeForIndependentComputation.stop();\n }\n\n } else {\n relevantConstraints = pConstraints;\n }\n\n BooleanFormula constraintsAsFormula =\n getFullFormula(\n relevantConstraints, pConstraints.getDefiniteAssignment(), pFunctionName);\n prover = solver.newProverEnvironment(ProverOptions.GENERATE_MODELS);\n prover.push(constraintsAsFormula);\n\n Boolean unsat = null; // assign null to fail fast if assignment is missed\n ImmutableList<ValueAssignment> modelAsAssignment = pConstraints.getModel();\n ImmutableList<ValueAssignment> newModelAsAssignment = ImmutableList.of();\n if (useLastModel) {\n BooleanFormula lastModel =\n modelAsAssignment\n .stream()\n .map(ValueAssignment::getAssignmentAsFormula)\n .collect(booleanFormulaManager.toConjunction());\n prover.push(lastModel);\n unsat = prover.isUnsat();\n if (!unsat) {\n // get this before popping the model assignment ; the operation will be invalid\n // otherwise\n newModelAsAssignment = prover.getModelAssignments();\n }\n // We have to remove the model assignment before resolving definite assignments, below.\n prover.pop(); // Remove model assignment from prover\n }\n\n boolean gotResultFromCache = false;\n\n if (!useLastModel || (unsat && !modelAsAssignment.isEmpty())) {\n // if the last model does not fulfill the formula, and the last model actually\n // is some variable assignment (i.e., model != true), then we check the formula\n // for satisfiability without any assignments, again.\n CacheResult res = cache.getCachedResult(pConstraints);\n\n if (res.isUnsat()) {\n unsat = true;\n gotResultFromCache = true;\n } else if (res.isSat()) {\n unsat = false;\n gotResultFromCache = true;\n pConstraints.setModel(res.getModelAssignment());\n } else {\n prover.close();\n prover = solver.newProverEnvironment(ProverOptions.GENERATE_MODELS);\n prover.push(constraintsAsFormula);\n unsat = prover.isUnsat();\n\n if (!unsat) {\n newModelAsAssignment = prover.getModelAssignments();\n }\n }\n }\n\n if (!gotResultFromCache) {\n if (!unsat) {\n pConstraints.setModel(newModelAsAssignment);\n cache.addSat(pConstraints, newModelAsAssignment);\n // doing this while the complete formula is still on the prover environment stack is\n // cheaper than performing another complete SAT check when the assignment is really\n // requested\n if (resolveDefinites) {\n resolveDefiniteAssignments(pConstraints, newModelAsAssignment, pFunctionName);\n }\n\n } else {\n cache.addUnsat(pConstraints);\n }\n }\n\n return unsat;\n\n } finally {\n closeProver();\n timeForSatChecks.stop();\n }\n\n } else {\n return false;\n }\n }", "private void initializeAndTrainModel(float alpha) {\n\n double forecast;\n double lastValue = actual[0];\n double[][] trainMatrix = new double[trainPoints][2];\n double[][] valMatrix = new double[validationPoints][2];\n\n for (int i = 1; i < trainPoints; i++) {\n forecast = lastValue;\n\n trainMatrix[i][0] = actual[i];\n trainMatrix[i][1] = forecast;\n lastValue = (alpha * actual[i]) + ((1 - alpha) * lastValue);\n }\n\n for (int t = 1; t <= validationPoints; t++) {\n valMatrix[t - 1][1] = lastValue;\n valMatrix[t - 1][0] = actual[trainPoints + t - 1];\n }\n\n\n double biasness = BiasnessHandler.handle(valMatrix);\n AccuracyIndicators AI = new AccuracyIndicators();\n ModelUtil.computeAccuracyIndicators(AI, trainMatrix, valMatrix, dof);\n AI.setBias(biasness);\n if (min_val_error >= AI.getMAPE()) {\n min_val_error = AI.getMAPE();\n optAlpha = alpha;\n accuracyIndicators = AI;\n }\n }", "@Override\n\tpublic void update(int timeStep)\n\t{\n\t\tthis.checkForNewAppliancesAndUpdateConstants();\n\n\t\tdouble[] ownersCostSignal = this.owner.getPredictedCostSignal();\n\t\tthis.dayPredictedCostSignal = Arrays.copyOfRange(ownersCostSignal, timeStep % ownersCostSignal.length, timeStep\n\t\t\t\t% ownersCostSignal.length + this.ticksPerDay);\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"update\");\n\t\t}\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"dayPredictedCostSignal: \" + Arrays.toString(this.dayPredictedCostSignal));\n\t\t}\n\n\t\tthis.dayPredictedCostSignal = ArrayUtils\n\t\t\t\t.offset(ArrayUtils.multiply(this.dayPredictedCostSignal, this.predictedCostToRealCostA), this.realCostOffsetb);\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"afterOffset dayPredictedCostSignal: \" + Arrays.toString(this.dayPredictedCostSignal));\n\t\t}\n\n\t\tif (this.owner.isHasElectricalSpaceHeat())\n\t\t{\n\t\t\tthis.setPointProfile = Arrays.copyOf(this.owner.getSetPointProfile(), this.owner.getSetPointProfile().length);\n\t\t\tthis.optimisedSetPointProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tthis.currentTempProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tthis.heatPumpDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(this.setPointProfile);\n\t\t\t// (20/01/12) Check if sum of <heatPumpDemandProfile> is consistent\n\t\t\t// at end day\n\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t{\n\t\t\t\tthis.mainContext.logger\n\t\t\t\t\t\t.trace(\"Sum(Wattbox estimated heatPumpDemandProfile): \" + ArrayUtils.sum(this.heatPumpDemandProfile));\n\t\t\t}\nif (\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\tthis.mainContext.logger.trace(\"Sum(Wattbox estimated heatPumpDemandProfile): \"\n\t\t\t\t\t+ ArrayUtils.sum(this.calculateEstimatedSpaceHeatPumpDemand(this.optimisedSetPointProfile)));\n}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.heatPumpDemandProfile = Arrays.copyOf(this.noElecHeatingDemand, this.noElecHeatingDemand.length);\n\t\t}\n\n\t\tif (this.owner.isHasElectricalWaterHeat())\n\t\t{\n\t\t\tthis.hotWaterVolumeDemandProfile = Arrays.copyOfRange(this.owner.getBaselineHotWaterVolumeProfile(), (timeStep % this.owner\n\t\t\t\t\t.getBaselineHotWaterVolumeProfile().length), (timeStep % this.owner.getBaselineHotWaterVolumeProfile().length)\n\t\t\t\t\t+ this.ticksPerDay);\n\t\t\tthis.waterHeatDemandProfile = ArrayUtils.multiply(this.hotWaterVolumeDemandProfile, Consts.WATER_SPECIFIC_HEAT_CAPACITY\n\t\t\t\t\t/ Consts.KWH_TO_JOULE_CONVERSION_FACTOR\n\t\t\t\t\t* (this.owner.waterSetPoint - ArrayUtils.min(Consts.MONTHLY_MAINS_WATER_TEMP) / Consts.DOMESTIC_HEAT_PUMP_WATER_COP));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.waterHeatDemandProfile = Arrays.copyOf(this.noElecHeatingDemand, this.noElecHeatingDemand.length);\n\t\t}\n\n\t\tif (this.coldAppliancesControlled && this.owner.isHasColdAppliances())\n\t\t{\n\t\t\tthis.optimiseColdProfile(timeStep);\n\t\t}\n\n\t\tif (this.wetAppliancesControlled && this.owner.isHasWetAppliances())\n\t\t{\n\t\t\tthis.optimiseWetProfile(timeStep);\n\t\t}\n\n\t\t// Note - optimise space heating first. This is so that we can look for\n\t\t// absolute\n\t\t// heat pump limit and add the cost of using immersion heater (COP 0.9)\n\t\t// to top\n\t\t// up water heating if the heat pump is too great\n\t\tif (this.spaceHeatingControlled && this.owner.isHasElectricalSpaceHeat())\n\t\t{\n\t\t\tif (this.owner.hasStorageHeater)\n\t\t\t{\n\t\t\t\tthis.optimiseStorageChargeProfile();\n\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t{\n\t\t\t\t\tthis.mainContext.logger.trace(\"Optimised storage heater profile = \" + Arrays.toString(this.heatPumpOnOffProfile));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tthis.optimiseSetPointProfile();\n\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t{\n\t\t\t\tthis.mainContext.logger.trace(\"Optimised set point profile = \" + Arrays.toString(this.heatPumpOnOffProfile));\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.waterHeatingControlled && this.owner.isHasElectricalWaterHeat())\n\t\t{\n\t\t\tthis.optimiseWaterHeatProfileWithSpreading();\n\t\t}\n\n\t\tif (this.eVehicleControlled && this.owner.isHasElectricVehicle())\n\t\t{\n\t\t\tthis.optimiseEVProfile();\n\t\t}\n\n\t\t// At the end of the step, set the temperature profile for today's\n\t\t// (which will be yesterday's when it is used)\n\t\tthis.priorDayExternalTempProfile = this.owner.getContext().getAirTemperature(timeStep, this.ticksPerDay);\n\t}", "@TaDaMethod(variablesToTrack = {\"ssn\", \"weekWage\", \"workWeeks\", \"ssn2\",\n\t\t\t\"capitalGains\", \"capitalLosses\", \"stockDividends\"}, \n\t\t\tcorrespondingDatabaseAttribute = {\"job.ssn\", \"job.WEEKWAGE\", \"job.WORKWEEKS\", \"investment.ssn\",\n\t\t\t\"investment.CAPITALGAINS\", \"investment.CAPITALLOSSES\", \"investment.STOCKDIVIDENDS\"})\n\tprivate void calculateSlopesAndIntercepts(){\n\t\tHashMap<Integer, Integer> ssnWeekWage = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnWorkWeeks = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnInvestmentIncome = new HashMap<Integer, Integer>();\n\t\t\n\t\ttry {\n\t\t\tstatement = Factory.getConnection().createStatement();\n\t results = statement.executeQuery(\"SELECT SSN, WEEKWAGE, WORKWEEKS from job\"); \n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"WEEKWAGE\") == null || results.getString(\"WORKWEEKS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn = results.getInt(\"SSN\");\n\t \tint weekWage = results.getInt(\"WEEKWAGE\");\n\t \tint workWeeks = results.getInt(\"WORKWEEKS\");\n\t \t\n\t \tssnWeekWage.put(ssn, weekWage);\n\t \tssnWorkWeeks.put(ssn, workWeeks);\n\t }\n\t \n\t results = statement.executeQuery(\"SELECT SSN, CAPITALGAINS, CAPITALLOSSES, STOCKDIVIDENDS from investment\");\n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"CAPITALGAINS\") == null || results.getString(\"CAPITALLOSSES\") == null || results.getString(\"STOCKDIVIDENDS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn2 = results.getInt(\"SSN\");\n\t \tint capitalGains = results.getInt(\"CAPITALGAINS\");\n\t \tint capitalLosses = results.getInt(\"CAPITALLOSSES\");\n\t \tint stockDividends = results.getInt(\"STOCKDIVIDENDS\");\n\t \tint investmentIncome = capitalGains + stockDividends + capitalLosses;\n\t \t\n\t \tssnInvestmentIncome.put(ssn2, investmentIncome);\n\t }\n\t \n\t // Calculate Cofficients\n\t // Build an array list of Work Weeks and an array list of Income;\n\t ArrayList<Integer> workWeeksList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeList = new ArrayList<Integer>();\n\t ArrayList<Integer> weeklyWageList = new ArrayList<Integer>();\n\t ArrayList<Integer> investmentList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeListForInvestment = new ArrayList<Integer>();\n\t \n\t for (Iterator<Integer> i = ssnWorkWeeks.keySet().iterator(); i.hasNext();){\n\t \tint SSNkey = (Integer) i.next();\n\t \tif(ssnWorkWeeks.get(SSNkey) != null && ssnWeekWage.get(SSNkey) != null){\n\t\t \tint workWeeks = (Integer) ssnWorkWeeks.get(SSNkey);\n\t\t \tint weekWage = (Integer) ssnWeekWage.get(SSNkey);\n\t\t \tif(workWeeks > 0 && weekWage > 0){\n\t\t \t\tworkWeeksList.add(workWeeks);\n\t\t\t \tincomeList.add(workWeeks * weekWage);\n\t\t\t \tweeklyWageList.add(weekWage);\n\t\t\t \tif(ssnInvestmentIncome.get(SSNkey) != null && ssnInvestmentIncome.get(SSNkey) != null){\n\t\t\t \t\tint investmentIncome = (Integer) ssnInvestmentIncome.get(SSNkey);\n\t\t\t \t\tinvestmentList.add(investmentIncome);\n\t\t\t \t\tincomeListForInvestment.add(workWeeks * weekWage);\n\t\t\t \t}\n\t\t \t}\n\t \t}\n\t }\n\t \n\t // Set the member variable for the cofficients for given Work Weeks find Income\n\t workWeeksFindIncome = new CalculateRegression().calculateRegressionNumbers(workWeeksList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given Weekly Wage find Income\n\t weeklyWageFindIncome = new CalculateRegression().calculateRegressionNumbers(weeklyWageList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given InvestmentIncome find Income \n\t investmentIncomeFindIncome = new CalculateRegression().calculateRegressionNumbers(investmentList,incomeListForInvestment);\n\t \n\t\t} catch (SQLException e) {\n\t while (e != null)\n\t {\n\t System.err.println(\"\\n----- SQLException -----\");\n\t System.err.println(\" SQL State: \" + e.getSQLState());\n\t System.err.println(\" Error Code: \" + e.getErrorCode());\n\t System.err.println(\" Message: \" + e.getMessage());\n\t // for stack traces, refer to derby.log or uncomment this:\n\t //e.printStackTrace(System.err);\n\t e = e.getNextException();\n\t }\n\t\t}\t\n\t\t\n\t}", "@Test\n\tpublic void testATMSwaptionCalibration() throws CalculationException, SolverException {\n\n\t\tfinal int numberOfPaths\t\t= 10000; // ideale è 10'000 paths!\n\t\tfinal int numberOfFactors\t= 1;\n\n\t\tfinal long millisCurvesStart = System.currentTimeMillis();\n\n\n\t\tSystem.out.println(\"Calibration to Swaptions.\\n\");\n\n\t\tSystem.out.println(\"Calibration of rate curves:\");\n\n\t\tfinal AnalyticModel curveModel = getCalibratedCurve();\n\n\t\t// Create the forward curve (initial value of the LIBOR market model)\n\t\tfinal ForwardCurve forwardCurve = curveModel.getForwardCurve(\"ForwardCurveFromDiscountCurve(discountCurve-EUR,1D)\");\n\t\tfinal DiscountCurve discountCurve = curveModel.getDiscountCurve(\"discountCurve-EUR\");\n\t\t//\t\tcurveModel.addCurve(discountCurve.getName(), discountCurve);\n\n\t\tfinal long millisCurvesEnd = System.currentTimeMillis();\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"Brute force Monte-Carlo calibration of model volatilities:\");\n\n\t\tfinal ArrayList<String>\t\t\t\tcalibrationItemNames\t= new ArrayList<>();\n\t\tfinal ArrayList<CalibrationProduct>\tcalibrationProducts\t\t= new ArrayList<>();\n\n\t\tfinal double\tswapPeriodLength\t= 0.5;\n\n\t\tfinal String[] atmExpiries = {\n\t\t\t\t\"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\",\n\t\t\t\t\"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \n\t\t\t\t\"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\",\n\t\t\t\t\"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\",\n\t\t\t\t\"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\",\n\t\t\t\t\"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \n\t\t\t\t\"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\",\n\t\t\t\t\"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\",\n\t\t\t\t\"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"4Y\",\n\t\t\t\t\"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\",\n\t\t\t\t\"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\",\n\t\t\t\t\"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\",\n\t\t\t\t\"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\",\n\t\t\t\t\"15Y\", \"15Y\", \"15Y\", \"15Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\",\n\t\t\t\t\"20Y\", \"20Y\", \"20Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\",\n\t\t\t\t\"25Y\", \"25Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\" };\n\n\t\tfinal String[] atmTenors = {\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \n\t\t\t\t\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\n\t\t\t\t\"1Y\", \"2Y\",\"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\",\"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\",\n\t\t\t\t\"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\",\n\t\t\t\t\"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\",\n\t\t\t\t\"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\",\n\t\t\t\t\"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\",\n\t\t\t\t\"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\",\n\t\t\t\t\"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\",\n\t\t\t\t\"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\",\n\t\t\t\t\"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\",\n\t\t\t\t\"15Y\", \"20Y\", \"25Y\", \"30Y\" };\n\n\t\tfinal double[] atmNormalVolatilities = {\n\t\t\t\t0.0015335, 0.0015179, 0.0019499, 0.0024161, 0.0027817, 0.0031067, 0.0033722, 0.0035158, 0.0036656, 0.0037844, 0.00452, 0.0050913, 0.0054071, 0.0056496,\n\t\t\t\t//next is 2M\n\t\t\t\t0.0016709, 0.0016287, 0.0020182, 0.0024951, 0.002827, 0.0031023, 0.0034348, 0.0036183, 0.0038008, 0.0039155, 0.0046602, 0.0051981, 0.0055116, 0.0057249,\n\t\t\t\t\n\t\t\t\t0.0015543, 0.0016509, 0.0020863, 0.002587, 0.002949, 0.0032105, 0.0035338, 0.0037133, 0.0038475, 0.0040674, 0.0047458, 0.005276, 0.005476, 0.005793,\n\t\t\t\t0.0016777, 0.001937, 0.0023423, 0.0027823, 0.0031476, 0.0034569, 0.0037466, 0.0039852, 0.0041802, 0.0043221, 0.0049649, 0.0054206, 0.0057009, 0.0059071,\n\t\t\t\t//next is 9M\n\t\t\t\t0.0017809, 0.0020951, 0.0024978, 0.0029226, 0.0032379, 0.0035522, 0.0038397, 0.0040864, 0.0043122, 0.0044836, 0.0050939, 0.0054761, 0.0057374, 0.0059448,\n\t\t\t\t\n\t\t\t\t0.0020129, 0.0022865, 0.0027082, 0.0030921, 0.0033849, 0.0037107, 0.0039782, 0.0042058, 0.0044272, 0.0046082, 0.0051564, 0.0055307, 0.0057924, 0.0059811,\n\t\t\t\t//next is 18M\n\t\t\t\t0.0022824, 0.0025971, 0.0029895, 0.0033299, 0.0036346, 0.0039337, 0.0042153, 0.0044347, 0.0046686, 0.0048244, 0.0052739, 0.005604, 0.0058311, 0.0060011,\n\t\t\t\n\t\t\t\t0.0026477, 0.0029709, 0.0033639, 0.0036507, 0.0039096, 0.0041553, 0.0044241, 0.00462, 0.0048265, 0.004989, 0.005361, 0.0056565, 0.0058529, 0.0060102,\n\t\t\t\t0.003382, 0.0036593, 0.0039353, 0.0041484, 0.0043526, 0.0045677, 0.004775, 0.0049506, 0.0051159, 0.0052722, 0.0055185, 0.0057089, 0.0058555, 0.0059432,\n\t\t\t\t0.0040679, 0.0042363, 0.0044602, 0.0046206, 0.0047527, 0.0048998, 0.0050513, 0.0051928, 0.0053439, 0.0054657, 0.0056016, 0.0057244, 0.0058153, 0.0058793,\n\t\t\t\t0.0045508, 0.0046174, 0.0047712, 0.0048999, 0.0050364, 0.0051504, 0.0052623, 0.0053821, 0.0054941, 0.0055918, 0.0056569, 0.0057283, 0.0057752, 0.0058109,\n\t\t\t\t0.0051385, 0.0051373, 0.0052236, 0.005312, 0.0053793, 0.0054396, 0.0055037, 0.0055537, 0.0056213, 0.0056943, 0.005671, 0.0056707, 0.0056468, 0.0056423,\n\t\t\t\t0.0055069, 0.0054836, 0.0055329, 0.0055696, 0.005605, 0.0056229, 0.0056562, 0.005655, 0.0056679, 0.0057382, 0.0056494, 0.0055831, 0.0055096, 0.0054526,\n\t\t\t\t0.0054486, 0.0054057, 0.0054439, 0.005462, 0.0054915, 0.0054993, 0.0055134, 0.0054985, 0.0055318, 0.0055596, 0.005369, 0.0052513, 0.0051405, 0.0050416,\n\t\t\t\t0.005317, 0.005268, 0.005312, 0.0053112, 0.0053417, 0.0053556, 0.0053323, 0.0053251, 0.0053233, 0.0053126, 0.0050827, 0.004922, 0.0047924, 0.0046666,\n\t\t\t\t0.0051198, 0.0051013, 0.0051421, 0.0051418, 0.0051538, 0.005133, 0.0051081, 0.0050552, 0.005055, 0.0050473, 0.0048161, 0.0045965, 0.0044512, 0.0043099,\n\t\t\t\t0.0049482, 0.004947, 0.0049805, 0.0049951, 0.0050215, 0.0049849, 0.0049111, 0.0048498, 0.0047879, 0.0047688, 0.0044943, 0.0042786, 0.0041191, 0.0039756};\n\n\t\tfinal LocalDate referenceDate = LocalDate.of(2020, Month.JULY, 31);\n\t\tfinal BusinessdayCalendarExcludingTARGETHolidays cal = new BusinessdayCalendarExcludingTARGETHolidays();\n\t\tfinal DayCountConvention_ACT_365 modelDC = new DayCountConvention_ACT_365();\n\t\tfor(int i=0; i<atmNormalVolatilities.length; i++ ) {\n\n\t\t\tfinal LocalDate exerciseDate = cal.getDateFromDateAndOffsetCode(referenceDate, atmExpiries[i]);\n\t\t\tfinal LocalDate tenorEndDate = cal.getDateFromDateAndOffsetCode(exerciseDate, atmTenors[i]);\n\t\t\tdouble\texercise\t\t= modelDC.getDaycountFraction(referenceDate, exerciseDate);\n\t\t\tdouble\ttenor\t\t\t= modelDC.getDaycountFraction(exerciseDate, tenorEndDate);\n\n\t\t\t// We consider an idealized tenor grid (alternative: adapt the model grid)\n\t\t\texercise\t= Math.round(exercise/0.25)*0.25;\n\t\t\ttenor\t\t= Math.round(tenor/0.25)*0.25;\n\t\t\tif(exercise < 0.25) {continue;}\n\t\t\t//if(exercise < 1.0) {continue;}\n\n\t\t\tfinal int numberOfPeriods = (int)Math.round(tenor / swapPeriodLength);\n\n\t\t\tfinal double\tmoneyness\t\t\t= 0.0;\n\t\t\tfinal double\ttargetVolatility\t= atmNormalVolatilities[i];\n\n\t\t\tfinal String\ttargetVolatilityType = \"VOLATILITYNORMAL\";\n\n\t\t\tfinal double\tweight = 1.0;\n\n\t\t\tcalibrationProducts.add(createCalibrationItem(weight, exercise, swapPeriodLength, numberOfPeriods, moneyness, targetVolatility, targetVolatilityType, forwardCurve, discountCurve));\n\t\t\tcalibrationItemNames.add(atmExpiries[i]+\"\\t\"+atmTenors[i]);\n\t\t}\n\n\t\t/*\n\t\t * Create a simulation time discretization\n\t\t */\n\t\t// If simulation time is below libor time, exceptions will be hard to track.\n\t\tfinal double lastTime\t= 21.0;\n\t\tfinal double dtLibor\t= 0.5;\n\t\tfinal double dt\t= 0.125;\n\t\tfinal TimeDiscretization timeDiscretizationFromArray = new TimeDiscretizationFromArray(0.0, (int) (lastTime / dt), dt);\n\t\tfinal TimeDiscretization liborPeriodDiscretization = new TimeDiscretizationFromArray(0.0, (int) (lastTime / dtLibor), dtLibor);\n\t\tint seed =1111;\n\t\tSystem.out.println(\"seed: \" + seed);\n\t\tfinal BrownianMotion brownianMotion = new net.finmath.montecarlo.BrownianMotionLazyInit(timeDiscretizationFromArray, numberOfFactors, numberOfPaths, seed /* seed */); \n\t\tTimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00,0.25, 0.5, 1.00, 2.00, 3.00, 5.00, 7.00, 10.0, 15.0, 21.0);\n\t\t//TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.0, 7.00, 8.0,9.0, 10.0, 12.5, 15.0, 21.0);\t\t// needed if you use LIBORVolatilityModelPiecewiseConstantWithMercurioModification: TimeDiscretization = new TimeDiscretizationFromArray(0.0, 0.25, 0.50, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 25.0, 30.0, 40.0);\n\t //TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 0.5, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9,00, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 , 17.0, 18.0, 19.0 ,20.0,21.0);\n //TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 21, 1.0);\n\n\t\tdouble[] arrayValues = new double [timeToMaturityDiscretization.getNumberOfTimes()];\n\t\tfor (int i=0; i<timeToMaturityDiscretization.getNumberOfTimes(); i++) {arrayValues[i]= 0.1/100;}\n\n\t //final LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelTimeHomogenousPiecewiseConstantWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, timeToMaturityDiscretization, arrayValues);\n\t\tLIBORVolatilityModel volatilityModel = new LIBORVolatilityModelFourParameterExponentialFormWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, 0.002, 0.0005, 0.2, 0.00005, true); //0.20/100.0, 0.05/100.0, 0.10, 0.05/100.0, \n\t\t//final LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelPiecewiseConstantWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization,optionMaturityDiscretization,timeToMaturityDiscretization, 0.50 / 100);\n\t\t\n\t\tfinal LIBORCorrelationModel correlationModel = new LIBORCorrelationModelExponentialDecayWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, numberOfFactors, 0.05, false);\n\t\t//AbstractLIBORCovarianceModelParametric covarianceModelParametric = new LIBORCovarianceModelExponentialForm5Param(timeDiscretizationFromArray, liborPeriodDiscretization, numberOfFactors, new double[] { 0.20/100.0, 0.05/100.0, 0.10, 0.05/100.0, 0.10} );\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelParametric = new LIBORCovarianceModelFromVolatilityAndCorrelation(timeDiscretizationFromArray, liborPeriodDiscretization, volatilityModel, correlationModel);\n\n\t\t// Create blended local volatility model with fixed parameter (0=lognormal, > 1 = almost a normal model).\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelDisplaced = new DisplacedLocalVolatilityModel(covarianceModelParametric, 1.0/0.25, false /* isCalibrateable */);\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelReducedVolatility = new VolatilityReductionMercurioModel(covarianceModelDisplaced);\n\t\t\n\t\t// Set model properties\n\t\tfinal Map<String, Object> properties = new HashMap<>();\n\t\tSystem.out.println(\"Number of volatility parameters: \" + volatilityModel.getParameter().length);\n\n\t\tproperties.put(\"measure\", LIBORMarketModelFromCovarianceModelWithMercurioModification.Measure.SPOT.name());\n\n\t\t// Choose normal state space for the Euler scheme (the covariance model above carries a linear local volatility model).\n\t\tproperties.put(\"stateSpace\", LIBORMarketModelFromCovarianceModelWithMercurioModification.StateSpace.NORMAL.name());\n\n\t\t// Set calibration properties (should use our brownianMotion for calibration - needed to have to right correlation).\n\t\tfinal Double accuracy = new Double(1E-8);\t// Lower accuracy to reduce runtime of the unit test\n\t\tfinal int maxIterations = 400;\n\t\tfinal int numberOfThreads = 6;\n\t\tfinal OptimizerFactory optimizerFactory = new OptimizerFactoryLevenbergMarquardt(maxIterations, accuracy, numberOfThreads);\n\n\t\t//penso che getParameterAsDouble().length mi ritorni il numero di tutti i paratemtri da calibrare cioè tutta la piecewise volatiliy e anche correlazion\n\t\tfinal double[] parameterStandardDeviation = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tfinal double[] parameterLowerBound = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tfinal double[] parameterUpperBound = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tArrays.fill(parameterStandardDeviation, 0.20/100.0);\n\t\tArrays.fill(parameterLowerBound, 0.0);\n\t\tArrays.fill(parameterUpperBound, Double.POSITIVE_INFINITY);\n\n\t\t// Set calibration properties (should use our brownianMotion for calibration - needed to have to right correlation).\n\t\tfinal Map<String, Object> calibrationParameters = new HashMap<>();\n\t\tcalibrationParameters.put(\"accuracy\", accuracy);\n\t\tcalibrationParameters.put(\"brownianMotion\", brownianMotion);\n\t\tcalibrationParameters.put(\"optimizerFactory\", optimizerFactory);\n\t\tcalibrationParameters.put(\"parameterStep\", new Double(1E-4));\n\t\tproperties.put(\"calibrationParameters\", calibrationParameters);\n\n\t\tfinal long millisCalibrationStart = System.currentTimeMillis();\n\n\t\t/*\n\t\t * Create corresponding Forward Market Model\n\t\t */\n\t\tfinal CalibrationProduct[] calibrationItemsLMM = new CalibrationProduct[calibrationItemNames.size()];\n\t\tfor(int i=0; i<calibrationItemNames.size(); i++) {\n\t\t\tcalibrationItemsLMM[i] = new CalibrationProduct(calibrationProducts.get(i).getProduct(),calibrationProducts.get(i).getTargetValue(),calibrationProducts.get(i).getWeight());\n\t\t}\n\t\tfinal LIBORMarketModel mercurioModelCalibrated = LIBORMarketModelFromCovarianceModelWithMercurioModification.of(\n\t\t\t\tliborPeriodDiscretization,\n\t\t\t\tcurveModel,\n\t\t\t\tforwardCurve,\n\t\t\t\tnew DiscountCurveFromForwardCurve(forwardCurve),\n\t\t\t\trandomVariableFactory,\n\t\t\t\tcovarianceModelReducedVolatility,\n\t\t\t\tcalibrationItemsLMM, properties);\n\n\t\tfinal long millisCalibrationEnd = System.currentTimeMillis();\n\t\t\n//-------------------------------------------------------------------------------- fine calibrazione volatility------------------------------\n\t\tSystem.out.println(\"\\nCalibrated parameters are:\");\n\t\tfinal double[] param = ((AbstractLIBORCovarianceModelParametric)((LIBORMarketModelFromCovarianceModelWithMercurioModification) mercurioModelCalibrated).getCovarianceModel()).getParameterAsDouble();\n\t\tfor (final double p : param) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\n\t\tfinal EulerSchemeFromProcessModel process = new EulerSchemeFromProcessModel(mercurioModelCalibrated, brownianMotion);\n\t\tfinal LIBORModelMonteCarloSimulationModel simulationMercurioCalibrated = new LIBORMonteCarloSimulationFromLIBORModel(process);\n\n\t\tSystem.out.println(\"\\nValuation on calibrated model:\");\n\t\tdouble deviationSum\t\t\t= 0.0;\n\t\tdouble deviationSquaredSum\t= 0.0;\n\t\tfor (int i = 0; i < calibrationProducts.size(); i++) {\n\t\t\tfinal AbstractLIBORMonteCarloProduct calibrationProduct = calibrationProducts.get(i).getProduct();\n\t\t\ttry {\n\t\t\t\tfinal double valueModel = calibrationProduct.getValue(simulationMercurioCalibrated);\n\t\t\t\tfinal double valueTarget = calibrationProducts.get(i).getTargetValue().getAverage();\n\t\t\t\tfinal double error = valueModel-valueTarget;\n\t\t\t\tdeviationSum += error;\n\t\t\t\tdeviationSquaredSum += error*error;\n\t\t\t\tSystem.out.println(calibrationItemNames.get(i) + \"\\t\" + \"Model: \" + formatterValue.format(valueModel) + \"\\t Target: \" + formatterValue.format(valueTarget) + \"\\t Deviation: \" + formatterDeviation.format(valueModel-valueTarget));// + \"\\t\" + calibrationProduct.toString());\n\t\t\t}\n\t\t\tcatch(final Exception e) {\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Time required for calibration of curves.........: \" + (millisCurvesEnd-millisCurvesStart)/1000.0 + \" s.\");\n\t\tSystem.out.println(\"Time required for calibration of volatilities...: \" + (millisCalibrationEnd-millisCalibrationStart)/1000.0 + \" s.\");\n\n\t\tfinal double averageDeviation = deviationSum/calibrationProducts.size();\n\t\tSystem.out.println(\"Mean Deviation:\" + formatterValue.format(averageDeviation));\n\t\tSystem.out.println(\"RMS Error.....:\" + formatterValue.format(Math.sqrt(deviationSquaredSum/calibrationProducts.size())));\n\t\tSystem.out.println(\"__________________________________________________________________________________________\\n\");\n\n\t\tAssert.assertTrue(Math.abs(averageDeviation) < 2E-4);\n\n//\n//\t\t/*\n//\t\t * Checking serilization\n//\t\t */\n//\t\tbyte[] lmmSerialized = null;\n//\t\ttry {\n//\t\t\tfinal ByteArrayOutputStream baos = new ByteArrayOutputStream();\n//\t\t\tfinal ObjectOutputStream oos = new ObjectOutputStream( baos );\n//\t\t\toos.writeObject(mercurioModelCalibrated.getCloneWithModifiedData(null));\n//\t\t\tlmmSerialized = baos.toByteArray();\n//\t\t} catch (final IOException e) {\n//\t\t\tfail(\"Serialization failed with exception \" + e.getMessage());\n//\t\t}\n//\n//\t\tLIBORMarketModelFromCovarianceModelWithMercurioModification liborMarketModelFromSerialization = null;\n//\t\ttry {\n//\t\t\tfinal ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(lmmSerialized) );\n//\t\t\tliborMarketModelFromSerialization = (LIBORMarketModelFromCovarianceModelWithMercurioModification)ois.readObject();\n//\t\t} catch (IOException | ClassNotFoundException e) {\n//\t\t\tfail(\"Deserialization failed with exception \" + e.getMessage());\n//\t\t}\n//\n//\t\t/*\n//\t\t * Check if the deserialized model and the original calibrated model give the same valuations\n//\t\t */\n//\t\tif(liborMarketModelFromSerialization != null) {\n//\t\t\tfinal LIBORModelMonteCarloSimulationModel simulationFromSerialization = new LIBORMonteCarloSimulationFromLIBORModel(new EulerSchemeFromProcessModel(liborMarketModelFromSerialization, brownianMotion));\n//\n//\t\t\tSystem.out.println(\"\\nValuation on calibrated model:\");\n//\t\t\tfor (int i = 0; i < calibrationProducts.size(); i++) {\n//\t\t\t\tfinal AbstractLIBORMonteCarloProduct calibrationProduct = calibrationProducts.get(i).getProduct();\n//\t\t\t\ttry {\n//\t\t\t\t\tfinal double valueFromCalibratedModel = calibrationProduct.getValue(simulationMercurioCalibrated);\n//\t\t\t\t\tfinal double valueFromSerializedModel = calibrationProduct.getValue(simulationFromSerialization);\n//\t\t\t\t\tfinal double error = valueFromSerializedModel-valueFromCalibratedModel;\n//\t\t\t\t\tAssert.assertEquals(\"Valuation using deserilized model.\", valueFromCalibratedModel, valueFromSerializedModel, 1E-12);\n//\t\t\t\t\tSystem.out.println(calibrationItemNames.get(i) + \"\\t\" + formatterDeviation.format(error));\n//\t\t\t\t}\n//\t\t\t\tcatch(final Exception e) {\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t// CAPLET ON BACKWARD LOOKING RATE SEMESTRALI\n\t\tDecimalFormat formatterTimeValue = new DecimalFormat(\"##0.00;\");\n\t\tDecimalFormat formatterVolValue = new DecimalFormat(\"##0.00000;\");\n\t\tDecimalFormat formatterAnalytic = new DecimalFormat(\"##0.000;\");\n\t\tDecimalFormat formatterPercentage = new DecimalFormat(\" ##0.000%;-##0.000%\", new DecimalFormatSymbols(Locale.ENGLISH));\n\t\tdouble[] mktData = new double[] {/* 6M 0.00167, */ /* 12M*/ 0.00201, /* 18M*/ 0.00228, /* 2Y */ 0.00264, 0.0, /* 3Y */ 0.0033, /* 4Y */0.00406, /* 5Y */ 0.00455, /* 6Y - NA */ 0.0, /* 7Y */0.00513, /* 8Y- NA */0.0, /* 9Y */0.0, /* 10Y */0.00550,0.0,0.0,0.0,0.0, /* 15Y */0.00544,0.0,0.0,0.0,0.0, /* 20Y */0.0053,0.0,0.0,0.0,0.0,/* 25Y */ 0.0053,0.0,0.0,0.0,0.0,/* 30Y */0.00495,0.0,0.0,0.0 };\n\t\t\n\t\tdouble strike = 0.004783;\n\t\n\t\tint liborIndex=1;\n\t\tint mktDataIndex = 0;\n\n\t\t//Results with CALIBRATED model\n\t\tSystem.out.println(\"\\n results on CALIBRATED model \\n\");\n\t\twhile(liborIndex < liborPeriodDiscretization.getNumberOfTimes()) {\n\t\t\tdouble maturityMinusLengthLibor =liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble fixBackwardTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tCaplet capletCassical = new Caplet(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false, ValueUnit.NORMALVOLATILITY);\n\t\t\t//set to default ValueUnit.NORMALVOLATILITY for CapletOnBackwardLookingRate\n\t\t\tCapletOnBackwardLookingRate capletBackward = new CapletOnBackwardLookingRate(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false);\t\t\t\n\t\t\tdouble impliedVolClassical = capletCassical.getValue(simulationMercurioCalibrated);\n\t\t\tdouble impliedVolBackward = capletBackward.getValue(simulationMercurioCalibrated);\n\t\t\tdouble analyticFormulaPaper = Math.sqrt(1+0.5/(maturityMinusLengthLibor*3));\n\t\t\tdouble ratioImpliedVol = impliedVolBackward/impliedVolClassical;\n\t\t\tdouble error = (analyticFormulaPaper-ratioImpliedVol)/analyticFormulaPaper;\n\n\t\t\tif (liborIndex<5) {\t\t//da i valori del caplet per maturity 1.5Y, 2Y, 2.5Y,.\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\tliborIndex+=1;\n\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\tliborIndex+=1;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\t//secondo loop da i valori del caplet per maturity 4Y,5Y,...,21\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\t\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\n\t\t// Set model properties\n\t\tMap<String, String> properties2 = new HashMap<String, String >();\n\t\tproperties2.put(\"measure\", LIBORMarketModelFromCovarianceModelWithMercurioModification.Measure.SPOT.name());\n\t\tproperties2.put(\"stateSpace\", LIBORMarketModelFromCovarianceModelWithMercurioModification.StateSpace.NORMAL.name());\n\n\t\tfinal LIBORMarketModel MercurioModelNONcalibrated= new LIBORMarketModelFromCovarianceModelWithMercurioModification(\n\t\t\t\tliborPeriodDiscretization,\n\t\t\t\tcurveModel,\n\t\t\t\tforwardCurve,\n\t\t\t\tnew DiscountCurveFromForwardCurve(forwardCurve),\n\t\t\t\trandomVariableFactory,\n\t\t\t\tcovarianceModelReducedVolatility,\n\t\t\t\tproperties2\n\t\t\t\t);\n\n\t\tfinal EulerSchemeFromProcessModel process2 = new EulerSchemeFromProcessModel(MercurioModelNONcalibrated,brownianMotion);\n\t\tfinal LIBORModelMonteCarloSimulationModel simulationMercurioModelNONcalibrated = new LIBORMonteCarloSimulationFromLIBORModel(process2);\n\t\n\t\t\n\t\t//Results with NON calibrated model\n\t\tliborIndex=1;\n\t\tmktDataIndex = 0;\n\t\tSystem.out.println(\"\\n results on NON-CALIBRATED model \\n\");\n\t\twhile(liborIndex < liborPeriodDiscretization.getNumberOfTimes()) {\n\t\t\tdouble maturityMinusLengthLibor =liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble fixBackwardTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tCaplet capletCassical = new Caplet(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false, ValueUnit.NORMALVOLATILITY);\n\t\t\t//set to default ValueUnit.NORMALVOLATILITY for CapletOnBackwardLookingRate\n\t\t\tCapletOnBackwardLookingRate capletBackward = new CapletOnBackwardLookingRate(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false);\t\t\t\n\t\t\tdouble impliedVolClassical = capletCassical.getValue(simulationMercurioModelNONcalibrated);\n\t\t\tdouble impliedVolBackward = capletBackward.getValue(simulationMercurioModelNONcalibrated);\n\t\t\tdouble analyticFormulaPaper = Math.sqrt(1+0.5/(maturityMinusLengthLibor*3));\n\t\t\tdouble ratioImpliedVol = impliedVolBackward/impliedVolClassical;\n\t\t\tdouble error = (analyticFormulaPaper-ratioImpliedVol)/analyticFormulaPaper;\n\n\t\t\tif (liborIndex<5) {\t\t//da i valori del caplet per maturity 1.0Y, 1.5Y, 2Y, 2.5Y, 3Y\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\tliborIndex+=1;\n\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\tliborIndex+=1;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\t//secondo loop da i valori del caplet per maturity 4Y,5Y,...,21\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\n\t\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\tint timeIndex = 4;\n\t\tSystem.out.println(\" \\n Backward looking rate evaluated at the END of the accrual period:\");\n\t\tfor( liborIndex=0; liborIndex<liborPeriodDiscretization.getNumberOfTimes()-1; liborIndex++) {\n\t\t\tdouble evaluationTime=timeDiscretizationFromArray.getTime(timeIndex);\n\t\t\tdouble liborStartingTime=liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble liborEndingTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tRandomVariable backwardLookingRate = simulationMercurioModelNONcalibrated.getLIBOR(timeIndex, liborIndex);\n\t\t\tdouble avgBackwardLookingRate =backwardLookingRate.getAverage();\n\t\t\tSystem.out.println(\"Backward B(\" + formatterTimeValue.format(liborStartingTime) + \", \" + formatterTimeValue.format(liborEndingTime) + \") evaluated in t= \" + formatterTimeValue.format(evaluationTime) + \".\"+ \"\\t\" + \"Average: \" + avgBackwardLookingRate);\n\t\t\ttimeIndex += 4;\n\t\t}\t\n\t\t\n\t\tint timeIndex2 = 0;\n\t\tSystem.out.println(\"\\n Backward looking rate evaluated at the BEGIN of the accrual period:\");\n\t\tfor( liborIndex=0; liborIndex<liborPeriodDiscretization.getNumberOfTimes()-1; liborIndex++) {\n\t\t\tdouble evaluationTime=timeDiscretizationFromArray.getTime(timeIndex2);\n\t\t\tdouble liborStartingTime=liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble liborEndingTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tRandomVariable backwardLookingRate = simulationMercurioModelNONcalibrated.getLIBOR(timeIndex2, liborIndex);\n\t\t\tdouble avgBackwardLookingRate =backwardLookingRate.getAverage();\n\t\t\tSystem.out.println(\"Backward B(\" + formatterTimeValue.format(liborStartingTime) + \", \" + formatterTimeValue.format(liborEndingTime) + \") evaluated in t= \" + formatterTimeValue.format(evaluationTime) + \".\"+ \"\\t\" + \"Average: \" + avgBackwardLookingRate);\n\t\t\ttimeIndex2 += 4;\n\t\t}\n\n\t}", "public double[][] calcCondPathProbs(char[] outcome, double[][] forwards, double[][] backwards) {\r\n\t\t// initialize return variable\r\n\t\tdouble[][] conditional = new double[states.length * states.length][outcome.length - 1];\r\n\t\t\r\n\t\t// initialize the probability of this outcome to 0\r\n\t\tdouble outcomeProb = 0;\r\n\t\t// loop over all nodes in the last column\r\n\t\tfor (int i = 0; i < states.length; ++i)\r\n\t\t\t// add this node's probability to the overall probability\r\n\t\t\toutcomeProb += forwards[i][outcome.length - 1];\r\n\t\t\r\n\t\t// loop over all columns of the graph to start from\t\r\n\t\tfor (int col = 0; col < outcome.length - 1; ++col)\r\n\t\t\t// loop over all states (row) to transition/go from and to\r\n\t\t\tfor (int from = 0; from < states.length; ++from) for (int to = 0; to < states.length; ++to)\r\n\t\t\t\t// calculate conditional probability of path from (col, from) to (col + 1, to)\r\n\t\t\t\tconditional[from * states.length + to][col] = forwards[from][col] * backwards[to][col + 1] * \r\n\t\t\t\t\tedgeProb(from, to, outcome[col + 1]) / outcomeProb;\r\n\t\t\r\n\t\treturn conditional;\r\n\t}", "public float[] BackSubstitution(){\n float[] solX = new float[this.NBrsEff];\n float temp;\n for (int i=this.NBrsEff-1; i>=0; i--){\n temp = this.M[i][this.NKolEff-1];\n for (int j=this.NKolEff-2; j>i; j--){\n temp -= solX[j] * this.M[i][j];\n }\n solX[i] = temp/this.M[i][i];\n System.out.println(\"SolX: \"+solX[i]);\n }\n return solX;\n }", "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "@NotNull\n @Generated\n @Selector(\"needRulesVerdict\")\n public static native NEFilterNewFlowVerdict needRulesVerdict();", "private String E19Conditions() {\n StringBuilder buffer = new StringBuilder();\n int numCols = 60;\n int leftMargin = 17;\n String tmp1 = \" \";\n String tmp2 = \" \";\n String tmp3 = \" \";\n String indent = \"\";\n for (int i = 0; i < leftMargin; i++) {\n indent = indent.concat(\" \");\n }\n buffer.append(\"\\f\");\n buffer.append(TextReportConstants.E19_HDR_CONDITIONS + \"\\n\\n\");\n\n TextReportData data = TextReportDataManager.getInstance()\n .getDataForReports(lid, 0);\n\n if (data.getRiverstat().getMile() != HydroConstants.MISSING_VALUE) {\n tmp1 = String.format(\"%-6.1f\", data.getRiverstat().getMile());\n }\n if (data.getRiverstat().getDa() != HydroConstants.MISSING_VALUE) {\n tmp2 = String.format(\"%-6.1f\", data.getRiverstat().getDa());\n }\n if (data.getRiverstat().getPool() != HydroConstants.MISSING_VALUE) {\n tmp3 = String.format(\"%-6.1f\", data.getRiverstat().getPool());\n }\n\n buffer.append(String.format(\n \" MILES ABOVE MOUTH: %s%sDRAINAGE AREA: %s%sPOOL STAGE: %s\",\n tmp1, \" \", tmp2, \" \", tmp3));\n buffer.append(\"\\n\\n\\n\");\n\n buffer.append(\" STREAM BED: \");\n\n if (data.getDescrip().getBed() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getBed(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REACH: \");\n if (data.getDescrip().getReach() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getReach(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REGULATION: \");\n if (data.getDescrip().getRes() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getRes(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" DIVERSION: \");\n if (data.getDescrip().getDivert() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getDivert(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" WINTER: \");\n if (data.getDescrip().getIce() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getIce(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" TOPOGRAPHY: \");\n if (data.getDescrip().getTopo() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getTopo(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REMARKS: \");\n if (data.getDescrip().getRemark() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getRemark(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n // try to place FOOTER at the bottom\n buffer.append(advanceToFooter(0, buffer.toString()));\n\n Date d = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\")).getTime();\n String footer = createFooter(data, E19_RREVISE_TYPE, sdf.format(d),\n \"NWS FORM E-19\", E19_CONDITIONS, \"CONDITIONS\", null,\n E19_STANDARD_LEFT_MARGIN);\n buffer.append(footer);\n\n return buffer.toString();\n }", "private static FXForwardTrade createFxForwardTrade() {\n\n Counterparty counterparty = new SimpleCounterparty(ExternalId.of(Counterparty.DEFAULT_SCHEME, \"COUNTERPARTY\"));\n BigDecimal tradeQuantity = BigDecimal.valueOf(1);\n LocalDate tradeDate = LocalDate.of(2014, 7, 11);\n OffsetTime tradeTime = OffsetTime.of(LocalTime.of(0, 0), ZoneOffset.UTC);\n SimpleTrade trade = new SimpleTrade(createFxForwardSecurity(), tradeQuantity, counterparty, tradeDate, tradeTime);\n trade.setPremium(0.00);\n trade.setPremiumDate(LocalDate.of(2014, 7, 25));\n trade.setPremiumCurrency(Currency.GBP);\n\n FXForwardTrade fxForwardTrade = new FXForwardTrade(trade);\n\n return fxForwardTrade;\n }", "private boolean consistencyCheckC1Constraints(double[][] xResults) {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tdouble outxValue = GRBSolverUtils.getOutValue(i, xResults, mExplicitMDP);\n\t\t\tdouble inxValue = GRBSolverUtils.getInValue(i, xResults, mExplicitMDP);\n\t\t\tboolean satisfied = GRBSolverUtils.approximatelyEqual(outxValue, inxValue,\n\t\t\t\t\tmSettings.getFeasibilityTolerance());\n\n\t\t\tif (!satisfied) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "SpacecraftState propagate(AbsoluteDate start, AbsoluteDate target) throws OrekitException;", "private double GetMCRTrainSet() \n\t{\n\t\tint numErrors = 0;\n\t\t\n\t\tfor(int i = 0; i < ITrain; i++)\n\t\t{\n\t\t\tPreCompute(i);\n\t\t\t\n\t\t\tdouble max_Y_hat_ic = Double.MIN_VALUE;\n\t\t\tint label_i = -1; \n\t\t\t\n\t\t\tfor(int c = 0; c < C; c++)\n\t\t\t{\n\t\t\t\tdouble Y_hat_ic = Predict(i, c); \n\t\t\t\t\n\n\t\t\t\tif(lossType == LossTypes.LOGISTIC)\n\t\t\t\t\tY_hat_ic = Sigmoid.Calculate(Y_hat_ic);\n\t\t\t\t\n\t\t\t\tif(Y_hat_ic > max_Y_hat_ic)\n\t\t\t\t{\n\t\t\t\t\tmax_Y_hat_ic = Y_hat_ic; \n\t\t\t\t\tlabel_i = (int)Math.ceil(c);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif( nominalLabels.indexOf(Y.get(i)) != label_i ) \n\t\t\t\tnumErrors++;\n\t\t}\n\t\t\n\t\treturn (double)numErrors/(double)ITrain;\n\t}", "public void train() {\n\n int w;\n double sum = 0, avg;\n double forecast;\n double[][] trainMatrix = new double[trainPoints][2];\n double[][] valMatrix = new double[validationPoints][2];\n actual = observations.toArray();\n\n for (int i = 0; i < step * slices; i++)\n sum += actual[i];\n\n avg = sum / slices;\n\n for (int pos = 0; pos < trainPoints; pos++) {\n sum = 0;\n w = 0;\n\n if (pos >= step * slices) {\n for (int k = pos - step * slices; k < pos; k += step)\n sum += actual[k] * weights[w++];\n forecast = sum / slices;\n } else forecast = avg;\n\n trainMatrix[pos][0] = actual[pos];\n trainMatrix[pos][1] = forecast;\n }\n\n for (int pos = actual.length - validationPoints, j = 0; pos < actual.length; pos++) {\n sum = 0;\n w = 0;\n for (int k = pos - step * slices; k < pos; k += step)\n sum += actual[k] * weights[w++];\n forecast = sum / slices;\n valMatrix[j][0] = actual[pos];\n valMatrix[j][1] = forecast;\n j++;\n }\n double biasness = BiasnessHandler.handleOffset(valMatrix);\n accuracyIndicators.setBias(biasness);\n ModelUtil.computeAccuracyIndicators(accuracyIndicators, trainMatrix, valMatrix, dof);\n errorBound = ErrorBoundsHandler.computeErrorBoundInterval(trainMatrix);\n }", "public static final org.drip.state.forward.ForwardCurve ShapePreservingForwardCurve (\n\t\tfinal java.lang.String strName,\n\t\tfinal org.drip.state.identifier.ForwardLabel fri,\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParam,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams quotingParam,\n\t\tfinal java.lang.String strBasisType,\n\t\tfinal org.drip.spline.basis.FunctionSetBuilderParams fsbp,\n\t\tfinal org.drip.product.definition.CalibratableComponent[] aCalibComp,\n\t\tfinal java.lang.String strManifestMeasure,\n\t\tfinal double[] adblQuote,\n\t\tfinal double dblEpochResponse)\n\t{\n\t\tif (null == strName || strName.isEmpty() || null == strBasisType || strBasisType.isEmpty() || null ==\n\t\t\tvalParams || null == fsbp || null == strManifestMeasure || strManifestMeasure.isEmpty())\n\t\t\treturn null;\n\n\t\tint iNumQuote = null == adblQuote ? 0 : adblQuote.length;\n\t\tint iNumComp = null == aCalibComp ? 0 : aCalibComp.length;\n\n\t\tif (0 == iNumComp || iNumComp != iNumQuote) return null;\n\n\t\ttry {\n\t\t\torg.drip.state.identifier.ForwardLabel forwardLabel = null;\n\n\t\t\tif (aCalibComp[0] instanceof org.drip.product.rates.DualStreamComponent)\n\t\t\t\tforwardLabel = ((org.drip.product.rates.DualStreamComponent)\n\t\t\t\t\taCalibComp[0]).derivedStream().forwardLabel();\n\t\t\telse {\n\t\t\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.state.identifier.ForwardLabel>\n\t\t\t\t\tmapForwardLabel = aCalibComp[0].forwardLabel();\n\n\t\t\t\tif (null != mapForwardLabel && 0 != mapForwardLabel.size())\n\t\t\t\t\tforwardLabel = mapForwardLabel.get (0);\n\t\t\t}\n\n\t\t\torg.drip.state.representation.LatentStateSpecification[] aLSS = new\n\t\t\t\torg.drip.state.representation.LatentStateSpecification[] {new\n\t\t\t\t\torg.drip.state.representation.LatentStateSpecification\n\t\t\t\t\t\t(org.drip.analytics.definition.LatentStateStatic.LATENT_STATE_FORWARD,\n\t\t\t\t\t\t\torg.drip.analytics.definition.LatentStateStatic.FORWARD_QM_FORWARD_RATE,\n\t\t\t\t\t\t\t\tforwardLabel)};\n\n\t\t\torg.drip.state.inference.LatentStateSegmentSpec[] aSegmentSpec = new\n\t\t\t\torg.drip.state.inference.LatentStateSegmentSpec[iNumComp];\n\n\t\t\tfor (int i = 0; i < iNumComp; ++i) {\n\t\t\t\torg.drip.product.calib.ProductQuoteSet pqs = aCalibComp[i].calibQuoteSet (aLSS);\n\n\t\t\t\tif (null == pqs || !pqs.set (strManifestMeasure, adblQuote[i])) return null;\n\n\t\t\t\taSegmentSpec[i] = new org.drip.state.inference.LatentStateSegmentSpec (aCalibComp[i], pqs);\n\t\t\t}\n\n\t\t\torg.drip.state.inference.LatentStateStretchSpec[] aStretchSpec = new\n\t\t\t\torg.drip.state.inference.LatentStateStretchSpec[] {new\n\t\t\t\t\torg.drip.state.inference.LatentStateStretchSpec (strName, aSegmentSpec)};\n\n\t\t\torg.drip.state.inference.LinearLatentStateCalibrator llsc = new\n\t\t\t\torg.drip.state.inference.LinearLatentStateCalibrator (new\n\t\t\t\t\torg.drip.spline.params.SegmentCustomBuilderControl (strBasisType, fsbp,\n\t\t\t\t\t\torg.drip.spline.params.SegmentInelasticDesignControl.Create (2, 2), new\n\t\t\t\t\t\t\torg.drip.spline.params.ResponseScalingShapeControl (true, new\n\t\t\t\t\t\t\t\torg.drip.function.r1tor1.QuadraticRationalShapeControl (0.)), null),\n\t\t\t\t\t\t\t\t\torg.drip.spline.stretch.BoundarySettings.FinancialStandard(),\n\t\t\t\t\t\t\t\t\t\torg.drip.spline.stretch.MultiSegmentSequence.CALIBRATE, null, null);\n\n\t\t\treturn ShapePreservingForwardCurve (llsc, aStretchSpec, fri, valParams, pricerParam, csqs,\n\t\t\t\tquotingParam, dblEpochResponse);\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "protected void initCoefficients() {\n\n\t\tString S = C + \": initCoefficients():\";\n\t\tif (D) {\n\t\t\tSystem.out.println(S + \"Starting\");\n\t\t}\n\n\t\t// Make the ShakeMap coefficients\n\t\tcoefficientsSM.clear();\n\t\t// Note that the coefficients in \"the APPENDIX\" that David Wald sent to me (Ned) on 8/27/07\n\t\t// assume that all logs in their equation are base-10 (in spite of their using \"ln\" for\n\t\t// two of the terms). Thus, thier B1, B2, and Sigma values need to be multiplied by 2.3025.\n\t\t// Also, since their units are gals their B1 needs to have ln(980) subtracted from it\n\t\t// (except for PGV).\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeffSM0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// Note: no sigma values were available for those below (Vince needs to recompute them)\n\t\t// (those above came from Vince via personal communication)\n\t\t// therefore, I multiplied those above by ratio of the sigmas given in the table in\n\t\t// \"the APPENDIX\" David sent to me (Ned). These are labeled as \"Sigma\" in their table\n\t\t// with no further explanation; using the ratios seems reasonable.\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeffSM2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.835318, 0.835318, 0.835318, 1.71773, 0.000, -1.827, -0.608, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.842 / 0.836) * 0.660, (0.842 / 0.836) * 0.328,\n\t\t\t\t(0.842 / 0.836) * 0.737, (0.842 / 0.836) * 0.3948,\n\t\t\t\t(0.842 / 0.836) * 0.836);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.82877, -1.82877, -1.82877, 2.20818, 0.000, -1.211, -0.974, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.988 / 0.836) * 0.660, (0.988 / 0.836) * 0.328,\n\t\t\t\t(0.988 / 0.836) * 0.737, (0.988 / 0.836) * 0.3948,\n\t\t\t\t(0.988 / 0.836) * 0.836);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeffSM4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -4.63102, -4.63102, -4.63102, 2.09305, 0.000, -0.848, -0.890, 760,\n\t\t\t\t6.0,\n\t\t\t\t(1.082 / 0.836) * 0.660, (1.082 / 0.836) * 0.328,\n\t\t\t\t(1.082 / 0.836) * 0.737, (1.082 / 0.836) * 0.3948,\n\t\t\t\t(1.082 / 0.836) * 0.836);\n\t\t// PGV - They actually give PGV coeffs so no scaling of 1-sec SA is needed.\n\t\tBJF_1997_AttenRelCoefficients coeffSM5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, 5.1186, 5.1186, 5.1186, 1.70391, 0.000, -1.386, -0.668, 760, 6.0,\n\t\t\t\t(0.753 / 0.836) * 0.660, (0.753 / 0.836) * 0.328,\n\t\t\t\t(0.753 / 0.836) * 0.737, (0.753 / 0.836) * 0.3948,\n\t\t\t\t(0.753 / 0.836) * 0.836);\n\n\t\t// add these to the list\n\t\tcoefficientsSM.put(coeffSM0.getName(), coeffSM0);\n\t\tcoefficientsSM.put(coeffSM1.getName(), coeffSM1);\n\t\tcoefficientsSM.put(coeffSM2.getName(), coeffSM2);\n\t\tcoefficientsSM.put(coeffSM3.getName(), coeffSM3);\n\t\tcoefficientsSM.put(coeffSM4.getName(), coeffSM4);\n\t\tcoefficientsSM.put(coeffSM5.getName(), coeffSM5);\n\n\t\t// Now make the original BJF 1997 coefficients\n\t\tcoefficientsBJF.clear();\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeff0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, -0.313, -0.117, -0.242, 0.527, 0.000, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeff1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, -0.313, -0.117, -0.242, 0.527, 0, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeff2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.598, 0.803, 0.7, 0.769, -0.161, -0.893, -0.401, 2133, 5.94,\n\t\t\t\t0.440, 0.276, 0.519, 0.048, 0.522);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeff3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.133, -1.009, -1.08, 1.036, -0.032, -0.798, -0.698, 1406, 2.9,\n\t\t\t\t0.474, 0.325, 0.575, 0.214, 0.613);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeff4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -1.699, -1.801, -1.743, 1.085, -0.085, -0.812, -0.655, 1795, 5.85,\n\t\t\t\t0.495, 0.362, 0.613, 0.276, 0.672);\n\t\t// PGV - these are actually from 1-sec SA using the Newmark & Hall (1982). According to the ShakeMap docs this\n\t\t// scaling factor is PGV = (37.27*2.54)*SA1.0\n\t\t// The following formula is slightly more accurate (from Ken Campbell)\n\t\tdouble SA10toPGV = Math.log(981.0 / (2.0 * Math.PI * 1.65));\n\t\tBJF_1997_AttenRelCoefficients coeff5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, -1.133 + SA10toPGV, -1.009 + SA10toPGV, -1.08 + SA10toPGV, 1.036,\n\t\t\t\t-0.032, -0.798, -0.698, 1406, 2.9, 0.474, 0.325, 0.575, 0.214, 0.613);\n\n\t\t// add these to the list\n\t\tcoefficientsBJF.put(coeff0.getName(), coeff0);\n\t\tcoefficientsBJF.put(coeff1.getName(), coeff1);\n\t\tcoefficientsBJF.put(coeff2.getName(), coeff2);\n\t\tcoefficientsBJF.put(coeff3.getName(), coeff3);\n\t\tcoefficientsBJF.put(coeff4.getName(), coeff4);\n\t\tcoefficientsBJF.put(coeff5.getName(), coeff5);\n\n\t}", "default Gwei[][] get_attestation_deltas(BeaconState state) {\n EpochNumber previous_epoch = get_previous_epoch(state);\n Gwei total_balance = get_total_active_balance(state);\n Gwei[] rewards = new Gwei[state.getValidatorRegistry().size().getIntValue()];\n Gwei[] penalties = new Gwei[state.getValidatorRegistry().size().getIntValue()];\n Arrays.fill(rewards, Gwei.ZERO);\n Arrays.fill(penalties, Gwei.ZERO);\n\n List<ValidatorIndex> eligible_validator_indices = new ArrayList<>();\n for (ValidatorIndex index : state.getValidatorRegistry().size()) {\n ValidatorRecord validator = state.getValidatorRegistry().get(index);\n if (is_active_validator(validator, previous_epoch)\n || (validator.getSlashed() && previous_epoch.increment().less(validator.getWithdrawableEpoch()))) {\n eligible_validator_indices.add(index);\n }\n }\n\n /* Micro-incentives for matching FFG source, FFG target, and head\n matching_source_attestations = get_matching_source_attestations(state, previous_epoch)\n matching_target_attestations = get_matching_target_attestations(state, previous_epoch)\n matching_head_attestations = get_matching_head_attestations(state, previous_epoch) */\n List<PendingAttestation> matching_source_attestations = get_matching_source_attestations(state, previous_epoch);\n List<PendingAttestation> matching_target_attestations = get_matching_target_attestations(state, previous_epoch);\n List<PendingAttestation> matching_head_attestations = get_matching_head_attestations(state, previous_epoch);\n\n /* for attestations in (matching_source_attestations, matching_target_attestations, matching_head_attestations):\n unslashed_attesting_indices = get_unslashed_attesting_indices(state, attestations)\n attesting_balance = get_attesting_balance(state, attestations)\n for index in eligible_validator_indices:\n if index in unslashed_attesting_indices:\n rewards[index] += get_base_reward(state, index) * attesting_balance // total_balance\n else:\n penalties[index] += get_base_reward(state, index) */\n for (List<PendingAttestation> attestations :\n Arrays.asList(matching_source_attestations, matching_target_attestations, matching_head_attestations)) {\n List<ValidatorIndex> unslashed_attesting_indices = get_unslashed_attesting_indices(state, attestations);\n Gwei attesting_balance = get_attesting_balance(state, attestations);\n for (ValidatorIndex index : eligible_validator_indices) {\n if (unslashed_attesting_indices.contains(index)) {\n rewards[index.getIntValue()] = rewards[index.getIntValue()]\n .plus(get_base_reward(state, index).times(attesting_balance).dividedBy(total_balance));\n } else {\n penalties[index.getIntValue()] = penalties[index.getIntValue()]\n .plus(get_base_reward(state, index));\n }\n }\n }\n\n /* Proposer and inclusion delay micro-rewards\n for index in get_unslashed_attesting_indices(state, matching_source_attestations):\n attestation = min([\n a for a in matching_source_attestations\n if index in get_attesting_indices(state, a.data, a.aggregation_bitfield)\n ], key=lambda a: a.inclusion_delay)\n rewards[attestation.proposer_index] += get_base_reward(state, index) // PROPOSER_REWARD_QUOTIENT\n rewards[index] += get_base_reward(state, index) * MIN_ATTESTATION_INCLUSION_DELAY // attestation.inclusion_delay */\n for (ValidatorIndex index : get_unslashed_attesting_indices(state, matching_source_attestations)) {\n PendingAttestation attestation =\n matching_source_attestations.stream()\n .filter(a -> get_attesting_indices(state, a.getData(), a.getAggregationBitfield()).contains(index))\n .min(Comparator.comparing(PendingAttestation::getInclusionDelay))\n .get();\n rewards[attestation.getProposerIndex().getIntValue()] = rewards[attestation.getProposerIndex().getIntValue()]\n .plus(get_base_reward(state, index).dividedBy(getConstants().getProposerRewardQuotient()));\n rewards[index.getIntValue()] = rewards[index.getIntValue()]\n .plus(get_base_reward(state, index)\n .times(getConstants().getMinAttestationInclusionDelay())\n .dividedBy(attestation.getInclusionDelay()));\n }\n\n /* Inactivity penalty\n finality_delay = previous_epoch - state.finalized_epoch\n if finality_delay > MIN_EPOCHS_TO_INACTIVITY_PENALTY:\n matching_target_attesting_indices = get_unslashed_attesting_indices(state, matching_target_attestations)\n for index in eligible_validator_indices:\n penalties[index] += BASE_REWARDS_PER_EPOCH * get_base_reward(state, index)\n if index not in matching_target_attesting_indices:\n penalties[index] += state.validator_registry[index].effective_balance * finality_delay // INACTIVITY_PENALTY_QUOTIENT */\n EpochNumber finality_delay = previous_epoch.minus(state.getFinalizedEpoch());\n if (finality_delay.greater(getConstants().getMinEpochsToInactivityPenalty())) {\n List<ValidatorIndex> matching_target_attesting_indices = get_unslashed_attesting_indices(state, matching_target_attestations);\n for (ValidatorIndex index : eligible_validator_indices) {\n penalties[index.getIntValue()] = penalties[index.getIntValue()]\n .plus(get_base_reward(state, index).times(getConstants().getBaseRewardsPerEpoch()));\n if (!matching_target_attesting_indices.contains(index)) {\n penalties[index.getIntValue()] = penalties[index.getIntValue()]\n .plus(state.getValidatorRegistry().get(index).getEffectiveBalance()\n .times(finality_delay).dividedBy(getConstants().getInactivityPenaltyQuotient()));\n }\n }\n }\n\n return new Gwei[][] { rewards, penalties };\n }", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "public void computeForecasts (GUICalcProgressBar progress, RJGUIController.XferForecastMod xfer) {\n\n\t\t// Save the catalog parameters\n\n\t\tcat_forecastStartTimeParam = xfer.x_forecastStartTimeParam;\n\t\tcat_forecastEndTimeParam = xfer.x_forecastEndTimeParam;\n\n\t\t// Compute the aftershock forecasts\n\n\t\tseqSpecForecast = makeForecast (progress, cat_forecastStartTimeParam, cur_model, \"Seq. Specific\");\n\t\tgenericForecast = makeForecast (progress, cat_forecastStartTimeParam, genericModel, \"Generic\");\n\t\tbayesianForecast = makeForecast (progress, cat_forecastStartTimeParam, bayesianModel, \"Bayesian\");\n\n\t\t// Remove the model-specific message\n\t\t\n\t\tif (progress != null) {\n\t\t\t//progress.setIndeterminate(true);\n\t\t\t//progress.setProgressMessage(\"Plotting...\");\n\t\t\tprogress.setIndeterminate(true, \"Plotting...\");\n\t\t}\n\n\t\t// Pre-compute elements for expected aftershock MFDs.\n\n\t\tgui_view.precomputeEAMFD (progress, cat_forecastStartTimeParam, cat_forecastEndTimeParam);\n\n\t\treturn;\n\t}", "Solution computeChange(Cash cashAvailable, int changeAmount);", "protected void createMimoentslotconstraintsAnnotations() {\n\t\tString source = \"mimo-ent-slot-constraints\";\n\t\taddAnnotation\n\t\t (getInvoice_InvoiceStatuses(),\n\t\t source,\n\t\t new String[] {\n\t\t\t \"statusDate\", \"*NOW\"\n\t\t });\n\t}", "SpacecraftState propagate(AbsoluteDate target) throws OrekitException;", "@Test\n @Tag(\"bm1000\")\n public void testAFIRO() {\n\n // CPLEX MIN OPTIMAL -464.7531428571429 @ { 8E+1, 25.5, 54.5, 84.80, 18.21428571428572, 0, 0, 0, 0, 0, 0, 0, 18.21428571428572, 0, 19.30714285714286, 5E+2, 475.92, 24.08, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 339.9428571428572, 383.9428571428572, 0, 0 }\n\n // Before shift\n // [80.0, 25.499999999999993, 54.5, 0.0, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 0.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0, 0.0, 0.0, 512.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 556.1746428571429, 0.0, 280.6928571428572, 0.0, 61.78571428571429, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]\n\n // After shift\n // [80.0, 25.499999999999993, 54.5, 84.8, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 500.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0, 0.0, 0.0, 512.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 556.1746428571429, 0.0, 280.6928571428572, 0.0, 61.78571428571429, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]\n // OPTIMAL -819.096 @ { 80.0, 25.499999999999993, 54.5, 84.8, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 500.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0, 0.0, 0.0, 512.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 556.1746428571429, 0.0, 280.6928571428572, 0.0, 61.78571428571429, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }\n\n // Mapped\n // OPTIMAL NaN @ { 80.0, 25.499999999999993, 54.5, 84.8, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 500.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0 }\n\n // Result\n // OPTIMAL -630.6960000000001 @ { 8E+1, 25.49999999999999, 54.5, 84.8, 18.21428571428571, 0, 0, 0, 0, 0, 0, 0, 18.21428571428571, 0, 19.30714285714285, 5E+2, 651.9200000000001, 24.07999999999999, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 465.657142857143, 561.6571428571428, 0, 0 }\n\n // CPLEX MAX OPTIMAL 3438.2920999999997 @ { 54.5, 0, 54.5, 57.77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5E+2, 483.5955, 16.4045, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 345.4253571428571, 0, 0, 389.4253571428571 }\n\n CuteNetlibCase.doTest(\"AFIRO.SIF\", \"-464.7531428571429\", \"3438.2920999999997\", NumberContext.of(7, 4));\n }", "static boolean applyChainOptimized(android.support.constraint.solver.widgets.ConstraintWidgetContainer r39, android.support.constraint.solver.LinearSystem r40, int r41, int r42, android.support.constraint.solver.widgets.ChainHead r43) {\n /*\n r0 = r40\n r1 = r41\n r2 = r43\n android.support.constraint.solver.widgets.ConstraintWidget r3 = r2.mFirst\n android.support.constraint.solver.widgets.ConstraintWidget r4 = r2.mLast\n android.support.constraint.solver.widgets.ConstraintWidget r5 = r2.mFirstVisibleWidget\n android.support.constraint.solver.widgets.ConstraintWidget r6 = r2.mLastVisibleWidget\n android.support.constraint.solver.widgets.ConstraintWidget r7 = r2.mHead\n r8 = r3\n r9 = 0\n r10 = 0\n r11 = 0\n float r12 = r2.mTotalWeight\n android.support.constraint.solver.widgets.ConstraintWidget r13 = r2.mFirstMatchConstraintWidget\n android.support.constraint.solver.widgets.ConstraintWidget r14 = r2.mLastMatchConstraintWidget\n r2 = r39\n r15 = r8\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r8 = r2.mListDimensionBehaviors\n r8 = r8[r1]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r2 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.WRAP_CONTENT\n r16 = 0\n r17 = r9\n if (r8 != r2) goto L_0x002b\n r2 = 1\n goto L_0x002c\n L_0x002b:\n r2 = 0\n L_0x002c:\n r8 = 0\n r18 = 0\n r19 = 0\n if (r1 != 0) goto L_0x0050\n int r9 = r7.mHorizontalChainStyle\n if (r9 != 0) goto L_0x0039\n r9 = 1\n goto L_0x003a\n L_0x0039:\n r9 = 0\n L_0x003a:\n r8 = r9\n int r9 = r7.mHorizontalChainStyle\n r21 = r2\n r2 = 1\n if (r9 != r2) goto L_0x0044\n r2 = 1\n goto L_0x0045\n L_0x0044:\n r2 = 0\n L_0x0045:\n int r9 = r7.mHorizontalChainStyle\n r22 = r2\n r2 = 2\n if (r9 != r2) goto L_0x004e\n r2 = 1\n goto L_0x004f\n L_0x004e:\n r2 = 0\n L_0x004f:\n goto L_0x006e\n L_0x0050:\n r21 = r2\n int r2 = r7.mVerticalChainStyle\n if (r2 != 0) goto L_0x0058\n r2 = 1\n goto L_0x0059\n L_0x0058:\n r2 = 0\n L_0x0059:\n r8 = r2\n int r2 = r7.mVerticalChainStyle\n r9 = 1\n if (r2 != r9) goto L_0x0061\n r2 = 1\n goto L_0x0062\n L_0x0061:\n r2 = 0\n L_0x0062:\n int r9 = r7.mVerticalChainStyle\n r23 = r2\n r2 = 2\n if (r9 != r2) goto L_0x006b\n r2 = 1\n goto L_0x006c\n L_0x006b:\n r2 = 0\n L_0x006c:\n r22 = r23\n L_0x006e:\n r9 = 0\n r18 = 0\n r24 = r7\n r7 = r11\n r11 = r15\n r15 = r9\n r9 = 0\n L_0x0077:\n r19 = 0\n r25 = r13\n r13 = 8\n if (r10 != 0) goto L_0x0143\n r26 = r10\n int r10 = r11.getVisibility()\n if (r10 == r13) goto L_0x00ca\n int r9 = r9 + 1\n if (r1 != 0) goto L_0x0092\n int r10 = r11.getWidth()\n float r10 = (float) r10\n float r15 = r15 + r10\n goto L_0x0098\n L_0x0092:\n int r10 = r11.getHeight()\n float r10 = (float) r10\n float r15 = r15 + r10\n L_0x0098:\n if (r11 == r5) goto L_0x00a4\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n r10 = r10[r42]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r15 = r15 + r10\n L_0x00a4:\n if (r11 == r6) goto L_0x00b2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n int r20 = r42 + 1\n r10 = r10[r20]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r15 = r15 + r10\n L_0x00b2:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n r10 = r10[r42]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r18 = r18 + r10\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n int r20 = r42 + 1\n r10 = r10[r20]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r18 = r18 + r10\n L_0x00ca:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n r10 = r10[r42]\n r27 = r9\n int r9 = r11.getVisibility()\n if (r9 == r13) goto L_0x0106\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r9 = r11.mListDimensionBehaviors\n r9 = r9[r1]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r13 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT\n if (r9 != r13) goto L_0x0106\n int r7 = r7 + 1\n if (r1 != 0) goto L_0x00f0\n int r9 = r11.mMatchConstraintDefaultWidth\n if (r9 == 0) goto L_0x00e7\n return r16\n L_0x00e7:\n int r9 = r11.mMatchConstraintMinWidth\n if (r9 != 0) goto L_0x00ef\n int r9 = r11.mMatchConstraintMaxWidth\n if (r9 == 0) goto L_0x00fe\n L_0x00ef:\n return r16\n L_0x00f0:\n int r9 = r11.mMatchConstraintDefaultHeight\n if (r9 == 0) goto L_0x00f5\n return r16\n L_0x00f5:\n int r9 = r11.mMatchConstraintMinHeight\n if (r9 != 0) goto L_0x0105\n int r9 = r11.mMatchConstraintMaxHeight\n if (r9 == 0) goto L_0x00fe\n goto L_0x0105\n L_0x00fe:\n float r9 = r11.mDimensionRatio\n int r9 = (r9 > r19 ? 1 : (r9 == r19 ? 0 : -1))\n if (r9 == 0) goto L_0x0106\n return r16\n L_0x0105:\n return r16\n L_0x0106:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r11.mListAnchors\n int r13 = r42 + 1\n r9 = r9[r13]\n android.support.constraint.solver.widgets.ConstraintAnchor r9 = r9.mTarget\n if (r9 == 0) goto L_0x012c\n android.support.constraint.solver.widgets.ConstraintWidget r13 = r9.mOwner\n r28 = r7\n android.support.constraint.solver.widgets.ConstraintAnchor[] r7 = r13.mListAnchors\n r7 = r7[r42]\n android.support.constraint.solver.widgets.ConstraintAnchor r7 = r7.mTarget\n if (r7 == 0) goto L_0x012a\n android.support.constraint.solver.widgets.ConstraintAnchor[] r7 = r13.mListAnchors\n r7 = r7[r42]\n android.support.constraint.solver.widgets.ConstraintAnchor r7 = r7.mTarget\n android.support.constraint.solver.widgets.ConstraintWidget r7 = r7.mOwner\n if (r7 == r11) goto L_0x0127\n goto L_0x012a\n L_0x0127:\n r17 = r13\n goto L_0x0131\n L_0x012a:\n r7 = 0\n goto L_0x012f\n L_0x012c:\n r28 = r7\n r7 = 0\n L_0x012f:\n r17 = r7\n L_0x0131:\n if (r17 == 0) goto L_0x0139\n r7 = r17\n r11 = r7\n r10 = r26\n goto L_0x013b\n L_0x0139:\n r7 = 1\n r10 = r7\n L_0x013b:\n r13 = r25\n r9 = r27\n r7 = r28\n goto L_0x0077\n L_0x0143:\n r26 = r10\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r3.mListAnchors\n r10 = r10[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r10 = r10.getResolutionNode()\n android.support.constraint.solver.widgets.ConstraintAnchor[] r13 = r4.mListAnchors\n int r20 = r42 + 1\n r13 = r13[r20]\n android.support.constraint.solver.widgets.ResolutionAnchor r13 = r13.getResolutionNode()\n r29 = r14\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r10.target\n if (r14 == 0) goto L_0x0480\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r13.target\n if (r14 != 0) goto L_0x0170\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r0\n goto L_0x048d\n L_0x0170:\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r10.target\n int r14 = r14.state\n r0 = 1\n if (r14 != r0) goto L_0x0471\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r13.target\n int r14 = r14.state\n if (r14 == r0) goto L_0x018d\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r40\n goto L_0x047f\n L_0x018d:\n if (r7 <= 0) goto L_0x0192\n if (r7 == r9) goto L_0x0192\n return r16\n L_0x0192:\n r0 = 0\n if (r2 != 0) goto L_0x0199\n if (r8 != 0) goto L_0x0199\n if (r22 == 0) goto L_0x01b2\n L_0x0199:\n if (r5 == 0) goto L_0x01a4\n android.support.constraint.solver.widgets.ConstraintAnchor[] r14 = r5.mListAnchors\n r14 = r14[r42]\n int r14 = r14.getMargin()\n float r0 = (float) r14\n L_0x01a4:\n if (r6 == 0) goto L_0x01b2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r14 = r6.mListAnchors\n int r20 = r42 + 1\n r14 = r14[r20]\n int r14 = r14.getMargin()\n float r14 = (float) r14\n float r0 = r0 + r14\n L_0x01b2:\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r10.target\n float r14 = r14.resolvedOffset\n r30 = r2\n android.support.constraint.solver.widgets.ResolutionAnchor r2 = r13.target\n float r2 = r2.resolvedOffset\n r20 = 0\n int r23 = (r14 > r2 ? 1 : (r14 == r2 ? 0 : -1))\n if (r23 >= 0) goto L_0x01c7\n float r23 = r2 - r14\n float r23 = r23 - r15\n goto L_0x01cb\n L_0x01c7:\n float r23 = r14 - r2\n float r23 = r23 - r15\n L_0x01cb:\n r27 = 1\n if (r7 <= 0) goto L_0x02b9\n if (r7 != r9) goto L_0x02b9\n android.support.constraint.solver.widgets.ConstraintWidget r20 = r11.getParent()\n if (r20 == 0) goto L_0x01e8\n r31 = r2\n android.support.constraint.solver.widgets.ConstraintWidget r2 = r11.getParent()\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r2 = r2.mListDimensionBehaviors\n r2 = r2[r1]\n r32 = r6\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r6 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.WRAP_CONTENT\n if (r2 != r6) goto L_0x01ec\n return r16\n L_0x01e8:\n r31 = r2\n r32 = r6\n L_0x01ec:\n float r23 = r23 + r15\n float r23 = r23 - r18\n r2 = r3\n r6 = r2\n r2 = r14\n L_0x01f3:\n if (r6 == 0) goto L_0x02ad\n android.support.constraint.solver.Metrics r11 = android.support.constraint.solver.LinearSystem.sMetrics\n if (r11 == 0) goto L_0x021a\n android.support.constraint.solver.Metrics r11 = android.support.constraint.solver.LinearSystem.sMetrics\n r33 = r8\n r34 = r9\n long r8 = r11.nonresolvedWidgets\n long r8 = r8 - r27\n r11.nonresolvedWidgets = r8\n android.support.constraint.solver.Metrics r8 = android.support.constraint.solver.LinearSystem.sMetrics\n r35 = r13\n r36 = r14\n long r13 = r8.resolvedWidgets\n long r13 = r13 + r27\n r8.resolvedWidgets = r13\n android.support.constraint.solver.Metrics r8 = android.support.constraint.solver.LinearSystem.sMetrics\n long r13 = r8.chainConnectionResolved\n long r13 = r13 + r27\n r8.chainConnectionResolved = r13\n goto L_0x0222\n L_0x021a:\n r33 = r8\n r34 = r9\n r35 = r13\n r36 = r14\n L_0x0222:\n android.support.constraint.solver.widgets.ConstraintWidget[] r8 = r6.mNextChainWidget\n r17 = r8[r1]\n if (r17 != 0) goto L_0x022e\n if (r6 != r4) goto L_0x022b\n goto L_0x022e\n L_0x022b:\n r13 = r40\n goto L_0x02a1\n L_0x022e:\n float r8 = (float) r7\n float r8 = r23 / r8\n int r9 = (r12 > r19 ? 1 : (r12 == r19 ? 0 : -1))\n if (r9 <= 0) goto L_0x0249\n float[] r9 = r6.mWeight\n r9 = r9[r1]\n r11 = -1082130432(0xffffffffbf800000, float:-1.0)\n int r9 = (r9 > r11 ? 1 : (r9 == r11 ? 0 : -1))\n if (r9 != 0) goto L_0x0241\n r8 = 0\n goto L_0x0249\n L_0x0241:\n float[] r9 = r6.mWeight\n r9 = r9[r1]\n float r9 = r9 * r23\n float r8 = r9 / r12\n L_0x0249:\n int r9 = r6.getVisibility()\n r11 = 8\n if (r9 != r11) goto L_0x0252\n r8 = 0\n L_0x0252:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n r9 = r9[r42]\n int r9 = r9.getMargin()\n float r9 = (float) r9\n float r2 = r2 + r9\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n r9 = r9[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r11 = r10.resolvedTarget\n r9.resolve(r11, r2)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n int r11 = r42 + 1\n r9 = r9[r11]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r11 = r10.resolvedTarget\n float r13 = r2 + r8\n r9.resolve(r11, r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n r9 = r9[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n r13 = r40\n r9.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n int r11 = r42 + 1\n r9 = r9[r11]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n r9.addResolvedValue(r13)\n float r2 = r2 + r8\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n int r11 = r42 + 1\n r9 = r9[r11]\n int r9 = r9.getMargin()\n float r9 = (float) r9\n float r2 = r2 + r9\n L_0x02a1:\n r6 = r17\n r8 = r33\n r9 = r34\n r13 = r35\n r14 = r36\n goto L_0x01f3\n L_0x02ad:\n r33 = r8\n r34 = r9\n r35 = r13\n r36 = r14\n r13 = r40\n r8 = 1\n return r8\n L_0x02b9:\n r31 = r2\n r32 = r6\n r33 = r8\n r34 = r9\n r35 = r13\n r36 = r14\n r13 = r40\n int r2 = (r23 > r19 ? 1 : (r23 == r19 ? 0 : -1))\n if (r2 >= 0) goto L_0x02d3\n r8 = 0\n r22 = 0\n r2 = 1\n r30 = r2\n r33 = r8\n L_0x02d3:\n if (r30 == 0) goto L_0x0370\n float r23 = r23 - r0\n r2 = r3\n float r6 = r3.getBiasPercent(r1)\n float r6 = r6 * r23\n float r14 = r36 + r6\n r11 = r2\n r23 = r14\n L_0x02e3:\n if (r11 == 0) goto L_0x036a\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n if (r2 == 0) goto L_0x0301\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r8 = r2.nonresolvedWidgets\n long r8 = r8 - r27\n r2.nonresolvedWidgets = r8\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r8 = r2.resolvedWidgets\n long r8 = r8 + r27\n r2.resolvedWidgets = r8\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r8 = r2.chainConnectionResolved\n long r8 = r8 + r27\n r2.chainConnectionResolved = r8\n L_0x0301:\n android.support.constraint.solver.widgets.ConstraintWidget[] r2 = r11.mNextChainWidget\n r17 = r2[r1]\n if (r17 != 0) goto L_0x0309\n if (r11 != r4) goto L_0x0366\n L_0x0309:\n r2 = 0\n if (r1 != 0) goto L_0x0312\n int r6 = r11.getWidth()\n float r2 = (float) r6\n goto L_0x0317\n L_0x0312:\n int r6 = r11.getHeight()\n float r2 = (float) r6\n L_0x0317:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r6 = r11.mListAnchors\n r6 = r6[r42]\n int r6 = r6.getMargin()\n float r6 = (float) r6\n float r6 = r23 + r6\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n r8.resolve(r9, r6)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n float r14 = r6 + r2\n r8.resolve(r9, r14)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n float r6 = r6 + r2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n int r8 = r8.getMargin()\n float r8 = (float) r8\n float r23 = r6 + r8\n L_0x0366:\n r11 = r17\n goto L_0x02e3\n L_0x036a:\n r37 = r7\n r38 = r34\n goto L_0x046f\n L_0x0370:\n if (r33 != 0) goto L_0x0374\n if (r22 == 0) goto L_0x036a\n L_0x0374:\n if (r33 == 0) goto L_0x0379\n float r23 = r23 - r0\n goto L_0x037d\n L_0x0379:\n if (r22 == 0) goto L_0x037d\n float r23 = r23 - r0\n L_0x037d:\n r2 = r3\n int r9 = r34 + 1\n float r6 = (float) r9\n float r6 = r23 / r6\n if (r22 == 0) goto L_0x0395\n r8 = r34\n r9 = 1\n if (r8 <= r9) goto L_0x0390\n int r9 = r8 + -1\n float r9 = (float) r9\n float r6 = r23 / r9\n goto L_0x0397\n L_0x0390:\n r9 = 1073741824(0x40000000, float:2.0)\n float r6 = r23 / r9\n goto L_0x0397\n L_0x0395:\n r8 = r34\n L_0x0397:\n r9 = r36\n int r11 = r3.getVisibility()\n r14 = 8\n if (r11 == r14) goto L_0x03a2\n float r9 = r9 + r6\n L_0x03a2:\n if (r22 == 0) goto L_0x03b2\n r11 = 1\n if (r8 <= r11) goto L_0x03b2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r11 = r5.mListAnchors\n r11 = r11[r42]\n int r11 = r11.getMargin()\n float r11 = (float) r11\n float r9 = r36 + r11\n L_0x03b2:\n if (r33 == 0) goto L_0x03c0\n if (r5 == 0) goto L_0x03c0\n android.support.constraint.solver.widgets.ConstraintAnchor[] r11 = r5.mListAnchors\n r11 = r11[r42]\n int r11 = r11.getMargin()\n float r11 = (float) r11\n float r9 = r9 + r11\n L_0x03c0:\n r11 = r2\n r23 = r9\n L_0x03c3:\n if (r11 == 0) goto L_0x046b\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n if (r2 == 0) goto L_0x03e6\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n r37 = r7\n r38 = r8\n long r7 = r2.nonresolvedWidgets\n long r7 = r7 - r27\n r2.nonresolvedWidgets = r7\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r7 = r2.resolvedWidgets\n long r7 = r7 + r27\n r2.resolvedWidgets = r7\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r7 = r2.chainConnectionResolved\n long r7 = r7 + r27\n r2.chainConnectionResolved = r7\n goto L_0x03ea\n L_0x03e6:\n r37 = r7\n r38 = r8\n L_0x03ea:\n android.support.constraint.solver.widgets.ConstraintWidget[] r2 = r11.mNextChainWidget\n r17 = r2[r1]\n if (r17 != 0) goto L_0x03f6\n if (r11 != r4) goto L_0x03f3\n goto L_0x03f6\n L_0x03f3:\n r8 = 8\n goto L_0x0463\n L_0x03f6:\n r2 = 0\n if (r1 != 0) goto L_0x03ff\n int r7 = r11.getWidth()\n float r2 = (float) r7\n goto L_0x0404\n L_0x03ff:\n int r7 = r11.getHeight()\n float r2 = (float) r7\n L_0x0404:\n if (r11 == r5) goto L_0x0411\n android.support.constraint.solver.widgets.ConstraintAnchor[] r7 = r11.mListAnchors\n r7 = r7[r42]\n int r7 = r7.getMargin()\n float r7 = (float) r7\n float r23 = r23 + r7\n L_0x0411:\n r7 = r23\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n r8.resolve(r9, r7)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n float r14 = r7 + r2\n r8.resolve(r9, r14)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n int r8 = r8.getMargin()\n float r8 = (float) r8\n float r8 = r8 + r2\n float r23 = r7 + r8\n if (r17 == 0) goto L_0x03f3\n int r7 = r17.getVisibility()\n r8 = 8\n if (r7 == r8) goto L_0x0463\n float r23 = r23 + r6\n L_0x0463:\n r11 = r17\n r7 = r37\n r8 = r38\n goto L_0x03c3\n L_0x046b:\n r37 = r7\n r38 = r8\n L_0x046f:\n r2 = 1\n return r2\n L_0x0471:\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r40\n L_0x047f:\n return r16\n L_0x0480:\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r0\n L_0x048d:\n return r16\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.constraint.solver.widgets.Optimizer.applyChainOptimized(android.support.constraint.solver.widgets.ConstraintWidgetContainer, android.support.constraint.solver.LinearSystem, int, int, android.support.constraint.solver.widgets.ChainHead):boolean\");\n }", "public void FVA( ArrayList< Double > objCoefs, Double objVal, ArrayList< Double > fbasoln, ArrayList< Double > min, ArrayList< Double > max, SolverComponent component ) throws Exception;", "private double calculateWeightFromCumulativeLosses(double accumulatedLosses, double numTrains) {\r\n\t\t\r\n\t\tdouble n=Math.sqrt(8*Math.log(2)/numTrains);\r\n\t\t//double n=0.5;\r\n\t\treturn Math.exp(-1*n*accumulatedLosses);\r\n\t}", "public ConstraintChecker(\n\t\t\tArrayList<TimeSlot> cSlots, \n\t\t\tArrayList<TimeSlot> lSlots, \n\t\t\tArrayList<Pair<Course, Course>> notCompat,\n\t\t\tArrayList<Pair<Course, TimeSlot>> unWant,\n\t\t\tArrayList<Pair<Course, TimeSlot>> parts,\n\t\t\tArrayList<Triple<TimeSlot, Course, Integer>> pref,\n\t\t\tArrayList<Pair<Course, Course>> pair)\n\t\n\t{\n\t\tcourseSlots = cSlots;\n\t\tlabSlots = lSlots;\n\t\tnotCompatible = notCompat;\n\t\tunwanted = unWant;\n\t\tpartials = parts;\n\t\tpreferences = pref;\n\t\tpairs = pair;\n\t}", "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\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\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "private MaintenanceRequest initializeCostAvoidanceIndicators(MaintenanceRequest maintenanceRequest){\n\t\tmaintenanceRequest.setGoodwillIndicator(hasGoodwill(maintenanceRequest));\n\t\t\n\t\tif(!MALUtilities.isEmpty(maintenanceRequest.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask task : maintenanceRequest.getMaintenanceRequestTasks()){\n\t\t\t\ttask = initializeCostAvoidanceIndicators(task);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn maintenanceRequest;\n\t}", "private void testAndUpdateControlFields(int startFieldNr) {\n\t\t\n\t\tboolean consistent = true;\n\t\t\n\t\t//test and correct y\n\t\tfor (int i = 0; i < _controlPoints.length; i++) {\n\t\t\tif (parseTextFieldValue(_controlPoints[i][1]) == -1.0f) {\n\t\t\t\tconsistent = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//test and correct x at startFieldNr and above\n\t\tfor (int i = startFieldNr; i >= 0; i--) {\n\t\t\tfloat value1 = parseTextFieldValue(_controlPoints[i][0]);\n\t\t\tif (value1 == -1.0f) {\n\t\t\t\t//check field value\n\t\t\t\tconsistent = false;\n\t\t\t} else {\n\t\t\t\t//field value ok check if it is greater than the field above\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tfloat value2 = parseTextFieldValue(_controlPoints[i-1][0]);\n\t\t\t\t\tif (value2 > value1) {\n\t\t\t\t\t\t//value 2 has to be <= value1 change it\n\t\t\t\t\t\t_controlPoints[i-1][0].setText(String.valueOf(value1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t//test and correct x at startFieldNr and below\n\t\tfor (int i = startFieldNr; i < _controlPoints.length; i++) {\n\t\t\tfloat value1 = parseTextFieldValue(_controlPoints[i][0]);\n\t\t\tif (value1 == -1.0f) {\n\t\t\t\t//check field value\n\t\t\t\tconsistent = false;\n\t\t\t} else {\n\t\t\t\t//field value ok check if it is smaller than the field below\n\t\t\t\tif (i < (_controlPoints.length-1)) {\n\t\t\t\t\tfloat value2 = parseTextFieldValue(_controlPoints[i+1][0]);\n\t\t\t\t\tif (value2 < value1) {\n\t\t\t\t\t\t//value 2 has to be >= value1 change it\n\t\t\t\t\t\t_controlPoints[i+1][0].setText(String.valueOf(value1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t_isConsistent = consistent;\n\t\t_changeListener.pointsChanged(consistent);\n\t}", "@Test\n public void presentValueCurveSensitivity() {\n final MultipleCurrencyParameterSensitivity pvpsDepositExact = PSC.calculateSensitivity(CPN_ON_COMPOUNDED, MULTICURVES,\n MULTICURVES.getAllNames());\n final MultipleCurrencyParameterSensitivity pvpsDepositFD = PSC_DSC_FD.calculateSensitivity(CPN_ON_COMPOUNDED, MULTICURVES);\n AssertSensitivityObjects.assertEquals(\"CouponONCompoundedDiscountingMethod: presentValueCurveSensitivity \", pvpsDepositExact,\n pvpsDepositFD, TOLERANCE_PV_DELTA);\n }", "private final void silk_PLC_update(final Jsilk_decoder_control psDecCtrl)\r\n\t{\r\n\t\tfinal Jsilk_PLC_struct psPLC = this.sPLC;\r\n\r\n\t\t/* Update parameters used in case of packet loss */\r\n\t\tthis.prevSignalType = this.indices.signalType;\r\n\t\tint LTP_Gain_Q14 = 0;\r\n\t\tfinal int nb_subfr1 = this.nb_subfr - 1;// java\r\n\t\tif( this.indices.signalType == Jdefine.TYPE_VOICED ) {\r\n\t\t\t/* Find the parameters for the last subframe which contains a pitch pulse */\r\n\t\t\tfor( int j = 0, je = psDecCtrl.pitchL[ nb_subfr1 ], nb_j = nb_subfr1; j * this.subfr_length < je; j++, nb_j-- ) {\r\n\t\t\t\tif( j == this.nb_subfr ) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tint temp_LTP_Gain_Q14 = 0;\r\n\t\t\t\tfinal int nb_j_o = nb_j * Jdefine.LTP_ORDER;// java\r\n\t\t\t\tint i = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\ttemp_LTP_Gain_Q14 += psDecCtrl.LTPCoef_Q14[ nb_j_o + i ];\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t\tif( temp_LTP_Gain_Q14 > LTP_Gain_Q14 ) {\r\n\t\t\t\t\tLTP_Gain_Q14 = temp_LTP_Gain_Q14;\r\n\t\t\t\t\tSystem.arraycopy( psDecCtrl.LTPCoef_Q14, nb_j_o, psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER );\r\n\r\n\t\t\t\t\tpsPLC.pitchL_Q8 = psDecCtrl.pitchL[ nb_j ] << 8;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// silk_memset( psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER * sizeof( opus_int16 ) );\r\n\t\t\tint i = 0;\r\n\t\t\tdo {\r\n\t\t\t\tpsPLC.LTPCoef_Q14[i] = 0;\r\n\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\tpsPLC.LTPCoef_Q14[ Jdefine.LTP_ORDER / 2 ] = (short)LTP_Gain_Q14;\r\n\r\n\t\t\t/* Limit LT coefs */\r\n\t\t\tif( LTP_Gain_Q14 < V_PITCH_GAIN_START_MIN_Q14 ) {\r\n\t\t\t\tfinal int tmp = V_PITCH_GAIN_START_MIN_Q14 << 10;\r\n\t\t\t\tfinal int scale_Q10 = ( tmp / ( LTP_Gain_Q14 > 1 ? LTP_Gain_Q14 : 1 ) );\r\n\t\t\t\ti = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tpsPLC.LTPCoef_Q14[ i ] = (short)(((int)psPLC.LTPCoef_Q14[ i ] * scale_Q10) >> 10);\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t} else if( LTP_Gain_Q14 > V_PITCH_GAIN_START_MAX_Q14 ) {\r\n\t\t\t\tfinal int tmp = V_PITCH_GAIN_START_MAX_Q14 << 14;\r\n\t\t\t\tfinal int scale_Q14 = ( tmp / ( LTP_Gain_Q14 > 1 ? LTP_Gain_Q14 : 1 ) );\r\n\t\t\t\ti = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t\tpsPLC.LTPCoef_Q14[ i ] = (short)(( (int)psPLC.LTPCoef_Q14[ i ] * scale_Q14 ) >> 14);\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tpsPLC.pitchL_Q8 = ( this.fs_kHz * 18 ) << 8;\r\n\t\t\t// silk_memset( psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER * sizeof( opus_int16 ));\r\n\t\t\tint i = 0;\r\n\t\t\tdo {\r\n\t\t\t\tpsPLC.LTPCoef_Q14[i] = 0;\r\n\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t}\r\n\r\n\t\t/* Save LPC coeficients */\r\n\t\tSystem.arraycopy( psDecCtrl.PredCoef_Q12[ 1 ], 0, psPLC.prevLPC_Q12, 0, this.LPC_order );\r\n\t\tpsPLC.prevLTP_scale_Q14 = (short)psDecCtrl.LTP_scale_Q14;\r\n\r\n\t\t/* Save last two gains */\r\n\t\tpsPLC.prevGain_Q16[0] = psDecCtrl.Gains_Q16[ nb_subfr1 - 1 ];\r\n\t\tpsPLC.prevGain_Q16[1] = psDecCtrl.Gains_Q16[ nb_subfr1 ];\r\n\r\n\t\tpsPLC.subfr_length = this.subfr_length;\r\n\t\tpsPLC.nb_subfr = this.nb_subfr;\r\n\t}", "protected abstract List<ConfusionMatrix> calcConfusions();", "@Override\n\tpublic void makeDecision() {\n\t\tDouble weightedFrontProximity;\n\t\tif (algorithmData.receiveMessageData != null && algorithmData.previousDistance != null) {\n\t\t\tdouble delay = (Time.getTime() - algorithmData.receiveMessageData.getStartTime()) / 100000000;\n\t\t\t//calculate the distance us and our predecessor have travelled since message received\n\t\t\talgorithmData.predictedPredecessorMovement = algorithmData.predecessorSpeed * delay\n\t\t\t\t\t+ 0.5 * algorithmData.predecessorAcceleration * delay * delay;\n\t\t\talgorithmData.predictedMovement = algorithmData.previousSpeed * delay\n\t\t\t\t\t+ 0.5 * algorithmData.previousAcceleration * delay * delay;\n\t\t\talgorithmData.predictedFrontProximity = algorithmData.predictedPredecessorMovement\n\t\t\t\t\t- algorithmData.predictedMovement + algorithmData.previousDistance;\n\n\t\t\talgorithmData.chosenSpeed = algorithmData.predecessorChosenSpeed;\n\t\t\talgorithmData.chosenTurnRate = algorithmData.predecessorTurnRate;\n\t\t} else {\n\t\t\t//no message received or no previous distance\n\t\t\talgorithmData.predictedFrontProximity = null;\n\t\t\talgorithmData.chosenSpeed = algorithmData.speed;\n\t\t\talgorithmData.chosenTurnRate = algorithmData.turnRate;\n\t\t}\n\t\tif (algorithmData.frontProximity != null && algorithmData.frontProximity > maxSensorDist) {\n\t\t\talgorithmData.frontProximity = null;\n\t\t}\n\t\tweightedFrontProximity = weightFrontProximity(algorithmData.predictedFrontProximity,\n\t\t\t\talgorithmData.frontProximity);\n\n\t\t// update previous state variables so that they are correct in next time period\n\t\talgorithmData.previousDistance = weightedFrontProximity;\n\t\talgorithmData.previousSpeed = algorithmData.speed;\n\t\talgorithmData.previousAcceleration = algorithmData.acceleration;\n\n\t\tif (weightedFrontProximity != null) {\n\t\t\tif (weightedFrontProximity < buffDist) {\n\t\t\t\tif (algorithmData.chosenAcceleration >= 0) {\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration * weightedFrontProximity / buffDist;\n\t\t\t\t} else {\n\t\t\t\t\t// if braking then divide by value so deceleration decreases if gap too small\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration / (weightedFrontProximity / buffDist);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (algorithmData.chosenAcceleration >= 0) {\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration\n\t\t\t\t\t\t\t* (0.75 + weightedFrontProximity / (4* buffDist));\n\t\t\t\t} else {\n\t\t\t\t\t// if braking then divide by value so deceleration decreases if gap too small\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration\n\t\t\t\t\t\t\t/ (0.75 + weightedFrontProximity / (4* buffDist));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t//no messages received and proximity sensor not working\n\t\t\talgorithmData.chosenAcceleration = 0;\n\t\t}\n\n\n\t}", "public InterestRateCurveSensitivity presentValueCurveSensitivity(final CouponIborCompounding coupon, final YieldCurveBundle curves) {\n Validate.notNull(coupon, \"Coupon\");\n Validate.notNull(curves, \"Curves\");\n final YieldAndDiscountCurve forwardCurve = curves.getCurve(coupon.getForwardCurveName());\n final YieldAndDiscountCurve discountingCurve = curves.getCurve(coupon.getFundingCurveName());\n final int nbSubPeriod = coupon.getFixingTimes().length;\n double notionalAccrued = coupon.getNotionalAccrued();\n final double[] ratioForward = new double[nbSubPeriod];\n final double[] dfStart = new double[nbSubPeriod];\n final double[] dfEnd = new double[nbSubPeriod];\n for (int loopsub = 0; loopsub < nbSubPeriod; loopsub++) {\n dfStart[loopsub] = forwardCurve.getDiscountFactor(coupon.getFixingPeriodStartTimes()[loopsub]);\n dfEnd[loopsub] = forwardCurve.getDiscountFactor(coupon.getFixingPeriodEndTimes()[loopsub]);\n ratioForward[loopsub] = dfStart[loopsub] / dfEnd[loopsub];\n notionalAccrued *= ratioForward[loopsub];\n }\n final double dfPayment = discountingCurve.getDiscountFactor(coupon.getPaymentTime());\n // Backward sweep\n final double pvBar = 1.0;\n final double dfPaymentBar = (notionalAccrued - coupon.getNotional()) * pvBar;\n final double notionalAccruedBar = dfPayment * pvBar;\n final double[] ratioForwardBar = new double[nbSubPeriod];\n final double[] dfStartBar = new double[nbSubPeriod];\n final double[] dfEndBar = new double[nbSubPeriod];\n for (int loopsub = 0; loopsub < nbSubPeriod; loopsub++) {\n ratioForwardBar[loopsub] = notionalAccrued / ratioForward[loopsub] * notionalAccruedBar;\n dfEndBar[loopsub] = -dfStart[loopsub] / (dfEnd[loopsub] * dfEnd[loopsub]) * ratioForwardBar[loopsub];\n dfStartBar[loopsub] = ratioForwardBar[loopsub] / dfEnd[loopsub];\n }\n InterestRateCurveSensitivity result = new InterestRateCurveSensitivity();\n final List<DoublesPair> listDiscounting = new ArrayList<>();\n listDiscounting.add(DoublesPair.of(coupon.getPaymentTime(), -coupon.getPaymentTime() * dfPayment * dfPaymentBar));\n result = result.plus(coupon.getFundingCurveName(), listDiscounting);\n final List<DoublesPair> listForward = new ArrayList<>();\n for (int loopsub = 0; loopsub < nbSubPeriod; loopsub++) {\n listForward.add(DoublesPair.of(coupon.getFixingPeriodStartTimes()[loopsub], -coupon.getFixingPeriodStartTimes()[loopsub] * dfStart[loopsub] * dfStartBar[loopsub]));\n listForward.add(DoublesPair.of(coupon.getFixingPeriodEndTimes()[loopsub], -coupon.getFixingPeriodEndTimes()[loopsub] * dfEnd[loopsub] * dfEndBar[loopsub]));\n }\n result = result.plus(coupon.getForwardCurveName(), listForward);\n return result;\n }", "private void calculateDepreciationAndCurrentValue(List<DepreciationInputs> depreciationInputsList,\n\t\t\tList<DepreciationDetail> depDetList, List<CurrentValue> currValList, Long fromDate, Long toDate) {\n\n\t\tdepreciationInputsList.forEach(a -> {\n\t\t\t// getting the amt to be depreciated\n\t\t\tBigDecimal amtToBeDepreciated = getAmountToBeDepreciated(a, fromDate, toDate);\n\n\t\t\t// calculating the valueAfterDepreciation\n\t\t\tBigDecimal valueAfterDep = a.getCurrentValue().subtract(amtToBeDepreciated);\n\n\t\t\t// adding the depreciation detail object to list\n\t\t\tdepDetList.add(DepreciationDetail.builder().assetId(a.getAssetId())\n\t\t\t\t\t.depreciationRate(a.getDepreciationRate()).depreciationValue(amtToBeDepreciated)\n\t\t\t\t\t.valueAfterDepreciation(valueAfterDep).valueBeforeDepreciation(a.getCurrentValue()).build());\n\n\t\t\t// adding currval to the currval list\n\t\t\tcurrValList.add(CurrentValue.builder().assetId(a.getAssetId()).assetTranType(TransactionType.DEPRECIATION)\n\t\t\t\t\t.currentAmount(valueAfterDep).transactionDate(toDate).tenantId(a.getTenantId()).build());\n\t\t});\n\t}", "@Test\n\tpublic void test() {\n\t\tRandomVariableDefinition RV_DEF_X = new RandomVariableDefinition(\"DEF_X\", Arrays.asList(\"x0\", \"x1\", \"x2\"));\n\t\tRandomVariableDefinition RV_DEF_Y = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"y0\", \"y1\"));\n\t\tRandomVariableDefinition RV_DEF_Z = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"z0\", \"z1\"));\n\n\t\t///////////////////////////////////\n\t\t// define the local probability models\n\t\tLocalProbabilityModel X = new LocalProbabilityModel(\"X\");\n\t\tLocalProbabilityModel Y = new LocalProbabilityModel(\"Y\");\n\t\tLocalProbabilityModel Z = new LocalProbabilityModel(\"Z\");\n\t\tLocalProbabilityModel X1 = new LocalProbabilityModel(\"X1\");\n\t\tLocalProbabilityModel X2 = new LocalProbabilityModel(\"X2\");\n\t\tLocalProbabilityModel X3 = new LocalProbabilityModel(\"X3\");\n\t\tLocalProbabilityModel X7 = new LocalProbabilityModel(\"X7\");\n\t\t\n\t\t////////////////////////////////\n\t\t// specify target variable type, and dependencies\n\t\t\n\t\t// two a-priori variables - target only, no dependencies\n\t\tX.setTargetAndDependencies(RV_DEF_X, null);\n\t\tY.setTargetAndDependencies(RV_DEF_Y, null);\n\t\t\n\t\t// a LPM conditionally dependent on two variables\n\t\tZ.setTargetAndDependencies(RV_DEF_Z, Arrays.asList(X, Y));\n\n\t\t// a LPM conditionally dependent on several variables of the same type\n\t\tX3.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X1, X2));\n\n\t\t// a LPM conditionally dependent on itself (i.e. a state variable)\n\t\tX7.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X7));\n\n\t\n\t\t// the first has no dependencies just values\n\t\tX.setValue(\"x0\", 0.6);\n\t\tX.setValue(\"x1\", 0.1);\n\t\tX.setValue(\"x2\", 0.1);\n\n\t\t// the second has dependencies\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\n\t\t// the third has a recurrent dependency\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\t\n\t\t\n\t\t\n\t\t/* NOTE - should we enforce that a conditional probability should always be 'set' with requirement that the conditioning variables should all be identified ? */\n\t\t// this would be Z.setValue(\n\t//\tZ.setValue(Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")),\n\t//\t\t\tArrays.asList(\n\t//\t\t\t\t\t\"z0\", 0.5,\n\t//\t\t\t\t\t\"z1\", 0.3,\n\t//\t\t\t\t\t\"z2\", 0.7));\n\n\n\n\t\tString s = Z.toString();\n\t\tSystem.out.println(\"==============\\n\" + s);\n\n\t\tSystem.out.println(\"done\");\n\n\n\t}", "@Value.Check\n default void checkPreconditions()\n {\n RangeCheck.checkIncludedInInteger(\n this.feedback(),\n \"Feedback\",\n RangeInclusiveI.of(0, 7),\n \"Valid feedback values\");\n\n RangeCheck.checkIncludedInInteger(\n this.transpose(),\n \"Transpose\",\n RangeInclusiveI.of(-24, 24),\n \"Valid transpose values\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Level(),\n \"Pitch R1 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Rate(),\n \"Pitch R1 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Level(),\n \"Pitch R2 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Rate(),\n \"Pitch R2 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Level(),\n \"Pitch R3 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Rate(),\n \"Pitch R3 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Level(),\n \"Pitch R4 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Rate(),\n \"Pitch R4 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationDepth(),\n \"LFO Pitch Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid pitch modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationSensitivity(),\n \"LFO Pitch Modulation Sensitivity\",\n RangeInclusiveI.of(0, 7),\n \"Valid pitch modulation sensitivity values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoAmplitudeModulationDepth(),\n \"LFO Amplitude Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid amplitude modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoSpeed(),\n \"LFO Speed\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO speed values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoDelay(),\n \"LFO Delay\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO delay values\");\n }", "public abstract double getConstraintFitness();", "private NbaRequirementResponseVO processRequirements(NbaRequirementRequestVO reqRequestVO) throws NbaBaseException {\n NbaRequirementResponseVO reqRespVO = new NbaRequirementResponseVO();\n String partyID = null;\n long personCode;\n long personSeq;\n List insuredRelations = reqRequestVO.getRelationsToUpdate();\n int count = insuredRelations.size(); \n NbaTXLife nbaTXLife = reqRequestVO.getNbaTXLife();\n NbaDst nbaDst = reqRequestVO.getNbaDst();\n reqRespVO.setReqMap(new HashMap(count));\n setPartyMapForLastReqIndicator(reqRequestVO);//NBLXA186-NBLXA1271\n for (int i = 0; i < count; i++) {\n Relation relation = (Relation) insuredRelations.get(i);\n partyID = relation.getRelatedObjectID();\n personCode = relation.getRelationRoleCode();\n personSeq = Long.parseLong(relation.getRelatedRefID());\n List requirements = (List) reqRequestVO.getReqMap().get(partyID);\n if (requirements != null) {\n commitRequirements(reqRequestVO, requirements, partyID, personCode, personSeq, nbaTXLife, nbaDst);\n //TODO passing map back to see if we can make commit/retrieve more efficient\n reqRespVO.getReqMap().put(partyID, requirements);\n }\n }\n reqRespVO.setNbaTXLife(nbaTXLife);\n reqRespVO.setNbaDst(nbaDst);\n return reqRespVO;\n \n }", "List<CitationConferenceModel> returnImpactFactorByHec();", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "static void CALC_FCSLOT(OPL_CH CH, OPL_SLOT SLOT) {\n int ksr;\n\n /* frequency step counter */\n /*RECHECK*/\n SLOT.Incr = ((CH.fc * SLOT.mul) & 0xFFFFFFFFL);\n ksr = CH.kcode >> SLOT.KSR;\n\n if (SLOT.ksr != (ksr & 0xFF)) {\n /*RECHECK*/\n SLOT.ksr = ksr & 0xFF;\n /* attack , decay rate recalcration */\n SLOT.evsa = SLOT.AR.read(ksr);\n SLOT.evsd = SLOT.DR.read(ksr);\n SLOT.evsr = SLOT.RR.read(ksr);\n }\n SLOT.TLL = (int) (SLOT.TL + (CH.ksl_base >> SLOT.ksl));\n }", "protected <E> List<E> LeastConstrainingValue(CSP<E> csp, String var){\r\n\t\tList<String> neighbores = new ArrayList<String>();\r\n\t\tfor(Constraint i:csp.constraints) {\r\n\t\t\tList<String> constraint = i.getScope();\r\n\t\t\tfor(String j:constraint){\r\n\t\t\t\tif(j.equals(var)) {\r\n\t\t\t\t\tneighbores.addAll(constraint);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tHashMap<E, Integer> affected = new HashMap<E, Integer>();\r\n\t\tfor(int value=0; value<csp.domains.get(var).size();value++) {\r\n\t\t\tint sum=0;\r\n\t\t\tfor(String i:neighbores){\r\n\t\t\t\tif(!i.equals(var)){\r\n\t\t\t\t\tList<E> domain=csp.domains.get(i);\r\n\t\t\t\t\tfor(E j:domain){\r\n\t\t\t\t\t\tif(j.equals(value)){\r\n\t\t\t\t\t\t\tsum++;\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\taffected.put(csp.domains.get(var).get(value),sum);\r\n\t\t}\r\n\t\tList<E> values = new ArrayList<E>();\r\n\t\tEntry<E, Integer> pos = null;\r\n\t\twhile(values.size()<affected.size()){\r\n\t\t\tint min=1000;\r\n\t\t\tfor (Entry<E, Integer> i:affected.entrySet()) {\r\n\t\t\t\tif(i.getValue()<min) {\r\n\t\t\t\t\tmin=i.getValue();\r\n\t\t\t\t\tpos=i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvalues.add(pos.getKey());\r\n\t\t\taffected.put(pos.getKey(),1000);\r\n\t\t}\r\n\t\t\r\n\t\treturn values;\r\n\t}", "private double calcuFcost() {\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('t');\n\t}", "public double calculateCriticalValue(Dot previous, Dot next){\n double d12 = Math.sqrt(Math.pow(this.x - previous.x, 2) + Math.pow(this.y - previous.y, 2));\n double d23 = Math.sqrt(Math.pow(next.x - this.x, 2) + Math.pow(next.y - this.y, 2));\n double d13 = Math.sqrt(Math.pow(next.x - previous.x, 2) + Math.pow(next.y - previous.y, 2));\n\n criticalValue = d12 + d23 - d13;\n return criticalValue;\n }", "private double calcuCMetric() {\n\t\treturn (p-1)/fcost;\n\t}", "@Override\n\tpublic double calcDifferential(ConfIndex confIndex, RCs rcs, int nextPos, int nextRc) {\n\t\tif (cachedNode != confIndex.getNode()) {\n\t\t\tcalcCachedEnergies(confIndex, rcs);\n\t\t\tcachedNode = confIndex.getNode();\n\t\t}\n\t\t\n \t// compute the h-score\n \tdouble hscore = 0;\n \tfor (int i=0; i<confIndex.getNumUndefined(); i++) {\n \t\tint pos = confIndex.getUndefinedPos()[i];\n \t\t\n \t\t// don't score at nextPos, it's defined now\n \t\tif (pos == nextPos) {\n \t\t\tcontinue;\n \t\t}\n \t\t\n \t\t// compute the new min energy over all rcs\n \t\tdouble minRCEnergy = Double.POSITIVE_INFINITY;\n \t\t\n \t\tdouble[] cachedEnergiesAtPos = cachedEnergies[pos];\n \t\tdouble[][] undefinedEnergiesAtPos = undefinedEnergies[pos];\n \t\t\n\t\t\t// for each rc at this pos...\n\t\t\tint[] rcsAtPos = rcs.get(pos);\n\t\t\tint n = rcsAtPos.length;\n\t\t\tfor (int j=0; j<n; j++) {\n\t\t\t\tint rc = rcsAtPos[j];\n\t\t\t\t\n\t\t\t\tdouble rcEnergy = cachedEnergiesAtPos[j];\n\t\t\t\t\n\t\t\t\t// subtract undefined contribution\n\t\t\t\tif (pos > nextPos) {\n\t\t\t\t\trcEnergy -= undefinedEnergiesAtPos[j][nextPos];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// add defined contribution\n\t\t\t\trcEnergy += emat.getPairwise(pos, rc, nextPos, nextRc);\n\t\t\t\t\n\t\t\t\tminRCEnergy = Math.min(minRCEnergy, rcEnergy);\n\t\t\t}\n\t\t\t\n\t\t\thscore += minRCEnergy;\n \t}\n \t\n \treturn hscore;\n\t}", "private final void silk_decode_parameters(final Jsilk_decoder_control psDecCtrl, final int condCoding)\r\n\t{\r\n\t\tfinal short pNLSF_Q15[] = new short[ Jdefine.MAX_LPC_ORDER ];\r\n\t\tfinal short pNLSF0_Q15[] = new short[ Jdefine.MAX_LPC_ORDER ];\r\n\r\n\t\t/* Dequant Gains */\r\n\t\tthis.LastGainIndex = silk_gains_dequant( psDecCtrl.Gains_Q16, this.indices.GainsIndices,\r\n\t\t\t\t\t\t\t\tthis.LastGainIndex, condCoding == Jdefine.CODE_CONDITIONALLY, this.nb_subfr );\r\n\r\n\t\t/****************/\r\n\t\t/* Decode NLSFs */\r\n\t\t/****************/\r\n\t\tsilk_NLSF_decode( pNLSF_Q15, this.indices.NLSFIndices, this.psNLSF_CB );\r\n\r\n\t\t/* Convert NLSF parameters to AR prediction filter coefficients */\r\n\t\tsilk_NLSF2A( psDecCtrl.PredCoef_Q12[ 1 ], pNLSF_Q15, this.LPC_order );// this.arch );\r\n\r\n\t\t/* If just reset, e.g., because internal Fs changed, do not allow interpolation */\r\n\t\t/* improves the case of packet loss in the first frame after a switch */\r\n\t\tif( this.first_frame_after_reset ) {\r\n\t\t\tthis.indices.NLSFInterpCoef_Q2 = 4;\r\n\t\t}\r\n\r\n\t\tint k = (int)this.indices.NLSFInterpCoef_Q2;// java\r\n\t\tif( k < 4 ) {\r\n\t\t\t/* Calculation of the interpolated NLSF0 vector from the interpolation factor, */\r\n\t\t\t/* the previous NLSF1, and the current NLSF1 */\r\n\t\t\tfinal short[] buff = this.prevNLSF_Q15;// java\r\n\t\t\tfor( int i = 0; i < this.LPC_order; i++ ) {\r\n\t\t\t\tfinal int v = buff[ i ];// java\r\n\t\t\t\tpNLSF0_Q15[ i ] = (short)(v + ((k * ((int)pNLSF_Q15[ i ] - v)) >> 2));\r\n\t\t\t}\r\n\r\n\t\t\t/* Convert NLSF parameters to AR prediction filter coefficients */\r\n\t\t\tsilk_NLSF2A( psDecCtrl.PredCoef_Q12[ 0 ], pNLSF0_Q15, this.LPC_order );// this.arch );\r\n\t\t} else {\r\n\t\t\t/* Copy LPC coefficients for first half from second half */\r\n\t\t\tSystem.arraycopy( psDecCtrl.PredCoef_Q12[ 1 ], 0, psDecCtrl.PredCoef_Q12[ 0 ], 0, this.LPC_order );\r\n\t\t}\r\n\r\n\t\tSystem.arraycopy( pNLSF_Q15, 0, this.prevNLSF_Q15, 0, this.LPC_order );\r\n\r\n\t\t/* After a packet loss do BWE of LPC coefs */\r\n\t\tif( 0 != this.lossCnt ) {\r\n\t\t\tsilk_bwexpander( psDecCtrl.PredCoef_Q12[ 0 ], this.LPC_order, Jdefine.BWE_AFTER_LOSS_Q16 );\r\n\t\t\tsilk_bwexpander( psDecCtrl.PredCoef_Q12[ 1 ], this.LPC_order, Jdefine.BWE_AFTER_LOSS_Q16 );\r\n\t\t}\r\n\r\n\t\tif( this.indices.signalType == Jdefine.TYPE_VOICED ) {\r\n\t\t\t/*********************/\r\n\t\t\t/* Decode pitch lags */\r\n\t\t\t/*********************/\r\n\r\n\t\t\t/* Decode pitch values */\r\n\t\t\tsilk_decode_pitch( this.indices.lagIndex, this.indices.contourIndex, psDecCtrl.pitchL, this.fs_kHz, this.nb_subfr );\r\n\r\n\t\t\t/* Decode Codebook Index */\r\n\t\t\tfinal byte[][] cbk_ptr_Q7 = Jtables_LTP.silk_LTP_vq_ptrs_Q7[ this.indices.PERIndex ]; /* set pointer to start of codebook */\r\n\r\n\t\t\tfinal short[] buff = psDecCtrl.LTPCoef_Q14;// java\r\n\t\t\tfinal byte[] indx = this.indices.LTPIndex;// java\r\n\t\t\tfor( k = 0; k < this.nb_subfr; k++ ) {\r\n\t\t\t\t// int Ix = psDec.indices.LTPIndex[ k ];\r\n\t\t\t\tfinal byte[] ptr = cbk_ptr_Q7[ indx[ k ] ];// java\r\n\t\t\t\tfor( int i = 0, ko = k * Jdefine.LTP_ORDER; i < Jdefine.LTP_ORDER; i++ ) {\r\n\t\t\t\t\t// psDecCtrl.LTPCoef_Q14[ k * Jdefine.LTP_ORDER + i ] = (short)( (int)cbk_ptr_Q7[ Ix * Jdefine.LTP_ORDER + i ] << 7 );// FIXME dirty way ...\r\n\t\t\t\t\t// psDecCtrl.LTPCoef_Q14[ k * Jdefine.LTP_ORDER + i ] = (short)( (int)cbk_ptr_Q7[ Ix ][ i ] << 7 );\r\n\t\t\t\t\tbuff[ ko++ ] = (short)( (int)ptr[ i ] << 7 );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/**********************/\r\n\t\t\t/* Decode LTP scaling */\r\n\t\t\t/**********************/\r\n\t\t\t// final int Ix = psDec.indices.LTP_scaleIndex;\r\n\t\t\tpsDecCtrl.LTP_scale_Q14 = (int)Jtables_other.silk_LTPScales_table_Q14[ this.indices.LTP_scaleIndex ];// [ Ix ];\r\n\t\t} else {\r\n\t\t\t// silk_memset( psDecCtrl.pitchL, 0, psDec.nb_subfr * sizeof( opus_int ) );\r\n\t\t\tfinal int[] ibuff = psDecCtrl.pitchL;// java\r\n\t\t\tfor( int i = this.nb_subfr; i > 0; ) {\r\n\t\t\t\tibuff[--i] = 0;\r\n\t\t\t}\r\n\t\t\t// silk_memset( psDecCtrl->LTPCoef_Q14, 0, LTP_ORDER * psDec->nb_subfr * sizeof( opus_int16 ) );\r\n\t\t\tfinal short[] sbuff = psDecCtrl.LTPCoef_Q14;// java\r\n\t\t\tfor( int i = Jdefine.LTP_ORDER * this.nb_subfr; i > 0; ) {\r\n\t\t\t\tsbuff[--i] = 0;\r\n\t\t\t}\r\n\t\t\tthis.indices.PERIndex = 0;\r\n\t\t\tpsDecCtrl.LTP_scale_Q14 = 0;\r\n\t\t}\r\n\t}", "public static void isSAT(Predicate pred, int[] vList){\n\t\t\n\t\tStack<Integer> assignedVariables = new Stack<Integer>();\n\t\tboolean satisfiability = false;\n\t\twhile(assignedCount<vList.length/2){\n\t\t\tif(pred.isContainsVariable(assignedCount+1, vList.length/2) == 0){\n\t\t\t\tvList[assignedCount] = 0;\n\t\t\t\tvList[assignedCount+vList.length/2] = 1;\n\t\t\t\tassignedCount++;\n\t\t\t} else {\n\t\t\t\tfailedPoint = assignedCount+1;\n\t\t\t\tsatisfiability = assignVariableAndEvaluatePred(pred, vList, assignedVariables);\n\t\t\t\t\n\t\t\t\tif(!satisfiability){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(satisfiability){\n\t\t\t\n\t\t\tsats.add(vList);\n\t\t\t\n\t\t\tgetAllSat(pred, vList);\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Assigned Values for Variables:\");\n\t\t\tfor(int[] arr: sats){\n\t\t\t\tfor(int i=0; i<vList.length/2; i++){\n\t\t\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" )\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" ) ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"No Possible Variable Values for Satisfiability\");\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Variable: \" + failedPoint);\n\t\t\t\n\t\t\tSystem.out.println(\"Backtracked Node Count: \" + backTrackedCount);\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \") ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "ConditionsDTO createConditionsDTO(final Rule source) {\n\t\tfinal ConditionsDTO conditionsDto = new ConditionsDTO();\n\n\t\tfinal List<RuleCondition> conditions = new ArrayList<RuleCondition>(source.getConditions());\n\t\tfinal BooleanComponentDTO limitedConditionDTO = retrieveLimitedUsageCondition(conditions);\n\t\tfinal BooleanComponentDTO couponCodeDTO = retrieveCouponCodeCondition(conditions);\n\n\t\tif (!conditions.isEmpty()) {\n\t\t\tfinal BooleanComponentDTO eligibilitiesAndConditionsDTO = new AndDTO();\n\t\t\teligibilitiesAndConditionsDTO.setComponents(Arrays.asList(createConditionComposition(conditions, source.getConditionOperator())));\n\t\t\tconditionsDto.setConditionsComponent(eligibilitiesAndConditionsDTO);\n\t\t}\n\n\t\taddCouponCondition(conditionsDto, couponCodeDTO);\n\t\taddLimitedCondition(conditionsDto, limitedConditionDTO);\n\n\t\treturn conditionsDto;\n\t}", "private void computeHazardCurve() {\n\n //flag to initialise if Deterministic Model Calc have been completed\n deterministicCalcDone=false;\n\n //checks how many SA Periods has been completed\n this.numSA_PeriodValDone =0;\n\n //flag to check whether Hazard Curve Calc are done\n hazCalcDone = false;\n\n //gets the Label for the Y-axis for the earlier grph\n String oldY_AxisLabel=\"\";\n if(totalProbFuncs.getYAxisName() !=null)\n oldY_AxisLabel = totalProbFuncs.getYAxisName();\n\n // get the selected IMR\n AttenuationRelationship imr = (AttenuationRelationship)imrGuiBean.getSelectedIMR_Instance();\n\n // make a site object to pass to IMR\n Site site = siteGuiBean.getSite();\n\n // intialize the hazard function\n ArbitrarilyDiscretizedFunc hazFunction = new ArbitrarilyDiscretizedFunc();\n ArbitrarilyDiscretizedFunc tempHazFunction = new ArbitrarilyDiscretizedFunc();\n\n //what selection does the user have made, IML@Prob or Prob@IML\n String imlOrProb=imlProbGuiBean.getSelectedOption();\n //gets the IML or Prob value filled in by the user\n double imlProbValue=imlProbGuiBean.getIML_Prob();\n boolean imlAtProb = false, probAtIML = false;\n if(imlOrProb.equalsIgnoreCase(imlProbGuiBean.IML_AT_PROB)){\n //if the old Y axis Label not equal to the IML then clear plot and draw the chart again\n if(!this.IML.equalsIgnoreCase(oldY_AxisLabel))\n this.clearPlot(true);\n totalProbFuncs.setYAxisName(this.IML);\n imlAtProb=true;\n }\n else{\n //if the old Y axis Label not equal to the Prob then clear plot and draw the chart again\n if(!this.PROB_AT_EXCEED.equalsIgnoreCase(oldY_AxisLabel))\n this.clearPlot(true);\n totalProbFuncs.setYAxisName(this.PROB_AT_EXCEED);\n probAtIML=true;\n }\n\n //If the user has chosen the Probabilistic\n if(((String)probDeterSelection.getSelectedItem()).equalsIgnoreCase(this.PROBABILISTIC)){\n this.isEqkList = false;\n // whwther to show progress bar in case of update forecast\n erfGuiBean.showProgressBar(this.progressCheckBox.isSelected());\n // get the selected forecast model\n EqkRupForecastBaseAPI eqkRupForecast = null;\n try{\n //gets the instance of the selected ERF\n eqkRupForecast = erfGuiBean.getSelectedERF();\n }catch(Exception e){\n e.printStackTrace();\n }\n if(this.progressCheckBox.isSelected()) {\n progressClass = new CalcProgressBar(\"Hazard-Curve Calc Status\", \"Beginning Calculation \");\n progressClass.displayProgressBar();\n timer.start();\n }\n\n // check whether this forecast is a Forecast List\n // if this is forecast list , handle it differently\n boolean isEqkForecastList = false;\n if(eqkRupForecast instanceof ERF_EpistemicList) {\n handleForecastList(site, imr, eqkRupForecast,imlProbValue,imlAtProb,probAtIML);\n this.hazCalcDone = true;\n return;\n }\n\n // this is not a eqk list\n this.isEqkList = false;\n\n try{\n // set the value for the distance from the distance control panel\n if(distanceControlPanel!=null) calc.setMaxSourceDistance(distanceControlPanel.getDistance());\n }catch(RemoteException e){\n e.printStackTrace();\n }\n // initialize the values in condProbfunc with log values as passed in hazFunction\n initX_Values(tempHazFunction,imlProbValue,imlAtProb,probAtIML);\n\n try {\n //iterating over all the SA Periods for the IMR's\n for(int i=0;i< numSA_PeriodVals;++i){\n double saPeriodVal = ((Double)this.saPeriodVector.get(i)).doubleValue();\n imr.getParameter(this.SA_PERIOD).setValue(this.saPeriodVector.get(i));\n try{\n // calculate the hazard curve for each SA Period\n calc.getHazardCurve(tempHazFunction, site, imr, (EqkRupForecast)eqkRupForecast);\n }catch(RemoteException e){\n e.printStackTrace();\n }\n //number of SA Periods for which we have ran the Hazard Curve\n this.numSA_PeriodValDone =i;\n hazFunction.setInfo(\"\\n\"+getCurveParametersInfo()+\"\\n\");\n double val = getHazFuncIML_ProbValues(tempHazFunction,imlProbValue,imlAtProb,probAtIML);\n hazFunction.set(saPeriodVal,val);\n }\n }catch (RuntimeException e) {\n JOptionPane.showMessageDialog(this, e.getMessage(),\n \"Parameters Invalid\", JOptionPane.INFORMATION_MESSAGE);\n return;\n }\n }\n else{ //If the Deterministic has been chosen by the user\n imr.setSite(site);\n try{\n imr.setEqkRupture(this.erfRupSelectorGuiBean.getRupture());\n }catch (Exception ex) {\n timer.stop();\n JOptionPane.showMessageDialog(this, \"Rupture not allowed for the chosen IMR: \"+ex.getMessage());\n this.repaint();\n this.validate();\n return;\n }\n\n if(this.progressCheckBox.isSelected()) {\n progressClass = new CalcProgressBar(\"Hazard-Curve Calc Status\", \"Beginning Calculation \");\n progressClass.displayProgressBar();\n timer.start();\n }\n\n //if the user has selectde the Prob@IML\n if(probAtIML)\n //iterating over all the SA Periods for the IMR's\n for(int i=0;i< this.numSA_PeriodVals;++i){\n double saPeriodVal = ((Double)this.saPeriodVector.get(i)).doubleValue();\n imr.getParameter(this.SA_PERIOD).setValue(this.saPeriodVector.get(i));\n double imlLogVal = Math.log(imlProbValue);\n //double val = 0.4343*Math.log(imr.getExceedProbability(imlLogVal));\n double val = imr.getExceedProbability(imlLogVal);\n //adding values to the hazard function\n hazFunction.set(saPeriodVal,val);\n //number of SA Periods for which we have ran the Hazard Curve\n this.numSA_PeriodValDone =i;\n }\n else //if the user has selected IML@prob\n //iterating over all the SA Periods for the IMR\n for(int i=0;i<this.numSA_PeriodVals;++i){\n double saPeriodVal = ((Double)(saPeriodVector.get(i))).doubleValue();\n imr.getParameter(this.SA_PERIOD).setValue(this.saPeriodVector.get(i));\n imr.getParameter(imr.EXCEED_PROB_NAME).setValue(new Double(imlProbValue));\n //double val = 0.4343*imr.getIML_AtExceedProb();\n //adding values to the Hazard Function\n double val = Math.exp(imr.getIML_AtExceedProb());\n hazFunction.set(saPeriodVal,val);\n //number of SA Periods for which we have ran the Hazard Curve\n this.numSA_PeriodValDone =i;\n }\n this.deterministicCalcDone = true;\n }\n\n // add the function to the function list\n totalProbFuncs.add(hazFunction);\n //checks whether the Hazard Curve Calculation are complete\n hazCalcDone = true;\n // set the X-axis label\n totalProbFuncs.setXAxisName(X_AXIS_LABEL);\n\n }", "private void addC2Constraints(double[] alpha, GRBVar[][] xVars, GRBVar[][] yVars, GRBModel model)\n\t\t\tthrows GRBException {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tString constraintName = \"constraintC2_\" + i;\n\t\t\t// out_x(i) + out_y(i) - in_y(i) = alpha_i\n\t\t\tGRBLinExpr constraintLinExpr = new GRBLinExpr();\n\n\t\t\t// Expression += out_x(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Expression += out_y(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, yVars, constraintLinExpr);\n\n\t\t\t// Expression -= in_y(i)\n\t\t\tGRBSolverUtils.addInTerm(i, -1, mExplicitMDP, yVars, constraintLinExpr);\n\n\t\t\t// Add constraint\n\t\t\tmodel.addConstr(constraintLinExpr, GRB.EQUAL, alpha[i], constraintName);\n\t\t}\n\t}", "public void mo3743a(LinearSystem eVar) {\n boolean z;\n boolean z2;\n boolean z3;\n boolean z4;\n int i;\n int i2;\n boolean z5;\n int i3;\n int i4;\n SolverVariable hVar;\n boolean z6;\n SolverVariable hVar2;\n SolverVariable hVar3;\n boolean z7;\n SolverVariable hVar4;\n SolverVariable hVar5;\n ConstraintWidget fVar;\n boolean z8;\n LinearSystem eVar2;\n SolverVariable hVar6;\n ConstraintWidget fVar2;\n int i5;\n boolean z9;\n boolean z10;\n SolverVariable a = eVar.mo3927a(this.f1490s);\n SolverVariable a2 = eVar.mo3927a(this.f1492u);\n SolverVariable a3 = eVar.mo3927a(this.f1491t);\n SolverVariable a4 = eVar.mo3927a(this.f1493v);\n SolverVariable a5 = eVar.mo3927a(this.f1494w);\n ConstraintWidget fVar3 = this.f1429D;\n if (fVar3 != null) {\n z4 = fVar3 != null && fVar3.f1428C[0] == EnumC0282a.WRAP_CONTENT;\n ConstraintWidget fVar4 = this.f1429D;\n boolean z11 = fVar4 != null && fVar4.f1428C[1] == EnumC0282a.WRAP_CONTENT;\n if (mo3742a(0)) {\n ((ConstraintWidgetContainer) this.f1429D).mo3854a(this, 0);\n z9 = true;\n } else {\n z9 = mo3774I();\n }\n if (mo3742a(1)) {\n ((ConstraintWidgetContainer) this.f1429D).mo3854a(this, 1);\n z10 = true;\n } else {\n z10 = mo3775J();\n }\n if (z4 && this.f1470as != 8 && this.f1490s.f1416c == null && this.f1492u.f1416c == null) {\n eVar.mo3935a(eVar.mo3927a(this.f1429D.f1492u), a2, 0, 1);\n }\n if (z11 && this.f1470as != 8 && this.f1491t.f1416c == null && this.f1493v.f1416c == null && this.f1494w == null) {\n eVar.mo3935a(eVar.mo3927a(this.f1429D.f1493v), a4, 0, 1);\n }\n z3 = z11;\n z2 = z9;\n z = z10;\n } else {\n z4 = false;\n z3 = false;\n z2 = false;\n z = false;\n }\n int i6 = this.f1430E;\n int i7 = this.f1441P;\n if (i6 < i7) {\n i6 = i7;\n }\n int i8 = this.f1431F;\n int i9 = this.f1442Q;\n if (i8 < i9) {\n i8 = i9;\n }\n boolean z12 = this.f1428C[0] != EnumC0282a.MATCH_CONSTRAINT;\n boolean z13 = this.f1428C[1] != EnumC0282a.MATCH_CONSTRAINT;\n this.f1487p = this.f1433H;\n float f = this.f1432G;\n this.f1488q = f;\n int i10 = this.f1476e;\n int i11 = this.f1477f;\n if (f <= 0.0f || this.f1470as == 8) {\n hVar = a5;\n i4 = i10;\n i2 = i6;\n i = i8;\n i3 = i11;\n z5 = false;\n } else {\n hVar = a5;\n if (this.f1428C[0] == EnumC0282a.MATCH_CONSTRAINT && i10 == 0) {\n i10 = 3;\n }\n if (this.f1428C[1] == EnumC0282a.MATCH_CONSTRAINT && i11 == 0) {\n i11 = 3;\n }\n if (this.f1428C[0] == EnumC0282a.MATCH_CONSTRAINT && this.f1428C[1] == EnumC0282a.MATCH_CONSTRAINT && i10 == 3 && i11 == 3) {\n mo3789a(z4, z3, z12, z13);\n } else if (this.f1428C[0] == EnumC0282a.MATCH_CONSTRAINT && i10 == 3) {\n this.f1487p = 0;\n int i12 = (int) (this.f1488q * ((float) this.f1431F));\n if (this.f1428C[1] != EnumC0282a.MATCH_CONSTRAINT) {\n i2 = i12;\n i = i8;\n i3 = i11;\n i4 = 4;\n z5 = false;\n } else {\n i2 = i12;\n i4 = i10;\n i = i8;\n i3 = i11;\n z5 = true;\n }\n } else if (this.f1428C[1] == EnumC0282a.MATCH_CONSTRAINT && i11 == 3) {\n this.f1487p = 1;\n if (this.f1433H == -1) {\n this.f1488q = 1.0f / this.f1488q;\n }\n int i13 = (int) (this.f1488q * ((float) this.f1430E));\n if (this.f1428C[0] != EnumC0282a.MATCH_CONSTRAINT) {\n i = i13;\n i4 = i10;\n i2 = i6;\n i3 = 4;\n z5 = false;\n } else {\n i = i13;\n i4 = i10;\n i2 = i6;\n i3 = i11;\n z5 = true;\n }\n }\n i4 = i10;\n i2 = i6;\n i = i8;\n i3 = i11;\n z5 = true;\n }\n int[] iArr = this.f1478g;\n iArr[0] = i4;\n iArr[1] = i3;\n if (z5) {\n int i14 = this.f1487p;\n if (i14 != 0) {\n }\n z6 = true;\n boolean z14 = this.f1428C[0] != EnumC0282a.WRAP_CONTENT && (this instanceof ConstraintWidgetContainer);\n boolean z15 = !this.f1497z.mo3764j();\n if (this.f1451a == 2) {\n ConstraintWidget fVar5 = this.f1429D;\n SolverVariable a6 = fVar5 != null ? eVar.mo3927a(fVar5.f1492u) : null;\n ConstraintWidget fVar6 = this.f1429D;\n z7 = z3;\n hVar3 = hVar;\n hVar5 = a4;\n hVar2 = a3;\n hVar4 = a2;\n m1247a(eVar, z4, fVar6 != null ? eVar.mo3927a(fVar6.f1490s) : null, a6, this.f1428C[0], z14, this.f1490s, this.f1492u, this.f1434I, i2, this.f1441P, this.f1460ai[0], this.f1443S, z6, z2, i4, this.f1479h, this.f1480i, this.f1481j, z15);\n fVar = this;\n } else {\n hVar2 = a3;\n hVar4 = a2;\n z7 = z3;\n hVar3 = hVar;\n hVar5 = a4;\n fVar = this;\n }\n if (fVar.f1473b == 2) {\n boolean z16 = fVar.f1428C[1] == EnumC0282a.WRAP_CONTENT && (fVar instanceof ConstraintWidgetContainer);\n boolean z17 = z5 && ((i5 = fVar.f1487p) == 1 || i5 == -1);\n if (fVar.f1440O <= 0) {\n hVar6 = hVar2;\n eVar2 = eVar;\n } else if (fVar.f1494w.mo3751a().f1561i == 1) {\n eVar2 = eVar;\n fVar.f1494w.mo3751a().mo3877a(eVar2);\n hVar6 = hVar2;\n } else {\n eVar2 = eVar;\n hVar6 = hVar2;\n eVar2.mo3943c(hVar3, hVar6, mo3767B(), 6);\n if (fVar.f1494w.f1416c != null) {\n eVar2.mo3943c(hVar3, eVar2.mo3927a(fVar.f1494w.f1416c), 0, 6);\n z8 = false;\n ConstraintWidget fVar7 = fVar.f1429D;\n SolverVariable a7 = fVar7 == null ? eVar2.mo3927a(fVar7.f1493v) : null;\n ConstraintWidget fVar8 = fVar.f1429D;\n m1247a(eVar, z7, fVar8 == null ? eVar2.mo3927a(fVar8.f1491t) : null, a7, fVar.f1428C[1], z16, fVar.f1491t, fVar.f1493v, fVar.f1435J, i, fVar.f1442Q, fVar.f1460ai[1], fVar.f1444T, z17, z, i3, fVar.f1482k, fVar.f1483l, fVar.f1484m, z8);\n if (!z5) {\n fVar2 = this;\n if (fVar2.f1487p == 1) {\n eVar.mo3936a(hVar5, hVar6, hVar4, a, fVar2.f1488q, 6);\n } else {\n eVar.mo3936a(hVar4, a, hVar5, hVar6, fVar2.f1488q, 6);\n }\n } else {\n fVar2 = this;\n }\n if (!fVar2.f1497z.mo3764j()) {\n eVar.mo3928a(fVar2, fVar2.f1497z.mo3761g().mo3757c(), (float) Math.toRadians((double) (fVar2.f1461aj + 90.0f)), fVar2.f1497z.mo3759e());\n return;\n }\n return;\n }\n }\n z8 = z15;\n ConstraintWidget fVar72 = fVar.f1429D;\n if (fVar72 == null) {\n }\n ConstraintWidget fVar82 = fVar.f1429D;\n m1247a(eVar, z7, fVar82 == null ? eVar2.mo3927a(fVar82.f1491t) : null, a7, fVar.f1428C[1], z16, fVar.f1491t, fVar.f1493v, fVar.f1435J, i, fVar.f1442Q, fVar.f1460ai[1], fVar.f1444T, z17, z, i3, fVar.f1482k, fVar.f1483l, fVar.f1484m, z8);\n if (!z5) {\n }\n if (!fVar2.f1497z.mo3764j()) {\n }\n } else {\n return;\n }\n }\n z6 = false;\n if (this.f1428C[0] != EnumC0282a.WRAP_CONTENT) {\n }\n boolean z152 = !this.f1497z.mo3764j();\n if (this.f1451a == 2) {\n }\n if (fVar.f1473b == 2) {\n }\n }", "public void ApplyPremiums() {\r\n\r\n\t\tdouble GrossPremium;\r\n\t\tdouble NetPremium;\r\n\r\n\t\tfor ( Premium p : _Premiums ) {\r\n\r\n\t\t\tGrossPremium = p.getPremium() * _InvestPerCent;\r\n\r\n\t\t\tNetPremium = p.Apply() * _InvestPerCent * _BidOfferSpread.getBidOfferSpread();\r\n\r\n\t\t\tsuper.UpdateFundPremiumSchedule( GrossPremium );\r\n\r\n\t\t\t//IRR is based on the premium paid by the customer not allocated to fund.\r\n\t\t\tCashflows.Instance().AddCashflow( _Tick, GrossPremium );\r\n\r\n\t\t\t_FundValue = _FundValue + NetPremium;\r\n\r\n\t\t\tSystem.out.println( \"\\t\\t\\t\\tNet \" + p.getName() + \" Premium Amount : \" + NetPremium + \" in \" + _Name);\r\n\t\t}\r\n\t}", "private void initiaLizeRequirements() {\n\n\t\ttry {\n\t\t\tstFoodDataEntry = cnFoodDataEntry.createStatement();\n\n\t\t\tString sql = \"select energysourceid, unit, conversionfactor from energysourcedetail where energysourceid in (select sourceid from energysource where energytypeid =\"\n\t\t\t\t\t+ FOOD + \") order by energysourceid asc\";\n\t\t\trsFoodDataEntry = stFoodDataEntry.executeQuery(sql);\n\n\t\t\tMap<String, Double> unitConversionF = null;\n\t\t\t// List<Map<String, Double>> listUnitConversionF;\n\t\t\tenergySourceDetail = new LinkedHashMap<Integer, Map<String, Double>>();\n\n\t\t\tint energysourceId;\n\t\t\tString unit;\n\t\t\tDouble coversionFactor;\n\n\t\t\twhile (rsFoodDataEntry.next()) {\n\t\t\t\tenergysourceId = rsFoodDataEntry.getInt(\"energysourceid\");\n\t\t\t\tunit = rsFoodDataEntry.getString(\"unit\");\n\t\t\t\tcoversionFactor = rsFoodDataEntry.getDouble(\"conversionfactor\");\n\n\t\t\t\tif (energySourceDetail.containsKey(energysourceId)) {\n\t\t\t\t\tenergySourceDetail.remove(energysourceId);\n\t\t\t\t} else {\n\t\t\t\t\tunitConversionF = new LinkedHashMap<String, Double>();\n\t\t\t\t}\n\t\t\t\tunitConversionF.put(unit, coversionFactor);\n\t\t\t\tenergySourceDetail.put(energysourceId, unitConversionF);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws SolverException, CloneNotSupportedException {\n\t\tLocalDate referenceDate = LocalDate.of(2018,9,24);\n\n\t\t/*\n\t\t * Define the calibration spec generators for our calibration products\n\t\t */\n\t\tFunction<String,String> frequencyForTenor = (tenor) -> {\n\t\t\tswitch(tenor) {\n\t\t\tcase \"3M\":\n\t\t\t\treturn \"quarterly\";\n\t\t\tcase \"6M\":\n\t\t\t\treturn \"semiannual\";\n\t\t\t}\n\t\t\tthrow new IllegalArgumentException(\"Unkown tenor \" + tenor);\n\t\t};\n\n\t\tBiFunction<String, Double, CalibrationSpec> deposit = (maturity, rate) -> {\n\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"tenor\", \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\tScheduleInterface scheduleInterfacePay = null;\n\t\t\tdouble calibrationTime = scheduleInterfaceRec.getPayment(scheduleInterfaceRec.getNumberOfPeriods()-1);\n\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-OIS-\" + maturity, \"Deposit\", scheduleInterfaceRec, \"\", rate, \"discount-EUR-OIS\", scheduleInterfacePay, null, 0.0, null, \"discount-EUR-OIS\", calibrationTime);\n\t\t\treturn calibrationSpec;\n\t\t};\n\n\t\tBiFunction<String, Double, CalibrationSpec> swapSingleCurve = (maturity, rate) -> {\n\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"annual\", \"act/360\", \"first\", \"modified_following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 1);\n\t\t\tScheduleInterface scheduleInterfacePay = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"annual\", \"act/360\", \"first\", \"modified_following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 1);\n\t\t\tdouble calibrationTime = scheduleInterfaceRec.getPayment(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-OIS-\" + maturity, \"Swap\", scheduleInterfaceRec, \"forward-EUR-OIS\", 0.0, \"discount-EUR-OIS\", scheduleInterfacePay, \"\", rate, \"discount-EUR-OIS\", \"discount-EUR-OIS\", calibrationTime);\n\t\t\treturn calibrationSpec;\n\t\t};\n\n\t\tFunction<String,BiFunction<String, Double, CalibrationSpec>> fra = (tenor) -> {\n\t\t\treturn (fixing, rate) -> {\n\t\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, fixing, tenor, \"tenor\", \"act/360\", \"first\", \"modified_following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tdouble calibrationTime = scheduleInterfaceRec.getFixing(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\t\t\t\tString curveName = \"forward-EUR-\" + tenor;\n\t\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-\" + tenor + \"-\" + fixing, \"FRA\", scheduleInterfaceRec, curveName, rate, \"discount-EUR-OIS\", null, null, 0.0, null, curveName, calibrationTime);\n\t\t\t\treturn calibrationSpec;\n\t\t\t};\n\t\t};\n\n\t\tFunction<String,BiFunction<String, Double, CalibrationSpec>> swap = (tenor) -> {\n\t\t\treturn (maturity, rate) -> {\n\t\t\t\tString frequencyRec = frequencyForTenor.apply(tenor);\n\n\t\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, frequencyRec, \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tScheduleInterface scheduleInterfacePay = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"annual\", \"E30/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tdouble calibrationTime = scheduleInterfaceRec.getFixing(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\t\t\t\tString curveName = \"forward-EUR-\" + tenor;\n\t\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-\" + tenor + maturity, \"Swap\", scheduleInterfaceRec, curveName, 0.0, \"discount-EUR-OIS\", scheduleInterfacePay, \"\", rate, \"discount-EUR-OIS\", curveName, calibrationTime);\n\t\t\t\treturn calibrationSpec;\n\t\t\t};\n\t\t};\n\n\t\tBiFunction<String,String,BiFunction<String, Double, CalibrationSpec>> swapBasis = (tenorRec,tenorPay) -> {\n\t\t\treturn (maturity, rate) -> {\n\t\t\t\tString curveNameRec = \"forward-EUR-\" + tenorRec;\n\t\t\t\tString curveNamePay = \"forward-EUR-\" + tenorPay;\n\n\t\t\t\tString frequencyRec = frequencyForTenor.apply(tenorRec);\n\t\t\t\tString frequencyPay = frequencyForTenor.apply(tenorPay);\n\n\t\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, frequencyRec, \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tScheduleInterface scheduleInterfacePay = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, frequencyPay, \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tdouble calibrationTime = scheduleInterfaceRec.getFixing(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\n\t\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-\" + tenorRec + \"-\" + tenorPay + maturity, \"Swap\", scheduleInterfaceRec, curveNameRec, 0.0, \"discount-EUR-OIS\", scheduleInterfacePay, curveNamePay, rate, \"discount-EUR-OIS\", curveNameRec, calibrationTime);\n\t\t\t\treturn calibrationSpec;\n\t\t\t};\n\t\t};\n\n\t\t/*\n\t\t * Generate empty curve template (for cloning during calibration)\n\t\t */\n\t\tdouble[] times = { 0.0 };\n\t\tdouble[] discountFactors = { 1.0 };\n\t\tboolean[] isParameter = { false };\n\n\t\tDiscountCurve discountCurveOIS = DiscountCurve.createDiscountCurveFromDiscountFactors(\"discount-EUR-OIS\", referenceDate, times, discountFactors, isParameter, InterpolationMethod.LINEAR, ExtrapolationMethod.CONSTANT, InterpolationEntity.LOG_OF_VALUE);\n\t\tForwardCurveInterface forwardCurveOIS = new ForwardCurveFromDiscountCurve(\"forward-EUR-OIS\", \"discount-EUR-OIS\", referenceDate, \"3M\");\n\t\tForwardCurveInterface forwardCurve3M = new ForwardCurve(\"forward-EUR-3M\", referenceDate, \"3M\", new BusinessdayCalendarExcludingTARGETHolidays(), BusinessdayCalendarInterface.DateRollConvention.FOLLOWING, Curve.InterpolationMethod.LINEAR, Curve.ExtrapolationMethod.CONSTANT, Curve.InterpolationEntity.VALUE,ForwardCurve.InterpolationEntityForward.FORWARD, \"discount-EUR-OIS\");\n\t\tForwardCurveInterface forwardCurve6M = new ForwardCurve(\"forward-EUR-6M\", referenceDate, \"6M\", new BusinessdayCalendarExcludingTARGETHolidays(), BusinessdayCalendarInterface.DateRollConvention.FOLLOWING, Curve.InterpolationMethod.LINEAR, Curve.ExtrapolationMethod.CONSTANT, Curve.InterpolationEntity.VALUE,ForwardCurve.InterpolationEntityForward.FORWARD, \"discount-EUR-OIS\");\n\n\t\tAnalyticModel forwardCurveModel = new AnalyticModel(new CurveInterface[] { discountCurveOIS, forwardCurveOIS, forwardCurve3M, forwardCurve6M });\n\n\t\tList<CalibrationSpec> calibrationSpecs = new LinkedList<>();\n\n\t\t/*\n\t\t * Calibration products for OIS curve: Deposits\n\t\t */\n\t\tcalibrationSpecs.add(deposit.apply(\"1D\", 0.202 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"1W\", 0.195 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"2W\", 0.193 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"3W\", 0.193 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"1M\", 0.191 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"2M\", 0.185 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"3M\", 0.180 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"4M\", 0.170 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"5M\", 0.162 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"6M\", 0.156 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"7M\", 0.150 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"8M\", 0.145 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"9M\", 0.141 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"10M\", 0.136 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"11M\", 0.133 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"12M\", 0.129 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for OIS curve: Swaps\n\t\t */\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"15M\", 0.118 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"18M\", 0.108 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"21M\", 0.101 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"2Y\", 0.101 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"3Y\", 0.194 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"4Y\", 0.346 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"5Y\", 0.534 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"6Y\", 0.723 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"7Y\", 0.895 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"8Y\", 1.054 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"9Y\", 1.189 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"10Y\", 1.310 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"11Y\", 1.423 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"12Y\", 1.520 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"15Y\", 1.723 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"20Y\", 1.826 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"25Y\", 1.877 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"30Y\", 1.910 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"40Y\", 2.025 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"50Y\", 2.101 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 3M curve: FRAs\n\t\t */\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"0D\", 0.322 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"1M\", 0.329 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"2M\", 0.328 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"3M\", 0.326 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"6M\", 0.323 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"9M\", 0.316 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"12M\", 0.360 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"15M\", 0.390 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 3M curve: swaps\n\t\t */\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"2Y\", 0.380 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"3Y\", 0.485 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"4Y\", 0.628 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"5Y\", 0.812 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"6Y\", 0.998 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"7Y\", 1.168 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"8Y\", 1.316 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"9Y\", 1.442 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"10Y\", 1.557 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"12Y\", 1.752 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"15Y\", 1.942 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"20Y\", 2.029 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"25Y\", 2.045 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"30Y\", 2.097 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"40Y\", 2.208 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"50Y\", 2.286 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 6M curve: FRAs\n\t\t */\n\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"0D\", 0.590 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"1M\", 0.597 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"2M\", 0.596 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"3M\", 0.594 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"6M\", 0.591 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"9M\", 0.584 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"12M\", 0.584 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 6M curve: tenor basis swaps\n\t\t * Note: the fixed bases is added to the second argument tenor (here 3M).\n\t\t */\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"2Y\", 0.255 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"3Y\", 0.245 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"4Y\", 0.227 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"5Y\", 0.210 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"6Y\", 0.199 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"7Y\", 0.189 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"8Y\", 0.177 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"9Y\", 0.170 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"10Y\", 0.164 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"12Y\", 0.156 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"15Y\", 0.135 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"20Y\", 0.125 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"25Y\", 0.117 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"30Y\", 0.107 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"40Y\", 0.095 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"50Y\", 0.088 / 100.0));\n\n\t\t/*\n\t\t * Calibrate\n\t\t */\n\t\tCalibratedCurves calibratedCurves = new CalibratedCurves(calibrationSpecs.toArray(new CalibrationSpec[calibrationSpecs.size()]), forwardCurveModel, 1E-15);\n\n\t\t/*\n\t\t * Get the calibrated model\n\t\t */\n\t\tAnalyticModelInterface calibratedModel = calibratedCurves.getModel();\n\t\t\n\t\tdouble[] strikes = {-0.005,\n\t\t\t\t-0.0025,\n\t\t\t\t-0.0013,\n\t\t\t\t0.0,\n\t\t\t\t0.0025,\n\t\t\t\t0.005,\n\t\t\t\t0.01,\n\t\t\t\t0.015,\n\t\t\t\t0.02,\n\t\t\t\t0.03,\n\t\t\t\t0.05};\n\t\t\n\t\n\t\tdouble[][] volatilities = \n\t\t\t{{0.0025,0.0024,0.0027,0.0031,0.0037,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0027,0.0031,0.0037,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0028,0.0031,0.0038,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0027,0.0031,0.0037,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0027,0.0031,0.0038,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0040,0.0043,0.0045,0.0047,0.0049,0.0052,0.0058,0.0065,0.0072,0.0087,0.0114},\n\t\t\t\t\t{0.0047,0.0049,0.0051,0.0053,0.0055,0.0057,0.0062,0.0068,0.0075,0.0089,0.0115},\n\t\t\t\t\t{0.0050,0.0052,0.0053,0.0054,0.0056,0.0058,0.0063,0.0069,0.0075,0.0088,0.0113},\n\t\t\t\t\t{0.0055,0.0056,0.0057,0.0058,0.0060,0.0061,0.0065,0.0070,0.0076,0.0088,0.0113},\n\t\t\t\t\t{0.0055,0.0056,0.0057,0.0058,0.0060,0.0061,0.0064,0.0069,0.0074,0.0084,0.0107},\n\t\t\t\t\t{0.0058,0.0059,0.0061,0.0061,0.0062,0.0064,0.0066,0.0070,0.0074,0.0083,0.0103},\n\t\t\t\t\t{0.0058,0.0059,0.0059,0.0060,0.0062,0.0063,0.0066,0.0069,0.0073,0.0081,0.0099},\n\t\t\t\t\t{0.0060,0.0061,0.0062,0.0063,0.0064,0.0065,0.0067,0.0069,0.0072,0.0079,0.0095},\n\t\t\t\t\t{0.0059,0.0060,0.0061,0.0061,0.0063,0.0063,0.0066,0.0068,0.0071,0.0079,0.0095},\n\t\t\t\t\t{0.0061,0.0062,0.0062,0.0062,0.0064,0.0065,0.0066,0.0068,0.0071,0.0077,0.0092},\n\t\t\t\t\t{0.0059,0.0060,0.0061,0.0061,0.0062,0.0063,0.0065,0.0067,0.0070,0.0077,0.0091},\n\t\t\t\t\t{0.0060,0.0061,0.0062,0.0062,0.0063,0.0063,0.0066,0.0067,0.0070,0.0075,0.0089},\n\t\t\t\t\t{0.0060,0.0060,0.0060,0.0061,0.0062,0.0063,0.0064,0.0067,0.0069,0.0075,0.0088},\n\t\t\t\t\t{0.0060,0.0061,0.0061,0.0062,0.0062,0.0063,0.0064,0.0067,0.0068,0.0073,0.0086},\n\t\t\t\t\t{0.0058,0.0058,0.0059,0.0059,0.0060,0.0061,0.0063,0.0065,0.0067,0.0073,0.0085},\n\t\t\t\t\t{0.0058,0.0059,0.0060,0.0060,0.0060,0.0061,0.0063,0.0065,0.0067,0.0071,0.0083},\n\t\t\t\t\t{0.0059,0.0059,0.0060,0.0060,0.0061,0.0061,0.0063,0.0064,0.0066,0.0070,0.0081},\n\t\t\t\t\t{0.0059,0.0060,0.0061,0.0061,0.0061,0.0062,0.0063,0.0064,0.0065,0.0069,0.0079},\n\t\t\t\t\t{0.0056,0.0057,0.0057,0.0057,0.0058,0.0059,0.0060,0.0062,0.0065,0.0069,0.0081},\n\t\t\t\t\t{0.0056,0.0057,0.0057,0.0057,0.0058,0.0059,0.0060,0.0062,0.0064,0.0068,0.0079},\n\t\t\t\t\t{0.0057,0.0057,0.0057,0.0058,0.0058,0.0059,0.0060,0.0061,0.0063,0.0067,0.0077},\n\t\t\t\t\t{0.0057,0.0057,0.0057,0.0058,0.0058,0.0059,0.0060,0.0061,0.0063,0.0066,0.0076},\n\t\t\t\t\t{0.0057,0.0057,0.0058,0.0058,0.0058,0.0059,0.0059,0.0060,0.0062,0.0065,0.0074},\n\t\t\t\t\t{0.0057,0.0058,0.0058,0.0058,0.0059,0.0059,0.0059,0.0060,0.0061,0.0064,0.0073},\n\t\t\t\t\t{0.0054,0.0054,0.0054,0.0055,0.0055,0.0056,0.0058,0.0059,0.0061,0.0065,0.0076},\n\t\t\t\t\t{0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0059,0.0060,0.0065,0.0075},\n\t\t\t\t\t{0.0054,0.0053,0.0054,0.0054,0.0055,0.0055,0.0057,0.0058,0.0060,0.0064,0.0074},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0055,0.0055,0.0056,0.0058,0.0059,0.0063,0.0073},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0059,0.0062,0.0071},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0058,0.0061,0.0070},\n\t\t\t\t\t{0.0053,0.0053,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0061,0.0069},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0060,0.0068},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0059,0.0067},\n\t\t\t\t\t{0.0053,0.0053,0.0054,0.0054,0.0054,0.0054,0.0054,0.0055,0.0055,0.0058,0.0066},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0052,0.0053,0.0054,0.0055,0.0057,0.0060,0.0070},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0052,0.0052,0.0053,0.0055,0.0056,0.0060,0.0069},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0052,0.0052,0.0053,0.0054,0.0056,0.0059,0.0068},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0051,0.0052,0.0052,0.0054,0.0055,0.0058,0.0067},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0051,0.0051,0.0052,0.0053,0.0055,0.0058,0.0066},\n\t\t\t\t\t{0.0050,0.0051,0.0051,0.0050,0.0051,0.0051,0.0052,0.0053,0.0054,0.0057,0.0066},\n\t\t\t\t\t{0.0050,0.0050,0.0051,0.0050,0.0051,0.0051,0.0051,0.0052,0.0054,0.0056,0.0065},\n\t\t\t\t\t{0.0050,0.0050,0.0050,0.0050,0.0051,0.0051,0.0051,0.0052,0.0053,0.0056,0.0064},\n\t\t\t\t\t{0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0051,0.0053,0.0055,0.0063},\n\t\t\t\t\t{0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0051,0.0052,0.0054,0.0063},\n\t\t\t\t\t{0.0050,0.0049,0.0049,0.0050,0.0050,0.0051,0.0051,0.0052,0.0053,0.0057,0.0065},\n\t\t\t\t\t{0.0049,0.0049,0.0049,0.0050,0.0050,0.0050,0.0051,0.0052,0.0053,0.0057,0.0065},\n\t\t\t\t\t{0.0049,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0052,0.0053,0.0056,0.0064},\n\t\t\t\t\t{0.0049,0.0049,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0052,0.0056,0.0064},\n\t\t\t\t\t{0.0049,0.0048,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0052,0.0056,0.0063},\n\t\t\t\t\t{0.0048,0.0048,0.0048,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0055,0.0063},\n\t\t\t\t\t{0.0048,0.0048,0.0048,0.0048,0.0049,0.0049,0.0049,0.0050,0.0051,0.0055,0.0062},\n\t\t\t\t\t{0.0048,0.0048,0.0048,0.0048,0.0048,0.0049,0.0049,0.0050,0.0051,0.0054,0.0062},\n\t\t\t\t\t{0.0048,0.0047,0.0048,0.0048,0.0048,0.0048,0.0048,0.0049,0.0050,0.0054,0.0061},\n\t\t\t\t\t{0.0047,0.0047,0.0047,0.0048,0.0048,0.0048,0.0048,0.0049,0.0050,0.0053,0.0061}};\n\t\t\n\t\tdouble[] maturities = {0.5000,1.0000,1.5000,2.0000,2.5000,3.0000,3.5000,4.0000,4.5000,5.0000,\n\t\t\t\t5.5000,6.0000,6.5000,7.0000,7.5000,8.0000,8.5000,9.0000,9.5000,10.0000,\n\t\t\t\t10.5000,11.0000,11.5000,12.0000,12.5000,13.0000,13.5000,14.0000,14.5000,\n\t\t\t\t15.0000,15.5000,16.0000,16.5000,17.0000,17.5000,18.0000,18.5000,19.0000,\n\t\t\t\t19.5000,20.0000,20.5000,21.0000,21.5000,22.0000,22.5000,23.0000,23.5000,\n\t\t\t\t24.0000,24.5000,25.0000,25.5000,26.0000,26.5000,27.0000,27.5000,28.0000,\n\t\t\t\t28.5000,29.0000,29.5000};\n\t\t\n\t\tint[] indeces = {7,9,10,11,12,13,14,15,16,17,18,19}; //chose the index of the maturities we want to calibrate\n\t\t\n\t\t//Target caplet data\n\t\tQuotingConvention convention = QuotingConvention.VOLATILITYNORMAL;\n\t\t\n\t\tArrayList<CapletSmileData> smiles = new ArrayList<CapletSmileData>();\n\t\t\n\t\tfor(int i = 0; i<indeces.length; i++) {\n\t\t\tint index = indeces[i];\n\t\t\tdouble[] values = volatilities[index];\n\t\t\tdouble time = maturities[index];\n\t\t\tCapletSmileData ithSmile = new CapletSmileData(\"forward-EUR-6M\",\"discount-EUR-OIS\",referenceDate,strikes,time, values, convention);\n\t\t\tsmiles.add(ithSmile);\n\t\t}\n\t\t\n\t\tCapletSmileData[] smileArray = new CapletSmileData[smiles.size()];\n\t\tsmileArray = smiles.toArray(new CapletSmileData[smiles.size()]);\n\t\t\n\t\tCapletSurfaceData surface = new CapletSurfaceData(smileArray, calibratedModel);\n\t\t\n\t\tOptimizerFactoryInterface optimizerFactory = new OptimizerFactoryLevenbergMarquardt(300 /* maxIterations */, 8 /* maxThreads */);\n\n\t\t\n\t\tdouble[] initialParameters = new double[] {0.1, 0.2,0.1, 0.3,0.1,0.7,0.4,0.6,0.1,0.2,0.1} /* initialParameters */;\n\t\tdouble[] parameterStep = new double[] {0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01, 0.01} /* parameterStep */;\n\t\t\n\t\tint numberOfPoints = 4096*16;\n\t\tdouble gridSpacing = 0.005;\n\t\tnet.finmath.interpolation.RationalFunctionInterpolation.InterpolationMethod intMethod = net.finmath.interpolation.RationalFunctionInterpolation.InterpolationMethod.LINEAR;\n\t\tnet.finmath.interpolation.RationalFunctionInterpolation.ExtrapolationMethod extMethod = net.finmath.interpolation.RationalFunctionInterpolation.ExtrapolationMethod.CONSTANT;\n\t\t\n\t\tCapletByCarrMadan pricer = new CapletByCarrMadan(\"forward-EUR-6M\", 5.0,strikes,numberOfPoints,gridSpacing,intMethod,extMethod);\n\t\t\t\n\t\t\n\t\tdouble b = 0.3;\n\t\tdouble sigma = 0.08512087176733757;\n\t\tdouble eta = 0.8006437480710635;\n\t\tdouble zeta = 1.9;\n\t\tdouble alpha = 1.0596981657639444;\n\t\tdouble[] initialValues = {0.01, 0.02};\n\t\tdouble[] immigrationRates = {0.1, 0.3};\n\t\tdouble[] lambda = {1, 1};\n\t\n\t\t\n\t\tMultiCurveTenor threeMonth = new MultiCurveTenor(0.25, \"3M\");\n\t\tMultiCurveTenor sixMonth = new MultiCurveTenor(0.5, \"6M\");\n\t\tMultiCurveTenor[] tenors = {threeMonth,sixMonth};\n\t\t\n\t\tdouble[] tenorLengths = {0.25,0.6};\n\t\tString[] tenorNames = {\"3M\", \"6M\"};\n\t\t\n\t\tdouble timeHorizon = 12.0;\t\t\n\t\tint numberOfTimeSteps = 40;\n\t\t\n\t\tScalarParameterInformationInterface[] lambdaInfo = \n\t\t\t{new ScalarParameterInformation(false, new PositivityConstraint()),\n\t\t\t\t\tnew ScalarParameterInformation(false, new PositivityConstraint())};\n\t\tScalarParameterInformationInterface[] immigrationRatesInfo =\n\t\t\t{new ScalarParameterInformation(true, new BoundConstraint(1E-5,10.0)),\n\t\t\t\t\tnew ScalarParameterInformation(true, new BoundConstraint(1E-5,10.0))};\n\t\t\n\t\tScalarParameterInformationInterface bInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface sigmaInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface etaInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface zetaInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface alphaInfo = new ScalarParameterInformation(true, new BoundConstraint(1, 2));\n\t\t\n\t\tScalarParameterInformationInterface[] initialValuesInfo = \n\t\t\t{new ScalarParameterInformation(true, new PositivityConstraint()),\n\t\t\t\t\tnew ScalarParameterInformation(true, new PositivityConstraint())};\n\t\t\n\t\tboolean functionVConstraint = true;\n\t\tboolean expMomentConstraint = true;\n\t\t\n\t\tCBIProcessInterface cbiProcess = new FlowOfTemperedAlphaStableCBIprocess(timeHorizon, numberOfTimeSteps, initialValues, immigrationRates, b, sigma, \n\t\t\t\t eta, zeta, alpha,lambda, \n\t\t\t\tlambdaInfo, immigrationRatesInfo, \n\t\t\t\tbInfo, sigmaInfo, etaInfo, \n\t\t\t\tzetaInfo, alphaInfo, initialValuesInfo,\n\t\t\t\tfunctionVConstraint, expMomentConstraint);\n\t\t\n\t\tCBIDrivenMultiCurveModel model = new CBIDrivenMultiCurveModel(calibratedModel, cbiProcess, tenorLengths, tenorNames);\n\t\t\n\t\t//CBIDrivenMultiCurveModel model = new CBIDrivenMultiCurveModel(timeHorizon, numberOfTimeSteps, calibratedModel, tenors, initialValues, immigrationRates, b, sigma, eta, zeta, alpha, lambda);\n\t\t\n\t\tCapletCalibrationProblem problem = new CapletCalibrationProblem(surface, model, optimizerFactory, pricer,initialParameters,parameterStep);\n\t\t\n\t\tSystem.out.println(\"Calibration started\");\n\t\t\n\t\tlong startMillis\t= System.currentTimeMillis();\n\t\tnet.finmath.fouriermethod.calibration.CapletCalibrationProblem.OptimizationResult result = problem.runCalibration();\n\t\tlong endMillis\t\t= System.currentTimeMillis();\n\t\t\n\t\tdouble calculationTime = ((endMillis-startMillis)/1000.0);\n\t\t\n\t\tSystem.out.println(\"Calibration completed in: \" +calculationTime + \" seconds\");\n\t\t\n\t\tSystem.out.println(\"The solver required \" + result.getIterations() + \" iterations.\");\n\t\tSystem.out.println(\"RMSQE \" +result.getRootMeanSquaredError());\n\t\t\n\t\tdouble[] parameters = result.getModel().getParameters();\n\t\tfor(int i =0; i<parameters.length; i++) {\n\t\t\tSystem.out.println(parameters[i]);\n\t\t}\n\t\t\n\t\tArrayList<String> errorsOverview = result.getCalibrationOutput();\n\t\t\n\t\tfor(String myString : errorsOverview)\n\t\t\tSystem.out.println(myString);\n\t\t\n\t\tSystem.out.println(result.getModel().getClass());\n\t\t\n\t\t\n\t\tSystem.out.println(\"Finished.\");\n\t\n\t\t\n\t}", "private List<Map<String, Object>> calcProfit(List<Map<String, Object>> revenue,\n List<Map<String, Object>> dep,\n List<Map<String, Object>> maintenance\n ) {\n int index = 0;\n List<Map<String, Object>> profit = new ArrayList<>();\n\n for (Map<String, Object> item : revenue) {\n \n String key = item.get(\"key\")!=null ? item.get(\"key\").toString() : \"\";\n\n HashMap<String, Object> node = new HashMap<>();\n\n double value = (Double) item.get(\"value\");\n if ((value > -0.00001) && (value < 0.00001)) {\n // revenue equals zero, it should be data input error, therefore, profit will be zero too\n node.put(\"value\", 0.0);\n } else {\n // revenue did not equal to zero, let us calculate profit\n if (dep.get(index).get(\"key\") != null) {\n value = value - (Double) dep.get(index).get(\"value\");\n }\n\n if (maintenance.get(index).get(\"key\") != null) {\n value = value - (Double) maintenance.get(index).get(\"value\");\n }\n node.put(\"value\", value);\n }\n\n node.put(\"key\", key);\n profit.add(node);\n index++;\n }\n\n return profit;\n }", "public IProbabilityFunction generateLinearDistroCPT(ProbabilisticNode probNode) {\r\n\t\tfloat value = 1.0F / probNode.getStatesSize();\r\n\t\tif (!isToNormalize()) {\r\n\t\t\t// if we don't need to normalize, then fill everything with zeros\r\n\t\t\tvalue = 1f;\r\n\t\t}\r\n\t\tPotentialTable table = probNode.getProbabilityFunction();\r\n\t\tif (table != null) {\r\n\t\t\tfor (int i = 0; i < table.tableSize(); i++) {\r\n\t\t\t\t// TODO in float operation, since 1/3 + 1/3 + 1/3 might not be 1, implement some precision control\r\n\t\t\t\ttable.setValue(i, value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn table;\r\n\t}" ]
[ "0.49675936", "0.48108283", "0.48009998", "0.47816962", "0.47122014", "0.4711302", "0.46626073", "0.46270412", "0.46154404", "0.45259142", "0.45154217", "0.4514669", "0.4501271", "0.4466499", "0.4449678", "0.4441388", "0.4426709", "0.44215813", "0.4407837", "0.4400905", "0.43773052", "0.43410978", "0.43223327", "0.4311546", "0.4290393", "0.42829993", "0.4269066", "0.4262082", "0.425995", "0.4248406", "0.42331904", "0.4224876", "0.42173645", "0.4215747", "0.42155153", "0.42109656", "0.4209079", "0.42041922", "0.4181221", "0.41775987", "0.4170447", "0.41665804", "0.4163078", "0.4160509", "0.41603574", "0.41498905", "0.41405413", "0.41353083", "0.41273296", "0.412368", "0.41034612", "0.4097424", "0.40939885", "0.40932378", "0.40931448", "0.40874222", "0.40861732", "0.40829092", "0.40806365", "0.40781853", "0.4075382", "0.40610045", "0.40550905", "0.40535462", "0.40468523", "0.40385634", "0.40383744", "0.40285578", "0.40282375", "0.40281403", "0.40192097", "0.401862", "0.4016716", "0.40156925", "0.40113983", "0.40109557", "0.4007019", "0.4003731", "0.40022126", "0.40018263", "0.40005863", "0.39970046", "0.39963865", "0.39928696", "0.3992137", "0.3985834", "0.3979279", "0.3974932", "0.39716393", "0.39692944", "0.39667594", "0.39647144", "0.396352", "0.39595267", "0.39547443", "0.3952515", "0.39519638", "0.39483994", "0.39472973", "0.39449382" ]
0.47509235
4
Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Nonmerged Govvie Curve Yield Latent State from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
public org.drip.state.estimator.PredictorResponseWeightConstraint govviePRWC ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp, final org.drip.product.calib.ProductQuoteSet pqs) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateCost() throws StandardException {\n\n double baseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE);\n double filterBaseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE,QualifierPhase.FILTER_BASE);\n double projectionSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.FILTER_PROJECTION);\n double totalSelectivity = computeTotalSelectivity(selectivityHolder);\n\n assert filterBaseTableSelectivity >= 0 && filterBaseTableSelectivity <= 1.0:\"filterBaseTableSelectivity Out of Bounds -> \" + filterBaseTableSelectivity;\n assert baseTableSelectivity >= 0 && baseTableSelectivity <= 1.0:\"baseTableSelectivity Out of Bounds -> \" + baseTableSelectivity;\n assert projectionSelectivity >= 0 && projectionSelectivity <= 1.0:\"projectionSelectivity Out of Bounds -> \" + projectionSelectivity;\n assert totalSelectivity >= 0 && totalSelectivity <= 1.0:\"totalSelectivity Out of Bounds -> \" + totalSelectivity;\n\n // Total Row Count from the Base Conglomerate\n double totalRowCount = scc.baseRowCount();\n assert totalRowCount >= 0 : \"totalRowCount cannot be negative -> \" + totalRowCount;\n // Rows Returned is always the totalSelectivity (Conglomerate Independent)\n scanCost.setEstimatedRowCount(Math.round(totalRowCount*totalSelectivity));\n\n double baseTableAverageRowWidth = scc.getBaseTableAvgRowWidth();\n double baseTableColumnSizeFactor = scc.baseTableColumnSizeFactor(totalColumns);\n\n // We use the base table so the estimated heap size and remote cost are the same for all conglomerates\n double colSizeFactor = baseTableAverageRowWidth*baseTableColumnSizeFactor;\n assert baseTableAverageRowWidth >= 0 : \"baseTableAverageRowWidth cannot be negative -> \" + baseTableAverageRowWidth;\n assert baseTableColumnSizeFactor >= 0 : \"baseTableColumnSizeFactor cannot be negative -> \" + baseTableColumnSizeFactor;\n\n double openLatency = scc.getOpenLatency();\n double closeLatency = scc.getCloseLatency();\n double localLatency = scc.getLocalLatency();\n double remoteLatency = scc.getRemoteLatency();\n double remoteCost = openLatency + closeLatency + totalRowCount*totalSelectivity*remoteLatency*(1+colSizeFactor/100d);\n assert openLatency >= 0 : \"openLatency cannot be negative -> \" + openLatency;\n assert closeLatency >= 0 : \"closeLatency cannot be negative -> \" + closeLatency;\n assert localLatency >= 0 : \"localLatency cannot be negative -> \" + localLatency;\n assert remoteLatency >= 0 : \"remoteLatency cannot be negative -> \" + remoteLatency;\n assert remoteCost >= 0 : \"remoteCost cannot be negative -> \" + remoteCost;\n // Heap Size is the avg row width of the columns for the base table*total rows\n // Average Row Width\n // This should be the same for every conglomerate path\n scanCost.setEstimatedHeapSize((long)(totalRowCount*totalSelectivity*colSizeFactor));\n // Should be the same for each conglomerate\n scanCost.setRemoteCost((long)remoteCost);\n // Base Cost + LookupCost + Projection Cost\n double congAverageWidth = scc.getConglomerateAvgRowWidth();\n double baseCost = openLatency+closeLatency+(totalRowCount*baseTableSelectivity*localLatency*(1+congAverageWidth/100d));\n assert congAverageWidth >= 0 : \"congAverageWidth cannot be negative -> \" + congAverageWidth;\n assert baseCost >= 0 : \"baseCost cannot be negative -> \" + baseCost;\n scanCost.setFromBaseTableRows(filterBaseTableSelectivity * totalRowCount);\n scanCost.setFromBaseTableCost(baseCost);\n double lookupCost;\n if (lookupColumns == null)\n lookupCost = 0.0d;\n else {\n lookupCost = totalRowCount*filterBaseTableSelectivity*(openLatency+closeLatency);\n scanCost.setIndexLookupRows(filterBaseTableSelectivity*totalRowCount);\n scanCost.setIndexLookupCost(lookupCost+baseCost);\n }\n assert lookupCost >= 0 : \"lookupCost cannot be negative -> \" + lookupCost;\n\n double projectionCost;\n if (projectionSelectivity == 1.0d)\n projectionCost = 0.0d;\n else {\n projectionCost = totalRowCount * filterBaseTableSelectivity * localLatency * colSizeFactor*1d/1000d;\n scanCost.setProjectionRows(scanCost.getEstimatedRowCount());\n scanCost.setProjectionCost(lookupCost+baseCost+projectionCost);\n }\n assert projectionCost >= 0 : \"projectionCost cannot be negative -> \" + projectionCost;\n\n double localCost = baseCost+lookupCost+projectionCost;\n assert localCost >= 0 : \"localCost cannot be negative -> \" + localCost;\n scanCost.setLocalCost(localCost);\n scanCost.setNumPartitions(scc.getNumPartitions());\n scanCost.setLocalCostPerPartition((baseCost + lookupCost + projectionCost)/scc.getNumPartitions());\n }", "public void InitializeConstraints(boundkey[] bkc, double[] blc, NodesVector nvector, PipesVector pvector,\n\t\t\tTapsVector tvector, double outflow, double PrixMax, double lcom) {\n\t\tNodes nodes;\n\t\tPipes pipes;\n\t\tTaps taps;\n\n\t\t/* Contraintes sur les Nodes - taps */\n\t\tfor (int i = 0; i < (NbNodes - NbTaps - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\tCste[i] = -nodes.height;\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les Taps */\n\t\tfor (int i = NbNodes - NbTaps - 1; i < (NbNodes - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\ttaps = (Taps) tvector.elementAt(i - (NbNodes - NbTaps - 1));\n\n\t\t\tif (taps.orifice == Orifices.MAXDIAM) {\n\t\t\t\tCste[i] = -nodes.height - ((outflow * outflow) / taps.faucetCoef);\n\t\t\t} else {\n\t\t\t\tCste[i] = (-nodes.height\n\t\t\t\t\t\t- (outflow * outflow * ((1 / taps.faucetCoef) + Math.pow(CoefOrif / taps.orifice, 4))));\n\t\t\t}\n\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les longueurs des Pipes */\n\t\tfor (int i = NbNodes - 1; i < (m - 1); i++) {\n\t\t\tpipes = (Pipes) pvector.elementAt(i - NbNodes + 1);\n\n\t\t\tCste[i] = pipes.length;\n\n\t\t\tbkc[i] = mosek.boundkey.fx;\n\t\t\tblc[i] = Cste[i];\n\t\t}\n\n\t\t/* contrainte de prix max */\n\t\tCste[m - 1] = PrixMax;\n\t\tbkc[m - 1] = mosek.boundkey.up;\n\t\tblc[m - 1] = -1.0e30;\n\t}", "public double constrainDemand(double slope, double trialprice)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to constrainDemand : \" + \"Agent\");\r\n/* 175 */ if (this.demand > 0.0D) {\r\n/* 176 */ if (this.demand * trialprice > this.cash - this.mincash)\r\n/* */ {\r\n/* 178 */ if (this.cash - this.mincash > 0.0D) {\r\n/* 179 */ this.demand = ((this.cash - this.mincash) / trialprice);\r\n/* 180 */ slope = -this.demand / trialprice;\r\n/* */ }\r\n/* */ else\r\n/* */ {\r\n/* 184 */ this.demand = 0.0D;\r\n/* 185 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* */ }\r\n/* 192 */ else if ((this.demand < 0.0D) && (this.demand + this.position < this.minholding))\r\n/* */ {\r\n/* */ \r\n/* 195 */ this.demand = (this.minholding - this.position);\r\n/* 196 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* 200 */ return this.demand;\r\n/* */ }", "private void addC1Constraints(GRBVar[][] xVars, GRBModel model) throws GRBException {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tString constraintName = \"constraintC1_\" + i;\n\t\t\t// out_x(i) - in_x(i) = 0\n\t\t\tGRBLinExpr constraintLinExpr = new GRBLinExpr();\n\n\t\t\t// Expression += out_x(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Expression -= in_x(i)\n\t\t\tGRBSolverUtils.addInTerm(i, -1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Add constraint\n\t\t\tmodel.addConstr(constraintLinExpr, GRB.EQUAL, 0, constraintName);\n\t\t}\n\t}", "private void convertReqsInCriterions(){\n\t\tArrayList<Criterion> criteria = this.data.getCriteria();\n\t\t\n\t\tfor(Requirement req : this.data.getRequirements()){\n\t\t\tif(req.isCriterion()){\n\t\t\t\t//create new criterion\n\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\telse\n\t\t\t\t\t//this is a price requirement\n\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\n\t\t\t\tString[] msg = {crit.getName(), \"General\"};\n\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t}\n\t\t\t\t//get the criterion preference direction\n\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcriteria.add(crit);\n\t\t\t}\n\t\t}\n\t\tthis.data.setCriteria(criteria);\n\t\t\n\t\t//convert each serpiceTemplate requirements\n\t\tfor(ServiceTemplate template : this.data.getServiceTemplates()){\n\t\t\tArrayList<Criterion> templateCriteria = template.getCriteria();\n\t\t\tfor(Requirement req: template.getRequirements()){\n\t\t\t\tif(req.isCriterion()){\n\t\t\t\t\t//create new criterion\n\t\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\t\telse\n\t\t\t\t\t\t//this is a price requirement\n\t\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\t\n\t\t\t\t\tString[] msg = {crit.getName(), template.getType()};\n\t\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//get the criterion preference direction\n\t\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\ttemplateCriteria.add(crit);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemplate.setCriteria(templateCriteria);\n\t\t}\n\t}", "private void generalizeCSARequirements(){\n\t\tArrayList<ServiceTemplate> comps = new ArrayList<ServiceTemplate>() ;\n\t\tArrayList<Requirement> reqs = new ArrayList<Requirement>() ;\n\t\t\n\t\tcomps = this.data.getServiceTemplates();\n\t\treqs = this.data.getRequirements();\n\t\t\n\t\tfor(ServiceTemplate c : comps){\n\t\t\tfor(Requirement r : reqs){\n\t\t\t\tRequirement temp = new Requirement();\n\t\t\t\ttry {\n\t\t\t\t\tBeanUtils.copyProperties(temp, r);\n\t\t\t\t\t//System.out.println(r.toString());\n\t\t\t\t\t//System.out.println(temp.toString());\n\t\t\t\t\tc.addReq(temp);\n\t\t\t\t} catch (IllegalAccessException | InvocationTargetException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\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 }", "protected void addConstraints() throws IloException {\n// Constrain (2)\n for (int i = 0; i < m; i++) {\n IloLinearNumExpr expr_2 = model.linearNumExpr();\n for (int j = 0; j < n; j++) {\n expr_2.addTerm(x[i][j], 1);\n }\n model.addLe(expr_2, supply[i]);\n }\n\n // Constrain (3)\n for (int j = 0; j < n; j++) {\n IloLinearNumExpr expr_3 = model.linearNumExpr();\n for (int i = 0; i < m; i++) {\n expr_3.addTerm(x[i][j], 1);\n }\n model.addEq(expr_3, demands[j]);\n }\n }", "public double calculateGoodness(CongressionalDistrict cd, int year){\n goodness = 0;\r\n Iterator<Constraint> iterate = constraints.iterator();\r\n iterate.forEachRemaining(c -> {\r\n goodness += -10*c.calculateConstraint(stateStats,cd,year);\r\n });\r\n for(int i=0; i<measures.size();i++){\r\n \r\n Integer gc = weights.get(measures.get(i).name);\r\n if(gc != null){\r\n double x = measures.get(i).calculate(stateStats,cd,year);\r\n goodness += gc*x;\r\n }\r\n }\r\n \r\n return goodness;\r\n }", "public static String generateNegativeConstraintsConjunct(GenerateCVC1 cvc, QueryBlockDetails queryBlock, Conjunct conjunct) throws Exception {\n\n\t\t\n\t\tString constraintString = \"\";\n\n\t\tconstraintString += \"%--------------------------------\\n%NEGATIVE CONSTRAINTS FOR THIS CONJUNCT\\n%---------------------------------------\\n\";\n\t\t\n\t\tVector<String> OrConstraints=new Vector<String>();\n\t\tVector<String> OrStringConstraints = new Vector<String>();\n\n\t\t/** Generate negative constraint for equivalence class.*/\n\t\t/**FIXME: Mahesh..Ask Amol why the below code and why cant't we use getconstraintsforequijoins()*/\n\t\tif(!conjunct.getEquivalenceClasses().isEmpty()){\n\n\t\t\t/**Get the equivalence classes*/\n\t\t\tVector<Vector<Node>> equivalenceClasses = conjunct.getEquivalenceClasses();\n\n\t\t\tfor(int i=0; i<equivalenceClasses.size(); i++){\t/** For each equivalence class list*/\n\n\t\t\t\t/**Get this equivalence */\n\t\t\t\tVector<Node> ec = equivalenceClasses.get(i);\n\n\t\t\t\t/**for each node in this equivalence*/\n\t\t\t\tfor(int j=0;j<ec.size(); j++)\n\t\t\t\t{\n\n\t\t\t\t\tNode eceNulled = ec.get(j);\t\t\t/** This is R.a - to be nulled */\n\n\n\t\t\t\t\tString CVCStr = \"%DataSet Generated By Nulling: \"+ ((Node)eceNulled).toString() + \"\\n\";\n\t\t\t\t\tTable tableNulled = eceNulled.getTable();\n\t\t\t\t\tColumn colNulled = eceNulled.getColumn();\n\n\t\t\t\t\t/** TODO: Have one vector for positive and negative conditions. */\n\n\t\t\t\t\tcvc.setResultsetTableColumns1( new HashMap<Table, Vector<String>>() );\t\t\t\t\t\n\n\t\t\t\t\t/** S = set of elements in ec which have a foreign key relationship with R.a <use closure for this> */\n\t\t\t\t\tArrayList<Node> S = new ArrayList<Node>();\n\t\t\t\t\tVector<Node> nullableFKs = new Vector<Node>();\n\t\t\t\t\tS.add(eceNulled);\n\n\t\t\t\t\tfor(int k=0; k<ec.size(); k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tNode ece = ec.get(k);\n\t\t\t\t\t\tTable tableEce = ece.getTable();\n\t\t\t\t\t\tColumn colEce = ece.getColumn();\n\t\t\t\t\t\t/**TODO Maintain a datasructure for list of PK and FK so as to compare in one pass.*/\n\t\t\t\t\t\tfor(int l=0; l < cvc.getForeignKeys().size(); l++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/**In ForeignKeys Left points to the foreign key attribute while the right points to the Primary or the referenced column*/\n\t\t\t\t\t\t\tNode fk = cvc.getForeignKeys().get(l);\n\n\t\t\t\t\t\t\t/**Adapted for Nullable foreign keys.\n\t\t\t\t\t\t\t *If FK is not nullable, then we need to null it along with the referenced relation which is eceNulled*/\n\t\t\t\t\t\t\tif( (fk.getLeft().getTable() == tableEce && fk.getLeft().getColumn() == colEce) \n\t\t\t\t\t\t\t\t\t&& (fk.getRight().getTable() == tableNulled && fk.getRight().getColumn() == colNulled)){\n\t\t\t\t\t\t\t\tif(!colEce.isNullable())\n\t\t\t\t\t\t\t\t\tS.add(ece);/**To be taken along with nulled Column*/\n\t\t\t\t\t\t\t\tif(colEce.isNullable())\n\t\t\t\t\t\t\t\t\tnullableFKs.add(ece);/** To be taken along with nulled column, in case P.size > 1 */\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Now, we have in S, the nulled column along with the foreign key columns in that equivalence class\n\t\t\t\t\t * that reference the nulled column and are not nullable.\n\t\t\t\t\t * But, if EC - S, contains a nullable column which references the nulled column, \n\t\t\t\t\t * AND also contains some other column which may or may not be nullable, \n\t\t\t\t\t * then we cannot assign NULL to the nullable FK column. We then need to nullify the nullable FK column\n\t\t\t\t\t * along with the nulled column. If EC - S, just contains a single nullable column referencing the \n\t\t\t\t\t * nulled column, then we can assign NULL to that column in order to nullify the nulled column. \n\t\t\t\t\t */\n\n\n\t\t\t\t\t/** Form P = EC - S */\n\t\t\t\t\tVector<Node> P = new Vector<Node>();\n\t\t\t\t\tfor(int k=0; k<ec.size(); k++)\t\t\t\t\t\t\n\t\t\t\t\t\tif( cvc.getqParser().alreadyNotExistInEquivalenceClass(S, ec.get(k)))\n\t\t\t\t\t\t\tP.add(ec.get(k));\n\n\n\t\t\t\t\tSystem.out.println(\"R.a = \"+eceNulled);\n\t\t\t\t\tSystem.out.print(\"EC : \"); Node.printPredicateVector(ec);\n\n\t\t\t\t\t/**For Now : if P is empty continue;*/\n\t\t\t\t\tif(P.size() == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif(P.size() == 1 \n\t\t\t\t\t\t\t&& P.get(0).getColumn().getReferenceColumn() == eceNulled.getColumn()\n\t\t\t\t\t\t\t&& P.get(0).getColumn().isNullable()){\n\n\t\t\t\t\t\t/**check if the column in P is referencing the nulled column and is nullable.\n\t\t\t\t\t\t *If so, then we can nullify the nulled relation inspite of the FK*/\n\t\t\t\t\t\tOrConstraints.add( GenerateCVCConstraintForNode.cvcSetNull(cvc, P.get(0).getColumn(), \"1\"));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t/**Otherwise, we need to nullify the foreign keys along with the nulled column.\n\t\t\t\t\t\t * Note that we need to do this irrespective of whether the column in P is FK \n\t\t\t\t\t\t * or whether it is nullable. Because, then we cannot assign NULL to any of the columns in P\n\t\t\t\t\t\t * This is because, NULLs cannot be equated and hence the joins in P will not be propogated up.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tP.removeAll(nullableFKs);\n\n\t\t\t\t\t\t/** Generate positiveConds for members in P*/ \n\t\t\t\t\t\tGenerateJoinPredicateConstraints.genPositiveConds(P);\n\t\t\t\t\t}\n\n\t\t\t\t\t/**Now generate negative conditions for Nulled relation\n\t\t\t\t\t *i.e. NOT EXISTS (i: Nulled Rel): NulledRel[i].col = P[1].col*/\n\t\t\t\t\tOrConstraints.add( GenerateJoinPredicateConstraints.genNegativeConds( cvc, queryBlock, colNulled, P.get(0)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\n\t\t/**Now generate Positive conditions for each of the non equi join conditions \n\t\t * that were not considered when building equivalence classes*/\n\t\tVector<Node> allConds = conjunct.getAllConds();\n\t\t\n\t\t/**get constraint*/\n\t\tString constraint = GenerateJoinPredicateConstraints.getNegativeConstraintsForNonEquiJoins(cvc, queryBlock, allConds) ;\n\n\t\tif( constraint.length() != 0)\n\t\t\tOrConstraints.add( constraint );\n\n\t\t/** Now generate Negative constraints for selection conditions */\n\t\tVector<Node> selectionConds = conjunct.getSelectionConds();\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeSelConds = GenerateCVCConstraintForNode.getNegativeConditions(selectionConds);\n\n\t\t/**Generate constraints for the negative conditions*/\n\t\tfor(int k = 0; k < negativeSelConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeSelConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l = 1; l <= count; l++)\n\t\t\t\tOrConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeSelConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\n\t\t/**Generate negative constraints for string selection conditions */\n\t\tVector<Node> stringSelectionConds = conjunct.getStringSelectionConds();\t\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeStringSelConds = GenerateCVCConstraintForNode.getNegativeConditions(stringSelectionConds);\n\n\t\t/**Generate constraints for the negative conditions*/\n\t\tfor(int k = 0; k < negativeStringSelConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeStringSelConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l = 1; l <= count; l++)\n\t\t\t\tOrStringConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeStringSelConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\t\t/**Generate negative constraints for like conditions */\n\t\tVector<Node> likeConds = conjunct.getLikeConds();\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeLikeConds = GenerateCVCConstraintForNode.getNegativeConditions(likeConds);\n\n\t\tfor(int k=0; k<likeConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeLikeConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l=1;l<=count;l++)\n\t\t\t\tOrStringConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeLikeConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\t\t/**get the where clause sub query conditions in this conjunct*/\n\t\tif(conjunct.getAllSubQueryConds() != null){\n\t\t\tfor(int i=0; i < conjunct.getAllSubQueryConds().size(); i++){\n\t\t\t\t\n\t\t\t\tNode subQ = conjunct.getAllSubQueryConds().get(i);\n\t\t\t\t\n\t\t\t\t/**FIXME: Add negative constraints for this where clause sub query block\n\t\t\t\t * We could use methods of class: GenerateConstraintsForWhereClauseSubQueryBlock*/\n\t\t\t\t/**FIXME:If the given conjunct has NOT EXISTS conditions, then negative of that becomes positive*/\n\t\t\t\tint index = UtilsRelatedToNode.getQueryIndexOfSubQNode(subQ);\n\n\t\t\t\t/**get sub query block*/\n\t\t\t\tQueryBlockDetails subQuery = queryBlock.getWhereClauseSubQueries().get(index);\n\t\t\t\t\n\t\t\t\tString negativeConstraint = \"\";\n\t\t\t\t\n\t\t\t\t/**if this sub query is of EXISTS Type*/\n\t\t\t\tif(subQ.getType().equals(Node.getExistsNodeType()) ){\n\t\t\t\t\t\n\t\t\t\t\tfor (Conjunct con: subQuery.getConjuncts())\n\t\t\t\t\t\tnegativeConstraint += generateNegativeConstraintsConjunct(cvc, subQuery, con);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**if sub query is of type NOT Exists*/\n\t\t\t\t/**We need to get positive constraints for this sub query*/\n\t\t\t\telse if ( subQ.getType().equals(Node.getNotExistsNodeType() ) ){\n\t\t\t\t\t\n\t\t\t\t\tfor (Conjunct con: subQuery.getConjuncts())\n\t\t\t\t\t\tnegativeConstraint += getConstraintsForConjuct(cvc, queryBlock, con);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\t/**get negative condition for this sub query node*/\n\t\t\t\t\tNode subQNegative = GenerateCVCConstraintForNode.getNegativeCondition(subQ);\n\t\t\t\t\t\n\t\t\t\t\t/**get negative constraints for where clause connective*/\t\t\t\t\t\n\t\t\t\t\tnegativeConstraint = GenerateConstraintsForWhereClauseSubQueryBlock.getConstraintsForWhereSubQueryConnective(cvc, queryBlock, subQNegative);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconstraintString += negativeConstraint;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!OrConstraints.isEmpty() && OrConstraints.size() != 0)\n\t\t\tconstraintString += processOrConstraints(OrConstraints);\n\t\tconstraintString += \"\\n%--------------------------------\\n%END OF NEGATIVE CONSTRAINTS FOR THIS CONJUNCT\\n%---------------------------------------\";\n\n\t\tif(!OrStringConstraints.isEmpty() && OrStringConstraints.size() != 0 )\n\t\t\tcvc.getStringConstraints().add(processOrConstraints(OrStringConstraints));\n\n\t\treturn constraintString;\n\t}", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "public void calculateCG() {\n\n\t\t//-------------------------------------------------------------\n\t\t// Lateral faces xCG calculation (LFR = Local Reference Frame):\n\t\tList<Double[]> xCGLateralFacesLFRList = new ArrayList<Double[]>();\n\t\t\n\t\tfor(int i=0; i<this._prismoidsLength.size(); i++) {\n\t\t\t\n\t\t\tDouble[] xCGLateralFacesLFR = new Double[4];\n\t\t\t\n\t\t\txCGLateralFacesLFR[0] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[1] = this._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[2] = this._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i+1).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[3] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFRList.add(xCGLateralFacesLFR);\n\t\t}\n\t\t\n\t\t//-------------------------------------------------------------\n\t\t// Calculation of the Xcg coordinates of each prismoid in wing LRF.\n\t\t\n\t\tList<Amount<Length>> xCGPrismoidsList = new ArrayList<Amount<Length>>();\n\t\t\n\t\tfor(int i=0; i<xCGLateralFacesLFRList.size(); i++) {\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseY = new double[2];\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseY = new double[2];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceSpanwiseX[0] = this._fuelTankStations.get(i).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseX[1] = this._fuelTankStations.get(i+1).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[0];\n\t\t\txCGSegmentOppositeFaceSpanwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i+1).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[2];\n\n\t\t\txCGSegmentOppositeFaceChordwiseX[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[3]; \n\t\t\txCGSegmentOppositeFaceChordwiseX[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[1];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceChordwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\txCGSegmentOppositeFaceChordwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ ((this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getSecondarySparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()));\n\n\t\t\t// check if the chordwise X array is monotonic increasing\n\t\t\tif(xCGSegmentOppositeFaceChordwiseX[1] - xCGSegmentOppositeFaceChordwiseX[0] < 0.0001)\n\t\t\t\txCGSegmentOppositeFaceChordwiseX[0] -= 0.0001; \n\t\t\t\n\t\t\t// now that the segments coordinates are calculated, we have to intersect these latter.\n\t\t\txCGPrismoidsList.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tMyMathUtils.getInterpolatedValue1DLinear(\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseX,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseY,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceChordwiseX[0]),\n\t\t\t\t\t\t\tSI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n xCG list = \" + xCGPrismoidsList);\n\t\t\n\t\t_xCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\tfor(int i=0; i<this._prismoidsVolumes.size(); i++)\n\t\t\t_xCGLRF = _xCGLRF.plus(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tthis._prismoidsVolumes.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t*xCGPrismoidsList.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t, SI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t_xCGLRF = _xCGLRF.divide(this._fuelVolume.divide(2).getEstimatedValue());\n\t\t_xCG = _xCGLRF.plus(_theWing.getXApexConstructionAxes());\n\t\t\n\t\t_yCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t_yCG = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\t_zCGLRF = _theWing.getTheBalanceManager().getCG().getZLRF();\n\t\t_zCG = _theWing.getTheBalanceManager().getCG().getZBRF();\n\t\t\n\t\t_cG = new CenterOfGravity();\n\t\t_cG.setX0(_theWing.getXApexConstructionAxes().to(SI.METER));\n\t\t_cG.setY0(_theWing.getYApexConstructionAxes().to(SI.METER));\n\t\t_cG.setZ0(_theWing.getZApexConstructionAxes().to(SI.METER));\n\t\t_cG.setXLRF(_xCGLRF.to(SI.METER));\n\t\t_cG.setYLRF(_yCGLRF.to(SI.METER));\n\t\t_cG.setZLRF(_zCGLRF.to(SI.METER));\n\t\t\n\t\t_cG.calculateCGinBRF(ComponentEnum.FUEL_TANK);\n\t\t\n\t}", "public JSONObject getCNForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n List<Object> cnData = accEntityGstDao.getCNDNWithInvoiceDetailsInSql(reqParams);\n List<Object> cnWithoutInventory = accEntityGstDao.getCNAgainstCustomer(reqParams);\n if (cnWithoutInventory != null && !cnWithoutInventory.isEmpty()) {\n cnData.addAll(cnWithoutInventory);\n }\n /**\n * Add data for Cash Sales refund \n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"paymententitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"paymententityValue\"));\n List<Object> refundlist = accEntityGstDao.getCashRefundWithInvoiceDetailsInSql(reqParams);\n if (refundlist != null && refundlist.size() > 0) {\n cnData.addAll(refundlist);\n } \n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n\n totalAmountCN = (Double) data[3];\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\",authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n jSONObject = accGSTReportService.getCreditNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n }\n return jSONObject;\n }", "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "@TaDaMethod(variablesToTrack = {\"ssn\", \"weekWage\", \"workWeeks\", \"ssn2\",\n\t\t\t\"capitalGains\", \"capitalLosses\", \"stockDividends\"}, \n\t\t\tcorrespondingDatabaseAttribute = {\"job.ssn\", \"job.WEEKWAGE\", \"job.WORKWEEKS\", \"investment.ssn\",\n\t\t\t\"investment.CAPITALGAINS\", \"investment.CAPITALLOSSES\", \"investment.STOCKDIVIDENDS\"})\n\tprivate void calculateSlopesAndIntercepts(){\n\t\tHashMap<Integer, Integer> ssnWeekWage = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnWorkWeeks = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnInvestmentIncome = new HashMap<Integer, Integer>();\n\t\t\n\t\ttry {\n\t\t\tstatement = Factory.getConnection().createStatement();\n\t results = statement.executeQuery(\"SELECT SSN, WEEKWAGE, WORKWEEKS from job\"); \n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"WEEKWAGE\") == null || results.getString(\"WORKWEEKS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn = results.getInt(\"SSN\");\n\t \tint weekWage = results.getInt(\"WEEKWAGE\");\n\t \tint workWeeks = results.getInt(\"WORKWEEKS\");\n\t \t\n\t \tssnWeekWage.put(ssn, weekWage);\n\t \tssnWorkWeeks.put(ssn, workWeeks);\n\t }\n\t \n\t results = statement.executeQuery(\"SELECT SSN, CAPITALGAINS, CAPITALLOSSES, STOCKDIVIDENDS from investment\");\n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"CAPITALGAINS\") == null || results.getString(\"CAPITALLOSSES\") == null || results.getString(\"STOCKDIVIDENDS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn2 = results.getInt(\"SSN\");\n\t \tint capitalGains = results.getInt(\"CAPITALGAINS\");\n\t \tint capitalLosses = results.getInt(\"CAPITALLOSSES\");\n\t \tint stockDividends = results.getInt(\"STOCKDIVIDENDS\");\n\t \tint investmentIncome = capitalGains + stockDividends + capitalLosses;\n\t \t\n\t \tssnInvestmentIncome.put(ssn2, investmentIncome);\n\t }\n\t \n\t // Calculate Cofficients\n\t // Build an array list of Work Weeks and an array list of Income;\n\t ArrayList<Integer> workWeeksList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeList = new ArrayList<Integer>();\n\t ArrayList<Integer> weeklyWageList = new ArrayList<Integer>();\n\t ArrayList<Integer> investmentList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeListForInvestment = new ArrayList<Integer>();\n\t \n\t for (Iterator<Integer> i = ssnWorkWeeks.keySet().iterator(); i.hasNext();){\n\t \tint SSNkey = (Integer) i.next();\n\t \tif(ssnWorkWeeks.get(SSNkey) != null && ssnWeekWage.get(SSNkey) != null){\n\t\t \tint workWeeks = (Integer) ssnWorkWeeks.get(SSNkey);\n\t\t \tint weekWage = (Integer) ssnWeekWage.get(SSNkey);\n\t\t \tif(workWeeks > 0 && weekWage > 0){\n\t\t \t\tworkWeeksList.add(workWeeks);\n\t\t\t \tincomeList.add(workWeeks * weekWage);\n\t\t\t \tweeklyWageList.add(weekWage);\n\t\t\t \tif(ssnInvestmentIncome.get(SSNkey) != null && ssnInvestmentIncome.get(SSNkey) != null){\n\t\t\t \t\tint investmentIncome = (Integer) ssnInvestmentIncome.get(SSNkey);\n\t\t\t \t\tinvestmentList.add(investmentIncome);\n\t\t\t \t\tincomeListForInvestment.add(workWeeks * weekWage);\n\t\t\t \t}\n\t\t \t}\n\t \t}\n\t }\n\t \n\t // Set the member variable for the cofficients for given Work Weeks find Income\n\t workWeeksFindIncome = new CalculateRegression().calculateRegressionNumbers(workWeeksList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given Weekly Wage find Income\n\t weeklyWageFindIncome = new CalculateRegression().calculateRegressionNumbers(weeklyWageList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given InvestmentIncome find Income \n\t investmentIncomeFindIncome = new CalculateRegression().calculateRegressionNumbers(investmentList,incomeListForInvestment);\n\t \n\t\t} catch (SQLException e) {\n\t while (e != null)\n\t {\n\t System.err.println(\"\\n----- SQLException -----\");\n\t System.err.println(\" SQL State: \" + e.getSQLState());\n\t System.err.println(\" Error Code: \" + e.getErrorCode());\n\t System.err.println(\" Message: \" + e.getMessage());\n\t // for stack traces, refer to derby.log or uncomment this:\n\t //e.printStackTrace(System.err);\n\t e = e.getNextException();\n\t }\n\t\t}\t\n\t\t\n\t}", "@Test\r\n\tpublic void testGetPlannedCapacity_Nonlinear() {\n\t\tassertEquals(car.sumUsedPhases*900.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*300.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*1200.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 1500), 1e-8);\r\n\t\t\r\n\t}", "private NbaRequirementResponseVO processRequirements(NbaRequirementRequestVO reqRequestVO) throws NbaBaseException {\n NbaRequirementResponseVO reqRespVO = new NbaRequirementResponseVO();\n String partyID = null;\n long personCode;\n long personSeq;\n List insuredRelations = reqRequestVO.getRelationsToUpdate();\n int count = insuredRelations.size(); \n NbaTXLife nbaTXLife = reqRequestVO.getNbaTXLife();\n NbaDst nbaDst = reqRequestVO.getNbaDst();\n reqRespVO.setReqMap(new HashMap(count));\n setPartyMapForLastReqIndicator(reqRequestVO);//NBLXA186-NBLXA1271\n for (int i = 0; i < count; i++) {\n Relation relation = (Relation) insuredRelations.get(i);\n partyID = relation.getRelatedObjectID();\n personCode = relation.getRelationRoleCode();\n personSeq = Long.parseLong(relation.getRelatedRefID());\n List requirements = (List) reqRequestVO.getReqMap().get(partyID);\n if (requirements != null) {\n commitRequirements(reqRequestVO, requirements, partyID, personCode, personSeq, nbaTXLife, nbaDst);\n //TODO passing map back to see if we can make commit/retrieve more efficient\n reqRespVO.getReqMap().put(partyID, requirements);\n }\n }\n reqRespVO.setNbaTXLife(nbaTXLife);\n reqRespVO.setNbaDst(nbaDst);\n return reqRespVO;\n \n }", "public ConstraintChecker(\n\t\t\tArrayList<TimeSlot> cSlots, \n\t\t\tArrayList<TimeSlot> lSlots, \n\t\t\tArrayList<Pair<Course, Course>> notCompat,\n\t\t\tArrayList<Pair<Course, TimeSlot>> unWant,\n\t\t\tArrayList<Pair<Course, TimeSlot>> parts,\n\t\t\tArrayList<Triple<TimeSlot, Course, Integer>> pref,\n\t\t\tArrayList<Pair<Course, Course>> pair)\n\t\n\t{\n\t\tcourseSlots = cSlots;\n\t\tlabSlots = lSlots;\n\t\tnotCompatible = notCompat;\n\t\tunwanted = unWant;\n\t\tpartials = parts;\n\t\tpreferences = pref;\n\t\tpairs = pair;\n\t}", "private void BC_duct(Grid gr){\r\n int i, j;\t\t\r\n NSmax=(int)(20/dt); repL=0.1;\r\n\t\t\r\n // boundary conditions of lower side of computational domain\r\n for(i = 0; i<mx; i++) BClow[i]=\"wall\"; \r\n // boundary conditions of upper side \r\n for(i = 0; i<mx; i++) BCupp[i]=\"wall\";\r\n // boundary conditions of left side\r\n for(j = 0; j<my; j++) BClef[j]=\"in\";\r\n // boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\r\n\t\r\n // initial conditions\r\n //for(j = 1; j <mym; j++){ \r\n // u[0][j]=Umean; //2.0*Umean*(1.0-4.0*(gr.y[0][j]-0.5)*(gr.y[0][j]-0.5));\r\n //}\r\n for(i = 0; i < mx; i++){ \r\n for(j = 1; j<mym; j++) u[i][j]=Umean;\r\n }\r\n // xmin=1.6; ymin=-3; xmax=8.6; ymax=3;\r\n }", "@Test\r\n\tpublic void testGetPlannedCapacity_Linear_Interval() {\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\t\t\r\n\t\t\r\n\t}", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public void controlPointsChanged(List<Coordinates> lcp) {\n // sort the control points by x position.\n // this makes things easier later when we paint the function.\n lcp.sort(\n (point1,point2) -> Integer.compare(point1.getX(),point2.getX())\n );\n\n // collect the points in an array before doing the calculations.\n // again, this makes things easier for us.\n controlPoints=lcp.toArray(new Coordinates[0]);\n n=controlPoints.length;\n if(n<2) {\n // nothing to do here\n return;\n }\n double []X = new double[n];\n double []Y = new double[n];\n for(int i =0;i<n;i++){\n \tX[i]=controlPoints[i].getX();\n \tY[i]=controlPoints[i].getY();\n }\n // Construct the linear system S*C=T with n-2 equations.\n // The matrix S contains the left hand side of the equations on slide 13.\n // The matrix Z contains the right hand side of the equations on slide 13.\n double[][] S=new double[n-2][n-2];\n double[] Z=new double[n-2];\n \n // Fill the matrix S and the vector Z and solve S*C=T to get c_2 to c_{n-1}.\n for(int i = 0; i< n-3;i++){\n \tS[i][i]=2*delta(X,i+1,0);\n \tS[i+1][i]=delta(X,i+2,-1);\n \tS[i][i+1]=delta(X,i+1,1);\n \tZ[i]=z(Y,X,i);\n }\n S[n-2][n-2]=2*delta(X,n-1,0);\n \n C= EliminationGaussLegendre.solve(S, Z);\n \n // Calculate the n-1 coefficients b_i and d_i.\n // Note that you need all c_i here (but you know that c_1 and c_n are zero).\n //a_i = y_i;\n for(int i=1 ; i<n ; i++){\n \tD[i-1]=d(Y,X,i-1);\n \tB[i-1]=b(Y,C,X,i-1);\n }\n \n }", "@Test\n public void testPrediction1() throws Exception {\n\n final CalUtils.InstantGenerator instantGenerator =\n new LocalTimeMinutes(5);\n \n final double coreDailyVols[][] = new double[][] {\n new double[] {55219 , 262256 , 202661 , 218359 , 178244 , 99610 , 92348 , 124795 , 214370 , 153854 , 204116 , 173501 , 85390 , 156835 , 108070 , 23755 , 118573 , 70117 , 55768 , 52643 , 71485 , 407645 , 442909 , 129109 , 188896 , 79590 , 422121 , 290067 , 227955 , 69257 , 41634 , 446002 , 579188 , 86237 , 1606794 , 83676 , 166393 , 84987 , 875905 , 117013 , 399084 , 116190 , 149507 , 207221 , 60857 , 155612 , 448006 , 198637 , 67695 , 65423 , 180038 , 88774 , 80273 , 86065 , 85231 , 38867 , 29330 , 116353 , 26887 , 34170 , 102518 , 72246 , 21274 , 70752 , 37912 , 49367 , 100472 , 49461 , 41735 , 45795 , 36578 , 311945 , 249039 , 70487 , 121906 , 136424 , 195136 , 166308 , 331734 , 343180 , 419616 , 104613 , 1354058 , 162678 , 141067 , 147039 , 149115 , 271162 , 543989 , 184421 , 340679 , 201939 , 293860 , 171035 , 263964 , 260198 , 428087 , 565126 , 385874 , 547890 , 384416 , 256696 , 0 , 4738359},\n new double[] {1298630 , 678084 , 488607 , 224766 , 434263 , 356933 , 576571 , 219236 , 252805 , 414776 , 166828 , 174665 , 146281 , 110944 , 145234 , 179739 , 253111 , 175685 , 64925 , 216682 , 494507 , 100205 , 67371 , 101019 , 158026 , 316281 , 334067 , 954850 , 115547 , 163051 , 130303 , 107600 , 1407996 , 90357 , 110452 , 451866 , 238004 , 3096215 , 2672803 , 190170 , 111282 , 107135 , 453389 , 60821 , 98292 , 1310864 , 1132267 , 241907 , 89915 , 175676 , 61621 , 521553 , 212388 , 288651 , 193578 , 272161 , 256777 , 236382 , 802159 , 230248 , 387068 , 160647 , 106999 , 391933 , 465080 , 374577 , 340378 , 330708 , 416320 , 200347 , 251986 , 336664 , 311970 , 600559 , 508011 , 922379 , 311581 , 352459 , 508727 , 159316 , 1355635 , 246541 , 389672 , 805957 , 370754 , 382556 , 316971 , 564228 , 437166 , 277733 , 1284505 , 1763095 , 169661 , 280682 , 969102 , 540315 , 451895 , 308036 , 715130 , 642966 , 981563 , 900778 , 0 , 7155528},\n new double[] {679280 , 229518 , 346536 , 347215 , 316025 , 313890 , 235844 , 199995 , 1920617 , 129356 , 172084 , 207860 , 317578 , 10369008 , 480990 , 1403537 , 1021730 , 156125 , 94833 , 366987 , 145687 , 322957 , 328120 , 66657 , 176001 , 271003 , 133121 , 558624 , 264638 , 638663 , 165080 , 129439 , 5126344 , 5438632 , 248806 , 250616 , 112716 , 54523 , 198097 , 67772 , 1414565 , 244509 , 246205 , 151540 , 98584 , 51217 , 94193 , 111763 , 104726 , 45880 , 64242 , 78893 , 60706 , 48117 , 133085 , 101941 , 5103803 , 5084823 , 168230 , 75537 , 815036 , 73409 , 422412 , 437127 , 115802 , 326536 , 54707 , 81759 , 94420 , 208637 , 50361 , 1458556 , 84257 , 129114 , 54632 , 105873 , 57165 , 77578 , 233302 , 195560 , 134194 , 180928 , 140433 , 123154 , 221422 , 339866 , 1343886 , 114699 , 170052 , 150679 , 181731 , 160943 , 192590 , 125556 , 132656 , 154740 , 320932 , 140929 , 117889 , 381656 , 393635 , 306177 , 0 , 21629250},\n new double[] {526909 , 167180 , 199570 , 149154 , 142141 , 320881 , 223750 , 102275 , 258400 , 202197 , 120202 , 93404 , 178631 , 106401 , 346186 , 231729 , 163656 , 1622531 , 125689 , 2656587 , 5336032 , 2385985 , 335692 , 86118 , 130551 , 99047 , 81695 , 98846 , 238413 , 4831684 , 293262 , 124652 , 106642 , 112048 , 14284646 , 111209 , 2204635 , 128940 , 83395 , 134816 , 116320 , 65412 , 165020 , 126511 , 92217 , 111751 , 47320 , 82219 , 19044177 , 70827 , 21676 , 211214 , 103108 , 22771 , 61629 , 4816563 , 63806 , 33989 , 130104 , 146897 , 15046441 , 44977 , 40889 , 54584 , 54591 , 76634 , 238536 , 68583 , 110591 , 75012 , 503760 , 209479 , 217929 , 86397 , 102284 , 81878 , 252785 , 135884 , 129149 , 112760 , 266851 , 110863 , 67866 , 55205 , 150165 , 699438 , 184450 , 270270 , 4270036 , 345303 , 895116 , 217142 , 145398 , 301231 , 10260595 , 136317 , 442910 , 371357 , 189023 , 538928 , 438973 , 926728 , 9137 , 8879481},\n new double[] {1318228 , 1391326 , 574558 , 441739 , 719144 , 522626 , 404351 , 383602 , 490710 , 284952 , 2984474 , 216339 , 10220195 , 247067 , 166223 , 224310 , 10181837 , 126161 , 9764418 , 692337 , 25907353 , 1518741 , 1179929 , 120730 , 10173292 , 290045 , 19824327 , 402527 , 277859 , 3116841 , 7164061 , 332021 , 10560006 , 2334129 , 121753 , 200177 , 246402 , 10106648 , 1137272 , 2084673 , 461849 , 125108 , 465907 , 156972 , 139083 , 127389 , 237263 , 311691 , 156536 , 155322 , 133368 , 329715 , 256088 , 116835 , 5192615 , 823762 , 183836 , 1110239 , 2414836 , 385072 , 599637 , 387285 , 291580 , 2796924 , 12977051 , 338582 , 884415 , 525622 , 322587 , 223348 , 668858 , 143039 , 627590 , 239797 , 232788 , 256503 , 209425 , 375474 , 558106 , 290991 , 1176648 , 286550 , 149539 , 297435 , 602136 , 152733 , 212363 , 178992 , 179644 , 295428 , 933636 , 349405 , 660749 , 226061 , 868852 , 318539 , 469303 , 538061 , 273643 , 444084 , 347730 , 825808 , 12011 , 7792372}};\n\n final SimpleDateFormat dateBuilder = new SimpleDateFormat(\"yyyy-MM-dd\");\n final Calendar moments[] = new Calendar[] { Calendar.getInstance(), \n Calendar.getInstance(), Calendar.getInstance(), \n Calendar.getInstance(), Calendar.getInstance(),\n Calendar.getInstance() };\n\n moments[0].setTime(dateBuilder.parse(\"2011-10-26\"));\n moments[1].setTime(dateBuilder.parse(\"2011-10-27\"));\n moments[2].setTime(dateBuilder.parse(\"2011-10-28\"));\n moments[3].setTime(dateBuilder.parse(\"2011-10-30\"));\n moments[4].setTime(dateBuilder.parse(\"2011-11-01\"));\n moments[5].setTime(dateBuilder.parse(\"2011-11-02\"));\n\n // Nomralize data to sum 100 (i.e., have an expectance of 100/104)\n for(int i=0; i<5; i++) {\n double sum = 0;\n for(int j=0; j<104; j++) sum += coreDailyVols[i][j];\n for(int j=0; j<104; j++) {\n coreDailyVols[i][j] = coreDailyVols[i][j]*100 / sum;\n }\n }\n\n final double[][] synthesizedDailyVols = new double[\n coreDailyVols.length][instantGenerator.maxInstantValue()];\n final Calendar openTime = Calendar.getInstance();\n final int n = 9*60 / 5;\n final int m = n + coreDailyVols[0].length;\n for(int i=0; i<5; i++) {\n for(int j=0; j<n; j++) {\n synthesizedDailyVols[i][j] = Double.NaN;\n }\n for(int j=0; j<coreDailyVols[i].length; j++) {\n synthesizedDailyVols[i][j+n] = coreDailyVols[i][j];\n }\n for(int j=m; j<instantGenerator.maxInstantValue(); j++) {\n synthesizedDailyVols[i][j] = Double.NaN;\n }\n }\n\n\n final Predictor predictor = new PCAPredictorTransposed(\n instantGenerator, 5);\n for(int i=0; i<5; i++) {\n predictor.learnVector(moments[i], synthesizedDailyVols[i]);\n }\n final double prediction[] = predictor.predictVector(moments[5]);\n final double coreExpectedPrediction[] = new double[] {\n0.21383323, -0.08665493, -0.28527934, -0.45293966, -0.35525111, -0.49117788,\n-0.38114565, -0.60141152, -0.09029406, -0.44815719, -0.45152723, -0.58079146,\n-0.29110153, 1.54262599, -0.59900211, -0.48107804, -0.03280398, -0.59369964,\n-0.44886852, -0.43868587, 0.88745208, -0.10900099, -0.26251035, -0.71557572,\n-0.20051598, -0.57674404, 0.53793693, 0.15857465, -0.53212067, -0.13529962,\n-0.49171709, -0.32334222, 2.16101856, 0.46824882, 2.13337330, -0.48802957,\n-0.40084079, 1.62077396, 1.93080019, -0.59114756, -0.09429057, -0.68952951,\n-0.39819841, -0.63019599, -0.78762027, 0.12458423, 0.34847712, -0.52481068,\n0.69730449, -0.74290105, -0.68866588, -0.45964670, -0.69174165, -0.64825389,\n-0.49908622, -0.30049621, 0.35726449, 0.47210113, -0.25058065, -0.72112704,\n0.79345044, -0.73245678, -0.75581875, -0.40885896, -0.08033429, -0.56030291,\n-0.54967743, -0.63571829, -0.58889882, -0.71099478, -0.67055922, -0.03850658,\n-0.40339282, -0.43003588, -0.44813762, -0.14347007, -0.48441216, -0.48851502,\n-0.15427010, -0.39484463, 0.52701151, -0.61335693, 0.89776479, -0.18821502,\n-0.46457371, -0.39850394, -0.26234640, -0.21535441, 0.33669589, -0.48879971,\n0.43892192, 0.52101182, -0.42851659, -0.51364225, 0.85831207, -0.24052028,\n-0.04192086, -0.02287821, 0.01522206, 0.24307671, 0.27369478, 0.11058009,\n-0.95575786, 14.90733910 };\n final double synthesizedExpectedPrediction[] = new double[\n instantGenerator.maxInstantValue()];\n for(int j=0; j<n; j++) {\n synthesizedExpectedPrediction[j] = Double.NaN;\n }\n for(int j=0; j<coreExpectedPrediction.length; j++) {\n synthesizedExpectedPrediction[j+n] = coreExpectedPrediction[j];\n }\n for(int j=m; j<instantGenerator.maxInstantValue(); j++) {\n synthesizedExpectedPrediction[j] = Double.NaN;\n }\n\n assertEquals(prediction.length, synthesizedExpectedPrediction.length);\n\n for(int i=0; i<prediction.length; i++) {\n assertEquals(prediction[i], synthesizedExpectedPrediction[i], \n 0.0001d);\n }\n System.out.println(\"Ok\");\n }", "public org.drip.state.estimator.PredictorResponseWeightConstraint fundingPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel();\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.fundingPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "default Gwei[][] get_attestation_deltas(BeaconState state) {\n EpochNumber previous_epoch = get_previous_epoch(state);\n Gwei total_balance = get_total_active_balance(state);\n Gwei[] rewards = new Gwei[state.getValidatorRegistry().size().getIntValue()];\n Gwei[] penalties = new Gwei[state.getValidatorRegistry().size().getIntValue()];\n Arrays.fill(rewards, Gwei.ZERO);\n Arrays.fill(penalties, Gwei.ZERO);\n\n List<ValidatorIndex> eligible_validator_indices = new ArrayList<>();\n for (ValidatorIndex index : state.getValidatorRegistry().size()) {\n ValidatorRecord validator = state.getValidatorRegistry().get(index);\n if (is_active_validator(validator, previous_epoch)\n || (validator.getSlashed() && previous_epoch.increment().less(validator.getWithdrawableEpoch()))) {\n eligible_validator_indices.add(index);\n }\n }\n\n /* Micro-incentives for matching FFG source, FFG target, and head\n matching_source_attestations = get_matching_source_attestations(state, previous_epoch)\n matching_target_attestations = get_matching_target_attestations(state, previous_epoch)\n matching_head_attestations = get_matching_head_attestations(state, previous_epoch) */\n List<PendingAttestation> matching_source_attestations = get_matching_source_attestations(state, previous_epoch);\n List<PendingAttestation> matching_target_attestations = get_matching_target_attestations(state, previous_epoch);\n List<PendingAttestation> matching_head_attestations = get_matching_head_attestations(state, previous_epoch);\n\n /* for attestations in (matching_source_attestations, matching_target_attestations, matching_head_attestations):\n unslashed_attesting_indices = get_unslashed_attesting_indices(state, attestations)\n attesting_balance = get_attesting_balance(state, attestations)\n for index in eligible_validator_indices:\n if index in unslashed_attesting_indices:\n rewards[index] += get_base_reward(state, index) * attesting_balance // total_balance\n else:\n penalties[index] += get_base_reward(state, index) */\n for (List<PendingAttestation> attestations :\n Arrays.asList(matching_source_attestations, matching_target_attestations, matching_head_attestations)) {\n List<ValidatorIndex> unslashed_attesting_indices = get_unslashed_attesting_indices(state, attestations);\n Gwei attesting_balance = get_attesting_balance(state, attestations);\n for (ValidatorIndex index : eligible_validator_indices) {\n if (unslashed_attesting_indices.contains(index)) {\n rewards[index.getIntValue()] = rewards[index.getIntValue()]\n .plus(get_base_reward(state, index).times(attesting_balance).dividedBy(total_balance));\n } else {\n penalties[index.getIntValue()] = penalties[index.getIntValue()]\n .plus(get_base_reward(state, index));\n }\n }\n }\n\n /* Proposer and inclusion delay micro-rewards\n for index in get_unslashed_attesting_indices(state, matching_source_attestations):\n attestation = min([\n a for a in matching_source_attestations\n if index in get_attesting_indices(state, a.data, a.aggregation_bitfield)\n ], key=lambda a: a.inclusion_delay)\n rewards[attestation.proposer_index] += get_base_reward(state, index) // PROPOSER_REWARD_QUOTIENT\n rewards[index] += get_base_reward(state, index) * MIN_ATTESTATION_INCLUSION_DELAY // attestation.inclusion_delay */\n for (ValidatorIndex index : get_unslashed_attesting_indices(state, matching_source_attestations)) {\n PendingAttestation attestation =\n matching_source_attestations.stream()\n .filter(a -> get_attesting_indices(state, a.getData(), a.getAggregationBitfield()).contains(index))\n .min(Comparator.comparing(PendingAttestation::getInclusionDelay))\n .get();\n rewards[attestation.getProposerIndex().getIntValue()] = rewards[attestation.getProposerIndex().getIntValue()]\n .plus(get_base_reward(state, index).dividedBy(getConstants().getProposerRewardQuotient()));\n rewards[index.getIntValue()] = rewards[index.getIntValue()]\n .plus(get_base_reward(state, index)\n .times(getConstants().getMinAttestationInclusionDelay())\n .dividedBy(attestation.getInclusionDelay()));\n }\n\n /* Inactivity penalty\n finality_delay = previous_epoch - state.finalized_epoch\n if finality_delay > MIN_EPOCHS_TO_INACTIVITY_PENALTY:\n matching_target_attesting_indices = get_unslashed_attesting_indices(state, matching_target_attestations)\n for index in eligible_validator_indices:\n penalties[index] += BASE_REWARDS_PER_EPOCH * get_base_reward(state, index)\n if index not in matching_target_attesting_indices:\n penalties[index] += state.validator_registry[index].effective_balance * finality_delay // INACTIVITY_PENALTY_QUOTIENT */\n EpochNumber finality_delay = previous_epoch.minus(state.getFinalizedEpoch());\n if (finality_delay.greater(getConstants().getMinEpochsToInactivityPenalty())) {\n List<ValidatorIndex> matching_target_attesting_indices = get_unslashed_attesting_indices(state, matching_target_attestations);\n for (ValidatorIndex index : eligible_validator_indices) {\n penalties[index.getIntValue()] = penalties[index.getIntValue()]\n .plus(get_base_reward(state, index).times(getConstants().getBaseRewardsPerEpoch()));\n if (!matching_target_attesting_indices.contains(index)) {\n penalties[index.getIntValue()] = penalties[index.getIntValue()]\n .plus(state.getValidatorRegistry().get(index).getEffectiveBalance()\n .times(finality_delay).dividedBy(getConstants().getInactivityPenaltyQuotient()));\n }\n }\n }\n\n return new Gwei[][] { rewards, penalties };\n }", "public void test4_c() {/*\n\t\tGDGraph gdGraph = new GDGraph();\n\t\tGDGVertex gdVertex = gdGraph.addVertex();\n\t\tGDGEdge gdEdge1 = gdGraph.addEdge(gdVertex, gdVertex);\n\t\tGDGEdge gdEdge2 = gdGraph.addEdge(gdVertex, gdVertex);\n\n\t\tgdEdge1.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i, j - 1) \n\t\t\t\t{ 1, 0, 0},\n\t\t\t\t{ 0, 1, -1},\n\t\t\t\t{ 0, 0, 1}\n });\n\t\tgdEdge1.producedDomain = convertIntTableToPIPDRational(2, 0, new int[][]{ // (0..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0},\n\t\t\t\t{ 0, 1, -1}\n\t\t});\n\n\t\tgdEdge2.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i - 1, j + 7) \n\t\t\t\t{ 1, 0, -1},\n\t\t\t\t{ 0, 1, 7},\n\t\t\t\t{ 0, 0, 1}\n });\n\t\tgdEdge2.producedDomain = convertIntTableToPIPDRational(2, 0, new int[][]{ // (1..+inf, 0..+inf)\n\t\t\t\t{ 1, 0, -1},\n\t\t\t\t{ 0, 1, 0}\n\t\t});\n\n\t\tgdVertex.computationDomain = convertIntTableToPIPDRational(2, 0, new int[][]{ // (1..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, -1},\n\t\t\t\t{ 0, 1, -1}\n\t\t});\n\t\t\n\t\tgdGraph.calculateFeautrierSchedule(false);\n\t\n\t\tgdGraph.<Rational>codeGeneration(Rational.ZERO, Rational.ONE);\n\t*/}", "public static void model1() {\n try {\n IloCplex cplex = new IloCplex();\n \n //variables\n IloNumVar x = cplex.numVar(0, Double.MAX_VALUE, \"x\"); //x >= 0\n IloNumVar y = cplex.numVar(0, Double.MAX_VALUE, \"y\"); //y >= 0\n \n //expressions\n IloLinearNumExpr objective = cplex.linearNumExpr();\n objective.addTerm(0.12, x);\n objective.addTerm(0.15, y);\n \n //define objective\n cplex.addMinimize(objective);\n \n //define constraints\n cplex.addGe(cplex.sum(cplex.prod(60, x), cplex.prod(60, y)), 300);\n cplex.addGe(cplex.sum(cplex.prod(12, x), cplex.prod(6, y)), 36);\n cplex.addGe(cplex.sum(cplex.prod(10, x), cplex.prod(30, y)), 90);\n \n //solve\n if (cplex.solve()) {\n System.out.println(\"Obj = \" + cplex.getObjValue());\n System.out.println(\"Obj = \" + cplex.getValue(objective));\n System.out.println(\"x = \" + cplex.getValue(x));\n System.out.println(\"y = \" + cplex.getValue(y));\n } else {\n System.out.println(\"Solution not found.\");\n }\n } catch (IloException ex) {\n ex.printStackTrace();\n }\n }", "private MaintenanceRequest initializeCostAvoidanceIndicators(MaintenanceRequest maintenanceRequest){\n\t\tmaintenanceRequest.setGoodwillIndicator(hasGoodwill(maintenanceRequest));\n\t\t\n\t\tif(!MALUtilities.isEmpty(maintenanceRequest.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask task : maintenanceRequest.getMaintenanceRequestTasks()){\n\t\t\t\ttask = initializeCostAvoidanceIndicators(task);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn maintenanceRequest;\n\t}", "public abstract double getConstraintFitness();", "protected void createMimoentslotconstraintsAnnotations() {\n\t\tString source = \"mimo-ent-slot-constraints\";\n\t\taddAnnotation\n\t\t (getInvoice_InvoiceStatuses(),\n\t\t source,\n\t\t new String[] {\n\t\t\t \"statusDate\", \"*NOW\"\n\t\t });\n\t}", "private double GetMCRTrainSet() \n\t{\n\t\tint numErrors = 0;\n\t\t\n\t\tfor(int i = 0; i < ITrain; i++)\n\t\t{\n\t\t\tPreCompute(i);\n\t\t\t\n\t\t\tdouble max_Y_hat_ic = Double.MIN_VALUE;\n\t\t\tint label_i = -1; \n\t\t\t\n\t\t\tfor(int c = 0; c < C; c++)\n\t\t\t{\n\t\t\t\tdouble Y_hat_ic = Predict(i, c); \n\t\t\t\t\n\n\t\t\t\tif(lossType == LossTypes.LOGISTIC)\n\t\t\t\t\tY_hat_ic = Sigmoid.Calculate(Y_hat_ic);\n\t\t\t\t\n\t\t\t\tif(Y_hat_ic > max_Y_hat_ic)\n\t\t\t\t{\n\t\t\t\t\tmax_Y_hat_ic = Y_hat_ic; \n\t\t\t\t\tlabel_i = (int)Math.ceil(c);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif( nominalLabels.indexOf(Y.get(i)) != label_i ) \n\t\t\t\tnumErrors++;\n\t\t}\n\t\t\n\t\treturn (double)numErrors/(double)ITrain;\n\t}", "public org.drip.state.estimator.PredictorResponseWeightConstraint fxPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams) return null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.fxPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\treturn prwc;\n\t}", "public double[] ConsumptionDecisionRule(double[] Kt, double[] Zt) {\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0]);\r\n\t\tdouble[] result = new double[N];\r\n\t\tdouble[] W_t = new double[N];\r\n\t\t// double[] result = Kt;\r\n\t\t// fact[9] = iT / (double) T;\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\r\n\t\t\t// Compute wage\r\n\t\t\tW_t[i] = (1 - delta) * Kt[i] + Zt[i] * Math.pow(Kt[i], alpha);\r\n\t\t\t// LOGGER.info(\"Kt[i]=\" + Kt[i] + \" , W_t=\" + W_t);\r\n\r\n\t\t\t// fact[0] = Kt[i];\r\n\t\t\t// fact[1] = Zt[i];\r\n\t\t\t// fact[2] = W_t[i];\r\n\r\n\t\t\t// result[i] = (W_t[i] * 0.34);\r\n\r\n\t\t\t// S[sc=640619,15461196 at 2000, 3x[C 0,35 [], C 0,256 [6], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.256 * factValues[6] - 0.032 * factValues[4]);\r\n\t\t\t// S[sc=673175,23434734 at 2000, 4x[C 0,448 [6], C 0,35 [], C -0,192 [8, 8, 8], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.448 * fact[6] - 0.192 * fact[8] * fact[8] * fact[8] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=684511.51178919 at 5000, 6x[C 0.576 [6], C 0.35 [], C -0.256 [4, 5, 8], C -0.128 [8, 8, 8], C 0.032\r\n\t\t\t// [3], C -0.032 [4]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35 + 0.576 * fact[6] - 0.256 * fact[4] * fact[5] * fact[8] - 0.128 * fact[8] * fact[8] * fact[8] +\r\n\t\t\t// 0.032\r\n\t\t\t// * fact[3] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=713249.61733519 at 17000, 10x[C 0.57042768 [6], C -0.42834052 [4, 5, 8], C 0.35726662 [], C\r\n\t\t\t// -0.19234839 [8, 8, 8], C 0.0618062 [3], C 0.03906074 [3, 3], C -0.0354908 [6, 8, 8], C -0.032 [4], C\r\n\t\t\t// 0.02872478 [3, 6, 6], C -0.01470091 [4, 8]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35726662 + 0.57042768 * fact[3] - 0.42834052 * fact[1] * fact[2] * fact[5] - 0.19234839 * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// * fact[5] + 0.0618062 * fact[2] + 0.03906074 * fact[2] * fact[2] - 0.0354908 * fact[3] * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// - 0.032 * fact[1] + 0.02872478 * fact[0] * fact[3] * fact[3] - 0.01470091 * fact[1] * fact[5]);\r\n\t\t\tresult[i] = W_t[i]\r\n\t\t\t\t\t* ( //\r\n\t\t\t\t\t0.40334336 + 0.22997859 * fact[3] + 0.21837595 * fact[3] * fact[3] + 0.15973829 * fact[3] * fact[4] + -0.10161004\r\n\t\t\t\t\t\t\t* fact[1] * fact[5] + -0.020384 * fact[1] * fact[1] * fact[5]\r\n\t\t\t);\r\n\t\t\t// Keep only valid solutions\r\n\t\t\tresult[i] = Math.max(result[i], VERY_SMALL * W_t[i]);\r\n\t\t\t// to have a valid result\r\n\t\t\tresult[i] = Math.min(result[i], W_t[i] * (1.0 - VERY_SMALL));\r\n\t\t}\r\n\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0] + \" , \" + result[0] + \" for \" + iT);\r\n\t\t// int s = 0;\r\n\t\t// LOGGER.info(\"Kt[\" + s + \"]=\" + Kt[s] + \" , Zt[]=\" + Zt[s] + \" , W_t[]=\" + W_t[s] + \" , \" + result[s] +\r\n\t\t// \" for \" + iT);\r\n\t\tiT++;\r\n\t\treturn result;\r\n\t}", "public void generatePropositions() {\r\n propositions.clear();\r\n\r\n\t\t// holds alternative options for each constituents (obtained by\r\n // processing coordinated conjunctions and xcomps)\r\n final List<List<Constituent>> constituents = new ArrayList<List<Constituent>>();\r\n\r\n // which of the constituents are required?\r\n final List<Flag> flags = new ArrayList<Flag>();\r\n final List<Boolean> include = new ArrayList<Boolean>();\r\n\r\n\t\t// holds all valid combination of constituents for which a proposition\r\n // is to be generated\r\n final List<List<Boolean>> includeConstituents = new ArrayList<List<Boolean>>();\r\n\r\n // let's start\r\n for (Clause clause : clauses) {\r\n // process coordinating conjunctions\r\n constituents.clear();\r\n for (int i = 0; i < clause.constituents.size(); i++) {\r\n\t\t\t\t// if(xcomp && clause.subject == i) continue; //An xcomp does\r\n // not have an internal subject so should not be processed here\r\n Constituent constituent = clause.constituents.get(i);\r\n List<Constituent> alternatives;\r\n if (!(xcomp && clause.subject == i)\r\n && constituent instanceof IndexedConstituent\r\n // the processing of the xcomps is done in Default\r\n // proposition generator. \r\n // Otherwise we get duplicate propositions.\r\n && !clause.xcomps.contains(i)\r\n && ((i == clause.verb && options.processCcAllVerbs) || (i != clause.verb && options.processCcNonVerbs))) {\r\n alternatives = ProcessConjunctions.processCC(depTree,\r\n clause, constituent, i);\r\n } else if (!(xcomp && clause.subject == i)\r\n && clause.xcomps.contains(i)) {\r\n alternatives = new ArrayList<Constituent>();\r\n ClausIE xclausIE = new ClausIE(options);\r\n xclausIE.semanticGraph = semanticGraph;\r\n xclausIE.depTree = depTree;\r\n xclausIE.xcomp = true;\r\n xclausIE.clauses = ((XcompConstituent) clause.constituents\r\n .get(i)).getClauses();\r\n xclausIE.generatePropositions();\r\n for (Proposition p : xclausIE.propositions) {\r\n StringBuilder sb = new StringBuilder();\r\n String sep = \"\";\r\n for (int j = 0; j < p.constituents.size(); j++) {\r\n if (j == 0) // to avoid including the subjecct, We\r\n {\r\n continue; // could also generate the prop\r\n }\t\t\t\t\t\t\t // without the subject\t\t\t\t\t\t\t\t\t\t\t\r\n sb.append(sep);\r\n sb.append(p.constituents.get(j));\r\n sep = \" \";\r\n }\r\n alternatives.add(new TextConstituent(sb.toString(),\r\n constituent.type));\r\n }\r\n } else {\r\n alternatives = new ArrayList<Constituent>(1);\r\n alternatives.add(constituent);\r\n }\r\n constituents.add(alternatives);\r\n }\r\n\r\n\t\t\t// create a list of all combinations of constituents for which a\r\n // proposition should be generated\r\n includeConstituents.clear();\r\n flags.clear();\r\n include.clear();\r\n for (int i = 0; i < clause.constituents.size(); i++) {\r\n Flag flag = clause.getFlag(i, options);\r\n flags.add(flag);\r\n include.add(!flag.equals(Flag.IGNORE));\r\n }\r\n if (options.nary) {\r\n\t\t\t\t// we always include all constituents for n-ary ouput \r\n // (optional parts marked later)\r\n includeConstituents.add(include);\r\n } else {\r\n // triple mode; determine which parts are required\r\n for (int i = 0; i < clause.constituents.size(); i++) {\r\n include.set(i, flags.get(i).equals(Flag.REQUIRED));\r\n }\r\n\r\n // create combinations of required/optional constituents\r\n new Runnable() {\r\n int noOptional;\r\n\r\n // @Override\r\n public void run() {\r\n noOptional = 0;\r\n for (Flag f : flags) {\r\n if (f.equals(Flag.OPTIONAL)) {\r\n noOptional++;\r\n }\r\n }\r\n run(0, 0, new ArrayList<Boolean>());\r\n }\r\n\r\n private void run(int pos, int selected, List<Boolean> prefix) {\r\n if (pos >= include.size()) {\r\n if (selected >= Math.min(options.minOptionalArgs,\r\n noOptional)\r\n && selected <= options.maxOptionalArgs) {\r\n includeConstituents.add(new ArrayList<Boolean>(\r\n prefix));\r\n }\r\n return;\r\n }\r\n prefix.add(true);\r\n if (include.get(pos)) {\r\n run(pos + 1, selected, prefix);\r\n } else {\r\n if (!flags.get(pos).equals(Flag.IGNORE)) {\r\n run(pos + 1, selected + 1, prefix);\r\n }\r\n prefix.set(prefix.size() - 1, false);\r\n run(pos + 1, selected, prefix);\r\n }\r\n prefix.remove(prefix.size() - 1);\r\n }\r\n }.run();\r\n }\r\n\r\n // create a temporary clause for which to generate a proposition\r\n final Clause tempClause = clause.clone();\r\n\r\n // generate propositions\r\n new Runnable() {\r\n public void run() {\r\n // select which constituents to include\r\n for (List<Boolean> include : includeConstituents) {\r\n // now select an alternative for each constituent\r\n selectConstituent(0, include);\r\n }\r\n }\r\n\r\n void selectConstituent(int i, List<Boolean> include) {\r\n if (i < constituents.size()) {\r\n if (include.get(i)) {\r\n List<Constituent> alternatives = constituents\r\n .get(i);\r\n for (int j = 0; j < alternatives.size(); j++) {\r\n tempClause.constituents.set(i,\r\n alternatives.get(j));\r\n selectConstituent(i + 1, include);\r\n }\r\n } else {\r\n selectConstituent(i + 1, include);\r\n }\r\n } else {\r\n // everything selected; generate\r\n propositionGenerator.generate(propositions, tempClause,\r\n include);\r\n }\r\n }\r\n }.run();\r\n }\r\n }", "public Activation_Linear_Range_0_1() {\r\n this.slope = new VDouble(new RealNumber(1), new VDoubleNoUpdate());\r\n this.c = new VDouble(new RealNumber(0), new VDoubleNoUpdate());\r\n }", "private double calcuCMetric() {\n\t\treturn (p-1)/fcost;\n\t}", "protected <E> List<E> LeastConstrainingValue(CSP<E> csp, String var){\r\n\t\tList<String> neighbores = new ArrayList<String>();\r\n\t\tfor(Constraint i:csp.constraints) {\r\n\t\t\tList<String> constraint = i.getScope();\r\n\t\t\tfor(String j:constraint){\r\n\t\t\t\tif(j.equals(var)) {\r\n\t\t\t\t\tneighbores.addAll(constraint);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tHashMap<E, Integer> affected = new HashMap<E, Integer>();\r\n\t\tfor(int value=0; value<csp.domains.get(var).size();value++) {\r\n\t\t\tint sum=0;\r\n\t\t\tfor(String i:neighbores){\r\n\t\t\t\tif(!i.equals(var)){\r\n\t\t\t\t\tList<E> domain=csp.domains.get(i);\r\n\t\t\t\t\tfor(E j:domain){\r\n\t\t\t\t\t\tif(j.equals(value)){\r\n\t\t\t\t\t\t\tsum++;\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\taffected.put(csp.domains.get(var).get(value),sum);\r\n\t\t}\r\n\t\tList<E> values = new ArrayList<E>();\r\n\t\tEntry<E, Integer> pos = null;\r\n\t\twhile(values.size()<affected.size()){\r\n\t\t\tint min=1000;\r\n\t\t\tfor (Entry<E, Integer> i:affected.entrySet()) {\r\n\t\t\t\tif(i.getValue()<min) {\r\n\t\t\t\t\tmin=i.getValue();\r\n\t\t\t\t\tpos=i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvalues.add(pos.getKey());\r\n\t\t\taffected.put(pos.getKey(),1000);\r\n\t\t}\r\n\t\t\r\n\t\treturn values;\r\n\t}", "@Test\r\n\tpublic void testFillChargingPlan_Nonlinear_HighInitialSoC() {\n\t\tdouble initialSoC = 0.99;\r\n\t\tint startTimeSeconds = 0;\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\tdouble desiredCapacity = car.getMissingCapacity();\r\n\t\t\r\n\t\t\r\n\t\t// Nonlinear\r\n\t\tcar.setCurrentPlan(new double[96]);\r\n\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 95, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\tstartTimeSeconds);\r\n\t\t\r\n\t\t//System.out.println(Arrays.toString(car.getCurrentPlan()));\r\n\t\t//System.out.println(schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds));\r\n\t\t\r\n\t\tassertEquals(car.getMissingCapacity(), schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-8);\r\n\t\t\r\n\t}", "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}", "public double costNEX() {\r\n double diff=0;\r\n double intensity=0;\r\n \r\n for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) {\r\n for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n\r\n this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n intensity = this.body2[x][y][z].radiationIntensity(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (intensity>0) {\r\n// LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n this.body2[x][y][z].addCurrentDosis(intensity);\r\n } \r\n diff += Math.pow((this.body2[x][y][z].getGoalDosis()-this.body2[x][y][z].getCurrentDosis()),2);\r\n// LogTool.print(\" diffdose \" + (Looper.body2[x][y][z].getGoalDosis()-Looper.body2[x][y][z].getCurrentDosis()),\"notification\");\r\n } \r\n }\r\n }\r\n return Math.sqrt(diff);\r\n// return Math.random();\r\n }", "public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t{\n\t\tif (null == valParams || null == csqs) return null;\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState (fundingLabel());\n\n\t\tif (null == dcFunding) return null;\n\n\t\tlong lStart = System.nanoTime();\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tdouble dblAccrued01 = 0.;\n\t\tdouble dblTotalCoupon = 0.;\n\t\tdouble dblCumulativeCouponDCF = 0.;\n\t\tdouble dblCumulativeCouponAmount = 0.;\n\t\tdouble dblAccrualCoupon = java.lang.Double.NaN;\n\t\tdouble dblUnadjustedDirtyPV = 0.;\n\t\tdouble dblUnadjustedDirtyDV01 = 0.;\n\t\tdouble dblCompoundingAdjustedDirtyPV = 0.;\n\t\tdouble dblCompoundingAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCashPayDF = java.lang.Double.NaN;\n\t\tint iResetDate = java.lang.Integer.MIN_VALUE;\n\t\tdouble dblFXAdjustedValueNotional = java.lang.Double.NaN;\n\t\tdouble dblCreditForwardConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditForwardConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCreditFundingConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditFundingConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCreditFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditFXConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCumulativeConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCumulativeConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblForwardFundingConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblForwardFundingConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblForwardFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblForwardFXConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblFundingFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblFundingFXConvexityAdjustedDirtyDV01 = 0.;\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tdouble dblPeriodFX = java.lang.Double.NaN;\n\t\t\tdouble dblPeriodNotional = java.lang.Double.NaN;\n\t\t\tdouble dblUnadjustedDirtyPeriodDV01 = java.lang.Double.NaN;\n\n\t\t\tint iPeriodPayDate = period.payDate();\n\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\ttry {\n\t\t\t\tdblPeriodNotional = period.notional (iPeriodEndDate) * period.couponFactor (iPeriodEndDate);\n\n\t\t\t\tdblPeriodFX = period.fx (csqs);\n\t\t\t} catch (java.lang.Exception e) {\n\t\t\t\te.printStackTrace();\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (iPeriodPayDate < iValueDate) {\n\t\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics\n\t\t\t\t\t(iPeriodEndDate, csqs);\n\n\t\t\t\tif (null == cpcm) return null;\n\n\t\t\t\tdouble dblPeriodDCF = cpcm.dcf();\n\n\t\t\t\tdblCumulativeCouponDCF += dblPeriodDCF;\n\n\t\t\t\tdblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * cpcm.rate() * dblPeriodDCF;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate,\n\t\t\t\tcsqs);\n\n\t\t\tif (null == cpcm) return null;\n\n\t\t\tdouble dblPeriodDCF = cpcm.dcf();\n\n\t\t\tdouble dblPeriodFullRate = cpcm.rate();\n\n\t\t\torg.drip.analytics.output.CompositePeriodAccrualMetrics cpam = period.accrualMetrics (iValueDate,\n\t\t\t\tcsqs);\n\n\t\t\ttry {\n\t\t\t\tif (null != cpam) {\n\t\t\t\t\tdblAccrualCoupon = cpam.rate();\n\n\t\t\t\t\tiResetDate = cpam.resetDate();\n\n\t\t\t\t\tdouble dblPeriodAccrualDCF = cpam.dcf();\n\n\t\t\t\t\tdblCumulativeCouponDCF += dblPeriodAccrualDCF;\n\t\t\t\t\tdblAccrued01 = 0.0001 * dblPeriodAccrualDCF * dblPeriodNotional * dblPeriodFX;\n\n\t\t\t\t\tdblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * dblAccrualCoupon *\n\t\t\t\t\t\tdblPeriodAccrualDCF;\n\t\t\t\t}\n\n\t\t\t\tdblUnadjustedDirtyPeriodDV01 = 0.0001 * dblPeriodDCF * dblPeriodNotional * dblPeriodFX *\n\t\t\t\t\tperiod.survival (csqs) * period.df (csqs);\n\t\t\t} catch (java.lang.Exception e) {\n\t\t\t\te.printStackTrace();\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tdouble dblCompoundingAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.compounding();\n\n\t\t\tdouble dblCreditForwardConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditForward();\n\n\t\t\tdouble dblCreditFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditFunding();\n\n\t\t\tdouble dblCreditFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditFX();\n\n\t\t\tdouble dblCumulativeConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.cumulative();\n\n\t\t\tdouble dblForwardFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.forwardFunding();\n\n\t\t\tdouble dblForwardFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.forwardFX();\n\n\t\t\tdouble dblFundingFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.fundingFX();\n\n\t\t\tdblTotalCoupon += dblPeriodFullRate;\n\t\t\tdblUnadjustedDirtyDV01 += dblUnadjustedDirtyPeriodDV01;\n\t\t\tdblUnadjustedDirtyPV += dblUnadjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate;\n\t\t\tdblCompoundingAdjustedDirtyDV01 += dblCompoundingAdjustedDirtyPeriodDV01;\n\t\t\tdblCompoundingAdjustedDirtyPV += dblCompoundingAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblCreditForwardConvexityAdjustedDirtyDV01 += dblCreditForwardConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditForwardConvexityAdjustedDirtyPV += dblCreditForwardConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblCreditFundingConvexityAdjustedDirtyDV01 += dblCreditFundingConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditFundingConvexityAdjustedDirtyPV += dblCreditFundingConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblCreditFXConvexityAdjustedDirtyDV01 += dblCreditFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditFXConvexityAdjustedDirtyPV += dblCreditFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblCumulativeConvexityAdjustedDirtyDV01 += dblCumulativeConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCumulativeConvexityAdjustedDirtyPV += dblCumulativeConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblForwardFundingConvexityAdjustedDirtyDV01 += dblForwardFundingConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblForwardFundingConvexityAdjustedDirtyPV += dblForwardFundingConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblForwardFXConvexityAdjustedDirtyDV01 += dblForwardFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblForwardFXConvexityAdjustedDirtyPV += dblForwardFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblFundingFXConvexityAdjustedDirtyDV01 += dblFundingFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblFundingFXConvexityAdjustedDirtyPV += dblFundingFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t}\n\n\t\ttry {\n\t\t\tdblCashPayDF = dcFunding.df (iValueDate);\n\n\t\t\tdblFXAdjustedValueNotional = fxAdjustedNotional (iValueDate, csqs);\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\tdblUnadjustedDirtyPV /= dblCashPayDF;\n\t\tdblUnadjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCompoundingAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCompoundingAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditForwardConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditForwardConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditFundingConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCumulativeConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCumulativeConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblForwardFundingConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblForwardFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblForwardFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblForwardFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblFundingFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblFundingFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdouble dblAccrued = 0. == dblAccrued01 ? 0. : dblAccrued01 * 10000. * dblAccrualCoupon;\n\t\tdouble dblUnadjustedCleanPV = dblUnadjustedDirtyPV - dblAccrued;\n\t\tdouble dblUnadjustedCleanDV01 = dblUnadjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblUnadjustedFairPremium = 0.0001 * dblUnadjustedCleanPV / dblUnadjustedCleanDV01;\n\t\tdouble dblCompoundingAdjustedCleanPV = dblCompoundingAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCompoundingAdjustedCleanDV01 = dblCompoundingAdjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblCompoundingAdjustedFairPremium = 0.0001 * dblCompoundingAdjustedCleanPV /\n\t\t\tdblCompoundingAdjustedCleanDV01;\n\t\tdouble dblCreditForwardConvexityAdjustedCleanPV = dblCreditForwardConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblCreditForwardConvexityAdjustedCleanDV01 = dblCreditForwardConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCreditForwardConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblCreditForwardConvexityAdjustedCleanPV / dblCreditForwardConvexityAdjustedCleanDV01;\n\t\tdouble dblCreditFundingConvexityAdjustedCleanPV = dblCreditFundingConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblCreditFundingConvexityAdjustedCleanDV01 = dblCreditFundingConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCreditFundingConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblCreditFundingConvexityAdjustedCleanPV / dblCreditFundingConvexityAdjustedCleanDV01;\n\t\tdouble dblCreditFXConvexityAdjustedCleanPV = dblCreditFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCreditFXConvexityAdjustedCleanDV01 = dblCreditFXConvexityAdjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblCreditFXConvexityAdjustedFairPremium = 0.0001 * dblCreditFXConvexityAdjustedCleanPV /\n\t\t\tdblCreditFXConvexityAdjustedCleanDV01;\n\t\tdouble dblCumulativeConvexityAdjustedCleanPV = dblCumulativeConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCumulativeConvexityAdjustedCleanDV01 = dblCumulativeConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCumulativeConvexityAdjustedFairPremium = 0.0001 * dblCumulativeConvexityAdjustedCleanPV /\n\t\t\tdblCumulativeConvexityAdjustedCleanDV01;\n\t\tdouble dblForwardFundingConvexityAdjustedCleanPV = dblForwardFundingConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblForwardFundingConvexityAdjustedCleanDV01 = dblForwardFundingConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblForwardFundingConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblForwardFundingConvexityAdjustedCleanPV / dblForwardFundingConvexityAdjustedCleanDV01;\n\t\tdouble dblForwardFXConvexityAdjustedCleanPV = dblForwardFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblForwardFXConvexityAdjustedCleanDV01 = dblForwardFXConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblForwardFXConvexityAdjustedFairPremium = 0.0001 * dblForwardFXConvexityAdjustedCleanPV /\n\t\t\tdblForwardFXConvexityAdjustedCleanDV01;\n\t\tdouble dblFundingFXConvexityAdjustedCleanPV = dblFundingFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblFundingFXConvexityAdjustedCleanDV01 = dblFundingFXConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblFundingFXConvexityAdjustedFairPremium = 0.0001 * dblFundingFXConvexityAdjustedCleanPV /\n\t\t\tdblFundingFXConvexityAdjustedCleanDV01;\n\n\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapResult = new\n\t\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>();\n\n\t\tmapResult.put (\"AccrualCoupon\", dblAccrualCoupon);\n\n\t\tmapResult.put (\"Accrued\", dblAccrued);\n\n\t\tmapResult.put (\"Accrued01\", dblAccrued01);\n\n\t\tmapResult.put (\"CleanDV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CleanPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanDV01\", dblCompoundingAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanPV\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPV\", dblCompoundingAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyDV01\", dblCompoundingAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPV\", dblCompoundingAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedFairPremium\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedParRate\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedPV\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedRate\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedUpfront\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustmentFactor\", dblCompoundingAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustmentPremium\", dblCompoundingAdjustedCleanPV - dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustmentPremiumUpfront\", (dblCompoundingAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanDV01\",\n\t\t\tdblCreditForwardConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanPV\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyDV01\",\n\t\t\tdblCreditForwardConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyPV\", dblCreditForwardConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDV01\", dblCreditForwardConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedFairPremium\",\n\t\t\tdblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedParRate\",\n\t\t\tdblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedPV\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedRate\", dblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedUpfront\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentFactor\", dblCreditForwardConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentPremium\", dblCreditForwardConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblCreditForwardConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanDV01\",\n\t\t\tdblCreditFundingConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanPV\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyDV01\",\n\t\t\tdblCreditFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyPV\", dblCreditFundingConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDV01\", dblCreditFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedFairPremium\",\n\t\t\tdblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedParRate\",\n\t\t\tdblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedPV\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedRate\", dblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedUpfront\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentFactor\", dblCreditFundingConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentPremium\", dblCreditFundingConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblCreditFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanDV01\", dblCreditFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanPV\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyDV01\", dblCreditFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyPV\", dblCreditFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDV01\", dblCreditFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedFairPremium\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedParRate\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedPV\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedRate\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedUpfront\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentFactor\", dblCreditFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentPremium\", dblCreditFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentPremiumUpfront\", (dblCreditFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanDV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyPV\", dblCumulativeConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedFairPremium\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedParRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedUpfront\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentFactor\", dblCumulativeConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentPremium\", dblCumulativeConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentPremiumUpfront\", (dblCumulativeConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CumulativeCouponAmount\", dblCumulativeCouponAmount);\n\n\t\tmapResult.put (\"CumulativeCouponDCF\", dblCumulativeCouponDCF);\n\n\t\tmapResult.put (\"CV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"DirtyDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"DirtyPV\", dblCumulativeConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"DV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"FairPremium\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"Fixing01\", dblAccrued01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanDV01\",\n\t\t\tdblForwardFundingConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanPV\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyDV01\",\n\t\t\tdblForwardFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyPV\", dblForwardFundingConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDV01\", dblForwardFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedFairPremium\",\n\t\t\tdblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedParRate\",\n\t\t\tdblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedPV\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedRate\", dblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedUpfront\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentFactor\", dblForwardFundingConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentPremium\", dblForwardFundingConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblForwardFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanDV01\", dblForwardFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanPV\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyDV01\", dblForwardFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyPV\", dblForwardFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDV01\", dblForwardFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedFairPremium\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedParRate\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedPV\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedRate\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedUpfront\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentFactor\", dblForwardFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentPremium\", dblForwardFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentPremiumUpfront\", (dblForwardFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanDV01\", dblFundingFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanPV\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyDV01\", dblFundingFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyPV\", dblFundingFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDV01\", dblFundingFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedFairPremium\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedParRate\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedPV\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedRate\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedUpfront\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentFactor\", dblFundingFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentPremium\", dblFundingFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentPremiumUpfront\", (dblFundingFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"ParRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"PV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"Rate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ResetDate\", (double) iResetDate);\n\n\t\tmapResult.put (\"ResetRate\", dblAccrualCoupon - basis());\n\n\t\tmapResult.put (\"TotalCoupon\", dblTotalCoupon);\n\n\t\tmapResult.put (\"UnadjustedCleanDV01\", dblUnadjustedCleanDV01);\n\n\t\tmapResult.put (\"UnadjustedCleanPV\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"UnadjustedDirtyDV01\", dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"UnadjustedDirtyPV\", dblUnadjustedDirtyPV);\n\n\t\tmapResult.put (\"UnadjustedFairPremium\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedParRate\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedPV\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"UnadjustedRate\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedUpfront\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"Upfront\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tdouble dblCompoundingAdjustedCleanPrice = 100. * (1. + (dblCompoundingAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblCreditForwardConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblCreditForwardConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblCreditFundingConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblCreditFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblCreditFXConvexityAdjustedCleanPrice = 100. * (1. + (dblCreditFXConvexityAdjustedCleanPV\n\t\t\t/ dblFXAdjustedValueNotional));\n\t\tdouble dblCumulativeConvexityAdjustedCleanPrice = 100. * (1. + (dblCumulativeConvexityAdjustedCleanPV\n\t\t\t/ dblFXAdjustedValueNotional));\n\t\tdouble dblForwardFundingConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblForwardFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblForwardFXConvexityAdjustedCleanPrice = 100. * (1. + (dblForwardFXConvexityAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblFundingFXConvexityAdjustedCleanPrice = 100. * (1. + (dblFundingFXConvexityAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblUnadjustedCleanPrice = 100. * (1. + (dblUnadjustedCleanPV / dblFXAdjustedValueNotional));\n\n\t\tmapResult.put (\"CleanPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanPrice\", dblCompoundingAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPrice\", 100. * (1. + (dblCompoundingAdjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CompoundingAdjustedPrice\", dblCompoundingAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanPrice\",\n\t\t\tdblCreditForwardConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditForwardConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedPrice\", dblCreditForwardConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanPrice\",\n\t\t\tdblCreditFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedPrice\", dblCreditFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanPrice\", dblCreditFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedPrice\", dblCreditFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCumulativeConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"DirtyPrice\", 100. * (1. + (dblCumulativeConvexityAdjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanPrice\",\n\t\t\tdblForwardFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblForwardFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedPrice\", dblForwardFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanPrice\", dblForwardFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblForwardFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedPrice\", dblForwardFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanPrice\", dblFundingFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblFundingFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedPrice\", dblFundingFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"Price\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"UnadjustedCleanPrice\", dblUnadjustedCleanPrice);\n\n\t\tmapResult.put (\"UnadjustedDirtyPrice\", 100. * (1. + (dblUnadjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"UnadjustedPrice\", dblUnadjustedCleanPrice);\n\n\t\tmapResult.put (\"CalcTime\", (System.nanoTime() - lStart) * 1.e-09);\n\n\t\treturn mapResult;\n\t}", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "@Override\n void calculate() {\n parents = new HashMap<>();\n table = new double[seq1.length() + 1][seq2.length() + 1];\n int n = table[0].length;\n GapPenalty.Type penaltyType = gapPenalty.getType();\n switch (penaltyType) {\n case AFFINE:\n table[0][0] = 0.0;\n for (int i = 1; i < table.length; i++) {\n table[i][0] = (double) (-1) * gapPenalty.countAffine(i);\n parents.put((n * i), new ArrayList<>(List.of(n * (i - 1))));\n }\n for (int i = 1; i < n; i++) {\n table[0][i] = (double) (-1) * gapPenalty.countAffine(i);\n parents.put(i, new ArrayList<>(List.of(i - 1)));\n }\n countAffValue();\n break;\n case LINEAR:\n for (int i = 0; i < table.length; i++) {\n table[i][0] = (double) i * (-1) * gapPenalty.linearPart();\n if (i != 0) {\n parents.put(n * i, new ArrayList<>(List.of(n * (i - 1))));\n }\n }\n for (int i = 0; i < n; i++) {\n table[0][i] = (double) i * (-1) * gapPenalty.linearPart();\n if (i != 0) {\n parents.put(i, new ArrayList<>(List.of(i - 1)));\n }\n }\n countLinValue();\n break;\n case ERROR:\n throw new GapPenalty.GapPenaltyNumericalError(\"Gap penalty not initialized properly\");\n }\n }", "public IProbabilityFunction generateLinearDistroCPT(ProbabilisticNode probNode) {\r\n\t\tfloat value = 1.0F / probNode.getStatesSize();\r\n\t\tif (!isToNormalize()) {\r\n\t\t\t// if we don't need to normalize, then fill everything with zeros\r\n\t\t\tvalue = 1f;\r\n\t\t}\r\n\t\tPotentialTable table = probNode.getProbabilityFunction();\r\n\t\tif (table != null) {\r\n\t\t\tfor (int i = 0; i < table.tableSize(); i++) {\r\n\t\t\t\t// TODO in float operation, since 1/3 + 1/3 + 1/3 might not be 1, implement some precision control\r\n\t\t\t\ttable.setValue(i, value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn table;\r\n\t}", "protected void initCoefficients() {\n\n\t\tString S = C + \": initCoefficients():\";\n\t\tif (D) {\n\t\t\tSystem.out.println(S + \"Starting\");\n\t\t}\n\n\t\t// Make the ShakeMap coefficients\n\t\tcoefficientsSM.clear();\n\t\t// Note that the coefficients in \"the APPENDIX\" that David Wald sent to me (Ned) on 8/27/07\n\t\t// assume that all logs in their equation are base-10 (in spite of their using \"ln\" for\n\t\t// two of the terms). Thus, thier B1, B2, and Sigma values need to be multiplied by 2.3025.\n\t\t// Also, since their units are gals their B1 needs to have ln(980) subtracted from it\n\t\t// (except for PGV).\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeffSM0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// Note: no sigma values were available for those below (Vince needs to recompute them)\n\t\t// (those above came from Vince via personal communication)\n\t\t// therefore, I multiplied those above by ratio of the sigmas given in the table in\n\t\t// \"the APPENDIX\" David sent to me (Ned). These are labeled as \"Sigma\" in their table\n\t\t// with no further explanation; using the ratios seems reasonable.\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeffSM2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.835318, 0.835318, 0.835318, 1.71773, 0.000, -1.827, -0.608, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.842 / 0.836) * 0.660, (0.842 / 0.836) * 0.328,\n\t\t\t\t(0.842 / 0.836) * 0.737, (0.842 / 0.836) * 0.3948,\n\t\t\t\t(0.842 / 0.836) * 0.836);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.82877, -1.82877, -1.82877, 2.20818, 0.000, -1.211, -0.974, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.988 / 0.836) * 0.660, (0.988 / 0.836) * 0.328,\n\t\t\t\t(0.988 / 0.836) * 0.737, (0.988 / 0.836) * 0.3948,\n\t\t\t\t(0.988 / 0.836) * 0.836);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeffSM4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -4.63102, -4.63102, -4.63102, 2.09305, 0.000, -0.848, -0.890, 760,\n\t\t\t\t6.0,\n\t\t\t\t(1.082 / 0.836) * 0.660, (1.082 / 0.836) * 0.328,\n\t\t\t\t(1.082 / 0.836) * 0.737, (1.082 / 0.836) * 0.3948,\n\t\t\t\t(1.082 / 0.836) * 0.836);\n\t\t// PGV - They actually give PGV coeffs so no scaling of 1-sec SA is needed.\n\t\tBJF_1997_AttenRelCoefficients coeffSM5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, 5.1186, 5.1186, 5.1186, 1.70391, 0.000, -1.386, -0.668, 760, 6.0,\n\t\t\t\t(0.753 / 0.836) * 0.660, (0.753 / 0.836) * 0.328,\n\t\t\t\t(0.753 / 0.836) * 0.737, (0.753 / 0.836) * 0.3948,\n\t\t\t\t(0.753 / 0.836) * 0.836);\n\n\t\t// add these to the list\n\t\tcoefficientsSM.put(coeffSM0.getName(), coeffSM0);\n\t\tcoefficientsSM.put(coeffSM1.getName(), coeffSM1);\n\t\tcoefficientsSM.put(coeffSM2.getName(), coeffSM2);\n\t\tcoefficientsSM.put(coeffSM3.getName(), coeffSM3);\n\t\tcoefficientsSM.put(coeffSM4.getName(), coeffSM4);\n\t\tcoefficientsSM.put(coeffSM5.getName(), coeffSM5);\n\n\t\t// Now make the original BJF 1997 coefficients\n\t\tcoefficientsBJF.clear();\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeff0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, -0.313, -0.117, -0.242, 0.527, 0.000, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeff1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, -0.313, -0.117, -0.242, 0.527, 0, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeff2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.598, 0.803, 0.7, 0.769, -0.161, -0.893, -0.401, 2133, 5.94,\n\t\t\t\t0.440, 0.276, 0.519, 0.048, 0.522);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeff3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.133, -1.009, -1.08, 1.036, -0.032, -0.798, -0.698, 1406, 2.9,\n\t\t\t\t0.474, 0.325, 0.575, 0.214, 0.613);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeff4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -1.699, -1.801, -1.743, 1.085, -0.085, -0.812, -0.655, 1795, 5.85,\n\t\t\t\t0.495, 0.362, 0.613, 0.276, 0.672);\n\t\t// PGV - these are actually from 1-sec SA using the Newmark & Hall (1982). According to the ShakeMap docs this\n\t\t// scaling factor is PGV = (37.27*2.54)*SA1.0\n\t\t// The following formula is slightly more accurate (from Ken Campbell)\n\t\tdouble SA10toPGV = Math.log(981.0 / (2.0 * Math.PI * 1.65));\n\t\tBJF_1997_AttenRelCoefficients coeff5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, -1.133 + SA10toPGV, -1.009 + SA10toPGV, -1.08 + SA10toPGV, 1.036,\n\t\t\t\t-0.032, -0.798, -0.698, 1406, 2.9, 0.474, 0.325, 0.575, 0.214, 0.613);\n\n\t\t// add these to the list\n\t\tcoefficientsBJF.put(coeff0.getName(), coeff0);\n\t\tcoefficientsBJF.put(coeff1.getName(), coeff1);\n\t\tcoefficientsBJF.put(coeff2.getName(), coeff2);\n\t\tcoefficientsBJF.put(coeff3.getName(), coeff3);\n\t\tcoefficientsBJF.put(coeff4.getName(), coeff4);\n\t\tcoefficientsBJF.put(coeff5.getName(), coeff5);\n\n\t}", "public void calcInc(int np)\n\t{\n \n findSpecEq();\n int nofc=numberOfComponents;\n fvec.timesEquals(0.0);\n fvec.set(nofc+1,0,1.0);\n Matrix dxds=Jac.solve(fvec);\n if (np<5)\n {\n double dp=0.01;\n ds=dp/dxds.get(nofc+1,0);\n Xgij.setMatrix(0,nofc+1,np-1,np-1,u);\n dxds.timesEquals(ds);\n // dxds.print(0,10);\n u.plusEquals(dxds);\n // Xgij.print(0,10);\n// u.print(0,10);\n }\n else\n {\n //System.out.println(\"iter \" +iter + \" np \" + np);\n if (iter>6)\n { \n ds *= 0.5;\n System.out.println(\"ds > 6\");\n }\n \n else\n {\n if (iter<3) {\n ds *= 1.5;\n }\n if (iter==3) {\n ds *= 1.1;\n }\n if (iter==4) {\n ds *= 1.0;\n }\n if (iter>4) {\n ds *= 0.5;\n }\n \n// Now we check wheater this ds is greater than dTmax and dPmax.\n if(Math.abs(system.getTemperature()*dxds.get(nofc,0)*ds)>dTmax){\n // System.out.println(\"true T\");\n ds=sign(dTmax/system.getTemperature()/Math.abs(dxds.get(nofc,0)),ds);\n }\n \n if(Math.abs(system.getPressure()*dxds.get(nofc+1,0)*ds)>dPmax)\n {\n ds=sign(dPmax/system.getPressure()/Math.abs(dxds.get(nofc+1,0)),ds);\n // System.out.println(\"true P\");\n }\n if (etterCP2) {\n etterCP2=false;\n ds = 0.5*ds;\n }\n \n Xgij.setMatrix(0,nofc+1,0,2,Xgij.getMatrix(0,nofc+1,1,3)); \n Xgij.setMatrix(0,nofc+1,3,3,u);\n s.setMatrix(0,0,0,3,Xgij.getMatrix(speceq,speceq,0,3));\n // s.print(0,10);\n // System.out.println(\"ds1 : \" + ds);\n calcInc2(np);\n // System.out.println(\"ds2 : \" + ds);\n \n// Here we find the next point from the polynomial.\n \n }\n }\n }", "public static ResourceGraph solveResourceFlow(final RecipeGraph graph, List<GraphSolver.Constraint> constraints) {\n ArrayList<Recipe> recipes = new ArrayList<>();\n recipes.addAll(graph.vertexSet());\n\n ArrayList<RecipeEdge> edges = new ArrayList<>();\n edges.addAll(graph.edgeSet());\n\n int width = edges.size() + recipes.size();\n\n List<double[]> matrix = new ArrayList<>();\n List<Double> rhs = new ArrayList<>();\n\n for (Recipe recipe : recipes) {\n for (String item : recipe.inputItems.keySet()) {\n double[] line = new double[width];\n\n int r = recipes.indexOf(recipe);\n line[edges.size() + r] = -1.0 * recipe.inputRate(item);\n\n int edgesFound = 0;\n for(RecipeEdge edge : graph.incomingEdgesOf(recipe)) {\n if (!item.equals(edge.getItem())) {\n continue;\n }\n\n int e = edges.indexOf(edge);\n line[e] = 1.0;\n\n edgesFound++;\n }\n\n if (edgesFound == 0) {\n continue;\n }\n\n matrix.add(line);\n rhs.add(0.0);\n }\n }\n\n // need variables in solution for proportion of output in monosplit situation!\n // create a line per (vertex, item) pair\n // add 1.0 for all edges that consume or produce resource\n // add -1.0 for vertex input/output rate\n for (Recipe recipe : recipes) {\n for (String item : recipe.outputItems.keySet()) {\n double[] line = new double[width];\n\n int r = recipes.indexOf(recipe);\n line[edges.size() + r] = -1.0 * recipe.outputRate(item);\n\n int edgesFound = 0;\n for(RecipeEdge edge : graph.outgoingEdgesOf(recipe)) {\n if (!item.equals(edge.getItem())) {\n continue;\n }\n\n int e = edges.indexOf(edge);\n line[e] = 1.0;\n\n edgesFound++;\n }\n\n if (edgesFound == 0) {\n continue;\n }\n\n matrix.add(line);\n rhs.add(0.0);\n }\n }\n\n for (int c = 0; c < constraints.size(); c++) {\n double[] line = new double[width];\n GraphSolver.Constraint constraint = constraints.get(c);\n\n Recipe r = graph.getRecipe(constraint.recipe);\n if (r == null) {\n throw new NullPointerException(\"Unknown recipe from constraint \" + constraint.recipe);\n }\n\n double rate = 0;\n if (constraint.type == GraphSolver.ConstraintType.INPUT) {\n String item = constraint.item;\n if (item == null && r.inputItems.size() == 1) {\n item = r.inputItems.keySet().iterator().next();\n }\n\n if (!r.inputItems.containsKey(item)) {\n throw new NullPointerException(\"Unknown item \" + constraint.item + \" from constraint on recipe \" + constraint.recipe);\n }\n\n rate = constraint.flow / r.inputRate(item);\n } else if (constraint.type == GraphSolver.ConstraintType.OUTPUT) {\n String item = constraint.item;\n if (item == null && r.outputItems.size() == 1) {\n item = r.outputItems.keySet().iterator().next();\n }\n\n if (!r.outputItems.containsKey(item)) {\n throw new NullPointerException(\"Unknown item from constraint on recipe \" + constraint.recipe);\n }\n\n rate = constraint.flow / r.outputRate(item);\n }\n\n int recipeIndex = recipes.indexOf(r);\n line[edges.size() + recipeIndex] = 1.0;\n\n matrix.add(line);\n rhs.add(rate);\n }\n\n double[][] matrixArray = matrix.toArray(new double[0][0]);\n RealMatrix coefficientsSmall = new Array2DRowRealMatrix(matrixArray, false);\n\n // we need a square matrix so we can use LU decomposition, which provides exact results\n // create an identity matrix, and overwrite the equations.\n int n = Math.max(matrix.size(), width);\n double[][] finalMatrix = new double[n][n];\n for(int i = 0; i < n; i++) {\n finalMatrix[i][i] = 1.0;\n }\n\n double[] rhsArray = new double[n];\n for (int i = 0; i < rhs.size(); i++) {\n rhsArray[i] = rhs.get(i);\n }\n\n coefficientsSmall.copySubMatrix(0, matrix.size() - 1, 0, width - 1, finalMatrix);\n RealMatrix coefficentsSquare = new Array2DRowRealMatrix(finalMatrix);\n\n DecompositionSolver solver = new LUDecomposition(coefficentsSquare).getSolver();\n RealVector constants = new ArrayRealVector(rhsArray, false);\n RealVector solution = solver.solve(constants);\n System.out.println(solution);\n\n ResourceGraph rg = new BasicGraphStream<>(graph).map(new ResourceGraph(),\n (g, v) -> new ResourceVertex(v, solution.getEntry(edges.size() + recipes.indexOf(v))),\n (g, e) -> {\n ResourceEdge edge = new ResourceEdge();\n g.setEdgeResource(edge, e.getItem(), solution.getEntry(edges.indexOf(e)));\n return edge;\n }\n );\n\n return rg;\n }", "@Override\n public CNF transformCNF(CNF cnf) throws QueryContradictoryException {\n HashMap<TimeSelector, Long> lowerBounds = new HashMap<>();\n /*\n * stores the newly inferred upper bounds for time selectors\n */\n HashMap<TimeSelector, Long> upperBounds = new HashMap<>();\n // clauses (not) to consider\n List<CNFElement> relevantClauses = cnf.getPredicates().stream()\n .filter(this::isRelevantClause)\n .collect(Collectors.toList());\n List<CNFElement> otherClauses = cnf.getPredicates().stream()\n .filter(clause -> !isRelevantClause(clause))\n .collect(Collectors.toList());\n List<ComparisonExpression> relevantComparisons = relevantClauses.stream()\n .map(clause -> clause.getPredicates().get(0))\n .collect(Collectors.toList());\n\n // stores all tuples (a,b) with a=b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cEq = new HashMap<>();\n // stores all tuples (a,b) with a<=b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cLeq = new HashMap<>();\n // stores all tuples (a,b) with a<b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cLt = new HashMap<>();\n // stores all tuples (a,b) with a!=b in relevant comparisons\n HashMap<ComparableExpression, HashSet<ComparableExpression>> cNeq = new HashMap<>();\n\n\n // init bounds\n for (ComparisonExpression comp : relevantComparisons) {\n ComparableExpression lhs = comp.getLhs().getWrappedComparable();\n ComparableExpression rhs = comp.getRhs().getWrappedComparable();\n Comparator comparator = comp.getComparator();\n if (comp.getLhs() instanceof TimeSelectorComparable) {\n lowerBounds.put((TimeSelector) lhs, TemporalElement.DEFAULT_TIME_FROM);\n upperBounds.put((TimeSelector) lhs, TemporalElement.DEFAULT_TIME_TO);\n }\n if (comp.getRhs() instanceof TimeSelectorComparable) {\n lowerBounds.put((TimeSelector) rhs, TemporalElement.DEFAULT_TIME_FROM);\n upperBounds.put((TimeSelector) rhs, TemporalElement.DEFAULT_TIME_TO);\n }\n // init c-relations\n if (comparator.equals(EQ)) {\n cEq.putIfAbsent(lhs, new HashSet<>());\n cEq.putIfAbsent(rhs, new HashSet<>());\n cEq.get(lhs).add(rhs);\n cEq.get(rhs).add(lhs);\n } else if (comparator.equals(Comparator.LTE)) {\n cLeq.putIfAbsent(lhs, new HashSet<>());\n cLeq.get(lhs).add(rhs);\n } else if (comparator.equals(Comparator.LT)) {\n cLt.putIfAbsent(lhs, new HashSet<>());\n cLt.get(lhs).add(rhs);\n } else if (comparator.equals(Comparator.NEQ)) {\n cNeq.putIfAbsent(lhs, new HashSet<>());\n cNeq.get(lhs).add(rhs);\n }\n }\n\n // compute closures for =,<,<=\n List<HashMap<ComparableExpression, HashSet<ComparableExpression>>> closures =\n computeClosureRelations(cEq, cLeq, cLt);\n\n checkLtContradictions(closures.get(2));\n // infer new bounds\n List<HashMap<TimeSelector, Long>> newBounds = updateEq(closures.get(0), lowerBounds, upperBounds);\n newBounds = updateLeq(closures.get(1), newBounds.get(0), newBounds.get(1));\n newBounds = updateLt(closures.get(2), newBounds.get(0), newBounds.get(1));\n\n // check them for contradictions with NEQ clauses\n checkNeqContradictions(cNeq, newBounds.get(0), newBounds.get(1));\n // filter redundant clauses like a.tx_from <= a.tx_to and comparisons between selectors and literals\n List<ComparisonExpression> remainingOldComparisons = filterRedundantComparisons(relevantComparisons);\n // construct new clauses\n List<ComparisonExpression> newComparisons = comparisons(newBounds.get(0), newBounds.get(1));\n\n // construct the CNF\n List<CNFElement> remainingOldClauses = remainingOldComparisons.stream()\n .map(comparison -> new CNFElement(Collections.singletonList(comparison)))\n .collect(Collectors.toList());\n List<CNFElement> newClauses = newComparisons.stream()\n .map(comparison -> new CNFElement(Collections.singletonList(comparison)))\n .collect(Collectors.toList());\n\n List<CNFElement> allClauses = otherClauses;\n allClauses.addAll(remainingOldClauses);\n allClauses.addAll(newClauses);\n return new CNF(allClauses);\n }", "default Gwei[][] get_crosslink_deltas(BeaconState state) {\n Gwei[] rewards = new Gwei[state.getValidatorRegistry().size().getIntValue()];\n Gwei[] penalties = new Gwei[state.getValidatorRegistry().size().getIntValue()];\n Arrays.fill(rewards, Gwei.ZERO);\n Arrays.fill(penalties, Gwei.ZERO);\n\n EpochNumber epoch = get_previous_epoch(state);\n for (UInt64 offset : UInt64s.iterate(UInt64.ZERO, get_epoch_committee_count(state, epoch))) {\n ShardNumber shard = get_epoch_start_shard(state, epoch)\n .plusModulo(offset, getConstants().getShardCount());\n List<ValidatorIndex> crosslink_committee = get_crosslink_committee(state, epoch, shard);\n Pair<Crosslink, List<ValidatorIndex>> winner =\n get_winning_crosslink_and_attesting_indices(state, epoch, shard);\n List<ValidatorIndex> attesting_indices = winner.getValue1();\n Gwei attesting_balance = get_total_balance(state, attesting_indices);\n Gwei committee_balance = get_total_balance(state, crosslink_committee);\n for (ValidatorIndex index : crosslink_committee) {\n Gwei base_reward = get_base_reward(state, index);\n if (attesting_indices.contains(index)) {\n rewards[index.getIntValue()] = rewards[index.getIntValue()]\n .plus(base_reward.times(attesting_balance).dividedBy(committee_balance));\n } else {\n penalties[index.getIntValue()] = penalties[index.getIntValue()]\n .plus(base_reward);\n }\n }\n }\n\n return new Gwei[][] { rewards, penalties };\n }", "private double calculateYearlyLoyaltyPoints(int year){\n \tLoyalty txnLoyalty = compositePOSTransaction.getLoyaltyCard();\n\t\tif (txnLoyalty == null){\n\t\t\treturn 0.0;\n\t\t}else if(!txnLoyalty.isYearlyComputed()){\n\t\t\treturn 0.0;\n\t\t}\n\t\t\n\t\tif(com.chelseasystems.cr.swing.CMSApplet.theAppMgr!=null &&\n \t\t\tcom.chelseasystems.cr.swing.CMSApplet.theAppMgr.getStateObject(\"THE_TXN\") != null){\n \t\t// this is an inquiry\n\t\t\tif (year == 0) {\n\t\t\t\treturn txnLoyalty.getCurrYearBalance();\n\t\t\t} else {\n\t\t\t\treturn txnLoyalty.getLastYearBalance();\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble loyaltyUsed = compositePOSTransaction.getUsedLoyaltyPoints();\n\t\tdouble points = compositePOSTransaction.getLoyaltyPoints();\n\n\t\tdouble currBal = txnLoyalty.getCurrBalance();\n\t\tdouble currYearBal = txnLoyalty.getCurrYearBalance();\n\t\tdouble lastYearBal = txnLoyalty.getLastYearBalance();\n\t\tif (loyaltyUsed > 0) {\n\t\t\tif (txnLoyalty.getLastYearBalance() < loyaltyUsed) {\n\t\t\t\tcurrYearBal = currYearBal - (loyaltyUsed - lastYearBal);\n\t\t\t\tlastYearBal = 0.0;\n\t\t\t} else {\n\t\t\t\tlastYearBal -= loyaltyUsed;\n\t\t\t}\n\t\t\tcurrBal -= loyaltyUsed;\n\t\t} else {\n\t\t\tcurrBal -= loyaltyUsed;\n\t\t\tcurrYearBal -= loyaltyUsed;\n\t\t}\n\n\t\tif (txnLoyalty.isYearlyComputed()) {\n\t\t\tcurrYearBal += points;\n\t\t} else {\n\t\t\tcurrYearBal = 0.0;\n\t\t\tlastYearBal = 0.0;\n\t\t}\n\n\t\tif (year == 0) {\n\t\t\treturn currYearBal;\n\t\t} else {\n\t\t\treturn lastYearBal;\n\t\t}\n }", "public double[][] calcCondStateProbs(char[] outcome, double[][] forwards, double[][] backwards) {\r\n\t\t// initialize return variable\r\n\t\tdouble[][] conditional = new double[states.length][outcome.length];\r\n\t\t\r\n\t\t// initialize the probability of this outcome to 0\r\n\t\tdouble outcomeProb = 0;\r\n\t\t// loop over all nodes in the last column\r\n\t\tfor (int i = 0; i < states.length; ++i)\r\n\t\t\t// add this node's probability to the overall probability\r\n\t\t\toutcomeProb += forwards[i][outcome.length - 1];\r\n\t\t\r\n\t\t// loop over all cells in the Viterbi graph\r\n\t\tfor (int row = 0; row < states.length; ++row) for (int col = 0; col < outcome.length; ++col)\r\n\t\t\t// calculate conditional probability of using this state in this column\r\n\t\t\tconditional[row][col] = forwards[row][col] * backwards[row][col] / outcomeProb;\r\n\t\t\t\r\n\t\t\r\n\t\treturn conditional;\r\n\t}", "public org.drip.state.estimator.PredictorResponseWeightConstraint fundingForwardPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel();\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardFundingPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "@Override\n\tpublic List<Variable> applyConstraints(List<Variable> variableList) {\n\t\tconstraintVariables.clear();\n\t\tvariables.clear();\n\n\t\tthis.variables = variableList;\n\n\t\tSystem.out.println(\"GAC:\");\n\n\t\treduceArc();\n\n\t\tsolved = GACSolve(queue.poll().number,variables);\n\n\t\tif (!solved){\n\t\t\tSystem.out.println(\"cannot be solved\");\n\t\t}\n\n\t\treturn variables;\n\t}", "@Override\n public void train() {\n actual = observations.toArray();\n min_val_error = Double.MAX_VALUE;\n if (findDecayConstant)\n for (float alpha = 0f; alpha <= 1f; alpha += 0.01f)\n initializeAndTrainModel(alpha);\n else\n initializeAndTrainModel(optAlpha);\n }", "@Test\r\n\tpublic void testGetPlannedCapacity_Nonlinear_Interval() {\n\t\tassertEquals(0, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 0), 0);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\r\n\t\tassertEquals(0, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 0, 0), 0);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\r\n\t\t\r\n\t}", "private LinearAVF() {\n this.booleanValueFunctions = new EnumMap<>(Criterion.class);\n this.linearValueFunctions = new EnumMap<>(Criterion.class);\n this.reversedValueFunctions = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasBooleanDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasDoubleDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n this.weight = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values()).forEach(criterion -> weight.put(criterion, 0.0d));\n }", "double[] compute_t_Cl (double[][] t_lift, double thickness, double camber) {\n double[] result = new double[15];\n if (camber >= 0)\n for (int aoa = -28, i = 0; aoa <= 28; aoa += 4, i++) \n result[i] = ci15_from_javafoil_data(t_lift, aoa, thickness, camber);\n else \n for (int aoa = -28, i = 0; aoa <= 28; aoa += 4, i++) \n result[i] = -ci15_from_javafoil_data(t_lift, -aoa, thickness, camber);\n return result;\n }", "public void calculateCoefficients(){\n\t\tdlt2d = null;\t//Get rid of existing calibration\n\t\tdouble[][] global = new double[calibrationFrame.data.size()-1][2]; //Global coordinates of the calibration object\n\t\tdouble[][] digitizedPoints = new double[calibrationFrame.data.size()-1][2];\n\t\t/*Copy the calibration object*/\n\t\tfor (int r = 0; r< calibrationFrame.data.size()-1;++r){\n\t\t\tfor (int c = 0; c<2;++c){\n\t\t\t\tSystem.out.println(calibrationFrame.data.get(r+1).get(c+1));\n\t\t\t\tglobal[r][c] = Double.parseDouble(calibrationFrame.data.get(r+1).get(c+1));\n\t\t\t}\n\t\t}\n\t\t/*Copy the calibration points*/\n\t\tfor (int r = 0; r< digitizedPoints.length;++r){\n\t\t\tfor (int c = 0; c< digitizedPoints[r].length;++c){\n\t\t\t\tdigitizedPoints[r][c] = (double) digitizedCalibration[r][c];\n\t\t\t}\n\t\t}\n\n\t\tdigitizedCalibration = null;\n\t\tdlt2d = new DLT2D(global,digitizedPoints);\n\t\t/*Print coefficients...*/\n\t\tMatrix coeffs = dlt2d.getCurrentDltCoefficients();\n\t\tString resultString = \"Coefficients\\n\";\n\t\tfor (int i = 0; i< coeffs.getRowDimension();++i){\n\t\t\tresultString += \"\\tCoeff \"+i+\": \"+Double.toString(coeffs.get(i,0))+\"\\n\";\n\t\t}\n\t\tSystem.out.println(resultString);\t\t\n\t\tstatus.setText(new String(\"2D DLT coefficients\"));\n\t\t/*Create text pane for coordinates*/\n\t\tpointFrame = new SaveableFrame(this);\n\t\tpointFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tpointFrame.pack();\n\t\tpointFrame.setLocation(10, 600);\n\t\tpointFrame.setVisible(true);\t\n\t\t\n\t\t\n\t}", "public JSONObject getDNAgainstSalesForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n List<Object> cnData = accEntityGstDao.getDNAgainstCustomer(reqParams);\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n\n totalAmountCN = (Double) data[3];\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\",authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n reqParams.put(\"isDebitNoteTransaction\", true);\n jSONObject = accGSTReportService.getCreditNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n reqParams.remove(\"isDebitNoteTransaction\");\n }\n return jSONObject;\n }", "public ModelParams optimize() throws Exception {\n\t\tint iterCount = 0;\n\t\tdivergence = KLDivergenceCalculator.calculate(cState, tState);\n\t\tSystem.out.println(\"KL Divergence : \" + divergence);\n\t\t// ((DivergenceChart) BeanFinder\n\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t// iterCount, divergence);\n\t\tdouble delta[] = null;\n\t\tdouble theta[] = data.getParams().getParams();\n\t\tdouble newDivergence = 0.0d;\n\t\tdouble initialStep = data.getInitialStepSize();\n\t\tboolean optimized = false;\n\t\tdo {\n\t\t\tdelta = computeGradient(theta);\n\t\t\tfor (double step = initialStep; iterCount < data.getMaxIterations(); step /= 10) {\n\t\t\t\tSystem.out.println(\"Step size : \" + step);\n\t\t\t\tSystem.out.println(\"KL divergence before taking a step : \"\n\t\t\t\t\t\t+ KLDivergenceCalculator.calculate(cState, tState));\n\t\t\t\tfor (int i = 0; i < delta.length; i++) {\n\t\t\t\t\tif (Double.isNaN(delta[i]))\n\t\t\t\t\t\tSystem.out.print(\"delta is NAN!!\" + delta[i] + \", \");\n\t\t\t\t\ttheta[i] -= step * delta[i];\n\t\t\t\t\tSystem.out.print((theta[i]) + \", \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t\tgetNewState(theta);\n\t\t\t\titerCount++;\n\t\t\t\tnewDivergence = KLDivergenceCalculator\n\t\t\t\t\t\t.calculate(cState, tState);\n\t\t\t\tSystem.out.println(\"KL Divergence : \" + newDivergence);\n\t\t\t\t// ((DivergenceChart) BeanFinder\n\t\t\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t\t\t// iterCount, newDivergence);\n\t\t\t\tif (newDivergence < divergence) {\n\t\t\t\t\tdivergence = newDivergence;\n\t\t\t\t\tinitialStep = step;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// before taking the next step size, reset theta to what it was\n\t\t\t\tfor (int i = 0; i < delta.length; i++)\n\t\t\t\t\ttheta[i] += step * delta[i];\n\t\t\t\tgetNewState(theta); // Added for checking. Not required.\n\t\t\t}\n\t\t\toptimized = optimized(theta);\n\t\t} while (!optimized && iterCount < data.getMaxIterations());\n\t\tModelParams optimParams = null;\n\t\tif (optimized) {\n\t\t\toptimParams = new ModelParams();\n\t\t\toptimParams.setParams(theta);\n\t\t}\n\t\treturn optimParams;\n\t}", "public static String getConstraintsForConjuct(GenerateCVC1 cvc, QueryBlockDetails queryBlock, Conjunct conjunct) throws Exception {\n\n\t\tString constraintString = \"\";\n\n\t\t/** If the given conjunct is null then no constraints need to be generated */\n\t\tif(conjunct == null)\n\t\t\treturn constraintString;\n\n\t\tconstraintString += \"\\n%---------------------------------\\n% EQUIVALENCE CLASS CONSTRAINTS\\n%---------------------------------\\n\";\n\n\t\t/** Get the equivalence class constraints for this conjunct*/\n\t\tVector<Vector<Node>> equivalenceClasses = conjunct.getEquivalenceClasses();\n\t\tfor(int k=0; k<equivalenceClasses.size(); k++){\n\t\t\tVector<Node> ec = equivalenceClasses.get(k);\n\t\t\tfor(int i=0;i<ec.size()-1;i++){\n\t\t\t\tNode n1 = ec.get(i);\n\t\t\t\tNode n2 = ec.get(i+1);\n\t\t\t\tconstraintString += GenerateJoinPredicateConstraints.getConstraintsForEquiJoins(cvc, queryBlock, n1,n2) +\"\\n\";\n\t\t\t}\n\t\t}\n\n\n\t\tconstraintString += \"\\n%---------------------------------\\n% SELECTION CLASS CONSTRAINTS\\n%---------------------------------\\n\";\n\n\t\t/** Get the constraints for the selection conditions of the form A.x = Constant of this conjunct */\n\t\tVector<Node> selectionConds = conjunct.getSelectionConds();\n\t\tfor(int k=0; k< selectionConds.size(); k++){\n\n\t\t\tString tableNo = selectionConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo) * queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */\n\t\t\tfor(int l=1;l<=count;l++)\n\t\t\t\tconstraintString += \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, selectionConds.get(k),l+offset-1)+\";\" +\"\\n\";\n\t\t}\n\n\n\n\t\tconstraintString += \"\\n%---------------------------------\\n% ALL CLASS CONSTRAINTS\\n%---------------------------------\\n\";\n\n\t\t/** Get the constraints for the non equi-join conditions */\n\t\tVector<Node> allConds = conjunct.getAllConds();\n\t\tfor(int k=0; k<allConds.size(); k++)\n\t\t\tconstraintString += GenerateJoinPredicateConstraints.getConstraintsForNonEquiJoins(cvc, queryBlock, allConds) +\"\\n\";\n\n\n\n\t\tconstraintString += \"\\n%---------------------------------\\n% STRING SELECTION CLASS CONSTRAINTS\\n%---------------------------------\\n\";\n\n\t\t/**get the constraints for the conditions of the form A.x=cons where cons is a string constant */\n\t\tVector<Node> stringSelectionConds = conjunct.getStringSelectionConds();\n\t\tfor(int k=0; k<stringSelectionConds.size(); k++){\n\n\t\t\tString tableNo = stringSelectionConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo) * queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;\n\t\t\tfor(int l=1;l<=count;l++)\n\t\t\t\tcvc.getStringConstraints().add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, stringSelectionConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\t\tconstraintString += \"\\n%---------------------------------\\n% LIKE CLAUSE CONSTRAINTS\\n%---------------------------------\\n\";\n\n\t\t/** Generate constraints for the like conditions of this conjunct*/\n\t\tVector<Node> likeConds = conjunct.getLikeConds();\n\t\tfor(int k=0; k<likeConds.size(); k++){\n\n\t\t\tString tableNo = likeConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo) * queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;\n\t\t\tfor(int l=1;l<=count;l++)\n\t\t\t\tcvc.getStringConstraints().add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, likeConds.get(k),l+offset-1)+\";\\n\" );\n\t\t}\n\n\n\t\tconstraintString += \"\\n%---------------------------------\\n% WHERE CLAUSE SUBQUERY BLOCK CONSTRAINTS\\n%---------------------------------\\n\";\n\t\tconstraintString += GenerateConstraintsForWhereClauseSubQueryBlock.getConstraintsForWhereClauseSubQueryBlock(cvc, queryBlock, conjunct);\n\t\tconstraintString += \"\\n%---------------------------------\\n% END OF WHERE CLAUSE SUBQUERY BLOCK CONSTRAINTS\\n%---------------------------------\\n\";\n\n\t\tConstraints finalConstraints=new Constraints();\n\t\tfinalConstraints.constraints.add(\"\");\n\t\tfinalConstraints.stringConstraints.add(\"\");\n\t\tfor(Disjunct disjunct:conjunct.disjuncts){\n\t\t\tConstraints constraints=GenerateConstraintsForDisjunct.getConstraintsForDisjuct(cvc, queryBlock, disjunct);\n\t\t\tfinalConstraints=Constraints.mergeConstraints(finalConstraints,constraints);\n\t\t}\n\t\tif(!conjunct.disjuncts.isEmpty()){\n\t\t\tconstraintString+=\"\\n\"+Constraints.getConstraint(finalConstraints) + \"\\n\";\n\t\t\tcvc.getStringConstraints().add(Constraints.getStringConstraints(finalConstraints));\n\t\t}\n\t\t\n\t\treturn constraintString;\n\t}", "public abstract ArrayList< Double > getObjectiveCoefs();", "private synchronized void initCircumstances() {\n if (circV == null) {\n\n // Calculate visit circumstances, which includes setup time.\n Function<Long, WorldCoords> coords = getObs()::getCoords;\n int size = Math.max(1, (int) (interval.getLength() / QUANTUM));\n circV = new TreeMap<Circumstance, Double[]>();\n for (Circumstance c: Circumstance.values()) {\n circV.put(c, new Double[size]);\n }\n TimingWindowSolver tws = new TimingWindowSolver(obs);\n ImprovedSkyCalc calc = new ImprovedSkyCalc(variant.getSchedule().getSite());\n for (int i = 0; i < size; i++) {\n long t = interval.getStart() + QUANTUM * i;\n calc.calculate(coords.apply(t), new Date(t), true);\n for (Circumstance c: Circumstance.values()) {\n Double[] vals = circV.get(c);\n switch (c) {\n case AIRMASS: vals[i] = calc.getAirmass(); break;\n case AZIMUTH: vals[i] = calc.getAzimuth(); break;\n case ELEVATION: vals[i] = calc.getAltitude(); break;\n case LUNAR_DISTANCE: vals[i] = calc.getLunarDistance(); break;\n case PARALLACTIC_ANGLE: vals[i] = calc.getParallacticAngle(); break;\n case TOTAL_SKY_BRIGHTNESS: vals[i] = calc.getTotalSkyBrightness(); break;\n case HOUR_ANGLE: vals[i] = calc.getHourAngle(); break;\n case TIMING_WINDOW_OPEN: vals[i] = tws.includes(t) ? 1. : 0.; break;\n default: throw new Error(\"Missing switch case for \" + c);\n }\n }\n }\n\n // Now calculate circumstances for science.\n if (getSetupType() != SetupType.NONE) {\n\n circS = new TreeMap<Circumstance, Double[]>();\n final long setupTime = getSetupTime();\n\n for (Circumstance c: Circumstance.values()) {\n\n Double[] valsV = circV.get(c);\n Double[] valsS = new Double[valsV.length];\n\n // We want to copy the range n ... length where n is the first\n // quantum that's not during setup time, or the last sample, so\n // we guarantee at least one.\n int n = Math.min((int) (setupTime / QUANTUM), valsV.length - 1);\n System.arraycopy(valsV, n, valsS, n, valsV.length - n);\n\n circS.put(c, valsS);\n\n }\n\n } else {\n\n // Science and visit circumstances are the same if there is no setup.\n circS = circV;\n\n }\n\n }\n }", "@Test\r\n\tpublic void testFillChargingPlan_Linear_HighInitialSoC() {\n\t\tdouble initialSoC = 0.9;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\tdouble desiredCapacity = car.getMissingCapacity();\r\n\t\t\r\n\t\t// Linear\r\n\t\tcar.setCurrentPlan(new double[96]);\r\n\t\tschedulerLinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 95, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\tstartTimeSeconds);\r\n\t\t\r\n\t\t\r\n\t\t//System.out.println(\"DesiredCapactiy: \" + desiredCapacity);\r\n\t\t//System.out.println(\"Planned capacity: \" + schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds));\r\n\t\t//System.out.println(Arrays.toString(car.getCurrentPlan()));\r\n\t\t\r\n\r\n\t\tassertTrue(car.getCurrentPlan()[0] > 0);\r\n\t\tassertEquals(car.getMissingCapacity(), schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-6);\r\n\t}", "@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 org.drip.state.estimator.PredictorResponseWeightConstraint volatilityPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams) return null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.volatilityPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\treturn prwc;\n\t}", "public List<Vector<Double>> calculateModel()\n {\n List<Vector<Double>> yModel = new LinkedList<>();\n yModel.add(this.initialValues());\n for (int j = 0; j < this.tSpan; j++)\n {\n yModel.add(this.calculateStep());\n }\n\n this.etatPopulation = yModel;\n return yModel;\n }", "public JSONObject getDNForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n List<Object> cnData = new ArrayList();\n if (!reqParams.optBoolean(\"onlycnagainstvendor\", false)) {\n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n cnData = gstr2Dao.getCNDNWithInvoiceDetailsInSql(reqParams);\n if (reqParams.has(\"zerorated\")) {\n reqParams.remove(\"zerorated\");\n }\n List<Object> cnDataWithoutInventory = gstr2Dao.getDNAgainstVendor(reqParams);\n if (cnDataWithoutInventory != null && !cnDataWithoutInventory.isEmpty()) {\n cnData.addAll(cnDataWithoutInventory);\n }\n }\n reqParams.put(\"isDebitNoteTransaction\", true);\n if (reqParams.has(\"cnentitycolnum\") && reqParams.has(\"cnentityValue\")) {\n /**\n * Return CN against vendors\n */\n if (reqParams.optBoolean(\"onlycnagainstvendor\", false)) {\n cnData.clear();\n reqParams.put(\"isDebitNoteTransaction\", false);\n }\n reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n List<Object> dnAgainstCustomer = gstr2Dao.getCNAgainstVendor(reqParams);\n if (dnAgainstCustomer != null) {\n cnData.addAll(dnAgainstCustomer);\n } \n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n }\n String companyId = reqParams.optString(\"companyid\");\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n totalAmountCN = data[3] != null ? (Double) data[3] : 0;\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN, companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount, companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount, companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount, companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount, companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount + CGSTAmount + SGSTAmount + CESSAmount, companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount, companyId));\n } else {\n jSONObject = accGSTReportService.getDebitNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n }\n// jSONObject.put(\"totalamount\", authHandler.formattedAmount(totalAmountCN, companyId));\n return jSONObject;\n }", "public static void checkConsistency(){\n double[] aNormalW=new double[numberOfObjectives];\n double randomIndex=0;\n double sum=0;\n for (int row=0;row<numberOfObjectives;row++){\n for (int column=0;column<numberOfObjectives;column++){\n\n sum+=weights[column]*objectives[row][column];\n }\n df.setRoundingMode(RoundingMode.UP);\n aNormalW[row]= Double.valueOf(df.format(sum));\n sum=0;\n }\n double awtDividedByWt=0;\n for (int i=0;i<numberOfObjectives;i++){\n awtDividedByWt+=aNormalW[i]/weights[i];\n decimalFormat.setRoundingMode(RoundingMode.HALF_UP);\n Double.valueOf(decimalFormat.format(awtDividedByWt));\n }\n double reciprocalNumber=(double) 1/numberOfObjectives;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n Double.valueOf(decimalFormat.format(reciprocalNumber));\n double step3=reciprocalNumber*awtDividedByWt;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n double numerator=Double.valueOf(decimalFormat.format(step3))-numberOfObjectives;\n double denominator=numberOfObjectives-1;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n double ci=Double.valueOf(decimalFormat.format(numerator)) /denominator;\n decimalFormat.setRoundingMode(RoundingMode.CEILING);\n System.out.println(\"Consistency Index (CI)= \"+Double.valueOf(decimalFormat.format(ci)));\n System.out.println();\n double ciDividedByRI=ci/table23(numberOfObjectives);\n decimalFormat.setRoundingMode(RoundingMode.UP);\n // Double.valueOf(df.format(ciDividedByRI));\n if (ciDividedByRI<0.10){\n randomIndex=ci/table23(numberOfObjectives);\n decimalFormat.setRoundingMode(RoundingMode.UP);\n System.out.println(\"Random Index (RI)= \"+Double.valueOf(decimalFormat.format(randomIndex)));\n System.out.println(\"degree of consistency is satisfactory !!\");\n }else {\n System.out.println(\"the AHP may not yield meaningful results !!\");\n }\n System.out.println();\n }", "public double pv (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqc,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t\tthrows java.lang.Exception\n\t{\n\t\tif (null == valParams || null == csqc)\n\t\t\tthrow new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqc.fundingState (fundingLabel());\n\n\t\tif (null == dcFunding) throw new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tdouble dblCumulativeConvexityAdjustedDirtyPV = 0.;\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodPayDate = period.payDate();\n\n\t\t\tif (iPeriodPayDate < iValueDate) continue;\n\n\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate,\n\t\t\t\tcsqc);\n\n\t\t\tif (null == cpcm) throw new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tdblCumulativeConvexityAdjustedDirtyPV += cpcm.dcf() * period.notional (iPeriodEndDate) *\n\t\t\t\tperiod.couponFactor (iPeriodEndDate) * period.fx (csqc) * period.survival (csqc) *\n\t\t\t\t\tperiod.df (csqc) * cpcm.cumulative() * cpcm.rate();\n\t\t}\n\n\t\treturn dblCumulativeConvexityAdjustedDirtyPV / dcFunding.df (iValueDate);\n\t}", "static WireloopReward constantCost() {\n return (s, a, n) -> RealScalar.of(-1.4); // -1.2\n }", "private void fillTrialConditionsData() {\n List<Condition> trialConditions = new ArrayList<Condition>();\n\n int instanceCounter = 1;\n for (Condition condition : this.workbookStudy.getConditions()) {\n if (condition.getDataType().equals(DATA_TYPE_CHAR)) {\n// LevelC levelCFilter = new LevelC(true);\n// LevelCPK levelCPK = new LevelCPK();\n// levelCPK.setLabelid(condition.getLabelId());\n// levelCFilter.setFactorid(condition.getFactorId());\n// levelCFilter.setLevelCPK(levelCPK);\n// List<LevelC> levelCList = this.servicioApp.getListLevelC(levelCFilter, 0, 0, false);\n List<LevelC> levelCList = condition.getFactor().getLevelsC();\n instanceCounter = 1;\n for (LevelC levelC : levelCList) {\n try {\n Condition conditionToAdd = new Condition();\n BeanUtilsBean.getInstance().copyProperties(conditionToAdd, condition);\n conditionToAdd.setValue(levelC.getLvalue());\n conditionToAdd.setInstance(instanceCounter);\n conditionToAdd.setLevelNo(levelC.getLevelCPK().getLevelno());\n trialConditions.add(conditionToAdd);\n instanceCounter++;\n } catch (IllegalAccessException ex) {\n Exceptions.printStackTrace(ex);\n } catch (InvocationTargetException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n } else if (condition.getDataType().equals(DATA_TYPE_NUMERIC)) {\n// LevelN levelNFilter = new LevelN(true);\n// LevelNPK levelnPK = new LevelNPK();\n// levelnPK.setLabelid(condition.getLabelId());\n// levelNFilter.setFactorid(condition.getFactorId());\n// levelNFilter.setLevelNPK(levelnPK);\n// List<LevelN> levelNList = this.servicioApp.getListLevelN(levelNFilter, 0, 0, false);\n List<LevelN> levelNList = condition.getFactor().getLevelsN();\n instanceCounter = 1;\n for (LevelN levelN : levelNList) {\n try {\n Condition conditionToAdd = new Condition();\n BeanUtilsBean.getInstance().copyProperties(conditionToAdd, condition);\n conditionToAdd.setValue(DecimalUtils.getValueAsString(levelN.getLvalue()));\n conditionToAdd.setInstance(instanceCounter);\n conditionToAdd.setLevelNo(levelN.getLevelNPK().getLevelno());\n trialConditions.add(conditionToAdd);\n instanceCounter++;\n } catch (IllegalAccessException ex) {\n Exceptions.printStackTrace(ex);\n } catch (InvocationTargetException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n }\n }\n\n Comparator<Condition> conditionComparator = new Comparator<Condition>() {\n\n @Override\n public int compare(Condition o1, Condition o2) {\n return o1.getInstance().compareTo(o2.getInstance());\n }\n };\n\n Collections.sort(trialConditions, conditionComparator);\n\n this.workbookStudy.setConditionsData(trialConditions);\n }", "public void cp_computeFlow () { \n double effaoa = effective_aoa();\n if (!can_do_gui_updates && current_part.foil.fast_coeffs()) {\n solver.set_q0();\n current_part.cl = solver.get_Cl(effaoa);\n } else {\n solver.getFreeStream();\n solver.getCirculation(effaoa, current_part.thickness, current_part.camber);\n solver.compute_foil_geometry(effaoa);\n current_part.cl = solver.get_Cl(effaoa);\n solver.genFlow(effaoa);\n } \n \n current_part.cm = current_part.compute_cm(effaoa);\n\n // test: is this the same value getCl_plot gives?\n // if (false) {\n // double getCl_plot_val = out_top.plot.getCl_plot(current_part.camber/25, current_part.thickness/25, effaoa);\n // if (getCl_plot_val != current_part.cl) {\n // System.out.println(\"-- getCl_plot_val: \" + getCl_plot_val + \"yet current_part.cl: \" + current_part.cl);\n // }\n // track_current_part.cl_changes();\n // }\n\n current_part.reynolds = foil_is_cylinder_or_ball(current_part.foil) \n ? velocity/vconv * 2 * radius/lconv * rho_EN / viscos\n : velocity/vconv * current_part.chord/lconv * rho_EN / viscos;\n\n if (can_do_gui_updates)\n solver.getProbe();\n\n double camd = current_part.camber;\n double alfd = effaoa; // effective_aoa();\n // attempt to fix symmetry problem\n if (fix_symmetry_problem && camd < 0.0) alfd = - alfd;\n \n // this saved current_part's cd, cd_profile and cd_aux\n solver.get_Cd(alfd); \n }", "public double calculateCriticalValue(Dot previous, Dot next){\n double d12 = Math.sqrt(Math.pow(this.x - previous.x, 2) + Math.pow(this.y - previous.y, 2));\n double d23 = Math.sqrt(Math.pow(next.x - this.x, 2) + Math.pow(next.y - this.y, 2));\n double d13 = Math.sqrt(Math.pow(next.x - previous.x, 2) + Math.pow(next.y - previous.y, 2));\n\n criticalValue = d12 + d23 - d13;\n return criticalValue;\n }", "public abstract double[] getMinimumValues(List<AbstractObjective> objectives, List<? extends Solution<?>> solutions) ;", "public JSONObject getAdvanceForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountAdv = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n if (reqParams.optBoolean(\"at\")) {\n /**\n * Get Advance for which invoice not linked yet\n */\n\n reqParams.put(\"at\", true);\n List<Object> receiptList = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n JSONArray bulkData = gSTR1DeskeraServiceDao.createJsonForAdvanceDataFetchedFromDB(receiptList, reqParams);\n Map<String, JSONArray> advanceMap = AccountingManager.getSortedArrayMapBasedOnJSONAttribute(bulkData, GSTRConstants.receiptadvanceid);\n for (String advdetailkey : advanceMap.keySet()) {\n double rate = 0d;\n JSONArray adDetailArr = advanceMap.get(advdetailkey);\n JSONObject advanceobj = adDetailArr.getJSONObject(0);\n taxableAmountAdv += advanceobj.optDouble(GSTRConstants.receiptamount) - advanceobj.optDouble(GSTRConstants.receipttaxamount);\n for (int index = 0; index < adDetailArr.length(); index++) {\n JSONObject invdetailObj = adDetailArr.getJSONObject(index);\n String defaultterm = invdetailObj.optString(GSTRConstants.defaultterm);\n\n /**\n * Iterate applied GST and put its Percentage and Amount\n * accordingly\n */\n double termamount = invdetailObj.optDouble(GSTRConstants.termamount);\n double taxrate = invdetailObj.optDouble(GSTRConstants.taxrate);\n /**\n * calculate tax amount by considering partial case\n */\n termamount = (advanceobj.optDouble(GSTRConstants.receiptamount) - advanceobj.optDouble(GSTRConstants.receipttaxamount)) * invdetailObj.optDouble(GSTRConstants.taxrate) / 100;\n if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n IGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n CGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n }\n }\n }\n\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// List<Object> AdvData = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// IGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// CGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n// CESSAmount += termamount;\n// }\n// }\n } else {\n /**\n * Get Advance for which invoice isLinked\n */\n reqParams.put(\"atadj\", true);\n List<Object> receiptList = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n JSONArray bulkData = gSTR1DeskeraServiceDao.createJsonForAdvanceDataFetchedFromDB(receiptList, reqParams);\n Map<String, JSONArray> advanceMap = AccountingManager.getSortedArrayMapBasedOnJSONAttribute(bulkData, GSTRConstants.receiptadvanceid);\n for (String advdetailkey : advanceMap.keySet()) {\n double rate = 0d;\n JSONArray adDetailArr = advanceMap.get(advdetailkey);\n JSONObject advanceobj = adDetailArr.getJSONObject(0);\n taxableAmountAdv += advanceobj.optDouble(GSTRConstants.adjustedamount);\n for (int index = 0; index < adDetailArr.length(); index++) {\n JSONObject invdetailObj = adDetailArr.getJSONObject(index);\n String defaultterm = invdetailObj.optString(GSTRConstants.defaultterm);\n\n /**\n * Iterate applied GST and put its Percentage and Amount\n * accordingly\n */\n double termamount = invdetailObj.optDouble(GSTRConstants.termamount);\n double taxrate = invdetailObj.optDouble(GSTRConstants.taxrate);\n /**\n * calculate tax amount by considering partial case\n */\n termamount = advanceobj.optDouble(GSTRConstants.adjustedamount) * invdetailObj.optDouble(GSTRConstants.taxrate) / 100;\n if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n IGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n CGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n }\n }\n }\n\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// List<Object> AdvDataLinked = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvDataLinked) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountAdv = (Double) data[2];\n// if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// IGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// CGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n// CESSAmount += termamount;\n// }\n// }\n }\n\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountAdv,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountAdv+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n return jSONObject;\n }", "public Object creditEarningsAndPayTaxes()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setInitialCash : \" + \"Agent\");\r\n/* 144 */ \tgetPriceFromWorld();\r\n/* 145 */ \tgetDividendFromWorld();\r\n/* */ \r\n/* */ \r\n/* 148 */ \tthis.cash -= (this.price * this.intrate - this.dividend) * this.position;\r\n/* 149 */ \tif (this.cash < this.mincash) {\r\n/* 150 */ \tthis.cash = this.mincash;\r\n/* */ }\t\r\n/* */ \r\n/* 153 */ \tthis.wealth = (this.cash + this.price * this.position);\r\n/* */ \r\n/* 155 */ \treturn this;\r\n/* */ }", "@NotNull\n @Generated\n @Selector(\"needRulesVerdict\")\n public static native NEFilterNewFlowVerdict needRulesVerdict();", "private List<InternalConstraint> genInternalCtrsForNonOverlapping(NonOverlapping ectr, GeostObject o) {\n List<InternalConstraint> ictrs = new ArrayList<InternalConstraint>();\n List<ShiftedBox> sb = stp.getShape(o.getShapeId().getLB());\n Iterator<Integer> itr;\n itr = ectr.getFrame().getRelForbidRegions().keySet().iterator();\n boolean printit = false;\n while (itr.hasNext()) {\n int i = itr.next();\n if (!(o.getObjectId() == i)) {\n for (int k = 0; k < sb.size(); k++) {\n // We will generate an outbox constraint corresponding to each relative forbidden region we already generated\n // for the shifted boxes of the shape corresponding to the Obj o\n\n // here we go into the relative forbidden regions\n loop:\n for (int l = 0; l < ectr.getFrame().getRelForbidRegions(i).size(); l++) {\n int[] t = new int[cst.getDIM()];\n int[] s = new int[cst.getDIM()];\n for (int j = 0; j < cst.getDIM(); j++) {\n int min = ectr.getFrame().getRelForbidRegions(i).get(l).getMinimumBoundary(j) - sb.get(k).getOffset(j) - sb.get(k).getSize(j);\n int max = ectr.getFrame().getRelForbidRegions(i).get(l).getMaximumBoundary(j) - sb.get(k).getOffset(j);\n\n s[j] = max - min + 1; // length of the jth coordinate\n if (s[j] <= 0) // since the length is negative\n continue loop;\n t[j] = min; // It is the offset. lower left corner.\n\n if (printit) System.out.println(o.getObjectId() + \" \" + j + \" \" + o);\n int supDom = o.getCoord(j).getUB();// + sb.get(k).getOffset(j) + sb.get(k).getSize(j);\n int infDom = o.getCoord(j).getLB();// + sb.get(k).getOffset(j) ;\n int maxObj = o.getCoord(j).getUB() + sb.get(k).getOffset(j) + sb.get(k).getSize(j) - 1;\n if (maxObj > o.getCoord(j).getUB()) maxObj = o.getCoord(j).getUB();\n int minObj = o.getCoord(j).getLB() + sb.get(k).getOffset(j);\n if (minObj < o.getCoord(j).getLB()) minObj = o.getCoord(j).getLB();\n\n if (printit) System.out.println(\"box: \" + t[j] + \" \" + s[j]);\n if (printit) System.out.println(\"dom: \" + minObj + \" \" + maxObj);\n\n\n if ((supDom < t[j]) || (infDom > t[j] + s[j])) {\n // this means the intersection of dom(o.x) and the region forbidden region associated with Outbox(t,s) is empty. In the other words all\n // the placement space is feasible for o.x according to the constraint Outbox(t,s)\n if (printit) System.out.println(\"skip\");\n continue loop;\n }\n if ((maxObj < t[j]) || (minObj > t[j] + s[j])) {\n // this means the intersection of dom(o.x) and the region forbidden region associated with Outbox(t,s) is empty. In the other words all\n // the placement space is feasible for o.x according to the constraint Outbox(t,s)\n if (printit) System.out.println(\"skip2\");\n continue loop;\n }\n\n //clipping\n if (stp.opt.clipping) {\n // t[j] = Math.max(minObj, t[j]);\n // s[j] = Math.min(maxObj, t[j] + s[j]) - t[j] ;\n }\n\n if (printit) System.out.println(\"result box: \" + t[j] + \" \" + s[j]);\n\n\n }\n\n Outbox new_ob = new Outbox(t, s);\n\n\n Pair<Outbox, Boolean> result;\n if (ictrs.size() != 0) {\n Outbox last_ob = (Outbox) ictrs.get(ictrs.size() - 1);\n result = mergeAdjacent(new_ob, last_ob);\n\n new_ob = result.fst;\n\n if (result.snd) ictrs.remove(ictrs.size() - 1);\n\n }\n\n ictrs.add(new_ob);\n }\n }\n }\n }\n return ictrs;\n }", "public double calculateObservedDisagreement();", "@DISPID(1610940427) //= 0x6005000b. The runtime will prefer the VTID if present\n @VTID(33)\n Constraints constraints();", "private String E19Conditions() {\n StringBuilder buffer = new StringBuilder();\n int numCols = 60;\n int leftMargin = 17;\n String tmp1 = \" \";\n String tmp2 = \" \";\n String tmp3 = \" \";\n String indent = \"\";\n for (int i = 0; i < leftMargin; i++) {\n indent = indent.concat(\" \");\n }\n buffer.append(\"\\f\");\n buffer.append(TextReportConstants.E19_HDR_CONDITIONS + \"\\n\\n\");\n\n TextReportData data = TextReportDataManager.getInstance()\n .getDataForReports(lid, 0);\n\n if (data.getRiverstat().getMile() != HydroConstants.MISSING_VALUE) {\n tmp1 = String.format(\"%-6.1f\", data.getRiverstat().getMile());\n }\n if (data.getRiverstat().getDa() != HydroConstants.MISSING_VALUE) {\n tmp2 = String.format(\"%-6.1f\", data.getRiverstat().getDa());\n }\n if (data.getRiverstat().getPool() != HydroConstants.MISSING_VALUE) {\n tmp3 = String.format(\"%-6.1f\", data.getRiverstat().getPool());\n }\n\n buffer.append(String.format(\n \" MILES ABOVE MOUTH: %s%sDRAINAGE AREA: %s%sPOOL STAGE: %s\",\n tmp1, \" \", tmp2, \" \", tmp3));\n buffer.append(\"\\n\\n\\n\");\n\n buffer.append(\" STREAM BED: \");\n\n if (data.getDescrip().getBed() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getBed(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REACH: \");\n if (data.getDescrip().getReach() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getReach(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REGULATION: \");\n if (data.getDescrip().getRes() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getRes(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" DIVERSION: \");\n if (data.getDescrip().getDivert() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getDivert(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" WINTER: \");\n if (data.getDescrip().getIce() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getIce(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" TOPOGRAPHY: \");\n if (data.getDescrip().getTopo() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getTopo(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REMARKS: \");\n if (data.getDescrip().getRemark() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getRemark(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n // try to place FOOTER at the bottom\n buffer.append(advanceToFooter(0, buffer.toString()));\n\n Date d = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\")).getTime();\n String footer = createFooter(data, E19_RREVISE_TYPE, sdf.format(d),\n \"NWS FORM E-19\", E19_CONDITIONS, \"CONDITIONS\", null,\n E19_STANDARD_LEFT_MARGIN);\n buffer.append(footer);\n\n return buffer.toString();\n }", "static boolean applyChainOptimized(android.support.constraint.solver.widgets.ConstraintWidgetContainer r39, android.support.constraint.solver.LinearSystem r40, int r41, int r42, android.support.constraint.solver.widgets.ChainHead r43) {\n /*\n r0 = r40\n r1 = r41\n r2 = r43\n android.support.constraint.solver.widgets.ConstraintWidget r3 = r2.mFirst\n android.support.constraint.solver.widgets.ConstraintWidget r4 = r2.mLast\n android.support.constraint.solver.widgets.ConstraintWidget r5 = r2.mFirstVisibleWidget\n android.support.constraint.solver.widgets.ConstraintWidget r6 = r2.mLastVisibleWidget\n android.support.constraint.solver.widgets.ConstraintWidget r7 = r2.mHead\n r8 = r3\n r9 = 0\n r10 = 0\n r11 = 0\n float r12 = r2.mTotalWeight\n android.support.constraint.solver.widgets.ConstraintWidget r13 = r2.mFirstMatchConstraintWidget\n android.support.constraint.solver.widgets.ConstraintWidget r14 = r2.mLastMatchConstraintWidget\n r2 = r39\n r15 = r8\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r8 = r2.mListDimensionBehaviors\n r8 = r8[r1]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r2 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.WRAP_CONTENT\n r16 = 0\n r17 = r9\n if (r8 != r2) goto L_0x002b\n r2 = 1\n goto L_0x002c\n L_0x002b:\n r2 = 0\n L_0x002c:\n r8 = 0\n r18 = 0\n r19 = 0\n if (r1 != 0) goto L_0x0050\n int r9 = r7.mHorizontalChainStyle\n if (r9 != 0) goto L_0x0039\n r9 = 1\n goto L_0x003a\n L_0x0039:\n r9 = 0\n L_0x003a:\n r8 = r9\n int r9 = r7.mHorizontalChainStyle\n r21 = r2\n r2 = 1\n if (r9 != r2) goto L_0x0044\n r2 = 1\n goto L_0x0045\n L_0x0044:\n r2 = 0\n L_0x0045:\n int r9 = r7.mHorizontalChainStyle\n r22 = r2\n r2 = 2\n if (r9 != r2) goto L_0x004e\n r2 = 1\n goto L_0x004f\n L_0x004e:\n r2 = 0\n L_0x004f:\n goto L_0x006e\n L_0x0050:\n r21 = r2\n int r2 = r7.mVerticalChainStyle\n if (r2 != 0) goto L_0x0058\n r2 = 1\n goto L_0x0059\n L_0x0058:\n r2 = 0\n L_0x0059:\n r8 = r2\n int r2 = r7.mVerticalChainStyle\n r9 = 1\n if (r2 != r9) goto L_0x0061\n r2 = 1\n goto L_0x0062\n L_0x0061:\n r2 = 0\n L_0x0062:\n int r9 = r7.mVerticalChainStyle\n r23 = r2\n r2 = 2\n if (r9 != r2) goto L_0x006b\n r2 = 1\n goto L_0x006c\n L_0x006b:\n r2 = 0\n L_0x006c:\n r22 = r23\n L_0x006e:\n r9 = 0\n r18 = 0\n r24 = r7\n r7 = r11\n r11 = r15\n r15 = r9\n r9 = 0\n L_0x0077:\n r19 = 0\n r25 = r13\n r13 = 8\n if (r10 != 0) goto L_0x0143\n r26 = r10\n int r10 = r11.getVisibility()\n if (r10 == r13) goto L_0x00ca\n int r9 = r9 + 1\n if (r1 != 0) goto L_0x0092\n int r10 = r11.getWidth()\n float r10 = (float) r10\n float r15 = r15 + r10\n goto L_0x0098\n L_0x0092:\n int r10 = r11.getHeight()\n float r10 = (float) r10\n float r15 = r15 + r10\n L_0x0098:\n if (r11 == r5) goto L_0x00a4\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n r10 = r10[r42]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r15 = r15 + r10\n L_0x00a4:\n if (r11 == r6) goto L_0x00b2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n int r20 = r42 + 1\n r10 = r10[r20]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r15 = r15 + r10\n L_0x00b2:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n r10 = r10[r42]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r18 = r18 + r10\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n int r20 = r42 + 1\n r10 = r10[r20]\n int r10 = r10.getMargin()\n float r10 = (float) r10\n float r18 = r18 + r10\n L_0x00ca:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r11.mListAnchors\n r10 = r10[r42]\n r27 = r9\n int r9 = r11.getVisibility()\n if (r9 == r13) goto L_0x0106\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r9 = r11.mListDimensionBehaviors\n r9 = r9[r1]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r13 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT\n if (r9 != r13) goto L_0x0106\n int r7 = r7 + 1\n if (r1 != 0) goto L_0x00f0\n int r9 = r11.mMatchConstraintDefaultWidth\n if (r9 == 0) goto L_0x00e7\n return r16\n L_0x00e7:\n int r9 = r11.mMatchConstraintMinWidth\n if (r9 != 0) goto L_0x00ef\n int r9 = r11.mMatchConstraintMaxWidth\n if (r9 == 0) goto L_0x00fe\n L_0x00ef:\n return r16\n L_0x00f0:\n int r9 = r11.mMatchConstraintDefaultHeight\n if (r9 == 0) goto L_0x00f5\n return r16\n L_0x00f5:\n int r9 = r11.mMatchConstraintMinHeight\n if (r9 != 0) goto L_0x0105\n int r9 = r11.mMatchConstraintMaxHeight\n if (r9 == 0) goto L_0x00fe\n goto L_0x0105\n L_0x00fe:\n float r9 = r11.mDimensionRatio\n int r9 = (r9 > r19 ? 1 : (r9 == r19 ? 0 : -1))\n if (r9 == 0) goto L_0x0106\n return r16\n L_0x0105:\n return r16\n L_0x0106:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r11.mListAnchors\n int r13 = r42 + 1\n r9 = r9[r13]\n android.support.constraint.solver.widgets.ConstraintAnchor r9 = r9.mTarget\n if (r9 == 0) goto L_0x012c\n android.support.constraint.solver.widgets.ConstraintWidget r13 = r9.mOwner\n r28 = r7\n android.support.constraint.solver.widgets.ConstraintAnchor[] r7 = r13.mListAnchors\n r7 = r7[r42]\n android.support.constraint.solver.widgets.ConstraintAnchor r7 = r7.mTarget\n if (r7 == 0) goto L_0x012a\n android.support.constraint.solver.widgets.ConstraintAnchor[] r7 = r13.mListAnchors\n r7 = r7[r42]\n android.support.constraint.solver.widgets.ConstraintAnchor r7 = r7.mTarget\n android.support.constraint.solver.widgets.ConstraintWidget r7 = r7.mOwner\n if (r7 == r11) goto L_0x0127\n goto L_0x012a\n L_0x0127:\n r17 = r13\n goto L_0x0131\n L_0x012a:\n r7 = 0\n goto L_0x012f\n L_0x012c:\n r28 = r7\n r7 = 0\n L_0x012f:\n r17 = r7\n L_0x0131:\n if (r17 == 0) goto L_0x0139\n r7 = r17\n r11 = r7\n r10 = r26\n goto L_0x013b\n L_0x0139:\n r7 = 1\n r10 = r7\n L_0x013b:\n r13 = r25\n r9 = r27\n r7 = r28\n goto L_0x0077\n L_0x0143:\n r26 = r10\n android.support.constraint.solver.widgets.ConstraintAnchor[] r10 = r3.mListAnchors\n r10 = r10[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r10 = r10.getResolutionNode()\n android.support.constraint.solver.widgets.ConstraintAnchor[] r13 = r4.mListAnchors\n int r20 = r42 + 1\n r13 = r13[r20]\n android.support.constraint.solver.widgets.ResolutionAnchor r13 = r13.getResolutionNode()\n r29 = r14\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r10.target\n if (r14 == 0) goto L_0x0480\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r13.target\n if (r14 != 0) goto L_0x0170\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r0\n goto L_0x048d\n L_0x0170:\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r10.target\n int r14 = r14.state\n r0 = 1\n if (r14 != r0) goto L_0x0471\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r13.target\n int r14 = r14.state\n if (r14 == r0) goto L_0x018d\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r40\n goto L_0x047f\n L_0x018d:\n if (r7 <= 0) goto L_0x0192\n if (r7 == r9) goto L_0x0192\n return r16\n L_0x0192:\n r0 = 0\n if (r2 != 0) goto L_0x0199\n if (r8 != 0) goto L_0x0199\n if (r22 == 0) goto L_0x01b2\n L_0x0199:\n if (r5 == 0) goto L_0x01a4\n android.support.constraint.solver.widgets.ConstraintAnchor[] r14 = r5.mListAnchors\n r14 = r14[r42]\n int r14 = r14.getMargin()\n float r0 = (float) r14\n L_0x01a4:\n if (r6 == 0) goto L_0x01b2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r14 = r6.mListAnchors\n int r20 = r42 + 1\n r14 = r14[r20]\n int r14 = r14.getMargin()\n float r14 = (float) r14\n float r0 = r0 + r14\n L_0x01b2:\n android.support.constraint.solver.widgets.ResolutionAnchor r14 = r10.target\n float r14 = r14.resolvedOffset\n r30 = r2\n android.support.constraint.solver.widgets.ResolutionAnchor r2 = r13.target\n float r2 = r2.resolvedOffset\n r20 = 0\n int r23 = (r14 > r2 ? 1 : (r14 == r2 ? 0 : -1))\n if (r23 >= 0) goto L_0x01c7\n float r23 = r2 - r14\n float r23 = r23 - r15\n goto L_0x01cb\n L_0x01c7:\n float r23 = r14 - r2\n float r23 = r23 - r15\n L_0x01cb:\n r27 = 1\n if (r7 <= 0) goto L_0x02b9\n if (r7 != r9) goto L_0x02b9\n android.support.constraint.solver.widgets.ConstraintWidget r20 = r11.getParent()\n if (r20 == 0) goto L_0x01e8\n r31 = r2\n android.support.constraint.solver.widgets.ConstraintWidget r2 = r11.getParent()\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r2 = r2.mListDimensionBehaviors\n r2 = r2[r1]\n r32 = r6\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r6 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.WRAP_CONTENT\n if (r2 != r6) goto L_0x01ec\n return r16\n L_0x01e8:\n r31 = r2\n r32 = r6\n L_0x01ec:\n float r23 = r23 + r15\n float r23 = r23 - r18\n r2 = r3\n r6 = r2\n r2 = r14\n L_0x01f3:\n if (r6 == 0) goto L_0x02ad\n android.support.constraint.solver.Metrics r11 = android.support.constraint.solver.LinearSystem.sMetrics\n if (r11 == 0) goto L_0x021a\n android.support.constraint.solver.Metrics r11 = android.support.constraint.solver.LinearSystem.sMetrics\n r33 = r8\n r34 = r9\n long r8 = r11.nonresolvedWidgets\n long r8 = r8 - r27\n r11.nonresolvedWidgets = r8\n android.support.constraint.solver.Metrics r8 = android.support.constraint.solver.LinearSystem.sMetrics\n r35 = r13\n r36 = r14\n long r13 = r8.resolvedWidgets\n long r13 = r13 + r27\n r8.resolvedWidgets = r13\n android.support.constraint.solver.Metrics r8 = android.support.constraint.solver.LinearSystem.sMetrics\n long r13 = r8.chainConnectionResolved\n long r13 = r13 + r27\n r8.chainConnectionResolved = r13\n goto L_0x0222\n L_0x021a:\n r33 = r8\n r34 = r9\n r35 = r13\n r36 = r14\n L_0x0222:\n android.support.constraint.solver.widgets.ConstraintWidget[] r8 = r6.mNextChainWidget\n r17 = r8[r1]\n if (r17 != 0) goto L_0x022e\n if (r6 != r4) goto L_0x022b\n goto L_0x022e\n L_0x022b:\n r13 = r40\n goto L_0x02a1\n L_0x022e:\n float r8 = (float) r7\n float r8 = r23 / r8\n int r9 = (r12 > r19 ? 1 : (r12 == r19 ? 0 : -1))\n if (r9 <= 0) goto L_0x0249\n float[] r9 = r6.mWeight\n r9 = r9[r1]\n r11 = -1082130432(0xffffffffbf800000, float:-1.0)\n int r9 = (r9 > r11 ? 1 : (r9 == r11 ? 0 : -1))\n if (r9 != 0) goto L_0x0241\n r8 = 0\n goto L_0x0249\n L_0x0241:\n float[] r9 = r6.mWeight\n r9 = r9[r1]\n float r9 = r9 * r23\n float r8 = r9 / r12\n L_0x0249:\n int r9 = r6.getVisibility()\n r11 = 8\n if (r9 != r11) goto L_0x0252\n r8 = 0\n L_0x0252:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n r9 = r9[r42]\n int r9 = r9.getMargin()\n float r9 = (float) r9\n float r2 = r2 + r9\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n r9 = r9[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r11 = r10.resolvedTarget\n r9.resolve(r11, r2)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n int r11 = r42 + 1\n r9 = r9[r11]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r11 = r10.resolvedTarget\n float r13 = r2 + r8\n r9.resolve(r11, r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n r9 = r9[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n r13 = r40\n r9.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n int r11 = r42 + 1\n r9 = r9[r11]\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r9.getResolutionNode()\n r9.addResolvedValue(r13)\n float r2 = r2 + r8\n android.support.constraint.solver.widgets.ConstraintAnchor[] r9 = r6.mListAnchors\n int r11 = r42 + 1\n r9 = r9[r11]\n int r9 = r9.getMargin()\n float r9 = (float) r9\n float r2 = r2 + r9\n L_0x02a1:\n r6 = r17\n r8 = r33\n r9 = r34\n r13 = r35\n r14 = r36\n goto L_0x01f3\n L_0x02ad:\n r33 = r8\n r34 = r9\n r35 = r13\n r36 = r14\n r13 = r40\n r8 = 1\n return r8\n L_0x02b9:\n r31 = r2\n r32 = r6\n r33 = r8\n r34 = r9\n r35 = r13\n r36 = r14\n r13 = r40\n int r2 = (r23 > r19 ? 1 : (r23 == r19 ? 0 : -1))\n if (r2 >= 0) goto L_0x02d3\n r8 = 0\n r22 = 0\n r2 = 1\n r30 = r2\n r33 = r8\n L_0x02d3:\n if (r30 == 0) goto L_0x0370\n float r23 = r23 - r0\n r2 = r3\n float r6 = r3.getBiasPercent(r1)\n float r6 = r6 * r23\n float r14 = r36 + r6\n r11 = r2\n r23 = r14\n L_0x02e3:\n if (r11 == 0) goto L_0x036a\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n if (r2 == 0) goto L_0x0301\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r8 = r2.nonresolvedWidgets\n long r8 = r8 - r27\n r2.nonresolvedWidgets = r8\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r8 = r2.resolvedWidgets\n long r8 = r8 + r27\n r2.resolvedWidgets = r8\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r8 = r2.chainConnectionResolved\n long r8 = r8 + r27\n r2.chainConnectionResolved = r8\n L_0x0301:\n android.support.constraint.solver.widgets.ConstraintWidget[] r2 = r11.mNextChainWidget\n r17 = r2[r1]\n if (r17 != 0) goto L_0x0309\n if (r11 != r4) goto L_0x0366\n L_0x0309:\n r2 = 0\n if (r1 != 0) goto L_0x0312\n int r6 = r11.getWidth()\n float r2 = (float) r6\n goto L_0x0317\n L_0x0312:\n int r6 = r11.getHeight()\n float r2 = (float) r6\n L_0x0317:\n android.support.constraint.solver.widgets.ConstraintAnchor[] r6 = r11.mListAnchors\n r6 = r6[r42]\n int r6 = r6.getMargin()\n float r6 = (float) r6\n float r6 = r23 + r6\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n r8.resolve(r9, r6)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n float r14 = r6 + r2\n r8.resolve(r9, r14)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n float r6 = r6 + r2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n int r8 = r8.getMargin()\n float r8 = (float) r8\n float r23 = r6 + r8\n L_0x0366:\n r11 = r17\n goto L_0x02e3\n L_0x036a:\n r37 = r7\n r38 = r34\n goto L_0x046f\n L_0x0370:\n if (r33 != 0) goto L_0x0374\n if (r22 == 0) goto L_0x036a\n L_0x0374:\n if (r33 == 0) goto L_0x0379\n float r23 = r23 - r0\n goto L_0x037d\n L_0x0379:\n if (r22 == 0) goto L_0x037d\n float r23 = r23 - r0\n L_0x037d:\n r2 = r3\n int r9 = r34 + 1\n float r6 = (float) r9\n float r6 = r23 / r6\n if (r22 == 0) goto L_0x0395\n r8 = r34\n r9 = 1\n if (r8 <= r9) goto L_0x0390\n int r9 = r8 + -1\n float r9 = (float) r9\n float r6 = r23 / r9\n goto L_0x0397\n L_0x0390:\n r9 = 1073741824(0x40000000, float:2.0)\n float r6 = r23 / r9\n goto L_0x0397\n L_0x0395:\n r8 = r34\n L_0x0397:\n r9 = r36\n int r11 = r3.getVisibility()\n r14 = 8\n if (r11 == r14) goto L_0x03a2\n float r9 = r9 + r6\n L_0x03a2:\n if (r22 == 0) goto L_0x03b2\n r11 = 1\n if (r8 <= r11) goto L_0x03b2\n android.support.constraint.solver.widgets.ConstraintAnchor[] r11 = r5.mListAnchors\n r11 = r11[r42]\n int r11 = r11.getMargin()\n float r11 = (float) r11\n float r9 = r36 + r11\n L_0x03b2:\n if (r33 == 0) goto L_0x03c0\n if (r5 == 0) goto L_0x03c0\n android.support.constraint.solver.widgets.ConstraintAnchor[] r11 = r5.mListAnchors\n r11 = r11[r42]\n int r11 = r11.getMargin()\n float r11 = (float) r11\n float r9 = r9 + r11\n L_0x03c0:\n r11 = r2\n r23 = r9\n L_0x03c3:\n if (r11 == 0) goto L_0x046b\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n if (r2 == 0) goto L_0x03e6\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n r37 = r7\n r38 = r8\n long r7 = r2.nonresolvedWidgets\n long r7 = r7 - r27\n r2.nonresolvedWidgets = r7\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r7 = r2.resolvedWidgets\n long r7 = r7 + r27\n r2.resolvedWidgets = r7\n android.support.constraint.solver.Metrics r2 = android.support.constraint.solver.LinearSystem.sMetrics\n long r7 = r2.chainConnectionResolved\n long r7 = r7 + r27\n r2.chainConnectionResolved = r7\n goto L_0x03ea\n L_0x03e6:\n r37 = r7\n r38 = r8\n L_0x03ea:\n android.support.constraint.solver.widgets.ConstraintWidget[] r2 = r11.mNextChainWidget\n r17 = r2[r1]\n if (r17 != 0) goto L_0x03f6\n if (r11 != r4) goto L_0x03f3\n goto L_0x03f6\n L_0x03f3:\n r8 = 8\n goto L_0x0463\n L_0x03f6:\n r2 = 0\n if (r1 != 0) goto L_0x03ff\n int r7 = r11.getWidth()\n float r2 = (float) r7\n goto L_0x0404\n L_0x03ff:\n int r7 = r11.getHeight()\n float r2 = (float) r7\n L_0x0404:\n if (r11 == r5) goto L_0x0411\n android.support.constraint.solver.widgets.ConstraintAnchor[] r7 = r11.mListAnchors\n r7 = r7[r42]\n int r7 = r7.getMargin()\n float r7 = (float) r7\n float r23 = r23 + r7\n L_0x0411:\n r7 = r23\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n r8.resolve(r9, r7)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n android.support.constraint.solver.widgets.ResolutionAnchor r9 = r10.resolvedTarget\n float r14 = r7 + r2\n r8.resolve(r9, r14)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n r8 = r8[r42]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n android.support.constraint.solver.widgets.ResolutionAnchor r8 = r8.getResolutionNode()\n r8.addResolvedValue(r13)\n android.support.constraint.solver.widgets.ConstraintAnchor[] r8 = r11.mListAnchors\n int r9 = r42 + 1\n r8 = r8[r9]\n int r8 = r8.getMargin()\n float r8 = (float) r8\n float r8 = r8 + r2\n float r23 = r7 + r8\n if (r17 == 0) goto L_0x03f3\n int r7 = r17.getVisibility()\n r8 = 8\n if (r7 == r8) goto L_0x0463\n float r23 = r23 + r6\n L_0x0463:\n r11 = r17\n r7 = r37\n r8 = r38\n goto L_0x03c3\n L_0x046b:\n r37 = r7\n r38 = r8\n L_0x046f:\n r2 = 1\n return r2\n L_0x0471:\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r40\n L_0x047f:\n return r16\n L_0x0480:\n r30 = r2\n r32 = r6\n r37 = r7\n r33 = r8\n r38 = r9\n r35 = r13\n r13 = r0\n L_0x048d:\n return r16\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.constraint.solver.widgets.Optimizer.applyChainOptimized(android.support.constraint.solver.widgets.ConstraintWidgetContainer, android.support.constraint.solver.LinearSystem, int, int, android.support.constraint.solver.widgets.ChainHead):boolean\");\n }", "private double GetMCRTestSet() \n\t{\n\t\tint numErrors = 0;\n\t\t\n\t\tfor(int i = ITrain; i < ITrain+ITest; i++)\n\t\t{\n\t\t\tPreCompute(i);\n\t\t\t\n\t\t\tdouble max_Y_hat_ic = Double.MIN_VALUE;\n\t\t\tint label_i = -1; \n\t\t\t\n\t\t\tfor(int c = 0; c < C; c++)\n\t\t\t{\n\t\t\t\tdouble Y_hat_ic = Predict(i, c);\n\t\t\t\t\n\n\t\t\t\tif(lossType == LossTypes.LOGISTIC)\n\t\t\t\t\tY_hat_ic = Sigmoid.Calculate(Y_hat_ic);\n\t\t\t\t\n\t\t\t\tif(Y_hat_ic > max_Y_hat_ic)\n\t\t\t\t{\n\t\t\t\t\tmax_Y_hat_ic = Y_hat_ic; \n\t\t\t\t\tlabel_i = (int)Math.ceil(c);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif( nominalLabels.indexOf(Y.get(i)) != label_i ) \n\t\t\t\tnumErrors++;\n\t\t}\n\t\t\n\t\treturn (double)numErrors/(double)ITest; \n\t}", "@Override\n\tpublic double calcDifferential(ConfIndex confIndex, RCs rcs, int nextPos, int nextRc) {\n\t\tif (cachedNode != confIndex.getNode()) {\n\t\t\tcalcCachedEnergies(confIndex, rcs);\n\t\t\tcachedNode = confIndex.getNode();\n\t\t}\n\t\t\n \t// compute the h-score\n \tdouble hscore = 0;\n \tfor (int i=0; i<confIndex.getNumUndefined(); i++) {\n \t\tint pos = confIndex.getUndefinedPos()[i];\n \t\t\n \t\t// don't score at nextPos, it's defined now\n \t\tif (pos == nextPos) {\n \t\t\tcontinue;\n \t\t}\n \t\t\n \t\t// compute the new min energy over all rcs\n \t\tdouble minRCEnergy = Double.POSITIVE_INFINITY;\n \t\t\n \t\tdouble[] cachedEnergiesAtPos = cachedEnergies[pos];\n \t\tdouble[][] undefinedEnergiesAtPos = undefinedEnergies[pos];\n \t\t\n\t\t\t// for each rc at this pos...\n\t\t\tint[] rcsAtPos = rcs.get(pos);\n\t\t\tint n = rcsAtPos.length;\n\t\t\tfor (int j=0; j<n; j++) {\n\t\t\t\tint rc = rcsAtPos[j];\n\t\t\t\t\n\t\t\t\tdouble rcEnergy = cachedEnergiesAtPos[j];\n\t\t\t\t\n\t\t\t\t// subtract undefined contribution\n\t\t\t\tif (pos > nextPos) {\n\t\t\t\t\trcEnergy -= undefinedEnergiesAtPos[j][nextPos];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// add defined contribution\n\t\t\t\trcEnergy += emat.getPairwise(pos, rc, nextPos, nextRc);\n\t\t\t\t\n\t\t\t\tminRCEnergy = Math.min(minRCEnergy, rcEnergy);\n\t\t\t}\n\t\t\t\n\t\t\thscore += minRCEnergy;\n \t}\n \t\n \treturn hscore;\n\t}", "private void addC2Constraints(double[] alpha, GRBVar[][] xVars, GRBVar[][] yVars, GRBModel model)\n\t\t\tthrows GRBException {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tString constraintName = \"constraintC2_\" + i;\n\t\t\t// out_x(i) + out_y(i) - in_y(i) = alpha_i\n\t\t\tGRBLinExpr constraintLinExpr = new GRBLinExpr();\n\n\t\t\t// Expression += out_x(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Expression += out_y(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, yVars, constraintLinExpr);\n\n\t\t\t// Expression -= in_y(i)\n\t\t\tGRBSolverUtils.addInTerm(i, -1, mExplicitMDP, yVars, constraintLinExpr);\n\n\t\t\t// Add constraint\n\t\t\tmodel.addConstr(constraintLinExpr, GRB.EQUAL, alpha[i], constraintName);\n\t\t}\n\t}", "JsonObjectBuilder evelThresholdCrossingObject()\r\n\t {\r\n\t double version = major_version+(double)minor_version/10;\r\n\r\n\t EVEL_ENTER();\r\n\t \r\n\r\n\t /***************************************************************************/\r\n\t /* Check preconditions. */\r\n\t /***************************************************************************/\r\n\t assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_THRESHOLD_CROSSING);\r\n\r\n\t /***************************************************************************/\r\n\t /* Mandatory fields. */\r\n\t /***************************************************************************/\r\n\t //encode counter\r\n JsonObjectBuilder counterobj = Json.createObjectBuilder()\r\n .add( \"criticality\",additionalParameters.criticality)\r\n .add( \"name\", additionalParameters.name)\r\n .add( \"thresholdCrossed\",additionalParameters.thresholdCrossed)\r\n .add( \"value\", additionalParameters.value);\r\n\r\n\t \r\n\t JsonObjectBuilder evelrep = Json.createObjectBuilder()\r\n\t \t\t .add(\"additionalParameters\", counterobj)\r\n\t \t .add(\"alertAction\", alertAction.toString())\r\n\t \t .add(\"alertDescription\", alertDescription)\r\n .add(\"alertType\", alertType.toString())\r\n .add(\"collectionTimestamp\", collectionTimestamp.toString())\r\n .add(\"eventSeverity\",eventSeverity.toString())\r\n .add(\"eventStartTimestamp\",eventStartTimestamp.toString());\r\n\r\n\t /***************************************************************************/\r\n\t /* Optional fields. */\r\n\t /***************************************************************************/\r\n\t alertValue.encJsonValue(evelrep, \"alertValue\");\r\n\t if( alertidList != null && alertidList.size() > 0)\r\n\t {\r\n\t\t JsonArrayBuilder builder = Json.createArrayBuilder();\r\n\t\t for(int i=0;i<alertidList.size();i++) {\r\n\t\t\t String addl_info = alertidList.get(i);\r\n\t\t\t JsonObject obj = Json.createObjectBuilder()\r\n\t\t\t \t .add(\"item\",addl_info).build();\r\n\t\t\t builder.add(obj);\r\n\t\t }\r\n\t\t\tevelrep.add(\"associatedAlertIdList\", builder);\r\n\t }\r\n\r\n\t dataCollector.encJsonValue(evelrep, \"dataCollector\");\r\n\t elementType.encJsonValue(evelrep, \"elementType\");\r\n\t interfaceName.encJsonValue(evelrep, \"interfaceName\");\r\n\t networkService.encJsonValue(evelrep, \"networkService\");\r\n\t possibleRootCause.encJsonValue(evelrep, \"possibleRootCause\");\r\n\r\n\t \r\n\t evelrep.add( \"thresholdCrossingFieldsVersion\", version);\r\n\r\n\t if( additional_info != null )\r\n\t {\r\n\t JsonArrayBuilder builder = Json.createArrayBuilder();\r\n\t for(int i=0;i<additional_info.size();i++) {\r\n\t\t String[] addl_info = additional_info.get(i);\r\n\t\t JsonObject obj = Json.createObjectBuilder()\r\n\t\t \t .add(\"name\", addl_info[0])\r\n\t\t \t .add(\"value\", addl_info[1]).build();\r\n\t\t builder.add(obj);\r\n\t }\r\n\t\tevelrep.add(\"additionalFields\", builder);\r\n\t }\r\n\r\n\r\n\t EVEL_EXIT();\r\n\t \r\n\t return evelrep;\r\n\t}", "@Override\n\tpublic void update(int timeStep)\n\t{\n\t\tthis.checkForNewAppliancesAndUpdateConstants();\n\n\t\tdouble[] ownersCostSignal = this.owner.getPredictedCostSignal();\n\t\tthis.dayPredictedCostSignal = Arrays.copyOfRange(ownersCostSignal, timeStep % ownersCostSignal.length, timeStep\n\t\t\t\t% ownersCostSignal.length + this.ticksPerDay);\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"update\");\n\t\t}\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"dayPredictedCostSignal: \" + Arrays.toString(this.dayPredictedCostSignal));\n\t\t}\n\n\t\tthis.dayPredictedCostSignal = ArrayUtils\n\t\t\t\t.offset(ArrayUtils.multiply(this.dayPredictedCostSignal, this.predictedCostToRealCostA), this.realCostOffsetb);\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"afterOffset dayPredictedCostSignal: \" + Arrays.toString(this.dayPredictedCostSignal));\n\t\t}\n\n\t\tif (this.owner.isHasElectricalSpaceHeat())\n\t\t{\n\t\t\tthis.setPointProfile = Arrays.copyOf(this.owner.getSetPointProfile(), this.owner.getSetPointProfile().length);\n\t\t\tthis.optimisedSetPointProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tthis.currentTempProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tthis.heatPumpDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(this.setPointProfile);\n\t\t\t// (20/01/12) Check if sum of <heatPumpDemandProfile> is consistent\n\t\t\t// at end day\n\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t{\n\t\t\t\tthis.mainContext.logger\n\t\t\t\t\t\t.trace(\"Sum(Wattbox estimated heatPumpDemandProfile): \" + ArrayUtils.sum(this.heatPumpDemandProfile));\n\t\t\t}\nif (\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\tthis.mainContext.logger.trace(\"Sum(Wattbox estimated heatPumpDemandProfile): \"\n\t\t\t\t\t+ ArrayUtils.sum(this.calculateEstimatedSpaceHeatPumpDemand(this.optimisedSetPointProfile)));\n}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.heatPumpDemandProfile = Arrays.copyOf(this.noElecHeatingDemand, this.noElecHeatingDemand.length);\n\t\t}\n\n\t\tif (this.owner.isHasElectricalWaterHeat())\n\t\t{\n\t\t\tthis.hotWaterVolumeDemandProfile = Arrays.copyOfRange(this.owner.getBaselineHotWaterVolumeProfile(), (timeStep % this.owner\n\t\t\t\t\t.getBaselineHotWaterVolumeProfile().length), (timeStep % this.owner.getBaselineHotWaterVolumeProfile().length)\n\t\t\t\t\t+ this.ticksPerDay);\n\t\t\tthis.waterHeatDemandProfile = ArrayUtils.multiply(this.hotWaterVolumeDemandProfile, Consts.WATER_SPECIFIC_HEAT_CAPACITY\n\t\t\t\t\t/ Consts.KWH_TO_JOULE_CONVERSION_FACTOR\n\t\t\t\t\t* (this.owner.waterSetPoint - ArrayUtils.min(Consts.MONTHLY_MAINS_WATER_TEMP) / Consts.DOMESTIC_HEAT_PUMP_WATER_COP));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.waterHeatDemandProfile = Arrays.copyOf(this.noElecHeatingDemand, this.noElecHeatingDemand.length);\n\t\t}\n\n\t\tif (this.coldAppliancesControlled && this.owner.isHasColdAppliances())\n\t\t{\n\t\t\tthis.optimiseColdProfile(timeStep);\n\t\t}\n\n\t\tif (this.wetAppliancesControlled && this.owner.isHasWetAppliances())\n\t\t{\n\t\t\tthis.optimiseWetProfile(timeStep);\n\t\t}\n\n\t\t// Note - optimise space heating first. This is so that we can look for\n\t\t// absolute\n\t\t// heat pump limit and add the cost of using immersion heater (COP 0.9)\n\t\t// to top\n\t\t// up water heating if the heat pump is too great\n\t\tif (this.spaceHeatingControlled && this.owner.isHasElectricalSpaceHeat())\n\t\t{\n\t\t\tif (this.owner.hasStorageHeater)\n\t\t\t{\n\t\t\t\tthis.optimiseStorageChargeProfile();\n\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t{\n\t\t\t\t\tthis.mainContext.logger.trace(\"Optimised storage heater profile = \" + Arrays.toString(this.heatPumpOnOffProfile));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tthis.optimiseSetPointProfile();\n\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t{\n\t\t\t\tthis.mainContext.logger.trace(\"Optimised set point profile = \" + Arrays.toString(this.heatPumpOnOffProfile));\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.waterHeatingControlled && this.owner.isHasElectricalWaterHeat())\n\t\t{\n\t\t\tthis.optimiseWaterHeatProfileWithSpreading();\n\t\t}\n\n\t\tif (this.eVehicleControlled && this.owner.isHasElectricVehicle())\n\t\t{\n\t\t\tthis.optimiseEVProfile();\n\t\t}\n\n\t\t// At the end of the step, set the temperature profile for today's\n\t\t// (which will be yesterday's when it is used)\n\t\tthis.priorDayExternalTempProfile = this.owner.getContext().getAirTemperature(timeStep, this.ticksPerDay);\n\t}", "public CXLContract(double cededPremiumFixed, double attachmentPoint, double limit, double aggregateDeductible,\n double aggregateLimit, IStabilizationStrategy stabilization,\n List<Double> reinstatementPremiumFactors, IRIPremiumSplitStrategy riPremiumSplit,\n IBoundaryIndexStrategy boundaryIndex, List<FactorsPacket> factors, IPeriodCounter periodCounter) {\n super(cededPremiumFixed, attachmentPoint, limit, aggregateDeductible, aggregateLimit, stabilization,\n reinstatementPremiumFactors, riPremiumSplit, boundaryIndex, factors, periodCounter);\n }", "IIntValueModel getMobilityPenaltyModel();", "public org.drip.state.estimator.PredictorResponseWeightConstraint forwardPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel();\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = null != floaterLabel && floaterLabel instanceof\n\t\t\torg.drip.state.identifier.ForwardLabel ? (org.drip.state.identifier.ForwardLabel) floaterLabel :\n\t\t\t\tnull;\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "@Test\n\tpublic void testATMSwaptionCalibration() throws CalculationException, SolverException {\n\n\t\tfinal int numberOfPaths\t\t= 10000; // ideale è 10'000 paths!\n\t\tfinal int numberOfFactors\t= 1;\n\n\t\tfinal long millisCurvesStart = System.currentTimeMillis();\n\n\n\t\tSystem.out.println(\"Calibration to Swaptions.\\n\");\n\n\t\tSystem.out.println(\"Calibration of rate curves:\");\n\n\t\tfinal AnalyticModel curveModel = getCalibratedCurve();\n\n\t\t// Create the forward curve (initial value of the LIBOR market model)\n\t\tfinal ForwardCurve forwardCurve = curveModel.getForwardCurve(\"ForwardCurveFromDiscountCurve(discountCurve-EUR,1D)\");\n\t\tfinal DiscountCurve discountCurve = curveModel.getDiscountCurve(\"discountCurve-EUR\");\n\t\t//\t\tcurveModel.addCurve(discountCurve.getName(), discountCurve);\n\n\t\tfinal long millisCurvesEnd = System.currentTimeMillis();\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"Brute force Monte-Carlo calibration of model volatilities:\");\n\n\t\tfinal ArrayList<String>\t\t\t\tcalibrationItemNames\t= new ArrayList<>();\n\t\tfinal ArrayList<CalibrationProduct>\tcalibrationProducts\t\t= new ArrayList<>();\n\n\t\tfinal double\tswapPeriodLength\t= 0.5;\n\n\t\tfinal String[] atmExpiries = {\n\t\t\t\t\"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\",\n\t\t\t\t\"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \n\t\t\t\t\"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\",\n\t\t\t\t\"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\",\n\t\t\t\t\"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\",\n\t\t\t\t\"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \n\t\t\t\t\"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\",\n\t\t\t\t\"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\",\n\t\t\t\t\"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"4Y\",\n\t\t\t\t\"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\",\n\t\t\t\t\"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\",\n\t\t\t\t\"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\",\n\t\t\t\t\"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\",\n\t\t\t\t\"15Y\", \"15Y\", \"15Y\", \"15Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\",\n\t\t\t\t\"20Y\", \"20Y\", \"20Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\",\n\t\t\t\t\"25Y\", \"25Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\" };\n\n\t\tfinal String[] atmTenors = {\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \n\t\t\t\t\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\n\t\t\t\t\"1Y\", \"2Y\",\"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\",\"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\",\n\t\t\t\t\"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\",\n\t\t\t\t\"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\",\n\t\t\t\t\"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\",\n\t\t\t\t\"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\",\n\t\t\t\t\"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\",\n\t\t\t\t\"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\",\n\t\t\t\t\"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\",\n\t\t\t\t\"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\",\n\t\t\t\t\"15Y\", \"20Y\", \"25Y\", \"30Y\" };\n\n\t\tfinal double[] atmNormalVolatilities = {\n\t\t\t\t0.0015335, 0.0015179, 0.0019499, 0.0024161, 0.0027817, 0.0031067, 0.0033722, 0.0035158, 0.0036656, 0.0037844, 0.00452, 0.0050913, 0.0054071, 0.0056496,\n\t\t\t\t//next is 2M\n\t\t\t\t0.0016709, 0.0016287, 0.0020182, 0.0024951, 0.002827, 0.0031023, 0.0034348, 0.0036183, 0.0038008, 0.0039155, 0.0046602, 0.0051981, 0.0055116, 0.0057249,\n\t\t\t\t\n\t\t\t\t0.0015543, 0.0016509, 0.0020863, 0.002587, 0.002949, 0.0032105, 0.0035338, 0.0037133, 0.0038475, 0.0040674, 0.0047458, 0.005276, 0.005476, 0.005793,\n\t\t\t\t0.0016777, 0.001937, 0.0023423, 0.0027823, 0.0031476, 0.0034569, 0.0037466, 0.0039852, 0.0041802, 0.0043221, 0.0049649, 0.0054206, 0.0057009, 0.0059071,\n\t\t\t\t//next is 9M\n\t\t\t\t0.0017809, 0.0020951, 0.0024978, 0.0029226, 0.0032379, 0.0035522, 0.0038397, 0.0040864, 0.0043122, 0.0044836, 0.0050939, 0.0054761, 0.0057374, 0.0059448,\n\t\t\t\t\n\t\t\t\t0.0020129, 0.0022865, 0.0027082, 0.0030921, 0.0033849, 0.0037107, 0.0039782, 0.0042058, 0.0044272, 0.0046082, 0.0051564, 0.0055307, 0.0057924, 0.0059811,\n\t\t\t\t//next is 18M\n\t\t\t\t0.0022824, 0.0025971, 0.0029895, 0.0033299, 0.0036346, 0.0039337, 0.0042153, 0.0044347, 0.0046686, 0.0048244, 0.0052739, 0.005604, 0.0058311, 0.0060011,\n\t\t\t\n\t\t\t\t0.0026477, 0.0029709, 0.0033639, 0.0036507, 0.0039096, 0.0041553, 0.0044241, 0.00462, 0.0048265, 0.004989, 0.005361, 0.0056565, 0.0058529, 0.0060102,\n\t\t\t\t0.003382, 0.0036593, 0.0039353, 0.0041484, 0.0043526, 0.0045677, 0.004775, 0.0049506, 0.0051159, 0.0052722, 0.0055185, 0.0057089, 0.0058555, 0.0059432,\n\t\t\t\t0.0040679, 0.0042363, 0.0044602, 0.0046206, 0.0047527, 0.0048998, 0.0050513, 0.0051928, 0.0053439, 0.0054657, 0.0056016, 0.0057244, 0.0058153, 0.0058793,\n\t\t\t\t0.0045508, 0.0046174, 0.0047712, 0.0048999, 0.0050364, 0.0051504, 0.0052623, 0.0053821, 0.0054941, 0.0055918, 0.0056569, 0.0057283, 0.0057752, 0.0058109,\n\t\t\t\t0.0051385, 0.0051373, 0.0052236, 0.005312, 0.0053793, 0.0054396, 0.0055037, 0.0055537, 0.0056213, 0.0056943, 0.005671, 0.0056707, 0.0056468, 0.0056423,\n\t\t\t\t0.0055069, 0.0054836, 0.0055329, 0.0055696, 0.005605, 0.0056229, 0.0056562, 0.005655, 0.0056679, 0.0057382, 0.0056494, 0.0055831, 0.0055096, 0.0054526,\n\t\t\t\t0.0054486, 0.0054057, 0.0054439, 0.005462, 0.0054915, 0.0054993, 0.0055134, 0.0054985, 0.0055318, 0.0055596, 0.005369, 0.0052513, 0.0051405, 0.0050416,\n\t\t\t\t0.005317, 0.005268, 0.005312, 0.0053112, 0.0053417, 0.0053556, 0.0053323, 0.0053251, 0.0053233, 0.0053126, 0.0050827, 0.004922, 0.0047924, 0.0046666,\n\t\t\t\t0.0051198, 0.0051013, 0.0051421, 0.0051418, 0.0051538, 0.005133, 0.0051081, 0.0050552, 0.005055, 0.0050473, 0.0048161, 0.0045965, 0.0044512, 0.0043099,\n\t\t\t\t0.0049482, 0.004947, 0.0049805, 0.0049951, 0.0050215, 0.0049849, 0.0049111, 0.0048498, 0.0047879, 0.0047688, 0.0044943, 0.0042786, 0.0041191, 0.0039756};\n\n\t\tfinal LocalDate referenceDate = LocalDate.of(2020, Month.JULY, 31);\n\t\tfinal BusinessdayCalendarExcludingTARGETHolidays cal = new BusinessdayCalendarExcludingTARGETHolidays();\n\t\tfinal DayCountConvention_ACT_365 modelDC = new DayCountConvention_ACT_365();\n\t\tfor(int i=0; i<atmNormalVolatilities.length; i++ ) {\n\n\t\t\tfinal LocalDate exerciseDate = cal.getDateFromDateAndOffsetCode(referenceDate, atmExpiries[i]);\n\t\t\tfinal LocalDate tenorEndDate = cal.getDateFromDateAndOffsetCode(exerciseDate, atmTenors[i]);\n\t\t\tdouble\texercise\t\t= modelDC.getDaycountFraction(referenceDate, exerciseDate);\n\t\t\tdouble\ttenor\t\t\t= modelDC.getDaycountFraction(exerciseDate, tenorEndDate);\n\n\t\t\t// We consider an idealized tenor grid (alternative: adapt the model grid)\n\t\t\texercise\t= Math.round(exercise/0.25)*0.25;\n\t\t\ttenor\t\t= Math.round(tenor/0.25)*0.25;\n\t\t\tif(exercise < 0.25) {continue;}\n\t\t\t//if(exercise < 1.0) {continue;}\n\n\t\t\tfinal int numberOfPeriods = (int)Math.round(tenor / swapPeriodLength);\n\n\t\t\tfinal double\tmoneyness\t\t\t= 0.0;\n\t\t\tfinal double\ttargetVolatility\t= atmNormalVolatilities[i];\n\n\t\t\tfinal String\ttargetVolatilityType = \"VOLATILITYNORMAL\";\n\n\t\t\tfinal double\tweight = 1.0;\n\n\t\t\tcalibrationProducts.add(createCalibrationItem(weight, exercise, swapPeriodLength, numberOfPeriods, moneyness, targetVolatility, targetVolatilityType, forwardCurve, discountCurve));\n\t\t\tcalibrationItemNames.add(atmExpiries[i]+\"\\t\"+atmTenors[i]);\n\t\t}\n\n\t\t/*\n\t\t * Create a simulation time discretization\n\t\t */\n\t\t// If simulation time is below libor time, exceptions will be hard to track.\n\t\tfinal double lastTime\t= 21.0;\n\t\tfinal double dtLibor\t= 0.5;\n\t\tfinal double dt\t= 0.125;\n\t\tfinal TimeDiscretization timeDiscretizationFromArray = new TimeDiscretizationFromArray(0.0, (int) (lastTime / dt), dt);\n\t\tfinal TimeDiscretization liborPeriodDiscretization = new TimeDiscretizationFromArray(0.0, (int) (lastTime / dtLibor), dtLibor);\n\t\tint seed =1111;\n\t\tSystem.out.println(\"seed: \" + seed);\n\t\tfinal BrownianMotion brownianMotion = new net.finmath.montecarlo.BrownianMotionLazyInit(timeDiscretizationFromArray, numberOfFactors, numberOfPaths, seed /* seed */); \n\t\tTimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00,0.25, 0.5, 1.00, 2.00, 3.00, 5.00, 7.00, 10.0, 15.0, 21.0);\n\t\t//TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.0, 7.00, 8.0,9.0, 10.0, 12.5, 15.0, 21.0);\t\t// needed if you use LIBORVolatilityModelPiecewiseConstantWithMercurioModification: TimeDiscretization = new TimeDiscretizationFromArray(0.0, 0.25, 0.50, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 25.0, 30.0, 40.0);\n\t //TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 0.5, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9,00, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 , 17.0, 18.0, 19.0 ,20.0,21.0);\n //TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 21, 1.0);\n\n\t\tdouble[] arrayValues = new double [timeToMaturityDiscretization.getNumberOfTimes()];\n\t\tfor (int i=0; i<timeToMaturityDiscretization.getNumberOfTimes(); i++) {arrayValues[i]= 0.1/100;}\n\n\t //final LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelTimeHomogenousPiecewiseConstantWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, timeToMaturityDiscretization, arrayValues);\n\t\tLIBORVolatilityModel volatilityModel = new LIBORVolatilityModelFourParameterExponentialFormWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, 0.002, 0.0005, 0.2, 0.00005, true); //0.20/100.0, 0.05/100.0, 0.10, 0.05/100.0, \n\t\t//final LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelPiecewiseConstantWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization,optionMaturityDiscretization,timeToMaturityDiscretization, 0.50 / 100);\n\t\t\n\t\tfinal LIBORCorrelationModel correlationModel = new LIBORCorrelationModelExponentialDecayWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, numberOfFactors, 0.05, false);\n\t\t//AbstractLIBORCovarianceModelParametric covarianceModelParametric = new LIBORCovarianceModelExponentialForm5Param(timeDiscretizationFromArray, liborPeriodDiscretization, numberOfFactors, new double[] { 0.20/100.0, 0.05/100.0, 0.10, 0.05/100.0, 0.10} );\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelParametric = new LIBORCovarianceModelFromVolatilityAndCorrelation(timeDiscretizationFromArray, liborPeriodDiscretization, volatilityModel, correlationModel);\n\n\t\t// Create blended local volatility model with fixed parameter (0=lognormal, > 1 = almost a normal model).\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelDisplaced = new DisplacedLocalVolatilityModel(covarianceModelParametric, 1.0/0.25, false /* isCalibrateable */);\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelReducedVolatility = new VolatilityReductionMercurioModel(covarianceModelDisplaced);\n\t\t\n\t\t// Set model properties\n\t\tfinal Map<String, Object> properties = new HashMap<>();\n\t\tSystem.out.println(\"Number of volatility parameters: \" + volatilityModel.getParameter().length);\n\n\t\tproperties.put(\"measure\", LIBORMarketModelFromCovarianceModelWithMercurioModification.Measure.SPOT.name());\n\n\t\t// Choose normal state space for the Euler scheme (the covariance model above carries a linear local volatility model).\n\t\tproperties.put(\"stateSpace\", LIBORMarketModelFromCovarianceModelWithMercurioModification.StateSpace.NORMAL.name());\n\n\t\t// Set calibration properties (should use our brownianMotion for calibration - needed to have to right correlation).\n\t\tfinal Double accuracy = new Double(1E-8);\t// Lower accuracy to reduce runtime of the unit test\n\t\tfinal int maxIterations = 400;\n\t\tfinal int numberOfThreads = 6;\n\t\tfinal OptimizerFactory optimizerFactory = new OptimizerFactoryLevenbergMarquardt(maxIterations, accuracy, numberOfThreads);\n\n\t\t//penso che getParameterAsDouble().length mi ritorni il numero di tutti i paratemtri da calibrare cioè tutta la piecewise volatiliy e anche correlazion\n\t\tfinal double[] parameterStandardDeviation = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tfinal double[] parameterLowerBound = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tfinal double[] parameterUpperBound = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tArrays.fill(parameterStandardDeviation, 0.20/100.0);\n\t\tArrays.fill(parameterLowerBound, 0.0);\n\t\tArrays.fill(parameterUpperBound, Double.POSITIVE_INFINITY);\n\n\t\t// Set calibration properties (should use our brownianMotion for calibration - needed to have to right correlation).\n\t\tfinal Map<String, Object> calibrationParameters = new HashMap<>();\n\t\tcalibrationParameters.put(\"accuracy\", accuracy);\n\t\tcalibrationParameters.put(\"brownianMotion\", brownianMotion);\n\t\tcalibrationParameters.put(\"optimizerFactory\", optimizerFactory);\n\t\tcalibrationParameters.put(\"parameterStep\", new Double(1E-4));\n\t\tproperties.put(\"calibrationParameters\", calibrationParameters);\n\n\t\tfinal long millisCalibrationStart = System.currentTimeMillis();\n\n\t\t/*\n\t\t * Create corresponding Forward Market Model\n\t\t */\n\t\tfinal CalibrationProduct[] calibrationItemsLMM = new CalibrationProduct[calibrationItemNames.size()];\n\t\tfor(int i=0; i<calibrationItemNames.size(); i++) {\n\t\t\tcalibrationItemsLMM[i] = new CalibrationProduct(calibrationProducts.get(i).getProduct(),calibrationProducts.get(i).getTargetValue(),calibrationProducts.get(i).getWeight());\n\t\t}\n\t\tfinal LIBORMarketModel mercurioModelCalibrated = LIBORMarketModelFromCovarianceModelWithMercurioModification.of(\n\t\t\t\tliborPeriodDiscretization,\n\t\t\t\tcurveModel,\n\t\t\t\tforwardCurve,\n\t\t\t\tnew DiscountCurveFromForwardCurve(forwardCurve),\n\t\t\t\trandomVariableFactory,\n\t\t\t\tcovarianceModelReducedVolatility,\n\t\t\t\tcalibrationItemsLMM, properties);\n\n\t\tfinal long millisCalibrationEnd = System.currentTimeMillis();\n\t\t\n//-------------------------------------------------------------------------------- fine calibrazione volatility------------------------------\n\t\tSystem.out.println(\"\\nCalibrated parameters are:\");\n\t\tfinal double[] param = ((AbstractLIBORCovarianceModelParametric)((LIBORMarketModelFromCovarianceModelWithMercurioModification) mercurioModelCalibrated).getCovarianceModel()).getParameterAsDouble();\n\t\tfor (final double p : param) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\n\t\tfinal EulerSchemeFromProcessModel process = new EulerSchemeFromProcessModel(mercurioModelCalibrated, brownianMotion);\n\t\tfinal LIBORModelMonteCarloSimulationModel simulationMercurioCalibrated = new LIBORMonteCarloSimulationFromLIBORModel(process);\n\n\t\tSystem.out.println(\"\\nValuation on calibrated model:\");\n\t\tdouble deviationSum\t\t\t= 0.0;\n\t\tdouble deviationSquaredSum\t= 0.0;\n\t\tfor (int i = 0; i < calibrationProducts.size(); i++) {\n\t\t\tfinal AbstractLIBORMonteCarloProduct calibrationProduct = calibrationProducts.get(i).getProduct();\n\t\t\ttry {\n\t\t\t\tfinal double valueModel = calibrationProduct.getValue(simulationMercurioCalibrated);\n\t\t\t\tfinal double valueTarget = calibrationProducts.get(i).getTargetValue().getAverage();\n\t\t\t\tfinal double error = valueModel-valueTarget;\n\t\t\t\tdeviationSum += error;\n\t\t\t\tdeviationSquaredSum += error*error;\n\t\t\t\tSystem.out.println(calibrationItemNames.get(i) + \"\\t\" + \"Model: \" + formatterValue.format(valueModel) + \"\\t Target: \" + formatterValue.format(valueTarget) + \"\\t Deviation: \" + formatterDeviation.format(valueModel-valueTarget));// + \"\\t\" + calibrationProduct.toString());\n\t\t\t}\n\t\t\tcatch(final Exception e) {\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Time required for calibration of curves.........: \" + (millisCurvesEnd-millisCurvesStart)/1000.0 + \" s.\");\n\t\tSystem.out.println(\"Time required for calibration of volatilities...: \" + (millisCalibrationEnd-millisCalibrationStart)/1000.0 + \" s.\");\n\n\t\tfinal double averageDeviation = deviationSum/calibrationProducts.size();\n\t\tSystem.out.println(\"Mean Deviation:\" + formatterValue.format(averageDeviation));\n\t\tSystem.out.println(\"RMS Error.....:\" + formatterValue.format(Math.sqrt(deviationSquaredSum/calibrationProducts.size())));\n\t\tSystem.out.println(\"__________________________________________________________________________________________\\n\");\n\n\t\tAssert.assertTrue(Math.abs(averageDeviation) < 2E-4);\n\n//\n//\t\t/*\n//\t\t * Checking serilization\n//\t\t */\n//\t\tbyte[] lmmSerialized = null;\n//\t\ttry {\n//\t\t\tfinal ByteArrayOutputStream baos = new ByteArrayOutputStream();\n//\t\t\tfinal ObjectOutputStream oos = new ObjectOutputStream( baos );\n//\t\t\toos.writeObject(mercurioModelCalibrated.getCloneWithModifiedData(null));\n//\t\t\tlmmSerialized = baos.toByteArray();\n//\t\t} catch (final IOException e) {\n//\t\t\tfail(\"Serialization failed with exception \" + e.getMessage());\n//\t\t}\n//\n//\t\tLIBORMarketModelFromCovarianceModelWithMercurioModification liborMarketModelFromSerialization = null;\n//\t\ttry {\n//\t\t\tfinal ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(lmmSerialized) );\n//\t\t\tliborMarketModelFromSerialization = (LIBORMarketModelFromCovarianceModelWithMercurioModification)ois.readObject();\n//\t\t} catch (IOException | ClassNotFoundException e) {\n//\t\t\tfail(\"Deserialization failed with exception \" + e.getMessage());\n//\t\t}\n//\n//\t\t/*\n//\t\t * Check if the deserialized model and the original calibrated model give the same valuations\n//\t\t */\n//\t\tif(liborMarketModelFromSerialization != null) {\n//\t\t\tfinal LIBORModelMonteCarloSimulationModel simulationFromSerialization = new LIBORMonteCarloSimulationFromLIBORModel(new EulerSchemeFromProcessModel(liborMarketModelFromSerialization, brownianMotion));\n//\n//\t\t\tSystem.out.println(\"\\nValuation on calibrated model:\");\n//\t\t\tfor (int i = 0; i < calibrationProducts.size(); i++) {\n//\t\t\t\tfinal AbstractLIBORMonteCarloProduct calibrationProduct = calibrationProducts.get(i).getProduct();\n//\t\t\t\ttry {\n//\t\t\t\t\tfinal double valueFromCalibratedModel = calibrationProduct.getValue(simulationMercurioCalibrated);\n//\t\t\t\t\tfinal double valueFromSerializedModel = calibrationProduct.getValue(simulationFromSerialization);\n//\t\t\t\t\tfinal double error = valueFromSerializedModel-valueFromCalibratedModel;\n//\t\t\t\t\tAssert.assertEquals(\"Valuation using deserilized model.\", valueFromCalibratedModel, valueFromSerializedModel, 1E-12);\n//\t\t\t\t\tSystem.out.println(calibrationItemNames.get(i) + \"\\t\" + formatterDeviation.format(error));\n//\t\t\t\t}\n//\t\t\t\tcatch(final Exception e) {\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t// CAPLET ON BACKWARD LOOKING RATE SEMESTRALI\n\t\tDecimalFormat formatterTimeValue = new DecimalFormat(\"##0.00;\");\n\t\tDecimalFormat formatterVolValue = new DecimalFormat(\"##0.00000;\");\n\t\tDecimalFormat formatterAnalytic = new DecimalFormat(\"##0.000;\");\n\t\tDecimalFormat formatterPercentage = new DecimalFormat(\" ##0.000%;-##0.000%\", new DecimalFormatSymbols(Locale.ENGLISH));\n\t\tdouble[] mktData = new double[] {/* 6M 0.00167, */ /* 12M*/ 0.00201, /* 18M*/ 0.00228, /* 2Y */ 0.00264, 0.0, /* 3Y */ 0.0033, /* 4Y */0.00406, /* 5Y */ 0.00455, /* 6Y - NA */ 0.0, /* 7Y */0.00513, /* 8Y- NA */0.0, /* 9Y */0.0, /* 10Y */0.00550,0.0,0.0,0.0,0.0, /* 15Y */0.00544,0.0,0.0,0.0,0.0, /* 20Y */0.0053,0.0,0.0,0.0,0.0,/* 25Y */ 0.0053,0.0,0.0,0.0,0.0,/* 30Y */0.00495,0.0,0.0,0.0 };\n\t\t\n\t\tdouble strike = 0.004783;\n\t\n\t\tint liborIndex=1;\n\t\tint mktDataIndex = 0;\n\n\t\t//Results with CALIBRATED model\n\t\tSystem.out.println(\"\\n results on CALIBRATED model \\n\");\n\t\twhile(liborIndex < liborPeriodDiscretization.getNumberOfTimes()) {\n\t\t\tdouble maturityMinusLengthLibor =liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble fixBackwardTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tCaplet capletCassical = new Caplet(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false, ValueUnit.NORMALVOLATILITY);\n\t\t\t//set to default ValueUnit.NORMALVOLATILITY for CapletOnBackwardLookingRate\n\t\t\tCapletOnBackwardLookingRate capletBackward = new CapletOnBackwardLookingRate(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false);\t\t\t\n\t\t\tdouble impliedVolClassical = capletCassical.getValue(simulationMercurioCalibrated);\n\t\t\tdouble impliedVolBackward = capletBackward.getValue(simulationMercurioCalibrated);\n\t\t\tdouble analyticFormulaPaper = Math.sqrt(1+0.5/(maturityMinusLengthLibor*3));\n\t\t\tdouble ratioImpliedVol = impliedVolBackward/impliedVolClassical;\n\t\t\tdouble error = (analyticFormulaPaper-ratioImpliedVol)/analyticFormulaPaper;\n\n\t\t\tif (liborIndex<5) {\t\t//da i valori del caplet per maturity 1.5Y, 2Y, 2.5Y,.\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\tliborIndex+=1;\n\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\tliborIndex+=1;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\t//secondo loop da i valori del caplet per maturity 4Y,5Y,...,21\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\t\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\n\t\t// Set model properties\n\t\tMap<String, String> properties2 = new HashMap<String, String >();\n\t\tproperties2.put(\"measure\", LIBORMarketModelFromCovarianceModelWithMercurioModification.Measure.SPOT.name());\n\t\tproperties2.put(\"stateSpace\", LIBORMarketModelFromCovarianceModelWithMercurioModification.StateSpace.NORMAL.name());\n\n\t\tfinal LIBORMarketModel MercurioModelNONcalibrated= new LIBORMarketModelFromCovarianceModelWithMercurioModification(\n\t\t\t\tliborPeriodDiscretization,\n\t\t\t\tcurveModel,\n\t\t\t\tforwardCurve,\n\t\t\t\tnew DiscountCurveFromForwardCurve(forwardCurve),\n\t\t\t\trandomVariableFactory,\n\t\t\t\tcovarianceModelReducedVolatility,\n\t\t\t\tproperties2\n\t\t\t\t);\n\n\t\tfinal EulerSchemeFromProcessModel process2 = new EulerSchemeFromProcessModel(MercurioModelNONcalibrated,brownianMotion);\n\t\tfinal LIBORModelMonteCarloSimulationModel simulationMercurioModelNONcalibrated = new LIBORMonteCarloSimulationFromLIBORModel(process2);\n\t\n\t\t\n\t\t//Results with NON calibrated model\n\t\tliborIndex=1;\n\t\tmktDataIndex = 0;\n\t\tSystem.out.println(\"\\n results on NON-CALIBRATED model \\n\");\n\t\twhile(liborIndex < liborPeriodDiscretization.getNumberOfTimes()) {\n\t\t\tdouble maturityMinusLengthLibor =liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble fixBackwardTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tCaplet capletCassical = new Caplet(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false, ValueUnit.NORMALVOLATILITY);\n\t\t\t//set to default ValueUnit.NORMALVOLATILITY for CapletOnBackwardLookingRate\n\t\t\tCapletOnBackwardLookingRate capletBackward = new CapletOnBackwardLookingRate(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false);\t\t\t\n\t\t\tdouble impliedVolClassical = capletCassical.getValue(simulationMercurioModelNONcalibrated);\n\t\t\tdouble impliedVolBackward = capletBackward.getValue(simulationMercurioModelNONcalibrated);\n\t\t\tdouble analyticFormulaPaper = Math.sqrt(1+0.5/(maturityMinusLengthLibor*3));\n\t\t\tdouble ratioImpliedVol = impliedVolBackward/impliedVolClassical;\n\t\t\tdouble error = (analyticFormulaPaper-ratioImpliedVol)/analyticFormulaPaper;\n\n\t\t\tif (liborIndex<5) {\t\t//da i valori del caplet per maturity 1.0Y, 1.5Y, 2Y, 2.5Y, 3Y\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\tliborIndex+=1;\n\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\tliborIndex+=1;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\t//secondo loop da i valori del caplet per maturity 4Y,5Y,...,21\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\n\t\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\tint timeIndex = 4;\n\t\tSystem.out.println(\" \\n Backward looking rate evaluated at the END of the accrual period:\");\n\t\tfor( liborIndex=0; liborIndex<liborPeriodDiscretization.getNumberOfTimes()-1; liborIndex++) {\n\t\t\tdouble evaluationTime=timeDiscretizationFromArray.getTime(timeIndex);\n\t\t\tdouble liborStartingTime=liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble liborEndingTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tRandomVariable backwardLookingRate = simulationMercurioModelNONcalibrated.getLIBOR(timeIndex, liborIndex);\n\t\t\tdouble avgBackwardLookingRate =backwardLookingRate.getAverage();\n\t\t\tSystem.out.println(\"Backward B(\" + formatterTimeValue.format(liborStartingTime) + \", \" + formatterTimeValue.format(liborEndingTime) + \") evaluated in t= \" + formatterTimeValue.format(evaluationTime) + \".\"+ \"\\t\" + \"Average: \" + avgBackwardLookingRate);\n\t\t\ttimeIndex += 4;\n\t\t}\t\n\t\t\n\t\tint timeIndex2 = 0;\n\t\tSystem.out.println(\"\\n Backward looking rate evaluated at the BEGIN of the accrual period:\");\n\t\tfor( liborIndex=0; liborIndex<liborPeriodDiscretization.getNumberOfTimes()-1; liborIndex++) {\n\t\t\tdouble evaluationTime=timeDiscretizationFromArray.getTime(timeIndex2);\n\t\t\tdouble liborStartingTime=liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble liborEndingTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tRandomVariable backwardLookingRate = simulationMercurioModelNONcalibrated.getLIBOR(timeIndex2, liborIndex);\n\t\t\tdouble avgBackwardLookingRate =backwardLookingRate.getAverage();\n\t\t\tSystem.out.println(\"Backward B(\" + formatterTimeValue.format(liborStartingTime) + \", \" + formatterTimeValue.format(liborEndingTime) + \") evaluated in t= \" + formatterTimeValue.format(evaluationTime) + \".\"+ \"\\t\" + \"Average: \" + avgBackwardLookingRate);\n\t\t\ttimeIndex2 += 4;\n\t\t}\n\n\t}", "com.google.cloud.clouddms.v1.ConstraintEntityOrBuilder getConstraintsOrBuilder(int index);", "public double weightedGPA() {\r\n\t\t\tdouble average = 0; \r\n\t\t\tdouble gradePoint = 0;\r\n\t\t\tdouble credit = 0;\r\n\t\t\t// Grade points\r\n\t\t\tfor (int i = 0; i < finalGrade.size(); i++) {\r\n\t\t\t\tif (finalGrade.get(i) >= 90 && finalGrade.get(i) <= 100) {\r\n\t\t\t\t\tgradePoint = gradePoint + (9*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 80 && finalGrade.get(i) <= 89.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (8*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 75 && finalGrade.get(i) <= 79.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (7*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 70 && finalGrade.get(i) <= 74.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (6*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 65 && finalGrade.get(i) <= 69.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (5*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 60 && finalGrade.get(i) <= 64.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (4*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 55 && finalGrade.get(i) <= 59.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (3*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 50 && finalGrade.get(i) <= 54.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (2*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 47 && finalGrade.get(i) <= 49.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (1*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) > 47) {\r\n\t\t\t\t\tgradePoint = gradePoint + 0;\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\taverage = gradePoint/credit; // GPA\r\n\t\t\treturn Math.round(average*10)/10.0; // GPA is returned\r\n\t\t}", "protected List<Candidate> getSlopeCandidates() {\r\n\t\t//method parameter declaration\r\n\t\tString de_name, xml_gid_in = null, xml_gid_out = null;\r\n\t\t\r\n\t\t//metaData logging\r\n\t\tLogger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.INFO, \"Features_in size is: \" + this.getFeatures_in().length);\r\n\t\tSystem.out.println(\"max allowed end-point distance is: \" + this.slopeThreshold);\r\n\t\tSystem.out.println(\"max allowed mid-point distance is: \" + midPointThreshold);\r\n\t\tSystem.out.println(\"max allowed height difference for slope Links is: \" + (StartConfiguration.getInstance().getSlope_heights()[5] + 0.5));\r\n\t\tList<SimpleFeature> slopes_out = new ArrayList<SimpleFeature>(Arrays.asList(this.getFeatures_in()));\r\n\t\tList<Candidate> candidates = new ArrayList<Candidate>();\r\n\t\tCandidate cand = null;\r\n\t\t\t\t\r\n\t\tfor (SimpleFeature slope_in: this.getFeatures_in()) {\r\n\t\t\t//remove first item of the out_feature list, to avoid checking a feature over itself\r\n\t\t\tslopes_out.remove(0);\r\n\t\t\t\r\n//if (!slope_in.getAttribute(\"DE_GR_L_1\").equals(\"Sportgastein\")) continue;\r\n\r\n\t\t\t//fetch geometry, coordinate sequence and create start and end point\r\n\t\t\tGeometry geom_in = (Geometry) slope_in.getDefaultGeometry();\r\n\t\t\tCoordinate [] slope_in_endPoints = GeometryOperations.getOrderedEndPoints(slope_in);\r\n\t\t\t\r\n\t\t\t//iterate over the out set of features\r\n\t\t\tfor (SimpleFeature slope_out: slopes_out) {\t\t\r\n\t\t\t\t//fetch semantic info\r\n\t\t\t\tde_name = slope_in.getAttribute(\"DE_GR_L_0\") + \" - \" + slope_in.getAttribute(\"DE_GR_L_1\");\r\n\t\t\t\txml_gid_in = slope_in.getAttribute(\"XML_GID\").toString();\r\n\t\t\t\txml_gid_out = slope_out.getAttribute(\"XML_GID\").toString();\r\n\t\t\t\t\r\n\t\t\t\tString[] attributes = new String [] {xml_gid_in, xml_gid_out, de_name};\r\n\t\t\t\t\r\n\t\t\t\t//fetch geometry and slope_out end-points\r\n\t\t\t\tCoordinate [] slope_out_endPoints = GeometryOperations.getOrderedEndPoints(slope_out);\r\n\t\t\t\tGeometry geom_out = (Geometry) slope_out.getDefaultGeometry();\r\n\t\t\t\t\r\n\t\t\t\t/* fetch intersection points of two geometries. size null -> means no intersection. size >=1 -> means slope intersect at one or more points */\r\n\t\t\t\tList<Coordinate> intersectionPoints = geomOps.getIntersectionVertices(geom_in, geom_out);\r\n\r\n\t\t\t\t//Remove common upper or lower point, if there is one, from intersection list\r\n\t\t\t\tcleanIntersectionsFromCommonEndPoints(slope_in_endPoints, slope_out_endPoints, intersectionPoints);\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/* 1 - search slope_in upper for connection with slope_out lower or mid-point (distance < 20m) (traverse direction from slope_out to slope_in) */\r\n\t\t\t\tCoordinate midPointNeighbor = getMidPointCandidate(slope_in_endPoints[1], geom_out, midPointThreshold); //fetch midPoint neighbor if one exists, for upper endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_in_endPoints[1], slope_out_endPoints[0], intersectionPoints, midPointNeighbor, attributes, true);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand); }\r\n\t\t\t\t\r\n\t\t\t\t/* 2 - search slope_in lower for connection with slope_out upper or mid-point (distance < 20m) (traverse direction from slope_in to slope_out) */\r\n\t\t\t\tmidPointNeighbor = getMidPointCandidate(slope_in_endPoints[0], geom_out, this.midPointThreshold);\t//fetch midPoint neighbor if one exists, for lower endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_in_endPoints[0], slope_out_endPoints[1], intersectionPoints, midPointNeighbor, attributes, false);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand); }\r\n\t\t\t\t\r\n\t\t\t\t/* 3 - search slope_out upper for connection with slope_in lower or mid-point (distance < 20m) (traverse direction from slope_in to slope_out)*/\r\n\t\t\t\tmidPointNeighbor = getMidPointCandidate(slope_out_endPoints[1], geom_in, midPointThreshold); //fetch midPoint neighbor if one exists, for upper slope_out endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_out_endPoints[1], slope_in_endPoints[0], intersectionPoints, midPointNeighbor, new String [] { xml_gid_out, xml_gid_in, de_name}, true);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand); }\r\n\t\t\t\t\r\n\t\t\t\t/* 4 - search slope_out lower for connection with slope_in upper or mid-point (distance < 20m) (traverse direction from slope_out to slope_in) */\r\n\t\t\t\tmidPointNeighbor = getMidPointCandidate(slope_out_endPoints[0], geom_in, this.midPointThreshold);\t//fetch midPoint neighbor if one exists, for lower endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_out_endPoints[0], slope_in_endPoints[1], intersectionPoints, midPointNeighbor, new String [] { xml_gid_out, xml_gid_in, de_name}, false);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand);\t}\r\n\t\t\t\t\r\n\t\t\t\t/* 5 - No candidate links are found and slopes DO NOT INTERSECT, search for mid-point links*/\r\n\t\t\t\tif (candidates.size() == 0 && intersectionPoints == null) {\r\n\t\t\t\t\t//Fetch closest point between two geometries, that is within allowed threshold (10.50)\r\n\t\t\t\t\tif (DistanceOp.isWithinDistance(geom_in, geom_out, midPointThreshold)) {\r\n\t\t\t\t\t\t//fetch nearest points\r\n\t\t\t\t\t\tCoordinate[] nearestPoints = DistanceOp.nearestPoints(geom_in, geom_out);\r\n\t\t\t\t\t\tCoordinate nearestGeom_in = nearestPoints[0];\r\n\t\t\t\t\t\tCoordinate nearestGeom_out = nearestPoints[1];\r\n\t\t\t\t\t\t//fetch interpolated Z ordinate in case it is NaN\r\n\t\t\t\t\t\tnearestGeom_in = GeometryOperations.get3DLinePoint(nearestGeom_in, geom_in);\r\n\t\t\t\t\t\tnearestGeom_out = GeometryOperations.get3DLinePoint(nearestGeom_out, geom_out);\r\n\t\t\t\t\t\t//create and add mid-point candidate. Traverse direction has to be from highest to lowest point\r\n\t\t\t\t\t\tif (nearestGeom_in.z > nearestGeom_out.z) {\r\n\t\t\t\t\t\t\tcand = new Candidate(nearestGeom_in, nearestGeom_out, \"Slope2Slope\", xml_gid_in, xml_gid_out, de_name);\r\n\t\t\t\t\t\t\tcandidates.add(cand);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcand = new Candidate(nearestGeom_out, nearestGeom_in, \"Slope2Slope\", xml_gid_out, xml_gid_in, de_name);\r\n\t\t\t\t\t\t\tcandidates.add(cand);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//FINALLY add intersection points\r\n\t\t\t\tif (intersectionPoints != null && intersectionPoints.size() > 0) {\r\n\t\t\t\t\t//System.err.println(\"Still \" + intersectionPoints.size() + \" to add\");\r\n\t\t\t\t\tfor (Coordinate intersection: intersectionPoints) {\r\n\t\t\t\t\t\tcand = new Candidate(intersection, intersection, \"Intersection\", xml_gid_in, xml_gid_out, de_name);\r\n\t\t\t\t\t\tcandidates.add(cand);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcand = null; //reset candidate\r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\t//Clean duplicate candidates in case some exist, candidates with different start and end features are needed for the final slope nodding\r\n\t\tcleanDuplicates(candidates);\r\n\t\t\t\r\n\t\t//********* METHOD END ****************\r\n\t\treturn candidates;\r\n\t}", "private double calculateWeightFromCumulativeLosses(double accumulatedLosses, double numTrains) {\r\n\t\t\r\n\t\tdouble n=Math.sqrt(8*Math.log(2)/numTrains);\r\n\t\t//double n=0.5;\r\n\t\treturn Math.exp(-1*n*accumulatedLosses);\r\n\t}", "private void applyRaceStartPenalty()\n {\n for(int i = 0; i < getDrivers().getSize(); i++)\n {\n getDrivers().getDriver(i).setAccumulatedTime(0); // set to default\n int driverRanking = getDrivers().getDriver(i).getRanking();\n int timePenalty = 10;\n switch(driverRanking)\n {\n case 1: timePenalty = 0; break;\n case 2: timePenalty = 3; break;\n case 3: timePenalty = 5; break;\n case 4: timePenalty = 7; break;\n }\n getDrivers().getDriver(i).setAccumulatedTime(timePenalty);\n }\n }", "public double[][] calcCondPathProbs(char[] outcome, double[][] forwards, double[][] backwards) {\r\n\t\t// initialize return variable\r\n\t\tdouble[][] conditional = new double[states.length * states.length][outcome.length - 1];\r\n\t\t\r\n\t\t// initialize the probability of this outcome to 0\r\n\t\tdouble outcomeProb = 0;\r\n\t\t// loop over all nodes in the last column\r\n\t\tfor (int i = 0; i < states.length; ++i)\r\n\t\t\t// add this node's probability to the overall probability\r\n\t\t\toutcomeProb += forwards[i][outcome.length - 1];\r\n\t\t\r\n\t\t// loop over all columns of the graph to start from\t\r\n\t\tfor (int col = 0; col < outcome.length - 1; ++col)\r\n\t\t\t// loop over all states (row) to transition/go from and to\r\n\t\t\tfor (int from = 0; from < states.length; ++from) for (int to = 0; to < states.length; ++to)\r\n\t\t\t\t// calculate conditional probability of path from (col, from) to (col + 1, to)\r\n\t\t\t\tconditional[from * states.length + to][col] = forwards[from][col] * backwards[to][col + 1] * \r\n\t\t\t\t\tedgeProb(from, to, outcome[col + 1]) / outcomeProb;\r\n\t\t\r\n\t\treturn conditional;\r\n\t}", "@Override\n\tpublic double calcMinCostFlow(Graph graph) {\n\t\treturn 0;\n\t}" ]
[ "0.49196377", "0.4844701", "0.47751012", "0.47480255", "0.473246", "0.47095716", "0.4670785", "0.46374092", "0.45839107", "0.45750362", "0.45744944", "0.45688927", "0.45573348", "0.45386213", "0.4537088", "0.45075026", "0.4479291", "0.44749618", "0.44473693", "0.44356215", "0.44342652", "0.44321278", "0.44269532", "0.44149935", "0.43932697", "0.43601918", "0.43581697", "0.43532872", "0.4346905", "0.43396378", "0.43323874", "0.43318927", "0.43109927", "0.43016097", "0.43009835", "0.4299159", "0.429212", "0.42909688", "0.42908528", "0.42899993", "0.42845118", "0.4283065", "0.4281775", "0.42694283", "0.42683867", "0.42489854", "0.4242367", "0.42389604", "0.42317042", "0.42311832", "0.42276916", "0.4226183", "0.4209107", "0.42090073", "0.42039195", "0.4199229", "0.4198046", "0.41921878", "0.41771045", "0.41769773", "0.41727048", "0.41636944", "0.41621932", "0.41582665", "0.41500264", "0.4149879", "0.414897", "0.41337612", "0.41276267", "0.41259488", "0.41186613", "0.41120064", "0.4092586", "0.40866715", "0.40807945", "0.40797842", "0.40700322", "0.40684465", "0.40666997", "0.40649432", "0.40646723", "0.40616676", "0.40600312", "0.40588692", "0.40566894", "0.4048384", "0.4040398", "0.40367103", "0.40359738", "0.40304813", "0.40285924", "0.40254387", "0.40198848", "0.40179294", "0.40154928", "0.4009035", "0.40073082", "0.40047613", "0.4002648", "0.40012893" ]
0.44341025
21
Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Nonmerged Volatility Curve Volatility Latent State from the Component's Cash Flows. The Constraints here typically correspond tovDate/Cash Flow pairs and the corresponding leading PV.
public org.drip.state.estimator.PredictorResponseWeightConstraint volatilityPRWC ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp, final org.drip.product.calib.ProductQuoteSet pqs) { if (null == valParams) return null; int iValueDate = valParams.valueDate(); org.drip.state.estimator.PredictorResponseWeightConstraint prwc = new org.drip.state.estimator.PredictorResponseWeightConstraint(); for (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) { int iPeriodEndDate = period.endDate(); if (iPeriodEndDate < iValueDate) continue; org.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.volatilityPRWC (iValueDate, csqs, pqs); if (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null; } return prwc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void InitializeConstraints(boundkey[] bkc, double[] blc, NodesVector nvector, PipesVector pvector,\n\t\t\tTapsVector tvector, double outflow, double PrixMax, double lcom) {\n\t\tNodes nodes;\n\t\tPipes pipes;\n\t\tTaps taps;\n\n\t\t/* Contraintes sur les Nodes - taps */\n\t\tfor (int i = 0; i < (NbNodes - NbTaps - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\tCste[i] = -nodes.height;\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les Taps */\n\t\tfor (int i = NbNodes - NbTaps - 1; i < (NbNodes - 1); i++) {\n\t\t\tnodes = (Nodes) nvector.elementAt(i + 1);\n\t\t\ttaps = (Taps) tvector.elementAt(i - (NbNodes - NbTaps - 1));\n\n\t\t\tif (taps.orifice == Orifices.MAXDIAM) {\n\t\t\t\tCste[i] = -nodes.height - ((outflow * outflow) / taps.faucetCoef);\n\t\t\t} else {\n\t\t\t\tCste[i] = (-nodes.height\n\t\t\t\t\t\t- (outflow * outflow * ((1 / taps.faucetCoef) + Math.pow(CoefOrif / taps.orifice, 4))));\n\t\t\t}\n\n\t\t\tbkc[i] = mosek.boundkey.up;\n\t\t\tblc[i] = -1.0e30;\n\t\t}\n\n\t\t/* Contraintes sur les longueurs des Pipes */\n\t\tfor (int i = NbNodes - 1; i < (m - 1); i++) {\n\t\t\tpipes = (Pipes) pvector.elementAt(i - NbNodes + 1);\n\n\t\t\tCste[i] = pipes.length;\n\n\t\t\tbkc[i] = mosek.boundkey.fx;\n\t\t\tblc[i] = Cste[i];\n\t\t}\n\n\t\t/* contrainte de prix max */\n\t\tCste[m - 1] = PrixMax;\n\t\tbkc[m - 1] = mosek.boundkey.up;\n\t\tblc[m - 1] = -1.0e30;\n\t}", "public void controlPointsChanged(List<Coordinates> lcp) {\n // sort the control points by x position.\n // this makes things easier later when we paint the function.\n lcp.sort(\n (point1,point2) -> Integer.compare(point1.getX(),point2.getX())\n );\n\n // collect the points in an array before doing the calculations.\n // again, this makes things easier for us.\n controlPoints=lcp.toArray(new Coordinates[0]);\n n=controlPoints.length;\n if(n<2) {\n // nothing to do here\n return;\n }\n double []X = new double[n];\n double []Y = new double[n];\n for(int i =0;i<n;i++){\n \tX[i]=controlPoints[i].getX();\n \tY[i]=controlPoints[i].getY();\n }\n // Construct the linear system S*C=T with n-2 equations.\n // The matrix S contains the left hand side of the equations on slide 13.\n // The matrix Z contains the right hand side of the equations on slide 13.\n double[][] S=new double[n-2][n-2];\n double[] Z=new double[n-2];\n \n // Fill the matrix S and the vector Z and solve S*C=T to get c_2 to c_{n-1}.\n for(int i = 0; i< n-3;i++){\n \tS[i][i]=2*delta(X,i+1,0);\n \tS[i+1][i]=delta(X,i+2,-1);\n \tS[i][i+1]=delta(X,i+1,1);\n \tZ[i]=z(Y,X,i);\n }\n S[n-2][n-2]=2*delta(X,n-1,0);\n \n C= EliminationGaussLegendre.solve(S, Z);\n \n // Calculate the n-1 coefficients b_i and d_i.\n // Note that you need all c_i here (but you know that c_1 and c_n are zero).\n //a_i = y_i;\n for(int i=1 ; i<n ; i++){\n \tD[i-1]=d(Y,X,i-1);\n \tB[i-1]=b(Y,C,X,i-1);\n }\n \n }", "@Test\n public void testPrediction1() throws Exception {\n\n final CalUtils.InstantGenerator instantGenerator =\n new LocalTimeMinutes(5);\n \n final double coreDailyVols[][] = new double[][] {\n new double[] {55219 , 262256 , 202661 , 218359 , 178244 , 99610 , 92348 , 124795 , 214370 , 153854 , 204116 , 173501 , 85390 , 156835 , 108070 , 23755 , 118573 , 70117 , 55768 , 52643 , 71485 , 407645 , 442909 , 129109 , 188896 , 79590 , 422121 , 290067 , 227955 , 69257 , 41634 , 446002 , 579188 , 86237 , 1606794 , 83676 , 166393 , 84987 , 875905 , 117013 , 399084 , 116190 , 149507 , 207221 , 60857 , 155612 , 448006 , 198637 , 67695 , 65423 , 180038 , 88774 , 80273 , 86065 , 85231 , 38867 , 29330 , 116353 , 26887 , 34170 , 102518 , 72246 , 21274 , 70752 , 37912 , 49367 , 100472 , 49461 , 41735 , 45795 , 36578 , 311945 , 249039 , 70487 , 121906 , 136424 , 195136 , 166308 , 331734 , 343180 , 419616 , 104613 , 1354058 , 162678 , 141067 , 147039 , 149115 , 271162 , 543989 , 184421 , 340679 , 201939 , 293860 , 171035 , 263964 , 260198 , 428087 , 565126 , 385874 , 547890 , 384416 , 256696 , 0 , 4738359},\n new double[] {1298630 , 678084 , 488607 , 224766 , 434263 , 356933 , 576571 , 219236 , 252805 , 414776 , 166828 , 174665 , 146281 , 110944 , 145234 , 179739 , 253111 , 175685 , 64925 , 216682 , 494507 , 100205 , 67371 , 101019 , 158026 , 316281 , 334067 , 954850 , 115547 , 163051 , 130303 , 107600 , 1407996 , 90357 , 110452 , 451866 , 238004 , 3096215 , 2672803 , 190170 , 111282 , 107135 , 453389 , 60821 , 98292 , 1310864 , 1132267 , 241907 , 89915 , 175676 , 61621 , 521553 , 212388 , 288651 , 193578 , 272161 , 256777 , 236382 , 802159 , 230248 , 387068 , 160647 , 106999 , 391933 , 465080 , 374577 , 340378 , 330708 , 416320 , 200347 , 251986 , 336664 , 311970 , 600559 , 508011 , 922379 , 311581 , 352459 , 508727 , 159316 , 1355635 , 246541 , 389672 , 805957 , 370754 , 382556 , 316971 , 564228 , 437166 , 277733 , 1284505 , 1763095 , 169661 , 280682 , 969102 , 540315 , 451895 , 308036 , 715130 , 642966 , 981563 , 900778 , 0 , 7155528},\n new double[] {679280 , 229518 , 346536 , 347215 , 316025 , 313890 , 235844 , 199995 , 1920617 , 129356 , 172084 , 207860 , 317578 , 10369008 , 480990 , 1403537 , 1021730 , 156125 , 94833 , 366987 , 145687 , 322957 , 328120 , 66657 , 176001 , 271003 , 133121 , 558624 , 264638 , 638663 , 165080 , 129439 , 5126344 , 5438632 , 248806 , 250616 , 112716 , 54523 , 198097 , 67772 , 1414565 , 244509 , 246205 , 151540 , 98584 , 51217 , 94193 , 111763 , 104726 , 45880 , 64242 , 78893 , 60706 , 48117 , 133085 , 101941 , 5103803 , 5084823 , 168230 , 75537 , 815036 , 73409 , 422412 , 437127 , 115802 , 326536 , 54707 , 81759 , 94420 , 208637 , 50361 , 1458556 , 84257 , 129114 , 54632 , 105873 , 57165 , 77578 , 233302 , 195560 , 134194 , 180928 , 140433 , 123154 , 221422 , 339866 , 1343886 , 114699 , 170052 , 150679 , 181731 , 160943 , 192590 , 125556 , 132656 , 154740 , 320932 , 140929 , 117889 , 381656 , 393635 , 306177 , 0 , 21629250},\n new double[] {526909 , 167180 , 199570 , 149154 , 142141 , 320881 , 223750 , 102275 , 258400 , 202197 , 120202 , 93404 , 178631 , 106401 , 346186 , 231729 , 163656 , 1622531 , 125689 , 2656587 , 5336032 , 2385985 , 335692 , 86118 , 130551 , 99047 , 81695 , 98846 , 238413 , 4831684 , 293262 , 124652 , 106642 , 112048 , 14284646 , 111209 , 2204635 , 128940 , 83395 , 134816 , 116320 , 65412 , 165020 , 126511 , 92217 , 111751 , 47320 , 82219 , 19044177 , 70827 , 21676 , 211214 , 103108 , 22771 , 61629 , 4816563 , 63806 , 33989 , 130104 , 146897 , 15046441 , 44977 , 40889 , 54584 , 54591 , 76634 , 238536 , 68583 , 110591 , 75012 , 503760 , 209479 , 217929 , 86397 , 102284 , 81878 , 252785 , 135884 , 129149 , 112760 , 266851 , 110863 , 67866 , 55205 , 150165 , 699438 , 184450 , 270270 , 4270036 , 345303 , 895116 , 217142 , 145398 , 301231 , 10260595 , 136317 , 442910 , 371357 , 189023 , 538928 , 438973 , 926728 , 9137 , 8879481},\n new double[] {1318228 , 1391326 , 574558 , 441739 , 719144 , 522626 , 404351 , 383602 , 490710 , 284952 , 2984474 , 216339 , 10220195 , 247067 , 166223 , 224310 , 10181837 , 126161 , 9764418 , 692337 , 25907353 , 1518741 , 1179929 , 120730 , 10173292 , 290045 , 19824327 , 402527 , 277859 , 3116841 , 7164061 , 332021 , 10560006 , 2334129 , 121753 , 200177 , 246402 , 10106648 , 1137272 , 2084673 , 461849 , 125108 , 465907 , 156972 , 139083 , 127389 , 237263 , 311691 , 156536 , 155322 , 133368 , 329715 , 256088 , 116835 , 5192615 , 823762 , 183836 , 1110239 , 2414836 , 385072 , 599637 , 387285 , 291580 , 2796924 , 12977051 , 338582 , 884415 , 525622 , 322587 , 223348 , 668858 , 143039 , 627590 , 239797 , 232788 , 256503 , 209425 , 375474 , 558106 , 290991 , 1176648 , 286550 , 149539 , 297435 , 602136 , 152733 , 212363 , 178992 , 179644 , 295428 , 933636 , 349405 , 660749 , 226061 , 868852 , 318539 , 469303 , 538061 , 273643 , 444084 , 347730 , 825808 , 12011 , 7792372}};\n\n final SimpleDateFormat dateBuilder = new SimpleDateFormat(\"yyyy-MM-dd\");\n final Calendar moments[] = new Calendar[] { Calendar.getInstance(), \n Calendar.getInstance(), Calendar.getInstance(), \n Calendar.getInstance(), Calendar.getInstance(),\n Calendar.getInstance() };\n\n moments[0].setTime(dateBuilder.parse(\"2011-10-26\"));\n moments[1].setTime(dateBuilder.parse(\"2011-10-27\"));\n moments[2].setTime(dateBuilder.parse(\"2011-10-28\"));\n moments[3].setTime(dateBuilder.parse(\"2011-10-30\"));\n moments[4].setTime(dateBuilder.parse(\"2011-11-01\"));\n moments[5].setTime(dateBuilder.parse(\"2011-11-02\"));\n\n // Nomralize data to sum 100 (i.e., have an expectance of 100/104)\n for(int i=0; i<5; i++) {\n double sum = 0;\n for(int j=0; j<104; j++) sum += coreDailyVols[i][j];\n for(int j=0; j<104; j++) {\n coreDailyVols[i][j] = coreDailyVols[i][j]*100 / sum;\n }\n }\n\n final double[][] synthesizedDailyVols = new double[\n coreDailyVols.length][instantGenerator.maxInstantValue()];\n final Calendar openTime = Calendar.getInstance();\n final int n = 9*60 / 5;\n final int m = n + coreDailyVols[0].length;\n for(int i=0; i<5; i++) {\n for(int j=0; j<n; j++) {\n synthesizedDailyVols[i][j] = Double.NaN;\n }\n for(int j=0; j<coreDailyVols[i].length; j++) {\n synthesizedDailyVols[i][j+n] = coreDailyVols[i][j];\n }\n for(int j=m; j<instantGenerator.maxInstantValue(); j++) {\n synthesizedDailyVols[i][j] = Double.NaN;\n }\n }\n\n\n final Predictor predictor = new PCAPredictorTransposed(\n instantGenerator, 5);\n for(int i=0; i<5; i++) {\n predictor.learnVector(moments[i], synthesizedDailyVols[i]);\n }\n final double prediction[] = predictor.predictVector(moments[5]);\n final double coreExpectedPrediction[] = new double[] {\n0.21383323, -0.08665493, -0.28527934, -0.45293966, -0.35525111, -0.49117788,\n-0.38114565, -0.60141152, -0.09029406, -0.44815719, -0.45152723, -0.58079146,\n-0.29110153, 1.54262599, -0.59900211, -0.48107804, -0.03280398, -0.59369964,\n-0.44886852, -0.43868587, 0.88745208, -0.10900099, -0.26251035, -0.71557572,\n-0.20051598, -0.57674404, 0.53793693, 0.15857465, -0.53212067, -0.13529962,\n-0.49171709, -0.32334222, 2.16101856, 0.46824882, 2.13337330, -0.48802957,\n-0.40084079, 1.62077396, 1.93080019, -0.59114756, -0.09429057, -0.68952951,\n-0.39819841, -0.63019599, -0.78762027, 0.12458423, 0.34847712, -0.52481068,\n0.69730449, -0.74290105, -0.68866588, -0.45964670, -0.69174165, -0.64825389,\n-0.49908622, -0.30049621, 0.35726449, 0.47210113, -0.25058065, -0.72112704,\n0.79345044, -0.73245678, -0.75581875, -0.40885896, -0.08033429, -0.56030291,\n-0.54967743, -0.63571829, -0.58889882, -0.71099478, -0.67055922, -0.03850658,\n-0.40339282, -0.43003588, -0.44813762, -0.14347007, -0.48441216, -0.48851502,\n-0.15427010, -0.39484463, 0.52701151, -0.61335693, 0.89776479, -0.18821502,\n-0.46457371, -0.39850394, -0.26234640, -0.21535441, 0.33669589, -0.48879971,\n0.43892192, 0.52101182, -0.42851659, -0.51364225, 0.85831207, -0.24052028,\n-0.04192086, -0.02287821, 0.01522206, 0.24307671, 0.27369478, 0.11058009,\n-0.95575786, 14.90733910 };\n final double synthesizedExpectedPrediction[] = new double[\n instantGenerator.maxInstantValue()];\n for(int j=0; j<n; j++) {\n synthesizedExpectedPrediction[j] = Double.NaN;\n }\n for(int j=0; j<coreExpectedPrediction.length; j++) {\n synthesizedExpectedPrediction[j+n] = coreExpectedPrediction[j];\n }\n for(int j=m; j<instantGenerator.maxInstantValue(); j++) {\n synthesizedExpectedPrediction[j] = Double.NaN;\n }\n\n assertEquals(prediction.length, synthesizedExpectedPrediction.length);\n\n for(int i=0; i<prediction.length; i++) {\n assertEquals(prediction[i], synthesizedExpectedPrediction[i], \n 0.0001d);\n }\n System.out.println(\"Ok\");\n }", "public double[] ConsumptionDecisionRule(double[] Kt, double[] Zt) {\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0]);\r\n\t\tdouble[] result = new double[N];\r\n\t\tdouble[] W_t = new double[N];\r\n\t\t// double[] result = Kt;\r\n\t\t// fact[9] = iT / (double) T;\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\r\n\t\t\t// Compute wage\r\n\t\t\tW_t[i] = (1 - delta) * Kt[i] + Zt[i] * Math.pow(Kt[i], alpha);\r\n\t\t\t// LOGGER.info(\"Kt[i]=\" + Kt[i] + \" , W_t=\" + W_t);\r\n\r\n\t\t\t// fact[0] = Kt[i];\r\n\t\t\t// fact[1] = Zt[i];\r\n\t\t\t// fact[2] = W_t[i];\r\n\r\n\t\t\t// result[i] = (W_t[i] * 0.34);\r\n\r\n\t\t\t// S[sc=640619,15461196 at 2000, 3x[C 0,35 [], C 0,256 [6], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.256 * factValues[6] - 0.032 * factValues[4]);\r\n\t\t\t// S[sc=673175,23434734 at 2000, 4x[C 0,448 [6], C 0,35 [], C -0,192 [8, 8, 8], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.448 * fact[6] - 0.192 * fact[8] * fact[8] * fact[8] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=684511.51178919 at 5000, 6x[C 0.576 [6], C 0.35 [], C -0.256 [4, 5, 8], C -0.128 [8, 8, 8], C 0.032\r\n\t\t\t// [3], C -0.032 [4]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35 + 0.576 * fact[6] - 0.256 * fact[4] * fact[5] * fact[8] - 0.128 * fact[8] * fact[8] * fact[8] +\r\n\t\t\t// 0.032\r\n\t\t\t// * fact[3] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=713249.61733519 at 17000, 10x[C 0.57042768 [6], C -0.42834052 [4, 5, 8], C 0.35726662 [], C\r\n\t\t\t// -0.19234839 [8, 8, 8], C 0.0618062 [3], C 0.03906074 [3, 3], C -0.0354908 [6, 8, 8], C -0.032 [4], C\r\n\t\t\t// 0.02872478 [3, 6, 6], C -0.01470091 [4, 8]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35726662 + 0.57042768 * fact[3] - 0.42834052 * fact[1] * fact[2] * fact[5] - 0.19234839 * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// * fact[5] + 0.0618062 * fact[2] + 0.03906074 * fact[2] * fact[2] - 0.0354908 * fact[3] * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// - 0.032 * fact[1] + 0.02872478 * fact[0] * fact[3] * fact[3] - 0.01470091 * fact[1] * fact[5]);\r\n\t\t\tresult[i] = W_t[i]\r\n\t\t\t\t\t* ( //\r\n\t\t\t\t\t0.40334336 + 0.22997859 * fact[3] + 0.21837595 * fact[3] * fact[3] + 0.15973829 * fact[3] * fact[4] + -0.10161004\r\n\t\t\t\t\t\t\t* fact[1] * fact[5] + -0.020384 * fact[1] * fact[1] * fact[5]\r\n\t\t\t);\r\n\t\t\t// Keep only valid solutions\r\n\t\t\tresult[i] = Math.max(result[i], VERY_SMALL * W_t[i]);\r\n\t\t\t// to have a valid result\r\n\t\t\tresult[i] = Math.min(result[i], W_t[i] * (1.0 - VERY_SMALL));\r\n\t\t}\r\n\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0] + \" , \" + result[0] + \" for \" + iT);\r\n\t\t// int s = 0;\r\n\t\t// LOGGER.info(\"Kt[\" + s + \"]=\" + Kt[s] + \" , Zt[]=\" + Zt[s] + \" , W_t[]=\" + W_t[s] + \" , \" + result[s] +\r\n\t\t// \" for \" + iT);\r\n\t\tiT++;\r\n\t\treturn result;\r\n\t}", "public double pv (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqc,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t\tthrows java.lang.Exception\n\t{\n\t\tif (null == valParams || null == csqc)\n\t\t\tthrow new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqc.fundingState (fundingLabel());\n\n\t\tif (null == dcFunding) throw new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tdouble dblCumulativeConvexityAdjustedDirtyPV = 0.;\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodPayDate = period.payDate();\n\n\t\t\tif (iPeriodPayDate < iValueDate) continue;\n\n\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate,\n\t\t\t\tcsqc);\n\n\t\t\tif (null == cpcm) throw new java.lang.Exception (\"Stream::pv => Invalid Inputs\");\n\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tdblCumulativeConvexityAdjustedDirtyPV += cpcm.dcf() * period.notional (iPeriodEndDate) *\n\t\t\t\tperiod.couponFactor (iPeriodEndDate) * period.fx (csqc) * period.survival (csqc) *\n\t\t\t\t\tperiod.df (csqc) * cpcm.cumulative() * cpcm.rate();\n\t\t}\n\n\t\treturn dblCumulativeConvexityAdjustedDirtyPV / dcFunding.df (iValueDate);\n\t}", "public org.drip.state.estimator.PredictorResponseWeightConstraint fundingPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel();\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.fundingPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "public void generateCost() throws StandardException {\n\n double baseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE);\n double filterBaseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE,QualifierPhase.FILTER_BASE);\n double projectionSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.FILTER_PROJECTION);\n double totalSelectivity = computeTotalSelectivity(selectivityHolder);\n\n assert filterBaseTableSelectivity >= 0 && filterBaseTableSelectivity <= 1.0:\"filterBaseTableSelectivity Out of Bounds -> \" + filterBaseTableSelectivity;\n assert baseTableSelectivity >= 0 && baseTableSelectivity <= 1.0:\"baseTableSelectivity Out of Bounds -> \" + baseTableSelectivity;\n assert projectionSelectivity >= 0 && projectionSelectivity <= 1.0:\"projectionSelectivity Out of Bounds -> \" + projectionSelectivity;\n assert totalSelectivity >= 0 && totalSelectivity <= 1.0:\"totalSelectivity Out of Bounds -> \" + totalSelectivity;\n\n // Total Row Count from the Base Conglomerate\n double totalRowCount = scc.baseRowCount();\n assert totalRowCount >= 0 : \"totalRowCount cannot be negative -> \" + totalRowCount;\n // Rows Returned is always the totalSelectivity (Conglomerate Independent)\n scanCost.setEstimatedRowCount(Math.round(totalRowCount*totalSelectivity));\n\n double baseTableAverageRowWidth = scc.getBaseTableAvgRowWidth();\n double baseTableColumnSizeFactor = scc.baseTableColumnSizeFactor(totalColumns);\n\n // We use the base table so the estimated heap size and remote cost are the same for all conglomerates\n double colSizeFactor = baseTableAverageRowWidth*baseTableColumnSizeFactor;\n assert baseTableAverageRowWidth >= 0 : \"baseTableAverageRowWidth cannot be negative -> \" + baseTableAverageRowWidth;\n assert baseTableColumnSizeFactor >= 0 : \"baseTableColumnSizeFactor cannot be negative -> \" + baseTableColumnSizeFactor;\n\n double openLatency = scc.getOpenLatency();\n double closeLatency = scc.getCloseLatency();\n double localLatency = scc.getLocalLatency();\n double remoteLatency = scc.getRemoteLatency();\n double remoteCost = openLatency + closeLatency + totalRowCount*totalSelectivity*remoteLatency*(1+colSizeFactor/100d);\n assert openLatency >= 0 : \"openLatency cannot be negative -> \" + openLatency;\n assert closeLatency >= 0 : \"closeLatency cannot be negative -> \" + closeLatency;\n assert localLatency >= 0 : \"localLatency cannot be negative -> \" + localLatency;\n assert remoteLatency >= 0 : \"remoteLatency cannot be negative -> \" + remoteLatency;\n assert remoteCost >= 0 : \"remoteCost cannot be negative -> \" + remoteCost;\n // Heap Size is the avg row width of the columns for the base table*total rows\n // Average Row Width\n // This should be the same for every conglomerate path\n scanCost.setEstimatedHeapSize((long)(totalRowCount*totalSelectivity*colSizeFactor));\n // Should be the same for each conglomerate\n scanCost.setRemoteCost((long)remoteCost);\n // Base Cost + LookupCost + Projection Cost\n double congAverageWidth = scc.getConglomerateAvgRowWidth();\n double baseCost = openLatency+closeLatency+(totalRowCount*baseTableSelectivity*localLatency*(1+congAverageWidth/100d));\n assert congAverageWidth >= 0 : \"congAverageWidth cannot be negative -> \" + congAverageWidth;\n assert baseCost >= 0 : \"baseCost cannot be negative -> \" + baseCost;\n scanCost.setFromBaseTableRows(filterBaseTableSelectivity * totalRowCount);\n scanCost.setFromBaseTableCost(baseCost);\n double lookupCost;\n if (lookupColumns == null)\n lookupCost = 0.0d;\n else {\n lookupCost = totalRowCount*filterBaseTableSelectivity*(openLatency+closeLatency);\n scanCost.setIndexLookupRows(filterBaseTableSelectivity*totalRowCount);\n scanCost.setIndexLookupCost(lookupCost+baseCost);\n }\n assert lookupCost >= 0 : \"lookupCost cannot be negative -> \" + lookupCost;\n\n double projectionCost;\n if (projectionSelectivity == 1.0d)\n projectionCost = 0.0d;\n else {\n projectionCost = totalRowCount * filterBaseTableSelectivity * localLatency * colSizeFactor*1d/1000d;\n scanCost.setProjectionRows(scanCost.getEstimatedRowCount());\n scanCost.setProjectionCost(lookupCost+baseCost+projectionCost);\n }\n assert projectionCost >= 0 : \"projectionCost cannot be negative -> \" + projectionCost;\n\n double localCost = baseCost+lookupCost+projectionCost;\n assert localCost >= 0 : \"localCost cannot be negative -> \" + localCost;\n scanCost.setLocalCost(localCost);\n scanCost.setNumPartitions(scc.getNumPartitions());\n scanCost.setLocalCostPerPartition((baseCost + lookupCost + projectionCost)/scc.getNumPartitions());\n }", "public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t{\n\t\tif (null == valParams || null == csqs) return null;\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState (fundingLabel());\n\n\t\tif (null == dcFunding) return null;\n\n\t\tlong lStart = System.nanoTime();\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tdouble dblAccrued01 = 0.;\n\t\tdouble dblTotalCoupon = 0.;\n\t\tdouble dblCumulativeCouponDCF = 0.;\n\t\tdouble dblCumulativeCouponAmount = 0.;\n\t\tdouble dblAccrualCoupon = java.lang.Double.NaN;\n\t\tdouble dblUnadjustedDirtyPV = 0.;\n\t\tdouble dblUnadjustedDirtyDV01 = 0.;\n\t\tdouble dblCompoundingAdjustedDirtyPV = 0.;\n\t\tdouble dblCompoundingAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCashPayDF = java.lang.Double.NaN;\n\t\tint iResetDate = java.lang.Integer.MIN_VALUE;\n\t\tdouble dblFXAdjustedValueNotional = java.lang.Double.NaN;\n\t\tdouble dblCreditForwardConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditForwardConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCreditFundingConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditFundingConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCreditFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCreditFXConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblCumulativeConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblCumulativeConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblForwardFundingConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblForwardFundingConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblForwardFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblForwardFXConvexityAdjustedDirtyDV01 = 0.;\n\t\tdouble dblFundingFXConvexityAdjustedDirtyPV = 0.;\n\t\tdouble dblFundingFXConvexityAdjustedDirtyDV01 = 0.;\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tdouble dblPeriodFX = java.lang.Double.NaN;\n\t\t\tdouble dblPeriodNotional = java.lang.Double.NaN;\n\t\t\tdouble dblUnadjustedDirtyPeriodDV01 = java.lang.Double.NaN;\n\n\t\t\tint iPeriodPayDate = period.payDate();\n\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\ttry {\n\t\t\t\tdblPeriodNotional = period.notional (iPeriodEndDate) * period.couponFactor (iPeriodEndDate);\n\n\t\t\t\tdblPeriodFX = period.fx (csqs);\n\t\t\t} catch (java.lang.Exception e) {\n\t\t\t\te.printStackTrace();\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (iPeriodPayDate < iValueDate) {\n\t\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics\n\t\t\t\t\t(iPeriodEndDate, csqs);\n\n\t\t\t\tif (null == cpcm) return null;\n\n\t\t\t\tdouble dblPeriodDCF = cpcm.dcf();\n\n\t\t\t\tdblCumulativeCouponDCF += dblPeriodDCF;\n\n\t\t\t\tdblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * cpcm.rate() * dblPeriodDCF;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\torg.drip.analytics.output.CompositePeriodCouponMetrics cpcm = period.couponMetrics (iValueDate,\n\t\t\t\tcsqs);\n\n\t\t\tif (null == cpcm) return null;\n\n\t\t\tdouble dblPeriodDCF = cpcm.dcf();\n\n\t\t\tdouble dblPeriodFullRate = cpcm.rate();\n\n\t\t\torg.drip.analytics.output.CompositePeriodAccrualMetrics cpam = period.accrualMetrics (iValueDate,\n\t\t\t\tcsqs);\n\n\t\t\ttry {\n\t\t\t\tif (null != cpam) {\n\t\t\t\t\tdblAccrualCoupon = cpam.rate();\n\n\t\t\t\t\tiResetDate = cpam.resetDate();\n\n\t\t\t\t\tdouble dblPeriodAccrualDCF = cpam.dcf();\n\n\t\t\t\t\tdblCumulativeCouponDCF += dblPeriodAccrualDCF;\n\t\t\t\t\tdblAccrued01 = 0.0001 * dblPeriodAccrualDCF * dblPeriodNotional * dblPeriodFX;\n\n\t\t\t\t\tdblCumulativeCouponAmount += dblPeriodNotional * dblPeriodFX * dblAccrualCoupon *\n\t\t\t\t\t\tdblPeriodAccrualDCF;\n\t\t\t\t}\n\n\t\t\t\tdblUnadjustedDirtyPeriodDV01 = 0.0001 * dblPeriodDCF * dblPeriodNotional * dblPeriodFX *\n\t\t\t\t\tperiod.survival (csqs) * period.df (csqs);\n\t\t\t} catch (java.lang.Exception e) {\n\t\t\t\te.printStackTrace();\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tdouble dblCompoundingAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 * cpcm.compounding();\n\n\t\t\tdouble dblCreditForwardConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditForward();\n\n\t\t\tdouble dblCreditFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditFunding();\n\n\t\t\tdouble dblCreditFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.creditFX();\n\n\t\t\tdouble dblCumulativeConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.cumulative();\n\n\t\t\tdouble dblForwardFundingConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.forwardFunding();\n\n\t\t\tdouble dblForwardFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.forwardFX();\n\n\t\t\tdouble dblFundingFXConvexityAdjustedDirtyPeriodDV01 = dblUnadjustedDirtyPeriodDV01 *\n\t\t\t\tcpcm.fundingFX();\n\n\t\t\tdblTotalCoupon += dblPeriodFullRate;\n\t\t\tdblUnadjustedDirtyDV01 += dblUnadjustedDirtyPeriodDV01;\n\t\t\tdblUnadjustedDirtyPV += dblUnadjustedDirtyPeriodDV01 * 10000. * dblPeriodFullRate;\n\t\t\tdblCompoundingAdjustedDirtyDV01 += dblCompoundingAdjustedDirtyPeriodDV01;\n\t\t\tdblCompoundingAdjustedDirtyPV += dblCompoundingAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblCreditForwardConvexityAdjustedDirtyDV01 += dblCreditForwardConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditForwardConvexityAdjustedDirtyPV += dblCreditForwardConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblCreditFundingConvexityAdjustedDirtyDV01 += dblCreditFundingConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditFundingConvexityAdjustedDirtyPV += dblCreditFundingConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblCreditFXConvexityAdjustedDirtyDV01 += dblCreditFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCreditFXConvexityAdjustedDirtyPV += dblCreditFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblCumulativeConvexityAdjustedDirtyDV01 += dblCumulativeConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblCumulativeConvexityAdjustedDirtyPV += dblCumulativeConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblForwardFundingConvexityAdjustedDirtyDV01 += dblForwardFundingConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblForwardFundingConvexityAdjustedDirtyPV += dblForwardFundingConvexityAdjustedDirtyPeriodDV01 *\n\t\t\t\t10000. * dblPeriodFullRate;\n\t\t\tdblForwardFXConvexityAdjustedDirtyDV01 += dblForwardFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblForwardFXConvexityAdjustedDirtyPV += dblForwardFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t\tdblFundingFXConvexityAdjustedDirtyDV01 += dblFundingFXConvexityAdjustedDirtyPeriodDV01;\n\t\t\tdblFundingFXConvexityAdjustedDirtyPV += dblFundingFXConvexityAdjustedDirtyPeriodDV01 * 10000. *\n\t\t\t\tdblPeriodFullRate;\n\t\t}\n\n\t\ttry {\n\t\t\tdblCashPayDF = dcFunding.df (iValueDate);\n\n\t\t\tdblFXAdjustedValueNotional = fxAdjustedNotional (iValueDate, csqs);\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\tdblUnadjustedDirtyPV /= dblCashPayDF;\n\t\tdblUnadjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCompoundingAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCompoundingAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditForwardConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditForwardConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditFundingConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCreditFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCreditFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblCumulativeConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblCumulativeConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblForwardFundingConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblForwardFundingConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblForwardFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblForwardFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdblFundingFXConvexityAdjustedDirtyPV /= dblCashPayDF;\n\t\tdblFundingFXConvexityAdjustedDirtyDV01 /= dblCashPayDF;\n\t\tdouble dblAccrued = 0. == dblAccrued01 ? 0. : dblAccrued01 * 10000. * dblAccrualCoupon;\n\t\tdouble dblUnadjustedCleanPV = dblUnadjustedDirtyPV - dblAccrued;\n\t\tdouble dblUnadjustedCleanDV01 = dblUnadjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblUnadjustedFairPremium = 0.0001 * dblUnadjustedCleanPV / dblUnadjustedCleanDV01;\n\t\tdouble dblCompoundingAdjustedCleanPV = dblCompoundingAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCompoundingAdjustedCleanDV01 = dblCompoundingAdjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblCompoundingAdjustedFairPremium = 0.0001 * dblCompoundingAdjustedCleanPV /\n\t\t\tdblCompoundingAdjustedCleanDV01;\n\t\tdouble dblCreditForwardConvexityAdjustedCleanPV = dblCreditForwardConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblCreditForwardConvexityAdjustedCleanDV01 = dblCreditForwardConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCreditForwardConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblCreditForwardConvexityAdjustedCleanPV / dblCreditForwardConvexityAdjustedCleanDV01;\n\t\tdouble dblCreditFundingConvexityAdjustedCleanPV = dblCreditFundingConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblCreditFundingConvexityAdjustedCleanDV01 = dblCreditFundingConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCreditFundingConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblCreditFundingConvexityAdjustedCleanPV / dblCreditFundingConvexityAdjustedCleanDV01;\n\t\tdouble dblCreditFXConvexityAdjustedCleanPV = dblCreditFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCreditFXConvexityAdjustedCleanDV01 = dblCreditFXConvexityAdjustedDirtyDV01 - dblAccrued01;\n\t\tdouble dblCreditFXConvexityAdjustedFairPremium = 0.0001 * dblCreditFXConvexityAdjustedCleanPV /\n\t\t\tdblCreditFXConvexityAdjustedCleanDV01;\n\t\tdouble dblCumulativeConvexityAdjustedCleanPV = dblCumulativeConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblCumulativeConvexityAdjustedCleanDV01 = dblCumulativeConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblCumulativeConvexityAdjustedFairPremium = 0.0001 * dblCumulativeConvexityAdjustedCleanPV /\n\t\t\tdblCumulativeConvexityAdjustedCleanDV01;\n\t\tdouble dblForwardFundingConvexityAdjustedCleanPV = dblForwardFundingConvexityAdjustedDirtyPV -\n\t\t\tdblAccrued;\n\t\tdouble dblForwardFundingConvexityAdjustedCleanDV01 = dblForwardFundingConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblForwardFundingConvexityAdjustedFairPremium = 0.0001 *\n\t\t\tdblForwardFundingConvexityAdjustedCleanPV / dblForwardFundingConvexityAdjustedCleanDV01;\n\t\tdouble dblForwardFXConvexityAdjustedCleanPV = dblForwardFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblForwardFXConvexityAdjustedCleanDV01 = dblForwardFXConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblForwardFXConvexityAdjustedFairPremium = 0.0001 * dblForwardFXConvexityAdjustedCleanPV /\n\t\t\tdblForwardFXConvexityAdjustedCleanDV01;\n\t\tdouble dblFundingFXConvexityAdjustedCleanPV = dblFundingFXConvexityAdjustedDirtyPV - dblAccrued;\n\t\tdouble dblFundingFXConvexityAdjustedCleanDV01 = dblFundingFXConvexityAdjustedDirtyDV01 -\n\t\t\tdblAccrued01;\n\t\tdouble dblFundingFXConvexityAdjustedFairPremium = 0.0001 * dblFundingFXConvexityAdjustedCleanPV /\n\t\t\tdblFundingFXConvexityAdjustedCleanDV01;\n\n\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapResult = new\n\t\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>();\n\n\t\tmapResult.put (\"AccrualCoupon\", dblAccrualCoupon);\n\n\t\tmapResult.put (\"Accrued\", dblAccrued);\n\n\t\tmapResult.put (\"Accrued01\", dblAccrued01);\n\n\t\tmapResult.put (\"CleanDV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CleanPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanDV01\", dblCompoundingAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanPV\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPV\", dblCompoundingAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyDV01\", dblCompoundingAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPV\", dblCompoundingAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedFairPremium\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedParRate\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedPV\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustedRate\", dblCompoundingAdjustedFairPremium);\n\n\t\tmapResult.put (\"CompoundingAdjustedUpfront\", dblCompoundingAdjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustmentFactor\", dblCompoundingAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CompoundingAdjustmentPremium\", dblCompoundingAdjustedCleanPV - dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CompoundingAdjustmentPremiumUpfront\", (dblCompoundingAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanDV01\",\n\t\t\tdblCreditForwardConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanPV\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyDV01\",\n\t\t\tdblCreditForwardConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyPV\", dblCreditForwardConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDV01\", dblCreditForwardConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedFairPremium\",\n\t\t\tdblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedParRate\",\n\t\t\tdblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedPV\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedRate\", dblCreditForwardConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedUpfront\", dblCreditForwardConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentFactor\", dblCreditForwardConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentPremium\", dblCreditForwardConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblCreditForwardConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanDV01\",\n\t\t\tdblCreditFundingConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanPV\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyDV01\",\n\t\t\tdblCreditFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyPV\", dblCreditFundingConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDV01\", dblCreditFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedFairPremium\",\n\t\t\tdblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedParRate\",\n\t\t\tdblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedPV\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedRate\", dblCreditFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedUpfront\", dblCreditFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentFactor\", dblCreditFundingConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentPremium\", dblCreditFundingConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblCreditFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanDV01\", dblCreditFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanPV\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyDV01\", dblCreditFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyPV\", dblCreditFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDV01\", dblCreditFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedFairPremium\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedParRate\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedPV\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedRate\", dblCreditFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedUpfront\", dblCreditFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentFactor\", dblCreditFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentPremium\", dblCreditFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustmentPremiumUpfront\", (dblCreditFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanDV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyPV\", dblCumulativeConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedFairPremium\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedParRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedPV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedUpfront\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentFactor\", dblCumulativeConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentPremium\", dblCumulativeConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustmentPremiumUpfront\", (dblCumulativeConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"CumulativeCouponAmount\", dblCumulativeCouponAmount);\n\n\t\tmapResult.put (\"CumulativeCouponDCF\", dblCumulativeCouponDCF);\n\n\t\tmapResult.put (\"CV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"DirtyDV01\", dblCumulativeConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"DirtyPV\", dblCumulativeConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"DV01\", dblCumulativeConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"FairPremium\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"Fixing01\", dblAccrued01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanDV01\",\n\t\t\tdblForwardFundingConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanPV\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyDV01\",\n\t\t\tdblForwardFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyPV\", dblForwardFundingConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDV01\", dblForwardFundingConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedFairPremium\",\n\t\t\tdblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedParRate\",\n\t\t\tdblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedPV\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedRate\", dblForwardFundingConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedUpfront\", dblForwardFundingConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentFactor\", dblForwardFundingConvexityAdjustedDirtyDV01\n\t\t\t/ dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentPremium\", dblForwardFundingConvexityAdjustedCleanPV\n\t\t\t- dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustmentPremiumUpfront\",\n\t\t\t(dblForwardFundingConvexityAdjustedCleanPV - dblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanDV01\", dblForwardFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanPV\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyDV01\", dblForwardFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyPV\", dblForwardFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDV01\", dblForwardFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedFairPremium\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedParRate\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedPV\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedRate\", dblForwardFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedUpfront\", dblForwardFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentFactor\", dblForwardFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentPremium\", dblForwardFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustmentPremiumUpfront\", (dblForwardFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanDV01\", dblFundingFXConvexityAdjustedCleanDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanPV\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyDV01\", dblFundingFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyPV\", dblFundingFXConvexityAdjustedDirtyPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDV01\", dblFundingFXConvexityAdjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedFairPremium\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedParRate\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedPV\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedRate\", dblFundingFXConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedUpfront\", dblFundingFXConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentFactor\", dblFundingFXConvexityAdjustedDirtyDV01 /\n\t\t\tdblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentPremium\", dblFundingFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustmentPremiumUpfront\", (dblFundingFXConvexityAdjustedCleanPV -\n\t\t\tdblUnadjustedCleanPV) / dblFXAdjustedValueNotional);\n\n\t\tmapResult.put (\"ParRate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"PV\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tmapResult.put (\"Rate\", dblCumulativeConvexityAdjustedFairPremium);\n\n\t\tmapResult.put (\"ResetDate\", (double) iResetDate);\n\n\t\tmapResult.put (\"ResetRate\", dblAccrualCoupon - basis());\n\n\t\tmapResult.put (\"TotalCoupon\", dblTotalCoupon);\n\n\t\tmapResult.put (\"UnadjustedCleanDV01\", dblUnadjustedCleanDV01);\n\n\t\tmapResult.put (\"UnadjustedCleanPV\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"UnadjustedDirtyDV01\", dblUnadjustedDirtyDV01);\n\n\t\tmapResult.put (\"UnadjustedDirtyPV\", dblUnadjustedDirtyPV);\n\n\t\tmapResult.put (\"UnadjustedFairPremium\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedParRate\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedPV\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"UnadjustedRate\", dblUnadjustedFairPremium);\n\n\t\tmapResult.put (\"UnadjustedUpfront\", dblUnadjustedCleanPV);\n\n\t\tmapResult.put (\"Upfront\", dblCumulativeConvexityAdjustedCleanPV);\n\n\t\tdouble dblCompoundingAdjustedCleanPrice = 100. * (1. + (dblCompoundingAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblCreditForwardConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblCreditForwardConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblCreditFundingConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblCreditFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblCreditFXConvexityAdjustedCleanPrice = 100. * (1. + (dblCreditFXConvexityAdjustedCleanPV\n\t\t\t/ dblFXAdjustedValueNotional));\n\t\tdouble dblCumulativeConvexityAdjustedCleanPrice = 100. * (1. + (dblCumulativeConvexityAdjustedCleanPV\n\t\t\t/ dblFXAdjustedValueNotional));\n\t\tdouble dblForwardFundingConvexityAdjustedCleanPrice = 100. * (1. +\n\t\t\t(dblForwardFundingConvexityAdjustedCleanPV / dblFXAdjustedValueNotional));\n\t\tdouble dblForwardFXConvexityAdjustedCleanPrice = 100. * (1. + (dblForwardFXConvexityAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblFundingFXConvexityAdjustedCleanPrice = 100. * (1. + (dblFundingFXConvexityAdjustedCleanPV /\n\t\t\tdblFXAdjustedValueNotional));\n\t\tdouble dblUnadjustedCleanPrice = 100. * (1. + (dblUnadjustedCleanPV / dblFXAdjustedValueNotional));\n\n\t\tmapResult.put (\"CleanPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CompoundingAdjustedCleanPrice\", dblCompoundingAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CompoundingAdjustedDirtyPrice\", 100. * (1. + (dblCompoundingAdjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CompoundingAdjustedPrice\", dblCompoundingAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedCleanPrice\",\n\t\t\tdblCreditForwardConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditForwardConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditForwardConvexityAdjustedPrice\", dblCreditForwardConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedCleanPrice\",\n\t\t\tdblCreditFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditFundingConvexityAdjustedPrice\", dblCreditFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedCleanPrice\", dblCreditFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCreditFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CreditFXConvexityAdjustedPrice\", dblCreditFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedCleanPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblCumulativeConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"CumulativeConvexityAdjustedPrice\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"DirtyPrice\", 100. * (1. + (dblCumulativeConvexityAdjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedCleanPrice\",\n\t\t\tdblForwardFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblForwardFundingConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFundingConvexityAdjustedPrice\", dblForwardFundingConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedCleanPrice\", dblForwardFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblForwardFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"ForwardFXConvexityAdjustedPrice\", dblForwardFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedCleanPrice\", dblFundingFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedDirtyPrice\", 100. * (1. +\n\t\t\t(dblFundingFXConvexityAdjustedDirtyPV / dblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"FundingFXConvexityAdjustedPrice\", dblFundingFXConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"Price\", dblCumulativeConvexityAdjustedCleanPrice);\n\n\t\tmapResult.put (\"UnadjustedCleanPrice\", dblUnadjustedCleanPrice);\n\n\t\tmapResult.put (\"UnadjustedDirtyPrice\", 100. * (1. + (dblUnadjustedDirtyPV /\n\t\t\tdblFXAdjustedValueNotional)));\n\n\t\tmapResult.put (\"UnadjustedPrice\", dblUnadjustedCleanPrice);\n\n\t\tmapResult.put (\"CalcTime\", (System.nanoTime() - lStart) * 1.e-09);\n\n\t\treturn mapResult;\n\t}", "@Test\r\n\tpublic void testGetPlannedCapacity_Linear_Interval() {\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\t\t\r\n\t\t\r\n\t}", "private synchronized void initCircumstances() {\n if (circV == null) {\n\n // Calculate visit circumstances, which includes setup time.\n Function<Long, WorldCoords> coords = getObs()::getCoords;\n int size = Math.max(1, (int) (interval.getLength() / QUANTUM));\n circV = new TreeMap<Circumstance, Double[]>();\n for (Circumstance c: Circumstance.values()) {\n circV.put(c, new Double[size]);\n }\n TimingWindowSolver tws = new TimingWindowSolver(obs);\n ImprovedSkyCalc calc = new ImprovedSkyCalc(variant.getSchedule().getSite());\n for (int i = 0; i < size; i++) {\n long t = interval.getStart() + QUANTUM * i;\n calc.calculate(coords.apply(t), new Date(t), true);\n for (Circumstance c: Circumstance.values()) {\n Double[] vals = circV.get(c);\n switch (c) {\n case AIRMASS: vals[i] = calc.getAirmass(); break;\n case AZIMUTH: vals[i] = calc.getAzimuth(); break;\n case ELEVATION: vals[i] = calc.getAltitude(); break;\n case LUNAR_DISTANCE: vals[i] = calc.getLunarDistance(); break;\n case PARALLACTIC_ANGLE: vals[i] = calc.getParallacticAngle(); break;\n case TOTAL_SKY_BRIGHTNESS: vals[i] = calc.getTotalSkyBrightness(); break;\n case HOUR_ANGLE: vals[i] = calc.getHourAngle(); break;\n case TIMING_WINDOW_OPEN: vals[i] = tws.includes(t) ? 1. : 0.; break;\n default: throw new Error(\"Missing switch case for \" + c);\n }\n }\n }\n\n // Now calculate circumstances for science.\n if (getSetupType() != SetupType.NONE) {\n\n circS = new TreeMap<Circumstance, Double[]>();\n final long setupTime = getSetupTime();\n\n for (Circumstance c: Circumstance.values()) {\n\n Double[] valsV = circV.get(c);\n Double[] valsS = new Double[valsV.length];\n\n // We want to copy the range n ... length where n is the first\n // quantum that's not during setup time, or the last sample, so\n // we guarantee at least one.\n int n = Math.min((int) (setupTime / QUANTUM), valsV.length - 1);\n System.arraycopy(valsV, n, valsS, n, valsV.length - n);\n\n circS.put(c, valsS);\n\n }\n\n } else {\n\n // Science and visit circumstances are the same if there is no setup.\n circS = circV;\n\n }\n\n }\n }", "public org.drip.state.estimator.PredictorResponseWeightConstraint fxPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams) return null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.fxPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\treturn prwc;\n\t}", "@Test\n\tpublic void testATMSwaptionCalibration() throws CalculationException, SolverException {\n\n\t\tfinal int numberOfPaths\t\t= 10000; // ideale è 10'000 paths!\n\t\tfinal int numberOfFactors\t= 1;\n\n\t\tfinal long millisCurvesStart = System.currentTimeMillis();\n\n\n\t\tSystem.out.println(\"Calibration to Swaptions.\\n\");\n\n\t\tSystem.out.println(\"Calibration of rate curves:\");\n\n\t\tfinal AnalyticModel curveModel = getCalibratedCurve();\n\n\t\t// Create the forward curve (initial value of the LIBOR market model)\n\t\tfinal ForwardCurve forwardCurve = curveModel.getForwardCurve(\"ForwardCurveFromDiscountCurve(discountCurve-EUR,1D)\");\n\t\tfinal DiscountCurve discountCurve = curveModel.getDiscountCurve(\"discountCurve-EUR\");\n\t\t//\t\tcurveModel.addCurve(discountCurve.getName(), discountCurve);\n\n\t\tfinal long millisCurvesEnd = System.currentTimeMillis();\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"Brute force Monte-Carlo calibration of model volatilities:\");\n\n\t\tfinal ArrayList<String>\t\t\t\tcalibrationItemNames\t= new ArrayList<>();\n\t\tfinal ArrayList<CalibrationProduct>\tcalibrationProducts\t\t= new ArrayList<>();\n\n\t\tfinal double\tswapPeriodLength\t= 0.5;\n\n\t\tfinal String[] atmExpiries = {\n\t\t\t\t\"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\", \"1M\",\n\t\t\t\t\"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \"2M\", \n\t\t\t\t\"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\", \"3M\",\n\t\t\t\t\"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\", \"6M\",\n\t\t\t\t\"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\", \"9M\",\n\t\t\t\t\"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \"1Y\", \n\t\t\t\t\"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\", \"18M\",\n\t\t\t\t\"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\", \"2Y\",\n\t\t\t\t\"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"3Y\", \"4Y\",\n\t\t\t\t\"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"4Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\",\n\t\t\t\t\"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"5Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\",\n\t\t\t\t\"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"7Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\",\n\t\t\t\t\"10Y\", \"10Y\", \"10Y\", \"10Y\", \"10Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\", \"15Y\",\n\t\t\t\t\"15Y\", \"15Y\", \"15Y\", \"15Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\", \"20Y\",\n\t\t\t\t\"20Y\", \"20Y\", \"20Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\", \"25Y\",\n\t\t\t\t\"25Y\", \"25Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\", \"30Y\" };\n\n\t\tfinal String[] atmTenors = {\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \n\t\t\t\t\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\n\t\t\t\t\"1Y\", \"2Y\",\"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\",\"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\",\n\t\t\t\t\"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\",\n\t\t\t\t\"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\",\n\t\t\t\t\"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\",\n\t\t\t\t\"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\",\n\t\t\t\t\"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\",\n\t\t\t\t\"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\",\n\t\t\t\t\"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\",\n\t\t\t\t\"7Y\", \"8Y\", \"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\",\n\t\t\t\t\"9Y\", \"10Y\", \"15Y\", \"20Y\", \"25Y\", \"30Y\", \"1Y\", \"2Y\", \"3Y\", \"4Y\", \"5Y\", \"6Y\", \"7Y\", \"8Y\", \"9Y\", \"10Y\",\n\t\t\t\t\"15Y\", \"20Y\", \"25Y\", \"30Y\" };\n\n\t\tfinal double[] atmNormalVolatilities = {\n\t\t\t\t0.0015335, 0.0015179, 0.0019499, 0.0024161, 0.0027817, 0.0031067, 0.0033722, 0.0035158, 0.0036656, 0.0037844, 0.00452, 0.0050913, 0.0054071, 0.0056496,\n\t\t\t\t//next is 2M\n\t\t\t\t0.0016709, 0.0016287, 0.0020182, 0.0024951, 0.002827, 0.0031023, 0.0034348, 0.0036183, 0.0038008, 0.0039155, 0.0046602, 0.0051981, 0.0055116, 0.0057249,\n\t\t\t\t\n\t\t\t\t0.0015543, 0.0016509, 0.0020863, 0.002587, 0.002949, 0.0032105, 0.0035338, 0.0037133, 0.0038475, 0.0040674, 0.0047458, 0.005276, 0.005476, 0.005793,\n\t\t\t\t0.0016777, 0.001937, 0.0023423, 0.0027823, 0.0031476, 0.0034569, 0.0037466, 0.0039852, 0.0041802, 0.0043221, 0.0049649, 0.0054206, 0.0057009, 0.0059071,\n\t\t\t\t//next is 9M\n\t\t\t\t0.0017809, 0.0020951, 0.0024978, 0.0029226, 0.0032379, 0.0035522, 0.0038397, 0.0040864, 0.0043122, 0.0044836, 0.0050939, 0.0054761, 0.0057374, 0.0059448,\n\t\t\t\t\n\t\t\t\t0.0020129, 0.0022865, 0.0027082, 0.0030921, 0.0033849, 0.0037107, 0.0039782, 0.0042058, 0.0044272, 0.0046082, 0.0051564, 0.0055307, 0.0057924, 0.0059811,\n\t\t\t\t//next is 18M\n\t\t\t\t0.0022824, 0.0025971, 0.0029895, 0.0033299, 0.0036346, 0.0039337, 0.0042153, 0.0044347, 0.0046686, 0.0048244, 0.0052739, 0.005604, 0.0058311, 0.0060011,\n\t\t\t\n\t\t\t\t0.0026477, 0.0029709, 0.0033639, 0.0036507, 0.0039096, 0.0041553, 0.0044241, 0.00462, 0.0048265, 0.004989, 0.005361, 0.0056565, 0.0058529, 0.0060102,\n\t\t\t\t0.003382, 0.0036593, 0.0039353, 0.0041484, 0.0043526, 0.0045677, 0.004775, 0.0049506, 0.0051159, 0.0052722, 0.0055185, 0.0057089, 0.0058555, 0.0059432,\n\t\t\t\t0.0040679, 0.0042363, 0.0044602, 0.0046206, 0.0047527, 0.0048998, 0.0050513, 0.0051928, 0.0053439, 0.0054657, 0.0056016, 0.0057244, 0.0058153, 0.0058793,\n\t\t\t\t0.0045508, 0.0046174, 0.0047712, 0.0048999, 0.0050364, 0.0051504, 0.0052623, 0.0053821, 0.0054941, 0.0055918, 0.0056569, 0.0057283, 0.0057752, 0.0058109,\n\t\t\t\t0.0051385, 0.0051373, 0.0052236, 0.005312, 0.0053793, 0.0054396, 0.0055037, 0.0055537, 0.0056213, 0.0056943, 0.005671, 0.0056707, 0.0056468, 0.0056423,\n\t\t\t\t0.0055069, 0.0054836, 0.0055329, 0.0055696, 0.005605, 0.0056229, 0.0056562, 0.005655, 0.0056679, 0.0057382, 0.0056494, 0.0055831, 0.0055096, 0.0054526,\n\t\t\t\t0.0054486, 0.0054057, 0.0054439, 0.005462, 0.0054915, 0.0054993, 0.0055134, 0.0054985, 0.0055318, 0.0055596, 0.005369, 0.0052513, 0.0051405, 0.0050416,\n\t\t\t\t0.005317, 0.005268, 0.005312, 0.0053112, 0.0053417, 0.0053556, 0.0053323, 0.0053251, 0.0053233, 0.0053126, 0.0050827, 0.004922, 0.0047924, 0.0046666,\n\t\t\t\t0.0051198, 0.0051013, 0.0051421, 0.0051418, 0.0051538, 0.005133, 0.0051081, 0.0050552, 0.005055, 0.0050473, 0.0048161, 0.0045965, 0.0044512, 0.0043099,\n\t\t\t\t0.0049482, 0.004947, 0.0049805, 0.0049951, 0.0050215, 0.0049849, 0.0049111, 0.0048498, 0.0047879, 0.0047688, 0.0044943, 0.0042786, 0.0041191, 0.0039756};\n\n\t\tfinal LocalDate referenceDate = LocalDate.of(2020, Month.JULY, 31);\n\t\tfinal BusinessdayCalendarExcludingTARGETHolidays cal = new BusinessdayCalendarExcludingTARGETHolidays();\n\t\tfinal DayCountConvention_ACT_365 modelDC = new DayCountConvention_ACT_365();\n\t\tfor(int i=0; i<atmNormalVolatilities.length; i++ ) {\n\n\t\t\tfinal LocalDate exerciseDate = cal.getDateFromDateAndOffsetCode(referenceDate, atmExpiries[i]);\n\t\t\tfinal LocalDate tenorEndDate = cal.getDateFromDateAndOffsetCode(exerciseDate, atmTenors[i]);\n\t\t\tdouble\texercise\t\t= modelDC.getDaycountFraction(referenceDate, exerciseDate);\n\t\t\tdouble\ttenor\t\t\t= modelDC.getDaycountFraction(exerciseDate, tenorEndDate);\n\n\t\t\t// We consider an idealized tenor grid (alternative: adapt the model grid)\n\t\t\texercise\t= Math.round(exercise/0.25)*0.25;\n\t\t\ttenor\t\t= Math.round(tenor/0.25)*0.25;\n\t\t\tif(exercise < 0.25) {continue;}\n\t\t\t//if(exercise < 1.0) {continue;}\n\n\t\t\tfinal int numberOfPeriods = (int)Math.round(tenor / swapPeriodLength);\n\n\t\t\tfinal double\tmoneyness\t\t\t= 0.0;\n\t\t\tfinal double\ttargetVolatility\t= atmNormalVolatilities[i];\n\n\t\t\tfinal String\ttargetVolatilityType = \"VOLATILITYNORMAL\";\n\n\t\t\tfinal double\tweight = 1.0;\n\n\t\t\tcalibrationProducts.add(createCalibrationItem(weight, exercise, swapPeriodLength, numberOfPeriods, moneyness, targetVolatility, targetVolatilityType, forwardCurve, discountCurve));\n\t\t\tcalibrationItemNames.add(atmExpiries[i]+\"\\t\"+atmTenors[i]);\n\t\t}\n\n\t\t/*\n\t\t * Create a simulation time discretization\n\t\t */\n\t\t// If simulation time is below libor time, exceptions will be hard to track.\n\t\tfinal double lastTime\t= 21.0;\n\t\tfinal double dtLibor\t= 0.5;\n\t\tfinal double dt\t= 0.125;\n\t\tfinal TimeDiscretization timeDiscretizationFromArray = new TimeDiscretizationFromArray(0.0, (int) (lastTime / dt), dt);\n\t\tfinal TimeDiscretization liborPeriodDiscretization = new TimeDiscretizationFromArray(0.0, (int) (lastTime / dtLibor), dtLibor);\n\t\tint seed =1111;\n\t\tSystem.out.println(\"seed: \" + seed);\n\t\tfinal BrownianMotion brownianMotion = new net.finmath.montecarlo.BrownianMotionLazyInit(timeDiscretizationFromArray, numberOfFactors, numberOfPaths, seed /* seed */); \n\t\tTimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00,0.25, 0.5, 1.00, 2.00, 3.00, 5.00, 7.00, 10.0, 15.0, 21.0);\n\t\t//TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.0, 7.00, 8.0,9.0, 10.0, 12.5, 15.0, 21.0);\t\t// needed if you use LIBORVolatilityModelPiecewiseConstantWithMercurioModification: TimeDiscretization = new TimeDiscretizationFromArray(0.0, 0.25, 0.50, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 25.0, 30.0, 40.0);\n\t //TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 0.5, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9,00, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 , 17.0, 18.0, 19.0 ,20.0,21.0);\n //TimeDiscretization timeToMaturityDiscretization = new TimeDiscretizationFromArray(0.00, 21, 1.0);\n\n\t\tdouble[] arrayValues = new double [timeToMaturityDiscretization.getNumberOfTimes()];\n\t\tfor (int i=0; i<timeToMaturityDiscretization.getNumberOfTimes(); i++) {arrayValues[i]= 0.1/100;}\n\n\t //final LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelTimeHomogenousPiecewiseConstantWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, timeToMaturityDiscretization, arrayValues);\n\t\tLIBORVolatilityModel volatilityModel = new LIBORVolatilityModelFourParameterExponentialFormWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, 0.002, 0.0005, 0.2, 0.00005, true); //0.20/100.0, 0.05/100.0, 0.10, 0.05/100.0, \n\t\t//final LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelPiecewiseConstantWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization,optionMaturityDiscretization,timeToMaturityDiscretization, 0.50 / 100);\n\t\t\n\t\tfinal LIBORCorrelationModel correlationModel = new LIBORCorrelationModelExponentialDecayWithMercurioModification(timeDiscretizationFromArray, liborPeriodDiscretization, numberOfFactors, 0.05, false);\n\t\t//AbstractLIBORCovarianceModelParametric covarianceModelParametric = new LIBORCovarianceModelExponentialForm5Param(timeDiscretizationFromArray, liborPeriodDiscretization, numberOfFactors, new double[] { 0.20/100.0, 0.05/100.0, 0.10, 0.05/100.0, 0.10} );\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelParametric = new LIBORCovarianceModelFromVolatilityAndCorrelation(timeDiscretizationFromArray, liborPeriodDiscretization, volatilityModel, correlationModel);\n\n\t\t// Create blended local volatility model with fixed parameter (0=lognormal, > 1 = almost a normal model).\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelDisplaced = new DisplacedLocalVolatilityModel(covarianceModelParametric, 1.0/0.25, false /* isCalibrateable */);\n\t\tfinal AbstractLIBORCovarianceModelParametric covarianceModelReducedVolatility = new VolatilityReductionMercurioModel(covarianceModelDisplaced);\n\t\t\n\t\t// Set model properties\n\t\tfinal Map<String, Object> properties = new HashMap<>();\n\t\tSystem.out.println(\"Number of volatility parameters: \" + volatilityModel.getParameter().length);\n\n\t\tproperties.put(\"measure\", LIBORMarketModelFromCovarianceModelWithMercurioModification.Measure.SPOT.name());\n\n\t\t// Choose normal state space for the Euler scheme (the covariance model above carries a linear local volatility model).\n\t\tproperties.put(\"stateSpace\", LIBORMarketModelFromCovarianceModelWithMercurioModification.StateSpace.NORMAL.name());\n\n\t\t// Set calibration properties (should use our brownianMotion for calibration - needed to have to right correlation).\n\t\tfinal Double accuracy = new Double(1E-8);\t// Lower accuracy to reduce runtime of the unit test\n\t\tfinal int maxIterations = 400;\n\t\tfinal int numberOfThreads = 6;\n\t\tfinal OptimizerFactory optimizerFactory = new OptimizerFactoryLevenbergMarquardt(maxIterations, accuracy, numberOfThreads);\n\n\t\t//penso che getParameterAsDouble().length mi ritorni il numero di tutti i paratemtri da calibrare cioè tutta la piecewise volatiliy e anche correlazion\n\t\tfinal double[] parameterStandardDeviation = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tfinal double[] parameterLowerBound = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tfinal double[] parameterUpperBound = new double[covarianceModelParametric.getParameterAsDouble().length];\n\t\tArrays.fill(parameterStandardDeviation, 0.20/100.0);\n\t\tArrays.fill(parameterLowerBound, 0.0);\n\t\tArrays.fill(parameterUpperBound, Double.POSITIVE_INFINITY);\n\n\t\t// Set calibration properties (should use our brownianMotion for calibration - needed to have to right correlation).\n\t\tfinal Map<String, Object> calibrationParameters = new HashMap<>();\n\t\tcalibrationParameters.put(\"accuracy\", accuracy);\n\t\tcalibrationParameters.put(\"brownianMotion\", brownianMotion);\n\t\tcalibrationParameters.put(\"optimizerFactory\", optimizerFactory);\n\t\tcalibrationParameters.put(\"parameterStep\", new Double(1E-4));\n\t\tproperties.put(\"calibrationParameters\", calibrationParameters);\n\n\t\tfinal long millisCalibrationStart = System.currentTimeMillis();\n\n\t\t/*\n\t\t * Create corresponding Forward Market Model\n\t\t */\n\t\tfinal CalibrationProduct[] calibrationItemsLMM = new CalibrationProduct[calibrationItemNames.size()];\n\t\tfor(int i=0; i<calibrationItemNames.size(); i++) {\n\t\t\tcalibrationItemsLMM[i] = new CalibrationProduct(calibrationProducts.get(i).getProduct(),calibrationProducts.get(i).getTargetValue(),calibrationProducts.get(i).getWeight());\n\t\t}\n\t\tfinal LIBORMarketModel mercurioModelCalibrated = LIBORMarketModelFromCovarianceModelWithMercurioModification.of(\n\t\t\t\tliborPeriodDiscretization,\n\t\t\t\tcurveModel,\n\t\t\t\tforwardCurve,\n\t\t\t\tnew DiscountCurveFromForwardCurve(forwardCurve),\n\t\t\t\trandomVariableFactory,\n\t\t\t\tcovarianceModelReducedVolatility,\n\t\t\t\tcalibrationItemsLMM, properties);\n\n\t\tfinal long millisCalibrationEnd = System.currentTimeMillis();\n\t\t\n//-------------------------------------------------------------------------------- fine calibrazione volatility------------------------------\n\t\tSystem.out.println(\"\\nCalibrated parameters are:\");\n\t\tfinal double[] param = ((AbstractLIBORCovarianceModelParametric)((LIBORMarketModelFromCovarianceModelWithMercurioModification) mercurioModelCalibrated).getCovarianceModel()).getParameterAsDouble();\n\t\tfor (final double p : param) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\n\t\tfinal EulerSchemeFromProcessModel process = new EulerSchemeFromProcessModel(mercurioModelCalibrated, brownianMotion);\n\t\tfinal LIBORModelMonteCarloSimulationModel simulationMercurioCalibrated = new LIBORMonteCarloSimulationFromLIBORModel(process);\n\n\t\tSystem.out.println(\"\\nValuation on calibrated model:\");\n\t\tdouble deviationSum\t\t\t= 0.0;\n\t\tdouble deviationSquaredSum\t= 0.0;\n\t\tfor (int i = 0; i < calibrationProducts.size(); i++) {\n\t\t\tfinal AbstractLIBORMonteCarloProduct calibrationProduct = calibrationProducts.get(i).getProduct();\n\t\t\ttry {\n\t\t\t\tfinal double valueModel = calibrationProduct.getValue(simulationMercurioCalibrated);\n\t\t\t\tfinal double valueTarget = calibrationProducts.get(i).getTargetValue().getAverage();\n\t\t\t\tfinal double error = valueModel-valueTarget;\n\t\t\t\tdeviationSum += error;\n\t\t\t\tdeviationSquaredSum += error*error;\n\t\t\t\tSystem.out.println(calibrationItemNames.get(i) + \"\\t\" + \"Model: \" + formatterValue.format(valueModel) + \"\\t Target: \" + formatterValue.format(valueTarget) + \"\\t Deviation: \" + formatterDeviation.format(valueModel-valueTarget));// + \"\\t\" + calibrationProduct.toString());\n\t\t\t}\n\t\t\tcatch(final Exception e) {\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Time required for calibration of curves.........: \" + (millisCurvesEnd-millisCurvesStart)/1000.0 + \" s.\");\n\t\tSystem.out.println(\"Time required for calibration of volatilities...: \" + (millisCalibrationEnd-millisCalibrationStart)/1000.0 + \" s.\");\n\n\t\tfinal double averageDeviation = deviationSum/calibrationProducts.size();\n\t\tSystem.out.println(\"Mean Deviation:\" + formatterValue.format(averageDeviation));\n\t\tSystem.out.println(\"RMS Error.....:\" + formatterValue.format(Math.sqrt(deviationSquaredSum/calibrationProducts.size())));\n\t\tSystem.out.println(\"__________________________________________________________________________________________\\n\");\n\n\t\tAssert.assertTrue(Math.abs(averageDeviation) < 2E-4);\n\n//\n//\t\t/*\n//\t\t * Checking serilization\n//\t\t */\n//\t\tbyte[] lmmSerialized = null;\n//\t\ttry {\n//\t\t\tfinal ByteArrayOutputStream baos = new ByteArrayOutputStream();\n//\t\t\tfinal ObjectOutputStream oos = new ObjectOutputStream( baos );\n//\t\t\toos.writeObject(mercurioModelCalibrated.getCloneWithModifiedData(null));\n//\t\t\tlmmSerialized = baos.toByteArray();\n//\t\t} catch (final IOException e) {\n//\t\t\tfail(\"Serialization failed with exception \" + e.getMessage());\n//\t\t}\n//\n//\t\tLIBORMarketModelFromCovarianceModelWithMercurioModification liborMarketModelFromSerialization = null;\n//\t\ttry {\n//\t\t\tfinal ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(lmmSerialized) );\n//\t\t\tliborMarketModelFromSerialization = (LIBORMarketModelFromCovarianceModelWithMercurioModification)ois.readObject();\n//\t\t} catch (IOException | ClassNotFoundException e) {\n//\t\t\tfail(\"Deserialization failed with exception \" + e.getMessage());\n//\t\t}\n//\n//\t\t/*\n//\t\t * Check if the deserialized model and the original calibrated model give the same valuations\n//\t\t */\n//\t\tif(liborMarketModelFromSerialization != null) {\n//\t\t\tfinal LIBORModelMonteCarloSimulationModel simulationFromSerialization = new LIBORMonteCarloSimulationFromLIBORModel(new EulerSchemeFromProcessModel(liborMarketModelFromSerialization, brownianMotion));\n//\n//\t\t\tSystem.out.println(\"\\nValuation on calibrated model:\");\n//\t\t\tfor (int i = 0; i < calibrationProducts.size(); i++) {\n//\t\t\t\tfinal AbstractLIBORMonteCarloProduct calibrationProduct = calibrationProducts.get(i).getProduct();\n//\t\t\t\ttry {\n//\t\t\t\t\tfinal double valueFromCalibratedModel = calibrationProduct.getValue(simulationMercurioCalibrated);\n//\t\t\t\t\tfinal double valueFromSerializedModel = calibrationProduct.getValue(simulationFromSerialization);\n//\t\t\t\t\tfinal double error = valueFromSerializedModel-valueFromCalibratedModel;\n//\t\t\t\t\tAssert.assertEquals(\"Valuation using deserilized model.\", valueFromCalibratedModel, valueFromSerializedModel, 1E-12);\n//\t\t\t\t\tSystem.out.println(calibrationItemNames.get(i) + \"\\t\" + formatterDeviation.format(error));\n//\t\t\t\t}\n//\t\t\t\tcatch(final Exception e) {\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t// CAPLET ON BACKWARD LOOKING RATE SEMESTRALI\n\t\tDecimalFormat formatterTimeValue = new DecimalFormat(\"##0.00;\");\n\t\tDecimalFormat formatterVolValue = new DecimalFormat(\"##0.00000;\");\n\t\tDecimalFormat formatterAnalytic = new DecimalFormat(\"##0.000;\");\n\t\tDecimalFormat formatterPercentage = new DecimalFormat(\" ##0.000%;-##0.000%\", new DecimalFormatSymbols(Locale.ENGLISH));\n\t\tdouble[] mktData = new double[] {/* 6M 0.00167, */ /* 12M*/ 0.00201, /* 18M*/ 0.00228, /* 2Y */ 0.00264, 0.0, /* 3Y */ 0.0033, /* 4Y */0.00406, /* 5Y */ 0.00455, /* 6Y - NA */ 0.0, /* 7Y */0.00513, /* 8Y- NA */0.0, /* 9Y */0.0, /* 10Y */0.00550,0.0,0.0,0.0,0.0, /* 15Y */0.00544,0.0,0.0,0.0,0.0, /* 20Y */0.0053,0.0,0.0,0.0,0.0,/* 25Y */ 0.0053,0.0,0.0,0.0,0.0,/* 30Y */0.00495,0.0,0.0,0.0 };\n\t\t\n\t\tdouble strike = 0.004783;\n\t\n\t\tint liborIndex=1;\n\t\tint mktDataIndex = 0;\n\n\t\t//Results with CALIBRATED model\n\t\tSystem.out.println(\"\\n results on CALIBRATED model \\n\");\n\t\twhile(liborIndex < liborPeriodDiscretization.getNumberOfTimes()) {\n\t\t\tdouble maturityMinusLengthLibor =liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble fixBackwardTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tCaplet capletCassical = new Caplet(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false, ValueUnit.NORMALVOLATILITY);\n\t\t\t//set to default ValueUnit.NORMALVOLATILITY for CapletOnBackwardLookingRate\n\t\t\tCapletOnBackwardLookingRate capletBackward = new CapletOnBackwardLookingRate(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false);\t\t\t\n\t\t\tdouble impliedVolClassical = capletCassical.getValue(simulationMercurioCalibrated);\n\t\t\tdouble impliedVolBackward = capletBackward.getValue(simulationMercurioCalibrated);\n\t\t\tdouble analyticFormulaPaper = Math.sqrt(1+0.5/(maturityMinusLengthLibor*3));\n\t\t\tdouble ratioImpliedVol = impliedVolBackward/impliedVolClassical;\n\t\t\tdouble error = (analyticFormulaPaper-ratioImpliedVol)/analyticFormulaPaper;\n\n\t\t\tif (liborIndex<5) {\t\t//da i valori del caplet per maturity 1.5Y, 2Y, 2.5Y,.\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\tliborIndex+=1;\n\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\tliborIndex+=1;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\t//secondo loop da i valori del caplet per maturity 4Y,5Y,...,21\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\t\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\n\t\t// Set model properties\n\t\tMap<String, String> properties2 = new HashMap<String, String >();\n\t\tproperties2.put(\"measure\", LIBORMarketModelFromCovarianceModelWithMercurioModification.Measure.SPOT.name());\n\t\tproperties2.put(\"stateSpace\", LIBORMarketModelFromCovarianceModelWithMercurioModification.StateSpace.NORMAL.name());\n\n\t\tfinal LIBORMarketModel MercurioModelNONcalibrated= new LIBORMarketModelFromCovarianceModelWithMercurioModification(\n\t\t\t\tliborPeriodDiscretization,\n\t\t\t\tcurveModel,\n\t\t\t\tforwardCurve,\n\t\t\t\tnew DiscountCurveFromForwardCurve(forwardCurve),\n\t\t\t\trandomVariableFactory,\n\t\t\t\tcovarianceModelReducedVolatility,\n\t\t\t\tproperties2\n\t\t\t\t);\n\n\t\tfinal EulerSchemeFromProcessModel process2 = new EulerSchemeFromProcessModel(MercurioModelNONcalibrated,brownianMotion);\n\t\tfinal LIBORModelMonteCarloSimulationModel simulationMercurioModelNONcalibrated = new LIBORMonteCarloSimulationFromLIBORModel(process2);\n\t\n\t\t\n\t\t//Results with NON calibrated model\n\t\tliborIndex=1;\n\t\tmktDataIndex = 0;\n\t\tSystem.out.println(\"\\n results on NON-CALIBRATED model \\n\");\n\t\twhile(liborIndex < liborPeriodDiscretization.getNumberOfTimes()) {\n\t\t\tdouble maturityMinusLengthLibor =liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble fixBackwardTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tCaplet capletCassical = new Caplet(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false, ValueUnit.NORMALVOLATILITY);\n\t\t\t//set to default ValueUnit.NORMALVOLATILITY for CapletOnBackwardLookingRate\n\t\t\tCapletOnBackwardLookingRate capletBackward = new CapletOnBackwardLookingRate(maturityMinusLengthLibor, dtLibor, strike, dtLibor, false);\t\t\t\n\t\t\tdouble impliedVolClassical = capletCassical.getValue(simulationMercurioModelNONcalibrated);\n\t\t\tdouble impliedVolBackward = capletBackward.getValue(simulationMercurioModelNONcalibrated);\n\t\t\tdouble analyticFormulaPaper = Math.sqrt(1+0.5/(maturityMinusLengthLibor*3));\n\t\t\tdouble ratioImpliedVol = impliedVolBackward/impliedVolClassical;\n\t\t\tdouble error = (analyticFormulaPaper-ratioImpliedVol)/analyticFormulaPaper;\n\n\t\t\tif (liborIndex<5) {\t\t//da i valori del caplet per maturity 1.0Y, 1.5Y, 2Y, 2.5Y, 3Y\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\tliborIndex+=1;\n\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\tliborIndex+=1;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\t//secondo loop da i valori del caplet per maturity 4Y,5Y,...,21\n\t\t\t\tif (mktData[mktDataIndex] == 0.0) {\n\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t+ formatterPercentage.format(error) );\n\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdouble ratioMktVol =impliedVolBackward/mktData[mktDataIndex];\n\t\t\t\t\t\tdouble errorMkt = (analyticFormulaPaper-ratioMktVol)/analyticFormulaPaper;\n\n\t\t\t\t\t\tSystem.out.println(\"Caplet on B(\" + formatterTimeValue.format(maturityMinusLengthLibor) + \", \"\n\t\t\t\t\t\t\t\t+ formatterTimeValue.format(fixBackwardTime) + \"; \"\n\t\t\t\t\t\t\t\t+ \"\" + formatterTimeValue.format(fixBackwardTime) + \") \" + \"\\t\" + \"Backward Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolBackward) + \"\\t\" + \"Classical Caplet: \" \n\t\t\t\t\t\t\t\t+ formatterPercentage.format(impliedVolClassical)+ \"\\t\" +\"Analytic ratio: \" \n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(analyticFormulaPaper)+ \"\\t\" + \"MC ratio: \"\n\t\t\t\t\t\t\t\t+ formatterAnalytic.format(ratioImpliedVol) + \"\\t\" +\"Error: \"\n\t\t\t\t\t\t\t\t+ formatterPercentage.format(error) \n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Caplet Vol. \" + formatterPercentage.format(mktData[mktDataIndex])\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Ratio: \"\t+ formatterAnalytic.format(ratioMktVol)\t\n\t\t\t\t\t\t\t\t+ \"\\t\" +\"Market Error: \"\t+ formatterPercentage.format(errorMkt)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tliborIndex+=2;\n\t\t\t\t\t\tmktDataIndex+=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\tint timeIndex = 4;\n\t\tSystem.out.println(\" \\n Backward looking rate evaluated at the END of the accrual period:\");\n\t\tfor( liborIndex=0; liborIndex<liborPeriodDiscretization.getNumberOfTimes()-1; liborIndex++) {\n\t\t\tdouble evaluationTime=timeDiscretizationFromArray.getTime(timeIndex);\n\t\t\tdouble liborStartingTime=liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble liborEndingTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tRandomVariable backwardLookingRate = simulationMercurioModelNONcalibrated.getLIBOR(timeIndex, liborIndex);\n\t\t\tdouble avgBackwardLookingRate =backwardLookingRate.getAverage();\n\t\t\tSystem.out.println(\"Backward B(\" + formatterTimeValue.format(liborStartingTime) + \", \" + formatterTimeValue.format(liborEndingTime) + \") evaluated in t= \" + formatterTimeValue.format(evaluationTime) + \".\"+ \"\\t\" + \"Average: \" + avgBackwardLookingRate);\n\t\t\ttimeIndex += 4;\n\t\t}\t\n\t\t\n\t\tint timeIndex2 = 0;\n\t\tSystem.out.println(\"\\n Backward looking rate evaluated at the BEGIN of the accrual period:\");\n\t\tfor( liborIndex=0; liborIndex<liborPeriodDiscretization.getNumberOfTimes()-1; liborIndex++) {\n\t\t\tdouble evaluationTime=timeDiscretizationFromArray.getTime(timeIndex2);\n\t\t\tdouble liborStartingTime=liborPeriodDiscretization.getTime(liborIndex);\n\t\t\tdouble liborEndingTime=liborPeriodDiscretization.getTime(liborIndex+1);\n\t\t\tRandomVariable backwardLookingRate = simulationMercurioModelNONcalibrated.getLIBOR(timeIndex2, liborIndex);\n\t\t\tdouble avgBackwardLookingRate =backwardLookingRate.getAverage();\n\t\t\tSystem.out.println(\"Backward B(\" + formatterTimeValue.format(liborStartingTime) + \", \" + formatterTimeValue.format(liborEndingTime) + \") evaluated in t= \" + formatterTimeValue.format(evaluationTime) + \".\"+ \"\\t\" + \"Average: \" + avgBackwardLookingRate);\n\t\t\ttimeIndex2 += 4;\n\t\t}\n\n\t}", "private final void silk_PLC_update(final Jsilk_decoder_control psDecCtrl)\r\n\t{\r\n\t\tfinal Jsilk_PLC_struct psPLC = this.sPLC;\r\n\r\n\t\t/* Update parameters used in case of packet loss */\r\n\t\tthis.prevSignalType = this.indices.signalType;\r\n\t\tint LTP_Gain_Q14 = 0;\r\n\t\tfinal int nb_subfr1 = this.nb_subfr - 1;// java\r\n\t\tif( this.indices.signalType == Jdefine.TYPE_VOICED ) {\r\n\t\t\t/* Find the parameters for the last subframe which contains a pitch pulse */\r\n\t\t\tfor( int j = 0, je = psDecCtrl.pitchL[ nb_subfr1 ], nb_j = nb_subfr1; j * this.subfr_length < je; j++, nb_j-- ) {\r\n\t\t\t\tif( j == this.nb_subfr ) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tint temp_LTP_Gain_Q14 = 0;\r\n\t\t\t\tfinal int nb_j_o = nb_j * Jdefine.LTP_ORDER;// java\r\n\t\t\t\tint i = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\ttemp_LTP_Gain_Q14 += psDecCtrl.LTPCoef_Q14[ nb_j_o + i ];\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t\tif( temp_LTP_Gain_Q14 > LTP_Gain_Q14 ) {\r\n\t\t\t\t\tLTP_Gain_Q14 = temp_LTP_Gain_Q14;\r\n\t\t\t\t\tSystem.arraycopy( psDecCtrl.LTPCoef_Q14, nb_j_o, psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER );\r\n\r\n\t\t\t\t\tpsPLC.pitchL_Q8 = psDecCtrl.pitchL[ nb_j ] << 8;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// silk_memset( psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER * sizeof( opus_int16 ) );\r\n\t\t\tint i = 0;\r\n\t\t\tdo {\r\n\t\t\t\tpsPLC.LTPCoef_Q14[i] = 0;\r\n\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\tpsPLC.LTPCoef_Q14[ Jdefine.LTP_ORDER / 2 ] = (short)LTP_Gain_Q14;\r\n\r\n\t\t\t/* Limit LT coefs */\r\n\t\t\tif( LTP_Gain_Q14 < V_PITCH_GAIN_START_MIN_Q14 ) {\r\n\t\t\t\tfinal int tmp = V_PITCH_GAIN_START_MIN_Q14 << 10;\r\n\t\t\t\tfinal int scale_Q10 = ( tmp / ( LTP_Gain_Q14 > 1 ? LTP_Gain_Q14 : 1 ) );\r\n\t\t\t\ti = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tpsPLC.LTPCoef_Q14[ i ] = (short)(((int)psPLC.LTPCoef_Q14[ i ] * scale_Q10) >> 10);\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t} else if( LTP_Gain_Q14 > V_PITCH_GAIN_START_MAX_Q14 ) {\r\n\t\t\t\tfinal int tmp = V_PITCH_GAIN_START_MAX_Q14 << 14;\r\n\t\t\t\tfinal int scale_Q14 = ( tmp / ( LTP_Gain_Q14 > 1 ? LTP_Gain_Q14 : 1 ) );\r\n\t\t\t\ti = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t\tpsPLC.LTPCoef_Q14[ i ] = (short)(( (int)psPLC.LTPCoef_Q14[ i ] * scale_Q14 ) >> 14);\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tpsPLC.pitchL_Q8 = ( this.fs_kHz * 18 ) << 8;\r\n\t\t\t// silk_memset( psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER * sizeof( opus_int16 ));\r\n\t\t\tint i = 0;\r\n\t\t\tdo {\r\n\t\t\t\tpsPLC.LTPCoef_Q14[i] = 0;\r\n\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t}\r\n\r\n\t\t/* Save LPC coeficients */\r\n\t\tSystem.arraycopy( psDecCtrl.PredCoef_Q12[ 1 ], 0, psPLC.prevLPC_Q12, 0, this.LPC_order );\r\n\t\tpsPLC.prevLTP_scale_Q14 = (short)psDecCtrl.LTP_scale_Q14;\r\n\r\n\t\t/* Save last two gains */\r\n\t\tpsPLC.prevGain_Q16[0] = psDecCtrl.Gains_Q16[ nb_subfr1 - 1 ];\r\n\t\tpsPLC.prevGain_Q16[1] = psDecCtrl.Gains_Q16[ nb_subfr1 ];\r\n\r\n\t\tpsPLC.subfr_length = this.subfr_length;\r\n\t\tpsPLC.nb_subfr = this.nb_subfr;\r\n\t}", "public double constrainDemand(double slope, double trialprice)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to constrainDemand : \" + \"Agent\");\r\n/* 175 */ if (this.demand > 0.0D) {\r\n/* 176 */ if (this.demand * trialprice > this.cash - this.mincash)\r\n/* */ {\r\n/* 178 */ if (this.cash - this.mincash > 0.0D) {\r\n/* 179 */ this.demand = ((this.cash - this.mincash) / trialprice);\r\n/* 180 */ slope = -this.demand / trialprice;\r\n/* */ }\r\n/* */ else\r\n/* */ {\r\n/* 184 */ this.demand = 0.0D;\r\n/* 185 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* */ }\r\n/* 192 */ else if ((this.demand < 0.0D) && (this.demand + this.position < this.minholding))\r\n/* */ {\r\n/* */ \r\n/* 195 */ this.demand = (this.minholding - this.position);\r\n/* 196 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* 200 */ return this.demand;\r\n/* */ }", "@Override\n public void train() {\n actual = observations.toArray();\n min_val_error = Double.MAX_VALUE;\n if (findDecayConstant)\n for (float alpha = 0f; alpha <= 1f; alpha += 0.01f)\n initializeAndTrainModel(alpha);\n else\n initializeAndTrainModel(optAlpha);\n }", "@Test\r\n\tpublic void testGetPlannedCapacity_Nonlinear() {\n\t\tassertEquals(car.sumUsedPhases*900.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*300.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*1200.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 1500), 1e-8);\r\n\t\t\r\n\t}", "public org.drip.state.estimator.PredictorResponseWeightConstraint govviePRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\treturn null;\n\t}", "public void calculateCoefficients(){\n\t\tdlt2d = null;\t//Get rid of existing calibration\n\t\tdouble[][] global = new double[calibrationFrame.data.size()-1][2]; //Global coordinates of the calibration object\n\t\tdouble[][] digitizedPoints = new double[calibrationFrame.data.size()-1][2];\n\t\t/*Copy the calibration object*/\n\t\tfor (int r = 0; r< calibrationFrame.data.size()-1;++r){\n\t\t\tfor (int c = 0; c<2;++c){\n\t\t\t\tSystem.out.println(calibrationFrame.data.get(r+1).get(c+1));\n\t\t\t\tglobal[r][c] = Double.parseDouble(calibrationFrame.data.get(r+1).get(c+1));\n\t\t\t}\n\t\t}\n\t\t/*Copy the calibration points*/\n\t\tfor (int r = 0; r< digitizedPoints.length;++r){\n\t\t\tfor (int c = 0; c< digitizedPoints[r].length;++c){\n\t\t\t\tdigitizedPoints[r][c] = (double) digitizedCalibration[r][c];\n\t\t\t}\n\t\t}\n\n\t\tdigitizedCalibration = null;\n\t\tdlt2d = new DLT2D(global,digitizedPoints);\n\t\t/*Print coefficients...*/\n\t\tMatrix coeffs = dlt2d.getCurrentDltCoefficients();\n\t\tString resultString = \"Coefficients\\n\";\n\t\tfor (int i = 0; i< coeffs.getRowDimension();++i){\n\t\t\tresultString += \"\\tCoeff \"+i+\": \"+Double.toString(coeffs.get(i,0))+\"\\n\";\n\t\t}\n\t\tSystem.out.println(resultString);\t\t\n\t\tstatus.setText(new String(\"2D DLT coefficients\"));\n\t\t/*Create text pane for coordinates*/\n\t\tpointFrame = new SaveableFrame(this);\n\t\tpointFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tpointFrame.pack();\n\t\tpointFrame.setLocation(10, 600);\n\t\tpointFrame.setVisible(true);\t\n\t\t\n\t\t\n\t}", "double[] compute_t_Cl (double[][] t_lift, double thickness, double camber) {\n double[] result = new double[15];\n if (camber >= 0)\n for (int aoa = -28, i = 0; aoa <= 28; aoa += 4, i++) \n result[i] = ci15_from_javafoil_data(t_lift, aoa, thickness, camber);\n else \n for (int aoa = -28, i = 0; aoa <= 28; aoa += 4, i++) \n result[i] = -ci15_from_javafoil_data(t_lift, -aoa, thickness, camber);\n return result;\n }", "public static String generateNegativeConstraintsConjunct(GenerateCVC1 cvc, QueryBlockDetails queryBlock, Conjunct conjunct) throws Exception {\n\n\t\t\n\t\tString constraintString = \"\";\n\n\t\tconstraintString += \"%--------------------------------\\n%NEGATIVE CONSTRAINTS FOR THIS CONJUNCT\\n%---------------------------------------\\n\";\n\t\t\n\t\tVector<String> OrConstraints=new Vector<String>();\n\t\tVector<String> OrStringConstraints = new Vector<String>();\n\n\t\t/** Generate negative constraint for equivalence class.*/\n\t\t/**FIXME: Mahesh..Ask Amol why the below code and why cant't we use getconstraintsforequijoins()*/\n\t\tif(!conjunct.getEquivalenceClasses().isEmpty()){\n\n\t\t\t/**Get the equivalence classes*/\n\t\t\tVector<Vector<Node>> equivalenceClasses = conjunct.getEquivalenceClasses();\n\n\t\t\tfor(int i=0; i<equivalenceClasses.size(); i++){\t/** For each equivalence class list*/\n\n\t\t\t\t/**Get this equivalence */\n\t\t\t\tVector<Node> ec = equivalenceClasses.get(i);\n\n\t\t\t\t/**for each node in this equivalence*/\n\t\t\t\tfor(int j=0;j<ec.size(); j++)\n\t\t\t\t{\n\n\t\t\t\t\tNode eceNulled = ec.get(j);\t\t\t/** This is R.a - to be nulled */\n\n\n\t\t\t\t\tString CVCStr = \"%DataSet Generated By Nulling: \"+ ((Node)eceNulled).toString() + \"\\n\";\n\t\t\t\t\tTable tableNulled = eceNulled.getTable();\n\t\t\t\t\tColumn colNulled = eceNulled.getColumn();\n\n\t\t\t\t\t/** TODO: Have one vector for positive and negative conditions. */\n\n\t\t\t\t\tcvc.setResultsetTableColumns1( new HashMap<Table, Vector<String>>() );\t\t\t\t\t\n\n\t\t\t\t\t/** S = set of elements in ec which have a foreign key relationship with R.a <use closure for this> */\n\t\t\t\t\tArrayList<Node> S = new ArrayList<Node>();\n\t\t\t\t\tVector<Node> nullableFKs = new Vector<Node>();\n\t\t\t\t\tS.add(eceNulled);\n\n\t\t\t\t\tfor(int k=0; k<ec.size(); k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tNode ece = ec.get(k);\n\t\t\t\t\t\tTable tableEce = ece.getTable();\n\t\t\t\t\t\tColumn colEce = ece.getColumn();\n\t\t\t\t\t\t/**TODO Maintain a datasructure for list of PK and FK so as to compare in one pass.*/\n\t\t\t\t\t\tfor(int l=0; l < cvc.getForeignKeys().size(); l++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/**In ForeignKeys Left points to the foreign key attribute while the right points to the Primary or the referenced column*/\n\t\t\t\t\t\t\tNode fk = cvc.getForeignKeys().get(l);\n\n\t\t\t\t\t\t\t/**Adapted for Nullable foreign keys.\n\t\t\t\t\t\t\t *If FK is not nullable, then we need to null it along with the referenced relation which is eceNulled*/\n\t\t\t\t\t\t\tif( (fk.getLeft().getTable() == tableEce && fk.getLeft().getColumn() == colEce) \n\t\t\t\t\t\t\t\t\t&& (fk.getRight().getTable() == tableNulled && fk.getRight().getColumn() == colNulled)){\n\t\t\t\t\t\t\t\tif(!colEce.isNullable())\n\t\t\t\t\t\t\t\t\tS.add(ece);/**To be taken along with nulled Column*/\n\t\t\t\t\t\t\t\tif(colEce.isNullable())\n\t\t\t\t\t\t\t\t\tnullableFKs.add(ece);/** To be taken along with nulled column, in case P.size > 1 */\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Now, we have in S, the nulled column along with the foreign key columns in that equivalence class\n\t\t\t\t\t * that reference the nulled column and are not nullable.\n\t\t\t\t\t * But, if EC - S, contains a nullable column which references the nulled column, \n\t\t\t\t\t * AND also contains some other column which may or may not be nullable, \n\t\t\t\t\t * then we cannot assign NULL to the nullable FK column. We then need to nullify the nullable FK column\n\t\t\t\t\t * along with the nulled column. If EC - S, just contains a single nullable column referencing the \n\t\t\t\t\t * nulled column, then we can assign NULL to that column in order to nullify the nulled column. \n\t\t\t\t\t */\n\n\n\t\t\t\t\t/** Form P = EC - S */\n\t\t\t\t\tVector<Node> P = new Vector<Node>();\n\t\t\t\t\tfor(int k=0; k<ec.size(); k++)\t\t\t\t\t\t\n\t\t\t\t\t\tif( cvc.getqParser().alreadyNotExistInEquivalenceClass(S, ec.get(k)))\n\t\t\t\t\t\t\tP.add(ec.get(k));\n\n\n\t\t\t\t\tSystem.out.println(\"R.a = \"+eceNulled);\n\t\t\t\t\tSystem.out.print(\"EC : \"); Node.printPredicateVector(ec);\n\n\t\t\t\t\t/**For Now : if P is empty continue;*/\n\t\t\t\t\tif(P.size() == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif(P.size() == 1 \n\t\t\t\t\t\t\t&& P.get(0).getColumn().getReferenceColumn() == eceNulled.getColumn()\n\t\t\t\t\t\t\t&& P.get(0).getColumn().isNullable()){\n\n\t\t\t\t\t\t/**check if the column in P is referencing the nulled column and is nullable.\n\t\t\t\t\t\t *If so, then we can nullify the nulled relation inspite of the FK*/\n\t\t\t\t\t\tOrConstraints.add( GenerateCVCConstraintForNode.cvcSetNull(cvc, P.get(0).getColumn(), \"1\"));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t/**Otherwise, we need to nullify the foreign keys along with the nulled column.\n\t\t\t\t\t\t * Note that we need to do this irrespective of whether the column in P is FK \n\t\t\t\t\t\t * or whether it is nullable. Because, then we cannot assign NULL to any of the columns in P\n\t\t\t\t\t\t * This is because, NULLs cannot be equated and hence the joins in P will not be propogated up.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tP.removeAll(nullableFKs);\n\n\t\t\t\t\t\t/** Generate positiveConds for members in P*/ \n\t\t\t\t\t\tGenerateJoinPredicateConstraints.genPositiveConds(P);\n\t\t\t\t\t}\n\n\t\t\t\t\t/**Now generate negative conditions for Nulled relation\n\t\t\t\t\t *i.e. NOT EXISTS (i: Nulled Rel): NulledRel[i].col = P[1].col*/\n\t\t\t\t\tOrConstraints.add( GenerateJoinPredicateConstraints.genNegativeConds( cvc, queryBlock, colNulled, P.get(0)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\n\t\t/**Now generate Positive conditions for each of the non equi join conditions \n\t\t * that were not considered when building equivalence classes*/\n\t\tVector<Node> allConds = conjunct.getAllConds();\n\t\t\n\t\t/**get constraint*/\n\t\tString constraint = GenerateJoinPredicateConstraints.getNegativeConstraintsForNonEquiJoins(cvc, queryBlock, allConds) ;\n\n\t\tif( constraint.length() != 0)\n\t\t\tOrConstraints.add( constraint );\n\n\t\t/** Now generate Negative constraints for selection conditions */\n\t\tVector<Node> selectionConds = conjunct.getSelectionConds();\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeSelConds = GenerateCVCConstraintForNode.getNegativeConditions(selectionConds);\n\n\t\t/**Generate constraints for the negative conditions*/\n\t\tfor(int k = 0; k < negativeSelConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeSelConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l = 1; l <= count; l++)\n\t\t\t\tOrConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeSelConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\n\t\t/**Generate negative constraints for string selection conditions */\n\t\tVector<Node> stringSelectionConds = conjunct.getStringSelectionConds();\t\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeStringSelConds = GenerateCVCConstraintForNode.getNegativeConditions(stringSelectionConds);\n\n\t\t/**Generate constraints for the negative conditions*/\n\t\tfor(int k = 0; k < negativeStringSelConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeStringSelConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l = 1; l <= count; l++)\n\t\t\t\tOrStringConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeStringSelConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\t\t/**Generate negative constraints for like conditions */\n\t\tVector<Node> likeConds = conjunct.getLikeConds();\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeLikeConds = GenerateCVCConstraintForNode.getNegativeConditions(likeConds);\n\n\t\tfor(int k=0; k<likeConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeLikeConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l=1;l<=count;l++)\n\t\t\t\tOrStringConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeLikeConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\t\t/**get the where clause sub query conditions in this conjunct*/\n\t\tif(conjunct.getAllSubQueryConds() != null){\n\t\t\tfor(int i=0; i < conjunct.getAllSubQueryConds().size(); i++){\n\t\t\t\t\n\t\t\t\tNode subQ = conjunct.getAllSubQueryConds().get(i);\n\t\t\t\t\n\t\t\t\t/**FIXME: Add negative constraints for this where clause sub query block\n\t\t\t\t * We could use methods of class: GenerateConstraintsForWhereClauseSubQueryBlock*/\n\t\t\t\t/**FIXME:If the given conjunct has NOT EXISTS conditions, then negative of that becomes positive*/\n\t\t\t\tint index = UtilsRelatedToNode.getQueryIndexOfSubQNode(subQ);\n\n\t\t\t\t/**get sub query block*/\n\t\t\t\tQueryBlockDetails subQuery = queryBlock.getWhereClauseSubQueries().get(index);\n\t\t\t\t\n\t\t\t\tString negativeConstraint = \"\";\n\t\t\t\t\n\t\t\t\t/**if this sub query is of EXISTS Type*/\n\t\t\t\tif(subQ.getType().equals(Node.getExistsNodeType()) ){\n\t\t\t\t\t\n\t\t\t\t\tfor (Conjunct con: subQuery.getConjuncts())\n\t\t\t\t\t\tnegativeConstraint += generateNegativeConstraintsConjunct(cvc, subQuery, con);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**if sub query is of type NOT Exists*/\n\t\t\t\t/**We need to get positive constraints for this sub query*/\n\t\t\t\telse if ( subQ.getType().equals(Node.getNotExistsNodeType() ) ){\n\t\t\t\t\t\n\t\t\t\t\tfor (Conjunct con: subQuery.getConjuncts())\n\t\t\t\t\t\tnegativeConstraint += getConstraintsForConjuct(cvc, queryBlock, con);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\t/**get negative condition for this sub query node*/\n\t\t\t\t\tNode subQNegative = GenerateCVCConstraintForNode.getNegativeCondition(subQ);\n\t\t\t\t\t\n\t\t\t\t\t/**get negative constraints for where clause connective*/\t\t\t\t\t\n\t\t\t\t\tnegativeConstraint = GenerateConstraintsForWhereClauseSubQueryBlock.getConstraintsForWhereSubQueryConnective(cvc, queryBlock, subQNegative);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconstraintString += negativeConstraint;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!OrConstraints.isEmpty() && OrConstraints.size() != 0)\n\t\t\tconstraintString += processOrConstraints(OrConstraints);\n\t\tconstraintString += \"\\n%--------------------------------\\n%END OF NEGATIVE CONSTRAINTS FOR THIS CONJUNCT\\n%---------------------------------------\";\n\n\t\tif(!OrStringConstraints.isEmpty() && OrStringConstraints.size() != 0 )\n\t\t\tcvc.getStringConstraints().add(processOrConstraints(OrStringConstraints));\n\n\t\treturn constraintString;\n\t}", "private void addC1Constraints(GRBVar[][] xVars, GRBModel model) throws GRBException {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tString constraintName = \"constraintC1_\" + i;\n\t\t\t// out_x(i) - in_x(i) = 0\n\t\t\tGRBLinExpr constraintLinExpr = new GRBLinExpr();\n\n\t\t\t// Expression += out_x(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Expression -= in_x(i)\n\t\t\tGRBSolverUtils.addInTerm(i, -1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Add constraint\n\t\t\tmodel.addConstr(constraintLinExpr, GRB.EQUAL, 0, constraintName);\n\t\t}\n\t}", "private void generalizeCSARequirements(){\n\t\tArrayList<ServiceTemplate> comps = new ArrayList<ServiceTemplate>() ;\n\t\tArrayList<Requirement> reqs = new ArrayList<Requirement>() ;\n\t\t\n\t\tcomps = this.data.getServiceTemplates();\n\t\treqs = this.data.getRequirements();\n\t\t\n\t\tfor(ServiceTemplate c : comps){\n\t\t\tfor(Requirement r : reqs){\n\t\t\t\tRequirement temp = new Requirement();\n\t\t\t\ttry {\n\t\t\t\t\tBeanUtils.copyProperties(temp, r);\n\t\t\t\t\t//System.out.println(r.toString());\n\t\t\t\t\t//System.out.println(temp.toString());\n\t\t\t\t\tc.addReq(temp);\n\t\t\t\t} catch (IllegalAccessException | InvocationTargetException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@NotNull\n @Generated\n @Selector(\"needRulesVerdict\")\n public static native NEFilterNewFlowVerdict needRulesVerdict();", "@TaDaMethod(variablesToTrack = {\"ssn\", \"weekWage\", \"workWeeks\", \"ssn2\",\n\t\t\t\"capitalGains\", \"capitalLosses\", \"stockDividends\"}, \n\t\t\tcorrespondingDatabaseAttribute = {\"job.ssn\", \"job.WEEKWAGE\", \"job.WORKWEEKS\", \"investment.ssn\",\n\t\t\t\"investment.CAPITALGAINS\", \"investment.CAPITALLOSSES\", \"investment.STOCKDIVIDENDS\"})\n\tprivate void calculateSlopesAndIntercepts(){\n\t\tHashMap<Integer, Integer> ssnWeekWage = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnWorkWeeks = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnInvestmentIncome = new HashMap<Integer, Integer>();\n\t\t\n\t\ttry {\n\t\t\tstatement = Factory.getConnection().createStatement();\n\t results = statement.executeQuery(\"SELECT SSN, WEEKWAGE, WORKWEEKS from job\"); \n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"WEEKWAGE\") == null || results.getString(\"WORKWEEKS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn = results.getInt(\"SSN\");\n\t \tint weekWage = results.getInt(\"WEEKWAGE\");\n\t \tint workWeeks = results.getInt(\"WORKWEEKS\");\n\t \t\n\t \tssnWeekWage.put(ssn, weekWage);\n\t \tssnWorkWeeks.put(ssn, workWeeks);\n\t }\n\t \n\t results = statement.executeQuery(\"SELECT SSN, CAPITALGAINS, CAPITALLOSSES, STOCKDIVIDENDS from investment\");\n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"CAPITALGAINS\") == null || results.getString(\"CAPITALLOSSES\") == null || results.getString(\"STOCKDIVIDENDS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn2 = results.getInt(\"SSN\");\n\t \tint capitalGains = results.getInt(\"CAPITALGAINS\");\n\t \tint capitalLosses = results.getInt(\"CAPITALLOSSES\");\n\t \tint stockDividends = results.getInt(\"STOCKDIVIDENDS\");\n\t \tint investmentIncome = capitalGains + stockDividends + capitalLosses;\n\t \t\n\t \tssnInvestmentIncome.put(ssn2, investmentIncome);\n\t }\n\t \n\t // Calculate Cofficients\n\t // Build an array list of Work Weeks and an array list of Income;\n\t ArrayList<Integer> workWeeksList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeList = new ArrayList<Integer>();\n\t ArrayList<Integer> weeklyWageList = new ArrayList<Integer>();\n\t ArrayList<Integer> investmentList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeListForInvestment = new ArrayList<Integer>();\n\t \n\t for (Iterator<Integer> i = ssnWorkWeeks.keySet().iterator(); i.hasNext();){\n\t \tint SSNkey = (Integer) i.next();\n\t \tif(ssnWorkWeeks.get(SSNkey) != null && ssnWeekWage.get(SSNkey) != null){\n\t\t \tint workWeeks = (Integer) ssnWorkWeeks.get(SSNkey);\n\t\t \tint weekWage = (Integer) ssnWeekWage.get(SSNkey);\n\t\t \tif(workWeeks > 0 && weekWage > 0){\n\t\t \t\tworkWeeksList.add(workWeeks);\n\t\t\t \tincomeList.add(workWeeks * weekWage);\n\t\t\t \tweeklyWageList.add(weekWage);\n\t\t\t \tif(ssnInvestmentIncome.get(SSNkey) != null && ssnInvestmentIncome.get(SSNkey) != null){\n\t\t\t \t\tint investmentIncome = (Integer) ssnInvestmentIncome.get(SSNkey);\n\t\t\t \t\tinvestmentList.add(investmentIncome);\n\t\t\t \t\tincomeListForInvestment.add(workWeeks * weekWage);\n\t\t\t \t}\n\t\t \t}\n\t \t}\n\t }\n\t \n\t // Set the member variable for the cofficients for given Work Weeks find Income\n\t workWeeksFindIncome = new CalculateRegression().calculateRegressionNumbers(workWeeksList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given Weekly Wage find Income\n\t weeklyWageFindIncome = new CalculateRegression().calculateRegressionNumbers(weeklyWageList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given InvestmentIncome find Income \n\t investmentIncomeFindIncome = new CalculateRegression().calculateRegressionNumbers(investmentList,incomeListForInvestment);\n\t \n\t\t} catch (SQLException e) {\n\t while (e != null)\n\t {\n\t System.err.println(\"\\n----- SQLException -----\");\n\t System.err.println(\" SQL State: \" + e.getSQLState());\n\t System.err.println(\" Error Code: \" + e.getErrorCode());\n\t System.err.println(\" Message: \" + e.getMessage());\n\t // for stack traces, refer to derby.log or uncomment this:\n\t //e.printStackTrace(System.err);\n\t e = e.getNextException();\n\t }\n\t\t}\t\n\t\t\n\t}", "public void calculateCG() {\n\n\t\t//-------------------------------------------------------------\n\t\t// Lateral faces xCG calculation (LFR = Local Reference Frame):\n\t\tList<Double[]> xCGLateralFacesLFRList = new ArrayList<Double[]>();\n\t\t\n\t\tfor(int i=0; i<this._prismoidsLength.size(); i++) {\n\t\t\t\n\t\t\tDouble[] xCGLateralFacesLFR = new Double[4];\n\t\t\t\n\t\t\txCGLateralFacesLFR[0] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[1] = this._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[2] = this._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i+1).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[3] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFRList.add(xCGLateralFacesLFR);\n\t\t}\n\t\t\n\t\t//-------------------------------------------------------------\n\t\t// Calculation of the Xcg coordinates of each prismoid in wing LRF.\n\t\t\n\t\tList<Amount<Length>> xCGPrismoidsList = new ArrayList<Amount<Length>>();\n\t\t\n\t\tfor(int i=0; i<xCGLateralFacesLFRList.size(); i++) {\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseY = new double[2];\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseY = new double[2];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceSpanwiseX[0] = this._fuelTankStations.get(i).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseX[1] = this._fuelTankStations.get(i+1).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[0];\n\t\t\txCGSegmentOppositeFaceSpanwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i+1).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[2];\n\n\t\t\txCGSegmentOppositeFaceChordwiseX[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[3]; \n\t\t\txCGSegmentOppositeFaceChordwiseX[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[1];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceChordwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\txCGSegmentOppositeFaceChordwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ ((this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getSecondarySparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()));\n\n\t\t\t// check if the chordwise X array is monotonic increasing\n\t\t\tif(xCGSegmentOppositeFaceChordwiseX[1] - xCGSegmentOppositeFaceChordwiseX[0] < 0.0001)\n\t\t\t\txCGSegmentOppositeFaceChordwiseX[0] -= 0.0001; \n\t\t\t\n\t\t\t// now that the segments coordinates are calculated, we have to intersect these latter.\n\t\t\txCGPrismoidsList.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tMyMathUtils.getInterpolatedValue1DLinear(\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseX,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseY,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceChordwiseX[0]),\n\t\t\t\t\t\t\tSI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n xCG list = \" + xCGPrismoidsList);\n\t\t\n\t\t_xCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\tfor(int i=0; i<this._prismoidsVolumes.size(); i++)\n\t\t\t_xCGLRF = _xCGLRF.plus(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tthis._prismoidsVolumes.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t*xCGPrismoidsList.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t, SI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t_xCGLRF = _xCGLRF.divide(this._fuelVolume.divide(2).getEstimatedValue());\n\t\t_xCG = _xCGLRF.plus(_theWing.getXApexConstructionAxes());\n\t\t\n\t\t_yCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t_yCG = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\t_zCGLRF = _theWing.getTheBalanceManager().getCG().getZLRF();\n\t\t_zCG = _theWing.getTheBalanceManager().getCG().getZBRF();\n\t\t\n\t\t_cG = new CenterOfGravity();\n\t\t_cG.setX0(_theWing.getXApexConstructionAxes().to(SI.METER));\n\t\t_cG.setY0(_theWing.getYApexConstructionAxes().to(SI.METER));\n\t\t_cG.setZ0(_theWing.getZApexConstructionAxes().to(SI.METER));\n\t\t_cG.setXLRF(_xCGLRF.to(SI.METER));\n\t\t_cG.setYLRF(_yCGLRF.to(SI.METER));\n\t\t_cG.setZLRF(_zCGLRF.to(SI.METER));\n\t\t\n\t\t_cG.calculateCGinBRF(ComponentEnum.FUEL_TANK);\n\t\t\n\t}", "public JSONObject getCNForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n List<Object> cnData = accEntityGstDao.getCNDNWithInvoiceDetailsInSql(reqParams);\n List<Object> cnWithoutInventory = accEntityGstDao.getCNAgainstCustomer(reqParams);\n if (cnWithoutInventory != null && !cnWithoutInventory.isEmpty()) {\n cnData.addAll(cnWithoutInventory);\n }\n /**\n * Add data for Cash Sales refund \n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"paymententitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"paymententityValue\"));\n List<Object> refundlist = accEntityGstDao.getCashRefundWithInvoiceDetailsInSql(reqParams);\n if (refundlist != null && refundlist.size() > 0) {\n cnData.addAll(refundlist);\n } \n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n\n totalAmountCN = (Double) data[3];\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\",authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n jSONObject = accGSTReportService.getCreditNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n }\n return jSONObject;\n }", "private LinearAVF() {\n this.booleanValueFunctions = new EnumMap<>(Criterion.class);\n this.linearValueFunctions = new EnumMap<>(Criterion.class);\n this.reversedValueFunctions = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasBooleanDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n Arrays.stream(Criterion.values())\n .filter(c -> c.hasDoubleDomain())\n .forEach(c -> this.setInternalValueFunction(c));\n this.weight = new EnumMap<>(Criterion.class);\n Arrays.stream(Criterion.values()).forEach(criterion -> weight.put(criterion, 0.0d));\n }", "public org.drip.state.estimator.PredictorResponseWeightConstraint fundingForwardPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = forwardLabel();\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardFundingPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "public ConstraintChecker(\n\t\t\tArrayList<TimeSlot> cSlots, \n\t\t\tArrayList<TimeSlot> lSlots, \n\t\t\tArrayList<Pair<Course, Course>> notCompat,\n\t\t\tArrayList<Pair<Course, TimeSlot>> unWant,\n\t\t\tArrayList<Pair<Course, TimeSlot>> parts,\n\t\t\tArrayList<Triple<TimeSlot, Course, Integer>> pref,\n\t\t\tArrayList<Pair<Course, Course>> pair)\n\t\n\t{\n\t\tcourseSlots = cSlots;\n\t\tlabSlots = lSlots;\n\t\tnotCompatible = notCompat;\n\t\tunwanted = unWant;\n\t\tpartials = parts;\n\t\tpreferences = pref;\n\t\tpairs = pair;\n\t}", "public Activation_Linear_Range_0_1() {\r\n this.slope = new VDouble(new RealNumber(1), new VDoubleNoUpdate());\r\n this.c = new VDouble(new RealNumber(0), new VDoubleNoUpdate());\r\n }", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "private double calculateYearlyLoyaltyPoints(int year){\n \tLoyalty txnLoyalty = compositePOSTransaction.getLoyaltyCard();\n\t\tif (txnLoyalty == null){\n\t\t\treturn 0.0;\n\t\t}else if(!txnLoyalty.isYearlyComputed()){\n\t\t\treturn 0.0;\n\t\t}\n\t\t\n\t\tif(com.chelseasystems.cr.swing.CMSApplet.theAppMgr!=null &&\n \t\t\tcom.chelseasystems.cr.swing.CMSApplet.theAppMgr.getStateObject(\"THE_TXN\") != null){\n \t\t// this is an inquiry\n\t\t\tif (year == 0) {\n\t\t\t\treturn txnLoyalty.getCurrYearBalance();\n\t\t\t} else {\n\t\t\t\treturn txnLoyalty.getLastYearBalance();\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble loyaltyUsed = compositePOSTransaction.getUsedLoyaltyPoints();\n\t\tdouble points = compositePOSTransaction.getLoyaltyPoints();\n\n\t\tdouble currBal = txnLoyalty.getCurrBalance();\n\t\tdouble currYearBal = txnLoyalty.getCurrYearBalance();\n\t\tdouble lastYearBal = txnLoyalty.getLastYearBalance();\n\t\tif (loyaltyUsed > 0) {\n\t\t\tif (txnLoyalty.getLastYearBalance() < loyaltyUsed) {\n\t\t\t\tcurrYearBal = currYearBal - (loyaltyUsed - lastYearBal);\n\t\t\t\tlastYearBal = 0.0;\n\t\t\t} else {\n\t\t\t\tlastYearBal -= loyaltyUsed;\n\t\t\t}\n\t\t\tcurrBal -= loyaltyUsed;\n\t\t} else {\n\t\t\tcurrBal -= loyaltyUsed;\n\t\t\tcurrYearBal -= loyaltyUsed;\n\t\t}\n\n\t\tif (txnLoyalty.isYearlyComputed()) {\n\t\t\tcurrYearBal += points;\n\t\t} else {\n\t\t\tcurrYearBal = 0.0;\n\t\t\tlastYearBal = 0.0;\n\t\t}\n\n\t\tif (year == 0) {\n\t\t\treturn currYearBal;\n\t\t} else {\n\t\t\treturn lastYearBal;\n\t\t}\n }", "public ForwardRateVolatilitySurfaceCurvature() {\n\t\tsuper();\n\t}", "@Test\n public void presentValueCurveSensitivity() {\n final MultipleCurrencyParameterSensitivity pvpsDepositExact = PSC.calculateSensitivity(CPN_ON_COMPOUNDED, MULTICURVES,\n MULTICURVES.getAllNames());\n final MultipleCurrencyParameterSensitivity pvpsDepositFD = PSC_DSC_FD.calculateSensitivity(CPN_ON_COMPOUNDED, MULTICURVES);\n AssertSensitivityObjects.assertEquals(\"CouponONCompoundedDiscountingMethod: presentValueCurveSensitivity \", pvpsDepositExact,\n pvpsDepositFD, TOLERANCE_PV_DELTA);\n }", "public org.drip.quant.calculus.WengertJacobian jackDDirtyPVDManifestMeasure (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t{\n\t\tif (null == valParams || valParams.valueDate() >= maturity().julian() || null == csqs) return null;\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState (fundingLabel());\n\n\t\tif (null == dcFunding) return null;\n\n\t\ttry {\n\t\t\torg.drip.quant.calculus.WengertJacobian jackDDirtyPVDManifestMeasure = null;\n\n\t\t\tfor (org.drip.analytics.cashflow.CompositePeriod p : _lsPeriod) {\n\t\t\t\tint iPeriodPayDate = p.payDate();\n\n\t\t\t\tif (p.startDate() < valParams.valueDate()) continue;\n\n\t\t\t\torg.drip.quant.calculus.WengertJacobian jackDDFDManifestMeasure =\n\t\t\t\t\tdcFunding.jackDDFDManifestMeasure (iPeriodPayDate, \"PV\");\n\n\t\t\t\tif (null == jackDDFDManifestMeasure) continue;\n\n\t\t\t\tint iNumQuote = jackDDFDManifestMeasure.numParameters();\n\n\t\t\t\tif (0 == iNumQuote) continue;\n\n\t\t\t\tif (null == jackDDirtyPVDManifestMeasure)\n\t\t\t\t\tjackDDirtyPVDManifestMeasure = new org.drip.quant.calculus.WengertJacobian (1,\n\t\t\t\t\t\tiNumQuote);\n\n\t\t\t\tdouble dblPeriodNotional = p.notional (p.startDate(), p.endDate()) * p.fx (csqs);\n\n\t\t\t\tdouble dblPeriodDCF = p.couponMetrics (valParams.valueDate(), csqs).dcf();\n\n\t\t\t\tfor (int k = 0; k < iNumQuote; ++k) {\n\t\t\t\t\tif (!jackDDirtyPVDManifestMeasure.accumulatePartialFirstDerivative (0, k,\n\t\t\t\t\t\tdblPeriodNotional * dblPeriodDCF * jackDDFDManifestMeasure.firstDerivative (0, k)))\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn jackDDirtyPVDManifestMeasure;\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "private void convertReqsInCriterions(){\n\t\tArrayList<Criterion> criteria = this.data.getCriteria();\n\t\t\n\t\tfor(Requirement req : this.data.getRequirements()){\n\t\t\tif(req.isCriterion()){\n\t\t\t\t//create new criterion\n\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\telse\n\t\t\t\t\t//this is a price requirement\n\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\n\t\t\t\tString[] msg = {crit.getName(), \"General\"};\n\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t}\n\t\t\t\t//get the criterion preference direction\n\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcriteria.add(crit);\n\t\t\t}\n\t\t}\n\t\tthis.data.setCriteria(criteria);\n\t\t\n\t\t//convert each serpiceTemplate requirements\n\t\tfor(ServiceTemplate template : this.data.getServiceTemplates()){\n\t\t\tArrayList<Criterion> templateCriteria = template.getCriteria();\n\t\t\tfor(Requirement req: template.getRequirements()){\n\t\t\t\tif(req.isCriterion()){\n\t\t\t\t\t//create new criterion\n\t\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\t\telse\n\t\t\t\t\t\t//this is a price requirement\n\t\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\t\n\t\t\t\t\tString[] msg = {crit.getName(), template.getType()};\n\t\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//get the criterion preference direction\n\t\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\ttemplateCriteria.add(crit);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemplate.setCriteria(templateCriteria);\n\t\t}\n\t}", "JsonObjectBuilder evelThresholdCrossingObject()\r\n\t {\r\n\t double version = major_version+(double)minor_version/10;\r\n\r\n\t EVEL_ENTER();\r\n\t \r\n\r\n\t /***************************************************************************/\r\n\t /* Check preconditions. */\r\n\t /***************************************************************************/\r\n\t assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_THRESHOLD_CROSSING);\r\n\r\n\t /***************************************************************************/\r\n\t /* Mandatory fields. */\r\n\t /***************************************************************************/\r\n\t //encode counter\r\n JsonObjectBuilder counterobj = Json.createObjectBuilder()\r\n .add( \"criticality\",additionalParameters.criticality)\r\n .add( \"name\", additionalParameters.name)\r\n .add( \"thresholdCrossed\",additionalParameters.thresholdCrossed)\r\n .add( \"value\", additionalParameters.value);\r\n\r\n\t \r\n\t JsonObjectBuilder evelrep = Json.createObjectBuilder()\r\n\t \t\t .add(\"additionalParameters\", counterobj)\r\n\t \t .add(\"alertAction\", alertAction.toString())\r\n\t \t .add(\"alertDescription\", alertDescription)\r\n .add(\"alertType\", alertType.toString())\r\n .add(\"collectionTimestamp\", collectionTimestamp.toString())\r\n .add(\"eventSeverity\",eventSeverity.toString())\r\n .add(\"eventStartTimestamp\",eventStartTimestamp.toString());\r\n\r\n\t /***************************************************************************/\r\n\t /* Optional fields. */\r\n\t /***************************************************************************/\r\n\t alertValue.encJsonValue(evelrep, \"alertValue\");\r\n\t if( alertidList != null && alertidList.size() > 0)\r\n\t {\r\n\t\t JsonArrayBuilder builder = Json.createArrayBuilder();\r\n\t\t for(int i=0;i<alertidList.size();i++) {\r\n\t\t\t String addl_info = alertidList.get(i);\r\n\t\t\t JsonObject obj = Json.createObjectBuilder()\r\n\t\t\t \t .add(\"item\",addl_info).build();\r\n\t\t\t builder.add(obj);\r\n\t\t }\r\n\t\t\tevelrep.add(\"associatedAlertIdList\", builder);\r\n\t }\r\n\r\n\t dataCollector.encJsonValue(evelrep, \"dataCollector\");\r\n\t elementType.encJsonValue(evelrep, \"elementType\");\r\n\t interfaceName.encJsonValue(evelrep, \"interfaceName\");\r\n\t networkService.encJsonValue(evelrep, \"networkService\");\r\n\t possibleRootCause.encJsonValue(evelrep, \"possibleRootCause\");\r\n\r\n\t \r\n\t evelrep.add( \"thresholdCrossingFieldsVersion\", version);\r\n\r\n\t if( additional_info != null )\r\n\t {\r\n\t JsonArrayBuilder builder = Json.createArrayBuilder();\r\n\t for(int i=0;i<additional_info.size();i++) {\r\n\t\t String[] addl_info = additional_info.get(i);\r\n\t\t JsonObject obj = Json.createObjectBuilder()\r\n\t\t \t .add(\"name\", addl_info[0])\r\n\t\t \t .add(\"value\", addl_info[1]).build();\r\n\t\t builder.add(obj);\r\n\t }\r\n\t\tevelrep.add(\"additionalFields\", builder);\r\n\t }\r\n\r\n\r\n\t EVEL_EXIT();\r\n\t \r\n\t return evelrep;\r\n\t}", "@Test\r\n\tpublic void testGetPlannedCapacity_Nonlinear_Interval() {\n\t\tassertEquals(0, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 0), 0);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\r\n\t\tassertEquals(0, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 0, 0), 0);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\r\n\t\t\r\n\t}", "protected void createMimoentslotconstraintsAnnotations() {\n\t\tString source = \"mimo-ent-slot-constraints\";\n\t\taddAnnotation\n\t\t (getInvoice_InvoiceStatuses(),\n\t\t source,\n\t\t new String[] {\n\t\t\t \"statusDate\", \"*NOW\"\n\t\t });\n\t}", "public double calculateCriticalValue(Dot previous, Dot next){\n double d12 = Math.sqrt(Math.pow(this.x - previous.x, 2) + Math.pow(this.y - previous.y, 2));\n double d23 = Math.sqrt(Math.pow(next.x - this.x, 2) + Math.pow(next.y - this.y, 2));\n double d13 = Math.sqrt(Math.pow(next.x - previous.x, 2) + Math.pow(next.y - previous.y, 2));\n\n criticalValue = d12 + d23 - d13;\n return criticalValue;\n }", "public static void model1() {\n try {\n IloCplex cplex = new IloCplex();\n \n //variables\n IloNumVar x = cplex.numVar(0, Double.MAX_VALUE, \"x\"); //x >= 0\n IloNumVar y = cplex.numVar(0, Double.MAX_VALUE, \"y\"); //y >= 0\n \n //expressions\n IloLinearNumExpr objective = cplex.linearNumExpr();\n objective.addTerm(0.12, x);\n objective.addTerm(0.15, y);\n \n //define objective\n cplex.addMinimize(objective);\n \n //define constraints\n cplex.addGe(cplex.sum(cplex.prod(60, x), cplex.prod(60, y)), 300);\n cplex.addGe(cplex.sum(cplex.prod(12, x), cplex.prod(6, y)), 36);\n cplex.addGe(cplex.sum(cplex.prod(10, x), cplex.prod(30, y)), 90);\n \n //solve\n if (cplex.solve()) {\n System.out.println(\"Obj = \" + cplex.getObjValue());\n System.out.println(\"Obj = \" + cplex.getValue(objective));\n System.out.println(\"x = \" + cplex.getValue(x));\n System.out.println(\"y = \" + cplex.getValue(y));\n } else {\n System.out.println(\"Solution not found.\");\n }\n } catch (IloException ex) {\n ex.printStackTrace();\n }\n }", "public CXLContract(double cededPremiumFixed, double attachmentPoint, double limit, double aggregateDeductible,\n double aggregateLimit, IStabilizationStrategy stabilization,\n List<Double> reinstatementPremiumFactors, IRIPremiumSplitStrategy riPremiumSplit,\n IBoundaryIndexStrategy boundaryIndex, List<FactorsPacket> factors, IPeriodCounter periodCounter) {\n super(cededPremiumFixed, attachmentPoint, limit, aggregateDeductible, aggregateLimit, stabilization,\n reinstatementPremiumFactors, riPremiumSplit, boundaryIndex, factors, periodCounter);\n }", "protected void addConstraints() throws IloException {\n// Constrain (2)\n for (int i = 0; i < m; i++) {\n IloLinearNumExpr expr_2 = model.linearNumExpr();\n for (int j = 0; j < n; j++) {\n expr_2.addTerm(x[i][j], 1);\n }\n model.addLe(expr_2, supply[i]);\n }\n\n // Constrain (3)\n for (int j = 0; j < n; j++) {\n IloLinearNumExpr expr_3 = model.linearNumExpr();\n for (int i = 0; i < m; i++) {\n expr_3.addTerm(x[i][j], 1);\n }\n model.addEq(expr_3, demands[j]);\n }\n }", "@Test\r\n\tpublic void testFillChargingPlan_Nonlinear_HighInitialSoC() {\n\t\tdouble initialSoC = 0.99;\r\n\t\tint startTimeSeconds = 0;\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\tdouble desiredCapacity = car.getMissingCapacity();\r\n\t\t\r\n\t\t\r\n\t\t// Nonlinear\r\n\t\tcar.setCurrentPlan(new double[96]);\r\n\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 95, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\tstartTimeSeconds);\r\n\t\t\r\n\t\t//System.out.println(Arrays.toString(car.getCurrentPlan()));\r\n\t\t//System.out.println(schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds));\r\n\t\t\r\n\t\tassertEquals(car.getMissingCapacity(), schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-8);\r\n\t\t\r\n\t}", "protected <E> List<E> LeastConstrainingValue(CSP<E> csp, String var){\r\n\t\tList<String> neighbores = new ArrayList<String>();\r\n\t\tfor(Constraint i:csp.constraints) {\r\n\t\t\tList<String> constraint = i.getScope();\r\n\t\t\tfor(String j:constraint){\r\n\t\t\t\tif(j.equals(var)) {\r\n\t\t\t\t\tneighbores.addAll(constraint);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tHashMap<E, Integer> affected = new HashMap<E, Integer>();\r\n\t\tfor(int value=0; value<csp.domains.get(var).size();value++) {\r\n\t\t\tint sum=0;\r\n\t\t\tfor(String i:neighbores){\r\n\t\t\t\tif(!i.equals(var)){\r\n\t\t\t\t\tList<E> domain=csp.domains.get(i);\r\n\t\t\t\t\tfor(E j:domain){\r\n\t\t\t\t\t\tif(j.equals(value)){\r\n\t\t\t\t\t\t\tsum++;\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\taffected.put(csp.domains.get(var).get(value),sum);\r\n\t\t}\r\n\t\tList<E> values = new ArrayList<E>();\r\n\t\tEntry<E, Integer> pos = null;\r\n\t\twhile(values.size()<affected.size()){\r\n\t\t\tint min=1000;\r\n\t\t\tfor (Entry<E, Integer> i:affected.entrySet()) {\r\n\t\t\t\tif(i.getValue()<min) {\r\n\t\t\t\t\tmin=i.getValue();\r\n\t\t\t\t\tpos=i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvalues.add(pos.getKey());\r\n\t\t\taffected.put(pos.getKey(),1000);\r\n\t\t}\r\n\t\t\r\n\t\treturn values;\r\n\t}", "public JSONObject getDNAgainstSalesForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n List<Object> cnData = accEntityGstDao.getDNAgainstCustomer(reqParams);\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n\n totalAmountCN = (Double) data[3];\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\",authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n reqParams.put(\"isDebitNoteTransaction\", true);\n jSONObject = accGSTReportService.getCreditNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n reqParams.remove(\"isDebitNoteTransaction\");\n }\n return jSONObject;\n }", "public BigDecimal getLBR_LatePaymentPenaltyAP();", "public org.drip.state.estimator.PredictorResponseWeightConstraint forwardPRWC (\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp,\n\t\tfinal org.drip.product.calib.ProductQuoteSet pqs)\n\t{\n\t\tif (null == valParams || null == pqs) return null;\n\n\t\torg.drip.state.identifier.FloaterLabel floaterLabel = floaterLabel();\n\n\t\torg.drip.state.identifier.ForwardLabel forwardLabel = null != floaterLabel && floaterLabel instanceof\n\t\t\torg.drip.state.identifier.ForwardLabel ? (org.drip.state.identifier.ForwardLabel) floaterLabel :\n\t\t\t\tnull;\n\n\t\tif ((null != forwardLabel && !(pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet)) ||\n\t\t\t(null == forwardLabel && !(pqs instanceof org.drip.product.calib.FixedStreamQuoteSet)))\n\t\t\treturn null;\n\n\t\tint iValueDate = valParams.valueDate();\n\n\t\tif (iValueDate >= maturity().julian()) return null;\n\n\t\tdouble dblCleanPV = 0.;\n\n\t\ttry {\n\t\t\tif (pqs instanceof org.drip.product.calib.FloatingStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FloatingStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FloatingStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t} else if (pqs instanceof org.drip.product.calib.FixedStreamQuoteSet) {\n\t\t\t\torg.drip.product.calib.FixedStreamQuoteSet fsqs =\n\t\t\t\t\t(org.drip.product.calib.FixedStreamQuoteSet) pqs;\n\n\t\t\t\tif (fsqs.containsPV()) dblCleanPV = fsqs.pv();\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwc = new\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint();\n\n\t\tfor (org.drip.analytics.cashflow.CompositePeriod period : _lsPeriod) {\n\t\t\tint iPeriodEndDate = period.endDate();\n\n\t\t\tif (iPeriodEndDate < iValueDate) continue;\n\n\t\t\torg.drip.state.estimator.PredictorResponseWeightConstraint prwcPeriod = period.forwardPRWC\n\t\t\t\t(iValueDate, csqs, pqs);\n\n\t\t\tif (null == prwcPeriod || !prwc.absorb (prwcPeriod)) return null;\n\t\t}\n\n\t\tif (!prwc.updateValue (dblCleanPV)) return null;\n\n\t\tif (!prwc.updateDValueDManifestMeasure (\"PV\", 1.)) return null;\n\n\t\treturn prwc;\n\t}", "private static double ct(double W, double Vr, double V){\n\t\t/*\n\t\t//declaring constants\n\t\tdouble A0 = 0.5766; \n\t\tdouble A1 = 1.9169;\n\t\tdouble A2 = -1.0712;\n\t\tdouble A3 = 1.6898;\n\t\t\n\t\tdouble aW = a/W;\n\t\tdouble Eqn1 = A0 + (A1*aW) + (A2*(aW*aW)) + (A3*(aW*aW*aW));\n\t\t//I don't know if they need to be able to see what the reference voltage is\n\t\tdouble Vr = initialV/Eqn1;\n\t\t*/\n\t\t//declaring constants\n\t\tdouble B0 = -0.5051;\n\t\tdouble B1 = 0.8857; \n\t\tdouble B2 = -0.1398;\n\t\tdouble B3 = 0.0002398;\n\t\t\n\t\tdouble VVr = V/Vr;\n\t\tdouble Eqn2 = B0 + (B1*VVr) + (B2*(VVr*VVr)) + (B3*(VVr*VVr*VVr));\n\t\t//crack size, A calculated for any voltage\n\t\tdouble A = Eqn2 * W;\n\t\treturn A;\n\t\t\n\t}", "public abstract ArrayList< Double > getObjectiveCoefs();", "public double getCoveredSlipAnnualLease(){//added by Nathalie\n double annualLeaseAmount = COVERED_SLIP_BY_LINEAR_FOOT * lenght;\n return annualLeaseAmount;\n }", "private void NoAirResistanceCalculator(double velocity, double launchAngle)\n\t{\n\t\t/*\n\t\t * Convert launch angle from degrees into radians\n\t\t * Convert velocity from mph to fps\n\t\t * Convert gravity to fps\n\t\t */\n\t\tlaunchAngle = (launchAngle * (Math.PI)) / 180;\n\t\tvelocity = velocity * 1.46667;\n\t\tgravity = gravity * 3.28084;\n\n\t\t// Calculate when the ball hits the ground\n\t\ttimeBallHitsGround = (2 * velocity * Math.sin(launchAngle)) / gravity;\n\n\t\t// Calculate max height (velocity_f = 0)\n\t\tmaxHeightTime = (velocity * Math.sin(launchAngle)) / gravity;\n\t\tmaxHeight = strikeHeight + (velocity * Math.sin(launchAngle) * maxHeightTime) - ((.5 * gravity) * (maxHeightTime * maxHeightTime));\n\n\t\t// Y Position: y = y_0 + (v_y)t + .5(-9.8)(t^2), v_y = (v_0)sin(theta)\n\t\tfor(double t = 0; t <= timeBallHitsGround + .1; t = t + timeIncrement)\n\t\t{\n\t\t\t// Math for y(t) position\n\t\t\tyPos = (velocity * Math.sin(launchAngle) * t) - ((.5 * gravity) * (t * t));\n\n\t\t\t// Add y position and time\n\t\t\tyPosList.add(yPos + strikeHeight);\n\t\t\ttimeList.add(t);\n\n\t\t}\n\n\t\t// X Position: x = x_0 + (v_x)t, v_x = (v_0)cos(theta)\n\t\tfor(int i = 0; i < timeList.size(); i++)\n\t\t{\n\t\t\t// Math for x(t) position\n\t\t\txPos = (velocity * Math.cos(launchAngle) * timeList.get(i));\n\n\t\t\t// Add x position\n\t\t\txPosList.add(xPos);\n\t\t}\n\t}", "private double GetMCRTrainSet() \n\t{\n\t\tint numErrors = 0;\n\t\t\n\t\tfor(int i = 0; i < ITrain; i++)\n\t\t{\n\t\t\tPreCompute(i);\n\t\t\t\n\t\t\tdouble max_Y_hat_ic = Double.MIN_VALUE;\n\t\t\tint label_i = -1; \n\t\t\t\n\t\t\tfor(int c = 0; c < C; c++)\n\t\t\t{\n\t\t\t\tdouble Y_hat_ic = Predict(i, c); \n\t\t\t\t\n\n\t\t\t\tif(lossType == LossTypes.LOGISTIC)\n\t\t\t\t\tY_hat_ic = Sigmoid.Calculate(Y_hat_ic);\n\t\t\t\t\n\t\t\t\tif(Y_hat_ic > max_Y_hat_ic)\n\t\t\t\t{\n\t\t\t\t\tmax_Y_hat_ic = Y_hat_ic; \n\t\t\t\t\tlabel_i = (int)Math.ceil(c);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif( nominalLabels.indexOf(Y.get(i)) != label_i ) \n\t\t\t\tnumErrors++;\n\t\t}\n\t\t\n\t\treturn (double)numErrors/(double)ITrain;\n\t}", "@Test\r\n\tpublic void testFillChargingPlan_Linear_HighInitialSoC() {\n\t\tdouble initialSoC = 0.9;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\tdouble desiredCapacity = car.getMissingCapacity();\r\n\t\t\r\n\t\t// Linear\r\n\t\tcar.setCurrentPlan(new double[96]);\r\n\t\tschedulerLinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 95, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\tstartTimeSeconds);\r\n\t\t\r\n\t\t\r\n\t\t//System.out.println(\"DesiredCapactiy: \" + desiredCapacity);\r\n\t\t//System.out.println(\"Planned capacity: \" + schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds));\r\n\t\t//System.out.println(Arrays.toString(car.getCurrentPlan()));\r\n\t\t\r\n\r\n\t\tassertTrue(car.getCurrentPlan()[0] > 0);\r\n\t\tassertEquals(car.getMissingCapacity(), schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-6);\r\n\t}", "void getCirculation (double effaoa, double thickness_pst, double camber_pst) { \n double beta;\n double th_abs = thickness_pst/100.0; \n xcval = 0.0;\n ycval = camber_pst/50; // was: current_part.camber/25/2\n\n if (current_part.foil == FOIL_CYLINDER || /* get circulation for rotating cylnder */\n current_part.foil == FOIL_BALL) { /* get circulation for rotating ball */\n rval = radius/lconv;\n gamval = 4.0 * Math.PI * Math.PI *spin * rval * rval\n / (velocity/vconv);\n gamval = gamval * spindr;\n ycval = .0001;\n } else {\n rval = th_abs + Math.sqrt((current_part.foil == FOIL_FLAT_PLATE\n ? 0 : th_abs*th_abs)\n + ycval*ycval + 1.0);\n xcval = current_part.foil == FOIL_JOUKOWSKI ? 0 : (1.0 - Math.sqrt(rval*rval - ycval*ycval));\n beta = Math.asin(ycval/rval)/convdr; /* Kutta condition */\n gamval = 2.0*rval*Math.sin((effaoa+beta)*convdr);\n }\n }", "public void computePenalty(double[] betas, double[] hyperparameters) {\n penalty = 0.0;\n\n double lambda = 0.0;\n\n for (int j = 0; j < betas.length; j++) {\n lambda = Math.sqrt(hyperparameters[j]);\n penalty += (Math.log(2) - Math.log(lambda) +\n (lambda * Math.abs(betas[j])));\n }\n\n penalty = 0 - penalty;\n }", "public void FVA( ArrayList< Double > objCoefs, Double objVal, ArrayList< Double > fbasoln, ArrayList< Double > min, ArrayList< Double > max, SolverComponent component ) throws Exception;", "private void checkForNewAppliancesAndUpdateConstants()\n\t{\n\t\t// This could be more sophisticated, but for now all this needs to do is\n\t\t// make sure that\n\t\t// the wattbox assigns load only according to the rated heat pump and\n\t\t// immersion capacity\n\t\t// of its owner\n\t\tthis.maxHeatPumpElecDemandPerTick = (this.owner.ratedPowerHeatPump * 24 / this.ticksPerDay);\n\t\tthis.maxImmersionHeatPerTick = Consts.MAX_DOMESTIC_IMMERSION_POWER * 24 / this.ticksPerDay;\n\t}", "private String E19Conditions() {\n StringBuilder buffer = new StringBuilder();\n int numCols = 60;\n int leftMargin = 17;\n String tmp1 = \" \";\n String tmp2 = \" \";\n String tmp3 = \" \";\n String indent = \"\";\n for (int i = 0; i < leftMargin; i++) {\n indent = indent.concat(\" \");\n }\n buffer.append(\"\\f\");\n buffer.append(TextReportConstants.E19_HDR_CONDITIONS + \"\\n\\n\");\n\n TextReportData data = TextReportDataManager.getInstance()\n .getDataForReports(lid, 0);\n\n if (data.getRiverstat().getMile() != HydroConstants.MISSING_VALUE) {\n tmp1 = String.format(\"%-6.1f\", data.getRiverstat().getMile());\n }\n if (data.getRiverstat().getDa() != HydroConstants.MISSING_VALUE) {\n tmp2 = String.format(\"%-6.1f\", data.getRiverstat().getDa());\n }\n if (data.getRiverstat().getPool() != HydroConstants.MISSING_VALUE) {\n tmp3 = String.format(\"%-6.1f\", data.getRiverstat().getPool());\n }\n\n buffer.append(String.format(\n \" MILES ABOVE MOUTH: %s%sDRAINAGE AREA: %s%sPOOL STAGE: %s\",\n tmp1, \" \", tmp2, \" \", tmp3));\n buffer.append(\"\\n\\n\\n\");\n\n buffer.append(\" STREAM BED: \");\n\n if (data.getDescrip().getBed() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getBed(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REACH: \");\n if (data.getDescrip().getReach() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getReach(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REGULATION: \");\n if (data.getDescrip().getRes() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getRes(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" DIVERSION: \");\n if (data.getDescrip().getDivert() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getDivert(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" WINTER: \");\n if (data.getDescrip().getIce() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getIce(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" TOPOGRAPHY: \");\n if (data.getDescrip().getTopo() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getTopo(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n buffer.append(\" REMARKS: \");\n if (data.getDescrip().getRemark() != null) {\n String[] lines = TextUtil.wordWrap(data.getDescrip().getRemark(),\n numCols, 0);\n buffer.append(lines[0] + \"\\n\");\n for (int i = 1; i < lines.length; i++) {\n if ((i != (lines.length - 1))\n && (!lines[i].trim().equalsIgnoreCase(\"\"))) {\n buffer.append(\" \" + lines[i] + \"\\n\");\n }\n }\n } else {\n buffer.append(\"\\n\");\n }\n buffer.append(\"\\n\");\n\n // try to place FOOTER at the bottom\n buffer.append(advanceToFooter(0, buffer.toString()));\n\n Date d = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\")).getTime();\n String footer = createFooter(data, E19_RREVISE_TYPE, sdf.format(d),\n \"NWS FORM E-19\", E19_CONDITIONS, \"CONDITIONS\", null,\n E19_STANDARD_LEFT_MARGIN);\n buffer.append(footer);\n\n return buffer.toString();\n }", "Solution computeChange(Cash cashAvailable, int changeAmount);", "@Override\n\tprotected double getAdditionalUsageLosses(final IInternalParameters parameters,\n\t\t\tfinal IEnergyState state) {\n\t\tfinal IConstants constants = parameters.getConstants();\n\t\tif (getStore().getVolume() >= constants.get(HeatingSystemConstants.STORAGE_COMBI_VOLUME_THRESHOLD)) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tfinal double A = constants.get(HeatingSystemConstants.STORAGE_COMBI_LOSS_TERMS, 0);\n\n\t\t\tfinal double volumeDemanded = state.getTotalDemand(EnergyType.DemandsHOT_WATER_VOLUME);\n\n\t\t\tfinal double fu =\n\t\t\tMath.min(1.0d,\n\t\t\t\t\tvolumeDemanded\n\t\t\t\t\t/\n\t\t\t\t\tconstants.get(HeatingSystemConstants.COMBI_HOT_WATER_USAGE_LIMIT));\n\n\t\t\tfinal double B = getStore().getVolume() - constants.get(HeatingSystemConstants.STORAGE_COMBI_LOSS_TERMS, 1);\n\n\t\t\tfinal double combiLosses = fu * (A - B * constants.get(HeatingSystemConstants.STORAGE_COMBI_LOSS_TERMS, 2));\n\t\t\treturn combiLosses;\n\t\t}\n\t}", "public double calculateObservedDisagreement();", "public ModelParams optimize() throws Exception {\n\t\tint iterCount = 0;\n\t\tdivergence = KLDivergenceCalculator.calculate(cState, tState);\n\t\tSystem.out.println(\"KL Divergence : \" + divergence);\n\t\t// ((DivergenceChart) BeanFinder\n\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t// iterCount, divergence);\n\t\tdouble delta[] = null;\n\t\tdouble theta[] = data.getParams().getParams();\n\t\tdouble newDivergence = 0.0d;\n\t\tdouble initialStep = data.getInitialStepSize();\n\t\tboolean optimized = false;\n\t\tdo {\n\t\t\tdelta = computeGradient(theta);\n\t\t\tfor (double step = initialStep; iterCount < data.getMaxIterations(); step /= 10) {\n\t\t\t\tSystem.out.println(\"Step size : \" + step);\n\t\t\t\tSystem.out.println(\"KL divergence before taking a step : \"\n\t\t\t\t\t\t+ KLDivergenceCalculator.calculate(cState, tState));\n\t\t\t\tfor (int i = 0; i < delta.length; i++) {\n\t\t\t\t\tif (Double.isNaN(delta[i]))\n\t\t\t\t\t\tSystem.out.print(\"delta is NAN!!\" + delta[i] + \", \");\n\t\t\t\t\ttheta[i] -= step * delta[i];\n\t\t\t\t\tSystem.out.print((theta[i]) + \", \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t\tgetNewState(theta);\n\t\t\t\titerCount++;\n\t\t\t\tnewDivergence = KLDivergenceCalculator\n\t\t\t\t\t\t.calculate(cState, tState);\n\t\t\t\tSystem.out.println(\"KL Divergence : \" + newDivergence);\n\t\t\t\t// ((DivergenceChart) BeanFinder\n\t\t\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t\t\t// iterCount, newDivergence);\n\t\t\t\tif (newDivergence < divergence) {\n\t\t\t\t\tdivergence = newDivergence;\n\t\t\t\t\tinitialStep = step;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// before taking the next step size, reset theta to what it was\n\t\t\t\tfor (int i = 0; i < delta.length; i++)\n\t\t\t\t\ttheta[i] += step * delta[i];\n\t\t\t\tgetNewState(theta); // Added for checking. Not required.\n\t\t\t}\n\t\t\toptimized = optimized(theta);\n\t\t} while (!optimized && iterCount < data.getMaxIterations());\n\t\tModelParams optimParams = null;\n\t\tif (optimized) {\n\t\t\toptimParams = new ModelParams();\n\t\t\toptimParams.setParams(theta);\n\t\t}\n\t\treturn optimParams;\n\t}", "@DISPID(1610940427) //= 0x6005000b. The runtime will prefer the VTID if present\n @VTID(33)\n Constraints constraints();", "public void learnVector(final Calendar when, final List<Double> vals);", "private void initializeAndTrainModel(float alpha) {\n\n double forecast;\n double lastValue = actual[0];\n double[][] trainMatrix = new double[trainPoints][2];\n double[][] valMatrix = new double[validationPoints][2];\n\n for (int i = 1; i < trainPoints; i++) {\n forecast = lastValue;\n\n trainMatrix[i][0] = actual[i];\n trainMatrix[i][1] = forecast;\n lastValue = (alpha * actual[i]) + ((1 - alpha) * lastValue);\n }\n\n for (int t = 1; t <= validationPoints; t++) {\n valMatrix[t - 1][1] = lastValue;\n valMatrix[t - 1][0] = actual[trainPoints + t - 1];\n }\n\n\n double biasness = BiasnessHandler.handle(valMatrix);\n AccuracyIndicators AI = new AccuracyIndicators();\n ModelUtil.computeAccuracyIndicators(AI, trainMatrix, valMatrix, dof);\n AI.setBias(biasness);\n if (min_val_error >= AI.getMAPE()) {\n min_val_error = AI.getMAPE();\n optAlpha = alpha;\n accuracyIndicators = AI;\n }\n }", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "public JSONObject getDNForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n List<Object> cnData = new ArrayList();\n if (!reqParams.optBoolean(\"onlycnagainstvendor\", false)) {\n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n cnData = gstr2Dao.getCNDNWithInvoiceDetailsInSql(reqParams);\n if (reqParams.has(\"zerorated\")) {\n reqParams.remove(\"zerorated\");\n }\n List<Object> cnDataWithoutInventory = gstr2Dao.getDNAgainstVendor(reqParams);\n if (cnDataWithoutInventory != null && !cnDataWithoutInventory.isEmpty()) {\n cnData.addAll(cnDataWithoutInventory);\n }\n }\n reqParams.put(\"isDebitNoteTransaction\", true);\n if (reqParams.has(\"cnentitycolnum\") && reqParams.has(\"cnentityValue\")) {\n /**\n * Return CN against vendors\n */\n if (reqParams.optBoolean(\"onlycnagainstvendor\", false)) {\n cnData.clear();\n reqParams.put(\"isDebitNoteTransaction\", false);\n }\n reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n List<Object> dnAgainstCustomer = gstr2Dao.getCNAgainstVendor(reqParams);\n if (dnAgainstCustomer != null) {\n cnData.addAll(dnAgainstCustomer);\n } \n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n }\n String companyId = reqParams.optString(\"companyid\");\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n totalAmountCN = data[3] != null ? (Double) data[3] : 0;\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN, companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount, companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount, companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount, companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount, companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount + CGSTAmount + SGSTAmount + CESSAmount, companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount, companyId));\n } else {\n jSONObject = accGSTReportService.getDebitNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n }\n// jSONObject.put(\"totalamount\", authHandler.formattedAmount(totalAmountCN, companyId));\n return jSONObject;\n }", "protected void Initialize (double[] pars) {\n for (int j = 0; j < scalarn; j++) {\n vectorXBeta[j] = 0;\n for (int i = 0; i <= scalarK; i++)\n vectorXBeta[j] += matrixX[j][i] * pars[i];\n }\n\n double y;\n for (int j = 0; j < scalarn; j++) {\n // Yjk, Phijk, Njk\n if (vectorY[j] == scalarM) {\n vectorPhiDiff[j] = 1.0;\n vectorNk[j] = 0.0;\n vectorNYk[j] = 0.0;\n } else {\n if (vectorY[j] == 1)\n y = 0.0 - vectorXBeta[j];\n else\n // pars[scalarK+1] is for mu_2 and\n y = pars[scalarK + vectorY[j] - 1] - vectorXBeta[j];\n vectorPhiDiff[j] = NormalDistribution.CDF (y);\n vectorNk[j] = NormalDistribution.PDF (y);\n vectorNYk[j] = vectorNk[j] * y;\n }\n\n // Yj(k-1), Phij(k-1), Nj(k-1)\n if (vectorY[j] == 1) {\n vectorNk1[j] = 0.0;\n vectorNYk1[j] = 0.0;\n } else {\n if (vectorY[j] == 2)\n y = 0.0 - vectorXBeta[j];\n else\n y = pars[scalarK + vectorY[j] - 2] - vectorXBeta[j];\n vectorPhiDiff[j] = vectorPhiDiff[j] - NormalDistribution.CDF (y);\n vectorNk1[j] = NormalDistribution.PDF (y);\n vectorNYk1[j] = vectorNk1[j] * y;\n }\n }\n }", "private void fillTrialConditionsData() {\n List<Condition> trialConditions = new ArrayList<Condition>();\n\n int instanceCounter = 1;\n for (Condition condition : this.workbookStudy.getConditions()) {\n if (condition.getDataType().equals(DATA_TYPE_CHAR)) {\n// LevelC levelCFilter = new LevelC(true);\n// LevelCPK levelCPK = new LevelCPK();\n// levelCPK.setLabelid(condition.getLabelId());\n// levelCFilter.setFactorid(condition.getFactorId());\n// levelCFilter.setLevelCPK(levelCPK);\n// List<LevelC> levelCList = this.servicioApp.getListLevelC(levelCFilter, 0, 0, false);\n List<LevelC> levelCList = condition.getFactor().getLevelsC();\n instanceCounter = 1;\n for (LevelC levelC : levelCList) {\n try {\n Condition conditionToAdd = new Condition();\n BeanUtilsBean.getInstance().copyProperties(conditionToAdd, condition);\n conditionToAdd.setValue(levelC.getLvalue());\n conditionToAdd.setInstance(instanceCounter);\n conditionToAdd.setLevelNo(levelC.getLevelCPK().getLevelno());\n trialConditions.add(conditionToAdd);\n instanceCounter++;\n } catch (IllegalAccessException ex) {\n Exceptions.printStackTrace(ex);\n } catch (InvocationTargetException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n } else if (condition.getDataType().equals(DATA_TYPE_NUMERIC)) {\n// LevelN levelNFilter = new LevelN(true);\n// LevelNPK levelnPK = new LevelNPK();\n// levelnPK.setLabelid(condition.getLabelId());\n// levelNFilter.setFactorid(condition.getFactorId());\n// levelNFilter.setLevelNPK(levelnPK);\n// List<LevelN> levelNList = this.servicioApp.getListLevelN(levelNFilter, 0, 0, false);\n List<LevelN> levelNList = condition.getFactor().getLevelsN();\n instanceCounter = 1;\n for (LevelN levelN : levelNList) {\n try {\n Condition conditionToAdd = new Condition();\n BeanUtilsBean.getInstance().copyProperties(conditionToAdd, condition);\n conditionToAdd.setValue(DecimalUtils.getValueAsString(levelN.getLvalue()));\n conditionToAdd.setInstance(instanceCounter);\n conditionToAdd.setLevelNo(levelN.getLevelNPK().getLevelno());\n trialConditions.add(conditionToAdd);\n instanceCounter++;\n } catch (IllegalAccessException ex) {\n Exceptions.printStackTrace(ex);\n } catch (InvocationTargetException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n }\n }\n\n Comparator<Condition> conditionComparator = new Comparator<Condition>() {\n\n @Override\n public int compare(Condition o1, Condition o2) {\n return o1.getInstance().compareTo(o2.getInstance());\n }\n };\n\n Collections.sort(trialConditions, conditionComparator);\n\n this.workbookStudy.setConditionsData(trialConditions);\n }", "private double calculateWeightFromCumulativeLosses(double accumulatedLosses, double numTrains) {\r\n\t\t\r\n\t\tdouble n=Math.sqrt(8*Math.log(2)/numTrains);\r\n\t\t//double n=0.5;\r\n\t\treturn Math.exp(-1*n*accumulatedLosses);\r\n\t}", "private void BC_duct(Grid gr){\r\n int i, j;\t\t\r\n NSmax=(int)(20/dt); repL=0.1;\r\n\t\t\r\n // boundary conditions of lower side of computational domain\r\n for(i = 0; i<mx; i++) BClow[i]=\"wall\"; \r\n // boundary conditions of upper side \r\n for(i = 0; i<mx; i++) BCupp[i]=\"wall\";\r\n // boundary conditions of left side\r\n for(j = 0; j<my; j++) BClef[j]=\"in\";\r\n // boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\r\n\t\r\n // initial conditions\r\n //for(j = 1; j <mym; j++){ \r\n // u[0][j]=Umean; //2.0*Umean*(1.0-4.0*(gr.y[0][j]-0.5)*(gr.y[0][j]-0.5));\r\n //}\r\n for(i = 0; i < mx; i++){ \r\n for(j = 1; j<mym; j++) u[i][j]=Umean;\r\n }\r\n // xmin=1.6; ymin=-3; xmax=8.6; ymax=3;\r\n }", "public static double[][] fireSsaComplianceArrayOutput(List<Row> inputList) {\n\t\t//16 rows (1 for each district) + inside + outside + county\n\t\t//6 columns (dist#, compliance threshold, compliance pct, # incidents, # comply, avg time)\n\t\tdouble[][] outputArray = new double[19][6];\n\n\t\tfor(int districtNumber = 1; districtNumber < 17; districtNumber++) {\n\t\t\t//set district number in 1st column\n\t\t\toutputArray[districtNumber-1][0] = districtNumber;\n\n\t\t\t//set compliance threshold and whether or not this district is inside SSA\n\t\t\t//2nd column represents max # of minutes required to be compliant\n\t\t\t//draws from hardcoded insideSsaArray defined above in this class\n\t\t\tLocalTime complianceThreshold;\n\t\t\tif(insideSsaArray[districtNumber-1]) {\n\t\t\t\t//if this district is inside SSA, set the compliance threshold to 9 minutes\n\t\t\t\tcomplianceThreshold = LocalTime.of(0, 9);\n\t\t\t\t//and note this compliance threshold in the output array\n\t\t\t\toutputArray[districtNumber-1][1] = 9;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//otherwise, district must be outside SSA\n\t\t\t\t//so set compliance threshold to 15 minutes\n\t\t\t\tcomplianceThreshold = LocalTime.of(0, 15);\n\t\t\t\t//and again, note this in the output array\n\t\t\t\toutputArray[districtNumber-1][1] = 15;\n\t\t\t}\n\n\t\t\t//get list of all valid incidents in the current district\n\t\t\tList<Row> currentDistrictList = filterValid(filterDistrict(inputList, districtNumber));\n\n\t\t\t//use this list to calculate percent compliance\n\t\t\t//uses compliance threshold determined by SSA status\n\t\t\t//then round compliance percent to 2 decimal places\n\t\t\tdouble compliancePercent = percentCompliance(currentDistrictList, complianceThreshold);\n\t\t\tdouble roundedCompliancePercent = (double) Math.round(compliancePercent*100.0)/100.0;\n\n\t\t\t//size of list is equal to total incident count\n\t\t\tdouble totalCount = currentDistrictList.size();\n\n\t\t\t//now we can just multiply the percentage by the list size\n\t\t\t//and round to nearest integer\n\t\t\tdouble compliantCount = compliancePercent*totalCount/100;\n\t\t\tMath.round(compliantCount);\n\n\t\t\t//3rd column is compliance percent\n\t\t\t//4th column is total incident count\n\t\t\t//5th column is number of compliant incidents\n\t\t\t//remember that since arrays start at 0, the 3rd column is represented by outputArray[x][2], the 4th column is represented by outputArray[x][3], etc...\n\t\t\t//the same applies to rows, hence the districtNumber-1\n\t\t\toutputArray[districtNumber-1][2] = roundedCompliancePercent;\n\t\t\toutputArray[districtNumber-1][3] = totalCount;\n\t\t\toutputArray[districtNumber-1][4] = compliantCount;\n\n\t\t\t//finally, do average response time\n\t\t\tdouble averageResponse = averageResponseTimeDouble(currentDistrictList);\n\t\t\t//this goes in column 6\n\t\t\toutputArray[districtNumber-1][5] = averageResponse;\n\n\t\t\tif(insideSsaArray[districtNumber-1]) {\n\t\t\t\t//if district is inside SSA, then we need to add its values to the totals for inside SSA\n\t\t\t\toutputArray[16][3] += totalCount;\n\t\t\t\toutputArray[16][4] += compliantCount;\n\n\t\t\t\t//this loop gets the response time from each individual incident and adds it to a total\n\t\t\t\t//this total will consist of all incidents from inside the SSA and divide it by the total incident count\n\t\t\t\tfor(Row row : currentDistrictList) {\n\t\t\t\t\toutputArray[16][5] += row.getResponseDouble();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//else if district is outside SSA, then we add its values to totals for outside SSA\n\t\t\t\toutputArray[17][3] += totalCount;\n\t\t\t\toutputArray[17][4] += compliantCount;\n\n\t\t\t\t//this loop is the same as the one immediately above, but applies to outside SSA instead\n\t\t\t\tfor(Row row : currentDistrictList) {\n\t\t\t\t\toutputArray[17][5] += row.getResponseDouble();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//placeholders\n\t\t//16 / 1 represents inside SSA\n\t\t//17 / 2 represents outside SSA\n\t\t//18 / 3 represents countywide totals\n\t\toutputArray[16][0] = 1;\n\t\toutputArray[17][0] = 2;\n\t\toutputArray[18][0] = 3;\n\n\t\t//represents response time requirement\n\t\t//-1 for bottom row as this is the total across all districts, so compliance threshold varies\n\t\toutputArray[16][1] = 9;\n\t\toutputArray[17][1] = 15;\n\t\toutputArray[18][1] = -1;\n\n\t\t//add total response times\n\t\toutputArray[18][5] = outputArray[16][5]+outputArray[17][5];\n\n\t\t//check to ensure incident count for inside SSA was not 0, else we risk dividing by zero\n\t\tif(outputArray[16][3] != 0) {\n\t\t\t//calculate the overall compliance rate for inside SSA by dividing compliant incidents by total incidents\n\t\t\t//round to two decimal places and place data in output array\n\t\t\tdouble insideSsaCompliance = outputArray[16][4]*100.0/outputArray[16][3];\n\t\t\tinsideSsaCompliance = (double) Math.round(insideSsaCompliance*100.0)/100.0;\n\t\t\toutputArray[16][2] = insideSsaCompliance;\n\n\t\t\t//now, calculate the average response time across all inside SSA incidents\n\t\t\t//and round to two decimal places\n\t\t\toutputArray[16][5] = outputArray[16][5]/outputArray[16][3];\n\t\t\toutputArray[16][5] = (double) Math.round(outputArray[16][5]*100.0)/100.0;\n\t\t}\n\n\t\t//check to ensure incident count for outside SSA was not 0, else we risk dividing by zero\n\t\tif(outputArray[17][3] != 0) {\n\t\t\t//calculate overall compliance rate for outside SSA\n\t\t\t//round and place in array\n\t\t\tdouble outsideSsaCompliance = outputArray[17][4]*100.0/outputArray[17][3];\n\t\t\toutsideSsaCompliance = (double) Math.round(outsideSsaCompliance*100.0)/100.0;\n\t\t\toutputArray[17][2] = outsideSsaCompliance;\n\n\t\t\t//calculate average response time across all outside SSA incidents\n\t\t\t//round to 2 decimal places\n\t\t\toutputArray[17][5] = outputArray[17][5]/outputArray[17][3];\n\t\t\toutputArray[17][5] = (double) Math.round(outputArray[17][5]*100.0)/100.0;\n\t\t}\n\n\t\t//the total incidents and compliant incidents counts for the county-wide totals are obtained by adding inside SSA and outside SSA totals\n\t\t//outputArray[18][3] = total incidents\n\t\t//outputArray[18][4] = compliant incidents\n\t\toutputArray[18][3] = outputArray[16][3]+outputArray[17][3];\n\t\toutputArray[18][4] = outputArray[16][4]+outputArray[17][4];\n\n\t\t//check to ensure total incident count is not zero to avoid dividing by zero errors\n\t\tif(outputArray[18][3] != 0) {\n\t\t\t//calculate total compliance by dividing compliant count by total count and multiplying by 100\n\t\t\t//round to 2 decimal places and place into output array\n\t\t\tdouble totalCompliance = outputArray[18][4]*100.0/outputArray[18][3];\n\t\t\ttotalCompliance = (double) Math.round(totalCompliance*100.0)/100.0;\n\t\t\toutputArray[18][2] = totalCompliance;\n\n\t\t\t//calculate average response time by dividing total response time counter by number of incidents\n\t\t\toutputArray[18][5] = outputArray[18][5]/outputArray[18][3];\n\t\t\toutputArray[18][5] = (double) Math.round(outputArray[18][5]*100.0)/100.0;\n\t\t}\n\n\t\t//finally return outputArray\n\t\treturn outputArray;\n\t}", "public PresentValueForexBlackVolatilityNodeSensitivityDataBundle(final Currency ccy1, final Currency ccy2, final DoubleMatrix1D expiries,\n final DoubleMatrix1D delta, final DoubleMatrix2D vega) {\n ArgumentChecker.notNull(ccy1, \"currency 1\");\n ArgumentChecker.notNull(ccy2, \"currency 2\");\n ArgumentChecker.notNull(expiries, \"expiries\");\n ArgumentChecker.notNull(delta, \"strikes\");\n ArgumentChecker.notNull(vega, \"Matrix\");\n ArgumentChecker.isTrue(vega.getNumberOfRows() == expiries.getNumberOfElements(), \"Number of rows did not match number of expiries\");\n ArgumentChecker.isTrue(vega.getNumberOfColumns() == delta.getNumberOfElements(), \"Number of columns did not match number of delta\");\n _currencyPair = ObjectsPair.of(ccy1, ccy2);\n _expiries = expiries;\n _delta = delta;\n _vega = vega;\n }", "public int perform_LMVM() {\n if (_inequality_width > 0) {\n int nvars = _fb.Size() * 2;\n double[] x = new double[nvars];\n \n // INITIAL POINT\n for (int i = 0; i < nvars / 2; i++) {\n x[i] = _va.get(i);\n x[i + _fb.Size()] = _vb.get(i);\n }\n \n // int info = BLMVMSolve(x, nvars);\n \n for (int i = 0; i < nvars / 2; i++) {\n _va.set(i, x[i]);\n _vb.set(i, x[i + _fb.Size()]);\n _vl.set(i, _va.get(i) - _vb.get(i));\n }\n \n return 0;\n } else {\n \n int nvars = _fb.Size();\n double[] x = new double[nvars];\n \n // INITIAL POINT\n for (int i = 0; i < nvars; i++) {\n x[i] = _vl.get(i);\n }\n \n // int info = BLMVMSolve(x, nvars);\n \n for (int i = 0; i < nvars; i++) {\n _vl.set(i, x[i]);\n }\n \n return 0;\n }\n }", "public static void checkConsistency(){\n double[] aNormalW=new double[numberOfObjectives];\n double randomIndex=0;\n double sum=0;\n for (int row=0;row<numberOfObjectives;row++){\n for (int column=0;column<numberOfObjectives;column++){\n\n sum+=weights[column]*objectives[row][column];\n }\n df.setRoundingMode(RoundingMode.UP);\n aNormalW[row]= Double.valueOf(df.format(sum));\n sum=0;\n }\n double awtDividedByWt=0;\n for (int i=0;i<numberOfObjectives;i++){\n awtDividedByWt+=aNormalW[i]/weights[i];\n decimalFormat.setRoundingMode(RoundingMode.HALF_UP);\n Double.valueOf(decimalFormat.format(awtDividedByWt));\n }\n double reciprocalNumber=(double) 1/numberOfObjectives;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n Double.valueOf(decimalFormat.format(reciprocalNumber));\n double step3=reciprocalNumber*awtDividedByWt;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n double numerator=Double.valueOf(decimalFormat.format(step3))-numberOfObjectives;\n double denominator=numberOfObjectives-1;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n double ci=Double.valueOf(decimalFormat.format(numerator)) /denominator;\n decimalFormat.setRoundingMode(RoundingMode.CEILING);\n System.out.println(\"Consistency Index (CI)= \"+Double.valueOf(decimalFormat.format(ci)));\n System.out.println();\n double ciDividedByRI=ci/table23(numberOfObjectives);\n decimalFormat.setRoundingMode(RoundingMode.UP);\n // Double.valueOf(df.format(ciDividedByRI));\n if (ciDividedByRI<0.10){\n randomIndex=ci/table23(numberOfObjectives);\n decimalFormat.setRoundingMode(RoundingMode.UP);\n System.out.println(\"Random Index (RI)= \"+Double.valueOf(decimalFormat.format(randomIndex)));\n System.out.println(\"degree of consistency is satisfactory !!\");\n }else {\n System.out.println(\"the AHP may not yield meaningful results !!\");\n }\n System.out.println();\n }", "private void setValues(Lsv lsv, Liability i, Liability c) {\r\n\t\t// the value in i and c liabilities are already in USD; converted in\r\n\t\t// clientAggregate\r\n\t\tBigDecimal imValue = i.getValue();\r\n\t\tBigDecimal cvmValue = c != null ? c.getValue() : BigDecimal.ZERO;\r\n\r\n\t\tlsv.setInitialMargin(imValue);\r\n\t\tlsv.setContingentVariationMargin(cvmValue);\r\n\r\n\t\t// values are liabilities; if cvmValue is negative it means it's a\r\n\t\t// credit\r\n\t\tBigDecimal offset = imValue.add(cvmValue);\r\n\t\tint sign = offset.signum();\r\n\r\n\t\tif (sign < 0) {\r\n\t\t\t// Credit CVM\r\n\t\t\tlsv.setCreditCVM(offset);\r\n\t\t\tlsv.setLSV(BigDecimal.ZERO);\r\n\t\t} else {\r\n\t\t\t// LSV\r\n\t\t\tlsv.setCreditCVM(BigDecimal.ZERO);\r\n\t\t\tlsv.setLSV(offset);\r\n\t\t}\r\n\r\n\t\tlsv.setExcess(calculateExcess(lsv.getClient(), lsv.getLSV()));\r\n\t}", "public String getVCML() {\n\n\t\t//\n\t\t// write format as follows:\n\t\t//\n\t\t// SolverTaskDescription {\n\t\t//\t\tTaskType Unsteady\n\t\t//\t\tMaxTime 1\n\t\t//\t\tSolverDescription \"Runga-Kutta Fehlberg\"\n\t\t//\t\tUseSymbolicJacobian false\n\t\t//\t\tTimeBounds {\n\t\t//\t\t\tStartingTime\t0.0\n\t\t//\t\t\tEndingTime\t\t0.0\n\t\t//\t\t}\n\t\t//\t\tTimeStep {\n\t\t//\t\t\tDefaultTimeStep\t\t0.0\n\t\t//\t\t\tMinimumTimeStep\t\t0.0\n\t\t//\t\t\tMaximumTimeStep\t\t0.0\n\t\t//\t\t}\n\t\t//\t\tErrorTolerance {\n\t\t//\t\t\tAbsoluteErrorTolerance 1e-8\n\t\t//\t\t\tRelativeErrorTolerance 1e-4\n\t\t//\t\t}\n\t\t// \tStochSimOptions {\n\t\t//\t\t\tUseCustomSeed\tfalse\n\t\t//\t\t\tCustomSeed\t0\n\t\t//\t\t\tNumOfTrials\t1\n\t\t// //if Hybrid, we have following four more\n\t\t// Epsilon 100\n\t\t// Lambda 10\n\t\t// MSRTolerance 0.01\n\t\t// SDETolerance 1e-4\n\t\t// \t}\n\t\t//\t\tStopAtSpatiallyUniform {\n\t\t//\t\t\tAbsoluteErrorTolerance\t1e-8\n\t\t//\t\t\tRelativeErrorTolerance 1e-4\n\t\t//\t\t}\n\t\t//\t\tNFSimSimulationOptions {\n\t\t//\t\t\tObservableComputationOff 1\n\t\t//\t\t\tMoleculeDistance 1000\n\t\t//\t\t\t...\n\t\t//\t\t\tNumOfTrials\t1\n\t\t//\t\t}\n\t\t// RunParameterScanSerially false\n\t\t//\t\tKeepEvery 1\n\t\t//\t\tKeepAtMost\t1000\n\t\t//\t\tSensitivityParameter {\n\t\t//\t\t\tConstant k1 39.0;\n\t\t//\t\t}\n\t\t//\t\tNumProcessors 1\n\t\t// }\n\t\t//\n\t\t//\n\t\tStringBuffer buffer = new StringBuffer();\n\n\t\tbuffer.append(VCML.SolverTaskDescription+\" \"+VCML.BeginBlock+\"\\n\");\n\n\t\tif (getTaskType() == TASK_UNSTEADY){\n\t\t\tbuffer.append(VCML.TaskType+\" \"+VCML.TaskType_Unsteady+\"\\n\");\n\t\t}else if (getTaskType() == TASK_STEADY){\n\t\t\tbuffer.append(VCML.TaskType+\" \"+VCML.TaskType_Steady+\"\\n\");\n\t\t}else{\n\t\t\tthrow new RuntimeException(\"unexpected task type\");\n\t\t}\n\n\t\tbuffer.append(VCML.SolverDescription+\" \\\"\"+getSolverDescription().getDatabaseName()+\"\\\"\"+\"\\n\");\n\n\t\tbuffer.append(VCML.UseSymbolicJacobian+\" \"+getUseSymbolicJacobian()+\"\\n\");\n\n\t\tbuffer.append(getTimeBounds().getVCML()+\"\\n\");\n\n\t\tbuffer.append(getTimeStep().getVCML()+\"\\n\");\n\n\t\tbuffer.append(getErrorTolerance().getVCML()+\"\\n\");\n\n\t\tif(getStochOpt() != null)\n\t\t\tbuffer.append(getStochOpt().getVCML()+\"\\n\");\n\n\t\tbuffer.append(fieldOutputTimeSpec.getVCML() + \"\\n\");\n\n\t\tif (getSensitivityParameter()!=null){\n\t\t\tbuffer.append(VCML.SensitivityParameter+\" \"+VCML.BeginBlock+\"\\n\");\n\t\t\tbuffer.append(getSensitivityParameter().getVCML()+\"\\n\");\n\t\t\tbuffer.append(VCML.EndBlock+\"\\n\");\n\t\t}\n\n\t\tif (stopAtSpatiallyUniformErrorTolerance != null) {\n\t\t\tbuffer.append(VCML.StopAtSpatiallyUniform + \" \" + stopAtSpatiallyUniformErrorTolerance.getVCML() + \"\\n\");\n\t\t}\n\n\t\tif (bSerialParameterScan) {\n\t\t\tbuffer.append(VCML.RunParameterScanSerially + \" \" + bSerialParameterScan + \"\\n\");\n\t\t}\n\t\tif (nfsimSimulationOptions != null) {\n\t\t\tbuffer.append(nfsimSimulationOptions.getVCML());\n\t\t}\n\t\tif (langevinSimulationOptions != null) {\n\t\t\tbuffer.append(langevinSimulationOptions.getVCML());\n\t\t}\n\t\tif (smoldynSimulationOptions != null) {\n\t\t\tbuffer.append(smoldynSimulationOptions.getVCML());\n\t\t}\n\t\tif (sundialsPdeSolverOptions != null) {\n\t\t\tbuffer.append(sundialsPdeSolverOptions.getVCML());\n\t\t}\n\n\t\tif (chomboSolverSpec != null) {\n\t\t\tbuffer.append(chomboSolverSpec.getVCML()+\"\\n\");\n\t\t}\n\t\tbuffer.append(\"\\t\" + VCML.NUM_PROCESSORS + \" \" + numProcessors + \"\\n\");\n\t\tif (bTimeoutDisabled) {\n\t\t\tbuffer.append(VCML.TimeoutSimulationDisabled + \" \" + bTimeoutDisabled + \"\\n\");\n\t\t}\n\t\tif (bBorderExtrapolationDisabled) {\n\t\t\tbuffer.append(VCML.BorderExtrapolationDisabled + \" \" + bBorderExtrapolationDisabled + \"\\n\");\n\t\t}\n\n\t\tif (movingBoundarySolverOptions != null) {\n\t\t\tbuffer.append(movingBoundarySolverOptions.getVCML()+\"\\n\");\n\t\t}\n\t\tbuffer.append(VCML.EndBlock+\"\\n\");\n\n\t\treturn buffer.toString();\n\t}", "@Override\n\tpublic double GetValue() {\n\t\tdouble spot = inputs.getSpot();\n\t\tdouble strike = inputs.getStrike();\n\t\tdouble vol = inputs.getVol();\n\t\tint noSteps=inputs.getNoSteps();\n\t\tdouble expiry=inputs.getExpiry();\n\t OptionType type=inputs.getType();\n\t ExerciseType exercise=inputs.getExercise();\n\t InterestRate interestRate=inputs.getR();\n\t\t\n\t double timestep = expiry/noSteps;\n\t double DF = Math.exp(-interestRate.GetRate(1.)*timestep);\n\t double temp1 = Math.exp((interestRate.GetRate(1.) + vol * vol)*timestep);\n\t double temp2 = 0.5 * (DF + temp1);\n\t double up = temp2 + Math.sqrt(temp2*temp2 - 1);\n\t double down = 1/ up;\n\t double probaUp = (Math.exp(interestRate.GetRate(1.) * timestep) - down)/(up -down) ;\n\t double probaDown = 1 - probaUp;\n\n\t //stock price tree\n\t\tstockPrice[0][0]=spot;\n\t for (int n = 1; n <= noSteps; n ++) {\n for (int j = n; j > 0; j--){\n \tstockPrice[j][n] = up * stockPrice[j-1][n-1];\n }\n \t\tstockPrice[0][n] = down * stockPrice[0][n-1];\n }\n\t \n\t //last column set payoffs\n\t\tfor (int j = 0; j <= noSteps; j++) {\n\t\t\t\tif(type.equals(OptionType.CALL)) {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(this.stockPrice[j][noSteps] - strike, .0);\n\t\t\t\t}else {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(strike - this.stockPrice[j][noSteps], .0);\n\t\t\t\t}\n\t\t}\n\n\t\t\n\t //payoff tree in backwardation\n\t \n\t for (int i = noSteps ; i >= 1; i--) {\n for (int j = 0; j <= i-1; j++) {\n\t \tif(exercise.equals(ExerciseType.AMERICAN)) { \n\t //American\t\n\t \t\tif(type.equals(OptionType.CALL)) {\n\t \t\t\t\tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(this.stockPrice[j][i-1] - strike, .0));\n\t \t\t\t\n\t \t\t}else \tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(strike - this.stockPrice[j][i-1] , .0));\n\t \t}else { \n\t \t\t\t//European put and call option\n\t \t\t\t\tpayOff[j][i-1] = DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]);\n\t }\n }\n }\n\t \n\t double deltaUp = (payOff[0][2]-payOff[1][2])/(stockPrice[0][2]-stockPrice[1][2]);\n\t double deltaDown = (payOff[1][2]-payOff[2][2])/(stockPrice[1][2]-stockPrice[2][2]);\n\t delta = (deltaUp + deltaDown) /2;\n\t gamma = (deltaUp-deltaDown)/((stockPrice[0][2]-stockPrice[2][2])/2);\n\t theta = (payOff[1][2]-payOff[0][0])/(365*2*timestep);//time in days\n\t \n\t long rounded = Math.round(payOff[0][0]*10000);\n\t return rounded/10000.0;\n\t}", "public abstract double[] getMinimumValues(List<AbstractObjective> objectives, List<? extends Solution<?>> solutions) ;", "public LuvAdjustmentChart(ColorServer ct) {\r\n\t\tsuper(PxlColor.CS_LuvStar, ct);\r\n\t\t// Create a uv-chromaticity diagram\r\n\t\tchromaChart = new Chart(new LinearAxisModel(-100.0, 180.0, 0.0), 8,\r\n\t\t\t\tnew LinearAxisModel(-140.0, 100.0, 0.0), 7, 1.0, this);\r\n\t\tchromaChart.setValidRegion(createValidRegion(1.0));\r\n\t\tchromaChart.setPreferredHorizontalSpacing(5 * cellWidth, 245,\r\n\t\t\t\t3 * cellWidth);\r\n\t\tchromaChart.setPreferredVerticalSpacing(1 * cellWidth, 210,\r\n\t\t\t\t5 * cellHeight / 4);\r\n\t\tchromaChart.setLabelPrecision(0);\r\n\t\t// Create a linear scale for the L* axis\r\n\t\tAxisModel lumModel = new LinearAxisModel(0.0, 100.0, 0.0);\r\n\t\tlumSlider = new Slider(Slider.HORIZONTAL, lumModel, 9, 0);\r\n\t\tlumSlider.setPreferredSpacing(7 * cellWidth, 240, 3 * cellWidth);\r\n\t\tlumSlider.setAxisListener(this);\r\n\t\tcreateLayout(lumSlider, chromaChart);\r\n\t}", "LigneTableau(boolean box_conveyor, boolean part_conveyor, boolean grab, boolean c_plus, boolean auto, boolean manual, boolean emergency_stop, boolean reset_button, boolean start, boolean stop, boolean part_at_place, boolean box_at_place, boolean detected, boolean c_limit, long date)\n\t\t{\n\t\tthis.box_conveyor = box_conveyor;\n\t\tthis.part_conveyor = part_conveyor;\n\t\tthis.grab = grab;\n\t\tthis.c_plus = c_plus;\n\t\tthis.auto = auto;\n\t\tthis.manual = manual;\n\t\tthis.emergency_stop = emergency_stop;\n\t\tthis.reset_button = reset_button;\n\t\tthis.start = start;\n\t\tthis.stop = stop;\n\t\tthis.part_at_place = part_at_place;\n\t\tthis.box_at_place = box_at_place;\n\t\tthis.detected = detected;\n\t\tthis.c_limit = c_limit;\n\t\tthis.date = date;\n\t\t}", "public RandomVariable getValues(final double evaluationTime, final LIBORMarketModel model) {\n\t\tif(evaluationTime > 0) {\n\t\t\tthrow new RuntimeException(\"Forward start evaluation currently not supported.\");\n\t\t}\n\n\t\t// Fetch the covariance model of the model\n\t\tfinal LIBORCovarianceModel covarianceModel = model.getCovarianceModel();\n\n\t\t// We sum over all forward rates\n\t\tfinal int numberOfComponents = covarianceModel.getLiborPeriodDiscretization().getNumberOfTimeSteps();\n\n\t\t// Accumulator\n\t\tRandomVariable\tintegratedLIBORCurvature\t= new RandomVariableFromDoubleArray(0.0);\n\t\tfor(int componentIndex = 0; componentIndex < numberOfComponents; componentIndex++) {\n\n\t\t\t// Integrate from 0 up to the fixing of the rate\n\t\t\tfinal double timeEnd\t\t= covarianceModel.getLiborPeriodDiscretization().getTime(componentIndex);\n\t\t\tint timeEndIndex\t= covarianceModel.getTimeDiscretization().getTimeIndex(timeEnd);\n\n\t\t\t// If timeEnd is not in the time discretization we get timeEndIndex = -insertionPoint-1. In that case, we use the index prior to the insertionPoint\n\t\t\tif(timeEndIndex < 0) {\n\t\t\t\ttimeEndIndex = -timeEndIndex - 2;\n\t\t\t}\n\n\t\t\t// Sum squared second derivative of the variance for all components at this time step\n\t\t\tRandomVariable integratedLIBORCurvatureCurrentRate = new RandomVariableFromDoubleArray(0.0);\n\t\t\tfor(int timeIndex = 0; timeIndex < timeEndIndex-2; timeIndex++) {\n\t\t\t\tfinal double timeStep1\t= covarianceModel.getTimeDiscretization().getTimeStep(timeIndex);\n\t\t\t\tfinal double timeStep2\t= covarianceModel.getTimeDiscretization().getTimeStep(timeIndex+1);\n\n\t\t\t\tfinal RandomVariable covarianceLeft\t\t= covarianceModel.getCovariance(timeIndex+0, componentIndex, componentIndex, null);\n\t\t\t\tfinal RandomVariable covarianceCenter\t= covarianceModel.getCovariance(timeIndex+1, componentIndex, componentIndex, null);\n\t\t\t\tfinal RandomVariable covarianceRight\t\t= covarianceModel.getCovariance(timeIndex+2, componentIndex, componentIndex, null);\n\n\t\t\t\t// Calculate second derivative\n\t\t\t\tRandomVariable curvatureSquared = covarianceRight.sub(covarianceCenter.mult(2.0)).add(covarianceLeft);\n\t\t\t\tcurvatureSquared = curvatureSquared.div(timeStep1 * timeStep2);\n\n\t\t\t\t// Take square\n\t\t\t\tcurvatureSquared = curvatureSquared.squared();\n\n\t\t\t\t// Integrate over time\n\t\t\t\tintegratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.add(curvatureSquared.mult(timeStep1));\n\t\t\t}\n\n\t\t\t// Empty interval - skip\n\t\t\tif(timeEnd == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Average over time\n\t\t\tintegratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.div(timeEnd);\n\n\t\t\t// Take square root\n\t\t\tintegratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.sqrt();\n\n\t\t\t// Take max over all forward rates\n\t\t\tintegratedLIBORCurvature = integratedLIBORCurvature.add(integratedLIBORCurvatureCurrentRate);\n\t\t}\n\n\t\tintegratedLIBORCurvature = integratedLIBORCurvature.div(numberOfComponents);\n\t\treturn integratedLIBORCurvature.sub(tolerance).floor(0.0);\n\t}", "public final EObject ruleConstraintCS() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n Token otherlv_3=null;\n Token otherlv_4=null;\n AntlrDatatypeRuleToken lv_name_0_0 = null;\n\n EObject lv_ownedMessageSpecification_2_0 = null;\n\n EObject lv_ownedSpecification_5_0 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalMyDsl.g:3604:2: ( ( ( ( (lv_name_0_0= ruleUnrestrictedName ) ) (otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')' )? )? otherlv_4= ':' ( (lv_ownedSpecification_5_0= ruleSpecificationCS ) ) ) )\n // InternalMyDsl.g:3605:2: ( ( ( (lv_name_0_0= ruleUnrestrictedName ) ) (otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')' )? )? otherlv_4= ':' ( (lv_ownedSpecification_5_0= ruleSpecificationCS ) ) )\n {\n // InternalMyDsl.g:3605:2: ( ( ( (lv_name_0_0= ruleUnrestrictedName ) ) (otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')' )? )? otherlv_4= ':' ( (lv_ownedSpecification_5_0= ruleSpecificationCS ) ) )\n // InternalMyDsl.g:3606:3: ( ( (lv_name_0_0= ruleUnrestrictedName ) ) (otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')' )? )? otherlv_4= ':' ( (lv_ownedSpecification_5_0= ruleSpecificationCS ) )\n {\n // InternalMyDsl.g:3606:3: ( ( (lv_name_0_0= ruleUnrestrictedName ) ) (otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')' )? )?\n int alt36=2;\n int LA36_0 = input.LA(1);\n\n if ( ((LA36_0>=RULE_SIMPLE_ID && LA36_0<=RULE_ESCAPED_ID)||LA36_0==19||(LA36_0>=60 && LA36_0<=61)) ) {\n alt36=1;\n }\n switch (alt36) {\n case 1 :\n // InternalMyDsl.g:3607:4: ( (lv_name_0_0= ruleUnrestrictedName ) ) (otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')' )?\n {\n // InternalMyDsl.g:3607:4: ( (lv_name_0_0= ruleUnrestrictedName ) )\n // InternalMyDsl.g:3608:5: (lv_name_0_0= ruleUnrestrictedName )\n {\n // InternalMyDsl.g:3608:5: (lv_name_0_0= ruleUnrestrictedName )\n // InternalMyDsl.g:3609:6: lv_name_0_0= ruleUnrestrictedName\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\tnewCompositeNode(grammarAccess.getConstraintCSAccess().getNameUnrestrictedNameParserRuleCall_0_0_0());\n \t\t\t\t\t\n }\n pushFollow(FOLLOW_43);\n lv_name_0_0=ruleUnrestrictedName();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\tif (current==null) {\n \t\t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getConstraintCSRule());\n \t\t\t\t\t\t}\n \t\t\t\t\t\tset(\n \t\t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\t\"name\",\n \t\t\t\t\t\t\tlv_name_0_0,\n \t\t\t\t\t\t\t\"org.eclipse.ocl.xtext.completeocl.CompleteOCL.UnrestrictedName\");\n \t\t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\t\n }\n\n }\n\n\n }\n\n // InternalMyDsl.g:3626:4: (otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')' )?\n int alt35=2;\n int LA35_0 = input.LA(1);\n\n if ( (LA35_0==20) ) {\n alt35=1;\n }\n switch (alt35) {\n case 1 :\n // InternalMyDsl.g:3627:5: otherlv_1= '(' ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) ) otherlv_3= ')'\n {\n otherlv_1=(Token)match(input,20,FOLLOW_44); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewLeafNode(otherlv_1, grammarAccess.getConstraintCSAccess().getLeftParenthesisKeyword_0_1_0());\n \t\t\t\t\n }\n // InternalMyDsl.g:3631:5: ( (lv_ownedMessageSpecification_2_0= ruleSpecificationCS ) )\n // InternalMyDsl.g:3632:6: (lv_ownedMessageSpecification_2_0= ruleSpecificationCS )\n {\n // InternalMyDsl.g:3632:6: (lv_ownedMessageSpecification_2_0= ruleSpecificationCS )\n // InternalMyDsl.g:3633:7: lv_ownedMessageSpecification_2_0= ruleSpecificationCS\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\t\tnewCompositeNode(grammarAccess.getConstraintCSAccess().getOwnedMessageSpecificationSpecificationCSParserRuleCall_0_1_1_0());\n \t\t\t\t\t\t\n }\n pushFollow(FOLLOW_8);\n lv_ownedMessageSpecification_2_0=ruleSpecificationCS();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\t\tif (current==null) {\n \t\t\t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getConstraintCSRule());\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tset(\n \t\t\t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\t\t\"ownedMessageSpecification\",\n \t\t\t\t\t\t\t\tlv_ownedMessageSpecification_2_0,\n \t\t\t\t\t\t\t\t\"org.eclipse.ocl.xtext.completeocl.CompleteOCL.SpecificationCS\");\n \t\t\t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\t\t\n }\n\n }\n\n\n }\n\n otherlv_3=(Token)match(input,21,FOLLOW_28); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewLeafNode(otherlv_3, grammarAccess.getConstraintCSAccess().getRightParenthesisKeyword_0_1_2());\n \t\t\t\t\n }\n\n }\n break;\n\n }\n\n\n }\n break;\n\n }\n\n otherlv_4=(Token)match(input,42,FOLLOW_44); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\tnewLeafNode(otherlv_4, grammarAccess.getConstraintCSAccess().getColonKeyword_1());\n \t\t\n }\n // InternalMyDsl.g:3660:3: ( (lv_ownedSpecification_5_0= ruleSpecificationCS ) )\n // InternalMyDsl.g:3661:4: (lv_ownedSpecification_5_0= ruleSpecificationCS )\n {\n // InternalMyDsl.g:3661:4: (lv_ownedSpecification_5_0= ruleSpecificationCS )\n // InternalMyDsl.g:3662:5: lv_ownedSpecification_5_0= ruleSpecificationCS\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getConstraintCSAccess().getOwnedSpecificationSpecificationCSParserRuleCall_2_0());\n \t\t\t\t\n }\n pushFollow(FOLLOW_2);\n lv_ownedSpecification_5_0=ruleSpecificationCS();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getConstraintCSRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"ownedSpecification\",\n \t\t\t\t\t\tlv_ownedSpecification_5_0,\n \t\t\t\t\t\t\"org.eclipse.ocl.xtext.completeocl.CompleteOCL.SpecificationCS\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n }\n\n }\n\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n\n \tleaveRule();\n\n }\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "private double culcSystemProfit(BetsMap bets, Car winner) {\n\t\tdouble sumBets = bets.getSumBets();\n\t\tif (bets.forCar(winner).isEmpty()) {\n\t\t\treturn sumBets;\n\t\t}\n\t\treturn sumBets * PERCENT / 100;\n\t}", "public void cp_computeFlow () { \n double effaoa = effective_aoa();\n if (!can_do_gui_updates && current_part.foil.fast_coeffs()) {\n solver.set_q0();\n current_part.cl = solver.get_Cl(effaoa);\n } else {\n solver.getFreeStream();\n solver.getCirculation(effaoa, current_part.thickness, current_part.camber);\n solver.compute_foil_geometry(effaoa);\n current_part.cl = solver.get_Cl(effaoa);\n solver.genFlow(effaoa);\n } \n \n current_part.cm = current_part.compute_cm(effaoa);\n\n // test: is this the same value getCl_plot gives?\n // if (false) {\n // double getCl_plot_val = out_top.plot.getCl_plot(current_part.camber/25, current_part.thickness/25, effaoa);\n // if (getCl_plot_val != current_part.cl) {\n // System.out.println(\"-- getCl_plot_val: \" + getCl_plot_val + \"yet current_part.cl: \" + current_part.cl);\n // }\n // track_current_part.cl_changes();\n // }\n\n current_part.reynolds = foil_is_cylinder_or_ball(current_part.foil) \n ? velocity/vconv * 2 * radius/lconv * rho_EN / viscos\n : velocity/vconv * current_part.chord/lconv * rho_EN / viscos;\n\n if (can_do_gui_updates)\n solver.getProbe();\n\n double camd = current_part.camber;\n double alfd = effaoa; // effective_aoa();\n // attempt to fix symmetry problem\n if (fix_symmetry_problem && camd < 0.0) alfd = - alfd;\n \n // this saved current_part's cd, cd_profile and cd_aux\n solver.get_Cd(alfd); \n }", "public double costNEX() {\r\n double diff=0;\r\n double intensity=0;\r\n \r\n for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) {\r\n for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n\r\n this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n intensity = this.body2[x][y][z].radiationIntensity(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (intensity>0) {\r\n// LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n this.body2[x][y][z].addCurrentDosis(intensity);\r\n } \r\n diff += Math.pow((this.body2[x][y][z].getGoalDosis()-this.body2[x][y][z].getCurrentDosis()),2);\r\n// LogTool.print(\" diffdose \" + (Looper.body2[x][y][z].getGoalDosis()-Looper.body2[x][y][z].getCurrentDosis()),\"notification\");\r\n } \r\n }\r\n }\r\n return Math.sqrt(diff);\r\n// return Math.random();\r\n }", "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}", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "public void calcInc(int np)\n\t{\n \n findSpecEq();\n int nofc=numberOfComponents;\n fvec.timesEquals(0.0);\n fvec.set(nofc+1,0,1.0);\n Matrix dxds=Jac.solve(fvec);\n if (np<5)\n {\n double dp=0.01;\n ds=dp/dxds.get(nofc+1,0);\n Xgij.setMatrix(0,nofc+1,np-1,np-1,u);\n dxds.timesEquals(ds);\n // dxds.print(0,10);\n u.plusEquals(dxds);\n // Xgij.print(0,10);\n// u.print(0,10);\n }\n else\n {\n //System.out.println(\"iter \" +iter + \" np \" + np);\n if (iter>6)\n { \n ds *= 0.5;\n System.out.println(\"ds > 6\");\n }\n \n else\n {\n if (iter<3) {\n ds *= 1.5;\n }\n if (iter==3) {\n ds *= 1.1;\n }\n if (iter==4) {\n ds *= 1.0;\n }\n if (iter>4) {\n ds *= 0.5;\n }\n \n// Now we check wheater this ds is greater than dTmax and dPmax.\n if(Math.abs(system.getTemperature()*dxds.get(nofc,0)*ds)>dTmax){\n // System.out.println(\"true T\");\n ds=sign(dTmax/system.getTemperature()/Math.abs(dxds.get(nofc,0)),ds);\n }\n \n if(Math.abs(system.getPressure()*dxds.get(nofc+1,0)*ds)>dPmax)\n {\n ds=sign(dPmax/system.getPressure()/Math.abs(dxds.get(nofc+1,0)),ds);\n // System.out.println(\"true P\");\n }\n if (etterCP2) {\n etterCP2=false;\n ds = 0.5*ds;\n }\n \n Xgij.setMatrix(0,nofc+1,0,2,Xgij.getMatrix(0,nofc+1,1,3)); \n Xgij.setMatrix(0,nofc+1,3,3,u);\n s.setMatrix(0,0,0,3,Xgij.getMatrix(speceq,speceq,0,3));\n // s.print(0,10);\n // System.out.println(\"ds1 : \" + ds);\n calcInc2(np);\n // System.out.println(\"ds2 : \" + ds);\n \n// Here we find the next point from the polynomial.\n \n }\n }\n }", "private List<Map<String, Object>> calcProfit(List<Map<String, Object>> revenue,\n List<Map<String, Object>> dep,\n List<Map<String, Object>> maintenance\n ) {\n int index = 0;\n List<Map<String, Object>> profit = new ArrayList<>();\n\n for (Map<String, Object> item : revenue) {\n \n String key = item.get(\"key\")!=null ? item.get(\"key\").toString() : \"\";\n\n HashMap<String, Object> node = new HashMap<>();\n\n double value = (Double) item.get(\"value\");\n if ((value > -0.00001) && (value < 0.00001)) {\n // revenue equals zero, it should be data input error, therefore, profit will be zero too\n node.put(\"value\", 0.0);\n } else {\n // revenue did not equal to zero, let us calculate profit\n if (dep.get(index).get(\"key\") != null) {\n value = value - (Double) dep.get(index).get(\"value\");\n }\n\n if (maintenance.get(index).get(\"key\") != null) {\n value = value - (Double) maintenance.get(index).get(\"value\");\n }\n node.put(\"value\", value);\n }\n\n node.put(\"key\", key);\n profit.add(node);\n index++;\n }\n\n return profit;\n }", "public int \r\nomStudent_ObjectConstraints( View mStudent,\r\n Integer Event,\r\n Integer State )\r\n{\r\n zVIEW wXferO = new zVIEW( );\r\n int RESULT = 0;\r\n //:VIEW lTermLST BASED ON LOD lTermLST\r\n zVIEW lTermLST = new zVIEW( );\r\n //:VIEW lTermLST2 BASED ON LOD lTermLST\r\n zVIEW lTermLST2 = new zVIEW( );\r\n //:VIEW mUser BASED ON LOD mUser\r\n zVIEW mUser = new zVIEW( );\r\n //:VIEW mStudentT BASED ON LOD mStudent\r\n zVIEW mStudentT = new zVIEW( );\r\n //:VIEW sAppMgr BASED ON LOD sAppMgr\r\n zVIEW sAppMgr = new zVIEW( );\r\n //:VIEW mStuChgH BASED ON LOD mStuChgH\r\n zVIEW mStuChgH = new zVIEW( );\r\n //:VIEW mStuChgH2 BASED ON LOD mStuChgH\r\n zVIEW mStuChgH2 = new zVIEW( );\r\n //:VIEW mStuChgL BASED ON LOD mStuChgL\r\n zVIEW mStuChgL = new zVIEW( );\r\n //:STRING ( 20 ) szCollegeTerm\r\n String szCollegeTerm = null;\r\n //:STRING ( 50 ) szAnticipatedGradPeriod\r\n String szAnticipatedGradPeriod = null;\r\n //:STRING ( 50 ) szOriginalValue\r\n String szOriginalValue = null;\r\n //:STRING ( 50 ) szNewValue\r\n String szNewValue = null;\r\n //:STRING ( 1 ) szChangeFlag\r\n String szChangeFlag = null;\r\n //:STRING ( 8 ) szCurrentDate\r\n String szCurrentDate = null;\r\n //:STRING ( 1 ) szCurrentAcademicLevel\r\n String szCurrentAcademicLevel = null;\r\n //:SHORT nRC\r\n int nRC = 0;\r\n int lTempInteger_0 = 0;\r\n String szTempString_0 = null;\r\n int lTempInteger_1 = 0;\r\n String szTempString_1 = null;\r\n int lTempInteger_2 = 0;\r\n int lTempInteger_3 = 0;\r\n int lTempInteger_4 = 0;\r\n int lTempInteger_5 = 0;\r\n int lTempInteger_6 = 0;\r\n int lTempInteger_7 = 0;\r\n int lTempInteger_8 = 0;\r\n int lTempInteger_9 = 0;\r\n int lTempInteger_10 = 0;\r\n int lTempInteger_11 = 0;\r\n int lTempInteger_12 = 0;\r\n int lTempInteger_13 = 0;\r\n int lTempInteger_14 = 0;\r\n int lTempInteger_15 = 0;\r\n int lTempInteger_16 = 0;\r\n int lTempInteger_17 = 0;\r\n int lTempInteger_18 = 0;\r\n int lTempInteger_19 = 0;\r\n int lTempInteger_20 = 0;\r\n int lTempInteger_21 = 0;\r\n zVIEW vTempViewVar_0 = new zVIEW( );\r\n int lTempInteger_22 = 0;\r\n\r\n RESULT = GetViewByName( wXferO, \"wXferO\", mStudent, zLEVEL_TASK );\r\n\r\n //:CASE Event\r\n switch( Event )\r\n { \r\n //:OF zOCE_ACTIVATE:\r\n case zOCE_ACTIVATE :\r\n\r\n// if ( lTempInteger_16 == 0 )\r\n// return 0;\r\n// \r\n// View v = mStudent.activateOiFromFile( \"mStudent\", \"testdata/ZENCAs/mstudent_ac.por\" );\r\n// boolean c = v.equalsOi( mStudent );\r\n \r\n //:// Order the Retention, Transcript and Residency data in reverse date order.\r\n //:OrderEntityForView( mStudent, \"RetentionRisk\", \"CreationDate D\" )\r\n OrderEntityForView( mStudent, \"RetentionRisk\", \"CreationDate D\" );\r\n //:OrderEntityForView( mStudent, \"TranscriptRequest\", \"CreationDate D\" )\r\n OrderEntityForView( mStudent, \"TranscriptRequest\", \"CreationDate D\" );\r\n //:OrderEntityForView( mStudent, \"TermOfResidence\", \"BeginDate D\" )\r\n OrderEntityForView( mStudent, \"TermOfResidence\", \"BeginDate D\" );\r\n\r\n //:// Order Student Major/Degree Track according to Ranking.\r\n //:IF mStudent.StudentMajorDegreeTrack EXISTS\r\n lTempInteger_0 = CheckExistenceOfEntity( mStudent, \"StudentMajorDegreeTrack\" );\r\n if ( lTempInteger_0 == 0 )\r\n { \r\n //:IF mStudent.StudentMajorDegreeTrack.Ranking > 0\r\n if ( CompareAttributeToInteger( mStudent, \"StudentMajorDegreeTrack\", \"Ranking\", 0 ) > 0 )\r\n { \r\n //:OrderEntityForView( mStudent, \"StudentMajorDegreeTrack\", \"Ranking A\" )\r\n OrderEntityForView( mStudent, \"StudentMajorDegreeTrack\", \"Ranking A\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Build Chapel Attendance Summary entries.\r\n //:GET VIEW lTermLST NAMED \"lTermLST\"\r\n RESULT = GetViewByName( lTermLST, \"lTermLST\", mStudent, zLEVEL_TASK );\r\n //:CreateViewFromView( lTermLST2, lTermLST )\r\n CreateViewFromView( lTermLST2, lTermLST );\r\n //:FOR EACH mStudent.ChapelSession \r\n RESULT = mStudent.cursor( \"ChapelSession\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:SET CURSOR FIRST mStudent.ChapelAttendanceByTerm \r\n //: WHERE mStudent.ChapelAttendanceByTerm.CollegeTerm = mStudent.CollegeTerm.YearSemester \r\n {StringBuilder sb_szTempString_0;\r\n if ( szTempString_0 == null )\r\n sb_szTempString_0 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_0 = new StringBuilder( szTempString_0 );\r\n GetStringFromAttribute( sb_szTempString_0, mStudent, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_0 = sb_szTempString_0.toString( );}\r\n RESULT = mStudent.cursor( \"ChapelAttendanceByTerm\" ).setFirst( \"CollegeTerm\", szTempString_0 ).toInt();\r\n //:IF RESULT < zCURSOR_SET\r\n if ( RESULT < zCURSOR_SET )\r\n { \r\n //:CREATE ENTITY mStudent.ChapelAttendanceByTerm\r\n RESULT = CreateEntity( mStudent, \"ChapelAttendanceByTerm\", zPOS_AFTER );\r\n //:// We keep CollegeYear and Semester for sorting purposes.\r\n //:szCollegeTerm = mStudent.CollegeTerm.YearSemester\r\n {MutableInt mi_lTempInteger_1 = new MutableInt( lTempInteger_1 );\r\n StringBuilder sb_szCollegeTerm;\r\n if ( szCollegeTerm == null )\r\n sb_szCollegeTerm = new StringBuilder( 32 );\r\n else\r\n sb_szCollegeTerm = new StringBuilder( szCollegeTerm );\r\n GetVariableFromAttribute( sb_szCollegeTerm, mi_lTempInteger_1, 'S', 21, mStudent, \"CollegeTerm\", \"YearSemester\", \"\", 0 );\r\n lTempInteger_1 = mi_lTempInteger_1.intValue( );\r\n szCollegeTerm = sb_szCollegeTerm.toString( );}\r\n //:mStudent.ChapelAttendanceByTerm.CollegeTerm = szCollegeTerm\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeTerm\", szCollegeTerm );\r\n //:mStudent.ChapelAttendanceByTerm.CollegeYear = szCollegeTerm[1:9]\r\n {StringBuilder sb_szTempString_0;\r\n if ( szTempString_0 == null )\r\n sb_szTempString_0 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_0 = new StringBuilder( szTempString_0 );\r\n ZeidonStringCopy( sb_szTempString_0, 1, 0, szCollegeTerm, 1, 9, 21 );\r\n szTempString_0 = sb_szTempString_0.toString( );}\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear\", szTempString_0 );\r\n //:mStudent.ChapelAttendanceByTerm.Semester = mStudent.CollegeTerm.Semester\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"Semester\", mStudent, \"CollegeTerm\", \"Semester\" );\r\n //:SET CURSOR FIRST lTermLST2.CollegeTerm WHERE lTermLST2.CollegeTerm.YearSemester = mStudent.CollegeTerm.YearSemester \r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n GetStringFromAttribute( sb_szTempString_1, mStudent, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n RESULT = lTermLST2.cursor( \"CollegeTerm\" ).setFirst( \"YearSemester\", szTempString_1 ).toInt();\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequired = lTermLST2.CollegeTerm.NumberOfChapelsRequired\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequired\", lTermLST2, \"CollegeTerm\", \"NumberOfChapelsRequired\" );\r\n } \r\n\r\n //:END\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsAttended = mStudent.ChapelAttendanceByTerm.TotalChapelsAttended + 1\r\n {MutableInt mi_lTempInteger_2 = new MutableInt( lTempInteger_2 );\r\n GetIntegerFromAttribute( mi_lTempInteger_2, mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsAttended\" );\r\n lTempInteger_2 = mi_lTempInteger_2.intValue( );}\r\n lTempInteger_3 = lTempInteger_2 + 1;\r\n SetAttributeFromInteger( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsAttended\", lTempInteger_3 );\r\n RESULT = mStudent.cursor( \"ChapelSession\" ).setNext().toInt();\r\n } \r\n\r\n //:END\r\n //:FOR EACH mStudent.OverrideChapelRequirement\r\n RESULT = mStudent.cursor( \"OverrideChapelRequirement\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:SET CURSOR FIRST lTermLST2.CollegeTerm WHERE lTermLST2.CollegeTerm.ID = mStudent.OverrideChapelReqCollegeTerm.ID \r\n {MutableInt mi_lTempInteger_4 = new MutableInt( lTempInteger_4 );\r\n GetIntegerFromAttribute( mi_lTempInteger_4, mStudent, \"OverrideChapelReqCollegeTerm\", \"ID\" );\r\n lTempInteger_4 = mi_lTempInteger_4.intValue( );}\r\n RESULT = lTermLST2.cursor( \"CollegeTerm\" ).setFirst( \"ID\", lTempInteger_4 ).toInt();\r\n //:SET CURSOR FIRST mStudent.ChapelAttendanceByTerm WHERE mStudent.ChapelAttendanceByTerm.CollegeTerm = lTermLST2.CollegeTerm.YearSemester\r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n GetStringFromAttribute( sb_szTempString_1, lTermLST2, \"CollegeTerm\", \"YearSemester\" );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n RESULT = mStudent.cursor( \"ChapelAttendanceByTerm\" ).setFirst( \"CollegeTerm\", szTempString_1 ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:// A ChapelAttendanceByTerm entity already exists for the Term, just add the Override value.\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequiredOverride = mStudent.OverrideChapelRequirement.NumberOfChapelsRequiredForTerm\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequiredOverride\", mStudent, \"OverrideChapelRequirement\", \"NumberOfChapelsRequiredForTerm\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// We need to add the ChapelAttendanceByTerm for the Override Term.\r\n //:CREATE ENTITY mStudent.ChapelAttendanceByTerm\r\n RESULT = CreateEntity( mStudent, \"ChapelAttendanceByTerm\", zPOS_AFTER );\r\n //:szCollegeTerm = lTermLST2.CollegeTerm.YearSemester \r\n {MutableInt mi_lTempInteger_5 = new MutableInt( lTempInteger_5 );\r\n StringBuilder sb_szCollegeTerm;\r\n if ( szCollegeTerm == null )\r\n sb_szCollegeTerm = new StringBuilder( 32 );\r\n else\r\n sb_szCollegeTerm = new StringBuilder( szCollegeTerm );\r\n GetVariableFromAttribute( sb_szCollegeTerm, mi_lTempInteger_5, 'S', 21, lTermLST2, \"CollegeTerm\", \"YearSemester\", \"\", 0 );\r\n lTempInteger_5 = mi_lTempInteger_5.intValue( );\r\n szCollegeTerm = sb_szCollegeTerm.toString( );}\r\n //:mStudent.ChapelAttendanceByTerm.CollegeTerm = szCollegeTerm\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeTerm\", szCollegeTerm );\r\n //:mStudent.ChapelAttendanceByTerm.CollegeYear = szCollegeTerm[1:9]\r\n {StringBuilder sb_szTempString_1;\r\n if ( szTempString_1 == null )\r\n sb_szTempString_1 = new StringBuilder( 32 );\r\n else\r\n sb_szTempString_1 = new StringBuilder( szTempString_1 );\r\n ZeidonStringCopy( sb_szTempString_1, 1, 0, szCollegeTerm, 1, 9, 21 );\r\n szTempString_1 = sb_szTempString_1.toString( );}\r\n SetAttributeFromString( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear\", szTempString_1 );\r\n //:mStudent.ChapelAttendanceByTerm.Semester = lTermLST2.CollegeTerm.Semester \r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"Semester\", lTermLST2, \"CollegeTerm\", \"Semester\" );\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequired = lTermLST2.CollegeTerm.NumberOfChapelsRequired \r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequired\", lTermLST2, \"CollegeTerm\", \"NumberOfChapelsRequired\" );\r\n //:mStudent.ChapelAttendanceByTerm.TotalChapelsRequiredOverride = mStudent.OverrideChapelRequirement.NumberOfChapelsRequiredForTerm\r\n SetAttributeFromAttribute( mStudent, \"ChapelAttendanceByTerm\", \"TotalChapelsRequiredOverride\", mStudent, \"OverrideChapelRequirement\", \"NumberOfChapelsRequiredForTerm\" );\r\n } \r\n\r\n RESULT = mStudent.cursor( \"OverrideChapelRequirement\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:DropView( lTermLST2 )\r\n DropView( lTermLST2 );\r\n //:OrderEntityForView( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear D Semester D\" )\r\n OrderEntityForView( mStudent, \"ChapelAttendanceByTerm\", \"CollegeYear D Semester D\" );\r\n //:OrderEntityForView( mStudent, \"ChapelSession\", \"Date D\" )\r\n OrderEntityForView( mStudent, \"ChapelSession\", \"Date D\" );\r\n\r\n //:// Generate Degree1 and Degree2 relationships.\r\n //:FOR EACH mStudent.StudentMajorDegreeTrack \r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.DegreeTrackCollegeDegree EXISTS\r\n lTempInteger_6 = CheckExistenceOfEntity( mStudent, \"DegreeTrackCollegeDegree\" );\r\n if ( lTempInteger_6 == 0 )\r\n { \r\n //:IF mStudent.CollegeDegree1 EXISTS\r\n lTempInteger_7 = CheckExistenceOfEntity( mStudent, \"CollegeDegree1\" );\r\n if ( lTempInteger_7 == 0 )\r\n { \r\n //:IF mStudent.CollegeDegree1.ID != mStudent.DegreeTrackCollegeDegree.ID \r\n if ( CompareAttributeToAttribute( mStudent, \"CollegeDegree1\", \"ID\", mStudent, \"DegreeTrackCollegeDegree\", \"ID\" ) != 0 )\r\n { \r\n //:IF mStudent.CollegeDegree2 DOES NOT EXIST\r\n lTempInteger_8 = CheckExistenceOfEntity( mStudent, \"CollegeDegree2\" );\r\n if ( lTempInteger_8 != 0 )\r\n { \r\n //:INCLUDE mStudent.CollegeDegree2 FROM mStudent.DegreeTrackCollegeDegree\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CollegeDegree2\", mStudent, \"DegreeTrackCollegeDegree\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:INCLUDE mStudent.CollegeDegree1 FROM mStudent.DegreeTrackCollegeDegree\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CollegeDegree1\", mStudent, \"DegreeTrackCollegeDegree\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END \r\n } \r\n\r\n //:END\r\n\r\n //:// Build display subobject of Transcript Requests.\r\n //:FOR EACH mStudent.TranscriptRequest\r\n RESULT = mStudent.cursor( \"TranscriptRequest\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:INCLUDE mStudent.DisplayTranscriptRequest FROM mStudent.TranscriptRequest \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"DisplayTranscriptRequest\", mStudent, \"TranscriptRequest\", zPOS_AFTER );\r\n RESULT = mStudent.cursor( \"TranscriptRequest\" ).setNext().toInt();\r\n } \r\n\r\n //:END\r\n //:OrderEntityForView( mStudent, \"DisplayTranscriptRequest\", \"ID A\" )\r\n OrderEntityForView( mStudent, \"DisplayTranscriptRequest\", \"ID A\" );\r\n\r\n //:// Build derived paths for Degree Candidacy relationship to StudentMajorDegreeTrack and CurrentDegreeCandidacy.\r\n //:FOR EACH mStudent.StudentMajorDegreeTrack \r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.SMDT_DegreeCandidacy EXISTS\r\n lTempInteger_9 = CheckExistenceOfEntity( mStudent, \"SMDT_DegreeCandidacy\" );\r\n if ( lTempInteger_9 == 0 )\r\n { \r\n //:SET CURSOR FIRST mStudent.DegreeCandidacy WHERE mStudent.DegreeCandidacy.ID = mStudent.SMDT_DegreeCandidacy.ID \r\n {MutableInt mi_lTempInteger_10 = new MutableInt( lTempInteger_10 );\r\n GetIntegerFromAttribute( mi_lTempInteger_10, mStudent, \"SMDT_DegreeCandidacy\", \"ID\" );\r\n lTempInteger_10 = mi_lTempInteger_10.intValue( );}\r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst( \"ID\", lTempInteger_10 ).toInt();\r\n //:INCLUDE mStudent.MajorTrackDegreeCandidacy FROM mStudent.DegreeCandidacy \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"MajorTrackDegreeCandidacy\", mStudent, \"DegreeCandidacy\", zPOS_AFTER );\r\n //:INCLUDE mStudent.DC_StudentMajorDegreeTrack FROM mStudent.StudentMajorDegreeTrack \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"DC_StudentMajorDegreeTrack\", mStudent, \"StudentMajorDegreeTrack\", zPOS_AFTER );\r\n } \r\n\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:IF mStudent.DegreeCandidacy EXISTS\r\n lTempInteger_11 = CheckExistenceOfEntity( mStudent, \"DegreeCandidacy\" );\r\n if ( lTempInteger_11 == 0 )\r\n { \r\n //:// Se need to set a work date to be used in sorting DegreeCandidacy entries in descending date order, so that the\r\n //:// most recent entry will be first. If there is a null entry, make it first.\r\n //:FOR EACH mStudent.DegreeCandidacy \r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.DC_GraduationDate EXISTS\r\n lTempInteger_12 = CheckExistenceOfEntity( mStudent, \"DC_GraduationDate\" );\r\n if ( lTempInteger_12 == 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DC_GraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DC_GraduationDate\", \"Date\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_13 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_13 == 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DC_AnticipatedGraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DC_AnticipatedGraduationDate\", \"Date\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.DegreeCandidacy.ReceivedDate != \"\"\r\n if ( CompareAttributeToString( mStudent, \"DegreeCandidacy\", \"ReceivedDate\", \"\" ) != 0 )\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = mStudent.DegreeCandidacy.ReceivedDate\r\n SetAttributeFromAttribute( mStudent, \"DegreeCandidacy\", \"wSortDate\", mStudent, \"DegreeCandidacy\", \"ReceivedDate\" );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:mStudent.DegreeCandidacy.wSortDate = \"21000101\"\r\n SetAttributeFromString( mStudent, \"DegreeCandidacy\", \"wSortDate\", \"21000101\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:OrderEntityForView( mStudent, \"DegreeCandidacy\", \"wSortDate D\" )\r\n OrderEntityForView( mStudent, \"DegreeCandidacy\", \"wSortDate D\" );\r\n //:SET CURSOR FIRST mStudent.DegreeCandidacy \r\n RESULT = mStudent.cursor( \"DegreeCandidacy\" ).setFirst().toInt();\r\n //:INCLUDE mStudent.CurrentDegreeCandidacy FROM mStudent.DegreeCandidacy \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CurrentDegreeCandidacy\", mStudent, \"DegreeCandidacy\", zPOS_AFTER );\r\n //:IF mStudent.DC_StudentMajorDegreeTrack EXISTS \r\n lTempInteger_14 = CheckExistenceOfEntity( mStudent, \"DC_StudentMajorDegreeTrack\" );\r\n if ( lTempInteger_14 == 0 )\r\n { \r\n //:INCLUDE mStudent.CDC_StudentMajorDegreeTrack FROM mStudent.DC_StudentMajorDegreeTrack \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"CDC_StudentMajorDegreeTrack\", mStudent, \"DC_StudentMajorDegreeTrack\", zPOS_AFTER );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Drop any Private Categories that are not from this Functional Area.\r\n //:nRC = GetViewByName( sAppMgr, \"sAppMgr\", mStudent, zLEVEL_APPLICATION )\r\n nRC = GetViewByName( sAppMgr, \"sAppMgr\", mStudent, zLEVEL_APPLICATION );\r\n //:IF nRC >= 0 \r\n if ( nRC >= 0 )\r\n { \r\n //:FOR EACH mStudent.Category \r\n RESULT = mStudent.cursor( \"Category\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudent.Category.PrivateToFunctionalAreaFlag = \"Y\"\r\n if ( CompareAttributeToString( mStudent, \"Category\", \"PrivateToFunctionalAreaFlag\", \"Y\" ) == 0 )\r\n { \r\n //:IF mStudent.Category.FunctionalArea != sAppMgr.FunctionalArea.FunctionalAreaName \r\n if ( CompareAttributeToAttribute( mStudent, \"Category\", \"FunctionalArea\", sAppMgr, \"FunctionalArea\", \"FunctionalAreaName\" ) != 0 )\r\n { \r\n //:DropEntity( mStudent, \"Category\", zREPOS_NONE )\r\n DropEntity( mStudent, \"Category\", zREPOS_NONE );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudent.cursor( \"Category\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Keep Legal Name for change comparison on COMMIT.\r\n //:mStudent.Student.wOriginalLegalName = mStudent.Student.LegalName\r\n SetAttributeFromAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n break ;\r\n\r\n //: /* end zOCE_ACTIVATE */\r\n //:OF zOCE_ACTIVATE_EMPTY:\r\n case zOCE_ACTIVATE_EMPTY :\r\n break ;\r\n\r\n //: /* end zOCE_ACTIVATE_EMPTY */\r\n //:OF zOCE_COMMIT:\r\n case zOCE_COMMIT :\r\n\r\n \t /*\r\n //:IF mStudent.Student EXISTS\r\n lTempInteger_15 = CheckExistenceOfEntity( mStudent, \"Student\" );\r\n if ( lTempInteger_15 == 0 )\r\n { \r\n\r\n //:// If the Legal Name has been changed, create change entry.\r\n //:IF mStudent.Student.wOriginalLegalName != mStudent.Student.LegalName\r\n if ( CompareAttributeToAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" ) != 0 )\r\n { \r\n //:CREATE ENTITY mStudent.PersonalDataModification \r\n RESULT = CreateEntity( mStudent, \"PersonalDataModification\", zPOS_AFTER );\r\n //:mStudent.PersonalDataModification.OriginalLegalName = mStudent.Student.wOriginalLegalName \r\n SetAttributeFromAttribute( mStudent, \"PersonalDataModification\", \"OriginalLegalName\", mStudent, \"Student\", \"wOriginalLegalName\" );\r\n //:mStudent.PersonalDataModification.NewLegalName = mStudent.Student.LegalName \r\n SetAttributeFromAttribute( mStudent, \"PersonalDataModification\", \"NewLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n //:SetAttributeFromCurrentDateTime( mStudent, \"PersonalDataModification\", \"ModifiedDateTime\" )\r\n //:GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION )\r\n GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION );\r\n //:INCLUDE mStudent.PersonalDataModificationUser FROM mUser.User\r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"PersonalDataModificationUser\", mUser, \"User\", zPOS_AFTER );\r\n //:mStudent.Student.wOriginalLegalName = mStudent.Student.LegalName\r\n SetAttributeFromAttribute( mStudent, \"Student\", \"wOriginalLegalName\", mStudent, \"Student\", \"LegalName\" );\r\n } \r\n\r\n //:END\r\n\r\n //:// Set Graduation Dates in StudentMajorDegreeTrack entries, if a Graduation Date has been set in associated Degree Candidacy.\r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:FOR EACH mStudentT.StudentMajorDegreeTrack \r\n RESULT = mStudentT.cursor( \"StudentMajorDegreeTrack\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n //:IF mStudentT.SMDT_GraduationDate EXISTS\r\n lTempInteger_16 = CheckExistenceOfEntity( mStudentT, \"SMDT_GraduationDate\" );\r\n if ( lTempInteger_16 == 0 )\r\n { \r\n //:IF mStudentT.StudentMajorDegreeTrack.GraduationDate != mStudentT.SMDT_GraduationDate.Date \r\n if ( CompareAttributeToAttribute( mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\", mStudentT, \"SMDT_GraduationDate\", \"Date\" ) != 0 )\r\n { \r\n //:mStudentT.StudentMajorDegreeTrack.GraduationDate = mStudentT.SMDT_GraduationDate.Date\r\n SetAttributeFromAttribute( mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\", mStudentT, \"SMDT_GraduationDate\", \"Date\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n RESULT = mStudentT.cursor( \"StudentMajorDegreeTrack\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n\r\n //:// For students that ARE NOT Undergraduate Main Campus, always set ResidencyStatus to Commuter.\r\n //:szCurrentAcademicLevel = mStudent.Student.CurrentLevel\r\n {MutableInt mi_lTempInteger_17 = new MutableInt( lTempInteger_17 );\r\n StringBuilder sb_szCurrentAcademicLevel;\r\n if ( szCurrentAcademicLevel == null )\r\n sb_szCurrentAcademicLevel = new StringBuilder( 32 );\r\n else\r\n sb_szCurrentAcademicLevel = new StringBuilder( szCurrentAcademicLevel );\r\n GetVariableFromAttribute( sb_szCurrentAcademicLevel, mi_lTempInteger_17, 'S', 2, mStudent, \"Student\", \"CurrentLevel\", \"\", 0 );\r\n lTempInteger_17 = mi_lTempInteger_17.intValue( );\r\n szCurrentAcademicLevel = sb_szCurrentAcademicLevel.toString( );}\r\n //:IF mStudent.AdministrativeDivision.ID = 1 AND\r\n //:( szCurrentAcademicLevel = \"1\" OR // Freshman\r\n //:szCurrentAcademicLevel = \"2\" OR // Sophomore\r\n //:szCurrentAcademicLevel = \"3\" OR // Junior\r\n //:szCurrentAcademicLevel = \"4\" OR // Senior\r\n //:szCurrentAcademicLevel = \"7\" OR // Special\r\n //:szCurrentAcademicLevel = \"8\" OR // Freshman-2\r\n //:szCurrentAcademicLevel = \"9\" ) // 5-Yr Senior\r\n if ( CompareAttributeToInteger( mStudent, \"AdministrativeDivision\", \"ID\", 1 ) == 0 && ( ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"1\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"2\", 1, 0, 2 ) == 0 ||\r\n ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"3\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"4\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"7\", 1, 0, 2 ) == 0 ||\r\n ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"8\", 1, 0, 2 ) == 0 || ZeidonStringCompare( szCurrentAcademicLevel, 1, 0, \"9\", 1, 0, 2 ) == 0 ) )\r\n { \r\n\r\n //:// This is case where student is Main Campus undergraduate.\r\n\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudent.Student.ResidencyStatus != \"C\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"ResidencyStatus\", \"C\" ) != 0 )\r\n { \r\n //:mStudent.Student.ResidencyStatus = \"C\"\r\n SetAttributeFromString( mStudent, \"Student\", \"ResidencyStatus\", \"C\" );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:// Automatically set Student graduation date attributes.\r\n //:IF mStudent.Student.UndergradGraduationDate = \"\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"UndergradGraduationDate\", \"\" ) == 0 )\r\n { \r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:SET CURSOR FIRST mStudentT.DegreeMajorCollege WHERE mStudentT.DegreeMajorCollege.Type = \"U\"\r\n RESULT = mStudentT.cursor( \"DegreeMajorCollege\" ).setFirst( \"Type\", \"U\" ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:mStudent.Student.UndergradGraduationDate = mStudentT.StudentMajorDegreeTrack.GraduationDate \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"UndergradGraduationDate\", mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\" );\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n } \r\n\r\n //:END\r\n //:IF mStudent.Student.GradGraduationDate = \"\"\r\n if ( CompareAttributeToString( mStudent, \"Student\", \"GradGraduationDate\", \"\" ) == 0 )\r\n { \r\n //:CreateViewFromView( mStudentT, mStudent )\r\n CreateViewFromView( mStudentT, mStudent );\r\n //:SET CURSOR FIRST mStudentT.DegreeMajorCollege WHERE mStudentT.DegreeMajorCollege.Type = \"G\"\r\n RESULT = mStudentT.cursor( \"DegreeMajorCollege\" ).setFirst( \"Type\", \"G\" ).toInt();\r\n //:IF RESULT >= zCURSOR_SET\r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:mStudent.Student.GradGraduationDate = mStudentT.StudentMajorDegreeTrack.GraduationDate \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"GradGraduationDate\", mStudentT, \"StudentMajorDegreeTrack\", \"GraduationDate\" );\r\n } \r\n\r\n //:END\r\n //:DropView( mStudentT )\r\n DropView( mStudentT );\r\n } \r\n\r\n //:END\r\n\r\n //:// If the Anticipated Grad Date exists, force the Clearing House Grad Date to that value.\r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_18 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_18 == 0 )\r\n { \r\n //:mStudent.Student.ClearingHouseGradDate = mStudent.DC_AnticipatedGraduationDate.Date \r\n SetAttributeFromAttribute( mStudent, \"Student\", \"ClearingHouseGradDate\", mStudent, \"DC_AnticipatedGraduationDate\", \"Date\" );\r\n } \r\n\r\n //:END\r\n\r\n //:// REGULAR CHANGE LOG\r\n //:// Create the Change Log entry.\r\n //:GenerateTransactionEntryWDesc( mStudent, \"General Student Data\" )\r\n\r\n //:// STUDENT CHANGE LOG AND HISTORY\r\n //:// Generate Student Change Log entries, if something has changed. We will determine this by looking at\r\n //:// the last StudentChangeHistory entry and comparing its values.\r\n //:szAnticipatedGradPeriod = \"\"\r\n {StringBuilder sb_szAnticipatedGradPeriod;\r\n if ( szAnticipatedGradPeriod == null )\r\n sb_szAnticipatedGradPeriod = new StringBuilder( 32 );\r\n else\r\n sb_szAnticipatedGradPeriod = new StringBuilder( szAnticipatedGradPeriod );\r\n ZeidonStringCopy( sb_szAnticipatedGradPeriod, 1, 0, \"\", 1, 0, 51 );\r\n szAnticipatedGradPeriod = sb_szAnticipatedGradPeriod.toString( );}\r\n //:IF mStudent.DC_AnticipatedGraduationDate EXISTS\r\n lTempInteger_19 = CheckExistenceOfEntity( mStudent, \"DC_AnticipatedGraduationDate\" );\r\n if ( lTempInteger_19 == 0 )\r\n { \r\n //:szAnticipatedGradPeriod = mStudent.DC_AnticipatedGraduationDate.Name \r\n {MutableInt mi_lTempInteger_20 = new MutableInt( lTempInteger_20 );\r\n StringBuilder sb_szAnticipatedGradPeriod;\r\n if ( szAnticipatedGradPeriod == null )\r\n sb_szAnticipatedGradPeriod = new StringBuilder( 32 );\r\n else\r\n sb_szAnticipatedGradPeriod = new StringBuilder( szAnticipatedGradPeriod );\r\n GetVariableFromAttribute( sb_szAnticipatedGradPeriod, mi_lTempInteger_20, 'S', 51, mStudent, \"DC_AnticipatedGraduationDate\", \"Name\", \"\", 0 );\r\n lTempInteger_20 = mi_lTempInteger_20.intValue( );\r\n szAnticipatedGradPeriod = sb_szAnticipatedGradPeriod.toString( );}\r\n } \r\n\r\n //:END\r\n //:ACTIVATE mStuChgH WHERE mStuChgH.StudentChangeHistory.LastDate = \"\"\r\n //: AND mStuChgH.Student.ID = mStudent.Student.ID \r\n {MutableInt mi_lTempInteger_21 = new MutableInt( lTempInteger_21 );\r\n GetIntegerFromAttribute( mi_lTempInteger_21, mStudent, \"Student\", \"ID\" );\r\n lTempInteger_21 = mi_lTempInteger_21.intValue( );}\r\n omStudent_fnLocalBuildQual_0( mStudent, vTempViewVar_0, lTempInteger_21 );\r\n RESULT = ActivateObjectInstance( mStuChgH, \"mStuChgH\", mStudent, vTempViewVar_0, zSINGLE );\r\n DropView( vTempViewVar_0 );\r\n //:IF RESULT < 0\r\n if ( RESULT < 0 )\r\n { \r\n //:// Since no history record has yet been created, create it here.\r\n //:ACTIVATE mStuChgH EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgH, \"mStuChgH\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgH.StudentChangeHistory \r\n RESULT = CreateEntity( mStuChgH, \"StudentChangeHistory\", zPOS_AFTER );\r\n //:mStuChgH.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:SetAttributeFromCurrentDateTime( mStuChgH, \"StudentChangeHistory\", \"FirstDate\" ) \r\n //:INCLUDE mStuChgH.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgH, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// There is a History entry, so see if anything has changed.\r\n //:szChangeFlag = \"\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n //:GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION )\r\n GetViewByName( mUser, \"mUser\", mStudent, zLEVEL_APPLICATION );\r\n\r\n //:// Student Status\r\n //:IF mStuChgH.StudentChangeHistory.StudentStatus != mStudent.Student.Status \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"Status\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"Status\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"StudentStatus\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"StudentStatus\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Classification (CurrentLevel)\r\n //:IF mStuChgH.StudentChangeHistory.Classification != mStudent.Student.CurrentLevel \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"Classification\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"Classification\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"CurrentLevel\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"CurrentLevel\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"Classification\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"Classification\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Residency Status\r\n //:IF mStuChgH.StudentChangeHistory.ResidencyStatus != mStudent.Student.ResidencyStatus \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"ResidencyStatus\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"ResidencyStatus\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"ResidencyStatus\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"ResidencyStatus\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Financial Hold Flag\r\n //:IF mStuChgH.StudentChangeHistory.FinancialHoldFlag != mStudent.Student.FinancialHoldFlag \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:GetStringFromAttributeByContext( szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", \"\", 50 )\r\n {StringBuilder sb_szOriginalValue;\r\n if ( szOriginalValue == null )\r\n sb_szOriginalValue = new StringBuilder( 32 );\r\n else\r\n sb_szOriginalValue = new StringBuilder( szOriginalValue );\r\n GetStringFromAttributeByContext( sb_szOriginalValue, mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", \"\", 50 );\r\n szOriginalValue = sb_szOriginalValue.toString( );}\r\n //:GetStringFromAttributeByContext( szNewValue, mStudent, \"Student\", \"FinancialHoldFlag\", \"\", 50 )\r\n {StringBuilder sb_szNewValue;\r\n if ( szNewValue == null )\r\n sb_szNewValue = new StringBuilder( 32 );\r\n else\r\n sb_szNewValue = new StringBuilder( szNewValue );\r\n GetStringFromAttributeByContext( sb_szNewValue, mStudent, \"Student\", \"FinancialHoldFlag\", \"\", 50 );\r\n szNewValue = sb_szNewValue.toString( );}\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"FinancialHoldFlag\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"FinancialHoldFlag\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = szOriginalValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", szOriginalValue );\r\n //:mStuChgL.StudentChangeLog.NewValue = szNewValue\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szNewValue );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Administrative Division\r\n //:IF mStuChgH.StudentChangeHistory.AdministrativeDivisionName != mStudent.AdministrativeDivision.Name \r\n if ( CompareAttributeToAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"AdministrativeDivisionName\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"AdministrativeDivisionName\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = mStuChgH.StudentChangeHistory.AdministrativeDivisionName\r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\" );\r\n //:mStuChgL.StudentChangeLog.NewValue = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"NewValue\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// Anticipated Graduation Period\r\n //:IF mStuChgH.StudentChangeHistory.AnticipatedGradPeriod != szAnticipatedGradPeriod\r\n if ( CompareAttributeToString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod ) != 0 )\r\n { \r\n //:ACTIVATE mStuChgL EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgL, \"mStuChgL\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgL.StudentChangeLog \r\n RESULT = CreateEntity( mStuChgL, \"StudentChangeLog\", zPOS_AFTER );\r\n //:mStuChgL.StudentChangeLog.AttributeName = \"AnticipatedGradPeriod\"\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"AttributeName\", \"AnticipatedGradPeriod\" );\r\n //:mStuChgL.StudentChangeLog.OriginalValue = mStuChgH.StudentChangeHistory.AnticipatedGradPeriod\r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"OriginalValue\", mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\" );\r\n //:mStuChgL.StudentChangeLog.NewValue = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgL, \"StudentChangeLog\", \"NewValue\", szAnticipatedGradPeriod );\r\n //:mStuChgL.StudentChangeLog.UserName = mUser.User.UserName \r\n SetAttributeFromAttribute( mStuChgL, \"StudentChangeLog\", \"UserName\", mUser, \"User\", \"UserName\" );\r\n //:SetAttributeFromCurrentDateTime( mStuChgL, \"StudentChangeLog\", \"ModificationDate\" )\r\n //:INCLUDE mStuChgL.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgL, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n //:COMMIT mStuChgL\r\n RESULT = CommitObjectInstance( mStuChgL );\r\n //:DropObjectInstance( mStuChgL )\r\n DropObjectInstance( mStuChgL );\r\n //:szChangeFlag = \"Y\"\r\n {StringBuilder sb_szChangeFlag;\r\n if ( szChangeFlag == null )\r\n sb_szChangeFlag = new StringBuilder( 32 );\r\n else\r\n sb_szChangeFlag = new StringBuilder( szChangeFlag );\r\n ZeidonStringCopy( sb_szChangeFlag, 1, 0, \"Y\", 1, 0, 2 );\r\n szChangeFlag = sb_szChangeFlag.toString( );}\r\n } \r\n\r\n //:END\r\n\r\n //:// If any of the key attributes have changed, then we will:\r\n //:// 1. Create a new Student Change History entry, if the current one was not created today.\r\n //:// 2. Update the current Student Change History entry, if it was created today.\r\n //:IF szChangeFlag = \"Y\"\r\n if ( ZeidonStringCompare( szChangeFlag, 1, 0, \"Y\", 1, 0, 2 ) == 0 )\r\n { \r\n //:szCurrentDate = wXferO.Root.dCurrentDate\r\n {MutableInt mi_lTempInteger_22 = new MutableInt( lTempInteger_22 );\r\n StringBuilder sb_szCurrentDate;\r\n if ( szCurrentDate == null )\r\n sb_szCurrentDate = new StringBuilder( 32 );\r\n else\r\n sb_szCurrentDate = new StringBuilder( szCurrentDate );\r\n GetVariableFromAttribute( sb_szCurrentDate, mi_lTempInteger_22, 'S', 9, wXferO, \"Root\", \"dCurrentDate\", \"\", 0 );\r\n lTempInteger_22 = mi_lTempInteger_22.intValue( );\r\n szCurrentDate = sb_szCurrentDate.toString( );}\r\n //:IF mStuChgH.StudentChangeHistory.FirstDate = szCurrentDate\r\n if ( CompareAttributeToString( mStuChgH, \"StudentChangeHistory\", \"FirstDate\", szCurrentDate ) == 0 )\r\n { \r\n //:// The entry was created today, so just update it.\r\n //:// Note that we can just set all the attributes, without regard to which ones changed,\r\n //:// since this entity is a record of attribute values as of this point in time.\r\n //:mStuChgH.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:COMMIT mStuChgH\r\n RESULT = CommitObjectInstance( mStuChgH );\r\n //:DropObjectInstance( mStuChgH )\r\n DropObjectInstance( mStuChgH );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// The entry was created earlier, so create a new entry with the new values\r\n //:ACTIVATE mStuChgH2 EMPTY \r\n RESULT = ActivateEmptyObjectInstance( mStuChgH2, \"mStuChgH\", mStudent, zSINGLE );\r\n //:CREATE ENTITY mStuChgH2.StudentChangeHistory \r\n RESULT = CreateEntity( mStuChgH2, \"StudentChangeHistory\", zPOS_AFTER );\r\n //:mStuChgH2.StudentChangeHistory.StudentStatus = mStudent.Student.Status \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"StudentStatus\", mStudent, \"Student\", \"Status\" );\r\n //:mStuChgH2.StudentChangeHistory.Classification = mStudent.Student.CurrentLevel \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"Classification\", mStudent, \"Student\", \"CurrentLevel\" );\r\n //:mStuChgH2.StudentChangeHistory.ResidencyStatus = mStudent.Student.ResidencyStatus \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"ResidencyStatus\", mStudent, \"Student\", \"ResidencyStatus\" );\r\n //:mStuChgH2.StudentChangeHistory.FinancialHoldFlag = mStudent.Student.FinancialHoldFlag \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"FinancialHoldFlag\", mStudent, \"Student\", \"FinancialHoldFlag\" );\r\n //:mStuChgH2.StudentChangeHistory.AdministrativeDivisionName = mStudent.AdministrativeDivision.Name \r\n SetAttributeFromAttribute( mStuChgH2, \"StudentChangeHistory\", \"AdministrativeDivisionName\", mStudent, \"AdministrativeDivision\", \"Name\" );\r\n //:mStuChgH2.StudentChangeHistory.AnticipatedGradPeriod = szAnticipatedGradPeriod\r\n SetAttributeFromString( mStuChgH2, \"StudentChangeHistory\", \"AnticipatedGradPeriod\", szAnticipatedGradPeriod );\r\n //:SetAttributeFromCurrentDateTime( mStuChgH2, \"StudentChangeHistory\", \"FirstDate\" )\r\n //:INCLUDE mStuChgH2.Student FROM mStudent.Student\r\n RESULT = IncludeSubobjectFromSubobject( mStuChgH2, \"Student\", mStudent, \"Student\", zPOS_AFTER );\r\n\r\n //:// Set the LastDate attribute in the previous history entry to yesterday.\r\n //:SetAttributeFromCurrentDateTime( wXferO, \"Root\", \"WorkDate\" )\r\n //:mStuChgH.StudentChangeHistory.LastDate = wXferO.Root.WorkDate \r\n SetAttributeFromAttribute( mStuChgH, \"StudentChangeHistory\", \"LastDate\", wXferO, \"Root\", \"WorkDate\" );\r\n\r\n //:COMMIT mStuChgH\r\n RESULT = CommitObjectInstance( mStuChgH );\r\n //:COMMIT mStuChgH2\r\n RESULT = CommitObjectInstance( mStuChgH2 );\r\n //:DropObjectInstance( mStuChgH2 )\r\n DropObjectInstance( mStuChgH2 );\r\n //:DropObjectInstance( mStuChgH )\r\n DropObjectInstance( mStuChgH );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n*/\r\n\r\n //:END\r\n break ;\r\n\r\n //: /* end zOCE_COMMIT */\r\n //:OF zOCE_DROPOI:\r\n case zOCE_DROPOI :\r\n break ;\r\n } \r\n\r\n\r\n //: /* end zOCE_DROPOI */\r\n //:END /* case */\r\n return( 0 );\r\n// END\r\n}", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "@Override\r\n public Portfolio calculateBlockchainPortfolioVol(int nCoinsInPortfolio, String portName) throws CoinDataAPIException {\n List<PowerRate> powerRates = new ArrayList<PowerRate>();\r\n List<CoinJson> coinJsonList= coinData.all(), neededCoins = new ArrayList<CoinJson>();\r\n int counter=0;\r\n //collect the coins\r\n for(CoinJson coinJson : coinJsonList){\r\n if( (System.currentTimeMillis() - coinJson.getBirthdate().getTime() ) > 1000*60*60*24*30 ) counter++;\r\n PowerRate powerRate = new PowerRate();\r\n powerRate.setWeight(calculateSD(coinData.coinHistoryByIdcoin(coinJson.getIdcoin())));\r\n powerRate.setCategory(coinJson.getCategoryCoin().getName());\r\n powerRate.setIdcoin(coinJson.getIdcoin());\r\n //add\r\n powerRates.add(powerRate);\r\n if(counter>=nCoinsInPortfolio) break;\r\n }\r\n //correct the weights\r\n List<PowerRate> correctCoins = calculateWeight(powerRates);\r\n //now lets set the portfolio\r\n Portfolio portfolio = new Portfolio();\r\n portfolio.setCoins(correctCoins);\r\n portfolio.setCreated( new Date());\r\n portfolio.setName(portName);\r\n portfolio.setType(\"blockchain-vol\");\r\n\r\n return portfolio;\r\n }", "private NbaRequirementResponseVO processRequirements(NbaRequirementRequestVO reqRequestVO) throws NbaBaseException {\n NbaRequirementResponseVO reqRespVO = new NbaRequirementResponseVO();\n String partyID = null;\n long personCode;\n long personSeq;\n List insuredRelations = reqRequestVO.getRelationsToUpdate();\n int count = insuredRelations.size(); \n NbaTXLife nbaTXLife = reqRequestVO.getNbaTXLife();\n NbaDst nbaDst = reqRequestVO.getNbaDst();\n reqRespVO.setReqMap(new HashMap(count));\n setPartyMapForLastReqIndicator(reqRequestVO);//NBLXA186-NBLXA1271\n for (int i = 0; i < count; i++) {\n Relation relation = (Relation) insuredRelations.get(i);\n partyID = relation.getRelatedObjectID();\n personCode = relation.getRelationRoleCode();\n personSeq = Long.parseLong(relation.getRelatedRefID());\n List requirements = (List) reqRequestVO.getReqMap().get(partyID);\n if (requirements != null) {\n commitRequirements(reqRequestVO, requirements, partyID, personCode, personSeq, nbaTXLife, nbaDst);\n //TODO passing map back to see if we can make commit/retrieve more efficient\n reqRespVO.getReqMap().put(partyID, requirements);\n }\n }\n reqRespVO.setNbaTXLife(nbaTXLife);\n reqRespVO.setNbaDst(nbaDst);\n return reqRespVO;\n \n }", "private MaintenanceRequest initializeCostAvoidanceIndicators(MaintenanceRequest maintenanceRequest){\n\t\tmaintenanceRequest.setGoodwillIndicator(hasGoodwill(maintenanceRequest));\n\t\t\n\t\tif(!MALUtilities.isEmpty(maintenanceRequest.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask task : maintenanceRequest.getMaintenanceRequestTasks()){\n\t\t\t\ttask = initializeCostAvoidanceIndicators(task);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn maintenanceRequest;\n\t}", "private void addC2Constraints(double[] alpha, GRBVar[][] xVars, GRBVar[][] yVars, GRBModel model)\n\t\t\tthrows GRBException {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tString constraintName = \"constraintC2_\" + i;\n\t\t\t// out_x(i) + out_y(i) - in_y(i) = alpha_i\n\t\t\tGRBLinExpr constraintLinExpr = new GRBLinExpr();\n\n\t\t\t// Expression += out_x(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, xVars, constraintLinExpr);\n\n\t\t\t// Expression += out_y(i)\n\t\t\tGRBSolverUtils.addOutTerm(i, 1, mExplicitMDP, yVars, constraintLinExpr);\n\n\t\t\t// Expression -= in_y(i)\n\t\t\tGRBSolverUtils.addInTerm(i, -1, mExplicitMDP, yVars, constraintLinExpr);\n\n\t\t\t// Add constraint\n\t\t\tmodel.addConstr(constraintLinExpr, GRB.EQUAL, alpha[i], constraintName);\n\t\t}\n\t}", "ConditionsDTO createConditionsDTO(final Rule source) {\n\t\tfinal ConditionsDTO conditionsDto = new ConditionsDTO();\n\n\t\tfinal List<RuleCondition> conditions = new ArrayList<RuleCondition>(source.getConditions());\n\t\tfinal BooleanComponentDTO limitedConditionDTO = retrieveLimitedUsageCondition(conditions);\n\t\tfinal BooleanComponentDTO couponCodeDTO = retrieveCouponCodeCondition(conditions);\n\n\t\tif (!conditions.isEmpty()) {\n\t\t\tfinal BooleanComponentDTO eligibilitiesAndConditionsDTO = new AndDTO();\n\t\t\teligibilitiesAndConditionsDTO.setComponents(Arrays.asList(createConditionComposition(conditions, source.getConditionOperator())));\n\t\t\tconditionsDto.setConditionsComponent(eligibilitiesAndConditionsDTO);\n\t\t}\n\n\t\taddCouponCondition(conditionsDto, couponCodeDTO);\n\t\taddLimitedCondition(conditionsDto, limitedConditionDTO);\n\n\t\treturn conditionsDto;\n\t}", "public double[] CstValue2(double[] x, int n1, int m1, NodesVector nvector, PipesVector pvector,\n\t\t\tDiametersVector dvector, TapsVector tvector, double[] LoadFactor, double outflow) {\n\t\tdouble[] Cst = new double[m1];\n\t\tNodes nodes;\n\t\tPipes pipes;\n\t\tString n_end;\n\n\t\t/* Les noeuds sans les robinets */\n\t\tfor (int i = 1; i < (nvector.size() - tvector.size()); i++) {\n\t\t\tCst[i - 1] = 0;\n\t\t\tnodes = (Nodes) nvector.elementAt(i);\n\n\t\t\tfor (int j = 0; j < (nodes.path.size() - 1); j++) {\n\t\t\t\tn_end = (String) nodes.path.elementAt(j);\n\n\t\t\t\tpipes = (Pipes) pvector.elementAt(pvector.getPosition(n_end));\n\n\t\t\t\tCst[i - 1] = Cst[i - 1]\n\t\t\t\t\t\t+ ((pipes.l1 * Math.pow(LoadFactor[pvector.getPosition(n_end)], pipes.p1))\n\t\t\t\t\t\t\t\t/ Math.pow(pipes.d1, pipes.q1) * pipes.beta1)\n\t\t\t\t\t\t+ ((pipes.l2 * Math.pow(LoadFactor[pvector.getPosition(n_end)], pipes.p2))\n\t\t\t\t\t\t\t\t/ Math.pow(pipes.d2, pipes.q2) * pipes.beta2);\n\t\t\t}\n\n\t\t\tnodes.pressure = Cst[i - 1];\n\t\t}\n\n\t\t/* Les robinets */\n\t\tfor (int i = nvector.size() - tvector.size(); i < nvector.size(); i++) {\n\t\t\tCst[i - 1] = 0;\n\t\t\tnodes = (Nodes) nvector.elementAt(i);\n\n\t\t\tfor (int j = 0; j < (nodes.path.size() - 1); j++) {\n\t\t\t\tn_end = (String) nodes.path.elementAt(j);\n\t\t\t\tpipes = (Pipes) pvector.elementAt(pvector.getPosition(n_end));\n\n\t\t\t\tCst[i - 1] = Cst[i - 1]\n\t\t\t\t\t\t+ ((pipes.l1 * Math.pow(LoadFactor[pvector.getPosition(n_end)], pipes.p1))\n\t\t\t\t\t\t\t\t/ Math.pow(pipes.d1, pipes.q1) * pipes.beta1)\n\t\t\t\t\t\t+ ((pipes.l2 * Math.pow(LoadFactor[pvector.getPosition(n_end)], pipes.p2))\n\t\t\t\t\t\t\t\t/ Math.pow(pipes.d2, pipes.q2) * pipes.beta2);\n\t\t\t}\n\n\t\t\tnodes.pressure = Cst[i - 1];\n\t\t}\n\n\t\treturn Cst;\n\t}" ]
[ "0.49333188", "0.47457168", "0.47104055", "0.4622128", "0.45666656", "0.45471382", "0.45235628", "0.44968522", "0.4460658", "0.44345257", "0.44276357", "0.4417899", "0.43890798", "0.43724954", "0.43718514", "0.43661314", "0.43578488", "0.4304602", "0.42962167", "0.4291844", "0.42845288", "0.4282736", "0.42777118", "0.42764238", "0.4257966", "0.42479712", "0.42478284", "0.42307398", "0.4227892", "0.42232087", "0.42198417", "0.421925", "0.42038816", "0.42030787", "0.4186668", "0.41859552", "0.4178534", "0.41758305", "0.41712004", "0.41652042", "0.41631347", "0.414194", "0.4137832", "0.41343042", "0.41244766", "0.41223377", "0.41196445", "0.40968266", "0.4094768", "0.40893885", "0.40748644", "0.40708226", "0.40659517", "0.40605778", "0.40571305", "0.40501595", "0.40383995", "0.40336487", "0.40239373", "0.39969423", "0.3992943", "0.3990865", "0.39777243", "0.39708203", "0.3968552", "0.39639845", "0.39580667", "0.39542374", "0.39524853", "0.39509878", "0.39488915", "0.39473754", "0.39472327", "0.3946755", "0.3940823", "0.3939282", "0.39363894", "0.39361864", "0.3934884", "0.3927066", "0.39267245", "0.39141938", "0.39135057", "0.39087972", "0.39049837", "0.39048567", "0.38999245", "0.38984165", "0.38975006", "0.3892448", "0.38904697", "0.3890196", "0.38892615", "0.3888155", "0.3884556", "0.38838577", "0.3883737", "0.3881767", "0.38797206", "0.38764003" ]
0.48803034
1
Generate the Jacobian of the Dirty PV to the Manifest Measure
public org.drip.quant.calculus.WengertJacobian jackDDirtyPVDManifestMeasure ( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp) { if (null == valParams || valParams.valueDate() >= maturity().julian() || null == csqs) return null; org.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState (fundingLabel()); if (null == dcFunding) return null; try { org.drip.quant.calculus.WengertJacobian jackDDirtyPVDManifestMeasure = null; for (org.drip.analytics.cashflow.CompositePeriod p : _lsPeriod) { int iPeriodPayDate = p.payDate(); if (p.startDate() < valParams.valueDate()) continue; org.drip.quant.calculus.WengertJacobian jackDDFDManifestMeasure = dcFunding.jackDDFDManifestMeasure (iPeriodPayDate, "PV"); if (null == jackDDFDManifestMeasure) continue; int iNumQuote = jackDDFDManifestMeasure.numParameters(); if (0 == iNumQuote) continue; if (null == jackDDirtyPVDManifestMeasure) jackDDirtyPVDManifestMeasure = new org.drip.quant.calculus.WengertJacobian (1, iNumQuote); double dblPeriodNotional = p.notional (p.startDate(), p.endDate()) * p.fx (csqs); double dblPeriodDCF = p.couponMetrics (valParams.valueDate(), csqs).dcf(); for (int k = 0; k < iNumQuote; ++k) { if (!jackDDirtyPVDManifestMeasure.accumulatePartialFirstDerivative (0, k, dblPeriodNotional * dblPeriodDCF * jackDDFDManifestMeasure.firstDerivative (0, k))) return null; } } return jackDDirtyPVDManifestMeasure; } catch (java.lang.Exception e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Jacobian {\n\n /**\n * Fetch an element in the jacobian matrix. Bounds checking is up to the implementer.\n * @param row Row id in matrix. Number from 0 to getRowSize()-1\n * @param col Column id in matrix. Number from 0 to getColumnSize()-1\n */\n double get(int row,int col);\n\n /**\n * @return The number of rows contained in the jacobian\n */\n int getRowSize();\n\n /**\n * @return The number of columns contained in the jacobian.\n */\n int getColSize();\n\n /**\n * Sets new estimates for the variables in the jacobian, forcing it to recalculate all its derivatives.\n * REMEMBER: This method must be run at least once prior to use!\n * @param estimates New estimates for all the variables in the jacobian. The size of this parameter must be exactly the same as the number returned by getColSize().\n */\n void setNewEstimates(double[] estimates);\n\n /**\n * @param num The index of the residual to fetch.\n * @return Residual from one DRSS equation\n */\n double getResidual(int num);\n\n}", "public Jacobian (Element element, UniversalElement universalElement) {\n\n this.jacobianMatrix = new double[universalElement.getNumberOfAllIntegrationPoints()][2][2];\n this.dXByDXi = new double[universalElement.getNumberOfAllIntegrationPoints()];\n this.dXByDEta = new double[universalElement.getNumberOfAllIntegrationPoints()];\n this.dYByDXi = new double[universalElement.getNumberOfAllIntegrationPoints()];\n this.dYByDEta = new double[universalElement.getNumberOfAllIntegrationPoints()];\n\n for (int i = 0; i < universalElement.getNumberOfAllIntegrationPoints(); i++) {\n dXByDXi[i] = 0;\n dXByDEta[i] = 0;\n dYByDXi[i] = 0;\n dYByDEta[i] = 0;\n\n for (int j = 0; j < 4; j++) { //because we have 4 apexes (and because of that we have 4 shape functions)\n dXByDXi[i] += universalElement.getdNByDXi()[i][j] * element.getID()[j].getX();\n dXByDEta[i] += universalElement.getdNByDEta()[i][j] * element.getID()[j].getX();\n dYByDXi[i] += universalElement.getdNByDXi()[i][j] * element.getID()[j].getY();\n dYByDEta[i] += universalElement.getdNByDEta()[i][j] * element.getID()[j].getY();\n }\n\n jacobianMatrix[i][0][0] = dXByDXi[i];\n jacobianMatrix[i][0][1] = dYByDXi[i];\n jacobianMatrix[i][1][0] = dXByDEta[i];\n jacobianMatrix[i][1][1] = dYByDEta[i];\n\n }\n\n calculateDeterminants(universalElement.getNumberOfAllIntegrationPoints());\n invertJacobians();\n }", "public abstract float mo12693b(C1085v vVar);", "public void calculate(double[] theta) {\r\n dvModel.vectorToParams(theta);\r\n\r\n double localValue = 0.0;\r\n double[] localDerivative = new double[theta.length];\r\n\r\n TwoDimensionalMap<String, String, SimpleMatrix> binaryW_dfsG,binaryW_dfsB;\r\n binaryW_dfsG = TwoDimensionalMap.treeMap();\r\n binaryW_dfsB = TwoDimensionalMap.treeMap();\r\n TwoDimensionalMap<String, String, SimpleMatrix> binaryScoreDerivativesG,binaryScoreDerivativesB ;\r\n binaryScoreDerivativesG = TwoDimensionalMap.treeMap();\r\n binaryScoreDerivativesB = TwoDimensionalMap.treeMap();\r\n Map<String, SimpleMatrix> unaryW_dfsG,unaryW_dfsB ;\r\n unaryW_dfsG = new TreeMap<String, SimpleMatrix>();\r\n unaryW_dfsB = new TreeMap<String, SimpleMatrix>();\r\n Map<String, SimpleMatrix> unaryScoreDerivativesG,unaryScoreDerivativesB ;\r\n unaryScoreDerivativesG = new TreeMap<String, SimpleMatrix>();\r\n unaryScoreDerivativesB= new TreeMap<String, SimpleMatrix>();\r\n\r\n Map<String, SimpleMatrix> wordVectorDerivativesG = new TreeMap<String, SimpleMatrix>();\r\n Map<String, SimpleMatrix> wordVectorDerivativesB = new TreeMap<String, SimpleMatrix>();\r\n\r\n for (TwoDimensionalMap.Entry<String, String, SimpleMatrix> entry : dvModel.binaryTransform) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n binaryW_dfsG.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));\r\n binaryW_dfsB.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));\r\n binaryScoreDerivativesG.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(1, numRows));\r\n binaryScoreDerivativesB.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(1, numRows));\r\n }\r\n for (Map.Entry<String, SimpleMatrix> entry : dvModel.unaryTransform.entrySet()) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n unaryW_dfsG.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n unaryW_dfsB.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n unaryScoreDerivativesG.put(entry.getKey(), new SimpleMatrix(1, numRows));\r\n unaryScoreDerivativesB.put(entry.getKey(), new SimpleMatrix(1, numRows));\r\n }\r\n if (op.trainOptions.trainWordVectors) {\r\n for (Map.Entry<String, SimpleMatrix> entry : dvModel.wordVectors.entrySet()) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n wordVectorDerivativesG.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n wordVectorDerivativesB.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n }\r\n }\r\n\r\n // Some optimization methods prints out a line without an end, so our\r\n // debugging statements are misaligned\r\n Timing scoreTiming = new Timing();\r\n scoreTiming.doing(\"Scoring trees\");\r\n int treeNum = 0;\r\n MulticoreWrapper<Tree, Pair<DeepTree, DeepTree>> wrapper = new MulticoreWrapper<Tree, Pair<DeepTree, DeepTree>>(op.trainOptions.trainingThreads, new ScoringProcessor());\r\n for (Tree tree : trainingBatch) {\r\n wrapper.put(tree);\r\n }\r\n wrapper.join();\r\n scoreTiming.done();\r\n while (wrapper.peek()) {\r\n Pair<DeepTree, DeepTree> result = wrapper.poll();\r\n DeepTree goldTree = result.first;\r\n DeepTree bestTree = result.second;\r\n\r\n StringBuilder treeDebugLine = new StringBuilder();\r\n Formatter formatter = new Formatter(treeDebugLine);\r\n boolean isDone = (Math.abs(bestTree.getScore() - goldTree.getScore()) <= 0.00001 || goldTree.getScore() > bestTree.getScore());\r\n String done = isDone ? \"done\" : \"\";\r\n formatter.format(\"Tree %6d Highest tree: %12.4f Correct tree: %12.4f %s\", treeNum, bestTree.getScore(), goldTree.getScore(), done);\r\n System.err.println(treeDebugLine.toString());\r\n if (!isDone){\r\n // if the gold tree is better than the best hypothesis tree by\r\n // a large enough margin, then the score difference will be 0\r\n // and we ignore the tree\r\n\r\n double valueDelta = bestTree.getScore() - goldTree.getScore();\r\n //double valueDelta = Math.max(0.0, - scoreGold + bestScore);\r\n localValue += valueDelta;\r\n\r\n // get the context words for this tree - should be the same\r\n // for either goldTree or bestTree\r\n List<String> words = getContextWords(goldTree.getTree());\r\n\r\n // The derivatives affected by this tree are only based on the\r\n // nodes present in this tree, eg not all matrix derivatives\r\n // will be affected by this tree\r\n backpropDerivative(goldTree.getTree(), words, goldTree.getVectors(),\r\n binaryW_dfsG, unaryW_dfsG,\r\n binaryScoreDerivativesG, unaryScoreDerivativesG,\r\n wordVectorDerivativesG);\r\n\r\n backpropDerivative(bestTree.getTree(), words, bestTree.getVectors(),\r\n binaryW_dfsB, unaryW_dfsB,\r\n binaryScoreDerivativesB, unaryScoreDerivativesB,\r\n wordVectorDerivativesB);\r\n\r\n }\r\n ++treeNum;\r\n }\r\n\r\n double[] localDerivativeGood;\r\n double[] localDerivativeB;\r\n if (op.trainOptions.trainWordVectors) {\r\n localDerivativeGood = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsG.valueIterator(), unaryW_dfsG.values().iterator(),\r\n binaryScoreDerivativesG.valueIterator(),\r\n unaryScoreDerivativesG.values().iterator(),\r\n wordVectorDerivativesG.values().iterator());\r\n\r\n localDerivativeB = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsB.valueIterator(), unaryW_dfsB.values().iterator(),\r\n binaryScoreDerivativesB.valueIterator(),\r\n unaryScoreDerivativesB.values().iterator(),\r\n wordVectorDerivativesB.values().iterator());\r\n } else {\r\n localDerivativeGood = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsG.valueIterator(), unaryW_dfsG.values().iterator(),\r\n binaryScoreDerivativesG.valueIterator(),\r\n unaryScoreDerivativesG.values().iterator());\r\n\r\n localDerivativeB = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsB.valueIterator(), unaryW_dfsB.values().iterator(),\r\n binaryScoreDerivativesB.valueIterator(),\r\n unaryScoreDerivativesB.values().iterator());\r\n }\r\n\r\n // correct - highest\r\n for (int i =0 ;i<localDerivativeGood.length;i++){\r\n localDerivative[i] = localDerivativeB[i] - localDerivativeGood[i];\r\n }\r\n\r\n // TODO: this is where we would combine multiple costs if we had parallelized the calculation\r\n value = localValue;\r\n derivative = localDerivative;\r\n\r\n // normalizing by training batch size\r\n value = (1.0/trainingBatch.size()) * value;\r\n ArrayMath.multiplyInPlace(derivative, (1.0/trainingBatch.size()));\r\n\r\n // add regularization to cost:\r\n double[] currentParams = dvModel.paramsToVector();\r\n double regCost = 0;\r\n for (int i = 0 ; i<currentParams.length;i++){\r\n regCost += currentParams[i] * currentParams[i];\r\n }\r\n regCost = op.trainOptions.regCost * 0.5 * regCost;\r\n value += regCost;\r\n // add regularization to gradient\r\n ArrayMath.multiplyInPlace(currentParams, op.trainOptions.regCost);\r\n ArrayMath.pairwiseAddInPlace(derivative, currentParams);\r\n\r\n }", "public void calcInc(int np)\n\t{\n \n findSpecEq();\n int nofc=numberOfComponents;\n fvec.timesEquals(0.0);\n fvec.set(nofc+1,0,1.0);\n Matrix dxds=Jac.solve(fvec);\n if (np<5)\n {\n double dp=0.01;\n ds=dp/dxds.get(nofc+1,0);\n Xgij.setMatrix(0,nofc+1,np-1,np-1,u);\n dxds.timesEquals(ds);\n // dxds.print(0,10);\n u.plusEquals(dxds);\n // Xgij.print(0,10);\n// u.print(0,10);\n }\n else\n {\n //System.out.println(\"iter \" +iter + \" np \" + np);\n if (iter>6)\n { \n ds *= 0.5;\n System.out.println(\"ds > 6\");\n }\n \n else\n {\n if (iter<3) {\n ds *= 1.5;\n }\n if (iter==3) {\n ds *= 1.1;\n }\n if (iter==4) {\n ds *= 1.0;\n }\n if (iter>4) {\n ds *= 0.5;\n }\n \n// Now we check wheater this ds is greater than dTmax and dPmax.\n if(Math.abs(system.getTemperature()*dxds.get(nofc,0)*ds)>dTmax){\n // System.out.println(\"true T\");\n ds=sign(dTmax/system.getTemperature()/Math.abs(dxds.get(nofc,0)),ds);\n }\n \n if(Math.abs(system.getPressure()*dxds.get(nofc+1,0)*ds)>dPmax)\n {\n ds=sign(dPmax/system.getPressure()/Math.abs(dxds.get(nofc+1,0)),ds);\n // System.out.println(\"true P\");\n }\n if (etterCP2) {\n etterCP2=false;\n ds = 0.5*ds;\n }\n \n Xgij.setMatrix(0,nofc+1,0,2,Xgij.getMatrix(0,nofc+1,1,3)); \n Xgij.setMatrix(0,nofc+1,3,3,u);\n s.setMatrix(0,0,0,3,Xgij.getMatrix(speceq,speceq,0,3));\n // s.print(0,10);\n // System.out.println(\"ds1 : \" + ds);\n calcInc2(np);\n // System.out.println(\"ds2 : \" + ds);\n \n// Here we find the next point from the polynomial.\n \n }\n }\n }", "private DoubleMatrix2D jacobianDirect(double[][] res, int nbTrades, int totalParamsGroup, int totalParamsPrevious) {\n double[][] direct = new double[totalParamsGroup][totalParamsGroup];\n for (int i = 0; i < nbTrades; i++) {\n System.arraycopy(res[i], totalParamsPrevious, direct[i], 0, totalParamsGroup);\n }\n return MATRIX_ALGEBRA.getInverse(new DoubleMatrix2D(direct));\n }", "public AbstractDoubleMatrix getTransitionMatrixJacobian(AbstractDoubleVector state)\r\n\t{\n\r\n\t\tF.setElement(0, 2, -d*sin);\r\n\t\tF.setElement(1, 2, d*cos);\r\n\r\n\t\treturn F;\r\n\t}", "@Override\n public void apply$mcVD$sp (double arg0)\n {\n\n }", "public org.drip.quant.calculus.WengertJacobian manifestMeasureDFMicroJack (\n\t\tfinal java.lang.String strManifestMeasure,\n\t\tfinal org.drip.param.valuation.ValuationParams valParams,\n\t\tfinal org.drip.param.pricer.CreditPricerParams pricerParams,\n\t\tfinal org.drip.param.market.CurveSurfaceQuoteContainer csqs,\n\t\tfinal org.drip.param.valuation.ValuationCustomizationParams vcp)\n\t{\n\t\tif (null == valParams || valParams.valueDate() >= _lsPeriod.get (_lsPeriod.size() - 1).endDate() ||\n\t\t\tnull == strManifestMeasure)\n\t\t\treturn null;\n\n\t\torg.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState\n\t\t\t(org.drip.state.identifier.FundingLabel.Standard (payCurrency()));\n\n\t\tif (null == dcFunding) return null;\n\n\t\tif (\"Rate\".equalsIgnoreCase (strManifestMeasure) || \"SwapRate\".equalsIgnoreCase (strManifestMeasure))\n\t\t{\n\t\t\torg.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapMeasures = value\n\t\t\t\t(valParams, pricerParams, csqs, vcp);\n\n\t\t\tif (null == mapMeasures) return null;\n\n\t\t\tdouble dblDirtyDV01 = mapMeasures.get (\"DirtyDV01\");\n\n\t\t\tdouble dblParSwapRate = mapMeasures.get (\"SwapRate\");\n\n\t\t\ttry {\n\t\t\t\torg.drip.quant.calculus.WengertJacobian wjSwapRateDFMicroJack = null;\n\n\t\t\t\tfor (org.drip.analytics.cashflow.CompositePeriod p : _lsPeriod) {\n\t\t\t\t\tint iPeriodPayDate = p.payDate();\n\n\t\t\t\t\tif (iPeriodPayDate < valParams.valueDate()) continue;\n\n\t\t\t\t\tdouble dblPeriodDCF = p.couponMetrics (valParams.valueDate(), csqs).dcf();\n\n\t\t\t\t\torg.drip.quant.calculus.WengertJacobian wjPeriodFwdRateDF =\n\t\t\t\t\t\tdcFunding.jackDForwardDManifestMeasure (p.startDate(), p.endDate(), \"Rate\",\n\t\t\t\t\t\t\tdblPeriodDCF);\n\n\t\t\t\t\torg.drip.quant.calculus.WengertJacobian wjPeriodPayDFDF =\n\t\t\t\t\t\tdcFunding.jackDDFDManifestMeasure (iPeriodPayDate, \"Rate\");\n\n\t\t\t\t\tif (null == wjPeriodFwdRateDF || null == wjPeriodPayDFDF) continue;\n\n\t\t\t\t\tdouble dblForwardRate = dcFunding.libor (p.startDate(), p.endDate());\n\n\t\t\t\t\tdouble dblPeriodPayDF = dcFunding.df (iPeriodPayDate);\n\n\t\t\t\t\tif (null == wjSwapRateDFMicroJack)\n\t\t\t\t\t\twjSwapRateDFMicroJack = new org.drip.quant.calculus.WengertJacobian (1,\n\t\t\t\t\t\t\twjPeriodFwdRateDF.numParameters());\n\n\t\t\t\t\tdouble dblPeriodNotional = notional (p.startDate(), p.endDate());\n\n\t\t\t\t\tfor (int k = 0; k < wjPeriodFwdRateDF.numParameters(); ++k) {\n\t\t\t\t\t\tdouble dblPeriodMicroJack = (dblForwardRate - dblParSwapRate) *\n\t\t\t\t\t\t\twjPeriodPayDFDF.firstDerivative (0, k) + dblPeriodPayDF *\n\t\t\t\t\t\t\t\twjPeriodFwdRateDF.firstDerivative (0, k);\n\n\t\t\t\t\t\tif (!wjSwapRateDFMicroJack.accumulatePartialFirstDerivative (0, k, dblPeriodNotional\n\t\t\t\t\t\t\t* dblPeriodDCF * dblPeriodMicroJack / dblDirtyDV01))\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn wjSwapRateDFMicroJack;\n\t\t\t} catch (java.lang.Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public static native void OpenMM_AmoebaAngleForce_getAngleParameters(PointerByReference target, int index, IntBuffer particle1, IntBuffer particle2, IntBuffer particle3, DoubleBuffer length, DoubleBuffer quadraticK);", "void kernel_load_parameters(double max_point_distance) {\n\t Matrix3 covariance_xyz = node.m_covariance;\n\t Matrix3 jacobian_normal = new Matrix3();\n Vector4d n = node.normal1.Normalized();\n // Jacobian Matrix calculation\n //double t=1.0;\n double EPS2 = 0.00001; //epsilon?\n Vector4d p = n.multiply(rho);\n double w = (p.x * p.x) + (p.y * p.y);\n double p2 = w + (p.z * p.z);\n double sqrtW = Math.sqrt(w);\n jacobian_normal.set(0,0, n.x);\n\t jacobian_normal.set(0,1, n.y);\n\t jacobian_normal.set(0,2, n.z);\n jacobian_normal.set(1,0, sqrtW<EPS2?(p.x * p.z)/EPS2:(p.x * p.z) / (sqrtW * p2)); \n\t jacobian_normal.set(1,1, sqrtW<EPS2?(p.y * p.z)/EPS2:(p.y * p.z) / (sqrtW * p2)); \n\t jacobian_normal.set(1,2, p2<EPS2?-sqrtW/EPS2:(-sqrtW / p2));\n jacobian_normal.set(2,0, (w<EPS2)?-p.y/EPS2:-p.y / w);\n\t jacobian_normal.set(2,1, (w<EPS2)?p.x/EPS2:p.x / w);\n\t jacobian_normal.set(2,2, 0.0);\n \n\t // Area importance (w_a) \n double w_a = 0.75;\n // Number-of-points importance (w_d)\n double w_d = 1- w_a;\n // w_a times node size over octree size plus w_d times samples in cluster over total samples in cloud\n node.representativeness = ( ((double)node.m_size/(double)node.m_root.m_size) * w_a ) + \n\t\t\t\t\t\t\t\t( ((double)node.m_indexes.size()/(double)node.m_root.m_points.size()) * w_d );\n\n // Uncertainty propagation\n\t Matrix3 jacobian_transposed_normal = Matrix3.transpose(jacobian_normal);\n\t // calculate covariance matrix\n\t // First order uncertainty propagation analysis generates variances and covariances in theta,phi,rho space \n\t // from euclidian space.\n covariance_rpt_normal = jacobian_normal.multiply(covariance_xyz).multiply(jacobian_transposed_normal);\n \n // Cluster representativeness\n covariance_rpt_normal.set(0,0, covariance_rpt_normal.get(0,0)+NONZERO);\n constant_normal = Math.sqrt(Math.abs(covariance_rpt_normal.determinant())*root22pi32);\n // if matrix is singular determinant is zero and constant_normal is 0\n // Supposedly adding epsilon averts this according to paper and in normal circumstances\n // a singular matrix would mean coplanar samples and voting should be done with bivariate kernel over theta,phi\n if( constant_normal == 0 ) {\n \t if( DEBUG ) {\n \t\t System.out.println(\"kernel_t kernel_load_parameters determinant is 0 for \"+this);\n \t }\n \t voting_limit = 0;\n \t return;\n }\n // if invert comes back null then the matrix is singular, which means the samples are coplanar\n covariance_rpt_inv_normal = covariance_rpt_normal.invert();\n if( covariance_rpt_inv_normal == null ) {\n \t if( DEBUG ) {\n \t\t System.out.println(\"kernel_t kernel_load_parameters covariance matrix is singular for \"+this);\n \t }\n \t voting_limit = 0;\n \t return;\n }\n\t EigenvalueDecomposition eigenvalue_decomp = new EigenvalueDecomposition(covariance_rpt_normal);\n\t double[] eigenvalues_vector = eigenvalue_decomp.getRealEigenvalues();\n\t Matrix3 eigenvectors_matrix = eigenvalue_decomp.getV();\n // Sort eigenvalues\n int min_index = 0;\n if (eigenvalues_vector[min_index] > eigenvalues_vector[1])\n min_index = 1;\n if (eigenvalues_vector[min_index] > eigenvalues_vector[2])\n min_index = 2;\n if( DEBUG )\n \t System.out.println(\"kernel_t kernel_load_parameters eigenvalues_vector=[\"+eigenvalues_vector[0]+\" \"+eigenvalues_vector[1]+\" \"+eigenvalues_vector[2]+\"] min_index=\"+min_index);\n // Voting limit calculation (g_min)\n double radius = Math.sqrt( eigenvalues_vector[min_index] ) * 2;\n voting_limit = trivariated_gaussian_dist_normal( eigenvectors_matrix.get(0, min_index) * radius, \n\t\t\t\t\t\t\t\t\t\t\t\t\t eigenvectors_matrix.get(1, min_index) * radius, \n\t\t\t\t\t\t\t\t\t\t\t\t\t eigenvectors_matrix.get(2, min_index) * radius);\n if(DEBUG)\n \t System.out.println(\"kernel_t kernel_load_parameters voting limit=\"+voting_limit);\n }", "protected double calc_virial_pressure() {\n\t\tint i,j,iTot;\n\t\tdouble dr2,fij,rij,TotFdotR;\n\t\tdouble vp;\n\t\t\n\t\t/* Calculate sum(f.r): */\n\t\tTotFdotR = 0.0; iTot = 0;\n\t\tfor(i=0; i<n; i++) {\n\t\t\tfor(j=0; j<n; j++) {\n\t\t\t\tif ( i != j ) {\n\t\t\t\t\tdr2 = ij_sep2(i,j,c_lat,CUR_POS);\n\t\t\t\t\trij = Math.sqrt(dr2);\n\t\t\t\t\tfij = -12.0*4.0*Math.pow(diameter,12.0)/Math.pow(rij,13.0)\n\t\t\t\t\t+6.0*4.0*Math.pow(diameter,6.0)/Math.pow(rij,7.0);\n\t\t\t\t\tTotFdotR += fij*rij;\n\t\t\t\t\tiTot++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//TotFdotR /= (double)iTot;\n\t\tTotFdotR /= -2.0;\n\t\t\n\t\t/* Calc total virial: */\n\t\tvp = Math.sqrt(2.0)*calc_sys_density()/beta +\n\t\tMath.pow(diameter,3.0)*TotFdotR/(3.0*box[c_lat].x*box[c_lat].y*box[c_lat].z);\n\t\t\n\t\t/* check line */\n\t\t//System.out.printf(\" VPi %f %f %f\\n\",calc_density()/beta, TotFdotR/(3.0*box.x*box.y*box.z),vp);\n\t\t\n\t\treturn(vp);\n\t}", "public static double[] Jordan(Matriks M) {\r\n int i, j, k = 0, c;\r\n int flag = 0;\r\n int n = M.BrsEff; \r\n\t\tdouble[][] a = new double[n][n+1];\r\n\t\tdouble[] x;\r\n \r\n for (i = 0; i < M.BrsEff; i++){\r\n for (j = 0; j < M.KolEff; j++){\r\n a[i][j] = M.Elmt[i][j];\r\n }\r\n }\r\n\r\n for (i = 0; i < n; i++){ \r\n if (a[i][i] == 0){ \r\n c = 1; \r\n while ((i + c) < n && a[i + c][i] == 0){ \r\n c++;\r\n } \r\n if ((i + c) == n){\r\n flag = 1; \r\n break; \r\n }\r\n for (j = i, k = 0; k <= n; k++){\r\n double temp =a[j][k]; \r\n a[j][k] = a[j+c][k]; \r\n a[j+c][k] = temp; \r\n }\r\n } \r\n \r\n for (j = 0; j < n; j++){ \r\n if (i != j){ \r\n double p = a[j][i] / a[i][i];\r\n for (k = 0; k <= n; k++){ \r\n a[j][k] = a[j][k] - (a[i][k]) * p;\r\n } \r\n } \r\n } \r\n }\r\n for (i = 0; i < M.BrsEff; i++){\r\n if ((a[i][i]!=0) && (a[i][i]!=1)){\r\n for (j = i; j < M.KolEff; j++){\r\n M.Elmt[i][j] = a[i][j] / a[i][i];\r\n }\r\n }\r\n }\r\n if (flag == 1){\r\n flag = 3;\r\n \t for (i = 0; i < n; i++) { \r\n \t double sum = 0; \r\n \t for (j = 0; j < n; j++){ \r\n \t sum = sum + M.Elmt[i][j]; \r\n \t }\r\n \t if (sum == M.Elmt[i][n]) { \r\n \t flag = 2; \r\n \t }\r\n \t }\r\n \t if (flag == 3){\r\n \t x = new double[n+3];\r\n for (i = 0; i < n; i++){\r\n x[i] = 0;\r\n }\r\n \t }\r\n \t else {\r\n \t x = new double[n+2];\r\n for (i = 0; i < n; i++){\r\n x[i] = 0;\r\n }\r\n \t }\r\n }\r\n else{\r\n x = new double[n];\r\n for (i = 0; i < n; i++){\r\n x[i] = a[i][M.KolEff-1] / a[i][i];\r\n }\r\n }\r\n return x;\r\n }", "@Override\n public float apply$mcFJ$sp (long arg0)\n {\n return 0;\n }", "public static native void OpenMM_AmoebaVdwForce_getParticleParameters(PointerByReference target, int particleIndex, IntBuffer parentIndex, DoubleBuffer sigma, DoubleBuffer epsilon, DoubleBuffer reductionFactor, IntBuffer isAlchemical);", "public static native void OpenMM_AmoebaAngleForce_getAngleParameters(PointerByReference target, int index, IntByReference particle1, IntByReference particle2, IntByReference particle3, DoubleByReference length, DoubleByReference quadraticK);", "@Override\n public long apply$mcJD$sp (double arg0)\n {\n return 0;\n }", "private double[][] jacobianIndirect(\n double[][] res,\n DoubleMatrix2D pDmCurrentMatrix,\n int nbTrades,\n int totalParamsGroup,\n int totalParamsPrevious,\n CurveBuildingBlock orderPrevious,\n CurveBuildingBlockBundleBuilder blockBundleBuilder) {\n\n double[][] pDmPreviousArray = new double[0][0];\n if (totalParamsPrevious > 0) {\n double[][] nonDirect = new double[totalParamsGroup][totalParamsPrevious];\n for (int i = 0; i < nbTrades; i++) {\n System.arraycopy(res[i], 0, nonDirect[i], 0, totalParamsPrevious);\n }\n DoubleMatrix2D pDpPreviousMatrix = (DoubleMatrix2D) MATRIX_ALGEBRA.scale(\n MATRIX_ALGEBRA.multiply(pDmCurrentMatrix, new DoubleMatrix2D(nonDirect)), -1d);\n // transition Matrix: all curves from previous groups\n double[][] transition = new double[totalParamsPrevious][totalParamsPrevious];\n int startIndexOuter = 0;\n for (CurveParameterSize order : orderPrevious.getData()) { // l\n int paramCountOuter = order.getParameterCount();\n Pair<CurveBuildingBlock, DoubleMatrix2D> thisPair = blockBundleBuilder.get(order.getName());\n CurveBuildingBlock thisBlock = thisPair.getFirst();\n Set<CurveName> thisBlockCurves = thisBlock.getAllNames();\n double[][] thisMatrix = thisPair.getSecond().getData();\n int startIndexInner = 0;\n for (CurveParameterSize order2 : orderPrevious.getData()) { // k\n int paramCountInner = order2.getParameterCount();\n if (thisBlockCurves.contains(order2.getName())) { // If not, the matrix stay with 0\n for (int p = 0; p < paramCountOuter; p++) {\n System.arraycopy(\n thisMatrix[p], startIndexOuter, transition[startIndexOuter + p], startIndexInner, paramCountInner);\n }\n }\n startIndexInner += paramCountInner;\n }\n startIndexOuter += paramCountOuter;\n }\n DoubleMatrix2D transitionMatrix = new DoubleMatrix2D(transition);\n DoubleMatrix2D pDmPreviousMatrix = (DoubleMatrix2D) MATRIX_ALGEBRA.multiply(pDpPreviousMatrix, transitionMatrix);\n pDmPreviousArray = pDmPreviousMatrix.getData();\n }\n return pDmPreviousArray;\n }", "public static native void OpenMM_AmoebaInPlaneAngleForce_getAngleParameters(PointerByReference target, int index, IntBuffer particle1, IntBuffer particle2, IntBuffer particle3, IntBuffer particle4, DoubleBuffer length, DoubleBuffer quadraticK);", "protected float j()\r\n/* 67: */ {\r\n/* 68: 80 */ return 1.5F;\r\n/* 69: */ }", "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}", "public PartialSigmaChargeDescriptor() { \n peoe = new GasteigerMarsiliPartialCharges();\n }", "public MLMOEA_Ang(Problem problem) {\r\n\t\tsuper(problem);\r\n\t\tzideal_ = new double[problem.getNumberOfObjectives()];\r\n\t\tznadir_ = new double[problem.getNumberOfObjectives()];\r\n\t}", "public VDF getVDF()\n {\n VDF vdf = getViewDefinition();\n // group view current cardinality\n vdf.getEntries()[0].getDataValue().setObject(new Integer(OutUnqassGrp_MA));\n // group view active flags\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n if ( adim0 < OutUnqassGrp_MA )\n {\n ((VDFEntryObject [])vdf.getEntries()[1].getDataValue().getObject())[\n adim0].setObject(new Character('Y'));\n }\n else \n {\n ((VDFEntryObject [])vdf.getEntries()[1].getDataValue().getObject())[\n adim0].setObject(new Character('N'));\n }\n }\n vdf.getEntries()[1].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[2].getDataValue().getObject())[adim0]\n .setObject(new Short(OutGUniqueAssignmentYear[adim0]));\n }\n vdf.getEntries()[2].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[3].getDataValue().getObject())[adim0]\n .setObject(new Short(OutGUniqueAssignmentPeriod[adim0]));\n }\n vdf.getEntries()[3].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[4].getDataValue().getObject())[adim0]\n .setObject(new Integer(OutGUniqueAssignmentUniqueNr[adim0]));\n }\n vdf.getEntries()[4].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[5].getDataValue().getObject())[adim0]\n .setObject(OutGUniqueAssignmentMkStudyUnitCode[adim0]);\n }\n vdf.getEntries()[5].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[6].getDataValue().getObject())[adim0]\n .setObject(new Short(OutGUniqueAssignmentAssignmentNr[adim0]));\n }\n vdf.getEntries()[6].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[7].getDataValue().getObject())[adim0]\n .setObject(new Short(OutGUniqueAssignmentNrOfQuestions[adim0]));\n }\n vdf.getEntries()[7].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[8].getDataValue().getObject())[adim0]\n .setObject(OutGUniqueAssignmentType[adim0]);\n }\n vdf.getEntries()[8].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[9].getDataValue().getObject())[adim0]\n .setObject(new Short(OutGUniqueAssignmentNegativeMarkFactor[adim0]));\n }\n vdf.getEntries()[9].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[10].getDataValue().getObject())[\n adim0].setObject(new Short(OutGUniqueAssignmentMaxCredits[adim0]));\n }\n vdf.getEntries()[10].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[11].getDataValue().getObject())[\n adim0].setObject(new Short(OutGUniqueAssignmentCreditSystem[adim0]));\n }\n vdf.getEntries()[11].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[12].getDataValue().getObject())[\n adim0].setObject(new Short(OutGUniqueAssignmentPassMarkPercentage[adim0]\n ));\n }\n vdf.getEntries()[12].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[13].getDataValue().getObject())[\n adim0].setObject(new Integer(OutGUniqueAssignmentClosingDate[adim0]));\n }\n vdf.getEntries()[13].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[14].getDataValue().getObject())[\n adim0].setObject(OutGUniqueAssignmentCompulsory[adim0]);\n }\n vdf.getEntries()[14].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[15].getDataValue().getObject())[\n adim0].setObject(new Integer(OutGUniqueAssignmentTsaUniqueNr[adim0]));\n }\n vdf.getEntries()[15].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[16].getDataValue().getObject())[\n adim0].setObject(OutGYearMarkCalculationType[adim0]);\n }\n vdf.getEntries()[16].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[17].getDataValue().getObject())[\n adim0].setObject(new Double(OutGYearMarkCalculationNormalWeight[adim0]))\n ;\n }\n vdf.getEntries()[17].setCountUsed((short)OutUnqassGrp_MA);\n // current cardinality group view items\n for(int adim0 = 0; adim0 < 100; adim0++)\n {\n ((VDFEntryObject [])vdf.getEntries()[18].getDataValue().getObject())[\n adim0].setObject(OutGYearMarkCalculationOptionalityGc3[adim0]);\n }\n vdf.getEntries()[18].setCountUsed((short)OutUnqassGrp_MA);\n return(vdf);\n }", "C11316t5 mo29022j0();", "@AnyLogicInternalCodegenAPI\n public double _DeathRisk_DefaultValue_xjal() {\n final Main self = this;\n return \n0.01 \n;\n }", "private double getAngleDisplacement(SkeletonNode root, int f) {\r\n\r\n\t\t/**------------------------------------------------------**/\r\n\t\tdouble ang = 0;\r\n\t\tint ang_counter = 0;\r\n\t\t/**------------------------------------------------------**/\r\n\t\t/**||||||||||||||||||||||||||||||||||||||||||||||||||||||**/\r\n\t\t/**------------------------------------------------------**/\r\n\t\tSkeletonNode parent =\troot.getParent();\r\n\t\tif(parent==null) return ang;\r\n\t\tString root_name = \t\troot.getName();\r\n\t\t/**------------------------------------------------------**/\r\n\t\t/**||||||||||||||||||||||||||||||||||||||||||||||||||||||**/\r\n\t\t/**------------------------------------------------------**/\r\n\t\tint group_size = ControlVariables.third_level_ang_filter_size;\r\n\t\tint group_size_half = (group_size/2)+(group_size % 2);\r\n\t\tint total_filter_size_i = (group_size_half*2) +\r\n\t\t\t\t(Math.min(f-group_size_half, 0)) +\r\n\t\t\t\t(Math.min(skeletonNodes.length - (f+group_size_half+1), 0));\r\n\t\t/**------------------------------------------------------**/\r\n\t\t/**||||||||||||||||||||||||||||||||||||||||||||||||||||||**/\r\n\t\t/**------------------------------------------------------**/\r\n\t\tfor(int j = f-group_size_half; j < f; j++) {\r\n\t\t\tif(j < 0) continue;\r\n\t\t\telse {\r\n\r\n\t\t\t\tSkeletonNode root_j_1 = skeletonWrappers[j+1].getFromHash(root_name);\r\n\t\t\t\tSkeletonNode parent_j_1 = root_j_1.getParent();\r\n\r\n\t\t\t\tSkeletonNode root_j = skeletonWrappers[j].getFromHash(root_name);\r\n\t\t\t\tSkeletonNode parent_j = root_j.getParent();\r\n\r\n\r\n\t\t\t\tdouble [] r_j = root_j.getPoint();\r\n\t\t\t\tdouble [] p_j = parent_j.getPoint();\r\n\r\n\t\t\t\tdouble [] r_j_1 = root_j_1.getPoint();\r\n\t\t\t\tdouble [] p_j_1 = parent_j_1.getPoint();\r\n\r\n\t\t\t\tdouble [] par_diff = VectorTools.sub(p_j, p_j_1);\r\n\t\t\t\tr_j_1 = VectorTools.add(par_diff, r_j_1);\r\n\r\n\t\t\t\tang += VectorTools.ang(r_j_1, p_j, r_j);\r\n\t\t\t\tang_counter++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/**------------------------------------------------------**/\r\n\t\t/**||||||||||||||||||||||||||||||||||||||||||||||||||||||**/\r\n\t\t/**------------------------------------------------------**/\r\n\t\tfor(int j = f; j < f+group_size_half; j++) {\r\n\t\t\tif((j+1) >= skeletonWrappers.length) continue;\r\n\t\t\telse {\r\n\r\n\t\t\t\tSkeletonNode root_j_1 = skeletonWrappers[j+1].getFromHash(root_name);\r\n\t\t\t\tSkeletonNode parent_j_1 = root_j_1.getParent();\r\n\r\n\t\t\t\tSkeletonNode root_j = skeletonWrappers[j].getFromHash(root_name);\r\n\t\t\t\tSkeletonNode parent_j = root_j.getParent();\r\n\r\n\r\n\t\t\t\tdouble [] r_j = root_j.getPoint();\r\n\t\t\t\tdouble [] p_j = parent_j.getPoint();\r\n\r\n\t\t\t\tdouble [] r_j_1 = root_j_1.getPoint();\r\n\t\t\t\tdouble [] p_j_1 = parent_j_1.getPoint();\r\n\r\n\t\t\t\tdouble [] par_diff = VectorTools.sub(p_j, p_j_1);\r\n\t\t\t\tr_j_1 = VectorTools.add(par_diff, r_j_1);\r\n\r\n\t\t\t\tang += VectorTools.ang(r_j_1, p_j, r_j);\r\n\t\t\t\tang_counter++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/**------------------------------------------------------**/\r\n\t\t/**||||||||||||||||||||||||||||||||||||||||||||||||||||||**/\r\n\t\t/**------------------------------------------------------**/\r\n\t\tif(total_filter_size_i != ang_counter) {\r\n\t\t\tSystem.out.println(total_filter_size_i);\r\n\t\t\tSystem.out.println(ang_counter);\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\treturn((1.0)/(ang_counter+0.0))*ang;\r\n\t\t/**------------------------------------------------------**/\r\n\t}", "@AnyLogicInternalCodegenAPI\n public double _BirthProbability_DefaultValue_xjal() {\n final Main self = this;\n return \n0.01 \n;\n }", "public Momentum() {\r\n m1 = m2 = v1 = v2 = p1 = p2 = comx = cv = 0.0;\r\n xp1 = 0.0;\r\n xp2 = 900.0;\r\n m1 = 2.0;\r\n m2 = 1.0;\r\n v1 = 1.0;\r\n v2 = -1.0;\r\n\r\n //m1 = m2 = 1.0;\r\n //v1 = 2.0;\r\n //v2 = -4.0;\r\n d = dc = 8.0;\r\n }", "@Override\n public long apply$mcJF$sp (float arg0)\n {\n return 0;\n }", "public static native void OpenMM_AmoebaInPlaneAngleForce_getAngleParameters(PointerByReference target, int index, IntByReference particle1, IntByReference particle2, IntByReference particle3, IntByReference particle4, DoubleByReference length, DoubleByReference quadraticK);", "public static native void OpenMM_AmoebaVdwForce_getParticleParameters(PointerByReference target, int particleIndex, IntByReference parentIndex, DoubleByReference sigma, DoubleByReference epsilon, DoubleByReference reductionFactor, IntByReference isAlchemical);", "public final void cZJ() {\n AppMethodBeat.i(7665);\n if (this.utI) {\n this.utH = false;\n cZv().uxb = false;\n this.utI = false;\n if (this.utJ) {\n cZM();\n }\n AppMethodBeat.o(7665);\n return;\n }\n AppMethodBeat.o(7665);\n }", "protected void o()\r\n/* 156: */ {\r\n/* 157:179 */ int i = 15 - aib.b(this);\r\n/* 158:180 */ float f = 0.98F + i * 0.001F;\r\n/* 159: */ \r\n/* 160:182 */ this.xVelocity *= f;\r\n/* 161:183 */ this.yVelocity *= 0.0D;\r\n/* 162:184 */ this.zVelocity *= f;\r\n/* 163: */ }", "@Override\n public double apply$mcDJ$sp (long arg0)\n {\n return 0;\n }", "float[] calculate(float[] acc, float[] oldAcc, float[] gyr , float[] oldGyr,float[] oldGra, float[] oldAccVelDisGra)\n {\n// System.out.println(\"inside method acc:\"+acc[0]+\", \"+acc[1]+\", \"+acc[2]+\", oldAcc:\"+oldAcc[0]+\", \"+oldAcc[1]+\", \"+oldAcc[2]);\n// System.out.println(\"inside method gravity:\"+oldGra[0]+\", \"+oldGra[1]+\", \"+oldGra[2]);\n if (oldAccVelDisGra==null)\n {\n oldAccVelDisGra= new float[9];\n for (int i = 0; i <9; i++) {\n oldAccVelDisGra[i]=0.0f;\n }\n }\n float[] oldDynamicAcc = new float[]{0.0f, 0.0f, 0.0f};\n float[] oldVelocity = new float[]{0.0f, 0.0f, 0.0f};\n float[] oldDistance = new float[]{0.0f, 0.0f, 0.0f};\n float[] newGra = gravityFromRotation(oldGra, gyr);\n\n for (int i = 0; i < 3; i++) {\n oldDynamicAcc[i] = oldAccVelDisGra[i];\n oldVelocity[i] = oldAccVelDisGra[i+3];\n oldDistance[i] = oldAccVelDisGra[i+6];\n }\n float[] accVelDisGra = new float[]{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};\n float[] dynAccDiff = dynamicAccDiff(acc,gyr,oldGra,oldAcc,oldGyr);\n float[] dynamicAcc = dynamicAcc(oldDynamicAcc, dynAccDiff);\n float[] velocity = velocity(oldVelocity,dynamicAcc);\n float[] distance = distance(oldDistance, velocity);\n for (int i = 0; i < 3; i++) {\n accVelDisGra[i]=dynamicAcc[i];\n accVelDisGra[i+3]= velocity[i];\n accVelDisGra[i+6]=distance[i];\n accVelDisGra[i+9]=newGra[i];\n }\n return accVelDisGra;\n }", "@Test\n\tpublic void test() {\n\t\tdouble delta = 0.00001;\n\t\tSnp fakeSnp1 = new Snp(\"fakeId1\", 0, 0.3);\n\t\tSnp fakeSnp2 = new Snp(\"fakeId2\", 0, 0.8);\n\t\tSnp fakeSnp3 = new Snp(\"fakeId3\", 0, 1.4);\n\t\tPascal.set.withZScore_=true;\n\t\tArrayList<Snp> geneSnps = new ArrayList<Snp>();\n\t\tgeneSnps.add(fakeSnp1);geneSnps.add(fakeSnp2);geneSnps.add(fakeSnp3);\n\t\tDenseMatrix ld= new DenseMatrix(3,3);\n\t\t//DenseMatrix crossLd= new DenseMatrix(3,2);\n\t\t\n\t\tArrayList<Double> snpScores = new ArrayList<Double>(3);\n\t\tsnpScores.add(fakeSnp1.getZscore());\n\t\tsnpScores.add(fakeSnp2.getZscore());\n\t\tsnpScores.add(fakeSnp3.getZscore());\n\t\t//ld and crossLd calculated as follows:\n\t\t// make 0.9-toeplitz mat of size 5.\n\t\t// 3,4,5 for ld-mat\n\t\t// 1,2 for crossLd-mat\n\t\tld.set(0,0,1);ld.set(1,1,1);ld.set(2,2,1);\n\t\tld.set(0,1,0.9);ld.set(1,2,0.9);\n\t\tld.set(1,0,0.9);ld.set(2,1,0.9);\n\t\tld.set(0,2,0.81);\n\t\tld.set(2,0,0.81);\n\t\tdouble[] weights = {2,2,2};\n\t\tAnalyticVegas myAnalyticObj= null;\n\t\t//UpperSymmDenseMatrix myMatToDecompose = null;\n\t\tdouble[] myEigenvals = null;\n\t\tdouble[] emptyWeights = {1,1,1};\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, emptyWeights);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\n\t\tassertEquals(myEigenvals[0],2.74067, delta);\n\t\tassertEquals(myEigenvals[1],0.1900, delta);\n\t\tassertEquals(myEigenvals[2],0.06932, delta);\n\t\t\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, weights);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\t\t\t\n\t\tassertEquals(myEigenvals[0], 5.481348, delta);\n\t\tassertEquals(myEigenvals[1],0.380000, delta);\n\t\tassertEquals(myEigenvals[2],0.138652, delta);\n\t\t\t\n\t\tdouble[] weights2 = {1,2,0.5};\n\t\t\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, weights2);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\t\t\n\t\tassertEquals(myEigenvals[0],3.27694674, delta);\n\t\tassertEquals(myEigenvals[1],0.1492338, delta);\n\t\tassertEquals(myEigenvals[2],0.07381938, delta);\t\t\t\n\t\t\n\t}", "void mo54413a(int i, C20254v vVar);", "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 amj b(dz paramdz, amj paramamj)\r\n/* 7: */ {\r\n/* 8:242 */ aqu localaqu = paramdz.i();\r\n/* 9: */ \r\n/* 10:244 */ dt localdt = paramdz.d().a(ave.b(paramdz.f()));\r\n/* 11: */ \r\n/* 12:246 */ bec localbec = localaqu.p(localdt);\r\n/* 13:247 */ atr localatr = localbec.c();\r\n/* 14:248 */ bof localbof = localatr.r();\r\n/* 15: */ alq localalq;\r\n/* 16:251 */ if ((bof.h.equals(localbof)) && ((localatr instanceof axl)) && (((Integer)localbec.b(axl.b)).intValue() == 0)) {\r\n/* 17:252 */ localalq = amk.ax;\r\n/* 18:253 */ } else if ((bof.i.equals(localbof)) && ((localatr instanceof axl)) && (((Integer)localbec.b(axl.b)).intValue() == 0)) {\r\n/* 19:254 */ localalq = amk.ay;\r\n/* 20: */ } else {\r\n/* 21:256 */ return super.b(paramdz, paramamj);\r\n/* 22: */ }\r\n/* 23:259 */ localaqu.g(localdt);\r\n/* 24:260 */ if (--paramamj.b == 0)\r\n/* 25: */ {\r\n/* 26:261 */ paramamj.a(localalq);\r\n/* 27:262 */ paramamj.b = 1;\r\n/* 28: */ }\r\n/* 29:263 */ else if (((bcx)paramdz.h()).a(new amj(localalq)) < 0)\r\n/* 30: */ {\r\n/* 31:264 */ this.b.a(paramdz, new amj(localalq));\r\n/* 32: */ }\r\n/* 33:266 */ return paramamj;\r\n/* 34: */ }", "public void update(ChiVertex<Integer, RatingEdge> vertex, GraphChiContext context) {\n\t\tboolean isUser = vertex.numOutEdges() > 0;\n\t\tdouble[] nbrPVec = new double[params.numFactors];\n\t\t\n\t\tdouble[] vData = new double[params.numFactors];\n\t\tint sourceId = context.getVertexIdTranslate().backward(vertex.getId());\n\t\tparams.latentFactors.getRow(sourceId, vData);\n\t\t\n\t\t//Will be updated to store SUM(V_j*R_ij)\n\t\tRealVector Xty = new ArrayRealVector(params.numFactors);\n\t\t//Will be updated to store SUM(V_j*V_j')\n\t\tRealMatrix XtX = new BlockRealMatrix(params.numFactors, params.numFactors);\n\t\t\n\t\t//Gather data to update the mean and the covariance for the hidden features.\t\n\t\tfor(int i = 0; i < vertex.numEdges(); i++) {\n\t\t\tRatingEdge edge = vertex.edge(i).getValue(); \n\t\t\tdouble observation = edge.observation;\n\t\t\t\n\t\t\tint nbrId = context.getVertexIdTranslate().backward(vertex.edge(i).getVertexId());\n\t\t\tparams.latentFactors.getRow(nbrId, nbrPVec);\n\t\t\t////VertexDataType nbrVertex = params.latentFactors.get(nbrId);\n\t\t\t\n\t\t\t//Add V_j*R_ij for this observation.\n\t\t\t////Xty = Xty.add(nbrVertex.pVec.mapMultiply(observation));\n\t\t\tfor(int f = 0; f < params.numFactors; f++) {\n\t\t\t\tdouble value = Xty.getEntry(f) + nbrPVec[f]*observation;\n\t\t\t\tXty.setEntry(f, value);\n\t\t\t\t\n\t\t\t\t//Add V_j*V_j' for this\n\t\t\t\tfor(int f2 = 0; f2 < params.numFactors; f2++) {\n\t\t\t\t\tvalue = XtX.getEntry(f, f2) + nbrPVec[f]*nbrPVec[f2];\n\t\t\t\t\tXtX.setEntry(f, f2, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Add V_j*V_j' for this \n\t\t\t////XtX = XtX.add(nbrVertex.pVec.outerProduct(nbrVertex.pVec));\n\t\t\t\n\t\t}\n\t\t\n\t\tRealMatrix lambda_prior = isUser ? params.lambda_U : params.lambda_V;\n\t\tRealVector mu_prior = isUser ? params.mu_U : params.mu_V;\n\t\t\n\t\tRealMatrix precision = lambda_prior.add(XtX.scalarMultiply(params.alpha)); \n\t\tRealMatrix covariance = (new LUDecompositionImpl(precision).getSolver().getInverse());\n\t\t\n\t\tRealVector tmp = lambda_prior.operate(mu_prior);\n\t\tRealVector mean = covariance.operate(Xty.mapMultiply(params.alpha).add(tmp));\n\t\t\n\t\t//We have the covariance and mean. We can grab a sample from this multivariate\n\t\t//normal distribution according to: \n\t\t// http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Drawing_values_from_the_distribution\n\t\t//Javadoc:\n\t\tMultivariateNormalDistribution dist = new MultivariateNormalDistribution(mean.toArray(), covariance.getData());\n\t\t////vData.pVec = new ArrayRealVector(dist.sample());\n\t\tvData = dist.sample();\n\t\tparams.latentFactors.setRow(sourceId, vData);\n\t\t\n\t\t//Compute contribution of all ratings for this vertex to RMSE.\n\t\tif(isUser) {\n\t\t\tfor(int i = 0; i < vertex.numEdges(); i++) {\n\t\t\t\tChiEdge<RatingEdge> edge = vertex.edge(i);\n\t\t\t\tRatingEdge pmfRatingEdge = edge.getValue();\n\t\t\t\tfloat observation = pmfRatingEdge.observation;\n\t\t\t\tint nbrId = context.getVertexIdTranslate().backward(vertex.edge(i).getVertexId());\n\t\t\t\tparams.latentFactors.getRow(nbrId, nbrPVec);\n\t\t\t\t\n\t\t\t\t//Aggregate the sample and compute rmse if greater than burn_in period\n\t\t\t\tdouble prediction = this.params.predict(vData, nbrPVec, datasetDesc);\n\t\t\t\tdouble squaredError = (observation - prediction)*(observation - prediction);\n\t\t\t\tsynchronized (this) {\n\t\t\t\t this.train_rmse += squaredError;\n\t }\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Update Sum of U_i / V_j\n\t\t//Should be synchronized? Or Atomic add of vectors?\n\t\tRealVector vDataVec = new ArrayRealVector(vData);\n\t\tRealMatrix vDataOuterProd = vDataVec.outerProduct(vDataVec);\n\t\tsynchronized (params) {\n\t\t\tif(isUser) {\n\t\t\t\t\tparams.sumU = params.sumU.add(vDataVec);\n\t\t\t\t\tparams.sumUUT = params.sumUUT.add(vDataOuterProd);\n\t\t\t} else {\n\t\t\t\tparams.sumV = params.sumV.add(vDataVec);\n\t\t\t\tparams.sumVVT = params.sumVVT.add(vDataOuterProd);\n\t\t\t}\n\t\t}\n\t}", "public PMVMatrix(boolean useBackingArray) {\n projectFloat = new ProjectFloat();\n \n // I Identity\n // T Texture\n // P Projection\n // Mv ModelView\n // Mvi Modelview-Inverse\n // Mvit Modelview-Inverse-Transpose\n if(useBackingArray) {\n matrixBufferArray = new float[6*16];\n matrixBuffer = null;\n // matrixBuffer = FloatBuffer.wrap(new float[12*16]);\n } else {\n matrixBufferArray = null;\n matrixBuffer = Buffers.newDirectByteBuffer(6*16 * Buffers.SIZEOF_FLOAT);\n matrixBuffer.mark();\n }\n \n matrixIdent = slice2Float(matrixBuffer, matrixBufferArray, 0*16, 1*16); // I\n matrixTex = slice2Float(matrixBuffer, matrixBufferArray, 1*16, 1*16); // T\n matrixPMvMvit = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 4*16); // P + Mv + Mvi + Mvit \n matrixPMvMvi = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 3*16); // P + Mv + Mvi\n matrixPMv = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 2*16); // P + Mv\n matrixP = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 1*16); // P\n matrixMv = slice2Float(matrixBuffer, matrixBufferArray, 3*16, 1*16); // Mv\n matrixMvi = slice2Float(matrixBuffer, matrixBufferArray, 4*16, 1*16); // Mvi\n matrixMvit = slice2Float(matrixBuffer, matrixBufferArray, 5*16, 1*16); // Mvit\n \n if(null != matrixBuffer) {\n matrixBuffer.reset();\n } \n ProjectFloat.gluMakeIdentityf(matrixIdent);\n \n vec3f = new float[3];\n matrixMult = new float[16];\n matrixTrans = new float[16];\n matrixRot = new float[16];\n matrixScale = new float[16];\n matrixOrtho = new float[16];\n matrixFrustum = new float[16];\n ProjectFloat.gluMakeIdentityf(matrixTrans, 0);\n ProjectFloat.gluMakeIdentityf(matrixRot, 0);\n ProjectFloat.gluMakeIdentityf(matrixScale, 0);\n ProjectFloat.gluMakeIdentityf(matrixOrtho, 0);\n ProjectFloat.gluMakeZero(matrixFrustum, 0);\n \n matrixPStack = new ArrayList<float[]>();\n matrixMvStack= new ArrayList<float[]>();\n \n // default values and mode\n glMatrixMode(GL_PROJECTION);\n glLoadIdentity();\n glMatrixMode(GL_MODELVIEW);\n glLoadIdentity();\n glMatrixMode(GL.GL_TEXTURE);\n glLoadIdentity();\n setDirty();\n update();\n }", "Function<RealMatrix, T> getJacobianNaNProcessor();", "public static native void OpenMM_AmoebaAngleForce_setAngleParameters(PointerByReference target, int index, int particle1, int particle2, int particle3, double length, double quadraticK);", "public static native void OpenMM_AmoebaBondForce_getBondParameters(PointerByReference target, int index, IntBuffer particle1, IntBuffer particle2, DoubleBuffer length, DoubleBuffer quadraticK);", "public void compile() {\n\t\tdouble zn = params.getZn();\n\t\tdouble zf = params.getZf();\n\t\tdouble sw = params.getSw();\n\t\tdouble sh = params.getSh();\n\n\t\tdouble d[][] = { { 2 * zn / sw, 0, 0, 0 }, { 0, 2 * zn / sh, 0, 0 },\n\t\t\t\t{ 0, 0, zf / (zf - zn), -zn * zf / (zf - zn) }, { 0, 0, 1, 0 } };\n\t\tTransformation proj = new Transformation(d);\n\t\tmk = proj.mult(VCS);\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t}", "public int mo3384v() {\n return 0;\n }", "public final bp dt() {\n if (this.ad == null) {\n return null;\n }\n dp aq = (-1 == this.cs * -1099198911 || this.cx * -1961250233 != 0) ? null : gn.aq(this.cs * -1099198911, 1902805010);\n dp aq2 = (-1 == this.ce * -1620542321 || (this.ce * -1620542321 == this.bb * -959328679 && aq != null)) ? null : gn.aq(this.ce * -1620542321, 2037846592);\n bp ai = this.ad.ai(aq, this.cr * 317461367, aq2, this.cy * 631506963, 578342776);\n if (ai == null) {\n return null;\n }\n bp bpVar;\n ai.ai();\n this.di = ai.bx * -1067272603;\n if (!(-1 == this.ck * 836985687 || -1 == this.co * 1215520647)) {\n bp aj = dd.aq(this.ck * 836985687, 812886062).aj(this.co * 1215520647, (byte) 57);\n if (aj != null) {\n aj.ac(0, -(this.cz * -583056727), 0);\n bpVar = new bp(new bp[]{ai, aj}, 2);\n if (1 == this.ad.ae * -735434895) {\n bpVar.bs = true;\n }\n return bpVar;\n }\n }\n bpVar = ai;\n if (1 == this.ad.ae * -735434895) {\n }\n return bpVar;\n }", "public static native void OpenMM_AmoebaGeneralizedKirkwoodForce_getParticleParameters(PointerByReference target, int index, DoubleBuffer charge, DoubleBuffer radius, DoubleBuffer scalingFactor);", "private double[] y_angle(VectorN x, double t, int p, VectorN s, int inoise){\r\n\t\t//int lx = x.length;\r\n\t\t\r\n\t\t//% Compute radial distance from Earth\r\n\t\tVectorN r = x.get(0,3);\r\n\t\t//double rmag=r.mag();\r\n\t\tVectorN v = new VectorN(3);\r\n\t\t//% Determine unit vector observation 1 (Either Earth or Moon)\r\n\t\tswitch(p){\r\n\t\tcase BODY_EARTH: //% Earth obs\r\n\t\t\tv=r.times(-1.0);\r\n\t\t\tbreak;\r\n\t\tcase BODY_MOON: //% Moon obs\r\n\t\t\t//% Get lunar position relative to the Earth\r\n\t\t\t//* TODO watch units\r\n\t\t\tVectorN xm=new VectorN(ephem.get_planet_pos(DE405_Body.GEOCENTRIC_MOON, TimeUtils.UTCtoTT(mjd0+t/86400)));\r\n\t\t\t//getmoon(jd0+t/86400); \r\n\t\t\tv=xm.minus(r);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tSystem.err.println(\"Invalid flag for vector observation 1.\");\r\n\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tVectorN u=v.unitVector();\r\n\t\tMatrix eye = new Matrix(3);\r\n\t\tMatrix dudx=(eye.minus(u.outerProduct(u))).divide(v.mag()); \r\n\t\t\r\n\t\t//% Compute measurement cos(theta)\r\n\t\tdouble y=s.dotProduct(u);\r\n\t\t\r\n\t\tif (inoise==1){\r\n\t\t\tdouble[] arnd_abias = camerr(v.mag(),p); //% 1-sigma noise and bias on angular measurement\r\n\t\t\ty=Math.cos(Math.acos(y)+arnd_abias[0]*randn()+arnd_abias[1]);\r\n\t\t}else{\r\n\t\t\t//y= y + x.x[i_yanglebias];\r\n\t\t}\r\n\t\t\r\n\t\t//% Compute Jacobian\r\n\t\t//dydx= -[s'*dudx zeros(1,3)];\r\n\t\tVectorN tmp = new VectorN(s.times(dudx),new VectorN(3)).times(-1.0);\r\n\t\tdouble[] dydx= tmp.x;\r\n\t\t\r\n\t\t\r\n\t\t//% % Assume the bias is on the pseudo measurement rather than angle itself\r\n\t\t//% if lx==8\r\n\t\t//% y=y+x(7);\r\n\t\t//% dydx=[dydx 1 0];\r\n\t\t//% end\r\n\t\tdouble[] out = new double[x.length+1];\r\n\t\tout[0] = y;\r\n\t\tfor(int i=1; i<7; i++) out[i] = dydx[i-1];\r\n\t\treturn out;\r\n\t}", "public static native PointerByReference OpenMM_AmoebaAngleForce_create();", "public static native void OpenMM_AmoebaInPlaneAngleForce_setAngleParameters(PointerByReference target, int index, int particle1, int particle2, int particle3, int particle4, double length, double quadraticK);", "public static native PointerByReference OpenMM_AmoebaInPlaneAngleForce_create();", "public void dorcsd_(CHARACTER JOBU1,CHARACTER JOBU2,CHARACTER JOBV1T,CHARACTER JOBV2T,CHARACTER TRANS,CHARACTER SIGNS,INTEGER M,INTEGER P,INTEGER Q,double[] X11,INTEGER LDX11,double[] X12,INTEGER LDX12,double[] X21,INTEGER LDX21,double[] X22,INTEGER LDX22,double[] THETA,double[] U1,INTEGER LDU1,double[] U2,INTEGER LDU2,double[] V1T,INTEGER LDV1T,double[] V2T,INTEGER LDV2T,double[] WORK,INTEGER LWORK,int[] IWORK,INTEGER INFO);", "public void mo4301a(C0820v vVar, C0788a0 a0Var, C0784c cVar, C0783b bVar) {\n int i;\n int i2;\n int i3;\n int i4;\n int i5;\n View a = cVar.mo4355a(vVar);\n if (a == null) {\n bVar.f3152b = true;\n return;\n }\n C0813p pVar = (C0813p) a.getLayoutParams();\n if (cVar.f3165k == null) {\n if (this.f3143x == (cVar.f3160f == -1)) {\n mo4716b(a);\n } else {\n mo4717b(a, 0);\n }\n } else {\n if (this.f3143x == (cVar.f3160f == -1)) {\n mo4690a(a);\n } else {\n mo4691a(a, 0);\n }\n }\n mo4692a(a, 0, 0);\n bVar.f3151a = this.f3140u.mo5113b(a);\n if (this.f3138s == 1) {\n if (mo4323M()) {\n i5 = mo4758r() - mo4756p();\n i4 = i5 - this.f3140u.mo5115c(a);\n } else {\n i4 = mo4754o();\n i5 = this.f3140u.mo5115c(a) + i4;\n }\n if (cVar.f3160f == -1) {\n int i6 = cVar.f3156b;\n i = i6;\n i2 = i5;\n i3 = i6 - bVar.f3151a;\n } else {\n int i7 = cVar.f3156b;\n i3 = i7;\n i2 = i5;\n i = bVar.f3151a + i7;\n }\n } else {\n int q = mo4757q();\n int c = this.f3140u.mo5115c(a) + q;\n if (cVar.f3160f == -1) {\n int i8 = cVar.f3156b;\n i2 = i8;\n i3 = q;\n i = c;\n i4 = i8 - bVar.f3151a;\n } else {\n int i9 = cVar.f3156b;\n i3 = q;\n i2 = bVar.f3151a + i9;\n i = c;\n i4 = i9;\n }\n }\n mo4693a(a, i4, i3, i2, i);\n if (pVar.mo4774d() || pVar.mo4773c()) {\n bVar.f3153c = true;\n }\n bVar.f3154d = a.hasFocusable();\n }", "public double getJx()\n {\n return m_Jx;\n }", "public void CalculatePPMI(boolean readFromFile, boolean writeToFile) {\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\n\t\tSystem.out.println(\"\\nConverting matrix to use PPMI values...\");\n\t\tSystem.out.println(\"Memory used: \" + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / Math.pow(1000, 3) + \" GB\");\n\n\t\tfloat[][] C = null;\n\t\tfloat[][] newC = null;\n\n\t\t// Variables\n\t\tfloat matrixSum = 0f;\n\t\tfloat matrixDelta = 0f;\n\t\t\n\t\tfloat cellValue = 0f;\n\t\tfloat cellProbability = 0f;\n\t\t\n\t\tfloat rowSum = 0f;\n\t\tfloat rowDelta = 0f;\n\t\tfloat rowProbability = 0f;\n\t\t\n\t\tfloat colSum = 0f;\n\t\tfloat colDelta = 0f;\n\t\tfloat colProbability = 0f;\n\t\t\n\t\tfloat logValue = 0f;\n\t\tfloat maxValue = 0f;\n\t\tfloat PPMI = 0f;\n\n\t\t// Read from file if necessary\n\t\tif(readFromFile) {\n\t\t\t\n\t\t\tnewC = new float[this.V][this.V];\n\t\t\tSystem.out.println(\"Memory used: \" + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / Math.pow(1000, 3) + \" GB\");\n\t\t\t\t\t\n\t\t\ttry {\n\n\t\t\t\t// Read file\n\t\t\t\tRandomAccessFile file = new RandomAccessFile(\"context-matrix.raf\", \"r\");\n\t\t\t\t\n\t\t\t\tString line;\n\t\t\t\tString[] values;\n\t\t\t\tint rowNum = 0;\n\t\t\t\tint colNum = 0;\n\t\t\t\tfloat currentNum = 0f;\n\t\t\t\tint count = 0;\n\t\t\t\twhile((line = file.readLine()) != null) {\n\t\t\t\t\t\n\t\t\t\t\t// Check row num\n\t\t\t\t\tif(rowNum >= this.V) break;\n\t\t\t\t\t\n\t\t\t\t\tvalues = line.split(\" \");\n\t\t\t\t\t\n\t\t\t\t\tfor(String value : values) {\n\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcurrentNum = Float.parseFloat(value);\n\n\t\t\t\t\t\t// Calculate PPMI and store value in newC\n\t\t\t\t\t\tif(currentNum != 0 && currentNum < 16) {\n\t\t\t\t\t\t\tcellProbability = currentNum / this.matrixSum;\n\t\t\t\t\t\t\trowProbability = this.rowSums[rowNum] / this.matrixSum;\n\t\t\t\t\t\t\tcolProbability = this.colSums[colNum] / this.matrixSum;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tlogValue = cellProbability / (rowProbability * colProbability);\n\t\t\t\t\t\t\tmaxValue = (float) (Math.log10(logValue) / Math.log10(2));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPPMI = Math.max(maxValue, 0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewC[rowNum][colNum] = PPMI;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(count % 1000000 == 0)\n\t\t\t\t\t\t\tSystem.out.println(\"Progress: \" + (count / 1000000) + \" / \" + (((long)newC.length * (long)newC[0].length) / 1000000));\n\n\t\t\t\t\t\tcolNum++;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcolNum = 0;\n\t\t\t\t\trowNum++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Close file\n\t\t\t\tfile.close();\n\t\t\t\t\n\t\t\t\t// Store new matrix on instance object\n\t\t\t\tthis.TermContextMatrix_PPMI = newC;\n\t\t\t\tif(this.TermContextMatrix_PPMI == null) System.out.println(\"PPMI term-context matrix is null.\");\n\n\t\t\t} catch(IOException e0) {\n\t\t\t\te0.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tC = this.TermContextMatrix_FREQ;\n\t\t\tnewC = new float[C.length][C[0].length];\n\n\t\t\t// Calculate matrix sum\n\t\t\tfor(int i = 0; i < C.length; i++) {\n\t\t\t\tfor(int j = 0; j < C[i].length; j++) {\n\t\t\t\t\tmatrixDelta = C[i][j];\n\t\t\t\t\tmatrixSum += matrixDelta;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// For each cell\n\t\t\tfor(int u = 0; u < C.length; u++) {\n\t\t\t\t\n\t\t\t\t// Calculate row sum\n\t\t\t\tfor(int r = 0; r < C[u].length; r++) {\n\t\t\t\t\trowDelta = C[u][r];\n\t\t\t\t\trowSum += rowDelta;\n\t\t\t\t}\n\t\t\t\trowProbability = rowSum / matrixSum;\n\t\t\t\t\n\t\t\t\tfor(int v = 0; v < C[u].length; v++) {\n\t\t\t\t\t\n\t\t\t\t\tcellValue = C[u][v];\n\t\t\t\t\t\n\t\t\t\t\tif(u != v && cellValue != 0) {\n\n\t\t\t\t\t\t// Calculate cell probability\n\t\t\t\t\t\tcellProbability = cellValue / matrixSum;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Calculate col sum\n\t\t\t\t\t\tfor(int c = 0; c < C.length; c++) {\n\t\t\t\t\t\t\tcolDelta = C[c][v];\n\t\t\t\t\t\t\tcolSum += colDelta;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcolProbability = (float) (Math.pow(colSum, 0.75) / Math.pow(matrixSum, 0.75));\n\n\t\t\t\t\t\tlogValue = cellProbability / (rowProbability * colProbability);\n\t\t\t\t\t\tmaxValue = (float) (Math.log10(logValue) / Math.log10(2));\n\t\t\t\t\t\t\n\t\t\t\t\t\tPPMI = Math.max(maxValue, 0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewC[u][v] = PPMI;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.TermContextMatrix_PPMI = newC;\t\t\t\n\t\t}\n\n\t\tSystem.out.println(\"Matrix converted.\");\n\n\t\tlong endTime = System.currentTimeMillis();\n\t\t\n\t\tSystem.out.println(\"Time taken: \" + (endTime - startTime) + \" ms\");\n\t\t\n\t\tif(writeToFile) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tWriteMatrixToDisk(this.TermContextMatrix_PPMI);\n\t\t\t\n\t\t\t\t// Save any settings pertaining to the matrix for later use\n\t\t\t\tBufferedWriter settingsBw = new BufferedWriter(new FileWriter(\"settings.txt\"));\n\t\t\t\tsettingsBw.write(\"V \" + this.V + \"\\n\");\n\t\t\t\tsettingsBw.close();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "public final void cpp() {\n AppMethodBeat.m2504i(37039);\n if (this.qZg == null) {\n this.qZg = new C46235l(this.qZf.bnR, this.context, (FrameLayout) this.contentView);\n this.qZg.mo74249aZ();\n this.bnR = cpt();\n AppMethodBeat.m2505o(37039);\n return;\n }\n this.qZg.mo74251dl(this.qZf.bnR);\n AppMethodBeat.m2505o(37039);\n }", "public int \r\nomStudent_dMajorGPA( View mStudentOrig,\r\n String InternalEntityStructure,\r\n String InternalAttribStructure,\r\n Integer GetOrSetFlag )\r\n{\r\n zVIEW mStudent = new zVIEW( );\r\n //:VIEW lDegTrkM BASED ON LOD lDegTrkM\r\n zVIEW lDegTrkM = new zVIEW( );\r\n //:VIEW mStudenC BASED ON LOD mStudenC\r\n zVIEW mStudenC = new zVIEW( );\r\n //:VIEW mStudenCO BASED ON LOD mStudenC\r\n zVIEW mStudenCO = new zVIEW( );\r\n //:DECIMAL MajorGPA\r\n double MajorGPA = 0.0;\r\n //:DECIMAL GPA_Divisor\r\n double GPA_Divisor = 0.0;\r\n //:DECIMAL GPA_Points\r\n double GPA_Points = 0.0;\r\n //:DECIMAL FinalGrade\r\n double FinalGrade = 0.0;\r\n //:DECIMAL CreditHours\r\n double CreditHours = 0.0;\r\n //:INTEGER CourseID\r\n int CourseID = 0;\r\n //:STRING ( 20 ) szDecimalString\r\n String szDecimalString = null;\r\n //:STRING ( 2 ) szFinalGrade\r\n String szFinalGrade = null;\r\n //:STRING ( 32 ) szEntityName\r\n String szEntityName = null;\r\n int RESULT = 0;\r\n int lTempInteger_0 = 0;\r\n int lTempInteger_1 = 0;\r\n int lTempInteger_2 = 0;\r\n int lTempInteger_3 = 0;\r\n zVIEW vTempViewVar_0 = new zVIEW( );\r\n int lTempInteger_4 = 0;\r\n int lTempInteger_5 = 0;\r\n int lTempInteger_6 = 0;\r\n\r\n\r\n //:CASE GetOrSetFlag\r\n switch( GetOrSetFlag )\r\n { \r\n //:OF zDERIVED_GET:\r\n case zDERIVED_GET :\r\n\r\n //:// This is a calculation of the major GPA based on the list of Degree Track major courses and\r\n //:// the Student's academic record.\r\n //:// We try to use the derived DegreeTrack path in mStudent. If it's not there, we will activate\r\n //:// lDegTrkM and include it.\r\n\r\n //:GetEntityNameFromStructure( InternalEntityStructure, szEntityName )\r\n //:IF szEntityName = \"StudentMajorDegreeTrack\"\r\n if ( ZeidonStringCompare( szEntityName, 1, 0, \"StudentMajorDegreeTrack\", 1, 0, 33 ) == 0 )\r\n { \r\n //:// We're already positioned on the correct entity.\r\n //:mStudent = mStudentOrig\r\n SetViewFromView( mStudent, mStudentOrig );\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:// Position on the correct DegreeTrack entity.\r\n //:CreateViewFromView( mStudent, mStudentOrig )\r\n CreateViewFromView( mStudent, mStudentOrig );\r\n //:IF szEntityName = \"mStudent.DC_StudentMajorDegreeTrack\"\r\n if ( ZeidonStringCompare( szEntityName, 1, 0, \"mStudent.DC_StudentMajorDegreeTrack\", 1, 0, 33 ) == 0 )\r\n { \r\n //:SET CURSOR FIRST mStudent.StudentMajorDegreeTrack WHERE mStudent.StudentMajorDegreeTrack.ID = mStudent.DC_StudentMajorDegreeTrack.ID\r\n {MutableInt mi_lTempInteger_0 = new MutableInt( lTempInteger_0 );\r\n GetIntegerFromAttribute( mi_lTempInteger_0, mStudent, \"DC_StudentMajorDegreeTrack\", \"ID\" );\r\n lTempInteger_0 = mi_lTempInteger_0.intValue( );}\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst( \"ID\", lTempInteger_0 ).toInt();\r\n\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:SET CURSOR FIRST mStudent.StudentMajorDegreeTrack WHERE mStudent.StudentMajorDegreeTrack.ID = mStudent.CDC_StudentMajorDegreeTrack.ID\r\n {MutableInt mi_lTempInteger_1 = new MutableInt( lTempInteger_1 );\r\n GetIntegerFromAttribute( mi_lTempInteger_1, mStudent, \"CDC_StudentMajorDegreeTrack\", \"ID\" );\r\n lTempInteger_1 = mi_lTempInteger_1.intValue( );}\r\n RESULT = mStudent.cursor( \"StudentMajorDegreeTrack\" ).setFirst( \"ID\", lTempInteger_1 ).toInt();\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n\r\n //:SET CURSOR FIRST mStudent.MajorGPA_DegreeTrack \r\n //: WHERE mStudent.MajorGPA_DegreeTrack.ID = mStudent.MajorDegreeTrack.ID \r\n {MutableInt mi_lTempInteger_2 = new MutableInt( lTempInteger_2 );\r\n GetIntegerFromAttribute( mi_lTempInteger_2, mStudent, \"MajorDegreeTrack\", \"ID\" );\r\n lTempInteger_2 = mi_lTempInteger_2.intValue( );}\r\n RESULT = mStudent.cursor( \"MajorGPA_DegreeTrack\" ).setFirst( \"ID\", lTempInteger_2 ).toInt();\r\n //:IF RESULT < zCURSOR_SET\r\n if ( RESULT < zCURSOR_SET )\r\n { \r\n //:ACTIVATE lDegTrkM WHERE lDegTrkM.DegreeTrack.ID = mStudent.MajorDegreeTrack.ID \r\n {MutableInt mi_lTempInteger_3 = new MutableInt( lTempInteger_3 );\r\n GetIntegerFromAttribute( mi_lTempInteger_3, mStudent, \"MajorDegreeTrack\", \"ID\" );\r\n lTempInteger_3 = mi_lTempInteger_3.intValue( );}\r\n omStudent_fnLocalBuildQual_1( mStudentOrig, vTempViewVar_0, lTempInteger_3 );\r\n RESULT = ActivateObjectInstance( lDegTrkM, \"lDegTrkM\", mStudentOrig, vTempViewVar_0, zSINGLE );\r\n DropView( vTempViewVar_0 );\r\n //:INCLUDE mStudent.MajorGPA_DegreeTrack FROM lDegTrkM.DegreeTrack \r\n RESULT = IncludeSubobjectFromSubobject( mStudent, \"MajorGPA_DegreeTrack\", lDegTrkM, \"DegreeTrack\", zPOS_AFTER );\r\n //:DropObjectInstance( lDegTrkM )\r\n DropObjectInstance( lDegTrkM );\r\n } \r\n\r\n //:END \r\n //:MajorGPA = 0\r\n MajorGPA = 0;\r\n //:GET VIEW mStudenCO NAMED \"mStudenC\"\r\n RESULT = GetViewByName( mStudenCO, \"mStudenC\", mStudentOrig, zLEVEL_TASK );\r\n //:IF RESULT >= 0\r\n if ( RESULT >= 0 )\r\n { \r\n //:CreateViewFromView( mStudenC, mStudenCO )\r\n CreateViewFromView( mStudenC, mStudenCO );\r\n //:GPA_Divisor = 0\r\n GPA_Divisor = 0;\r\n //:GPA_Points = 0\r\n GPA_Points = 0;\r\n //:FOR EACH mStudenC.Registration WHERE ( mStudenC.Registration.Status = \"C\" // Completed\r\n //: OR mStudenC.Registration.Status = \"F\" // Transferred\r\n //: OR mStudenC.Registration.Status = \"X\" ) // L. Transferred\r\n //: AND mStudenC.Registration.wRepeatedClass != \"R\"\r\n RESULT = mStudenC.cursor( \"Registration\" ).setFirst().toInt();\r\n while ( RESULT > zCURSOR_UNCHANGED )\r\n { \r\n if ( ( CompareAttributeToString( mStudenC, \"Registration\", \"Status\", \"C\" ) == 0 || CompareAttributeToString( mStudenC, \"Registration\", \"Status\", \"F\" ) == 0 || CompareAttributeToString( mStudenC, \"Registration\", \"Status\", \"X\" ) == 0 ) &&\r\n CompareAttributeToString( mStudenC, \"Registration\", \"wRepeatedClass\", \"R\" ) != 0 )\r\n { \r\n\r\n //:IF mStudenC.RegistrationCourse EXISTS\r\n lTempInteger_4 = CheckExistenceOfEntity( mStudenC, \"RegistrationCourse\" );\r\n if ( lTempInteger_4 == 0 )\r\n { \r\n //:CourseID = mStudenC.RegistrationCourse.ID \r\n {MutableInt mi_CourseID = new MutableInt( CourseID );\r\n GetIntegerFromAttribute( mi_CourseID, mStudenC, \"RegistrationCourse\", \"ID\" );\r\n CourseID = mi_CourseID.intValue( );}\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:IF mStudenC.EquivalentCourse EXISTS\r\n lTempInteger_5 = CheckExistenceOfEntity( mStudenC, \"EquivalentCourse\" );\r\n if ( lTempInteger_5 == 0 )\r\n { \r\n //:CourseID = mStudenC.EquivalentCourse.ID \r\n {MutableInt mi_CourseID = new MutableInt( CourseID );\r\n GetIntegerFromAttribute( mi_CourseID, mStudenC, \"EquivalentCourse\", \"ID\" );\r\n CourseID = mi_CourseID.intValue( );}\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:CourseID = 0\r\n CourseID = 0;\r\n } \r\n\r\n //:END \r\n } \r\n\r\n //:END\r\n //:SET CURSOR FIRST mStudent.MajorGPA_Course WHERE mStudent.MajorGPA_Course.ID = CourseID\r\n RESULT = mStudent.cursor( \"MajorGPA_Course\" ).setFirst( \"ID\", CourseID ).toInt();\r\n //:IF RESULT >= zCURSOR_SET \r\n if ( RESULT >= zCURSOR_SET )\r\n { \r\n //:szFinalGrade = mStudenC.Registration.FinalGrade\r\n {MutableInt mi_lTempInteger_6 = new MutableInt( lTempInteger_6 );\r\n StringBuilder sb_szFinalGrade;\r\n if ( szFinalGrade == null )\r\n sb_szFinalGrade = new StringBuilder( 32 );\r\n else\r\n sb_szFinalGrade = new StringBuilder( szFinalGrade );\r\n GetVariableFromAttribute( sb_szFinalGrade, mi_lTempInteger_6, 'S', 3, mStudenC, \"Registration\", \"FinalGrade\", \"\", 0 );\r\n lTempInteger_6 = mi_lTempInteger_6.intValue( );\r\n szFinalGrade = sb_szFinalGrade.toString( );}\r\n //:GetStringFromAttributeByContext( szDecimalString,\r\n //: mStudenC, \"Registration\", \"FinalGrade\", \"DegreeTrackGradePointValue\", 20 )\r\n {StringBuilder sb_szDecimalString;\r\n if ( szDecimalString == null )\r\n sb_szDecimalString = new StringBuilder( 32 );\r\n else\r\n sb_szDecimalString = new StringBuilder( szDecimalString );\r\n GetStringFromAttributeByContext( sb_szDecimalString, mStudenC, \"Registration\", \"FinalGrade\", \"DegreeTrackGradePointValue\", 20 );\r\n szDecimalString = sb_szDecimalString.toString( );}\r\n //:IF szFinalGrade = \"F\"\r\n if ( ZeidonStringCompare( szFinalGrade, 1, 0, \"F\", 1, 0, 3 ) == 0 )\r\n { \r\n //:// Failed Course\r\n //:CreditHours = mStudenC.Registration.CreditHours\r\n {MutableDouble md_CreditHours = new MutableDouble( CreditHours );\r\n GetDecimalFromAttribute( md_CreditHours, mStudenC, \"Registration\", \"CreditHours\" );\r\n CreditHours = md_CreditHours.doubleValue( );}\r\n //:GPA_Divisor = GPA_Divisor + CreditHours\r\n GPA_Divisor = GPA_Divisor + CreditHours;\r\n //:// GPA_Points are not impacted for this case.\r\n //:ELSE\r\n } \r\n else\r\n { \r\n //:FinalGrade = StrToDecimal( szDecimalString )\r\n //:IF FinalGrade > 0\r\n if ( FinalGrade > 0 )\r\n { \r\n //:// Passed Course\r\n //:// The only other entries considered are those with grades D through A, in which case FinalGrade is > 0.\r\n //:CreditHours = mStudenC.Registration.CreditHours\r\n {MutableDouble md_CreditHours = new MutableDouble( CreditHours );\r\n GetDecimalFromAttribute( md_CreditHours, mStudenC, \"Registration\", \"CreditHours\" );\r\n CreditHours = md_CreditHours.doubleValue( );}\r\n //:GPA_Divisor = GPA_Divisor + CreditHours\r\n GPA_Divisor = GPA_Divisor + CreditHours;\r\n //:GPA_Points = GPA_Points + (FinalGrade * CreditHours)\r\n GPA_Points = GPA_Points + ( FinalGrade * CreditHours );\r\n } \r\n\r\n //:END\r\n } \r\n\r\n //:END\r\n } \r\n\r\n } \r\n\r\n RESULT = mStudenC.cursor( \"Registration\" ).setNext().toInt();\r\n //:END\r\n } \r\n\r\n\r\n //:END\r\n //:MajorGPA = GPA_Points / GPA_Divisor\r\n MajorGPA = GPA_Points / GPA_Divisor;\r\n //:DropView( mStudenC )\r\n DropView( mStudenC );\r\n } \r\n\r\n //:END\r\n //:IF mStudent != mStudentOrig\r\n if ( mStudent != mStudentOrig )\r\n { \r\n //:DropView( mStudent )\r\n DropView( mStudent );\r\n } \r\n\r\n //:END\r\n\r\n //:StoreValueInRecord ( mStudentOrig,\r\n //: InternalEntityStructure, InternalAttribStructure, MajorGPA, 0 )\r\n StoreValueInRecord( mStudentOrig, InternalEntityStructure, InternalAttribStructure, MajorGPA, 0 );\r\n break ;\r\n\r\n //: /* end zDERIVED_GET */\r\n //:OF zDERIVED_SET:\r\n case zDERIVED_SET :\r\n break ;\r\n } \r\n\r\n\r\n //: /* end zDERIVED_SET */\r\n //:END /* case */\r\n return( 0 );\r\n// END\r\n}", "public static native void Conjugate(long lpjFbxDualQuaternion);", "public float mo12719a(C1085v vVar) {\n return 0.5f;\n }", "private int[] calculateMomentum(byte state){\n //pull out each particle.\n\n //each particle has an x and y momentum based on its direction\n //1 x = 1, y = 0\n //2 x = cos(pi/3), y = sin(pi/3)\n //3 x = cos(2pi/3), y = sin(2pi/3)\n //4 x = -1, y = 0\n //5 x = cos(4pi/3), y = sin(4pi/3)\n //6 x = cos(5pi/3), y = sin(5pi/3)\n\n\n// double x = 0.0;\n// double y = 0.0;\n//\n// double arg = 0.0;\n// for(int n = 0; n < SMASKS.length; n++){\n// if((incomingState & SMASKS[n]) == SMASKS[n]){\n// arg = (n*Math.PI)/3;\n// x += BigDecimal.valueOf(Math.cos(arg)).setScale(5, BigDecimal.ROUND_DOWN).doubleValue();\n// y += BigDecimal.valueOf(Math.sin(arg)).setScale(5, BigDecimal.ROUND_DOWN).doubleValue();\n// }\n// }\n// return new double[]{x, y};\n\n //each particle has an x and y momentum based on its direction\n //1 x = 100, y = 0000\n //2 x = 050, y = 087\n //3 x = -050, y = 087\n //4 x = -100, y = 000\n //5 x = -050, y = -087\n //6 x = 050, y = -087\n\n int x = 0;\n int y = 0;\n\n for(int n = 0; n < SMASKS.length; n++){\n if((state & SMASKS[n]) == SMASKS[n]){\n x += xm[n];\n y += ym[n];\n }\n }\n return new int[]{x, y};\n }", "abstract void mo4372a(zzwt zzwt, cu cuVar);", "public static native void OpenMM_AmoebaBondForce_getBondParameters(PointerByReference target, int index, IntByReference particle1, IntByReference particle2, DoubleByReference length, DoubleByReference quadraticK);", "bgx mo11923a(bju bju, bhr bhr, int i, int[] iArr, biv biv, int i2, long j, boolean z, boolean z2);", "public boolean getUseSymbolicJacobian() {\n\t\treturn fieldUseSymbolicJacobian;\n\t}", "void getCirculation (double effaoa, double thickness_pst, double camber_pst) { \n double beta;\n double th_abs = thickness_pst/100.0; \n xcval = 0.0;\n ycval = camber_pst/50; // was: current_part.camber/25/2\n\n if (current_part.foil == FOIL_CYLINDER || /* get circulation for rotating cylnder */\n current_part.foil == FOIL_BALL) { /* get circulation for rotating ball */\n rval = radius/lconv;\n gamval = 4.0 * Math.PI * Math.PI *spin * rval * rval\n / (velocity/vconv);\n gamval = gamval * spindr;\n ycval = .0001;\n } else {\n rval = th_abs + Math.sqrt((current_part.foil == FOIL_FLAT_PLATE\n ? 0 : th_abs*th_abs)\n + ycval*ycval + 1.0);\n xcval = current_part.foil == FOIL_JOUKOWSKI ? 0 : (1.0 - Math.sqrt(rval*rval - ycval*ycval));\n beta = Math.asin(ycval/rval)/convdr; /* Kutta condition */\n gamval = 2.0*rval*Math.sin((effaoa+beta)*convdr);\n }\n }", "private double calculaz(double v) { //funcion de densidad de probabilidad normal\n double N = Math.exp(-Math.pow(v, 2) / 2) / Math.sqrt(2 * Math.PI);\n return N;\n }", "@Nullable\r\n/* */ public ji Z_() {\r\n/* 257 */ return new ji(this.d_, 3, aa_());\r\n/* */ }", "public void increase_BUIBYDryingFactor(){\r\n\tBUO=BUO+DF;\r\n}", "public static void obsDis()\n\t{\n\n\t\tclade = clad[k];\n\n\t\tclade.meanLatNest = 0; // mean latitude for the nesting clade \n\t\tclade.meanLonNest = 0; // mean longitude for the nesting clade \n\t\tclade.sumTotal = 0;\t\t // total number of observations in the nesting clade\n\n\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t{\n\t\t\tclade.meanLatitude[i]=0;\n\t\t\tclade.meanLongitude[i]=0;\n\t\t\tclade.Dc[i]=0;\n\t\t\tclade.Dn[i]=0;\n\t\t\tclade.varDc[i]=0;\n\t\t\tclade.varDn[i]=0;\n\t\t}\n\n\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t{\n\t\t\tclade.subCladeSum[i] = 0;\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\n\t\t\t\tclade.subCladeSum[i] += clade.absFreq[i][j];\t\n\t\t\tclade.sumTotal += clade.subCladeSum[i];\n\t\t\tfor(j = 0; j <clade.numCladeLocations; j++)\n\t\t\t \tclade.relFreq[i][j] = clade.absFreq[i][j] / clade.subCladeSum[i];\n\t\t}\n\t\t\n\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\n\t\t\t{\n\t\t\t\tindex = clade.cladeLocIndex[j]-1;\n\t\t\t\tclade.meanLatNest += clade.absFreq[i][j] / clade.sumTotal * GeoDis.Latitude[index];\n\t\t\t\tclade.meanLonNest += clade.absFreq[i][j] / clade.sumTotal * GeoDis.Longitude[index];\n\t\t\t}\n\n\t\tfor(i = 0; i <clade.numSubClades; i++)\n\t\t{\t\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\n\t\t\t{\n\t\t\t\tindex = clade.cladeLocIndex[j]-1;\n\t\t\t\tclade.meanLatitude[i] += clade.relFreq[i][j] * GeoDis.Latitude[index];\n\t\t\t\tclade.meanLongitude[i] += clade.relFreq[i][j] * GeoDis.Longitude[index];\n\t\t\t}\n\t\t\t\t\t\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\t\t\n\t\t\t{\n\t\t\t\tif (clade.relFreq[i][j] == 0)\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tindex = clade.cladeLocIndex[j]-1;\n\t\t\t\tif (GeoDis.Latitude[index] == clade.meanLatitude[i] && GeoDis.Longitude[index] == clade.meanLongitude[i]) \n\t\t\t\t\tZ = 1;\n\t\t\t\telse\t\n\t\t\t\t\tZ = Math.sin(GeoDis.Latitude[index]) * Math.sin(clade.meanLatitude[i]) + Math.cos(GeoDis.Latitude[index]) * \n\t\t\t\t \tMath.cos(clade.meanLatitude[i]) * Math.cos(clade.meanLongitude[i] - GeoDis.Longitude[index]);\n\n\t\t\t\t//System.err.println(\"Dc \" + clade.subCladeName[i] + \" = \" + clade.Dc[i] + \" Z = \" + Z);\n\t\t\t\t\n\t\t\t\tif (Math.abs(Z) < 1)\n\t\t\t\t{\n\t\t\t\t\t//VZ = 111.12 * (atan(-Z / sqrt(-Z * Z + 1)) + 90); // does not work, I do not know why \n\t\t\t\t\t//VZ = GC2K * (asin(-Z) + 90); // does not work, I do not know why \n\t\t\t\t\t//VZ = GC2K / D2R * acos(Z); // it works although gives slightly bigger distances \n\t\t\t\t\t VZ = RADIUS * Math.acos (Z); // it works although gives slightly bigger distances \n\t\t\t\t\tif(verbose){\n\t\t\t\t\t\tlogfile.println(\"Dc: Subclade = \" + clade.subCladeName + \" in \" + locationName[j] + \" distance to clade center \" + clade.subCladeName[i] + \" = \" + VZ);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tclade.Dc[i] += clade.relFreq[i][j] * VZ; \n\t\t\t\t\tclade.varDc[i] += clade.relFreq[i][j] * Math.pow (VZ, 2);\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\tif (GeoDis.Latitude[index] == clade.meanLatNest && GeoDis.Longitude[index] == clade.meanLonNest) \n\t\t\t\t\tZB = 1;\n\t\t\t\telse\t\n\t\t\t\t\tZB = Math.sin(GeoDis.Latitude[index]) * Math.sin(clade.meanLatNest) + Math.cos(GeoDis.Latitude[index]) * \n\t\t\t\t Math.cos(clade.meanLatNest) * Math.cos(clade.meanLonNest - GeoDis.Longitude[index]);\n\n\t\t\t\tif (Math.abs(ZB) >= 1)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\t//VZB = 111.12 * (atan(-ZB / sqrt(-ZB * ZB + 1)) + 90); \n\t\t\t\tVZB = RADIUS * Math.acos (ZB);\n\t\t\t\tclade.Dn[i] += clade.relFreq[i][j] * VZB ;\n\t\t\t\tif(verbose){\n\t\t\t\t\tlogfile.println(\"clade.Dn[i](\" + clade.Dn[i] + \")\" \n\t\t\t\t\t+ \"+= clade.relFreq[i][j]\" + \"(\" + clade.relFreq[i][j] + \")\" \n\t\t\t\t\t+ \"* VZB\" + \"(\" + VZB + \")\" );\n\t\t\t\t}\n\t\t\t\tclade.varDn[i] += clade.relFreq[i][j] * Math.pow (VZB, 2);\n\t\t\t\tif(verbose){\n\t\t\t\t\tlogfile.println(\"Dn: Subclade = \" + clade.subCladeName + \" in \"\n\t\t\t\t\t+ locationName[j] + \" distance to nested clade center = \"\n\t\t\t\t\t+ VZB);\n\t\t\t\t}\n\t\t\t\t//}\n\t\t\t}\n\t\t\n\n\t\t}\n\t\n\t}", "public static native int OpenMM_AmoebaVdwForce_addParticle(PointerByReference target, int parentIndex, double sigma, double epsilon, double reductionFactor, int isAlchemical);", "public double getV() {\r\n\t\treturn v;\t\r\n\t\t}", "private double calcuCMetric() {\n\t\treturn (p-1)/fcost;\n\t}", "public void test4_c() {/*\n\t\tGDGraph gdGraph = new GDGraph();\n\t\tGDGVertex gdVertex = gdGraph.addVertex();\n\t\tGDGEdge gdEdge1 = gdGraph.addEdge(gdVertex, gdVertex);\n\t\tGDGEdge gdEdge2 = gdGraph.addEdge(gdVertex, gdVertex);\n\n\t\tgdEdge1.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i, j - 1) \n\t\t\t\t{ 1, 0, 0},\n\t\t\t\t{ 0, 1, -1},\n\t\t\t\t{ 0, 0, 1}\n });\n\t\tgdEdge1.producedDomain = convertIntTableToPIPDRational(2, 0, new int[][]{ // (0..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0},\n\t\t\t\t{ 0, 1, -1}\n\t\t});\n\n\t\tgdEdge2.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i - 1, j + 7) \n\t\t\t\t{ 1, 0, -1},\n\t\t\t\t{ 0, 1, 7},\n\t\t\t\t{ 0, 0, 1}\n });\n\t\tgdEdge2.producedDomain = convertIntTableToPIPDRational(2, 0, new int[][]{ // (1..+inf, 0..+inf)\n\t\t\t\t{ 1, 0, -1},\n\t\t\t\t{ 0, 1, 0}\n\t\t});\n\n\t\tgdVertex.computationDomain = convertIntTableToPIPDRational(2, 0, new int[][]{ // (1..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, -1},\n\t\t\t\t{ 0, 1, -1}\n\t\t});\n\t\t\n\t\tgdGraph.calculateFeautrierSchedule(false);\n\t\n\t\tgdGraph.<Rational>codeGeneration(Rational.ZERO, Rational.ONE);\n\t*/}", "public Vertice GetExtremoFinal(){\r\n return this.Vf;\r\n }", "public static native void OpenMM_AmoebaGeneralizedKirkwoodForce_getParticleParameters(PointerByReference target, int index, DoubleByReference charge, DoubleByReference radius, DoubleByReference scalingFactor);", "@Override\n public double apply$mcDD$sp (double arg0)\n {\n return 0;\n }", "public static native PointerByReference OpenMM_AmoebaBondForce_create();", "public double getPartialDerviative(double consumptionAllocation);", "public abstract void debiterMontant( double montant);", "public Matrix P0 ();", "public static native int OpenMM_AmoebaAngleForce_addAngle(PointerByReference target, int particle1, int particle2, int particle3, double length, double quadraticK);", "public static native int OpenMM_AmoebaInPlaneAngleForce_addAngle(PointerByReference target, int particle1, int particle2, int particle3, int particle4, double length, double quadraticK);", "public interface PVPlant extends ElectricityGenerator {\n\n\t/**\n\t * Total area of the panels.\n\t */\n\tAreaResource panelArea();\n\n\t/**\n\t * Inclination of the modules in degrees. <br>\n\t * 0 : horizontal <br>\n\t * 90 : vertical.\n\t */\n\tAngleResource inclination();\n\n\t/**\n\t * Azimuthal orientation of the modules, from 0° to 360°. <br>\n\t */\n\tGeographicDirectionSensor azimuth();\n\n\t/**\n\t * Change in panel output power per temperature unit. Unit = 1/K. <br>\n\t * Note that this quantity is normally given in %/K instead of 1/K (factor 100 difference!). <br>\n\t * In practice, this value is temperature dependent. TODO\n\t * */\n\tFloatResource temperatureCoefficient();\n\n\t/**\n\t * Nominal Operating Cell Temperature (TNOCT), <br>\n\t * defined as the mean panel cell temperature for an open-rack mounted module in idle operation @ solar irradiance\n\t * of 800 W/m2 on the panel surface, ambient temperature of 20°C, wind speed of 1 m/s.\n\t */\n\tTemperatureResource nominalOperatingCellTemperature();\n\n\t/**\n\t * Solar panel installation type <br>\n\t * 1: roof mount <br>\n\t * 2: free standing <br>\n\t * 3: building integrated PV <br>\n\t * 10: flush mount roof installation (panels have the same orientation as the roof, panels close to roof) <br>\n\t * 11: open-rack roof installation <br>\n\t * 20: open-rack free standing <br>\n\t * 21: pole-mounted free standing\n\t */\n\tIntegerResource installationType();\n\n\t/**\n\t * 1: fixed installation, no tracking <br>\n\t * 2: single-axis tracking: horizontal <br>\n\t * 2: single-axis tracking: vertical <br>\n\t * 3: dual-axis tracking\n\t * */\n\tIntegerResource tracking();\n}", "@Override\n public double apply$mcDF$sp (float arg0)\n {\n return 0;\n }", "public double[] randv()\n\t{\n\t\tdouble p = a * (1.0 - e * e);\n\t\tdouble cta = Math.cos(ta);\n\t\tdouble sta = Math.sin(ta);\n\t\tdouble opecta = 1.0 + e * cta;\n\t\tdouble sqmuop = Math.sqrt(this.mu / p);\n\n\t\tVectorN xpqw = new VectorN(6);\n\t\txpqw.x[0] = p * cta / opecta;\n\t\txpqw.x[1] = p * sta / opecta;\n\t\txpqw.x[2] = 0.0;\n\t\txpqw.x[3] = -sqmuop * sta;\n\t\txpqw.x[4] = sqmuop * (e + cta);\n\t\txpqw.x[5] = 0.0;\n\n\t\tMatrix cmat = PQW2ECI();\n\n\t\tVectorN rpqw = new VectorN(xpqw.x[0], xpqw.x[1], xpqw.x[2]);\n\t\tVectorN vpqw = new VectorN(xpqw.x[3], xpqw.x[4], xpqw.x[5]);\n\n\t\tVectorN rijk = cmat.times(rpqw);\n\t\tVectorN vijk = cmat.times(vpqw);\n\n\t\tdouble[] out = new double[6];\n\n\t\tfor (int i = 0; i < 3; i++)\n\t\t{\n\t\t\tout[i] = rijk.x[i];\n\t\t\tout[i + 3] = vijk.x[i];\n\t\t}\n\n\t\treturn out;\n\t}", "public java.math.BigDecimal getVat () {\n\t\treturn vat;\n\t}", "public void MutationDNF (TableVar Variables) {\r\n\r\n int posiciones, interv, i, j, l, h, eliminar;\r\n float m;\r\n \r\n posiciones = Variables.getNVars()*long_poblacion;\r\n \r\n if (mut_prob > 0)\r\n while (Mu_next < posiciones) {\r\n // Determine the chromosome and gene to be muted\r\n i = Mu_next/Variables.getNVars();\r\n j = Mu_next%Variables.getNVars();\r\n \r\n // Copy the chromosome\r\n for (h=0; h<Variables.getNVars(); h++) {\r\n for (l=0; l<=Variables.getNLabelVar(h); l++)\r\n Des.setCromElemGene(descendientes, h, l, Inter.getCromElemGene(i,h,l));\r\n }\r\n \r\n // Make the mutation\r\n // Half the mutations eliminates the variable from the rule\r\n // The others sets a random value (including the elimination)\r\n eliminar = Randomize.Randint (0,10);\r\n if (eliminar <=5){\r\n for (l=0; l<=Variables.getNLabelVar(j); l++)\r\n Des.setCromElemGene(descendientes, j, l, 0);\r\n }\r\n else {\r\n interv = 0;\r\n for (l=0; l<Variables.getNLabelVar(j); l++) {\r\n Des.setCromElemGene(descendientes, j, l, Randomize.Randint(0,1));\r\n if (Des.getCromElemGene(descendientes, j, l)==1)\r\n interv ++;\r\n }\r\n // si no interviene ningún valor o intervienen todos, la variable no interviene\r\n if (interv==0 || interv==Variables.getNLabelVar(j))\r\n Des.setCromElemGene(descendientes, j, Variables.getNLabelVar(j), 0);\r\n else\r\n Des.setCromElemGene(descendientes, j, Variables.getNLabelVar(j), 1);\r\n }\r\n descendientes++;\r\n\r\n // Marks the chromosome as no evaluated\r\n Des.setIndivEvaluated(i,false);\r\n\r\n // Compute next position to be muted\r\n if (mut_prob<1) {\r\n m = (float) Randomize.Rand();\r\n Mu_next += Math.ceil (Math.log(m) / Math.log(1.0 - mut_prob));\r\n }\r\n else\r\n Mu_next += 1;\r\n\r\n }\r\n Mu_next -= posiciones;\r\n \r\n }", "private void calculateLabelMasses(PepXmlFraction fraction)\r\n {\r\n // Process amino acid mods\r\n List<MS2Modification> mods = fraction.getModifications();\r\n for (MS2Modification mod : mods)\r\n {\r\n char aa = mod.getAminoAcid().charAt(0);\r\n IsotopicLabel label = labels.get(aa);\r\n if (null != label)\r\n {\r\n float mass = mod.getMass();\r\n if (mod.getVariable())\r\n label.setHeavyMass(mass);\r\n else\r\n label.setLightMass(mass);\r\n }\r\n }\r\n\r\n/**********************************************************************\r\n ???? Pending commit of PepXmlLoader updates...\r\n\r\n // Process terminal mods\r\n List<MS2TerminalModification> tmods = fraction.getTerminalModifications();\r\n for (MS2TerminalModification mod : tmods)\r\n {\r\n char aa = mod.isNTerminus() ? 'n' : 'c'; // use psuedo amino acids for termini\r\n IsotopicLabel label = labels.get(aa);\r\n if (null != label)\r\n {\r\n float mass = mod.getMass();\r\n if (mod.getVariable())\r\n label.setHeavyMass(mass);\r\n else\r\n label.setLightMass(mass);\r\n }\r\n }\r\n**********************************************************************/\r\n\r\n // Make sure we've got a complete table of masses for the labels\r\n for (IsotopicLabel label : labels.values())\r\n {\r\n float light = label.getLightMass();\r\n float heavy = label.getHeavyMass();\r\n float diff = label.getMassDiff();\r\n\r\n _log.debug(\"Label Before = \" + label.toString());\r\n \r\n if (heavy == 0f && light == 0f)\r\n throw new Q3RuntimeException(\"No static or variable modification found for labeled residue '\" + label.getResidue() + \"'\");\r\n if (heavy == 0f && light != 0f)\r\n label.setHeavyMass(light + diff);\r\n else if (light == 0f && heavy != 0f)\r\n label.setLightMass(heavy - diff);\r\n\r\n _log.debug(\"Label After = \" + label.toString());\r\n\r\n if (label.getLightMass() < 0f ||\r\n label.getHeavyMass() < 0f ||\r\n label.getHeavyMass() < label.getLightMass())\r\n {\r\n throw new Q3RuntimeException(\"Inconsistent light and heavy masses (\" + label.getLightMass() + \" and \" + label.getHeavyMass() + \")\");\r\n }\r\n\r\n if (Math.abs(label.getHeavyMass() - label.getLightMass() - diff) > 0.01)\r\n _log.warn(\"Specified quantitation mass diff, \" + diff + \", may not be compatible with mass diff used in search \" + (heavy - light));\r\n }\r\n }", "private void UpdateTransform()\n\t{\t\n\t\tTransform transform = parent.transform;\n\t\t\n\t\tVector2 friction = Vector2.Scale(-frictionCoefficient,velocity);\n\t\tfloat angularFriction = -frictionCoefficient*angularVelocity;\n\t\t\n\t\t//Newton integration P = P + dP + acceleration * dt^2\n\t\ttransform.position.x += velocity.x + (acceleration.x *deltaTime*deltaTime) + friction.x;\n\t\ttransform.position.y += velocity.y + (acceleration.y *deltaTime*deltaTime) + friction.y;\n\t\ttransform.rotation += angularVelocity + angularAcceleration*deltaTime*deltaTime + angularFriction ;\n\t\t\n\t}", "public abstract void mo12694b(C1085v vVar, int i);", "public static String generateNegativeConstraintsConjunct(GenerateCVC1 cvc, QueryBlockDetails queryBlock, Conjunct conjunct) throws Exception {\n\n\t\t\n\t\tString constraintString = \"\";\n\n\t\tconstraintString += \"%--------------------------------\\n%NEGATIVE CONSTRAINTS FOR THIS CONJUNCT\\n%---------------------------------------\\n\";\n\t\t\n\t\tVector<String> OrConstraints=new Vector<String>();\n\t\tVector<String> OrStringConstraints = new Vector<String>();\n\n\t\t/** Generate negative constraint for equivalence class.*/\n\t\t/**FIXME: Mahesh..Ask Amol why the below code and why cant't we use getconstraintsforequijoins()*/\n\t\tif(!conjunct.getEquivalenceClasses().isEmpty()){\n\n\t\t\t/**Get the equivalence classes*/\n\t\t\tVector<Vector<Node>> equivalenceClasses = conjunct.getEquivalenceClasses();\n\n\t\t\tfor(int i=0; i<equivalenceClasses.size(); i++){\t/** For each equivalence class list*/\n\n\t\t\t\t/**Get this equivalence */\n\t\t\t\tVector<Node> ec = equivalenceClasses.get(i);\n\n\t\t\t\t/**for each node in this equivalence*/\n\t\t\t\tfor(int j=0;j<ec.size(); j++)\n\t\t\t\t{\n\n\t\t\t\t\tNode eceNulled = ec.get(j);\t\t\t/** This is R.a - to be nulled */\n\n\n\t\t\t\t\tString CVCStr = \"%DataSet Generated By Nulling: \"+ ((Node)eceNulled).toString() + \"\\n\";\n\t\t\t\t\tTable tableNulled = eceNulled.getTable();\n\t\t\t\t\tColumn colNulled = eceNulled.getColumn();\n\n\t\t\t\t\t/** TODO: Have one vector for positive and negative conditions. */\n\n\t\t\t\t\tcvc.setResultsetTableColumns1( new HashMap<Table, Vector<String>>() );\t\t\t\t\t\n\n\t\t\t\t\t/** S = set of elements in ec which have a foreign key relationship with R.a <use closure for this> */\n\t\t\t\t\tArrayList<Node> S = new ArrayList<Node>();\n\t\t\t\t\tVector<Node> nullableFKs = new Vector<Node>();\n\t\t\t\t\tS.add(eceNulled);\n\n\t\t\t\t\tfor(int k=0; k<ec.size(); k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tNode ece = ec.get(k);\n\t\t\t\t\t\tTable tableEce = ece.getTable();\n\t\t\t\t\t\tColumn colEce = ece.getColumn();\n\t\t\t\t\t\t/**TODO Maintain a datasructure for list of PK and FK so as to compare in one pass.*/\n\t\t\t\t\t\tfor(int l=0; l < cvc.getForeignKeys().size(); l++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/**In ForeignKeys Left points to the foreign key attribute while the right points to the Primary or the referenced column*/\n\t\t\t\t\t\t\tNode fk = cvc.getForeignKeys().get(l);\n\n\t\t\t\t\t\t\t/**Adapted for Nullable foreign keys.\n\t\t\t\t\t\t\t *If FK is not nullable, then we need to null it along with the referenced relation which is eceNulled*/\n\t\t\t\t\t\t\tif( (fk.getLeft().getTable() == tableEce && fk.getLeft().getColumn() == colEce) \n\t\t\t\t\t\t\t\t\t&& (fk.getRight().getTable() == tableNulled && fk.getRight().getColumn() == colNulled)){\n\t\t\t\t\t\t\t\tif(!colEce.isNullable())\n\t\t\t\t\t\t\t\t\tS.add(ece);/**To be taken along with nulled Column*/\n\t\t\t\t\t\t\t\tif(colEce.isNullable())\n\t\t\t\t\t\t\t\t\tnullableFKs.add(ece);/** To be taken along with nulled column, in case P.size > 1 */\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Now, we have in S, the nulled column along with the foreign key columns in that equivalence class\n\t\t\t\t\t * that reference the nulled column and are not nullable.\n\t\t\t\t\t * But, if EC - S, contains a nullable column which references the nulled column, \n\t\t\t\t\t * AND also contains some other column which may or may not be nullable, \n\t\t\t\t\t * then we cannot assign NULL to the nullable FK column. We then need to nullify the nullable FK column\n\t\t\t\t\t * along with the nulled column. If EC - S, just contains a single nullable column referencing the \n\t\t\t\t\t * nulled column, then we can assign NULL to that column in order to nullify the nulled column. \n\t\t\t\t\t */\n\n\n\t\t\t\t\t/** Form P = EC - S */\n\t\t\t\t\tVector<Node> P = new Vector<Node>();\n\t\t\t\t\tfor(int k=0; k<ec.size(); k++)\t\t\t\t\t\t\n\t\t\t\t\t\tif( cvc.getqParser().alreadyNotExistInEquivalenceClass(S, ec.get(k)))\n\t\t\t\t\t\t\tP.add(ec.get(k));\n\n\n\t\t\t\t\tSystem.out.println(\"R.a = \"+eceNulled);\n\t\t\t\t\tSystem.out.print(\"EC : \"); Node.printPredicateVector(ec);\n\n\t\t\t\t\t/**For Now : if P is empty continue;*/\n\t\t\t\t\tif(P.size() == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif(P.size() == 1 \n\t\t\t\t\t\t\t&& P.get(0).getColumn().getReferenceColumn() == eceNulled.getColumn()\n\t\t\t\t\t\t\t&& P.get(0).getColumn().isNullable()){\n\n\t\t\t\t\t\t/**check if the column in P is referencing the nulled column and is nullable.\n\t\t\t\t\t\t *If so, then we can nullify the nulled relation inspite of the FK*/\n\t\t\t\t\t\tOrConstraints.add( GenerateCVCConstraintForNode.cvcSetNull(cvc, P.get(0).getColumn(), \"1\"));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t/**Otherwise, we need to nullify the foreign keys along with the nulled column.\n\t\t\t\t\t\t * Note that we need to do this irrespective of whether the column in P is FK \n\t\t\t\t\t\t * or whether it is nullable. Because, then we cannot assign NULL to any of the columns in P\n\t\t\t\t\t\t * This is because, NULLs cannot be equated and hence the joins in P will not be propogated up.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tP.removeAll(nullableFKs);\n\n\t\t\t\t\t\t/** Generate positiveConds for members in P*/ \n\t\t\t\t\t\tGenerateJoinPredicateConstraints.genPositiveConds(P);\n\t\t\t\t\t}\n\n\t\t\t\t\t/**Now generate negative conditions for Nulled relation\n\t\t\t\t\t *i.e. NOT EXISTS (i: Nulled Rel): NulledRel[i].col = P[1].col*/\n\t\t\t\t\tOrConstraints.add( GenerateJoinPredicateConstraints.genNegativeConds( cvc, queryBlock, colNulled, P.get(0)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\n\t\t/**Now generate Positive conditions for each of the non equi join conditions \n\t\t * that were not considered when building equivalence classes*/\n\t\tVector<Node> allConds = conjunct.getAllConds();\n\t\t\n\t\t/**get constraint*/\n\t\tString constraint = GenerateJoinPredicateConstraints.getNegativeConstraintsForNonEquiJoins(cvc, queryBlock, allConds) ;\n\n\t\tif( constraint.length() != 0)\n\t\t\tOrConstraints.add( constraint );\n\n\t\t/** Now generate Negative constraints for selection conditions */\n\t\tVector<Node> selectionConds = conjunct.getSelectionConds();\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeSelConds = GenerateCVCConstraintForNode.getNegativeConditions(selectionConds);\n\n\t\t/**Generate constraints for the negative conditions*/\n\t\tfor(int k = 0; k < negativeSelConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeSelConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l = 1; l <= count; l++)\n\t\t\t\tOrConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeSelConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\n\t\t/**Generate negative constraints for string selection conditions */\n\t\tVector<Node> stringSelectionConds = conjunct.getStringSelectionConds();\t\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeStringSelConds = GenerateCVCConstraintForNode.getNegativeConditions(stringSelectionConds);\n\n\t\t/**Generate constraints for the negative conditions*/\n\t\tfor(int k = 0; k < negativeStringSelConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeStringSelConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l = 1; l <= count; l++)\n\t\t\t\tOrStringConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeStringSelConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\t\t/**Generate negative constraints for like conditions */\n\t\tVector<Node> likeConds = conjunct.getLikeConds();\n\n\t\t/**get negative conditions for these nodes*/\n\t\tVector<Node> negativeLikeConds = GenerateCVCConstraintForNode.getNegativeConditions(likeConds);\n\n\t\tfor(int k=0; k<likeConds.size(); k++){\n\n\t\t\t/**get table details*/\n\t\t\tString tableNo = negativeLikeConds.get(k).getLeft().getTableNameNo();\n\t\t\tint offset = cvc.getRepeatedRelNextTuplePos().get(tableNo)[1];\n\n\t\t\tint count = cvc.getNoOfTuples().get(tableNo)* queryBlock.getNoOfGroups();/** We should generate the constraints across all groups */;;\n\t\t\tfor(int l=1;l<=count;l++)\n\t\t\t\tOrStringConstraints.add( \"ASSERT \" + GenerateCVCConstraintForNode.genPositiveCondsForPred(queryBlock, negativeLikeConds.get(k),l+offset-1)+\";\" +\"\\n\" );\n\t\t}\n\n\n\t\t/**get the where clause sub query conditions in this conjunct*/\n\t\tif(conjunct.getAllSubQueryConds() != null){\n\t\t\tfor(int i=0; i < conjunct.getAllSubQueryConds().size(); i++){\n\t\t\t\t\n\t\t\t\tNode subQ = conjunct.getAllSubQueryConds().get(i);\n\t\t\t\t\n\t\t\t\t/**FIXME: Add negative constraints for this where clause sub query block\n\t\t\t\t * We could use methods of class: GenerateConstraintsForWhereClauseSubQueryBlock*/\n\t\t\t\t/**FIXME:If the given conjunct has NOT EXISTS conditions, then negative of that becomes positive*/\n\t\t\t\tint index = UtilsRelatedToNode.getQueryIndexOfSubQNode(subQ);\n\n\t\t\t\t/**get sub query block*/\n\t\t\t\tQueryBlockDetails subQuery = queryBlock.getWhereClauseSubQueries().get(index);\n\t\t\t\t\n\t\t\t\tString negativeConstraint = \"\";\n\t\t\t\t\n\t\t\t\t/**if this sub query is of EXISTS Type*/\n\t\t\t\tif(subQ.getType().equals(Node.getExistsNodeType()) ){\n\t\t\t\t\t\n\t\t\t\t\tfor (Conjunct con: subQuery.getConjuncts())\n\t\t\t\t\t\tnegativeConstraint += generateNegativeConstraintsConjunct(cvc, subQuery, con);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**if sub query is of type NOT Exists*/\n\t\t\t\t/**We need to get positive constraints for this sub query*/\n\t\t\t\telse if ( subQ.getType().equals(Node.getNotExistsNodeType() ) ){\n\t\t\t\t\t\n\t\t\t\t\tfor (Conjunct con: subQuery.getConjuncts())\n\t\t\t\t\t\tnegativeConstraint += getConstraintsForConjuct(cvc, queryBlock, con);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\t/**get negative condition for this sub query node*/\n\t\t\t\t\tNode subQNegative = GenerateCVCConstraintForNode.getNegativeCondition(subQ);\n\t\t\t\t\t\n\t\t\t\t\t/**get negative constraints for where clause connective*/\t\t\t\t\t\n\t\t\t\t\tnegativeConstraint = GenerateConstraintsForWhereClauseSubQueryBlock.getConstraintsForWhereSubQueryConnective(cvc, queryBlock, subQNegative);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconstraintString += negativeConstraint;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!OrConstraints.isEmpty() && OrConstraints.size() != 0)\n\t\t\tconstraintString += processOrConstraints(OrConstraints);\n\t\tconstraintString += \"\\n%--------------------------------\\n%END OF NEGATIVE CONSTRAINTS FOR THIS CONJUNCT\\n%---------------------------------------\";\n\n\t\tif(!OrStringConstraints.isEmpty() && OrStringConstraints.size() != 0 )\n\t\t\tcvc.getStringConstraints().add(processOrConstraints(OrStringConstraints));\n\n\t\treturn constraintString;\n\t}", "private void m3422v(C0933b bVar) {\n this.f4373c.add(bVar);\n int i = bVar.f4379a;\n if (i == 1) {\n this.f4374d.mo7444g(bVar.f4380b, bVar.f4382d);\n } else if (i == 2) {\n this.f4374d.mo7443f(bVar.f4380b, bVar.f4382d);\n } else if (i == 4) {\n this.f4374d.mo7440c(bVar.f4380b, bVar.f4382d, bVar.f4381c);\n } else if (i == 8) {\n this.f4374d.mo7438a(bVar.f4380b, bVar.f4382d);\n } else {\n throw new IllegalArgumentException(\"Unknown update op type for \" + bVar);\n }\n }", "public /* synthetic */ void m125691a(DetailInfo axVar, ExtraInfo bjVar) {\n axVar.mo125533a().f106957t = 6572;\n axVar.mo125533a().f106947j = ZA.m91651i();\n axVar.mo125533a().f106952o = this.f90217G.mo110111g();\n }", "public void recarga(){\n \tthis.fuerza *= 1.1;\n \tthis.vitalidad *= 1.1; \n }", "public double[] partialV(double u, double v) {\n return null;\n }", "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 39; angle < 45; angle += 3) {\r\n int x, y, yOffset;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n scaleFactor = Math.tan(angleRad);\r\n x = xDim;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x > xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x--;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n x = xcm;\r\n y = 0;\r\n yOffset = y * xDim;\r\n while (y < ycm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n y++;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n x = 0;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x < xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x++;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n x = xcm;\r\n y = yDim;\r\n yOffset = y * xDim;\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n y--;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n }\r\n } // end for (angle = 0; ...\r\n \r\n int[] x1 = new int[xValsAbdomenVOI.size()];\r\n int[] y1 = new int[xValsAbdomenVOI.size()];\r\n int[] z1 = new int[xValsAbdomenVOI.size()];\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n x1[idx] = xValsAbdomenVOI.get(idx);\r\n y1[idx] = xValsAbdomenVOI.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n\r\n\r\n }", "private double calculateUvi(){\n if ( uva != Integer.MAX_VALUE\n && uvb != Integer.MAX_VALUE\n && uvd != Integer.MAX_VALUE\n && uvcomp1 != Integer.MAX_VALUE\n && uvcomp2 != Integer.MAX_VALUE\n )\n {\n // These equations came from the \"Designing the VEML6075 into an Application\" document from Vishay\n double uvacomp = (uva - uvd) - VEML_A_COEF * (uvcomp1 - uvd) - VEML_B_COEF * (uvcomp2 - uvd);\n double uvbcomp = (uvb - uvd) - VEML_C_COEF * (uvcomp1 - uvd) - VEML_D_COEF * (uvcomp2 - uvd);\n\n return ( (uvbcomp * VEML_UVB_RESP) + (uvacomp * VEML_UVA_RESP) ) / 2.0;\n }\n\n return Double.NaN;\n }", "void mo1941j();" ]
[ "0.53433704", "0.52052104", "0.51187766", "0.49703133", "0.49398366", "0.48711008", "0.48141837", "0.47640523", "0.46892503", "0.4656957", "0.46299797", "0.4620345", "0.4584311", "0.45753193", "0.45687208", "0.45463687", "0.45293447", "0.45282608", "0.45176125", "0.4516728", "0.45148715", "0.4509271", "0.45090544", "0.4505219", "0.45036072", "0.4499657", "0.44967258", "0.44879514", "0.44828302", "0.44781706", "0.446965", "0.44649416", "0.44621706", "0.44577453", "0.44534975", "0.44441822", "0.4423151", "0.44177654", "0.43950552", "0.43916318", "0.43914923", "0.43713927", "0.4362749", "0.43587777", "0.43496934", "0.4348952", "0.43431163", "0.43348312", "0.43346193", "0.43257523", "0.43189847", "0.4316966", "0.4311029", "0.43063134", "0.4304616", "0.4299207", "0.4292732", "0.42914027", "0.4287313", "0.42821124", "0.42770424", "0.42766193", "0.4272641", "0.4266031", "0.42610967", "0.4256953", "0.42521167", "0.42497933", "0.42489576", "0.4246832", "0.42446727", "0.42430738", "0.4241422", "0.42406413", "0.42374557", "0.42367768", "0.42359382", "0.422839", "0.42259377", "0.42172685", "0.4204668", "0.4202826", "0.4202564", "0.42017785", "0.41984254", "0.419534", "0.418921", "0.4187719", "0.4187341", "0.4186433", "0.41858193", "0.41809013", "0.41790682", "0.4177216", "0.4174836", "0.41747823", "0.4173312", "0.41711304", "0.4170434", "0.41699076" ]
0.4954907
4
Generate the microJacobian of the Manifest Measure to the Discount Factor
public org.drip.quant.calculus.WengertJacobian manifestMeasureDFMicroJack ( final java.lang.String strManifestMeasure, final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.CreditPricerParams pricerParams, final org.drip.param.market.CurveSurfaceQuoteContainer csqs, final org.drip.param.valuation.ValuationCustomizationParams vcp) { if (null == valParams || valParams.valueDate() >= _lsPeriod.get (_lsPeriod.size() - 1).endDate() || null == strManifestMeasure) return null; org.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState (org.drip.state.identifier.FundingLabel.Standard (payCurrency())); if (null == dcFunding) return null; if ("Rate".equalsIgnoreCase (strManifestMeasure) || "SwapRate".equalsIgnoreCase (strManifestMeasure)) { org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapMeasures = value (valParams, pricerParams, csqs, vcp); if (null == mapMeasures) return null; double dblDirtyDV01 = mapMeasures.get ("DirtyDV01"); double dblParSwapRate = mapMeasures.get ("SwapRate"); try { org.drip.quant.calculus.WengertJacobian wjSwapRateDFMicroJack = null; for (org.drip.analytics.cashflow.CompositePeriod p : _lsPeriod) { int iPeriodPayDate = p.payDate(); if (iPeriodPayDate < valParams.valueDate()) continue; double dblPeriodDCF = p.couponMetrics (valParams.valueDate(), csqs).dcf(); org.drip.quant.calculus.WengertJacobian wjPeriodFwdRateDF = dcFunding.jackDForwardDManifestMeasure (p.startDate(), p.endDate(), "Rate", dblPeriodDCF); org.drip.quant.calculus.WengertJacobian wjPeriodPayDFDF = dcFunding.jackDDFDManifestMeasure (iPeriodPayDate, "Rate"); if (null == wjPeriodFwdRateDF || null == wjPeriodPayDFDF) continue; double dblForwardRate = dcFunding.libor (p.startDate(), p.endDate()); double dblPeriodPayDF = dcFunding.df (iPeriodPayDate); if (null == wjSwapRateDFMicroJack) wjSwapRateDFMicroJack = new org.drip.quant.calculus.WengertJacobian (1, wjPeriodFwdRateDF.numParameters()); double dblPeriodNotional = notional (p.startDate(), p.endDate()); for (int k = 0; k < wjPeriodFwdRateDF.numParameters(); ++k) { double dblPeriodMicroJack = (dblForwardRate - dblParSwapRate) * wjPeriodPayDFDF.firstDerivative (0, k) + dblPeriodPayDF * wjPeriodFwdRateDF.firstDerivative (0, k); if (!wjSwapRateDFMicroJack.accumulatePartialFirstDerivative (0, k, dblPeriodNotional * dblPeriodDCF * dblPeriodMicroJack / dblDirtyDV01)) return null; } } return wjSwapRateDFMicroJack; } catch (java.lang.Exception e) { e.printStackTrace(); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private long getSuffixCValue(int sufIndex){\n long result = 0;\n for(int index = sufIndex; index<number;index++){\n result = result^array[index];\n }\n return result;\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}", "public int determinant(){\r\n\t\tint ret = 0;\r\n\t\tif (this.N == 1){\r\n\t\t\tret = this.MA[0][0];\r\n\t\t}\r\n\t\telse{\r\n\t\t\tfor (int j = 0; j < this.N; j++){\r\n\t\t\t\tret += Math.pow(-1, j) * this.MA[0][j] * \r\n\t\t\t\t\t\tthis.minor(j).determinant();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "private double calcuCMetric() {\n\t\treturn (p-1)/fcost;\n\t}", "public void dorcsd_(CHARACTER JOBU1,CHARACTER JOBU2,CHARACTER JOBV1T,CHARACTER JOBV2T,CHARACTER TRANS,CHARACTER SIGNS,INTEGER M,INTEGER P,INTEGER Q,double[] X11,INTEGER LDX11,double[] X12,INTEGER LDX12,double[] X21,INTEGER LDX21,double[] X22,INTEGER LDX22,double[] THETA,double[] U1,INTEGER LDU1,double[] U2,INTEGER LDU2,double[] V1T,INTEGER LDV1T,double[] V2T,INTEGER LDV2T,double[] WORK,INTEGER LWORK,int[] IWORK,INTEGER INFO);", "double calculateGLBasicMass(int i1, int i2, int i3)\n {\n\n // Array of Glycerolipid's num of Carbon, Hydrogen repeated (for SN1 Dropdown Menu's values)\n int[] arrayGL_sn1 = {\n 5,10, 7,14, 9,18, 11,22, 13,26, 15,30, 16,32, 17,34,\n 17,32, 18,36, 18,34, 19,40, 19,38, 19,38, 19,36, 20,40,\n 20,38, 20,36, 21,44, 21,42, 21,42, 21,40, 21,40, 21,38,\n 21,36, 21,36, 21,34, 22,44, 23,48, 23,46, 23,46, 23,44,\n 23,42, 23,40, 23,38, 23,36, 24,48, 25,50, 25,48, 25,46,\n 25,44, 25,42, 25,40, 25,38, 26,52, 27,54, 27,52, 28,56, 29,58};\n\n // addCarbon array: Amount of increase in Carbon when on certain sn2 & sn3 index position\n int[] addCarbon = {\n 0, 2, 4, 6, 8, 10, 12, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17,\n 18, 18, 18, 18, 18, 18, 18, 19, 20, 20, 20, 20,\t20,\t20, 21, 22,\n 22,\t22,\t22,\t22, 22, 22, 23, 24, 24, 25, 26 };\n\n // addHydrogen array: Amount of increase in Hydrogen when on certain sn2 & sn3 index position\n int[] addHydrogen = {\n 0, 2, 6, 10, 14, 18, 22, 24, 26, 24, 28, 26, 30, 28, 32, 30, 28,\n 34,\t32,\t32,\t30,\t28,\t28,\t26,\t36,\t38,\t36,\t34,\t32,\t30,\t28,\t40,\t42,\n 40,\t38,\t36,\t34,\t32,\t30,\t44,\t46,\t44,\t48,\t50 };\n\n // Get the # of C & H depending on the index position of SN1's dropdown menu\n int numOfC = arrayGL_sn1[i1 * 2], numOfH = arrayGL_sn1[i1 * 2 + 1];\n\n // Add carbon & hydrogen depending on SN2 and SN3 dropdown menu's index position\n numOfC = numOfC + addCarbon[i2] + addCarbon[i3];\n numOfH = numOfH + addHydrogen[i2] + addHydrogen[i3];\n\n /* Set Number of Carbon & Hydrogen */\n setNumC(numOfC); setNumH(numOfH);\n\n /* Set Number of Oxygen */\n\n // If SN1 Dropdown index is not O or P\n if (i1 != 11 && i1 != 12 && i1 != 18 && i1 != 19 && i1 != 28 && i1 != 29) {\n\n if (i2 == 0 && i3 == 0){ setNumO(4); }\n else if (i2 == 0 || i3 == 0) { setNumO(5); }\n else setNumO(6);\n\n // If SN1 Dropdown index is O or P\n } else {\n\n if (i2 == 0 && i3 == 0){ setNumO(3); }\n else if (i2 == 0 || i3 == 0) { setNumO(4); }\n else setNumO(5);\n }\n\n // Sets the basic mass based on the elemental composition of the monoisotopic distribution\n setMass(calculateInitialMass(getNumC(), getNumH(), getNumO(), getNumN(), getNumAg(),\n getNumLi(), getNumNa(), getNumK(), getNumCl(), getNumP(), getNumS(), getNumF()));\n\n // Return basic mass\n return getMass();\n }", "@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}", "MagLegendre( int nt ) \n {\n nTerms = nt;\n Pcup = new double[ nTerms + 1 ];\n dPcup = new double[ nTerms + 1 ];\n }", "C11316t5 mo29022j0();", "public double getPartialDerviative(double consumptionAllocation);", "public double getCoefficient();", "double objetosc() {\n return dlugosc * wysokosc * szerokosc; //zwraca obliczenie poza metode\r\n }", "public double getResult(){\n double x;\n x= (3+Math.sqrt(9-4*3*(1-numberOfStrands)))/(2*3);\n if(x<0){\n x= (3-Math.sqrt(9-(4*3*(1-numberOfStrands))))/6;\n\n }\n numberOfLayers=(float) x;\n diameter=((2*numberOfLayers)-1)*strandDiameter;\n phaseSpacing=(float)(Math.cbrt(ab*bc*ca));\n\n netRadius=diameter/2;\n\n\n\n //SGMD calculation\n float prod=1;\n for(int rand=0;rand<spacingSub.size();rand++){\n prod*=spacingSub.get(rand);\n }\n\n //SGMD calculation\n sgmd=Math.pow((Math.pow(netRadius,subconductors)*prod*prod),1/(subconductors*subconductors));\n capacitance=((8.854e-12*2*3.14)/Math.log(phaseSpacing/sgmd));\n Log.d(\"How\",\"phase spacing:\"+phaseSpacing+\" sgmd=\"+sgmd);\n return capacitance*1000;\n\n\n }", "public void increase_BUIBYDryingFactor(){\r\n\tBUO=BUO+DF;\r\n}", "public void cal_AdjustedFuelMoist(){\r\n\tADFM=0.9*FFM+0.5+9.5*Math.exp(-BUO/50);\r\n}", "public Calculation getMultiplicityFunction() {\n return multiplicityFunction;\n }", "abstract void mo4366a(int i, zzwt zzwt, cu cuVar);", "public abstract void recalcNormalizationExtrema();", "public static void obsDis()\n\t{\n\n\t\tclade = clad[k];\n\n\t\tclade.meanLatNest = 0; // mean latitude for the nesting clade \n\t\tclade.meanLonNest = 0; // mean longitude for the nesting clade \n\t\tclade.sumTotal = 0;\t\t // total number of observations in the nesting clade\n\n\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t{\n\t\t\tclade.meanLatitude[i]=0;\n\t\t\tclade.meanLongitude[i]=0;\n\t\t\tclade.Dc[i]=0;\n\t\t\tclade.Dn[i]=0;\n\t\t\tclade.varDc[i]=0;\n\t\t\tclade.varDn[i]=0;\n\t\t}\n\n\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t{\n\t\t\tclade.subCladeSum[i] = 0;\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\n\t\t\t\tclade.subCladeSum[i] += clade.absFreq[i][j];\t\n\t\t\tclade.sumTotal += clade.subCladeSum[i];\n\t\t\tfor(j = 0; j <clade.numCladeLocations; j++)\n\t\t\t \tclade.relFreq[i][j] = clade.absFreq[i][j] / clade.subCladeSum[i];\n\t\t}\n\t\t\n\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\n\t\t\t{\n\t\t\t\tindex = clade.cladeLocIndex[j]-1;\n\t\t\t\tclade.meanLatNest += clade.absFreq[i][j] / clade.sumTotal * GeoDis.Latitude[index];\n\t\t\t\tclade.meanLonNest += clade.absFreq[i][j] / clade.sumTotal * GeoDis.Longitude[index];\n\t\t\t}\n\n\t\tfor(i = 0; i <clade.numSubClades; i++)\n\t\t{\t\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\n\t\t\t{\n\t\t\t\tindex = clade.cladeLocIndex[j]-1;\n\t\t\t\tclade.meanLatitude[i] += clade.relFreq[i][j] * GeoDis.Latitude[index];\n\t\t\t\tclade.meanLongitude[i] += clade.relFreq[i][j] * GeoDis.Longitude[index];\n\t\t\t}\n\t\t\t\t\t\n\t\t\tfor(j = 0; j < clade.numCladeLocations; j++)\t\t\n\t\t\t{\n\t\t\t\tif (clade.relFreq[i][j] == 0)\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tindex = clade.cladeLocIndex[j]-1;\n\t\t\t\tif (GeoDis.Latitude[index] == clade.meanLatitude[i] && GeoDis.Longitude[index] == clade.meanLongitude[i]) \n\t\t\t\t\tZ = 1;\n\t\t\t\telse\t\n\t\t\t\t\tZ = Math.sin(GeoDis.Latitude[index]) * Math.sin(clade.meanLatitude[i]) + Math.cos(GeoDis.Latitude[index]) * \n\t\t\t\t \tMath.cos(clade.meanLatitude[i]) * Math.cos(clade.meanLongitude[i] - GeoDis.Longitude[index]);\n\n\t\t\t\t//System.err.println(\"Dc \" + clade.subCladeName[i] + \" = \" + clade.Dc[i] + \" Z = \" + Z);\n\t\t\t\t\n\t\t\t\tif (Math.abs(Z) < 1)\n\t\t\t\t{\n\t\t\t\t\t//VZ = 111.12 * (atan(-Z / sqrt(-Z * Z + 1)) + 90); // does not work, I do not know why \n\t\t\t\t\t//VZ = GC2K * (asin(-Z) + 90); // does not work, I do not know why \n\t\t\t\t\t//VZ = GC2K / D2R * acos(Z); // it works although gives slightly bigger distances \n\t\t\t\t\t VZ = RADIUS * Math.acos (Z); // it works although gives slightly bigger distances \n\t\t\t\t\tif(verbose){\n\t\t\t\t\t\tlogfile.println(\"Dc: Subclade = \" + clade.subCladeName + \" in \" + locationName[j] + \" distance to clade center \" + clade.subCladeName[i] + \" = \" + VZ);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tclade.Dc[i] += clade.relFreq[i][j] * VZ; \n\t\t\t\t\tclade.varDc[i] += clade.relFreq[i][j] * Math.pow (VZ, 2);\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\tif (GeoDis.Latitude[index] == clade.meanLatNest && GeoDis.Longitude[index] == clade.meanLonNest) \n\t\t\t\t\tZB = 1;\n\t\t\t\telse\t\n\t\t\t\t\tZB = Math.sin(GeoDis.Latitude[index]) * Math.sin(clade.meanLatNest) + Math.cos(GeoDis.Latitude[index]) * \n\t\t\t\t Math.cos(clade.meanLatNest) * Math.cos(clade.meanLonNest - GeoDis.Longitude[index]);\n\n\t\t\t\tif (Math.abs(ZB) >= 1)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\t//VZB = 111.12 * (atan(-ZB / sqrt(-ZB * ZB + 1)) + 90); \n\t\t\t\tVZB = RADIUS * Math.acos (ZB);\n\t\t\t\tclade.Dn[i] += clade.relFreq[i][j] * VZB ;\n\t\t\t\tif(verbose){\n\t\t\t\t\tlogfile.println(\"clade.Dn[i](\" + clade.Dn[i] + \")\" \n\t\t\t\t\t+ \"+= clade.relFreq[i][j]\" + \"(\" + clade.relFreq[i][j] + \")\" \n\t\t\t\t\t+ \"* VZB\" + \"(\" + VZB + \")\" );\n\t\t\t\t}\n\t\t\t\tclade.varDn[i] += clade.relFreq[i][j] * Math.pow (VZB, 2);\n\t\t\t\tif(verbose){\n\t\t\t\t\tlogfile.println(\"Dn: Subclade = \" + clade.subCladeName + \" in \"\n\t\t\t\t\t+ locationName[j] + \" distance to nested clade center = \"\n\t\t\t\t\t+ VZB);\n\t\t\t\t}\n\t\t\t\t//}\n\t\t\t}\n\t\t\n\n\t\t}\n\t\n\t}", "public void calcInc(int np)\n\t{\n \n findSpecEq();\n int nofc=numberOfComponents;\n fvec.timesEquals(0.0);\n fvec.set(nofc+1,0,1.0);\n Matrix dxds=Jac.solve(fvec);\n if (np<5)\n {\n double dp=0.01;\n ds=dp/dxds.get(nofc+1,0);\n Xgij.setMatrix(0,nofc+1,np-1,np-1,u);\n dxds.timesEquals(ds);\n // dxds.print(0,10);\n u.plusEquals(dxds);\n // Xgij.print(0,10);\n// u.print(0,10);\n }\n else\n {\n //System.out.println(\"iter \" +iter + \" np \" + np);\n if (iter>6)\n { \n ds *= 0.5;\n System.out.println(\"ds > 6\");\n }\n \n else\n {\n if (iter<3) {\n ds *= 1.5;\n }\n if (iter==3) {\n ds *= 1.1;\n }\n if (iter==4) {\n ds *= 1.0;\n }\n if (iter>4) {\n ds *= 0.5;\n }\n \n// Now we check wheater this ds is greater than dTmax and dPmax.\n if(Math.abs(system.getTemperature()*dxds.get(nofc,0)*ds)>dTmax){\n // System.out.println(\"true T\");\n ds=sign(dTmax/system.getTemperature()/Math.abs(dxds.get(nofc,0)),ds);\n }\n \n if(Math.abs(system.getPressure()*dxds.get(nofc+1,0)*ds)>dPmax)\n {\n ds=sign(dPmax/system.getPressure()/Math.abs(dxds.get(nofc+1,0)),ds);\n // System.out.println(\"true P\");\n }\n if (etterCP2) {\n etterCP2=false;\n ds = 0.5*ds;\n }\n \n Xgij.setMatrix(0,nofc+1,0,2,Xgij.getMatrix(0,nofc+1,1,3)); \n Xgij.setMatrix(0,nofc+1,3,3,u);\n s.setMatrix(0,0,0,3,Xgij.getMatrix(speceq,speceq,0,3));\n // s.print(0,10);\n // System.out.println(\"ds1 : \" + ds);\n calcInc2(np);\n // System.out.println(\"ds2 : \" + ds);\n \n// Here we find the next point from the polynomial.\n \n }\n }\n }", "protected abstract double getReductionFactor();", "public double[][] coFactorFinder() {\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/* co-factor: change signs.\n\t\t\t\t\t|+ - +|\n\t\t\t\t\t|- + -|\n\t\t\t\t\t|+ - +|\t */\n\t\t\t\tthis.coFactor = new double[this.singleMatrix.length][this.singleMatrix[i].length];\n\t\t\t\t\n\t\t\t\tthis.coFactor[0][0] = this.minor[0][0];\n\t\t\t\tthis.coFactor[0][1] = - this.minor[0][1];\n\t\t\t\tthis.coFactor[0][2] = this.minor[0][2];\n\t\t\t\tthis.coFactor[1][0] = - this.minor[1][0];\n\t\t\t\tthis.coFactor[1][1] = this.minor[1][1];\n\t\t\t\tthis.coFactor[1][2] = - this.minor[1][2];\n\t\t\t\tthis.coFactor[2][0] = this.minor[2][0];\n\t\t\t\tthis.coFactor[2][1] = - this.minor[2][1];\n\t\t\t\tthis.coFactor[2][2] = this.minor[2][2];\n\t\t\t\t\t\n\t\t\t}\n\t\t}\t\t\t\t\n\t\t//\tprint\n\t\t\tSystem.out.println(\"\\nCo-factor of the current matrix is: \");\n\t\t\tfor (int i=0; i<this.singleMatrix.length; i++) {\n\t\t\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\tSystem.out.print(String.format(\"%.2f\", coFactor[i][j]) + \" \");\t//display the result with a space between value representing as two decimal point\n\t\t\t\t}\n\t\t\tSystem.out.println();\t//a new line for the next row and cols\n\t\t\t}\n\t\treturn coFactor;\t//return co-factors\n\t\t}", "public final float determinant() {\n\t// less *,+,- calculation than expanded expression.\n\treturn m00*(m11*m22 - m21*m12)\n\t - m01*(m10*m22 - m20*m12)\n\t + m02*(m10*m21 - m20*m11);\n }", "public int mo9745j() {\n return mo9785x();\n }", "public double getNu() {return nu;}", "public abstract float mo12693b(C1085v vVar);", "C0043i mo12153d();", "protected abstract long mo1602b(C2175k c2175k);", "public void calcularQuinA(){\n sueldoQuinAd = sueldoMensual /2;\n\n }", "static int m22556b(zzwt zzwt, cu cuVar) {\n zztw zztw = (zztw) zzwt;\n int d = zztw.mo4835d();\n if (d == -1) {\n d = cuVar.mo3068b(zztw);\n zztw.mo4833a(d);\n }\n return m22576g(d) + d;\n }", "double compute() {\r\ndouble b, e;\r\nb = (1 + rateOfRet/compPerYear);\r\ne = compPerYear * numYears;\r\nreturn principal * Math.pow(b, e);\r\n}", "public double computeMacroRecall(){\n\t\tdouble res = 0;\n\t\t//iterate all labels to compute their individual recall values\n\t\tfor(Label l : labels){\n\t\t\tres += this.computeRecall(l);\n\t\t}\n\n\t\t//take the average\n\t\tres = res/((double)labels.size());\n\t\treturn res;\n\n\t}", "float mo56157b();", "public double basis()\n\t{\n\t\treturn _lsPeriod.get (0).basis();\n\t}", "public void mul(final int factor) {\n for (int i = 0; i < coefficients.length; i++) {\n coefficients[i] = zpz.mul(coefficients[i],factor);\n }\n constant = zpz.mul(constant,factor);\n }", "abstract void mo4372a(zzwt zzwt, cu cuVar);", "private int[] productExceptSelfByMathAndConstantSpace(int[] nums){\n int len = nums.length;\n int[] ret = new int[len]; // not count as extra space\n\n // prefix\n ret[0] = 1;\n for(int i = 1; i < len; i++){\n ret[i] = ret[i - 1] * nums[i - 1];\n }\n\n // right to keep the suffix product of i, and ret[i](product) = ret[i](prefix) * right(suffix); and then update right.\n int right = 1; // keep right value of ret[i]\n for(int i = len - 1; i >= 0; i--){\n ret[i] = right * ret[i]; // prefix prdocut of i(ret[i] for current i) * suffix product of i(right, actaully is 'i + 1' for current i)\n right = right * nums[i]; // suffix product of i(actually suffix product of \"i+1\" when right is used.)\n }\n\n return ret;\n }", "public abstract float mo9744i();", "public Double getFactor();", "void adobe_coeff( CharPtr make, CharPtr model) {\n \n adobe_coeff( make.toString(), model.toString());\n}", "private double calculateZ(double rawScore, double y_micro,\n double y_sigma) {\n return (rawScore - y_micro) / y_sigma;\n }", "public void dorcsd2by1_(CHARACTER JOBU1,CHARACTER JOBU2,CHARACTER JOBV1T,INTEGER M,INTEGER P,INTEGER Q,double[] X11,INTEGER LDX11,double[] X21,INTEGER LDX21,double[] THETA,double[] U1,INTEGER LDU1,double[] U2,INTEGER LDU2,double[] V1T,INTEGER LDV1T,double[] WORK,INTEGER LWORK,int[] IWORK,INTEGER INFO);", "protected void initCoefficients() {\n\n\t\tString S = C + \": initCoefficients():\";\n\t\tif (D) {\n\t\t\tSystem.out.println(S + \"Starting\");\n\t\t}\n\n\t\t// Make the ShakeMap coefficients\n\t\tcoefficientsSM.clear();\n\t\t// Note that the coefficients in \"the APPENDIX\" that David Wald sent to me (Ned) on 8/27/07\n\t\t// assume that all logs in their equation are base-10 (in spite of their using \"ln\" for\n\t\t// two of the terms). Thus, thier B1, B2, and Sigma values need to be multiplied by 2.3025.\n\t\t// Also, since their units are gals their B1 needs to have ln(980) subtracted from it\n\t\t// (except for PGV).\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeffSM0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, 2.408, 2.408, 2.408, 1.3171, 0.000, -1.757, -0.473, 760, 6.0,\n\t\t\t\t0.660, 0.328, 0.737, 0.3948, 0.836);\n\t\t// Note: no sigma values were available for those below (Vince needs to recompute them)\n\t\t// (those above came from Vince via personal communication)\n\t\t// therefore, I multiplied those above by ratio of the sigmas given in the table in\n\t\t// \"the APPENDIX\" David sent to me (Ned). These are labeled as \"Sigma\" in their table\n\t\t// with no further explanation; using the ratios seems reasonable.\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeffSM2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.835318, 0.835318, 0.835318, 1.71773, 0.000, -1.827, -0.608, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.842 / 0.836) * 0.660, (0.842 / 0.836) * 0.328,\n\t\t\t\t(0.842 / 0.836) * 0.737, (0.842 / 0.836) * 0.3948,\n\t\t\t\t(0.842 / 0.836) * 0.836);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeffSM3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.82877, -1.82877, -1.82877, 2.20818, 0.000, -1.211, -0.974, 760,\n\t\t\t\t6.0,\n\t\t\t\t(0.988 / 0.836) * 0.660, (0.988 / 0.836) * 0.328,\n\t\t\t\t(0.988 / 0.836) * 0.737, (0.988 / 0.836) * 0.3948,\n\t\t\t\t(0.988 / 0.836) * 0.836);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeffSM4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -4.63102, -4.63102, -4.63102, 2.09305, 0.000, -0.848, -0.890, 760,\n\t\t\t\t6.0,\n\t\t\t\t(1.082 / 0.836) * 0.660, (1.082 / 0.836) * 0.328,\n\t\t\t\t(1.082 / 0.836) * 0.737, (1.082 / 0.836) * 0.3948,\n\t\t\t\t(1.082 / 0.836) * 0.836);\n\t\t// PGV - They actually give PGV coeffs so no scaling of 1-sec SA is needed.\n\t\tBJF_1997_AttenRelCoefficients coeffSM5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, 5.1186, 5.1186, 5.1186, 1.70391, 0.000, -1.386, -0.668, 760, 6.0,\n\t\t\t\t(0.753 / 0.836) * 0.660, (0.753 / 0.836) * 0.328,\n\t\t\t\t(0.753 / 0.836) * 0.737, (0.753 / 0.836) * 0.3948,\n\t\t\t\t(0.753 / 0.836) * 0.836);\n\n\t\t// add these to the list\n\t\tcoefficientsSM.put(coeffSM0.getName(), coeffSM0);\n\t\tcoefficientsSM.put(coeffSM1.getName(), coeffSM1);\n\t\tcoefficientsSM.put(coeffSM2.getName(), coeffSM2);\n\t\tcoefficientsSM.put(coeffSM3.getName(), coeffSM3);\n\t\tcoefficientsSM.put(coeffSM4.getName(), coeffSM4);\n\t\tcoefficientsSM.put(coeffSM5.getName(), coeffSM5);\n\n\t\t// Now make the original BJF 1997 coefficients\n\t\tcoefficientsBJF.clear();\n\t\t// PGA\n\t\tBJF_1997_AttenRelCoefficients coeff0 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGA_Param.NAME,\n\t\t\t\t-1, -0.313, -0.117, -0.242, 0.527, 0.000, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.00\n\t\tBJF_1997_AttenRelCoefficients coeff1 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tSA_Param.NAME + '/' + (new Double(\"0.00\")).doubleValue(),\n\t\t\t\t0.00, -0.313, -0.117, -0.242, 0.527, 0, -0.778, -0.371, 1396, 5.57,\n\t\t\t\t0.431, 0.226, 0.486, 0.184, 0.520);\n\t\t// SA/0.30\n\t\tBJF_1997_AttenRelCoefficients coeff2 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"0.30\")).doubleValue(),\n\t\t\t\t0.30, 0.598, 0.803, 0.7, 0.769, -0.161, -0.893, -0.401, 2133, 5.94,\n\t\t\t\t0.440, 0.276, 0.519, 0.048, 0.522);\n\t\t// SA/1.00\n\t\tBJF_1997_AttenRelCoefficients coeff3 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"1.00\")).doubleValue(),\n\t\t\t\t1.00, -1.133, -1.009, -1.08, 1.036, -0.032, -0.798, -0.698, 1406, 2.9,\n\t\t\t\t0.474, 0.325, 0.575, 0.214, 0.613);\n\t\t// SA/3.00 - actually these are BJF's 2-second values\n\t\tBJF_1997_AttenRelCoefficients coeff4 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\t\"SA/\" + (new Double(\"3.00\")).doubleValue(),\n\t\t\t\t3.00, -1.699, -1.801, -1.743, 1.085, -0.085, -0.812, -0.655, 1795, 5.85,\n\t\t\t\t0.495, 0.362, 0.613, 0.276, 0.672);\n\t\t// PGV - these are actually from 1-sec SA using the Newmark & Hall (1982). According to the ShakeMap docs this\n\t\t// scaling factor is PGV = (37.27*2.54)*SA1.0\n\t\t// The following formula is slightly more accurate (from Ken Campbell)\n\t\tdouble SA10toPGV = Math.log(981.0 / (2.0 * Math.PI * 1.65));\n\t\tBJF_1997_AttenRelCoefficients coeff5 = new BJF_1997_AttenRelCoefficients(\n\t\t\t\tPGV_Param.NAME,\n\t\t\t\t-1, -1.133 + SA10toPGV, -1.009 + SA10toPGV, -1.08 + SA10toPGV, 1.036,\n\t\t\t\t-0.032, -0.798, -0.698, 1406, 2.9, 0.474, 0.325, 0.575, 0.214, 0.613);\n\n\t\t// add these to the list\n\t\tcoefficientsBJF.put(coeff0.getName(), coeff0);\n\t\tcoefficientsBJF.put(coeff1.getName(), coeff1);\n\t\tcoefficientsBJF.put(coeff2.getName(), coeff2);\n\t\tcoefficientsBJF.put(coeff3.getName(), coeff3);\n\t\tcoefficientsBJF.put(coeff4.getName(), coeff4);\n\t\tcoefficientsBJF.put(coeff5.getName(), coeff5);\n\n\t}", "int catalanDP(int n) {\n int[] catalan = new int[n+1]; \n \n // Initialize first two values in table \n catalan[0] = catalan[1] = 1; \n\n // Fill entries in catalan[] using recursive formula \n for (int i=2; i<=n; i++) { \n catalan[i] = 0; \n for (int j=0; j<i; j++) \n catalan[i] += catalan[j] * catalan[i-j-1]; \n } \n \n // Return last entry \n return catalan[n]; \n }", "void mo130799a(double d);", "@Override\r\n\tpublic void computeConstant() {\n\t\t\r\n\t}", "C2368d mo1698a();", "static public double yard2m(double yard){\n\t\treturn yard*0.9144;\n\t}", "public double getUtility(double consumption);", "C4945r5 mo19056B();", "public void setMultiplicityFunction(Calculation multiplicityFunction) {\n this.multiplicityFunction = new Calculation(multiplicityFunction);\n }", "public static native void DualConjugate(long lpjFbxDualQuaternion);", "@Override\n public double apply$mcDJ$sp (long arg0)\n {\n return 0;\n }", "public void cal_FineFuelMoisture(){\r\n\tdouble DIF=dry-wet;\r\n\tfor (int i=1;i<=3; i++){\r\n\tif ((DIF-C[i])<=0){ \r\n\t\t\r\n\t\tFFM=B[i]*Math.exp(A[i]*DIF);\r\n\t}\r\n\t}\r\n}", "public abstract double calcular();", "int catalan(int n) { \n int res = 0; \n \n // Base case \n if (n <= 1) { \n return 1; \n } \n for (int i = 0; i < n; i++) { \n res += catalan(i) * catalan(n - i - 1); \n } \n return res; \n }", "C1529a mo17010b();", "private static double [][] exe_helper (double [] rf) throws Exception {\r\n\t\r\n\t\tint p1 = rf.length; // [nf,p1]=size(rf);\r\n\t\tint p0 = p1-1;\r\n\t\tdouble [] rr = null;\r\n\t\tdouble [] ar = null;\r\n\t\t\r\n\t\tif (p0!=0)\r\n\t\t{\r\n\t\t\tdouble [] a = new double [] {rf[1]}; //a = rf(:,2); // array eith a single elemtne, at the moment\r\n\r\n\t\t\t// rr=[ones(nf,1) -a zeros(nf,p0-1)];\r\n\t\t\trr = new double[p0+1];\r\n\t\t\tArrays.fill(rr, 0.0);\r\n\t\t\trr[0] = 1;\r\n\t\t\trr[1] = -a[0];\r\n\r\n\t\t\t// e = (a.^2-1);\r\n\t\t\tdouble e = a[0]*a[0]-1;\r\n\r\n\t\t\tfor (int n = 2; n<=p0; n++) // for n = 2:p0\r\n\t\t\t{\r\n\t\t\t\tdouble k = rf[n]; // k=rf(:,n+1); // It s a column vector\r\n\r\n\t\t\t\t// rr(:,n+1) =k.*e - sum(rr(:,n:-1:2).*a,2);\r\n\t\t\t\trr[n] = k*e - MyMath.sum(MyMath.arrayTimes(MyMath.select(rr, n-1, 1, -1), a));\r\n\r\n\t\t\t\t// a = [a+k(:,ones(1,n-1)).*a(:,n-1:-1:1) k];\r\n\t\t\t\tdouble [] aa = new double[a.length +1];\r\n\t\t\t\tfor (int i=0; i<a.length; i++)\r\n\t\t\t\t\taa[i] = a[i] + k*a[n-2-i];\r\n\t\t\t\taa[aa.length-1] = k;\r\n\t\t\t\ta = aa;\r\n\r\n\t\t\t\t// e = e.*(1-k.^2);\r\n\t\t\t\te *= (1-k*k);\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\t// ar = [ones(nf,1) a];\r\n\t\t\tar = new double [1+a.length];\r\n\t\t\tar[0] = 1;\r\n\t\t\tSystem.arraycopy(a, 0, ar, 1, a.length);\r\n\t\t\t\r\n\t\t\tdouble r0 = 1.0/MyMath.sum(MyMath.arrayTimes(rr, ar)); // r0=sum(rr.*ar,2).^(-1);\r\n\t\t\t\r\n\t\t\tMyMath.timesSelf(rr, r0); // rr=rr.*r0(:,ones(1,p1));\r\n\t\t\t\r\n\t\t\t// if nargin>1 && ~isempty(p)\r\n\t\t\t// if p<p0\r\n\t\t\t// rr(:,p+2:p1)=[];\r\n\t\t\t// else\r\n\t\t\t//\r\n\t\t\t// rr=[rr zeros(nf,p-p0)];\r\n\t\t\t// af=-ar(:,p1:-1:2);\r\n\t\t\t// for i=p0+1:p\r\n\t\t\t// rr(:,i+1)=sum(af.*rr(:,i-p0+1:i),2);\r\n\t\t\t// end\r\n\t\t\t// end\r\n\t\t\t// end\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\trr = new double [] {1.0}; // rr=ones(nf,1);\r\n\t\t\tar = new double [] {1.0}; // ar=rr;\r\n\t\t}\r\n\r\n\t\treturn new double [][] {rr, ar};\r\n\t}", "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}", "public int mo163c() {\n int size = this.f1963b.size();\n if (size < 1) {\n return 0;\n }\n int i = f1962a;\n return ((size / i) * (Lca.m828b(i) + 4)) + 4 + Lca.m828b(size % i);\n }", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tint n=s.nextInt();\r\n\t\tlong md=s.nextLong();\r\n\t\tlong mr=s.nextLong();\r\n\t\tString a=binGen(0,n);\r\n\t\tString MR;\r\n\t\tString MD;\r\n\t\tif(md<0) { MD=binGen(md,n); }\r\n\t\telse { MD=binGen(md,n);}\r\n\t\tif(mr<0) {MR=binGen(mr,n);}\r\n\t\telse { MR=binGen(mr,n);}\r\n\t\tSystem.out.println(\"MULTIPLICAND=\"+MD);System.out.println(\"MULTIPLIER=Q=\"+MR);\r\n\t\tString[] A=new String[n]; \r\n\t\tString[] Q=new String[n]; \r\n\t\tfor(int i=0;i<n-1;i++)\r\n\t\t{\r\n\t\t\tA[i]=a.substring(i,i+1);\r\n\t\t}\r\n\t\tA[n-1]=a.substring(n-1);\r\n\t\tfor(int i=0;i<n-1;i++)\r\n\t\t{\r\n\t\t\tQ[i]=MR.substring(i,i+1);\r\n\t\t}\r\n\t\tQ[n-1]=MR.substring(n-1);\r\n\t\tString[] C=new String[2*n+1];\r\n\t\tfor(int i=0;i<A.length;i++)\r\n \t{\r\n \t\tC[i]=A[i];\r\n \t}\r\n \tfor(int i=A.length;i<C.length-1;i++)\r\n \t{\r\n \t\tC[i]=Q[i-Q.length];\r\n \t}\r\n\t\tC[C.length-1]=\"0\";\r\n\t\tSystem.out.println(\"A\"+\" \"+\"Q\"+\" \"+\"Q0\");\r\n\t\t for(int i=0;i<Q.length;i++) {System.out.print(A[i]);} System.out.print(\" \");\r\n\t\t for(int i=0;i<Q.length;i++) {System.out.print(Q[i]);}System.out.print(\" \"); System.out.print(C[C.length-1]);System.out.println();\r\n\t\t \t\r\n\t\twhile(n!=0)\r\n\t\t{\r\n\t\t\tString str=C[C.length-2]+C[C.length-1];\r\n\t\t\tif(str.contentEquals(\"00\")|| str.contentEquals(\"11\"))\r\n\t\t\t\t{\r\n\t\t\t\t C=ASR(A,Q,C);\r\n\t\t\t\t for(int i=0;i<A.length;i++) {A[i]=C[i];}\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {Q[i]=C[i+A.length];}\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {System.out.print(A[i]);} System.out.print(\" \");\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {System.out.print(Q[i]);}System.out.print(\" \"); System.out.print(C[C.length-1]);System.out.println();\r\n\t\t\t\t \t}\r\n\t\t\telse if(str.contentEquals(\"01\"))\r\n\t\t\t{\r\n\t\t\t\tA=binAdd(A,MD);\r\n\t\t\t\tC=ASR(A,Q,C);\r\n\r\n\t\t\t\t for(int i=0;i<A.length;i++) {A[i]=C[i];}\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {Q[i]=C[i+A.length];}\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {System.out.print(A[i]);} System.out.print(\" \");\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {System.out.print(Q[i]);} System.out.print(\" \"); System.out.print(C[C.length-1]);System.out.println();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tA=binSub(A,MD);\r\n\t\t\t\tC=ASR(A,Q,C);\r\n\t\t\t\t\r\n\t\t\t\t for(int i=0;i<A.length;i++) {A[i]=C[i];}\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {Q[i]=C[i+A.length];}\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {System.out.print(A[i]);}\r\n\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t for(int i=0;i<Q.length;i++) {System.out.print(Q[i]);}System.out.print(\" \"); System.out.print(C[C.length-1]); System.out.println();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tn--;\r\n\t\t}\r\n\t\tString st1=\"\";\r\n\t\tString st2=\"\";\r\n\t\tfor(int i=0;i<A.length;i++) {st1=st1+A[i];st2=st2+Q[i];}\r\n\t\tSystem.out.println(\"FINAL ANSWER :-\");\r\n\t\tSystem.out.println(st1+st2);\r\n\t\tif((md<0 && mr<0)|| (md>=0 && mr>=0) ) {System.out.println(Long.parseLong(st1+st2,2));}\r\n\t\telse if((md<0 && mr>0)||(md>0&&mr<0)) {System.out.println(0-Long.parseLong((twocomp(st1+st2)),2));}\r\n\t\t\r\n\t}", "@Override\n\tpublic String getDesription() {\n\t\treturn \"structure based process similarity metric using Jaccard coefficient\";\n\t}", "public static native void Conjugate(long lpjFbxDualQuaternion);", "public BigDecimal getLBR_ICMSST_TaxBAmtUFDes();", "public void mo1812a(C0768c cVar) {\n int size = this.f1963b.size();\n if (size >= 1) {\n int i = f1962a;\n int i2 = size / i;\n int i3 = size % i;\n Jca[] jcaArr = new Jca[size];\n this.f1963b.toArray(jcaArr);\n for (int i4 = 0; i4 < i2; i4++) {\n int i5 = f1962a;\n cVar.mo4341a(new C0379RX(jcaArr, i4 * i5, i5));\n }\n if (i3 > 0) {\n cVar.mo4341a(new C0379RX(jcaArr, i2 * f1962a, i3));\n }\n }\n }", "public double calcular(){\n double calculo = 1;\n\n for(INodo descendiente : getDescendientes()) {\n calculo *= descendiente.calcular();\n }\n\n return calculo;\n }", "public long getMicros() {\r\n \treturn micros;\r\n }", "private double equation(long n) {\n\t\treturn (4d * montoCarlo(n) / n);\n\t}", "public abstract double mo9740e();", "public static Experiment lawson1162_E() { \n\n\t\tExperiment experiment = createLawsonExperiment( 1162, false );\n\t\t\n\t\tComplexMatrix pm = new ComplexMatrix(2);\n\t\t\n\t\tpm.set( 0, 0, 9.778932093636766E-6, +1.1539001755855298 );\n\t\tpm.set( 0, 1, 9.54090827267122E-6, -0.5761611044097982); //these minus signs are made up\n\t\tpm.set( 1, 0, -4.664462353536279E-6, -0.5776434681545166); //these minus signs are made up\n\t\tpm.set( 1, 1, -1.2050992588859665E-5,+1.153881700898593);\n\t\t\n\t\texperiment.setActual(pm);\n\t\t\n\t\treturn experiment;\n\t}", "@Test\n public void computeFactor_SummerTimeMonth() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-01-13 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-04-25 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-01-01 00:00:00\", \"2012-05-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.MONTH,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(4, factor, 0);\n }", "public float calculate_benefits() {\r\n\t\tfloat calculate = 0.0f;\r\n\t\tcalculate = this.getActivity() * this.getAntiquity() + 100;\r\n\t\treturn calculate;\r\n\t}", "public abstract C0707b mo9237au();", "public abstract double calcSA();", "public int mo9745j() {\n return mo9774x();\n }", "static int m22551b(int i, zzwt zzwt, cu cuVar) {\n return m22569e(i) + m22556b(zzwt, cuVar);\n }", "public AncientEgyptianMultiplication( ) {\r\n }", "public double[] coeff();", "public double magnetization(){\n double total = 0;\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < m; j++) {\n total+=lattice[i][j];\n }\n }\n \n return total;\n }", "QuoteCoefficient createQuoteCoefficient();", "public dd mo1967j() throws cf {\r\n this.f6478m.m10086a(this.f6479n);\r\n this.f6479n = (short) 0;\r\n return f6467d;\r\n }", "public int mo9785x() {\n /*\n r10 = this;\n long r0 = r10.f9091i\n long r2 = r10.f9090h\n int r2 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1))\n if (r2 != 0) goto L_0x000a\n goto L_0x0085\n L_0x000a:\n r2 = 1\n long r4 = r0 + r2\n byte r0 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r0)\n if (r0 < 0) goto L_0x0017\n r10.f9091i = r4\n return r0\n L_0x0017:\n long r6 = r10.f9090h\n long r6 = r6 - r4\n r8 = 9\n int r1 = (r6 > r8 ? 1 : (r6 == r8 ? 0 : -1))\n if (r1 >= 0) goto L_0x0021\n goto L_0x0085\n L_0x0021:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 7\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x002f\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x008b\n L_0x002f:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003e\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x003c:\n r6 = r4\n goto L_0x008b\n L_0x003e:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 21\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x004e\n r1 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r1\n goto L_0x008b\n L_0x004e:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r6 = r1 << 28\n r0 = r0 ^ r6\n r6 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r6\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n L_0x0085:\n long r0 = r10.mo9787z()\n int r0 = (int) r0\n return r0\n L_0x008b:\n r10.f9091i = r6\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3661d.mo9785x():int\");\n }", "public double mo1263c() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }", "C4945r5 mo19057F();", "public final float mo115217j() {\n return this.f119291j - this.f119300t;\n }", "public long mo9228aC() {\n return 0;\n }", "void updateVariableDiscount(int acc_no, Double discount_rate, String catalog_name);", "public int mo9741f() {\n return mo9785x();\n }", "C1529a mo17019b();", "void mo1506m();", "public BigDecimal getACC_CY() {\r\n return ACC_CY;\r\n }", "@Test\n\tpublic void test() {\n\t\tdouble delta = 0.00001;\n\t\tSnp fakeSnp1 = new Snp(\"fakeId1\", 0, 0.3);\n\t\tSnp fakeSnp2 = new Snp(\"fakeId2\", 0, 0.8);\n\t\tSnp fakeSnp3 = new Snp(\"fakeId3\", 0, 1.4);\n\t\tPascal.set.withZScore_=true;\n\t\tArrayList<Snp> geneSnps = new ArrayList<Snp>();\n\t\tgeneSnps.add(fakeSnp1);geneSnps.add(fakeSnp2);geneSnps.add(fakeSnp3);\n\t\tDenseMatrix ld= new DenseMatrix(3,3);\n\t\t//DenseMatrix crossLd= new DenseMatrix(3,2);\n\t\t\n\t\tArrayList<Double> snpScores = new ArrayList<Double>(3);\n\t\tsnpScores.add(fakeSnp1.getZscore());\n\t\tsnpScores.add(fakeSnp2.getZscore());\n\t\tsnpScores.add(fakeSnp3.getZscore());\n\t\t//ld and crossLd calculated as follows:\n\t\t// make 0.9-toeplitz mat of size 5.\n\t\t// 3,4,5 for ld-mat\n\t\t// 1,2 for crossLd-mat\n\t\tld.set(0,0,1);ld.set(1,1,1);ld.set(2,2,1);\n\t\tld.set(0,1,0.9);ld.set(1,2,0.9);\n\t\tld.set(1,0,0.9);ld.set(2,1,0.9);\n\t\tld.set(0,2,0.81);\n\t\tld.set(2,0,0.81);\n\t\tdouble[] weights = {2,2,2};\n\t\tAnalyticVegas myAnalyticObj= null;\n\t\t//UpperSymmDenseMatrix myMatToDecompose = null;\n\t\tdouble[] myEigenvals = null;\n\t\tdouble[] emptyWeights = {1,1,1};\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, emptyWeights);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\n\t\tassertEquals(myEigenvals[0],2.74067, delta);\n\t\tassertEquals(myEigenvals[1],0.1900, delta);\n\t\tassertEquals(myEigenvals[2],0.06932, delta);\n\t\t\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, weights);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\t\t\t\n\t\tassertEquals(myEigenvals[0], 5.481348, delta);\n\t\tassertEquals(myEigenvals[1],0.380000, delta);\n\t\tassertEquals(myEigenvals[2],0.138652, delta);\n\t\t\t\n\t\tdouble[] weights2 = {1,2,0.5};\n\t\t\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, weights2);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\t\t\n\t\tassertEquals(myEigenvals[0],3.27694674, delta);\n\t\tassertEquals(myEigenvals[1],0.1492338, delta);\n\t\tassertEquals(myEigenvals[2],0.07381938, delta);\t\t\t\n\t\t\n\t}", "public BigDecimal getLBR_ICMSST_TaxAmtUFDes();", "public float mo2187a(C0317d dVar) {\n return m1278j(dVar).mo2223b();\n }", "private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }", "static int determinant(int A[][], int n) \n { \n int D = 0; // Initialize result \n \n // Base case : if matrix contains single element \n if (n == 1) \n return A[0][0]; \n \n int [][]temp = new int[N][N]; // To store cofactors \n \n int sign = 1; // To store sign multiplier \n \n // Iterate for each element of first row \n for (int f = 0; f < n; f++) \n { \n // Getting Cofactor of A[0][f] \n getCofactor(A, temp, 0, f, n); \n D += sign * A[0][f] * determinant(temp, n - 1); \n \n // terms are to be added with alternate sign \n sign = -sign; \n } \n \n return D; \n }", "UnsignedLong cost(EigrpMetricVersion version);", "long mo1154d();", "private String AccelYConversion() {\n int reading = (((raw[17] & 0xFC) >> 2) + ((raw[18] & 0x0F) << 6));\n\n\n int y[] = fixBinaryString(Integer.toBinaryString(reading));\n return myUnsignedToSigned(y) + \"\";\n\n //System.out.println(\"Y \" + unsignedToSigned(reading ,10) * 0.1533);\n //return (reading * 0.1533) + \"\";\n }", "public int mo9745j() {\n return mo9761x();\n }" ]
[ "0.5360259", "0.5023242", "0.500104", "0.49573663", "0.4949933", "0.49432126", "0.48971167", "0.48811853", "0.4871537", "0.48403797", "0.47445926", "0.4738086", "0.47335047", "0.47316965", "0.4728945", "0.47152084", "0.4708405", "0.470762", "0.4705067", "0.47036296", "0.46952552", "0.4691094", "0.46797597", "0.46789137", "0.46760753", "0.46760547", "0.46654168", "0.46553543", "0.46362674", "0.4635003", "0.4629118", "0.46213663", "0.4618126", "0.46011248", "0.45976925", "0.4595464", "0.45927745", "0.458969", "0.4584287", "0.45752662", "0.45721287", "0.45720157", "0.45688877", "0.45684364", "0.45546564", "0.45536223", "0.45434088", "0.4542093", "0.45401022", "0.45287085", "0.4525568", "0.4523911", "0.45223737", "0.452201", "0.4517626", "0.45169362", "0.45134652", "0.4512206", "0.45118108", "0.45084006", "0.4505207", "0.45050785", "0.45039174", "0.4503705", "0.4489915", "0.4480519", "0.4478211", "0.4472555", "0.44691747", "0.4468405", "0.44670334", "0.44605678", "0.44592634", "0.44588697", "0.4457887", "0.44563058", "0.44542143", "0.4453289", "0.44527718", "0.44514525", "0.4451356", "0.4451311", "0.44453695", "0.44441324", "0.44376278", "0.44327456", "0.4432733", "0.44284123", "0.4428211", "0.44280934", "0.44267476", "0.4422727", "0.44211015", "0.44205695", "0.44198266", "0.4418533", "0.44113532", "0.44096252", "0.43972245", "0.43948552" ]
0.5110159
1
Takes a String s in camel class and splits it by injecting a space Taken from polygenelubricants answer on
public static String splitCamelCase(String s) { return s.replaceAll( String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])", "(?<=[A-Za-z])(?=[^A-Za-z])" ), " " ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String splitCamelCase(String s) {\n return s.replaceAll(\n String.format(\"%s|%s|%s\",\n \"(?<=[A-Z])(?=[A-Z][a-z])\",\n \"(?<=[^A-Z])(?=[A-Z])\",\n \"(?<=[A-Za-z])(?=[^A-Za-z])\"),\n \" \").replaceAll(\"[-_]\", \"\").replaceAll(\" \", \" \");\n }", "private String getSplitNames(String className){\n String nameSplited = \"\";\n\n for (String character : className.split(\"(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])\")){\n nameSplited = nameSplited + character + \" \";\n }\n\n return nameSplited;\n }", "public abstract void split(Space s);", "private String firstSentenceSplitting(String s) {\n // Double new-line means a new sentence:\n s = paragraph.matcher(s).replaceAll(\"$1\" + EOS);\n // Punctuation followed by whitespace means a new sentence:\n s = punctWhitespace.matcher(s).replaceAll(\"$1\" + EOS);\n // New (compared to the perl module): Punctuation followed by uppercase followed\n // by non-uppercase character (except dot) means a new sentence:\n s = punctUpperLower.matcher(s).replaceAll(\"$1\" + EOS + \"$2\");\n // Break also when single letter comes before punctuation:\n s = letterPunct.matcher(s).replaceAll(\"$1\" + EOS);\n return s;\n }", "public static String splitCamelCase(String s, String replacement) {\n return s.replaceAll(\n String.format(\"%s|%s|%s\",\n \"(?<=[A-Z])(?=[A-Z][a-z])\",\n \"(?<=[^A-Z])(?=[A-Z])\",\n \"(?<=[A-Za-z])(?=[^A-Za-z])\"\n ), replacement\n );\n }", "public static String[] split(String s)\n\t{\n\t\tArrayList <String> words = new ArrayList<> ();\n\t\t\n\t\tStringBuilder word = new StringBuilder();\n\t\tfor(int i=0; i < s.length(); i++ )\n\t\t{\n\t\t\tif(s.charAt(i) == ' ')\n\t\t\t{\n\t\t\t\twords.add(word.toString());\n\t\t\t\tword = new StringBuilder();\n\t\t\t}\n\t\t\telse\n\t\t\t\tword.append(s.charAt(i));\n\t\t}\n\t\twords.add(word.toString());\n\t\treturn words.toArray(new String[words.size()]);\n\t}", "@Test(testName = \"splitFunctioanlity\")\n\t public static void splitFunction() \n\t { \n\t String str = \"geekss@for@geekss\"; \n\t String[] arrOfStr = str.split(\"s\", 5); \n\t \n\t for (String a : arrOfStr) \n\t System.out.println(a); \n\t \t}", "public static String [] splitwords(String s) {\n return splitwords(s, WHITESPACE);\n }", "public static String [] splitwords(String s, String whiteSpace) {\n return splitwords(s, whiteSpace, CITCHAR);\n }", "static ArrayList<String> split_words(String s){\n ArrayList<String> words = new ArrayList<>();\n\n Pattern p = Pattern.compile(\"\\\\w+\");\n Matcher match = p.matcher(s);\n while (match.find()) {\n words.add(match.group());\n }\n return words;\n }", "public static String[] splitIntoWords(String s) {\n String[] words = s.split(\" \");\n return words;\n }", "private static String[] seperateStr(String str)\r\n\t{\r\n\t\tboolean doubleSpace = false;\r\n\t\tint wordCount = 0;\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tif (str == null || str.length() == 0)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tfor (int j = 0; j < str.length(); j++)\r\n\t\t{\r\n\t\t\tif (str.charAt(j) == ' ')\r\n\t\t\t{\r\n\t\t\t\tif (!doubleSpace)\r\n\t\t\t\t\twordCount++;\r\n\r\n\t\t\t\tdoubleSpace = true;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tdoubleSpace = false;\r\n\t\t}\r\n\t\tString st[] = new String[wordCount + 1];\r\n\t\tint i = 0;\r\n\r\n\t\tdoubleSpace = false;\r\n\t\tString ch = \"\";\r\n\t\tfor (int j = 0; j < str.length(); j++)\r\n\t\t{\r\n\t\t\tif (str.charAt(j) == ' ')\r\n\t\t\t{\r\n\t\t\t\tif (!doubleSpace)\r\n\t\t\t\t{\r\n\t\t\t\t\tst[i] = sb.toString();\r\n\t\t\t\t\tsb.delete(0, sb.length());\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\tdoubleSpace = true;\r\n\t\t\t\tcontinue;\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tsb.append(str.charAt(j));\r\n\t\t\t}\r\n\t\t\tdoubleSpace = false;\r\n\t\t}\r\n\r\n\t\tst[i] = sb.toString();\r\n\t\t;\r\n\t\treturn st;\r\n\t}", "static void separarString(String s){\n\t\tString[] palabras = s.split(\"[ ]\");\n\t\tfor(int i = 0; i < palabras.length; i++){\n\t\t\tpalabras[i] = limpia(palabras[i]);\n\t\t\tSystem.out.println(palabras[i]);\n\t\t}\n\t}", "@Override\n public String split(String source) {\n String result = (hasEnd()) ? source.substring(getStart(), getEnd()) : source.substring(getStart());\n result = (trimmed) ? result.trim() : result;\n return wordCase.apply(result);\n }", "public static void main(String[] args) {\n String textString = \"Hello, world! I am program.\";\n\n\n// System.out.println(Arrays.toString(\"a;b;c;d\".split(\"(?=;)\")));\n// String[] split = \"a;b;c;d\".split(\"(?=\\\\p{Punct}\\s?)|\\s\");\n /*String[] split = \"a;b;c;d\".split(\"(?=\\\\p{Punct}\\s?)\");\n System.out.println(Arrays.toString(split));*/\n// String[] split1 = \"Hello, world!\".split(\"(?=\\\\p{Punct}\\s?)|\\s\");\n /*String[] split1 = \"Hello, world!\".split(\"(?=(\\\\p{Punct}\\s?))\");\n System.out.println(Arrays.toString(split1));*/\n// System.out.println(Arrays.toString(\"a;b;c;d\".split(\"((?<=;)|(?=;))\")));\n\n// String[] sentenceElementStrings = sentenceString.split(\"(?=\\\\p{Punct}\\s?)|\\s\");\n// System.out.println(\"Hello world! \\\\I am program.\");\n Text text = new Text(textString);\n\n System.out.println(\"Original text:\\n\" + text);\n\n text.swapFirstAndLastWordsInSentences();\n\n System.out.println(\"Text after swapping:\\n\" + text);\n }", "public static String[] splitWordString(String word) {\r\n\t\tString[] letters = word.split(\"[^a-z^A-Z]\");\r\n\t\treturn letters;\r\n\t}", "public String[] splitBySplitter(String s) {\r\n\t\tString[] returnArray = new String[4];\r\n\t\treturnArray = s.split(\"-\");\r\n\t\treturn returnArray;\r\n\t}", "public static String camelCaseToDelimited(CharSequence s, char delimiter) {\n StringBuilder sb = new StringBuilder();\n int max = s.length();\n char prev = 0;\n for (int i = 0; i < max; i++) {\n char c = s.charAt(i);\n if (Character.isUpperCase(c) && !Character.isUpperCase(prev)) {\n if (sb.length() > 0 && sb.charAt(sb.length() - 1) != delimiter) {\n sb.append(delimiter);\n }\n }\n sb.append(Character.toLowerCase(c));\n prev = c;\n }\n return sb.toString();\n }", "public void splitString() {\n\t\t\tString sentence = \"I am studying\";\n\t\t\tString[] strings = sentence.split(\" \");\n\t\t\tSystem.out.println(\"Length is \" + strings.length);\n\n\n\t\t\tfor (int index = 0; index < strings.length; index++)\n\t\t\t\tSystem.out.println(strings[index]);\n\t\t}", "String[] splitSentenceWords() {\n\t\t\tint i=0;\n\t\t\tint j=0;\n\t\t\tArrayList<String> words = new ArrayList<String>();\n\t\t\t\n\t\t\t\tString[] allWords = wordPattern.split(purePattern.matcher(sentence).replaceAll(\" \"));//.split(\"(?=\\\\p{Lu})|(\\\\_|\\\\,|\\\\.|\\\\s|\\\\n|\\\\#|\\\\\\\"|\\\\{|\\\\}|\\\\@|\\\\(|\\\\)|\\\\;|\\\\-|\\\\:|\\\\*|\\\\\\\\|\\\\/)+\");\n\t\t\tfor(String word : allWords) {\n\t\t\t\tif(word.length()>2) {\n\t\t\t\t\twords.add(word.toLowerCase());\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\treturn (String[])words.toArray(new String[words.size()]);\n\t\t\n\t\t}", "public void stringToAl(String s){\n\t\tfor(int i=0, j=0; i<s.length(); i++){\n\t\t\tif(s.charAt(i) == ' ' || i == s.length()-1){\n\t\t\t\tString temp;\n\t\t\t\tif(i == s.length() - 1){\n\t\t\t\t\ttemp =s.substring(j,i+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp =s.substring(j,i);\n\t\t\t\t}\n\t\t\t\t//System.out.println(temp);\n\t\t\t\twords.add(temp);\n\t\t\t\tj = i + 1;\n\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString str= \"I liked Java, did you like it\";\n\t\t\n\t\tString arr[]=str.split(\"d\");\n\t\t\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\nString str1[]=str.split(\" \");\n\t\t\n\t\tSystem.out.println(Arrays.toString(str1));\n\t\t\n\t\t\n\t}", "public static String[] breakInput(String input){\n\t\t//Split the thing up on spaces,\n\t\tString[] inputSplit = (input.split(\"\\\\s\"));\n\t\treturn inputSplit;\n\t}", "static Stream<String> splitIntoWords(String str) \r\n\t{\r\n\t\treturn Arrays.stream(str.split(\"\\\\W+\")).filter(s -> s.length() > 0);\r\n\t}", "private String[] splitLetters(String word) {\n String[] temp = new String[word.length()];\n for (int i = 0; i < word.length(); i++) {\n temp[i] = Character.toString(word.charAt(i)).toUpperCase();\n }\n return temp;\n }", "private static String formattingWhitespace(String string) {\n // Splitting the String.\n String[] stringSplits = string.split(\" \");\n\n StringBuilder formattedString = new StringBuilder();\n for (int word = 0; word < stringSplits.length; word++) {\n // If the element is not an empty String.\n if (!stringSplits[word].isEmpty()) {\n // Checking if the word is not the last word of the sentence.\n if (word < stringSplits.length - 1) {\n // Adding a space after the word.\n formattedString.append(stringSplits[word]).append(\" \");\n }\n // If last word of the sentence.\n else {\n // Last word does not have a space after it.\n formattedString.append(stringSplits[word]);\n }\n }\n }\n // Returning a formatted String.\n return formattedString.toString();\n }", "public static String separateAndCapitalizeWords(String aInString, String aInSeparator) {\n String[] lChars = aInString.split(\"\");\n StringBuilder lStringBuilder = new StringBuilder();\n for (String lChar : lChars) {\n if (lChar.toUpperCase().equals(lChar))\n lStringBuilder.append(aInSeparator).append(lChar);\n else\n lStringBuilder.append(lChar);\n }\n return lStringBuilder.toString().toUpperCase();\n }", "String nombreDeClase(String s) {\n return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();\n }", "public static String camelCaseToDashes(CharSequence s) {\n return camelCaseToDelimited(s, '-');\n }", "static String[] splitIntoAlphasAndNums( String s )\n\t{\n\t\tif ( \"\".equals( s ) )\n\t\t{\n\t\t\treturn new String[]{\"\"};\n\t\t}\n\t\ts = s.toLowerCase( Locale.ENGLISH );\n\n\t\tList<String> splits = new ArrayList<String>();\n\t\tString tok = \"\";\n\n\t\tchar c = s.charAt( 0 );\n\t\tboolean isDigit = isDigit( c );\n\t\tboolean isSpecial = isSpecial( c );\n\t\tboolean isAlpha = !isDigit && !isSpecial;\n\t\tint prevMode = isAlpha ? 0 : isDigit ? 1 : -1;\n\n\t\tfor ( int i = 0; i < s.length(); i++ )\n\t\t{\n\t\t\tc = s.charAt( i );\n\t\t\tisDigit = isDigit( c );\n\t\t\tisSpecial = isSpecial( c );\n\t\t\tisAlpha = !isDigit && !isSpecial;\n\t\t\tint mode = isAlpha ? 0 : isDigit ? 1 : -1;\n\t\t\tif ( mode != prevMode )\n\t\t\t{\n\t\t\t\tif ( !\"\".equals( tok ) )\n\t\t\t\t{\n\t\t\t\t\tsplits.add( tok );\n\t\t\t\t\ttok = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// alpha=0, digit=1. Don't append for specials.\n\t\t\tif ( mode >= 0 )\n\t\t\t{\n\t\t\t\t// Special case for minus sign.\n\t\t\t\tif ( i == 1 && isDigit && '-' == s.charAt( 0 ) )\n\t\t\t\t{\n\t\t\t\t\ttok = \"-\";\n\t\t\t\t}\n\t\t\t\ttok += c;\n\t\t\t}\n\t\t\tprevMode = mode;\n\t\t}\n\t\tif ( !\"\".equals( tok ) )\n\t\t{\n\t\t\tsplits.add( tok );\n\t\t}\n\t\tsplits.add( \"\" ); // very important: append empty-string to all returned splits.\n\t\treturn splits.toArray( new String[ splits.size() ] );\n\t}", "private final static String stripDash( String s ) {\n\n StringTokenizer tokDash = new StringTokenizer(s, \"-\");\n\n if (tokDash.countTokens() > 1) {\n return tokDash.nextToken();\n } else {\n return s;\n }\n\n }", "public static String process(String input) {\n StringTokenizer st = new StringTokenizer(input, DELIM);\n StringBuilder result = new StringBuilder();\n String space = \" \";\n\n while (st.hasMoreTokens()) {\n String tok = st.nextToken();\n Pattern p = Pattern.compile(SPLIT_REGEX);\n Matcher m = p.matcher(tok);\n boolean found = m.find();\n while (found) {\n String subStringFound = m.group();\n if (1 < subStringFound.length()) {\n result.append(subStringFound + space);\n }\n found = m.find();\n }\n }\n return result.toString();\n }", "private static String toStartCase(String words) {\n String[] tokens = words.split(\"\\\\s+\");\n StringBuilder builder = new StringBuilder();\n for (String token : tokens) {\n builder.append(capitaliseSingleWord(token)).append(\" \");\n }\n return builder.toString().stripTrailing();\n }", "public static ArrayList<String> words(String s){\n\t\ts = s.toLowerCase().replaceAll(\"[^a-zA-Z ]\", \"\");\n\t\tArrayList<String> arrayList = new ArrayList<String>();\n\t\tString currWord = \"\";\n\n\t\tfor(int i = 0; i < s.length(); i ++){\n\t\t\tchar c = s.charAt(i);\n\t\t\tif (Character.isLetter(c) == false){\n\t\t\t\tarrayList.add(currWord);\n\t\t\t\tcurrWord = \"\";\n\t\t\t}else{\n\t\t\t\tcurrWord = currWord + c;\n\t\t\t}\n\t\t}\n\t\tarrayList = removeSpaces(arrayList);\n\t\treturn arrayList;\n\t}", "public static String split(String sentence) {\n StringBuilder result = new StringBuilder();\n int i = 0; // use for create lines <= 4 words\n for (String word : sentence.split(\" \")) {\n result.append(word).append(\" \");\n ++i;\n if (i == 4) {\n result.append(\"\\n\");\n i = 0;\n }\n }\n return result.toString();\n }", "public static String[] split(String s, char token) {\n\t\tint tokenCount = 0;\n\t\tfor(int i=0;i<s.length();i++) {\n\t\t\tif(s.charAt(i) == token) {\n\t\t\t\ttokenCount++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tString[] splits = new String[tokenCount+1];\n\t\t\n\t\tString temp = \"\";\n\t\tint tokenItr = 0;\n\t\tfor(int i=0;i<s.length();i++) {\n\t\t\tif(s.charAt(i) == token) {\n\t\t\t\tsplits[tokenItr] = temp;\n\t\t\t\ttokenItr++;\n\t\t\t\ttemp = \"\";\n\t\t\t} else {\n\t\t\t\ttemp+=s.charAt(i);\n\t\t\t}\n\t\t}\n\t\tsplits[tokenItr] = temp; //For the left over strings in s\n\t\t\n\t\treturn splits;\n\t}", "public static String capitalizeWordsFirstLetter(String aInString, String aInSeparator) {\n String[] lWords = aInString.split(aInSeparator);\n StringBuilder lStringBuilder = new StringBuilder();\n int lWordsCount = 0;\n for (String lWord : lWords) {\n if (++lWordsCount == 1) {\n lStringBuilder.append(lWord.toLowerCase());\n } else {\n if (lWord.length() > 0)\n lStringBuilder.append(lWord.substring(0, 1).toUpperCase()).append(lWord.substring(1).toLowerCase());\n }\n }\n return lStringBuilder.toString();\n }", "public static String[] split(String toSplit, char spliter){\n String[] endStringArray = new String[4];\n StringBuilder st = new StringBuilder();\n int i = 0;\n for (int j = 0; j < toSplit.length(); j++){\n if (toSplit.charAt(j) != spliter){\n st.append(toSplit.charAt(j));\n }\n else{\n endStringArray[i] = st.toString();\n st = new StringBuilder();\n i++;\n }\n }\n endStringArray[i] = st.toString();\n int size = 0;\n for (String s : endStringArray){\n if (s != null)\n size++;\n }\n String[] reducedArray = new String[size];\n System.arraycopy(endStringArray, 0, reducedArray, 0, size);\n return reducedArray;\n }", "public List<String> sentenceSplit(String input)\n {\n return InputNormalizer.sentenceSplit(this.sentenceSplitters, input);\n }", "public static String formatSpaces(String s) {\n \tString temp = s;\n \tif(s.contains(\"underscores\")) temp = s.replace(\" \", \"_\");\n return temp;\n }", "public static String initCap(final String value) {\n if (value == null) {\n return null;\n }\n\n StringBuilder sb = new StringBuilder();\n String[] tokens = value.split(\"\\s\");\n\n for (String token : tokens) {\n if (token.length() == 1) {\n sb.append(token.toUpperCase());\n\n } else if (token.length() > 1) {\n sb.append(token.substring(0,1).toUpperCase() + token.substring(1).toLowerCase());\n sb.append(\" \");\n }\n }\n\n return sb.toString().trim();\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n String s = scan.nextLine();\n // System.out.println(s);\n s = s.replace(\"!\", \" \");\n s = s.replace(\".\", \" \");\n s = s.replace(\"'\", \" \");\n s = s.replace(\"_\", \" \");\n s = s.replace(\"@\", \" \");\n s = s.replace(\"?\", \" \");\n s = s.replace(\",\", \" \");\n s = s.replace(\" \", \" \");\n s = s.replace(\" \", \" \");\n while(s.contains(\" \")) {\n \ts = s.replace(\" \", \" \");\n }\n \n \n while(s.charAt(0)==' '&&s.length()>1) {\n \tif(s.charAt(0)!=' ') {\n \t//\tSystem.out.println(s.length() +\"s \"+s);\n \t\tbreak;\n \t}else {\n \t\t//System.out.println(s.length() +\"s (\"+s+\")\");\n \t\ts = s.trim();\n \t}\n }\n \n if(!s.equals(\" \")) {\n s = s.trim();\n String [] allToken = s.split(\" \");\n System.out.println(allToken.length);\n for(int y=0;y<allToken.length;y++) {\n System.out.println(allToken[y]);\t\n }\n // System.out.println(allToken.length);\n }else {\n \t System.out.println(0);\n }\n scan.close();\n }", "public static List<String> splitSpaces(String text) {\n\t\treturn splitChar(text, ' ');\n\t}", "public static String[] strParts(String string) {\r\n //StringTokenizer st = new StringTokenizer(string);\r\n String[] strings = string.split(\"\\\\s+\");\r\n return removeSpaces(strings);\r\n }", "public static List<String> getCamelCaseWords(String content) {\n List<String> camelCaseList = new ArrayList<>();\n// for (String word : content.split(\" \")) {\n// if(word.matches(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\")){\n// camelCaseList.add(word);\n// }\n// }\n Pattern regex = Pattern.compile(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\");\n Matcher regexMatcher = regex.matcher(content);\n while (regexMatcher.find()) {\n camelCaseList.add(regexMatcher.group());\n }\n return camelCaseList;\n }", "public static String[] splitWords(String str){\r\n\t\tArrayList<String> wordsList= new ArrayList<String>();\r\n\t\t\r\n\t\tfor(String s:str.split(\" \")){\r\n\t\t\tif(!s.isEmpty()) wordsList.add(s);\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn wordsList.toArray(new String[wordsList.size()]);\r\n\t}", "private String getSplitCapitalPeriodSent(String text) {\n\t\t\r\n\t\tString testString = text;\r\n\t\t\r\n\t\t/*\r\n\t\ttestString = testString.replaceAll(\"\\\\·\", \".\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t// https://d5gate.ag5.mpi-sb.mpg.de/ClausIEGate/ClausIEGate?inputtext=Optimal+temperature+and+pH+for+growth+are+25%E2%80%9330+%CB%9AC+and+pH+7%2C+respectively.&processCcAllVerbs=true&processCcNonVerbs=true&type=true&go=Extract\r\n\t\ttestString = testString.replaceAll(\"\\\\s?\\\\·\\\\s?\", \".\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t\r\n\t\ttestString = testString.replaceAll(\"–\", \"-\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t// https://d5gate.ag5.mpi-sb.mpg.de/ClausIEGate/ClausIEGate?inputtext=Optimal+temperature+and+pH+for+growth+are+25%E2%80%9330+%CB%9AC+and+pH+7%2C+respectively.&processCcAllVerbs=true&processCcNonVerbs=true&type=true&go=Extract\r\n\t\ttestString = testString.replaceAll(\"\\\\s?-\\\\s?\", \"-\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t*/\r\n\t\t\r\n\t\t// System.out.println(\"testString::Before::\" + testString);\r\n\t\t\r\n\t\tString targetPatternString = \"(\\\\s[A-Z]\\\\.\\\\s)\";\r\n\t\tPattern pattern = Pattern.compile(targetPatternString);\r\n\t\tMatcher matcher = pattern.matcher(testString);\r\n\t\t\r\n\t\twhile (matcher.find()) {\r\n\t\t\t// System.out.println(\"Whloe Sent::\" + matcher.group());\r\n\t\t\t// System.out.println(\"Part 1::\" + matcher.group(1));\r\n\t\t\t// System.out.println(\"Part 2::\" + matcher.group(2));\r\n\t\t\t// System.out.println(\"Part 3::\" + matcher.group(3));\r\n\t\t\t\r\n\t\t\tString matchString = matcher.group(1);\r\n\t\t\t\r\n\t\t\tString newMatchString = \"\";\r\n\t\t\tfor ( int j = 0; j < matchString.length(); j++ ) {\r\n\t\t\t\tnewMatchString += matchString.substring(j, j+1) + \" \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"getSplitCapitalPeriodSent::OriginalSent::\" + text);\r\n\t\t\tSystem.out.println(\"matchString:: \" + matchString);\r\n\t\t\tSystem.out.println(\"newMatchString:: \" + newMatchString);\r\n\t\t\t\r\n\t\t\tlog(LogLevel.INFO, \"getSplitCapitalPeriodSent::OriginalSent::\" + text);\r\n\t\t\tlog(LogLevel.INFO, \"matchString:: \" + matchString);\r\n\t\t\tlog(LogLevel.INFO, \"newMatchString:: \" + newMatchString);\r\n\t\t\t\r\n\t\t\ttestString = testString.replaceAll(matcher.group(1), newMatchString);\r\n\t\t\t\r\n\t\t\t// String matchResult = matcher.group(1);\r\n\t\t\t// System.out.println(\"matchResult::\" + matchResult);\r\n\t\t}\r\n\t\t\r\n\t\t// System.out.println(\"testString::After::\" + testString);\r\n\t\t\r\n\t\treturn testString;\r\n\t\t\r\n\t}", "public String[] convertSentToArrayOfWords(String s){\n\t\tString [] arr = s.split(\" \");\n\n\t\treturn arr;\n\t}", "public static void main(String args[])\n {\n String s = \"Bharat mata ki jai\";\n char[] c = s.toCharArray();\n\n for(int i =0; i<c.length;i++)\n {\n if(c[i]!=' ' && (i == 0 || c[i-1]==' '))\n {\n System.out.print(c[i]+\" \");\n }\n }\n\n\n\n\n }", "public static String formatString(String str){\n String[] arr = str.split(\" \");\n String resultant = \"\";\n for(int i = 0; i < arr.length;i++){\n if(arr[i].length() == 1)\n arr[i] = arr[i].toUpperCase();\n else if(arr[i].length() == 0)\n continue;\n else{\n arr[i] = Character.toUpperCase(arr[i].charAt(0)) + arr[i].substring(1);\n }\n }\n for(String s : arr)\n resultant += s + \" \";\n return resultant.trim();\n }", "private String[] split(String string){\n\t\tString[] split = string.split( \" \" );\n\t\t\n\t\tfor(int i = 0; i < split.length; i++){\n\t\t\tString index = split[i];\n\t\t\tindex = index.trim();\n\t\t}\n\t\t\n\t\treturn split;\n\t}", "public static String[] wordSeparator(String input) {\n return partition(input, ' ');\n }", "public static void main(String[] args) {\n String myRegExString = \"[a-zA-Z\\\\s]+\";\n\n // This is the string we will check to see if our regex matches:\n String myString = \"The quick brown fox jumped over the lazy dog...\";\n\n // Create a Pattern object (compiled RegEx) and save it as 'p'\n Pattern p = Pattern.compile(myRegExString);\n\n // We need a Matcher to match our compiled RegEx to a String\n Matcher m = p.matcher(myString);\n\n // if our Matcher finds a match\n if (m.find()) {\n // Print the match\n System.out.println(m.group());\n }\n\n String s = \"Hello, Goodbye, Farewell\";\n Pattern p1 = Pattern.compile(\"\\\\p{Alpha}+\");\n Matcher m1 = p1.matcher(s);\n\n while( m.find() ){\n System.out.println(m1.group());\n }\n\n String s1 = \"Hello, Goodbye, Farewell\";\n String s2 = \"Hola, Adios, Hasta Luego\";\n\n String myDelimiter = \", \";\n\n String[] s1array = s1.split(myDelimiter);\n String[] s2array = s2.split(myDelimiter);\n\n System.out.println(\"s1array[0]: \" + s1array[0]);\n System.out.println(\"s1array[1]: \" + s1array[1]);\n System.out.println(\"s1array[2]: \" + s1array[2]);\n System.out.println(\"s2array[0]: \" + s2array[0]);\n System.out.println(\"s2array[1]: \" + s2array[1]);\n System.out.println(\"s2array[2]: \" + s2array[2]);\n\n }", "public static String camel(String s) {\n if (s == null) {\n return null;\n }\n final var result = new char[s.length()];\n int dst = 0;\n var capIt = true;\n for (int src = 0; src < s.length(); src++) {\n if (s.charAt(src) == '_') {\n capIt = true;\n } else {\n if (capIt) {\n capIt = false;\n result[dst++] = Character.toUpperCase(s.charAt(src));\n } else {\n result[dst++] = Character.toLowerCase(s.charAt(src));\n }\n }\n }\n return new String(result, 0, dst);\n }", "public String sortTheCharInString(String s){\n\n\t\treturn Stream.of(s.split(\"\"))\n\t\t\t\t.sorted()\n\t\t\t\t.collect(Collectors.joining());\n\t}", "public static String [] splitwords(String s, \n\t\t\t\t String whiteSpace,\n\t\t\t\t char citChar) {\n boolean bCit = false; // true when inside citation chars.\n Vector v = new Vector(); // (String) individual words after splitting\n StringBuffer buf = new StringBuffer(); \n int i = 0; \n \n while(i < s.length()) {\n char c = s.charAt(i);\n\n if(bCit || whiteSpace.indexOf(c) == -1) {\n\t// Build up word until we breaks on either a citation char or whitespace\n\tif(c == citChar) {\n\t bCit = !bCit;\n\t} else {\n\t if(buf == null) {\n\t buf = new StringBuffer();\n\t }\n\t buf.append(c);\n\t}\n\ti++;\n } else {\t\n\t// found whitespace or end of citation, append word if we have one\n\tif(buf != null) {\n\t v.addElement(buf.toString());\n\t buf = null;\n\t}\n\n\t// and skip whitespace so we start clean on a word or citation char\n\twhile((i < s.length()) && (-1 != whiteSpace.indexOf(s.charAt(i)))) {\n\t i++;\n\t}\n }\n }\n\n // Add possible remaining word\n if(buf != null) {\n v.addElement(buf.toString());\n }\n \n // Copy back into an array\n String [] r = new String[v.size()];\n v.copyInto(r);\n \n return r;\n }", "@Test\n void labTask() {\n String s = \"abczefoh\";\n List<String> result = StringSplitter.labTask(s);\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(2, second.length());\n assertEquals('o', second.charAt(0));\n assertFalse(\"oh\".contains(String.valueOf(second.charAt(1))));\n\n String third = result.get(2);\n assertEquals(3, third.length());\n assertEquals('z', third.charAt(0));\n assertFalse(\"zef\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', third.charAt(2));\n }", "public ArrayList<Card> stringToCards(String s) {\n ArrayList<Card> cards = new ArrayList<>();\n String[] splitS = s.split(\" \");\n for(int x = 0; x < splitS.length; x++) {\n cards.add(new Card(splitS[x].substring(0, 1), splitS[x].substring(1)));\n }\n return cards;\n }", "public List<String> splitWordList(final String text) {\n\t\tList<String> result = new ArrayList<>();\n\t\tif (text == null)\n\t\t\treturn result;\n\n\t\tString t = text + \"⁋\";\n\t\tt = t.replace('\\n', '⁋');\n\t\tt = REFERENCE_PATTERN.matcher(t).replaceAll(\"\");\n\t\tt = SUPERSCRIPT_PATTERN.matcher(t).replaceAll(\"\"); //TODO: Extract sense!\n\t\tt = HTML_REMOVER.matcher(t).replaceAll(\"\");\n\t\tt = t.replace(\"&quot;\", \"\\\"\");\n\t\tt = t.replace(\",\", \"⁋,\");\n\t\tt = t.replace(\";\", \"⁋;\");\n\t\t//System.out.println(t);\n\t\t//t = BRACKETED_DELIMITER.matcher(t).replaceAll(\"$1$2$3$4$5$6\");\n\t\t//t = ESCAPE_DELIMITER1.matcher(t).replaceAll(\"$1$2\");\n\t\t//t = ESCAPE_DELIMITER2.matcher(t).replaceAll(\"$1$2\");\n\t\t//t = ESCAPE_DELIMITER3.matcher(t).replaceAll(\"$1$2\");\n\t\tt = escapeDelimiters(t);\t\t\t\n\t\t//System.out.println(t);\n\t\tt = t.replace(\"⁋;\", \"⁋\");\n\t\tt = t.replace(\"⁋,\", \"⁋\");\n\t\tt = t.replace(\"]] or [[\", \"]]⁋[[\");\n\t\tt = t.replace(\"]] and [[\", \"]]⁋[[\");\n\t\tt = t.replace(\" - \", \"⁋\");\n\t\t//t = t.replace(\" / \", \"⁋\");\n\t\tint j = t.indexOf(\" / \"); // Use ' / ' only as a delimiter if there are at least two of them!\n\t\tif (j >= 0) {\n\t\t\tj = t.indexOf(\" / \", j);\n\t\t\tif (j >= 0) {\n\t\t\t\tt = t.replace(\" / \", \"⁋\");\n\t\t\t\t//System.out.println(t);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(t);\n\t\tint delim;\n\t\tdo {\n\t\t\tdelim = t.indexOf('⁋');\n\t\t\tif (delim >= 0) {\n\t\t\t\tString word = t.substring(0, delim);\n\t\t\t\tif (word.length() > 0) {\n\t\t\t\t\t// Normalize the word.\n\t\t\t\t\tword = word.trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see also\"))\n\t\t\t\t\t\tword = word.substring(8).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see\"))\n\t\t\t\t\t\tword = word.substring(3).trim();\n\t\t\t\t\tif (word.startsWith(\":\"))\n\t\t\t\t\t\tword = word.substring(1).trim();\n\t\t\t\t\tword = deWikify(word).trim();\n\t\t\t\t\tword = removeBrackets(word).trim();\n\t\t\t\t\tword = removeTemplates(word).trim();\n\t\t\t\t\tword = removeComments(word).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see also\"))\n\t\t\t\t\t\tword = word.substring(8).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see\"))\n\t\t\t\t\t\tword = word.substring(3).trim();\n\t\t\t\t\tif (word.startsWith(\":\"))\n\t\t\t\t\t\tword = word.substring(1).trim();\n\t\t\t\t\tif (word.endsWith(\".\"))\n\t\t\t\t\t\tword = word.substring(0, word.length() - 1).trim();\n\t\t\t\t\tif (word.endsWith(\",\"))\n\t\t\t\t\t\tword = word.substring(0, word.length() - 1).trim();\n\t\t\t\t\t\n\t\t\t\t\t// Check for slashes.\n\t\t\t\t\tword = word.replace(\" / \", \"/\");\n\t\t\t\t\tword = word.replace(\"/ \", \"/\");\n\t\t\t\t\tint i = word.indexOf('/');\n\t\t\t\t\tif (word.length() > 0) {\n\t\t\t\t\t\tif (i >= 0 && word.indexOf(' ') < 0) {\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tresult.add(word.substring(0, i));\n\t\t\t\t\t\t\t\tword = word.substring(i + 1);\n\t\t\t\t\t\t\t\ti = word.indexOf('/');\n\t\t\t\t\t\t\t} while (i >= 0);\n\t\t\t\t\t\t\tresult.add(word);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tresult.add(word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tt = t.substring(delim + 1);\n\t\t\t}\n\t\t} while (delim >= 0);\n\t\treturn result;\n\t}", "public static String[] strParts(String string, String delim) {\r\n //StringTokenizer st = new StringTokenizer(string);\r\n String[] strings = string.split(delim);\r\n return removeSpaces(strings);\r\n }", "static String cutName(String input) { return input.split(\" \")[0]; }", "public String split(String s1,String s2) {\n\t\treturn s1.split(s2, 1).toString();\n\t}", "public String breakUp(String m){\n int arrSize = (int)(m.length()/35 + 0.5);\n\n String[] bySpace = m.split(\" \",0);\n String realMessage = \"\";\n int size = 0;\n for(int i = 0; i < bySpace.length;i++){\n size += bySpace[i].length();\n if(size > 35){\n size = 0;\n realMessage += \"\\n\";\n }\n realMessage += bySpace[i];\n }\n return realMessage;\n }", "static Extractor bySpaces() {\n\t\t\treturn Splitter.SPACE_EXTRACTOR;\n\t\t}", "public static ArrayList<String> stringSplit(String stringToSplit, String delimiter) \n\t{\n\t\tif (delimiter == null) delimiter = \" \";\n\t\tArrayList<String> stringList = new ArrayList<String>();\n\t\tString currentWord = \"\";\n\n\t\tfor (int i = 0; i < stringToSplit.length(); i++) \n\t\t{\n\t\t\tString s = Character.toString(stringToSplit.charAt(i));\n\n\t\t\tif (s.equals(delimiter)) \n\t\t\t{\n\t\t\t\tstringList.add(currentWord);\n\t\t\t\tcurrentWord = \"\";\n\t\t\t} \n\t\t\telse { currentWord += stringToSplit.charAt(i); }\n\n\t\t\tif (i == stringToSplit.length() - 1) stringList.add(currentWord);\n\t\t}\n\n\t\treturn stringList;\n\t}", "public static String cutSpaces(String s){\n\t\tString res = s;\n\t\t\n\t\twhile ((res.startsWith(\" \")||(res.startsWith(\"\\n\")))&& res.length()>0) {\n\t\t\tres=res.substring(1);\n\t\t}\n\t\treturn res;\n\t}", "private static String wordCap(String str) {\r\n\t\tif(str.isEmpty()) {\r\n\t\t\treturn \"\";\r\n\t\t}else if(str.length()==1) {\r\n\t\t\treturn str.toUpperCase();\r\n\t\t}else {\r\n\t\t\treturn (str.substring(0,1)).toUpperCase() + (str.substring(1,str.length()).toLowerCase());\r\n\t\t}\r\n\t}", "public String formatSpaceBetweenWords(String line) {\r\n line = line.replaceAll(\"\\\\s+\", \" \"); \r\n line = line.toLowerCase();\r\n line = oneSpaceSpecial(line, \".\");\r\n line = oneSpaceSpecial(line, \",\");\r\n line = oneSpaceSpecial(line, \":\");\r\n line = oneSpaceSpecial(line, \"\\\"\");\r\n return line.trim();\r\n }", "public static void main(String[] args) {\n\t\tString s1=\"abc def ghi\";\n\t\tString s3=\"rupomroy\";\n\t\tString s7 =s3.substring(0, 4);\n\t\tSystem.out.println(s7);\n\t\t\n\t\t String[] s5 =s3.split(\"roy\");\n\t\t System.out.println(s5[0]);\n String s2 = s1.substring(4);\t\n System.out.println(s2);\n\t\t\n\t\t String[] s = s1.split(\" \");\n\t\t System.out.println(s[0]);\n\t\t System.out.println(s[1]);\n\t\t System.out.println(s[2]);\n\t\t\n\t\tSystem.out.println(s1);\n\t\t\n\t\t\n\n\t}", "private static String[] splitByCharacterType(String str, boolean camelCase) {\n if (str == null) {\n return null;\n }\n if (str.length() == 0) {\n return new String[0];\n }\n char[] c = str.toCharArray();\n ArrayList<String> list = new ArrayList<String>();\n int tokenStart = 0;\n int currentType = Character.getType(c[tokenStart]);\n for (int pos = tokenStart + 1; pos < c.length; pos++) {\n int type = Character.getType(c[pos]);\n if (type == currentType) {\n continue;\n }\n if (camelCase && type == Character.LOWERCASE_LETTER\n && currentType == Character.UPPERCASE_LETTER) {\n int newTokenStart = pos - 1;\n if (newTokenStart != tokenStart) {\n list.add(new String(c, tokenStart, newTokenStart - tokenStart));\n tokenStart = newTokenStart;\n }\n } else {\n list.add(new String(c, tokenStart, pos - tokenStart));\n tokenStart = pos;\n }\n currentType = type;\n }\n list.add(new String(c, tokenStart, c.length - tokenStart));\n return (String[]) list.toArray(new String[list.size()]);\n }", "private static CharSequence[] splitOnSpaceRuns(CharSequence read) {\n int lastStart = 0;\n ArrayList<CharSequence> segs = new ArrayList<CharSequence>(5);\n int i;\n for(i=0;i<read.length();i++) {\n if (read.charAt(i)==' ') {\n segs.add(read.subSequence(lastStart,i));\n i++;\n while(i < read.length() && read.charAt(i)==' ') {\n // skip any space runs\n i++;\n }\n lastStart = i;\n }\n }\n if(lastStart<read.length()) {\n segs.add(read.subSequence(lastStart,i));\n }\n return (CharSequence[]) segs.toArray(new CharSequence[segs.size()]); \n }", "public static List<String> tokenize(final String str) {\n\tfinal LinkedList<String> list = new LinkedList<String>();\n\tfinal StringTokenizer tokenizer = new StringTokenizer(str, ALL_DELIMS, true);\n\n\twhile (tokenizer.hasMoreTokens()) {\n\t final String token = tokenizer.nextToken();\n\t // don't add spaces\n\t if (!token.equals(\" \")) {\n\t\tlist.add(token);\n\t }\n\t}\n\n\treturn list;\n }", "public static ArrayList<String> getWordsInString(String s) {\r\n\t\t// Search words in text\r\n\t\tString[] split = s.replace('-', ' ').split(\" \");\r\n\t\tArrayList<String> words = new ArrayList<String>(split.length);\r\n\t\t// Remove punctuation\r\n\t\tfor(String str : split) {\r\n\t\t\tif(str.isEmpty()) continue;\r\n\t\t\tStringBuilder wordBuilder = new StringBuilder();\r\n\t\t\tfor(int j = 0; j < str.length(); j++) {\r\n\t\t\t\tchar c = str.charAt(j);\r\n\t\t\t\tif(c >= 'A' && c <= 'Z') c = (char) (c + 'a' - 'A');\r\n\t\t\t\tif((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) {\r\n\t\t\t\t\twordBuilder.append(c);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twords.add(wordBuilder.toString());\r\n\t\t}\r\n\t\treturn words;\r\n\t}", "public static String convert1(String input) {\n\t\tString sRes = \"\";\n\t\tString[] splitInput = input.split(\"\\n\");\n\n\t\tfor (String s : splitInput) {\n\t\t\tString[] splitStr = s.split(\" \");\n\t\t\tfor (int i = 0; i < splitStr.length; i++) {\n\t\t\t\tsplitStr[i] = firstUpperCase(splitStr[i].toLowerCase());\n\t\t\t\tsRes = sRes.concat(splitStr[i] + \" \");\n\t\t\t}\n\t\t\tsRes += \"\\n\";\n\t\t}\n\n\t\treturn sRes;\n\t}", "private String normalizeSpace(final String arg) {\n return arg.replaceAll(Constants.SPACE_PATTERN, Constants.SPACE);\n }", "private String cutString(String value){\n String [] strings = value.split(\" \");\n System.out.println(strings[0]);\n return strings[0];\n }", "public static String capitalizeAllFirstLetters(String s)\n {\n char firstLetter;\n String result, word, capitalizedWord;\n String [] array;\n\n result = \"\";\n\n if(s.length() > 0)\n {\n array = s.split(\" \");\n\n for(int i =0; i < array.length; i++)\n {\n word = array[i];\n firstLetter = Character.toUpperCase(word.charAt(0));\n capitalizedWord = firstLetter + word.substring(1);\n\n result += capitalizedWord + \" \";\n }\n }\n\n return result;\n }", "public static String underscoreToCamelCase(final String undescoredString) {\r\n\r\n // Split the string for each underscore\r\n final String[] parts = undescoredString.split(\"_\");\r\n final StringBuilder camelCaseString = new StringBuilder(undescoredString.length());\r\n camelCaseString.append(parts[0].toLowerCase(Locale.getDefault()));\r\n\r\n // Skip the first part already added\r\n for (int i = 1; i < parts.length; i++) {\r\n // First letter to upper case\r\n camelCaseString.append(parts[i].substring(0, 1).toUpperCase(Locale.getDefault()));\r\n // Others to lower case\r\n camelCaseString.append(parts[i].substring(1).toLowerCase(Locale.getDefault()));\r\n }\r\n return camelCaseString.toString();\r\n\r\n }", "public static void main(String[] args) {\n\t String name = \"hi how\";\n\t String[] split = name.split(\" \");\n\t for(int i=0; i<split.length; i++)\n\t {\n\t \t int len = split[i].length();\n\t \t for(int a=len-1; a>=0; a--)\n\t \t {\n\t \t\t System.out.print(split[i].charAt(a));\n\t \t }\n\t \t System.out.print(\" \");\n\t \n\t }\n\t}", "public static String delimitedToCamelCase(CharSequence s, char delimiter) {\n StringBuilder sb = new StringBuilder();\n boolean upcase = true;\n int max = s.length();\n for (int i = 0; i < max; i++) {\n char c = s.charAt(i);\n if (c == delimiter) {\n upcase = true;\n continue;\n }\n if (upcase) {\n c = Character.toUpperCase(c);\n upcase = false;\n }\n sb.append(c);\n }\n return sb.toString();\n }", "public static List<String> splitString(String s, char c) {\r\n List<String> result = new ArrayList<String>();\r\n int startPos = 0;\r\n while (true) {\r\n int pos = s.indexOf(c, startPos);\r\n if (pos == -1) {\r\n break;\r\n }\r\n result.add(s.substring(startPos, pos));\r\n startPos = pos + 1;\r\n }\r\n if (startPos != s.length()) {\r\n result.add(s.substring(startPos, s.length()));\r\n }\r\n return result;\r\n }", "public static String formatSpaces(String s) {\n\t\tif(s.contains(\"underscores\"))\n\t\treturn s.replaceAll(\" \", \"_\");\n\t\t\n\t\treturn s;\n\t}", "public String acronym(String phrase) {\n /*StringBuilder acronymFeed = new StringBuilder(\"\");\n String wordHolder = \"\";\n int spaceIndex;\n char firstLetter;\n do{\n spaceIndex = phrase.indexOf(\" \");\n wordHolder = phrase.substring(0,spaceIndex);\n acronymFeed.append(wordHolder.charAt(0));\n phrase = phrase.replaceFirst(wordHolder, \"\");\n } while (spaceIndex != -1 && wordHolder != \"\" && phrase != \"\");\n \n \n \n \n \n String acronymResult = acronymFeed.toString().toUpperCase();\n return acronymResult;\n */\n \n char[] letters = phrase.toCharArray();\n String firstLetters = \"\";\n firstLetters += String.valueOf(letters[0]);\n for (int i = 1; i < phrase.length();i++){\n if (letters[i-1] == ' '){\n firstLetters += String.valueOf(letters[i]);\n }\n }\n firstLetters = firstLetters.toUpperCase();\n return firstLetters;\n }", "public void biStringToAl(String s){\n\t\tint i=0, j=0, num=0;\n\t\twhile(i<s.length() - 1){ //avoid index out of range exception\t\t\t\n\t\t\twhile(i < s.length()){\n\t\t\t\ti++;\n\t\t\t\tif(s.charAt(i) == ' ' || i == s.length()-1){ //a word ends\n\t\t\t\t\tnum++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile(num >2 && i < s.length()){\n\t\t\t\tj++;\n\t\t\t\tif(s.charAt(j) == ' '){ // j is 2 words slower than i\n\t\t\t\t\tj = j + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tString temp;\n\t\t\tif(num >= 2){\n\t\t\t\tif(i == s.length() - 1){\n\t\t\t\t\ttemp =s.substring(j,i+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp =s.substring(j,i);\n\t\t\t\t}\n\t\t\t\tbiWords.add(temp);\n\t\t\t\t//System.out.println(\"temp:\"+temp);\n\t\t\t}\n\t\t}\n\t}", "@Test\n void splitAndReplace_WorksCorrectly_abcdefg() {\n String s = \"abcdefg\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(1, third.length());\n assertEquals('g', third.charAt(0));\n }", "public static String lineLeader(String s1, String s2, String s3) {\n\t\t\n\t\tString[] last1 = s1.split(\"\");\n\t\tString[] last2 = s2.split(\"\");\n\t\tString[] last3 = s3.split(\"\");\n\t\t\n\t\t\n\t\tString char1 = null;\n\t\tString char2 = null;\n\t\tString char3 = null;\n\t\t\n\t\tString[] abcs = {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"};\n\t\t\n\t\tfor (int i = 2; i < last1.length; i++) {\n\t\t\tif(!last1[i].equals(\" \") && last1[i - 1].equals(\" \") && !last1[i - 2].equals(\" \")) {\n\t\t\t\tchar1 = last1[i];\n\t\t\t\t//System.out.println(char1);\n\t\t\t}\n\n\t\t}\n\t\tfor (int i = 2; i < last2.length; i++) {\n\n\t\t\tif(!last2[i].equals(\" \") && last2[i - 1].equals(\" \") && !last2[i - 2].equals(\" \")) {\n\t\t\t\tchar2 = last2[i];\n\t\t\t\t//System.out.println(char2);\n\n\t\t\t}\n\n\t\t}\n\t\tfor (int i = 2; i < last3.length; i++) {\n\n\t\t\tif(!last3[i].equals(\" \") && last3[i - 1].equals(\" \") && !last3[i - 2].equals(\" \")) {\n\t\t\t\tchar3 = last3[i];\n\t\t\t\t//System.out.println(char3);\n\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < abcs.length; i++) {\n\t\t\tif(char1.contains(abcs[i])) {\n\t\t\t\t//System.err.println(s1.replaceAll(\" \", \"\").substring(0, s1.replaceAll(\" \", \"\").length()-1) + \" \" + char1);\n\t\t\t\treturn s1.replaceAll(\" \", \"\").substring(0, s1.replaceAll(\" \", \"\").length()-1) + \" \" + char1;\n\t\t\t}\n\t\t\tif(char2.contains(abcs[i])) {\n\t\t\t\t//System.err.println(s2.replaceAll(\" \", \"\").substring(0, s2.replaceAll(\" \", \"\").length()-1) + \" \" + char2);\n\n\t\t\t\treturn s2.replaceAll(\" \", \"\").substring(0, s2.replaceAll(\" \", \"\").length()-1) + \" \" + char2;\n\t\t\t}\n\t\t\tif(char3.contains(abcs[i])) {\n\t\t\t\t///System.err.println(s3.replaceAll(\" \", \"\").substring(0, s3.replaceAll(\" \", \"\").length()-1) + \" \" + char3);\n\t\t\t\treturn s3.replaceAll(\" \", \"\").substring(0, s3.replaceAll(\" \", \"\").length()-1) + \" \" + char3;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\n\t}", "public String splitColumn(String s){\n\t\tint i;\n\t\tchar ch;\n\t\tfor(i=s.length()-1; i>=0; i--){\n\t\t\tch = s.charAt(i);\n\t\t\tif('9'<ch || ch<'0')\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t\tif(i>=0 && i<s.length()-1)\n\t\t\treturn s.substring(0, i+1);\n\t\telse\n\t\t\treturn \"\";\t\n\t}", "public static String camel(final String value) {\r\n\t\tif (!isBlank(value)) {\r\n\t\t\treturn value.substring(0, 1).toLowerCase() + value.substring(1);\r\n\t\t} else {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}", "public String acronym(String phrase) {\n\t\tString[] p = phrase.split(\"[\\\\W\\\\s]\");\n\t\tString returner = \"\";\n\t\tfor (String s : p) {\n\t\t\tif (!s.isEmpty())\n\t\t\t\treturner = returner + s.charAt(0);\n\t\t}\n\t\treturn returner.toUpperCase();\n\t}", "public static char[] splitWordChar(String word) {\r\n\t\tchar[] letters = word.toCharArray();\r\n\t\treturn letters;\r\n\t}", "public static String formatSpaces(String s) {\n\t\t\n\t\tif(s.contains(\"underscores\")==true) {\n\t\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\t\tif(s.charAt(i)==' ') {\n\t\t\t\t\tString t1=s.substring(0, i);\n\t\t\t\t\tString t2=s.substring(i+1, s.length());\n\t\t\ts=t1+\"_\"+t2;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\treturn s;\n\t}", "@Test\n public void testSplitOnWhitespaceAndCommas() {\n assertEquals(0, Strings.splitOnWhitespaceAndCommas(null).size());\n assertEquals(0, Strings.splitOnWhitespaceAndCommas(\"\").size());\n assertEquals(0, Strings.splitOnWhitespaceAndCommas(\" ,, \\n,\\t, ,, ,\").size());\n \n List<String> split = Strings.splitOnWhitespaceAndCommas(\" ,, hello, \\nthere\\t,,\");\n assertEquals(2, split.size());\n assertEquals(\"hello\", split.get(0));\n assertEquals(\"there\", split.get(1));\n }", "public static StringSplit newSplit(int start, WordCase wordCase) {\n return new StringSplit(start, END_OF_LINE, wordCase, false);\n }", "public static String toTitleCase(String s) {\n if (s != null && !s.isEmpty()) {\n int length = s.length();\n String str = \"\";\n String strTemp = \"\";\n for (int i = 0; i < length; i++) {\n char ch = s.charAt(i);\n if (ch == ' ') {\n strTemp += ch;\n str = str.concat(toSentenceCase(strTemp));\n strTemp = \"\";\n } else {\n strTemp += ch;\n }\n }\n str = str.concat(toSentenceCase(strTemp));\n return str;\n } else\n return \"\";\n }", "@Test\n void splitAndReplace_WorksCorrectly_abcdefgh() {\n String s = \"abcdefgh\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(2, third.length());\n assertEquals('g', third.charAt(0));\n assertFalse(\"gh\".contains(String.valueOf(second.charAt(1))));\n }", "public String titlelize(String toTitlelize) {\r\n if (toTitlelize == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n StringBuilder resultString = new StringBuilder();\r\n List<String> wordList = Arrays.asList(toTitlelize.split(\"\\\\s\"));\r\n\r\n\r\n for (String word : wordList) {\r\n if (!ignoreList.contains(word)) {\r\n resultString.append(WordUtils.capitalizeFully(word));\r\n resultString.append(\" \");\r\n\r\n\r\n } else {\r\n resultString.append(word);\r\n resultString.append(\" \");\r\n }\r\n\r\n\r\n }\r\n resultString.deleteCharAt(resultString.length() - 1);\r\n return resultString.toString();\r\n }", "public static List<Pair<Integer,String>> getIndexedCamelCaseWords(String content) {\n List<Pair<Integer,String>> camelCaseList = new ArrayList<>();\n// for (String word : content.split(\" \")) {\n// if(word.matches(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\")){\n// camelCaseList.add(word);\n// }\n// }\n Pattern regex = Pattern.compile(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\");\n Matcher regexMatcher = regex.matcher(content);\n while (regexMatcher.find()) {\n if(regexMatcher.group().length()<=40){\n camelCaseList.add(new Pair<>(regexMatcher.start(), regexMatcher.group()));\n }\n }\n return camelCaseList;\n }", "private int findSplit(String input) {\n char[] buffer = input.toCharArray();\n int pos = 0;\n for (int i = 0; i < buffer.length; i++) {\n if (this.isLetter(buffer[i])) {\n pos = i;\n break;\n }\n }\n return pos;\n }", "public static StringSplit newSplit(int start, int end, WordCase wordCase) {\n return new StringSplit(start, end, wordCase, false);\n }", "public static List<String> splitWhitespace(String text) {\n\t\tif (sb == null) {\n\t\t\tsb = new StringBuilder();\n\t\t}\n\t\tchar[] chars = text.toCharArray();\n\t\tList<String> words = new ArrayList<String>();\n\t\tfor (int i=0; i<chars.length; i++) {\n\t\t\tif (Character.isWhitespace(chars[i])) {\n\t\t\t\tif (sb.length() > 0) {\n\t\t\t\t\twords.add(sb.toString());\n\t\t\t\t}\n\t\t\t\tsb.setLength(0);\n\t\t\t} else {\n\t\t\t\tsb.append(chars[i]);\n\t\t\t}\n\t\t}\n\t\tif (sb.length() > 0) {\n\t\t\twords.add(sb.toString());\n\t\t}\n\t\tsb.setLength(0);\n\t\treturn words;\n\t}" ]
[ "0.7494371", "0.7052162", "0.6790428", "0.6580964", "0.63633204", "0.63013303", "0.6199556", "0.6185821", "0.6183761", "0.6171002", "0.6166158", "0.61357725", "0.6087131", "0.60428196", "0.60142267", "0.6008457", "0.59993404", "0.59847015", "0.59598386", "0.5925488", "0.5883937", "0.58581036", "0.58196396", "0.58001727", "0.5799148", "0.5798497", "0.5797479", "0.57650644", "0.575779", "0.5753089", "0.5752189", "0.57519794", "0.5745717", "0.5694068", "0.56117356", "0.5605202", "0.5593303", "0.5588939", "0.5588865", "0.5573956", "0.55668753", "0.5555229", "0.5550192", "0.5545029", "0.5543312", "0.5539493", "0.5531885", "0.5528054", "0.5507871", "0.5503774", "0.5499666", "0.5485645", "0.547507", "0.54628426", "0.5459388", "0.54234326", "0.5419488", "0.54179806", "0.5412808", "0.53997713", "0.5383953", "0.5376752", "0.53754383", "0.5354285", "0.5344201", "0.5340631", "0.53358275", "0.53248787", "0.5317889", "0.53148097", "0.53134006", "0.530594", "0.5305306", "0.5303031", "0.52906287", "0.5286515", "0.5283386", "0.52814513", "0.52813965", "0.52788985", "0.5267894", "0.52596724", "0.52561843", "0.5256108", "0.5254982", "0.5252998", "0.52427524", "0.52425563", "0.5239369", "0.52305377", "0.5229946", "0.52264947", "0.52235055", "0.5219218", "0.5219052", "0.52125156", "0.51933414", "0.5188663", "0.5179872", "0.51734114" ]
0.7373392
1
Takes a String s in camel class and splits it by injecting the supplied replacement Taken from polygenelubricants answer on
public static String splitCamelCase(String s, String replacement) { return s.replaceAll( String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])", "(?<=[A-Za-z])(?=[^A-Za-z])" ), replacement ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String splitCamelCase(String s) {\n return s.replaceAll(\n String.format(\"%s|%s|%s\",\n \"(?<=[A-Z])(?=[A-Z][a-z])\",\n \"(?<=[^A-Z])(?=[A-Z])\",\n \"(?<=[A-Za-z])(?=[^A-Za-z])\"),\n \" \").replaceAll(\"[-_]\", \"\").replaceAll(\" \", \" \");\n }", "public static String splitCamelCase(String s) {\n return s.replaceAll(\n String.format(\"%s|%s|%s\",\n \"(?<=[A-Z])(?=[A-Z][a-z])\",\n \"(?<=[^A-Z])(?=[A-Z])\",\n \"(?<=[A-Za-z])(?=[^A-Za-z])\"\n ),\n \" \"\n );\n }", "private String getSplitNames(String className){\n String nameSplited = \"\";\n\n for (String character : className.split(\"(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])\")){\n nameSplited = nameSplited + character + \" \";\n }\n\n return nameSplited;\n }", "@Test\n void splitAndReplace_WorksCorrectly_abcdefg() {\n String s = \"abcdefg\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(1, third.length());\n assertEquals('g', third.charAt(0));\n }", "@Test\n void splitAndReplace_WorksCorrectly_abcdefghi() {\n String s = \"abcdefghi\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(3, third.length());\n assertEquals('g', third.charAt(0));\n assertFalse(\"gh\".contains(String.valueOf(second.charAt(1))));\n assertEquals('i', third.charAt(2));\n }", "@Test\n void splitAndReplace_WorksCorrectly_abcdefgh() {\n String s = \"abcdefgh\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(2, third.length());\n assertEquals('g', third.charAt(0));\n assertFalse(\"gh\".contains(String.valueOf(second.charAt(1))));\n }", "private String firstSentenceSplitting(String s) {\n // Double new-line means a new sentence:\n s = paragraph.matcher(s).replaceAll(\"$1\" + EOS);\n // Punctuation followed by whitespace means a new sentence:\n s = punctWhitespace.matcher(s).replaceAll(\"$1\" + EOS);\n // New (compared to the perl module): Punctuation followed by uppercase followed\n // by non-uppercase character (except dot) means a new sentence:\n s = punctUpperLower.matcher(s).replaceAll(\"$1\" + EOS + \"$2\");\n // Break also when single letter comes before punctuation:\n s = letterPunct.matcher(s).replaceAll(\"$1\" + EOS);\n return s;\n }", "public static String camelCaseToDelimited(CharSequence s, char delimiter) {\n StringBuilder sb = new StringBuilder();\n int max = s.length();\n char prev = 0;\n for (int i = 0; i < max; i++) {\n char c = s.charAt(i);\n if (Character.isUpperCase(c) && !Character.isUpperCase(prev)) {\n if (sb.length() > 0 && sb.charAt(sb.length() - 1) != delimiter) {\n sb.append(delimiter);\n }\n }\n sb.append(Character.toLowerCase(c));\n prev = c;\n }\n return sb.toString();\n }", "public static void main(String[] args) {\n String textString = \"Hello, world! I am program.\";\n\n\n// System.out.println(Arrays.toString(\"a;b;c;d\".split(\"(?=;)\")));\n// String[] split = \"a;b;c;d\".split(\"(?=\\\\p{Punct}\\s?)|\\s\");\n /*String[] split = \"a;b;c;d\".split(\"(?=\\\\p{Punct}\\s?)\");\n System.out.println(Arrays.toString(split));*/\n// String[] split1 = \"Hello, world!\".split(\"(?=\\\\p{Punct}\\s?)|\\s\");\n /*String[] split1 = \"Hello, world!\".split(\"(?=(\\\\p{Punct}\\s?))\");\n System.out.println(Arrays.toString(split1));*/\n// System.out.println(Arrays.toString(\"a;b;c;d\".split(\"((?<=;)|(?=;))\")));\n\n// String[] sentenceElementStrings = sentenceString.split(\"(?=\\\\p{Punct}\\s?)|\\s\");\n// System.out.println(\"Hello world! \\\\I am program.\");\n Text text = new Text(textString);\n\n System.out.println(\"Original text:\\n\" + text);\n\n text.swapFirstAndLastWordsInSentences();\n\n System.out.println(\"Text after swapping:\\n\" + text);\n }", "private String getSplitCapitalPeriodSent(String text) {\n\t\t\r\n\t\tString testString = text;\r\n\t\t\r\n\t\t/*\r\n\t\ttestString = testString.replaceAll(\"\\\\·\", \".\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t// https://d5gate.ag5.mpi-sb.mpg.de/ClausIEGate/ClausIEGate?inputtext=Optimal+temperature+and+pH+for+growth+are+25%E2%80%9330+%CB%9AC+and+pH+7%2C+respectively.&processCcAllVerbs=true&processCcNonVerbs=true&type=true&go=Extract\r\n\t\ttestString = testString.replaceAll(\"\\\\s?\\\\·\\\\s?\", \".\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t\r\n\t\ttestString = testString.replaceAll(\"–\", \"-\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t// https://d5gate.ag5.mpi-sb.mpg.de/ClausIEGate/ClausIEGate?inputtext=Optimal+temperature+and+pH+for+growth+are+25%E2%80%9330+%CB%9AC+and+pH+7%2C+respectively.&processCcAllVerbs=true&processCcNonVerbs=true&type=true&go=Extract\r\n\t\ttestString = testString.replaceAll(\"\\\\s?-\\\\s?\", \"-\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t*/\r\n\t\t\r\n\t\t// System.out.println(\"testString::Before::\" + testString);\r\n\t\t\r\n\t\tString targetPatternString = \"(\\\\s[A-Z]\\\\.\\\\s)\";\r\n\t\tPattern pattern = Pattern.compile(targetPatternString);\r\n\t\tMatcher matcher = pattern.matcher(testString);\r\n\t\t\r\n\t\twhile (matcher.find()) {\r\n\t\t\t// System.out.println(\"Whloe Sent::\" + matcher.group());\r\n\t\t\t// System.out.println(\"Part 1::\" + matcher.group(1));\r\n\t\t\t// System.out.println(\"Part 2::\" + matcher.group(2));\r\n\t\t\t// System.out.println(\"Part 3::\" + matcher.group(3));\r\n\t\t\t\r\n\t\t\tString matchString = matcher.group(1);\r\n\t\t\t\r\n\t\t\tString newMatchString = \"\";\r\n\t\t\tfor ( int j = 0; j < matchString.length(); j++ ) {\r\n\t\t\t\tnewMatchString += matchString.substring(j, j+1) + \" \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"getSplitCapitalPeriodSent::OriginalSent::\" + text);\r\n\t\t\tSystem.out.println(\"matchString:: \" + matchString);\r\n\t\t\tSystem.out.println(\"newMatchString:: \" + newMatchString);\r\n\t\t\t\r\n\t\t\tlog(LogLevel.INFO, \"getSplitCapitalPeriodSent::OriginalSent::\" + text);\r\n\t\t\tlog(LogLevel.INFO, \"matchString:: \" + matchString);\r\n\t\t\tlog(LogLevel.INFO, \"newMatchString:: \" + newMatchString);\r\n\t\t\t\r\n\t\t\ttestString = testString.replaceAll(matcher.group(1), newMatchString);\r\n\t\t\t\r\n\t\t\t// String matchResult = matcher.group(1);\r\n\t\t\t// System.out.println(\"matchResult::\" + matchResult);\r\n\t\t}\r\n\t\t\r\n\t\t// System.out.println(\"testString::After::\" + testString);\r\n\t\t\r\n\t\treturn testString;\r\n\t\t\r\n\t}", "@Override\n public String split(String source) {\n String result = (hasEnd()) ? source.substring(getStart(), getEnd()) : source.substring(getStart());\n result = (trimmed) ? result.trim() : result;\n return wordCase.apply(result);\n }", "public static String delimitedToCamelCase(CharSequence s, char delimiter) {\n StringBuilder sb = new StringBuilder();\n boolean upcase = true;\n int max = s.length();\n for (int i = 0; i < max; i++) {\n char c = s.charAt(i);\n if (c == delimiter) {\n upcase = true;\n continue;\n }\n if (upcase) {\n c = Character.toUpperCase(c);\n upcase = false;\n }\n sb.append(c);\n }\n return sb.toString();\n }", "String replaceInString(String s) {\n\t\tString newS = s.replaceAll(\"[a-zA-Z]+\", \"WORT\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}", "public static void main(String[] args) {\n String s1 = \"01724-063642\";\n String s2 = s1.replace('i', 'j');\n\n System.out.println(s2);\n \n //String[] sp = s1.split(\" \");\n //String[] sp = s1.split(\"_\");\n String[] sp = s1.split(\"-\");\n for (String s:sp) {\n System.out.println(s);\n }\n \n }", "static String changeStr(StringFunc sf, String s){\n return sf.func(s);\n }", "public static void main(String[] args) {\n String myRegExString = \"[a-zA-Z\\\\s]+\";\n\n // This is the string we will check to see if our regex matches:\n String myString = \"The quick brown fox jumped over the lazy dog...\";\n\n // Create a Pattern object (compiled RegEx) and save it as 'p'\n Pattern p = Pattern.compile(myRegExString);\n\n // We need a Matcher to match our compiled RegEx to a String\n Matcher m = p.matcher(myString);\n\n // if our Matcher finds a match\n if (m.find()) {\n // Print the match\n System.out.println(m.group());\n }\n\n String s = \"Hello, Goodbye, Farewell\";\n Pattern p1 = Pattern.compile(\"\\\\p{Alpha}+\");\n Matcher m1 = p1.matcher(s);\n\n while( m.find() ){\n System.out.println(m1.group());\n }\n\n String s1 = \"Hello, Goodbye, Farewell\";\n String s2 = \"Hola, Adios, Hasta Luego\";\n\n String myDelimiter = \", \";\n\n String[] s1array = s1.split(myDelimiter);\n String[] s2array = s2.split(myDelimiter);\n\n System.out.println(\"s1array[0]: \" + s1array[0]);\n System.out.println(\"s1array[1]: \" + s1array[1]);\n System.out.println(\"s1array[2]: \" + s1array[2]);\n System.out.println(\"s2array[0]: \" + s2array[0]);\n System.out.println(\"s2array[1]: \" + s2array[1]);\n System.out.println(\"s2array[2]: \" + s2array[2]);\n\n }", "private String substitution(String s) {\r\n\t\t// System.out.println(\"ExPar.substitution() Substitution for: \" + s);\r\n\t\tint i = s.indexOf(substitutionChar);\r\n\t\tif (i < 0) {\r\n\t\t\treturn (s);\r\n\t\t} else {\r\n\t\t\tStringBuffer t = new StringBuffer();\r\n\t\t\tint i0 = 0;\r\n\t\t\tboolean finished = false;\r\n\t\t\twhile (!finished) {\r\n\t\t\t\t// System.out.println(\" Buffer = \" + t);\r\n\t\t\t\tint i1 = s.indexOf(substitutionChar, i0);\r\n\t\t\t\tif (i1 < 0) {\r\n\t\t\t\t\tt.append(s.substring(i0));\r\n\t\t\t\t\t// System.out.println(\" i1 = \" + i1 + \" Buffer = \" + t);\r\n\t\t\t\t\tfinished = true;\r\n\t\t\t\t} else if ((i1 > i0) && (s.charAt(i1 - 1) == escapeChar)) {\r\n\t\t\t\t\tt.append(s.substring(i0, i1 - 1));\r\n\t\t\t\t\tt.append(substitutionChar);\r\n\t\t\t\t\ti0 = i1 + 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// found first substitution character\r\n\t\t\t\t\tint i2 = s.indexOf(substitutionChar, i1 + 2);\r\n\t\t\t\t\tif (i2 < 0) {\r\n\t\t\t\t\t\tt.append(s.substring(i0));\r\n\t\t\t\t\t\t// System.out.println(\" i2 = \" + i2 + \" Buffer = \" +\r\n\t\t\t\t\t\t// t);\r\n\t\t\t\t\t\tfinished = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// found second substitution character\r\n\t\t\t\t\t\tif (i0 < i1) {\r\n\t\t\t\t\t\t\tt.append(s.substring(i0, i1));\r\n\t\t\t\t\t\t\t// System.out.println(\" Buffer = \" + t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Check for trailing format character\r\n\t\t\t\t\t\tString name = s.substring(i1 + 1, i2);\r\n\t\t\t\t\t\tint n = name.length();\r\n\t\t\t\t\t\tchar fmt = '0';\r\n\t\t\t\t\t\tif ((n > 2) && (name.charAt(n - 2) == formatChar)) {\r\n\t\t\t\t\t\t\tfmt = name.charAt(n - 1);\r\n\t\t\t\t\t\t\tname = name.substring(0, n - 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t// System.out.println(\"ExPar.substitution() Parameter = \"\r\n\t\t\t\t\t\t// + name);\r\n\t\t\t\t\t\tExPar sx = get(name);\r\n\t\t\t\t\t\tif (sx != null) {\r\n\t\t\t\t\t\t\t// Force parameter evaluation\r\n\t\t\t\t\t\t\tExParValue sxv = sx.getValue().getValue();\r\n\t\t\t\t\t\t\t// t.append(sx.getString());\r\n\t\t\t\t\t\t\t// If this is a string then remove the quotes\r\n\t\t\t\t\t\t\tString ss = sxv.toFormattedString(fmt);\r\n\t\t\t\t\t\t\t// System.out.println(\"ExPar.substitution() Value = \"\r\n\t\t\t\t\t\t\t// + ss);\r\n\t\t\t\t\t\t\tif (ss.startsWith(\"\\\"\") && (ss.endsWith(\"\\\"\")))\r\n\t\t\t\t\t\t\t\tss = StringExt.unquote(ss);\r\n\t\t\t\t\t\t\tt.append(ss);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tt.append(s.substring(i1, i2 + 1));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// System.out.println(\" Buffer = \" + t);\r\n\t\t\t\t\t\ti0 = i2 + 1;\r\n\t\t\t\t\t\tfinished = (i0 >= s.length());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn (t.toString());\r\n\t\t}\r\n\t}", "private String replace(String s) {\n return s.replaceAll(\"C#\", \"1\")\n .replace(\"D#\", \"2\")\n .replace(\"F#\", \"3\")\n .replace(\"G#\", \"4\")\n .replace(\"A#\", \"5\");\n }", "public abstract void split(Space s);", "String nombreDeClase(String s) {\n return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();\n }", "public List<String> splitWordList(final String text) {\n\t\tList<String> result = new ArrayList<>();\n\t\tif (text == null)\n\t\t\treturn result;\n\n\t\tString t = text + \"⁋\";\n\t\tt = t.replace('\\n', '⁋');\n\t\tt = REFERENCE_PATTERN.matcher(t).replaceAll(\"\");\n\t\tt = SUPERSCRIPT_PATTERN.matcher(t).replaceAll(\"\"); //TODO: Extract sense!\n\t\tt = HTML_REMOVER.matcher(t).replaceAll(\"\");\n\t\tt = t.replace(\"&quot;\", \"\\\"\");\n\t\tt = t.replace(\",\", \"⁋,\");\n\t\tt = t.replace(\";\", \"⁋;\");\n\t\t//System.out.println(t);\n\t\t//t = BRACKETED_DELIMITER.matcher(t).replaceAll(\"$1$2$3$4$5$6\");\n\t\t//t = ESCAPE_DELIMITER1.matcher(t).replaceAll(\"$1$2\");\n\t\t//t = ESCAPE_DELIMITER2.matcher(t).replaceAll(\"$1$2\");\n\t\t//t = ESCAPE_DELIMITER3.matcher(t).replaceAll(\"$1$2\");\n\t\tt = escapeDelimiters(t);\t\t\t\n\t\t//System.out.println(t);\n\t\tt = t.replace(\"⁋;\", \"⁋\");\n\t\tt = t.replace(\"⁋,\", \"⁋\");\n\t\tt = t.replace(\"]] or [[\", \"]]⁋[[\");\n\t\tt = t.replace(\"]] and [[\", \"]]⁋[[\");\n\t\tt = t.replace(\" - \", \"⁋\");\n\t\t//t = t.replace(\" / \", \"⁋\");\n\t\tint j = t.indexOf(\" / \"); // Use ' / ' only as a delimiter if there are at least two of them!\n\t\tif (j >= 0) {\n\t\t\tj = t.indexOf(\" / \", j);\n\t\t\tif (j >= 0) {\n\t\t\t\tt = t.replace(\" / \", \"⁋\");\n\t\t\t\t//System.out.println(t);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(t);\n\t\tint delim;\n\t\tdo {\n\t\t\tdelim = t.indexOf('⁋');\n\t\t\tif (delim >= 0) {\n\t\t\t\tString word = t.substring(0, delim);\n\t\t\t\tif (word.length() > 0) {\n\t\t\t\t\t// Normalize the word.\n\t\t\t\t\tword = word.trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see also\"))\n\t\t\t\t\t\tword = word.substring(8).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see\"))\n\t\t\t\t\t\tword = word.substring(3).trim();\n\t\t\t\t\tif (word.startsWith(\":\"))\n\t\t\t\t\t\tword = word.substring(1).trim();\n\t\t\t\t\tword = deWikify(word).trim();\n\t\t\t\t\tword = removeBrackets(word).trim();\n\t\t\t\t\tword = removeTemplates(word).trim();\n\t\t\t\t\tword = removeComments(word).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see also\"))\n\t\t\t\t\t\tword = word.substring(8).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see\"))\n\t\t\t\t\t\tword = word.substring(3).trim();\n\t\t\t\t\tif (word.startsWith(\":\"))\n\t\t\t\t\t\tword = word.substring(1).trim();\n\t\t\t\t\tif (word.endsWith(\".\"))\n\t\t\t\t\t\tword = word.substring(0, word.length() - 1).trim();\n\t\t\t\t\tif (word.endsWith(\",\"))\n\t\t\t\t\t\tword = word.substring(0, word.length() - 1).trim();\n\t\t\t\t\t\n\t\t\t\t\t// Check for slashes.\n\t\t\t\t\tword = word.replace(\" / \", \"/\");\n\t\t\t\t\tword = word.replace(\"/ \", \"/\");\n\t\t\t\t\tint i = word.indexOf('/');\n\t\t\t\t\tif (word.length() > 0) {\n\t\t\t\t\t\tif (i >= 0 && word.indexOf(' ') < 0) {\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tresult.add(word.substring(0, i));\n\t\t\t\t\t\t\t\tword = word.substring(i + 1);\n\t\t\t\t\t\t\t\ti = word.indexOf('/');\n\t\t\t\t\t\t\t} while (i >= 0);\n\t\t\t\t\t\t\tresult.add(word);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tresult.add(word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tt = t.substring(delim + 1);\n\t\t\t}\n\t\t} while (delim >= 0);\n\t\treturn result;\n\t}", "public static String deCamelCase(String s, String newDelim) {\n StringBuilder b = new StringBuilder(s.length() + newDelim.length() *4); // estimating the expected capacity\n for (int i = 0, n = s.length(); i < n; i++) {\n char ch = s.charAt(i);\n if (i > 0 && ch == Character.toUpperCase(ch))\n b.append(newDelim);\n b.append(Character.toLowerCase(ch));\n }\n return b.toString();\n }", "String getReplacementString();", "public static StringSplit newSplit(int start, int end, WordCase wordCase) {\n return new StringSplit(start, end, wordCase, false);\n }", "@Test\n void labTask() {\n String s = \"abczefoh\";\n List<String> result = StringSplitter.labTask(s);\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(2, second.length());\n assertEquals('o', second.charAt(0));\n assertFalse(\"oh\".contains(String.valueOf(second.charAt(1))));\n\n String third = result.get(2);\n assertEquals(3, third.length());\n assertEquals('z', third.charAt(0));\n assertFalse(\"zef\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', third.charAt(2));\n }", "public static void main(String[] args) {\n\t\n\tString str=\"Hello Deannochka, How are you? How have you been?\";\n\tSystem.out.println(str.replace(\" y\", \" th\"));\n\tSystem.out.println(str.replace(\"Hello\", \"Hey\"));\n//\tSystem.out.println(str.replaceAll(regex, replacement));\n\t\n}", "public interface StringTransformer\r\n{\r\n String transform(String source, Matcher matcher);\r\n}", "public String transform(String input);", "public static void main(String[] args) {\n Arrays.asList(\"abc def gh\".split(\" \")).forEach(System.out::println);\n\n //Section2: string replace\n System.out.println(\"abca\".replace('a','d'));\n\n\n }", "public static List<String> getCamelCaseWords(String content) {\n List<String> camelCaseList = new ArrayList<>();\n// for (String word : content.split(\" \")) {\n// if(word.matches(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\")){\n// camelCaseList.add(word);\n// }\n// }\n Pattern regex = Pattern.compile(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\");\n Matcher regexMatcher = regex.matcher(content);\n while (regexMatcher.find()) {\n camelCaseList.add(regexMatcher.group());\n }\n return camelCaseList;\n }", "@Test(testName = \"splitFunctioanlity\")\n\t public static void splitFunction() \n\t { \n\t String str = \"geekss@for@geekss\"; \n\t String[] arrOfStr = str.split(\"s\", 5); \n\t \n\t for (String a : arrOfStr) \n\t System.out.println(a); \n\t \t}", "public static void main(String[] args) {\nString s1 = \"java gg\";\nchar[] ch ={'g','r','d'};\nString s2 = new String(ch);\n//length\nSystem.out.println(s1.length());\nSystem.out.println(s2.length());\n//charAt\nchar c = s1.charAt(2);\nSystem.out.println(c);\n//String format\nString cd = String.format(\"value %32.11f\",32.5654);\nSystem.out.println(cd);\n//Substring.........start index starts with 0 and end index starts with 1\nSystem.out.println(s1.substring(1));\nSystem.out.println(s1.substring(1, 3));\n//Contains\nSystem.out.println(\"contains example\" +s1.contains(\"gg\"));\n//Join\nString joint = String.join(\"-\", \"Welcome\",\"to\",\"india\");\nSystem.out.println(joint);\n//Equals\nSystem.out.println(s1.equals(s2));\n//is empty\nSystem.out.println(s1.isEmpty());\n//Concat\ns1.concat(\"hello\");\nSystem.out.println(s1);\ns1 = s1.concat(\" home\");\nSystem.out.println(s1);\n//char replace\nString sf=\"javatpoint is a very good website\"; \nString replaceString=sf.replace('a','e');//replaces all occurrences of 'a' to 'e' \nSystem.out.println(replaceString);\n//charSequence replace\nString sg=\"my name is khan my name is java\"; \nString replaceString1=sg.replace(\"is\",\"was\");//replaces all occurrences of \"is\" to \"was\" \nSystem.out.println(replaceString1); \n// trim: string with omitted leading and trailing spaces\nString df = \" Hello java \";\nSystem.out.println(df+\"javapoint\");\nSystem.out.println(df.trim()+\"javapoint\");\n//Split\nString g1 = \"Strike with bang\";\nString[] words = g1.split(\"\\\\s\");//regular expression\nfor (String m:words){\n\tSystem.out.println(m);\n}\n\tfor(String m1:g1.split(\"\\\\s\", 2)){\n\t\tSystem.out.println(m1);\n\t}\n\t\n//indexof\n\tString sw1=\"this is index of example\"; \n\t//passing substring \n\tint index1=sw1.indexOf(\"dex o\");//returns the index of is substring \n\tint index2=sw1.indexOf(\"index\");//returns the index of index substring \n\tSystem.out.println(index1+\" \"+index2);//2 8 \n\t \n\t//passing substring with from index \n\tint index3=sw1.indexOf(\"is\",4);//returns the index of is substring after 4th index \n\tSystem.out.println(index3);//5 i.e. the index of another is \n\t \n\t//passing char value \n\tint index4=sw1.indexOf('x');//returns the index of s char value \n\tSystem.out.println(index4);//3 \n//To lower case\n\tString sf1=\"JAVATPOINT HELLO stRIng\"; \n\tString s1lower=sf1.toLowerCase(); \n\tSystem.out.println(s1lower); \n//To upper case\n\tString sf2 =\"john cenA\";\n\tSystem.out.println(sf2.toUpperCase());\n\t}", "public String applyAbbreviations(String s) {\n\t\tString result = s;\n\t\t\n\t\tfor (Entry<String, String> entry : abbreviations.entrySet()) {\n\t\t\tresult = result.replace(entry.getKey(), entry.getValue());\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public static String textFormat(String s){\r\n s =s.toLowerCase();\r\n s = s.substring(0, 1).toUpperCase() + s.substring(1);\r\n return(s);\r\n }", "public static StringSplit newSplit(int start, WordCase wordCase) {\n return new StringSplit(start, END_OF_LINE, wordCase, false);\n }", "String getReplaced();", "public static String process(String input) {\n StringTokenizer st = new StringTokenizer(input, DELIM);\n StringBuilder result = new StringBuilder();\n String space = \" \";\n\n while (st.hasMoreTokens()) {\n String tok = st.nextToken();\n Pattern p = Pattern.compile(SPLIT_REGEX);\n Matcher m = p.matcher(tok);\n boolean found = m.find();\n while (found) {\n String subStringFound = m.group();\n if (1 < subStringFound.length()) {\n result.append(subStringFound + space);\n }\n found = m.find();\n }\n }\n return result.toString();\n }", "public static String toCamelCase(String s, String regexp, boolean startLower) {\n StringBuilder b = new StringBuilder(s.length());\n Matcher m = Pattern.compile(regexp).matcher(s);\n int end = 0;\n while (m.find()) {\n int start = m.start();\n if (start > end) {\n int i;\n if (startLower && b.length() == 0)\n i = end;\n else {\n i = end + 1;\n b.append(Character.toUpperCase(s.charAt(end)));\n }\n while (i < start)\n b.append(Character.toLowerCase(s.charAt(i++)));\n }\n end = m.end();\n }\n return b.toString();\n }", "static void separarString(String s){\n\t\tString[] palabras = s.split(\"[ ]\");\n\t\tfor(int i = 0; i < palabras.length; i++){\n\t\t\tpalabras[i] = limpia(palabras[i]);\n\t\t\tSystem.out.println(palabras[i]);\n\t\t}\n\t}", "public static String underscoreToCamelCase(final String undescoredString) {\r\n\r\n // Split the string for each underscore\r\n final String[] parts = undescoredString.split(\"_\");\r\n final StringBuilder camelCaseString = new StringBuilder(undescoredString.length());\r\n camelCaseString.append(parts[0].toLowerCase(Locale.getDefault()));\r\n\r\n // Skip the first part already added\r\n for (int i = 1; i < parts.length; i++) {\r\n // First letter to upper case\r\n camelCaseString.append(parts[i].substring(0, 1).toUpperCase(Locale.getDefault()));\r\n // Others to lower case\r\n camelCaseString.append(parts[i].substring(1).toLowerCase(Locale.getDefault()));\r\n }\r\n return camelCaseString.toString();\r\n\r\n }", "public static String separateAndCapitalizeWords(String aInString, String aInSeparator) {\n String[] lChars = aInString.split(\"\");\n StringBuilder lStringBuilder = new StringBuilder();\n for (String lChar : lChars) {\n if (lChar.toUpperCase().equals(lChar))\n lStringBuilder.append(aInSeparator).append(lChar);\n else\n lStringBuilder.append(lChar);\n }\n return lStringBuilder.toString().toUpperCase();\n }", "private static ArrayIterator<String> splitString(String base, String delimiter) {\r\n\t\tString[] substrings = base.split(delimiter);\r\n\t\treturn ArrayIterator.create(substrings);\r\n\t}", "private static String qualifiedName2FirstCharacterUppercasedString(final String s) {\n final StringBuffer result = new StringBuffer();\n final Matcher m = Pattern.compile(\"(?:\\\\.|^)(.)\").matcher(s);\n while (m.find()) {\n m.appendReplacement(result,\n m.group(1).toUpperCase());\n }\n m.appendTail(result);\n return result.toString().replaceAll(\"\\\\[\\\\]\", \"Array\");\n }", "public static String stuff(String mString, int nStartReplacement, int nCharactersReplaced, String cReplacement){\n\t\tString pre = StringUtils.substring(mString, 0, nStartReplacement);\n\t\tString suf = StringUtils.substring(mString, nStartReplacement + nCharactersReplaced, mString.length());\n\n\t\treturn pre.concat(cReplacement).concat(suf);\n\t}", "private static String zzty(String string2) {\n StringBuffer stringBuffer = new StringBuffer();\n int n = 0;\n while (n < string2.length()) {\n char c = string2.charAt(n);\n if (n == 0) {\n stringBuffer.append(Character.toLowerCase(c));\n } else if (Character.isUpperCase(c)) {\n stringBuffer.append('_').append(Character.toLowerCase(c));\n } else {\n stringBuffer.append(c);\n }\n ++n;\n }\n return stringBuffer.toString();\n }", "private static @NotNull List<String> parse(@Nullable String s) {\n if (s == null) {\n return Collections.emptyList();\n }\n final Pattern COMPONENT_RE = Pattern.compile(\"\\\\d+|[a-z]+|\\\\.|-|.+\");\n final List<String> results = new ArrayList<>();\n final Matcher matcher = COMPONENT_RE.matcher(s);\n while (matcher.find()) {\n final String component = replace(matcher.group());\n if (component == null) {\n continue;\n }\n results.add(component);\n }\n for (int i = results.size() - 1; i > 0; i--) {\n if (\"00000000\".equals(results.get(i))) {\n results.remove(i);\n }\n else {\n break;\n }\n }\n results.add(\"*final\");\n return results;\n }", "private String removeFalseEndOfSentence(String s) {\n // Don't split at e.g. \"U. S. A.\":\n s = abbrev1.matcher(s).replaceAll(\"$1\");\n // Don't split at e.g. \"U.S.A.\": \n s = abbrev2.matcher(s).replaceAll(\"$1\");\n // Don't split after a white-space followed by a single letter followed\n // by a dot followed by another whitespace.\n // e.g. \" p. \"\n s = abbrev3.matcher(s).replaceAll(\"$1$2\");\n // Don't split at \"bla bla... yada yada\" \n s = abbrev4.matcher(s).replaceAll(\"$1$2\");\n // Don't split [.?!] when the're quoted:\n s = abbrev5.matcher(s).replaceAll(\"$1\");\n\n // Don't split at abbreviations, treat them case insensitive\n s = ABREVLIST_PATTERN.matcher(s).replaceAll(\"$1\");\n\n //a special list of abbrevs used at the end of sentence\n s = ENDABREVLIST_PATTERN.matcher(s).replaceAll(\"$1$3\");\n \n // Don't break after quote unless there's a capital letter:\n // e.g.: \"That's right!\" he said.\n s = abbrev6.matcher(s).replaceAll(\"$1$2\");\n\n // fixme? not sure where this should occur, leaving it commented out:\n // don't break: text . . some more text.\n // text=~s/(\\s\\.\\s)$EOS(\\s*)/$1$2/sg;\n\n // e.g. \"Das ist . so.\" -> assume one sentence\n s = abbrev7.matcher(s).replaceAll(\"$1\");\n\n // e.g. \"Das ist . so.\" -> assume one sentence\n s = abbrev8.matcher(s).replaceAll(\"$1\");\n \n s = ELLIPSIS.matcher(s).replaceAll(\"$1$3\");\n \n s = s.replaceAll(\"(\\\\d+\\\\.) \" + EOS + \"([\\\\p{L}&&[^\\\\p{Lu}]]+)\", \"$1 $2\");\n\n // z.B. \"Das hier ist ein(!) Satz.\"\n s = s.replaceAll(\"\\\\(([!?]+)\\\\) \" + EOS, \"($1) \");\n return s;\n }", "public static StringSplit newSplit(int start, int end) {\n return new StringSplit(start, end, WordCase.NO_CASE, false);\n }", "public static String camel(String s) {\n if (s == null) {\n return null;\n }\n final var result = new char[s.length()];\n int dst = 0;\n var capIt = true;\n for (int src = 0; src < s.length(); src++) {\n if (s.charAt(src) == '_') {\n capIt = true;\n } else {\n if (capIt) {\n capIt = false;\n result[dst++] = Character.toUpperCase(s.charAt(src));\n } else {\n result[dst++] = Character.toLowerCase(s.charAt(src));\n }\n }\n }\n return new String(result, 0, dst);\n }", "private Set<String> replacementHelper(String word) {\n\t\tSet<String> replacementWords = new HashSet<String>();\n\t\tfor (char letter : LETTERS) {\n\t\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\t\treplacementWords.add(word.substring(0, i) + letter + word.substring(i + 1));\n\t\t\t}\n\t\t}\n\t\treturn replacementWords;\n\t}", "public String replace(String input);", "private String imported(String string) {\n string = IMPORT.matcher(string).replaceAll(\"\");\n string = DOT.matcher(string).replaceAll(\"/\");\n string = SEMICOLON.matcher(string).replaceAll(\"\");\n string = \"/\" + string.trim() + \".java\";\n return string;\n }", "public StringWrapper[] split(DocText docText, BreakStrategy breakStrategy) {\n final String string = docText.getString();\n final String[] pieces = string.split(pattern);\n\n final List<StringWrapper> result = new ArrayList<StringWrapper>();\n\n for (int i = 0; i < pieces.length; ++i) {\n if (!\"\".equals(pieces[i])) {\n result.add(new StringWrapper(pieces[i], breakStrategy));\n }\n }\n\n return result.toArray(new StringWrapper[result.size()]);\n }", "public static void main(String args[]){\n \"abc\".chars().forEach(System.out::println);\n\n\n //breaks a String into sub-strings according to specified RegEx:\n Stream<String> stream =\n Pattern.compile(\", \").splitAsStream(\"a, b, c\");\n\n stream.forEach(System.out::println);\n\n }", "public interface ParentStringService {\n String MakeLower(String in);\n}", "public List<String> sentenceSplit(String input)\n {\n return InputNormalizer.sentenceSplit(this.sentenceSplitters, input);\n }", "private static String extractCustomMultipleDelimiters(String delimiter) {\n\t\tdelimiter = delimiter.substring(1, delimiter.length() - 1);\n\t\tdelimiter = delimiter.replace(\"][\", \"|\");\n\t\treturn delimiter;\n\t}", "public static final String javaName(String s, int firstCase, int otherCase,\n\t\t\t\t boolean elideDash, boolean elideDot) {\n String n = \"\";\n int nxcase = firstCase;\n for (int i = 0; i < s.length(); ++i) {\n char c = s.charAt(i);\n if (elideDash && c == '-') \t\t{ nxcase = 1; continue; }\n else if (elideDot && c == '.') \t\t{ nxcase = 1; continue; }\n else if (!Character.isLetterOrDigit(c)) \tn += '_';\n else if (nxcase < 0) \t\t\tn += Character.toLowerCase(c);\n else if (nxcase > 0) \t\t\tn += Character.toUpperCase(c);\n else \t\t\t\t\tn += c;\n nxcase = otherCase;\n }\n return n;\n }", "public static String[] split(String toSplit, char spliter){\n String[] endStringArray = new String[4];\n StringBuilder st = new StringBuilder();\n int i = 0;\n for (int j = 0; j < toSplit.length(); j++){\n if (toSplit.charAt(j) != spliter){\n st.append(toSplit.charAt(j));\n }\n else{\n endStringArray[i] = st.toString();\n st = new StringBuilder();\n i++;\n }\n }\n endStringArray[i] = st.toString();\n int size = 0;\n for (String s : endStringArray){\n if (s != null)\n size++;\n }\n String[] reducedArray = new String[size];\n System.arraycopy(endStringArray, 0, reducedArray, 0, size);\n return reducedArray;\n }", "public String[] splitBySplitter(String s) {\r\n\t\tString[] returnArray = new String[4];\r\n\t\treturnArray = s.split(\"-\");\r\n\t\treturn returnArray;\r\n\t}", "public static String dashesToCamelCase(CharSequence s) {\n return delimitedToCamelCase(s, '-');\n }", "public static void replaceAll0(){\n System.out.println(\">>>>>>>>>>>>\");\n String class0 = \"this is an example\";\n String ret0 = class0.replaceAll(\"is\", \"IS\");\n assert(ret0.equals(\"thIS IS an example\"));\n System.out.println(ret0);\n }", "public static void main(String[] args) {\n\t\tString str = \"They is students.\";\n\t\tint i=0;\n\t\tfor(;i<str.length();i++){\n\t\t\tif(str.charAt(i)=='i')\n\t\t\t\tif(str.charAt(i+1)=='s'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\tStringBuffer sb = new StringBuffer(str);\n\t\tsb.replace(i, i+2, \"are\");\n\t\tSystem.out.println(sb);\n\t}", "public static String wordsReplace(String objString, String regex, String replace) {\n\t\tPattern pat = Pattern.compile(regex);\n\t\tMatcher match = pat.matcher(string);\n\t\treturn string = match.replaceAll(replace);\n\t}", "@Test\n public void testPatter(){\n String str = \"select * from t_user where deletea dropa\";\n str = str.toUpperCase();\n // String re = \"(update|delete|insert|drop|alter)\";\n // String re = \"(update\\\\b)|(delete\\\\b)|(insert)|(drop)|(alter)\";\n // String re = \"\\\\b[(update)|(delete)|(insert)|(drop)|(alter)\\\\b\";\n // System.out.println(str.indexOf(\"updatea\"));\n // System.out.println(\"update\".matches(str));\n // System.out.println(str.matches(re));\n /* System.out.println(re.matches(str));\n String[] ss = str.split(re);\n System.out.println(ss.length);\n for(String s: ss){\n System.out.println(s);\n }*/\n\n String re =\"(\\\\bupdate\\\\b)|(\\\\bdelete\\\\b)|(\\\\binsert\\\\b)|(\\\\bdrop\\\\b)|(\\\\balter\\\\b)\";\n Pattern p = Pattern.compile(re,Pattern.CASE_INSENSITIVE );\n Matcher m = p.matcher(str);\n System.out.println(m.find());\n\n }", "public static List<Pair<Integer,String>> getIndexedCamelCaseWords(String content) {\n List<Pair<Integer,String>> camelCaseList = new ArrayList<>();\n// for (String word : content.split(\" \")) {\n// if(word.matches(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\")){\n// camelCaseList.add(word);\n// }\n// }\n Pattern regex = Pattern.compile(\"[aA-zZ]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\");\n Matcher regexMatcher = regex.matcher(content);\n while (regexMatcher.find()) {\n if(regexMatcher.group().length()<=40){\n camelCaseList.add(new Pair<>(regexMatcher.start(), regexMatcher.group()));\n }\n }\n return camelCaseList;\n }", "public static String toSentenceCase(String s) {\n if (s != null && !s.isEmpty()) {\n int length = s.length();\n String temp = \"\";\n int position = 0;\n for (int i = 0; i < length; i++) {\n if (s.charAt(i) == '.') {\n temp = temp.concat(s.substring(position, position + 1).toUpperCase() + s.substring(position + 1, i + 1));\n position = i + 1;\n }\n }\n if (position < length)\n temp = temp.concat(s.substring(position, position + 1).toUpperCase() + (position >= length - 1 ? \"\" : s.substring(position + 1)));\n return temp;\n } else\n return \"\";\n }", "@org.junit.Test\n\tpublic void testingStringChangeCase() {\n\t\tString result=object.replaceLowerUpperCase(\"Game of Thrones\");\n\t\tassertEquals(\"gAME OF tHRONES\",result );\n\t}", "public static String splitTagContents(String source, String tagName, String splitRegex) {\n\t\tString regexBody = String.format(\"<(?<tagDefinition>%s[^<>]*)>[^<>]+((?<delimiter>%s)[^<>]+)+</%1$s>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttagName, splitRegex);\n\t\tregexBody = Strings.getValidPatternOrFailAnyMatch(regexBody);\n\t\tif (!source.matches(String.format(\".*%s.*\",regexBody))) return source;\n\t\tString result = source;\n\t\tMatcher matcher = Pattern.compile(String.format(\"(?<tagToSplit>%s)\",regexBody)).matcher(source);\n\t\twhile (matcher.find()) {\n\t\t\tString sourceTag = matcher.group(\"tagToSplit\");\n\t\t\tString sourceTagDefinition = matcher.group(\"tagDefinition\");\n\t\t\tString splitDelimiter = matcher.group(\"delimiter\");\n\t\t\tString taggedDelimiter = String.format(\"</%s>%s<%s>\", tagName, splitDelimiter, sourceTagDefinition);\n\t\t\tresult = result.replace(sourceTag, sourceTag.replaceAll(splitDelimiter, taggedDelimiter));\n\t\t}\n\t\treturn result;\n\t}", "private static void encodeStringForAuditFieldReplaceString(StringBuilder sb, String oldString, String newString) {\n\n\t\tint index = sb.indexOf(oldString);\n\t\twhile (index >= 0) {\n\t\t\tsb.delete(index, index + oldString.length());\n\t\t\tsb.insert(index, newString);\n\t\t\tindex = sb.indexOf(oldString, index + newString.length());\n\t\t}\n\n\t}", "private static void processTurn(String content) {\n\t\tString[] sts = content.split(\" \");\n\n\t\tcards[5] = new Card();\n\t\tcards[5].setColor(sts[0]);\n\t\tcards[5].setPoint(sts[1]);\n\t\t\n\t\tCard.numsPlus();\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 }", "abstract List<String> splitStringToCollection(String inputString, String separator);", "default HtmlFormatter replace(Pattern pattern, String replacement) {\n return andThen(s -> pattern.matcher(s).replaceAll(replacement));\n }", "public static void main(String[] args) {\n String s = \"applepenapple\";\n List<String> wordDict = new ArrayList<>();\n wordDict.add(\"apple\");\n wordDict.add(\"pen\");\n// String s = \"catsandog\";\n// List<String> wordDict = new ArrayList<>();\n// wordDict.add(\"cats\");\n// wordDict.add(\"dog\");\n// wordDict.add(\"sand\");\n// wordDict.add(\"cat\");\n\n System.out.println(wordBreak2(s, wordDict));\n }", "private String replaceAll(Matcher matcher, String input, String replacement) {\n // Process substitution string to replace group references with groups\n int cursor = 0;\n StringBuilder result = new StringBuilder();\n\n while (cursor < replacement.length()) {\n char nextChar = replacement.charAt(cursor);\n if (nextChar == '\\\\') {\n cursor++;\n nextChar = replacement.charAt(cursor);\n result.append(nextChar);\n cursor++;\n } else if (nextChar == '$') {\n // Skip past $\n cursor++;\n // The first number is always a group\n int refNum = (int)replacement.charAt(cursor) - '0';\n if ((refNum < 0)||(refNum > 9))\n throw new IllegalArgumentException(\n \"Illegal group reference\");\n cursor++;\n\n // Capture the largest legal group string\n boolean done = false;\n while (!done) {\n if (cursor >= replacement.length()) {\n break;\n }\n int nextDigit = replacement.charAt(cursor) - '0';\n if ((nextDigit < 0)||(nextDigit > 9)) { // not a number\n break;\n }\n int newRefNum = (refNum * 10) + nextDigit;\n if (matcher.groupCount() < newRefNum) {\n done = true;\n } else {\n refNum = newRefNum;\n cursor++;\n }\n }\n // Append group\n if (matcher.group(refNum) != null)\n result.append(matcher.group(refNum));\n } else {\n result.append(nextChar);\n cursor++;\n }\n }\n\n return matcher.replaceAll(result.toString());\n }", "private String preprocessName(String original){\n\t\t// Remove non-alphabetical characters from the name\n\t\toriginal = original.replaceAll( \"[^A-Za-z]\", \"\" );\n\t\t\t\t\n\t\t// Convert to uppercase to help us ignore case-sensitivity\n\t\toriginal = original.toUpperCase();\n\t\t\n\t\t// Remove all occurences of the letters outlined in step 3\n\t\toriginal = original.substring(0,1) + original.substring(1).replaceAll(\"[AEIHOUWY]\",\"\");\n\t\t\n\t\t// Return the result\n\t\treturn original;\n\t}", "public static void main(String[] args) { String s = \"catsanddog\";\n// List<String> wordDict = new ArrayList<>(Arrays.asList(\"cat\", \"cats\", \"and\", \"sand\", \"dog\"));\n//\n String s = \"pineapplepenappl\";\n List<String> wordDict = new ArrayList<>(Arrays.asList(\"apple\", \"pen\", \"applepen\", \"pine\", \"pineapple\"));\n\n WordBreak140 tmp = new WordBreak140();\n tmp.wordBreak(s, wordDict);\n }", "public static StringSplit newSplit(int start, int end, WordCase wordCase, boolean trimmed) {\n return new StringSplit(start, end, wordCase, trimmed);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString str = \"I am very ouch happy about you\";\r\n\t\t//str.\r\n\t\t\r\n\t\tString x = str.replace(\"ou\", \"XY\");\r\n\t\tSystem.out.println(\"x::\"+x);\r\n\t\t\r\n\t\t//Without using replace method -- in progress\r\n\t\tString[] arr = str.split(\"ou\");\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"size of array::\"+arr.length);\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\t\r\n\t\t\r\n\t\tfor(int i = 0; i<arr.length; i++) {\r\n\t\t\tSystem.out.println(arr[i]);\r\n\t\t\tsb.append(arr[i]).append(\"XY\");\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Final:::\"+sb.toString());\r\n\t\t/*StringBuffer sb = new StringBuffer();\r\n\t\tfor(int i = 0; i<str.length(); i++) {\r\n\t\t\tif(\"ABC\".equals(str.substring(i, i+3))) {\r\n\t\t\t\tsb.append(\"XY\");\r\n\t\t\t\ti = i+3;\r\n\t\t\t}\r\n\t\t}*/\r\n\t}", "private static String toStartCase(String words) {\n String[] tokens = words.split(\"\\\\s+\");\n StringBuilder builder = new StringBuilder();\n for (String token : tokens) {\n builder.append(capitaliseSingleWord(token)).append(\" \");\n }\n return builder.toString().stripTrailing();\n }", "@Override\n\tpublic void replaceWord(String s) {\n\t\tfinder.replace(s);\n\t}", "public static StringSplit newSplit(int start) {\n return new StringSplit(start, END_OF_LINE, WordCase.NO_CASE, false);\n }", "@Test\n\tpublic void revStrSentances() {\n\n\t\tString s = \"i like this program very much\";\n\t\tString[] words = s.split(\" \");\n\t\tString revStr = \"\";\n\t\tfor (int i = words.length - 1; i >= 0; i--) {\n\t\t\trevStr += words[i] + \" \";\n\n\t\t}\n\n\t\tSystem.out.println(revStr);\n\n\t}", "public String prefix(String s) {\n\t\tString tmp = methodBase();\n\t\treturn s+tmp.substring(0,1).toUpperCase()+tmp.substring(1);\n\t}", "public static void main (String[] args){\n\n System.out.println(\"Input a sentence\");\n Scanner sc = new Scanner(System.in);\n\n\n //2. Make the scanner read the input.scanner.nextLine()\n\n String input = sc.nextLine();\n\n //3. input.replaceAll(\"a\",\"A\");\n\n String output = input.replaceAll(\"a\",\"A\");\n\n\n //4. print the modified string.\n\n System.out.println(\"The code made the lowercase 'a' to uppercase\");\n System.out.println(output);\n\n }", "public static String translateSentence(String sentence) {\n\n Matcher matcher = Pattern.compile(\"\\\\w+\").matcher(sentence);\n return matcher.replaceAll(match -> translateWord(match.group()));\n }", "public StringArraySplitterBuilder addStringSplit(int start, int end, WordCase wordCase) {\n splitter.addSplit(StringSplit.newSplit(start, end, wordCase));\n return this;\n }", "@Test\n public void testUnCapitalize1() {\n Object target = \"ABC\";\n String expResult = \"aBC\";\n String result = StringUtils.unCapitalize(target);\n Assertions.assertEquals(expResult, result);\n }", "public static String recaseMWE(String s) {\n return recase.get(s.toLowerCase());\n }", "public static String capitalizeWordsFirstLetter(String aInString, String aInSeparator) {\n String[] lWords = aInString.split(aInSeparator);\n StringBuilder lStringBuilder = new StringBuilder();\n int lWordsCount = 0;\n for (String lWord : lWords) {\n if (++lWordsCount == 1) {\n lStringBuilder.append(lWord.toLowerCase());\n } else {\n if (lWord.length() > 0)\n lStringBuilder.append(lWord.substring(0, 1).toUpperCase()).append(lWord.substring(1).toLowerCase());\n }\n }\n return lStringBuilder.toString();\n }", "static ArrayList<String> split_words(String s){\n ArrayList<String> words = new ArrayList<>();\n\n Pattern p = Pattern.compile(\"\\\\w+\");\n Matcher match = p.matcher(s);\n while (match.find()) {\n words.add(match.group());\n }\n return words;\n }", "java.lang.String getNewSentence();", "@Test\n public void testReplacingSuccess()\n {\n String expectedValue=\"fatly fry\",actualValue;\n actualValue=replaceingchar.replaceChar(inputString);\n assertEquals(expectedValue,actualValue);\n }", "public static String transform(final String aString) {\n String result = aString;\n result = WHITESPACE.matcher(aString).replaceAll(\"$1\");\n result = unescapeHtml4(result);\n result = transliterator.transliterate(result);\n// result = HYPHEN.matcher(result).replaceAll(\"-\");\n result = result.trim();\n return result;\n }", "public String capitalCaseToSnakeCase(String text) {\n String textArray[] = text.split(\"(?=\\\\p{Upper})\");\n String capitalcaseToSnakeCase = \"\";\n for (String word: textArray) {\n if(!word.equals(\"\"))\n capitalcaseToSnakeCase += \"_\" + word.toLowerCase();\n }\n capitalcaseToSnakeCase = \"categorias\" + capitalcaseToSnakeCase;\n return capitalcaseToSnakeCase;\n }", "protected abstract String[] tokenizeImpl(String text);", "private String derivePrefixFromClassName(String className) {\n int prefixIdx = 0;\n int lastUpperIndex = 0;\n char[] prefix = new char[PREFIX_LENGTH];\n char[] src = className.toCharArray();\n\n prefix[prefixIdx++] = Character.toLowerCase(src[0]);\n\n for (int i = 1; i < src.length; i++) {\n char c = src[i];\n if (Character.isUpperCase(c)) {\n prefix[prefixIdx++] = Character.toLowerCase(c);\n if (prefixIdx == PREFIX_LENGTH) {\n return new String(prefix);\n }\n lastUpperIndex = i;\n }\n }\n\n while (prefixIdx < PREFIX_LENGTH) {\n prefix[prefixIdx++] = Character.toLowerCase(src[++lastUpperIndex]);\n }\n\n return new String(prefix);\n }", "private void Trans(String s) {\n }", "public String parseStringMsg(String msg, String... replacements){\n String parsedMsg = msg;\n //Make second mthd w/o second param\n //replacements is like Variable:Replacement i.e. PLAYERTRADESENTTO:playerReceiver.getName()\n for(String s : replacements){\n String[] replace = s.split(\":\");\n if(msg.contains(replace[0])){\n parsedMsg = msg.replace(replace[0], replace[1]);\n }\n }\n parsedMsg = ChatColor.translateAlternateColorCodes('&', parsedMsg);\n\n return parsedMsg;\n }" ]
[ "0.6464311", "0.6332634", "0.61056125", "0.5949995", "0.5846709", "0.5819106", "0.5665756", "0.560157", "0.5539888", "0.5405675", "0.5342492", "0.5276182", "0.52368367", "0.52094054", "0.51906765", "0.5180283", "0.5176807", "0.5147173", "0.51232207", "0.5039645", "0.50230634", "0.5012247", "0.4987034", "0.49766165", "0.49463072", "0.49382907", "0.4934691", "0.49297988", "0.4907357", "0.49067792", "0.48997864", "0.48927748", "0.48839614", "0.48617852", "0.48473582", "0.4842628", "0.48420516", "0.48388034", "0.48292857", "0.48193133", "0.48007196", "0.47980645", "0.47845215", "0.47805426", "0.4769694", "0.4768615", "0.47530407", "0.47507146", "0.4728819", "0.47250775", "0.47241968", "0.47094977", "0.4708359", "0.46921873", "0.46902505", "0.46637794", "0.46609554", "0.4654526", "0.46454257", "0.46369416", "0.46343815", "0.46146452", "0.46023512", "0.46014008", "0.45930007", "0.45913392", "0.45853242", "0.4585192", "0.4573905", "0.4561653", "0.45543122", "0.45506367", "0.45503855", "0.45469853", "0.45459464", "0.45409802", "0.45335382", "0.4532357", "0.4531904", "0.4523302", "0.45216998", "0.4520946", "0.45159227", "0.45023215", "0.45012912", "0.4501093", "0.44997874", "0.4499017", "0.44951877", "0.44934726", "0.44926143", "0.44878843", "0.44712493", "0.44689184", "0.44588915", "0.44539228", "0.4452424", "0.4451259", "0.44498888", "0.444685" ]
0.7052626
0
Removes all line break characters from a supplied string
public static String removeLineBreaks(String string) { String[] lines = string.split("\r\n|\r|\n"); String oneLiner = ""; for (String line : lines) { oneLiner += line; } return oneLiner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String removeLineBreak(String text){\n\t\ttext = text.replace(\"\\n\", \"\").replace(\"\\r\", \"\");\n\t\treturn text;\n\t}", "private String trimStringNewline(String text) {\n while (text.endsWith(\"\\n\")) {\n text = text.substring(0, text.length() - 1);\n }\n \n return text;\n }", "static void trimNL(String s) {\n StringBuilder sb = new StringBuilder(s);\n while(sb.length() > 0 && (sb.charAt(sb.length() - 1) == '\\u005cr' || sb.charAt(sb.length() - 1) == '\\u005cn'))\n sb.deleteCharAt(sb.length() - 1);\n }", "private static String removeNewline(String content) {\n if (StringUtil.isNotEmpty(content)) {\n content = content.replaceAll(StringConstants.LF, EMPTY);\n content = content.replace(StringConstants.CR, EMPTY);\n return content;\n }\n return content;\n }", "public static String convertLineBreak(String input) {\n return input.replace(\"\\r\\n\", \"\\n\").replace('\\r', '\\n').replaceAll(\"[\\000-\\010\\013\\014\\016-\\037]\", \" \");\n }", "public static String convertString(String string) {\n return string.replaceAll(\"\\n\", \"<br>\");\n }", "public static String removeQuebraLinha (String s) {\n\n\t\tif (StringUtils.isNotBlank(s)) {\n\n\t\t\ts = s.replaceAll(\"\\r\", \"\"); \n\t\t\ts = s.replaceAll(\"\\t\", \"\");\n\t\t\ts = s.replaceAll(\"\\n\", \"\");\n\t\t}\n\n\t\treturn s;\n\t}", "public static String cleanText(String text)\r\n\t{\r\n\t\ttext = text.replace(\"\\n\", \"\\\\n\");\r\n\t\ttext = text.replace(\"\\t\", \"\\\\t\");\r\n\r\n\t\treturn text;\r\n\t}", "public static String replaceInverseBreakLine(String text) {\n\t\treturn text != null ? replace(text, \"<br/>\", \"\\n\") : null;\n\t}", "public static String trimEndsOfLines(String s) {\n\t\tif (s == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn s.replaceAll(\"\\\\s+\\r?\\n\", \"\\n\");\n\t\t}\n\t}", "public static String trimLines(String multilineString) {\n if (StringUtils.isNullOrWhitespaceOnly(multilineString)) {\n return \"\";\n }\n\n return Arrays.stream(multilineString.split(UNIVERSAL_NEW_LINE_REGEXP))\n .map(String::trim)\n .collect(Collectors.joining(System.lineSeparator()));\n }", "public static String trimLines(String s) {\n\t\tif (s == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn s.replaceAll(\"[ \\t]*\\r?\\n[ \\t]*\", \"\\n\").trim();\n\t\t}\n\t}", "public static String stripWhiteSpace(String str) {\n if (str != null) {\n StringBuffer stringBuffer = new StringBuffer(str.length());\n for (int i = 0, strLen = str.length(); i < strLen; i++) {\n final char ch = str.charAt(i);\n if (ch != ' ' && ch != '\\r' && ch != '\\n' && ch != '\\t') {\n stringBuffer.append(ch);\n }\n }\n return stringBuffer.toString();\n }\n return str;\n }", "public static String removeWhitespace(String s) {\n s = s.replace(\" \",\"\");\n s = s.replace(\"\\n\",\"\");\n s = s.replace(\"\\t\",\"\");\n return s;\n }", "private static String normalizeLineEndings(String input) {\n return NON_UNIX_LINE_ENDING.matcher(input).replaceAll(\"\\n\");\n }", "public static String replaceBreakLines(String text) {\n\t\treturn text != null ? replace(text, \"\\n\", \"<br/>\") : null;\n\t}", "private static String cleanTextContent(String text) {\n text = text.replaceAll(\"[^\\\\x00-\\\\x7F]\", \"\");\n\n // erases all the ASCII control characters\n text = text.replaceAll(\"[\\\\p{Cntrl}&&[^\\r\\n\\t]]\", \"\");\n\n // removes non-printable characters from Unicode\n text = text.replaceAll(\"\\\\p{C}\", \"\");\n \n text = text.replaceAll(\"[\\\\r\\\\n]+\", \" \");\n\n return text.trim();\n }", "@Test\n\tpublic void removeWhiteSpaceFromNewLine() {\n\t\tString input = \"two tousand sixteen \"\n\t\t\t\t+ \"new \" + \"lines!\" + \"\\n\" + \" \" + \"\\n\";\n\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\t\tactualCastedString = stringUtility.removeWhiteSpace(actualCastedString);\n\n\t\tString correctlyCastedString = \"2tousandsixteennewlines!\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}", "public static String cleanString(String s) {\n\t\ts = s.trim();\n\t\tString newStr = \"\";\n\t\tboolean lastWasSpace = false;\n\t\tfor(int i = 0; i < s.length(); i++) {\n\t\t\tchar c = s.charAt(i);\n\t\t\tif(c == ' ' && lastWasSpace) {\n\t\t\t\t//Ignore\n\t\t\t} else if (c == ' ' && !lastWasSpace) {\n\t\t\t\tnewStr+=c;\n\t\t\t\tlastWasSpace = true;\n\t\t\t} else {\n\t\t\t\tnewStr+=c;\n\t\t\t\tlastWasSpace = false;\n\t\t\t}\n\t\t}\n\t\ts = newStr;\n\t\treturn s;\n\t}", "public static String clearLongWhitespaces(String str) {\r\n\r\n if (str == null) {\r\n str = \"\";\r\n }\r\n String result = \"\";\r\n StringTokenizer st = new StringTokenizer(str);\r\n while (st.hasMoreTokens()) {\r\n String s = st.nextToken();\r\n if (s != null) {\r\n result += s.trim();\r\n }\r\n }\r\n return result.trim();\r\n }", "public static String nl2br(String text) {return text.replaceAll(\"\\n\",\"<br />\");}", "private static String removeWhitespace(String str)\n {\n // A string buffer to build the result in.\n StringBuffer res;\n\n // Create the result string buffer.\n res = new StringBuffer(str.length());\n\n // Iterate through the input string, appending chars to the\n // result if they are not white space.\n for (int iChar = 0; iChar < str.length(); iChar++) {\n if (!Character.isWhitespace(str.charAt(iChar))) {\n res.append(str.charAt(iChar));\n }\n }\n\n return res.toString();\n }", "private static String fixPrintWriterNewLine(String decodedString) {\n StringBuilder fixedString = new StringBuilder();\n for(int i = 0; i < decodedString.length(); i++) {\n\n if(decodedString.charAt(i) == '\\n' ) {\n fixedString.append(\"\\r\\n\");\n }\n else {\n fixedString.append(decodedString.charAt(i));\n }\n }\n return fixedString.toString();\n }", "private String cleanString(String data){\n Pattern ptn = Pattern.compile(\"//.*\");\n Matcher mc = ptn.matcher(data);\n while(mc.find())data = data.replace(mc.group(),\"\");\n ptn = Pattern.compile(\"/\\\\*(.|\\n)*?\\\\*/\");\n mc = ptn.matcher(data);\n while(mc.find()) data = data.replace(mc.group(),\"\");\n return data.trim();\n }", "public static String ungroupify(String text){\r\n return text.replaceAll(\"[\\\\sx]\", \"\");\r\n}", "public static String removeSpecialCharacters(String string) {\n return Normalizer.normalize(string, Normalizer.Form.NFD).replaceAll(\"[^\\\\p{ASCII}]\", \"\");\n }", "public static String cutSpaces(String s){\n\t\tString res = s;\n\t\t\n\t\twhile ((res.startsWith(\" \")||(res.startsWith(\"\\n\")))&& res.length()>0) {\n\t\t\tres=res.substring(1);\n\t\t}\n\t\treturn res;\n\t}", "static void trimNL() {\n if(outputBuffer.length() > 0 && outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cn')\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n if(outputBuffer.length() > 0 && outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cr')\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n }", "private void normalizeNewlines(StringBuffer sb) {\n\n\t\t// State machine states\n\t\tfinal int START = 0;\n\t\tfinal int SEEN_CR = 1;\n\n\t\tint state = START;\n\t\tint i = 0;\n\t\twhile (i < sb.length()) {\n\t\t\t// No simple 'for' here, since we may delete chars\n\n\t\t\tchar c = sb.charAt(i);\n\n\t\t\tswitch (state) {\n\t\t\tcase START:\n\t\t\t\tif (c == '\\r') {\n\t\t\t\t\tstate = SEEN_CR;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\n\t\t\tcase SEEN_CR:\n\t\t\t\tif (c == '\\n') {\n\t\t\t\t\t// CR-LF, just delete the previous CR\n\t\t\t\t\tsb.deleteCharAt(i - 1);\n\t\t\t\t\tstate = START;\n\t\t\t\t\t// no need to advance i, since it's done implicitly\n\t\t\t\t} else if (c == '\\r') {\n\t\t\t\t\t// CR line ending followed by another\n\t\t\t\t\t// Replace the first with a newline...\n\t\t\t\t\tsb.setCharAt(i - 1, '\\n');\n\t\t\t\t\ti++;\n\t\t\t\t\t// ...and stay in the SEEN_CR state\n\t\t\t\t} else {\n\t\t\t\t\t// CR line ending, replace it with a newline\n\t\t\t\t\tsb.setCharAt(i - 1, '\\n');\n\t\t\t\t\ti++;\n\t\t\t\t\tstate = START;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state == SEEN_CR) {\n\t\t\t// CR line ending, replace it with a newline\n\t\t}\n\t}", "protected static String showLineSeparators(String string) {\n\tif (string == null) return null;\n\tStringBuffer buffer = new StringBuffer();\n\tint length = string.length();\n\tfor (int i = 0; i < length; i++) {\n\t\tchar car = string.charAt(i);\n\t\tswitch (car) {\n\t\t\tcase '\\n': \n\t\t\t\tbuffer.append(\"\\\\n\\n\"); //$NON-NLS-1$\n\t\t\t\tbreak;\n\t\t\tcase '\\r':\n\t\t\t\tif (i < length-1 && string.charAt(i+1) == '\\n') {\n\t\t\t\t\tbuffer.append(\"\\\\r\\\\n\\n\"); //$NON-NLS-1$\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tbuffer.append(\"\\\\r\\n\"); //$NON-NLS-1$\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbuffer.append(car);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn buffer.toString();\n}", "public static String removeWhiteSpace(String input) {\r\n if (input == null || input.isEmpty()) {\r\n return \"\";\r\n }\r\n StringBuilder sb = new StringBuilder();\r\n for (int i = 0; i < input.length(); i++) {\r\n char c = input.charAt(i);\r\n if (!Character.isWhitespace(c)) {\r\n sb.append(c);\r\n }\r\n }\r\n return sb.toString();\r\n }", "static String m8561a(String str) {\n return str.replaceAll(\"\\r\\n\", \"\\n\").replaceAll(\" *\\n *\", \"\\n\").replaceAll(\"\\n\", \" \").replaceAll(\"[ \\t\\\\x0B\\f\\r]+\", \" \");\n }", "public static String cleanString(String aText) {\n if ( !Utils.stringDefined(aText)) {\n return \"\";\n }\n final StringBuilder result = new StringBuilder();\n StringCharacterIterator iterator = new StringCharacterIterator(aText);\n char character = iterator.current();\n char char_slash = '\\\\';\n char char_dquote = '\"';\n\n while (character != StringCharacterIterator.DONE) {\n if (character == char_dquote) {\n //For now don't escape double quotes\n result.append(character);\n // result.append(char_slash);\n // result.append(char_dquote);\n } else if (character == char_slash) {\n result.append(char_slash);\n result.append(char_slash);\n } else if (character == '\\b') {\n result.append(\"\\\\b\");\n } else if (character == '\\f') {\n result.append(\"\\\\f\");\n } else if (character == '\\n') {\n result.append(\"\\\\n\");\n } else if (character == '\\r') {\n result.append(\"\\\\r\");\n } else if (character == '\\t') {\n result.append(\"\\\\t\");\n } else {\n //the char is not a special one\n //add it to the result as is\n result.append(character);\n }\n character = iterator.next();\n }\n\n String s = result.toString();\n\n //Make into all ascii ??\n s = s.replaceAll(\"[^\\n\\\\x20-\\\\x7E]+\", \" \");\n\n return s;\n }", "public static String trimLineSeparator(String line) {\n int n = line.length();\n if (n == 0) {\n return line;\n }\n char ch = line.charAt(n - 1);\n if (ch == '\\n' || ch == '\\r') {\n n--;\n }\n else {\n return line;\n }\n if (n > 0) {\n char ch2 = line.charAt(n - 1);\n if ((ch2 == '\\n' || ch2 == '\\r') && ch2 != ch) {\n n--;\n }\n }\n return line.substring(0, n);\n\n }", "protected static String trimWhitespace(String s) {\n int len = s.length();\n StringBuffer buf = new StringBuffer(len);\n for (int ii = 0; ii < len; ii++) {\n char c = s.charAt(ii);\n if (!Character.isWhitespace(c)) {\n buf.append(c);\n }\n }\n return buf.toString();\n }", "public static String removeReturns( String input )\n {\n StringBuffer result = new StringBuffer();\n if ( input != null )\n {\n StringTokenizer st = new StringTokenizer( input, \"\\n\" );\n while ( st.hasMoreTokens() )\n {\n result.append( st.nextToken() );\n }\n }\n return result.toString();\n }", "public static String cleanTextContent(String text) {\r\n\t\tif (null == text) {\r\n\t\t\treturn text;\r\n\t\t}\r\n\t\t// strips off all non-ASCII characters\r\n\t\ttext = text.replaceAll(\"[^\\\\x00-\\\\x7F]\", \"\");\r\n\t\t// erases all the ASCII control characters\r\n\t\ttext = text.replaceAll(\"[\\\\p{Cntrl}&&[^\\r\\n\\t]]\", \"\");\r\n\t\t// removes non-printable characters from Unicode\r\n\t\ttext = text.replaceAll(\"\\\\p{C}\", \"\");\r\n\t\treturn text.trim();\r\n\t}", "private static String clearSpaces(final String old) {\n return old.replace(\" \", \"\").replace(\"\\n\", \"\");\n }", "static String trimStart(String s) {\n StringBuilder sb = new StringBuilder(s);\n while(sb.length() > 0 && (sb.charAt(0) == '\\u005cr'\n || sb.charAt(0) == '\\u005cn'\n || sb.charAt(0) == '\\u005ct'\n || sb.charAt(0) == ' ')) {\n sb.deleteCharAt(0);\n }\n return sb.toString();\n }", "private String removeLeadingWhitespace(String input) {\n for (int index = 0; index < input.length(); index++) {\n if (!Character.isWhitespace(input.charAt(index))) {\n return input.substring(index);\n }\n }\n return input;\n }", "@Override\n\tpublic String spaceRemover(String input) {\n\t\treturn input.replaceAll(\"\\\\s+\",\"\");\n\n\t}", "public String removeComplexWhiteSpaces(@NotNull String rawText) {\n return rawText.replaceAll(\"(\\\\s)?\\n\\n(\\\\s)?\", \"\\n\").trim();\n }", "public void removeJunkOrUnwantedCharFromString() {\n\t\tString str = \"hello@#4kjk122\";\n\t\tstr = str.replaceAll(\"[^a-zA-z0-9]\", \"\");\n\t\t// if we don't put ^ in above statement it will remove a to z charac and numbers\n\t\tSystem.out.println(str);\n\t}", "public static String strip(final String string) {\n return ChatColor.stripColor(string);\n }", "public static String createBreaks(String input) {\r\n char[] chars = input.toCharArray();\r\n int len = chars.length;\r\n StringBuffer buf = new StringBuffer(len);\r\n int count = 0;\r\n int cur = 0; \r\n for (int i = 0; i < len; i++) { \r\n if (chars[i] == '\\n') {\r\n buf.append(chars, cur, i - cur).append(BR_TAG);\r\n cur = i + 1;\r\n } \r\n else if (chars[i] == '\\r' && i < len - 1 && chars[i + 1] == '\\n') {\r\n buf.append(chars, cur, i - cur).append(BR_TAG);\r\n i++;\r\n cur = i + 1;\r\n }\r\n\r\n count++;\r\n } \r\n buf.append(chars, cur, len - cur);\r\n return buf.toString();\r\n }", "private static String trimWhiteSpace(String sentence) {\n\t\tsentence = sentence.replaceAll(\"[^a-zA-Z]\", \" \");\n//\t\tsentence = sentence.replaceAll(\"\\n\", \" \");\n//\t\tsentence = sentence.replaceAll(\"\\t\", \" \");\n// sentence = sentence.replaceAll(\"\\\\.\", \" \");\n// sentence = sentence.replaceAll(\",\", \" \");\n \n//\t\tint length;\n//\t\tdo {\n//\t\t\tlength = sentence.length();\n//\t\t\tsentence = sentence.replaceAll(\" \", \" \");\n//\n//\t\t} while (sentence.length() < length);\n\t\treturn sentence;\n\t}", "public static String chomp(String str) {\n return StringUtils.chomp(str);\n }", "public static String cleanHiddenCharacters(String text)\n {\n text = text.replaceAll(\"[^\\\\x00-\\\\x7F]\", \"\");\n\n // erases all the ASCII control characters\n text = text.replaceAll(\"[\\\\p{Cntrl}&&[^\\r\\n\\t]]\", \"\");\n\n // removes non-printable characters from Unicode\n text = text.replaceAll(\"\\\\p{C}\", \"\");\n\n return text.trim();\n }", "String remEscapes(String str){\n StringBuilder retval = new StringBuilder();\n\n // remove leading/trailing \" or '\r\n int start = 1, end = str.length() - 1;\n\n if ((str.startsWith(SQ3) && str.endsWith(SQ3)) ||\n (str.startsWith(SSQ3) && str.endsWith(SSQ3))){\n // remove leading/trailing \"\"\" or '''\r\n start = 3;\n end = str.length() - 3;\n }\n\n for (int i = start; i < end; i++) {\n\n if (str.charAt(i) == '\\\\' && i+1 < str.length()){\n i += 1;\n switch (str.charAt(i)){\n\n case 'b':\n retval.append('\\b');\n continue;\n case 't':\n retval.append('\\t');\n continue;\n case 'n':\n retval.append('\\n');\n continue;\n case 'f':\n retval.append('\\f');\n continue;\n case 'r':\n retval.append('\\r');\n continue;\n case '\"':\n retval.append('\\\"');\n continue;\n case '\\'':\n retval.append('\\'');\n continue;\n case '\\\\':\n retval.append('\\\\');\n continue;\n }\n\n }\n else {\n retval.append(str.charAt(i));\n }\n }\n\n return retval.toString();\n }", "public static String removeSpaces(String str) {\n return removeRegex(str, \"[\\\\ ]\");\n }", "public static String chompTrim(String str) {\n String rtn = str;\n if (null != rtn) {\n int i = 0;\n int j = str.length() - 1;\n while (i < j) {\n char head = rtn.charAt(i);\n char tail = rtn.charAt(j);\n if (CharacterConstants.SPACE == head || CharacterConstants.LF == head\n || CharacterConstants.CR == head || CharacterConstants.TAB == head) {\n i++;\n } else {\n if (CharacterConstants.SPACE == tail || CharacterConstants.LF == tail\n || CharacterConstants.CR == tail || CharacterConstants.TAB == tail) {\n j--;\n } else {\n break;\n }\n }\n }\n rtn = rtn.substring(i, j + 1);\n }\n return rtn;\n }", "public String cleanStr(String s) {\n\t\t\n\t\tString fixed = s;\n\t\tif(s.contains(\"\\\"\")) {\n\t\t\tfixed = s.strip().split(\"\\\"\")[1];\n\t\t}\n\t\treturn fixed;\n\t}", "private static String removeChars(String input, String rmv){\n\t\t// in case checked with question asker the char possibility is ASCII\n\t\tboolean[] flags=new boolean[128];\n\t\t// using Arrays.fill to set all flase\n\t\tArrays.fill(flags, false);\n\t\t\n\t\tfor(int i=0;i<rmv.length();i++){\n\t\tflags[(int)rmv.charAt(i)]=true;\t\n\t\t}\n\t\t\n\t\t\n\t\t// here is another trick,\n\t\t// instead of arbitrially loop the array\n\t\t// use self-incremental end pointer\n\t\tint src=0,dst=0;\n\t\tint len=input.length(); \n\t\tchar[] s=input.toCharArray();\n\t\t//save the origional length now, as input array will be updated later, the length maybe changed.\n\t\twhile(src<len){\n\t\t\tif(!flags[(int)s[src]]){\n\t\t\t\ts[dst++]=s[src];\n\t\t\t}\n\t\t\tsrc++;\n\t\t}\n\t\treturn new String(s,0,dst);\n\t}", "private String getLineSeparator(String givenStr) {\n if (givenStr.indexOf(\"\\r\\n\") == -1) {\n return \"\\n\";\n } else {\n return \"\\r\\n\";\n }\n }", "public static String removeSpaces(String s) {\r\n StringTokenizer stt = new StringTokenizer(s);\r\n String res = \"\";\r\n\r\n while (stt.hasMoreTokens()) {\r\n String tok = stt.nextToken().trim();\r\n res += tok;\r\n }\r\n return res;\r\n }", "private static String trim(String s) {\n return s.replace(\" \", \"\");\n }", "public static String removeInvalidCharacteres(String string) {\n\t\tString corretString = string;\n\t\tif (containsInvalidCharacterInLogin(string)) {\n\t\t\tString regex = \"[|\\\"&*=+'@#$%\\\\/?{}?:;~<>,\\u00C0\\u00C1\\u00C2\\u00C3\\u00C4\\u00C5\\u00C6\\u00C7\\u00C8\\u00C9\\u00CA\\u00CB\\u00CC\\u00CD\\u00CE\\u00CF\\u00D0\\u00D1\\u00D2\\u00D3\\u00D4\\u00D5\\u00D6\\u00D8\\u0152\\u00DE\\u00D9\\u00DA\\u00DB\\u00DC\\u00DD\\u0178\\u00E0\\u00E1\\u00E2\\u00E3\\u00E4\\u00E5\\u00E6\\u00E7\\u00E8\\u00E9\\u00EA\\u00EB\\u00EC\\u00ED\\u00EE\\u00EF\\u00F0\\u00F1\\u00F2\\u00F3\\u00F4\\u00F5\\u00F6\\u00F8\\u0153\\u00DF\\u00FE\\u00F9\\u00FA\\u00FB\\u00FC\\u00FD\\u00FF]\";\n\t\t\tPattern p = Pattern.compile(regex);\n\t\t\tMatcher m = p.matcher(string);\n\t\t\tcorretString = m.replaceAll(\"\");\n\t\t\t//System.out.println(corretString);\n\t\t}\n\t\t\n\t\tcorretString = corretString.replace(\"\\\\\", \"\");\n\t\t\n\t\treturn corretString;\n\t}", "public String removespaces(String inputString) {\r\n char[] charArray = inputString.toCharArray();\r\n \r\n String stringWithoutSpaces = \"\";\r\n \r\n for (int i = 0; i < charArray.length; i++) \r\n {\r\n if ( (charArray[i] != ' ') && (charArray[i] != '\\t') )\r\n {\r\n stringWithoutSpaces = stringWithoutSpaces + charArray[i];\r\n }\r\n }\r\n return stringWithoutSpaces;\r\n\t}", "public static String trim(String s) {\r\n\t\treturn Escape.collapseWhitespace(Escape.forDoubleQuotedString(s, true).trim());\r\n\t}", "private String removeWhitespace(String lineToFormat) {\n StringBuilder lineWithoutWhitespace = new StringBuilder();\n StringBuilder buffer = new StringBuilder();\n boolean isString = false;\n char prevChar = '\\0';\n\n for (int i = 0; i < lineToFormat.length(); i++) {\n // check if the current char is a whitespace char\n if (AssemblyConstants.isWhitespace(lineToFormat.charAt(i))) {\n if (buffer.length() > 0) {\n // add everything from buffer in-between\n lineWithoutWhitespace.append(buffer).append(\" \");\n buffer.setLength(0);\n }\n } else {\n // add all non-whitespace chars found to the buffer\n char charToAdd = lineToFormat.charAt(i);\n // check if the char is a part of a string (check if it's not an escaped string separator as well)\n if (charToAdd == AssemblyConstants.STRING_SEPARATOR && prevChar != AssemblyConstants.ESCAPE_SEQUENCE)\n isString = !isString;\n\n // if the char is not a part of a string, make it lowercase if it's a letter\n if (!isString)\n buffer.append((charToAdd < 'A' || charToAdd > 'Z')\n ? charToAdd\n : (char) (charToAdd + 0x20));\n else\n // if the char is a part of a string, just add it as it is\n buffer.append(charToAdd);\n }\n\n prevChar = lineToFormat.charAt(i);\n }\n\n if (isString)\n throw new WrongAssemblyLineException(\"\\nWrong assembly line found:\\n\"\n + \"'\" + lineToFormat + \"' contains too many string separators\");\n\n // add the rest found in buffer\n return buffer.length() > 0\n ? lineWithoutWhitespace.append(buffer).toString().trim()\n : lineWithoutWhitespace.toString().trim();\n }", "public static String removeNonAlphabeticCharactersFrom(String text) {\n\n // replacing \\r\\n\\t for a single space\n text = text.replaceAll(\"[\\\\p{Cntrl}]\", \" \");\n\n // strips off all non-alphabetic character:[\\p{Lower}\\p{Upper}] apart from a blank\n text = text.replaceAll(\"[^\\\\p{Alpha}\\\\p{Blank}]\", \" \");\n\n // remove extra spaces\n text = text.replaceAll(\"\\\\s+\", \" \");\n\n return text.trim();\n }", "private String StringFilter(String str) {\n String regEx = \"[` !@#$%^&*()+=|《{}':;',//[//]. ̄<o╥﹏╥o>/?!@#¥%……&*~~。∀。》()・゜・ノД・゜・∠ ͡° ͜ʖ ͡° ᐛ 」∠_——+|{}【】σ°∀°σ‘⊙▽⊙;≧∇≦ヾ〃∇ノヽ´∀`ノ:ω”“’。,、ヽ●´∀●ノ?ヾ´∀`ノ[\\\\s][0-9][\\\\uD83E\\uDD70\\\\uD83E\\uDD2A\\\\uD83E\\uDD23\\\\uD83E\\uDD22\\\\uD83E\\uDD2E\\\\uD83E\\uDDD0\\\\uD83E\\uDD11\\\\uD83E\\uDD2A\\\\uD83E\\uDD23\\\\uD83E\\uDD2A\\\\uD83E\\uDD74\\\\ud83c\\\\udc00-\\\\ud83c\\\\udfff]|[\\\\ud83d\\\\udc00-\\\\ud83d\\\\udfff]|[\\\\u2600-\\\\u27ff]]\";\n Pattern pattern = Pattern.compile(regEx);\n Matcher matcher = pattern.matcher(str);\n String trim = matcher.replaceAll(\"\").trim();\n return trim;\n }", "public static String removeWhiteSpace(String value) {\n return value.replaceAll(\"\\\\s\", \"\");\n }", "public static String removeEscapeChar(String string)\t{\n\t\tint lastIndex = 0;\n\t\twhile (string.contains(\"&#\"))\n\t\t{\n\t\t\t//Get the escape character index\n\t\t\tint startIndex = string.indexOf(\"&#\", lastIndex);\n\t\t\tint endIndex = string.indexOf(\";\", startIndex);\n\n\t\t\t//and rip the sucker out of the string\n\t\t\tString escapeChar = string.substring(startIndex, endIndex);\n\n\t\t\t//Get the unicode representation and replace all occurrences in the string\n\t\t\tString replacementChar = convertEscapeChar(escapeChar);\n\t\t\tstring = string.replaceAll(escapeChar + \";\", replacementChar);\t\t\t\n\t\t\tlastIndex = endIndex;\n\t\t}\n\t\treturn string;\n\t}", "public static String removeJunk(String str){\n StringBuilder strnew = new StringBuilder(str);\n for(int i=0;i<strnew.length();i++){\n if(!Character.isLetter(strnew.charAt(i)))\n strnew.delete(i, i+1);\n }\n return strnew.toString();\n }", "public String stripNonLettersOrNumbers(String in) {\n if (in != null) {\n return in.replaceAll(\"[^\\\\p{L}\\\\p{N}]\", \"\");\n } else {\n return null;\n }\n }", "private String avoidErrorChar (String original) {\n\t\tStringBuffer modSB = new StringBuffer();\n\t\tfor (int j=0; j < original.length(); j++) {\n\t\t\tchar c = original.charAt(j);\n\t\t\tif (c == '\\n') {\n\t\t\t\tmodSB.append(\"\\\\n\"); // rimpiazzo il ritorno a capo con il simbolo \\n\n\t\t\t} else if (c == '\"') {\n\t\t\t\tmodSB.append(\"''\"); // rimpiazzo le doppie virgolette (\") con due apostofi ('')\n\t\t\t} else if ((int)c > 31 || (int)c !=127){ // non stampo i primi 32 caratteri di controllo\n\t\t\t\tmodSB.append(c);\n\t\t\t}\n\t\t}\n\t\treturn modSB.toString();\n\t}", "private static String _stripWhitespace(String str)\n {\n if (str == null)\n return null;\n\n int length = str.length();\n int startIndex = 0;\n\n while (startIndex < length)\n {\n if (Character.isWhitespace(str.charAt(startIndex)))\n startIndex++;\n else\n break;\n }\n\n int endIndex = length;\n while (endIndex > 0)\n {\n if (Character.isWhitespace(str.charAt(endIndex - 1)))\n endIndex--;\n else\n break;\n }\n\n if ((startIndex == 0) && (endIndex == length))\n return str;\n\n return str.substring(startIndex, endIndex);\n }", "public static String stripTags(String string) {\n\t\tif (string == null || string.isEmpty()) {\n\t\t\treturn string;\n\t\t}\n\n\t\tString withoutTags = PATTERN_XML_TAGS.matcher(string).replaceAll(\"\");\n\t\treturn PATTERN_MULTIPLE_SPACES.matcher(withoutTags).replaceAll(\" \").trim();\n\t}", "private String stripNoneWordChars(String uncleanString) {\n return uncleanString.replace(\".\", \" \").replace(\":\", \" \").replace(\"@\", \" \").replace(\"-\", \" \").replace(\"_\", \" \").replace(\"<\", \" \").replace(\">\", \" \");\n\n }", "private String editString(String s) {\n s = s.replace(\"[31m\", \"\");\n s = s.replace(\"[0m\", \"\");\n s = s.replace(\"[33m\", \"\");\n s = s.replace(\"[36m\", \"\");\n s = s.replace(\"[34m\", \"\");\n s = s.replace(\"*\", \"\");\n s = s.replace(\"|\", \"\");\n //s = s.replace(\"]\", \"]\\n\");\n s = s.replace(\"\\t\", \"\\n\");\n\n\n return s;\n }", "private String parseLine(String line){\n String escaped = StringEscapeUtils.unescapeHtml4(line);\n escaped = escaped.replaceAll(\"[><*:]\", \"\");\n\n // get rid of ellipses\n escaped = escaped.replaceAll(\"[.]{2,}\", \".\");\n\n // Finally remove line-greaks\n escaped = escaped.replaceAll(\"[\\n]\", \"\");\n\n return escaped.trim();\n }", "public String removerAcentos(String str) {\r\n return Normalizer.normalize(str, Normalizer.Form.NFD).replaceAll(\"[^\\\\p{ASCII}]\", \"\");\r\n }", "private String normalize(String text) {\n final String nbsp = new String(new char[] {(char) 160});\n return text.replaceAll(\"\\\\s+(\" + nbsp + \")+\\\\s+\", \"$1\")\n .replace((char) 160, ' ')\n .replaceAll(\n \"\\n+\", \"\\n\")\n .replaceAll(\"\\r|\\t\", \"\")\n .trim();\n }", "public static String stripString(final String str, final char stripChar) {\n\t\tfinal int i = str.indexOf(stripChar);\n\t\treturn i != -1 ? str.substring(0, i) : str;\n\t}", "public static String condense(String str){\n Matcher matcher = condensePattern.matcher(str);\n return matcher.replaceAll(\" \");\n }", "public static String stripComments(String s, ParseResult result) {\n\t\tint commentStart = s.indexOf(\";\");\n\t\tif (commentStart != -1) {\n\t\t\ts = s.substring(0, commentStart);\n\t\t\tresult.commentStartPos = commentStart;\n\t\t\t// undo the effect escape() has had on commas\n\t\t\tint index = s.indexOf(\" , \");\n\t\t\twhile (index > -1) {\n\t\t\t\tresult.commentStartPos -= 2;\n\t\t\t\tindex = s.indexOf(\" , \", index + 3);\n\t\t\t}\n\t\t}\n\t\treturn s.trim();\n\t}", "private String removePunctuation(String input, boolean caseSensitive) {\n\t\tint i;\n\t\tint x;\n\t\tchar[] temp;\n\n\t\ttemp = input.toCharArray();\n\t\tx = 0;\n\n\t\t//Iterate through string and replace punctuation with white space\n\t\tfor (i = 0; i < input.length(); i++) {\n\t\t\tif ((input.charAt(i) == '.') || (input.charAt(i) == ',') || (input.charAt(i) == '?')\n\t\t\t\t\t || (input.charAt(i) == ':') || (input.charAt(i) == ';') || (input.charAt(i) == '\"')\n\t\t\t\t\t || (input.charAt(i) == '\\'') || (input.charAt(i) == '`') || (input.charAt(i) == '\\n')\n\t\t\t\t\t || (input.charAt(i) == '\\t')) {\n\t\t\t\tif (input.charAt(i) == '\\'') {\n\t\t\t\t\tx--;\n\t\t\t\t} else {\n\t\t\t\t\ttemp[x] = ' ';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!caseSensitive) {\n\t\t\t\t\ttemp[x] = Character.toLowerCase(input.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\tx++;\n\t\t}\n\n\t\treturn ((new String(temp, 0, x)).concat(\"\\n\"));\n\t}", "@Override\n\tprotected void filterUserInputText(AttributedString text) {\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar ch = text.charAt(i);\n\t\t\tif (ch == '\\t' || (!multiline && (ch == '\\n' || ch == '\\r'))) {\n\t\t\t\ttext.delete(Range.make(i, 1));\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tsuper.filterUserInputText(text);\n\t}", "public static String removeAndEscapeHTML( String s ) {\n if ( s==null ) return \"\";\n else return Utilities.escapeHTML( Utilities.removeHTML(s) );\n }", "@Override\n\tprotected void filterUserInputText(AttributedString text) {\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar ch = text.charAt(i);\n\t\t\tif (ch == '\\t' || ch == '\\n' || ch == '\\r') {\n\t\t\t\ttext.delete(Range.make(i, 1));\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tsuper.filterUserInputText(text);\n\t}", "public void trimDuplicatedNewline() {\n Utils.limitNewline(builder, 1);\n }", "@Override\n\tpublic String clean(String input) {\n\t\tinput = input.replaceAll(removeCommonWords.toString(), \" \");\n\t\t//input = input.replaceAll(removeSingleCharacterOrOnlyDigits.toString(), \" \");\n\t\t//input = input.replaceAll(removeTime.toString(), \" \");\n\t\t//input = input.replaceAll(\"(\\\\s+>+\\\\s+)+\", \" \");\n\t\treturn input;\n\t}", "String unescStr(String pSource) throws Exception;", "public static String trimer (String text){\n\t\treturn text.replaceAll(\"\\\\s+\", \" \");\n\t}", "private String cleanText(String str) {\r\n\t\tString clean = str.replace(\" \", \"\");\r\n\t\tclean = clean.replace(\":\", \"\");\r\n\t\tclean = clean.replace(\"$\", \"\");\r\n\t\tclean = clean.replace(\".\", \"\");\r\n\t\tclean = clean.replace(\"\\\"\", \"\");\r\n\t\tclean = clean.replace(\"'\", \"\");\r\n\t\tclean = clean.replace(\"&\", \"\");\r\n\t\treturn clean;\r\n\t}", "private static String repairString(String s) {\n return s != null ? s.replaceAll(\"\\'\", \"\\'\\'\") : null;\n }", "public static String toPlainText(String input) {\r\n return input.replaceAll(REGEX_SPECIAL_CHARS, \"\");\r\n }", "public String stripInput(String input) {\n return input.replaceAll(\"[.#$\\\\[\\\\]]\", \"\").replaceAll(\"/\", \" \");\n }", "public String removeSpace(String oldString)\n\t{\n\t\tString str = new String();\n\t\tString[] newString = oldString.split(\" \");\n\t\tfor(int i = 0; i < newString.length; i++)\n\t\t{\n\t\t\tstr += newString[i];\n\t\t}\n\t\treturn str;\n\t}", "public static final String escapeForIntro(String string) {\n String str = string;\n str = replace(str, \"\\r\\n\", \"<br>\");\n str = replace(str, \"\\n\", \"<br>\");\n str = replace(str, \"'\", \"\\\\'\");\n return replace(str, \"\\r\", \"\");\n\n }", "@Override\n public String postProcess(final String line) {\n var lineSeparatorIndex = line.lastIndexOf(RECORD_SEPARATOR_CHARACTER);\n return lineSeparatorIndex >= 0 ? line.substring(0, lineSeparatorIndex) : line;\n }", "public static String removePosessive(String line) {\n\t\tif (line.contains(\"'S\")) {\n\t\t\tline = line.replace(\"'S\", \"\");\n\t\t}\n\t\treturn line;\n\t}", "private String fixCapsOnlyLines(final String line) {\n if (line.matches(\"^[0-9A-Zl\\\\[\\\\]:'\\\"\\\\(\\\\)\\\\- ]*$\")) {\n return line.replaceAll(\"l\", \"I\");\n }\n return line;\n }", "private static String escapeWhitespace( final String input )\n {\n return input.replaceAll( \"\\\\ \", \"\\\\\\\\ \" );\n }", "public static String removeSpecialCharacters(String text) {\r\n\t\tif (null == text) {\r\n\t\t\treturn text;\r\n\t\t}\r\n\t\tPattern pattern = Pattern.compile(\"[^A-Z a-z0-9]\");\r\n\t\tMatcher matcher = pattern.matcher(text);\r\n\t\ttext = matcher.replaceAll(\"\");\r\n\t\treturn text;\r\n\t}", "private String trimRight(String string) {\n String newString = \"\";\n for (int i = 0; i < string.length(); i++) {\n if (string.charAt(i) != ' ') {\n newString = string.substring(0, i) + string.trim();\n break;\n }\n }\n return newString;\n }", "private final static String stripQuote( String s ) {\n\n char[] ca = s.toCharArray();\n char[] ca2 = new char [ca.length];\n char letter;\n int i2 = 0;\n\n for ( int i=0; i<ca.length; i++ ) {\n letter = ca[i];\n if ( letter != '\"' ) {\n ca2[i2] = letter; // save good letter\n i2++;\n }\n }\n\n char[] ca3 = new char [i2];\n\n for ( int i=0; i<i2; i++ ) {\n letter = ca2[i]; // get from first array\n ca3[i] = letter; // move to correct size array\n }\n\n return new String (ca3);\n\n }", "public static String removeLeadingTrailingChar(char c, String s) {\n \tif(s==null) return s;\n \tboolean hasLeading = true;\n \tboolean hasTrailing=true;\n \tString retVal = s;\n \twhile(hasLeading || hasTrailing) {\n\t \tif(hasLeadingChar(c,retVal)) {\n\t \t\tretVal = retVal.substring(1);\n\t \t}\n\t \telse {\n\t \t\thasLeading = false;\n\t \t}\n\t \tif(hasTrailingChar(c,retVal)) {\n\t \t\tretVal = retVal.substring(0,retVal.length()-1);\n\t \t}\n\t \telse {\n\t \t\thasTrailing = false;\n\t \t}\n\t \t\n \t}\n \treturn retVal;\n }", "public static String trim(String str) {\n\n\n str = str.replace(\"_IN_\", \"\");\n str = str.replace(\"_In_\", \"\");\n str = str.replace(\"__in\", \"\");\n str = str.replace(\"_Out_\", \"\");\n str = str.replace(\"__out\", \"\");\n str = str.replace(\"_Inout_\", \"\");\n str = str.replace(\"opt_\", \"\"); // this method is to remove _In_opt_\n str = str.replace(\"<span style=\\\"color:Blue;\\\">\", \"\");\n str = str.replace(\"</span>\", \"\");\n str = str.replace(\"WINAPI\", \"\");\n str = str.replace(\"_Inout_\", \"\");\n str = str.replaceAll(\"&nbsp;\", \"\");\n str = str.replaceAll(String.valueOf((char)160), \"\");\n str = str.replaceAll(\" \", \" \");\n str = str.replaceAll(\"CALLBACK \", \"\");\n str = str.replaceAll(\"const\", \"\");\n str = str.replaceAll(\"\\\\( \", \"\\\\(\");\n str = str.trim();\n str = str.substring(0, str.length() - 1);\n\n\n // System.out.println(\"AFTER TRIM \" + this.syntax);\n\n return str;\n\n\n }" ]
[ "0.80699694", "0.70172185", "0.6753621", "0.6749205", "0.6623076", "0.65002054", "0.6405545", "0.63638586", "0.6330869", "0.6219904", "0.6167412", "0.61453533", "0.6057256", "0.6045583", "0.6042984", "0.60174066", "0.6012843", "0.5987661", "0.59285647", "0.5924761", "0.5905651", "0.5905145", "0.588179", "0.58695704", "0.58642185", "0.5829919", "0.57424563", "0.5720819", "0.5675858", "0.56434214", "0.5599789", "0.55984724", "0.55959207", "0.5577172", "0.55530345", "0.5541055", "0.55322576", "0.55069494", "0.54984206", "0.54714507", "0.5456804", "0.54006386", "0.5364247", "0.53518504", "0.53478134", "0.534194", "0.5332991", "0.5318992", "0.5288261", "0.52782065", "0.52768826", "0.5270554", "0.5263665", "0.52355826", "0.5234343", "0.5230971", "0.52308685", "0.51958674", "0.51918787", "0.5189218", "0.51785284", "0.51707876", "0.5170308", "0.51700926", "0.51651585", "0.51523006", "0.5144671", "0.51313245", "0.51309025", "0.51299894", "0.51285195", "0.51145214", "0.5110665", "0.5100274", "0.5087571", "0.50829893", "0.50808287", "0.5066242", "0.50483817", "0.5048206", "0.5043555", "0.50401556", "0.5034499", "0.5032648", "0.50260144", "0.5025167", "0.50244534", "0.50205755", "0.5004309", "0.49946505", "0.4981441", "0.49755332", "0.49651787", "0.49605846", "0.49600768", "0.49572778", "0.4956601", "0.4942343", "0.49379817", "0.4915619" ]
0.7703012
1
Counts the number of occurences of a char within a string Taken from Jon Skeets answer from
public static int countOccurrences(String haystack, char needle) { int count = 0; for (int i=0; i < haystack.length(); i++) { if (haystack.charAt(i) == needle) { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int char_count(String y, char c){\r\n\tint count = 0;\r\n\tfor(int i = 0; i < y.length(); i++){\r\n\t\tif(y.charAt(i) == c){\r\n\t\t\tcount++;\r\n\t\t}\r\n\t}\r\n\treturn count;\r\n}", "private static int countOccurrences(String input, char c) {\n int count = 0;\n for (int i = 0; i < input.length(); i++) {\n if (input.charAt(i) == c) {\n count++;\n }\n }\n return count;\n }", "public int doCount(String s){\r\n\t\tint count = 0;\r\n\t\tint i;\r\n\t\tfor(i = 0; i < s.length(); i++){\r\n\t\t\tif ( s.charAt(i) == Letter )\r\n\t\t\t\tcount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn count;\r\n\t\t\r\n\t}", "public static int countChar(String s){\n return s.length();\n }", "public void getOccuringChar() \n\t\t {\n\t\t \tint count[] = new int[MAX_CHAR]; \n\t\t \t \n\t\t int len = str.length(); \n\t\t \n\t\t // Initialize count array index \n\t\t for (int i = 0; i < len; i++) \n\t\t count[str.charAt(i)]++; \n\t\t \n\t\t // Create an array of given String size \n\t\t char ch[] = new char[str.length()]; \n\t\t for (int i = 0; i < len; i++) { \n\t\t ch[i] = str.charAt(i); \n\t\t int find = 0; \n\t\t for (int j = 0; j <= i; j++) { \n\t\t \n\t\t // If any matches found \n\t\t if (str.charAt(i) == ch[j]) \n\t\t find++; \n\t\t } \n\t\t \n\t\t if (find == 1) \n\t\t System.out.println(\"Number of Occurrence of \" + \n\t\t str.charAt(i) + \" is:\" + count[str.charAt(i)]); \n\t\t } \n\t\t }", "public static int numOccurrences(String testString, char ch) {\n \tif(testString==null) return 0;\n\t\tint numOccurrences = 0;\n\t\tchar [] chars = testString.toCharArray();\n\t\tint len = chars.length;\n\t\tfor(int i = 0; i < len; ++i) {\n\t\t\tif(chars[i] == ch) {\n\t\t\t\t++numOccurrences;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn numOccurrences; \t\n }", "private static int characterCount(String expr, Character c) {\n\t\tint count = 0;\n\t\tfor(Character ch : expr.toCharArray()) if(ch == c) count ++;\n\t\treturn count;\n\t}", "static int charOccurrenceCount(String s, char c, int startIndex) {\n\t\tif(startIndex == s.length()) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tif(s.charAt(startIndex) == c) {\n\t\t\t\treturn 1 + charOccurrenceCount(s, c, startIndex + 1);\n\t\t\t} else {\n\t\t\t\treturn charOccurrenceCount(s, c, startIndex + 1);\n\t\t\t}\n\t\t}\n\t}", "public static int count(String s, char c) {\n // regex with negated char = removal of all but the char\n return s.replaceAll(\"[^\\\\Q\" + c + \"\\\\E]\", \"\").length();\n }", "public static int count(String str, char a) {\r\n\t\tint counter = 0;\r\n\t\tchar b = ' ';\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tb = str.toLowerCase().charAt(i);\t// string prebaciti u mala slova\r\n\t\t\tif (b == a) {\r\n\t\t\t\tcounter++;\t\t\t// brojac ponavljanja karaktera\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn counter;\r\n\t}", "private static int countOccurrences(String amount, char c) {\n int cnt = 0;\n for(int i = 0; i < amount.length(); i++){\n if(amount.charAt(i) == c){\n cnt++;\n }\n }\n return cnt;\n }", "public static int count(String s, String token)\r\n {\r\n if (isEmpty(s) || isEmpty(token))\r\n return 0;\r\n \r\n int count = 0;\r\n int k = 0;\r\n while ((k = s.indexOf(token, k)) >= 0)\r\n {\r\n count ++;\r\n k += token.length();\r\n }\r\n return count;\r\n }", "public static int numOfChars(String str, char ch) {\n\t\tint count = 0; \n\t\tfor(int i = 0; i < str.length(); i++) {\n\t\t\tif(str.charAt(i) == ch)\n\t\t\t\tcount += 1;\n\t\t\t\t\n\t\t}\n\t\treturn count;\n\t}", "public int strCount(String str, String sub) {\n//Solution to problem coming soon\n}", "private static void charCount(String str) {\n\t\t\n\t\tHashMap<Character, Integer> mp = new HashMap<Character, Integer>();\n\t\t\n\t\tchar[] cr=str.toCharArray();\n\t\t\n\t\tSystem.out.println(cr);\n\t\t\n\t\tfor(char c: cr) {\n\t\t\t\n\t\t\tif(mp.containsKey(c)) {\n\t\t\t\tmp.put(c, mp.get(c)+1);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tmp.put(c, 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(Map.Entry<Character, Integer> ent: mp.entrySet()) {\n\t\t\tSystem.out.println(ent.getKey() + \" \" + ent.getValue());\n\t\t}\n\t\t\n\t}", "public static int frequency(String str, char ch){\n//will return frequency of char from the string\n int count = 0; //to save the frequency of char\n/*each character is a char : and need to compare it with str.\nevery time it matches we add frequency to count*/\n\n for(char each : str.toCharArray() ){\n if(each == ch){//every time this is true, count will increase to 1\n count++;\n }\n }\n //return the frequency of one character from the string\n return count;\n }", "@Test\n public void charCount() {\n final int expectedEight = 8;\n final int expectedFour = 4;\n\n CharCount charCounter = new CharCount();\n assertEquals(expectedEight, charCounter.characterCounter(\"fizzbuzz FIZZBUZZ\", 'z'));\n assertEquals(expectedEight, charCounter.characterCounter(\"fizzbuzz FIZZBUZZ\", 'Z'));\n assertEquals(expectedFour, charCounter.characterCounter(\"FIZZBUZZ\", 'z'));\n assertEquals(0, charCounter.characterCounter(\"TEdff fdjfj 223\", '1'));\n assertEquals(expectedFour, charCounter.characterCounter(\"TE00df0f f0djfj 223\", '0'));\n assertEquals(0, charCounter.characterCounter(\"RRuyt 111000AAdda\", (char) 0));\n }", "public static int count(String str, char a) {\r\n\t\t\r\n\t\tint brojac = 0;\r\n\t\t // petlja koja prolazi kroz uneseni string\r\n\t\tfor(int i=0; i<str.length(); i++) {\r\n\t\t\t// ako je bilo koji karakter u unesenom stringu jednak trazenom karakteru\r\n\t\t\tif(Character.toString(str.charAt(i)).contains(Character.toString(a))) {\r\n\t\t\t\tbrojac++; // onda brojac broji koliko se trazeni karakter puta nalazi u stringu\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn brojac; // vraca se ukupan broj ponavljanja trazenog karaktera u stringu\r\n\t}", "static void getCharCountArray(String str) {\n for (int i = 0; i < str.length(); i++)\n count[str.charAt(i)]++;\n }", "public static int countABC(String str) {\n int x = 0;\n char[] chars = str.toCharArray();\n for (char c : chars) {\n if (c == 'a' || c == 'b' || c == 'c') {\n x += 1;\n }\n }\n return x;\n }", "public static void getOccuringChar(String inPutString) {\n HashMap<Character, Integer> charCountMap = new HashMap<Character, Integer>();\n /* converting given string to char Array*/\n char[] strArray = inPutString.toCharArray();\n /*Checking each char in strArray*/\n for (char c : strArray) {\n if (charCountMap.containsKey(c)) {\n //If char 'c' is present in charCountMap, incrementing it's count by 1\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n /*If char 'c' is not present in charCountMap,putting 'c' into charCountMap with 1 as it's value\n */\n charCountMap.put(c, 1);\n }\n }\n /*Printing input String*/\n System.out.println(\"The frequency of Character is \" + charCountMap);\n }", "public static int countSearchedChar(String text, char searchedChar) {\n char[] chars = text.toCharArray();\n int counter = 0;\n for (char currentChar : chars) {\n if (currentChar == searchedChar) {\n counter++;\n }\n }\n return counter;\n }", "public int countConsonants(String str){\n\t\tint count=str.replaceAll(\"[^A-Za-z0-9_]\", \"\").length()\n\t\t\t\t-str.toLowerCase().replaceAll(\"[^aeiouy]\",\"\").length();\n\t\treturn count;\n\t}", "public int charCount(final String str, final char c) {\n return (int) str.toLowerCase().chars()\n .filter(chr -> chr == Character.toLowerCase(c))\n .count();\n }", "public static int approach2(String str) {\n\t\tMap<Character, Integer> charToCountMap = new HashMap<Character, Integer>();\n\t\tint strLength = str.length();\n\t\tfor(int i = 0; i < strLength; i++) {\n\t\t\tif(charToCountMap.containsKey(str.charAt(i))) {\n\t\t\t\tcharToCountMap.put(str.charAt(i), charToCountMap.get(str.charAt(i)) + 1);\n\t\t\t} else {\n\t\t\t\tcharToCountMap.put(str.charAt(i), 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < strLength; i++) {\n\t\t\tif(charToCountMap.get(str.charAt(i)) > 1) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public static int countABC(String str) {\n int count = 0;\n for (int i = 0; i < str.length(); i++) {\n if (str.charAt(i) == 'a'){\n count++;\n }\n else if(str.charAt(i) == 'b'){\n count++;\n }\n else if(str.charAt(i) == 'c'){\n count++;\n\n }\n }\n return count;\n }", "public int [] getCharCount(String str){\n\t\tint CHAR_ARRAY = 26;\n\t\tint [] count = new int [CHAR_ARRAY];\n\t\tfor(char c: str.toCharArray()){\n\t\t\tcount[c-'a']++;\n\t\t}\n\t\treturn count;\n\t}", "int getCharCount(Element e, char s) {\n return e.text().split(Character.toString(s)).length - 1;\n }", "public static int [] countChar(String str) {\n char data [] = str.toCharArray();\n \n int count [] = new int [2];\n \n for (int i = 0; i < data.length; i++) {\n if (data[i] == 'n' || data[i] == 'N')\n count[0]++;\n if (data[i] == 'm' || data[i] == 'M')\n count[1]++;\n }\n return count;\n }", "public static void main(String[] args) {\n\t\tString str = \"welcome to chennai\";\r\n\t\tchar search='e';\r\n\t\tint count=0;\r\n\t\tchar ch[]=str.toCharArray();\r\n\t\tint len=ch.length;\r\n\t\tfor(int i=0;i<len;i++)\r\n\t\t{\r\n\t\t\tif(search==(ch[i]))\r\n\t\t\t{\r\n\t\t\t\tcount=count+1;\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t\tSystem.out.println(count);\r\n\t\r\n\r\n\t}", "include<stdio.h>\nint main()\n{\n char str[100];\n scanf(\"%s\", str);\n int i, count=1, length; \n for(length=0; str[length]!='\\0'; length++);\n if(length>20)\n {\n printf(\"Invalid Input\");\n }\n else\n {\n for(i=0; i<length; i++)\n {\n if(str[i] == str[i+1])\n {\n count++;\n }\n else\n {\n printf(\"%c%d\", str[i], count); \n count = 1;\n }\n }\n }\n return 0;\n}", "public static int[] countChar(String str) {\n\t\tint[] charSet = new int[256];\n\t\tfor(int i = 0; i < str.length(); i++) {\n\t\t\tcharSet[str.charAt(i)]++;\n\t\t}\n\t\treturn charSet;\n\t}", "public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter a word:\");\n String word = scan.next();\n System.out.println(\"Enter character:\");\n char character = scan.next().charAt(0);\n\n int count=0; //count frequency of character\n for (int i =0; i<word.length(); i++) {\n char each = word.charAt(i); //each character by given string word\n\n if (each == character) { //if each character in str is matching with ch\n count++; //count increase the frequency of ch by 1\n\n }\n }\n System.out.println(count);\n\n System.out.println(\"===========================\");\n\n\n\n }", "public int count(String word);", "@Test\n\tpublic static void main() {\n\t\tSystem.out.println(Stringcount2(\"reddygaru\"));\n\t}", "public static int eCounter (String string) {\r\n int count = 0;\r\n \r\n if (string.length() == 0) {\r\n return count;\r\n }\r\n \r\n if (string.substring(0,1).equalsIgnoreCase(\"e\")) {\r\n count = 1 + eCounter(string.substring(1));\r\n return count;\r\n }\r\n \r\n count = eCounter(string.substring(1));\r\n return count;\r\n }", "public long numberOfSubstrings(String s) {\n int[] letterCounts = new int[26];\n long substringCount = 0;\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n int letterCount = ++letterCounts[c - 'a'];\n substringCount += letterCount;\n }\n return substringCount;\n }", "public static int foo ( String s, char c )\r\n\t{\r\n\t\tif ( s.length() == 0 )\r\n\t\t\treturn 0;\r\n\t\telse\r\n\t\t{\r\n\t\t\tint count = 0;\r\n\t\t\t\r\n\t\t\tif ( s.charAt(0) == c )\r\n\t\t\t\tcount++;\r\n\t\t\t\r\n\t\t\treturn count + foo( ( s.substring( 1, s.length() ) ), c );\r\n\t\t\t\r\n\t\t}// end else\r\n\t\t\r\n\t}", "public static int numberOfOccurences(String str1,String str2) {\n\tint count=0;\n\tfor (int i=0; i<=str1.length()-str2.length(); i++) {//(int i=0; i<str1.length()-str2.length()+1; i++)\n\t\tString currentString=str1.substring(i,i+str2.length());\n\t //char charChar=str1.charAt(i);//2.solution\n\tif (currentString.equals(str2)) {\n\t\tcount++;\n\t }\n }\n\t\t\n\treturn count;\n}", "public static void main(String[] args) {\n\t\tString sentence = \"I think it's fair to say practice can be heplful in learning. \"\r\n\t\t\t\t+ \"Just about anything it can be true.\";\r\n\t\tchar myChar = 'a';\r\n\t\tint counter = 0;\r\n\t\t\r\n\t\tfor(int i=0; i<sentence.length(); i++)\r\n\t\t{\t//if you find the char value, count it in the if block\r\n\t\t\tif(sentence.charAt(i)==myChar)\r\n\t\t\t{\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Total number of occurences of 'a' is \"+counter);\r\n\t}", "@Override //old methd for letter count\n public Integer letterCount(String inputString) {\n char[] characterArray = inputString.toCharArray();\n Map<Character, Integer> wordFrequencyMap = new HashMap<Character, Integer>();\n\n for (char character : characterArray) {\n if (wordFrequencyMap.containsKey(character)) {\n\n Integer wordCount = (Integer) wordFrequencyMap.get(character);\n wordFrequencyMap.put(character, wordCount + 1);\n\n } else {\n wordFrequencyMap.put(character, 1);\n\n }\n }\n return null; //iterateWordCount(wordFrequencyMap);\n }", "public int stringCounter (String stringToFind) throws IOException{\n if (stringToFind.equals(\"\")){\n return stringCount=-1;\n }\n Pattern pattern = Pattern.compile(stringToFind);\n Matcher matcher;\n String line;\n fileRead.mark(2000000);\n while ((line=fileRead.readLine())!= null){\n matcher = pattern.matcher(line.toLowerCase());\n int c=0;\n while(matcher.find()) {\n c++;\n }\n stringCount=stringCount+c;\n }\n fileRead.reset();\n return stringCount;\n }", "public static void main(String[] args) {\n\t\tString str = \"Im a Java Developer\";\r\n\t\tSystem.out.println(str);\r\n\t\tScanner s = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the character for which you want to find occurrance\");\r\n\t\tchar c = s.next().charAt(0);\r\n\t\tint count = 0;\r\n\t\tfor(int i=0;i<str.length();i++){\r\n\t\t\tif (str.charAt(i) == c ){\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Number of occurrances are : \"+count);\r\n\t}", "static int countOccurrences(String str, String word) \r\n\t\t{\n\t\t String a[] = str.split(\" \");\r\n\t\t \r\n\t\t // search for pattern in a\r\n\t\t int count = 0;\r\n\t\t for (int i = 0; i < a.length; i++) \r\n\t\t {\r\n\t\t // if match found increase count\r\n\t\t if (word.equals(a[i]))\r\n\t\t count++;\r\n\t\t }\r\n\t\t \r\n\t\t return count;\r\n\t\t}", "public static int howManyLetters (String s)\n {\n if (s.length()==0) //stop condition - the end case, if the string is empty\n return 0;\n int isc=( s.charAt(s.length()-1)>='a'&&s.charAt(s.length()-1)<='z'||\n s.charAt(s.length()-1)>='A'&& s.charAt(s.length()-1)<='Z')? 1: 0; //checks whether the current character is a letter\n return isc+howManyLetters(s.substring(0,s.length()-1)); //return the amount of letters (by re-call the method again)\n }", "public static int count(String str){\r\n\t\tString[] splitStr = str.trim().split(\"\\\\s+\"); //split according to spaces and tabs.\r\n\t\treturn splitStr.length;\r\n\t}", "public static int duplicateCount(String text) {\n \r\n int count=0; \r\n \r\n \r\n \r\n int l=text.length(); int index=0; String s1=\"\"; char [] c= new\r\n char [text.length()] ; for (int i=0;i <text.length();i++) {\r\n c[i]=text.toLowerCase().charAt(index++);\r\n \r\n System.out.println(\"Character at c[\"+i+\"] is\"+c[i]);\r\n \r\n }\r\n \r\n System.out.println(\"Character array is \"+Arrays.toString(c));\r\n \r\n int charSize=c.length; int index2=1;\r\n \r\n HashMap h =new HashMap();\r\n for (int i=0;i<charSize;i++)\r\n {\r\n for(int j=i+1;j<charSize;j++)\r\n {\r\n if (c[i]==c[j])\r\n {\r\n count++;\r\n //s1=s1+c[j];\r\n \r\n h.put(c[j],count);\r\n }\r\n }\r\n }\r\n \r\n \r\n System.out.println(h);\r\n \r\n int hsize= h.size();\r\n \r\n return hsize;\r\n }", "public int countSpecificString(String str)\n\t{\n\t\tif (str == null)\n\t\t\treturn 0;\n\n\t\tstr = str.toLowerCase();\n\t\tNode wizard = this.root; // Temporary node variable.\n\n\t\tfor (int i = 0; i < str.length(); i++)\n\t\t{\n\t\t\tif (!(Character.isLetter(str.charAt(i)))) continue;\n\t\t\tint index = str.charAt(i) - 'a';\n\t\t\t\n\t\t\tif (wizard.children[index] == null) return 0;\n\t\t\twizard = wizard.children[index];\n\t\t}\n\n\t\treturn wizard.count;\n\t}", "public static int countChar ( char target, String line )\n {\n int sum = 0;\n\n // Look for the first target character in line.\n int index = line.indexOf ( target );\n\n // Loop, counting all occurances.\n while ( index >= 0 )\n {\n sum++;\n\n // Check if reached the last character in line.\n if ( index == line.length () - 1 ) return sum;\n\n // Search for an additional target character in line.\n index = line.indexOf ( target, index+1 );\n } // while\n\n return sum;\t\t// return the count\n }", "public static Map<Character,Integer> countFreq(String string){\n\n\n\n Map<Character,Integer> results = new HashMap<Character,Integer>();\n for (int i = 0; i < string.length(); i++) {\n Character temp = string.charAt(i);\n Integer count;\n// System.out.println(temp);\n if (results.containsKey(temp)){\n count=results.get(temp);\n count++;\n results.replace(temp,count);\n }\n else\n results.put(temp,1);\n\n }\n\n return results;\n }", "static int countCharacters2(String[] words, String chars) {\n int count = 0;\n int[] seen = new int[26];\n //Count char of Chars String\n for (char c : chars.toCharArray())\n seen[c - 'a']++;\n // Comparing each word in words\n for (String word : words) {\n // simple making copy of seen arr\n int[] tSeen = Arrays.copyOf(seen, seen.length);\n int Tcount = 0;\n for (char c : word.toCharArray()) {\n if (tSeen[c - 'a'] > 0) {\n tSeen[c - 'a']--;\n Tcount++;\n }\n }\n if (Tcount == word.length())\n count += Tcount;\n }\n return count;\n }", "public int count(char ch) {\n int count = 0;\n if (jumble.containsKey(ch)) {\n count = jumble.get(ch);\n }\n return count;\n }", "public int countSegments(String s) {\r\n int count = 0;\r\n boolean flag = true;\r\n if (s.length() == 0) return 0;\r\n \r\n for (char c : s.toCharArray()) {\r\n if (c == 32) {\r\n flag = true;\r\n } else if (c != 32 && flag) {\r\n flag = false;\r\n count++;\r\n }\r\n }\r\n \r\n return count;\r\n }", "public int countAbc(String str) {\n//Solution to problem coming soon\n}", "public static void main(String[] args) \n{\nScanner scan=new Scanner(System.in);\n \nSystem.out.println(\"Please Enter the String here\");\n \n// It will accept String from user and will store in variable\nString str1=scan.next();\n \nSystem.out.println(\"enter the letter to count\");\n \n// It will accept char from user and will store in variable\nString str2=scan.next();\n \n// Now from Second String get the value using charAt method\nchar cha = str2.charAt(0);\n \n// take count variable\nint count=0;\n \n// Run a for loop that will run based on String length\nfor(int i=0;i<=str1.length()-1;i++)\n{\n \n// This will check if match found\nif(str1.charAt(i)==cha)\n \n{\n \n// It will increment the counter\ncount++;\n \n}\n \n}\n \n// Finally print the count\nSystem.out.println(count);\n \n}", "void countCharByCategory(String inputstr) {\n\n\t\tint digitcount = 0;\n\t\tint lowercasecount = 0;\n\t\tint uppercasecount = 0;\n\t\tint specialcharcount = 0;\n\n\t\tfor (int i = 0; i < inputstr.length(); i++) {\n\n\t\t\tif (Character.isLowerCase(inputstr.charAt(i)))\n\t\t\t\tlowercasecount++;\n\t\t\telse if (Character.isUpperCase(inputstr.charAt(i)))\n\t\t\t\tuppercasecount++;\n\n\t\t\telse if (Character.isDigit(inputstr.charAt(i)))\n\t\t\t\tdigitcount++;\n\t\t\telse\n\t\t\t\tspecialcharcount++;\n\t\t}\n\t\tSystem.out.println(\"Total Digits: \" + digitcount + \"\\nTotal letters: \" + (lowercasecount+uppercasecount) + \"\\nTotal Uppercase: \"\n\t\t\t\t+ uppercasecount + \"\\nTotal lowercase: \" + lowercasecount + \"\\nTotal Special character: \"\n\t\t\t\t+ specialcharcount);\n\n\t}", "public int countX(String str) {\n\t\t if(str.length() == 0 ){\n\t\t // return count;\n\t\t\t return 0;\n\t\t }\n\t\t if(str.charAt(0) == 'x'){\n\t\t // count++;\n\t\t //return count + countX(str.substring(1));\n\t\t return 1 + countX(str.substring(1));\n\t\t }\n\t\t return countX(str.substring(1));\n\t\t}", "public int count(char c){\n int counting = 0;\n \n if(isEmpty()){\n return counting; \n }else if(c == this.top){\n return counting += rest.count(c) + 1 ;\n }else{\n return counting = rest.count(c);\n }\n }", "private static int ones(String s)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor (int i = 0; i < s.length(); i++)\r\n\t\t{\r\n\t\t\tif(s.charAt(i) == '1')\r\n\t\t\t\tcount++;\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int countXX(String str) {\n\n int index = str.indexOf(\"xx\");\n int numOfX = 0;\n\n while (index != -1) {\n numOfX++;\n str = str.substring(index + 1);\n index = str.indexOf(\"xx\");\n }\n return numOfX;\n }", "static double count(String str, String findStr) {\n\t\tint lastIndex = 0;\n\t\tint count = 0;\n\t\twhile (lastIndex != -1) {\n\t\t lastIndex = str.indexOf(findStr,lastIndex);\n\t\t if (lastIndex != -1) {\n\t\t count++;\n\t\t lastIndex += findStr.length();\n\t\t }\n\t\t}\n\t\treturn count;\n\t}", "int[] buildFrequencyTable(String s)\n{\n int[] table = new int [Character.getNumericValue('z') - Character.getNumericValue('a') + 1];\n for (char c : s.toCharArray())\n {\n int x = getCharNumber(c);\n if (x != -1) table[x]++;\n }\n return table;\n}", "public static int count(String str, String search, boolean contig) {\n\t\tif (contig) return contig(str, search);\n\t\tint count = 0;\n\t\tint index = 0;\n\t\t\n\t\tint match = str.indexOf(search, index);\n\t\twhile (match > -1 && index < str.length()) {\n\t\t\tcount++;\n\t\t\tindex = match+search.length();\n\t\t\tmatch = str.indexOf(search, index);\n\t\t}\n\t\treturn count;\n\t}", "public int guessCount(String tester, char guess) {\n StringBuilder r = new StringBuilder(tester);\n\n int guessCount = 0;\n for (int i = 0; i < tester.length(); i++) {\n if (r.charAt(i) == guess) {\n guessCount++;\n }\n }\n\n return guessCount;\n }", "public static Character findLength(String str) {\n\n List<Character> list = new ArrayList<>();\n for (Character c : str.toCharArray()) {\n list.add(c);\n }\n\n Character result = '\\0';\n for (Character c : list) {\n if (Collections.frequency(list, c) == 1) {\n result = c;\n break;\n }\n }\n\n return result;\n }", "static int countCharacters(String[] words, String chars) {\n int ans = 0;\n int[] letters = new int[26];\n char[] arr = chars.toCharArray();\n for (char a : arr) {\n letters[a-'a']++;\n }\n for (String s : words) {\n char[] charArray = s.toCharArray();\n int[] temp = new int[26];\n int i = 0;\n for (;i<charArray.length;i++) {\n if (letters[charArray[i]-'a'] > 0) {\n letters[charArray[i]-'a']--;\n temp[charArray[i]-'a']++;\n } else {\n break;\n }\n }\n if (i == charArray.length) {\n ans += s.length();\n }\n i=0;\n for (;i<temp.length;i++) {\n letters[i] += temp[i];\n }\n }\n return ans;\n }", "public int countSubstrings(String s) {\n int cnt = 0;\n\n char[] str = s.toCharArray();\n\n\n for(int j=0; j<2; j++) {\n for(int i=0; i< str.length; i++) {\n int left = i;\n int right = i+j;\n\n while(left>=0 && right<str.length && str[left] == str[right]) {\n cnt++;\n left--;\n right++;\n }\n\n }\n }\n\n return cnt;\n }", "public int countTokens()\n {\n\n int count = 0;\n int currpos = currentPosition;\n\n while (currpos < maxPosition)\n {\n int start = currpos;\n\n while ((currpos < maxPosition)\n && Character.isLetterOrDigit(str.charAt(currpos)))\n {\n currpos++;\n }\n\n if ((start == currpos)\n && (Character.isLetterOrDigit(str.charAt(currpos)) == false))\n {\n currpos++;\n }\n\n count++;\n }\n\n return count;\n }", "public static Map<Character, Integer> findDuplicateCharactersInAString(final String input){\n\n Map<Character, Integer> charCountMap= null;\n if(input !=null && input.length() > 0)\n {\n if(input.length() ==1){\n return charCountMap;\n }\n charCountMap = new LinkedHashMap<Character, Integer>();\n String inputString = input;\n // In case if the program need not consider capital and small letters,\n // if want to consider comment out below line\n inputString = inputString.toLowerCase();\n char [] inputChars = inputString.toCharArray();\n\n for(Character c : inputChars) {\n\n if (charCountMap.containsKey(c)) {\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n charCountMap.put(c, 1);\n }\n }\n }\n else{\n throw new IllegalArgumentException(\"Invalid input\");\n }\n return charCountMap;\n }", "int count(String s) {\r\n\t\tif (m_words.containsKey(s)) {\r\n\t\t\treturn m_words.get(s);\r\n\t\t} else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public static int occurrences(char[] v, char c) {\n\t\tif (v == null)\n\t\t\tthrow new NullPointerException();\n\t\tint n = 0;\n\t\tfor (int i = 0; i < v.length; i++)\n\t\t\tif (v[i] == c)\n\t\t\t\tn++;\n\t\treturn n;\n\t}", "public int count(String st) {\n\t\tboolean ans = Search(st);\n\t\tif (ans) {\n\t\t\tint stIndex = table[hashFunction(st,m)].indexOf(st);\n\t\t\tint count = table[hashFunction(st,m)].get(stIndex).GetCount();\n\t\t\treturn count;\n\n\t\t} else\n\t\t\treturn 0;\n\t}", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tSystem.out.println(\"enter a string\");\n\t\tString str=sc.nextLine();\n\t\tint count=0;\n\t\tchar ar[]=str.toCharArray();\n\t\tfor(char c:ar) {\n\t\t\tcount++;\n\t\t}\nSystem.out.println(count);\n\t}", "public static int countCharacters(char[] characters, char c) {\r\n\t\tint n = 0;//before counting, the number of counts is 0\r\n\t\tfor(int i=0; i<characters.length; i++) {\r\n\t\t\tif(characters[i]==c) {\r\n\t\t\t\tn++;//while there's a character c in a row/column/diagonal, counts plus 1\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn n;//after running the loop, return the number of counts\r\n\t}", "public int countSyllables(String s){\r\n\t\ts = s.replace(\"qu\", \"q\");\r\n\t\tint i = 0;\r\n\t\tint count = 0;\r\n\t\tdo {\r\n\t\t\tchar c = s.charAt(i);\r\n\t\t\tif(isVowel(c)){\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t} while(i<s.length()-1);\r\n\t\treturn count;\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tString s = \"Mahesh\";\r\n\t\tchar[] arr = s.toCharArray();\r\n\t\tint count = 0;\r\n\t\tfor(char s1: arr) {\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tSystem.out.println(count);\r\n\t\t\r\n\t\tint index = 0;\r\n\t\ttry {\r\n\t\t\twhile(true) {\r\n\t\t\t\ts.charAt(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(index);\r\n\t}", "public int charNumber(String string, char ch){\n\t\tint num=0;\n\t\tint length=string.length();\n\n\t\tfor(int i=0; i<length; i++){\n\t\t\tif(string.charAt(i)==ch) num++;\n\t\t}\n\t\t\n\t\treturn num;\n\t}", "public static void main(String[] args) {\n\n String s = \"Java Programming Java oops\";\n\n int fullLenght = s.length();\n\n int lengthWithoutas = s.replace(\"a\", \"\").length();\n\n int numOfas = fullLenght - lengthWithoutas;\n\n System.out.println(\"Number of a's in the string = \" + numOfas);\n\n\n }", "public static int main(String[] args) {\n\n System.out.println(\"Input the string: \");\n\n Scanner scn = new Scanner(System.in);\n\n String word = scn.nextLine();\n\n int count = 0;\n for (int i = 0; i < word.length(); i++) {\n if (word.charAt(i) == 'a' || word.charAt(i) == 'e' || word.charAt(i) == 'i' ||\n word.charAt(i) == 'o' || word.charAt(i) == 'u' || word.charAt(i) == 'A' ||\n word.charAt(i) == 'E' || word.charAt(i) == 'I' || word.charAt(i) == 'O' || word.charAt(i) == 'U') {\n count++;\n }\n }\n return count;\n\n }", "HashMap<Character, Integer> countCharacter(char[] array) {\n\t\tHashMap<Character, Integer> hm = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (hm.containsKey(array[i]))\n\t\t\t\thm.put(array[i], hm.get(array[i]) + 1);\n\n\t\t\telse\n\t\t\t\thm.put(array[i], 1);\n\t\t}\n\t\treturn hm;\n\n\t}", "public static int findLength(String str) {\n flushMap();\n if (str==null || str.isEmpty()) return -1;\n int x = 0;\n int count = 0;\n int maxCount = 0;\n while (x<str.length()) {\n char letter = str.charAt(x);\n if (!isRepeating(letter)) count++;\n else {\n flushMap();\n maxCount = Math.max(maxCount, count);\n x--;\n count = 0;\n }\n x++;\n }\n return Math.max(maxCount, count);\n }", "public int symbols(String senha){\n Pattern exp = Pattern.compile(\"([^a-zA-Z\\\\d\\\\s]+)\");\n Matcher matcher = exp.matcher(senha);\n int i = 0;\n while (matcher.find())\n i += matcher.group().length();\n return i;\n }", "public static int substringCount(String s, String substring) {\n \tint num = 0;\n \twhile(s.contains(substring)) {\n \t\ts = s.substring(s.indexOf(substring) + substring.length());\n \t\tnum++;\n \t}\n return num;\n }", "static long repeatedString(String s, long n) {\n\n char[] str = s.toCharArray();\n\n String temp = \"\";\n\n int i=0;\n long count=0;\n\n while(i<str.length){\n if(str[i]=='a'){\n count++;\n }\n i++;\n }\n\n long occurance = n/str.length;\n long remainder = n%str.length;\n count = count*occurance;\n\n i=0;\n while(i<remainder){\n if(str[i]=='a'){\n count++;\n }\n i++;\n }\n\n return count;\n\n }", "private static Map<Character, Integer> countChars(char[] characters) {\n\t\t/**\n\t\t * creating hashMap called map for storing the character along with count\n\t\t */\n\t\tMap<Character, Integer> map = new HashMap<>();\n\t\t/**\n\t\t * using for as outerloop to take each character for checking\n\t\t */\n\t\tfor (int i = 0; i < characters.length; i++) {\n\t\t\t/**\n\t\t\t * declaring count variable to keep count of repeated characters\n\t\t\t */\n\t\t\tint count = 0;\n\t\t\t/**\n\t\t\t * inner loop for checking the character with particular character\n\t\t\t */\n\t\t\tfor (int j = 0; j < characters.length; j++) {\n\t\t\t\t/**\n\t\t\t\t * if both the character are equal increment the count\n\t\t\t\t */\n\t\t\t\tif (characters[i] == characters[j]) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * checking if the character already exists in map to remove duplicates\n\t\t\t */\n\t\t\tif (!(map.containsKey(characters[i]))) {\n\t\t\t\t/**\n\t\t\t\t * adding the character and the character count into the map\n\t\t\t\t */\n\t\t\t\tmap.put(characters[i], count);\n\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * returning the map\n\t\t */\n\t\treturn map;\n\t}", "private static int countSpaceSub(char [] dest,int length, char subChar){\n int i = 0;\n int count = 0;\n while (i < length) {\n if (dest[i] == subChar) {\n count++;\n }\n i++;\n }\n return count;\n }", "public static void main(String[] args) {\n String s = \"ab\";\n\n\n int res = countSubstrings(s);\n System.out.println(res);\n\n }", "private int m127619a(String str) {\n if (TextUtils.isEmpty(str)) {\n return 0;\n }\n int i = 0;\n for (char a : str.toCharArray()) {\n if (m127620a(a)) {\n i++;\n }\n }\n return i;\n }", "public static int commonCharacterCount(String s1, String s2) {\n\t int count = 0;\n\t int auxArray[] = new int[s2.length()];\n\t for (int i = 0; i < auxArray.length; i++){\n\t\tauxArray[i] = 0;\n\t }\n\t \n\t for(int i = 0; i < s1.length(); i++){\n\t\tfor(int j = 0; j < s2.length(); j++){\n\t\t if( auxArray[j] == 1){\n\t\t continue;\n\t\t }\n\t\t else{\n\t\t if(s1.charAt(i) == s2.charAt(j)){\n\t\t auxArray[j] = 1;\n\t\t count += 1;\n\t\t break;\n\t\t }\n\t\t }\n\t\t}\n\t }\n\t return count;\n\t}", "public int numberOfCharacters(String senha){\n return senha.length();\n }", "static long substrCount(int n, String input) {\n List<String> result = new ArrayList<>();\n if (!isEmpty(input)) {\n for (int index = 0; index <= input.length(); index++) {\n for (int i = index; i <= input.length(); i++) {\n String temp = input.substring(index, i);\n if (valid(temp)) {\n result.add(temp);\n }\n }\n }\n }\n return result.size();\n\n }", "public static void main(String[] args)\n{\n\tString str=\"like like rcb\";\n String[] Spl = str.split(\" \");\n\tint count=0;\n\tfor(int i=0;i<Spl.length;i++)\n\t{\n\t\tif(Spl[i].equals(\"like\"))\n\t\t{\n\t\tcount++;\n\t\t}\n\t}\n\tSystem.out.println(\"number of like present in given String are \"+count);\n}", "public static int count(String str) {\n if (str == null || str.isEmpty()) {\n return 0;\n }\n String[] words = str.split(\"\\\\s+\");\n return words.length;\n }", "int[] countLetters(String str) {\n int[] countArr = new int['z'-'a'+1];\n Arrays.fill(countArr, 0);\n\n for (int i = 0; i < str.length(); ++i) {\n char c = str.charAt(i);\n if (!Character.isLetter(c)) {\n continue;\n }\n\n if (c >= 'a' && c <= 'z') {\n countArr[c - 'a']++;\n }\n }\n\n return countArr;\n }", "static\nint\ncountPairs(String str) \n\n{ \n\nint\nresult = \n0\n; \n\nint\nn = str.length(); \n\n\nfor\n(\nint\ni = \n0\n; i < n; i++) \n\n\n// This loop runs at most 26 times \n\nfor\n(\nint\nj = \n1\n; (i + j) < n && j <= MAX_CHAR; j++) \n\nif\n((Math.abs(str.charAt(i + j) - str.charAt(i)) == j)) \n\nresult++; \n\n\nreturn\nresult; \n\n}", "@Override\n\tpublic int getLength() {\n\t\tint c = 0;\n\t\tfor (char c1 : theString.toCharArray()) {\n\t\t\tc++;\n\t\t}\n\t\treturn c;\n\t}", "public static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\tSystem.out.print(\"Please enter a string: \");\n\t\tString s=in.nextLine();\n\t\tSystem.out.print(\"Please enter the character to find: \");\n\t\tchar c=in.nextLine().charAt(0);\n\t\tSystem.out.print(countChar(s,c));\n\t\tin.close();\n\t}", "static int theLoveLetterMystery(String s){\n \n int i=0, j = s.length()-1;\n int count =0;\n if(s.length() == 0 || s == null)\n return count;\n while(i<j)\n {\n if(s.charAt(i) == s.charAt(j))\n {\n i++;\n j--;\n continue;\n }\n \n else\n count = count + Math.abs((int)(s.charAt(i) - s.charAt(j)));\n \n i++;\n j--;\n }\n return count;\n }", "public static int longerThanOriginalOne(String s){\n\n\t\tint count = 1;\n\t\tchar c = s.charAt(0);\n\n\t\tint total = 0;\n\n\t\tfor (int i = 1; i < s.length(); i++){\n\t\t\tif (s.charAt(i) == c){\n\t\t\t\tcount += 1;\n\t\t\t}else{\n\t\t\t\ttotal += 1 + Integer.toString(count).length();\n\t\t\t\tc = s.charAt(i);\n\t\t\t\tcount = 1;\n\n\t\t\t}\n\t\t}\n\t\ttotal += 1 + Integer.toString(count).length();\n\t return total;\n\n\n\t}", "public static int codeCount(String str, int beginIndex, int endIndex) {\r\n return str.codePointCount(beginIndex, endIndex);\r\n }" ]
[ "0.8046001", "0.8014129", "0.7821778", "0.77220386", "0.76944315", "0.7681828", "0.76259327", "0.7587956", "0.74850714", "0.7475265", "0.7451532", "0.7360138", "0.7309561", "0.7306047", "0.72852254", "0.728433", "0.7179896", "0.7168203", "0.71676004", "0.71439993", "0.7126994", "0.7096335", "0.70665985", "0.70640165", "0.7000586", "0.69861156", "0.6970173", "0.69686395", "0.69409686", "0.6927272", "0.68928385", "0.68803316", "0.6875738", "0.6872329", "0.6867626", "0.68622315", "0.68565977", "0.6840485", "0.6840209", "0.68375957", "0.68162286", "0.68083084", "0.6801366", "0.67750233", "0.675664", "0.675637", "0.67451966", "0.6738937", "0.67365754", "0.67350584", "0.67294914", "0.6694454", "0.6693594", "0.66816944", "0.66697973", "0.6663765", "0.66550237", "0.6653127", "0.66366816", "0.66213083", "0.6602163", "0.6578056", "0.65774363", "0.65676093", "0.65634906", "0.65619665", "0.65436274", "0.653976", "0.6537518", "0.6525479", "0.6516487", "0.651054", "0.6503606", "0.6485043", "0.6482244", "0.64737767", "0.6471419", "0.6469045", "0.6449561", "0.643787", "0.6423096", "0.64210635", "0.6407758", "0.6398876", "0.639303", "0.6391327", "0.63837695", "0.6360877", "0.6357593", "0.63426554", "0.63405806", "0.6339336", "0.63390464", "0.6336406", "0.6336134", "0.6326445", "0.63082546", "0.63062084", "0.6300442", "0.62992656" ]
0.69953656
25
Prints to console the occurences of each regex match within a string of text Taken from Jean Logeart's answer from
public static void printMatches(String text, String regex) { Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(text); // Check all occurrences while (matcher.find()) { System.out.print("Start index: " + matcher.start()); System.out.print(" End index: " + matcher.end()); System.out.println(" Found: " + matcher.group()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void printMatches(String text, String regex) {\n\t\tvar matches = getMatches(text, regex);\n\t\tconsole.printf(\"%10s -> %2d matches: %s %n\", replaceSymbols(regex), matches.size(), matches);\n\t}", "public static void showMatches(String text, String regex) {\n\t\t// create regex and matcher\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tMatcher matcher = pattern.matcher(text);\n\n\t\t// character array to show where matches are located\n\t\tchar fill = '_';\n\t\tchar[] region = new char[text.length()];\n\t\tArrays.fill(region, fill);\n\n\t\t// used to track current match\n\t\tint index = 0;\n\t\tint count = 0;\n\n\t\t// keep going while found a match in text\n\t\twhile (index < text.length() && matcher.find(index)) {\n\t\t\t// converts count to a character\n\t\t\t// will loop through 0-9 and then A-Z as necessary\n\t\t\tfill = Character.forDigit(count % 36, 36);\n\t\t\tfill = Character.toUpperCase(fill);\n\n\t\t\t// indicate region matched\n\t\t\tArrays.fill(region, matcher.start(), matcher.end(), fill);\n\n\t\t\t// test if matched empty string\n\t\t\tif (matcher.start() == matcher.end()) {\n\t\t\t\t// indicate empty string at location was matched\n\t\t\t\tregion[matcher.start()] = '\\u2024';\n\n\t\t\t\t// move to next position to avoid infinite loop\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// otherwise start looking at end of last match\n\t\t\t\tindex = matcher.end();\n\t\t\t}\n\n\t\t\t// increment count\n\t\t\tcount++;\n\t\t}\n\n\t\t// print original string and matching regions\n\t\tconsole.println(text);\n\t\tconsole.println(region);\n\t}", "public static void main(String[] args) {\n String regex = \"[1-3[5-7]]\";\n String input = \"1234567890\";\n\n // Compiles the given regular expression into a pattern.\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(input);\n\n // Find matches and print it\n while (matcher.find()) {\n System.out.format(\"Text \\\"%s\\\" found at %d to %d.%n\",\n matcher.group(), matcher.start(),\n matcher.end());\n }\n }", "public static ArrayList<RegexResult> getMatches(String text, String regex) {\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(text);\n // Check all occurrences\n\n ArrayList<RegexResult> results = new ArrayList<>();\n\n while (matcher.find()) {\n results.add(new RegexResult(matcher.group(), matcher.start(), matcher.end()));\n //System.out.print(\"Start index: \" + matcher.start());\n //System.out.print(\" End index: \" + matcher.end());\n //System.out.println(\" Found: \" + matcher.group());\n }\n\n return results;\n }", "public static void StringFinder()\n {\n // String to be scanned to find the pattern.\n String TargetString = \"Find me in me this string me, test me\";\n String SearchExpression_literal = \"me\"; // Default Pattern (RegEx ) group\n\n // Create a Pattern object\n Pattern r = Pattern.compile(SearchExpression_literal);\n // Now create matcher object.\n Matcher m = r.matcher(TargetString);\n\n int SearchFindCounter = 0;\n /**\n * Matcher.find() Returns Boolean for every occurrence found\n */\n if (m.find())\n { \n \t System.out.println(\"Match Found\");\n }\n }", "public static void main(String[] args) {\n\t\t Pattern p = Pattern.compile(\"(a+)\");\r\n\t\t Matcher m = p.matcher(\"aaaaaba\");\r\n\t\t //System.out.println(m.matches())\r\n\t\t m.find();\t\t \r\n\t\t m.find();\r\n\t\t System.out.println(\"grCount \"+m.groupCount());\t \r\n\t\t MatchResult mr = m.toMatchResult();\r\n\t\t \r\n\t\t System.out.println(m.end());\r\n\t\t System.out.println(\"'\"+mr.group()+\"'\");\r\n\t\t System.out.println(\"start \"+mr.start(1));\r\n\t\t \r\n\t}", "public static ArrayList<String> getMatches(String text, String regex) {\n\t\tArrayList<String> matches = new ArrayList<String>();\n\n\t\t// create regex pattern and matcher\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tMatcher matcher = pattern.matcher(text);\n\n\t\tint index = 0;\n\n\t\t// keep going while found a match in text\n\t\twhile (index < text.length() && matcher.find(index)) {\n\n\t\t\t// store matching substring\n\t\t\tmatches.add(replaceSymbols(text.substring(matcher.start(), matcher.end())));\n\n\t\t\tif (matcher.start() == matcher.end()) {\n\t\t\t\t// advance index if matched empty string\n\t\t\t\tindex = matcher.end() + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// otherwise start looking at end of last match\n\t\t\t\tindex = matcher.end();\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t}", "String findMatches(String filePath, String pattern) {\n\t Pattern regexp = Pattern.compile(pattern);\n\t Matcher m = null;\n\t String output = \"\";\n\t Path path = Paths.get(filePath);\n\t try {\n\t \t\tBufferedReader reader = Files.newBufferedReader(path, m_oEncoding);\n\t \t\tLineNumberReader lineReader = new LineNumberReader(reader);\n\t \t\tString line = null;\n\t \t\twhile ((line = lineReader.readLine()) != null) {\n\t \t\t\tm = regexp.matcher(line); //reset the input\n\t \t\t\tif (m.find()) {\n\t \t\t\t\tm_nCount ++;\n\t \t\t\t\toutput = output + String.valueOf(m_nCount) +\" - \" + String.valueOf(lineReader.getLineNumber()) +\": \"+ line + \"\\n\";\n\t \t\t\t}\n\t \t\t}\n\t } catch (IOException ex){\n\t ex.printStackTrace();\n\t }\n\t return output;\n\t }", "public ArrayList<Shout> getMatches(Pattern pattern, String text) {\r\n\t\tArrayList<Shout> matches = new ArrayList<Shout>();\r\n\t\tMatcher m = pattern.matcher(text);\r\n//\t\tint match= 0;\r\n\t\twhile(m.find()){\r\n//\t\t\tLog.i(\"FUCKING WORK\", \"a: \" + m.start());\r\n\t\t\tmatches.add(new Shout(Integer.parseInt(m.group(1)), m.group(2), m.group(3)));\r\n//\t\t\tmatch++;\r\n\t\t}\r\n\t\treturn matches;\r\n\t}", "public static void main(String[] args) {\n Pattern p = Pattern.compile(\"\\\\bis\\\\b\"); // эффект тот же\n\n Matcher m = p.matcher(\"this island is beautiful\");\n while (m.find()){\n System.out.println(m.start() + \" \" + m.group());\n }\n }", "public static void main(String[] args) {\n String myRegExString = \"[a-zA-Z\\\\s]+\";\n\n // This is the string we will check to see if our regex matches:\n String myString = \"The quick brown fox jumped over the lazy dog...\";\n\n // Create a Pattern object (compiled RegEx) and save it as 'p'\n Pattern p = Pattern.compile(myRegExString);\n\n // We need a Matcher to match our compiled RegEx to a String\n Matcher m = p.matcher(myString);\n\n // if our Matcher finds a match\n if (m.find()) {\n // Print the match\n System.out.println(m.group());\n }\n\n String s = \"Hello, Goodbye, Farewell\";\n Pattern p1 = Pattern.compile(\"\\\\p{Alpha}+\");\n Matcher m1 = p1.matcher(s);\n\n while( m.find() ){\n System.out.println(m1.group());\n }\n\n String s1 = \"Hello, Goodbye, Farewell\";\n String s2 = \"Hola, Adios, Hasta Luego\";\n\n String myDelimiter = \", \";\n\n String[] s1array = s1.split(myDelimiter);\n String[] s2array = s2.split(myDelimiter);\n\n System.out.println(\"s1array[0]: \" + s1array[0]);\n System.out.println(\"s1array[1]: \" + s1array[1]);\n System.out.println(\"s1array[2]: \" + s1array[2]);\n System.out.println(\"s2array[0]: \" + s2array[0]);\n System.out.println(\"s2array[1]: \" + s2array[1]);\n System.out.println(\"s2array[2]: \" + s2array[2]);\n\n }", "public static void main(String[] args) {\n String pattern = \"aabe\";\n String text = \"aabaacdeaaabe\";\n\n List<Integer> foundIndexes = KnuthMorrisPrattPatternSearch.performKMPSearch(text, pattern);\n\n if (foundIndexes.isEmpty()) {\n System.out.println(\"Pattern not found in the given text String\");\n } else {\n System.out.println(\"Pattern found in the given text String at positions: \"+\n foundIndexes.stream().map(Object::toString).collect(Collectors.joining(\", \")));\n }\n }", "@Test\n\tvoid runRegExFoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"S(a|r|g)*on\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(30, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "@Override\n public void run() {\n long beginTime = System.currentTimeMillis();\n String[] words = text.split(\" \");\n long endTime = System.currentTimeMillis();\n System.out.printf(\"Regex time: %d;\\n\", endTime - beginTime);\n int count = 0;\n beginTime = System.currentTimeMillis();\n for (int i = 0; i < text.length(); i++) {\n char c = text.charAt(i);\n if (c == ' ' || c == '.' || c == '!' || c == '?') {\n count++;\n }\n }\n endTime = System.currentTimeMillis();\n System.out.printf(\"For time: %d;\\n\", endTime - beginTime);\n System.out.printf(\"Words: %d;\\n\", words.length);\n System.out.printf(\"Count word: %d;\\n\", count);\n }", "public static void main(String[] args) {\n String pattern = \"orl\";\n String text = \"Hello World in Java\";\n\n searchPatternInText(pattern, text);\n\n //pattern = \"xyz\";\n //searchPatternInText(pattern, text);\n }", "public List<HashSet<Integer>> findMatches(String text) {\n ArrayList<HashSet<Integer>> matches = new ArrayList<>();\n for (String s : words)\n matches.add(new HashSet<>());\n for (int i = 0; i < text.length(); ++i) {\n Node activeNode = root;\n int offset = i;\n while (offset < text.length() && activeNode.numEdges() != 0) {\n char current = text.charAt(offset);\n if (activeNode.hasEdge(current)) {\n activeNode = activeNode.getEdge(current).getTo();\n if (activeNode.isWordEnd())\n matches.get(activeNode.getWordIndex()).add(i);\n ++offset;\n } else\n break;\n }\n }\n return matches;\n }", "public static void main(String[] args)\n {\n String [] roles= {\n \"Городничий\",\"Аммос Федорович\",\n \"Артемий Филиппович\",\n \"Лука Лукич\"};\n String [] textLines={\n \"Городничий: Я пригласил вас, господа, с тем, чтобы сообщить вам пренеприятное известие: к нам едет ревизор.\",\n \"Аммос Федорович: Как ревизор?\",\n \"Артемий Филиппович: Как ревизор?\",\n \"Городничий: Ревизор из Петербурга, инкогнито. И еще с секретным предписаньем.\",\n \"Аммос Федорович: Вот те на!\",\n \"Артемий Филиппович: Вот не было заботы, так подай!\",\n \"Лука Лукич: Господи боже! еще и с секретным предписаньем!\"};\n\n StringBuilder res = new StringBuilder(\"\");\n \n for (String role : roles) {\n \n res.append(role + \":\\n\");\n for (int i = 0; i < textLines.length; i++) {\n if ( textLines[i].matches(\"^\"+role+\":.*\") ){\n res.append(String.valueOf(i+1) + \")\" + textLines[i].substring(role.length()+1));\n }\n }\n res.append(\"\\n\");\n }\n System.out.println( res.toString());\n \n }", "public static void main(String[] args) {\n splitRegex();\n\n }", "private static void grep(File f, CharBuffer cb) {\r\n\t\tMatcher lm = linePattern.matcher(cb); // Line matcher\r\n\t\tMatcher pm = null; // Pattern matcher\r\n\t\tint lines = 0;\r\n\t\twhile (lm.find()) {\r\n\t\t\tlines++;\r\n\t\t\tCharSequence cs = lm.group(); // The current line\r\n\t\t\tif (pm == null)\r\n\t\t\t\tpm = pattern.matcher(cs);\r\n\t\t\telse\r\n\t\t\t\tpm.reset(cs);\r\n\t\t\tif (pm.find())\r\n\t\t\t\tSystem.out.print(f + \":\" + lines + \":\" + cs);\r\n\t\t\tif (lm.end() == cb.limit())\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\r\n\r\n\t\tSystem.out.println(\"string=\\\"ppqp\\\", pattern=\\\"pq\\\" output:[1,2] got : \" + findStringAnagrams(\"ppqp\", \"pq\"));\r\n\t\tSystem.out.println(\r\n\t\t\t\t\"string=\\\"abbcabc\\\", pattern=\\\"abc\\\" output:[2,3,4] got : \" + findStringAnagrams(\"abbcabc\", \"abc\"));\r\n\t}", "void solution() {\n\t\t/* Write a RegEx matching repeated words here. */\n\t\tString regex = \"(?i)\\\\b([a-z]+)\\\\b(?:\\\\s+\\\\1\\\\b)+\";\n\t\t/* Insert the correct Pattern flag here. */\n\t\tPattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);\n\n\t\tString[] in = { \"I love Love to To tO code\", \"Goodbye bye bye world world world\",\n\t\t\t\t\"Sam went went to to to his business\", \"Reya is is the the best player in eye eye game\", \"in inthe\",\n\t\t\t\t\"Hello hello Ab aB\" };\n\t\tfor (String input : in) {\n\t\t\tMatcher m = p.matcher(input);\n\n\t\t\t// Check for subsequences of input that match the compiled pattern\n\t\t\twhile (m.find()) {\n\t\t\t\t// /* The regex to replace */, /* The replacement. */\n\t\t\t\tinput = input.replaceAll(m.group(), m.group(1));\n\t\t\t}\n\n\t\t\t// Prints the modified sentence.\n\t\t\tSystem.out.println(input);\n\t\t}\n\n\t}", "private void outputMatchedLines(Pattern grepPattern, BufferedReader reader, BufferedWriter writer) throws IOException {\n String line = null;\n while ((line = reader.readLine()) != null) {\n Matcher matcher = grepPattern.matcher(line);\n if (matcher.find()) {\n writer.write(line);\n writer.write(System.getProperty(\"line.separator\"));\n writer.flush();\n }\n }\n }", "public static void main(String[] args){\n String str = \"aasdfasdfasdfasdfas\";\n String pattern = \"aasdf.*asdf.*asdf.*asdf.*s\";\n// String str = \"mississippi\";\n// String pattern = \"mis*is*ip*.\";\n// String pattern = \"mis*is*p*.\";\n// String pattern = \"mis*is*ip*.\";\n// String str = \"aaaaaaaaaaaaac\";\n// String pattern = \"a*a*a*a*a*a*a*a*a*a*c\";\n long time = System.currentTimeMillis();\n// String str = \"aaaaaaaaaaaaab\";\n// String pattern = \"a*a*a*a*a*a*a*a*a*a*b\";\n System.out.println(find(str,pattern));\n System.out.println(\"time: \" + (System.currentTimeMillis() - time));\n }", "public static void main(String[] args) {\n\t\tString original=\"Java is Programming Language Java asdf Java ghjhfj\";\r\n\t\tString occurence=\"Java\";\r\n\t\t\r\n\t\tint count=0;\r\n\t\tint fromIndex=0;\r\n\t\t\r\n\t\twhile ((fromIndex = original.indexOf(occurence, fromIndex)) != -1 )\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Fount at index: \"+fromIndex);\r\n\t\t\tcount++;\r\n\t\t\tfromIndex++;\r\n\t\t}\r\n\t\tSystem.out.println(\"Total number of occurence of Java: \"+count);\r\n\t}", "public static void RE( String s){\n \tString path = \"txt\";\t\n\t\tFile file = new File(path);\t\t\n\t\tFile[] fs = file.listFiles();\n\t\tString A [ ] = new String [fs.length];\n\t\tfor(int i=0;i<fs.length;i++) {\n\t\t\tA[i]=fs[i].toString();\t\t\n\t\t\tlib.In myfile=new lib.In (A[i]);\n\t\t\tString f=myfile.readAll();\n\t\t\tmyfile.close();\n \n//\t\t\tString pattern =\"[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\\\.[a-zA-Z0-9_-]+)+\";\n//\t\t\tString pattern2 = \"(\\\\()?(\\\\d){3}(\\\\))?[- ](\\\\d){3}-(\\\\d){4}\";\n//\t\t\tString pattern3=\"([a-zA-Z0-9_-]+\\\\.)+w3.org\";\n//\t\t\tString pattern8=\"www.w3.org(/[a-zA-Z0-9_-]+)+/\";\n//\t\t\tString pattern9=\"www.w3.org(/[a-zA-Z0-9_-]+)+/#[a-zA-Z0-9_-]+\";\n//\t\t\tString pattern5=\"([a-zA-Z0-9_-]+\\\\.)+com\";\n//\t\t\tString pattern6=\"([a-zA-Z0-9_-]+\\\\.)+net\";\n//\t\t\tString pattern7=\"([a-zA-Z0-9_-]+\\\\.)+org\";\n\t\t\t\n\t\n\t\t\tString pattern10=s;\n\t\t\tPattern r = Pattern.compile(pattern10);\n\t\n\t\t\n\t\t\t// Now create matcher object.\n\t\t\tMatcher m = r.matcher(f);\n\t\t\twhile (m.find( )) {\n\t\t\t\tSystem.out.println(A[i]);\n\t\t\t\tSystem.out.println(\"Found value: \" + m.group(0) + \" at \" + m.start(0));\n\t\t\t} \n\t\t}\n }", "public static void main (String ... args) {\n\n String titulo = \"simple\";\n String pattern = \"abc\";\n String source = \"avsfvasdfabcwefewafabc\";\n find(titulo, pattern, source);\n\n ////////////////////////\n titulo = \"Digitos...\";\n pattern = \"\\\\d\";\n source = \"9a8d70sd98f723708\";\n find(titulo, pattern, source);\n\n titulo = \"NO Digitos...\";\n pattern = \"\\\\D\";\n source = \"9a8d70sd98f723708\";\n find(titulo, pattern, source);\n\n titulo = \"\";\n pattern = \"a?\";\n source = \"aba\";\n find(titulo, pattern, source);\n\n titulo = \"dot methacharacter\";\n pattern = \"a.c\";\n source = \"ac abc a c\";\n find(titulo, pattern, source);\n\n titulo =\"Operator ^ carat\";\n pattern = \"proj1([^,])*\";\n source = \"proj3.txt,proj1sched.pdf,proj1,prof2,proj1.java\";\n find(titulo, pattern, source);\n\n }", "public static void main(String[] args)\n {\n try\n {\n System.out.println(\"Regular expression [\"+args[0]+\"]\");\n NameParser parser = new NameParser();\n StringMatcher matcher = parser.parse(args[0]);\n for (int index = 1; index < args.length; index++)\n {\n String string = args[index];\n System.out.print(\"String [\"+string+\"]\");\n System.out.println(\" -> match = \"+matcher.matches(args[index]));\n }\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tRepeatedStringMatch result = new RepeatedStringMatch();\n\t\tSystem.out.println(result.repeatedStringMatch(\"abcd\", \"cdabcdab\"));\n\t\tSystem.out.println(result.repeatedStringMatch(\"a\", \"aa\"));\n\t}", "public static void main(String[] args)\n {\n Pattern pattern = Pattern.compile(\"aba\");\n Matcher m = pattern.matcher(\"abababa\");\n //boolean find()//return true if found the pattern and go to the next sub sequence\n while(m.find()){\n System.out.print(m.start());//0 and 4 but not 2!\n System.out.print(m.end());//3 and 7 (return the position of the last char matched + 1)\n System.out.print(m.group());// = s.substring(m.start(), m.end());\n System.out.print(\"\\n\");\n }\n //what's append?\n //first occurence starts at 0, ends at 2 and aba\n //search for the second occurence from 3\n //second occurence starts at 4, ends at 6 and aba\n //search for the thrid occurence from 7\n \n System.out.print(\"========\\n\");\n \n //0-length matches\n Pattern pattern2 = Pattern.compile(\"a?\");\n Matcher m2 = pattern2.matcher(\"aba\");\n while(m2.find()){\n System.out.print(m2.start());//the char a is or not is at position 0,1,2 and 3\n System.out.print(m2.end());//1,1,3,3 ==> ?? @see page 500\n System.out.print(\"\\n\");\n }\n \n /** Expressions **/\n // \\d digit\n // \\s whitespace\n // \\w letters, digits or _\n // [abc] searching for a, b or c\n // [a-f] searching for a letter to f lettre included\n // [A-F] searching for A letter to F lettre included\n // [a-fA-F] search for a letter to f or A letter to F lettre included\n // 0 [x-X] search for 0 followed by x or X\n /** quantifiers **/\n //? Zero or one\n //* Zero or more\n //+ One or more\n// 0[x-X]+ => 0 followed by one x or one X\n// (0[x-X])+ => 0 followed by x or X one time\n \n //. = any char (whitespace is a char)\n //Escaping special char !!! . = any char, \\. = compilator error, \\\\. = .\n }", "public static void main2(String args[]) {\n String s1 = \"2009-03-10T16:08:55.184 -0600 [ 16621850][ 162233] INFO - thredds.server.opendap.NcDODSServlet - Remote host: 128.117.140.71 - Request: \\\"GET /thredds/dodsC/model/NCEP/NAM/CONUS_80km/NAM_CONUS_80km_20090309_0000.grib1.dods?Geopotential_height%5B7:1:7%5D%5B0:10:10%5D%5B0:1:64%5D%5B0:1:92%5D HTTP/1.1\\\"\";\r\n // 1 2 3 4 5 6 7 8 9\r\n Pattern p1 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Remote host: ([^-]+) - Request: \\\"(\\\\w+) (.*) (.*)\");\r\n\r\n show(s1, p1);\r\n\r\n // 1 2 3 4 5 6 7 8 9\r\n String s2 = \"2009-03-10T16:08:54.617 -0600 [ 16621283][ 162230] INFO - thredds.server.opendap.NcDODSServlet - Request Completed - 200 - -1 - 47\";\r\n // 1 2 3 4 5 6 7 8 9\r\n Pattern p2 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Request Completed - (\\\\d+) - (.*) - (.*)\");\r\n// Pattern p1 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Remote host: ([^-]+) - Request: \\\"(\\\\w+) (.*) (.*)\");\r\n\r\n show(s2, p2);\r\n\r\n// Pattern p2 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Request Completed - (\\\\d+) - (.*) - (.*)\");\r\n// Pattern p1 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Remote host: ([^-]+) - Request: \\\"(\\\\w+) (.*) (.*)\");\r\n Pattern p3 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - (.*)\");\r\n\r\n show(s1, p3);\r\n show(s2, p3);\r\n\r\n }", "private static int matchFunction(Scanner inputStream, List<Character> text, List<Character> pattern) {\n\n int countPattern = 0;//Keeps track of the successful occurrences.\n\n while (inputStream.hasNext()) { //checks for every new line of the text file.\n\n String[] line = inputStream.nextLine().split(\" \"); //Splits the line into tokens.\n\n\n for(String word: line){\n //For every token analyzed, turn every token into an array of characters and store it in the list.\n for(int i =0 ; i < word.length(); i++){\n text.add(word.charAt(i));\n }//end for\n\n int result = findBrute(text, pattern); //returns the index where the substring is found.\n\n if (result != -1) { //if it returns anything but -1, substring was found in the token.\n countPattern++; //increment for every matching substring found.\n }//end if\n\n text.clear(); //clears the token from the list. loops back again for the next token.\n }//end for\n\n }//end while\n inputStream.close(); //closes input stream.\n return countPattern;\n }", "Match getMatches();", "public static void main(String[] args) {\n//\n// String pattern = \"abba\";\n// String s = \"dog cat cat fish\";\n\n\n// String pattern = \"aaaa\";\n// String s = \"dog cat cat dog\";\n\n String pattern = \"abba\";\n String s = \"dog dog dog dog\";\n\n// String pattern = \"e\";\n// String s = \"eukera\";\n\n boolean flag = wordPattern(pattern, s);\n\n System.out.println(flag);\n }", "public static List<String> get_matches(String s, String p) {\n List<String> matches = new ArrayList<String>();\r\n Matcher m = Pattern.compile(p).matcher(s);\r\n while (m.find()) {\r\n matches.add(m.group(1));\r\n }\r\n return matches;\r\n }", "public static void main(String[] args) {\n String s=\"a /*a*/ sd /*v*/\";\n Pattern p = Pattern.compile(\"(\\\\/\\\\*(\\\\w|\\r\\n)+\\\\*\\\\/)\");\n Matcher m = p.matcher(s);\n List<String> l = new ArrayList<>(100);\n\n while (m.find()) {\n System.out.println(\"tick\");\n l.add(s.substring(m.start()+2, m.end()-2));\n }\n\n System.out.println(l);\n }", "private Annotation[] testRegEx(String regEx) {\n\t\tQueriableAnnotation data = this.parent.getActiveDocument();\n\t\treturn ((data == null) ? null : Gamta.extractAllMatches(data, regEx, 64));\n\t}", "public List<HashSet<Integer>> findMatchesAC(String text) {\n ArrayList<HashSet<Integer>> matches = new ArrayList<>();\n for (String s : words)\n matches.add(new HashSet<>());\n Node activeNode = root;\n for (int i = 0; i < text.length(); ++i) {\n char c = text.charAt(i);\n while (!activeNode.hasEdge(c)) {\n if (activeNode == root)\n break;\n else\n activeNode = activeNode.getFailureLink();\n }\n //If activeNode has an edge matching the current char inspected, follow it\n if (activeNode.hasEdge(c))\n activeNode = activeNode.getEdge(c).getTo();\n //If activeNode now corresponds to a word, save the match\n if (activeNode.isWordEnd())\n matches.get(activeNode.getWordIndex()).add(i - activeNode.getDepth() + 1);\n //Follow any valid chain of dictionary links to save these possible matches\n Node dictNode = activeNode.getDictionaryLink();\n while (dictNode != null) {\n matches.get(dictNode.getWordIndex()).add(i - dictNode.getDepth() + 1);\n dictNode = dictNode.getDictionaryLink();\n }\n }\n return matches;\n }", "public static void main(String[] args) throws Exception {\n String patronA = \"[0-5]\";\n\n // conjunto de letras de \"a\" a \"c\"\n String patronB = \"[a-c]\";\n\n // conjunto de todas las letras minusculas\n String patronC = \"[a-z]\";\n\n // conjunto de numeros\n String patronD = \"[0-9]\";\n\n // ejemplo con tipo de dato string\n String textoAlfanumerico = \"0123aaaa\";\n System.out.println(\"Texto alfanumerico:\" + textoAlfanumerico);\n\n String replace1 = textoAlfanumerico.replaceAll(patronA, \"X\");\n System.out.println(\"Reemplazo de numeros con X: \" + replace1);\n\n String replace2 = textoAlfanumerico.replaceAll(patronB, \"X\");\n System.out.println(\"Reemplazo de letras con X: \" + replace2);\n\n\n //[0-5][a-c];\n //String patronComplejo = patronA + patronB;\n\n //[a-c]*[0-5]*\n //String patronComplejo = patronA + \"*\" + patronB + \"*\";\n\n //\"[a-z]+\"\n\n // + = una coincidencia\n // * = ninguna o muchas\n\n //String patronComplejo = \"(\" + patronA + patronC + \")+\";\n String patronComplejo = \"(\" + patronC + \")+\";\n\n String texto = \"hola, aacc este bbcc es mi 55222aaa texto 2663aaaa blah blah\";\n System.out.println(\"patron complejo:\" + patronComplejo);\n System.out.println(texto);\n\n Pattern pattern = Pattern.compile(patronComplejo);\n Matcher matcher = pattern.matcher(texto);\n\n // buscar ocurrencias\n while (matcher.find()) {\n System.out.println(\"Encontrado:\" + matcher.group());\n }\n\n\n }", "public static void grep(String[] args) {\n\t\t//Boolean to skip the first term in args which is the search term\n\t\tBoolean searchTerm = false;\n\t for (String i : args) {\n\t \t if (searchTerm==false) {\n\t \t\t searchTerm = true;\n\t \t\t continue;\n\t \t }\n\t \t //Print the current directory\n\t \t System.out.println(i);\n\t \t Pattern pat = null; \n\t \t //Make a pattern with the search term\n\t\t try {\n\t\t pat = Pattern.compile(args[0]);\n\t\t } catch (PatternSyntaxException e) {\n\t\t System.err.println(\"Invalid RE syntax: \" + e.getDescription());\n\t\t System.exit(1);\n\t\t }\n\t\t //Open the file\n\t\t BufferedReader in = null;\n\t\t try {\n\t\t in = new BufferedReader(new InputStreamReader(\n\t\t new FileInputStream(i)));\n\t\t } catch (FileNotFoundException e) {\n\t\t System.err.println(\"Unable to open file \" +\n\t\t i + \": \" + e.getMessage());\n\t\t System.exit(1);\n\t\t }\n\n\t\t //Search the file for the search term and also record and print the line numbers with the found lines\n\t\t try {\n\t\t String s;\n\t\t int line = 0;\n\t\t while ((s = in.readLine()) != null) {\n\t\t \tline++;\n\t\t Matcher m = pat.matcher(s);\n\t\t if (m.find())\n\t\t System.out.println(line + \": \" + s);\n\t\t }\n\t\t } catch (Exception e) {\n\t\t System.err.println(\"Error reading line: \" + e.getMessage());\n\t\t System.exit(1);\n\t\t }\n\t } \n\t }", "public static void main(String[] args) {\n Scanner console = new Scanner(System.in);\n String input = console.nextLine();\n Pattern wordPattern = Pattern.compile(\n \"[A-Za-z]+\");\n Matcher matcher = wordPattern.matcher(input);\n while (matcher.find()) {\n System.out.print(matcher.group()+\" \");\n }\n\n }", "public static void main(String[] args)\n {\n String text=\"A B C D | E F G | H I J K L M N O P Q R S | A\";\n Occ occ=new Occ();\n OccList list = new OccList();\n for (String tok: text.split( \" \" ) ) {\n if ( tok.equals( \"|\" )) {\n list.reset();\n continue;\n }\n list.add( occ.orth( tok ) );\n System.out.println( list );\n }\n }", "public static void main(String[] args) {\n String pat = args[0];\n String txt = args[1];\n char[] pattern = pat.toCharArray();\n char[] text = txt.toCharArray();\n\n KMP kmp1 = new KMP(pat);\n int offset1 = kmp1.search(txt);\n\n KMP kmp2 = new KMP(pattern, 256);\n int offset2 = kmp2.search(text);\n\n // print results\n StdOut.println(\"text: \" + txt);\n\n StdOut.print(\"pattern: \");\n for (int i = 0; i < offset1; i++)\n StdOut.print(\" \");\n StdOut.println(pat);\n\n StdOut.print(\"pattern: \");\n for (int i = 0; i < offset2; i++)\n StdOut.print(\" \");\n StdOut.println(pat);\n }", "public static String grepGroup(String text, String pattern) {\n return grepGroup(checkNotNull(text), checkNotNull(pattern), 1, \"i\");\n }", "public static void main(String[] args) {\n\t\tString sampleText = \"In addition, the rook was moved too far to be effective.\";\r\n\t\tScanner scanner = new Scanner(sampleText);\r\n\t\tArrayList<String> list = new ArrayList<>();\r\n\t\t\r\n\t\twhile (scanner.hasNext()) {\r\n\t\t String token = scanner.next();\r\n\t\t list.add(token);\r\n\t\t }\r\n\r\n\t\tfor (String token : list) {\r\n\t\t System.out.println(token);\r\n\t\t}\r\n\r\n\r\n\t}", "private static ArrayList<Integer> patternSearch(String s, String p){\n ArrayList<Integer> indexes = new ArrayList<>(); \n\n for(int i = 0 ; i < s.length() - p.length(); i++){\n\n if(s.substring(i, i + p.length()).equals(p)) indexes.add(i);\n\n\n }\n\n return indexes;\n }", "public static void main(String[] args) {\r\n\r\n\t\tString pattern = \"pattern\";\r\n\t\tString string = \"String used to search for patterns\";\r\n\t\tint sub = bruteForce(string, pattern);\r\n\t\tif (sub > -1) {\r\n\t\t\tSystem.out.println(\"Pattern found at index \" + sub + \": \" + string.substring(sub, sub + pattern.length()));\r\n\t\t} else {\r\n\t\t\tSystem.out.println(pattern + \" not found in \" + string);\r\n\t\t}\r\n\t\tsub = -1;\r\n\t\tsub = KMPSearch(string, pattern);\r\n\t\tif (sub > -1) {\r\n\t\t\tSystem.out.println(\"Pattern found at index \" + sub + \": \" + string.substring(sub, sub + pattern.length()));\r\n\t\t} else {\r\n\t\t\tSystem.out.println(pattern + \" not found in \\\"\" + string + \"\\\"\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\t\n\t\t //1.Write a regex to split String by new line?\n\t\t String regex=\" \";\n\t\t String regex1=\"\\\\n+\"; //Split by new line\n\t\t \n\t\t String regex2=\"\\\\r?\"; //Split by new line also called carraiage return\n\t\t String regex3=\"\\\\r?\\\\n\";//Answer\n\t\t String s =\"subhash is \\n good \\n\\n boy\";\n\t\t String s1 =\"subhash is \\r good boy\";\n\t\t System.out.println(s1);\n\t\t String[] string = s.split(\"\\\\n\");\n\t\t String[] string1 = s.split(\"\\\\n?\");\n\t\t String[] string2 = s.split(\"\\\\n*\");\n\t\t String[] string3 = s.split(\"\\\\n+\");\n\t\t \n\t\t String[] string4 = s.split(\"\\\\n??\");\n\t\t String[] string5 = s.split(\"\\\\n*?\");\n\t\t String[] string6 = s.split(\"\\\\n+?\");\n\t\t \n\t\t String[] string7 = s.split(\"\\\\n?+\");\n\t\t String[] string8 = s.split(\"\\\\n*+\");\n\t\t String[] string9 = s.split(\"\\\\n++\");\n\t\t \n\t\t \n\t\t for(String ss: string)\n\t\t\t System.out.print(ss);\n\t\t \n\t\t //2.What is use of Dot(.) symbol in Java Regex? . represents any number of any characters\n\t\t \n\t\t //3. How to extract a substring using regex ? Example - String test = \"This is a test String and 'This is data we want'\"\n\t\t \n\t\t String input =\"This is a test String and 'This is data we want'\";\n\t\t Pattern pattern = Pattern.compile(\"(')(.*?)(')\");//reluctant quantifier\n\t\t Matcher matcher = pattern.matcher(input);\n\t\t \n\t\t while(matcher.find())\n\t\t {\n\t\t\t System.out.println(matcher.group(1)+matcher.group(2)+matcher.group(3));\n\t\t\t //'This is data we want'\n\t\t }\n\t\t \n\t\t /*\n\t\t \t\n\t\t \t*\t\t\tZero or more occurrences\t\t\t\t\t. * - Any sequence\n\t\t\t?\t\t\tZero or one occurrences(Optional)\t\t\t[0-9]? - Any optional digit\n\t\t\t+\t\t\tOne or more occurrences\t\t\t\t\t\t[0-9]+ - One or more digit\n\t\t\t{x}\t\t\tx instance of occurrences\t\t\t\t\tm{5} - Five instances of the letter m\n\t\t\t{x,y}\t\tbetween x and y instances of occurrences\t[0-9]{13,19} - Between 13 and 19 occurrences\n\t\t\t{x,}\t\tat least x instances of occurrences\t\t\t.{8,} - At least 8 characters\n\t\t \n\t\t \n\t\t */\n\t\t \n\t\t //4. What is difference between matches() and find() in Java Regex?\n\t\t //matches() returns true only if the whole string matches the specified pattern while find() returns trues even if a substring matches the pattern.\n\t\t \n\t\t \n\t\t //5.How to replace all non-alphanumeric characters with empty strings?\n\t\t \n\t\t \n\t\t System.out.println(\"a1A*()\".replaceAll(\"(?i)[a-z0-9]\",\"\"));//*()\n\t\t System.out.println(\"a1A*()\".replaceAll(\"[a-z0-9A-Z]\",\"\"));//*()\n\t\t \n\t\t \n\t\t \n\t\t //How to replace 2 or more spaces with single space in string and delete leading and trailing spaces?\n\t\t System.out.println(\"a b c \".replaceAll(\"\\\\s{1,}\",\" \").trim());\n\t\t \n\t\t //Create a regular expression that accepts alphanumeric characters only. Its length must be five characters long only\n\t\t System.out.println(Pattern.matches(\"(?i)[a-z0-9]{5}\",\"java1\"));//true- Matches check for the whole of input with the regex\n\t\t System.out.println(Pattern.matches(\"(?i)[a-z0-9]{5}\",\"subhad\"));//false\n\t\t \n\t\t //Create a regular expression that accepts 10 digit numeric characters starting with 1, 2 or 3 only.\n\t\t System.out.println(Pattern.matches(\"[123][0-9]{9}\", \"\"));\n\t\t System.out.println(Pattern.matches(\"[123]{1}[0-9]{9}\",\"\"));\n\t\t System.out.println(Pattern.matches(\"[123]{1}[\\\\d]{9}\",\"\"));\n\t\t \n\t\t \n\t\t //How to extract nos from a string\n\t\t List<Integer> list = new ArrayList<>();\n\t\t Pattern pattern1 = Pattern.compile(\"\\\\d+\");\n\t\t Matcher matcher1 = pattern1.matcher(\"1234dfdf4573dfdf5555d2fdf5555df55dfdfd513\");\n\t\t while(matcher1.find())\n\t\t {\n\t\t\t list.add(Integer.parseInt(matcher1.group()));\n\t\t }\n\t\t System.out.println();\n\t\t list.forEach(e->System.out.print(e+\":\"));// 1234:4573:5555:2:5555:55:513: one or more occurrence are grouped together \n\t\t System.out.println();\n\t\t \n\t\t //Pattern pattern1 = Pattern.compile(\"\\\\d\"); will print 1:2:3:4:4:5:7:3:5:5:5:5:2:5:5:5:5:5:5:5:1:3:\n\t\t \n\t\t \n\t\t System.out.println(\"***********\");\n\t\t //\tHow to split Java String by newlines?\n\t\t //\t\\r and \\n CR and LF used in windows\n\t\t \n\t\t \n\t\t String lines[]= \"lk\\r\\rdfdf\\nsd\\rfsdf\\nzsff\".split(\"[\\\\r?\\\\n]\");\n\t\t // lk::dfdf:sd:fsdf:zsff: this will check for each match of \\r or \\n and insert empty lines if there are consecutive line separators\n\t\t \n\t\t lines= \"lk\\r\\rdfdf\\nsd\\rfsdf\\nzsff\".split(\"[\\\\r\\\\n]+\");\n\t\t //lk:dfdf:sd:fsdf:zsff: - if you do not want empty lines\n\t\t \n\t\t //Importance of Pattern.compile()\n\t\t /*\n\t\t A regular expression, specified as a string, must first be compiled into an instance of Pattern class. \n\t\t Pattern.compile() method is the only way to create a instance of object. A typical invocation sequence is thus\n\t\t */\n\n\t\t \n\t\t \n\t\t System.out.println(Pattern.matches(\".s\", \"as\"));//true (2nd char is s) \n\t\t System.out.println(Pattern.matches(\".s\", \"mk\"));//false (2nd char is not s) \n\t\t System.out.println(Pattern.matches(\".s\", \"mst\"));//false (has more than 2 char) \n\t\t System.out.println(Pattern.matches(\".s\", \"amms\"));//false (has more than 2 char) \n\t\t System.out.println(Pattern.matches(\"..s\", \"mas\"));//true (3rd char is s) \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "public static void textQueries(List<String> sentences, List<String> queries) {\n // Write your code here\n for(String q: queries){\n boolean a = false;\n int i=0;\n for(String s: sentences){\n if(Arrays.asList(s.split(\" \")).containsAll(Arrays.asList(q.split(\" \")))){\n System.out.print(i+\" \");\n a = true;\n }\n i++;\n }\n if(!a)\n System.out.println(-1);\n else\n System.out.println(\"\");\n }\n \n }", "public static void main(String[] args) {\n\t\tMatcher m = Pattern.compile(\"(?m)(\\\\S+)\\\\s+((\\\\S+)\\\\s+(\\\\S+))$\").matcher(PESMA);\r\n\t\twhile(m.find()){\r\n\t\t\tfor(int j = 0; j<=m.groupCount();j++)\r\n\t\t\t\tSystem.out.print(\"[\"+m.group(j)+\"]\");\r\n\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t}\r\n\t}", "public static String findMultipleOccorancesOfGivenWord(String sentence,String word)\n {\n if(sentence == null || word == null || sentence == \"\" || word == \"\"){\n return \"Please enter valid sentence and word.It should not be empty and null\";\n }\n String result = \"\";\n Pattern pattern = Pattern.compile(word);\n Matcher matcher = pattern.matcher(sentence);\n while(matcher.find()) {\n\n result = result + \"Found at:\"+ matcher.start() + \" - \" + matcher.end() + \" \";\n }\n\n return result.trim();\n\n }", "public static void main(String[] args) {\n\t \n\t System.out.println(\"Q3) a) The pattern 'BCD' found in text 'ABCADCBABABCDABCD' on index : \"+ search2(\"BCD\".toCharArray(),\"ABCADCBABABCDABCD\".toCharArray()));\n\t \n\t }", "public static void main(String[] args) {\n\t\t\n\t ArrayList<String> emails = new ArrayList<String>();\n\t \n\t // valid email addresses\n\t emails.add(\"sofia@gmail.com\");\n\t emails.add(\"nayak.sofi@ex.co.in\");\n\t emails.add(\"sofi1@example.do.org\");\n\t emails.add(\"shagun_sofi@example.com\");\n\t emails.add(\"sofi-sh@example.com\");\n\t \n\t \n\t //invalid email addresses\n\t emails.add(\"@gmail.com\");\n\t emails.add(\"shagun&ag.com\");\n\t emails.add(\"raghu#@example.us.org\");\n\n\t //initialize the Pattern object\n\t Pattern pattern = Pattern.compile(regex);\n\n\t //searching for occurrences of regex\n\t for (String value : emails) {\n\t Matcher matcher = pattern.matcher(value);\n\t System.out.println(\"Email \" + value + \" is \" + (matcher.matches() ? \"valid\" : \"invalid\"));\n\t System.out.println(\"-----------------------------------------------------\");\n\t \n//\t \tboolean result = Pattern.compile(regex).matcher(value).matches();\n//\t \tSystem.out.println(result);\n\t }\n\n\t}", "public interface Analyzer {\n\n Map<String, List<Integer>> search(StringBuffer text, String... pattern);\n}", "public static void printAllCombinations(String pattern)\n {\n // create an empty stack (we can also use set, queue, vector\n // or any other container)\n Stack<String> stack = new Stack();\n stack.push(pattern); // push the pattern into the stack\n \n int index;\n \n // do till stack is not empty\n while (!stack.empty())\n {\n // pop string from stack and process it\n String curr = stack.pop();\n \n // index stores position of first occurrence of wildcard\n // pattern in curr\n if ((index = curr.indexOf('?')) != -1)\n {\n // replace '?' with 0 and 1 and push it to the stack\n for (char ch = '0'; ch <= '1'; ch++)\n {\n curr = curr.substring(0, index) + ch + \n curr.substring(index + 1);\n stack.push(curr);\n }\n }\n \n // If no wildcard pattern is found, print the string\n else\n System.out.println(curr);\n }\n }", "public static void main(String[] args){\n List<String> inputArrayList = new ArrayList<>();\n Path path = Paths.get(\"log.txt\");\n List<String> output = new ArrayList<>();\n\n try {\n inputArrayList = Files.readAllLines(path);\n Pattern IPAddress = Pattern.compile(\"https://*.com\");\n String substring;\n for (int i = 0; i < inputArrayList.size(); i++){\n Matcher m = IPAddress.matcher(inputArrayList.get(i));\n }\n\n } catch (IOException x){\n System.out.println(\"File not readable.\");\n }\n\n\n }", "private void checkForPattern(Pattern grepPattern, Path[] filePathArray, BufferedWriter writer) {\n for (int j = 0; j < filePathArray.length; j++) {\n try (BufferedReader reader = Files.newBufferedReader(filePathArray[j], Jsh.encoding)) {\n outputMatchedLines(grepPattern, reader, writer);\n } catch (IOException e) {\n throw new RuntimeException(\"grep: cannot open \" + filePathArray[j].getFileName());\n }\n }\n }", "public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n buffer.append(stringDfaMatcher);\n buffer.append(nfaMatcher);\n buffer.append(regExpMatcher);\n return buffer.toString();\n }", "private static void findTokensByPattern (Document doc, String text, int start, int end) {\n\tMatcher emailMatcher = emailPat.matcher(text).region(start,end);\n\tspecialTokenEnd = new HashMap<Integer, Integer>();\n\tspecialTokenType = new HashMap<Integer, String>();\n\twhile (emailMatcher.find()) {\n\t\tint tokenStart = emailMatcher.start();\n\t\tint tokenEnd = emailMatcher.end();\n\t\tspecialTokenEnd.put(tokenStart, tokenEnd);\n\t\tspecialTokenType.put(tokenStart, \"email\");\n\t}\n\tMatcher urlMatcher = urlPat.matcher(text).region(start,end);\n\twhile (urlMatcher.find()) {\n\t\tint tokenStart = urlMatcher.start();\n\t\tint tokenEnd = urlMatcher.end();\n\t\tspecialTokenEnd.put(tokenStart, tokenEnd);\n\t\tspecialTokenType.put(tokenStart, \"url\");\n\t}\n}", "public static void main(String[] args) {\r\n\t\tString text = \"thestoryofleetcodeandme\";\r\n\t\tString[] words = new String[]{\"story\", \"fleet\", \"leetcode\"};\r\n\t\tint[][] arr = findIndexPairs(text, words);\r\n\t\tfor(int[] row : arr)\r\n\t\t{\r\n\t\t\tSystem.out.println(Arrays.toString(row));\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String[] tokens = scanner.nextLine().split(\"\\\\s\");\n String search = scanner.nextLine().trim();\n System.out.println(Collections.frequency(List.of(tokens), search));\n }", "public static void main(String args[]) throws IOException\n\t{\n\t\tif (args.length == 0) {\n\t\t\tregress();\n\t\t}\n\n\t\tString\t pattern = args[0];\n\n\t\tBufferedReader stdin = new BufferedReader(\n\t\t\tnew InputStreamReader(System.in));\n\n\t\tString line;\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"Enter text: \");\n\t\t\tif ((line = stdin.readLine()) == null)\n\t\t\t\tSystem.exit(0);\n\t\t\tif (line.length() == 0)\n\t\t\t\tbreak;\n\t\t\tSystem.out.println(wildmat(line, pattern)?\"match\":\"no match\");\n\t\t}\n\t}", "public static void main(String args[]){\n \"abc\".chars().forEach(System.out::println);\n\n\n //breaks a String into sub-strings according to specified RegEx:\n Stream<String> stream =\n Pattern.compile(\", \").splitAsStream(\"a, b, c\");\n\n stream.forEach(System.out::println);\n\n }", "public static void TestRegex()\n\t{\n\t String line = \" if( aaa&&(ypbreg))\";\n\t String pattern = \"(&&)\\\\s*\\\\(*\\\\s*!?ypbreg\\\\)*\";\n\t // Create a Pattern object\n\t Pattern r = Pattern.compile(pattern);\n\t System.out.println(line.contains(pattern));\n\t // Now create matcher object.\n\t Matcher m = r.matcher(line);\n\t if (m.find( )) {\n\t // System.out.println(\"Found value: \" + m.group(0) );\n\t int count = m.groupCount();\n\t System.out.println(\"group count is \"+count);\n\t for(int i=0;i<count;i++){\n\t System.out.println(m.group(i));\n\t }\n\t // System.out.println(line.replaceFirst(BregPattern.pEqualTrue1, \"!$1\"));\n\n\t } else {\n\t System.out.println(\"NO MATCH\");\n\t }\n\t}", "public static void main(String[] args) {\n\t\tString str = \"32+5*2-40/3\";\r\n\t\t/*\r\n\t\tPattern p = Pattern.compile(\"(([0-9]+)(\\\\+\\\\-\\\\*\\\\/)?)+\");\r\n\t\tMatcher m = p.matcher(str);\r\n\t\tSystem.out.println(m.find());\r\n\t\tSystem.out.println(m.groupCount());\r\n\t\tSystem.out.println(m.group(1));\r\n\t\tSystem.out.println(m.group(2));\r\n\t\tSystem.out.println(m.group(3));\r\n\t\t*/\r\n\t\tString[] sub = str.split(\"\\\\+|\\\\-|\\\\*|\\\\/\");\r\n\t\tfor(String s : sub) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t\t\r\n\t}", "int getGrammarMatchCount();", "public ArrayList<GrammarMatch> extract(String text) {\n text = text.replaceAll(\"\\\\s+\", \" \");\n\n ArrayList<GrammarMatch> bigResult = new ArrayList();\n\n List<ParserToken> stream = this.tokenizer.transform(text);\n\n /**\n * Get morfological data for whole list of tokens\n */\n // TODO make this flexible \n // provide tagger as a parameter to parser\n // add posibility to skip tagging to boost performance\n List<AnalyzedTokenReadings> tags = null;\n\n try {\n UkrainianTagger ut = new UkrainianTagger();\n List<String> sentence = new ArrayList();\n\n stream.forEach(t -> {\n sentence.add(t.value);\n });\n\n tags = ut.tag(sentence);\n\n } catch (IOException ex) {\n Logger.getLogger(GrammarMatch.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // merge pos tags with ParserTokens\n int currentIndex = 0;\n for (ParserToken token : stream) {\n AnalyzedTokenReadings forms = tags.get(currentIndex);\n\n if (forms != null) {\n token.setRawForms(forms);\n }\n currentIndex++;\n }\n\n // preprocess tokens\n for (ParserTokenPreprocessor preprocessor : this.preprocessors) {\n stream = preprocessor.proceed(stream);\n }\n\n // match with grammars\n// int tokenIndex = 0;\n// int lastInsertTokenIndex = 0;\n this.currentTokens = stream;\n\n for (ParserToken token : stream) {\n for (GrammarRuleI grule : this.grammars) {\n\n // TODO get rid of this. use based on interface implementation\n ParserGrammar grammar = (ParserGrammar) grule;\n\n boolean recheck = grammar.shift(token);\n // TODO substitute ParserMatch with parserToken\n ArrayList<ParserMatch> match = grammar.reduce();\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n }\n\n if (recheck) {\n grammar.shift(token);\n match = grammar.reduce();\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n }\n\n }\n\n }\n\n }\n\n // shift repeatable rules to the terminal symbol if any\n// for (GrammarRuleI gr : this.grammars) {\n//\n// visitAllRules(null,gr, (rule,parent) -> {\n// if (!rule.isSimple()) {\n//\n// ParserGrammar pg = (ParserGrammar) rule;\n// System.out.print(\" %%% -> [\"+parent+\"]\" + ((ParserGrammar) rule).getName());\n// if (pg.isRepeatable()) {\n// System.out.print(\" repeatable\");\n// if (pg.isInserted()) {\n// System.out.print(\" is_inserted\");\n// } else {\n// System.out.print(\" not_inserted\");\n//\n// if (!pg.isFirstRun() && pg.getCurrentIndex() == 0) {\n// System.out.print(\" dirty\");\n// \n// pg.setCurrentIndex(pg.rulesCount());\n// \n// if (parent != null) {\n// ParserGrammar pgp = (ParserGrammar) parent;\n// \n// \n// pgp.setCurrentIndex(pgp.getCurrentIndex()+1);\n// System.out.print(\" shift_head[\"+pgp.getCurrentIndex()+\"->\"+(pgp.getCurrentIndex()+1)+\"]\");\n// }\n// \n// \n// }\n// \n// }\n//\n// }\n// System.out.println(\"\");\n//\n// } else {\n//// System.out.println(\" [%%%] -> \");\n// }\n// });\n// }\n\n for (GrammarRuleI grule : this.grammars) {\n\n ParserGrammar grammar = (ParserGrammar) grule;\n\n ArrayList<ParserMatch> match = grammar.reduce(true, false);\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n\n }\n grammar.reset();\n }\n\n return bigResult;\n }", "public static void testScript() throws Exception {\r\n\r\n Pattern p = Pattern.compile(\"#.+?#\");\r\n String txt = \"aaaaaaaaaaaa# 鏈�編涓浗 #fsdfs#a##b#\\r\\naaaaaaaaaaaa#!!鏈�編涓浗2 #\";\r\n\r\n Matcher m = p.matcher(txt);\r\n\r\n while (m.find()) {\r\n System.out.println(m.group(0));\r\n }\r\n\r\n Matcher m2 = p.matcher(\"aaa##bb\");\r\n\r\n while (m2.find()) {\r\n System.out.println(m2.group(1));\r\n }\r\n\r\n }", "public static void main(String[] args) {\n\t\tString s = \"this is a small house .\";\n\t\tString t = \"das ist ein kleines haus .\";\n\t\tString m = \"das ist |0-1| ein kleines |2-3| haus . |4-5|\";\n\t\tArrayList<String> x = new XlingualProjection().ExtractAlignments(s,t,m);\n\t\tfor (int i=0; i<x.size(); i++){\n\t\t\tSystem.out.println(x.get(i));\n\t\t}\n\t\n\t\tString[] y = new XlingualProjection().getSrcPhrases(x);\n\t\tint start = 0;\n\t\tint end = 0;\n\t\t\n\t\tfor(int i=0; i < y.length; i++){ // Traverse through each phrase\n \tend = start + y[i].length();\n \tSystem.out.println(y[i] + \" \" + start + \" \" + end);\n \t\t\n \t\tstart = end+1;\n }\n\n }", "public static ArrayList<String> grepMultiThreadExecute (String file, String pattern, int begin, int end) {\n\t\tArrayList<String> results = new ArrayList<String>(); \n\t\tPattern pat = null; \n \t //Make a pattern with the search term\n\t try {\n\t pat = Pattern.compile(pattern);\n\t } catch (PatternSyntaxException e) {\n\t System.err.println(\"Invalid RE syntax: \" + e.getDescription());\n\t System.exit(1);\n\t }\n\t //Open the file\n\t BufferedReader in = null;\n\t try {\n\t in = new BufferedReader(new InputStreamReader(\n\t new FileInputStream(file)));\n\t } catch (FileNotFoundException e) {\n\t System.err.println(\"Unable to open file \" +\n\t file + \": \" + e.getMessage());\n\t System.exit(1);\n\t }\n\n\t //Search the file for the search term and also record and print the line numbers with the found lines\n\t try {\n\t String s;\n\t String res = null;\n\t int line = 0;\n\t \n\t while ((s = in.readLine()) != null) {\n\t \tif (line<begin) {\n\t \t\tline++;\n\t \t\tcontinue;\n\t \t}\n\t \tline++;\n\t Matcher m = pat.matcher(s);\n\t if (m.find()) {\n\t \tres = (line + \": \" + s);\n\t \tresults.add(res);\n\t }\n\t if (line==end) {\n\t \tbreak;\n\t }\n\t }\n\t } catch (Exception e) {\n\t System.err.println(\"Error reading line: \" + e.getMessage());\n\t System.exit(1);\n\t }\n\t //Return the results\n\t\t\treturn results;\n }", "public String getRegEx();", "public int countAllStringAppearances(List<String> stringsToCheck, String stringToContain) {\n int counter = 0;\n Pattern patternToMatch = Pattern.compile(stringToContain.toLowerCase());\n for (String currentString : stringsToCheck) {\n Matcher matcher = patternToMatch.matcher(currentString.toLowerCase());\n while (matcher.find()) {\n counter ++;\n }\n }\n return counter;\n }", "public static void main(String[] args) {\n\n\t\tString regex = \"\\\\b(\\\\w+)(\\\\b\\\\W+\\\\b\\\\1\\\\b)*\";\n\t\tPattern p = Pattern.compile(regex, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);\n\n\t\tScanner in = new Scanner(System.in);\n\t\tint numSentences = Integer.parseInt(in.nextLine());\n\n\t\twhile (numSentences-- > 0) {\n\t\t\tString input = in.nextLine();\n\n\t\t\tMatcher m = p.matcher(input);\n\n\t\t\t// Check for subsequences of input that match the compiled pattern\n\t\t\twhile (m.find()) {\n\t\t\t\tinput = input.replaceAll(m.group(), m.group(1));\n\t\t\t}\n\n\t\t\t// Prints the modified sentence.\n\t\t\tSystem.out.println(input);\n\t\t}\n\n\t\tin.close();\n\n\t\tnew RegexDuplicateWord().solution();\n\t}", "public static void main(String[] args) {\n\r\n\t\tString password = \"$$ Welcome to 1st Automation Interview $$\" ;\r\n\t\t\r\n\t\tSystem.out.println(password.charAt(5));\r\n\r\n\t\tint lettercount = 0 , digitcount = 0 , specialcount = 0 ; \r\n\r\n\t\tPattern letter = Pattern.compile(\"[a-zA-z]\");\r\n\t\tPattern digit = Pattern.compile(\"[0-9]\");\r\n\t\tPattern special = Pattern.compile (\"[!@#$%&*()_+=|<>?{}\\\\[\\\\]~-]\");\r\n\t\t//Pattern eight = Pattern.compile (\".{8}\");\r\n\r\n\r\n\t\tMatcher hasLetter = letter.matcher(password);\r\n\t\tMatcher hasDigit = digit.matcher(password);\r\n\t\tMatcher hasSpecial = special.matcher(password);\r\n\r\n\r\n\t\tfor (int i = 0 ;password.length()<i ; i++) {\r\n\r\n\t\t\tif(hasLetter.find(password.charAt(i))) {\r\n\r\n\t\t\t\tlettercount++ ;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(lettercount);\r\n\r\n\t\t/*while ( hasLetter.find()) {\r\n\t\t\tlettercount++ ; \r\n\r\n\r\n\r\n\t\t} System.out.println(lettercount);\r\n\r\n\t\twhile (hasDigit.find()) {\r\n\t\t\tdigitcount++ ; \r\n\t\t\tSystem.out.println(hasDigit.group());\r\n\t\t} \r\n\t\tSystem.out.println(digitcount);\r\n\r\n\t\twhile ( hasSpecial.find()) {\r\n\t\t\tSystem.out.println(hasSpecial.group());\r\n\r\n\t\t\tspecialcount++;\r\n\t\t}System.out.println(specialcount);\r\n\t\t */\r\n\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tScanner io=new Scanner(System.in);\r\n\t\tString s=io.nextLine();\r\n\t\t\r\n\t\tint result=match(s.toCharArray(),s.length());\r\n\t\tSystem.out.println(result);\r\n\t}", "public RegexGrep(ShellEnvironment env, String[] args) {\n super(env, args);\n this.regex = Pattern.compile(args[0]);\n }", "public MyStringBuilder2 [] regMatch(String [] pats)\n\t{\n\t\t//System.out.print(\"hi\");\n\t\t\tMyStringBuilder2[] answers = new MyStringBuilder2[pats.length];\n\t\t\tMyStringBuilder2[] finals = new MyStringBuilder2[pats.length];\n\t\t\tfinals = recursiveArrayAdd(finals, pats, 0);\n\t\t\tif(finals[0] == null) {\n\t\t\t\tfinals = null;\n\t\t\t}\n\t\t\treturn finals;\n\t\t\n\t}", "private ReaderWorld() {\r\n pattern = Pattern.compile(regularExpression);\r\n matcher = pattern.matcher(getText());\r\n }", "public static void main(String[] args) {\n\t\t\tString str=\"Four score and seven years ago\";\n\t\t\tSystem.out.println(\"The letter r appears at the following locations: \");\n\t\t\tint position = str.indexOf('r');\n\t\t\twhile (position!= -1) {\n\t\t\t\tSystem.out.print(position + \" \");\n\t\t\t\tposition = str.indexOf('r',position+1);\n\t\t\t}\n\t\t\t\n\t\t\tString str2 = \"and a one and two and a three\";\n\t\t\tSystem.out.println(\"The word \\\" and\\\" appears at the following location: \");\n\t\t\tint positionAnd = str2.indexOf(\"and\");\n\t\t\twhile(positionAnd != -1) {\n\t\t\t\tSystem.out.print(positionAnd + \" \");;\n\t\t\t\tpositionAnd = str2.indexOf(\"and\", positionAnd+1);\n\t\t\t}\n}", "@Test\n\tvoid testFormattedRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthToFormatRE]; \n\t\tint i = 0;\n\t\tfor (String re : toFormatRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Verify if all objects were created\n\t\tfor (RegularLanguage re : rl) {\n\t\t\tif (re.equals(null)) {\n\t\t\t\tfail(); // object couldn't be created\n\t\t\t}\n\t\t}\n\n\t\t// a***** -> a*\n\t\tassertEquals(\"a*\", rl[0].getRE().getFormattedRegex());\n\t\t// aa????? -> a?\n\t\tassertEquals(\"a?\", rl[1].getRE().getFormattedRegex());\n\t\t// a+++++ -> a+\n\t\tassertEquals(\"a+\", rl[2].getRE().getFormattedRegex());\n\t\t// a?*?*?***???* -> a*\n\t\tassertEquals(\"a*\", rl[3].getRE().getFormattedRegex());\n\t\t// a?+?+?+++???+ -> a*\n\t\tassertEquals(\"a*\", rl[4].getRE().getFormattedRegex());\n\t\t// a*+*+*++++***+* -> a*\n\t\tassertEquals(\"a*\", rl[5].getRE().getFormattedRegex());\n\t\t// a?+*?+?***???+++***?+?*+* -> a*\n\t\tassertEquals(\"a*\", rl[6].getRE().getFormattedRegex());\n\t\t\t\n\t}", "public static void scan(String text)\r\n\t{\r\n\t\tchar[] buf = text.toCharArray();\r\n\t\tfor (int i = 0; i < buf.length; i++)\r\n\t\t\tscan(buf[i]);\r\n\t}", "public static void main(String[] args) {\n\t\tWordPattern mySol = new WordPattern();\n\t\tSystem.out.println(mySol.wordPattern(\"abba\", \"dog cat cat dog\"));\n\t\tSystem.out.println(mySol.wordPattern(\"abba\", \"dog cat cat fish\"));\n\t\tSystem.out.println(mySol.wordPattern(\"aaaa\", \"dog cat cat dog\"));\n\t\tSystem.out.println(mySol.wordPattern(\"abba\", \"dog dog dog dog\"));\n\t\t\n\t}", "static int countOccurrences(String str, String word) \r\n\t\t{\n\t\t String a[] = str.split(\" \");\r\n\t\t \r\n\t\t // search for pattern in a\r\n\t\t int count = 0;\r\n\t\t for (int i = 0; i < a.length; i++) \r\n\t\t {\r\n\t\t // if match found increase count\r\n\t\t if (word.equals(a[i]))\r\n\t\t count++;\r\n\t\t }\r\n\t\t \r\n\t\t return count;\r\n\t\t}", "static String[] SplitText(String input, String regex) {\n ArrayList<String> res = new ArrayList<String>();\n Pattern p = Pattern.compile(regex);\n Matcher m = p.matcher(input);\n int pos = 0;\n while (m.find()) {\n res.add(input.substring(pos, m.start()));\n res.add(input.substring(m.start()+1, m.end()-1));\n pos = m.end();\n }\n if(pos < input.length()) res.add(input.substring(pos));\n return res.toArray(new String[res.size()]);\n }", "public static void main(String[] args) {\n Pattern pattern = Pattern.compile(\"\\\\b(\\\\w+)(\\\\W+\\\\1\\\\b)+\",Pattern.CASE_INSENSITIVE);\r\n\r\n Scanner in = new Scanner(System.in);\r\n int numSentences = Integer.parseInt(in.nextLine());\r\n \r\n while (numSentences-- > 0) {\r\n String input = in.nextLine();\r\n \r\n Matcher matcher = pattern.matcher(input);\r\n \r\n while (matcher.find()) \r\n input = input.replaceAll(matcher.group(),matcher.group(1));\r\n // Prints the modified sentence.\r\n System.out.println(input);\r\n }\r\n \r\n in.close();\r\n }", "public static void grepMultiThread(String[] args) {\n\t\t\t\tBoolean searchTerm = false;\n\t\t\t\tString pattern = null;\n\t\t\t for (String i : args) {\n\t\t\t \t if (searchTerm==false) {\n\t\t\t \t\t pattern = i;\n\t\t\t \t\t searchTerm = true;\n\t\t\t \t\t continue;\n\t\t\t \t }\n\t\t\t \t//Print the current directory\n\t\t\t \t System.out.println(i);\n\t\t\t \t int lines = lines(i);\n\t\t\t \t int startEnd = (lines/2);\n\t\t\t \t \n\t\t\t \t //Create an executor and 2 workers\n\t\t\t \t ExecutorService executor = Executors.newFixedThreadPool(2);\n\t\t\t \t \n\t\t\t \t //One workers holds the info for the first half of the file,\n\t\t\t \t //the other worker holds the info for the second half of the file\n\t\t\t \t Callable<ArrayList<String>> worker = new MyCallable(i, pattern, 0, startEnd);\n\t\t\t \t Callable<ArrayList<String>> worker2 = new MyCallable(i, pattern, startEnd, lines);\n\t\t\t \t \n\t\t\t \t \n\t\t\t \t //Run the workers and store the results in Futures\n\t\t\t \t Future <ArrayList<String>> future = executor.submit(worker);\n\t\t\t \t Future <ArrayList<String>> future2 = executor.submit(worker2);\n\t\t\t \t \n\t\t\t \t //Shutdown when complete\n\t\t\t \t executor.shutdown();\n\t\t\t \t\twhile (!executor.isTerminated()) {\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t//Now get the results from the futures and store them into Arraylists\n\t\t\t \t\t//Then print those Arraylists in the correct order, first half then second half\n\t\t\t \t\ttry {\n\t\t\t\t\t\tArrayList<String> results = future.get();\n\t\t\t\t\t\tfor (String s: results) {\n\t\t\t\t \t\t\tSystem.out.println(s);\n\t\t\t\t \t\t}\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} catch (ExecutionException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t \t\t\n\t\t\t \t\ttry {\n\t\t\t\t\t\tArrayList<String> results2 = future2.get();\n\t\t\t\t\t\tfor (String s: results2) {\n\t\t\t\t \t\t\tSystem.out.println(s);\n\t\t\t\t \t\t}\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} catch (ExecutionException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t }\n\t}", "private FontMatch printMatches(PriorityQueue<FontMatch> queue) {\n/* 719 */ FontMatch bestMatch = queue.peek();\n/* 720 */ System.out.println(\"-------\");\n/* 721 */ while (!queue.isEmpty()) {\n/* */ \n/* 723 */ FontMatch match = queue.poll();\n/* 724 */ FontInfo info = match.info;\n/* 725 */ System.out.println(match.score + \" | \" + info.getMacStyle() + \" \" + info\n/* 726 */ .getFamilyClass() + \" \" + info.getPanose() + \" \" + info\n/* 727 */ .getCIDSystemInfo() + \" \" + info.getPostScriptName() + \" \" + info\n/* 728 */ .getFormat());\n/* */ } \n/* 730 */ System.out.println(\"-------\");\n/* 731 */ return bestMatch;\n/* */ }", "@Test\n public void testDebugPrintBasicRegexp() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"(01|10)*1111\");\n BasicRegexp.debugPrintBasicRegexp(0, re1);\n }", "@Test\n\tvoid runRegExUnfoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"Introuvable\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(0, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "public GrepMain Grep (List<String> commandline) {\n if (commandline.size()>3 || commandline.size() < 2){\n System.out.println(\"what input in commandline don not obey format, check it please\");\n }\n // save information from commandline to command, word, fileNames\n String command = (commandline.size() == 2)? \"\":commandline.get(0);\n String word = (commandline.size() == 2)? commandline.get(0):commandline.get(1);\n String fileNames = (commandline.size() == 2)? commandline.get(1):commandline.get(2);\n try {\n //open file if fail print file not found\n BufferedReader readerTxt = new BufferedReader(new InputStreamReader(\n new FileInputStream(fileNames)));\n //[-v] [-i] [-r]\n for (String line = readerTxt.readLine(); line != null; line = readerTxt.readLine()) {\n if (command.contains(\"[-v]\")){\n if (command.contains(\"[-r]\")){\n if (command.contains(\"[-i]\")){\n if (!checkReg(word.toLowerCase(),line.toLowerCase())){\n System.out.println(line);\n }\n }else {\n if (!checkReg(word,line)){\n System.out.println(line);\n }\n }\n }else {\n if (command.contains(\"[-i]\")){\n if (!checkWord(word.toLowerCase(),line.toLowerCase())){\n System.out.println(line);\n }\n }else {\n if (!checkWord(word,line)){\n System.out.println(line);\n }\n }\n }\n }else {\n if (command.contains(\"[-r]\")){\n if (command.contains(\"[-i]\")){\n if (checkReg(word.toLowerCase(),line.toLowerCase())){\n System.out.println(line);\n }\n }else {\n if (checkReg(word,line)){\n System.out.println(line);\n }\n }\n }else {\n if (command.contains(\"[-i]\")){\n if (checkWord(word.toLowerCase(),line.toLowerCase())){\n System.out.println(line);\n }\n }else {\n if (checkWord(word,line)){\n System.out.println(line);\n }\n }\n }\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n System.out.println(\"file not found\");\n }\n return null;\n }", "private void extractAllCitations() {\r\n try {\r\n // gets all matched objects for extracting All Citations.\r\n Matcher matcherObject = matcher.patternMatcher(\"AllCitations\");\r\n\r\n\r\n while (matcherObject.find()) {\r\n allMatches.add(matcherObject.group(1));\r\n }\r\n\r\n // add all citations from allMatches, add it to outputResult\r\n if (!allMatches.isEmpty()) {\r\n format.Formatter(2, allMatches.get(0));\r\n }\r\n \r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Error has occured in extractAllCitations method\");\r\n }\r\n }", "@Test\n public void testPatter(){\n String str = \"select * from t_user where deletea dropa\";\n str = str.toUpperCase();\n // String re = \"(update|delete|insert|drop|alter)\";\n // String re = \"(update\\\\b)|(delete\\\\b)|(insert)|(drop)|(alter)\";\n // String re = \"\\\\b[(update)|(delete)|(insert)|(drop)|(alter)\\\\b\";\n // System.out.println(str.indexOf(\"updatea\"));\n // System.out.println(\"update\".matches(str));\n // System.out.println(str.matches(re));\n /* System.out.println(re.matches(str));\n String[] ss = str.split(re);\n System.out.println(ss.length);\n for(String s: ss){\n System.out.println(s);\n }*/\n\n String re =\"(\\\\bupdate\\\\b)|(\\\\bdelete\\\\b)|(\\\\binsert\\\\b)|(\\\\bdrop\\\\b)|(\\\\balter\\\\b)\";\n Pattern p = Pattern.compile(re,Pattern.CASE_INSENSITIVE );\n Matcher m = p.matcher(str);\n System.out.println(m.find());\n\n }", "public Iterable<Integer> findAll (String pat, String txt) {\n // Fila que armazena as posicoes nas quais foram encontradas \n // o padrao no texto \n Queue<Integer> queue = new Queue<Integer> ();\n\n int N = txt.length ();\n int M = pat.length ();\n // Armazena a posicao das ocorrencias do padrao no texto\n int position;\n // Posicao a partir do qual o texto sera processado\n int start = 0;\n\n // Achando o estado que devemos ficar apos encontrar um padrao no texto\n int X = 1;\n\n // Achando todas as ocorrencias do padrao\n do { \n position = search (txt, start);\n if (position < N) {\n queue.enqueue (position);\n }\n start = position + X;\n } while (start < txt.length ());\n \n return queue;\n }", "public String apply(TregexMatcher tregexMatcher)\n/* */ {\n/* 275 */ return this.result;\n/* */ }", "private static List<String> getAllMatches(final String page, final String pattern, final int group)\n {\n if (page == null || page.length() == 0)\n {\n return Collections.emptyList();\n }\n\n final List<String> trimmedMatches = new ArrayList<String>();\n final List<String> matches = RegExUtils.getAllMatches(page, \"(?is)\" + pattern, group);\n\n for (int i = 0; i < matches.size(); i++)\n {\n final String s = matches.get(i);\n\n final String trimmed = s.trim();\n if (trimmed.length() > 0)\n {\n trimmedMatches.add(trimmed);\n }\n }\n\n return trimmedMatches;\n }", "private static String scan(String text)\r\n\t{\r\n\t\tSystem.out.print(text);\r\n\t\treturn input.nextLine();\r\n\t}", "public int findAllMatches(String regularExpression, BirdView birdView) {\n getLock().getWriteLock();\n try {\n return findAllMatchesWithWriteLockAlreadyHeld(regularExpression, birdView);\n } finally {\n getLock().relinquishWriteLock();\n }\n }", "public static String getAfterRegex(String text, String regex) {\n\t\tMatcher textMatcher = Pattern.compile(regex).matcher(text);\n\t\ttextMatcher.find();\n\t\tint foundI = textMatcher.end();\n\t\tif (sb == null) {\n\t\t\tsb = new StringBuilder();\n\t\t}\n\t\tchar[] chars = text.toCharArray();\n\t\tfor (int i=foundI; i<chars.length; i++) {\n\t\t\tsb.append(chars[i]);\n\t\t}\n\t\tString tokens = sb.toString();\n\t\tsb.setLength(0);\n\t\treturn tokens;\n\t}", "public void processWildcards() {\n ws = new WildcardSegment();\n WildcardSegment next;\n int sw,mw; //Single Wildcard, Multi-Wildcard\n currIndex = 0;\n int ci = -1;\n Highlighter h = jta.getHighlighter();\n h.removeAllHighlights();\n String text = jtfFind.getText();\n \n String jText = jta.getText();\n if (text.equals(\"\")) {\n jtfFind.setBackground(Color.WHITE);\n }\n else {\n if (hasWildcards(text)) {\n int index = 0;\n int currIndex_w = currIndex;\n boolean tryAgain = false;\n text = processEscapeChars_w(text);\n text = validateWildcards(text);\n \n ws.setStart(0);\n next = ws.next;\n \n text = text.replace(\"^^\",\"~!~\");\n \n do {\n sw = text.indexOf(\"^#\");\n mw = text.indexOf(\"^*\");\n \n if ((sw != -1) && (mw != -1)) {\n if (sw < mw) {\n text = text.replaceFirst(\"\\\\Q^#\\\\E\",\"`#\");\n if (sw == 0) {\n ws.type = 1;\n }\n else {\n next.setStart(sw,1);\n index = next.start;\n next = next.next;\n }\n }\n else {\n text = text.replaceFirst(\"\\\\Q^*\\\\E\",\"`*\");\n if (mw == 0) {\n ws.type = 2;\n }\n else {\n next.setStart(mw,2);\n index = next.start;\n next = next.next;\n }\n }\n }\n else if (sw != -1) {\n text = text.replaceFirst(\"\\\\Q^#\\\\E\",\"`#\");\n if (sw == 0) {\n ws.type = 1;\n }\n else {\n next.setStart(sw,1);\n index = next.start;\n next = next.next;\n }\n }\n else {\n text = text.replaceFirst(\"\\\\Q^*\\\\E\",\"`*\");\n if (mw == 0) {\n ws.type = 2;\n }\n else {\n next.setStart(mw,2);\n index = next.start;\n next = next.next;\n }\n }\n \n sw = text.indexOf(\"^#\");\n mw = text.indexOf(\"^*\");\n if ((index != text.length() - 2) && (sw != (index + 2)) && (mw != (index + 2))) {\n next.setStart(index+2);\n index = next.start;\n next = next.next;\n }\n }\n while ((sw != -1) || (mw != -1));\n \n next = ws;\n while(next.start != -1) {\n switch (next.type) {\n case 0:\n if (next.next.type == -1) {\n next.seg = text.substring(next.start);\n }\n else {\n next.seg = text.substring(next.start,next.next.start);\n }\n break;\n case 1:\n next.seg = \"~`~\";\n break;\n case 2:\n next.seg = \"`~`\";\n break;\n default:\n //Do nothing\n break;\n }\n next = next.next;\n }\n //text = text.replace(\"~!~\",\"^\");\n next = ws;\n boolean keepLooking = true;\n int bSpace,bTab,bNewline,bIndex;\n while(next.start != -1) {\n switch (next.type) {\n case 0:\n index = jText.toLowerCase().indexOf(next.seg.toLowerCase(),currIndex_w);\n if (index == -1) {\n keepLooking = false;\n }\n else {\n if (next.start == 0) {\n //currIndex = index + 1;\n if (ci == -1) {\n ci = index + 1;\n }\n }\n if (ci == -1) {\n ci = index + 1;\n }\n if (next.next.start != -1) {\n currIndex_w = index + next.seg.length();\n }\n else {\n currIndex_w = index + 1;\n }\n }\n break;\n case 1:\n //index = jText.toLowerCase().indexOf(next.seg.toLowerCase(),currIndex_w);\n if (currIndex_w != jText.length()) {\n index = currIndex_w;\n }\n else {\n index = -1;\n }\n if (index == -1) {\n keepLooking = false;\n }\n else {\n if (next.start == 0) {\n //currIndex = index + 1;\n if (ci == -1) {\n ci = index + 1;\n }\n }\n if (ci == -1) {\n ci = index + 1;\n }\n if (next.next.start != -1) {\n next.seg = String.valueOf(jText.charAt(currIndex_w));\n currIndex_w = index + next.seg.length();\n }\n else {\n next.seg = String.valueOf(jText.charAt(currIndex_w));\n currIndex_w = index + 1;\n }\n }\n break;\n case 2:\n \n if (next.next.start != -1) {\n bIndex = jText.toLowerCase().indexOf(next.next.seg.toLowerCase(),currIndex_w);\n bSpace = jText.toLowerCase().indexOf(StringUtil.ASPACE,currIndex_w);\n bTab = jText.toLowerCase().indexOf(StringUtil.ATAB,currIndex_w);\n bNewline = jText.toLowerCase().indexOf(\"\\n\",currIndex_w);\n if ((bSpace != -1) && ((bSpace < bIndex) || (bIndex == -1))) {\n bIndex = -1;\n }\n \n if ((bTab != -1) && ((bTab < bIndex) || (bIndex == -1))) {\n bIndex = -1;\n }\n if ((bNewline != -1) && ((bNewline < bIndex) || (bIndex == -1))) {\n bIndex = -1;\n }\n index = bIndex;\n if ((currIndex_w != jText.length()) && (index == -1)) {\n tryAgain = true;\n }\n }\n else {\n bSpace = jText.toLowerCase().indexOf(StringUtil.ASPACE,currIndex_w);\n bTab = jText.toLowerCase().indexOf(StringUtil.ATAB,currIndex_w);\n bNewline = jText.toLowerCase().indexOf(\"\\n\",currIndex_w);\n \n bIndex = bSpace;\n if ((bTab != -1) && ((bTab < bIndex) || (bIndex == -1))) {\n bIndex = bTab;\n }\n if ((bNewline != -1) && ((bNewline < bIndex) || (bIndex == -1))) {\n bIndex = bNewline;\n }\n index = bIndex;\n if ((currIndex_w != jText.length()) && (index == -1)) {\n index = jText.length();\n }\n }\n \n if (index == -1) {\n keepLooking = false;\n }\n else {\n next.seg = jText.substring(currIndex_w,index);\n if (next.start == 0) {\n //currIndex = index + 1;\n if (ci == -1) {\n ci = index + 1;\n }\n }\n if (ci == -1) {\n ci = index + 1;\n }\n if (next.next.start != -1) {\n currIndex_w = index + next.seg.length();\n }\n else {\n currIndex_w = index + next.seg.length();\n }\n }\n break;\n default:\n //Do nothing\n break;\n }\n if (keepLooking) {\n next = next.next;\n }\n else {\n if (tryAgain) {\n next = ws;\n tryAgain = false;\n keepLooking = true;\n }\n else {\n break;\n }\n }\n }\n /*\n TestInfo.testWriteLn(\"Find String: \" + ws.makeFindString());\n TestInfo.testWriteLn(\"Find Type: \" + ws.makeFindType());\n TestInfo.testWriteLn(\"Find Start: \" + ws.makeFindStart());\n */\n if (keepLooking) {\n TestInfo.testWriteLn(\"String Found!\");\n }\n else {\n TestInfo.testWriteLn(\"String Not Found!\");\n }\n \n //Do search\n text = ws.makeFindString();\n index = jText.toLowerCase().indexOf(text.toLowerCase(),currIndex);\n if (index == -1) {\n jtfFind.setBackground(Color.RED);\n }\n else {\n try {\n currIndex = ci;\n // An instance of the private subclass of the default highlight painter\n Highlighter.HighlightPainter myHighlightPainter = new MyHighlightPainter(Color.YELLOW);\n oldHighlightPainter = myHighlightPainter;\n h.addHighlight(index,index+text.length(),myHighlightPainter);\n jtfFind.setBackground(Color.WHITE);\n jta.setSelectionColor(Color.CYAN);\n //jta.selectAll();\n jta.select(index,index+text.length());\n lastHighlight[0] = index;\n lastHighlight[1] = index + text.length();\n //jta.setSelectionEnd(index + text.length());\n }\n catch (BadLocationException e) {\n //Do nothing\n }\n }\n }\n else {\n text = processEscapeChars(text);\n \n int index = jText.toLowerCase().indexOf(text.toLowerCase());\n if (index == -1) {\n jtfFind.setBackground(Color.RED);\n }\n else {\n try {\n currIndex = index + 1;\n // An instance of the private subclass of the default highlight painter\n Highlighter.HighlightPainter myHighlightPainter = new MyHighlightPainter(Color.YELLOW);\n oldHighlightPainter = myHighlightPainter;\n h.addHighlight(index,index+text.length(),myHighlightPainter);\n jtfFind.setBackground(Color.WHITE);\n jta.setSelectionColor(Color.CYAN);\n //jta.selectAll();\n jta.select(index,index+text.length());\n lastHighlight[0] = index;\n lastHighlight[1] = index + text.length();\n //jta.setSelectionEnd(index + text.length());\n }\n catch (BadLocationException e) {\n //Do nothing\n }\n }\n }\n }\n }", "java.lang.String getRegex();", "java.lang.String getRegex();" ]
[ "0.7732845", "0.7301418", "0.6801707", "0.66742915", "0.6075175", "0.6071267", "0.60184515", "0.59916633", "0.5723449", "0.5597834", "0.5578458", "0.5559976", "0.55451745", "0.55279005", "0.5477942", "0.546708", "0.5437158", "0.54360574", "0.5434503", "0.5428034", "0.53912437", "0.5351645", "0.53516203", "0.5340582", "0.53292245", "0.53141993", "0.529039", "0.52718633", "0.52681834", "0.52612466", "0.5252588", "0.5250814", "0.52499276", "0.5237536", "0.52192605", "0.52094686", "0.5189127", "0.5181116", "0.5152727", "0.51413184", "0.5126881", "0.5123653", "0.5121589", "0.5119703", "0.511514", "0.51046705", "0.50969255", "0.5094255", "0.5085036", "0.5080817", "0.5074172", "0.506679", "0.5065091", "0.505889", "0.50502783", "0.5048051", "0.50458765", "0.5040602", "0.50388837", "0.5031837", "0.50249404", "0.50189346", "0.501852", "0.49681988", "0.49542812", "0.49137497", "0.49114674", "0.4905984", "0.49030095", "0.4899573", "0.48985678", "0.48981443", "0.4869161", "0.48617512", "0.48497236", "0.48440567", "0.4837711", "0.48330456", "0.4824299", "0.48183477", "0.4812442", "0.4800937", "0.47858867", "0.47842246", "0.4779107", "0.47559568", "0.47462714", "0.47424322", "0.47397888", "0.47357985", "0.47346476", "0.47241405", "0.47221532", "0.47097448", "0.47060278", "0.47051445", "0.47048208", "0.46991843", "0.46960378", "0.46960378" ]
0.7838839
0
Returns all the RegexResult objects for regex matches within a string
public static ArrayList<RegexResult> getMatches(String text, String regex) { Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(text); // Check all occurrences ArrayList<RegexResult> results = new ArrayList<>(); while (matcher.find()) { results.add(new RegexResult(matcher.group(), matcher.start(), matcher.end())); //System.out.print("Start index: " + matcher.start()); //System.out.print(" End index: " + matcher.end()); //System.out.println(" Found: " + matcher.group()); } return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private DynamicObject getMatchResult(TruffleObject result, String inputStr) {\n return JSArray.createLazyRegexArray(context, regexResultAccessor.groupCount(result), result, inputStr);\n }", "public static ArrayList<String> getMatches(String text, String regex) {\n\t\tArrayList<String> matches = new ArrayList<String>();\n\n\t\t// create regex pattern and matcher\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tMatcher matcher = pattern.matcher(text);\n\n\t\tint index = 0;\n\n\t\t// keep going while found a match in text\n\t\twhile (index < text.length() && matcher.find(index)) {\n\n\t\t\t// store matching substring\n\t\t\tmatches.add(replaceSymbols(text.substring(matcher.start(), matcher.end())));\n\n\t\t\tif (matcher.start() == matcher.end()) {\n\t\t\t\t// advance index if matched empty string\n\t\t\t\tindex = matcher.end() + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// otherwise start looking at end of last match\n\t\t\t\tindex = matcher.end();\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t}", "Match getMatches();", "java.lang.String getRegex();", "java.lang.String getRegex();", "public String getRegEx();", "public String getRegex();", "com.google.protobuf.ByteString\n getRegexBytes();", "com.google.protobuf.ByteString\n getRegexBytes();", "public static List<String> get_matches(String s, String p) {\n List<String> matches = new ArrayList<String>();\r\n Matcher m = Pattern.compile(p).matcher(s);\r\n while (m.find()) {\r\n matches.add(m.group(1));\r\n }\r\n return matches;\r\n }", "public Matcher getMatcher(String matchedString, String regex) {\n Pattern r = Pattern.compile(regex);\r\n\r\n // Now create matcher object.\r\n Matcher m = r.matcher(matchedString);\r\n\r\n return m;\r\n }", "Match getResultMatch();", "List<T> findMatches(final String value);", "protected abstract Regex pattern();", "public interface RegExp {\n String NAME_REGEXP = \"^[А-Я][а-я]{2,30}$\";\n String AGE_REGEXP = \"^((1[012][0-9])|([1-9][0-9]))$\";\n String EMAIL_REGEXP = \"^[-z0-9_.]{1,30}@([A-z]+[A-z0-9]{1,15}.){1,2}([A-z]+[A-z0-9]{1,15})$\";\n String CELL_PHONE_REGEXP = \"([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2}$\";\n String CELL_PHONE_OPTIONAL_REGEXP = \"^(([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2})?\";\n String LOCAL_PHONE_REGEXP = \"^([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|(\\\\d{3}))?[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{3}$\";\n String COMMENT_REGEXP = \"^([\\\\d\\\\s\\\\w\\\\.\\\\,\\\\!]){0,127}$\";\n String GROUP_REGEXP = \"^[А-я]{4,10}$\";\n String SKYPE_NICK_REGEXP = \"^[\\\\w\\\\d\\\\_]{3,20}$\";\n String INDEX_REGEXP = \"^[\\\\d]{8}$\";\n String CITY_STREET_REGEXP = \"^[А-Я][а-я]{3,20}$\";\n String BUILDING_REGEXP = \"^[\\\\d]{1,3}[\\\\w]?$\";\n String FLAT_REGEXP = \"^[\\\\d]{1,3}$\";\n}", "private Annotation[] testRegEx(String regEx) {\n\t\tQueriableAnnotation data = this.parent.getActiveDocument();\n\t\treturn ((data == null) ? null : Gamta.extractAllMatches(data, regEx, 64));\n\t}", "public List<Match> getAllMatches() {\n\t\treturn matchers.stream()\n\t\t\t\t.flatMap(m -> m.getMatches().stream())\n\t\t\t\t.distinct()\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public String getMatchRegex() {\n return matchRegex;\n }", "public static void printMatches(String text, String regex) {\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(text);\n // Check all occurrences\n while (matcher.find()) {\n System.out.print(\"Start index: \" + matcher.start());\n System.out.print(\" End index: \" + matcher.end());\n System.out.println(\" Found: \" + matcher.group());\n }\n }", "private String getStringMatching(final String input, final String regex) {\n\t\tLOGGER.debug(\"trying to locate a pattern {} in the input {}\", regex, input);\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tString match = null;\n\t\tMatcher m = pattern.matcher(input);\n\t\twhile (m.find()) {\n\t\t\tfinal String matchingGroup = m.group().trim();\n\t\t\tif (matchingGroup.length() > 0) {\n\t\t\t\tmatch = matchingGroup;\n\t\t\t}\n\t\t}\n\t\treturn match;\n\t}", "public static void StringFinder()\n {\n // String to be scanned to find the pattern.\n String TargetString = \"Find me in me this string me, test me\";\n String SearchExpression_literal = \"me\"; // Default Pattern (RegEx ) group\n\n // Create a Pattern object\n Pattern r = Pattern.compile(SearchExpression_literal);\n // Now create matcher object.\n Matcher m = r.matcher(TargetString);\n\n int SearchFindCounter = 0;\n /**\n * Matcher.find() Returns Boolean for every occurrence found\n */\n if (m.find())\n { \n \t System.out.println(\"Match Found\");\n }\n }", "public ArrayList<Shout> getMatches(Pattern pattern, String text) {\r\n\t\tArrayList<Shout> matches = new ArrayList<Shout>();\r\n\t\tMatcher m = pattern.matcher(text);\r\n//\t\tint match= 0;\r\n\t\twhile(m.find()){\r\n//\t\t\tLog.i(\"FUCKING WORK\", \"a: \" + m.start());\r\n\t\t\tmatches.add(new Shout(Integer.parseInt(m.group(1)), m.group(2), m.group(3)));\r\n//\t\t\tmatch++;\r\n\t\t}\r\n\t\treturn matches;\r\n\t}", "private ArrayList<String> tokeniseString(String string) {\n ArrayList<String> tokens = new ArrayList<>();\n\n // Regex that tokenises based on the rules of the assignment\n String regex = \"(https?:\\\\/\\\\/[^\\\\s]+)|((www)?[^\\\\s]+\\\\.[^\\\\s]+)|(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])|([A-Z][a-zA-Z0-9-]*)([\\\\s][A-Z][a-zA-Z0-9-]*)+|(?:^|\\\\s)'([^']*?)'(?:$|\\\\s)|[^\\\\s{.,:;”’()?!}]+\";\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(string);\n\n // Add all terms to the array\n while (matcher.find()) {\n tokens.add(matcher.group());\n }\n\n ArrayList<String> processedTokens = new ArrayList<>();\n\n // Need to remove quotes, commas, etc. leading and trailing\n for (String token : tokens) {\n token = token.trim();\n\n // Remove leading punctuation\n while (token.startsWith(\".\") || token.startsWith(\",\") || token.startsWith(\"'\") || token.startsWith(\"\\\"\") || token.startsWith(\"_\") || token.startsWith(\"[\")) {\n token = token.substring(1);\n }\n\n // Remove trailing punctuation\n while (token.endsWith(\".\") || token.endsWith(\",\") || token.endsWith(\"'\") || token.endsWith(\"\\\"\") || token.endsWith(\"_\") || token.endsWith(\"]\")) {\n token = token.substring(0, token.length() - 1);\n }\n\n // Add to new array\n processedTokens.add(token);\n }\n\n return processedTokens;\n }", "public String apply(TregexMatcher tregexMatcher)\n/* */ {\n/* 275 */ return this.result;\n/* */ }", "public com.google.protobuf.ByteString\n getRegexBytes() {\n java.lang.Object ref = regex_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n regex_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getRegexBytes() {\n java.lang.Object ref = regex_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n regex_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Pattern regexPattern(String regex) {\n return Pattern.compile(regex);\n }", "public static void main(String[] args) {\n String myRegExString = \"[a-zA-Z\\\\s]+\";\n\n // This is the string we will check to see if our regex matches:\n String myString = \"The quick brown fox jumped over the lazy dog...\";\n\n // Create a Pattern object (compiled RegEx) and save it as 'p'\n Pattern p = Pattern.compile(myRegExString);\n\n // We need a Matcher to match our compiled RegEx to a String\n Matcher m = p.matcher(myString);\n\n // if our Matcher finds a match\n if (m.find()) {\n // Print the match\n System.out.println(m.group());\n }\n\n String s = \"Hello, Goodbye, Farewell\";\n Pattern p1 = Pattern.compile(\"\\\\p{Alpha}+\");\n Matcher m1 = p1.matcher(s);\n\n while( m.find() ){\n System.out.println(m1.group());\n }\n\n String s1 = \"Hello, Goodbye, Farewell\";\n String s2 = \"Hola, Adios, Hasta Luego\";\n\n String myDelimiter = \", \";\n\n String[] s1array = s1.split(myDelimiter);\n String[] s2array = s2.split(myDelimiter);\n\n System.out.println(\"s1array[0]: \" + s1array[0]);\n System.out.println(\"s1array[1]: \" + s1array[1]);\n System.out.println(\"s1array[2]: \" + s1array[2]);\n System.out.println(\"s2array[0]: \" + s2array[0]);\n System.out.println(\"s2array[1]: \" + s2array[1]);\n System.out.println(\"s2array[2]: \" + s2array[2]);\n\n }", "public JavaRE(String regex) throws Exception {\n if (ignoreCase) {\n pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);\n } else {\n pattern = Pattern.compile(regex);\n }\n }", "String findMatches(String filePath, String pattern) {\n\t Pattern regexp = Pattern.compile(pattern);\n\t Matcher m = null;\n\t String output = \"\";\n\t Path path = Paths.get(filePath);\n\t try {\n\t \t\tBufferedReader reader = Files.newBufferedReader(path, m_oEncoding);\n\t \t\tLineNumberReader lineReader = new LineNumberReader(reader);\n\t \t\tString line = null;\n\t \t\twhile ((line = lineReader.readLine()) != null) {\n\t \t\t\tm = regexp.matcher(line); //reset the input\n\t \t\t\tif (m.find()) {\n\t \t\t\t\tm_nCount ++;\n\t \t\t\t\toutput = output + String.valueOf(m_nCount) +\" - \" + String.valueOf(lineReader.getLineNumber()) +\": \"+ line + \"\\n\";\n\t \t\t\t}\n\t \t\t}\n\t } catch (IOException ex){\n\t ex.printStackTrace();\n\t }\n\t return output;\n\t }", "public static List<Result> getDataByRegex(String tableName, String regexKey) {\n RegexStringComparator rc = new RegexStringComparator(regexKey);\n RowFilter rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, rc);\n\n Scan scan = new Scan();\n scan.setFilter(rowFilter);\n return getResultsFromScan(tableName, scan);\n }", "public static void main(String[] args) {\n\t\t Pattern p = Pattern.compile(\"(a+)\");\r\n\t\t Matcher m = p.matcher(\"aaaaaba\");\r\n\t\t //System.out.println(m.matches())\r\n\t\t m.find();\t\t \r\n\t\t m.find();\r\n\t\t System.out.println(\"grCount \"+m.groupCount());\t \r\n\t\t MatchResult mr = m.toMatchResult();\r\n\t\t \r\n\t\t System.out.println(m.end());\r\n\t\t System.out.println(\"'\"+mr.group()+\"'\");\r\n\t\t System.out.println(\"start \"+mr.start(1));\r\n\t\t \r\n\t}", "static Extractor byRegex(Pattern pattern) {\n\t\t\treturn Splitter.regexGroupExtractor(pattern);\n\t\t}", "public String getRegEx() {\r\n return regex;\r\n }", "private List<String> retrieveValues(String color, String regex) {\r\n\t\tList<String> split = Arrays.asList(color.split(regex));\r\n\t\tsplit = split.subList(1, split.size());\r\n\t\treturn split;\r\n\t}", "public static void printMatches(String text, String regex) {\n\t\tvar matches = getMatches(text, regex);\n\t\tconsole.printf(\"%10s -> %2d matches: %s %n\", replaceSymbols(regex), matches.size(), matches);\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getRegexBytes() {\n java.lang.Object ref = regex_;\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 regex_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getRegexBytes() {\n java.lang.Object ref = regex_;\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 regex_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "private static String adaptRegEx(Mode mode, String regex, int flagMask, boolean removeWhitespace)\n throws QueryException {\n StringBuilder sb = new StringBuilder();\n boolean escaped = false;\n boolean groupStart = false;\n int completeGroups = 0;\n int backRef = 0;\n int charClassDepth = 0;\n int groupDepth = 0;\n\n for (char c : regex.toCharArray()) {\n if (escaped) {\n if (backRef == 0 && c == '0') {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Reference to group 0 not allowed\");\n } else if (c >= '0' && c <= '9') {\n if (charClassDepth > 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back references in character class expressions\" + \" are disallowed.\");\n }\n backRef = backRef * 10 + Integer.parseInt(Character.toString(c));\n continue;\n }\n }\n\n if (backRef > 0) {\n // Check back reference that just ended\n if (backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n } else {\n backRef = 0;\n escaped = false;\n }\n }\n\n if (c == '\\\\' && !escaped) {\n // Not preceded by backslash\n escaped = true;\n groupStart = false;\n continue;\n }\n\n if (c == '(' && !escaped) {\n groupStart = true;\n groupDepth++;\n escaped = false;\n continue;\n }\n\n if (c == '?' && !escaped && groupStart) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Pure groups are not supported in XQuery regular expressions.\");\n } else if (c == ')' && !escaped) {\n if (--groupDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n completeGroups++;\n } else if (c == '[' && !escaped) {\n charClassDepth++;\n } else if (c == ']' && !escaped) {\n if (--charClassDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n } else if (removeWhitespace) {\n // Remove whitespace outside of character classes\n if (charClassDepth == 0 && WHITESPACE.contains(c)) {\n // Don't touch boolean flags\n continue;\n }\n\n sb.append(c);\n }\n\n groupStart = false;\n escaped = false;\n }\n\n // Check for trailing '\\' (only valid with subsequent characters)\n if (escaped && backRef == 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Trailing backslash character in pattern.\");\n }\n\n // Check back reference if that was last token in pattern\n if (backRef > 0 && backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n }\n\n // Check for dangling brackets\n if (charClassDepth != 0 || groupDepth != 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Pattern contains dangling brackets.\");\n }\n\n if (!removeWhitespace) {\n sb.append(regex);\n }\n\n if (mode == Mode.MATCH) {\n // Adapt for XQuery substring matching by extending pattern\n if (sb.charAt(0) != '^' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.insert(0, \".*\");\n } else {\n sb.insert(0, \"(?s:.*)\");\n }\n }\n\n if (sb.charAt(sb.length() - 1) != '$' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.append(\".*\");\n } else {\n sb.append(\"(?s:.*)\");\n }\n }\n }\n\n return sb.toString();\n }", "public static MatchResult exec(String pattern, String input, int cflags) throws RegexException {\n Regex regex = Regex.compile(pattern, cflags);\n MatchResult result = regex.exec(input);\n regex.free();\n return result;\n }", "private static List<String> getAllMatches(final String page, final String pattern, final int group)\n {\n if (page == null || page.length() == 0)\n {\n return Collections.emptyList();\n }\n\n final List<String> trimmedMatches = new ArrayList<String>();\n final List<String> matches = RegExUtils.getAllMatches(page, \"(?is)\" + pattern, group);\n\n for (int i = 0; i < matches.size(); i++)\n {\n final String s = matches.get(i);\n\n final String trimmed = s.trim();\n if (trimmed.length() > 0)\n {\n trimmedMatches.add(trimmed);\n }\n }\n\n return trimmedMatches;\n }", "@Test\n\tvoid testFormattedRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthToFormatRE]; \n\t\tint i = 0;\n\t\tfor (String re : toFormatRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Verify if all objects were created\n\t\tfor (RegularLanguage re : rl) {\n\t\t\tif (re.equals(null)) {\n\t\t\t\tfail(); // object couldn't be created\n\t\t\t}\n\t\t}\n\n\t\t// a***** -> a*\n\t\tassertEquals(\"a*\", rl[0].getRE().getFormattedRegex());\n\t\t// aa????? -> a?\n\t\tassertEquals(\"a?\", rl[1].getRE().getFormattedRegex());\n\t\t// a+++++ -> a+\n\t\tassertEquals(\"a+\", rl[2].getRE().getFormattedRegex());\n\t\t// a?*?*?***???* -> a*\n\t\tassertEquals(\"a*\", rl[3].getRE().getFormattedRegex());\n\t\t// a?+?+?+++???+ -> a*\n\t\tassertEquals(\"a*\", rl[4].getRE().getFormattedRegex());\n\t\t// a*+*+*++++***+* -> a*\n\t\tassertEquals(\"a*\", rl[5].getRE().getFormattedRegex());\n\t\t// a?+*?+?***???+++***?+?*+* -> a*\n\t\tassertEquals(\"a*\", rl[6].getRE().getFormattedRegex());\n\t\t\t\n\t}", "public java.lang.String getRegexStr() {\r\n return regexStr;\r\n }", "public ArrayList<GrammarMatch> extract(String text) {\n text = text.replaceAll(\"\\\\s+\", \" \");\n\n ArrayList<GrammarMatch> bigResult = new ArrayList();\n\n List<ParserToken> stream = this.tokenizer.transform(text);\n\n /**\n * Get morfological data for whole list of tokens\n */\n // TODO make this flexible \n // provide tagger as a parameter to parser\n // add posibility to skip tagging to boost performance\n List<AnalyzedTokenReadings> tags = null;\n\n try {\n UkrainianTagger ut = new UkrainianTagger();\n List<String> sentence = new ArrayList();\n\n stream.forEach(t -> {\n sentence.add(t.value);\n });\n\n tags = ut.tag(sentence);\n\n } catch (IOException ex) {\n Logger.getLogger(GrammarMatch.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // merge pos tags with ParserTokens\n int currentIndex = 0;\n for (ParserToken token : stream) {\n AnalyzedTokenReadings forms = tags.get(currentIndex);\n\n if (forms != null) {\n token.setRawForms(forms);\n }\n currentIndex++;\n }\n\n // preprocess tokens\n for (ParserTokenPreprocessor preprocessor : this.preprocessors) {\n stream = preprocessor.proceed(stream);\n }\n\n // match with grammars\n// int tokenIndex = 0;\n// int lastInsertTokenIndex = 0;\n this.currentTokens = stream;\n\n for (ParserToken token : stream) {\n for (GrammarRuleI grule : this.grammars) {\n\n // TODO get rid of this. use based on interface implementation\n ParserGrammar grammar = (ParserGrammar) grule;\n\n boolean recheck = grammar.shift(token);\n // TODO substitute ParserMatch with parserToken\n ArrayList<ParserMatch> match = grammar.reduce();\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n }\n\n if (recheck) {\n grammar.shift(token);\n match = grammar.reduce();\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n }\n\n }\n\n }\n\n }\n\n // shift repeatable rules to the terminal symbol if any\n// for (GrammarRuleI gr : this.grammars) {\n//\n// visitAllRules(null,gr, (rule,parent) -> {\n// if (!rule.isSimple()) {\n//\n// ParserGrammar pg = (ParserGrammar) rule;\n// System.out.print(\" %%% -> [\"+parent+\"]\" + ((ParserGrammar) rule).getName());\n// if (pg.isRepeatable()) {\n// System.out.print(\" repeatable\");\n// if (pg.isInserted()) {\n// System.out.print(\" is_inserted\");\n// } else {\n// System.out.print(\" not_inserted\");\n//\n// if (!pg.isFirstRun() && pg.getCurrentIndex() == 0) {\n// System.out.print(\" dirty\");\n// \n// pg.setCurrentIndex(pg.rulesCount());\n// \n// if (parent != null) {\n// ParserGrammar pgp = (ParserGrammar) parent;\n// \n// \n// pgp.setCurrentIndex(pgp.getCurrentIndex()+1);\n// System.out.print(\" shift_head[\"+pgp.getCurrentIndex()+\"->\"+(pgp.getCurrentIndex()+1)+\"]\");\n// }\n// \n// \n// }\n// \n// }\n//\n// }\n// System.out.println(\"\");\n//\n// } else {\n//// System.out.println(\" [%%%] -> \");\n// }\n// });\n// }\n\n for (GrammarRuleI grule : this.grammars) {\n\n ParserGrammar grammar = (ParserGrammar) grule;\n\n ArrayList<ParserMatch> match = grammar.reduce(true, false);\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n\n }\n grammar.reset();\n }\n\n return bigResult;\n }", "public static void main(String[] args) {\n splitRegex();\n\n }", "@JsonValue\n public Map<String, Object> getRegularExpressions()\n {\n if (regularExpressions == null)\n {\n setRegularExpressions(new HashMap());\n }\n return regularExpressions;\n }", "private ReaderWorld() {\r\n pattern = Pattern.compile(regularExpression);\r\n matcher = pattern.matcher(getText());\r\n }", "public ArrayList<String> findSimilarStringsLiterals(String s, double score){\n\t\t\n\t\tsetForSuggestions.clear();\n\t\t\n\t\t// ArrayList for match scores\n\t\tArrayList<StringScore> matchesScores = new ArrayList<StringScore>(); \n\t\t\n\t\t// ArrayList for the matches\n\t\tArrayList<String> matches = new ArrayList<String>();\n\t\t\n\t\t// The trimmed string variable\n\t\tString trimmedString;\n\t\t\n\t\t// Check if it's not a literal\n\t\tif(!s.startsWith(\"\\\"\"))\n\t\t\treturn matches;\n\t\t\n\t\t// Extract what's between double quotes\n\t\ttrimmedString = s.substring(s.indexOf(\"\\\"\")+1,\n\t\t\t\ts.indexOf(\"\\\"\", s.indexOf(\"\\\"\")+1)).toLowerCase();\t// Just choose what is between brackets\n\t\t\n\t\t// Find similar literals withing 5 characters\n\t\tint minLength = trimmedString.length() - 2;\n\t\tint maxLength = trimmedString.length() + 3;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine indices for search in bins\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores - 1);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SuggestionTask(i, i + indexesPerThread, s, trimmedString, score)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Copy contents of the synchronized list into the matchesScores list\n\t\tfor(StringScore stringScore : setForSuggestions) {\n\t\t\tmatchesScores.add(stringScore);\n\t\t}\n\t\t\n\t\t// Sort the candidate matches based on score and return top 5\n\t\tjava.util.Collections.sort(matchesScores, new StringScoreComparator());\n\t\tfor(int i = 0; i < 5 && i < matchesScores.size(); ++i){\n\t\t\tmatches.add(matchesScores.get(i).getS());\n\t\t}\n\t\treturn matches;\n\t}", "public List<Match> listAllMatch() {\n\t\treturn matchDao.list(\"from Match\");\r\n\t}", "public GrammaticaRE(String regex) throws Exception {\n regExp = new RegExp(regex, ignoreCase);\n }", "public static void RE( String s){\n \tString path = \"txt\";\t\n\t\tFile file = new File(path);\t\t\n\t\tFile[] fs = file.listFiles();\n\t\tString A [ ] = new String [fs.length];\n\t\tfor(int i=0;i<fs.length;i++) {\n\t\t\tA[i]=fs[i].toString();\t\t\n\t\t\tlib.In myfile=new lib.In (A[i]);\n\t\t\tString f=myfile.readAll();\n\t\t\tmyfile.close();\n \n//\t\t\tString pattern =\"[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\\\.[a-zA-Z0-9_-]+)+\";\n//\t\t\tString pattern2 = \"(\\\\()?(\\\\d){3}(\\\\))?[- ](\\\\d){3}-(\\\\d){4}\";\n//\t\t\tString pattern3=\"([a-zA-Z0-9_-]+\\\\.)+w3.org\";\n//\t\t\tString pattern8=\"www.w3.org(/[a-zA-Z0-9_-]+)+/\";\n//\t\t\tString pattern9=\"www.w3.org(/[a-zA-Z0-9_-]+)+/#[a-zA-Z0-9_-]+\";\n//\t\t\tString pattern5=\"([a-zA-Z0-9_-]+\\\\.)+com\";\n//\t\t\tString pattern6=\"([a-zA-Z0-9_-]+\\\\.)+net\";\n//\t\t\tString pattern7=\"([a-zA-Z0-9_-]+\\\\.)+org\";\n\t\t\t\n\t\n\t\t\tString pattern10=s;\n\t\t\tPattern r = Pattern.compile(pattern10);\n\t\n\t\t\n\t\t\t// Now create matcher object.\n\t\t\tMatcher m = r.matcher(f);\n\t\t\twhile (m.find( )) {\n\t\t\t\tSystem.out.println(A[i]);\n\t\t\t\tSystem.out.println(\"Found value: \" + m.group(0) + \" at \" + m.start(0));\n\t\t\t} \n\t\t}\n }", "public static void showMatches(String text, String regex) {\n\t\t// create regex and matcher\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tMatcher matcher = pattern.matcher(text);\n\n\t\t// character array to show where matches are located\n\t\tchar fill = '_';\n\t\tchar[] region = new char[text.length()];\n\t\tArrays.fill(region, fill);\n\n\t\t// used to track current match\n\t\tint index = 0;\n\t\tint count = 0;\n\n\t\t// keep going while found a match in text\n\t\twhile (index < text.length() && matcher.find(index)) {\n\t\t\t// converts count to a character\n\t\t\t// will loop through 0-9 and then A-Z as necessary\n\t\t\tfill = Character.forDigit(count % 36, 36);\n\t\t\tfill = Character.toUpperCase(fill);\n\n\t\t\t// indicate region matched\n\t\t\tArrays.fill(region, matcher.start(), matcher.end(), fill);\n\n\t\t\t// test if matched empty string\n\t\t\tif (matcher.start() == matcher.end()) {\n\t\t\t\t// indicate empty string at location was matched\n\t\t\t\tregion[matcher.start()] = '\\u2024';\n\n\t\t\t\t// move to next position to avoid infinite loop\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// otherwise start looking at end of last match\n\t\t\t\tindex = matcher.end();\n\t\t\t}\n\n\t\t\t// increment count\n\t\t\tcount++;\n\t\t}\n\n\t\t// print original string and matching regions\n\t\tconsole.println(text);\n\t\tconsole.println(region);\n\t}", "public Object execute(DynamicObject regExp, String input) {\n TruffleObject flags = compiledRegexAccessor.flags(JSRegExp.getCompiledRegex(regExp));\n boolean global = flagsAccessor.global(flags);\n boolean sticky = ecmaScriptVersion >= 6 && flagsAccessor.sticky(flags);\n long lastIndex = getLastIndex(regExp);\n if (global || sticky) {\n if (invalidLastIndex.profile(lastIndex < 0 || lastIndex > input.length())) {\n setLastIndex(regExp, 0);\n return getEmptyResult();\n }\n } else {\n lastIndex = 0;\n }\n\n TruffleObject result = executeIgnoreLastIndex(regExp, input, lastIndex);\n if (match.profile(regexResultAccessor.isMatch(result))) {\n context.setRegexResult(result);\n if (stickyProfile.profile(sticky && regexResultAccessor.captureGroupStart(result, 0) != lastIndex)) {\n // matcher should never have advanced that far!\n setLastIndex(regExp, 0);\n return getEmptyResult();\n }\n if (global || sticky) {\n setLastIndex(regExp, regexResultAccessor.captureGroupEnd(result, 0));\n }\n if (ecmaScriptVersion < 6) {\n return result;\n }\n return getMatchResult(result, input);\n } else {\n if (ecmaScriptVersion < 8 || global || sticky) {\n setLastIndex(regExp, 0);\n }\n return getEmptyResult();\n }\n }", "public static String[] extract(String source, String regex){\n Pattern p = Pattern.compile(regex);\n Matcher m = p.matcher(source);\n if (m.matches()){\n int count = m.groupCount();\n String[] res = new String[count];\n for (int i = 0; i < count; i++) {\n res[i] = m.group(i+1);\n }\n return res;\n }else{\n return new String[]{};\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic JSONArray findMatches(String query){\n\t\t\n\t\t// Increment the search tasks counter\n\t\t++numOfSearchTasks;\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Number of needed matches\n\t\tresultsToBeFound = 10;\n\t\t\n\t\t// Clear the matches list\n\t\tsetForTypeahead.clear();\n\t\t\n\t\t// The returned JSON array\n\t\tJSONArray arrayObj = new JSONArray();\n\t\t\n\t\t// Search in all predicates\n\t\tfor(int i = 0; i < predicatesList.size(); ++i){\n\t\t\tif(predicatesList.get(i).toLowerCase().contains(query.toLowerCase())){\n\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t}\n\t\t\tArrayList<String> semanticRelations = semanticRelationsMap.get(query.toLowerCase());\n\t\t\tif(semanticRelations != null) {\n\t\t\t\tfor(String s : semanticRelations) {\n\t\t\t\t\tif(predicatesList.get(i).toLowerCase().contains(s.toLowerCase())){\n\t\t\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Search in index first\n\t\tCollection<Integer> list = in.search(query.toLowerCase());\n\t\tHashSet<Integer> output = null;\n\t\tif(list.size() > 0) {\n\t\t\toutput = (HashSet<Integer>) list;\n\t\t}\n\t\telse {\n\t\t\toutput = new HashSet<Integer>();\n\t\t}\n\n\t\t// If found a match, that's a hit\n\t\tif(output.size() > 0) {\n\t\t\t++numOfIndexHits;\n\t\t}\n\t\t\n\t\tfor(Integer index : output) {\n\t\t\tarrayObj.add(frequentLiteralsList.get(index));\n \t\t--resultsToBeFound;\n \t}\n\t\tdouble tempStopTime;\n\t\t// If all results were found in suffix tree\n\t\tif(resultsToBeFound < 0) {\n\t\t\tTimer.stop();\n\t\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\t\ttotalTime += Timer.getTimeInSeconds();\n\t\t\twriteStatsToFile();\n\t\t\treturn arrayObj;\n\t\t}\n\t\t\n\t\tTimer.stop();\n\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\ttempStopTime = Timer.getTimeInSeconds();\n\t\tTimer.start();\n\t\t// In length bins\n\t\t// Search in bins with a minimum length of the query\n\t\t// and a maximum of the query length + 10\n\t\tint minLength = query.length()-1;\n\t\tint maxLength = query.length() + 9;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine which indices of the literals array\n\t\t// to search within\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpruningPercentage += 1 - (1.0 * (maxIndex - minIndex) / literalsList.size());\n\t\ttry{\n\t\tSystem.out.println(\"Searching for \" + query + \" between indeces: \" + minIndex + \n\t\t\t\t\" corresponding to length \" + (literalsList.get(minIndex).length()-5) +\n\t\t\t\t\" and \" + maxIndex + \" corresponding to length \" + \n\t\t\t\t(literalsList.get(maxIndex).length()-5));\n\t\t}\n\t\tcatch(IndexOutOfBoundsException e) {\n\t\t\tSystem.out.println(\"query = \" + query);\n\t\t\tSystem.out.println(\"minIndex = \" + minIndex);\n\t\t\tSystem.out.println(\"maxIndex = \" + maxIndex);\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SearchTask(i, i + indexesPerThread, query)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop timer\n\t\tTimer.stop();\n\t\ttotalTime += tempStopTime + Timer.getTimeInSeconds();\n\t\t\n\t\t// Sort by length\n\t\tArrayList<String> tempList = new ArrayList<String>();\n\t\tfor(String string : setForTypeahead) {\n\t\t\tif(!arrayObj.contains(string))\n\t\t\t\ttempList.add(string);\n\t\t}\n\t\tjava.util.Collections.sort(tempList, new LengthComparator());\n\t\t\n\t\t// Fill the array\n\t\tfor(int i = 0; i < tempList.size() && resultsToBeFound > 0; ++i, --resultsToBeFound) {\n\t\t\tarrayObj.add(tempList.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Update the stats file with number of tasks and hits\n\t\twriteStatsToFile();\n\t\t\n\t\treturn arrayObj;\n\t}", "static Extractor byRegex(String format, Object... args) {\n\t\t\treturn byRegex(RegexUtil.compile(format, args));\n\t\t}", "private static List<String> rastaviizraz(String regex) {\n List<String> izbori = new ArrayList<>();\n int br_zagrada = 0;\n int start = 0;\n for (int i = 0; i < regex.length(); i++) {\n if (regex.charAt(i) == '(' && je_operator(regex, i)) {\n br_zagrada++;\n } else if (regex.charAt(i) == ')' && je_operator(regex, i)) {\n br_zagrada--;\n } else if (br_zagrada == 0 && regex.charAt(i) == '|' && je_operator(regex, i)) {\n izbori.add(regex.substring(start, i));\n start = i + 1;\n }\n }\n if (start > 0) {\n izbori.add(regex.substring(start, regex.length()));\n }\n\n // for (String s : izbori) {\n // System.out.println(s);\n // }\n return izbori;\n }", "public static void main2(String args[]) {\n String s1 = \"2009-03-10T16:08:55.184 -0600 [ 16621850][ 162233] INFO - thredds.server.opendap.NcDODSServlet - Remote host: 128.117.140.71 - Request: \\\"GET /thredds/dodsC/model/NCEP/NAM/CONUS_80km/NAM_CONUS_80km_20090309_0000.grib1.dods?Geopotential_height%5B7:1:7%5D%5B0:10:10%5D%5B0:1:64%5D%5B0:1:92%5D HTTP/1.1\\\"\";\r\n // 1 2 3 4 5 6 7 8 9\r\n Pattern p1 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Remote host: ([^-]+) - Request: \\\"(\\\\w+) (.*) (.*)\");\r\n\r\n show(s1, p1);\r\n\r\n // 1 2 3 4 5 6 7 8 9\r\n String s2 = \"2009-03-10T16:08:54.617 -0600 [ 16621283][ 162230] INFO - thredds.server.opendap.NcDODSServlet - Request Completed - 200 - -1 - 47\";\r\n // 1 2 3 4 5 6 7 8 9\r\n Pattern p2 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Request Completed - (\\\\d+) - (.*) - (.*)\");\r\n// Pattern p1 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Remote host: ([^-]+) - Request: \\\"(\\\\w+) (.*) (.*)\");\r\n\r\n show(s2, p2);\r\n\r\n// Pattern p2 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Request Completed - (\\\\d+) - (.*) - (.*)\");\r\n// Pattern p1 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - Remote host: ([^-]+) - Request: \\\"(\\\\w+) (.*) (.*)\");\r\n Pattern p3 = Pattern.compile(\"^(\\\\d+-\\\\d+-\\\\d+T\\\\d+:\\\\d+:\\\\d+\\\\.\\\\d+ -\\\\d+) \\\\[(.*)]\\\\[(.*)] (\\\\w+)[\\\\s]+- ([^-]+) - (.*)\");\r\n\r\n show(s1, p3);\r\n show(s2, p3);\r\n\r\n }", "static String[] SplitText(String input, String regex) {\n ArrayList<String> res = new ArrayList<String>();\n Pattern p = Pattern.compile(regex);\n Matcher m = p.matcher(input);\n int pos = 0;\n while (m.find()) {\n res.add(input.substring(pos, m.start()));\n res.add(input.substring(m.start()+1, m.end()-1));\n pos = m.end();\n }\n if(pos < input.length()) res.add(input.substring(pos));\n return res.toArray(new String[res.size()]);\n }", "@Test\n\tvoid runRegExFoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"S(a|r|g)*on\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(30, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "private String[] getStringArray(String data, String regex) {\r\n\r\n\t\tLOG.info(\"getStringArray\");\r\n\t\t\r\n\t\tString[] array = data.split(regex);\r\n\r\n\t\tLOG.debug(\"Array [\" + Arrays.toString(array) + \"]\");\r\n\r\n\t\treturn array;\r\n\t\t\r\n\t}", "public RegularExpression() {\n }", "boolean hasRegex();", "public List<Match> getAllMatch() {\n return matchRepository.selectAllMatchesFromDatabase();\n }", "public java.lang.String getRegex() {\n java.lang.Object ref = regex_;\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 regex_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getRegex() {\n java.lang.Object ref = regex_;\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 regex_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Test\r\n public void testGetRegexp() {\r\n final Regexp re = rs.getRegexp(reString);\r\n assertTrue(rs.hasRegexp(reString));\r\n assertSame(rs.getRegexp(reString), re);\r\n }", "public MatchResult getResult() {\n return result;\n }", "@Override\n public Set<Restaurant> getMatches(String queryString) {\n\n /* Setup grammar listener */\n CharStream stream = new ANTLRInputStream(queryString);\n QueryLexer lexer = new QueryLexer(stream);\n TokenStream tokens = new CommonTokenStream(lexer);\n QueryParser parser = new QueryParser(tokens);\n ParseTree tree = parser.root();\n ParseTreeWalker walker = new ParseTreeWalker();\n\n // Setup custom walker\n QueryCreator creator = new QueryCreator();\n walker.walk(creator, tree);\n\n Set<Restaurant> matches = new HashSet<Restaurant>();\n RestaurantHandle rH = creator.getHandle();\n Expression expTree = creator.getExpression();\n\n // Look through every restaurant, if one matches query add it to the set\n for (Restaurant r : this.restaurantMap.values()) {\n rH.setRestaurant(r);\n if (expTree.eval()) {\n matches.add(r);\n }\n }\n\n return matches;\n }", "public static void main(String[] args){\n String str = \"aasdfasdfasdfasdfas\";\n String pattern = \"aasdf.*asdf.*asdf.*asdf.*s\";\n// String str = \"mississippi\";\n// String pattern = \"mis*is*ip*.\";\n// String pattern = \"mis*is*p*.\";\n// String pattern = \"mis*is*ip*.\";\n// String str = \"aaaaaaaaaaaaac\";\n// String pattern = \"a*a*a*a*a*a*a*a*a*a*c\";\n long time = System.currentTimeMillis();\n// String str = \"aaaaaaaaaaaaab\";\n// String pattern = \"a*a*a*a*a*a*a*a*a*a*b\";\n System.out.println(find(str,pattern));\n System.out.println(\"time: \" + (System.currentTimeMillis() - time));\n }", "public int findAllMatches(String regularExpression, BirdView birdView) {\n getLock().getWriteLock();\n try {\n return findAllMatchesWithWriteLockAlreadyHeld(regularExpression, birdView);\n } finally {\n getLock().relinquishWriteLock();\n }\n }", "public static boolean regexMatches(Regex regex, Slice value)\n {\n byte[] bytes = value.getBytes();\n if (isAscii(bytes)) {\n return regexMatches(regex, bytes);\n }\n return regexMatches(regex, value.toString(UTF_8).getBytes(UTF_8));\n }", "public static void main(String[] args) {\n String regex = \"[1-3[5-7]]\";\n String input = \"1234567890\";\n\n // Compiles the given regular expression into a pattern.\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(input);\n\n // Find matches and print it\n while (matcher.find()) {\n System.out.format(\"Text \\\"%s\\\" found at %d to %d.%n\",\n matcher.group(), matcher.start(),\n matcher.end());\n }\n }", "public static void TestRegex()\n\t{\n\t String line = \" if( aaa&&(ypbreg))\";\n\t String pattern = \"(&&)\\\\s*\\\\(*\\\\s*!?ypbreg\\\\)*\";\n\t // Create a Pattern object\n\t Pattern r = Pattern.compile(pattern);\n\t System.out.println(line.contains(pattern));\n\t // Now create matcher object.\n\t Matcher m = r.matcher(line);\n\t if (m.find( )) {\n\t // System.out.println(\"Found value: \" + m.group(0) );\n\t int count = m.groupCount();\n\t System.out.println(\"group count is \"+count);\n\t for(int i=0;i<count;i++){\n\t System.out.println(m.group(i));\n\t }\n\t // System.out.println(line.replaceFirst(BregPattern.pEqualTrue1, \"!$1\"));\n\n\t } else {\n\t System.out.println(\"NO MATCH\");\n\t }\n\t}", "public static MatchResult exec(String pattern, String input) throws RegexException {\n return exec(pattern, input, 0);\n }", "@Override\n protected void compileRegex(String regex) {\n }", "public interface RegExp {\n String NUMBER_OF_COMPOSITION = \"^[1-2][0-9]|[1-9]$\";\n String BREAK_DATE_BY_DOT = \"[.]\";\n String IDENTIFY_BUMDLE = \"^([E|e][N|n])|[У|у][К|к][Р|р]$\";\n String DURATION = \"^[1-9]|[1-9][0-9]|[1-4][0-9][0-9]$\";\n}", "public MyStringBuilder2 [] regMatch(String [] pats)\n\t{\n\t\t//System.out.print(\"hi\");\n\t\t\tMyStringBuilder2[] answers = new MyStringBuilder2[pats.length];\n\t\t\tMyStringBuilder2[] finals = new MyStringBuilder2[pats.length];\n\t\t\tfinals = recursiveArrayAdd(finals, pats, 0);\n\t\t\tif(finals[0] == null) {\n\t\t\t\tfinals = null;\n\t\t\t}\n\t\t\treturn finals;\n\t\t\n\t}", "public GrandChildOfStringMatch() {}", "public Iterator<LineDetail> getAllMatches(String strHTMLPath) {\n\t\tArrayList<LineDetail> lines = new ArrayList<LineDetail>();\n\t\t\n\t\tLineReader reader = new LineReader(strFlatHTMLPath);\n\t\treader.open();\n\t\t\n\t\tString strLine = \"\";\n\t\tString strCurrentHTMLPath = \"\";\n\t\t\n\t\tfor(long i = 0; ; i++){\n\t\t\n\t\t\tstrLine = reader.readNextLine();\n\t\t\t\n\t\t\tif(strLine == null) break; // reached end of the file\n\t\t\t\n\t\t\t// get the html content from the current line\n\t\t\tstrCurrentHTMLPath = StringUtil.GetFirstRightOf(strLine, \"=\");\n\t\t\t\n\t\t\tif(strHTMLPath.compareTo(strCurrentHTMLPath) == 0)\n\t\t\t{\n\t\t\t\tlines.add(new LineDetail(i, strLine, strHTMLPath));\n\t\t\t}\n\t\t}\n\t\t\n\t\treader.close();\n\t\t\n\t\t\n\t\treturn lines.iterator();\n\t}", "public RegexGrep(ShellEnvironment env, String[] args) {\n super(env, args);\n this.regex = Pattern.compile(args[0]);\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\t\n\t\t //1.Write a regex to split String by new line?\n\t\t String regex=\" \";\n\t\t String regex1=\"\\\\n+\"; //Split by new line\n\t\t \n\t\t String regex2=\"\\\\r?\"; //Split by new line also called carraiage return\n\t\t String regex3=\"\\\\r?\\\\n\";//Answer\n\t\t String s =\"subhash is \\n good \\n\\n boy\";\n\t\t String s1 =\"subhash is \\r good boy\";\n\t\t System.out.println(s1);\n\t\t String[] string = s.split(\"\\\\n\");\n\t\t String[] string1 = s.split(\"\\\\n?\");\n\t\t String[] string2 = s.split(\"\\\\n*\");\n\t\t String[] string3 = s.split(\"\\\\n+\");\n\t\t \n\t\t String[] string4 = s.split(\"\\\\n??\");\n\t\t String[] string5 = s.split(\"\\\\n*?\");\n\t\t String[] string6 = s.split(\"\\\\n+?\");\n\t\t \n\t\t String[] string7 = s.split(\"\\\\n?+\");\n\t\t String[] string8 = s.split(\"\\\\n*+\");\n\t\t String[] string9 = s.split(\"\\\\n++\");\n\t\t \n\t\t \n\t\t for(String ss: string)\n\t\t\t System.out.print(ss);\n\t\t \n\t\t //2.What is use of Dot(.) symbol in Java Regex? . represents any number of any characters\n\t\t \n\t\t //3. How to extract a substring using regex ? Example - String test = \"This is a test String and 'This is data we want'\"\n\t\t \n\t\t String input =\"This is a test String and 'This is data we want'\";\n\t\t Pattern pattern = Pattern.compile(\"(')(.*?)(')\");//reluctant quantifier\n\t\t Matcher matcher = pattern.matcher(input);\n\t\t \n\t\t while(matcher.find())\n\t\t {\n\t\t\t System.out.println(matcher.group(1)+matcher.group(2)+matcher.group(3));\n\t\t\t //'This is data we want'\n\t\t }\n\t\t \n\t\t /*\n\t\t \t\n\t\t \t*\t\t\tZero or more occurrences\t\t\t\t\t. * - Any sequence\n\t\t\t?\t\t\tZero or one occurrences(Optional)\t\t\t[0-9]? - Any optional digit\n\t\t\t+\t\t\tOne or more occurrences\t\t\t\t\t\t[0-9]+ - One or more digit\n\t\t\t{x}\t\t\tx instance of occurrences\t\t\t\t\tm{5} - Five instances of the letter m\n\t\t\t{x,y}\t\tbetween x and y instances of occurrences\t[0-9]{13,19} - Between 13 and 19 occurrences\n\t\t\t{x,}\t\tat least x instances of occurrences\t\t\t.{8,} - At least 8 characters\n\t\t \n\t\t \n\t\t */\n\t\t \n\t\t //4. What is difference between matches() and find() in Java Regex?\n\t\t //matches() returns true only if the whole string matches the specified pattern while find() returns trues even if a substring matches the pattern.\n\t\t \n\t\t \n\t\t //5.How to replace all non-alphanumeric characters with empty strings?\n\t\t \n\t\t \n\t\t System.out.println(\"a1A*()\".replaceAll(\"(?i)[a-z0-9]\",\"\"));//*()\n\t\t System.out.println(\"a1A*()\".replaceAll(\"[a-z0-9A-Z]\",\"\"));//*()\n\t\t \n\t\t \n\t\t \n\t\t //How to replace 2 or more spaces with single space in string and delete leading and trailing spaces?\n\t\t System.out.println(\"a b c \".replaceAll(\"\\\\s{1,}\",\" \").trim());\n\t\t \n\t\t //Create a regular expression that accepts alphanumeric characters only. Its length must be five characters long only\n\t\t System.out.println(Pattern.matches(\"(?i)[a-z0-9]{5}\",\"java1\"));//true- Matches check for the whole of input with the regex\n\t\t System.out.println(Pattern.matches(\"(?i)[a-z0-9]{5}\",\"subhad\"));//false\n\t\t \n\t\t //Create a regular expression that accepts 10 digit numeric characters starting with 1, 2 or 3 only.\n\t\t System.out.println(Pattern.matches(\"[123][0-9]{9}\", \"\"));\n\t\t System.out.println(Pattern.matches(\"[123]{1}[0-9]{9}\",\"\"));\n\t\t System.out.println(Pattern.matches(\"[123]{1}[\\\\d]{9}\",\"\"));\n\t\t \n\t\t \n\t\t //How to extract nos from a string\n\t\t List<Integer> list = new ArrayList<>();\n\t\t Pattern pattern1 = Pattern.compile(\"\\\\d+\");\n\t\t Matcher matcher1 = pattern1.matcher(\"1234dfdf4573dfdf5555d2fdf5555df55dfdfd513\");\n\t\t while(matcher1.find())\n\t\t {\n\t\t\t list.add(Integer.parseInt(matcher1.group()));\n\t\t }\n\t\t System.out.println();\n\t\t list.forEach(e->System.out.print(e+\":\"));// 1234:4573:5555:2:5555:55:513: one or more occurrence are grouped together \n\t\t System.out.println();\n\t\t \n\t\t //Pattern pattern1 = Pattern.compile(\"\\\\d\"); will print 1:2:3:4:4:5:7:3:5:5:5:5:2:5:5:5:5:5:5:5:1:3:\n\t\t \n\t\t \n\t\t System.out.println(\"***********\");\n\t\t //\tHow to split Java String by newlines?\n\t\t //\t\\r and \\n CR and LF used in windows\n\t\t \n\t\t \n\t\t String lines[]= \"lk\\r\\rdfdf\\nsd\\rfsdf\\nzsff\".split(\"[\\\\r?\\\\n]\");\n\t\t // lk::dfdf:sd:fsdf:zsff: this will check for each match of \\r or \\n and insert empty lines if there are consecutive line separators\n\t\t \n\t\t lines= \"lk\\r\\rdfdf\\nsd\\rfsdf\\nzsff\".split(\"[\\\\r\\\\n]+\");\n\t\t //lk:dfdf:sd:fsdf:zsff: - if you do not want empty lines\n\t\t \n\t\t //Importance of Pattern.compile()\n\t\t /*\n\t\t A regular expression, specified as a string, must first be compiled into an instance of Pattern class. \n\t\t Pattern.compile() method is the only way to create a instance of object. A typical invocation sequence is thus\n\t\t */\n\n\t\t \n\t\t \n\t\t System.out.println(Pattern.matches(\".s\", \"as\"));//true (2nd char is s) \n\t\t System.out.println(Pattern.matches(\".s\", \"mk\"));//false (2nd char is not s) \n\t\t System.out.println(Pattern.matches(\".s\", \"mst\"));//false (has more than 2 char) \n\t\t System.out.println(Pattern.matches(\".s\", \"amms\"));//false (has more than 2 char) \n\t\t System.out.println(Pattern.matches(\"..s\", \"mas\"));//true (3rd char is s) \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "public RegularExpressionJSONComparator exact(final String... regexes)\n {\n Stream.of(regexes).map(Pattern::compile).forEach(this.searchPatterns::add);\n return this;\n }", "@java.lang.Override\n public java.lang.String getRegex() {\n java.lang.Object ref = regex_;\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 regex_ = s;\n return s;\n }\n }", "public static void main(String[] args) {\n\t\tRepeatedStringMatch result = new RepeatedStringMatch();\n\t\tSystem.out.println(result.repeatedStringMatch(\"abcd\", \"cdabcdab\"));\n\t\tSystem.out.println(result.repeatedStringMatch(\"a\", \"aa\"));\n\t}", "@java.lang.Override\n public java.lang.String getRegex() {\n java.lang.Object ref = regex_;\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 regex_ = s;\n return s;\n }\n }", "public Map<String, Match> getReferenceMatches();", "private String[] getPatterns(StreamTokenizer st) throws IOException {\n\t\t// get language\n\t\tString lang = getLanguageFromTokenizer(st);\n\n\t\tif (st.nextToken() != StreamTokenizer.TT_EOF)\n\t\t\tthrow new IOException(\n\t\t\t\t\t\"PATTERNS takes exactly one (language) or no arguments (default language)!\");\n\n\t\treturn ng.getPatterns(lang);\n\t}", "@Test\n public void testParseRegexp_valid3() throws InvalidRegexpException {\n BasicRegexp re = BasicRegexp.parseRegexp(\"a b c d\");\n assertEquals(re.toString(), \"abcd\");\n }", "public String[] getPatternsRegEx() {\n return this.patternsRegEx;\n }", "static Collection readMatches(Node nMagic, MagicImpl magic) {\n\t\t// get match nodes\n\t\tNode[] matches = getChildNodes(nMagic, \"match\");\n\t\tArrayList ret = new ArrayList(matches.length);\n\t\tfor (int i = 0; i < matches.length; i++) {\n\t\t\t// get attributes from match\n\t\t\tNode nMatch = matches[i];\n\t\t\tNamedNodeMap attrs = nMatch.getAttributes();\n\t\t\tNode nAttr = attrs.getNamedItem(\"type\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain type!\" + nMagic);\n\t\t\tString sType = nAttr.getNodeValue();\n\t\t\tint type = magic.typeToType(sType);\n\n\t\t\tnAttr = attrs.getNamedItem(\"offset\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain offset!\" + nMagic);\n\t\t\tString offset = nAttr.getNodeValue();\n\t\t\tint pos = offset.indexOf(':');\n\t\t\tint offsetStart = 0, offsetEnd = 0;\n\t\t\tif(pos < 0) {\n\t\t\t\toffsetStart = Integer.parseInt(offset);\n\t\t\t\toffsetEnd = offsetStart;\n\t\t\t} else {\n\t\t\t\toffsetStart = Integer.parseInt(offset.substring(0, pos));\t\t\t\t\n\t\t\t\toffsetEnd = Integer.parseInt(offset.substring(pos + 1));\n\t\t\t}\n\t\t\t\t \n\t\t\tnAttr = attrs.getNamedItem(\"value\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain value!\" + nMagic);\n\t\t\tString sValue = nAttr.getNodeValue();\n\t\t\tbyte[] value = ByteHelper.decode(-1, sValue, BIGENDIAN); \n\t\t\t\n\t\t\tnAttr = attrs.getNamedItem(\"mask\");\n\t\t\tString sMask = null;\n\t\t\tbyte[] mask = null;\n\t\t\tif(nAttr != null) {// mask is optional\n\t\t\t\tsMask = nAttr.getNodeValue();\n\t\t\t\tmask = ByteHelper.decode(-1, sMask, BIGENDIAN);\n\t\t\t}\n\t\t\t\n\t\t\tMatchImpl match = magic.addMatchImpl(type, offsetStart, offsetEnd, value, mask);\n\t\t\t// read sub matches\n\t\t\treadMatches(nMatch, match);\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "public RegexPatternBuilder (String regex)\n {\n this.regex = regex;\n }", "public BodyMatchesRegexAnalyzer(BodyRegexProperties properties) {\n super(properties);\n this.pattern = Pattern.compile(properties.getPattern());\n }", "public static TextP regex(final String value) {\n return new TextP(new Text.RegexPredicate(value, false), value);\n }", "private String parseRegExp(String exp) throws Exception {\r\n\t\treturn RegexpTranslationHelper.translateANTLRToAutomatonStyle(exp);\r\n\t}", "@Test\r\n public void testRegexpSetInclusion() {\r\n rs.getRegexp(reString);\r\n stringSet.add(reString);\r\n assertTrue(rs.getRegexpSet().containsAll(stringSet));\r\n }", "java.util.List<org.sas04225.proto.LookupResultProto.DMatch> \n getMatchesList();", "public abstract Match match();", "public void setRegex (String regex)\n {\n this.regex = regex;\n }", "@Override\n public Map<K, V> getMatching( final String pattern )\n {\n final Map<K, V> unwrappedResults;\n\n final Map<K, ICacheElement<K, V>> wrappedResults = this.getCacheControl().getMatching( pattern );\n\n if ( wrappedResults == null )\n {\n unwrappedResults = new HashMap<>();\n }\n else\n {\n unwrappedResults = wrappedResults.entrySet()\n .stream()\n .filter(entry -> entry.getValue() != null)\n .collect(Collectors.toMap(\n Entry::getKey,\n entry -> entry.getValue().getVal()));\n }\n\n return unwrappedResults;\n }" ]
[ "0.65765435", "0.6567474", "0.62210864", "0.6119133", "0.6119133", "0.6009622", "0.59467083", "0.5900778", "0.58987087", "0.5866742", "0.58558315", "0.57648826", "0.574516", "0.56033504", "0.55900407", "0.5468816", "0.54561144", "0.5452806", "0.54415035", "0.5412439", "0.5406639", "0.53966016", "0.539362", "0.53688085", "0.5300234", "0.5299739", "0.52982265", "0.5287645", "0.5286847", "0.52498275", "0.52494794", "0.5241049", "0.52307725", "0.52001274", "0.51966625", "0.51928055", "0.5185047", "0.5185047", "0.5173221", "0.514947", "0.51331633", "0.5130575", "0.51162523", "0.511577", "0.505752", "0.5052396", "0.50475836", "0.5044343", "0.5037537", "0.5031063", "0.50262797", "0.5026257", "0.50230116", "0.50159913", "0.5002887", "0.50022036", "0.4999916", "0.49996975", "0.49893785", "0.49744686", "0.49517205", "0.49513534", "0.494972", "0.49408877", "0.4934596", "0.49328154", "0.49207342", "0.49194115", "0.4893168", "0.4891293", "0.48754472", "0.48661867", "0.48552793", "0.4853159", "0.48447493", "0.48421258", "0.4838527", "0.4835566", "0.48035926", "0.48009443", "0.4796868", "0.4789154", "0.4772994", "0.4765727", "0.4765107", "0.47640988", "0.47616363", "0.47600856", "0.47573715", "0.47380817", "0.47371057", "0.47077832", "0.47058758", "0.47037315", "0.46974275", "0.46926725", "0.46914405", "0.4691169", "0.4690659", "0.46856058" ]
0.73669624
0
Taken from CraigTP's answer on StackOverflow Works for negative and decimal numbers but not international
public static boolean isNumericRegex(String str) { return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract String convertEnglishNumber(String number);", "public static void main( String[] args ) {\n System.out.println(NumUtil.format4DecimalPoint(1));\n System.out.println(NumUtil.format4DecimalPoint(1.1));\n System.out.println(NumUtil.format4DecimalPoint(1.12));\n System.out.println(NumUtil.format4DecimalPoint(1.123));\n System.out.println(NumUtil.format4DecimalPoint(1.1234));\n System.out.println(NumUtil.format4DecimalPoint(1.12345));\n System.out.println(NumUtil.format4DecimalPoint(1.123456));\n System.out.println(NumUtil.format4DecimalPoint(12.123456));\n \n double a = 0.09d;\n double b = 0.01d;\n double c = 0.1d;\n \n System.out.println( ( a + b ) );\n System.out.println( c - ( a + b ) == 0 );\n \n //Currency Testing\n Locale canadianEnglish = new Locale( \"en\",\"CA\" );\n NumberFormat currencyFormat = NumberFormat.getCurrencyInstance( Locale.CANADA_FRENCH );\n currencyFormat.setCurrency( Currency.getInstance( Locale.CANADA ) );\n currencyFormat.setMinimumFractionDigits( 2 );\n currencyFormat.setMaximumFractionDigits( 4 );\n double amt = -1.21234;\n System.out.println(amt + \" formats as \" + currencyFormat.format( amt ));\n System.out.println( formatPercent( 2.34d ));\n System.out.println( formatPercent( 0.54d ));\n System.out.println( formatPercent( 99.99999d ));\n System.out.println( formatPercent( 99d ));\n System.out.println( formatPercent( 100d ));\n System.out.println( formatPercent( 150d ));\n System.out.println( formatPercent( 150.1d ));\n System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\");\n \n System.out.println(\"formatNoDecimalPoint\");\n \n System.out.println(\"0.000 -> \"+NumUtil.formatNoDecimalPoint(0.000));\n System.out.println(\"0.0005 -> \"+NumUtil.formatNoDecimalPoint(0.0005));\n\tSystem.out.println(\"0.05 -> \"+NumUtil.formatNoDecimalPoint(0.05));\n\tSystem.out.println(\"0.5 -> \"+NumUtil.formatNoDecimalPoint(0.5));\n\tSystem.out.println(\"1 -> \"+NumUtil.formatNoDecimalPoint(1));\n\tSystem.out.println(\"1.1 -> \"+NumUtil.formatNoDecimalPoint(1.1));\n\tSystem.out.println(\"1.12 -> \"+NumUtil.formatNoDecimalPoint(1.12));\n\tSystem.out.println(\"1.123 -> \"+NumUtil.formatNoDecimalPoint(1.123));\n\tSystem.out.println(\"1.1234 -> \"+NumUtil.formatNoDecimalPoint(1.1234));\n\tSystem.out.println(\"1.12345 -> \"+NumUtil.formatNoDecimalPoint(1.12345));\n\tSystem.out.println(\"1.123456 -> \"+NumUtil.formatNoDecimalPoint(1.123456));\n\tSystem.out.println(\"12.12345699999999999999999999999999999999 -> \"+NumUtil.formatNoDecimalPoint(12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"566762.42 -> \"+formatNoDecimalPoint(566762.42));\n\tSystem.out.println(\"56676242.00 -> \"+formatNoDecimalPoint(56676242.00));\n\tSystem.out.println(\"2342342342.00 -> \"+formatNoDecimalPoint(2342342342.00));\n\tSystem.out.println(\"12345678901234.12345678901234567890 -> \"+formatNoDecimalPoint(12345678901234.12345678901234567890));\n \n\t\n\tSystem.out.println(\"NumUtil.format2DecimalPoint\");\n \n\tSystem.out.println(\"0.0005 -> \"+NumUtil.format2DecimalPoint(0.0005));\n\tSystem.out.println(\"0.05 -> \"+NumUtil.format2DecimalPoint(0.05));\n\tSystem.out.println(\"0.5 -> \"+NumUtil.format2DecimalPoint(0.5));\n\tSystem.out.println(\"1 -> \"+NumUtil.format2DecimalPoint(1));\n\tSystem.out.println(\"1.1 -> \"+NumUtil.format2DecimalPoint(1.1));\n\tSystem.out.println(\"1.12 -> \"+NumUtil.format2DecimalPoint(1.12));\n\tSystem.out.println(\"1.123 -> \"+NumUtil.format2DecimalPoint(1.123));\n\tSystem.out.println(\"1.1234 -> \"+NumUtil.format2DecimalPoint(1.1234));\n\tSystem.out.println(\"1.12345 -> \"+NumUtil.format2DecimalPoint(1.12345));\n\tSystem.out.println(\"1.123456 -> \"+NumUtil.format2DecimalPoint(1.123456));\n\tSystem.out.println(\"12.12345699999999999999999999999999999999 -> \"+NumUtil.format2DecimalPoint(12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"566762.42 -> \"+format2DecimalPoint(566762.42));\n\tSystem.out.println(\"56676242.00 -> \"+format2DecimalPoint(56676242.00));\n\tSystem.out.println(\"2342342342.00 -> \"+format2DecimalPoint(2342342342.00));\n\tSystem.out.println(\"12345678901234.12345678901234567890 -> \"+format2DecimalPoint(12345678901234.12345678901234567890));\n\t\n\t\n \n////////////\n\t\nSystem.out.println(\"formatNoDecimalPoint\");\n \n System.out.println(\"0.000 -> \"+NumUtil.formatNoDecimalPoint(0.00));\n System.out.println(\"-0.0005 -> \"+NumUtil.formatNoDecimalPoint(-0.0005));\n\tSystem.out.println(\"-0.05 -> \"+NumUtil.formatNoDecimalPoint(-0.05));\n\tSystem.out.println(\"-0.5 -> \"+NumUtil.formatNoDecimalPoint(-0.5));\n\tSystem.out.println(\"-1 -> \"+NumUtil.formatNoDecimalPoint(-1));\n\tSystem.out.println(\"-1.1 -> \"+NumUtil.formatNoDecimalPoint(-1.1));\n\tSystem.out.println(\"-1.12 -> \"+NumUtil.formatNoDecimalPoint(-1.12));\n\tSystem.out.println(\"-1.123 -> \"+NumUtil.formatNoDecimalPoint(-1.123));\n\tSystem.out.println(\"-1.1234 -> \"+NumUtil.formatNoDecimalPoint(-1.1234));\n\tSystem.out.println(\"-1.12345 -> \"+NumUtil.formatNoDecimalPoint(-1.12345));\n\tSystem.out.println(\"-1.123456 -> \"+NumUtil.formatNoDecimalPoint(-1.123456));\n\tSystem.out.println(\"-12.12345699999999999999999999999999999999 -> \"+NumUtil.formatNoDecimalPoint(-12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"-566762.42 -> \"+formatNoDecimalPoint(-566762.42));\n\tSystem.out.println(\"-56676242.00 -> \"+formatNoDecimalPoint(-56676242.00));\n\tSystem.out.println(\"-2342342342.00 -> \"+formatNoDecimalPoint(-2342342342.00));\n\tSystem.out.println(\"-12345678901234.12345678901234567890 -> \"+formatNoDecimalPoint(-12345678901234.12345678901234567890));\n \n\t\n\tSystem.out.println(\"NumUtil.format2DecimalPoint\");\n \n\tSystem.out.println(\"0.000 -> \"+NumUtil.format2DecimalPoint(0.00));\n\tSystem.out.println(\"-0.0005 -> \"+NumUtil.format2DecimalPoint(-0.0005));\n\tSystem.out.println(\"-0.05 -> \"+NumUtil.format2DecimalPoint(-0.05));\n\tSystem.out.println(\"-0.5 -> \"+NumUtil.format2DecimalPoint(-0.5));\n\tSystem.out.println(\"-1 -> \"+NumUtil.format2DecimalPoint(-1));\n\tSystem.out.println(\"-1.1 -> \"+NumUtil.format2DecimalPoint(-1.1));\n\tSystem.out.println(\"-1.12 -> \"+NumUtil.format2DecimalPoint(-1.12));\n\tSystem.out.println(\"-1.123 -> \"+NumUtil.format2DecimalPoint(-1.123));\n\tSystem.out.println(\"-1.1234 -> \"+NumUtil.format2DecimalPoint(-1.1234));\n\tSystem.out.println(\"-1.12345 -> \"+NumUtil.format2DecimalPoint(-1.12345));\n\tSystem.out.println(\"-1.123456 -> \"+NumUtil.format2DecimalPoint(-1.123456));\n\tSystem.out.println(\"-12.12345699999999999999999999999999999999 -> \"+NumUtil.format2DecimalPoint(-12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"-566762.42 -> \"+format2DecimalPoint(-566762.42));\n\tSystem.out.println(\"-56676242.00 -> \"+format2DecimalPoint(-56676242.00));\n\tSystem.out.println(\"-2342342342.00 -> \"+format2DecimalPoint(-2342342342.00));\n\tSystem.out.println(\"-12345678901234.12345678901234567890 -> \"+format2DecimalPoint(-12345678901234.12345678901234567890));\n\t\n\t\n\t\n\tSystem.out.println(\"8865450.54 -> \"+NumUtil.format2DecimalPoint(8865450.54));\n\t\n\t\n\t\n\tSystem.out.println( ratio( 7, 14 ) );\n\t\n System.out.println( ratio( 10293, 1234 ) );\n\t\n System.out.println( ratio( 50 * 23, 20 * 23 ) );\n }", "public int translateNum(int num) {\n String s = String.valueOf(num);\n int a=1,b=1;\n for(int i=s.length()-2; i>-1; i--){\n String tmp = s.substring(i, i+2);\n int c= tmp.compareTo(\"10\") >= 0 && tmp.compareTo(\"25\") <= 0 ? a+b:a;\n b=a;\n a=c;\n }\n return a;\n }", "public String convertAmount(long num) {\n String sign = \"\";\n if (num == 0){\n return \"zero\"; \n }\n else if (num < 0) {\n // if number negative, making it as positive number and saving the sign in the variable\n num = -num;\n sign = \"Negative\";\n }\n \n String inWords = \"\";\n int place = 0;\n \n // do this for every set of 3 digits from right till your left with northing\n do {\n // get the right most 3 numbers \n long n = num % 1000;\n // check if it not 0\n if (n != 0){\n // call the changeUptoThousand for the 3 digit number\n String s = changeUptoThousand((int) n);\n // add the appropriate word from thousand \n inWords = s + specialdigitNames[place] + inWords;\n }\n place++;\n //change the number leaving the right most 3 digits whic are processed above\n num /= 1000;\n } \n while (num > 0);\n // add the sign and the number\n return (sign + inWords).trim();\n }", "public static boolean isNumericInternational(String str)\n {\n try\n {\n double d = Double.parseDouble(str);\n }\n catch(NumberFormatException nfe)\n {\n return false;\n }\n return true;\n }", "protected static String cleanFormat(Double d) {\n\t\tif(d<0) return \"-\"+cleanFormat(d*-1.0);\n\t\tString result = String.format(Locale.US, \"%f\", d).replaceAll(\"([\\\\.])?0+$\",\"\");\n\t\tif(Math.abs(Double.parseDouble(result)-d) < 0.000001) return result;\n\t\tSystem.err.print(\"warning: String.format(\"+d+\")=\\\"\"+result+\"\\\"\");\n\t\tresult=\"\";\n\t\tint dimension = (int)Math.log10(d);\n\t\tif(dimension<0) result=\"0.\";\n\t\twhile(d>(double)Float.MIN_VALUE) {\n\t\t\t// System.err.print(\"cleanFormat(\"+d+\")=\");\n\t\t\tdouble base = Math.pow(10.0, (double)dimension);\n\t\t\tresult=result+(int)(d/base);\n\t\t\tif(d % base>(double)Float.MIN_VALUE) {\n\t\t\t\td=d % base;\n\t\t\t\tif(dimension==0 && d>(double)Float.MIN_VALUE)\n\t\t\t\t\tresult=result+\".\";\n\t\t\t\tdimension--;\n\t\t\t} else d=(double)Float.MIN_VALUE;\n\t\t\t// System.err.println(result);\n\t\t}\n\t\tSystem.err.println(\" => \\\"\"+result+\"\\\"\");\n\t\treturn result;\n\t}", "private String convertToCelsius(String string) {\n\t\tDecimalFormat df2 = new DecimalFormat(\".##\");\n\t\treturn df2.format((Double.parseDouble(string)-273.15));\n\t}", "private static String formatPRECIO(String var1)\r\n\t{\r\n\t\tString temp = var1.replace(\".\", \"\");\r\n\t\t\r\n\t\treturn( String.format(\"%09d\", Integer.parseInt(temp)) );\r\n\t}", "private String normalizeDouble(Double value) {\n\n String valueSign = (value < 0) ? \"-\" : \"0\";\n String expSign = \"0\";\n Integer finalExp = 0;\n\n DecimalFormat df = new DecimalFormat(DECIMAL_FORMAT);\n String[] splits = df.format(value).split(\"E\");\n\n // if there's an exponent, complement it\n if(splits.length > 1) {\n\n String exponent = splits[1];\n\n if(exponent.startsWith(\"-\")) {\n\n expSign = \"-\";\n exponent = exponent.replace(\"-\", \"\");\n finalExp = 999 - Integer.parseInt(exponent);\n }\n\n else {\n finalExp = Integer.parseInt(exponent);\n }\n }\n\n return String.format(\"%s%s%03d %s\", valueSign, expSign, finalExp, splits[0]);\n }", "@Test\n public void arabicOutOfBounds() throws MalformedNumberException {\n final RomanArabicConverter rac_low = new RomanArabicConverter(\"-1\");\n final RomanArabicConverter rac_high = new RomanArabicConverter(\"124121\");\n \n assertEquals(-1, rac_low.toArabic());\n assertEquals(124121, rac_high.toArabic());\n }", "String getFloatingPointEncoding();", "public String covertIng(int num) {\n\t\tchar[] digits = new char[10];\r\n\t\t\r\n\t\tboolean sign = num >= 0 ? true : false;\r\n\t\tint idx = 0;\r\n\t\t\r\n\t\twhile(idx <digits.length){\r\n\t\t\tdigits[idx] = toChar(num % 10);\r\n\t\t\tnum = num /10;\r\n\t\t\tif(num== 0)\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tidx++;\r\n\t\t}\r\n\t\t\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tif(!sign)\r\n\t\t\tsb.append('-');\r\n\t\t\r\n\t\twhile(idx>=0){\r\n\t\t\tsb.append(digits[idx--]);\r\n\t\t}\r\n\t\t\r\n\t\treturn sb.toString();\r\n\t\t\r\n\t}", "private static long convertNumber(String text, int base)\r\n\t{\r\n\t\tlong result = 0;\r\n\t\ttext = text.toLowerCase();\r\n\t\tfor (int i = 2; i < text.length(); i++)\r\n\t\t{\r\n\t\t\tint d;\r\n\t\t\tchar c = text.charAt(i);\r\n\t\t\tif (c > '9')\r\n\t\t\t\td = (int) (c - 'a') + 10;\r\n\t\t\telse\r\n\t\t\t\td = (int) (c - '0');\r\n\t\t\tresult = (result * base) + d;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public static void getPositiveAndNegativeInput() {\n Double num = getDoubleInput(\"enter the number you would like to change\");\n println(String.valueOf(positiveAndNegative(num)));\n }", "@Test\n public void canConvertValidRomanString() {\n String romanStr = \"mMmCMxciX\";\n //when\n BigDecimal b = RomanNumberUtil.toDecimal(romanStr);\n //then\n Assert.assertEquals(b, BigDecimal.valueOf(3999L));\n\n }", "private String formatUsNumber(Editable text) {\n\t\tStringBuilder cashAmountBuilder = null;\n\t\tString USCurrencyFormat = text.toString();\n//\t\tif (!text.toString().matches(\"^\\\\$(\\\\d{1,3}(\\\\,\\\\d{3})*|(\\\\d+))(\\\\.\\\\d{2})?$\")) { \n\t\t\tString userInput = \"\" + text.toString().replaceAll(\"[^\\\\d]\", \"\");\n\t\t\tcashAmountBuilder = new StringBuilder(userInput);\n\n\t\t\twhile (cashAmountBuilder.length() > 3 && cashAmountBuilder.charAt(0) == '0') {\n\t\t\t\tcashAmountBuilder.deleteCharAt(0);\n\t\t\t}\n\t\t\twhile (cashAmountBuilder.length() < 3) {\n\t\t\t\tcashAmountBuilder.insert(0, '0');\n\t\t\t}\n\t\t\tcashAmountBuilder.insert(cashAmountBuilder.length() - 2, '.');\n\t\t\tUSCurrencyFormat = cashAmountBuilder.toString();\n\t\t\tUSCurrencyFormat = Util.getdoubleUSPriceFormat(Double.parseDouble(USCurrencyFormat));\n\n//\t\t}\n\t\tif(\"0.00\".equals(USCurrencyFormat)){\n\t\t\treturn \"\";\n\t\t}\n\t\tif(!USCurrencyFormat.contains(\"$\"))\n\t\t\treturn \"$\"+USCurrencyFormat;\n\t\treturn USCurrencyFormat;\n\t}", "public static void main(String[] args) {\n int integer = 6;\n String s = Integer.toString(integer);\n System.out.println(s);\n\n //integer to string (abc) -- ascii value\n //Character.toString();\n int a = 3;\n char character = (char) (a + '0' + 48);\n char c = 'c';\n s = Character.toString(character);\n System.out.println(s);\n int b = 13;\n c = (char) (b + 48 + '0');\n s = Character.toString(c);\n System.out.println(s);\n\n //parseInt String to Int...\n String str = \"0\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str= \"00\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str = \"-1\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n String inf = \"asdf\"; //any error produces -1\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str = \"-2\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str = \"-002\";\n integer = Integer.parseInt(str);\n System.out.println(integer); //handles all leading zeros... and negatives... edge case is when it is equal to -1 then error....\n //however good news is that my function has all negatives handled like no edge cases.... only 0000 edge case\n\n //- + 0000 123 0.000 */\n //handled all edge cases with integers... only edge cases with float 0.000 consider...\n //parseDouble\n str = \"0\";\n double d = Double.parseDouble(str);\n System.out.println(d);\n str = \"00.9\";\n d = Double.parseDouble(str);\n System.out.println(d);\n str = \"-00.9000\";\n d = Double.parseDouble(str);\n System.out.println(d);\n str = \"-1.987\";\n d = Double.parseDouble(str);\n System.out.println(d);\n str = \"asdf\"; //throws exception\n try {\n d = Double.parseDouble(str);\n } catch (NumberFormatException e) {\n System.out.println(\"error\");\n }\n System.out.println(d); //d remains same/old value;\n\n }", "private static DecimalFormat determineLabelFormat(float val) {\n float absval = Math.abs(val);\n\n DecimalFormat rval = null;\n if (absval == 0) {\n rval = new DecimalFormat(\"0.#\");\n } else if (absval < 0.001 || absval > 1e7) {\n rval = new DecimalFormat(\"0.###E0\");\n } else if (absval < 0.01) {\n rval = new DecimalFormat(\"0.###\");\n } else if (absval < 0.1) {\n rval = new DecimalFormat(\"0.##\");\n } else {\n rval = new DecimalFormat(\"0.#\");\n }\n\n return rval;\n }", "public static String convertMixedNumber(String originalFraction)\r\n {\r\n\t\tint slash = originalFraction.indexOf('/');\r\n \tint underscore = originalFraction.indexOf('_');\r\n\t\tif (originalFraction.contains(\"-\"))\r\n\t\t{\r\n\t\t\tint wholeNumber = Integer.parseInt(originalFraction.substring(1, underscore));\r\n\t\t\tint num = Integer.parseInt(originalFraction.substring(underscore + 1, slash));\r\n\t\t\tint denom = Integer.parseInt(originalFraction.substring(slash + 1, originalFraction.length()));\r\n\t\t\tint num1 = (denom * wholeNumber + num) * -1;\r\n\t\t\tString improperFraction = num1 + \"/\" + denom;\r\n\t\t\treturn improperFraction;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\tint wholeNumber = Integer.parseInt(originalFraction.substring(0, underscore));\r\n\t\tint num = Integer.parseInt(originalFraction.substring(underscore + 1, slash));\r\n\t\tint denom = Integer.parseInt(originalFraction.substring(slash + 1, originalFraction.length()));\r\n\t\tint num1 = (denom * wholeNumber) + num;\r\n\t\tString improperFraction = num1 + \"/\" + denom;\r\n\t\treturn improperFraction;\r\n\t\t}\r\n }", "private static String removeZeroDecimal(String s) {\r\n // Make sure to add check for existance of decimal sign to\r\n // prevent StringIndexOutOfBoundsException\r\n if (s.indexOf(\".\") != -1 && s.substring(s.indexOf(\".\"), s.length()).equals(\".0\"))\r\n s = s.replace(\".0\", \"\");\r\n return s;\r\n }", "String getDecimalEncoding();", "@Test\n\tpublic void testValidNegativeInput() {\n\t\t\n\t\tString normalInput = \"-1357.459\";\n\t\tString germanInput = \"-1357,459\";\n\t\tBigDecimal expectedOutput = new BigDecimal(normalInput);\n\t\t\n\t\t// normal input\n\t\tfor( final CellProcessor p : Arrays.asList(processor, processor2, processorChain, processorChain2) ) {\n\t\t\tassertExecution(p, normalInput, expectedOutput);\n\t\t}\n\t\t\n\t\t// german input (\",\" instead of \".\" as decimal symbol)\n\t\tfor( final CellProcessor p : Arrays.asList(processor3, processorChain3) ) {\n\t\t\tassertExecution(p, germanInput, expectedOutput);\n\t\t}\n\t}", "@Override\n public void setUp() {\n\n LocaleConvertUtils.deregister();\n\n final NumberFormat nf = NumberFormat.getNumberInstance();\n final String result = nf.format(1.1);\n\n // could be commas instead of stops in Europe.\n decimalSeparator = result.charAt(1);\n\n }", "private String convertFahrenheitToCelsius(double f) {\n double c = (f - 32.0) * (5.0 / 9.0);\n DecimalFormat numberFormat = new DecimalFormat(\"#.0\");\n return numberFormat.format(c);\n }", "public static void convert(double number)\n {\n\nlong bits = Double.doubleToLongBits(number);\n\nlong sign = bits >>> 63;\nlong exponent = ((bits >>> 52) ^ (sign << 11)) - 1023;\nlong fraction = bits << 12; // bits are \"reversed\" but that's not a problem\n\nlong a = 1L;\nlong b = 1L;\n\nfor (int i = 63; i >= 12; i--) {\n a = a * 2 + ((fraction >>> i) & 1);\n b *= 2;\n}\n\nif (exponent > 0)\n a *= 1 << exponent;\nelse\n b *= 1 << -exponent;\n\nif (sign == 1)\n a *= -1;\n\n// Here you have to simplify the fraction\n\nSystem.out.println(\"Resultat : \"+simplifier(a,b));\n }", "@Test\n public void input_XX_() throws ValueOutOfBoundsException, MalformedNumberException {\n final RomanArabicConverter rac = new RomanArabicConverter(\"XX\");\n assertEquals(20, rac.toArabic());\n assertEquals(\"XX\", rac.toRoman());\n }", "public static Locale returnUserLocale()\n{\n Locale currLocale = null;\n try\n {\n\tboolean notFound = true;\n\t// any number just to compare the formatted value\n\tBigDecimal value = new BigDecimal(1225.5);\n\tString neededFormat = format(value,\"#,###.0\");\n\t//French (space ,), English(,.), Spanish(.,)\n\tLocale[] availableLocales = new Locale[]{new Locale(\"fr\"),new Locale(\"en\"),new Locale(\"es\")};\n\tfor(int i = 0; i < availableLocales.length; i++)\n\t{\n\t currLocale = availableLocales[i];\n\t DecimalFormat df = (DecimalFormat) NumberFormat.getNumberInstance(currLocale);\n\t String output = df.format(value);\n\t // this is needed because the group separator character in French format behaves as space but it is in fact non-braking space\n\t output = output.replace('\\u00a0', ' ');\n\t if(neededFormat.equals(output))\n\t {\n\t\tnotFound = false;\n\t\tbreak;\n\t }\n\t}\n\tif(notFound)\n\t{\n\t currLocale = new Locale(\"en\");\n\t}\n }\n catch(Exception e)\n {\n\tlog.error(e,\"ERROR in \");\n }\n return currLocale;\n}", "@Test(expected=MalformedNumberException.class)\n public void spacesInWeirdPlaces() throws MalformedNumberException {\n new RomanArabicConverter(\"1 4\");\n }", "int getI18();", "@Test (expected=MalformedNumberException.class)\n public void inputDLIXLD() throws MalformedNumberException\n {\n new RomanArabicConverter(\"DLIXLD\"); \n }", "private String formato(String cadena){\n cadena = cadena.replaceAll(\" \",\"0\");\n return cadena;\n }", "void beginNotZeroDec(String stringzero){\n \t\tboolean findot = false;\n \t\tString mantisse = \"\";\n \t\tint exposant = -1;\n \t\tfor (int i = 0; i < stringzero.length(); i++) {\n \t\t\tswitch(stringzero.charAt(i)) {\n \t\t\tcase 'f':\n \t\t\t\tbreak;\n \t\t\tcase 'F':\n \t\t\t\tbreak;\n \t\t\tcase 'e':\n \t\t\t\texposantFlottantDec(mantisse, exposant, stringzero.substring(i+1));\n \t\t\t\treturn;\n \t\t\tcase 'E':\n \t\t\t\texposantFlottantDec(mantisse, exposant, stringzero.substring(i+1));\n \t\t\t\treturn;\n \t\t\tcase '.':\n \t\t\t\tfindot = true;\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\tmantisse += stringzero.charAt(i);\n \t\t\t\tif(!findot) {\n \t\t\t\t\texposant++;\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t\tcompareExposantDec(exposant, mantisse);\n \t}", "public static long parseLongPennies(String numStr)\r\n\t{\r\n\t\tnumStr = numStr.trim();\r\n\t\t// strip commas, spaces, + etc\r\n\t\tStringBuffer b = new StringBuffer(numStr.length());\r\n\t\tboolean negative = false;\r\n\t\tint decpl = -1;\r\n\t\tfor (int i = 0; i < numStr.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = numStr.charAt(i);\r\n\t\t\tswitch (c)\r\n\t\t\t{\r\n\t\t\tcase '-':\r\n\t\t\t\tnegative = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase '.':\r\n\t\t\t\tif (decpl == -1)\r\n\t\t\t\t{\r\n\t\t\t\t\tdecpl = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new NumberFormatException(\"more than one decimal point\");\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase '0':\r\n\t\t\tcase '1':\r\n\t\t\tcase '2':\r\n\t\t\tcase '3':\r\n\t\t\tcase '4':\r\n\t\t\tcase '5':\r\n\t\t\tcase '6':\r\n\t\t\tcase '7':\r\n\t\t\tcase '8':\r\n\t\t\tcase '9':\r\n\t\t\t\tif (decpl != -1)\r\n\t\t\t\t{\r\n\t\t\t\t\tdecpl++;\r\n\t\t\t\t}\r\n\t\t\t\tb.append(c);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t// ignore junk chars\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t// end switch\r\n\t\t}\r\n\t\t// end for\r\n\t\tif (numStr.length() != b.length())\r\n\t\t{\r\n\t\t\tnumStr = b.toString();\r\n\t\t}\r\n\t\tif (numStr.length() == 0)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tlong num = Long.parseLong(numStr);\r\n\t\tif (decpl == -1 || decpl == 0)\r\n\t\t{\r\n\t\t\tnum *= 100;\r\n\t\t}\r\n\t\telse if (decpl == 2)\r\n\t\t{\r\n\t\t\t/* it is fine as is */\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new NumberFormatException(\"wrong number of decimal places.\");\r\n\t\t}\r\n\t\tif (negative)\r\n\t\t{\r\n\t\t\tnum = -num;\r\n\t\t}\r\n\t\treturn num;\r\n\t}", "void beginZeroDec(String stringzero)throws DecaRecognitionException{\n \t\tboolean debutmantisse = false;\n \t\tint exposant = -1;\n \t\tString mantisse = \"\";\n \t\tfor (int i = 2; i < stringzero.length(); i++){\n \t\t\tswitch(stringzero.charAt(i)) {\n \t\t\t// fin du float\n \t\t\tcase 'f':\n \t\t\t\tbreak;\n \t\t\tcase 'F':\n \t\t\t\tbreak;\n \t\t\tcase 'e':\n \t\t\t\texposantFlottantDec(mantisse, exposant, stringzero.substring(i+1, stringzero.length()));\n \t\t\t\treturn;\n \t\t\tcase 'E':\n \t\t\t\texposantFlottantDec(mantisse, exposant, stringzero.substring(i+1, stringzero.length()));\n \t\t\t\treturn;\n \t\t\tcase '0':\n \t\t\t\tif(!debutmantisse) {\n \t\t\t\t\texposant -= 1;\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tmantisse += '0';\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\tmantisse += stringzero.charAt(i);\n \t\t\t\tdebutmantisse = true;\n \t\t\t}\n \t\t}\n \t\t// cas 0.000...\n \t\tif (mantisse == \"\") {\n \t\t\treturn;\n \t\t}\n \t\t// deux premier cas le de la fonction a traiter en exemple\n \t\tcompareExposantDec(exposant, mantisse);\n\n \t}", "public abstract double fromBasicUnit(double valueJTextInsert);", "@Test\n public void testCalculateRPNCustomNegativeNumbers() throws Exception {\n String[] expression = {\"3\",\"4\",\"+\",\"8\",\"3\",\"-\",\"+\",\"-10\",\"*\"};\n double result = solver.calculateRPNCustom(expression);\n\n assertThat(result, is(-120.0));\n }", "public static double atof(String s)\n {\n int i = 0;\n int sign = 1;\n double r = 0; // integer part\n // double f = 0; // fractional part\n double p = 1; // exponent of fractional part\n int state = 0; // 0 = int part, 1 = frac part\n\n while ((i < s.length()) && Character.isWhitespace(s.charAt(i)))\n {\n i++;\n }\n\n if ((i < s.length()) && (s.charAt(i) == '-'))\n {\n sign = -1;\n i++;\n }\n else if ((i < s.length()) && (s.charAt(i) == '+'))\n {\n i++;\n }\n\n while (i < s.length())\n {\n char ch = s.charAt(i);\n\n if (('0' <= ch) && (ch <= '9'))\n {\n if (state == 0)\n {\n r = ((r * 10) + ch) - '0';\n }\n else if (state == 1)\n {\n p = p / 10;\n r = r + (p * (ch - '0'));\n }\n }\n else if (ch == '.')\n {\n if (state == 0)\n {\n state = 1;\n }\n else\n {\n return sign * r;\n }\n }\n else if ((ch == 'e') || (ch == 'E'))\n {\n long e = (int) parseLong(s.substring(i + 1), 10);\n\n return sign * r * Math.pow(10, e);\n }\n else\n {\n return sign * r;\n }\n\n i++;\n }\n\n return sign * r;\n }", "@Test\n\tpublic void input_II_() throws ValueOutOfBoundsException, MalformedNumberException {\n\t assertEquals(2, new RomanArabicConverter(\"II\").toArabic());\n\t assertEquals(\"II\", new RomanArabicConverter(\"II\").toRoman());\n\t}", "private static int eatNumber (String s, int pos[]) {\r\n int sign = 1;\r\n int result = 0;\r\n int i = 0;\r\n if (s.charAt(pos[0])=='-') {\r\n pos[0]++;\r\n sign = -1;\r\n }\r\n for (; pos[0]<s.length(); i++) {\r\n char c=s.charAt(pos[0]);\r\n if (! Character.isDigit(c)) {\r\n break;\r\n }\r\n result = 10*result + (c-'0');\r\n pos[0]++;\r\n if (i==0 && result==0) return 0;\r\n }\r\n if (i==0) throw new RuntimeException();\r\n return result*sign;\r\n }", "private String numberFormatter(double input) {\n // Formatters\n NumberFormat sciFormatter = new DecimalFormat(\"0.#####E0\"); // Scientific notation\n NumberFormat commaFormatter = new DecimalFormat(\"###,###,###,###.###############\"); // Adding comma\n\n // If input is in scientific notation already\n if ((String.valueOf(input)).indexOf(\"E\") > 0) {\n return sciFormatter.format(input); // make the scientific notation neater\n }\n\n // If input is not in scientific notation\n // Number of digits of integer and decimal of input\n String[] splitter = String.format(\"%f\", input).split(\"\\\\.\");\n int intDigits = splitter[0].length(); // Before Decimal Count\n int decDigits;// After Decimal Count\n if (splitter[1].equals(\"000000\")){\n decDigits = 0;\n } else {\n decDigits= splitter[1].length();\n }\n\n if ((intDigits + decDigits) > 9) {\n return sciFormatter.format(input);\n }\n return commaFormatter.format(input);\n }", "public static String intToNumeral(int number)\n\t{\n\t\tString numeral = \"\";\n\t\twhile(number > 0)\n\t\t{\n\t\t\tif(number >= 1000)\n\t\t\t{\n\t\t\t\tnumber -= 1000;\n\t\t\t\tnumeral = numeral + \"M\";\n\t\t\t}\n\t\t\telse if(number >= 900)\n\t\t\t{\n\t\t\t\tnumber -= 900;\n\t\t\t\tnumeral = numeral + \"CM\";\n\t\t\t}\n\t\t\telse if(number >= 500)\n\t\t\t{\n\t\t\t\tnumber -= 500;\n\t\t\t\tnumeral = numeral + \"D\";\n\t\t\t}\n\t\t\telse if(number >= 400)\n\t\t\t{\n\t\t\t\tnumber -= 400;\n\t\t\t\tnumeral = numeral + \"DC\";\n\t\t\t}\n\t\t\telse if(number >= 100)\n\t\t\t{\n\t\t\t\tnumber -= 100;\n\t\t\t\tnumeral = numeral + \"C\";\n\t\t\t}\n\t\t\telse if(number >= 90)\n\t\t\t{\n\t\t\t\tnumber -= 90;\n\t\t\t\tnumeral = numeral + \"XC\";\n\t\t\t}\n\t\t\telse if(number >= 50)\n\t\t\t{\n\t\t\t\tnumber -= 50;\n\t\t\t\tnumeral = numeral + \"L\";\n\t\t\t}\n\t\t\telse if(number >= 40)\n\t\t\t{\n\t\t\t\tnumber -= 40;\n\t\t\t\tnumeral = numeral + \"XL\";\n\t\t\t}\n\t\t\telse if(number >= 10)\n\t\t\t{\n\t\t\t\tnumber -= 10;\n\t\t\t\tnumeral = numeral + \"X\";\n\t\t\t}\n\t\t\telse if(number >= 9)\n\t\t\t{\n\t\t\t\tnumber -= 9;\n\t\t\t\tnumeral = numeral + \"IX\";\n\t\t\t}\n\t\t\telse if(number >= 5)\n\t\t\t{\n\t\t\t\tnumber -= 5;\n\t\t\t\tnumeral = numeral + \"V\";\n\t\t\t}\n\t\t\telse if(number >= 4)\n\t\t\t{\n\t\t\t\tnumber -= 4;\n\t\t\t\tnumeral = numeral + \"IV\";\n\t\t\t}\n\t\t\telse if(number >= 1)\n\t\t\t{\n\t\t\t\tnumber -= 1;\n\t\t\t\tnumeral = numeral + \"I\";\n\t\t\t}\n\t\t\tif(number < 0) return \"ERROR\";\n\t\t}\n\t\treturn numeral;\n\t}", "private Token number() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\twhile(isDigit(this.currentChar) && this.pos != Integer.MIN_VALUE) {\n\t\t\tsb.append(this.currentChar);\n\t\t\tnext_char();\n\t\t}\n\t\t//处理小数\n\t\tif(this.currentChar == '.') {\n\t\t\tsb.append(this.currentChar);\n\t\t\tnext_char();\n\t\t\t\n\t\t\twhile(isDigit(this.currentChar) && this.pos != Integer.MIN_VALUE) {\n\t\t\t\tsb.append(this.currentChar);\n\t\t\t\tnext_char();\n\t\t\t}\n\t\t\treturn new Token(Type.REAL_CONST, sb.toString());\n\t\t}else {\n\t\t\treturn new Token(Type.INTEGER_CONST, sb.toString());\n\t\t}\n\t}", "private String formatNumberForDotNet(String val)\n/* */ {\n/* 348 */ if (val == null)\n/* */ {\n/* 350 */ return \"-\";\n/* */ }\n/* */ \n/* 353 */ String ret = FormatUtil.formatNumber(val);\n/* 354 */ String troubleshootlink = com.adventnet.appmanager.util.OEMUtil.getOEMString(\"company.troubleshoot.link\");\n/* 355 */ if (ret.indexOf(\"-1\") != -1)\n/* */ {\n/* */ \n/* 358 */ return \"- &nbsp;<a class=\\\"staticlinks\\\" href=\\\"http://\" + troubleshootlink + \"#m44\\\" target=\\\"_blank\\\">\" + FormatUtil.getString(\"am.webclient.dotnet.troubleshoot\") + \"</a>\";\n/* */ }\n/* */ \n/* */ \n/* 362 */ return ret;\n/* */ }", "private void outputBasedOnText(Editable s) {\n String stringValue = s.toString();\n if (stringValue.length() > 1 && stringValue.substring(stringValue.length() - 1).equals(\".\")) { // If the last char in string is \".\"\n convertInput(Double.parseDouble(stringValue.substring(0, stringValue.length() - 1)));\n } else if (!stringValue.matches(\"[-+]?\\\\d*\\\\.?\\\\d+\")) { // Check if stringValue is numeric\n convertInput(0);\n } else {\n convertInput(Double.parseDouble(stringValue));\n }\n }", "private String latitudeConversion() {\n int lat = record[1];\n if (lat >= 0) {\n lat = lat & 255;\n }\n lat = (lat << 8) + (record[0] & 255);\n float flat = Float.parseFloat((\"\" + lat + \".\" + (((record[3] & 255) << 8) + (record[2] & 255))));\n int degs = (int) flat / 100;\n float min = flat - degs * 100;\n String retVal = \"\" + (degs + min / 60);\n\n if (retVal.compareTo(\"200.0\") == 0) {\n return \"\";\n } else {\n return retVal;\n }\n }", "private String formatNumberForDotNet(String val)\n/* */ {\n/* 339 */ if (val == null)\n/* */ {\n/* 341 */ return \"-\";\n/* */ }\n/* */ \n/* 344 */ String ret = FormatUtil.formatNumber(val);\n/* 345 */ String troubleshootlink = com.adventnet.appmanager.util.OEMUtil.getOEMString(\"company.troubleshoot.link\");\n/* 346 */ if (ret.indexOf(\"-1\") != -1)\n/* */ {\n/* */ \n/* 349 */ return \"- &nbsp;<a class=\\\"staticlinks\\\" href=\\\"http://\" + troubleshootlink + \"#m44\\\" target=\\\"_blank\\\">\" + FormatUtil.getString(\"am.webclient.dotnet.troubleshoot\") + \"</a>\";\n/* */ }\n/* */ \n/* */ \n/* 353 */ return ret;\n/* */ }", "public static Object translate2singed(Object number, char sign)\n\t\t\tthrows Exception {\n\t\tif (number.toString().equals(\"0\"))\n\t\t\treturn number;\n\t\tif (!isNumeric(number))\n\t\t\tthrow new IllegalArgumentException(\"NaN: \" + number);\n\n\t\tClass numClass = number.getClass();\n\t\tNumber minval = limit(numClass, true);\n\n\t\tif (sign == '+' && minval.toString().equals(number.toString()))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"out of Class limits number*(-1) bigger then MAX_VALUE : \"\n\t\t\t\t\t\t\t+ number);\n\n\t\tif (isIntegral(number)) {\n\t\t\tLong numberL = Long.parseLong(number.toString());\n\t\t\tLong minL = Long.parseLong(limit(numClass, true).toString());\n\t\t\tLong maxL = Long.parseLong(limit(numClass, false).toString());\n\t\t\tif (numberL > maxL || numberL < minL)\n\t\t\t\tthrow new IllegalArgumentException(\"out of Class limits : \"\n\t\t\t\t\t\t+ minL + \", \" + maxL + \", \" + numClass + \", \" + numberL);\n\t\t}\n\t\tif (isFloatingPoint(number)) {\n\t\t\tDouble numberD = Double.parseDouble(number.toString());\n\t\t\tDouble minD = Double.parseDouble(limit(numClass, true).toString());\n\t\t\tDouble maxD = Double.parseDouble(limit(numClass, false).toString());\n\t\t\tif (numberD > maxD || numberD < minD)\n\t\t\t\tthrow new IllegalArgumentException(\"out of Class limits : \"\n\t\t\t\t\t\t+ minD + \", \" + maxD + \", \" + numClass + \", \" + numberD);\n\t\t}\n\n\t\t// integral-Numbers\n\t\tif (isIntegral(number)) {\n\t\t\tLong integralNumber = Long.valueOf(number.toString());\n\t\t\tswitch (sign) {\n\t\t\tcase '+':\n\t\t\t\tnumber = Math.abs(integralNumber);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\tnumber = -1 * Math.abs(integralNumber);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\tif (new Random().nextBoolean())\n\t\t\t\t\tnumber = -1 * Math.abs(integralNumber);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new IllegalArgumentException(\"unknown sign char: \" + sign);\n\t\t\t}\n\t\t}\n\t\t// floating point\n\t\tif (isFloatingPoint(number)) {\n\t\t\tDouble floatingNumber = Double.valueOf(number.toString());\n\t\t\tswitch (sign) {\n\t\t\tcase '+':\n\t\t\t\tnumber = Math.abs(floatingNumber);\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\tnumber = -1 * Math.abs(floatingNumber);\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\tif (new Random().nextBoolean())\n\t\t\t\t\tnumber = -1 * Math.abs(floatingNumber);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new IllegalArgumentException(\"unknown sign char: \" + sign);\n\t\t\t}\n\t\t}\n\t\tConstructor construct = numClass.getConstructor(String.class);\n\t\t// System.out.println(\"numClass: \"+numClass);\n\t\t// System.out.println(\"sign: \"+sign);\n\t\t// System.out.println(\"number: \"+number.toString());\n\t\tnumber = construct.newInstance(number.toString());\n\n\t\treturn number;\n\t}", "private String formatNumberForDotNet(String val)\n/* */ {\n/* 342 */ if (val == null)\n/* */ {\n/* 344 */ return \"-\";\n/* */ }\n/* */ \n/* 347 */ String ret = FormatUtil.formatNumber(val);\n/* 348 */ String troubleshootlink = com.adventnet.appmanager.util.OEMUtil.getOEMString(\"company.troubleshoot.link\");\n/* 349 */ if (ret.indexOf(\"-1\") != -1)\n/* */ {\n/* */ \n/* 352 */ return \"- &nbsp;<a class=\\\"staticlinks\\\" href=\\\"http://\" + troubleshootlink + \"#m44\\\" target=\\\"_blank\\\">\" + FormatUtil.getString(\"am.webclient.dotnet.troubleshoot\") + \"</a>\";\n/* */ }\n/* */ \n/* */ \n/* 356 */ return ret;\n/* */ }", "private String defaultFormat(double d) {\n\t\tString str = \"\" + d;\n\t\tint availableSpace = getSize().width - 2 * PIXEL_MARGIN;\n\t\tFontMetrics fm = getFontMetrics(getFont());\n\t\tif (fm.stringWidth(str) <= availableSpace) return str;\n\t\tint eIndex = str.indexOf(\"E\");\n\t\tString suffix = \"\";\n\t\tif (eIndex != -1) {\n\t\t\tsuffix = str.substring(eIndex);\n\t\t\tstr = str.substring(0, eIndex);\n\t\t\ttry {\n\t\t\t\td = parser.parse(str).doubleValue();\n\t\t\t} catch (ParseException ex) {\n\t\t\t\tthrow new ErrorException(ex);\n\t\t\t}\n\t\t}\n\t\tNumberFormat standard = NumberFormat.getNumberInstance(Locale.US);\n\t\tstandard.setGroupingUsed(false);\n\t\tString head = str.substring(0, str.indexOf('.') + 1);\n\t\tint fractionSpace = availableSpace - fm.stringWidth(head + suffix);\n\t\tif (fractionSpace > 0) {\n\t\t\tint fractionDigits = fractionSpace / fm.stringWidth(\"0\");\n\t\t\tstandard.setMaximumFractionDigits(fractionDigits);\n\t\t\treturn standard.format(d) + suffix;\n\t\t}\n\t\tstr = \"\";\n\t\twhile (fm.stringWidth(str + \"#\") <= availableSpace) {\n\t\t\tstr += \"#\";\n\t\t}\n\t\treturn str;\n\t}", "@Test\n public void testNineNegativeRegionToPuncturePoint(){\n precisionAssertEquals(\n \"Test [x = -5.8]: nine negative region\",\n 3.89952,\n systemFunctions.calculate(-5.8)\n );\n precisionAssertEquals(\n \"Test [x = -6.0]: nine negative region\",\n -29.835,\n systemFunctions.calculate(-6.0)\n );\n precisionAssertEquals(\n \"Test [x = -6.2]: nine negative region\",\n -2866.63,\n systemFunctions.calculate(-6.2)\n );\n }", "@Test\n public void testNineNegativeRegionToPuncturePoint(){\n precisionAssertEquals(\n \"Test [x = -5.8]: nine negative region\",\n 3.89952,\n systemFunctions.calculate(-5.8)\n );\n precisionAssertEquals(\n \"Test [x = -6.0]: nine negative region\",\n -29.835,\n systemFunctions.calculate(-6.0)\n );\n precisionAssertEquals(\n \"Test [x = -6.2]: nine negative region\",\n -2866.63,\n systemFunctions.calculate(-6.2)\n );\n }", "private String longitudeConversion() {\n int lon = record[5];\n if (lon >= 0) {\n lon = lon & 255;\n }\n lon = (lon << 8) + (record[4] & 255);\n float flon = Float.parseFloat(\"\" + lon + \".\" + (((record[7] & 255) << 8) + (record[6] & 255)));\n int degs = (int) flon / 100;\n float min = flon - degs * 100;\n String retVal = \"\" + (degs + min / 60);\n\n if (retVal.compareTo(\"200.0\") == 0) {\n return \"\";\n } else {\n return retVal;\n }\n }", "String getPvalue(String num) {\n\t\tif (Double.parseDouble(num) >= 30) return \"0.000000\";\n\t\telse \n\t\t\treturn pvalues.get(num);\n\t}", "private static String NUmberToEnglishString(long number) {\n\t\tString s;\r\n\t\tif(number<0)\r\n\t\t{\r\n\t\t\ts=\"error\";\r\n\t\t\treturn s;\r\n\t\t}\r\n\t\tif(number<20)\r\n\t\t{\r\n\t\t\tswitch ((int)number)\r\n\t\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\ts=\"zero\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 1:\r\n\t\t\t\ts=\"one\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 2:\r\n\t\t\t\ts=\"two\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 3:\r\n\t\t\t\ts=\"three\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 4:\r\n\t\t\t\ts=\"four\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 5:\r\n\t\t\t\ts=\"five\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 6:\r\n\t\t\t\ts=\"six\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 7:\r\n\t\t\t\ts=\"seven\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 8:\r\n\t\t\t\ts=\"eight\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 9:\r\n\t\t\t\ts=\"nine\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 10:\r\n\t\t\t\ts=\"ten\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 11:\r\n\t\t\t\ts=\"eleven\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 12:\r\n\t\t\t\ts=\"twelve\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 13:\r\n\t\t\t\ts=\"thirteen\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 14:\r\n\t\t\t\ts=\"fourteen\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 15:\r\n\t\t\t\ts=\"fifteen\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 16:\r\n\t\t\t\ts=\"sixteen\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 17:\r\n\t\t\t\ts=\"seventeen\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 18:\r\n\t\t\t\ts=\"eighteen\";\r\n\t\t\t\treturn s;\r\n\t\t\tcase 19:\r\n\t\t\t\ts=\"nineteen\";\r\n\t\t\t\treturn s;\r\n\t\t\tdefault:\r\n\t\t\t\ts=\"error\";\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(number<100) //21-99\r\n\t\t{\r\n\t\t\tif (number % 10 == 0) //20,30,40,...90的输出\r\n\t\t\t{\r\n\t\t\t\tswitch ((int)number)\r\n\t\t\t\t{\r\n\t\t\t\tcase 20:\r\n\t\t\t\t\ts=\"twenty\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tcase 30:\r\n\t\t\t\t\ts=\"thirty\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tcase 40:\r\n\t\t\t\t\ts=\"forty\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tcase 50:\r\n\t\t\t\t\ts=\"fifty\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tcase 60:\r\n\t\t\t\t\ts=\"sixty\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tcase 70:\r\n\t\t\t\t\ts=\"seventy\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tcase 80:\r\n\t\t\t\t\ts=\"eighty\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tcase 90:\r\n\t\t\t\t\ts=\"ninety\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\ts=\"error\";\r\n\t\t\t\t\treturn s;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ts=NUmberToEnglishString(number/10*10)+' '+NUmberToEnglishString(number%10);\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif(number<1000) //100-999\r\n\t\t{\r\n\t\t\tif(number%100==0)\r\n\t\t\t{\r\n\t\t\t\ts=NUmberToEnglishString(number/100)+\" hundred\";\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ts=NUmberToEnglishString(number/100)+\" hundred and \"+NUmberToEnglishString(number%100);\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(number<1000000) //1000-999999 百万以下\r\n\t\t{\r\n\t\t\tif(number%1000==0)\r\n\t\t\t{\r\n\t\t\t\ts=NUmberToEnglishString(number/1000)+\" thousand\";\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ts=NUmberToEnglishString(number/1000)+\" thousand \"+NUmberToEnglishString(number%1000);\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(number<1000000000) //十亿以下\r\n\t\t{\r\n\t\t\tif(number%1000000==0)\r\n\t\t\t{\r\n\t\t\t\ts=NUmberToEnglishString(number/1000000)+\" million\";\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ts=NUmberToEnglishString(number/1000000)+\" million \"+NUmberToEnglishString(number%1000000);\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (number>999999999)\r\n\t\t{\r\n\t\t\ts=\"error\";\r\n\t\t\treturn s;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Test\n\tpublic void caseCostWithWrongInput() {\n\t\tFloat cost = 0f;\n\t\ttry {\n\t\t\tStringNumberUtil.positiveNumberUtil(cost);\n\t\t\tfail();\n\t\t} catch (NumberException e) {\n\t\t}\n\t}", "public String decimalNumberOct(double d) {\n m = \"\";\n c = 0;\n i = 0;\n long z = (long) d;\n while (z != 0) {\n //11001 ------- 25\n c += ((z % 10) * (Math.pow(8, i)));\n z /= 10;\n i++;\n }\n if ((long) d != d) {\n i = -1;\n m += d;\n f = m.indexOf('.') + 1;\n f = m.length() - f;\n f = -f;\n double a = d - (long) d;\n while (i >= f) {\n //11001 ------- 25\n a *= 10;\n c += (long) a * ((Math.pow(8, i)));\n i--;\n a -= (long) a;\n }\n }\n m = \"\";\n m += c;\n return m;\n }", "@Test\n public void testIsNotValidDecimal() {\n FieldVerifier service = new FieldVerifier();\n boolean result = service.isValidDecimal(-1);\n assertEquals(false, result);\n }", "public char get_floating_suffix();", "public static void main(String[] args){\n Double a = -1d;\n String as = a.toString();\n String result = \"\";\n if (as.replace(\"-\", \"\").length()>=14){\n result = as.substring(0,14);\n }else {\n while (as.replace(\"-\", \"\").length()<14){\n as+='0';\n }\n result= as;\n }\n System.out.print(result);\n }", "@Override\n public String toString(Number value) {\n return String.format(\"%.1f\", -value.doubleValue());\n }", "private static String convertToFormat(int number) {\n int cents = number%100;\n number /= 100;\n return \"$\" + String.valueOf(number) + \".\" + String.valueOf(cents);\n }", "public static String currencyMask(BigDecimal cyDec) throws BaseException\n {\n String theFormat = \"#,##0\";\n if(NumberUtil.nullToZero(cyDec).intValue() > 0)\n {\n theFormat = theFormat.concat(\".\");\n String nbDecimalZeros = fill(\"0\", cyDec);\n theFormat = theFormat.concat(nbDecimalZeros);\n }\n return theFormat;\n }", "public static String formatNum(String numString){\n\t\tnumString = numString.replace(\",\",\"\");\n\t\tif(numString.contains(\".\")){\n\t\t\tString result =String.format(\"%1$,f\",Double.parseDouble(numString)).substring(0,String.format(\"%1$,f\",Double.parseDouble(numString)).indexOf('.')+3);\n\t\t\tif(numString.split(\"\\\\.\")[1].length() ==1){\n\t\t\t\treturn result.substring(0,result.length()-1);\n\t\t\t}else{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}else{\n\t\t\treturn String.format(\"%1$,d\",Long.parseLong(numString));\t\n\t\t}\n\t}", "static public String toStringLat(double val, boolean includeDecimal)\r\n {\r\n _workingHolder.setData(val, true);\r\n\r\n java.text.DecimalFormat secFormat = null;\r\n if (includeDecimal)\r\n secFormat = df;\r\n else\r\n secFormat = df2;\r\n\r\n String res = \" \" + df2.format(_workingHolder.deg) + DEGREE_SYMBOL +\r\n df2.format(_workingHolder.min) + \"\\'\" +\r\n secFormat.format(_workingHolder.sec) + \"\\\"\";\r\n\r\n // just check we're not at origin\r\n if(val != 0)\r\n \t res += _workingHolder.hem + \"\";\r\n\r\n // hack: when the degs symbol appears in the third character of the string, when\r\n // we write to Metafile the following (4th) character is swapped for a y.\r\n\r\n // when the degs symbol appears as the 4th character, however, the string\r\n // writes perfectly to metafile\r\n\r\n // consequently we insert a space at the front of the string to artificially\r\n // put the deg symbol in the 4th character.\r\n\r\n return res;\r\n }", "@Test\n\tpublic void input_10_() throws ValueOutOfBoundsException, MalformedNumberException {\n\t assertEquals(10, new RomanArabicConverter(\"10\").toArabic());\n assertEquals(\"X\", new RomanArabicConverter(\"10\").toRoman());\n\t}", "public String formatoDecimales(double valorInicial, int numeroDecimales ,int espacios) { \n String number = String.format(\"%.\"+numeroDecimales+\"f\", valorInicial);\n String str = String.valueOf(number);\n String num = str.substring(0, str.indexOf(',')); \n String numDec = str.substring(str.indexOf(',') + 1);\n \n for (int i = num.length(); i < espacios; i++) {\n num = \" \" + num;\n }\n \n for (int i = numDec.length(); i < espacios; i++) {\n numDec = numDec + \" \";\n }\n \n return num +\".\" + numDec;\n }", "@Test\n public void test_ScientificNotation_0130() {\n ScientificNotation x = new ScientificNotation(BigDecimal.ZERO);\n assertEquals(0, x.significand().doubleValue(), 0);\n assertEquals(0, x.exponent());\n }", "static int getNumberFromString(String s) {\n if (s == null) {\n throw new NumberFormatException(\"null\");\n }\n int result = 0;\n int startIndex = 0;\n int length = s.length();\n boolean negative = false;\n char firstChar = s.charAt(0);\n if (firstChar == '-') {\n negative = true;\n startIndex = 1;\n }\n\n for (int i = startIndex; i < length; i++) {\n char num = s.charAt(i);\n result = result * 10 + num - '0';\n }\n\n return negative ? -result : result;\n }", "public static String replace(String number, int scale) {\n if (TextUtils.isEmpty(number)) { return \"0\"; }\n number = newInstance(number).round(scale).create().toString();\n if (number.indexOf(\".\") > 0) {\n number = number.replaceAll(\"0+?$\", \"\"); //Remove the useless zero behind\n number = number.replaceAll(\"[.]$\", \"\"); // If the decimal point is all zero, remove the decimal point\n }\n return number;\n }", "public boolean get_exponent_sign();", "public static void main(String[] args) {\n\t double d=123456.789;\r\n\t\tNumberFormat nf=NumberFormat.getInstance(Locale.ITALY);\r\n\t\tNumberFormat nf1=NumberFormat.getInstance(Locale.US);\r\n\t\tNumberFormat nf2=NumberFormat.getInstance(Locale.ENGLISH);\r\n\t\tSystem.out.println(\"Italy representation of \" + d + \" : \"+nf.format(d));\r\n\t\tSystem.out.println(\"US representation of \" + d + \" : \" +nf1.format(d));\r\n\t\tSystem.out.println(\"Japan representation of \" + d + \" : \" +nf2.format(d));\r\n\t\t\r\n\t //DateTimeFormat in short,long and medium with getDateTimeInstance\r\n\t\tDateFormat df=DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT);\r\n\t System.out.println(\"Short format of date: \"+df.format(new Date()));\r\n\t DateFormat df1=DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);\r\n\t System.out.println(\"Long format of date: \"+df1.format(new Date()));\r\n\t DateFormat df2=DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM);\r\n\t System.out.println(\"Medium format of date: \"+df2.format(new Date()));\r\n\t \r\n\t //Locale date format giving countries starting letters to get time but using only getDateInstance(de-denmark)\r\n\t DateFormat df3=DateFormat.getDateInstance(DateFormat.SHORT,new Locale(\"de\",\"DE\"));\r\n\t System.out.println(\"Short format of date: \"+df3.format(new Date()));\r\n\t DateFormat df4=DateFormat.getDateInstance(DateFormat.LONG,new Locale(\"de\",\"DE\"));\r\n\t System.out.println(\"Long format of date: \"+df4.format(new Date()));\r\n\t DateFormat df5=DateFormat.getDateInstance(DateFormat.MEDIUM,new Locale(\"de\",\"DE\"));\r\n\t System.out.println(\"Medium format of date: \"+df5.format(new Date()));\r\n\t \r\n\r\n}", "public static String toMixedNum(int numerator, int denominator) {\n \tint whole=numerator/denominator;\t\t//make variable to store whole number by dividing num and denom\r\n\t\tint newnumerator=numerator%denominator;\t//get newnum by doing num mod denom\r\n\t\t\r\n\t\tif(whole<0) {\t\t\t//if whole number is negative and the new num is neg as well,\r\n\t\t\tnewnumerator *= -1;\t// make the new num positive\r\n\t\t}\r\n\t\tif(newnumerator==0 && whole==0) {\t//if the frac is 0 all-around\r\n\t\t\treturn \"0\";\t\t\t\t\t\t//return 0\r\n\t\t}\r\n\t\tif(newnumerator==0) {\t//if the num is 0 it's most likely\r\n\t\t\treturn whole + \"\";\t//just a whole number\r\n\t\t}\r\n\t\tif(newnumerator<0 && denominator<0) {\t//if the num and denom is both neg\r\n\t\t\tnewnumerator *= -1;\t\t\t\t\t//then the frac itself should be negative\r\n\t\t\tdenominator *= -1;\r\n\t\t}\r\n\t\tif(denominator<0) {\t\t\t\t//if denom is negative \r\n\t\t\tnewnumerator *= -1;\t\t\t//multiply both num and denom by -1 to get a postitive denom and neg num\r\n\t\t\tdenominator *= -1;\r\n\t\t}\r\n\t\tif(whole==0) {\t\t\t//if the whole num is 0\r\n\t\t\treturn simplify(newnumerator, denominator);\t//then it should just return num/denom\r\n\t\t}\r\n\t\treturn whole + \"_\"+ simplify(newnumerator, denominator); //return statement of the whole mixed frac\r\n }", "private static int invertirNumero(int num) {\n\t\tint cifra, inverso = 0;\n\t\twhile (num > 0) {\n\t\t\tcifra = num % 10;\n\t\t\tinverso = cifra + inverso * 10;\n\t\t\tnum /= 10;\n\t\t}\n\t\treturn inverso;\n\t}", "private static String toNumber(String in) {\n in = in.toLowerCase();\n for (int i = 0; i < MONTHS.length; i++)\n if (MONTHS[i].equals(in))\n return Integer.toString(i + 1);\n for (int i = 0; i < DAYS.length; i++)\n if (DAYS[i].equals(in))\n return Integer.toString(i);\n try {\n Integer.parseInt(in);\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"'\" + in + \"' is not a number!\");\n }\n return in;\n }", "private boolean formalDateContainsNegativeNumber(String source) {\n String dateWithNegativePattern = \".*-\\\\d+/|/-\\\\d+.*\";\n return source.matches(dateWithNegativePattern);\n }", "private String moneyFormat(String money)\n {\n if(money.indexOf('.') == -1)\n {\n return \"$\" + money;\n }\n else\n {\n String dec = money.substring(money.indexOf('.')+1 , money.length());\n if(dec.length() == 1)\n {\n return \"$\" + money.substring(0, money.indexOf('.')+1) + dec + \"0\";\n }\n else\n {\n return \"$\" + money.substring(0, money.indexOf('.')+1) + dec.substring(0,2);\n }\n }\n }", "@Test\n public void testDigits() {\n final String result = calc.type(\"1 + 2 - 3\")\n .press_equalBtn()\n .result();\n\n Assert.assertEquals(result, \"0\");\n }", "@Test\n public void testFloatingPointCurrency() {\n AntiPattern.floatingPointCurrency();\n }", "public static Object parseFloat(Context cx, Scriptable thisObj,\n Object[] args, Function funObj)\n {\n if (args.length < 1)\n return ScriptRuntime.NaNobj;\n String s = ScriptRuntime.toString(args[0]);\n int len = s.length();\n if (len == 0)\n return ScriptRuntime.NaNobj;\n \n int i;\n char c;\n // Scan forward to the first digit or .\n for (i=0; TokenStream.isJSSpace(c = s.charAt(i)) && i+1 < len; i++)\n /* empty */\n ;\n \n int start = i;\n \n if (c == '+' || c == '-')\n c = s.charAt(++i);\n \n if (c == 'I') {\n // check for \"Infinity\"\n double d;\n if (i+8 <= len && s.substring(i, i+8).equals(\"Infinity\"))\n d = s.charAt(start) == '-' ? Double.NEGATIVE_INFINITY\n : Double.POSITIVE_INFINITY;\n else\n return ScriptRuntime.NaNobj;\n return new Double(d);\n }\n \n // Find the end of the legal bit\n int decimal = -1;\n int exponent = -1;\n for (; i < len; i++) {\n switch (s.charAt(i)) {\n case '.':\n if (decimal != -1) // Only allow a single decimal point.\n break;\n decimal = i;\n continue;\n \n case 'e':\n case 'E':\n if (exponent != -1)\n break;\n exponent = i;\n continue;\n \n case '+':\n case '-':\n // Only allow '+' or '-' after 'e' or 'E'\n if (exponent != i-1)\n break;\n continue;\n \n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n continue;\n \n default:\n break;\n }\n break;\n }\n s = s.substring(start, i);\n try {\n return Double.valueOf(s);\n }\n catch (NumberFormatException ex) {\n return ScriptRuntime.NaNobj;\n }\n }", "public String get_exponent_part();", "public void llenarnumerodecimales(java.awt.event.KeyEvent evt, int tamanioEntero, int tamanioDecimal, String txt){\n char c = evt.getKeyChar();\r\n int bDecimal = 0, bEntero = 0;\r\n// if ((c >= '0') || (c <= '9') && bEntero)\r\n// bEntero++;\r\n if (((c < '0') || (c > '9')) && (c != KeyEvent.VK_BACK_SPACE) && (c != '.')) {\r\n evt.consume();\r\n JOptionPane.showMessageDialog(null, \"Debe ingresar sólo números!!!\", \"Mensaje del sistema\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n if (c == '.' && txt.contains(\".\")) {\r\n evt.consume();\r\n JOptionPane.showMessageDialog(null, \"No puede ingresar más puntos!!!\", \"Mensaje del sistema\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "private double tranferStringToNum(String num){\r\n double number = 0;\r\n try{\r\n\tnumber = Double.parseDouble(num);\r\n }catch(Exception ex){\r\n\tnumber = 0;\r\n }\r\n return number;\r\n }", "private String toPattern(boolean localized) {\n StringBuffer result = new StringBuffer();\n for (int j = 1; j >= 0; --j) {\n if (j == 1)\n appendAffix(result, posPrefixPattern, positivePrefix, localized);\n else\n appendAffix(result, negPrefixPattern, negativePrefix, localized);\n int i;\n int digitCount = useExponentialNotation ? getMaximumIntegerDigits() : Math.max(groupingSize, getMinimumIntegerDigits()) + 1;\n for (i = digitCount; i > 0; --i) {\n if (i != digitCount && isGroupingUsed() && groupingSize != 0 && i % groupingSize == 0) {\n result.append(localized ? symbols.getGroupingSeparator() : PATTERN_GROUPING_SEPARATOR);\n }\n result.append(i <= getMinimumIntegerDigits() ? (localized ? symbols.getZeroDigit() : PATTERN_ZERO_DIGIT) : (localized ? symbols.getDigit()\n : PATTERN_DIGIT));\n }\n if (getMaximumFractionDigits() > 0 || decimalSeparatorAlwaysShown)\n result.append(localized ? symbols.getDecimalSeparator() : PATTERN_DECIMAL_SEPARATOR);\n for (i = 0; i < getMaximumFractionDigits(); ++i) {\n if (i < getMinimumFractionDigits()) {\n result.append(localized ? symbols.getZeroDigit() : PATTERN_ZERO_DIGIT);\n } else {\n result.append(localized ? symbols.getDigit() : PATTERN_DIGIT);\n }\n }\n if (useExponentialNotation) {\n result.append(localized ? symbols.getExponentialSymbol() : PATTERN_EXPONENT);\n for (i = 0; i < minExponentDigits; ++i)\n result.append(localized ? symbols.getZeroDigit() : PATTERN_ZERO_DIGIT);\n }\n if (j == 1) {\n appendAffix(result, posSuffixPattern, positiveSuffix, localized);\n if ((negSuffixPattern == posSuffixPattern && // n == p == null\n negativeSuffix.equals(positiveSuffix))\n || (negSuffixPattern != null && negSuffixPattern.equals(posSuffixPattern))) {\n if ((negPrefixPattern != null && posPrefixPattern != null && negPrefixPattern.equals(\"'-\" + posPrefixPattern))\n || (negPrefixPattern == posPrefixPattern && // n ==\n // p ==\n // null\n negativePrefix.equals(symbols.getMinusSign() + positivePrefix)))\n break;\n }\n result.append(localized ? symbols.getPatternSeparator() : PATTERN_SEPARATOR);\n } else\n appendAffix(result, negSuffixPattern, negativeSuffix, localized);\n }\n return result.toString();\n }", "private static String canonicalDecimalStr_X(BigDecimal d) {\n String x = d.toPlainString() ;\n\n // The part after the \".\"\n int dotIdx = x.indexOf('.') ;\n if ( dotIdx < 0 )\n // No DOT.\n return x+\".0\";\n\n // Has a DOT.\n int i = x.length() - 1 ;\n // dotIdx+1 to leave at least \".0\"\n while ((i > dotIdx + 1) && x.charAt(i) == '0')\n i-- ;\n if ( i < x.length() - 1 )\n // And trailing zeros.\n x = x.substring(0, i + 1) ;\n // Avoid replaceAll as it is expensive.\n // Leading zeros.\n int j = 0;\n for ( ; j < x.length() ; j++ ) {\n if ( x.charAt(j) != '0')\n break;\n }\n // At least one zero before dot.\n if ( j == dotIdx )\n j--;\n if ( j > 0 )\n x = x.substring(j, x.length());\n return x;\n }", "String getValueFormat();", "private double readPositive(JTextField field, double oldValue, String title) {\n boolean isOK = true;\n double newValue = 1;\n try{\n //test input\n newValue = Double.parseDouble(field.getText());\n }\n catch (NumberFormatException e){\n //Error message\n JOptionPane.showMessageDialog(null,\n NOT_A_NUMBER,\n title,\n JOptionPane.ERROR_MESSAGE);\n isOK = false;\n }\n if (newValue <=0){\n //ERROR message\n JOptionPane.showMessageDialog(null,\n NOT_POSITIVE,\n title,\n JOptionPane.ERROR_MESSAGE);\n isOK = false;\n }\n if (isOK)\n return newValue;\n\n else {\n field.setText(numberFormatter.format(oldValue));\n return oldValue;\n }\n }", "public abstract float mo70722e(String str);", "public static int myAtoi(String s) {\n int n = s.length();\n if (n == 0) {\n return 0;\n }\n int i = 0;\n char[] c = s.toCharArray();\n\n //去除空格\n while (i < n && c[i] == ' ') {\n i++;\n }\n //极端情况 \" \"\n if (i == n) {\n return 0;\n }\n //判断符号\n int sign = 1;\n if (c[i] == '-') {\n sign = -1;\n i++;\n } else if (c[i] == '+') {\n i++;\n }\n //遍历\n int res = 0;\n while (i<n){\n char cur = c[i];\n if(cur< '0' || cur > '9'){\n break;\n }\n //提前判断乘以10 + 上当前数字是否越界\n if (res > Integer.MAX_VALUE / 10 || (res == Integer.MAX_VALUE / 10 && (cur - '0') > Integer.MAX_VALUE % 10)) {\n return Integer.MAX_VALUE;\n }\n if (res < Integer.MIN_VALUE / 10 || (res == Integer.MIN_VALUE / 10 && (cur - '0') > -(Integer.MIN_VALUE % 10))) {\n return Integer.MIN_VALUE;\n }\n res = res*10 + sign*(cur-'0');\n i++;\n }\n return res;\n\n\n }", "@Test\n public void testGetDefaultFormatter() {\n System.out.println(\"getDefaultFormatter\");\n Temperature t = new Temperature(10.0);\n NumberFormat formatter = Temperature.getDefaultFormatter();\n String s = formatter.format(t.get());\n assertEquals(\"10.0\", s);\n\n s = Temperature.Unit.CELSIUS.getFormatterWithUnit().format(t.get());\n assertEquals(\"10.0 C\", s);\n\n s = Temperature.Unit.CELSIUS.toString();\n assertEquals(\"\\260C\", s);\n }", "private Double parseNumber(String num) {\r\n\t\tDouble tempnum = (double) 0;\r\n\t\tint opos; //operator position\r\n\t\tif ((num == null) || (num.length() < 1) ) {\r\n\t\t\treturn tempnum;\r\n\t\t}\r\n\r\n\t\t//replace constants with their value\r\n\t\twhile (num.indexOf(\"P\") >= 0) { //PI constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'P', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.PI)+numparts[1];\r\n\t\t}\r\n\t\twhile (num.indexOf(\"X\") >= 0) { //e constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'X', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.E)+numparts[1];\r\n\t\t}\r\n\r\n\t\tif (num.indexOf(\"^\") >= 0) { //allows to specify powers (e.g.: 2^10)\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '^', 2);\r\n\t\t\ttempnum = Math.pow(parseNumber(numparts[0]), parseNumber(numparts[1]));\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"-\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '-', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) - parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"+\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '+', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) + parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"/\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '/', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) / parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"*\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '*', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) * parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttempnum = Double.valueOf(num);\r\n\t\t}\r\n\r\n\t\treturn tempnum;\r\n\t}", "private String getDecimalPattern(String str) {\n int decimalCount = str.length() - str.indexOf(\".\") - 1;\n StringBuilder decimalPattern = new StringBuilder();\n for (int i = 0; i < decimalCount && i < MAX_DECIMAL; i++) {\n decimalPattern.append(\"0\");\n }\n return decimalPattern.toString();\n }", "@Test (expected=MalformedNumberException.class)\n public void inputVLX() throws MalformedNumberException\n {\n new RomanArabicConverter(\"VLX\");\n }", "public static String standardizePhoneNumber( String phoneNumber)\n {\n // Write your implementation here\n String res = \"\";\n int count = 0;\n for (int i = 0; i < phoneNumber.length(); i++) {\n char c = phoneNumber.charAt(i);\n if (c >= 48 && c <= 57) {\n count++;\n res += String.valueOf(c);\n if (res.length() == 3 || res.length() == 7)\n res += \"-\";\n }\n if (count > 10) return \"\";\n }\n\n if (count != 10) return \"\";\n return res;\n }", "public static Symbol decimal(String text)\r\n\t{\r\n\t\treturn number(text, 10);\r\n\t}", "public String getLocale () throws java.io.IOException, com.linar.jintegra.AutomationException;", "private float translateField(Field field){\r\n\t\tif (field == null) return -1;\r\n\t\tswitch (field){\r\n\t\t\tcase COVERED_EMPTY:\r\n\t\t\tcase COVERED_MINE:\r\n\t\t\tcase EMPTY:\r\n\t\t\t\treturn 0;\r\n\t\t\tcase ONE:\r\n\t\t\t\treturn 0.125f;\r\n\t\t\tcase TWO:\r\n\t\t\t\treturn 0.25f;\r\n\t\t\tcase THREE:\r\n\t\t\t\treturn 0.375f;\r\n\t\t\tcase FOUR:\r\n\t\t\t\treturn 0.5f;\r\n\t\t\tcase FIVE:\r\n\t\t\t\treturn 0.625f;\r\n\t\t\tcase SIX:\r\n\t\t\t\treturn 0.75f;\r\n\t\t\tcase SEVEN:\r\n\t\t\t\treturn 0.875f;\r\n\t\t\tcase EIGHT:\r\n\t\t\t\treturn 1;\r\n\t\t\tdefault:\r\n\t\t\t\t//Should never happen\r\n\t\t\t\tSystem.err.println(\"Unknown case!!!\");\r\n\t\t\t\treturn -1;\r\n\t\t}\r\n\t}", "public String format(double number);", "@Test\n public void input_100_() throws ValueOutOfBoundsException, MalformedNumberException {\n final RomanArabicConverter rac = new RomanArabicConverter(\"100\");\n assertEquals(100, rac.toArabic());\n assertEquals(\"C\", rac.toRoman());\n }", "private String filterDecimalString(String string) {\n return string\n .replaceAll(\"[^0-9.]\", \"\")\n .replaceFirst(\"\\\\.\", \"@\")\n .replaceAll(\"\\\\.\", \"\")\n .replaceFirst(\"@\", \".\");\n }", "public static String multiFormatNumber(Number theValue, String format, String groupSep, String decimalSep) throws BaseException\n {\n try\n {\n \tString result = null;\n \tNumber value = theValue;\n \tDecimalFormat _df = new DecimalFormat();\n \t_df.setRoundingMode(RoundingMode.HALF_UP);\n \tif(format.indexOf(\";\") == -1)\n \t{\n \t _df.applyPattern(format);\n\t result = _df.format(value);\n\t \n \t}\n \telse\n \t{\n\n \t String[] formatting = null;\n \t String[] formatType = { \"posFrmt\", \"negFrmt\", \"zeroFrmt\", \"nullFrmt\" };\n \t HashMap<String,String> formatMap = new HashMap<String,String>();\n \t formatting = format.split(\";\");\n\n \t for(int i = 0; i < formatting.length; i++)\n \t {\n \t\tformatMap.put(formatType[i], formatting[i]);\n \t }\n\n \t \n \t if(value == null)\n \t {\n \t\tif(formatMap.get(\"nullFrmt\") != null)\n \t\t{\n \t\t _df.applyPattern(formatMap.get(\"nullFrmt\"));\n \t\t result = _df.format(0);\n \t\t}\n \t }\n \t else\n \t {\n \t\tDouble valDouble = value.doubleValue();\n \t\tif(valDouble > 0)\n \t\t{\n \t\t if(formatMap.get(\"posFrmt\") != null)\n \t\t {\n \t\t\t_df.applyPattern(formatMap.get(\"posFrmt\"));\n \t\t\tresult = _df.format(value);\n \t\t }\n \t\t}\n \t\telse if(valDouble < 0)\n \t\t{\n \t\t if(formatMap.get(\"negFrmt\") != null)\n \t\t {\n \t\t\t_df.applyPattern(formatMap.get(\"negFrmt\"));\n \t\t\tvalue = Math.abs(valDouble);\n \t\t\tresult = _df.format(value);\n \t\t }\n \t\t}\n \t\telse if(valDouble == 0)\n \t\t{\n \t\t if(formatMap.get(\"zeroFrmt\") == null)\n \t\t {\n \t\t\t_df.applyPattern(formatMap.get(\"posFrmt\"));\n \t\t }\n \t\t else\n \t\t {\n \t\t\t_df.applyPattern(formatMap.get(\"zeroFrmt\")); \t\t\t\n \t\t }\n \t\t result = _df.format(valDouble);\n \t\t}\n \t }\n \t}\n \t\n \tString returnFrmt = null;\n \tif(result != null)\n \t{\n \t String theGrpSep = groupSep;\n \t String theDecSep = decimalSep;\n \t if(theGrpSep == null || theGrpSep.isEmpty() || theDecSep == null || theDecSep.isEmpty())\n \t {\n \t\t// return group and decimal separator from session if any\n \t\tString[] grpDecArr = returnGroupDecimalSep();\n \t\tif(theGrpSep == null || theGrpSep.isEmpty())\n \t\t{\n \t\t theGrpSep = grpDecArr[0];\n \t\t}\n \t\tif(theDecSep == null || theDecSep.isEmpty())\n \t\t{\n \t\t theDecSep = grpDecArr[1];\n \t\t}\n \t }\n \t // need first to replace by #grpSep# so that in case the group separator is equal to dot . the replacement will be correct\n \t returnFrmt = result.replace(\",\",\"#grp#\");\n \t returnFrmt = returnFrmt.replace(\".\",theDecSep+\"\");\n \t returnFrmt = returnFrmt.replace(\"#grp#\",theGrpSep+\"\");\n \t}\n\t \n\t return returnFrmt;\n }\n catch(Exception e)\n {\n \t throw new BaseException(e);\n }\n }", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }" ]
[ "0.65394247", "0.63646406", "0.59206754", "0.5881485", "0.5799803", "0.5755947", "0.57297724", "0.5697359", "0.56487477", "0.5635813", "0.56229794", "0.56125", "0.55878836", "0.55092907", "0.5506636", "0.54885393", "0.54787654", "0.5473533", "0.5434447", "0.54258186", "0.54239744", "0.54127324", "0.54123396", "0.54012436", "0.5396517", "0.538619", "0.537186", "0.5322374", "0.53162825", "0.53042966", "0.52876604", "0.52857125", "0.52840513", "0.52734697", "0.5271805", "0.52714866", "0.52698296", "0.52633905", "0.52608925", "0.5258217", "0.5245202", "0.52405024", "0.52360165", "0.5234306", "0.52296555", "0.5226532", "0.5223105", "0.52214605", "0.5219681", "0.52145875", "0.52145875", "0.5213151", "0.5207691", "0.52021396", "0.5194831", "0.5184298", "0.51810086", "0.51808405", "0.51784986", "0.517792", "0.5174953", "0.5172614", "0.5170288", "0.5169114", "0.5161046", "0.5159076", "0.51483685", "0.5142996", "0.51387715", "0.51354784", "0.5122599", "0.51175916", "0.5114571", "0.51068664", "0.51017386", "0.51002735", "0.5099102", "0.50888216", "0.50862527", "0.50795734", "0.507952", "0.5078289", "0.50677216", "0.50638205", "0.5063089", "0.50617945", "0.5059767", "0.5058402", "0.50575125", "0.5056432", "0.505365", "0.50436336", "0.5039533", "0.50390464", "0.5039044", "0.5034115", "0.50331944", "0.5031505", "0.5029055", "0.5023147", "0.5022797" ]
0.0
-1
Taken from CraigTP's answer on StackOverflow
public static boolean isNumericInternational(String str) { try { double d = Double.parseDouble(str); } catch(NumberFormatException nfe) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void method_4270() {}", "protected boolean func_70814_o() { return true; }", "public void func_70305_f() {}", "public abstract int mo9754s();", "@Override\n public void func_104112_b() {\n \n }", "public abstract String mo13682d();", "private void kk12() {\n\n\t}", "void mo57277b();", "static int size_of_inx(String passed){\n\t\treturn 1;\n\t}", "public abstract String mo9239aw();", "public abstract String mo118046b();", "private void m50366E() {\n }", "public void func_70295_k_() {}", "public abstract String mo41079d();", "abstract String mo1748c();", "public abstract long mo9229aD();", "String lowValue(String comp) { return null; }", "static int size_of_xthl(String passed){\n\t\treturn 1;\n\t}", "public abstract Object mo26777y();", "static int type_of_inx(String passed){\n\t\treturn 1;\n\t}", "public abstract String mo11611b();", "void mo57278c();", "private void strin() {\n\n\t}", "static int type_of_xthl(String passed){\n\t\treturn 1;\n\t}", "public abstract String mo9751p();", "public int func_70297_j_()\n/* */ {\n/* 71 */ return 64;\n/* */ }", "static int size_of_xri(String passed){\n\t\treturn 2;\n\t}", "abstract String mo1747a(String str);", "public abstract String mo24851a(String str);", "public abstract int mo8526p();", "static int size_of_xra(String passed){\n\t\treturn 1;\n\t}", "static int size_of_ani(String passed){\n\t\treturn 2;\n\t}", "public abstract int mo9747l();", "public abstract void mo56925d();", "public abstract void mo70713b();", "public abstract void mo27385c();", "public abstract int mo9797a();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract int mo123248g();", "static int size_of_sbb(String passed){\n\t\treturn 1;\n\t}", "private int e(String paramString, int paramInt)\r\n/* 628: */ {\r\n/* 629:624 */ int i1 = paramString.length();\r\n/* 630:625 */ int i2 = 0;\r\n/* 631:626 */ int i3 = 0;\r\n/* 632:627 */ int i4 = -1;\r\n/* 633:628 */ int i5 = 0;\r\n/* 634:631 */ for (; i3 < i1; i3++)\r\n/* 635: */ {\r\n/* 636:632 */ char c1 = paramString.charAt(i3);\r\n/* 637:634 */ switch (c1)\r\n/* 638: */ {\r\n/* 639: */ case '§': \r\n/* 640:636 */ if (i3 < i1 - 1)\r\n/* 641: */ {\r\n/* 642:637 */ char c2 = paramString.charAt(++i3);\r\n/* 643:638 */ if ((c2 == 'l') || (c2 == 'L')) {\r\n/* 644:639 */ i5 = 1;\r\n/* 645:640 */ } else if ((c2 == 'r') || (c2 == 'R') || (c(c2))) {\r\n/* 646:641 */ i5 = 0;\r\n/* 647: */ }\r\n/* 648: */ }\r\n/* 649:643 */ break;\r\n/* 650: */ case '\\n': \r\n/* 651:646 */ i3--;\r\n/* 652:647 */ break;\r\n/* 653: */ case ' ': \r\n/* 654:649 */ i4 = i3;\r\n/* 655: */ default: \r\n/* 656:651 */ i2 += a(c1);\r\n/* 657:652 */ if (i5 != 0) {\r\n/* 658:653 */ i2++;\r\n/* 659: */ }\r\n/* 660: */ break;\r\n/* 661: */ }\r\n/* 662:657 */ if (c1 == '\\n')\r\n/* 663: */ {\r\n/* 664:658 */ i3++;i4 = i3;\r\n/* 665: */ }\r\n/* 666: */ else\r\n/* 667: */ {\r\n/* 668:662 */ if (i2 > paramInt) {\r\n/* 669: */ break;\r\n/* 670: */ }\r\n/* 671: */ }\r\n/* 672: */ }\r\n/* 673:667 */ if ((i3 != i1) && (i4 != -1) && (i4 < i3)) {\r\n/* 674:668 */ return i4;\r\n/* 675: */ }\r\n/* 676:670 */ return i3;\r\n/* 677: */ }", "public int n_()\r\n/* 429: */ {\r\n/* 430:442 */ return this.a.length + 4;\r\n/* 431: */ }", "public abstract String mo41086i();", "private static int m6083a(Object obj) {\n if (obj == null) {\n return 1;\n }\n if (obj == Undefined.f6689a) {\n return 0;\n }\n if (obj instanceof CharSequence) {\n return 4;\n }\n if (obj instanceof Number) {\n return 3;\n }\n if (obj instanceof Boolean) {\n return 2;\n }\n if (obj instanceof Scriptable) {\n if (obj instanceof NativeJavaClass) {\n return 5;\n }\n if (obj instanceof NativeJavaArray) {\n return 7;\n }\n if (obj instanceof Wrapper) {\n return 6;\n }\n return 8;\n } else if (obj instanceof Class) {\n return 5;\n } else {\n if (obj.getClass().isArray()) {\n return 7;\n }\n return 6;\n }\n }", "static int size_of_lxi(String passed){\n\t\treturn 3;\n\t}", "private void m50367F() {\n }", "public abstract int mo9749n();", "static int size_of_rnz(String passed){\n\t\treturn 1;\n\t}", "String mo38971b();", "protected float l()\r\n/* 72: */ {\r\n/* 73: 84 */ return 0.0F;\r\n/* 74: */ }", "static int type_of_rnz(String passed){\n\t\treturn 1;\n\t}", "public abstract int mo123247f();", "public abstract void mo6549b();", "public abstract void mo2624j();", "long getUnknown2();", "int reproduce();", "boolean mo30282b();", "void mo41086b();", "static int size_of_rpo(String passed){\n\t\treturn 1;\n\t}", "protected float j()\r\n/* 67: */ {\r\n/* 68: 80 */ return 1.5F;\r\n/* 69: */ }", "public abstract long mo13681c();", "private static void cajas() {\n\t\t\n\t}", "public abstract String mo9238av();", "int mo5882g(String str);", "public int g()\r\n/* 173: */ {\r\n/* 174:198 */ return 0;\r\n/* 175: */ }", "static int size_of_ldax(String passed){\n\t\treturn 1;\n\t}", "static int size_of_pchl(String passed){\n\t\treturn 1;\n\t}", "void mo119582b();", "private static int zzaz(java.lang.String r5) {\n /*\n int r0 = r5.hashCode()\n r1 = 0\n r2 = 3\n r3 = 2\n r4 = 1\n switch(r0) {\n case -1095064472: goto L_0x002a;\n case 187078296: goto L_0x0020;\n case 1504578661: goto L_0x0016;\n case 1505942594: goto L_0x000c;\n default: goto L_0x000b;\n }\n L_0x000b:\n goto L_0x0034\n L_0x000c:\n java.lang.String r0 = \"audio/vnd.dts.hd\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 3\n goto L_0x0035\n L_0x0016:\n java.lang.String r0 = \"audio/eac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 1\n goto L_0x0035\n L_0x0020:\n java.lang.String r0 = \"audio/ac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 0\n goto L_0x0035\n L_0x002a:\n java.lang.String r0 = \"audio/vnd.dts\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 2\n goto L_0x0035\n L_0x0034:\n r5 = -1\n L_0x0035:\n if (r5 == 0) goto L_0x0045\n if (r5 == r4) goto L_0x0043\n if (r5 == r3) goto L_0x0041\n if (r5 == r2) goto L_0x003e\n return r1\n L_0x003e:\n r5 = 8\n return r5\n L_0x0041:\n r5 = 7\n return r5\n L_0x0043:\n r5 = 6\n return r5\n L_0x0045:\n r5 = 5\n return r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzio.zzaz(java.lang.String):int\");\n }", "public abstract int mo9741f();", "public int a(char paramChar)\r\n/* 484: */ {\r\n/* 485:481 */ if (paramChar == '§') {\r\n/* 486:482 */ return -1;\r\n/* 487: */ }\r\n/* 488:485 */ if (paramChar == ' ') {\r\n/* 489:486 */ return 4;\r\n/* 490: */ }\r\n/* 491:489 */ int i1 = \"\".indexOf(paramChar);\r\n/* 492:490 */ if ((paramChar > 0) && (i1 != -1) && (!this.k)) {\r\n/* 493:491 */ return this.d[i1];\r\n/* 494: */ }\r\n/* 495:495 */ if (this.e[paramChar] != 0)\r\n/* 496: */ {\r\n/* 497:496 */ int i2 = this.e[paramChar] >>> 4;\r\n/* 498:497 */ int i3 = this.e[paramChar] & 0xF;\r\n/* 499:499 */ if (i3 > 7)\r\n/* 500: */ {\r\n/* 501:500 */ i3 = 15;\r\n/* 502:501 */ i2 = 0;\r\n/* 503: */ }\r\n/* 504:503 */ i3++;\r\n/* 505: */ \r\n/* 506:505 */ return (i3 - i2) / 2 + 1;\r\n/* 507: */ }\r\n/* 508:508 */ return 0;\r\n/* 509: */ }", "static int size_of_dcr(String passed){\n\t\treturn 1;\n\t}", "public abstract void mo27386d();", "void mo72113b();", "private void poetries() {\n\n\t}", "public abstract int mo9753r();", "public abstract String mo83558a(Object obj);", "protected boolean func_70041_e_() { return false; }", "void mo41083a();", "void mo21076g();", "public abstract int mo4375b();", "public void mo21877s() {\n }", "public boolean func_145773_az() { return true; }", "String mo21078i();", "static int size_of_ori(String passed){\n\t\treturn 2;\n\t}", "static int size_of_sub(String passed){\n\t\treturn 1;\n\t}", "void mo1943l();", "@Override\r\n\tprotected Integer deriveLower() {\r\n\t return 0;\r\n\t}", "static int size_of_cpi(String passed){\n\t\treturn 2;\n\t}", "static int size_of_jm(String passed){\n\t\treturn 3;\n\t}", "public abstract int mo13680b();", "static int size_of_jz(String passed){\n\t\treturn 3;\n\t}", "String getFirstIndex();", "public int p_()\r\n/* 463: */ {\r\n/* 464:477 */ return 64;\r\n/* 465: */ }", "static int getNumPatterns() { return 64; }", "String getMGFAlgorithm();", "static int size_of_dcx(String passed){\n\t\treturn 1;\n\t}", "int getMagic();", "int expand();", "static int type_of_cnz(String passed){\n\t\treturn 1;\n\t}", "String getBegin();" ]
[ "0.5463842", "0.52122253", "0.51914793", "0.51697344", "0.5144335", "0.50483245", "0.50391316", "0.5034999", "0.5028256", "0.50192255", "0.50068474", "0.49757388", "0.49706703", "0.49445093", "0.49212712", "0.48753402", "0.48738697", "0.48714086", "0.48661065", "0.48617268", "0.48606", "0.4857177", "0.48425612", "0.48396868", "0.48351744", "0.4833378", "0.4830619", "0.48258978", "0.48170474", "0.4812051", "0.48008803", "0.47965193", "0.47945684", "0.47934952", "0.47917354", "0.4787131", "0.47759196", "0.4770116", "0.4767343", "0.47651914", "0.4761857", "0.4759116", "0.47559237", "0.47478732", "0.47460565", "0.4744437", "0.47429612", "0.4740718", "0.4733662", "0.47330642", "0.47296026", "0.4727997", "0.47261754", "0.47214016", "0.47150838", "0.4710346", "0.4707275", "0.47049886", "0.4703287", "0.46990073", "0.46981895", "0.4693166", "0.46925017", "0.4690137", "0.46895555", "0.46881205", "0.46835425", "0.46831825", "0.46829084", "0.4675478", "0.46739867", "0.46732798", "0.4673214", "0.46697658", "0.4665757", "0.46632662", "0.46627676", "0.46625456", "0.46620736", "0.46614847", "0.4660635", "0.465294", "0.46513575", "0.46504232", "0.46444488", "0.46439654", "0.46435794", "0.46432814", "0.4643211", "0.46429288", "0.4637825", "0.4637437", "0.46368942", "0.46330816", "0.46319723", "0.46313772", "0.46288276", "0.46286216", "0.4624742", "0.46244714", "0.46243134" ]
0.0
-1
Taken from CraigTP's answer on StackOverflow Does not work for numbers that are negative or decimals
public static boolean isNumeric(String str) { return str.chars().allMatch( Character::isDigit ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main( String[] args ) {\n System.out.println(NumUtil.format4DecimalPoint(1));\n System.out.println(NumUtil.format4DecimalPoint(1.1));\n System.out.println(NumUtil.format4DecimalPoint(1.12));\n System.out.println(NumUtil.format4DecimalPoint(1.123));\n System.out.println(NumUtil.format4DecimalPoint(1.1234));\n System.out.println(NumUtil.format4DecimalPoint(1.12345));\n System.out.println(NumUtil.format4DecimalPoint(1.123456));\n System.out.println(NumUtil.format4DecimalPoint(12.123456));\n \n double a = 0.09d;\n double b = 0.01d;\n double c = 0.1d;\n \n System.out.println( ( a + b ) );\n System.out.println( c - ( a + b ) == 0 );\n \n //Currency Testing\n Locale canadianEnglish = new Locale( \"en\",\"CA\" );\n NumberFormat currencyFormat = NumberFormat.getCurrencyInstance( Locale.CANADA_FRENCH );\n currencyFormat.setCurrency( Currency.getInstance( Locale.CANADA ) );\n currencyFormat.setMinimumFractionDigits( 2 );\n currencyFormat.setMaximumFractionDigits( 4 );\n double amt = -1.21234;\n System.out.println(amt + \" formats as \" + currencyFormat.format( amt ));\n System.out.println( formatPercent( 2.34d ));\n System.out.println( formatPercent( 0.54d ));\n System.out.println( formatPercent( 99.99999d ));\n System.out.println( formatPercent( 99d ));\n System.out.println( formatPercent( 100d ));\n System.out.println( formatPercent( 150d ));\n System.out.println( formatPercent( 150.1d ));\n System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\");\n \n System.out.println(\"formatNoDecimalPoint\");\n \n System.out.println(\"0.000 -> \"+NumUtil.formatNoDecimalPoint(0.000));\n System.out.println(\"0.0005 -> \"+NumUtil.formatNoDecimalPoint(0.0005));\n\tSystem.out.println(\"0.05 -> \"+NumUtil.formatNoDecimalPoint(0.05));\n\tSystem.out.println(\"0.5 -> \"+NumUtil.formatNoDecimalPoint(0.5));\n\tSystem.out.println(\"1 -> \"+NumUtil.formatNoDecimalPoint(1));\n\tSystem.out.println(\"1.1 -> \"+NumUtil.formatNoDecimalPoint(1.1));\n\tSystem.out.println(\"1.12 -> \"+NumUtil.formatNoDecimalPoint(1.12));\n\tSystem.out.println(\"1.123 -> \"+NumUtil.formatNoDecimalPoint(1.123));\n\tSystem.out.println(\"1.1234 -> \"+NumUtil.formatNoDecimalPoint(1.1234));\n\tSystem.out.println(\"1.12345 -> \"+NumUtil.formatNoDecimalPoint(1.12345));\n\tSystem.out.println(\"1.123456 -> \"+NumUtil.formatNoDecimalPoint(1.123456));\n\tSystem.out.println(\"12.12345699999999999999999999999999999999 -> \"+NumUtil.formatNoDecimalPoint(12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"566762.42 -> \"+formatNoDecimalPoint(566762.42));\n\tSystem.out.println(\"56676242.00 -> \"+formatNoDecimalPoint(56676242.00));\n\tSystem.out.println(\"2342342342.00 -> \"+formatNoDecimalPoint(2342342342.00));\n\tSystem.out.println(\"12345678901234.12345678901234567890 -> \"+formatNoDecimalPoint(12345678901234.12345678901234567890));\n \n\t\n\tSystem.out.println(\"NumUtil.format2DecimalPoint\");\n \n\tSystem.out.println(\"0.0005 -> \"+NumUtil.format2DecimalPoint(0.0005));\n\tSystem.out.println(\"0.05 -> \"+NumUtil.format2DecimalPoint(0.05));\n\tSystem.out.println(\"0.5 -> \"+NumUtil.format2DecimalPoint(0.5));\n\tSystem.out.println(\"1 -> \"+NumUtil.format2DecimalPoint(1));\n\tSystem.out.println(\"1.1 -> \"+NumUtil.format2DecimalPoint(1.1));\n\tSystem.out.println(\"1.12 -> \"+NumUtil.format2DecimalPoint(1.12));\n\tSystem.out.println(\"1.123 -> \"+NumUtil.format2DecimalPoint(1.123));\n\tSystem.out.println(\"1.1234 -> \"+NumUtil.format2DecimalPoint(1.1234));\n\tSystem.out.println(\"1.12345 -> \"+NumUtil.format2DecimalPoint(1.12345));\n\tSystem.out.println(\"1.123456 -> \"+NumUtil.format2DecimalPoint(1.123456));\n\tSystem.out.println(\"12.12345699999999999999999999999999999999 -> \"+NumUtil.format2DecimalPoint(12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"566762.42 -> \"+format2DecimalPoint(566762.42));\n\tSystem.out.println(\"56676242.00 -> \"+format2DecimalPoint(56676242.00));\n\tSystem.out.println(\"2342342342.00 -> \"+format2DecimalPoint(2342342342.00));\n\tSystem.out.println(\"12345678901234.12345678901234567890 -> \"+format2DecimalPoint(12345678901234.12345678901234567890));\n\t\n\t\n \n////////////\n\t\nSystem.out.println(\"formatNoDecimalPoint\");\n \n System.out.println(\"0.000 -> \"+NumUtil.formatNoDecimalPoint(0.00));\n System.out.println(\"-0.0005 -> \"+NumUtil.formatNoDecimalPoint(-0.0005));\n\tSystem.out.println(\"-0.05 -> \"+NumUtil.formatNoDecimalPoint(-0.05));\n\tSystem.out.println(\"-0.5 -> \"+NumUtil.formatNoDecimalPoint(-0.5));\n\tSystem.out.println(\"-1 -> \"+NumUtil.formatNoDecimalPoint(-1));\n\tSystem.out.println(\"-1.1 -> \"+NumUtil.formatNoDecimalPoint(-1.1));\n\tSystem.out.println(\"-1.12 -> \"+NumUtil.formatNoDecimalPoint(-1.12));\n\tSystem.out.println(\"-1.123 -> \"+NumUtil.formatNoDecimalPoint(-1.123));\n\tSystem.out.println(\"-1.1234 -> \"+NumUtil.formatNoDecimalPoint(-1.1234));\n\tSystem.out.println(\"-1.12345 -> \"+NumUtil.formatNoDecimalPoint(-1.12345));\n\tSystem.out.println(\"-1.123456 -> \"+NumUtil.formatNoDecimalPoint(-1.123456));\n\tSystem.out.println(\"-12.12345699999999999999999999999999999999 -> \"+NumUtil.formatNoDecimalPoint(-12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"-566762.42 -> \"+formatNoDecimalPoint(-566762.42));\n\tSystem.out.println(\"-56676242.00 -> \"+formatNoDecimalPoint(-56676242.00));\n\tSystem.out.println(\"-2342342342.00 -> \"+formatNoDecimalPoint(-2342342342.00));\n\tSystem.out.println(\"-12345678901234.12345678901234567890 -> \"+formatNoDecimalPoint(-12345678901234.12345678901234567890));\n \n\t\n\tSystem.out.println(\"NumUtil.format2DecimalPoint\");\n \n\tSystem.out.println(\"0.000 -> \"+NumUtil.format2DecimalPoint(0.00));\n\tSystem.out.println(\"-0.0005 -> \"+NumUtil.format2DecimalPoint(-0.0005));\n\tSystem.out.println(\"-0.05 -> \"+NumUtil.format2DecimalPoint(-0.05));\n\tSystem.out.println(\"-0.5 -> \"+NumUtil.format2DecimalPoint(-0.5));\n\tSystem.out.println(\"-1 -> \"+NumUtil.format2DecimalPoint(-1));\n\tSystem.out.println(\"-1.1 -> \"+NumUtil.format2DecimalPoint(-1.1));\n\tSystem.out.println(\"-1.12 -> \"+NumUtil.format2DecimalPoint(-1.12));\n\tSystem.out.println(\"-1.123 -> \"+NumUtil.format2DecimalPoint(-1.123));\n\tSystem.out.println(\"-1.1234 -> \"+NumUtil.format2DecimalPoint(-1.1234));\n\tSystem.out.println(\"-1.12345 -> \"+NumUtil.format2DecimalPoint(-1.12345));\n\tSystem.out.println(\"-1.123456 -> \"+NumUtil.format2DecimalPoint(-1.123456));\n\tSystem.out.println(\"-12.12345699999999999999999999999999999999 -> \"+NumUtil.format2DecimalPoint(-12.12345699999999999999999999999999999999));\n\tSystem.out.println(\"-566762.42 -> \"+format2DecimalPoint(-566762.42));\n\tSystem.out.println(\"-56676242.00 -> \"+format2DecimalPoint(-56676242.00));\n\tSystem.out.println(\"-2342342342.00 -> \"+format2DecimalPoint(-2342342342.00));\n\tSystem.out.println(\"-12345678901234.12345678901234567890 -> \"+format2DecimalPoint(-12345678901234.12345678901234567890));\n\t\n\t\n\t\n\tSystem.out.println(\"8865450.54 -> \"+NumUtil.format2DecimalPoint(8865450.54));\n\t\n\t\n\t\n\tSystem.out.println( ratio( 7, 14 ) );\n\t\n System.out.println( ratio( 10293, 1234 ) );\n\t\n System.out.println( ratio( 50 * 23, 20 * 23 ) );\n }", "private String normalizeDouble(Double value) {\n\n String valueSign = (value < 0) ? \"-\" : \"0\";\n String expSign = \"0\";\n Integer finalExp = 0;\n\n DecimalFormat df = new DecimalFormat(DECIMAL_FORMAT);\n String[] splits = df.format(value).split(\"E\");\n\n // if there's an exponent, complement it\n if(splits.length > 1) {\n\n String exponent = splits[1];\n\n if(exponent.startsWith(\"-\")) {\n\n expSign = \"-\";\n exponent = exponent.replace(\"-\", \"\");\n finalExp = 999 - Integer.parseInt(exponent);\n }\n\n else {\n finalExp = Integer.parseInt(exponent);\n }\n }\n\n return String.format(\"%s%s%03d %s\", valueSign, expSign, finalExp, splits[0]);\n }", "private static String removeZeroDecimal(String s) {\r\n // Make sure to add check for existance of decimal sign to\r\n // prevent StringIndexOutOfBoundsException\r\n if (s.indexOf(\".\") != -1 && s.substring(s.indexOf(\".\"), s.length()).equals(\".0\"))\r\n s = s.replace(\".0\", \"\");\r\n return s;\r\n }", "public static int decimals() {\n return 0;\n }", "public static void convert(double number)\n {\n\nlong bits = Double.doubleToLongBits(number);\n\nlong sign = bits >>> 63;\nlong exponent = ((bits >>> 52) ^ (sign << 11)) - 1023;\nlong fraction = bits << 12; // bits are \"reversed\" but that's not a problem\n\nlong a = 1L;\nlong b = 1L;\n\nfor (int i = 63; i >= 12; i--) {\n a = a * 2 + ((fraction >>> i) & 1);\n b *= 2;\n}\n\nif (exponent > 0)\n a *= 1 << exponent;\nelse\n b *= 1 << -exponent;\n\nif (sign == 1)\n a *= -1;\n\n// Here you have to simplify the fraction\n\nSystem.out.println(\"Resultat : \"+simplifier(a,b));\n }", "private boolean decimals() {\r\n return OPT(GO() && decimal() && decimals());\r\n }", "@Override\n public String toString(Number value) {\n return String.format(\"%.1f\", -value.doubleValue());\n }", "java.math.BigDecimal getFractionalMinimum();", "private double f(double x) {\r\n if(x<0){\r\n double x1 = x*-1;\r\n return interpretador.getResultado(\"!\"+x1);\r\n }\r\n return interpretador.getResultado(x);\r\n }", "protected static String cleanFormat(Double d) {\n\t\tif(d<0) return \"-\"+cleanFormat(d*-1.0);\n\t\tString result = String.format(Locale.US, \"%f\", d).replaceAll(\"([\\\\.])?0+$\",\"\");\n\t\tif(Math.abs(Double.parseDouble(result)-d) < 0.000001) return result;\n\t\tSystem.err.print(\"warning: String.format(\"+d+\")=\\\"\"+result+\"\\\"\");\n\t\tresult=\"\";\n\t\tint dimension = (int)Math.log10(d);\n\t\tif(dimension<0) result=\"0.\";\n\t\twhile(d>(double)Float.MIN_VALUE) {\n\t\t\t// System.err.print(\"cleanFormat(\"+d+\")=\");\n\t\t\tdouble base = Math.pow(10.0, (double)dimension);\n\t\t\tresult=result+(int)(d/base);\n\t\t\tif(d % base>(double)Float.MIN_VALUE) {\n\t\t\t\td=d % base;\n\t\t\t\tif(dimension==0 && d>(double)Float.MIN_VALUE)\n\t\t\t\t\tresult=result+\".\";\n\t\t\t\tdimension--;\n\t\t\t} else d=(double)Float.MIN_VALUE;\n\t\t\t// System.err.println(result);\n\t\t}\n\t\tSystem.err.println(\" => \\\"\"+result+\"\\\"\");\n\t\treturn result;\n\t}", "private double roundToOneDecimal(double num) {\n\t\treturn (int)((10 * num) + 0.5) / 10.0;\n\t}", "public boolean almostZero(double a);", "private String calcMod(double val) {\n double vall = (val - 10) / 2;\n if (vall < 0) {\n val = Math.floor(vall);\n return String.valueOf((int)val);\n }\n else {\n val = Math.ceil(vall);\n return \"+\" + String.valueOf((int)val);\n }\n }", "@Test\n\tpublic void testDFnumber(){\n\t\tdouble d1 = 0.05;\n\t\tdouble d2 = 0.01;\n\t\tSystem.out.println(d1+d2);\n System.out.println(1.0-0.42);\n System.out.println(4.015*100);\n System.out.println(123.3/100);\n\t}", "org.apache.xmlbeans.XmlDecimal xgetFractionalMinimum();", "public static void determineIsPositiveFloat() {\n System.out.println(\"Enter a number:\");\r\n Scanner num = new Scanner(System.in);\r\n float i = Float.parseFloat(num.nextLine());\r\n float absI = Math.abs(i);\r\n if (i == 0)\r\n System.out.println(\"Number is zero\");\r\n else if ((i > 0) && (i < 1))\r\n System.out.println(\"Number is small positive\");\r\n else if ((i >= 1) && (i < 1000000))\r\n System.out.println(\"Number is positive\");\r\n else if (i >= 1000000)\r\n System.out.println(\"Number is large positive\");\r\n else if ((i < 0) && (absI < 1))\r\n System.out.println(\"Number is small negative\");\r\n else if ((absI >= 1) && (absI <= 1000000))\r\n System.out.println(\"Number is negative\");\r\n else\r\n System.out.println(\"Number is large negative\");\r\n }", "public double hasNegSign(double value) {\n if (value < 0) {\n return value * -1;\n } else {\n return value;\n }\n }", "public double abs(double value){return value < 0? value*-1: value;}", "private String formatDec(double number) {\n String returnString = \"\";\n DecimalFormat df = new DecimalFormat(\"#.##\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n returnString = df.format(number);\n int dotPosition = returnString.lastIndexOf(\".\");\n if (dotPosition == -1) {\n returnString += \".00\";\n } else {\n if (returnString.substring(dotPosition, returnString.length() - 1).length() == 1) {\n returnString += \"0\";\n }\n }\n return returnString;\n }", "public int getDecimalDigits() { return 1; }", "public int getDecimalDigits() { return 1; }", "public static String nice( double x )\n {\n double y = Math.abs(x);\n\n // using very naive tolerance (assuming scaling around 1)!\n if( y <= tiny )\n return \"0\";\n\n if( y < 0.00001 )\n return expFormat.format( x );\n else if( y < 1 )\n return formats[0].format( x );\n else if( y < 10 )\n return formats[1].format( x );\n else if( y < 100 )\n return formats[2].format( x );\n else if( y < 1000 )\n return formats[3].format( x );\n else if( y < 10000 )\n return formats[4].format( x );\n else if( y < 100000 )\n return formats[5].format( x );\n else\n return expFormat.format( x );\n }", "@Test\n public void roundOffDecimalPoints() throws IOException {\n BigDecimal actual = Utils.roundOffDecimalPoints(new BigDecimal(1), 2, 2);\n Assert.assertEquals(\"100.00\", actual.toString());\n }", "private double formatDoubleWithTwoDeci(double value) {\r\n \treturn Math.floor(value*1e2)/1e2;\r\n }", "private static DecimalFormat determineLabelFormat(float val) {\n float absval = Math.abs(val);\n\n DecimalFormat rval = null;\n if (absval == 0) {\n rval = new DecimalFormat(\"0.#\");\n } else if (absval < 0.001 || absval > 1e7) {\n rval = new DecimalFormat(\"0.###E0\");\n } else if (absval < 0.01) {\n rval = new DecimalFormat(\"0.###\");\n } else if (absval < 0.1) {\n rval = new DecimalFormat(\"0.##\");\n } else {\n rval = new DecimalFormat(\"0.#\");\n }\n\n return rval;\n }", "private String format(double number) {\r\n boolean farAway = (number != 0.0d && Math.abs(number) < 0.01d) ||\r\n Math.abs(number) > 99.0d;\r\n return (farAway ? secondFormatter : mainFormatter).format(number);\r\n }", "@Test\n public void testZeroPuncturePoint(){\n assertTrue(\n \"Test [x = 0.0]: zero value puncture point\",\n Double.isNaN(systemFunctions.calculate(0))\n );\n }", "@Test\n public void testZeroPuncturePoint(){\n assertTrue(\n \"Test [x = 0.0]: zero value puncture point\",\n Double.isNaN(systemFunctions.calculate(0))\n );\n }", "double roundOff (double value) {\n\t\treturn Math.floor((value + EPSILON) * 100) / 100;\n\t}", "static double convert(double in) {\n return (in * 0.254);\n }", "public static int sign(double x) {\n\t // A true signum could be implemented in C++ as below.\n\t // template <typename T> int sgn(T val) {\n\t // return (T(0) < val) - (val < T(0));\n //}\n if (x >= 0)\n return 1;\n return -1;\n }", "public static float ipart (double x) {\n\t\tFloat a;\r\n\t\tif (x != 0) {\r\n\t\ta = new Float(x/Math.abs(x) * Math.floor(Math.abs(x)));\r\n\t\t}\r\n\t\telse {\r\n\t\t a=new Float(0);\r\n\t\t}\r\n\t\treturn a.floatValue();\r\n\t}", "public static void main(String[] args) {\n int integer = 6;\n String s = Integer.toString(integer);\n System.out.println(s);\n\n //integer to string (abc) -- ascii value\n //Character.toString();\n int a = 3;\n char character = (char) (a + '0' + 48);\n char c = 'c';\n s = Character.toString(character);\n System.out.println(s);\n int b = 13;\n c = (char) (b + 48 + '0');\n s = Character.toString(c);\n System.out.println(s);\n\n //parseInt String to Int...\n String str = \"0\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str= \"00\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str = \"-1\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n String inf = \"asdf\"; //any error produces -1\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str = \"-2\";\n integer = Integer.parseInt(str);\n System.out.println(integer);\n str = \"-002\";\n integer = Integer.parseInt(str);\n System.out.println(integer); //handles all leading zeros... and negatives... edge case is when it is equal to -1 then error....\n //however good news is that my function has all negatives handled like no edge cases.... only 0000 edge case\n\n //- + 0000 123 0.000 */\n //handled all edge cases with integers... only edge cases with float 0.000 consider...\n //parseDouble\n str = \"0\";\n double d = Double.parseDouble(str);\n System.out.println(d);\n str = \"00.9\";\n d = Double.parseDouble(str);\n System.out.println(d);\n str = \"-00.9000\";\n d = Double.parseDouble(str);\n System.out.println(d);\n str = \"-1.987\";\n d = Double.parseDouble(str);\n System.out.println(d);\n str = \"asdf\"; //throws exception\n try {\n d = Double.parseDouble(str);\n } catch (NumberFormatException e) {\n System.out.println(\"error\");\n }\n System.out.println(d); //d remains same/old value;\n\n }", "@Test\n void toDouble ()\n {\n class FractionTestCase {\n FractionPrecise fraction;\n double expectedResult;\n \n public FractionTestCase (FractionPrecise fraction, double expectedResult)\n {\n this.fraction = fraction;\n this.expectedResult = expectedResult;\n }\n }\n \n List<FractionTestCase> testCases = new ArrayList<>();\n \n // Trivial case\n testCases.add(new FractionTestCase(\n new FractionPrecise(1, 1),\n 1.0\n ));\n \n // Numerator is the biggest number\n testCases.add(new FractionTestCase(\n new FractionPrecise(50, 2),\n 25.0\n ));\n \n // Denominator is the biggest number\n testCases.add(new FractionTestCase(\n new FractionPrecise(2, 50),\n 2.0/50\n ));\n \n \n // Very large numbers\n testCases.add(new FractionTestCase(\n new FractionPrecise(new BigInteger(\"1000111222333444555666777888999000111222333444555666777888999\") , new BigInteger(\"1000111222333444555666777888999000111222333444555666777888999\")),\n 1.0\n ));\n \n // Numerator is negative\n testCases.add(new FractionTestCase(\n new FractionPrecise(-20, 10),\n -20.0/10\n ));\n \n // Denominator is negative\n testCases.add(new FractionTestCase(\n new FractionPrecise(20, -10),\n 20.0/-10\n ));\n \n // Both are negative\n testCases.add(new FractionTestCase(\n new FractionPrecise(-20, -10),\n -20.0/-10\n ));\n \n for (FractionTestCase testcase : testCases) {\n // Act\n double actualResult = testcase.fraction.toDouble();\n // Assert\n assertTrue(Math.abs(actualResult - testcase.expectedResult) <= 0.001);\n }\n }", "public boolean get_exponent_sign();", "static String double2String (Double a){\n String s = \"\"+a;\n String[] arr = s.split(\"\\\\.\");\n if (arr[1].length()==1) s+=\"0\";\n return s;\n }", "@Override\n public int getDecimalDigits() { return 0; }", "int main()\n{\n int p;\n float t;\n cin>>p>>t;\n if(t>13.30)\n if( p <= 13)\n cout<<\"$\"<<2<<\".00\";\n \telse\n cout<<\"$\"<<5<<\".00\";\n else\n if( p <= 13)\n cout<<\"$\"<<4<<\".00\";\n else\n cout<<\"$\"<<8<<\".00\";\n \n}", "@Test\n public void testFirstNegativeRegionToExtremePoint(){\n precisionAssertEquals(\n \"Test [x = -0.4]: first negative region\",\n 50.2412,\n systemFunctions.calculate(-0.4)\n );\n precisionAssertEquals(\n \"Test [x = 0.7]: first negative region\",\n 10.964,\n systemFunctions.calculate(-0.7)\n );\n precisionAssertEquals(\n \"Test [x = -1.15]: first negative region\",\n 3.65397,\n systemFunctions.calculate(-1.15)\n );\n }", "@Test\n public void testFirstNegativeRegionToExtremePoint(){\n precisionAssertEquals(\n \"Test [x = -0.4]: first negative region\",\n 50.2412,\n systemFunctions.calculate(-0.4)\n );\n precisionAssertEquals(\n \"Test [x = 0.7]: first negative region\",\n 10.964,\n systemFunctions.calculate(-0.7)\n );\n precisionAssertEquals(\n \"Test [x = -1.15]: first negative region\",\n 3.65397,\n systemFunctions.calculate(-1.15)\n );\n }", "static int find(int decimal_number) \r\n { \r\n if (decimal_number == 0) \r\n return 0; \r\n \r\n else\r\n \r\n return (decimal_number % 2 + 10 * \r\n find(decimal_number / 2)); \r\n }", "public static double not(final double value) {\n return 1 - value;\n }", "public static double getPositiveDouble() {\n double result;\n\n do {\n result = getDouble();\n } while (result <= 0);\n return result;\n }", "public static double atof(String s)\n {\n int i = 0;\n int sign = 1;\n double r = 0; // integer part\n // double f = 0; // fractional part\n double p = 1; // exponent of fractional part\n int state = 0; // 0 = int part, 1 = frac part\n\n while ((i < s.length()) && Character.isWhitespace(s.charAt(i)))\n {\n i++;\n }\n\n if ((i < s.length()) && (s.charAt(i) == '-'))\n {\n sign = -1;\n i++;\n }\n else if ((i < s.length()) && (s.charAt(i) == '+'))\n {\n i++;\n }\n\n while (i < s.length())\n {\n char ch = s.charAt(i);\n\n if (('0' <= ch) && (ch <= '9'))\n {\n if (state == 0)\n {\n r = ((r * 10) + ch) - '0';\n }\n else if (state == 1)\n {\n p = p / 10;\n r = r + (p * (ch - '0'));\n }\n }\n else if (ch == '.')\n {\n if (state == 0)\n {\n state = 1;\n }\n else\n {\n return sign * r;\n }\n }\n else if ((ch == 'e') || (ch == 'E'))\n {\n long e = (int) parseLong(s.substring(i + 1), 10);\n\n return sign * r * Math.pow(10, e);\n }\n else\n {\n return sign * r;\n }\n\n i++;\n }\n\n return sign * r;\n }", "public static boolean isNumberRatio(Object val) throws BaseException\n {\n \tif(val instanceof Number && (NumberUtil.toDouble(val) >= 0 && NumberUtil.toDouble(val) <= 100))\n \t{\n \t return true;\n \t}\n \treturn false;\n }", "@Test(timeout = 4000)\n public void test040() throws Throwable {\n String string0 = JSONObject.doubleToString((-0.80100864F));\n assertEquals(\"-0.8010086417198181\", string0);\n }", "private double limit(double num) {\n if (num > 1.0) {\n return 1.0;\n }\n if (num < 0) {\n return 0;\n }\n return num;\n }", "@Test(timeout = 4000)\n public void test045() throws Throwable {\n Float float0 = new Float(0.0F);\n Float.max(0.0F, 3101.6F);\n JSONObject jSONObject0 = new JSONObject(float0);\n String[] stringArray0 = JSONObject.getNames(jSONObject0);\n assertEquals(3, jSONObject0.length());\n assertEquals(3, stringArray0.length);\n \n String string0 = JSONObject.doubleToString((-2050.33659257));\n assertEquals(\"-2050.33659257\", string0);\n }", "public void allowFractional() {\n APIlib.getInstance().addJSLine(jsBase + \".allowFractional();\");\n }", "private String numberFormatter(double input) {\n // Formatters\n NumberFormat sciFormatter = new DecimalFormat(\"0.#####E0\"); // Scientific notation\n NumberFormat commaFormatter = new DecimalFormat(\"###,###,###,###.###############\"); // Adding comma\n\n // If input is in scientific notation already\n if ((String.valueOf(input)).indexOf(\"E\") > 0) {\n return sciFormatter.format(input); // make the scientific notation neater\n }\n\n // If input is not in scientific notation\n // Number of digits of integer and decimal of input\n String[] splitter = String.format(\"%f\", input).split(\"\\\\.\");\n int intDigits = splitter[0].length(); // Before Decimal Count\n int decDigits;// After Decimal Count\n if (splitter[1].equals(\"000000\")){\n decDigits = 0;\n } else {\n decDigits= splitter[1].length();\n }\n\n if ((intDigits + decDigits) > 9) {\n return sciFormatter.format(input);\n }\n return commaFormatter.format(input);\n }", "protected static double limit(double num) {\r\n\t\tif (num > 1.0) {\r\n\t\t\treturn 1.0;\r\n\t\t}\r\n\t\tif (num < -1.0) {\r\n\t\t\treturn -1.0;\r\n\t\t}\r\n\t\treturn num;\r\n\t}", "@Test\n public void testNineNegativeRegionToPuncturePoint(){\n precisionAssertEquals(\n \"Test [x = -5.8]: nine negative region\",\n 3.89952,\n systemFunctions.calculate(-5.8)\n );\n precisionAssertEquals(\n \"Test [x = -6.0]: nine negative region\",\n -29.835,\n systemFunctions.calculate(-6.0)\n );\n precisionAssertEquals(\n \"Test [x = -6.2]: nine negative region\",\n -2866.63,\n systemFunctions.calculate(-6.2)\n );\n }", "@Test\n public void testNineNegativeRegionToPuncturePoint(){\n precisionAssertEquals(\n \"Test [x = -5.8]: nine negative region\",\n 3.89952,\n systemFunctions.calculate(-5.8)\n );\n precisionAssertEquals(\n \"Test [x = -6.0]: nine negative region\",\n -29.835,\n systemFunctions.calculate(-6.0)\n );\n precisionAssertEquals(\n \"Test [x = -6.2]: nine negative region\",\n -2866.63,\n systemFunctions.calculate(-6.2)\n );\n }", "public static Object parseFloat(Context cx, Scriptable thisObj,\n Object[] args, Function funObj)\n {\n if (args.length < 1)\n return ScriptRuntime.NaNobj;\n String s = ScriptRuntime.toString(args[0]);\n int len = s.length();\n if (len == 0)\n return ScriptRuntime.NaNobj;\n \n int i;\n char c;\n // Scan forward to the first digit or .\n for (i=0; TokenStream.isJSSpace(c = s.charAt(i)) && i+1 < len; i++)\n /* empty */\n ;\n \n int start = i;\n \n if (c == '+' || c == '-')\n c = s.charAt(++i);\n \n if (c == 'I') {\n // check for \"Infinity\"\n double d;\n if (i+8 <= len && s.substring(i, i+8).equals(\"Infinity\"))\n d = s.charAt(start) == '-' ? Double.NEGATIVE_INFINITY\n : Double.POSITIVE_INFINITY;\n else\n return ScriptRuntime.NaNobj;\n return new Double(d);\n }\n \n // Find the end of the legal bit\n int decimal = -1;\n int exponent = -1;\n for (; i < len; i++) {\n switch (s.charAt(i)) {\n case '.':\n if (decimal != -1) // Only allow a single decimal point.\n break;\n decimal = i;\n continue;\n \n case 'e':\n case 'E':\n if (exponent != -1)\n break;\n exponent = i;\n continue;\n \n case '+':\n case '-':\n // Only allow '+' or '-' after 'e' or 'E'\n if (exponent != i-1)\n break;\n continue;\n \n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n continue;\n \n default:\n break;\n }\n break;\n }\n s = s.substring(start, i);\n try {\n return Double.valueOf(s);\n }\n catch (NumberFormatException ex) {\n return ScriptRuntime.NaNobj;\n }\n }", "public static void main(String args[])\n {\n Scanner sc=new Scanner(System.in);\n String s=sc.next();\n double n=0;\n int dcount=0;\n int pointer=0;\n for(int i=0;i<s.length();i++)\n {\n if(s.charAt(i)!='.')\n {\n n=n*10+(s.charAt(i)-'0');\n if(pointer==1)\n dcount++;\n }\n else\n pointer=1;\n }\n n=n/Math.pow(10,dcount);\n System.out.printf(\"%.6f\",n);\n }", "public static double parseFloat(final Object self, final Object string) {\n final String str = JSType.trimLeft(JSType.toString(string));\n final int length = str.length();\n\n // empty string is not valid\n if (length == 0) {\n return Double.NaN;\n }\n\n int start = 0;\n boolean negative = false;\n char ch = str.charAt(0);\n\n if (ch == '-') {\n start++;\n negative = true;\n } else if (ch == '+') {\n start++;\n } else if (ch == 'N') {\n if (str.startsWith(\"NaN\")) {\n return Double.NaN;\n }\n }\n\n if (start == length) {\n // just the sign character\n return Double.NaN;\n }\n\n ch = str.charAt(start);\n if (ch == 'I') {\n if (str.substring(start).startsWith(\"Infinity\")) {\n return negative? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;\n }\n }\n\n boolean dotSeen = false;\n boolean exponentOk = false;\n int exponentOffset = -1;\n int end;\n\nloop:\n for (end = start; end < length; end++) {\n ch = str.charAt(end);\n\n switch (ch) {\n case '.':\n // dot allowed only once\n if (exponentOffset != -1 || dotSeen) {\n break loop;\n }\n dotSeen = true;\n break;\n\n case 'e':\n case 'E':\n // 'e'/'E' allow only once\n if (exponentOffset != -1) {\n break loop;\n }\n exponentOffset = end;\n break;\n\n case '+':\n case '-':\n // Sign of the exponent. But allowed only if the\n // previous char in the string was 'e' or 'E'.\n if (exponentOffset != end - 1) {\n break loop;\n }\n break;\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n if (exponentOffset != -1) {\n // seeing digit after 'e' or 'E'\n exponentOk = true;\n }\n break;\n\n default: // ignore garbage at the end\n break loop;\n }\n }\n\n // ignore 'e'/'E' followed by '+/-' if not real exponent found\n if (exponentOffset != -1 && !exponentOk) {\n end = exponentOffset;\n }\n\n if (start == end) {\n return Double.NaN;\n }\n\n try {\n final double result = Double.valueOf(str.substring(start, end));\n return negative ? -result : result;\n } catch (final NumberFormatException e) {\n return Double.NaN;\n }\n }", "public static double integ(double d)\n {\n if (d >= 0.0) \n return Math.floor(d);\n else \n return Math.ceil(d);\n }", "public static void getPositiveAndNegativeInput() {\n Double num = getDoubleInput(\"enter the number you would like to change\");\n println(String.valueOf(positiveAndNegative(num)));\n }", "@Test\n public void testFloatInRange() {\n int lowEnd = -10;\n int highEnd = 10;\n Optional<NumberValue> optRslt = floatService.floatInRange(lowEnd, highEnd);\n assertTrue(optRslt.isPresent());\n NumberValue numberValue = optRslt.get();\n assertTrue(lowEnd * 1.0 <= numberValue.getNumber().doubleValue());\n assertTrue(highEnd * 1.0 >= numberValue.getNumber().doubleValue());\n System.out.println(\"Number Value = \" + numberValue.toString());\n }", "@Test\n\tpublic void caseCostWithWrongInput() {\n\t\tFloat cost = 0f;\n\t\ttry {\n\t\t\tStringNumberUtil.positiveNumberUtil(cost);\n\t\t\tfail();\n\t\t} catch (NumberException e) {\n\t\t}\n\t}", "private boolean isDecimalEqualToZero(String doubleValue) {\n\t\tif (doubleValue.contains(\"%\")) {\n\t\t\treturn false;\n\t\t}\n\t\tString[] n = doubleValue.split(\"\\\\.\");\n\t\tif(n.length > 1) {\n\t\t\t// get the value to right of decimal point\n\t\t\tint d = Integer.parseInt(n[1]);\n\t\t\treturn d == 0;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "public float make_accurate(float a){//fixes floats\r\n\t\tint b = (int) (a * 1000000);\r\n\t\t\r\n\t\treturn (float)(b)/1000000f;\r\n\t\t\r\n\t}", "private int round(double d){\n double dAbs = Math.abs(d);\n int i = (int) dAbs;\n double result = dAbs - (double) i;\n if(result<0.5){\n return d<0 ? -i : i;\n }else{\n return d<0 ? -(i+1) : i+1;\n }\n }", "static double negate(double num) {\n\t\t\n\t\treturn num*(-1);\n\t\n\t}", "public static void main(String[] args){\n Double a = -1d;\n String as = a.toString();\n String result = \"\";\n if (as.replace(\"-\", \"\").length()>=14){\n result = as.substring(0,14);\n }else {\n while (as.replace(\"-\", \"\").length()<14){\n as+='0';\n }\n result= as;\n }\n System.out.print(result);\n }", "public static int decimalToAnyBase(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % b;\n n = n / b;\n val += p * d;\n p = p * 10;\n }\n\n return val;\n}", "public static float abs(float input){\n\t\tif(input < 0){\n\t\t\treturn -1 * input;\n\t\t}\n\t\treturn input;\n\t}", "public static double absValue(double number) {\n\t\tif(number >= 0) {\r\n\t\t\treturn(number);\r\n\t\t} else {\r\n\t\t\treturn(number / -1);\r\n\t\t}\r\n\t\t\r\n\t}", "public static double softsign(double x) {\n if (Double.isNaN(x)) return Double.NaN;\n double result = x / (1 + Math.abs(x));\n if (Double.isNaN(result))\n return (x < 0) ? -1.0 : 1.0;\n return result;\n }", "private int condense(int[] inputs) {\n\t\tint total = 0;\n\t\tflag = false;\n\t\tfor(int i = 0; i < inputs.length; i++) {\n\t\t\tinputs[i] -= 48;\n\t\t\tif(inputs[i] < 0 || inputs[i] > 9) {\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttotal *= 10;\n\t\t\ttotal += inputs[i];\n\t\t}\n\t\treturn total;\n\t}", "public static boolean isFloatNoExponent(String str)\n {\n int len = str.length();\n if (len == 0)\n {\n return false;\n }\n\n // skip first char if sign char\n char c = str.charAt(0);\n int i = ((c == '-') || (c == '+')) ? 1 : 0;\n\n // is it only a sign?\n if (i >= len)\n {\n return false;\n }\n\n boolean decimalPointFound = false;\n\n do\n {\n c = str.charAt(i);\n if (c == '.')\n {\n // is this a second dot?\n if (decimalPointFound)\n {\n return false;\n }\n\n decimalPointFound = true;\n }\n else if (!Character.isDigit(c))\n {\n return false;\n }\n\n i++;\n }\n while (i < len);\n\n return true;\n }", "public String format(double number);", "float mo106363e();", "@Test\n public void testSecondNegativeRegionToPuncturePoint(){\n precisionAssertEquals(\n \"Test [x = -1.3]: second negative region\",\n 3.97437,\n systemFunctions.calculate(-1.3)\n );\n precisionAssertEquals(\n \"Test [x = -1.4]: second negative region\",\n 5.61428,\n systemFunctions.calculate(-1.4)\n );\n precisionAssertEquals(\n \"Test [x = -1.5]: second negative region\",\n 13.4263,\n systemFunctions.calculate(-1.5)\n );\n }", "@Test\n public void testSecondNegativeRegionToPuncturePoint(){\n precisionAssertEquals(\n \"Test [x = -1.3]: second negative region\",\n 3.97437,\n systemFunctions.calculate(-1.3)\n );\n precisionAssertEquals(\n \"Test [x = -1.4]: second negative region\",\n 5.61428,\n systemFunctions.calculate(-1.4)\n );\n precisionAssertEquals(\n \"Test [x = -1.5]: second negative region\",\n 13.4263,\n systemFunctions.calculate(-1.5)\n );\n }", "private double fd(double x) {\r\n if(x<0){\r\n double x1 = x*-1;\r\n return interpretadorD.getResultado(\"!\"+x1);\r\n }\r\n return interpretadorD.getResultado(x);\r\n }", "private CDecimal getBestMultiplier(CDecimal x) {\n\t\tif ( x.compareTo(CDecimalBD.ZERO) <= 0 ) {\r\n\t\t\tthrow new IllegalArgumentException(\"Argument must be greater than zero but: \" + x);\r\n\t\t}\r\n\t\tBigDecimal f = x.toBigDecimal().remainder(BigDecimal.ONE);\r\n\t\tBigDecimal i = x.toBigDecimal().subtract(f);\r\n\t\tif ( i.compareTo(BigDecimal.ZERO) > 0 ) {\r\n\t\t\tString ps = i.toPlainString();\r\n\t\t\tint pp = ps.indexOf('.');\r\n\t\t\tif ( pp < 0 ) {\r\n\t\t\t\tpp = ps.length();\r\n\t\t\t}\r\n\t\t\tBigDecimal r = BigDecimal.TEN.pow(pp - 1);\r\n\t\t\treturn new CDecimalBD(r);\r\n\t\t} else {\r\n\t\t\tString ps = f.toPlainString();\r\n\t\t\tint pp = StringUtils.indexOfAny(ps, \"123456789\");\r\n\t\t\tif ( pp < 0 ) {\r\n\t\t\t\tthrow new IllegalStateException(\"Unable to find non-zero digits in fractional part: \" + f);\r\n\t\t\t}\r\n\t\t\tBigDecimal r = BigDecimal.ONE.divide(BigDecimal.TEN.pow(pp - 1));\r\n\t\t\treturn new CDecimalBD(r);\r\n\t\t}\r\n\t}", "public double cliphelper(double n) {\n return (n > 1) ? 1 : (n < -1) ? -1 : n;\n }", "public static double frac(double d)\n {\n return frac( new BigDecimal(\"\" + d) ).doubleValue();\n }", "public static double floor(double a) {\t\n\t\treturn ((a<0)?(int)(a-1):(int)a);\t\n\t}", "java.math.BigDecimal getSingleBetMinimum();", "public static int part1(double num)\r\n {\r\n \r\n //Math.floor extract the integer part, then substract it from the original one \r\n int firstNum=(int)Math.floor(num);\r\n double secondNum=num-firstNum;\r\n return firstNum;\r\n \r\n }", "void milestone2(double num){\n System.out.println(\"Integer part: \" + (int)num);\n double fractionPart = num - (int)num;\n fractionPart *= 100;\n System.out.println(\"Fractional part: \" + (int)fractionPart);\n }", "public static void displayFractionalUndIngeralFromDoubleNumber(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tdouble fractional_part=x%1;\n\t\tdouble integral_part=x-fractional_part;\n\t\tSystem.out.println(\"The integral part of (\" +x +\" ) is: \" +integral_part);\n\t\tSystem.out.println(\"The fractional part of ( \" +x +\" ) is: \" +fractional_part);\n\t}", "@Test\n public void testLog() throws IOException {\n System.out.println(Double.parseDouble(\"3.123124354657668698\"));\n }", "public static String toMixedNum(int numerator, int denominator) {\n \tint whole=numerator/denominator;\t\t//make variable to store whole number by dividing num and denom\r\n\t\tint newnumerator=numerator%denominator;\t//get newnum by doing num mod denom\r\n\t\t\r\n\t\tif(whole<0) {\t\t\t//if whole number is negative and the new num is neg as well,\r\n\t\t\tnewnumerator *= -1;\t// make the new num positive\r\n\t\t}\r\n\t\tif(newnumerator==0 && whole==0) {\t//if the frac is 0 all-around\r\n\t\t\treturn \"0\";\t\t\t\t\t\t//return 0\r\n\t\t}\r\n\t\tif(newnumerator==0) {\t//if the num is 0 it's most likely\r\n\t\t\treturn whole + \"\";\t//just a whole number\r\n\t\t}\r\n\t\tif(newnumerator<0 && denominator<0) {\t//if the num and denom is both neg\r\n\t\t\tnewnumerator *= -1;\t\t\t\t\t//then the frac itself should be negative\r\n\t\t\tdenominator *= -1;\r\n\t\t}\r\n\t\tif(denominator<0) {\t\t\t\t//if denom is negative \r\n\t\t\tnewnumerator *= -1;\t\t\t//multiply both num and denom by -1 to get a postitive denom and neg num\r\n\t\t\tdenominator *= -1;\r\n\t\t}\r\n\t\tif(whole==0) {\t\t\t//if the whole num is 0\r\n\t\t\treturn simplify(newnumerator, denominator);\t//then it should just return num/denom\r\n\t\t}\r\n\t\treturn whole + \"_\"+ simplify(newnumerator, denominator); //return statement of the whole mixed frac\r\n }", "static public String nf(float num, int lead, int decimal) {\n\t\tif (formatFloat==null) nfInitFormats();\n\t\tformatFloat.setMinimumIntegerDigits(lead);\n\t\tformatFloat.setMaximumFractionDigits(decimal);\n\t\tformatFloat.setMinimumFractionDigits(decimal);\n\n\t\treturn formatFloat.format(num).replace(\",\", \".\");\n\t}", "@Test\n public void testIsNotValidDecimal() {\n FieldVerifier service = new FieldVerifier();\n boolean result = service.isValidDecimal(-1);\n assertEquals(false, result);\n }", "double getFloatingPointField();", "public double truncDecimals(double nonTruncated){\n double truncated;\n double a;\n int i;\n a = nonTruncated * 100;\n i = (int)a;\n\n truncated = i;\n truncated = (double)truncated / 100;\n return truncated;\n }", "include<stdio.h>\nint main()\n{\n float d;\n \n scanf(\"%f\", &d);\n float r = d/2;\n float a;\n a = 3.14 * r * r;\n printf(\"%.2f\", a);\n return 0;\n}", "public static double round(double number) {\r\n //MiscStuff.writeToLog(number);\r\n Double d = new Double(number);\r\n String str = d.toString();\r\n str.trim();\r\n \r\n if(str.indexOf('.') + 3 < str.length()) {\r\n if(!str.equals(\"NaN\") && !str.equals(\"Infinity\") \r\n && !str.equals(\"-Infinity\")) {\r\n \r\n \r\n int i = str.indexOf('.');\r\n String str1 = str.substring(0, i + 3);\r\n d = new Double(str1);\r\n \r\n //MiscStuff.writeToLog(\" \" + str + \" \" + d);\r\n \r\n if(!str.substring(i+3).equals(\"\") ) {\r\n int rounder = new Integer(str.substring(i+3, i+4));\r\n \r\n if(5 <= rounder) {\r\n Double d2 = (10 - rounder) * .001;// d + new Float(.01);\r\n d = number + d2;\r\n //MiscStuff.writeToLog(\"Rounder \" + rounder + \" \" + d2);\r\n \r\n String str2 = d.toString();\r\n str2.trim();\r\n \r\n if(str2.indexOf('.') + 3 < str2.length()) \r\n d = Math2.round(d); //don't get stuck....\r\n }\r\n }\r\n \r\n number = d; \r\n }\r\n \r\n else {\r\n //MiscStuff.writeToLog(number); \r\n }\r\n }\r\n \r\n return number;\r\n }", "private static String canonicalDecimalStr_X(BigDecimal d) {\n String x = d.toPlainString() ;\n\n // The part after the \".\"\n int dotIdx = x.indexOf('.') ;\n if ( dotIdx < 0 )\n // No DOT.\n return x+\".0\";\n\n // Has a DOT.\n int i = x.length() - 1 ;\n // dotIdx+1 to leave at least \".0\"\n while ((i > dotIdx + 1) && x.charAt(i) == '0')\n i-- ;\n if ( i < x.length() - 1 )\n // And trailing zeros.\n x = x.substring(0, i + 1) ;\n // Avoid replaceAll as it is expensive.\n // Leading zeros.\n int j = 0;\n for ( ; j < x.length() ; j++ ) {\n if ( x.charAt(j) != '0')\n break;\n }\n // At least one zero before dot.\n if ( j == dotIdx )\n j--;\n if ( j > 0 )\n x = x.substring(j, x.length());\n return x;\n }", "boolean getFractional();", "private static BigInteger divideAndRound(BigInteger a, BigInteger b) {\r\n BigInteger result = a.divide(b);\r\n //Case 1: Integer part of the quotient is positive, a%b*2>=b, then the float part of the quotient>=.5, therefore add 1 to quotient\r\n if(result.signum()>0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)>=0)\r\n result = result.add(BigInteger.ONE);\r\n //Case 2: Integer part of the quotient is negative, a%b*2<=b but a%b<>0 , \r\n //then the float part of the quotient<=-0.5, therefore subtract 1 from quotient\r\n else if(result.signum()<0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)<=0 && !a.mod(b).equals(BigInteger.ZERO))\r\n result = result.subtract(BigInteger.ONE);\r\n //Case 3: Integer part of the quotient is zero then two cases arise: a>0 or a<0\r\n else if(result.signum()==0)\r\n { \r\n //Case 1.1: a>0.5 then result=1\r\n if(a.compareTo(BigInteger.ZERO)>0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)>=0)\r\n result = BigInteger.ONE;\r\n //Case 1.1: a<-0.5 then result=-1\r\n else if(a.compareTo(BigInteger.ZERO)<0 && a.mod(b).multiply(new BigInteger(\"2\")).compareTo(b)<=0)\r\n result = BigInteger.ZERO.subtract(BigInteger.ONE); //-1 :)\r\n }\r\n return result;\r\n }", "private double convert(double d){\n\t\tDecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();\n\t\tsymbols.setDecimalSeparator('.');\n\t\tDecimalFormat df = new DecimalFormat(\"#.##\",symbols); \n\t\treturn Double.valueOf(df.format(d));\n\t}", "private String getDecimalPattern(String str) {\n int decimalCount = str.length() - str.indexOf(\".\") - 1;\n StringBuilder decimalPattern = new StringBuilder();\n for (int i = 0; i < decimalCount && i < MAX_DECIMAL; i++) {\n decimalPattern.append(\"0\");\n }\n return decimalPattern.toString();\n }", "String getFloat_lit();", "private double signum(double d) {\n if (d > 0) {\n return 1.0;\n }\n else if (d < 0) {\n return -1.0;\n }\n else {\n return 0.0;\n }\n }", "@Test\n public void test19() throws Throwable {\n Complex complex0 = new Complex((-138.659), 0.0);\n Complex complex1 = complex0.exp();\n String string0 = complex0.toString();\n Complex complex2 = complex1.subtract(complex0);\n Complex complex3 = complex0.multiply(complex1);\n Complex complex4 = complex0.cos();\n double double0 = complex4.getImaginary();\n }", "private double readPositive(JTextField field, double oldValue, String title) {\n boolean isOK = true;\n double newValue = 1;\n try{\n //test input\n newValue = Double.parseDouble(field.getText());\n }\n catch (NumberFormatException e){\n //Error message\n JOptionPane.showMessageDialog(null,\n NOT_A_NUMBER,\n title,\n JOptionPane.ERROR_MESSAGE);\n isOK = false;\n }\n if (newValue <=0){\n //ERROR message\n JOptionPane.showMessageDialog(null,\n NOT_POSITIVE,\n title,\n JOptionPane.ERROR_MESSAGE);\n isOK = false;\n }\n if (isOK)\n return newValue;\n\n else {\n field.setText(numberFormatter.format(oldValue));\n return oldValue;\n }\n }" ]
[ "0.64957696", "0.6137498", "0.6043085", "0.6011973", "0.59220195", "0.5879067", "0.5875702", "0.58572125", "0.5852673", "0.58503664", "0.58236146", "0.58050126", "0.57940704", "0.57748014", "0.5769493", "0.5744782", "0.57385045", "0.5689715", "0.56781", "0.5668533", "0.5668533", "0.5601683", "0.55976474", "0.55906004", "0.55602944", "0.5558502", "0.5531203", "0.5531203", "0.552991", "0.5507995", "0.55070776", "0.5492841", "0.5470604", "0.54273933", "0.54237986", "0.54193693", "0.5415148", "0.541338", "0.5398908", "0.5398908", "0.5385399", "0.53805184", "0.5374471", "0.5371981", "0.53637123", "0.53470457", "0.5346824", "0.5345124", "0.53419614", "0.53377557", "0.53295624", "0.5327817", "0.5327817", "0.5324168", "0.53204674", "0.53195626", "0.53068084", "0.53061646", "0.5299523", "0.52950907", "0.52946997", "0.52905065", "0.52854407", "0.5277142", "0.52764803", "0.5269635", "0.52691525", "0.5257814", "0.524953", "0.5243507", "0.52428013", "0.5240328", "0.5238805", "0.5236783", "0.5236783", "0.5230313", "0.52247655", "0.522312", "0.52190715", "0.52129817", "0.5211038", "0.5194309", "0.5190212", "0.5183725", "0.51826495", "0.51817644", "0.5178429", "0.5175381", "0.51724374", "0.5170303", "0.5162677", "0.51602876", "0.51502913", "0.51427734", "0.5141781", "0.5138905", "0.51381254", "0.5137719", "0.51350206", "0.51297927", "0.51236904" ]
0.0
-1
TODO: save step state in the descripor
public void onButtonTouched(int index, View anchor ){ WorkflowStepDescriptor descr = descriptors.get(index); descr.status_completed = true; FutureVisitActivity.this.showMessageDialog(index, anchor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getStepDescription()\r\n\t{\r\n\t\treturn stepDescription;\r\n\t}", "public java.lang.String getStepDescription() {\n return stepDescription;\n }", "public void setStepDescription(String stepDescription)\r\n\t{\r\n\t\tthis.stepDescription = stepDescription;\r\n\t}", "@Override\n public String toString() {\n return String.format(Locale.getDefault(),\n \"Step{id=%d, shortDescription='%s'}\", id, shortDescription);\n }", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Override\n\tpublic void step() {\n\t}", "@Override\n\tpublic void step() {\n\t}", "public String nextStep();", "private static void printStep(String stepDescription) {\n char[] separatorLine = new char[stepDescription.length()];\n Arrays.fill(separatorLine, '-');\n System.out.println();\n System.out.println(separatorLine);\n System.out.println(stepDescription);\n System.out.println(separatorLine);\n }", "void Step(String step);", "java.lang.String getNextStep();", "public void onStepStarted(int index, int total, String name);", "public void setStepDescription(java.lang.String stepDescription) {\n this.stepDescription = stepDescription;\n }", "@Override\r\n\tpublic void step(SimState state) {\r\n\r\n\t}", "public void step();", "public void step();", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "public void setStep(int step)\n {\n this.step = step;\n this.stepSpecified = true;\n }", "public InfoLiveTollsStepDefinition() {\n\t\tsuper();\n\t}", "private static String getDescription(Step step) {\n if (step instanceof FlowCall) {\n return \"Flow call: \" + ((FlowCall) step).getFlowName();\n } else if (step instanceof Expression) {\n return \"Expression: \" + ((Expression) step).getExpr();\n } else if (step instanceof ScriptCall) {\n return \"Script: \" + ((ScriptCall) step).getLanguageOrRef();\n } else if (step instanceof IfStep) {\n return \"Check: \" + ((IfStep) step).getExpression();\n } else if (step instanceof SwitchStep) {\n return \"Switch: \" + ((SwitchStep) step).getExpression();\n } else if (step instanceof SetVariablesStep) {\n return \"Set variables\";\n } else if (step instanceof Checkpoint) {\n return \"Checkpoint: \" + ((Checkpoint) step).getName();\n } else if (step instanceof FormCall) {\n return \"Form call: \" + ((FormCall) step).getName();\n } else if (step instanceof GroupOfSteps) {\n return \"Group of steps\";\n } else if (step instanceof ParallelBlock) {\n return \"Parallel block\";\n } else if (step instanceof ExitStep) {\n return \"Exit\";\n } else if (step instanceof ReturnStep) {\n return \"Return\";\n }\n\n return step.getClass().getName();\n }", "public String getStepDisplayName()\r\n\t{\r\n\t\treturn stepDisplayName;\r\n\t}", "int getStep();", "int getStep();", "int getStep();", "@Override\r\n\tpublic int getSteps() {\n\t\treturn 0;\r\n\t}", "public ProofStep [ ] getSteps ( ) ;", "void setDescription(State state);", "@Override\n\tpublic void step2() {\n\t\t\n\t}", "@Override\n\tpublic String getDescription() {\n\t\treturn \"Advance the turn after you've done everything you need to do - this action will fail if something else needs to be done to finish the turn.\";\n\t}", "public void recordStep(final TestStep step) {\n Preconditions.checkNotNull(step.getDescription(),\n \"The test step description was not defined.\");\n Preconditions.checkNotNull(step.getResult(), \"The test step result was not defined\");\n\n testSteps.add(step);\n }", "@Override\n public String getShortName() {\n return step.getShortName();\n }", "@Then(\"troubleshooting chart steps are displaying\")\n public void troubleshooting_chart_steps_are_displaying() {\n }", "public void setStep(int step) {\n this.step = step;\n }", "public String getStepName()\r\n\t{\r\n\t\treturn stepName;\r\n\t}", "public int step() {\n // PUT YOUR CODE HERE\n }", "public static void info(String stepName, String description) \n\t{\n\t\ttry{\n\t\t\ttest.log(LogStatus.INFO, stepName, description);\n\t\t\t\n\t\t}catch(Exception e){fnPrintException(e);}\t\n\t}", "public void step()\n {\n status = stepInternal();\n }", "public void anexaDescricao(Object descricao) {\n Log.info((String) descricao);\n ReportListener.setSteps((String) descricao);\n }", "@Override\r\n\tpublic void stepHasBeenTaken(int steps) {\n\t\tTextView currLoc = (TextView) findViewById(R.id.stepsCount);\r\n\t\tcurrLoc.setText(\"\"+steps);\r\n\t}", "@Given(\"prepare to Analysis\")\npublic void preanalysis(){\n}", "public String toString()\r\n\t{\r\n\t\treturn ToStringHelper.toString(this, new String [] { \"stepName\" });\r\n\t}", "@Override\n\tpublic String summarize(Context context) {\n\t\treturn \"FINISHED\";\n\t\t\n//\t\treturn String.format(\"Normal:\\n%s\\n\" +\n//\t\t\t\t\"========================================\\n\" +\n//\t\t\t\t\"Modified:\\n%s\", machine1.formatedResume(), machine2.formatedResume());\n\t}", "protected int getStep() {\n\t\treturn step;\n\t}", "protected void runAfterStep() {}", "public Step() {\n\n }", "public int getStep() {\n return step;\n }", "public void setStep(int step) {\n\t\tthis.step = step;\n\t}", "public void setStepName(String stepName)\r\n\t{\r\n\t\tthis.stepName = stepName;\r\n\t}", "public void setStepDisplayName(String stepDisplayName)\r\n\t{\r\n\t\tthis.stepDisplayName = stepDisplayName;\r\n\t}", "boolean hasStep();", "boolean hasStep();", "boolean hasStep();", "public abstract void performStep();", "public static void pass(String stepName, String description) \n\t{\n\t\ttry{\n\t\t\ttest.log(LogStatus.PASS, stepName, description);\n\t\t}catch(Exception e){fnPrintException(e);}\t\t\t\n\t}", "public void setStep(Integer step) {\n this.step = step;\n }", "@Override\n public void scenario(gherkin.formatter.model.Scenario scenario) {\n }", "public int getStep()\n\t{\n\t\treturn step;\n\t}", "@AfterMethod\n\tpublic void getResult(ITestResult result) throws IOException {\n\t\tString cellContent = this.getClass().getSimpleName();\n\t\tSystem.out.println(cellContent);\n\t\t// Searches for the Class name in Excel and return step name\n\t\tString StepName = ts.GetStepName(fileName, cellContent, i, 7);\n\t\t// Searches for the Class name in Excel and returns description of step\n\t\tString StepDescrip = ts.GetStepName(fileName, cellContent, i, 8);\n\t\t// Here we merge the step and description to be put in word\n\t\tString merged = StepName + \": \" + StepDescrip;\n\t\tSystem.out.println(merged);\n\t\ti++;\n\n\t\tSystem.out.println(\"In After method\");\n\t\tSystem.out.println(result.getMethod().getConstructorOrMethod().getMethod().getName());\n\n\t\t// First get the Step Name and Description name in here\n\n\t\t// System.out.println(this.getClass().getSimpleName());\n\t\t// test=\n\t\t// extent.createTest(result.getMethod().getConstructorOrMethod().getMethod().getName());\n\t\tif (result.getStatus() == ITestResult.FAILURE) {\n\t\t\tSystem.out.println(\"Test failed entering in Report\");\n\t\t\ttest.log(Status.FAIL, MarkupHelper.createLabel(result.getName() + StepDescrip + \" Test case FAILED due to below issues:\",\n\t\t\t\t\tExtentColor.RED));\n\t\t\tString issueDescription = result.getThrowable().getMessage();\n\t\t\tissueDescription.concat(ExceptionUtils.getFullStackTrace(result.getThrowable()));\n\t\t\ttest.fail(issueDescription);\n\t\t} else if (result.getStatus() == ITestResult.SUCCESS) {\n\t\t\tSystem.out.println(\"Test passed entering in report\");\n\t\t\ttest.log(Status.PASS, MarkupHelper.createLabel(result.getName() + StepDescrip + \" Test Case PASSED\", ExtentColor.GREEN));\n\t\t} else {\n\t\t\ttest.log(Status.SKIP,\n\t\t\t\t\tMarkupHelper.createLabel(result.getName() + StepDescrip + \" Test Case SKIPPED\", ExtentColor.ORANGE));\n\t\t\ttest.skip(result.getThrowable());\n\t\t}\n\t\tSystem.out.println(\"At end of after method\");\n\t}", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "@Test\n public void testGetInfo_1()\n throws Exception {\n LogicStep fixture = new LogicStep();\n fixture.setScript(\"\");\n fixture.setName(\"\");\n fixture.setOnFail(\"\");\n fixture.setScriptGroupName(\"\");\n fixture.stepIndex = 1;\n\n String result = fixture.getInfo();\n\n assertEquals(\"Logic Step: \", result);\n }", "public int getStep () {\n\t\treturn step_;\n\t}", "abstract int steps();", "@Override public List<ExecutionStep> getSteps() {\n return Collections.singletonList(step);\n }", "@Override\n public void onStepClick(int index) {\n }", "public T caseStepDesc(StepDesc object) {\n\t\treturn null;\n\t}", "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}", "public int getStep() {\n\t\treturn step;\n\t}", "protected void runBeforeStep() {}", "boolean nextStep();", "@Test\n void step() {\n Fb2ConverterStateMachine state = new Fb2ConverterStateMachine();\n StringBuilder sb = new StringBuilder();\n WordsTokenizer wt = new WordsTokenizer(getOriginalText());\n while (wt.hasMoreTokens()) {\n String word = wt.nextToken();\n if (state.step(word)) {\n sb.append(word).append(\" \");\n }\n }\n assertEquals(\"test 1 . text- 2 text 0 text 6111 222 \", sb.toString());\n }", "@Override\n\tpublic void terminalStep(StateView arg0, HistoryView arg1) {\n\n\t}", "@Override\n public void onClick(Step selectedStepItem) {\n parent.setSelectedStepNumber(selectedStepItem.getId());\n Timber.d(selectedStepItem.getDescription());\n }", "public java.lang.String getStepName() {\n return stepName;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public void setSteps(int steps) {\n\t\tthis.steps = steps;\n\t}", "public static void beginStep() {\n\t\tTestNotify.log(STEP_SEPARATOR);\n\t TestNotify.log(GenLogTC() + \"is being tested ...\");\n\t}", "private void saveInput(BBSStep aStep) {\n BBSStepData aStepData = BBSStepDataManager.getInstance().getStepData(aStep.getName());\n BBSStepData inheritedData = BBSStepDataManager.getInstance().getInheritedStepData(aStep);\n \n //normal sources\n ArrayList<String> sources = createList(stepExplorerNSourcesList);\n if(this.useAllSourcesCheckbox.isSelected()){\n sources = new ArrayList<>();\n }\n if(sources.equals(inheritedData.getSources())){\n aStepData.setSources(null);\n }else{\n if(this.useAllSourcesCheckbox.isSelected()){\n aStepData.setSources(new ArrayList<String>());\n }else{\n if(sources.size()>0){\n aStepData.setSources(new ArrayList<String>());\n }else{\n aStepData.setSources(null);\n }\n \n }\n }\n if(aStepData.getSources()!=null){\n if(!sources.equals(aStepData.getSources())){\n aStepData.setSources(sources);\n }\n }\n \n //instrument model \n \n ArrayList<String> imodels = createList(stepExplorerInstrumentModelList);\n if(this.noInstrumentModelCheckbox.isSelected()){\n imodels = new ArrayList<>();\n }\n if(imodels.equals(inheritedData.getInstrumentModel())){\n aStepData.setInstrumentModel(null);\n }else{\n if(this.noInstrumentModelCheckbox.isSelected()){\n aStepData.setInstrumentModel(new ArrayList<String>());\n }else{\n if(imodels.size()>0){\n aStepData.setInstrumentModel(new ArrayList<String>());\n }else{\n aStepData.setInstrumentModel(null);\n }\n \n }\n }\n if(aStepData.getInstrumentModel()!=null){\n if(!imodels.equals(aStepData.getInstrumentModel())){\n aStepData.setInstrumentModel(imodels);\n }\n }\n \n/* //instrument model \n \n ArrayList<String> imodels = createArrayListFromSelectionList(stepExplorerInstrumentModelList);\n if(this.noInstrumentModelCheckbox.isSelected()){\n imodels = new ArrayList<String>();\n }\n if(imodels.equals(inheritedData.getInstrumentModel())){\n aStepData.setInstrumentModel(null);\n }else{\n if(this.noInstrumentModelCheckbox.isSelected()){\n aStepData.setInstrumentModel(new ArrayList<String>());\n }else{\n if(imodels.size()>0){\n aStepData.setInstrumentModel(new ArrayList<String>());\n }else{\n aStepData.setInstrumentModel(null);\n }\n \n }\n }\n if(aStepData.getInstrumentModel()!=null){\n if(!imodels.equals(aStepData.getInstrumentModel())){\n aStepData.setInstrumentModel(imodels);\n }\n } \n*/ \n\n//extra sources\n// ArrayList<String> esources = createList(stepExplorerESourcesList);\n// if(!this.useExtraSourcesCheckbox.isSelected()){\n// esources = new ArrayList<String>();\n// }\n// if(esources.equals(inheritedData.getExtraSources())){\n// aStepData.setExtraSources(null);\n// }else{\n// if(!this.useExtraSourcesCheckbox.isSelected()){\n// aStepData.setExtraSources(new ArrayList<String>());\n// }else{\n// if(esources.size()>0){\n// aStepData.setExtraSources(new ArrayList<String>());\n// }else{\n// aStepData.setExtraSources(null);\n// }\n \n// }\n// }\n// if(aStepData.getExtraSources()!=null){\n// if(!esources.equals(aStepData.getExtraSources())){\n// aStepData.setExtraSources(esources);\n// }\n// }\n //output data column\n String outputdata = stepExplorerOutputDataText.getText();\n if(this.writeOutputCheckbox.isSelected()){\n outputdata = \"\";\n }\n if(outputdata.equals(inheritedData.getOutputDataColumn())){\n aStepData.setOutputDataColumn(null);\n }else{\n if(this.writeOutputCheckbox.isSelected()){\n aStepData.setOutputDataColumn(\"\");\n }else{\n if(!outputdata.equals(\"\")){\n aStepData.setOutputDataColumn(\"\");\n }else{\n aStepData.setOutputDataColumn(null);\n }\n \n }\n }\n if(aStepData.getOutputDataColumn()!=null){\n if(!outputdata.equals(aStepData.getOutputDataColumn())){\n aStepData.setOutputDataColumn(outputdata);\n }\n }\n \n\n \n //Integration\n //Time\n if(this.integrationTimeText.getText().equals(\"\")){\n aStepData.setIntegrationTime(-1.0);\n }else{\n if(Double.parseDouble(integrationTimeText.getText()) == inheritedData.getIntegrationTime()){\n aStepData.setIntegrationTime(-1.0);\n }else{\n aStepData.setIntegrationTime(0.0);\n }\n }\n if(aStepData.getIntegrationTime()!=-1.0){\n if(Double.parseDouble(integrationTimeText.getText()) != aStepData.getIntegrationTime()){\n aStepData.setIntegrationTime(Double.parseDouble(integrationTimeText.getText()));\n }\n }\n //Frequency\n if(this.integrationFrequencyText.getText().equals(\"\")){\n aStepData.setIntegrationFrequency(-1.0);\n }else{\n if(Double.parseDouble(integrationFrequencyText.getText()) == inheritedData.getIntegrationFrequency()){\n aStepData.setIntegrationFrequency(-1.0);\n }else{\n aStepData.setIntegrationFrequency(0.0);\n }\n }\n if(aStepData.getIntegrationFrequency()!=-1.0){\n if(Double.parseDouble(integrationFrequencyText.getText()) != aStepData.getIntegrationFrequency()){\n aStepData.setIntegrationFrequency(Double.parseDouble(integrationFrequencyText.getText()));\n }\n }\n \n //Correlation\n //Type\n if(this.createArrayListFromSelectionList(this.stepExplorerCorrelationTypeList).isEmpty()){\n aStepData.setCorrelationType(null);\n }else{\n if(createArrayListFromSelectionList(stepExplorerCorrelationTypeList).equals(inheritedData.getCorrelationType())){\n aStepData.setCorrelationType(null);\n }else{\n aStepData.setCorrelationType(new ArrayList<String>());\n }\n }\n if(aStepData.getCorrelationType()!=null){\n if(!createArrayListFromSelectionList(stepExplorerCorrelationTypeList).equals(aStepData.getCorrelationType())){\n aStepData.setCorrelationType(createArrayListFromSelectionList(stepExplorerCorrelationTypeList));\n }\n }\n //Selection\n String selectedCSelection = null;\n if(this.stepExplorerCorrelationSelectionBox.getSelectedItem() != null){\n selectedCSelection = this.stepExplorerCorrelationSelectionBox.getSelectedItem().toString();\n }\n if(selectedCSelection == null){\n aStepData.setCorrelationSelection(null);\n }else{\n if(selectedCSelection.equals(\"N/A\")){\n aStepData.setCorrelationSelection(null);\n }else{\n if(selectedCSelection.equals(inheritedData.getCorrelationSelection())){\n aStepData.setCorrelationSelection(null);\n }else{\n aStepData.setCorrelationSelection(\"Generated by BBS GUI\");\n }\n }\n }\n if(aStepData.getCorrelationSelection()!=null){\n if(selectedCSelection!= null && !selectedCSelection.equals(aStepData.getCorrelationSelection())){\n aStepData.setCorrelationSelection(selectedCSelection);\n }\n }\n \n //baseline selection\n ArrayList<ArrayList<String>> baselines = createArrayListsFromBaselineTable();\n ArrayList<String> station1 = baselines.get(0);\n ArrayList<String> station2 = baselines.get(1);\n if(this.baselineUseAllCheckbox.isSelected()){\n station1 = new ArrayList<>();\n station2 = new ArrayList<>();\n }\n if(station1.equals(inheritedData.getStation1Selection()) && station2.equals(inheritedData.getStation2Selection())){\n aStepData.setStation1Selection(null);\n }else{\n if(this.baselineUseAllCheckbox.isSelected()){\n aStepData.setStation1Selection(new ArrayList<String>());\n }else{\n if(station1.size()>0 && station2.size()>0){\n aStepData.setStation1Selection(new ArrayList<String>());\n }else{\n aStepData.setStation1Selection(null);\n }\n \n }\n \n }\n \n if(station1.equals(inheritedData.getStation1Selection()) && station2.equals(inheritedData.getStation2Selection())){\n aStepData.setStation2Selection(null);\n }else{\n if(this.baselineUseAllCheckbox.isSelected()){\n aStepData.setStation2Selection(new ArrayList<String>());\n }else{\n if(station1.size()>0 && station2.size()>0){\n aStepData.setStation2Selection(new ArrayList<String>());\n }else{\n aStepData.setStation2Selection(null);\n }\n \n }\n }\n \n if(aStepData.getStation1Selection()!=null){\n if(!station1.equals(aStepData.getStation1Selection())){\n aStepData.setStation1Selection(station1);\n }\n }\n if(aStepData.getStation2Selection()!=null){\n if(!station2.equals(aStepData.getStation2Selection())){\n aStepData.setStation2Selection(station2);\n }\n }\n \n //Operation\n \n //name\n String selectedOSelection = null;\n if(this.stepExplorerOperationComboBox.getSelectedItem() != null){\n selectedOSelection = this.stepExplorerOperationComboBox.getSelectedItem().toString();\n }\n if(selectedOSelection == null){\n aStepData.setOperationName(null);\n \n }else{\n if(selectedOSelection.equals(\"NOT DEFINED\")){\n aStepData.setOperationName(null);\n }else{\n if(selectedOSelection.equals(inheritedData.getOperationName())){\n aStepData.setOperationName(null);\n }else{\n aStepData.setOperationName(\"Generated by BBS GUI\");\n }\n }\n }\n if(aStepData.getOperationName()!=null){\n if(selectedOSelection!= null && !selectedOSelection.equals(aStepData.getOperationName())){\n aStepData.setOperationName(selectedOSelection);\n }\n }\n //fetch variables from operation attributes panel\n if(!selectedOSelection.equals(\"NOT DEFINED\") && currentStepOperationsPanel != null){\n if(this.currentStepOperationsPanel.getBBSStepOperationAttributes()!=null){\n \n HashMap<String,String> valuesFromForm = currentStepOperationsPanel.getBBSStepOperationAttributes();\n \n HashMap<String,String> oldValuesFromStep = aStepData.getOperationAttributes();\n \n if(oldValuesFromStep == null) oldValuesFromStep = new HashMap<>();\n \n for(String aKey : valuesFromForm.keySet()){\n if(oldValuesFromStep.containsKey(aKey)){\n if(valuesFromForm.get(aKey) == null){\n oldValuesFromStep.put(aKey,null);\n }else{\n if(valuesFromForm.get(aKey).equals(inheritedData.getOperationAttribute(aKey))){\n oldValuesFromStep.put(aKey,null);\n }else{\n oldValuesFromStep.put(aKey,\"Generated by BBS GUI\");\n }\n }\n if(oldValuesFromStep.get(aKey) != null){\n if(!valuesFromForm.get(aKey).equals(oldValuesFromStep.get(aKey))){\n oldValuesFromStep.put(aKey,valuesFromForm.get(aKey));\n aStepData.setOperationName(selectedOSelection);\n }\n }\n }else{\n String newValue = valuesFromForm.get(aKey);\n String inheritedValue = inheritedData.getOperationAttribute(aKey);\n if(newValue!= null && newValue.equals(inheritedValue)){\n oldValuesFromStep.put(aKey,null);\n }else{\n oldValuesFromStep.put(aKey,valuesFromForm.get(aKey));\n aStepData.setOperationName(selectedOSelection);\n }\n }\n }\n aStepData.setOperationAttributes(oldValuesFromStep);\n }\n }else if(currentStepOperationsPanel == null){\n aStepData.setOperationAttributes(null);\n }\n }", "void descriptionComplete();", "@Then(\"detailed description is displaying\")\n public void detailed_description_is_displaying() {\n }", "private void logFullTestDescription() {\n\t\tif (m_currentTestCaseTestSteps != null) {\n\t\t\tString[] fullDescription = m_currentTestCaseTestSteps.split(\"%%%\");\n\t\t\tfor (String testStep : fullDescription) {\n\t\t\t\tm_logMessage.append(\" \" + testStep + \"\\n\");\n\t\t\t}\n\t\t}\n\t}", "private void makeDescription() {\n List switchInfo = InteractDB.getTheList(InteractDB.getFromDB(\"SwitchInfo\", idSwitch.toString()));\n\n DescriptionGen descr = new DescriptionGen(switchInfo);\n description = descr.getDescription();\n }", "interface WithDescription {\n /**\n * Specifies the description property: The description of the lab..\n *\n * @param description The description of the lab.\n * @return the next definition stage.\n */\n WithCreate withDescription(String description);\n }", "protected abstract R runStep();", "private void generateSteps() {\n for (GlobalState g : this.globalStates) {\n List<String> faults = g.getPendingFaults(); \n if(faults.isEmpty()) {\n // Identifying all available operation transitions (when there \n // are no faults), and adding them as steps\n List<String> gSatisfiableReqs = g.getSatisfiableReqs();\n \n for(Node n : nodes) {\n String nName = n.getName();\n String nState = g.getStateOf(nName);\n List<Transition> nTau = n.getProtocol().getTau().get(nState);\n for(Transition t : nTau) {\n boolean firable = true;\n for(String req : t.getRequirements()) {\n if(!(gSatisfiableReqs.contains(n.getName() + \"/\" + req)))\n firable = false;\n }\n if(firable) {\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, t.getTargetState());\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,t.getOperation(),next));\n }\n }\n }\n } else {\n // Identifying all settling handlers for handling the faults\n // pending in this global state\n for(Node n: nodes) {\n // Computing the \"targetState\" of the settling handler for n\n String targetState = null;\n \n String nName = n.getName();\n String nState = g.getStateOf(nName);\n Map<String,List<String>> nRho = n.getProtocol().getRho();\n \n List<String> nFaults = new ArrayList();\n for(String req : nRho.get(nState)) {\n if(faults.contains(nName + \"/\" + req)) \n nFaults.add(req);\n }\n\n // TODO : Assuming handlers to be complete \n\n if(nFaults.size() > 0) {\n Map<String,List<String>> nPhi = n.getProtocol().getPhi();\n for(String handlingState : nPhi.get(nState)) {\n // Check if handling state is handling all faults\n boolean handles = true;\n for(String req : nRho.get(handlingState)) {\n if(nFaults.contains(req))\n handles = false;\n }\n\n // TODO : Assuming handlers to be race-free\n\n // Updating targetState (if the handlingState is \n // assuming a bigger set of requirements)\n if(handles) {\n if(targetState == null || nRho.get(handlingState).size() > nRho.get(targetState).size())\n targetState = handlingState;\n }\n }\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, targetState);\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,next));\n }\n }\n }\n }\n }", "@Override\n public void onStepSelected(Step step) {\n\n mStep = step;\n mSelectedIndex = mRecipe.getStepIndex(mStep);\n if (mSelectedIndex != -1) {\n\n if (mTwoPane) {\n\n FragmentManager fragmentManager = getSupportFragmentManager();\n StepDetailFragment stepDetailFragment =\n StepDetailFragment.newInstance(mRecipe.getSteps().get(mSelectedIndex));\n\n // replace detail fragment\n fragmentManager.beginTransaction()\n .replace(R.id.step_detail_container, stepDetailFragment)\n .commit();\n } else {\n\n // phone scenario\n // The StepDetailActivity takes the entire list of steps to enable navigation\n //between steps without popping back to this activity.\n Intent intent = StepDetailActivity.newIntent(this,\n mRecipe.getSteps(), mSelectedIndex);\n\n // The result is the list of steps with updated check box states corresponding to user\n // input when working with individual steps\n startActivityForResult(intent, STEP_UPDATED_CODE);\n }\n }\n }", "@Override\r\n\t\t\t\t\tpublic void onChange(ChangeEvent event)\r\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal String status = statusList.getItemText(statusList.getSelectedIndex());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(step.getStatus()!=StepStatus.NotStarted && StepStatus.convertLabel(status)==StepStatus.NotStarted)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWindow.alert(messages.cannotChangeToNotStarted());\r\n\t\t\t\t\t\t\tif(step.getStatus()==StepStatus.InProgress)\r\n\t\t\t\t\t\t\t\tstatusList.setSelectedIndex(1);\r\n\t\t\t\t\t\t\tif(step.getStatus()==StepStatus.Complete)\r\n\t\t\t\t\t\t\t\tstatusList.setSelectedIndex(2);\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(step.getStatus()==StepStatus.Complete && StepStatus.convertLabel(status)==StepStatus.InProgress)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//System.out.println(\"step id....\"+step.getId()+\" ... \"+step.getDescription().charAt(5));\r\n\t\t\t\t\t\t\tint stepNo = Integer.valueOf(step.getDescription().charAt(5));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tfor(int i=0; i<listOfSteps.size(); i++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tint stepNumber = Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));\r\n\t\t\t\t\t\t\t\tif(stepNumber < stepNo)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tupdateStepStatus(projectId, listOfSteps.get(i).getStep().getId(), \"In Progress\");\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(step.getStatus()==StepStatus.NotStarted && \r\n\t\t\t\t\t\t\t\t(StepStatus.convertLabel(status)==StepStatus.InProgress || StepStatus.convertLabel(status)==StepStatus.Complete))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tanalysisResults.clear();\r\n\t\t\t\t\t\t\tanalysisResults.add(new Hyperlink(step.getDescription(), StepRouter.CreateStepLink(step)));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tupdateStepStatus(projectId, step.getId(), status);\r\n\t\t\t\t\t\tstep.setStatus(StepStatus.convertLabel(status));\r\n\t\t\t\t\t}", "public int getStepNumber() {\n return stepNumber;\n }", "public abstract void description();", "private void presentShowcaseSequence() {\n }", "public Integer getStep() {\n return step;\n }", "private void advanceToNextInteractionSteps() {\r\n if (this.currentStep < this.notifications.size() - 1) {\r\n this.currentStep++;\r\n this.notificationLabel.setText(\" \" + this.notifications.get(this.currentStep).getMessage());\r\n this.notificationLabel.repaint();\r\n }\r\n }", "public void setStepName(java.lang.String stepName) {\n this.stepName = stepName;\n }", "public String getStepLine()\n\t{\n\t\tString stepString = new String(\"#\"+this.stepLineNumber+\"= \");\n\t\tstepString = stepString.concat(\"IFCDOORLININGPROPERTIES(\");\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"GlobalId\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.GlobalId != null)\t\tstepString = stepString.concat(((RootInterface)this.GlobalId).getStepParameter(IfcGloballyUniqueId.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"OwnerHistory\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.OwnerHistory != null)\t\tstepString = stepString.concat(((RootInterface)this.OwnerHistory).getStepParameter(IfcOwnerHistory.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"Name\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.Name != null)\t\tstepString = stepString.concat(((RootInterface)this.Name).getStepParameter(IfcLabel.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"Description\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.Description != null)\t\tstepString = stepString.concat(((RootInterface)this.Description).getStepParameter(IfcText.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"LiningDepth\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.LiningDepth != null)\t\tstepString = stepString.concat(((RootInterface)this.LiningDepth).getStepParameter(IfcPositiveLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"LiningThickness\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.LiningThickness != null)\t\tstepString = stepString.concat(((RootInterface)this.LiningThickness).getStepParameter(IfcPositiveLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"ThresholdDepth\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.ThresholdDepth != null)\t\tstepString = stepString.concat(((RootInterface)this.ThresholdDepth).getStepParameter(IfcPositiveLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"ThresholdThickness\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.ThresholdThickness != null)\t\tstepString = stepString.concat(((RootInterface)this.ThresholdThickness).getStepParameter(IfcPositiveLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"TransomThickness\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.TransomThickness != null)\t\tstepString = stepString.concat(((RootInterface)this.TransomThickness).getStepParameter(IfcPositiveLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"TransomOffset\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.TransomOffset != null)\t\tstepString = stepString.concat(((RootInterface)this.TransomOffset).getStepParameter(IfcLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"LiningOffset\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.LiningOffset != null)\t\tstepString = stepString.concat(((RootInterface)this.LiningOffset).getStepParameter(IfcLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"ThresholdOffset\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.ThresholdOffset != null)\t\tstepString = stepString.concat(((RootInterface)this.ThresholdOffset).getStepParameter(IfcLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"CasingThickness\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.CasingThickness != null)\t\tstepString = stepString.concat(((RootInterface)this.CasingThickness).getStepParameter(IfcPositiveLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"CasingDepth\")) stepString = stepString.concat(\"*,\");\n\t\telse{\n\t\tif(this.CasingDepth != null)\t\tstepString = stepString.concat(((RootInterface)this.CasingDepth).getStepParameter(IfcPositiveLengthMeasure.class.isInterface())+\",\");\n\t\telse\t\tstepString = stepString.concat(\"$,\");\n\t\t}\n\t\tif(getRedefinedDerivedAttributeTypes().contains(\"ShapeAspectStyle\")) stepString = stepString.concat(\"*);\");\n\t\telse{\n\t\tif(this.ShapeAspectStyle != null)\t\tstepString = stepString.concat(((RootInterface)this.ShapeAspectStyle).getStepParameter(IfcShapeAspect.class.isInterface())+\");\");\n\t\telse\t\tstepString = stepString.concat(\"$);\");\n\t\t}\n\t\treturn stepString;\n\t}", "public QaStep() {\n\t}", "public static void fail(String stepName, String description) \n\t{\n\t\ttry{\n\t\t\t\tString strImagePath=\"./ScreenShot/\"+getScreenshot();\n\t\t\t\tString strMarkup=getMarkup(strImagePath);\n\t\t\t\ttest.log(LogStatus.FAIL, stepName, description +\"\\n\" + strMarkup);\t\t\t\t\t\t\n\t\t\t\tReporter.blnStatus=false;\n\t\t\t\tblnReportTempStatus=false;\n\t\t}catch(Exception e){fnPrintException(e);}\t\n\t}" ]
[ "0.72575194", "0.6906461", "0.6684224", "0.66805255", "0.6600281", "0.6600281", "0.65801305", "0.65801305", "0.65656835", "0.6559091", "0.6549611", "0.65338", "0.6489475", "0.6395018", "0.63893384", "0.63540596", "0.63540596", "0.6338217", "0.6325045", "0.62881386", "0.62845", "0.628254", "0.62624776", "0.62624776", "0.62624776", "0.6256089", "0.6245074", "0.6212239", "0.61707413", "0.6168264", "0.61502635", "0.6140532", "0.61376256", "0.61166877", "0.60997784", "0.60986584", "0.6096684", "0.60691684", "0.6054737", "0.6038821", "0.60358924", "0.60351515", "0.6014146", "0.60129964", "0.5994775", "0.5994638", "0.5985285", "0.5974172", "0.5968362", "0.5938895", "0.59298325", "0.59298325", "0.59298325", "0.592732", "0.59212655", "0.5911747", "0.5907446", "0.58878213", "0.58794713", "0.58681875", "0.58681875", "0.58681875", "0.58562464", "0.5843628", "0.5828484", "0.5823103", "0.58223027", "0.5811457", "0.5808938", "0.5808938", "0.57725185", "0.5769238", "0.5764517", "0.57444876", "0.57384044", "0.5733841", "0.57323825", "0.57312685", "0.57312685", "0.57312685", "0.5715194", "0.5710408", "0.57065916", "0.57028574", "0.56989735", "0.5696597", "0.5681506", "0.56616294", "0.565722", "0.5657066", "0.5655497", "0.5654641", "0.5631914", "0.56228346", "0.56223154", "0.56182617", "0.5611467", "0.5603954", "0.55968213", "0.5591583", "0.5571674" ]
0.0
-1
15, only letters and numbers, not simbols
public RegistrationRutPage(WebDriver driver) { super(driver); PageFactory.initElements(driver, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Boolean testUsername(String username){\n\t\t//Setting Up Regex -> All Numbers and Letters maximum 14 signs\n\t\tString pattern =\"[A-z1-9]{2,14}\";\n\t\tPattern p = Pattern.compile(pattern);\n\t\tMatcher m = p.matcher(username);\n\t\t\t\n\t\tif(m.matches() && !username.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private static char[] m619z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 20);\n }\n return toCharArray;\n }", "static String m33125a(String name) {\n StringBuilder fieldNameBuilder = new StringBuilder();\n int index = 0;\n char firstCharacter = name.charAt(0);\n int length = name.length();\n while (index < length - 1 && !Character.isLetter(firstCharacter)) {\n fieldNameBuilder.append(firstCharacter);\n index++;\n firstCharacter = name.charAt(index);\n }\n if (Character.isUpperCase(firstCharacter)) {\n return name;\n }\n fieldNameBuilder.append(m33124a(Character.toUpperCase(firstCharacter), name, index + 1));\n return fieldNameBuilder.toString();\n }", "private static boolean m4389a(String str) {\n return str != null && str.length() != 0 && Pattern.compile(\"^[0-9A-Fa-f]{13,18}+$\").matcher(str).matches() && str.indexOf(\"000000000\") == -1 && str.indexOf(\"111111111\") == -1 && str.indexOf(\"222222222\") == -1 && str.indexOf(\"333333333\") == -1 && str.indexOf(\"444444444\") == -1 && str.indexOf(\"555555555\") == -1 && str.indexOf(\"666666666\") == -1 && str.indexOf(\"777777777\") == -1 && str.indexOf(\"888888888\") == -1 && str.indexOf(\"999999999\") == -1;\n }", "public int symbols(String senha){\n Pattern exp = Pattern.compile(\"([^a-zA-Z\\\\d\\\\s]+)\");\n Matcher matcher = exp.matcher(senha);\n int i = 0;\n while (matcher.find())\n i += matcher.group().length();\n return i;\n }", "public boolean isPwLength5to12Characters(String password) {\n\t\t//return password.matches(\"^(?=[\\\\s\\\\S]{5,12}$)[a-zA-Z0-9]*[^$%^&*;:,<>?()\\\\\\\"']*$\");\n\t\treturn password.length() >= 5 && password.length() <= 12;\n\t}", "public boolean verifisTel(String text) {\n if (text.matches(\"^[0-9]+$\")&& text.length()==8) {\n return true;\n } else {\n return false;\n }\n }", "private char[] alphanumeric(){\n StringBuffer buf=new StringBuffer(128);\n for(int i=48; i<= 57;i++)buf.append((char)i); // 0-9\n for(int i=65; i<= 90;i++)buf.append((char)i); // A-Z\n for(int i=97; i<=122;i++)buf.append((char)i); // a-z\n return buf.toString().toCharArray();\n }", "@Test\n\tpublic void inputVoucher_is_alphanumeric(){\n\t\tString pattern = \"^[a-zA-Z0-9]*$\";\n\t\tvoucher.getInputVoucher().sendKeys(\"aaa aaaa 123\");\n\t\tSystem.out.println(voucher.getInputVoucher().getText().matches(pattern));\n\t\tAssert.assertEquals(voucher.getInputVoucher().getText().matches(pattern), true, \"input voucher code tidak alphanumeric\");\n\t}", "public abstract void mo2153a(CharSequence charSequence);", "public static void main(String[] args) {\n\r\n\t\tString password = \"$$ Welcome to 1st Automation Interview $$\" ;\r\n\t\t\r\n\t\tSystem.out.println(password.charAt(5));\r\n\r\n\t\tint lettercount = 0 , digitcount = 0 , specialcount = 0 ; \r\n\r\n\t\tPattern letter = Pattern.compile(\"[a-zA-z]\");\r\n\t\tPattern digit = Pattern.compile(\"[0-9]\");\r\n\t\tPattern special = Pattern.compile (\"[!@#$%&*()_+=|<>?{}\\\\[\\\\]~-]\");\r\n\t\t//Pattern eight = Pattern.compile (\".{8}\");\r\n\r\n\r\n\t\tMatcher hasLetter = letter.matcher(password);\r\n\t\tMatcher hasDigit = digit.matcher(password);\r\n\t\tMatcher hasSpecial = special.matcher(password);\r\n\r\n\r\n\t\tfor (int i = 0 ;password.length()<i ; i++) {\r\n\r\n\t\t\tif(hasLetter.find(password.charAt(i))) {\r\n\r\n\t\t\t\tlettercount++ ;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(lettercount);\r\n\r\n\t\t/*while ( hasLetter.find()) {\r\n\t\t\tlettercount++ ; \r\n\r\n\r\n\r\n\t\t} System.out.println(lettercount);\r\n\r\n\t\twhile (hasDigit.find()) {\r\n\t\t\tdigitcount++ ; \r\n\t\t\tSystem.out.println(hasDigit.group());\r\n\t\t} \r\n\t\tSystem.out.println(digitcount);\r\n\r\n\t\twhile ( hasSpecial.find()) {\r\n\t\t\tSystem.out.println(hasSpecial.group());\r\n\r\n\t\t\tspecialcount++;\r\n\t\t}System.out.println(specialcount);\r\n\t\t */\r\n\r\n\r\n\t}", "@Test //TEST THREE\n void testallNumbersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"12345\");\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }", "@Test //TEST FOUR\n void testOneNumberinRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"MO0N\");\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }", "private static char[] m3268z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 18);\n }\n return toCharArray;\n }", "@Test\n public void shouldCollapseAllDigitsByX(){\n Assert.assertThat(\"match any digits\",CharMatcher.DIGIT.replaceFrom(\"123TT T4\",\"x\"),is(\"xxxTT Tx\"));\n Assert.assertThat(\"match any digits\",CharMatcher.DIGIT.or(CharMatcher.WHITESPACE).replaceFrom(\"123TT T4\", \"x\"),is(\"xTTxTx\"));\n }", "static String getAlphaNumericString(int n) \n {\n byte[] array = new byte[256]; \n new Random().nextBytes(array); \n \n String randomString \n = new String(array, Charset.forName(\"UTF-8\")); \n \n // Create a StringBuffer to store the result \n StringBuffer r = new StringBuffer(); \n \n // Append first 20 alphanumeric characters \n // from the generated random String into the result \n for (int k = 0; k < randomString.length(); k++) { \n \n char ch = randomString.charAt(k); \n \n if (((ch >= 'a' && ch <= 'z') \n || (ch >= 'A' && ch <= 'Z') \n || (ch >= '0' && ch <= '9')) \n && (n > 0)) { \n \n r.append(ch); \n n--; \n } \n } \n \n // return the resultant string \n return r.toString(); \n }", "public static void main(String[] args) {\n// System.out.println(alphanumeric.replaceAll(\"[aei]\", \"x\"));\n\n\n String regex = \"^[A-Z]|[a-z]\";\n String username = \"kaaviya\";\n\n System.out.println(username.replaceAll( \"^[A-Za-z][A-Za-z0-9_]{7,29}$\", \"x\"));\n System.out.println(username.matches(regex));\n\n }", "public static String crypter (String chaineACrypter, int codeCryptage) {\r\n char car;\r\n char newCar;\r\n int charLength = chaineACrypter.length();\r\n\r\n for(int i = 0; i < charLength; i++){\r\n car = chaineACrypter.charAt(i);\r\n if(car >= 'a' && car <= 'z'){\r\n newCar = (char)(car + codeCryptage);\r\n if (i == 0) {\r\n chaineACrypter = newCar + chaineACrypter.substring(i+1);\r\n }else{\r\n chaineACrypter = chaineACrypter.substring(0, i) + newCar + chaineACrypter.substring(i+1);\r\n }\r\n }else if(car >= 'A' && car <= 'Z'){\r\n newCar = (char)(car - codeCryptage);\r\n if (i == 0) {\r\n chaineACrypter = newCar + chaineACrypter.substring(i+1);\r\n }else{\r\n chaineACrypter = chaineACrypter.substring(0, i) + newCar + chaineACrypter.substring(i+1);\r\n }\r\n }else if(car >= '0' && car <= '9'){\r\n newCar = (char)(car + 7 % codeCryptage);\r\n if (i == 0) {\r\n chaineACrypter = newCar + chaineACrypter.substring(i+1);\r\n }else{\r\n chaineACrypter = chaineACrypter.substring(0, i) + newCar + chaineACrypter.substring(i+1);\r\n }\r\n }\r\n }\r\n\r\n\r\n return chaineACrypter;\r\n }", "public C3244x1 mo12665a(String str) {\n C3244x1 x1Var = new C3244x1();\n String trim = str.trim();\n String str2 = trim;\n for (String replace : f11725a) {\n str2 = str2.replace(replace, \"\");\n }\n if (str2.length() > 512) {\n str2 = str2.substring(0, C0753l.f3451u);\n StringBuilder sb = new StringBuilder();\n sb.append(str2.trim());\n sb.append(\"... exceeds the limit of \");\n sb.append(512);\n sb.append(\" characters. Trimmed\");\n x1Var.mo12658a(sb.toString());\n x1Var.mo12656a(510);\n }\n x1Var.mo12657a((Object) str2.trim());\n return x1Var;\n }", "private static String genString(){\n final String ALPHA_NUMERIC_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n int pwLength = 14; //The longer the password, the more likely the user is to change it.\n StringBuilder pw = new StringBuilder();\n while (pwLength-- != 0) {\n int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());\n pw.append(ALPHA_NUMERIC_STRING.charAt(character));\n }\n return pw.toString(); //\n }", "static char[] generateAZLowercaseAndNumbersAndSpecial(int length) {\n charArray = new char[length];\n int k;\n for (int i = 0; i < length; i++) {\n k = (int) (Math.random() * 3);\n if (k == 0) {\n charArray[i] = RandomChar.generateAZLowerRangeChar();\n } else if (k == 1) {\n charArray[i] = RandomChar.generateNumberChar();\n } else if (k == 2) {\n charArray[i] = RandomChar.generateSpecChar();\n }\n }\n return charArray;\n }", "private String extractLetters(String courseCode) {\n CharMatcher matcher = CharMatcher.javaDigit();\n String StringOnly = matcher.removeFrom(courseCode);\n return StringOnly;\n }", "private static boolean m66068b(String str) {\n for (int i = 0; i < str.length(); i++) {\n char charAt = str.charAt(i);\n if (charAt <= 31 || charAt >= 127 || \" #%/:?@[\\\\]\".indexOf(charAt) != -1) {\n return true;\n }\n }\n return false;\n }", "private String quitarCaracteresNoImprimibles(String mensaje) {\n String newMensaje = \"\";\n int codigoLetra = 0;\n for (char letra : mensaje.toCharArray()) {\n codigoLetra = (int) letra;\n if (codigoLetra >= 32 && codigoLetra <= 128) {\n newMensaje += letra;\n }\n }\n return newMensaje;\n }", "private String intChecker(String s) {\n\t\tString newS = \"\";\n\t\tfor(int i = 0; i < s.length(); i++) {\n\t\t\tif(s.charAt(i) > 47 && s.charAt(i) < 58) {\n\t\t\t\tnewS += s.charAt(i);\n\t\t\t}\n\t\t}\n\t\treturn newS;\n\t}", "@Test\n public void checkUniqueCharacter() {\n int numberOfChars = compressor.getCodes().size();\n assertTrue(numberOfChars == 86 || numberOfChars == 87, \"You appear to have some very strange end-of-line configuration on your machine!\");\n }", "@Test(timeout = 4000)\n public void test38() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"BnqiEV[^a>`-s`25}M\");\n assertEquals(\"bnqief[^a>`-s`25}m\", string0);\n }", "public static String rndLetterString() {\r\n int spLen = RBytes.rndInt(10, 20);\r\n char[] c = RBytes.rndCharArray('a', 'z');\r\n char[] C = RBytes.rndCharArray('A', 'Z');\r\n char[] d = RBytes.rndCharArray('0', '9');\r\n String special = \"\";\r\n for (int s = 0; s < spLen; s++) {\r\n special += \"!@#$%^&*()-_~`=+:;.,\";\r\n }\r\n String s1 = new String(c) + new String(d) + new String(C) + special;\r\n return shaffleString(s1);\r\n }", "private void validExpresion(){\n\t\tString valores =\"+/*-^sinbqrcotah.\";\n\t\tchar[] fun = (this.getText()).toCharArray();\n\t\tint tam = fun.length-1;\n\t\tif(tam > 0){\n\t\t\tif(valores.indexOf(fun[tam]) != -1){\n\t\t\t\tcont++;\n\t\t\t\tthis.setBackground(Color.RED);\n\t\t\t}\n\t\t}\n\n\t\tif(this.getText().equals(\"+\") || this.getText().equals(\"-\") || this.getText().equals(\".\")){\n\t\t\t\tcont++;\n\t\t\t\tthis.setBackground(Color.RED);\n\t\t}\n\n\t\telse if(this.getText().equals(\"s\") || this.getText().equals(\"c\") || this.getText().equals(\"t\")){\n\t\t\t\tcont++;\n\t\t\t\tthis.setBackground(Color.RED);\n\t\t}\n\n\t\telse if(this.getText().equals(\"(\") || this.getText().equals(\"a\") || this.getText().equals(\"i\")){\n\t\t\t\tcont++;\n\t\t\t\tthis.setBackground(Color.RED);\n\t\t}\n\t}", "public static boolean isUsernameValid(String username) {\n if (username.length() > 50) { \n return false;\n } else { \n char c;\n int count = 1; \n for (int i = 0; i < username.length(); i++) {\n c = username.charAt(i);\n if (!Character.isLetterOrDigit(c)) { \n return false;\n }\n // If the character is a space\n else if (c == ' '){ \n return false;\n }\n else if (Character.isDigit(c)) {\n count++;\n if (count > 6) { \n return false;\n } \n }\n }\n }\n return true;\n }", "public static String getRandomAplhaNumeric(String characters) {\n\t\tSecureRandom secureRnd = new SecureRandom();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < 5; i++)\n\t\t\tsb.append(characters.charAt(secureRnd.nextInt(characters.length())));\n\t\treturn sb.toString();\n\t}", "String selectRandomSecretWord();", "public static void show() {\r\n\t\t int[] forword=new int[6];\r\n\t\t int[] temp;\r\n\t\t for(int i=1;i<7;i++){\r\n\t\t\t temp=Arrays.copyOf(forword, 6);\r\n\t\t\t for(int j=0;j<i;j++){\r\n\t\t\t\t if(j==0){\r\n\t\t\t\t\t forword[0]=i;\r\n\t\t\t\t\t System.out.print(forword[0]+\" \");\r\n\t\t\t\t }else{\r\n\t\t\t\t\t forword[j]=forword[j-1]+temp[j-1];\r\n\t\t\t\t\t System.out.print(forword[j]+\" \");\t\t \r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t System.out.println();\r\n\t\t }\r\n\t\t //0-9:48-57 ; A-Z:65-90 ; a-z:97-122 \r\n\t\t\r\n\t}", "@Test\n public void nao_deve_aceitar_descricao_com_menos_de_15_caracteres() {\n telefone.setDescricao(random(35, true, false));\n assertFalse(isValid(telefone, \"A descrição não pode ter menos de 15 e mais de 30 caracteres.\", Find.class));\n }", "private void scanTicket(){\r\n\t\ttext = numberField.getText();\r\n\t\t//Number field text is converted into char \r\n\t\tstringToChar(text);\r\n\t\tif(executed == false){\r\n\t\t\trandom();\r\n\t\t}\r\n\t}", "String mo150a(String str);", "private boolean validNbit(String input) {\n\t\treturn input.matches(\"[0-9A-F]+\");\n\t}", "private void insureMinimumLettersInTypeCode(StringBuffer buffer, String type) {\r\n buffer.append(type.charAt(1));\r\n int ndx = 2;\r\n char ch = type.charAt(ndx);\r\n while (isVowel(ch)) {\r\n buffer.append(ch);\r\n ndx++;\r\n ch = type.charAt(ndx);\r\n }\r\n buffer.append(ch);\r\n }", "private String whiteSpace(String sum, String num)\n {\n\tString space = \"\";\n\tfor(int i = 0; i < sum.length() - num.length(); i++)\n\t space += \" \";\n\treturn space;\n }", "public C3244x1 mo12669d(String str) {\n C3244x1 x1Var = new C3244x1();\n String trim = str.trim();\n String str2 = trim;\n for (String replace : f11726b) {\n str2 = str2.replace(replace, \"\");\n }\n if (str2.length() > 120) {\n str2 = str2.substring(0, 119);\n StringBuilder sb = new StringBuilder();\n sb.append(str2.trim());\n sb.append(\"... exceeds the limit of \");\n sb.append(120);\n sb.append(\" characters. Trimmed\");\n x1Var.mo12658a(sb.toString());\n x1Var.mo12656a(520);\n }\n x1Var.mo12657a((Object) str2.trim());\n return x1Var;\n }", "private String validateChar(String text) {\n char[] validChars = new char[text.length()];\n int validCount = 0;\n for (int i = 0; i < text.length(); i++) {\n char c = text.charAt(i);\n boolean valid = (c >= 0x20 && c <= 0xd7ff) || (c >= 0xe000 && c <= 0xfffd);\n if (valid) {\n validChars[validCount++] = c;\n } else {\n if (c == 10) // LineBreak\n {\n validChars[validCount++] = c;\n }\n }\n }\n return new String(validChars, 0, validCount);\n }", "@Test\n public void nao_deve_aceitar_descricao_com_mais_de_30_caracteres() {\n telefone.setDescricao(random(35, true, false));\n assertFalse(isValid(telefone, \"A descrição não pode ter menos de 15 e mais de 30 caracteres.\", Find.class));\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}", "private String createId() {\n int idLength = 5;\n String possibleChars = \"1234567890\";\n Random random = new Random();\n StringBuilder newString = new StringBuilder();\n\n for (int i = 0; i < idLength; i++) {\n int randomInt = random.nextInt(10);\n newString.append(possibleChars.charAt(randomInt));\n }\n\n return newString.toString();\n }", "private boolean validarContrasena (String contrasena){\n Pattern pattern = Pattern.compile(\"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=!.])(?=\\\\S+$).{6,}$\");\n if (!contrasena.matches(String.valueOf(pattern))){\n errorCo.setText(\"La Contraseña debe tener al menos: 6 caracteres, 1 minúscula, 1 mayúscula, 1 número y 1 signo\");\n errorCo.setVisibility(View.VISIBLE);\n\n }\n return contrasena.matches(String.valueOf(pattern));\n }", "public void limitarCaracteres(JTextField l, int nmax){\r\n l.addKeyListener(new KeyAdapter(){\r\n @Override\r\n public void keyTyped(KeyEvent e){\r\n if (l.getText().length()==nmax){\r\n e.consume();}\r\n } \r\n });\r\n }", "@Test(timeout = 4000)\n public void test40() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stem(\"8B{6r2FfF_D<R@pp\");\n assertEquals(\"8b{6r2fff_d<r@p\", string0);\n }", "public static String randAlnum(){\n int n;\n String result = null;\n switch (CAPS){\n case 0:\n n = rand.nextInt(62);\n if (n>51){\n result = String.valueOf(n-52);\n }else {\n result = randChar(); //both\n }\n break;\n case 1:\n n = rand.nextInt(36);\n if (n>25){\n result = String.valueOf(n-26);\n }else {\n result = randLower(); //lower\n }\n break;\n case 2:\n n = rand.nextInt(36);\n if (n>25){\n result = String.valueOf(n-26);\n }else {\n result = randUpper(); //upper\n }\n break;\n }\n return result;\n }", "static String keepNumbersOnly(CharSequence s) {\n try {\n return s.toString().replaceAll(\"[^0-9]\", \"\");\n } catch (Exception e){\n return null;\n }\n }", "void mo12635a(String str);", "private String getToken() {\n\t\tString numbers = \"0123456789\";\n\t\tRandom rndm_method = new Random();\n String OTP = \"\";\n for (int i = 0; i < 4; i++)\n {\n \tOTP = OTP+numbers.charAt(rndm_method.nextInt(numbers.length()));\n \n }\n return OTP;\n\t}", "private String construyeCaracter(String palabra) throws IOException {\n\t\tToken aux = null;\n \t\twhile(!((aux = this.nextTokenWithWhites()).get_lexema().equals(\"'\"))) {\n \t\t\tif (aux.get_lexema().equals(\"fin\"))\n \t\t\t\treturn palabra;\n \t\t\tpalabra = palabra + aux.get_lexema();\n \t\t\t// Si vemos que el caracter se alarga mucho, paramos de leer\n \t\t\tif (palabra.length() > 4) {\n \t\t\t\treturn palabra;\n \t\t\t}\n \t\t}\n \t\tpalabra = palabra + aux.get_lexema();\n\t\treturn palabra;\n\t}", "static char[] generateAZLowercaseAndNumbers(int length) {\n charArray = new char[length];\n int k;\n for (int i = 0; i < length; i++) {\n k = (int) (Math.random() * 2);\n if (k == 0) {\n charArray[i] = RandomChar.generateAZLowerRangeChar();\n } else if (k == 1) {\n charArray[i] = RandomChar.generateNumberChar();\n }\n }\n return charArray;\n }", "public void hileraReconocer (javafx.scene.input.KeyEvent keyEvent) {\r\n char car = keyEvent.getCharacter().charAt(0);\r\n \r\n if(j==1){\r\n if ((car < 'a' || car > 'z') && (car < 'A' || car > 'Z') ) {\r\n keyEvent.consume();\r\n } \r\n }else{\r\n if ((car < '0' || car > '9') ) {\r\n keyEvent.consume();\r\n } \r\n }\r\n \r\n }", "private static String lettre2Chiffre1(String n) {\n\t\tString c= new String() ;\n\t\tswitch(n) {\n\t\tcase \"A\": case \"J\":\n\t\t\tc=\"1\";\n\t\t\treturn c;\n\t\tcase \"B\": case \"K\": case \"S\":\n\t\t\tc=\"2\";\n\t\t\treturn c;\n\t\tcase \"C\": case\"L\": case \"T\":\n\t\t\tc=\"3\";\n\t\t\treturn c;\n\t\tcase \"D\": case \"M\": case \"U\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\tcase \"E\": case \"N\": case \"V\":\n\t\t\tc=\"5\";\n\t\t\treturn c;\n\t\tcase \"F\": case \"O\": case \"W\":\n\t\t\tc=\"6\";\n\t\t\treturn c;\n\t\tcase \"G\": case \"P\": case \"X\":\n\t\t\tc=\"7\";\n\t\t\treturn c;\n\t\tcase \"H\": case \"Q\": case \"Y\":\n\t\t\tc=\"8\";\n\t\t\treturn c;\n\t\tcase \"I\": case \"R\": case \"Z\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\t\t\n\t\t}\n\t\treturn c;\n\t\t\n\t\n\t\t}", "private boolean isAllChars(String fieldVal){\r\n // Get rid of all whitespace from the given string\r\n String val = fieldVal.replaceAll(\"\\\\s\", \"\").trim();\r\n // Check each character in the string to determine if it is a digit or not\r\n for (int i=0; i < val.length(); i++){\r\n // if we find a digit return false\r\n if (Character.isDigit(val.charAt(i))){\r\n return false;\r\n }\r\n }\r\n // if we get here then all characters in the string are letters\r\n return true;\r\n }", "public static void main(String[] args) \n\t{\n\t\tString str = \"647mahesh\";\n\t\tint size = str.length();\n\t\tint i;\n\t\tfor (i = 0; i < size ; i++)\n\t\t{\n\t\t\tchar split = str.charAt(i);\n\t\t\tif ('0'<=split && split<='8')\n\t\t\tbreak;\n\t\t}\n\t\tString numeric = str.substring(0,i);\n\t\tString alphabets = str.substring(i);\n\t\tSystem.out.println(numeric);\n\t\tSystem.out.println(alphabets);\n\t}", "@Test(timeout = 4000)\n public void test152() throws Throwable {\n StringReader stringReader0 = new StringReader(\"pZhZ$;yY23j:\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 121, 1);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[4];\n stringReader0.read(charArray0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(\"$\", token0.toString());\n assertEquals(74, token0.kind);\n }", "@Override\n\tpublic void challenge15() {\n\n\t}", "Rule Digit() {\n // No effect on value stack\n return CharRange('0', '9');\n }", "private String Interpretar(String num) {\r\n\t\tif(num.length() > 3)\r\n\t\t\treturn \"\";\r\n\t\tString salida=\"\";\r\n\t\t\r\n\t\tif(Dataposi(num,2) != 0)\r\n\t\t\tsalida = Centenas[Dataposi(num,2)-1];\r\n\t\t\r\n\t\tint k = Integer.parseInt(String.valueOf(Dataposi(num,1))+String.valueOf(Dataposi(num,0)));\r\n\r\n\t\tif(k <= 20)\r\n\t\t\tsalida += Numero[k];\r\n\t\telse {\r\n\t\t\tif(k > 30 && Dataposi(num,0) != 0)\r\n\t\t\t\tsalida += Decenas[Dataposi(num,1)-2] + \"Y \" + Numero[Dataposi(num,0)];\r\n\t\t\telse\r\n\t\t\t\tsalida += Decenas[Dataposi(num,1)-2] + Numero[Dataposi(num,0)];\r\n\t\t}\r\n\t\t//Caso especial con el 100\r\n\t\tif(Dataposi(num,2) == 1 && k == 0)\r\n\t\t\tsalida=\"CIEN\";\r\n\t\t\r\n\t\treturn salida;\r\n\t}", "@Override\r\n\tpublic boolean validate(String num) {\n\t\treturn false;\r\n\t}", "public void testNUMWORDS15() throws Exception {\n\t\tObject retval = execLexer(\"NUMWORDS\", 260, \"eight\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"NUMWORDS\", expecting, actual);\n\t}", "int minLength();", "public String mo38889c() {\n String trim = this.f30736g0.getText().toString().trim();\n return trim.length() == 5 ? trim.substring(3, 5) : \"\";\n }", "@Test //TEST FIVE\n void testSpecialCharactersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"Pot!at!*\"); //potat or potato w/out an o\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }", "private static String makeLatinName(int len, Random r) {\n final String lc = \"abcdefghijklmnopqrstuvwxyz\";\n final String alphabet = lc + lc.toUpperCase();\n final String start = \"$_\" + alphabet;\n final String part = start + \"0123456789\";\n\n StringBuffer sb = new StringBuffer();\n sb.append(start.charAt(r.nextInt(start.length())));\n while (sb.length() < len)\n sb.append(part.charAt(r.nextInt(part.length())));\n return sb.toString();\n }", "private String creatNewText() {\n\t\tRandom rnd = new Random();\n\t\treturn \"Some NEW teXt U9\" + Integer.toString(rnd.nextInt(999999));\n\t}", "private boolean verificarCnpj(String cnpj) {\n return true;\n \n// if (cnpj.length() != 14) {\n// return false;\n// }\n//\n// int soma = 0;\n// int dig = 0;\n//\n// String digitosIniciais = cnpj.substring(0, 12);\n// char[] cnpjCharArray = cnpj.toCharArray();\n//\n// /* Primeira parte da validação */\n// for (int i = 0; i < 4; i++) {\n// if (cnpjCharArray[i] - 48 >= 0 && cnpjCharArray[i] - 48 <= 9) {\n// soma += (cnpjCharArray[i] - 48) * (6 - (i + 1));\n// }\n// }\n//\n// for (int i = 0; i < 8; i++) {\n// if (cnpjCharArray[i + 4] - 48 >= 0 && cnpjCharArray[i + 4] - 48 <= 9) {\n// soma += (cnpjCharArray[i + 4] - 48) * (10 - (i + 1));\n// }\n// }\n//\n// dig = 11 - (soma % 11);\n//\n// digitosIniciais += (dig == 10 || dig == 11) ? \"0\" : Integer.toString(dig);\n//\n// /* Segunda parte da validação */\n// soma = 0;\n//\n// for (int i = 0; i < 5; i++) {\n// if (cnpjCharArray[i] - 48 >= 0 && cnpjCharArray[i] - 48 <= 9) {\n// soma += (cnpjCharArray[i] - 48) * (7 - (i + 1));\n// }\n// }\n//\n// for (int i = 0; i < 8; i++) {\n// soma += (cnpjCharArray[i + 5] - 48) * (10 - (i + 1));\n// }\n//\n// dig = 11 - (soma % 11);\n// digitosIniciais += (dig == 10 || dig == 11) ? \"0\" : Integer.toString(dig);\n\n// return cnpj.equals(digitosIniciais);\n }", "private String newCode(int length) {\n Random rnd = new SecureRandom();\n StringBuilder code = new StringBuilder(length);\n do {\n code.setLength(0);\n while (code.length() < length) {\n if (rnd.nextBoolean()) { // append a new letter or digit?\n char letter = (char) ('a' + rnd.nextInt(26));\n code.append(rnd.nextBoolean() ? Character.toUpperCase(letter) : letter);\n } else {\n code.append(rnd.nextInt(10));\n }\n }\n } while (exists(code.toString()));\n return code.toString();\n }", "public void testNmCode() throws Exception {\n String nmCode = \"E1-541-392740-1-img.E1-543-392740-1-a.E1-4-DengLu-1-a.E1-38-red&ChaDian-1-a.UT-601-392740-2*2-a\";\r\n //Pattern p = Pattern.compile(\"\\\\w+-(?:543|601)-(\\\\w+)-(\\\\d+(\\\\*\\\\d+)?)-\\\\w+\\\\.?\");\r\n Pattern p = Pattern.compile(\"(\\\\w+)-(\\\\w+)-(\\\\w+)-(\\\\d+(\\\\*\\\\d+)?)-\\\\w+\\\\.?\");\r\n //Pattern p = Pattern.compile(\".+-(?:639|640)-(\\\\w+)-(\\\\d+(\\\\*\\\\d+)?)-.*\");\r\n Matcher m = p.matcher(nmCode);\r\n while (m.find()) {\r\n p(m.group(1) + \",\" + m.group(2) + \",\" + m.group(3));\r\n }\r\n }", "@Test\n public void testIsStringOnlyAlphabetAndNumbersAndWhiteSpaces() {\n System.out.println(\"isStringOnlyAlphabetAndNumbersAndWhiteSpaces\");\n String input = \".%6gwdye\";\n boolean expResult = false;\n boolean result = ValidVariables.isStringOnlyAlphabetAndNumbersAndWhiteSpaces(input);\n assertEquals(expResult, result);\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s = \"123.5MA1C2034\";\n\t\tfor(int i = 0; i < s.length(); i++)\n\t\t\tif(((int) s.charAt(i)>= 65 && (int)s.charAt(i)<= 91)||(int) s.charAt(i)>= 97 && (int)s.charAt(i)<= 122)\n\t\t\t\tSystem.out.println(s.charAt(i));\n\t\t\t\n\t}", "protected void validatePassword(){\n //Only Checking For Word Type Password With Minimum Of 8 Digits, At Least One Capital Letter,At Least One Number,At Least One Special Character\n Boolean password = Pattern.matches(\"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9](?=.*[!@#$%^&*()])).{8,}$\",getPassword());\n System.out.println(passwordResult(password));\n }", "public static void main(String[] args) {\n\t\t\n\t\tString var1=\"Syntax is best2525.batch nine is great.\";\n\t\t\n\t\tSystem.out.println(var1.replaceAll(\"[0-9]\", \"\"));\n\t\t// since we dont know what exat number is in my string then we say \n\t\t// an general state that all number from 0 t0 9 repkace with ...\n\t\t\n\t\tString var2=\"98739985849jgjdvjfSSAAklvjvjf\";\n\t\tSystem.out.println(var2.replaceAll(\"[a-zA-Z]\", \"\"));\n\t\t\n\t\t\n\t\t\n\t\tString var3=\"854838FHJGFF75838847dssugufshkhiu#@$%&*(\";\n\t\t\n\t\tSystem.out.println(var3.replaceAll(\"[^a-zA-Z]\", \"\"));\n\t\tSystem.out.println(var3.replaceAll(\"[^a-zA-Z0-9]\", \"\"));\n\t\t\n\t\t\n\t}", "private static int m615a(String str, int i) {\n int length = str.length() - 1;\n int i2 = 1;\n int i3 = 0;\n while (length >= 0) {\n int indexOf = (f337z[0].indexOf(str.charAt(length)) * i2) + i3;\n i3 = i2 + 1;\n if (i3 > i) {\n i3 = 1;\n }\n length--;\n i2 = i3;\n i3 = indexOf;\n }\n return i3 % 47;\n }", "@Test\n\tpublic void caseNameWithWrongLength() {\n\t\tString caseName = \"le\";\n\t\ttry {\n\t\t\tCaseManagerValidator.isCharAllowed(caseName);\n\t\t\tfail();\n\t\t} catch (ValidationException e) {\n\t\t}\n\t}", "public static boolean validaPlaca(String placa){\n\t\t if(placa.length() != 7){\n\t\t return false;\n\t\t }\n\t\t if(!placa.substring(0, 3).matches(\"[A-Z]*\")){\n\t\t return false;\n\t\t }\n\t\t return placa.substring(3).matches(\"[0-9]*\");\n\t}", "private static boolean nameIsValid(String name) {\n if (name.length() < 4 || name.length() > 11)\n return false;\n\n for (int i = 0; i < name.length(); i++) {\n int charIndex = name.charAt(i);\n\n // Each character can only be a letter or number\n if (charIndex < 48 || (charIndex > 57 && charIndex < 65) || (charIndex > 90 && charIndex < 97) || charIndex > 122)\n return false;\n }\n\n return true;\n }", "public static void m1555w(String str) {\n if (m1550n(5)) {\n Log.w(AdRequest.LOGTAG, str);\n }\n }", "void mo33731Pw();", "@Test\n public void shouldAbleToInputNumericCharactersInTradeInValueField() {\n\n//1. Enter 1 in the Trade-In Value field\n//2. Enter 12 in the Trade-In Value field\n//3. Enter 123 in the Trade-In Value field\n//4. Enter 1234 in the Trade-In Value field\n//5. Enter 12345 in the Trade-In Value field\n//6. Enter 123456 in the Trade-In Value field\n//7. Enter 1234567 in the Trade-In Value field\n//6. Enter 12345678 in the Trade-In Value field\n//6. Enter 12345678 in the Trade-In Value field\n\n }", "private static boolean isLegalIdentifier(String str) {\n if (\"\".equals(str)) {\n return false;\n }\n if (str.charAt(0) >= '0' & str.charAt(0) <= '9') {\n return false;\n }\n\n return str.matches(\"^\\\\w+$\");\n }", "public static String generateCoupon() {\n \t\t// choose a Character random from this String\n\t\tString availableCharacters = \"ABCDEFGHIJKLMNPQRSTUVWXYZ\" + \"123456789\";\n\t\t// create StringBuffer \n\t\tStringBuilder sb = new StringBuilder(5);\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\t// generate a random number\n\t\t\tdouble indexDouble = availableCharacters.length() * Math.random();\n\t\t\tint index = (int)Math.round(indexDouble);\n\t\t\tif(index > 0 && index < 33) {\n\t\t\t\tsb.append(availableCharacters.charAt(index));\n\t\t\t}\n\t\t}\n\t\treturn sb.toString().substring(0,10);\t\t\n\t}", "protected static String removeBannedCharacters(String st) {\n return st.replaceAll(\"[^A-Za-z]\", \"\");\n }", "public static void main(String[] args) throws Exception {\n String patronA = \"[0-5]\";\n\n // conjunto de letras de \"a\" a \"c\"\n String patronB = \"[a-c]\";\n\n // conjunto de todas las letras minusculas\n String patronC = \"[a-z]\";\n\n // conjunto de numeros\n String patronD = \"[0-9]\";\n\n // ejemplo con tipo de dato string\n String textoAlfanumerico = \"0123aaaa\";\n System.out.println(\"Texto alfanumerico:\" + textoAlfanumerico);\n\n String replace1 = textoAlfanumerico.replaceAll(patronA, \"X\");\n System.out.println(\"Reemplazo de numeros con X: \" + replace1);\n\n String replace2 = textoAlfanumerico.replaceAll(patronB, \"X\");\n System.out.println(\"Reemplazo de letras con X: \" + replace2);\n\n\n //[0-5][a-c];\n //String patronComplejo = patronA + patronB;\n\n //[a-c]*[0-5]*\n //String patronComplejo = patronA + \"*\" + patronB + \"*\";\n\n //\"[a-z]+\"\n\n // + = una coincidencia\n // * = ninguna o muchas\n\n //String patronComplejo = \"(\" + patronA + patronC + \")+\";\n String patronComplejo = \"(\" + patronC + \")+\";\n\n String texto = \"hola, aacc este bbcc es mi 55222aaa texto 2663aaaa blah blah\";\n System.out.println(\"patron complejo:\" + patronComplejo);\n System.out.println(texto);\n\n Pattern pattern = Pattern.compile(patronComplejo);\n Matcher matcher = pattern.matcher(texto);\n\n // buscar ocurrencias\n while (matcher.find()) {\n System.out.println(\"Encontrado:\" + matcher.group());\n }\n\n\n }", "@org.junit.Test\n public void everyNthChar() {\n }", "@Test\n public void shouldRetainDigitsAndWhiteSpace() {\n Assert.assertThat(\"match any digits\",CharMatcher.DIGIT.or(CharMatcher.WHITESPACE)\n .retainFrom(\"123TT T4\"),is(\"123 4\"));\n }", "private static String create50DigitString(){\n StringBuilder sb = new StringBuilder(\"1\");\n for(int i = 1; i < 50; i++){\n sb.append(\"0\");\n }\n return sb.toString();\n }", "public static void main(String[] args) {\n //The letters are randomly chosen through this block of code with use of ASCII code.\n char let1 = (char) ((int)(Math.random() * 26 + 65));\n char let2 = (char) ((int)(Math.random() * 26 + 65));\n char let3 = (char) ((int)(Math.random() * 26 + 65));\n \n //This generates a number of four digits to follow the letters. \n int num = (int)(Math.random() * 9000 + 999);\n \n //The combination is now printed to the screen through this. \n System.out.println(\"The plate number is \" + let1 + let2 +let3 + num); \n }", "@BeforeEach\n\tvoid setUpValidRE(){\n\t\tvalidRE= new String[lengthValid];\n\t\t// ab\n\t\tvalidRE[0] = \"ab\";\n\t\t// (ab)\n\t\tvalidRE[1] = \"(ab)\";\n\t\t//(ab)*\n\t\tvalidRE[2] = \"(ab)*\";\n\t\t// a???\n\t\tvalidRE[3] = \"a???\";\n\t\t// a***\n\t\tvalidRE[4] = \"a***\";\n\t\t// a+++\n\t\tvalidRE[5] = \"a+++\";\n\t\t// (((a)))\n\t\tvalidRE[6] = \"(((a)))\";\n\t\t// (a | ab | c*)*\n\t\tvalidRE[7] = \"(a | ab | c*)*\";\n\t\t// (a | ab | c*)**??\n\t\tvalidRE[8] = \"(a | ab | c*)*??\";\n\t\t// ( a | (ab | cd)+ )+\n\t\tvalidRE[9] = \"(a | (ab | cd)+)+\";\n\t\t// 0 (01 | (02) * | (03)++) | (1?01?)\n\t\tvalidRE[10] = \"0 (01 | (02) * | (03)++) | (a?01?)\";\n\t\t// a | &\n\t\tvalidRE[11] = \"a | &\";\n\t\t// &*\n\t\tvalidRE[12] = \"&*\";\n\t\t// (())* (empty language)\n\t\tvalidRE[13] = \"(())*\";\n\t\t// (a*b)*\n\t\tvalidRE[14] = \"(a*b)*\";\n\t\t// (a | & | a*b?c+)*\n\t\tvalidRE[15] = \"(a | & | a*b?c+)*\";\n\t}", "@Test\n public void shouldNotBeAbleToInputSpecialCharactersInAmountOwedOnTradeField() {\n }", "public abstract C0690a mo9258k(String str);", "public static String rndString(int length, String type, char[] cc) {\r\n char min = ' ';\r\n char max = ' ';\r\n if (type.trim().equals(LATIN_LARGE)) {\r\n min = 'A';\r\n max = 'Z';\r\n } else if (type.trim().equals(LATIN_SMALL)) {\r\n min = 'a';\r\n max = 'z';\r\n } else if (type.trim().equals(DIGITS)) {\r\n min = '0';\r\n max = '9';\r\n }\r\n String CC = new String(cc);\r\n CC = shaffleString(CC);\r\n char[] c = RBytes.rndCharArray(length, min, max);\r\n if (min != max) {\r\n return new String(c) + CC;\r\n }\r\n\r\n return CC;\r\n }", "private final String getRandomString() {\n StringBuffer sbRan = new StringBuffer(11);\n String alphaNum = \"1234567890abcdefghijklmnopqrstuvwxyz\";\n int num;\n for (int i = 0; i < 11; i++) {\n num = (int) (Math.random() * (alphaNum.length() - 1));\n sbRan.append(alphaNum.charAt(num));\n }\n return sbRan.toString();\n }", "public abstract String mo24851a(String str);", "private String newPassword() {\n\t\tchar[] vet = new char[10];\n\t\tfor(int i=0; i<10; i++) {\n\t\t\tvet[i] = randomChar();\n\t\t}\n\t\treturn new String(vet);\n\t}", "static int twoCharaters(String s) {\n\t\tList<String> list = Arrays.asList(s.split(\"\"));\n\t\tHashSet<String> uniqueValues = new HashSet<>(list);\n\t\tSystem.out.println(uniqueValues);\n\t\tString result;\n\t\twhile(check(list,1,list.get(0))) {\n\t\t\tresult = replace(list,1,list.get(0));\n\t\t\tif(result != null) {\n\t\t\t\tSystem.out.println(result);\n\t\t\t\ts = s.replaceAll(result,\"\");\n\t\t\t\tlist = Arrays.asList(s.split(\"\"));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t\treturn 5;\n }", "public static String[] generateRegularAlphabet()\n {\n String[] regularAlphabet = new String[26];\n for(int index = 0; index<regularAlphabet.length; index++)\n {\n regularAlphabet[index] = (char)(index+65) + \"\";\n }\n return regularAlphabet;\n }", "public static boolean validigits(String pass){\n\t\tif (pass.length()>=8){\n\t\t\treturn true;\n\t\t}\n\t\telse \n\t\t\treturn false;\n\t}", "public C3244x1 mo12668c(String str) {\n C3244x1 x1Var = new C3244x1();\n String lowerCase = str.trim().toLowerCase();\n String str2 = lowerCase;\n for (String replace : f11727c) {\n str2 = str2.replace(replace, \"\");\n }\n try {\n if (str2.length() > 512) {\n str2 = str2.substring(0, C0753l.f3451u);\n StringBuilder sb = new StringBuilder();\n sb.append(str2);\n sb.append(\"... exceeds the limit of \");\n sb.append(512);\n sb.append(\" chars. Trimmed\");\n x1Var.mo12658a(sb.toString());\n x1Var.mo12656a(521);\n }\n } catch (Exception unused) {\n }\n x1Var.mo12657a((Object) str2);\n return x1Var;\n }" ]
[ "0.59685236", "0.59402144", "0.5880569", "0.5849386", "0.56389856", "0.5616063", "0.5588638", "0.55811775", "0.55776256", "0.5560203", "0.5560039", "0.55508304", "0.5547023", "0.55462235", "0.55400115", "0.55097795", "0.5505419", "0.550337", "0.5491488", "0.5450988", "0.5434156", "0.5427742", "0.53942436", "0.5380556", "0.53703463", "0.5363576", "0.5350923", "0.5325151", "0.5316922", "0.53137904", "0.5310835", "0.5303645", "0.5290419", "0.52844256", "0.5282891", "0.5281115", "0.52800906", "0.5277916", "0.5271947", "0.52676517", "0.52568305", "0.525642", "0.52509975", "0.52484757", "0.52482074", "0.5246828", "0.5243692", "0.52420956", "0.5235961", "0.52345616", "0.5232182", "0.5231611", "0.52282", "0.52254945", "0.52246773", "0.52203804", "0.5220145", "0.521498", "0.5209667", "0.5207291", "0.52040124", "0.5201481", "0.5200657", "0.5196163", "0.51923484", "0.5190871", "0.5187608", "0.5180868", "0.5179648", "0.517849", "0.5178308", "0.51770556", "0.51736045", "0.51711524", "0.5167811", "0.5166648", "0.5162001", "0.5160469", "0.51601917", "0.51597655", "0.51576227", "0.51509815", "0.5146301", "0.5142802", "0.5141555", "0.51412195", "0.5139638", "0.51395255", "0.51374215", "0.512887", "0.5127764", "0.51251346", "0.5125033", "0.51239544", "0.5123278", "0.51218754", "0.51217216", "0.51179856", "0.51173437", "0.5117203", "0.51137584" ]
0.0
-1
clicking on the buttons
public RegistrationRutPage clickOnAddUserButton() { Log.info("Clicking on Add user button"); clickElement(addUserButton); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void click() {\n\t\tSystem.out.println(\"LinuxButton Click\");\r\n\t}", "public void buttonClicked();", "protected void onClick() {\n for(Runnable action : onClick) action.run();\n }", "private void button1MouseClicked(MouseEvent e) {\n\t}", "public void click(){\n\t\t\n\tfor(MouseListener m: listeners){\n\t\t\t\n\t\t\tm.mouseClicked();\n\t\t}\n\t\t\n\t}", "@Override\n public void mouseClicked(MouseEvent e) {\n System.out.println(\"MouseClicked\");\n //kwadrat.clicked();\n trojkat.clicked();\n //kolo.clicked();\n //square.clicked();\n }", "public void clickgoButton(){\n \n \t \n driver.findElement(By.cssSelector(goButton)).click();\n }", "public void mouseClicked(int ex, int ey, int button) {\r\n\t}", "void clickSomewhereElse();", "private void button1MouseClicked(MouseEvent e) {\n }", "public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\trb.performClick();\n\t\t\t\t\t}", "public void clickFirstQviewbutton(){\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:- Qview First Buy button should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\t/*List<WebElement> eles=driver.findElements((locator_split(\"btnQview\")));\r\n\t\t\tSystem.out.println(eles.size());\r\n\t\t\teles.get(0).click();*/\r\n\r\n\t\t\tclick(locator_split(\"btnQview\"));\t\t\t\t\r\n\t\t\tSystem.out.println(\"Clicked on the First Buy button\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- First Buy Button is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Qview First Buy button is not clicked or Not Available\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btnQview\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tclickMulti();\n\t\t\t}", "@Override\n\tprotected void OnClick() {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[0])){\n\t\t\tperformButton(0);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[1])){\n\t\t\tperformButton(1);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[2])){\n\t\t\tperformButton(2);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[3])){\n\t\t\tperformButton(3);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[4])){\n\t\t\tperformButton(4);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[5])){\n\t\t\tperformButton(5);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[6])){\n\t\t\tperformButton(6);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[7])){\n\t\t\tperformButton(7);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[8])){\n\t\t\tperformButton(8);\n\t\t}\n\t}", "public void clickYes ();", "public void clickBulkActions() {\n btnBulkActions.click();\n }", "@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}", "protected void doScreenClick() {\r\n\t\tbtnColonyInfo.visible = btnButtons.down;\r\n\t\tbtnPlanet.visible = btnButtons.down;\r\n\t\tbtnStarmap.visible = btnButtons.down;\r\n\t\tbtnBridge.visible = btnButtons.down;\r\n\t\trepaint();\r\n\t}", "@Override\n public void mouseClicked(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n System.out.println(\" Mouse: Click \" + boton ); \n }", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tSystem.out.println(\"vai ficar clikando ai a toa? PATETA\");\n\t\t\t\t\n\t\t\t}", "public void btn_LearningActivity() {\r\n\t\tbtn_LearningActivity.click();\r\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Test\n public final void testClickButton() {\n spysizedialog.getStartButton().doClick();\n }", "@Override\n public void onClick(View view) {\n Button trykket = null;\n for (int i = 0; i < 30 ; i++) {\n if (view==buttons.get(i)){\n trykket=buttons.get(i);\n }\n }\n assert trykket != null;\n gæt(trykket);\n\n //vi afslutter spiller hvis det er slut eller vundet.\n if(logik.erSpilletSlut()){\n if(logik.erSpilletTabt()){\n // die.start();\n slutspilllet(false);\n }\n if(logik.erSpilletVundet()) slutspilllet(true);\n }\n\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 mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void testCheckButtons() {\n onView(withId(R.id.quiz_button)).perform(click());\n pressBack();\n onView(withId(R.id.flash_button)).perform(click());\n pressBack();\n onView(withId(R.id.quiz_button)).perform(click());\n onView(withId(R.id.quiz_make)).perform(click());\n pressBack();\n onView(withId(R.id.quiz_take)).perform(click());\n onView(withId(R.id.quiz_all)).perform(click());\n onView(withId(R.id.homeButton)).perform(click());\n\n\n }", "public void mouseClicked(MouseEvent e) \t{\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void onClick() {\n\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void onClick() {\n\r\n\t\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void mousePressed(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n //System.out.println(\"->Mouse: Presionando Click \" + boton );\n }", "public void mouseClicked(MouseEvent e) {\n\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "public void mouseClicked() {\n\t\tswitch(screen) {\n\t\t\n\t\t// Pantalla Home\n\t\tcase 0:\n\t\t\tif((mouseX > 529 && mouseY > 691) && (mouseX < 966 & mouseY < 867)) {\n\t\t\t\t//si hace click adentro del boton de jugar\n\t\t\t\tscreen = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t// Pantalla Instrucciones\n\t\tcase 1:\n\t\t\t//si hace click adentro de la pantalla\n\t\t\tscreen = 2;\n\t\t\tbreak;\n\t\t}\n\t}", "void clickAmFromMenu();", "public void click() {\n\t\tif(this.buttonListener != null) {\n\t\t\tthis.buttonListener.onClicked();\n\t\t}\n\t}", "@Override\n\tpublic void onClick() {\n\t\t\n\t}", "public void clickLikeBtn() {\n likeBtn.click();\n }", "public void mouseClicked(MouseEvent e) {\n\n }", "public void mouseClicked(MouseEvent e) {\n \t\t\r\n \t}", "public void ButtonStatusToOneWay() throws InterruptedException {\n\n Thread.sleep(10000);\n //action=new Actions(this.driver);\n if (oneWayButton.isSelected()) {\n System.out.println(\"One way Button is already selected\");\n } else {\n wait.until(ExpectedConditions.elementSelectionStateToBe(oneWayButton,false));\n oneWayButton.click();\n System.out.println(\"one way button is clicked\");\n }\n\n\n }", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\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}", "protected void mouseClicked(int par1, int par2, int par3)\n {\n if (this.buttonId >= 0)\n {\n \t// no setting minimap keybinds to mouse button. Can do so if wanted if I change ZanMinimap to not send every input to Keyboard for processing. Check if it's mouse first\n // this.options.setKeyBinding(this.buttonId, -100 + par3);\n // ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);\n this.buttonId = -1;\n // KeyBinding.resetKeyBindingArrayAndHash();\n }\n else\n {\n super.mouseClicked(par1, par2, par3);\n }\n }", "@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tUI.getCurrent().getNavigator().navigateTo(\"CliPantallaBusquedaExpedientes\");\t \n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "public void Open() {\r\n\t click();\r\n\t }", "public void onClicked();", "void onClick();", "public void performClick() {\n\t\tgetWrappedElement().click();\n\t}", "@Override\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\n\t\t\t\t}", "private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {\n }", "public void click(int mouseButton){\n\n if(mouseButton ==1){\n for (int i = 0; i <buttons.length ; i++) {\n //if click was registered on a button\n if(buttons[i].contains(Game.mousePoint)){\n int j = i +1;\n\n if(i == 0 && !(noOfCredits - Translator.pitifullPrice < 0)){\n noOfCredits -= Translator.pitifullPrice;\n army.addToArmyQueue(TrooperType.PITIFUL);\n\n }\n if(i == 1 && !(noOfCredits -\n Translator.armoredTrooperPrice < 0)){\n noOfCredits -= Translator.armoredTrooperPrice;\n army.addToArmyQueue(TrooperType.ARMORED);\n }\n if(i == 2 && !(noOfCredits -\n Translator.teleporterPrice < 0)){\n noOfCredits -= Translator.teleporterPrice;\n army.addToArmyQueue(TrooperType.TELEPORTER);\n }\n if(i==3){\n for (Trooper t:army.getArmy()) {\n if(t.getClass().equals(TeleportTrooper.class)){\n TeleportTrooper tp = (TeleportTrooper)t;\n if(tp.hasTeleport()) {\n Game.air[t.getPosition().getX()]\n [t.getPosition().getY()] =\n Translator.indexTeleportZone;\n tp.placePortal(tp.getDirection());\n Game.air[t.getPosition().getX()]\n [t.getPosition().getY()] =\n Translator.indexTeleporterZoneOut;\n }\n }\n }\n }\n if(i==4){\n if(army != null && army.getPreferred() == null\n || army.getPreferred() == Direction.RIGHT) {\n buttons[i].setIsSelected(true);\n buttons[i+1].setIsSelected(false);\n army.setPreferred(Direction.LEFT);\n }\n else if(army.getPreferred().equals(Direction.LEFT)){\n buttons[i].setIsSelected(false);\n army.setPreferred(null);\n }\n }\n if(i==5){\n if(army != null && army.getPreferred() == null\n || army.getPreferred() == Direction.LEFT) {\n army.setPreferred(Direction.RIGHT);\n buttons[i].setIsSelected(true);\n buttons[i-1].setIsSelected(false);\n }\n else if(army.getPreferred().equals(Direction.RIGHT)){\n army.setPreferred(null);\n buttons[i].setIsSelected(false);\n }\n }\n }\n }\n }\n }", "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}", "public final void click() {\n getUnderlyingElement().click();\n }", "private void button1MousePressed(MouseEvent e) {\n }", "public void clickOnLoginButton(){\n\t\tthis.loginButton.click();\n\t}", "public void mouseClicked(MouseEvent e) {\r\n\t}", "public void clickLoginBtn() {\r\n\t\tthis.loginBtn.click(); \r\n\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "public void clickSearchButton() {\n\t\tsearchButton.click();\n\t}", "@Override\r\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tprotected void setOnClickForButtons() {\n\t\tthis.buttons[0].setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(getActivity(), MainScreenActivity.class);\n\t\t\t\tstartActivity(i);\n\t\t\t\tMainFunctions.selectedOption = 1;\n\t\t\t\tdestroyServices();\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\n\t\t/* message box - onclick event */\n\t\tthis.buttons[1].setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdestroyServices();\n\t\t\t\tMainFunctions.selectedOption = 2;\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\t\t\n\t\t/* one tick sound */\n\t\tfor (int i = 0; i < this.totalButtons; i++){\n\t\t\tfinal String desc = buttons[i].getTag().toString();\n\t\t\tbuttons[i].setOnFocusChangeListener(new View.OnFocusChangeListener() {\n\t\t\t\tpublic void onFocusChange(View v, boolean hasFocus) {\n\t\t\t\t\tif (hasFocus) {\n\t\t\t\t\t\tLog.i(TAG, \"Button \" + desc + \" was selected\");\n\t\t\t\t\t\tlogFunctions.logTextFile(\"Button \" + desc + \" was selected\");\n\t\t\t\t\t\tspeakButton(desc, 1.0f, 1.0f);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "@Override\n public void onBoomButtonClick(int index) {\n }", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\t\r\n\t\t\t\t}", "private void cs1() {\n\t\t\tctx.mouse.click(675,481,true);\n\t\t\t\n\t\t}", "private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {\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}", "private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {\n }", "private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {\n }", "@Override\n public void onClick() {\n }" ]
[ "0.71963924", "0.7182013", "0.717067", "0.71462506", "0.71356565", "0.7122098", "0.6996352", "0.6990564", "0.6989841", "0.6968635", "0.69476354", "0.69194686", "0.68894464", "0.68520224", "0.68369675", "0.6835636", "0.67991537", "0.6792789", "0.67749774", "0.6770518", "0.67514867", "0.6748091", "0.6741438", "0.673857", "0.67285925", "0.67171794", "0.6715604", "0.67129457", "0.6707612", "0.6707612", "0.6707612", "0.67005557", "0.66951203", "0.6684876", "0.6684876", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.6682873", "0.66704994", "0.6668627", "0.6668627", "0.666341", "0.66566366", "0.66525996", "0.6649371", "0.66308236", "0.66295403", "0.6629401", "0.6627553", "0.66251177", "0.6621882", "0.6621882", "0.6620055", "0.661873", "0.6616871", "0.6616222", "0.6616222", "0.66157603", "0.6599888", "0.6598637", "0.65838957", "0.65809506", "0.65800154", "0.65800154", "0.6574667", "0.6572336", "0.65654457", "0.6562858", "0.6559934", "0.65481156", "0.65476125", "0.65438414", "0.65402555", "0.6539315", "0.6539315", "0.6533442", "0.6531329", "0.65269566", "0.65269566", "0.65269566", "0.65257186", "0.65257186", "0.65257186", "0.65236", "0.6522443", "0.6515181", "0.65142536", "0.6512304", "0.6511497", "0.6511125", "0.6508434", "0.6508434", "0.65033454" ]
0.0
-1
Sets upp a clip for treePane
private void initializeTreePane() { Rectangle clipRect = new Rectangle(treePane.getWidth(), treePane.getHeight()); clipRect.heightProperty().bind(treePane.heightProperty()); clipRect.widthProperty().bind(treePane.widthProperty()); treePane.setClip(clipRect); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PaneOrganizer() {\n\t\t\n\t\t_root = new BorderPane();\n\t\t_game = new Game(_root);\n\t\tthis.setupButton();\n\t\t\n\t}", "public void setClip(Shape clip)\r\n\t{\r\n\t\tg.setClip(clip);\r\n\t}", "private void initPane() {\n\t\tContainer localContainer = getContentPane();\n\t\tlocalContainer.setLayout(new BorderLayout());\n\t\t\n\t\tsplitpane_left_top.setBorder(BorderFactory.createTitledBorder(\"Training Data\"));\n\t\tsplitpane_left_bottom.setBorder(BorderFactory.createTitledBorder(\"Tree View\"));\n\t\tsplitpane_left.setDividerLocation(400);\n\t\tsplitpane_left.setLastDividerLocation(0);\n\t\tsplitpane_left.setOneTouchExpandable(true);\n\t\tsplitpane_right.setBorder(BorderFactory.createTitledBorder(\"Classifer Output\"));\n\t\tsplitpane_main.setDividerLocation(500);\n\t\tsplitpane_main.setLastDividerLocation(0);\n\t\tsplitpane_main.setOneTouchExpandable(true);\n\t\tlocalContainer.add(splitpane_main, \"Center\");\n\t\tlocalContainer.add(statusPanel,BorderLayout.SOUTH);\n\t}", "@Override\n public void start(Stage primaryStage) {\n \n tabPane = new TabPane();\n tree = new OwnTreeView(tabPane, new OwnTreeItem());\n tabs = new OwnTabs(tree,tabPane);\n areas = new OwnTextAreas(tree,tabPane);\n projects = new Projects();\n file = new OwnFile(areas,tabs,tree,projects);\n areas.setTabs(tabs);\n tabs.setAreas(areas);\n tree.setAreas(areas);\n tree.setTabs(tabs);\n\n //Creo un array de separadores de menuitems\n for (int i = 0; i < separate.length; i++) {\n separate[i] = new SeparatorMenuItem();\n }\n\n Point3D punto = new Point3D(0, 0, 1);\n\n //Panel que contiene todos los demás contenidos\n root = new BorderPane();\n root.autosize();\n root.setMaxHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setMaxWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setMinHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setMinWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setPrefHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setPrefWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setScaleX(1);\n root.setScaleY(1);\n root.setScaleZ(1);\n root.setRotationAxis(punto);\n\n //Barra principal con las pestañas de los menús\n bar = new MenuBar();\n bar.autosize();\n bar.setMaxHeight(MenuBar.USE_COMPUTED_SIZE);\n bar.setMaxWidth(MenuBar.USE_COMPUTED_SIZE);\n bar.setMinHeight(24);\n bar.setMinWidth(MenuBar.USE_COMPUTED_SIZE);\n bar.setPrefHeight(22);\n bar.setPrefWidth(1024);\n bar.setScaleX(1);\n bar.setScaleY(1);\n bar.setScaleZ(1);\n bar.setRotationAxis(punto);\n\n //Menús\n menuFile = new Menu(\"Archivo\");\n\n //MenuItems del menú \"Archivo\"\n open = new MenuItem(\"Abrir Ctrl+O\");\n open.getStyleClass().add(\"menuitem\");\n /**\n * Abre un archivo en un nuevo tab que crea y escribe el texto de dicho\n * archivo en el area correspondiente al tab seleccionado, que es el tab\n * creado. ATAJO : CTRL+0\n */\n open.setOnAction(_openFile = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n\n file.open();\n }\n });\n \n /*\n * Abre un proyecto seleccionado,con todas sus subcarpetas\n * y archivos llamando a la función abrirProyecto(explicada mas abajo)\n */\n openProject = new MenuItem(\"Abrir proyecto\");\n openProject.getStyleClass().add(\"menuitem\");\n openProject.setOnAction(_projectOpen = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.openProject();\n }\n });\n /**\n * Guarda un archivo, en el caso de que el archivo haya sido abierto y\n * ya existiese, se guardará en la dirección que le corresponda, en el\n * caso de que no existiese se llamará a la función guardarComo\n * guardandose en la dirección que se le indique. ATAJO : CTRL + S\n */\n save = new MenuItem(\"Guardar Ctrl+S\");\n save.getStyleClass().add(\"menuitem\");\n save.setOnAction(_saveFile = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.save();\n }\n });\n\n /**\n * Guarda un archivo en una dirección determinada, ya estuviese o no\n * creado el archivo, al realizar el guardado con otro nombre\n * actualizara el nombre del tab y el nombre que aparezca en el\n * TreeView.\n */\n saveAs = new MenuItem(\"Guardar Como...\");\n saveAs.getStyleClass().add(\"menuitem\");\n saveAs.setOnAction(_asSave = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.saveAs();\n }\n });\n\n /**\n * Cierra el programa JavEditor\n */\n close = new MenuItem(\"Cerrar\");\n close.getStyleClass().add(\"menuitem\");\n close.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n System.exit(0);\n }\n });\n\n /**\n * Abre una nueva pestaña para crear un nuevo archivo. ATAJO : CTRL+N\n */\n newTab = new MenuItem(\"Nuevo Archivo Ctrl+N\");\n newTab.getStyleClass().add(\"menuitem\");\n newTab.setOnAction(_tabNew = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n tabs.newTab(_isForOpen);\n }\n });\n \n\n /*\n * Cierra el tab que se encuentra seleccionado. Buscamos el tab seleccionado, y cuando lo encontramos\n * borramos del TreeView el nombre del archivo correspondiente con actualizarArbol, y eliminamos\n * la posición creada para la dirección del archivo, el area y el tab de las listas tabs y areas, \n * a parte de eliminarlo del tabPane ya que al ser un atajo no se realiza por defecto. ATAJO : CTRL+A\n */\n closeFile = new MenuItem(\"Cerrar Archivo Ctrl+T\");\n closeFile.getStyleClass().add(\"menuitem\");\n closeFile.setOnAction(_fileClose = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n String s;\n boolean noestab = false;\n OwnTextArea a = areas.seleccionarArea();\n if(areas.isModificated(a)){\n int n = JOptionPane.showConfirmDialog(null, \"Do you want save the file?\");\n if(n==JOptionPane.CANCEL_OPTION){\n return;\n }else if(n==JOptionPane.YES_OPTION){\n _asSave.handle(null);\n }\n }\n for(int i=0;i<tabs.size();i++){\n if(!tabs.get(i).isSelected()){\n continue;\n }else{\n tree.getItems().getChildren().remove(tabs.get(i).getTreeItem());\n tabPane.getTabs().remove(tabs.get(i));\n areas.remove(a);\n tabs.remove(tabs.get(i));\n break;\n }\n }\n }\n });\n\n /*\n * Cierra todos los tabs abiertos del programa, recorre todos los tabs del tabPane y los va eleminando\n * de la lista uno por uno, ademas, se borran las correspondientes direcciones de archivos guardadas y\n * las areas creadas para los tabs.Además se van borrando los nombres del TreeView\n */\n closeAll = new MenuItem(\"Cerrar Todo Ctrl+Q\");\n closeAll.getStyleClass().add(\"menuitem\");\n closeAll.setOnAction(_allClose = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n int longitudTabPane = tabPane.getTabs().size();\n for (int i = 0; i < longitudTabPane; i++) {\n OwnTextArea a = areas.seleccionarArea();\n if(areas.isModificated(a)){\n int n = JOptionPane.showConfirmDialog(null, \"Do you want save the file?\");\n if(n==JOptionPane.CANCEL_OPTION){\n return;\n }else if(n==JOptionPane.YES_OPTION){\n _asSave.handle(null);\n }\n }\n if (tree.getItems().getChildren().size() > 0) {\n tree.getItems().getChildren().remove(0);\n }\n tabPane.getTabs().remove(0);\n }\n for (int i = 0; i < tabs.size(); i++) {\n tabs.remove(0);\n areas.remove(0);\n }\n }\n });\n menuFile.getItems().addAll(newTab, separate[0], open, openProject, save, saveAs, separate[1], closeFile, closeAll, separate[2], close);\n menuFile.getStyleClass().add(\"menu\");\n menuEdit = new Menu(\"Edición\");\n\n //Submenús de \"Edición\"\n undo = new MenuItem(\"Deshacer Ctrl+Z\");\n /*\n * Deshace la acción previa hecha\n */\n undo.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.undo();\n }\n });\n\n selectAll = new MenuItem(\"Seleccionar Todo Ctrl+A\");\n\n /*\n * Selecciona todo el texto del area del tab en el que se encuentra en el momento\n */\n selectAll.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.selectAll();\n }\n });\n\n deselect = new MenuItem(\"Deseleccionar\");\n /*\n * Deselecciona lo seleccionado previamente\n */\n deselect.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.deselect();\n }\n });\n\n cut = new MenuItem(\"Cortar Ctrl+X\");\n /*\n * Corta lo seleccionado, elimina de la pantalla lo seleccionado, almacenandolo en la variable seleccion\n * para su posible posterior pegado\n */\n cut.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.cut();\n }\n });\n\n copy = new MenuItem(\"Copiar Ctrl+C\");\n /**\n * Copia lo seleccionado, almacena dicha selección en la variable\n * seleccion para su posible posterior pegado\n */\n copy.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.copy();\n }\n });\n\n paste = new MenuItem(\"Pegar Ctrl+V\");\n /*\n * Añade al texto del area del tab seleccionado lo que se encuentra en la variable selección.\n */\n paste.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.paste(); \n }\n });\n\n delete = new MenuItem(\"Eliminar\");\n /*\n * Elimina lo seleccionado, a diferencia de cortar, este no guarda el texto en ninguna variable.\n */\n delete.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.delete();\n }\n });\n\n menuEdit.getItems().addAll(undo, separate[3], copy, cut, paste, delete, separate[4], selectAll,deselect);\n menuHelp = new Menu(\"Ayuda\");\n\n //Submenús de \"Ayuda\"\n about = new MenuItem(\"Sobre JavEditor\");\n\n /*\n * Abre una nueva ventana donde se da información de JavEditor\n */\n about.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n Stage stage = new Stage();\n About sobre = new About();\n sobre.start(stage);\n }\n });\n\n menuHelp.getItems().addAll(about);\n menuPreferences = new Menu(\"Preferencias\");\n\n //SubMenús de \"Preferencias\"\n font = new MenuItem(\"Fuente\");\n menuPreferences.getItems().addAll(font);\n bar.getMenus().addAll(menuFile, menuEdit, menuPreferences, menuHelp);\n\n //TabPane\n \n tabPane.getStyleClass().add(\"tabpane\");\n tabPane.autosize();\n tabPane.setLayoutX(0);\n tabPane.setLayoutY(24);\n tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.ALL_TABS);\n tabPane.setMinHeight(TabPane.USE_COMPUTED_SIZE);\n tabPane.setMinWidth(TabPane.USE_COMPUTED_SIZE);\n tabPane.setPrefHeight(378);\n tabPane.setPrefWidth(600);\n tabPane.setScaleX(1);\n tabPane.setScaleY(1);\n tabPane.setScaleZ(1);\n tabPane.setRotationAxis(punto);\n tabPane.setPrefWidth(1024);\n\n //TreeView\n \n tree.createChilds();\n tree.setPrefHeight(20);\n tree.getStyleClass().add(\"tree-view\");\n \n \n //Si una tecla es pulsada se almacena el codigo en la lista codigoTeclas y si hay mas de 1\n //se realiza la comprobacion de las teclas pulsadas.\n root.setOnKeyPressed(new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent event) {\n keyCodes.add(event.getCode());\n if (keyCodes.size() > 1) {\n comprobarTeclas();\n }\n }\n });\n //Si alguna tecla se suelta deja de ser pulsada se elimina de la lista\n root.setOnKeyReleased(new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent event) {\n keyCodes.remove(event.getCode());\n }\n });\n\n //El panel de tabs y la barra de herramientas se añaden al panel root\n root.setLeft(tree);\n root.setTop(bar);\n root.setCenter(tabPane);\n \n \n Scene scene = new Scene(root);\n scene.getStylesheets().add(\"/JavEditor/JavEditor.css\");\n Image imagen = new Image(\"JavEditor/Images/Icono.gif\", 10, 10, false, false);\n primaryStage.getIcons().add(imagen);\n primaryStage.setTitle(\"JavEditor\");\n primaryStage.setScene(scene);\n primaryStage.show();\n }", "private void initAdminCard(Pane root) {\n\t\t//Get stack pane\n\t\tfinal StackPane sp1 = (StackPane) root.lookup(\"#sp1\");\n\n\t\t//set depth\n\t\tJFXDepthManager.setDepth(sp1, 2);\n\t\tFont font = Font.font(\"Verdana\", FontWeight.BOLD, 15);\n\t\t// initialize Header\n\t\tStackPane header = new StackPane();\n\t\tLabel headerText = new Label(\"Administration\");\n\t\theaderText.setFont(font);\n\t\theaderText.setTextFill(Paint.valueOf(\"#FFF\"));\n\t\theader.getChildren().add(headerText);\n\t\theader.setStyle(\"-fx-background-radius: 5 5 0 0; -fx-background-color: \" + headerColor);\n\t\tVBox.setVgrow(header, Priority.ALWAYS);\n\n\t\t//Initialize body\n\t\tStackPane body = new StackPane();\n\t\tbody.setMinHeight(80);\n\t\t//Create Image For Icon\n\t\tImageView icon = new ImageView(new Image(this.getClass().getResourceAsStream(\"boss.png\")));\n\t\tStackPane.setAlignment(icon, Pos.CENTER);\n\t\tStackPane.setMargin(icon, new Insets(5, 5, 5, 5));\n\t\t//Add icon in body\n\t\tbody.getChildren().add(icon);\n\n\t\t//Create vbox for header and body\n\t\tVBox content = new VBox();\n\t\tJFXRippler ripper = new JFXRippler(content);\n\t\tcontent.getChildren().addAll(header, body);\n\t\tbody.setStyle(\"-fx-background-radius: 0 0 5 5; -fx-background-color: rgb(255,255,255,0.87);\");\n\n\t\t//Initialize Button\n\t\tJFXButton button = new JFXButton(\"\");\n\t\tbutton.setTooltip(new Tooltip(\"Login As Administrator\"));\n\t\tbutton.setButtonType(ButtonType.RAISED);\n\t\tbutton.setStyle(\"-fx-background-radius: 40;-fx-background-color: #01A05E\");\n\t\tbutton.setPrefSize(40, 40);\n\t\tbutton.setRipplerFill(Color.valueOf(headerColor));\n\t\tbutton.setScaleX(0);\n\t\tbutton.setScaleY(0);\n\n\t\t//Glyph icon\n\t\tSVGGlyph glyph = new SVGGlyph(-1, \"Login\",\n\t\t\t\t\"M1008 6.286q18.857 13.714 15.429 36.571l-146.286 877.714q-2.857 16.571-18.286 25.714-8 4.571-17.714 4.571-6.286 \"\n\t\t\t\t\t\t+ \"0-13.714-2.857l-258.857-105.714-138.286 168.571q-10.286 13.143-28 13.143-7.429 \"\n\t\t\t\t\t\t+ \"0-12.571-2.286-10.857-4-17.429-13.429t-6.571-20.857v-199.429l493.714-605.143-610.857 \"\n\t\t\t\t\t\t+ \"528.571-225.714-92.571q-21.143-8-22.857-31.429-1.143-22.857 18.286-33.714l950.857-548.571q8.571-5.143 18.286-5.143\" + \" 11.429 0 20.571 6.286z\",\n\t\t\t\tColor.WHITE);\n\t\tglyph.setSize(20, 20);\n\n\t\tbutton.setGraphic(glyph);\n\t\tbutton.translateYProperty().bind(Bindings.createDoubleBinding(() -> {\n\t\t\treturn header.getBoundsInParent().getHeight() - button.getHeight() / 2;\n\t\t}, header.boundsInParentProperty(), button.heightProperty()));\n\t\tStackPane.setMargin(button, new Insets(0, 12, 0, 0));\n\t\tStackPane.setAlignment(button, Pos.BOTTOM_RIGHT);\n\n\t\t//Create timeline for animation\n\t\tTimeline animation = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(button.scaleXProperty(), 1, javafx.animation.Interpolator.EASE_IN),\n\t\t\t\tnew KeyValue(button.scaleYProperty(), 1, javafx.animation.Interpolator.EASE_IN)));\n\t\tanimation.setDelay(Duration.millis(1000));\n\t\tanimation.play();\n\t\tsp1.getChildren().addAll(content, button, ripper);\n\n\t\t///Event on Button\n\t\tbutton.setOnAction(new EventHandler<ActionEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "public TreeScenery() {\r\n\t\tstopped = false;\r\n\t\tthis.position = new Vector2(0, 400);\r\n boundingRectangle = new Rectangle();\r\n treeAnimation = AssetLoader.treeAnimation;\r\n\t}", "private Parent content() {\r\n\r\n\t\t// Kujundus.\r\n\t\tBorderPane bp = new BorderPane();\r\n\r\n\t\tPane side = new Pane(controls);\r\n\t\tside.getStyleClass().add(\"pane\");\r\n\r\n\t\tPane window = new Pane();\r\n\t\twindow.setPrefSize(APP_W, APP_H);\r\n\t\twindow.getStyleClass().add(\"board\");\r\n\r\n\t\tbp.setCenter(window);\r\n\t\tbp.setLeft(side);\r\n\r\n\t\tGroup snakeBody = new Group();\r\n\t\tsnake = snakeBody.getChildren();\r\n\r\n\t\tpoints.setText(\"Points: \" + punktid);\r\n\t\tpoints.setTextFill(Color.WHITE);\r\n\t\tpoints.setTranslateX(APP_W / 1.15);\r\n\t\tpoints.setTranslateY(2);\r\n\t\tcontrols.setTextFill(Color.WHITE);\r\n\r\n\t\tLine rLine = new Line(APP_W, 0, APP_W, APP_H);\r\n\t\trLine.getStyleClass().add(\"line\");\r\n\t\trLine.setStrokeWidth(5);\r\n\t\tLine tLine = new Line(0, 0, APP_W, 0);\r\n\t\ttLine.getStyleClass().add(\"line\");\r\n\t\ttLine.setStrokeWidth(5);\r\n\t\tLine bLine = new Line(0, APP_H, APP_W, APP_H);\r\n\t\tbLine.getStyleClass().add(\"line\");\r\n\t\tbLine.setStrokeWidth(5);\r\n\r\n\t\t// Tekib toit.\r\n\t\tCircle food = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5);\r\n\t\tfood.setFill(Color.CHARTREUSE);\r\n\t\tfood.setTranslateX((int) (Math.random() * (APP_W - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);\r\n\t\tfood.setTranslateY((int) (Math.random() * (APP_H - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);\r\n\t\tRfood = 1;\r\n\r\n\t\t// Aja algus.\r\n\t\tKeyFrame frame = new KeyFrame(Duration.seconds(0.1), event -> {\r\n\t\t\tif (!running)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t// Kui ussi pikkus on 1 liigub ise edasi, kui 2 v�i enam v�tab\r\n\t\t\t// viimase t�ki ja t�stab ette.\r\n\t\t\tboolean toRemove = snake.size() > 1;\r\n\r\n\t\t\tNode tail = toRemove ? snake.remove(snake.size() - 1) : snake.get(0);\r\n\r\n\t\t\t// J�tan meelde ussi kordinaadid\r\n\t\t\tdouble tailX = tail.getTranslateX();\r\n\t\t\tdouble tailY = tail.getTranslateY();\r\n\r\n\t\t\t// kuhu ja kuidas uss liigub iga suuna korral\r\n\t\t\tswitch (direction) {\r\n\t\t\tcase UP:\r\n\t\t\t\ttail.setTranslateX(snake.get(0).getTranslateX());\r\n\t\t\t\ttail.setTranslateY(snake.get(0).getTranslateY() - BLOCK_SIZE);\r\n\t\t\t\tbreak;\r\n\t\t\tcase DOWN:\r\n\t\t\t\ttail.setTranslateX(snake.get(0).getTranslateX());\r\n\t\t\t\ttail.setTranslateY(snake.get(0).getTranslateY() + BLOCK_SIZE);\r\n\t\t\t\tbreak;\r\n\t\t\tcase LEFT:\r\n\t\t\t\ttail.setTranslateX(snake.get(0).getTranslateX() - BLOCK_SIZE);\r\n\t\t\t\ttail.setTranslateY(snake.get(0).getTranslateY());\r\n\t\t\t\tbreak;\r\n\t\t\tcase RIGHT:\r\n\t\t\t\ttail.setTranslateX(snake.get(0).getTranslateX() + BLOCK_SIZE);\r\n\t\t\t\ttail.setTranslateY(snake.get(0).getTranslateY());\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tmoved = true;\r\n\r\n\t\t\t// Lisame tagasi �rav�etud t�ki\r\n\t\t\tif (toRemove)\r\n\t\t\t\tsnake.add(0, tail);\r\n\r\n\t\t\t// Kui uss vastu iseennast\r\n\t\t\tfor (Node part : snake) {\r\n\t\t\t\tif (part != tail && tail.getTranslateX() == part.getTranslateX()\r\n\t\t\t\t\t\t&& tail.getTranslateY() == part.getTranslateY()) {\r\n\t\t\t\t\tstopGame();\r\n\t\t\t\t\tover.setTextFill(Color.WHITE);\r\n\t\t\t\t\tover.setText(\"GAME OVER !\");\r\n\t\t\t\t\tover.setTranslateX(APP_W / 2.5);\r\n\t\t\t\t\tover.setTranslateY(APP_H / 4);\r\n\t\t\t\t\tover.setVisible(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Kui uss l�heb vastu seina\r\n\t\t\t\tif (tail.getTranslateX() < 0 || tail.getTranslateX() == APP_W || tail.getTranslateY() < 0\r\n\t\t\t\t\t\t|| tail.getTranslateY() == APP_H) {\r\n\t\t\t\t\tstopGame();\r\n\t\t\t\t\tover.setTextFill(Color.WHITE);\r\n\t\t\t\t\tover.setText(\"GAME OVER ! \");\r\n\t\t\t\t\tover.setTranslateX(APP_W / 2.25);\r\n\t\t\t\t\tover.setTranslateY(APP_H / 4);\r\n\t\t\t\t\tover.setVisible(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Kui uss l�heb vastu boonus toitu\r\n\t\t\tif (tail.getTranslateX() == bonus.getTranslateX() && tail.getTranslateY() == bonus.getTranslateY()) {\r\n\t\t\t\tbonus.setVisible(false);\r\n\t\t\t\tbonus.isVisible();\r\n\t\t\t\tbonus.setDisable(true);\r\n\t\t\t\tbonus.isDisable();\r\n\r\n\t\t\t\tif (bonusFood == 1) {\r\n\r\n\t\t\t\t\tpunktid = punktid + 50;\r\n\t\t\t\t\tpoints.setText(\"Points: \" + punktid);\r\n\t\t\t\t\tpoints.setTextFill(Color.WHITE);\r\n\t\t\t\t\tpoints.setTranslateX(APP_W / 1.15);\r\n\r\n\t\t\t\t\tCircle circ2 = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5, Color.WHITE);\r\n\t\t\t\t\tcirc2.setTranslateX(tailX);\r\n\t\t\t\t\tcirc2.setTranslateY(tailY);\r\n\r\n\t\t\t\t\tCircle circ3 = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5, Color.WHITE);\r\n\t\t\t\t\tcirc3.setTranslateX(tailX);\r\n\t\t\t\t\tcirc3.setTranslateY(tailY);\r\n\r\n\t\t\t\t\tsnake.addAll(circ2, circ3);\r\n\t\t\t\t\tbonusFood = 0;\r\n\t\t\t\t\tRfood = 1;\r\n\t\t\t\t\tfood.setVisible(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (Rfood == 1) {\r\n\r\n\t\t\t\t// Kui uss l�heb vastu tavalist toitu\r\n\t\t\t\tif (tail.getTranslateX() == food.getTranslateX() && tail.getTranslateY() == food.getTranslateY()) {\r\n\t\t\t\t\tfood.setTranslateX((int) (Math.random() * (APP_W - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);\r\n\t\t\t\t\tfood.setTranslateY((int) (Math.random() * (APP_H - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);\r\n\r\n\t\t\t\t\tpunktid = punktid + 10;\r\n\t\t\t\t\tpoints.setText(\"Points: \" + punktid);\r\n\t\t\t\t\tpoints.setTextFill(Color.WHITE);\r\n\t\t\t\t\tpoints.setTranslateX(APP_W / 1.15);\r\n\t\t\t\t\tpoints.setTranslateY(2);\r\n\t\t\t\t\tCircle circ = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5, Color.WHITE);\r\n\t\t\t\t\tcirc.setTranslateX(tailX);\r\n\t\t\t\t\tcirc.setTranslateY(tailY);\r\n\r\n\t\t\t\t\t// Boonus toidu tekkimine\r\n\t\t\t\t\tif (7 < (int) (Math.random() * 10)) {\r\n\t\t\t\t\t\tRfood = 0;\r\n\t\t\t\t\t\tbonusFood = 1;\r\n\t\t\t\t\t\tbonus.setVisible(true);\r\n\t\t\t\t\t\tbonus.setDisable(false);\r\n\t\t\t\t\t\tbonus.getStyleClass().add(\"bonus\");\r\n\t\t\t\t\t\tbonus.setTranslateX((int) (Math.random() * (APP_W - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);\r\n\t\t\t\t\t\tbonus.setTranslateY((int) (Math.random() * (APP_H - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);\r\n\t\t\t\t\t\tfood.setVisible(false);\r\n\t\t\t\t\t\tfood.isVisible();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsnake.add(circ);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Keyframe k�ib l�pmatult\r\n\t\ttimeline.getKeyFrames().add(frame);\r\n\t\ttimeline.setCycleCount(Timeline.INDEFINITE);\r\n\r\n\t\twindow.getChildren().addAll(bonus, food, snakeBody, points, over, rLine, tLine, bLine);\r\n\t\treturn bp;\r\n\t}", "private Parent mainMenu() {\n BorderPane menu = new BorderPane();\n menu.setPrefSize(1200, 900);\n\n Image image = new Image(\"/menu.png\");\n ImageView img = new ImageView(image);\n img.setFitHeight(400);\n img.setFitWidth(400);\n\n\n //if cheat is on, user can see pieces on computer board --> for testing purposes\n cheatON.setToggleGroup(groupCheat);\n cheatOFF.setToggleGroup(groupCheat);\n HBox cheat = new HBox(cheatON, cheatOFF);\n cheatOFF.setSelected(true);\n //select difficulty\n easy.setToggleGroup(groupDiff);\n hard.setToggleGroup(groupDiff);\n HBox Diff = new HBox(easy, hard);\n hard.setSelected(true);\n\n Label welcome = new Label(\"Welcome!\");\n Label Cheat = new Label(\"Cheats\");\n Label diff = new Label(\"Difficulty\");\n\n Cheat.setAlignment(Pos.CENTER);\n cheat.setAlignment(Pos.CENTER);\n\n diff.setAlignment(Pos.CENTER);\n Diff.setAlignment(Pos.CENTER);\n\n\n HBox buttons = new HBox(40, startGame, exit);\n\n buttons.setAlignment(Pos.CENTER);\n\n menu.setStyle(\"-fx-background-color: #B5D3E7\");\n\n VBox difficulty = new VBox(5, diff, Diff);\n VBox cheater = new VBox(5, Cheat, cheat);\n difficulty.setAlignment(Pos.CENTER);\n cheater.setAlignment(Pos.CENTER);\n\n VBox vbox = new VBox(30, welcome, img, buttons, difficulty, cheater);\n vbox.setAlignment(Pos.CENTER);\n //use some CSS inline styling\n vbox.setStyle(\"-fx-background-image: url('/menu.png');\" +\n \"-fx-background-repeat: stretch;\" +\n \"-fx-background-size: 400 300;\" +\n \"-fx-background-position: center center;\"\n );\n menu.setCenter(vbox);\n\n\n return menu; //return root\n }", "@FXML private void setOval()\t\t{ pasteboard.setTool(Tool.Circle);\t\t}", "public void pridajPane() {\n\t\tmojPane.setAlignment(Pos.CENTER);\n\n\t\tmojPane.getChildren().addAll(informacia, vyberPredmetov, tabulkaZiak);\n\t}", "private void setTreePresenter() {\n this.tree.setIconProvider(new ModelIconProvider<GPBeanTreeModel>() {\n \n @Override\n public AbstractImagePrototype getIcon(GPBeanTreeModel model) {\n return model.getIcon();\n }\n });\n \n this.tree.setLabelProvider(new ModelStringProvider<GPBeanTreeModel>() {\n \n @Override\n public String getStringValue(GPBeanTreeModel model, String property) {\n return model.getLabel();\n }\n });\n \n this.tree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);\n \n this.tree.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<GPBeanTreeModel>() {\n \n @Override\n public void selectionChanged(\n SelectionChangedEvent<GPBeanTreeModel> se) {\n if (se.getSelectedItem() != null) {\n MediatorToolbarTreeAction.getInstance().elementChanged(se.getSelectedItem());\n } else {\n MediatorToolbarTreeAction.getInstance().disableAllActions();\n }\n \n }\n });\n this.setCheckable(true);\n this.setCheckStyle(CheckCascade.NONE);\n this.tree.setAutoHeight(true);\n }", "@Override\n\tpublic void setPane() {\n\t\tNewSchedulePane SchListPane = new NewSchedulePane();\n\t\trootPane = new HomePane(new MainLeftPane(),SchListPane);\n\t}", "private void mountTree() {\n if (tree != null) {\n treePane.getChildren().addAll(tree);\n }\n }", "public TreeObject(int x, int y, ImageView tree_fig, AnchorPane tree_pane) {\n this.pane = tree_pane;\n this.x = x;\n this.y = y;\n\n tree_fig.setLayoutX(x);\n tree_fig.setLayoutY(y);\n }", "@Override\n\tpublic void setPane() {\n\t\tNewTaskPane textListPane = new NewTaskPane();\n\t\trootPane = new HomePane(new MainLeftPane(),textListPane);\t\t\n\t}", "public void createPartControl(Composite parent) {\n//\t\tviewer = new TreeViewer(parent, SWT.VIRTUAL | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tviewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n\n\t\tdrillDownAdapter = new DrillDownAdapter(viewer);\n\t\tviewer.setContentProvider(new ViewContentProvider());\n\t\tviewer.setLabelProvider(new ViewLabelProvider());\n\t\tviewer.setSorter(new NameSorter()); // sorts the tree names alphabetically\n\t\tviewer.setInput(getViewSite());\n\t\t\n\t\tViewerFilter[] filters = {showAllFilter};\n\t\tviewer.setFilters(filters);\n\n\t\tshell = parent.getShell();\n\n\t\t// Create the help context id for the viewer's control\n\t\tPlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), \"org.openmodelica.modelicaml.view.componentstree\");\n\t\tmakeActions();\n\t\thookContextMenu();\n//\t\thookDoubleClickAction();\n\t\thookSelectionChangedAction();\n\t\tcontributeToActionBars();\n\n//\t\tgetSite().getWorkbenchWindow().getSelectionService().addSelectionListener(listener);\n\t\t\n\t\t// add a selection provider.\n\t\tgetSite().setSelectionProvider(viewer); \n\t\t\n\t\t// double click for opening/closing the sub tree\n\t\tviewer.addOpenListener(new IOpenListener() {\n\t\t\tpublic void open(final OpenEvent event) {\n\t\t\t\tObject firstElement = ((IStructuredSelection)\n\t\t\t\tevent.getSelection()).getFirstElement();\n\t\t\t\t\tif (viewer.getExpandedState(firstElement)) {\n\t\t\t\t\t\tviewer.collapseToLevel(firstElement, AbstractTreeViewer.ALL_LEVELS);\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tviewer.expandToLevel(firstElement, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\t// add drag support\n\t\tint operations = DND.DROP_MOVE;\n\t\tTransfer[] transferTypes = new Transfer[]{ LocalSelectionTransfer.getTransfer()};\n\t\tviewer.addDragSupport(operations, transferTypes, new DragListener(viewer));\n\n\t}", "public NavigatorPane() {\n _initNewLayer(_symbolLayer);\n _rebuildLayerArray();\n }", "public abstract void setClip(Shape clip);", "public Pane buildGuiInDerSchonzeit() {\n\t\tVBox root = new VBox(10); \r\n\t\t// Der Hintergrund des GUI wird mit einem Transparenten Bild erstellt\r\n\t\tImage imageBackground = new Image(getClass().getResource(\"transparent.png\").toExternalForm()); // Ein Image wird erstellt und das Bild übergeben\r\n\t\tBackgroundImage backgroundImage = new BackgroundImage(imageBackground, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);\r\n\t\tBackground background = new Background(backgroundImage); // Ein Background wird ertsellt und das Bild übergeben\r\n\t\troot.setBackground(background); // Der Hintergrund mit dem Bild wird dem root übergeben\r\n\t\t\r\n\t\t//\r\n\t\t// // Allse verschiedenen Boxen werden erstellt\r\n\t\t//\r\n\t\t\r\n\t\t// HBox für die erste Spalte\r\n\t\tHBox hBoxSpalte1 = new HBox(190);\r\n\t\t// 2mal VBox um Button und Text anzuzeigen \r\n\t\tVBox vBox1Spalte1 = new VBox();\r\n\t\tVBox vBox2Spalte1 = new VBox();\r\n\t\t\r\n\t\t// HBox für 2. Spalte\r\n\t\tHBox hBoxSpalte2 = new HBox(190);\r\n\t\t// 2 VBoxen für Bild und Text\r\n\t\tVBox vbox1Spalte2 = new VBox();\r\n\t\tVBox vbox2Spalte2 = new VBox();\r\n\t\t\r\n\t\t// HBox für die 3.Spalte\r\n\t\tHBox hboxSpalte3 = new HBox(190);\r\n\t\t// 2mal VBox für Bild und Text\r\n\t\tVBox vbox1Spalte3 = new VBox();\r\n\t\tVBox vbox2Spalte3 = new VBox();\r\n\t\t\r\n\t\t// HBox für die 4 Spalte\r\n\t\tHBox hboxSpalte4 = new HBox(190);\r\n\t\t// 2mal VBox für Bild und Text\r\n\t\tVBox vbox1Spalte4 = new VBox();\r\n\t\tVBox vbox2Spalte4 = new VBox();\r\n\t\t\r\n\t\t//\r\n\t\t// Button für die Fische\r\n\t\t//\r\n\t\t\r\n\t\t//Label Bild für Hecht\r\n\t\tLabel hechtbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage hechtimage = new Image(getClass().getResource(\"Hecht.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\thechtbildLabel.setGraphic(new ImageView(hechtimage)); // Das Bild wird dem Label übergeben\r\n\t\thechtbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Zander\r\n\t\tLabel zanderbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage zanderImage = new Image(getClass().getResource(\"Zander.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tzanderbildLabel.setGraphic(new ImageView(zanderImage)); // Das Bild wird dem Label übergeben\r\n\t\tzanderbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Aal\r\n\t\tLabel aalbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage aalImage = new Image(getClass().getResource(\"Aal.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\taalbildLabel.setGraphic(new ImageView(aalImage)); // Das Bild wird dem Label übergeben\r\n\t\taalbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Aesche\r\n\t\tLabel aeschebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage aescheImage = new Image(getClass().getResource(\"Aesche.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\taeschebildLabel.setGraphic(new ImageView(aescheImage)); // Das Bild wird dem Label übergeben\r\n\t\taeschebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Barsch\r\n\t\tLabel barschbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage barschImage = new Image(getClass().getResource(\"Barsch.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tbarschbildLabel.setGraphic(new ImageView(barschImage)); // Das Bild wird dem Label übergeben\r\n\t\tbarschbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Forelle\r\n\t\tLabel forellebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage forelleImage = new Image(getClass().getResource(\"Regenbogenforelle.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tforellebildLabel.setGraphic(new ImageView(forelleImage)); // Das Bild wird dem Label übergeben\r\n\t\tforellebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Schleie\r\n\t\tLabel schleiebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage schleieImage = new Image(getClass().getResource(\"Schleie.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tschleiebildLabel.setGraphic(new ImageView(schleieImage)); // Das Bild wird dem Label übergeben\r\n\t\tschleiebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Karpfe\r\n\t\tLabel karpfenbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage karpfenImage = new Image(getClass().getResource(\"Schuppenkarpfen.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tkarpfenbildLabel.setGraphic(new ImageView(karpfenImage)); // Das Bild wird dem Label übergeben\r\n\t\tkarpfenbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// Label für die Titel der Fische\r\n\t\t//\r\n\t\t\r\n\t\t// Label Hecht\r\n\t\tLabel hechtlabel = new Label(\"Hecht\"); // Das Label mit dem Namen wird erstellt\r\n\t\thechtlabel.setFont(new Font(30)); // Die Schriftgrösse\r\n\t\thechtlabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t//Label Zander\r\n\t\tLabel zanderLabel = new Label(\"Zander\"); // DAs LAabel mit dem Namen wird erstellt\r\n\t\tzanderLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tzanderLabel.setTranslateX(160); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Aal\r\n\t\tLabel aaLabel = new Label(\"Aal\"); // Das Label mit dem Namen wird erstellt\r\n\t\taaLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\taaLabel.setTranslateX(200); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Aesche\r\n\t\tLabel aescheLabel = new Label(\"Äsche\"); // Das Label mit dem Namen wird erstellt\r\n\t\taescheLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\taescheLabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Barsch\r\n\t\tLabel barschLabel = new Label(\"Flussbarsch\"); // Das Label mit dem Namen wird erstellt\r\n\t\tbarschLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tbarschLabel.setTranslateX(130); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Forelle\r\n\t\tLabel forelleLabel = new Label(\"Forelle\"); // Das Label mit dem Namen wird erstellt\r\n\t\tforelleLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tforelleLabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Schleie\r\n\t\tLabel schleieLabel = new Label(\"Schleie\"); // Das Label mit dem Namen wird erstellt\r\n\t\tschleieLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tschleieLabel.setTranslateX(170); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Karpfe\r\n\t\tLabel karpfeLabel = new Label(\"Karpfe\"); // Das Label mit dem Namen wird erstellt\r\n\t\tkarpfeLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tkarpfeLabel.setTranslateX(170); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// Label für die Anzeige in der Schonzeit\r\n\t\t//\r\n\t\t\r\n\t\t// Label Schonzeit für Hecht\r\n\t\tLabel schonzeitHechtLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitHechtLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitHechtLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Zander\r\n\t\tLabel schonzeitZanderLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitZanderLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitZanderLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Aal\r\n\t\tLabel schonzeitaaLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitaaLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitaaLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Aesche\r\n\t\tLabel schonzeitaescheLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitaescheLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitaescheLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Barsch\r\n\t\tLabel schonzeitbarschLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitbarschLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitbarschLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Forelle\r\n\t\tLabel schonzeitforelleLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitforelleLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitforelleLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Schleie\r\n\t\tLabel schonzeitschleieLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitschleieLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitschleieLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Karpfe\r\n\t\tLabel schonzeitkarpfeLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitkarpfeLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitkarpfeLabel.setTranslateX(140); // X-Achse im root\r\n\r\n\t\t\r\n\t\t// Das Label für die überschrift\r\n\t\tLabel fischeAuswahlLabel = new Label(\"Fische und Ihre Schonzeit\"); // Das Label wird mit dem Namen erstellt\r\n\t\tfischeAuswahlLabel.setFont(new Font(40)); // Schriftgrösse\r\n\t\tfischeAuswahlLabel.setTranslateX(10); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// // Buttons werden erstellt\r\n\t\t//\r\n\t\t\r\n\t\t// Button zurück Hauptmenu\r\n\t\tButton hauptmenuButton = new Button(\"Hauptmenü\"); // Button wird erstellt und Initialisiert\r\n\t\thauptmenuButton.setMinSize(200, 50); // Die Minimumgrösse wird gesetzt\r\n\t\thauptmenuButton.setTranslateX(345); // X- Achse des Buttons im root\r\n\t\thauptmenuButton.setFont(new Font(25)); // Schriftgrösse des Buttons\r\n\t\t// Zoom in und out wird hinzugefügt\r\n\t\tButtonHandling zoomButtonHandling = new ButtonHandling();\r\n\t\tzoomButtonHandling.zoomIn(hauptmenuButton);\r\n\t\tzoomButtonHandling.zoomOut(hauptmenuButton);\r\n\t\t// Funktion zurück ins Hauptmenü\r\n\t\thauptMenuAufrufen(hauptmenuButton);\r\n\t\t\r\n\t\t//\r\n\t\t// // Aktuelles Datum wird eingelesen um die Fische auf Ihre Schonzeit zu prüfen\r\n\t\t//\r\n\t\t\r\n\t\t// Aktueller Monat wird in der Variablen datumAktuell gespeichert.\r\n\t\tCalendar dateNow = Calendar.getInstance(); // Kalender wird erstellt\r\n\t\tint datum = dateNow.get(Calendar.MONTH) +1; // Der aktuelle Monat wird im Int Initialisiert. +1 Da die Monate ab 0 Beginnen\r\n\t\t// Datum Manuell setzten für Test und Debbug \r\n\t\t//int datum = 1;\r\n\t\t\r\n\t\t//\r\n\t\t// // Die einzelnen VBoxen für die Fische werden je nach Schonzeit gefüllt\r\n\t\t//\r\n\t\t\r\n\t\t// 1. Spalte und 1 Box\r\n\t\tvBox1Spalte1.getChildren().addAll(hechtlabel,hechtbildLabel);// Erste Linie und erste Spalte mit Bild und Text wird dem root übergeben\r\n\t\tif (datum >=1 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitHechtLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitHechtLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitHechtLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitHechtLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den entsprecheneden Einstellungen übergeben\r\n\t\tvBox1Spalte1.getChildren().add(schonzeitHechtLabel);\r\n\t\t\r\n\t\t// 1. Spalte und 2. Box\r\n\t\tvBox2Spalte1.getChildren().addAll(zanderLabel,zanderbildLabel); // Erste Linie und zweite Spalte mit Bild und Text wird dem root übergeben\r\n\t\tif (datum >= 1 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitZanderLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitZanderLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitZanderLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitZanderLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den entsprechenden Einstellungen übergeben\r\n\t\tvBox2Spalte1.getChildren().add(schonzeitZanderLabel);\r\n\t\t\r\n\t\t// 2. Spalte und 1. Box\r\n\t\tvbox1Spalte2.getChildren().addAll(aaLabel,aalbildLabel); // Zweite Linie erste Spalte mit Bild und Text\r\n\t\t// Der Aal hat keine Schonzeit\r\n\t\t\tschonzeitaaLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitaaLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den einstellungen übergeben\t\r\n\t\tvbox1Spalte2.getChildren().add(schonzeitaaLabel);\r\n\t\t\r\n\t\t// 2. Spalte und 2. Box\r\n\t\tvbox2Spalte2.getChildren().addAll(aescheLabel,aeschebildLabel); // Zweite Linie zweite Spalte mit Bild und Text\r\n\t\tif (datum >= 2 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitaescheLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitaescheLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitaescheLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitaescheLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\r\n\t\tvbox2Spalte2.getChildren().add(schonzeitaescheLabel);\r\n\t\t\r\n\t\t// 3. Spalte und 1. Box\r\n\t\tvbox1Spalte3.getChildren().addAll(barschLabel,barschbildLabel); // Dritte Linie erste Spalte mit Bild und Text\r\n\t\t// Der Barsch hat keine Schonzeit\r\n\t\t\tschonzeitbarschLabel.setText(\"keine Schonzeit\");\r\n\t\t\tschonzeitbarschLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox1Spalte3.getChildren().add(schonzeitbarschLabel);\r\n\t\t\r\n\t\t// 3. Spalte und 2. Box\r\n\t\tvbox2Spalte3.getChildren().addAll(forelleLabel,forellebildLabel); // Dritte Linie zweite Spalte mit Bild und Text\r\n\t\tif (datum >= 3 && datum <= 9) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitforelleLabel.setText(\"keine Schonzeit\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitforelleLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitforelleLabel.setText(\"hat Schonzeit !\"); // Die Schonzeit des Hechtes wird überprüft\r\n\t\t\tschonzeitforelleLabel.setTextFill(Color.RED); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\r\n\t\tvbox2Spalte3.getChildren().add(schonzeitforelleLabel);\r\n\t\t\r\n\t\t// 4. Spalte und 1. Box\r\n\t\tvbox1Spalte4.getChildren().addAll(schleieLabel,schleiebildLabel); // Vierte Linie erste Spalte mit Bild und Text\r\n\t\t// Die Schleie hat keien Schonzeit\r\n\t\t\tschonzeitschleieLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitschleieLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox1Spalte4.getChildren().add(schonzeitschleieLabel);\r\n\t\t\r\n\t\t// 4. Spalte und 2. Box\r\n\t\tvbox2Spalte4.getChildren().addAll(karpfeLabel,karpfenbildLabel); // Vierte Linie zweite Spalte mit Bild und Text\r\n\t\t// Der Karpfe hat keine Schonzeit\r\n\t\t\tschonzeitkarpfeLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitkarpfeLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox2Spalte4.getChildren().add(schonzeitkarpfeLabel);\r\n\t\t\r\n\t\t//\r\n\t\t// // Die einzelnen HBoxen werden gefüllt für die Spalten in der Root\r\n\t\t//\r\n\t\thBoxSpalte1.getChildren().addAll(vBox1Spalte1,vBox2Spalte1); // Die erste Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// HBox Spalte 2\r\n\t\thBoxSpalte2.getChildren().addAll(vbox1Spalte2,vbox2Spalte2); // Die zweite Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// Hbox Spalte 3\r\n\t\thboxSpalte3.getChildren().addAll(vbox1Spalte3,vbox2Spalte3); // Die dritte Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// Hbox Spalte 4\r\n\t\thboxSpalte4.getChildren().addAll(vbox1Spalte4,vbox2Spalte4); // Die vierte Spalte wird mit den zwei Boxen gefüllt\r\n\t\t\r\n\t\t// Elemente werden der HauptVBox root hinzugefügt\r\n\t\troot.getChildren().addAll(fischeAuswahlLabel,hBoxSpalte1,hBoxSpalte2,hboxSpalte3,hboxSpalte4,hauptmenuButton); // Alle gefüllten Boxen werden der Hauptbox übergeben\r\n\t\t\r\n\t\t// Das root wird zurückgegeben um Angezeigt zu werden\r\n\t\treturn root;\r\n\t}", "private Pane createLayout() {\n root = new Pane();\n root.setPrefSize(Main.APP_W, Main.APP_H);\n\n // Logo\n ImageView logoView = new ImageView(new Image(\"res/snake.png\"));\n logoView.setFitHeight(500);\n logoView.setPreserveRatio(true);\n logoView.setLayoutX(40);\n logoView.setLayoutY(40);\n\n // Controls diagram\n ImageView controlsView = new ImageView(new Image(\"res/controls.png\"));\n controlsView.setFitHeight(100);\n controlsView.setPreserveRatio(true);\n controlsView.setLayoutX(350);\n controlsView.setLayoutY(40);\n\n // Control instructions\n Text keys = new Text(\"Use arrow keys to direct the snake \\nspacebar to pause / resume the game\");\n keys.setFont(Font.font(\"Calibri\", FontWeight.BOLD, 20));\n keys.setFill(Color.BLUE);\n keys.setLayoutX(470);\n keys.setLayoutY(90);\n\n // Play button image\n ImageView playView = new ImageView(new Image(\"res/play.png\"));\n playView.setFitHeight(150);\n playView.setPreserveRatio(true);\n playView.setLayoutX(320);\n playView.setLayoutY(170);\n\n // Click here instructions\n // Control instructions\n Text clickHere = new Text(\"Click to play\");\n clickHere.setFont(Font.font(\"Calibri\", FontWeight.BOLD, 20));\n clickHere.setFill(Color.BLUE);\n clickHere.setLayoutX(348);\n clickHere.setLayoutY(348);\n\n // Background\n ImageView backgroundView = new ImageView(Main.BACKGROUND_IMAGE);\n\n // Add elements to the root\n root.getChildren().setAll(backgroundView, logoView, controlsView, keys, playView, clickHere);\n\n return root;\n }", "public PaneOrganizer() {\n\t\t_root = new BorderPane(); // new border pane\n\t\t\n\t\tLabel score = new Label(\"Score: 0\"); // score label\n\t\tscore.setTextFill(Color.WHITE); // text color\n\t\t\n\t\tLabel lives = new Label(\"Lives: 3\"); // lives label\n\t\tlives.setTextFill(Color.WHITE); // text color\n\t\t\n\t\tGame game = new Game(score, lives); // game pane\n\t\tHBox hbox = new HBox(); // hbox to organize the quit button\n\n\t\tButton quit = new Button(\"Quit\"); // Creating quit button\n\t\tquit.setOnAction(new QuitHandler()); // add the quit handler\n\t\tquit.minHeight(Constants.QUIT_HEIGHT); // sizing\n\n\t\thbox.getChildren().addAll(quit, score, lives); // add components to hbox\n\t\thbox.setSpacing(20);\n\t\t\n\t\t_root.setCenter(game); // set the game pane\n\t\t_root.setBottom(hbox); // set the hbox\n\t\t_root.setStyle(\"-fx-background-color: black\");\n\t}", "private void initializeExplorer() {\n\t\tthis.hydraExplorer = new HydraExplorer(this.stage);\n\t\tthis.splitPane.setTopComponent(this.hydraExplorer);\n\t\tthis.initializeExplorerCommands();\n\t}", "public void build() {\n VBox rootLayout = new VBox();\n Pane topPane = new Pane();\n HBox bottomBox = new HBox();\n Pane pluginPane = new Pane();\n Pane iconPane = new Pane();\n rootLayout.setPrefSize(300, 623);\n topPane.setPrefSize(300, 50);\n bottomBox.setPrefSize(300, 573);\n pluginPane.setPrefSize(250, 573);\n iconPane.setPrefSize(50, 573);\n Button b1 = new Button(\"h\");\n pluginPane.getChildren().addAll(b1);\n bottomBox.getChildren().addAll(pluginPane, iconPane);\n rootLayout.getChildren().addAll(topPane, bottomBox);\n\n Scene scene = new Scene(rootLayout);\n setScene(scene);\n }", "private Parent createContent(){\n Pane root = new Pane();\n root.setPrefSize(BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n\n Rectangle background = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n background.setFill(Color.rgb(152, 172, 172));\n root.getChildren().add(background);\n\n Rectangle bar = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT+1), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1)); // the Board area\n bar.setFill(Color.rgb(31, 31, 31));\n root.getChildren().add(bar);\n\n Rectangle holdArea = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT-1) + 96, 10, BRICK_SIZE*4+4, BRICK_SIZE*4+4);\n holdArea.setFill(Color.rgb(31, 31, 31));\n holdArea.setStroke(Color.WHITE);\n holdArea.setStrokeWidth(1.0);\n root.getChildren().add(holdArea);\n\n Text holdLabel = new Text();\n holdLabel.setText(\"Hold: (X)\");\n holdLabel.setLayoutX(BRICK_SIZE*(Board.BOUNDARY_RIGHT) + 96);\n holdLabel.setLayoutY(32);\n holdLabel.setFill(Color.WHITESMOKE);\n holdLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(holdLabel);\n\n Rectangle next = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT-1) + 96, 150, BRICK_SIZE*4+4, BRICK_SIZE*4+4);\n next.setFill(Color.rgb(91, 91, 91));\n next.setStroke(Color.WHITE);\n next.setStrokeWidth(1.0);\n root.getChildren().add(next);\n\n Text nextLabel = new Text();\n nextLabel.setText(\"Next:\");\n nextLabel.setLayoutX(BRICK_SIZE*(Board.BOUNDARY_RIGHT) + 96);\n nextLabel.setLayoutY(172);\n nextLabel.setFill(Color.WHITESMOKE);\n nextLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(nextLabel);\n\n Canvas canvas = new Canvas(BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n g = canvas.getGraphicsContext2D();\n root.getChildren().add(canvas);\n\n Label scoreLabel = new Label();\n scoreLabel.setText(\"Score\");\n scoreLabel.setLayoutX(360);\n scoreLabel.setLayoutY(332);\n scoreLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(scoreLabel);\n\n Label highScoreLabel = new Label();\n highScoreLabel.setText(\"High Score\");\n highScoreLabel.setLayoutX(360);\n highScoreLabel.setLayoutY(382);\n highScoreLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(highScoreLabel);\n\n Label levelLabel = new Label();\n levelLabel.setText(\"Level\");\n levelLabel.setLayoutX(360);\n levelLabel.setLayoutY(432);\n levelLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(levelLabel);\n\n Label linesLabel = new Label();\n linesLabel.setText(\"Lines Cleared\");\n linesLabel.setLayoutX(360);\n linesLabel.setLayoutY(482);\n linesLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(linesLabel);\n\n board = new Board();\n\n score.setText(\"\" + board.getScore());\n score.setLayoutX(360);\n score.setLayoutY(352);\n score.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(score);\n\n highScore.setText(\"\" + Math.max(FileHandler.readHighScore(), board.getScore()));\n highScore.setLayoutX(360);\n highScore.setLayoutY(402);\n highScore.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(highScore);\n\n level.setText(\"\" + board.getLevel());\n level.setLayoutX(360);\n level.setLayoutY(452);\n level.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(level);\n\n lines.setText(\"\" + board.getTotalLinesCleared());\n lines.setLayoutX(360);\n lines.setLayoutY(502);\n lines.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(lines);\n\n refreshDisplay();\n\n // The AnimationTimer is responsible for moving the currently controlled piece down.\n AnimationTimer animationTimer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if(time < 0.2){\n time = 0.0;\n }\n time += timeFractionBasedOnLevel();\n if(time >= 60.0){\n board.moveDown();\n refreshDisplay();\n time = 0.0;\n }\n }\n };\n animationTimer.start();\n\n return root;\n }", "private void setLayout (){\r\n /* define placeholders for content*/\r\n HBox mainFrame= new HBox(); //the Main frame component.\r\n root.getChildren().add(mainFrame); //add it to the scene\r\n \r\n \r\n \r\n mainFrame.getChildren().addAll(leftPane,rightPane);\r\n \r\n Rectangle leftR= new Rectangle(600.0, 900.0);\r\n leftR.setFill(Color.WHITE);\r\n Rectangle rightR= new Rectangle(300.0, 900.0);\r\n rightR.setFill(Color.RED);\r\n rightPane.getChildren().add(rightR);\r\n leftPane.getChildren().add(leftR);\r\n \r\n \r\n }", "public void nodeDemo() {\n final PLayer layer = getCanvas().getLayer();\n final PNode aNode = PPath.createRectangle(0, 0, 100, 80);\n\n // A node needs to be a descendent of the root to be displayed on the\n // screen.\n layer.addChild(aNode);\n\n // The default color for a node is blue, but you can change that with\n // the setPaint method.\n aNode.setPaint(Color.red);\n\n // A node can have children nodes added to it.\n aNode.addChild(PPath.createRectangle(0, 0, 100, 80));\n\n // The base bounds of a node is easy to change. Note that changing the\n // base\n // bounds of a node will not change it's children.\n aNode.setBounds(-10, -10, 200, 110);\n\n // Each node has a transform that can be used to transform the node, and\n // all its children on the screen.\n aNode.translate(100, 100);\n aNode.scale(1.5);\n aNode.rotate(45);\n\n // The transparency of any node can be set, this transparency will be\n // applied to any of the nodes children as well.\n aNode.setTransparency(0.75f);\n\n // Its easy to copy nodes.\n final PNode aCopy = (PNode) aNode.clone();\n\n // Make is so that the copies children are not pickable. For this\n // example\n // that means you will not be able to grab the child and remove it from\n // its parent.\n aNode.setChildrenPickable(false);\n\n // Change the look of the copy\n aNode.setPaint(Color.GREEN);\n aNode.setTransparency(1.0f);\n\n // Let's add the copy to the root, and translate it so that it does not\n // cover the original node.\n layer.addChild(aCopy);\n aCopy.setOffset(0, 0);\n aCopy.rotate(-45);\n }", "private void configure() {\n\t\tthis.pressedListener = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tstartDragX = me.getSceneX();\n\t\t\t\tstartDragY = me.getSceneY();\n\t\t\t\tstartNodeX = getTranslateX();\n\t\t\t\tstartNodeY = getTranslateY();\n\t\t\t\tstartWidth = getMaxWidth();\n\t\t\t\tstartHeight = getMaxHeight();\n\t\t\t}\n\t\t};\n\t\ttopDragger.setOnMousePressed(this.pressedListener);\n\t\tbottomDragger.setOnMousePressed(this.pressedListener);\n\t\tleftDragger.setOnMousePressed(this.pressedListener);\n\t\trightDragger.setOnMousePressed(this.pressedListener);\n\n\t\tsetTop(topDragger);\n\t\tsetBottom(bottomDragger);\n\t\tsetLeft(leftDragger);\n\t\tsetRight(rightDragger);\n\t\tsetCenter(center);\n\t\tbuildDragListeners();\n\t\tbuildResizeListeners();\n\t}", "@Override\n public void initPane(final MainView parent) {\n this.parent = parent;\n headerAnchorPane.getChildren().setAll(PaneFactory.initHeader());\n\n }", "@Override\n\tpublic void clip(Node n) {\n\t}", "public static void setTreePane(TreePane pane)\n {\n for (Component c : frame.getContentPane().getComponents())\n {\n if (c instanceof TreePane)\n {\n frame.getContentPane().remove(c);\n }\n }\n frame.getContentPane().add(pane, BorderLayout.CENTER);\n frame.revalidate(); //Redraws the GUI, not only for looks, but also so that the user can interact. (Non-Responsive GUI without this)\n }", "public abstract void setClip(int x, int y, int width, int height);", "public void initialPanes()\r\n\t{\n\t\t\t\tlmg.setLayout(null);\r\n\t\t\t\tlmg.setBounds(0, 0, 1280, 720);\r\n\t\t\t\t\r\n\t\t//adding child panes\r\n\t\t\t\t//World background pane\r\n\t\t\t\t\tlmg.add(wB, new Integer(0));\r\n\t\t\t\t//World pane\r\n\t\t\t\t\tlmg.add(w, new Integer(1));\r\n\t\t\t\t\t\r\n\t\t//DisplayPanel adds the layered pane which holds all child pane\r\n\t\t\t\tadd(lmg);\r\n\t}", "@Override\n\tpublic void setPane() {\n\t\tNewRecordPane RecListPane = new NewRecordPane();\n\t\trootPane = new HomePane(new MainLeftPane(),RecListPane);\n\t}", "public DrawPane()\n {\n //Step #1: initialize each instance variable and set up layout\n undoBtn = new Button(\"Undo\");\n eraseBtn = new Button(\"Erase\");\n undoBtn.setMinWidth(80.0);\n eraseBtn.setMinWidth(80.0);\n\n canvas = new Pane();\n setCenter(canvas);\n\n left = new VBox(20);\n left.setAlignment(Pos.CENTER);\n setLeft(left);\n this.getLeft().prefWidth(400);\n\n controls = new HBox(40);\n controls.setAlignment(Pos.CENTER);\n undoBtn.setOnAction(new ButtonHandler());\n eraseBtn.setOnAction(new ButtonHandler());\n controls.getChildren().addAll(undoBtn, eraseBtn);\n setBottom(controls);\n\n //Create the color comboBox and initialize its default color\n colorCombo = new ComboBox<>();\n colorCombo.getItems().setAll(\"Black\", \"Red\", \"Blue\", \"Green\", \"Yellow\", \"Orange\", \"Pink\");\n colorCombo.getSelectionModel().select(0);\n colorCombo.setOnAction(new ColorHandler());\n left.getChildren().add(colorCombo);\n //----\n\n //Create the three radio buttons and also a ToggleGroup\n //so that the three radio buttons can be selected\n //mutually exclusively. Otherwise they are independent of each other\n rbRect = new RadioButton(\"Rectangle\");\n rbCircle = new RadioButton(\"Circle\");\n rbArc = new RadioButton(\"Arc\");\n radioGroup = new ToggleGroup();\n rbRect.setToggleGroup(radioGroup);\n rbRect.setSelected(true);\n rbCircle.setToggleGroup(radioGroup);\n rbArc.setToggleGroup(radioGroup);\n rbRect.setOnAction(new ShapeHandler());\n rbCircle.setOnAction(new ShapeHandler());\n rbArc.setOnAction(new ShapeHandler());\n left.getChildren().addAll(rbRect, rbCircle, rbArc);\n //----\n\n //initialize shapeList, it is a data structure we used\n //to track the shape we drew\n shapeList = new ArrayList<>();\n //----\n\n //canvas is a Pane where we will draw rectagles, circles and arcs on it\n canvas.setStyle(\"-fx-background-color: Azure;\");\n\n //Step #3: Register the source nodes with its handler objects\n canvas.setOnMousePressed(new MouseHandler());\n canvas.setOnMouseDragged(new MouseHandler());\n canvas.setOnMouseReleased(new MouseHandler());\n //----\n //----\n\n }", "@FXML\n private void initialize() {\n storyContainer.getStyleClass().add(\"workspace-story\");\n }", "private void initRoot() {\n root = new VBox(10);\n root.setAlignment(Pos.CENTER);\n root.setPadding(new Insets(10));\n root.setPrefWidth(300);\n root.setPrefHeight(150);\n }", "public ImagePane() {\r\n\t\tsuper();\r\n\t}", "public void setClipBoardData() {\n }", "public void createPartControl(Composite parent) {\n \t\t// Store the display so we can make async calls from listeners\n \t\tdisplay = parent.getDisplay();\n\t\tviewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n \t\tsetTreeColumns(viewer.getTree());\n \t\tviewer.getTree().setHeaderVisible(true);\n \t\tviewer.setContentProvider(getContentProvider());\n \t\tviewer.setInput(getInput());\n \t\tviewer.setLabelProvider(getLabelProvider());\n \t\tviewer.setComparator(new ViewerComparator());\n \t\tconfigureViewer(viewer);\n \t\taddListeners();\n \t\tmakeActions();\n \t\thookContextMenu();\n \t\thookDoubleClickAction();\n \t\tcontributeToActionBars();\n \t}", "public void initialize() {\n this.setPreferredSize(new com.ulcjava.base.application.util.Dimension(548, 372));\n this.add(getTitlePane(), new com.ulcjava.base.application.GridBagConstraints(0, 0, 3, 1, -1, -1,\n com.ulcjava.base.application.GridBagConstraints.CENTER, com.ulcjava.base.application.GridBagConstraints.NONE,\n new com.ulcjava.base.application.util.Insets(0, 0, 0, 0), 0, 0));\n this.add(getXpertIvyPane(), new com.ulcjava.base.application.GridBagConstraints(0, 1, 1, 1, -1, -1,\n com.ulcjava.base.application.GridBagConstraints.CENTER, com.ulcjava.base.application.GridBagConstraints.NONE,\n new com.ulcjava.base.application.util.Insets(0, 0, 0, 0), 0, 0));\n this.add(getLicensePane(), new com.ulcjava.base.application.GridBagConstraints(0, 2, 1, 1, -1, -1,\n com.ulcjava.base.application.GridBagConstraints.CENTER, com.ulcjava.base.application.GridBagConstraints.NONE,\n new com.ulcjava.base.application.util.Insets(0, 0, 0, 0), 0, 0));\n this.add(getDatabasePane(), new com.ulcjava.base.application.GridBagConstraints(0, 3, 1, 1, -1, -1,\n com.ulcjava.base.application.GridBagConstraints.CENTER, com.ulcjava.base.application.GridBagConstraints.NONE,\n new com.ulcjava.base.application.util.Insets(0, 0, 0, 0), 0, 0));\n this.add(getJavaPane(), new com.ulcjava.base.application.GridBagConstraints(0, 4, 1, 1, -1, -1,\n com.ulcjava.base.application.GridBagConstraints.CENTER, com.ulcjava.base.application.GridBagConstraints.NONE,\n new com.ulcjava.base.application.util.Insets(0, 0, 0, 0), 0, 0));\n }", "@FXML\n public void plannerCupboardBtnClicked(){\n //display correct pane and subMenu pane\n subMenuDisplay(PlannerSubMenuPane);\n PlannerCupboardPane.toFront();\n MenuPane.toFront();\n loadIngredients();\n }", "private void initFaithPathPane() {\n this.faithPathPane = new FaithPathPane();\n faithPathPane.setOpaque(false);\n faithPathPane.setSize(faithPathWidth,faithPathHeight);\n faithPathPane.setBounds(0,0,faithPathWidth,faithPathHeight);\n\n this.add(faithPathPane);\n }", "public void createPartControl(Composite parent) {\n\t\tlog.info(\"Workplace plugin version 1.6.0\");\n\t\t// Drag \"from\" tree\n\t\tcompositeQueryTree = new Composite(parent, SWT.NULL);\n\t\tGridLayout gridLayout = new GridLayout();\n\t\tgridLayout.numColumns = 1;\n\t\tgridLayout.horizontalSpacing = 1;\n\t\tgridLayout.verticalSpacing = 1;\n\t\tgridLayout.marginHeight = 0;\n\t\tgridLayout.marginWidth = 0;\n\t\tcompositeQueryTree.setLayout(gridLayout);\n\n\t\tGridLayout gridLayoutTree = new GridLayout(1, false);\n\t\tgridLayoutTree.numColumns = 1;\n\t\tgridLayoutTree.marginHeight = 0;\n\t\tGridData fromTreeGridData = new GridData (GridData.FILL_BOTH);\n\t\tfromTreeGridData.widthHint = 300;\n\t\tcompositeQueryTree.setLayoutData(fromTreeGridData);\n\n\t\tTreeComposite dragTree = new TreeComposite(compositeQueryTree, 1, slm);\n\t\tdragTree.setLayoutData(new GridData (GridData.FILL_BOTH));\n\t\tdragTree.setLayout(gridLayout);\n\t\t\n\t\t// Setup help context\n\t\tPlatformUI.getWorkbench().getHelpSystem().setHelp(dragTree, WORKPLACE_VIEW_CONTEXT_ID);\n\t\taddHelpButtonToToolBar();\n\t}", "@Override\n\t\tpublic void setPane(JPanel pane) {\n\t\t\t\n\t\t}", "public RTGraphPanel (RTPanelFrame.Type win_type, int win_pos, String win_uniq, RT rt) {\n super(win_type, win_pos, win_uniq, rt); JMenuItem mi;\n JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false, component = new RTGraphComponent(), createLabelsPanel(getRTParent().getEntityTagTypes()));\n split.setOneTouchExpandable(true); split.setResizeWeight(1.0);\n add(\"Center\", split);\n\n // - Relationships...\n getRTPopupMenu().add(add_relationship_mi = new JMenuItem(\"Add Edge Relationship...\"));\n getRTPopupMenu().add(delete_relationship_mi = new JMenuItem(\"Delete Edge Relationship...\"));\n JMenu datascience_menu = new JMenu(\"Data Science\"); getRTPopupMenu().add(datascience_menu);\n datascience_menu.add(add_header_relationships_mi = new JMenuItem(\"Add Header Relationships\"));\n datascience_menu.add(add_header_relationships_types_mi = new JMenuItem(\"Add Header Relationships (Types)\"));\n datascience_menu.add(add_header_relationships_stars_mi = new JMenuItem(\"Add Header Star Relationships\"));\n datascience_menu.add(add_header_relationships_types_stars_mi = new JMenuItem(\"Add Header Star Relationships (Types)\"));\n common_relationships_menu = new JMenu(\"Common Relationships\"); getRTPopupMenu().add(common_relationships_menu); \n fillCommonRelationshipsMenu();\n\n // - Copy and paste\n getRTPopupMenu().addSeparator();\n getRTPopupMenu().add(mi = new JMenuItem(\"Copy Selected Entities\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { copySelection(); } } );\n getRTPopupMenu().add(mi = new JMenuItem(\"Select (Clipboard)\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { selectFromClipboard(); } } );\n getRTPopupMenu().add(mi = new JMenuItem(\"Add To (Clipboard)\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { addFromClipboard(); } } );\n getRTPopupMenu().add(mi = new JMenuItem(\"Remove From (Clipboard)\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { removeFromClipboard(); } } );\n getRTPopupMenu().add(mi = new JMenuItem(\"Intersect Clipboard\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { intersectFromClipboard(); } } );\n getRTPopupMenu().add(strict_matches_cbmi = new JCheckBoxMenuItem(\"Strict Substring Matches\", true));\n\n // - Background Stuff\n getRTPopupMenu().addSeparator();\n JMenu background_menu = new JMenu(\"Background\"); ButtonGroup bg; bg = new ButtonGroup();\n getRTPopupMenu().add(background_menu);\n nobg_rbmi = new JRadioButtonMenuItem(\"None\", true); bg.add(nobg_rbmi); background_menu.add(nobg_rbmi); defaultListener(nobg_rbmi);\n background_menu.addSeparator();\n geo_out_rbmi = new JRadioButtonMenuItem(\"Geo Outline\"); bg.add(geo_out_rbmi); background_menu.add(geo_out_rbmi); defaultListener(geo_out_rbmi);\n geo_fill_rbmi = new JRadioButtonMenuItem(\"Geo Fill\"); bg.add(geo_fill_rbmi); background_menu.add(geo_fill_rbmi); defaultListener(geo_fill_rbmi);\n geo_touch_rbmi = new JRadioButtonMenuItem(\"Geo Touch\"); bg.add(geo_touch_rbmi); background_menu.add(geo_touch_rbmi); defaultListener(geo_touch_rbmi);\n background_menu.addSeparator();\n kcores_rbmi = new JRadioButtonMenuItem(\"KCores\"); bg.add(kcores_rbmi); background_menu.add(kcores_rbmi); defaultListener(kcores_rbmi);\n\n // - Layout Stuff\n getRTPopupMenu().addSeparator();\n JMenu layouts_menu = new JMenu(\"Layout\");\n getRTPopupMenu().add(layouts_menu);\n getRTPopupMenu().add(mi = new JMenuItem(\"Layout Small Multiples Dialog (Beta)...\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { new LayoutSmallMultiplesDialog(); } } );\n\n // - Layout I/O\n layouts_menu.add(mi = new JMenuItem(\"Save Layout...\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { saveLayout(false, null); } } );\n layouts_menu.add(mi = new JMenuItem(\"Save Layout (Selected Entities)...\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { saveLayout(true, null); } } );\n layouts_menu.add(mi = new JMenuItem(\"Load Layout...\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { loadLayout(false); } } );\n layouts_menu.add(mi = new JMenuItem(\"Load Layout (Apply To Selected)...\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { loadLayout(true); } } );\n\n // - Layout helpers\n layouts_menu.addSeparator();\n layouts_menu.add(mi = new JMenuItem(\"Subset One Bundle Per Edge (Fast UI)\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { subsetOneBundlePerEdge(); } } );\n layouts_menu.add(mi = new JMenuItem(\"IP Logical Octet Layout\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { ipLogicalOctetLayout(); } } );\n layouts_menu.add(mi = new JMenuItem(\"Temporal Layout\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { temporalLayout(); } } );\n layouts_menu.add(mi = new JMenuItem(\"Collapse Blocks\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { collapseBlocks(); } } );\n layouts_menu.add(mi = new JMenuItem(\"Node Color TreeMap Layout\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { nodeColorTreeMapLayout(); } } );\n\n // - Specialized layouts\n layouts_menu.addSeparator();\n layouts_menu.add(mi = new JMenuItem(\"Geospatial\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { geospatialLayout(false); } } );\n // layouts_menu.add(mi = new JMenuItem(\"Geospatial (cc)\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { geospatialLayout(true); } } );\n\n // - Layouts\n layouts_menu.addSeparator(); Map<String,JMenu> layout_cats = new HashMap<String,JMenu>();\n String layouts[] = GraphLayouts.getLayoutAlgorithms();\n for (int i=0;i<layouts.length;i++) {\n\n // Categorize\n String category = GraphLayouts.getLayoutCategory(layouts[i]);\n if (layout_cats.containsKey(category) == false) {\n JMenu jmenu;\n layouts_menu.add(jmenu = new JMenu(category));\n layout_cats.put(category, jmenu);\n }\n layout_cats.get(category).add(mi = new JMenuItem(layouts[i]));\n\n // Add the action listener for each layout\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) {\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) (getRTComponent().getRTRenderContext()); if (myrc == null) return;\n String algorithm = ((JMenuItem) ae.getSource()).getText();\n (new GraphLayouts()).executeLayoutAlgorithm(\n algorithm, graph, myrc.filterEntities(getRTParent().getSelectedEntities()), entity_to_wxy);\n Iterator<String> it = entity_to_wxy.keySet().iterator();\n String str = null; double x0 = 0.0, x1 = 1.0, y0 = 0.0, y1 = 1.0;\n if (it.hasNext()) {\n str = it.next(); \n x0 = entity_to_wxy.get(str).getX();\n y0 = entity_to_wxy.get(str).getY();\n x1 = entity_to_wxy.get(str).getX();\n y1 = entity_to_wxy.get(str).getY();\n }\n while (it.hasNext()) { \n str = it.next(); \n if (x0 > entity_to_wxy.get(str).getX()) x0 = entity_to_wxy.get(str).getX();\n if (y0 > entity_to_wxy.get(str).getY()) y0 = entity_to_wxy.get(str).getY();\n if (x1 < entity_to_wxy.get(str).getX()) x1 = entity_to_wxy.get(str).getX();\n if (y1 < entity_to_wxy.get(str).getY()) y1 = entity_to_wxy.get(str).getY();\n }\n if (x1 == x0) { x0 -= 1.0; x1 += 1.0; }\n if (y1 == y0) { y0 -= 1.0; y1 += 1.0; }\n double xp = (x1 - x0)*0.05, yp = (y1 - y0)*0.05;\n extents = new Rectangle2D.Double(x0-xp,y0-yp,x1-x0+2*xp,y1-y0+2*yp);\n transform(); getRTComponent().render();\n } } );\n }\n\n // - Mode\n getRTPopupMenu().addSeparator();\n JMenu menu; \n menu = new JMenu(\"Mode\"); getRTPopupMenu().add(menu); bg = new ButtonGroup();\n menu.add(edit_rbmi = new JRadioButtonMenuItem(\"Edit\",true)); bg.add(edit_rbmi);\n menu.add(filter_rbmi = new JRadioButtonMenuItem(\"Filter\")); bg.add(filter_rbmi);\n menu.add(edgelens_rbmi = new JRadioButtonMenuItem(\"EdgeLens\")); bg.add(edgelens_rbmi);\n menu.add(timeline_rbmi = new JRadioButtonMenuItem(\"Timeline\")); bg.add(timeline_rbmi);\n\n // - Sizes, Colors\n getRTPopupMenu().addSeparator();\n menu = new JMenu(\"Node Size\"); getRTPopupMenu().add(menu); bg = new ButtonGroup();\n node_sizes = new JRadioButtonMenuItem[NODE_SZ_STRS.length]; for (int i=0;i<NODE_SZ_STRS.length;i++) { menu.add(node_sizes[i] = new JRadioButtonMenuItem(NODE_SZ_STRS[i],i==0)); bg.add(node_sizes[i]); defaultListener(node_sizes[i]); }\n menu = new JMenu(\"Node Color\"); getRTPopupMenu().add(menu); bg = new ButtonGroup();\n node_colors = new JRadioButtonMenuItem[NODE_CO_STRS.length]; for (int i=0;i<NODE_CO_STRS.length;i++) { menu.add(node_colors[i] = new JRadioButtonMenuItem(NODE_CO_STRS[i],i==0)); bg.add(node_colors[i]); defaultListener(node_colors[i]); }\n menu = new JMenu(\"Link Size\"); getRTPopupMenu().add(menu); bg = new ButtonGroup();\n link_sizes = new JRadioButtonMenuItem[LINK_SZ_STRS.length]; for (int i=0;i<LINK_SZ_STRS.length;i++) { menu.add(link_sizes[i] = new JRadioButtonMenuItem(LINK_SZ_STRS[i],i==0)); bg.add(link_sizes[i]); defaultListener(link_sizes[i]); }\n menu.addSeparator();\n menu.add(link_trans_cbmi = new JCheckBoxMenuItem(\"Enable Link Transpency\", true));\n menu.add(link_curves_cbmi = new JCheckBoxMenuItem(\"Use Curves (Beta)\"));\n menu.add(arrows_cbmi = new JCheckBoxMenuItem(\"Draw Arrows\"));\n menu.add(timing_cbmi = new JCheckBoxMenuItem(\"Draw Timing Marks\"));\n menu = new JMenu(\"Link Color\"); getRTPopupMenu().add(menu); bg = new ButtonGroup();\n link_colors = new JRadioButtonMenuItem[LINK_CO_STRS.length]; for (int i=0;i<LINK_CO_STRS.length;i++) { menu.add(link_colors[i] = new JRadioButtonMenuItem(LINK_CO_STRS[i],i==0)); bg.add(link_colors[i]); defaultListener(link_colors[i]); }\n\n // - Rendering options\n getRTPopupMenu().addSeparator();\n getRTPopupMenu().add(dyn_label_cbmi = new JCheckBoxMenuItem(\"Dynamic Labels\", true));\n getRTPopupMenu().add(recalc_bounds_cbmi = new JCheckBoxMenuItem(\"Recalculate Bounds On Re-Draw\", false));\n getRTPopupMenu().add(vertex_placement_heatmap_cbmi = new JCheckBoxMenuItem(\"Vertex Placement Heatmap (Experimental)\", false));\n\n // - Add growth options\n menu = new JMenu(\"Expansion/Filter\");\n getRTPopupMenu().addSeparator();\n getRTPopupMenu().add(menu);\n menu.add(mi = new JMenuItem(\"Add All Bundles On Visible Links\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { addAllOnVisibleLinks(); } } );\n menu.add(mi = new JMenuItem(\"Make 1-Hop Links Visible\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { makeOneHopsVisible(false); } } );\n menu.add(mi = new JMenuItem(\"Make 1-Hop Links Visible (Directional)\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { makeOneHopsVisible(true); } } );\n menu.addSeparator();\n menu.add(mi = new JMenuItem(\"Only Keep Bidirectional Links\")); mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { filterToBidirectionalLinks(); } } );\n\n // - Selection\n menu = new JMenu(\"Select By\"); getRTPopupMenu().add(menu);\n Iterator<Utils.Symbol> it_sym = EnumSet.allOf(Utils.Symbol.class).iterator();\n while (it_sym.hasNext()) { Utils.Symbol symbol = it_sym.next(); menu.add(mi = new JMenuItem(\"\"+symbol)); mi.addActionListener(new SymbolSelector(symbol)); }\n\n getRTPopupMenu().addSeparator();\n getRTPopupMenu().add(mi = new JMenuItem(\"Retain Visible Nodes Only (Destructive, Locally)\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { retainOnlyVisibleNodes(); } } );\n getRTPopupMenu().add(mi = new JMenuItem(\"Add Selection To Retained\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { addSelectionToRetained(); } } );\n getRTPopupMenu().add(mi = new JMenuItem(\"Clear Retained Set\"));\n mi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { clearRetained(); } } );\n\n getRTPopupMenu().addSeparator();\n\n // - Test graphs\n // -- Create the listener\n ActionListener graphfactory_al = new ActionListener() { public void actionPerformed(ActionEvent ae) {\n if (ae.getSource() instanceof JMenuItem) { \n // Get the type from the label and instantiate the graph\n String type_str = ((JMenuItem) ae.getSource()).getText();\n\tGraphFactory.Type type = GraphFactory.toType(type_str);\n MyGraph mygraph = GraphFactory.createInstance(type, null);\n\n\t// Create the specialized tablet\n String header[] = { \"from\", \"to\", \"source\" };\n Tablet tablet = getRTParent().getRootBundles().findOrCreateTablet(header);\n\n\t// Go through the nodes and add them to the tablet\n for (int i=0;i<mygraph.getNumberOfEntities();i++) {\n String node = mygraph.getEntityDescription(i);\n\t for (int j=0;j<mygraph.getNumberOfNeighbors(i);j++) {\n\t String nbor = mygraph.getEntityDescription(mygraph.getNeighbor(i,j));\n\n\t // Add the record\n\t Map<String,String> attr = new HashMap<String,String>();\n\t attr.put(\"from\", node);\n\t attr.put(\"to\", nbor);\n\t attr.put(\"source\", \"GraphFactory\");\n\n\t tablet.addBundle(attr);\n } } \n // Force the change\n Set<Bundles> bundles_set = new HashSet<Bundles>(); bundles_set.add(getRTParent().getRootBundles());\n getRTParent().getRootBundles().getGlobals().cleanse(bundles_set);\n // Update the dropdowns\n getRTParent().updateBys();\n } } };\n\n // -- Fill out the menu\n menu = new JMenu(\"Test Graphs\"); getRTPopupMenu().add(menu);\n Iterator<GraphFactory.Type> it_gt = GraphFactory.graphTypeIterator();\n while (it_gt.hasNext()) {\n mi = new JMenuItem(GraphFactory.toString(it_gt.next()));\n menu.add(mi);\n mi.addActionListener(graphfactory_al);\n }\n \n // Create the southern panel\n JPanel panel = new JPanel(new FlowLayout()); JButton clear_tags_bt;\n panel.add(new JLabel(\"Select\"));\n panel.add(select_tf = new JTextField(16)); select_tf.setToolTipText(\"(+/-/*/! sub/IP/CIDR/REGEX:)\"); new JTextFieldHistory(select_tf);\n panel.add(new JLabel(\"Tag\"));\n panel.add(tag_tf = new JTextField(16)); tag_tf.setToolTipText(Utils.getTagToolTip()); new JTextFieldHistory(tag_tf);\n panel.add(clear_tags_bt = new JButton(\"Clear Tags\"));\n add(\"South\", panel);\n\n // Listeners\n add_relationship_mi.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent ae) { addRelationshipDialog(); } } );\n delete_relationship_mi.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent ae) { deleteRelationshipDialog(); } } );\n add_header_relationships_mi.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent ae) { addHeaderRelationships(false); } } );\n add_header_relationships_types_mi.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent ae) { addHeaderRelationships(true); } } );\n add_header_relationships_stars_mi.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent ae) { addHeaderRelationshipsStars(false); } } );\n add_header_relationships_types_stars_mi.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent ae) { addHeaderRelationshipsStars(true); } } );\n defaultListener(link_curves_cbmi);\n defaultListener(link_trans_cbmi);\n defaultListener(arrows_cbmi);\n defaultListener(timing_cbmi);\n\n select_tf. addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { select(select_tf.getText()); } } );\n tag_tf. addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { tagSelectedEntities(tag_tf.getText()); } } );\n clear_tags_bt.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { clearEntityTagsForSelectedEntities(); } } );\n }", "private void setup() {\r\n\t\tscrollPane.setContent(iv);\r\n\t\tiv.setPickOnBounds(true);\r\n\t\tiv.requestFocus();\r\n\t\tiv.setOnMouseClicked(e -> {\r\n\t\tswitch (click) {\r\n\t\t\tcase 0:\r\n\t\t\t\tlines = image.getRGB((int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\tColor lColH = new Color(lines);\r\n\t\t\t\tjavafx.scene.paint.Color lCol = javafx.scene.paint.Color.rgb(lColH.getRed(), lColH.getGreen(), lColH.getBlue(), lColH.getTransparency());\r\n\t\t\t\twallRect.setFill(lCol);\r\n\t\t\t\tclick++;\r\n\t\t\t\te.consume();\r\n\t\t\t\tstateLabel.setText(\"Click on a corrider\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\tspace = image.getRGB((int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\tclick++;\r\n\t\t\t\tColor sColH = new Color(space);\r\n\t\t\t\tjavafx.scene.paint.Color sCol = javafx.scene.paint.Color.rgb(sColH.getRed(), sColH.getGreen(), sColH.getBlue(), sColH.getTransparency());\r\n\t\t\t\tspaceRect.setFill(sCol);\r\n\t\t\t\te.consume();\r\n\t\t\t\tstateLabel.setText(\"Choose start location\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tstart = new Pair<Integer, Integer>(\r\n\t\t\t\t\t\t(int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\timage.setRGB(start.getKey(), start.getValue(), Color.BLUE.getRGB());\r\n\t\t\t\tiv.setImage(SwingFXUtils.toFXImage(image, null));\r\n\t\t\t\tclick++;\r\n\t\t\t\tstateLabel.setText(\"Choose end location\");\r\n\t\t\t\te.consume();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tend = new Pair<Integer, Integer>(\r\n\t\t\t\t\t\t(int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\te.consume();\r\n\t\t\t\timage.setRGB(end.getKey(), end.getValue(), Color.BLUE.getRGB());\r\n\t\t\t\tiv.setImage(SwingFXUtils.toFXImage(image, null));\r\n\t\t\t\tclick++;\r\n\t\t\t\tsolveButton.setDisable(false);\r\n\t\t\t\tstateLabel.setText(\"Ready to solve\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t\tzoomProperty.addListener(new InvalidationListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void invalidated(Observable arg0) {\r\n\t\t\t\tiv.setFitWidth(zoomProperty.get() * 4);\r\n\t\t\t\tiv.setFitHeight(zoomProperty.get() * 3);\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tscrollPane.addEventFilter(ScrollEvent.ANY, new EventHandler<ScrollEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ScrollEvent event) {\r\n\t\t\t\tif (event.getDeltaY() > 0) {\r\n\t\t\t\t\tzoomProperty.set(zoomProperty.get() * 1.1);\r\n\t\t\t\t} else if (event.getDeltaY() < 0) {\r\n\t\t\t\t\tzoomProperty.set(zoomProperty.get() / 1.1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t\tiv.setSmooth(false);\r\n\t\tiv.preserveRatioProperty().set(true);\r\n\t}", "public BracketPane(Bracket currentBracket) {\n displayedSubtree=0;\n this.currentBracket = currentBracket;\n\n bracketMap = new HashMap<>();\n nodeMap = new HashMap<>();\n panes = new HashMap<>();\n nodes = new ArrayList<>();\n ArrayList<Root> roots = new ArrayList<>();\n\n center = new GridPane();\n\n ArrayList<StackPane> buttons = new ArrayList<>();\n buttons.add(customButton(\"EAST\"));\n buttons.add(customButton(\"WEST\"));\n buttons.add(customButton(\"MIDWEST\"));\n buttons.add(customButton(\"SOUTH\"));\n buttons.add(customButton(\"FULL\"));\n\n ArrayList<GridPane> gridPanes = new ArrayList<>();\n\n for (int m = 0; m < buttons.size() - 1; m++) {\n roots.add(new Root(3 + m));\n panes.put(buttons.get(m), roots.get(m));\n }\n Pane finalPane = createFinalFour();\n //buttons.add(customButton(\"FINAL\"));\n //panes.put(buttons.get(5), finalPane);\n fullPane = new GridPane();\n GridPane gp1 = new GridPane();\n gp1.add(roots.get(0), 0, 0);\n gp1.add(roots.get(1), 0, 1);\n GridPane gp2 = new GridPane();\n gp2.add(roots.get(2), 0, 0);\n gp2.add(roots.get(3), 0, 1);\n gp2.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);\n\n fullPane.add(gp1, 0, 0);\n fullPane.add(finalPane, 1, 0, 1, 2);\n fullPane.add(gp2, 2, 0);\n fullPane.setAlignment(Pos.CENTER);\n panes.put(buttons.get((buttons.size() - 1)), fullPane);\n finalPane.toBack();\n\n // Initializes the button grid\n GridPane buttonGrid = new GridPane();\n for (int i = 0; i < buttons.size(); i++)\n buttonGrid.add(buttons.get(i), 0, i);\n buttonGrid.setAlignment(Pos.CENTER);\n\n // set default center to the button grid\n this.setCenter(buttonGrid);\n\n for (StackPane t : buttons) {\n t.setOnMouseEntered(mouseEvent -> {\n t.setStyle(\"-fx-background-color: lightblue;\");\n t.setEffect(new InnerShadow(10, Color.LIGHTCYAN));\n });\n t.setOnMouseExited(mouseEvent -> {\n t.setStyle(\"-fx-background-color: orange;\");\n t.setEffect(null);\n });\n t.setOnMouseClicked(mouseEvent -> {\n setCenter(null);\n /**\n * @update Grant & Tyler \n * \t\t\tpanes are added as ScrollPanes to retain center alignment when moving through full-view and region-view\n */\n center.add(new ScrollPane(panes.get(t)), 0, 0);\n center.setAlignment(Pos.CENTER);\n setCenter(center);\n //Grant 5/7 this is for clearing the tree it kind of works \n displayedSubtree=buttons.indexOf(t)==7?0:buttons.indexOf(t)+3;\n });\n }\n\n }", "public void copyNode ()\n {\n Clipboard clipboard = _tree.getToolkit().getSystemClipboard();\n clipboard.setContents(_tree.createClipboardTransferable(), ConfigEditor.this);\n _clipclass = group.getConfigClass();\n _paste.setEnabled(!_readOnly);\n }", "public FramedPane() {\n\t\tLoggingTool.print( \"Constructing new FramedPane.\" );\n\t\t// Draw Frame\n\t\tLine topLine = new Line( 1, 1, this.getWidth(), 1 );\n\t\tLine rightLine = new Line( this.getWidth(), 1, this.getWidth(), this.getHeight() );\n\t\tLine leftLine = new Line( 1, 1, 1, this.getHeight() );\n\t\tLine bottomLine = new Line( 1, this.getHeight(), this.getWidth(), this.getHeight() );\n\n\t\ttopLine.endXProperty().bind( this.widthProperty().subtract( 1 ) );\n\n\t\trightLine.startXProperty().bind( this.widthProperty().subtract( 1 ) );\n\t\trightLine.endXProperty().bind( rightLine.startXProperty() );\n\t\trightLine.endYProperty().bind( this.heightProperty().subtract( 1 ) );\n\n\t\tleftLine.endYProperty().bind( this.heightProperty().subtract( 1 ) );\n\n\t\tbottomLine.startYProperty().bind( this.heightProperty().subtract( 1 ) );\n\t\tbottomLine.endXProperty().bind( this.widthProperty().subtract( 1 ) );\n\t\tbottomLine.endYProperty().bind( bottomLine.startYProperty() );\n\n\t\tthis.getChildren().addAll( topLine, rightLine, leftLine, bottomLine );\n\t}", "@Override\n\tpublic Composite createTab(CTabFolder parent) {\n\t\tmIconCache = PowerMan.getSingleton(MainDesigner.class).getIconCache();\n\n\t\tmTree = new Tree(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI);\n\n\t\tmTree.addSelectionListener(new SelectionListener() {\n\t\t\tpublic void widgetSelected(SelectionEvent event) {\n\t\t\t\tfinal TreeItem[] selection = mTree.getSelection();\n\t\t\t\tif (selection != null && selection.length != 0) {\n\t\t\t\t\tTreeItem item = selection[0];\n//\t\t\t\t\titem.setExpanded(!item.getExpanded());\n\t\t\t\t\t\n\t\t\t\t\tfinal String path = getItemData(item, 0);\n\t\t\t\t\tif (ResJudge.isLegalResAndExisted(path)) {\n\t\t\t\t\t\tPreviewPictureTab prev = PowerMan.getSingleton(PreviewPictureTab.class);\n//\t\t\t\t\t\tImageWindow.getSingleton().open(path, mTree);\n\t\t\t\t\t\tprev.setResid(path);\n//\t\t\t\t\t\tmResTree.forceFocus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent event) {\n\t\t\t\tfinal TreeItem[] selection = mTree.getSelection();\n\t\t\t\tif (selection != null && selection.length != 0) {\n\t\t\t\t\tTreeItem itemInit = selection[0];\n\t\t\t\t\tif (itemInit != null) {\n\t\t\t\t\t\tfinal String pathInit = getItemData(itemInit, 0);\n\t\t\t\t\t\tTpConfig tpc = ResPackerHelper.readPackerConfig(pathInit);\n\t\t\t\t\t\tif (tpc == null) {\n\t\t\t\t\t\t\ttpc = new TpConfig();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfinal TpConfigPanel tpcp = new TpConfigPanel();\n\t\t\t\t\t\tfinal TpConfig newTpc = tpcp.open(tpc, PowerMan.getSingleton(MainDesigner.class).getShell());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (newTpc != null) {\n\t\t\t\t\t\t\tfor (TreeItem item : selection) {\n\t\t\t\t\t\t\t\tfinal String path = getItemData(item, 0);\n\t\t\t\t\t\t\t\tif (FileHelper.isDir(path)) {\n\t\t\t\t\t\t\t\t\tif (newTpc != null) {\n\t\t\t\t\t\t\t\t\t\tResPackerHelper.writePackerConfig(path, newTpc);\n\t\t\t\t\t\t\t\t\t\titem.setData(\"tpc\", newTpc);\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\n\t\t\t\tevent.doit = false;\n\t\t\t}\n\t\t});\n\t\t\n\t\tmTree.addKeyListener(new KeyListener() {\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\t\t\t}\n\t\t\t\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tswitch (e.keyCode) {\n\t\t\t\tcase 'F':\n\t\t\t\tcase 'f':\n\t\t\t\t\tif ((e.stateMask & PlatformHelper.CTRL) != 0) {\n\t\t\t\t\t\topenSearch();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\n\t\tfinal String[] columnTitles = new String[] { \"file\", \"pack\" };\n\n\t\tfor (int i = 0; i < columnTitles.length; i++) {\n\t\t\tTreeColumn treeColumn = new TreeColumn(mTree, SWT.NONE);\n\t\t\ttreeColumn.setText(columnTitles[i]);\n\t\t\ttreeColumn.setMoveable(true);\n\t\t}\n\t\tmTree.setHeaderVisible(true);\n\t\t\n\t\tbuildTree();\n\n\t\tfinal int columnCount = mTree.getColumnCount();\n\t\tfor (int i = 0; i < columnCount; i++) {\n\t\t\tTreeColumn treeColumn = mTree.getColumn(i);\n\t\t\ttreeColumn.pack();\n\t\t\t\n\t\t\ttreeColumn.setWidth(200);\n\t\t}\n\n\t\tsetDND();\n\t\tsetMenu();\n\t\t\n\t\trun();\n\t\t\n\t\treturn mTree;\n\t}", "private AnchorPane construirCamadas() {\n AnchorPane painelCamadas = new AnchorPane();\n painelCamadas.setPrefSize(400, 400);\n\n /*******************************************\n * [ACORDEON]\n ********************************************/\n this.camadas = new Accordion();\n this.camadas.setPrefSize(370,350);\n this.camadas.setLayoutX(30);\n this.camadas.setLayoutY(10);\n painelCamadas.getChildren().add(camadas);\n\n /*******************************************\n * [IMAGEVIEW SETA]\n ********************************************/\n this.setaImagem = allImage.getImageView(\"seta\");\n this.setaImagem.setFitWidth(26);\n this.setaImagem.setFitHeight(26);\n this.setaImagem.setLayoutY(10);\n this.setaImagem.setVisible(false);\n painelCamadas.getChildren().add(setaImagem);\n\n\n /*******************************************\n * [CAMADA DE APLICACAO]\n ********************************************/\n camadaAplicacao = new Camada(\"Camada Aplicacao\",setaImagem,10,camadas);\n this.camadas.getPanes().add(camadaAplicacao);\n \n /*******************************************\n * [CAMADA ENLACE DE DADOS]\n ********************************************/\n camadaEnlace = new Camada(\"Camada Enlace de Dados\",setaImagem,37,camadas);\n this.camadas.getPanes().add(camadaEnlace);\n\n /*******************************************\n * [CAMADA FISICA]\n ********************************************/\n camadaFisica = new Camada(\"Camada Fisica\",setaImagem,62,camadas);\n this.camadas.getPanes().add(camadaFisica);\n\n return painelCamadas;\n }", "@Override\r\n\tpublic void createPartControl(Composite parent) {\r\n\t\tComposite container = new Composite(parent, SWT.NONE);\r\n\t\tcontainer.setLayout(new FillLayout(SWT.HORIZONTAL));\r\n\r\n\t\ttreeViewer = new TreeViewer(container, SWT.BORDER);\r\n\t\tObservableListTreeContentProvider contentProvider = new ObservableListTreeContentProvider(\r\n\t\t\t\tnew IObservableFactory() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic IObservable createObservable(Object target) {\r\n\t\t\t\t\t\treturn new DecoratingObservableList(\r\n\t\t\t\t\t\t\t\t((Resource) target).getObservableChildren(),\r\n\t\t\t\t\t\t\t\tfalse);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, null);\r\n\t\ttreeViewer.setContentProvider(contentProvider);\r\n\t\tObservableMapLabelProvider labelProvider = new ObservableMapLabelProvider(\r\n\t\t\t\tBeanProperties.value(\"label\").observeDetail(\r\n\t\t\t\t\t\tcontentProvider.getKnownElements())) {\r\n\t\t\tprivate Image folderImage = Activator.getImageDescriptor(\r\n\t\t\t\t\t\"/icons/folder.gif\").createImage();\r\n\t\t\tprivate Image fileImage = Activator.getImageDescriptor(\r\n\t\t\t\t\t\"/icons/file.gif\").createImage();\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Image getImage(Object element) {\r\n\t\t\t\tResource node = (Resource) element;\r\n\t\t\t\tif (node.getType() != Resource.TYPE_ITEM) {\r\n\t\t\t\t\treturn folderImage;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn fileImage;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void dispose() {\r\n\t\t\t\tfolderImage.dispose();\r\n\t\t\t\tfileImage.dispose();\r\n\t\t\t\tsuper.dispose();\r\n\t\t\t}\r\n\t\t};\r\n\t\ttreeViewer.setLabelProvider(labelProvider);\r\n\t\ttreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\r\n\t\t\t\tsyncToolbarStatus();\r\n\t\t\t}\r\n\t\t});\r\n\t\ttreeViewer.addDoubleClickListener(new IDoubleClickListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void doubleClick(DoubleClickEvent event) {\r\n\t\t\t\tResource node = getSelectedItem();\r\n\t\t\t\tif (node != null) {\r\n\t\t\t\t\tif (node.getType() != Resource.TYPE_ITEM) {\r\n\t\t\t\t\t\ttreeViewer.setExpandedState(node,\r\n\t\t\t\t\t\t\t\t!treeViewer.getExpandedState(node));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\teditAction.run();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcreateActions();\r\n\t\tinitializeToolBar();\r\n\t\tinitializeMenu();\r\n\r\n\t\tloadTree(false);\r\n\t}", "@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\tPane root = new Pane();\n\t\troot.setPrefSize(800, 600);\n\t\tString sep = File.separator;\n\t\tString file = \"C:\" + sep + \"Users\" + sep + \"Karakoz\" + sep + \"Downloads\" + sep + \"Civ6_bg\" + \".png\";\n\t\tFile file1 = new File(file);\n\t\t// Creating an image object\n\t\tImage image = new Image(file1.toURI().toString());\n\t\tImageView imageView = new ImageView(image);\n\t\timageView.setFitWidth(850);\n\t\timageView.setFitHeight(650);\n\n\t\tVBox menu0 = new VBox(10);\n\n\t\tmenu0.setTranslateX(100);\n\t\tmenu0.setTranslateY(200);\n\n\t\tMenuButton but_shapes = new MenuButton(\"SHAPES\");\n\n\t\tbut_shapes.setOnMouseClicked(event -> {\n\t\t\tprimaryStage.setTitle(\"SHAPER\");\n\t\t\tGridPane gridPane = new GridPane();\n\t\t\t// Pane Pane = new Pane();\n\t\t\tgridPane.setAlignment(Pos.CENTER);\n\t\t\tgridPane.setStyle(\"-fx-background-color:khaki\");\n\t\t\tgridPane.setHgap(10);\n\t\t\tgridPane.setVgap(10);\n\t\t\tgridPane.setPadding(new Insets(10));\n\n\t\t\tLabel label = new Label(\"Shape\");\n\t\t\tgridPane.add(label, 1, 1, 2, 1);\n\t\t\tlabel.setTextFill(Color.BLACK);\n\t\t\tlabel.setFont(Font.font(30));\n\n\t\t\tComboBox<Shape> shapes = new ComboBox<Shape>(FXCollections.observableArrayList(getShapes()));\n\t\t\tshapes.setPromptText(\"Choose your shape\");\n\t\t\t//shapes.getSelectionModel().select(0);\n\t\t\tshapes.setPrefWidth(300);\n\t\t\tButton but_Draw = new Button(\"Draw\");\n\t\t\tbut_Draw.setPrefWidth(100);\n\t\t\tbut_Draw.setFont(Font.font(13));\n\n\t\t\tButton but_back = new Button(\"Back\");\n\t\t\tbut_back.setPrefWidth(100);\n\t\t\tbut_back.setFont(Font.font(13));\n\n\t\t\tgridPane.add(shapes, 3, 1, 2, 1);\n\t\t\tgridPane.add(but_Draw, 4, 2, 1, 1);\n\t\t\tgridPane.add(but_back, 2, 2, 1, 1);\n\t\t\tbut_Draw.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\n\t\t\t\t\tnew DrawShape(shapes.getValue());\n\t\t\t\t}\n\t\t\t});\n\t\t\tbut_back.setOnAction(even -> {\n\t\t\t\tStage stage = (Stage) but_back.getScene().getWindow();\n\t\t\t\tstage.close();\n\t\t\t});\n\n\t\t\tStage mainStage = new Stage();\n\t\t\tmainStage.initStyle(StageStyle.UNDECORATED);\n\t\t\tmainStage.setScene(new Scene(new StackPane(gridPane), 850, 650));\n\t\t\tmainStage.show();\n\t\t});\n\t\tMenuButton but_about = new MenuButton(\"About\");\n\t\tbut_about.setOnMouseClicked(event -> {\n\t\t\tGridPane gridPane = new GridPane();\n\t\t\tgridPane.setStyle(\"-fx-background-color:lightsteelblue\");\n\n\t\t\tLabel label = new Label();\n\t\t\tlabel.setFont(Font.font(20));\n\t\t\tgridPane.add(label, 1, 1, 2, 1);\n\t\t\tlabel.setText(\"\\n This program created by future programmer \"\n\t\t\t\t\t+ \" \\n Madiyar Zhorakhan \"\n\t\t\t\t\t+ \" \\n This program draw geometric shapes. Draw this \"\n\t\t\t\t\t+ \" \\n shapes: circle, ellipse, square, rectangle, trape-\"\n\t\t\t\t\t+ \" \\n soid, triangle, parallelogram , rombus, kite, penta-\" + \" \\n gon and hexagon !!! \");\n\n\t\t\tButton butBack = new Button(\"BACK\");\n\t\t\tgridPane.add(butBack, 1, 2, 1, 1);\n\t\t\tbutBack.setPrefWidth(100);\n\n\t\t\tbutBack.setOnAction(e -> {\n\t\t\t\tStage stage = (Stage) butBack.getScene().getWindow();\n\t\t\t\tstage.close();\n\t\t\t});\n\t\t\tStage aboutStage = new Stage();\n\t\t\taboutStage.initStyle(StageStyle.UNDECORATED);\n\t\t\taboutStage.setScene(new Scene(new StackPane(gridPane), 450, 510));\n\t\t\taboutStage.show();\n\t\t});\n\n\t\tMenuButton but_exit = new MenuButton(\"EXIT\");\n\t\tbut_exit.setOnMouseClicked(event -> {\n\t\t\tSystem.exit(0);\n\n\t\t});\n\n\t\tmenu0.getChildren().addAll(but_shapes, but_about, but_exit);\n\n\t\troot.getChildren().addAll(imageView, menu0);\n\n\t\tScene scene = new Scene(root, 850, 650);\n\t\tprimaryStage.initStyle(StageStyle.UNDECORATED);\n\t\tprimaryStage.setScene(scene);\n\t\tprimaryStage.show();\n\n\t}", "public void createChequeStage(){\n chequeStage = new Stage();\n BorderPane chequePageBp = new BorderPane();\n \n String headerTextMain = \"Cheque Account\";\n setBorderPaneTop(chequePageBp, headerTextMain, chequeStage);\n setBorderPaneCenterCheque(chequePageBp);\n setBorderPaneBottomCheque(chequePageBp, chequeStage);\n \n Scene sceneCheque = new Scene(chequePageBp,Constants.SCENEWIDTH, Constants.SCENEHEIGHT);\n sceneCheque.getStylesheets().add(\"/styles/aitBank.css\");// add connection to stylesheet per scene\n chequeStage.setTitle(bankName);\n chequeStage.setScene(sceneCheque);\n }", "public CssBackgroundClip() {\r\n\tbgclip = border;\r\n }", "private void setTree() throws IOException {\n TreeItem<File> root = new TreeItem<>();\n dirFolders.setRoot(buildTree(model.DirectoryManager.getTree(), root));\n dirFolders.setRoot(root.getChildren().get(0));\n\n // format cellFactory\n // we want to show file name in UI although treeView stores File object\n // Add directory logo if the file is a directory\n // Add photo thumbnail if the file is a photo\n dirFolders.setCellFactory(\n new Callback<TreeView<File>, TreeCell<File>>() {\n @Override\n public TreeCell<File> call(TreeView<File> param) {\n return new TreeCell<File>() {\n @Override\n protected void updateItem(File item, boolean empty) {\n super.updateItem(item, empty);\n if (item != null) {\n if (item.isDirectory()) {\n setGraphic(\n new ImageView(\n new Image(getClass().getResourceAsStream(\"/views/folder.png\"))));\n setDisclosureNode(null);\n File[] fileList = item.listFiles();\n if (fileList != null) {\n if (fileList.length == 0) {\n setDisable(true);\n }\n }\n } else {\n ImageView image = new ImageView(\"File:\" + item.getPath());\n image.setFitHeight(32);\n image.setFitWidth(36);\n setGraphic(image);\n }\n setText(item.getName());\n }\n }\n };\n }\n });\n\n // handle onClickAction\n dirFolders\n .getSelectionModel()\n .selectedItemProperty()\n .addListener(\n (observable, oldValue, newValue) -> {\n if (!dirFolders.getSelectionModel().getSelectedItem().getValue().isDirectory()) {\n model.User.setPhoto(\n model.PhotoManager.getPhoto(\n dirFolders.getSelectionModel().getSelectedItem().getValue().getPath()));\n try {\n loadNextScene(rootPane, \"/views/focusPhotoPane.fxml\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n Stage curStage = (Stage) rootPane.getScene().getWindow();\n File selectedDirectory =\n dirFolders.getSelectionModel().getSelectedItem().getValue();\n if (selectedDirectory != null) {\n Directory dir =\n DirectoryManager.getCurrentDirectory(selectedDirectory.getPath());\n if (dir != null) {\n model.User.setGalleryPhotos(dir.getPhotos());\n fadeOutEvent();\n }\n } else {\n curStage.show();\n }\n }\n });\n }", "@FXML\n private void showMenu(){\n Main.setPane(0);\n }", "public void createPartControl(Composite parent) {\n\t\tviewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tdrillDownAdapter = new DrillDownAdapter(viewer);\n\t\tviewer.setContentProvider(new ViewContentProvider());\n\t\tviewer.setLabelProvider(new ViewLabelProvider());\n\t\tviewer.setSorter(new NameSorter());\n\t\tviewer.setInput(getViewSite());\n\n\t\t// Create the help context id for the viewer's control\n\t\tPlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), \"TreeView.viewer\");\n\t\tmakeActions();\n\t\thookContextMenu();\n\t\thookDoubleClickAction();\n\t\tcontributeToActionBars();\n\t}", "public void set() {\n\n\t\tStage newWindow = new Stage();\n\t\tnewWindow.setScene(scene);\n\t\tnewWindow.initModality(Modality.WINDOW_MODAL);\n\t\tnewWindow.initOwner(primaryStage);\n\n\t\tnewWindow.show();\n\n\t\tCircle cir = new Circle(num*36.5+117.5, num*73+145, 70);\n\t\tcir.setFill(Color.ALICEBLUE);\n\t\troot.getChildren().add(cir);\n\n\t\tImage i = null;\n\t\ttry {\n\t\t\ti = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/Button - ?.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tCircle cirI = new Circle(50, num*73+105, 35); \n\t\tcirI.setFill(new ImagePattern(i)); \n\t\tcirI.setEffect(new DropShadow(+25d, 0d, +2d, Color.ALICEBLUE));\n\t\troot.getChildren().add(cirI);\n\t\tcirI.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tsetIns();\n\t\t\t}\n\t\t});\n\n\t\tImage u = null;\n\t\ttry {\n\t\t\tu = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/Button - Undo.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tCircle cirU = new Circle(num*73+185, num*73+105, 35); \n\t\tcirU.setFill(new ImagePattern(u)); \n\t\troot.getChildren().add(cirU);\n\t\tcirU.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tundo = true;\n\t\t\t}\n\t\t});\n\n\t\tText scoreLine = new Text(num*36.5+72.5, 34, \"Score: \"+score);\n\t\tscoreLine.setFont(Font.font(\"Verdana\", FontWeight.THIN, FontPosture.REGULAR, 20));\n\t\tscoreLine.setFill(Color.CADETBLUE);\n\t\troot.getChildren().add(scoreLine);\n\n\t\tupdateTiles(currentTiles);\n\t\tupdateBoard(arr);\n\t\ttiles.push(currentTiles);\n\n\t\tAnimationTimer timer = new AnimationTimer() {\n\t\t\t@Override\n\t\t\tpublic void handle(long arg0) {\n\t\t\t\tif(undo) {\n\t\t\t\t\tif(lastUndo>0 && field.size()>0 && tiles.size()>0) {\n\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\tif(currentTiles[0]!=0)\n\t\t\t\t\t\t\troot.getChildren().remove(b);\n\t\t\t\t\t\tSystem.out.println(field.size());\n\t\t\t\t\t\tarr = (int[][]) field.pop();\n\n\t\t\t\t\t\tcurrentTiles = (int[]) tiles.pop();\n\t\t\t\t\t\tisUpdatedT = false;\n\n\t\t\t\t\t\tisUpdatedB = false;\n\t\t\t\t\t\tupdateBoard(arr);\n\t\t\t\t\t\tisUpdatedB = true;\n\n\t\t\t\t\t\tscore = (int) sc.pop();\n\t\t\t\t\t\tlastUndo = 0;\n\t\t\t\t\t\tfield.clear();\n\t\t\t\t\t\ttiles.clear();\n\t\t\t\t\t\tsc.clear();\n\t\t\t\t\t}\n\t\t\t\t\tundo = false;\n\t\t\t\t}\n\n\t\t\t\tif(lastUndo>0) {\n\t\t\t\t\tcirU.setEffect(new DropShadow(+25d, 0d, +2d, Color.ALICEBLUE));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcirU.setEffect(new DropShadow(0d, 0d, 0d, Color.ALICEBLUE));\n\n\t\t\t\ta.setOnDragDetected(new EventHandler<MouseEvent>() {\n\t\t\t\t\tpublic void handle(MouseEvent event) {\n\n\t\t\t\t\t\tDragboard db = a.startDragAndDrop(TransferMode.ANY);\n\n\t\t\t\t\t\tcaseTile = 1;\n\n\t\t\t\t\t\tClipboardContent content = new ClipboardContent();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontent.putImage(clipboard.getImage(-1*currentTiles[1]));\n\t\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.setContent(content);\n\n\t\t\t\t\t\tevent.consume();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tb.setOnDragDetected(new EventHandler<MouseEvent>() {\n\t\t\t\t\tpublic void handle(MouseEvent event) {\n\n\t\t\t\t\t\tDragboard db = b.startDragAndDrop(TransferMode.ANY);\n\n\t\t\t\t\t\tcaseTile = 2;\n\n\t\t\t\t\t\tClipboardContent content = new ClipboardContent();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontent.putImage(clipboard.getImage(-1*currentTiles[2]));\n\t\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.setContent(content);\n\n\t\t\t\t\t\tevent.consume();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif(isUpdatedT==false)\n\t\t\t\t\tupdateTiles(currentTiles);\n\t\t\t\tif(isUpdatedB==false)\n\t\t\t\t\tupdateBoard(arr);\n\t\t\t\tgameOver = isDead(arr, currentTiles);\n\t\t\t\tscoreLine.setText(\"Score: \"+score);\n\n\t\t\t\tif(gameOver) {\n\t\t\t\t\tthis.stop();\n\t\t\t\t\tdeadIns(num, newWindow, scoreLine, root, score);\n\t\t\t\t\tlastUndo = 0;\n\t\t\t\t\tfield.clear();\n\t\t\t\t\ttiles.clear();\n\t\t\t\t\tsc.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\troot.setOnDragOver(new EventHandler<DragEvent>() {\n\t\t\tpublic void handle(DragEvent event) {\n\n\t\t\t\tif (event.getGestureSource() != root && event.getDragboard().hasImage()) {\n\t\t\t\t\tevent.acceptTransferModes(TransferMode.MOVE);\n\t\t\t\t}\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\n\t\troot.setOnDragDropped(new EventHandler<DragEvent>() {\n\t\t\tpublic void handle(DragEvent event) {\n\n\t\t\t\tDragboard db = event.getDragboard();\n\t\t\t\tboolean success = false;\n\t\t\t\tif (db.hasImage()) {\n\n\t\t\t\t\tdouble xPos = event.getSceneX();\n\t\t\t\t\tdouble yPos = event.getSceneY();\n\n\t\t\t\t\tint xInd = (int)(xPos-119)/73;\n\t\t\t\t\tint yInd = (int)(yPos-58)/73;\n\n\t\t\t\t\tif(xInd>=0 && xInd<=num-1 && yInd>=0 && yInd<=num-1) {\n\t\t\t\t\t\tif(isValidMove(yInd, xInd, currentTiles, arr, caseTile)) {\n\n\t\t\t\t\t\t\tlastUndo++;\n\t\t\t\t\t\t\tint tempc[][] = new int[num][num];\n\t\t\t\t\t\t\tfor(int i=0; i<num; i++) {\n\t\t\t\t\t\t\t\tfor(int j=0; j<num; j++) {\n\t\t\t\t\t\t\t\t\ttempc[i][j] = arr[i][j];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfield.push(tempc);\n\t\t\t\t\t\t\tsc.push(score);\n\n\t\t\t\t\t\t\tarr = placeTiles(yInd, xInd, currentTiles, arr, caseTile);\n\t\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\t\tif(currentTiles[0]!=0)\n\t\t\t\t\t\t\t\troot.getChildren().remove(b);\n\n\t\t\t\t\t\t\tisUpdatedT = false;\n\t\t\t\t\t\t\tif(currentTiles[0]==0) {\n\t\t\t\t\t\t\t\tarr = play.merge1(arr, yInd, xInd, score);\n\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(caseTile==1) {\n\t\t\t\t\t\t\t\tif(currentTiles[0]==1) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd+1, xInd, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(currentTiles[0]==2) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd, xInd+1, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif(currentTiles[0]==1) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd-1, xInd, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(currentTiles[0]==2) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd, xInd-1, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttiles.push(currentTiles);\n\t\t\t\t\t\t\tcurrentTiles = play.generateTiles();\n\t\t\t\t\t\t\tupdateTiles(currentTiles);\n\t\t\t\t\t\t\tisUpdatedB = false;\n\t\t\t\t\t\t\tupdateBoard(arr);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsuccess = true;\n\t\t\t\t}\n\t\t\t\tevent.setDropCompleted(success);\n\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\n\t\troot.setOnDragDone(new EventHandler<DragEvent>() {\n\t\t\tpublic void handle(DragEvent event) {\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\n\t\tscene.setOnKeyPressed(new EventHandler<KeyEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(KeyEvent event) {\n\t\t\t\tif(currentTiles[0]!=0) {\n\t\t\t\t\tif (event.getCode() == KeyCode.RIGHT) {\n\t\t\t\t\t\tif(currentTiles[0] == 1) {\n\t\t\t\t\t\t\tcurrentTiles[0] = 2;\n\t\t\t\t\t\t\tint temp = currentTiles[1];\n\t\t\t\t\t\t\tcurrentTiles[1] = currentTiles[2];\n\t\t\t\t\t\t\tcurrentTiles[2] = temp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcurrentTiles[0] = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\troot.getChildren().remove(b);\n\t\t\t\t\t\tisUpdatedT = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif (event.getCode() == KeyCode.LEFT) {\n\t\t\t\t\t\tif(currentTiles[0] == 2) {\n\t\t\t\t\t\t\tcurrentTiles[0] = 1;\n\t\t\t\t\t\t\tint temp = currentTiles[1];\n\t\t\t\t\t\t\tcurrentTiles[1] = currentTiles[2];\n\t\t\t\t\t\t\tcurrentTiles[2] = temp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcurrentTiles[0] = 2;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\troot.getChildren().remove(b);\n\t\t\t\t\t\tisUpdatedT = false;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttimer.start();\n\t}", "public static void newPane(String resourceURL) throws IOException { \n\t\tMain.root = (Pane) FXMLLoader.load(Main.class.getResource(resourceURL));\n\t\t\n\t}", "@FXML\n\tvoid initialize() {\n\t\tm = new PR1Model();\n\t\tsetFile(null);\n\t\tselection = new SimpleObjectProperty<Shape>();\n\t\tapplication = new PR1();\n\t\tsetSelection(null);\n\t\tsetClipboard(null);\n\t\tviewState = new SimpleObjectProperty<ViewState>(ViewState.CLOSE);\n\t\tclipboardState = new SimpleObjectProperty<ClipboardState>(ClipboardState.IDLE);\n\t\tdefaultS = m.add(-50, -50);\n\t\tdefaultS.setText(defaultshape);\n\t\t\n\t\t\n\t\tcanvasListener = new ChangeListener<Number>() {\n\n\t\t\t/**\n\t\t\t * Handles the canvas resizing.\n\t\t\t * \n\t\t\t * @param event The event object.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n\t\t\t\tviewState.set(ViewState.RESIZE);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t\n\n\t\t\n\t\tgc = canvas.getGraphicsContext2D();\n\t\tcanvas.heightProperty().set(1105);\n\t\tcanvas.widthProperty().set(1105);\n\t\tcanvas.heightProperty().addListener(canvasListener);\n\t\tcanvas.widthProperty().addListener(canvasListener);\n\t\t\n\t\t\n\t\ttcs.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttccx.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttccy.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttcr.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttcc.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttcw.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttch.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttcaw.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttcah.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttct.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\ttcd.prefWidthProperty().bind(tv.widthProperty().divide(11));\n\t\t\n\t\ttcs.setCellValueFactory(new PropertyValueFactory<Shape, ShapeType>(\"type\"));\n\t\ttccx.setCellValueFactory(new PropertyValueFactory<Shape, Double>(\"centerX\"));\n\t\ttccy.setCellValueFactory(new PropertyValueFactory<Shape, Double>(\"centerY\"));\n\t\ttcr.setCellValueFactory(new PropertyValueFactory<Shape, Double>(\"radius\"));\n\t\ttcc.setCellValueFactory(new PropertyValueFactory<Shape, Color>(\"color\"));\n\t\ttcw.setCellValueFactory(new PropertyValueFactory<Shape, Double>(\"width\"));\n\t\ttch.setCellValueFactory(new PropertyValueFactory<Shape, Double>(\"height\"));\n\t\ttcaw.setCellValueFactory(new PropertyValueFactory<Shape, Double>(\"arcWidth\"));\n\t\ttcah.setCellValueFactory(new PropertyValueFactory<Shape, Double>(\"arcHeight\"));\n\t\ttct.setCellValueFactory(new PropertyValueFactory<Shape, String>(\"text\"));\n\t\ttcd.setCellValueFactory(new PropertyValueFactory<Shape, Boolean>(\"delete\"));\n\t\t\n\t\tObservableList<ShapeType> shapeValues = FXCollections.observableArrayList(ShapeType.CIRCLE, ShapeType.RECTANGLE, ShapeType.OVAL, ShapeType.ROUNDRECT, ShapeType.TEXT);\n\t\t\n\t\ttcs.setCellFactory(ComboBoxTableCell.forTableColumn(new PR1Model.ShapeTypeStringConverter(), shapeValues));\n\t\ttccx.setCellFactory(TextFieldTableCell.forTableColumn(new DoubleStringConverter()));\n\t\ttccy.setCellFactory(TextFieldTableCell.forTableColumn(new DoubleStringConverter()));\n\t\ttcr.setCellFactory(TextFieldTableCell.forTableColumn(new DoubleStringConverter()));\n\t\t\n\t\ttcw.setCellFactory(TextFieldTableCell.forTableColumn(new DoubleStringConverter()));\n\t\ttch.setCellFactory(TextFieldTableCell.forTableColumn(new DoubleStringConverter()));\n\t\ttcaw.setCellFactory(TextFieldTableCell.forTableColumn(new DoubleStringConverter()));\n\t\ttcah.setCellFactory(TextFieldTableCell.forTableColumn(new DoubleStringConverter()));\n\t\t\n\t\ttcd.setCellFactory(CheckBoxTableCell.forTableColumn(tcd));\n\t\t\n\t\ttct.setCellFactory(TextFieldTableCell.forTableColumn());\n\t\t\n\t\ttcc.setCellFactory(ColorTableCell<Shape>::new);\n\t\t\n\t\tscrpaneright.setFitToHeight(true);\n\t\tscrpaneright.setFitToWidth(true);\n\t\t\n\t\t\n\t\taddMouseListener(new EventHandler<MouseEvent>() {\n\n\t\t\t/**\n\t\t\t * Handles the mouse events.\n\t\t\t * \n\t\t\t * @param event The event object.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent e) {\n\t\t\t\tmouseLastX = e.getX();\n\t\t\t\tmouseLastY = e.getY();\n\t\t\t\tif (viewState.get() == ViewState.CLOSED) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (e.getEventType() == MouseEvent.MOUSE_PRESSED){\n\t\t\t\t\t\n\t\t\t\t\tsetSelection(m.select(e.getX(), e.getY()));\n\t\t\t\t\tif (e.getButton() == MouseButton.PRIMARY) {\n\t\t\t\t\t\tif (getSelection() != null) {\n\t\t\t\t\t\t\tm.setTop(getSelection());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (e.getEventType() == MouseEvent.MOUSE_DRAGGED) {\n\t\t\t\t\tif (getSelection() != null) {\n\t\t\t\t\t\tif (e.getButton() == MouseButton.PRIMARY) {\n\t\t\t\t\t\t\tgetSelection().setCenterX(e.getX());\n\t\t\t\t\t\t\tgetSelection().setCenterY(e.getY());\n\t\t\t\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (e.getButton() == MouseButton.SECONDARY) {\n\t\t\t\t\t\t\tif(getSelection().getType() == ShapeType.CIRCLE) {\n\t\t\t\t\t\t\t\tgetSelection().setRadius(getSelection().getRadius() + 0.25 * (e.getX() - getSelection().getCenterX()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tgetSelection().setWidth(getSelection().getWidth() + 0.25 * (e.getX() - getSelection().getCenterX()));\n\t\t\t\t\t\t\t\tgetSelection().setHeight(getSelection().getHeight() + 0.25 * (e.getY() - getSelection().getCenterY()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (e.getEventType() == MouseEvent.MOUSE_CLICKED) {\n\t\t\t\t\tif (e.getButton().equals(MouseButton.PRIMARY)){\n\t\t\t\t\t\tswitch (e.getClickCount()) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tif (getSelection() == null) {\n\t\t\t\t\t\t\t\tsetSelection(m.add(defaultS.getType(), e.getX(), e.getY()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tsetSelection(m.select(e.getX(), e.getY()));\n\t\t\t\t\t\t\tapplication.goToCD(getSelection());\n\t\t\t\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tm.drawDataProperty().addListener(new ListChangeListener<PR1Model.Shape>() {\n\n\t\t\t/**\n\t\t\t * Handles the model changes.\n\t\t\t * Always repaints, regardless of the event object. Inefficient but works!\n\t\t\t * \n\t\t\t * @param e The event object.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void onChanged(ListChangeListener.Change<? extends PR1Model.Shape> e) { \n\t\t\t\t\n\t\t\t\trepaint(); \n\t\t\t\treTable();\n\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\tviewState.addListener(new ChangeListener<ViewState>() {\n\n\t\t\t/**\n\t\t\t * Handles the view state changes (from File menu and window resizing).\n\t\t\t * \n\t\t\t * @param event The event object.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void changed(ObservableValue<? extends ViewState> observable, ViewState oldValue, ViewState newValue) {\n\t\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\t\tswitch (newValue) {\n\t\t\t\t\tcase CLOSED: // No file opened (when the application starts or when the current file is closed.\n\t\t\t\t\t\tsetFileMenu(false, false, true, true, false); // Configures individual file menu items (enabled/disabled).\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase NEW: // A new file to be opened.\n\t\t\t\t\t\tif (file != null) {\n\t\t\t\t\t\t\tif (file.exists()) {\n\t\t\t\t\t\t\t\tfile.delete(); // Delete the file if it the file with that name already exists (overwrite).\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\tcase OPEN: // An existing file opened.\n\t\t\t\t\t\tif (file != null) {\n\t\t\t\t\t\t\tCharset charset = Charset.forName(\"US-ASCII\");\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfile.createNewFile();\n\t\t\t\t\t\t\t\tBufferedReader reader = Files.newBufferedReader(file.toPath(), charset);\n\t\t\t\t\t\t\t\tString line = null;\n\t\t\t\t\t\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tm.add(line); // Read the file line by line and add the circle (line) to the model.\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch (NumberFormatException e) { } // Ignores an incorrectly formatted line.\n\t\t\t\t\t\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { } // Ignores an incorrectly formatted line.\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tviewState.set(ViewState.OPENED);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (IOException e) {\n\t\t\t\t\t\t\t\tviewState.set(ViewState.CLOSE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase OPENED: // The file is opened.\n\t\t\t\t\t\tsetFileMenu(true, true, false, true, false); // Configures individual file menu items (enabled/disabled).\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CLOSE: // The file has to be closed.\n\t\t\t\t\t\tsetFile(null); // Clears the file.\n\t\t\t\t\t\tsetSelection(null); // Clears the selection;\n\t\t\t\t\t\tsetClipboard(null); // Clears the selection;\n\t\t\t\t\t\tm.clear(); // Clears the model.\n\t\t\t\t\t\tclear(); // Clears the view.\n\t\t\t\t\t\tviewState.set(ViewState.CLOSED);\n\t\t\t\t\t\tbreak;\t\t\t\t\n\t\t\t\t\tcase MODIFIED: // The file has been modified, needs saving.\n\t\t\t\t\t\tsetFileMenu(true, true, true, false, false);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SAVE: // Save the file.\n\t\t\t\t\t\tif (file != null) {\n\t\t\t\t\t\t\tCharset charset = Charset.forName(\"US-ASCII\");\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tBufferedWriter writer = Files.newBufferedWriter(file.toPath(), charset, StandardOpenOption.WRITE);\n\t\t\t\t\t\t\t\tfor (PR1Model.Shape c : m.drawDataProperty()) {\n\t\t\t\t\t\t\t\t\t//For the project, the line needs to be created in a more complicated way than before,\n\t\t\t\t\t\t\t\t\t//so the work is passed off to a function here.\n\t\t\t\t\t\t\t\t\tString line = lineMaker(c);\n\t\t\t\t\t\t\t\t\twriter.write(line);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twriter.close();\n\t\t\t\t\t\t\t\tviewState.set(ViewState.OPENED);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (IOException e) {\n\t\t\t\t\t\t\t\tapplication.goToErrorDialog();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUIT: // Quit the application\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (oldValue == ViewState.MODIFIED) {\n\t\t\t\t\t\t\tapplication.goToQuitDialog();\n\t\t\t\t\t\t\t//if the application didn't quit, setback the viewState\n\t\t\t\t\t\t\tviewState.set(oldValue);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RESIZE: // Redraw the view when the application window resizes.\n\t\t\t\t\t\trepaint();\n\t\t\t\t\t\tviewState.set(oldValue);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\tclipboardState.addListener(new ChangeListener<ClipboardState>() {\n\n\t\t\t/**\n\t\t\t * Handles the clipboard changes.\n\t\t\t * \n\t\t\t * @param event The event object.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void changed(ObservableValue<? extends ClipboardState> observable, ClipboardState oldValue, ClipboardState newValue) {\n\t\t\t\tShape c = null;\n\t\t\t\tif (getSelection() != null) {\n\t\t\t\t\tswitch (newValue) {\n\t\t\t\t\tcase COPY: // Copy the selection to the clipboard. \n\t\t\t\t\t\tsetClipboard(getSelection());\n\t\t\t\t\t\tsetEditMenu(false, false, false); // Enable all Edit menu items.\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PASTE: // Paste the clipboard to the view.\n\t\t\t\t\t\tc = m.add(mouseLastX, mouseLastY);\n\t\t\t\t\t\tc.setRadius(getClipboard().getRadius());\n\t\t\t\t\t\tc.setColor(getClipboard().getColor());\n\t\t\t\t\t\tc.setHeight(getClipboard().getHeight());\n\t\t\t\t\t\tc.setWidth(getClipboard().getWidth());\n\t\t\t\t\t\tc.setArcheight(getClipboard().getAH());\n\t\t\t\t\t\tc.setArcwidth(getClipboard().getAW());\n\t\t\t\t\t\tc.setType(getClipboard().getType());\n\t\t\t\t\t\tc.setText(getClipboard().getText());\n\t\t\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DELETE: // delete the selection.\n\t\t\t\t\t\tc = getSelection();\n\t\t\t\t\t\tsetSelection(null);\n\t\t\t\t\t\tm.remove(c);\n\t\t\t\t\t\tsetEditMenu(true, true, true); // Disable all Edit menu items.\t\t\n\t\t\t\t\t\tviewState.set(ViewState.MODIFIED);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase IDLE:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tclipboardState.set(ClipboardState.IDLE);\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\t\tsetFileMenu(false, false, true, true, false);\n\t\tsetEditMenu(true, true, true);\n\t}", "private void setup() {\n this.primaryStage.setTitle(Constants.APP_NAME);\n\n this.root = new VBox();\n root.setAlignment(Pos.TOP_CENTER);\n root.getChildren().addAll(getMenuBar());\n\n Scene scene = new Scene(root);\n this.primaryStage.setScene(scene);\n\n // set the default game level.\n setGameLevel(GameLevel.BEGINNER);\n\n // fix the size of the game window.\n this.primaryStage.setResizable(false);\n this.primaryStage.show();\n }", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n /* \r\n double sceneWidth = parentPane.getWidth();\r\n double msgWidth = node.getLayoutBounds().getWidth();\r\n\r\n KeyValue initKeyValue = new KeyValue(node.translateXProperty(), sceneWidth);\r\n KeyFrame initFrame = new KeyFrame(Duration.ZERO, initKeyValue);\r\n\r\n KeyValue endKeyValue = new KeyValue(node.translateXProperty(), -1.0\r\n * msgWidth);\r\n KeyFrame endFrame = new KeyFrame(Duration.seconds(5), endKeyValue);\r\n\r\n Timeline timeline = new Timeline(initFrame, endFrame);\r\n\r\n timeline.setCycleCount(Timeline.INDEFINITE);\r\n timeline.play();*/\r\n }", "public void showPane(){\n\t\tpane.draw();\n\t}", "@FXML\n private void settingsClick(){\n mainContainer.getChildren().setAll(settings);\n }", "@Override\n public void start(Stage primaryStage) {\n BorderPane root = new BorderPane();\n\n generateRandomHeights();\n root.setBottom(createSortingDisplay());\n root.setTop(createMenu(root));\n\n primaryStage.setTitle(\"Concurrent Merge Sort Visualizer\");\n primaryStage.setScene(new Scene(root));\n primaryStage.setFullScreen(true);\n primaryStage.show();\n }", "private Parent create() {\n root.setPrefSize(600,600);\r\n\r\n for(int i = 0; i < 3; ++i) {\r\n for(int j = 0; j < 3; ++j) {\r\n Tile tile = new Tile();\r\n tile.setTranslateX(j * 200);\r\n tile.setTranslateY(i * 200);\r\n\r\n root.getChildren().add(tile);\r\n board[j][i] = tile;\r\n }\r\n }\r\n\r\n // horizontal strikes\r\n for(int i = 0; i < 3; ++i) {\r\n comboList.add(new Combination(board[0][i], board[1][i], board[2][i]));\r\n }\r\n\r\n // vertical strikes\r\n for(int j = 0; j < 3; ++j) {\r\n comboList.add(new Combination(board[j][0], board[j][1], board[j][2]));\r\n }\r\n\r\n // diagonal strikes\r\n comboList.add(new Combination(board[0][0], board[1][1], board[2][2]));\r\n comboList.add(new Combination(board[2][0], board[1][1], board[0][2]));\r\n\r\n return root;\r\n }", "private void displayPane(Node p){\n root.setCenter(p);\n //BorderPane.setAlignment(p,Pos.CENTER);\n }", "public void initModule(){\n SplitPane pane = new SplitPane();\n VBox module = (VBox) loader.getNamespace().get(\"vbox_grapher\");\n ScrollPane module_parent = (ScrollPane) loader.getNamespace().get(\"vbox_grapher_parent\");\n\n //bug solution (set resizable with parent):\n module_parent.setFitToHeight(true);\n module_parent.setFitToWidth(true);\n\n //clear(module);\n createGraphes(-1, module);\n }", "public void initialize(){\t\t\n\n\t\tsetBounds(100, 100, 900, 620);\n\t\tcontentPane = new JPanel();\n\t\tcontentPane.setBackground(SystemColor.control);\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\tcontentPane.setLayout(null);\n\t\tsetLayout(null);\n\n\t\t//build the image of the board for toggling the active squares\n\t\t//buildBoardImage();\n\n\t\tboardView = new BoardView(new Color(20,200,160), model, 1, app);\n\t\tboardView.builderInitialize(app);\n\t\tboardView.setSize(408, 440);\n\t\tboardView.setLocation(39, 158);\n\t\tadd(boardView);\n\n\t\tcomboBox = new JComboBox<String>();\n\t\tcomboBox.setModel(new DefaultComboBoxModel<String>(new String[] {\"Puzzle\", \"Lightning\", \"Theme\"}));\n\t\tcomboBox.setToolTipText(\"\");\n\t\tcomboBox.setMaximumRowCount(3);\n\t\tcomboBox.setBounds(593, 158, 97, 26);\n\t\tcomboBox.addItemListener(this);\n\t\tthis.add(comboBox, \"ComboBox\");\n\n\t\tJLabel lblTitle = new JLabel(\"LetterCraze: Builder\");\n\t\tlblTitle.setFont(new Font(\"Impact\", Font.BOLD | Font.ITALIC, 40));\n\t\tlblTitle.setBounds(39, 11, 522, 109);\n\t\tadd(lblTitle);\n\n\t\tpnlLevelSwitch = new JPanel();\n\t\tpnlLevelSwitch.setName(\"pnlLevelSwitch\");\n\t\tpnlLevelSwitch.setBounds(479, 192, 379, 362);\n\t\tpnlLevelSwitch.setLayout(new CardLayout());\n\t\tadd(pnlLevelSwitch);\n\n\t\tJPanel pnlPuzzle = new BuilderPuzzlePanelView(labelFont);\n\t\tpnlLevelSwitch.add(pnlPuzzle, \"Puzzle\");\n\t\tpnlPuzzle.setBackground(new Color(102,255,102));\n\t\tpnlPuzzle.setLayout(null);\n\n\t\tJPanel pnlLightning = new BuilderLightningPanelView();\n\t\tpnlLightning.setBackground(Color.ORANGE);\n\t\tpnlLevelSwitch.add(pnlLightning, \"Lightning\");\n\t\tpnlLightning.setLayout(null);\n\n\n\t\tJPanel pnlTheme = new BuilderThemePanelView(labelFont);\n\t\tpnlTheme.setBackground(Color.PINK);\n\t\tpnlLevelSwitch.add(pnlTheme, \"Theme\");\n\t\tpnlTheme.setLayout(null);\n\n\t\tcontentPane.setVisible(true);\n\t\tcontentPane.repaint();\n\t\tJButton btnReset = new JButton(\"Reset Level\");\n\t\tbtnReset.addMouseListener(new ResetBoardSquaresController(this, model));\n\t\tbtnReset.setBounds(39, 118, 107, 29);\n\t\tadd(btnReset);\n\n\t\tJButton btnSaveLevel = new JButton(\"Save And Exit\");\n\t\tbtnSaveLevel.setBounds(156, 118, 111, 29);\n\t\tbtnSaveLevel.addMouseListener(new SaveLevelController(this, cardLayoutPanel, model));\n\t\t//btnSaveLevel.addMouseListener(new ExitWithoutSavingController(this, cardLayoutPanel, model));\n\t\tadd(btnSaveLevel);\n\n\t\tJLabel lblLevelType = new JLabel(\"Level Type\");\n\t\tlblLevelType.setFont(labelFont);\n\t\tlblLevelType.setBounds(491, 158, 92, 26);\n\t\tadd(lblLevelType);\n\n\t\tJButton btnCloseWithoutSaving = new JButton(\"Close Without Saving\");\n\t\t//TODO replace with close builder controller\n\t\tbtnCloseWithoutSaving.addMouseListener(new ExitWithoutSavingController(this, cardLayoutPanel, model));\n\t\tbtnCloseWithoutSaving.setBounds(273, 118, 174, 29);\n\t\tadd(btnCloseWithoutSaving);\n\t\t\n\t\tJButton btnPreviewLevel = new JButton(\"Show Me The Money!\");\n\t\tbtnPreviewLevel.addMouseListener(new PreviewLevelController(this, model, cardLayoutPanel));\n\t\tbtnPreviewLevel.setBounds(491, 118, 199, 29);\n\t\tadd(btnPreviewLevel);\n\t\trepaint();\n\t}", "void ship_setup() {\n ship = new Ship(level);\n ship_image_view = new ImageView(ship_image);\n ship_image_view.setX(ship.x_position);\n ship_image_view.setY(ship.y_position);\n ship_image_view.setFitWidth(Ship.SHIP_WIDTH);\n ship_image_view.setFitHeight(Ship.SHIP_HEIGHT);\n game_pane.getChildren().add(ship_image_view);\n }", "public static void borderPane(Stage primaryStage) {\n BorderPane pane = new BorderPane();\n\n // Place nodes in the pane\n pane.setTop(new CustomPane(\"Top\"));\n pane.setRight(new CustomPane(\"Right\"));\n pane.setBottom(new CustomPane(\"Bottom\"));\n pane.setLeft(new CustomPane(\"Left\"));\n pane.setCenter(new CustomPane(\"Center\"));\n\n // Create a scene and place it in the stage\n Scene scene = new Scene(pane);\n primaryStage.setTitle(\"ShowBorderPane\"); // Set the stage title\n primaryStage.setScene(scene); // Place the scene in the stage\n primaryStage.show(); // Display the stage\n }", "public void Pj() {\n\t\tGroup root = new Group();\r\n\t\tLine body=new Line(350,660,350,650);\r\n\t\tLine Lhand=new Line(350,656,346,653);\r\n\t\tLine Rhand=new Line(350,656,354,653);\r\n\t\tLine Rfeed=new Line(350,660,354,663);\r\n\t\tLine Lfeed=new Line(350,660,346,663);\r\n\t\tCircle head=new Circle(346,646,4);\r\n\t\troot.getChildren().addAll(body,Lhand,Rhand,Rfeed,Lfeed,head);\r\n\t\t\r\n\t}", "public SelectionPanel(){\n\t\tthis.setHbarPolicy(ScrollBarPolicy.ALWAYS);\n\t\tthis.setVbarPolicy(ScrollBarPolicy.NEVER);\n\t\tsetButton();\n\t\tthis.setContent(container);\n\t\tthis.setPrefHeight(65);\n\t\tthis.setPrefWidth(700);\n\t\tcontainer.setVisible(false);\n\t}", "void setClip(Boolean[][] clip)\n {\n this.clip = clip;\n }", "private Pane createSubTree(int level, File directory) {\n\t\tVBox dirNameBox = new VBox();\n\t\t\n\t\tdouble maxPaneHeight = 0;\n\t\tdouble totalArea = 0;\n\t\tdouble totalPanesHeight = 0;\n\t\tdouble totalPanesWidth = 0;\n\n\t\tArrayList<Pane> panes = new ArrayList<Pane>();\n\t\t\n\t\t// Add label\n\t\tLabel newLabel = new Label(directory.getName());\n\t\tnewLabel.setFont(Font.font(\"System\", FontWeight.BOLD, 8.0f));\n\t\t//newLabel.setBackground(new Background(new BackgroundFill(Color.CORNFLOWERBLUE, CornerRadii.EMPTY, Insets.EMPTY)));\n\n\t\t//nodes.add(newLabel);\t\t\n\t\tdirNameBox.getChildren().add(newLabel);\n\t\t\n\t\t\n\t\tPane dirPane;\n\t\tif (level % 2 == 0) {\n\t\t\tdirPane = new VBox();\n\t\t\t// Setting the spacing between the nodes\n\t\t\t((VBox)dirPane).setSpacing(gap);\n\t\t\t((VBox)dirPane).setAlignment(Pos.TOP_LEFT); \t\t\n\t\t} else {\n\t\t\tdirPane = new HBox();\n\t\t\t// Setting the spacing between the nodes\n\t\t\t((HBox)dirPane).setSpacing(gap);\n\t\t\t((HBox)dirPane).setAlignment(Pos.TOP_LEFT); \t\t\n\t\t}\n\t\tdirNameBox.getChildren().add(dirPane);\n\t\t\n\t\t\t\t\n\t\tint numSubDirs = 0;\n\t\tString[] subFilesAndDirectories = directory.list(new FilenameFilter() {\n\t\t public boolean accept(File dir, String name) {\n\t\t \tif (fileExtensionFilter == null || fileExtensionFilter.length == 0 ) {\n\t\t \t\t// No Filter defined\n\t\t \t\treturn true;\n\t\t \t} else {\n\t\t\t \t// check if file extension is in the list of allowed extensions\n\t\t\t return Arrays.stream(fileExtensionFilter).anyMatch(FilenameUtils.getExtension(name.toLowerCase())::equals);\n\t\t \t}\n\t\t };\n\t\t});\t\n\n\t\tfor (String fileOrDirectoryName : subFilesAndDirectories) {\n\t\t\t\n\t\t\tFile fileOrDirectory = new File(directory, fileOrDirectoryName);\n\t\t\t\n\t\t\tif (fileOrDirectory.isDirectory()) {\n\t\t\t\tpanes.add(createSubTree(level++, fileOrDirectory));\n\t\t\t\tnumSubDirs++;\n\t\t\t} else {\n\t\t\t\tif (showFiles) {\n\t\t\t\t\tpanes.add(createFilePane(fileOrDirectory));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tdirNameBox.setSpacing(0);\n\t\t\n\t\tif (usePadding) {dirPane.setPadding(new Insets(gap,gap,gap,gap));}\n\t\t\n\t\tdirNameBox.setPadding(new Insets(1,1,1,1));\n\n\t\t//flowPane.autosize();\n\t\t\n\t\t// Alignments\n\t\tdirNameBox.setAlignment(Pos.TOP_LEFT); \n\n\t\tif (showRandomDirectoryBackgroundColor) {\n\t\t\tdirNameBox.setStyle(\"-fx-background-color: rgba(\" + (randomizer.nextInt(155) + 100) +\n\t\t\t\t\t\", \" + (randomizer.nextInt(155) + 100) + \", \" + (randomizer.nextInt(155) + 100) + \", \" +\n\t\t\t\t\t1 + \"); -fx-background-radius: 10;\");\n\t\t} else {\n//\t\t\tvBox.setStyle(\"-fx-background-color: rgba(\" + 255 + \", \" + 255 + \", \" + 255 + \", \" + 0\n//\t\t\t\t\t+ \"); -fx-background-radius: 10; \" + (showBorder ? \"-fx-border-color: gray\" : \"\")\n//\t\t\t);\n\t\t\tdirNameBox.setStyle(\"-fx-background-color: rgba(\" + 240 + \", \" + 240 + \", \" + 240 + \", \" + 1\n\t\t\t\t\t+ \"); -fx-background-radius: 10; \" + (showBorder ? \"-fx-border-color: gray\" : \"\")\n\t\t\t);\n\n\t\t}\n\n\t\tdirPane.setStyle(\"-fx-background-color: rgba(\" + 255 + \", \" + 255 + \", \" + 255 + \", \" + 0.5f\n\t\t\t\t+ \"); -fx-background-radius: 10; \" // + (showBorder ? \"-fx-border-color: blue; -fx-border-style: dotted;\" : \"\")\n\t\t);\n\n\t\t\n\t\t// Retrieving the childrens list of the parent pane\n\t\tObservableList<Node> list = dirPane.getChildren();\n\t\t\n\t\t// Adding all the nodes to the parent pane\n\t\tfor (Pane pane : panes) {\n\n\t\t\tlist.add(pane);\n\t\t\t\n\t\t\tdouble currentHeight = \n\t\t\t\t\t(pane instanceof VBox ? ((VBox)pane).getPrefHeight() + \n\t\t\t\t\t\t\t\t\t\t\t\t(showBorder ? 2 : 0) /*top + bottom border*/ + \n\t\t\t\t\t\t\t\t\t\t\t\t(usePadding ? 2 * gap : 0) /*padding*/ \n\t\t\t\t\t: (pane instanceof Pane ? ((Pane)pane).getPrefHeight() : 12 /*label*/)\n\t\t\t);\n\t\t\tdouble currentWidth = \n\t\t\t\t\t(pane instanceof HBox ? ((HBox)pane).getPrefHeight() + \n\t\t\t\t\t\t\t\t\t\t\t\t(showBorder ? 2 : 0) /*top + bottom border*/ + \n\t\t\t\t\t\t\t\t\t\t\t\t(usePadding ? 2 * gap : 0) /*padding*/ \n\t\t\t\t\t: (pane instanceof Pane ? ((Pane)pane).getPrefWidth() : 12 /*label*/)\n\t\t\t);\n\t\t\tmaxPaneHeight = Math.max(maxPaneHeight, currentHeight);\n\t\t\ttotalPanesHeight += currentHeight;\n\t\t\ttotalPanesWidth += currentWidth;\n\t\t\ttotalArea += pane.getPrefHeight() * pane.getPrefWidth();\n//\t\t\tSystem.out.println((p instanceof FlowPane ? \"Folder\" : \"File\") + \": \" + ((Label)p.getChildren().get(0)).getText() + \n//\t\t\t\t\t\" p.PrefHeight: \" + p.getPrefHeight() + \" p.PrefWidth: \" + p.getPrefWidth() + \n//\t\t\t\t\t\" p.Height: \" + p.getHeight() + \" p.Width: \" + p.getWidth() +\n//\t\t\t\t\t(p instanceof FlowPane ? \" p.PrefWrap: \" + ((FlowPane)p).getPrefWrapLength() : \"\") +\n//\t\t\t\t\t\" totalHeight: \" + totalPanesHeight);\n\t\t}\n\t\t\t\n\t\t// height of squared total area\n\t\tdouble areaHeight = Math.sqrt(totalArea) * transformFactor;\n\t\tdouble prefHeight = Math.max(areaHeight, maxPaneHeight);\n\t\t\n\t\tprefHeight = Math.min(totalPanesHeight, areaHeight);\n\t\t\n//\t\t// Setting preferred heights\n//\t\t((VBox)dirPane).setPrefHeight(\n//\t\t\t\ttotalPanesHeight\n//\t\t\t\t+ (panes.size() - 1) * gap /*gaps*/\n//\t\t\t\t// + 2 /*border*/\n//\t\t); \t\n\t\t\n//\t\tvBox.setPrefWrapLength(flowPane.getPrefWrapLength() + \n//\t\t\t\t12 /*label height*/ + \n//\t\t\t\t(showBorder ? 2 : 0) /*border around childFlowPane*/ +\n//\t\t\t\t(usePadding ? 2 * gap : 0) /*padding*/\n//\t\t\t\t);\n\n\t\t\t\n\t\tbindTooltip(dirNameBox, tooltip);\n\t\tbindTooltip(dirPane,tooltip);\n\t\tbindTooltip(newLabel, tooltip);\n\n\t\treturn dirNameBox;\n\t}", "@Override\r\n public void start(Stage primaryStage) throws Exception{\n primaryStage.setTitle(\"Color switch\");\r\n Gameplay obj1 = new Gameplay();\r\n obj1.mainmenu(primaryStage);\r\n// pane.getChildren().add(new Polygon(10,20,30,10,20,30));\r\n\r\n }", "public SolitairePane() {\n getChildren().addListener((ListChangeListener<Node>) c -> {\n while (c.next()) {\n List<? extends Node> added = c.getAddedSubList();\n added.forEach(this::makeDraggable);\n }\n });\n\n // Allow nodes to be directly dragged onto this pane\n this.setOnDragOver(event -> {\n final Dragboard dragboard = event.getDragboard();\n if (dragboard.hasContent(DRAG_FORMAT)\n && DRAG_KEY.equals(dragboard.getContent(DRAG_FORMAT))\n && dragging != null) {\n event.acceptTransferModes(TransferMode.MOVE);\n event.consume();\n }\n });\n\n // Drop dragged nodes onto this pane\n this.setOnDragDropped(event -> {\n Dragboard db = event.getDragboard();\n boolean success = false;\n if (db.hasContent(DRAG_FORMAT)) {\n Node nearestNode = findNearestNode(getChildren(), event.getX(), event.getY());\n if (nearestNode == null) {\n getChildren().add(dragging);\n } else {\n int targetIndex = getChildren().indexOf(nearestNode);\n if (event.getX() > nearestNode.getLayoutX()) {\n // dropped to the right of the node\n // bump the index to place it to that side\n targetIndex++;\n }\n getChildren().add(targetIndex, dragging);\n }\n success = true;\n }\n event.setDropCompleted(success);\n event.consume();\n });\n }", "public MainContentPane() {\r\n\t\tsuper();\r\n\r\n\t\t// Add design-time configured components.\r\n\t\tinitComponents();\r\n\t}", "public void setContents()\r\n\t{\r\n\t\t// contents.widthProperty().bind(this.prefWidthProperty());\r\n\t\t// contents.heightProperty().bind(this.prefHeightProperty());\r\n\t\t// contents.resize(width, height);\r\n\t\t// contents.relocate(width/4, height/4);\r\n\r\n\t}", "public GameWindow(){\n setSize(1012,785);\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n setLayout(null);\n\n JLabel sun = new JLabel(\"SUN\");\n sun.setLocation(37,80);\n sun.setSize(60,20);\n\n GamePanel gp = new GamePanel(sun);\n gp.setLocation(0,0);\n getLayeredPane().add(gp,new Integer(0));\n \n PlantCard sunflower = new PlantCard(new ImageIcon(this.getClass().getResource(\"images/cards/card_sunflower.png\")).getImage());\n sunflower.setLocation(110,8);\n sunflower.setAction((ActionEvent e) -> {\n gp.activePlantingBrush = PlantType.Sunflower;\n });\n getLayeredPane().add(sunflower,new Integer(3));\n\n PlantCard peashooter = new PlantCard(new ImageIcon(this.getClass().getResource(\"images/cards/card_peashooter.png\")).getImage());\n peashooter.setLocation(175,8);\n peashooter.setAction((ActionEvent e) -> {\n gp.activePlantingBrush = PlantType.Peashooter;\n });\n getLayeredPane().add(peashooter,new Integer(3));\n\n PlantCard freezepeashooter = new PlantCard(new ImageIcon(this.getClass().getResource(\"images/cards/card_freezepeashooter.png\")).getImage());\n freezepeashooter.setLocation(240,8);\n freezepeashooter.setAction((ActionEvent e) -> {\n gp.activePlantingBrush = PlantType.FreezePeashooter;\n });\n getLayeredPane().add(freezepeashooter,new Integer(3));\n\n\n\n getLayeredPane().add(sun,new Integer(2));\n setResizable(false);\n setVisible(true);\n }", "private void initComponents() {//GEN-BEGIN:initComponents\n scrollPanel = new javax.swing.JScrollPane();\n hierarchy = new JTree(treeModel);\n setLayout(new java.awt.BorderLayout());\n \n \n hierarchy.setPreferredSize(new java.awt.Dimension(300, 500));\n hierarchy.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n hierarchyMouseClicked(evt);\n }\n }\n );\n scrollPanel.setViewportView(hierarchy);\n \n \n add(scrollPanel, java.awt.BorderLayout.CENTER);\n \n }", "public TwentyQuestionsView() {\n\t\tsuper(new BorderLayout());\n\t\t// brings in image 20Q.jpg\n//\t\timage = new Image(\"20Q.jpg\");\n\t\t// makes a new instace of the controller\n\t\tcontroller = new TwentyQuestionsController();\n\t\t// starts at the root of the treee\n\t\tcurrent = controller.tree.getRoot();\n\t\t// calls the method which initializes the GUI\n\t\tinitGUI();\n\n\t}", "public void setGraphPane(GraphPane p) {\n setCanvasPane(p);\n }", "public void setParent(RMParentShape aShape) { _parent = aShape; }", "public RootTreePanel() {\n\t\tsuper();\n\t\tTreeNode.setCentered(false);\n\t}", "public LImagePane() {\n\tsetLayout(null);\n\tsetOpaque(false);\n }", "@FXML public void toLayer()\t\t\n\t{\n\t}", "public Window() {\n // Creation de la fenetre\n super();\n\n // Creation du graphe de scene\n sceneGraph = new SceneGraph(\"Scene Graph\");\n origin = new int[2];\n\n // Proprietes generales de la fenetre\n // Titre de la fenetre\n this.setTitle(NOMFENETRE);\n /// Taille de la fenetre\n this.setSize(HTAILLE, VTAILLE);\n // Centre la fenetre a l'ecran\n this.setLocationRelativeTo(null);\n // Pour fermer la fenetre lorsqu'on clique sur la croix\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n // Creation des composants de la fenetre\n infoBar = new InfoBar();\n treeZone = new TreePanel();\n drawZone = new DrawPanel(infoBar, treeZone);\n optionZone = new OptionPanel(drawZone);\n menuBar = new MenuBar();\n toolBar = new ToolBar(optionZone);\n\n split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treeZone, drawZone);\n split.setDividerLocation(200);\n\n treeZone.initializeListeners(drawZone);\n menuBar.initializeListeners(drawZone);\n\n // Ajout de la barre de menu a la fenetre\n this.setJMenuBar(menuBar);\n // Ajout des differents sous-conteneurs au conteneur principal\n this.getContentPane().setLayout(new BorderLayout());\n this.add(optionZone, BorderLayout.NORTH);\n this.add(toolBar, BorderLayout.WEST);\n this.add(split, BorderLayout.CENTER);\n this.add(infoBar, BorderLayout.SOUTH);\n\n // Affiche la fenetre a l'ecran\n this.setVisible(true);\n\n this.addComponentListener(new ComponentAdapter() {\n\n @Override\n public void componentResized(ComponentEvent e) {\n drawZone.calculateOrigin();\n }\n });\n\n }", "public Parent creatPanel() {\r\n\t\t\r\n\t\thlavniPanel = new BorderPane();\r\n\t\thlavniPanel.setCenter(creatGameDesk());\r\n\t\thlavniPanel.setTop(createMenuBar());\r\n\t\t\r\n\t\thlavniPanel.setBackground(new Background(new BackgroundFill(Color.BURLYWOOD, CornerRadii.EMPTY, Insets.EMPTY)));\r\n\t\thlavniPanel.setPadding(new Insets(8));\r\n\t\treturn hlavniPanel;\r\n\t}", "public HangingFlowPane() {\n super();\n }", "public PaneEdiccion(Principal parent, String nick, String token) {\n //this.setUndecorated(true);\n \n initComponents();\n \n this.setSize(715, 485);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setLocationRelativeTo(null);\n this.setResizable(true);\n \n this.parent = parent;\n this.nick = nick;\n this.token = token;\n this.frame = this;\n \n // Paneles para cambiar, tiene que estar en el mismo orden que se encuentre en la interfaz\n paneles = new ArrayList<JPanel>();\n paneles.add (panelInicio);\n \n cargarItemReducidos ();\n }", "public Parent createContent(){\n Pane root = new Pane();\n root.setPrefSize((dimension * tileSize)+(tileSize*4)+menuWidth, (dimension * tileSize)+(tileSize*4));\n root.getChildren().addAll(tileGroup);\n TopOfBoard top = new TopOfBoard();\n Parent controlsAndMovement = top.newScene();\n root.getChildren().addAll(controlsAndMovement);\n\n // setting main game board template\n for (int i = 0; i< dimension; i++){\n for (int j = 0; j< dimension; j++){\n if (i==0||i== dimension -1||j==0||j== dimension -1){\n if (i==0) {\n if (j==0){\n tileInit(i, j, tileGroup, tileSize * 2, tileSize * 2, j * tileSize, i * tileSize);\n }\n else if (j== dimension -1){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, (j * tileSize)+tileSize, i * tileSize);\n }\n else {\n tileInit(i, j, tileGroup, tileSize*2, tileSize, (j * tileSize)+tileSize, i * tileSize);\n }\n }\n else if (i== dimension -1){\n if (j==0){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, j * tileSize, (i * tileSize)+tileSize);\n }\n else if (j== dimension -1){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, (j * tileSize)+tileSize, (i * tileSize)+tileSize);\n }\n else {\n tileInit(i, j, tileGroup, tileSize * 2, tileSize, (j * tileSize) + tileSize, (i * tileSize) + tileSize);\n }\n }\n else if (j==0){\n tileInit(i, j, tileGroup, tileSize, tileSize*2, j * tileSize, (i * tileSize)+(tileSize));\n\n }\n else if (j== dimension -1) {\n tileInit(i, j, tileGroup, tileSize, tileSize*2, (j * tileSize)+(tileSize), (i * tileSize)+tileSize);\n }\n\n }\n }\n\n // Setting player score board\n for (int q = 1; q <= numOfPlayers; q++){\n if (q == 1){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*3);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*3.5), \"Player 1 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 2){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*5);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*5.5), \"Player 2 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 3){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*7);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*7.5), \"Player 3 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 4){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*9);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*9.5), \"Player 4 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n\n }\n\n for (int r = 1; r <= numOfPlayers; r++) {\n if (r == 1) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(0);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 0.5), \"Player 1 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 2) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 3);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 3.5), \"Player 2 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 3) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 6);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 6.5), \"Player 3 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 4) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 9);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 9.5), \"Player 4 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n\n }\n }\n addImg();\n }\n return root;\n }", "private void createConent() {\n\t\tdockPanel = new DockLayoutPanel(Unit.PX);\n\t\tribbonBarPanel = new RibbonBarContainer();\n\t\tbattleMatCanvasPanel = new SimpleLayoutPanel();\n\t\tmainPanel = new LayoutPanel();\n\t\tmainPanel.setSize(\"100%\", \"100%\");\n\t\tbattleMatCanvas = new BattleMatCanvas();\n\t\tbattleMatCanvasPanel.clear();\n\t\tbattleMatCanvasPanel.add(battleMatCanvas);\n\t\teast.setSize(\"100%\", \"100%\");\n\t\teast.add(assetManagementPanel);\n\t\tsplitPanel = new SplitLayoutPanel() {\n\t\t\t@Override\n\t\t\tpublic void onResize() {\n\t\t\t\tsuper.onResize();\n\t\t\t\tbattleMatCanvas.onResize();\n\t\t\t};\n\t\t};\n\t\tmainPanel.add(splitPanel);\n\t\tdockPanel.clear();\n\t\tdockPanel.addNorth(ribbonBarPanel, Constants.RIBBON_BAR_SIZE);\n\t\tdockPanel.add(mainPanel);\n\t\t// MUST CALL THIS METHOD to set the constraints; if you don't not much\n\t\t// will be displayed!\n\t\tdockPanel.forceLayout();\n\n\t\tWindow.addResizeHandler(new ResizeHandler() {\n\t\t\tpublic void onResize(final ResizeEvent event) {\n\t\t\t\tdoWindowResize(event);\n\t\t\t}\n\t\t});\n\t}", "public Zug_V2() {\n\t\tsetLayout();\n\t\tthis.initStyle(StageStyle.UNDECORATED);\n\t\tthis.scene = new Scene(fenster, 500, 300);\n\t\tthis.setScene(scene);\n\t}", "GridPane body();", "public void setPiece(Piece piece) {\n\t\troot.getChildren().clear();\n\t\tthis.piece = piece;\n\t\troot.getChildren().addAll(piece.getImage(),rectangle);\n\t}", "public void addToPane(Node node) {\n pane.getChildren().add(node);\n }", "private void setStage() {\n\t\tstage = new Stage();\n\t\tstage.setScene(myScene);\n\t\tstage.setTitle(title);\n\t\tstage.show();\n\t\tstage.setResizable(false);\n//\t\tstage.setOnCloseRequest(e -> {\n//\t\t\te.consume();\n//\t\t});\n\t}", "@Override\r\n\tprotected Object createLowerView(Composite parent) {\n\t\tfTree = new Tree(parent, SWT.BORDER );\r\n\t\tfTree.addSelectionListener(new SelectionAdapter() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t// https://jira.jboss.org/browse/JBIDE-7107\r\n\t\t\t\t// update \"OK\" button enablement\r\n\t\t\t\tupdateOkState();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t \r\n\t\tfTreeViewer = new TreeViewer(fTree);\r\n\t\tfTreeViewer.setContentProvider( treeContentProvider );\r\n\t\tfTreeViewer.setLabelProvider(new ModelTreeLabelProvider());\r\n\t\tfTreeViewer.setInput ( null );\r\n\t\tfTreeViewer.setAutoExpandLevel( getAutoExpandLevel() );\r\n\t\t// end tree viewer for variable structure\r\n\t\tGridData data = new GridData(); \r\n\t data.grabExcessVerticalSpace = true;\r\n\t data.grabExcessHorizontalSpace = true;\r\n\t data.horizontalAlignment = GridData.FILL;\r\n\t data.verticalAlignment = GridData.FILL;\r\n\t data.minimumHeight = 200;\r\n\t fTree.setLayoutData(data);\r\n\t \r\n\t\treturn fTree;\r\n\t}" ]
[ "0.6346305", "0.5843613", "0.58298177", "0.5812045", "0.5780987", "0.5775481", "0.5750647", "0.5733432", "0.57230175", "0.57033277", "0.5699892", "0.56799316", "0.56541157", "0.5620668", "0.561723", "0.5610482", "0.5574504", "0.55719656", "0.55620307", "0.55213666", "0.5477036", "0.5474266", "0.54694825", "0.54440314", "0.5439071", "0.54362285", "0.54329425", "0.54328525", "0.54175174", "0.5409812", "0.5400543", "0.5399725", "0.5384266", "0.538129", "0.53636867", "0.53632283", "0.53569144", "0.53526974", "0.5347433", "0.53460324", "0.5339669", "0.5335405", "0.5313672", "0.5307945", "0.5306098", "0.53037417", "0.5302154", "0.53001434", "0.5296307", "0.52950567", "0.5288206", "0.5286673", "0.5273262", "0.52667874", "0.52561706", "0.5246733", "0.52467126", "0.5240059", "0.52387786", "0.52274925", "0.52203584", "0.5219315", "0.5213468", "0.5209952", "0.5205289", "0.51968193", "0.51939535", "0.5183276", "0.518077", "0.51791984", "0.5178854", "0.5178252", "0.5177857", "0.5175881", "0.516869", "0.5162239", "0.5156856", "0.51534045", "0.51529706", "0.51460373", "0.5141146", "0.51359916", "0.5130802", "0.5128641", "0.5126661", "0.51244944", "0.5117427", "0.51068914", "0.51012033", "0.51003855", "0.5099666", "0.5095359", "0.5093589", "0.5087078", "0.5077336", "0.5076964", "0.5066092", "0.5065075", "0.5058091", "0.50572103" ]
0.7857707
0
Sets upp and initializes the spinner input for branchLimit
private void initializeBranchLimitSpinner() { SpinnerValueFactory<Integer> valueFactory; valueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 20, inputN){ @Override public void decrement(int steps) { final int min = getMin(); final int currentValue = getValue(); final int newIndex = currentValue - steps * getAmountToStepBy(); setValue(Math.max(newIndex, min)); inputN = newIndex; renderTree(); } @Override public void increment(int steps) { final int max = getMax(); final int currentValue = getValue(); final int newIndex = currentValue + steps * getAmountToStepBy(); setValue(Math.min(newIndex, max)); inputN = newIndex; renderTree(); } }; branchLimitSpinner.setValueFactory(valueFactory); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initSpinner() {\n }", "public void setupPrioritySpinner() {\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(),\n R.array.prirority_level_list, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mPriority.setAdapter(adapter);\n mPriority.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n removeFocusFromEditText();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n }\n });\n }", "private void init(){\n //Selected value in Spinner\n String selectedSubj= getActivity().getIntent().getStringExtra(\"subj\");\n String selectedPoten= getActivity().getIntent().getStringExtra(\"prob\");\n String selectedInst= getActivity().getIntent().getStringExtra(\"inst\");\n String selectedY= getActivity().getIntent().getStringExtra(\"peri\");\n\n if(selectedY.equals(\"2015~2017\")){\n String yList[]= {\"2015\", \"2016\", \"2017\"};\n selectedY= yList[new Random().nextInt(yList.length)];\n }\n\n String e_inst= QuestionUtil.create_eInst(selectedY, selectedInst);\n String k_inst= QuestionUtil.create_kInst(e_inst);\n String m= QuestionUtil.createPeriodM(selectedY, e_inst);\n\n QuestionNameBuilder.inst= new QuestionNameBuilder(selectedY, m, k_inst, selectedSubj, QuestionNameBuilder.UNDEFINED\n , QuestionNameBuilder.UNDEFINED, QuestionNameBuilder.TYPE_KOR);\n qnBuilder= QuestionNameBuilder.inst;\n\n //Potential Load\n loadPotentials(selectedPoten);\n }", "private void setSpinner(){\n for (String id : activity.getCollectedIDs()){\n if (activity.getCoinsCollection().containsKey(id)) {\n Coin tempCoin = activity.getCoinsCollection().get(id);\n assert tempCoin != null;\n if(!tempCoin.isBanked() && !tempCoin.isTransferred()) {\n spinnerItems.add(tempCoin);\n }\n }\n }\n\n //sort coins on gold value descending\n spinnerItems.sort((a, b) ->\n a.getValue() * activity.getExchangeRates().get(a.getCurrency())\n < b.getValue() * activity.getExchangeRates().get(b.getCurrency()) ? 1 : -1);\n\n ArrayAdapter<Coin> spinnerArrayAdapter = new ArrayAdapter<>(Objects.requireNonNull(getActivity()), R.layout.spinner_item, spinnerItems);\n spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n spinner.setAdapter(spinnerArrayAdapter);\n }", "private void initUI() {\n fileCount = wizard.getFileCount();\n fileByteCount = wizard.getByteCount();\n fileCountLabel.setText(String.valueOf(fileCount));\n updateByteCount(byteCountLabel, byteCountUnit, \"KB\", fileByteCount, 0);\n progressBar.setProgress(0);\n }", "public void setThisClassQuantity() {\n quantity = spinnerValue + \" pieces\";\n }", "private void setupSpinners() {\n\n ArrayAdapter<String> statesAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, states);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n statesAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n // Apply the adapter to the spinner\n statesAdapter.notifyDataSetChanged();\n mStateSpinner.setAdapter(statesAdapter);\n\n // Set the integer mSelected to the constant values\n mStateSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n mState = (String) parent.getItemAtPosition(position);\n setUpStatesSpinner(position);\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n // Unknown\n }\n });\n }", "private JSpinner setUpNumberSpinner(Player player) {\n SpinnerNumberModel sModel = \n new SpinnerNumberModel(0, 0, player.getMoney(), 1);\n JSpinner spinner = new JSpinner(sModel);\n return spinner;\n }", "protected abstract void initializeSpinners();", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\n Inventory.amountOfParts();\r\n partToggleGroup = new ToggleGroup();\r\n this.inHouseRadioButton.setToggleGroup(partToggleGroup);\r\n this.outsourceRadioButton.setToggleGroup(partToggleGroup);\r\n \r\n // Setting textFields\r\n partName.setPromptText(\"Enter Part Name\");\r\n partInv.setPromptText(\"Enter Inventory Number\");\r\n partPrice.setPromptText(\"Enter Price\");\r\n partMax.setPromptText(\"Max\");\r\n partMin.setPromptText(\"Min\");\r\n companyNameField.setPromptText(\"Company Name\");\r\n \r\n // Displaying the next ID Number\r\n partId = Inventory.partIDCount +1;\r\n addPartID.setText(\"Auto-Generated: \" + partId);\r\n }", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n SpinnerValueFactory<Integer> valueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0,3000,500); \r\n hoursWorkedSpinner.setValueFactory(valueFactory);\r\n \r\n //change the text on the button if it is an administrative user\r\n if(!SceneChanger.getLoggedInUser().isAdmin())\r\n backButton.setText(\"Edit\");\r\n \r\n }", "protected abstract void setupSpinners();", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n spinnerDescuento.setEditable(false);\n spinnerDescuento.setFocusTraversable(false);\n SpinnerValueFactory<Integer> valueFactory\n = new SpinnerValueFactory.IntegerSpinnerValueFactory(5, 100,5 , 5);\n spinnerDescuento.setValueFactory(valueFactory);\n List<String> tipoPromociones = new ArrayList();\n tipoPromociones.add(\"Mensualidad\");\n tipoPromociones.add(\"Inscripción\");\n ObservableList<String> items = FXCollections.observableArrayList();\n items.addAll(tipoPromociones);\n cmbTipoPromocion.setItems(items);\n crearValidadorres();\n }", "private Spinner<Integer> createNumOfThreadsSpinner() {\n Spinner<Integer> numOfThreadsSpinner = new Spinner<Integer> (\n new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 128) {\n @Override\n public void decrement(int i) {\n if(getValue() != null) {\n setValue(getValue() / 2);\n numOfThreads = getValue();\n }\n }\n\n @Override\n public void increment(int i) {\n if(getValue() != null) {\n setValue(getValue() * 2);\n numOfThreads = getValue();\n }\n }\n });\n\n return numOfThreadsSpinner;\n }", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter supplierSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_supplier_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n supplierSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mSupplierSpinner.setAdapter(supplierSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mSupplierSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.supplier_one))) {\n mSupplier = BookEntry.SUPPLIER_ONE;\n } else if (selection.equals(getString(R.string.supplier_two))) {\n mSupplier = BookEntry.SUPPLIER_TWO;\n } else {\n mSupplier = BookEntry.SUPPLIER_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mSupplier = BookEntry.SUPPLIER_UNKNOWN;\n }\n });\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n SpinnerValueFactory factory = new SpinnerValueFactory() {\n @Override\n public void decrement(int i) {\n if((int)this.getValue() > 1)\n this.setValue((int)this.getValue() - 1);\n }\n\n @Override\n public void increment(int i) {\n if((int) this.getValue() < 1000) {\n this.setValue((int)this.getValue() + 1);\n }\n }\n };\n predictedTime.setValueFactory(factory);\n if(task == null) {\n predictedTime.getValueFactory().setValue(1);\n }\n else {\n name.setText(task.getName());\n startDate.setValue(task.getStartDate());\n endDate.setValue(task.getEndDate());\n predictedTime.getValueFactory().setValue(task.getPredictedTime());\n }\n }", "public void setupSpinner()\n {\n if (spinnerAdapter == null)\n {\n spinnerAdapter = new StringSpinnerAdapter(spinner, R.array.graph_period_spinner_values);\n }\n\n spinner.setOnItemSelectedListener(this);\n spinner.setAdapter(spinnerAdapter);\n }", "private void playerSpinnerSetup(){\r\n\t\tSpinner spinner = (Spinner) findViewById(R.id.PlayerSpinner);\r\n \t\r\n \tArrayAdapter<String> adapter = new ArrayAdapter<String>(Statistics.this, android.R.layout.simple_spinner_item, players);\r\n \tadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n \tspinner.setAdapter(adapter);\r\n \t\r\n \tspinner.setOnItemSelectedListener(new OnItemSelectedListener() {\r\n \t\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {\r\n \t\t\tcalculatePlayerStats(pos);\r\n \t\t\t\r\n \t\t\tplayerSpinnerPosition = pos;\r\n \t\t}\r\n\r\n \t\tpublic void onNothingSelected(AdapterView<?> parent) {\r\n \t\t}\r\n \t}); \t\r\n\t}", "private void initJBusyComponentTab() {\n /** Create the {@link BusyLayerUI}\n */\n this.printingUI = new BasicBusyLayerUI();\n\n /** Give a range to the printing model\n */\n this.printingModel.setMinimum(0);\n this.printingModel.setMaximum(1000000);\n\n /** Bound the LayerUI and the BusyModel to the JBusyComponent\n */\n this.jBusyComponent.setBusyLayerUI( this.printingUI );\n this.jBusyComponent.setBusyModel( this.printingModel );\n\n /** Init the default Task Duration to 5 seconds\n */\n this.jSpinnerTaskDuration.setValue(5);\n this.jSpinnerMinTaskDuration.setValue(2);\n }", "public AddProductWindow() {\r\n initComponents();\r\n this.setLocationRelativeTo(null);\r\n SpinnerNumberModel modelSpinner = new SpinnerNumberModel();\r\n modelSpinner.setMaximum(100);\r\n modelSpinner.setMinimum(0);\r\n spnQuantity.setModel(modelSpinner);\r\n }", "public void initProjectSpinner(){\n projectSpinner = findViewById(R.id.spinner_project);\n projectList = Arrays.asList(gson.fromJson(myRequestHandler.getJsonStringProjects(), Project[].class)); //The jsonString with Projects is already initialized to prevent null pointers\n ArrayAdapter<Project> projectAdapter = new ArrayAdapter<Project>(this,\n android.R.layout.simple_spinner_item, projectList);\n projectAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n projectSpinner.setAdapter(projectAdapter);\n projectSpinner.setOnItemSelectedListener(this);\n\n }", "private void createSpinners() {\n\t\tsuper.addSpinner(myResources.getString(\"FishReproduce\"));\n\t\tsuper.addSpinner(myResources.getString(\"SharkDeath\"));\n\t\tsuper.addSpinner(myResources.getString(\"SharkReproduce\"));\n\t}", "protected void initialize() {\n \tisAtLimit = Robot.clawElevator.getLowerSwitch();\n \t\n \tif (isAtLimit) {\n \t\tcancel();\n \t} else {\n \t\tRobot.clawElevator.resetEncoder();\n \t}\n \t\n// \tif (Robot.clawElevator.getContainerHeight() == 0) {\n \t\tRobot.clawElevator.decrementContainerHeight();\n// \t}\n }", "private void beginPane(){ \n JTextField textField = new JTextField();\n SpinnerModel sModel = new SpinnerNumberModel(50,1,blackjackController.getHumanPlayer().getBudget(),5); \n JSpinner spinner = new JSpinner(sModel);\n\n Object[] inputFields = {\"Welcome! \\nYour initial budget is $200.\", \"Enter your name : \", textField, \"Declare your bet : \", spinner, \"Good luck!\"};\n int option = JOptionPane.showConfirmDialog(this, inputFields, \"\", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);\n\n if (option == JOptionPane.OK_OPTION) {\n if(textField.getText().length() != 0){\n this.blackjackController.getHumanPlayer().setName(textField.getText());\n this.blackjackController.setBet((Integer) spinner.getValue());\n blackjackController.startNewGame(this);\n }else{\n beginPane();\n }\n }else{\n System.exit(0);\n }\n }", "private void initialize() {\r\n\t\tframe = new JFrame(\"Ping-Pong\");\r\n\t\tframe.setSize(500, 500);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\t\r\n\t\tframe.setLocationRelativeTo(null);\r\n\t\tframe.setContentPane(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(\"background/pingpong.jpg\"))));\r\n\t\tGridBagLayout gridBagLayout = new GridBagLayout();\r\n\t\tgridBagLayout.columnWeights = new double[]{1.0, 1.0};\r\n\t\tframe.getContentPane().setLayout(gridBagLayout);\r\n\t\t\r\n\t\tArrayList<Object> player = new ArrayList<Object>();\r\n\t\tplayer.add(\"Two \");\r\n\t\tplayer.add(\"Three\");\r\n\t\tplayer.add(\"Four \");\r\n\t\t\r\n\t\ttxtNumberOfPlayers = new JTextField();\r\n\t\ttxtNumberOfPlayers.setBorder(null);\r\n\t\ttxtNumberOfPlayers.setBackground(Color.BLACK);\r\n\t\ttxtNumberOfPlayers.setForeground(Color.RED);\r\n\t\ttxtNumberOfPlayers.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\ttxtNumberOfPlayers.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\r\n\t\ttxtNumberOfPlayers.setEditable(false);\r\n\t\ttxtNumberOfPlayers.setText(\"No. of Players :\");\r\n\t\tGridBagConstraints gbc_txtNumberOfPlayers = new GridBagConstraints();\r\n\t\tgbc_txtNumberOfPlayers.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_txtNumberOfPlayers.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tgbc_txtNumberOfPlayers.gridx = 0;\r\n\t\tgbc_txtNumberOfPlayers.gridy = 0;\r\n\t\tframe.getContentPane().add(txtNumberOfPlayers, gbc_txtNumberOfPlayers);\r\n\t\ttxtNumberOfPlayers.setColumns(8);\r\n\t\t\r\n\t\tJSpinner spinner = new JSpinner();\r\n\t\tDimension d = spinner.getPreferredSize();\r\n d.width = 100;\r\n spinner.setPreferredSize(d);\r\n\t\tspinner.setModel(new javax.swing.SpinnerListModel(player));\r\n\t\tJSpinner.ListEditor editor = new JSpinner.ListEditor(spinner);\r\n JTextField tf = editor.getTextField();\r\n tf.setHorizontalAlignment(JTextField.CENTER);\r\n tf.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\r\n tf.setEditable(false);\r\n spinner.setEditor(editor);\r\n\t\tGridBagConstraints gbc_spinner = new GridBagConstraints();\r\n\t\tgbc_spinner.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_spinner.gridx = 1;\r\n\t\tgbc_spinner.gridy = 0;\r\n\t\tframe.getContentPane().add(spinner, gbc_spinner);\r\n\t\t\r\n\t\tspinner.addChangeListener(new ChangeListener() {\r\n public void stateChanged(ChangeEvent e) {\r\n final String number = (String) ((JSpinner) e.getSource()).getValue();\r\n if(number.equals(\"Two \")){\r\n \t players = 2;\r\n }\r\n else if(number.equals(\"Three\")){\r\n \t players = 3;\r\n }\r\n else if(number.equals(\"Four \")){\r\n \t players = 4;\r\n }\r\n }\r\n });\r\n\t\t\r\n\t\ttxtDifficultyLevel = new JTextField();\r\n\t\ttxtDifficultyLevel.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\r\n\t\ttxtDifficultyLevel.setBackground(Color.BLACK);\r\n\t\ttxtDifficultyLevel.setForeground(Color.RED);\r\n\t\ttxtDifficultyLevel.setBorder(null);\r\n\t\ttxtDifficultyLevel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\ttxtDifficultyLevel.setEditable(false);\r\n\t\ttxtDifficultyLevel.setText(\"Difficulty Level :\");\r\n\t\tGridBagConstraints gbc_txtDifficultyLevel = new GridBagConstraints();\r\n\t\tgbc_txtDifficultyLevel.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_txtDifficultyLevel.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tgbc_txtDifficultyLevel.gridx = 0;\r\n\t\tgbc_txtDifficultyLevel.gridy = 1;\r\n\t\tframe.getContentPane().add(txtDifficultyLevel, gbc_txtDifficultyLevel);\r\n\t\ttxtDifficultyLevel.setColumns(8);\r\n\t\t\r\n\t\tamatuer = new JRadioButton(\"Amateur \");\r\n\t\tamatuer.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tamatuer.setBackground(Color.BLACK);\r\n\t\tamatuer.setForeground(Color.WHITE);\r\n\t\tamatuer.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\r\n\t\tGridBagConstraints gbc_rdbtnNewRadioButton = new GridBagConstraints();\r\n\t\tgbc_rdbtnNewRadioButton.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_rdbtnNewRadioButton.gridx = 1;\r\n\t\tgbc_rdbtnNewRadioButton.gridy = 1;\r\n\t\tframe.getContentPane().add(amatuer, gbc_rdbtnNewRadioButton);\r\n\t\r\n\t\tamatuer.addItemListener(new ItemListener() {\r\n\t public void itemStateChanged(ItemEvent e) { \r\n\t \t if (e.getStateChange() == ItemEvent.SELECTED){\r\n\t pro.setEnabled(false);\r\n\t diff_level = false;\r\n\t \t }\r\n\t \t else{\r\n\t \t\t pro.setEnabled(true); \r\n\t \t }\r\n\t } \r\n\t \r\n\t });\r\n\t\t\r\n\t\tpro = new JRadioButton(\"Professional\");\r\n\t\tpro.setBackground(Color.BLACK);\r\n\t\tpro.setForeground(Color.WHITE);\r\n\t\tpro.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\r\n\t\tpro.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tGridBagConstraints gbc_rdbtnNewRadioButton_1 = new GridBagConstraints();\r\n\t\tgbc_rdbtnNewRadioButton_1.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_rdbtnNewRadioButton_1.gridx = 1;\r\n\t\tgbc_rdbtnNewRadioButton_1.gridy = 2;\r\n\t\tframe.getContentPane().add(pro, gbc_rdbtnNewRadioButton_1);\r\n\t\tpro.addItemListener(new ItemListener() {\r\n\t public void itemStateChanged(ItemEvent e) { \r\n\t \t if (e.getStateChange() == ItemEvent.SELECTED){\r\n\t \t amatuer.setEnabled(false);\r\n\t \t diff_level = true;\r\n\t \t \t }\r\n\t \t \t else{\r\n\t \t \t\t amatuer.setEnabled(true); \r\n\t \t \t }\r\n\t } \r\n\t });\r\n\t\t\r\n\t\tJButton play=new JButton(\"Play Offline\");\r\n\t\tplay.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\t\r\n\t\t\t\tif(amatuer.isSelected()==true || pro.isSelected()==true){\r\n\t\t\t\t\t PingPong1();\r\n\t\t\t\t\t frame.dispose();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ttextField_1.setText(\"Difficulty level not selected\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tplay.setFont(new Font(\"Tahoma\", Font.PLAIN, 13));\r\n\t\tGridBagConstraints gbc_play = new GridBagConstraints();\r\n\t\tgbc_play.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_play.gridx = 0;\r\n\t\tgbc_play.gridy = 5;\r\n\t\tframe.getContentPane().add(play, gbc_play);\r\n\t\t\r\n\t\tJButton quit=new JButton(\"Quit Game \");\r\n\t\tquit.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\tGame.stop();\r\n\t\t\t}\r\n\t\t});\r\n\t\tquit.setFont(new Font(\"Tahoma\", Font.PLAIN, 13));\r\n\t\tGridBagConstraints gbc_quit = new GridBagConstraints();\r\n\t\tgbc_quit.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_quit.gridx = 0;\r\n\t\tgbc_quit.gridy = 6;\r\n\t\tframe.getContentPane().add(quit, gbc_quit);\r\n\t\t\r\n\t\tJButton host=new JButton(\" Host \");\r\n\t\thost.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(amatuer.isSelected()==true || pro.isSelected()==true){\r\n\t\t\t\t\t\tSystem.out.println(\"host the game\");\r\n\t\t\t\t\t\tframe.dispose();\r\n\t\t\t\t\t\tif (ClientPlayer.connected==1){\r\n\t\t\t\t\t\t new CreateServer();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t//JOptionPane.showMessageDialog(null, \"Creating server...\");\r\n\t\t\t\t\t\t\tnew CreateServer();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ttextField_1.setText(\"Difficulty level not selected\");\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\thost.setFont(new Font(\"Tahoma\", Font.PLAIN, 13));\r\n\t\tGridBagConstraints gbc_host = new GridBagConstraints();\r\n\t\tgbc_host.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_host.gridx = 0;\r\n\t\tgbc_host.gridy = 3;\r\n\t\tframe.getContentPane().add(host, gbc_host);\r\n\t\t\r\n\t\tJButton connect=new JButton(\" Player2 \");\r\n\t\tconnect.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\r\n\t\t\t\t\t\t\tSystem.out.println(\"Connect to the game\");\r\n\t\t\t\t\t\t\tframe.dispose();\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tnew ClientPlayer();\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tconnect.setFont(new Font(\"Tahoma\", Font.PLAIN, 13));\r\n\t\tGridBagConstraints gbc_connect = new GridBagConstraints();\r\n\t\tgbc_connect.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_connect.gridx = 0;\r\n\t\tgbc_connect.gridy = 4;\r\n\t\tframe.getContentPane().add(connect, gbc_connect);\r\n\t\t\r\n\t\tJButton connect2=new JButton(\" Player3 \");\r\n\t\tconnect2.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\r\n\t\t\t\t\t\t\tSystem.out.println(\"Connect to the game\");\r\n\t\t\t\t\t\t\tframe.dispose();\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tnew ClientPlayer2();\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tconnect2.setFont(new Font(\"Tahoma\", Font.PLAIN, 13));\r\n\t\tGridBagConstraints gbc_connect2 = new GridBagConstraints();\r\n\t\tgbc_connect2.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_connect2.gridx = 1;\r\n\t\tgbc_connect2.gridy = 4;\r\n\t\tframe.getContentPane().add(connect2, gbc_connect2);\r\n\t\t\r\n\t\tJButton connect3=new JButton(\" Player4 \");\r\n\t\tconnect3.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\r\n\t\t\t\t\t\t\tSystem.out.println(\"Connect to the game\");\r\n\t\t\t\t\t\t\tframe.dispose();\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tnew ClientPlayer3();\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tconnect3.setFont(new Font(\"Tahoma\", Font.PLAIN, 13));\r\n\t\tGridBagConstraints gbc_connect3 = new GridBagConstraints();\r\n\t\tgbc_connect3.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_connect3.gridx = 2;\r\n\t\tgbc_connect3.gridy = 4;\r\n\t\tframe.getContentPane().add(connect3, gbc_connect3);\r\n\t\r\n\t\t\r\n\t\ttextField_1 = new JTextField();\r\n\t\ttextField_1.setEditable(false);\r\n\t\ttextField_1.setEnabled(true);\r\n\t\ttextField_1.setBorder(null);\r\n\t\ttextField_1.setBackground(Color.BLACK);\r\n\t\ttextField_1.setForeground(Color.RED);\r\n\t\ttextField_1.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\r\n\t\tGridBagConstraints gbc_display1 = new GridBagConstraints();\r\n\t\tgbc_display1.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tgbc_display1.gridx = 1;\r\n\t\tgbc_display1.gridy = 5;\r\n\t\tframe.getContentPane().add(textField_1, gbc_display1);\r\n\t\ttextField_1.setColumns(20);\r\n\t\t\r\n\t}", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n\n progressSpinner.setValueFactory(\n new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 100, 0)\n );\n priorities.getItems().addAll(\"High\", \"Medium\", \"Low\");\n\n }", "public quotaGUI() {\n initComponents();\n }", "private void initSpinners() {\r\n Spinner arrivalSpinner = (Spinner)findViewById(R.id.arrival_place);\r\n SpinnerAdapter arrivalSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, new LinkedList<>(manager.getAllSights()));\r\n arrivalSpinner.setAdapter(arrivalSpinnerAdapter);\r\n\r\n Spinner departureSpinner = (Spinner)findViewById(R.id.departure_place);\r\n SpinnerAdapter departureSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, new LinkedList<>(manager.getAllSights()));\r\n departureSpinner.setAdapter(departureSpinnerAdapter);\r\n\r\n Spinner focusSpinner = (Spinner)findViewById(R.id.focus);\r\n SpinnerAdapter focusSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Category.values());\r\n focusSpinner.setSelection(3);\r\n focusSpinner.setAdapter(focusSpinnerAdapter);\r\n }", "private void SpinnerInitialize() {\n try{\n Spinner dropdownto = findViewById(R.id.tonumbercountrycode);\n\n//create an adapter to describe how the items are displayed, adapters are used in several places in android.\n//There are multiple variations of this, but this is the basic variant.\n ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, countrycodes);\n//set the spinners adapter to the previously created one.\n\n dropdownto.setAdapter(adapter);\n dropdownto.setSelection(0,true);\n\n Spinner dropdownfrom = findViewById(R.id.fromnumbercountrycode);\n\n//create an adapter to describe how the items are displayed, adapters are used in several places in android.\n//There are multiple variations of this, but this is the basic variant.\n // ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, countrycodes);\n//set the spinners adapter to the previously created one.\n\n dropdownfrom.setAdapter(adapter);\n dropdownfrom.setSelection(0,true);\n }\n catch (Exception ex){\n Toast.makeText(InsertDb.this, ex.getMessage().toString(), Toast.LENGTH_SHORT).show();\n\n }\n\n\n }", "private void uploadingProgressBarInit() {\n uploadingProgressBar.setVisibility(VISIBLE);\n uploadingProgressBar.setProgress(0);\n }", "private void initializeEntreeSpinner() {\n // Extracting and storing entree names and prices\n alEntreeNames = extractColumn(\"Entree\", 1);\n alEntreePrices = extractColumn(\"Entree\", 2);\n spEntree.setAdapter(getAdapter(alEntreeNames));\n\n // Display price of selected entree item\n spEntree.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n entreePrice = (i > 0) ? Double.parseDouble(alEntreePrices.get(i)) : Double.parseDouble(\"0.00\");\n edtTxtEntreePrice.setText(String.format(\"$%.2f\", entreePrice));\n\n updateSubtotal();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n edtTxtEntreePrice.setText(\"0.00\");\n }\n });\n }", "private void setUpSpinner(){\n //instantiates a new CategoryAdapter with the categories from the database\n CategorySpinnerAdapter mCategorySpinnerAdapter = new CategorySpinnerAdapter(this, mCategories);\n mCategorySpinner.setAdapter(mCategorySpinnerAdapter);\n //callback for when an item is selected\n mCategorySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n }\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n }", "private SpinnerModel geSpinnerModel(){\n return new SpinnerNumberModel(0, 0, null, 1);\n }", "private static JSpinner createRangedSpinner(int initialValue, int min, int max)\r\n\t\t{\r\n\t\tSpinnerModel spinnerModel = new SpinnerNumberModel(initialValue, min, max, 1); //default value,lower bound,upper bound,increment by\r\n\t\treturn new JSpinner(spinnerModel);\r\n\t\t}", "@FXML\n private void initialize() {\n \tuictrlLength.setValueFactory(\n \t\t\tnew SpinnerValueFactory.IntegerSpinnerValueFactory(\n \t\t\t\t\tNYAPSEncoder.MIN_LENGTH, NYAPSEncoder.MAX_LENGTH, NYAPSEncoder.DEFAULT_LENGTH, 1));\n \tuictrlIssue.setValueFactory(\n \t\t\tnew SpinnerValueFactory.IntegerSpinnerValueFactory(\n \t\t\t\t\tNYAPSEncoder.MIN_ISSUE, NYAPSEncoder.MAX_ISSUE, 1, 1));\n }", "public pic() {\n MAX=10;\n initComponents();\n jLabel3.setText(MAX-approved+\"\");\n \n pctcollection=new ArrayList();\n \n }", "private static void setBudget() {\n\t\tSystem.out.println(\"How much is the budget:\");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint input = scan.nextInt();\n\t\tbudget = input;\n\t\tSystem.out.println(\"Budget Entry successfull:\"+budget);\n\t}", "private void init(){\n\t\t\n\t\tpurchasePrice = (EditText)findViewById(R.id.purchasePrice);\n\t\tpurchasePrice.setFilters(new InputFilter[] { new CurrencyFormatInputFilter()});\n\t\t\n\t\tdownPaymentSpinner = (Spinner)findViewById(R.id.inputTypeSpinner);\n\t\tArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n\t\t\t\tR.array.inputTypes, android.R.layout.simple_spinner_item);\n\t\tadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\t\tdownPaymentSpinner.setAdapter(adapter);\n\t\t\n\t\tsellerSpinner = (Spinner)findViewById(R.id.inputTypeSpinnerSeller);\n\t\tArrayAdapter<CharSequence> adapter2 = ArrayAdapter.createFromResource(this,\n\t\t\t\tR.array.inputTypes, android.R.layout.simple_spinner_item);\n\t\tadapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\t\tsellerSpinner.setAdapter(adapter2);\t\n\t}", "private void setUpCategorySpinner() {\n mCategorySpinner = (Spinner) findViewById(R.id.spnCategory);\n categoryList = new ArrayList<>();\n categoryList.add(AppUtils.SELECT_CATEGORY);\n List<String> tempList = AppUtils.getAllCategoryName();\n categoryList.addAll(tempList);\n int size = categoryList.size();\n categoryList.add(size, AppUtils.CREATE_CATEGORY);\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, categoryList);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mCategorySpinner.setAdapter(dataAdapter);\n mCategorySpinner.setOnItemSelectedListener(this);\n }", "public void setSpinner(){\n SpinnerModel spinnerModelA = new SpinnerNumberModel\n (date.getYear()+1900, date.getYear() -1800, date.getYear() +2000, 1);\n spinA.setModel(spinnerModelA);\n\n SpinnerModel spinnerModelM = new SpinnerNumberModel\n (date.getMonth()+1, 1,12,1 );\n spinM.setModel(spinnerModelM);\n\n SpinnerModel spinnerModelG = new SpinnerNumberModel\n (date.getDate(), 1, 31,1);\n spinG.setModel(spinnerModelG);\n }", "private void initLimits() {\n lowerLimit1 = quarterHolderWidth;\n lowerLimit2 = (2 * quarterHolderWidth);\n lowerLimit3 = (3 * quarterHolderWidth);\n lowerLimit4 = holderWidth;\n }", "private void initControlUI() {\n typeAdapter = new SpinnerSimpleAdapter(self, android.R.layout.simple_spinner_item, self.getResources().getStringArray(R.array.arr_feedback_type));\n spnType.setAdapter(typeAdapter);\n }", "private void initializeDrinkSpinner() {\n // Extracting and storing drink names and prices\n alDrinkNames = extractColumn(\"Drink\", 1);\n alDrinkPrices = extractColumn(\"Drink\", 2);\n spDrink.setAdapter(getAdapter(alDrinkNames));\n\n // Display price of selected drink item\n spDrink.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n drinkPrice = (i > 0) ? Double.parseDouble(alDrinkPrices.get(i)) : Double.parseDouble(\"0.00\");\n edtTxtDrinkPrice.setText(String.format(\"$%.2f\", drinkPrice));\n\n updateSubtotal();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n edtTxtDrinkPrice.setText(\"0.00\");\n }\n });\n }", "void setSpinCount(long spinCount);", "protected void setSizeSpinner() {\r\n\t\tSpinner spinner = (Spinner) mActionBar.getCustomView().findViewById(\r\n\t\t\t\tR.id.spinner_size);\r\n\t\tif (!mShowSizeFilter\r\n\t\t\t\t|| mArchiveFragmentStatePagerAdapter.getCount() == 0) {\r\n\t\t\tspinner.setVisibility(View.GONE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Determine which sizes are actually used for the currently\r\n\t\t// selected status filter.\r\n\t\tGridDatabaseAdapter gridDatabaseAdapter = new GridDatabaseAdapter();\r\n\t\tfinal SizeFilter[] usedSizes = gridDatabaseAdapter\r\n\t\t\t\t.getUsedSizes(mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t.getStatusFilter());\r\n\r\n\t\t// Load the list of descriptions for sizes actually used into the\r\n\t\t// array adapter.\r\n\t\tString[] usedSizesDescription = new String[usedSizes.length];\r\n\t\tfor (int i = 0; i < usedSizes.length; i++) {\r\n\t\t\tusedSizesDescription[i] = getResources().getStringArray(\r\n\t\t\t\t\tR.array.archive_size_filter)[usedSizes[i].ordinal()];\r\n\t\t}\r\n\t\tArrayAdapter<String> adapterStatus = new ArrayAdapter<String>(this,\r\n\t\t\t\tandroid.R.layout.simple_spinner_item, usedSizesDescription);\r\n\t\tadapterStatus\r\n\t\t\t\t.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\r\n\t\t// Build the spinner\r\n\t\tspinner.setAdapter(adapterStatus);\r\n\r\n\t\t// Restore selected size\r\n\t\tSizeFilter selectedSizeFilter = mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t.getSizeFilter();\r\n\t\tfor (int i = 0; i < usedSizes.length; i++) {\r\n\t\t\tif (usedSizes[i] == selectedSizeFilter) {\r\n\t\t\t\tspinner.setSelection(i);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Hide spinner if only two choices are available. As one of those\r\n\t\t// choices is always \"ALL\" the choices will result in an identical\r\n\t\t// selection.\r\n\t\tspinner.setVisibility((usedSizes.length <= 2 ? View.GONE : View.VISIBLE));\r\n\r\n\t\tspinner.setOnItemSelectedListener(new OnItemSelectedListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\r\n\t\t\t\t\tint position, long id) {\r\n\t\t\t\t// Remember currently displayed grid id.\r\n\t\t\t\tint gridId = getCurrentSelectedGridId();\r\n\r\n\t\t\t\t// Get the selected status\r\n\t\t\t\tSizeFilter sizeFilter = usedSizes[(int) id];\r\n\r\n\t\t\t\t// Check if value for status spinner has changed.\r\n\t\t\t\tif (sizeFilter != mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t.getSizeFilter()) {\r\n\t\t\t\t\t// Refresh pager adapter with new status.\r\n\t\t\t\t\tmArchiveFragmentStatePagerAdapter.setSizeFilter(sizeFilter);\r\n\r\n\t\t\t\t\t// Refresh the status spinner as the content of the spinners\r\n\t\t\t\t\t// are related.\r\n\t\t\t\t\tsetStatusSpinner();\r\n\r\n\t\t\t\t\t// If possible select the grid id which was selected before\r\n\t\t\t\t\t// changing the spinner(s). Otherwise select last page.\r\n\t\t\t\t\tselectGridId(gridId);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onNothingSelected(AdapterView<?> arg0) {\r\n\t\t\t\t// Do nothing\r\n\t\t\t}\r\n\t\t});\r\n\t}", "protected void initialize() {\r\n if (dumper.isLimitSwitchPressed()){ \r\n dumper.stop();\r\n state = STATE_SUCCESS;\r\n }\r\n else {\r\n startPosition = dumper.getPosition();\r\n desiredPosition = startPosition + increment;\r\n dumper.backward();\r\n state = STATE_SEEK_LEFT;\r\n }\r\n }", "private void initializeSpinner() {\n listClients = appGlobal.listClients;\n listDSRStatuses = appGlobal.listDSRStatuses;\n listLoadingnPoint = appGlobal.listLoadingnPoint;\n listDestinationPoint = appGlobal.listDestinationPoint;\n\n\n if(listClients!=null && listClients.size()>0){\n CompanySelectorAdapter clientCompAdapter = new CompanySelectorAdapter(getActivity(), listClients);\n spinnerListClientComp.setAdapter(clientCompAdapter);\n clientCompAdapter.notifyDataSetChanged();\n }\n else {\n loadClientsList();\n }\n if(listDSRStatuses!=null && listDSRStatuses.size()>0){\n // Remove all value from list\n for (DSRStatusModel model :listDSRStatuses) {\n if(Integer.parseInt(model.dsrStatusID.trim())== -1) {\n listDSRStatuses.remove(model);\n }\n }\n DSRStatusSpinnerAdapter dsrStatusAdapter = new DSRStatusSpinnerAdapter(getActivity(), listDSRStatuses);\n spinnerListStatusDSR.setAdapter(dsrStatusAdapter);\n dsrStatusAdapter.notifyDataSetChanged();\n }else {\n loadDSRStatusList();\n }\n if(listLoadingnPoint!=null && listLoadingnPoint.size()>0) {\n LocationPointAdapter loadingPointAdapter = new LocationPointAdapter(getActivity(), listLoadingnPoint);\n //spinnerListLoadingPoint.setAdapter(loadingPointAdapter);\n autocompleteTVLoadingPoint.setAdapter(loadingPointAdapter);\n loadingPointAdapter.notifyDataSetChanged();\n }\n else {\n loadLoadingPointList();\n }\n if(listDestinationPoint!=null && listDestinationPoint.size()>0) {\n LocationPointAdapter destinationPointAdapter = new LocationPointAdapter(getActivity(), listDestinationPoint);\n //spinnerListDestinationPoint.setAdapter(destinationPointAdapter);\n autocompleteTVDestinationPoint.setAdapter(destinationPointAdapter);\n destinationPointAdapter.notifyDataSetChanged();\n }\n else {\n loadDestinationPointList();\n }\n loadCustomsPoints();\n\n }", "public void initialize() {\n fillCombobox();\n }", "public void resetJBJ() {\n min = 0;\n max = 1000;\n spinCVal.setValue(0);\n spinPVal.setValue(0);\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n svf = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 1000000, 0);\n spinnerAdet.setValueFactory(svf);\n\n olKategori = FXCollections.observableArrayList(\"Demirbaş\", \"Genel\");\n cbKategori.setItems(olKategori);\n olKDV = FXCollections.observableArrayList(0, 1, 5, 8, 18);\n cbKDV.setItems(olKDV);\n olKDVTipi = FXCollections.observableArrayList(\"Dahil\", \"Hariç\");\n cbKDVTipi.setItems(olKDVTipi);\n cbKDVTipi.setValue(\"Dahil\");\n olBirim = FXCollections.observableArrayList(\"Adet\", \"Balya\", \"CM\", \"KG\", \"Koli\", \"Litre\", \"Metre\", \"ML\", \"Ton\", \"Top\");\n cbBirim.setItems(olBirim);\n\n efekt = new DropShadow();\n\n tfAlisFiyat.textProperty().addListener((observable, oldValue, newValue) -> {\n karHesapla();\n });\n tfSatisFiyat.textProperty().addListener((observable, oldValue, newValue) -> {\n karHesapla();\n });\n }", "@Override\r\n\tpublic void setParameterValuesToGUI() {\r\n\t\tthis.pb = this.workPackage.getParameters();\r\n\r\n\t\tjSpinnerLeft.removeChangeListener(this);\r\n\t\tjSpinnerRight.removeChangeListener(this);\r\n\t\tjSpinnerTop.removeChangeListener(this);\r\n\t\tjSpinnerBottom.removeChangeListener(this);\r\n\t\tjSpinnerConst.removeChangeListener(this);\r\n\r\n\t\tjSpinnerLeft.setValue(pb.getIntParameter(\"Left\"));\r\n\t\tjSpinnerRight.setValue(pb.getIntParameter(\"Right\"));\r\n\t\tjSpinnerTop.setValue(pb.getIntParameter(\"Top\"));\r\n\t\tjSpinnerBottom.setValue(pb.getIntParameter(\"Bottom\"));\r\n\t\tjSpinnerConst.setValue(pb.getIntParameter(\"Const\"));\r\n\r\n\t\tjSpinnerLeft.addChangeListener(this);\r\n\t\tjSpinnerRight.addChangeListener(this);\r\n\t\tjSpinnerTop.addChangeListener(this);\r\n\t\tjSpinnerBottom.addChangeListener(this);\r\n\t\tjSpinnerConst.addChangeListener(this);\r\n\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pb.getIntParameter(\"NewWidth\"));\r\n\t\tjSpinnerNewHeight.setValue(pb.getIntParameter(\"NewHeight\"));\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.ZERO) buttZero.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.CONSTANT) buttConst.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.COPY) buttCopy.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.REFLECT) buttReflect.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.WRAP) buttWrap.setSelected(true);\r\n\r\n\t\tif (buttConst.isSelected()) {\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_BORDER) buttBorder.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_SIZE) buttSize.setSelected(true);\r\n\r\n\t}", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n // TODO\r\n ratingcombobox.getItems().addAll(\"1\",\"2\",\"3\",\"4\",\"5\");\r\n }", "public void setLimit_Base (String Limit_Base);", "private void setTimeLimit() {\n\t\t// Set the minimum time for \"Departing Time\" spinner\n\t\t// based on current selected combo box item\n\t\tview.setModifyTimeLimit(model.getDepartTime(view\n\t\t\t\t.getModifyStationIndex()));\n\t}", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n //init form input\r\n initFormDataCompanyBalance();\r\n //refresh data form input (transfer)\r\n dataCompanyBalanceTransferHandle();\r\n }", "private void initUI(View view) {\n btnSend = (AutoBgButton) view.findViewById(R.id.btnSend);\n btnBack = (ImageView) view.findViewById(R.id.btnBack);\n edtTitle = (EditText) view.findViewById(R.id.edtTitleFB);\n edtDes = (EditText) view.findViewById(R.id.edtDesFB);\n spnType = (Spinner) view.findViewById(R.id.spnType);\n btnBack.setOnClickListener(this);\n btnSend.setOnClickListener(this);\n spnType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n\n @Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (position == 0) {\n type = \"1\";\n } else if (position == 1) {\n type = \"3\";\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n // TODO Auto-generated method stub\n\n }\n });\n }", "private void courseSpinnerSetup(){\r\n\t\tSpinner spinner = (Spinner) findViewById(R.id.CourseSpinner);\r\n \t\r\n \tArrayAdapter<String> adapter = new ArrayAdapter<String>(Statistics.this, android.R.layout.simple_spinner_item, courses);\r\n \tadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n \tspinner.setAdapter(adapter);\r\n \t\r\n \tspinner.setOnItemSelectedListener(new OnItemSelectedListener() {\r\n \t\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {\r\n \t\t\t//\\todo allow for other players besides the default player (pos=0)\r\n calculateCourseStats(pos, 0);\r\n \t\t\t\r\n \t\t\tcourseSpinnerPosition = pos;\r\n \t\t}\r\n\r\n \t\tpublic void onNothingSelected(AdapterView<?> parent) {\r\n \t\t}\r\n \t}); \t\r\n\t}", "private void setBaseTipPerBag() {\n System.out.println(\"What would you like the base tip per bag to be?\");\n baseTipPerBag = keyboard.nextDouble();\n \n \n if(baseTipPerBag < 0) {\n throw new IllegalArgumentException(\n \"error: base tip must be greater than or equal to zero\");\n }\n \n }", "private synchronized void updateNumberFormat()\n\t{\n\n\t\tfinal int sw = rangeSlider.getWidth();\n\t\tif ( sw > 0 )\n\t\t{\n\t\t\tfinal double vrange = range.getMaxBound() - range.getMinBound();\n\t\t\tfinal int digits = ( int ) Math.ceil( Math.log10( sw / vrange ) );\n\n\t\t\tblockUpdates = true;\n\n\t\t\tJSpinner.NumberEditor numberEditor = ( ( JSpinner.NumberEditor ) minSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( minSpinner ) );\n\n\t\t\tnumberEditor = ( ( JSpinner.NumberEditor ) maxSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( maxSpinner ) );\n\n\t\t\tblockUpdates = false;\n\t\t}\n\t}", "private void setUpSocialSpinner() {\n socialSpinner = mView.findViewById(R.id.social_spinner);\n\n // Get list of social conditions setup in strings.xml\n conditionsArray = new ArrayList<>(Arrays.asList(getResources().getStringArray(R.array.social_conditions)));\n conditionsArray.add(getResources().getString(R.string.spinner_empty)); //filter_empty is \"None\"\n\n // Convert ArrayList to array, so that it can be passed to SocialArrayAdapter\n String[] spinnerObject = new String[conditionsArray.size()];\n spinnerObject = conditionsArray.toArray(spinnerObject);\n\n // Create string ArrayAdapter that will be used for filterSpinner\n ArrayAdapter<String> spinnerAdapter = new SocialArrayAdapter(mActivity,\n R.layout.spinner_item, spinnerObject);\n socialSpinner.setAdapter(spinnerAdapter);\n\n // Set default selection to None\n int defaultIndex = conditionsArray.indexOf(getResources().getString(R.string.spinner_empty));\n socialSpinner.setSelection(defaultIndex);\n }", "Currencies(final int lowerLimit, final int upperLimit) {\n this.min = lowerLimit;\n this.max = upperLimit;\n }", "void setupSpinner() {\n\n Spinner spinner = (Spinner) findViewById(R.id.language_spinner);\n\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.language_array, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(adapter);\n\n }", "public void SetSpinnerName(String SpinnerName) {\r\n System.out.println(\"Algo\");\r\n this.SpinnerName = SpinnerName;\r\n }", "public IntegerSpinner(SpinnerNumberModel spinnerModel) {\n\n\t\tspinner = new JSpinner(spinnerModel);\n\n\t\tintegerTextField = new IntegerTextField(10, ((Number) spinnerModel.getValue()).longValue());\n\t\tintegerTextField.getComponent().setName(\"integer.spinner.editor\");\n\t\tNumber maximum = (Number) spinnerModel.getMaximum();\n\t\tintegerTextField.setMaxValue(\n\t\t\tmaximum == null ? null : BigInteger.valueOf(maximum.longValue()));\n\n\t\tspinner.setEditor(integerTextField.getComponent());\n\n\t\tspinnerModel.addChangeListener(e -> {\n\t\t\tNumber newVal = (Number) spinnerModel.getValue();\n\t\t\tintegerTextField.setValue(newVal.longValue());\n\t\t});\n\n\t\tintegerTextField.getComponent().addKeyListener(new KeyAdapter() {\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t\tObject newVal = null;\n\t\t\t\tswitch (e.getKeyCode()) {\n\t\t\t\t\tcase KeyEvent.VK_UP:\n\t\t\t\t\t\tnewVal = spinnerModel.getNextValue();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase KeyEvent.VK_DOWN:\n\t\t\t\t\t\tnewVal = spinnerModel.getPreviousValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (newVal != null) {\n\t\t\t\t\tspinner.setValue(newVal);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tspinner.addMouseWheelListener(e -> {\n\t\t\tSpinnerNumberModel model = (SpinnerNumberModel) spinner.getModel();\n\t\t\ttry {\n\t\t\t\tif (e.getWheelRotation() > 0) {\n\t\t\t\t\tObject previousValue = model.getPreviousValue();\n\t\t\t\t\tif (previousValue != null) {\n\t\t\t\t\t\tspinner.setValue(previousValue);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tObject nextValue = model.getNextValue();\n\t\t\t\t\tif (nextValue != null) {\n\t\t\t\t\t\tspinner.setValue(nextValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IllegalArgumentException iae) {\n\t\t\t\t// ignored\n\t\t\t}\n\t\t});\n\n\t\tintegerTextField.addChangeListener(e -> {\n\t\t\tBigInteger value = integerTextField.getValue();\n\t\t\tif (value == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tspinnerModel.setValue(value.longValue());\n\t\t});\n\n\t}", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n // TODO\r\n kembali();\r\n loaddata();\r\n select();\r\n simpan();\r\n hapus();\r\n clear();\r\n cari();\r\n loadtotaldata();\r\n rawclear();\r\n onkodetype();\r\n loadcombokeuangan();\r\n luser.setText(sh.getUsername());\r\n bsimpan.setId(\"bc\");\r\n bclear.setId(\"bc\");\r\n header.setId(\"tema\");\r\n footer.setId(\"tema\");\r\n detail.setId(\"tema\");\r\n tlimit.setId(\"tema\");\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n btnCalculaPalpite = new javax.swing.JButton();\n txtValorPalpite = new javax.swing.JSpinner();\n lblBalaoTextoGenio = new javax.swing.JLabel();\n lblImageGenio = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n btnCalculaPalpite.setText(\"Palpite\");\n btnCalculaPalpite.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCalculaPalpiteActionPerformed(evt);\n }\n });\n\n txtValorPalpite.setModel(new javax.swing.SpinnerNumberModel(1, 1, 5, 1));\n\n lblBalaoTextoGenio.setFont(new java.awt.Font(\"Ubuntu\", 0, 18)); // NOI18N\n lblBalaoTextoGenio.setForeground(new java.awt.Color(23, 11, 11));\n lblBalaoTextoGenio.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lblBalaoTextoGenio.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/images/balao.png\"))); // NOI18N\n lblBalaoTextoGenio.setText(\"<html> Vou pensar em um<br/> valor entre <strong>1</strong> e <strong>5</strong>.<br/> Tente adivinhar. </html>\");\n lblBalaoTextoGenio.setToolTipText(\"\");\n lblBalaoTextoGenio.setVerticalAlignment(javax.swing.SwingConstants.TOP);\n lblBalaoTextoGenio.setFocusTraversalPolicyProvider(true);\n lblBalaoTextoGenio.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n\n lblImageGenio.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/images/genio.png\"))); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(80, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblBalaoTextoGenio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(btnCalculaPalpite, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE)\n .addComponent(txtValorPalpite)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lblImageGenio)\n .addContainerGap(19, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(lblImageGenio))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(26, Short.MAX_VALUE)\n .addComponent(lblBalaoTextoGenio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(122, 122, 122)\n .addComponent(txtValorPalpite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btnCalculaPalpite, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(76, Short.MAX_VALUE))\n );\n\n pack();\n }", "private void initHubTab() {\n\n /** Create the Hiub to manage the master model \"modelHub\"\n */\n this.hub = new BoundedRangeModelHub( this.modelHub );\n\n /** Define the range values of our master model\n */\n this.modelHub.setMinimum(0);\n this.modelHub.setMaximum(5000);\n\n /** Create 3 sub models initially with an arbitrary weight of 10\n * Theses weights are editable by the user\n */\n this.modelHub1 = this.hub.createFragment( 10 );\n this.modelHub2 = this.hub.createFragment( 10 );\n this.modelHub3 = this.hub.createFragment( 10 );\n\n /** Each SubModel's range values are independant and take it directly from theses slider.\n * All models (even the master) are independant and can have theses owns range values\n */\n this.modelHub1.setMinimum( this.jSliderModel1.getMinimum() );\n this.modelHub1.setMaximum( this.jSliderModel1.getMaximum() );\n this.modelHub2.setMinimum( this.jSliderModel2.getMinimum() );\n this.modelHub2.setMaximum( this.jSliderModel2.getMaximum() );\n this.modelHub3.setMinimum( this.jSliderModel3.getMinimum() );\n this.modelHub3.setMaximum( this.jSliderModel3.getMaximum() );\n\n /** Fix some default weight for sub models\n * At this stage of initialisation, listeners are effective on spinners.\n * Theses changes will change sub model weight\n */\n this.jSpinnerModel1.setValue(40);\n this.jSpinnerModel2.setValue(60);\n this.jSpinnerModel3.setValue(20);\n\n /** Set the BusyIcon to the label\n */\n this.jLabelHub.setIcon( iconHub );\n }", "private void betOptionPane(){ \n SpinnerModel sModel = new SpinnerNumberModel(50,1,blackjackController.getHumanPlayer().getBudget(),5); \n JSpinner spinner = new JSpinner(sModel);\n\n Object[] inputFields = {\"Hey! \\nYour current budget is $\"+this.blackjackController.getHumanPlayer().getBudget()+\".\\n\", \"Declare your new bet : \", spinner, \"Good luck!\"};\n int option = JOptionPane.showConfirmDialog(this, inputFields, \"\", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);\n\n if (option == JOptionPane.OK_OPTION) {\n this.blackjackController.setBet((Integer) spinner.getValue());\n }else{\n this.dispose();\n }\n }", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n // TODO\r\n loadtotaluang();\r\n kalkulasi();\r\n clearfield();\r\n kalkulasibybutton();\r\n bcl.setId(\"bc\");\r\n b1.setId(\"bc\");\r\n b2.setId(\"bc\");\r\n b3.setId(\"bc\");\r\n b4.setId(\"bc\");\r\n b5.setId(\"bc\");\r\n b6.setId(\"bc\");\r\n b7.setId(\"bc\");\r\n b8.setId(\"bc\");\r\n b9.setId(\"bc\");\r\n b0.setId(\"bc\");\r\n header.setId(\"tema\");\r\n footer.setId(\"tema\");\r\n loadakunkeuangan();\r\n\r\n }", "public void initialize() {\n currency.setRoundingMode(RoundingMode.HALF_UP);\r\n \r\n // listener for changes to tipPercentageSlider's value\r\n tipPercentageSlider.valueProperty().addListener(\r\n new ChangeListener<Number>() {\r\n @Override\r\n public void changed(ObservableValue<? extends Number> ov,\r\n Number oldValue, Number newValue) {\r\n tipPercentage =\r\n BigDecimal.valueOf(newValue.intValue() / 100.0);\r\n tipPercentageLabel.setText(percent.format(tipPercentage));\r\n }\r\n }\r\n );\r\n }", "@Override\n public final void init() {\n super.init();\n UIUtils.clearAllFields(upperPane);\n changeStatus(Status.NONE);\n intCombo();\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n MyUtils.populateColumnNames(cmbSc, \"task\");\n txtSi.setText(si);\n MyUtils.selectComboBoxValue(cmbSc, sc);\n refreshTbl();\n }", "private void initializeVariables() {\n\t\tseekBar = (SeekBar) findViewById(R.id.seekBar1);\n\t\ttextView = (TextView) findViewById(R.id.finishText);\n\t\tspinner = (Spinner) findViewById(R.id.algorithm);\n\t\tsetSeekBarListener();\n\t\taddListenerOnAlgorithmSelection();\n\t}", "private void setUpSpinner(){\n ArrayAdapter paymentSpinnerAdapter =ArrayAdapter.createFromResource(this,R.array.array_gender_option,android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line, then apply adapter to the spinner\n paymentSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n mPaymentSpinner.setAdapter(paymentSpinnerAdapter);\n\n // To set the spinner to the selected payment method by the user when clicked from cursor adapter.\n if (payMode != null) {\n if (payMode.equalsIgnoreCase(\"COD\")) {\n mPaymentSpinner.setSelection(0);\n } else {\n mPaymentSpinner.setSelection(1);\n }\n mPaymentSpinner.setOnTouchListener(mTouchListener);\n }\n\n mPaymentSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selectedPayment = (String)parent.getItemAtPosition(position);\n if(!selectedPayment.isEmpty()){\n if(selectedPayment.equals(getString(R.string.payment_cod))){\n mPaymentMode = clientContract.ClientInfo.PAYMENT_COD; // COD = 1\n }else{\n\n mPaymentMode = clientContract.ClientInfo.PAYMENT_ONLINE; // ONLINE = 0\n }\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n }", "public void setMinSelectCount(int count) {\n this.mMinSelectCount = count;\n }", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n //Populating current part data\r\n currPart = MainController.getPartModify();\r\n if (currPart instanceof InHousePart) {\r\n inHouseRBtn.setSelected(true);\r\n partIDLabel.setText(\"Machine ID\");\r\n partIDTxt.setText(String.valueOf(((InHousePart) currPart).getMachineId()));\r\n }\r\n\r\n if (currPart instanceof OutsourcedPart){\r\n outsourcedRBtn.setSelected(true);\r\n partIDLabel.setText(\"Company Name\");\r\n partIDTxt.setText(((OutsourcedPart) currPart).getCompanyName());\r\n }\r\n\r\n autoIDTxt.setText(String.valueOf(currPart.getId()));\r\n partNameTxt.setText(currPart.getName());\r\n partInvTxt.setText(String.valueOf(currPart.getStock()));\r\n partPriceTxt.setText(String.valueOf(currPart.getPrice()));\r\n maxInvTxt.setText(String.valueOf(currPart.getMax()));\r\n minInvTxt.setText(String.valueOf(currPart.getMin()));\r\n \r\n \r\n errorLabel.setVisible(false);\r\n errorTxtLabel.setVisible(false);\r\n }", "private void populatePhone() {\n dataBaseHelper = new DataBaseHelper(this);\n List<String> lables = dataBaseHelper.getPN();\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, lables);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n phoneNum.setAdapter(dataAdapter);\n\n }", "public MainFrame() {\n initComponents();\n jLabel_Site.setCursor(new Cursor(Cursor.HAND_CURSOR));\n jf = new JFileChooser();\n jf.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n SpinnerNumberModel model = new SpinnerNumberModel(DownTask.getInstance().getPOOL_SIZE(), 1, 500, 1);\n jSpThreadCount.setModel(model);\n jTextField_SavePath.setText(DownTask.getInstance().getSavePath());\n MainFrameUI.setTaskTable(jTable_TaskList);\n MainFrameUI.setDowningTable(jTable_Download);\n }", "@Override\r\n protected void initListener() {\r\n backiv.setOnClickListener(this);\r\n mSetMainbtn.setOnClickListener(this);\r\n// mSetTerminalBtn.setOnClickListener(this);\r\n// mTerminalipSp3.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\r\n// @Override\r\n// public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\r\n// mSpinner3Data = i;\r\n// }\r\n//\r\n// @Override\r\n// public void onNothingSelected(AdapterView<?> adapterView) {\r\n//\r\n// }\r\n// });\r\n// mTerminalipSp5.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\r\n// @Override\r\n// public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\r\n// mSpinner5Data = i;\r\n// }\r\n//\r\n// @Override\r\n// public void onNothingSelected(AdapterView<?> adapterView) {\r\n//\r\n// }\r\n// });\r\n }", "private void initialiseNumberPickers() {\n\n ViewGroup pickerElements = (ViewGroup) findViewById(R.id.pickerLayout);\n for (int j = 0; j < pickerElements.getChildCount(); j++) {\n View grandchild = pickerElements.getChildAt(j);\n if (grandchild instanceof NumberPicker) {\n\n ((NumberPicker) grandchild).setMaxValue(9);\n ((NumberPicker) grandchild).setMinValue(0);\n if (grandchild.getId() == R.id.tenSecondPicker) {\n ((NumberPicker) grandchild).setMaxValue(5);\n }\n }\n }\n }", "private void initSpinners() {\n mColourArray = Constants.colours.keySet().toArray(new String[Constants.colours.keySet().size()]);\n mPositonArray = Constants.gravity.keySet().toArray(new String[Constants.gravity.keySet().size()]);\n mScaleArray = Constants.scale.keySet().toArray(new String[Constants.scale.keySet().size()]);\n\n // Init Adapters\n ArrayAdapter<String> colourAdapter = new ArrayAdapter<>(\n this,\n R.layout.adapter_dropdown_menu_item,\n mColourArray);\n\n ArrayAdapter<String> positionAdapter = new ArrayAdapter<>(\n this,\n R.layout.adapter_dropdown_menu_item,\n mPositonArray);\n\n ArrayAdapter<String> scaleAdapter = new ArrayAdapter<>(\n this,\n R.layout.adapter_dropdown_menu_item,\n mScaleArray);\n\n // Set Adapter\n mDataBinding.textColor.setAdapter(colourAdapter);\n mDataBinding.backgroundColor.setAdapter(colourAdapter);\n mDataBinding.position.setAdapter(positionAdapter);\n mDataBinding.imageScale.setAdapter(scaleAdapter);\n\n // Set Listeners\n mDataBinding.textColor.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mTextColour = Constants.colours.get(selectedItemKey);\n });\n\n mDataBinding.backgroundColor.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mBackgroundColour = Constants.colours.get(selectedItemKey);\n });\n\n mDataBinding.position.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mPosition = Constants.gravity.get(selectedItemKey);\n });\n\n mDataBinding.imageScale.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mScale = Constants.scale.get(selectedItemKey);\n });\n\n // Set defaults\n mDataBinding.textColor.setText(colourAdapter.getItem(1), false);\n mDataBinding.backgroundColor.setText(colourAdapter.getItem(0), false);\n mDataBinding.position.setText(positionAdapter.getItem(0), false);\n mDataBinding.imageScale.setText(scaleAdapter.getItem(0), false);\n mTextColour = colourAdapter.getItem(1);\n mBackgroundColour = colourAdapter.getItem(0);\n mPosition = positionAdapter.getItem(0);\n mScale = scaleAdapter.getItem(0);\n }", "private void loadSpinnerData() {\n rows = db.getPumpDetails();\n\n // Creating adapter for spinner\n dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, rows);\n\n // Drop down layout style - list view with radio button\n dataAdapter\n .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // attaching data adapter to spinner\n spinner.setAdapter(dataAdapter);\n }", "public banks() {\n initComponents();\n }", "private void initSpinner() {\n\t\tdata1 = new ArrayList<HashMap<String, String>>();\n\t\tdata2 = new ArrayList<HashMap<String, String>>();\n\t\tdata3 = new ArrayList<HashMap<String, String>>();\n\n\t\tadapter1 = new SimpleAdapter(this, data1,\n\t\t\t\tandroid.R.layout.simple_spinner_dropdown_item, from, to);\n\t\tadapter2 = new SimpleAdapter(this, data2,\n\t\t\t\tandroid.R.layout.simple_spinner_dropdown_item, from, to);\n\t\tadapter3 = new SimpleAdapter(this, data3,\n\t\t\t\tandroid.R.layout.simple_spinner_dropdown_item, from, to);\n\n\t\tsp1.setAdapter(adapter1);\n\t\tsp2.setAdapter(adapter2);\n\t\tsp3.setAdapter(adapter3);\n\n\t\tAjaxParams params = new AjaxParams();\n\t\tparams.put(\"op\", \"GetCity\");\n\t\tparams.put(\"levelID\", \"1\");\n\t\tparams.put(\"parentCode\", \"\");\n\t\thttp.get(GlobalVars.url, params, new AjaxCallBack<String>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String t) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.onSuccess(t);\n\t\t\t\ttry {\n\t\t\t\t\tJSONObject jsonObject = new JSONObject(t);\n\t\t\t\t\tif (jsonObject.getInt(\"result\") == 1) {\n\t\t\t\t\t\tJSONArray array = jsonObject.getJSONArray(\"list\");\n\t\t\t\t\t\tfor (int i = 0; i < array.length(); i++) {\n\t\t\t\t\t\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\t\t\t\t\tmap.put(\"name\",\n\t\t\t\t\t\t\t\t\tarray.getJSONObject(i).getString(\"name\"));\n\t\t\t\t\t\t\tmap.put(\"code\",\n\t\t\t\t\t\t\t\t\tarray.getJSONObject(i).getString(\"code\"));\n\t\t\t\t\t\t\tdata1.add(map);\n\t\t\t\t\t\t\tif (userInfoPreferences.getString(\"provinceId\", \"\")\n\t\t\t\t\t\t\t\t\t.equals(array.getJSONObject(i).getString(\n\t\t\t\t\t\t\t\t\t\t\t\"code\"))) {\n\t\t\t\t\t\t\t\tdefaultSheng = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadapter1.notifyDataSetChanged();\n\t\t\t\t\t\tsp1.setSelection(defaultSheng, true);\n\t\t\t\t\t}\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable t, int errorNo, String strMsg) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.onFailure(t, errorNo, strMsg);\n\t\t\t\tTools.showTextToast(context, \"获取省份列表失败,可能是网络问题\");\n\t\t\t}\n\t\t});\n\n\t}", "protected void InitValuables() {\n\t\tsuper.InitValuables();\n\t\t\n\t\tBrightnessManualLevel = ParentActivity.BrightnessManualLevel;\n\t\tBrightnessManualAuto = Home.BRIGHTNESS_MANUAL;\n\t\t\n\t\tseekbarLevel.setProgress(BrightnessManualLevel);\n\t}", "public LimitAddOn() throws Exception {\n initComponents();\n getContextMenu();\n getImageIcon();\n defaultSetVariable();\n configComponent();\n configLimitTable();\n showLimitHeader();\n datePick();\n AutoCompleteDecorator.decorate(cmbGrup);\n AutoCompleteDecorator.decorate(cmbProduk);\n byGrupList();\n byProdukList();\n captureSelectedRow();\n }", "protected void setStatusSpinner() {\r\n\t\tSpinner spinner = (Spinner) mActionBar.getCustomView().findViewById(\r\n\t\t\t\tR.id.spinner_status);\r\n\t\tif (!mShowStatusFilter\r\n\t\t\t\t|| mArchiveFragmentStatePagerAdapter.getCount() == 0) {\r\n\t\t\tspinner.setVisibility(View.GONE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Determine which statuses are actually used for the currently\r\n\t\t// selected size filter.\r\n\t\tGridDatabaseAdapter gridDatabaseAdapter = new GridDatabaseAdapter();\r\n\t\tfinal StatusFilter[] usedStatuses = gridDatabaseAdapter\r\n\t\t\t\t.getUsedStatuses(mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t.getSizeFilter());\r\n\r\n\t\t// Load the list of descriptions for statuses actually used into the\r\n\t\t// array adapter.\r\n\t\tString[] usedStatusesDescription = new String[usedStatuses.length];\r\n\t\tfor (int i = 0; i < usedStatuses.length; i++) {\r\n\t\t\tusedStatusesDescription[i] = getResources().getStringArray(\r\n\t\t\t\t\tR.array.archive_status_filter)[usedStatuses[i].ordinal()];\r\n\t\t}\r\n\t\tArrayAdapter<String> adapterStatus = new ArrayAdapter<String>(this,\r\n\t\t\t\tandroid.R.layout.simple_spinner_item, usedStatusesDescription);\r\n\t\tadapterStatus\r\n\t\t\t\t.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\r\n\t\t// Build the spinner\r\n\t\tspinner.setAdapter(adapterStatus);\r\n\r\n\t\t// Restore selected status\r\n\t\tStatusFilter selectedStatusFilter = mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t.getStatusFilter();\r\n\t\tfor (int i = 0; i < usedStatuses.length; i++) {\r\n\t\t\tif (usedStatuses[i] == selectedStatusFilter) {\r\n\t\t\t\tspinner.setSelection(i);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Hide spinner if only two choices are available. As one of those\r\n\t\t// choices is always \"ALL\" the choices will result in an identical\r\n\t\t// selection.\r\n\t\tspinner.setVisibility((usedStatuses.length <= 2 ? View.GONE\r\n\t\t\t\t: View.VISIBLE));\r\n\r\n\t\tspinner.setOnItemSelectedListener(new OnItemSelectedListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\r\n\t\t\t\t\tint position, long id) {\r\n\t\t\t\t// Get the selected status\r\n\t\t\t\tStatusFilter statusFilter = usedStatuses[(int) id];\r\n\r\n\t\t\t\t// Check if value for status spinner has changed.\r\n\t\t\t\tif (statusFilter != mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t.getStatusFilter()) {\r\n\t\t\t\t\t// Remember currently displayed grid id.\r\n\t\t\t\t\tint gridId = getCurrentSelectedGridId();\r\n\r\n\t\t\t\t\t// Refresh pager adapter with new status.\r\n\t\t\t\t\tmArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t\t.setStatusFilter(statusFilter);\r\n\r\n\t\t\t\t\t// Refresh the size spinner as the content of the spinners\r\n\t\t\t\t\t// are related.\r\n\t\t\t\t\tsetSizeSpinner();\r\n\r\n\t\t\t\t\t// If possible select the grid id which was selected before\r\n\t\t\t\t\t// changing the spinner(s). Otherwise select last page.\r\n\t\t\t\t\tselectGridId(gridId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onNothingSelected(AdapterView<?> arg0) {\r\n\t\t\t\t// Do nothing\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void getUserBathroomsChoice() {\n int checkedChipId = mBinding.chipGroupBathrooms.getCheckedChipId();\n if (checkedChipId == R.id.chip_1_bathroom) {\n mChipBathroomsInput = 1;\n } else if (checkedChipId == R.id.chip_2_bathrooms) {\n mChipBathroomsInput = 2;\n } else if (checkedChipId == R.id.chip_3_bathrooms) {\n mChipBathroomsInput = 3;\n } else if (checkedChipId == R.id.chip_4_bathrooms) {\n mChipBathroomsInput = 4;\n } else if (checkedChipId == R.id.chip_5_bathrooms) {\n mChipBathroomsInput = 5;\n } else {\n mChipBathroomsInput = 0;\n }\n }", "private void loadSpinner() {\n // Chargement du spinner de la liste des widgets\n widgetAdapter = (WidgetAdapter) DomoUtils.createAdapter(context, VOCAL);\n spinnerWidgets.setAdapter(widgetAdapter);\n\n // Chargement du spinner Box\n BoxAdapter boxAdapter = (BoxAdapter) DomoUtils.createAdapter(context, BOX);\n spinnerBox.setAdapter(boxAdapter);\n }", "private void BuildingCombo() {\n \n }", "private void scanningBlurScoreValueBarInit() {\n LayoutParams layoutParams = (LayoutParams) scanningBlurScoreProgressBarContainer.getLayoutParams();\n layoutParams.setMargins(0, dp2Px(context, px2Dp(context, cornerPositions.leftTop.y) - 70), 0, 0);\n scanningBlurScoreProgressBarContainer.setLayoutParams(layoutParams);\n\n scanningBlurValueBar = (ProgressBar) findViewById(R.id.scanning_seekbar);\n scanningBlurValueBar.setProgress(0);\n scanningBlurValueBar.setInterpolator(new BounceInterpolator());\n }", "void setLimit(int limit);", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n showPromotion();\n showCombo();\n showComboPart();\n \n }", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter colourSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.phone_colour_array, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n colourSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mColourSpinner.setAdapter(colourSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mColourSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.phone_colour_black))) {\n mColour = PhoneEntry.COLOUR_BLACK;\n } else if (selection.equals(getString(R.string.phone_colour_white))) {\n mColour = PhoneEntry.COLOUR_WHITE;\n } else if (selection.equals(getString(R.string.phone_colour_grey))){\n mColour = PhoneEntry.COLOUR_GREY;\n }\n else {\n mColour = PhoneEntry.COLOUR_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mColour = PhoneEntry.COLOUR_UNKNOWN;\n }\n });\n\n }", "@Override\r\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tsize = (int) spinnerModel.getValue();\r\n\t\t\t\t\tcanvas.repaint();\r\n\t\t\t\t}", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter genderSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_gender_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n genderSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mGenderSpinner.setAdapter(genderSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mGenderSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.gender_male))) {\n mGender = PetContract.PetEntry.GENDER_MALE;\n } else if (selection.equals(getString(R.string.gender_female))) {\n mGender = PetContract.PetEntry.GENDER_FEMALE;\n } else {\n mGender = PetContract.PetEntry.GENDER_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mGender = PetContract.PetEntry.GENDER_UNKNOWN;\n }\n });\n }", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter fruitSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_fruit_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n fruitSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mTypeSpinner.setAdapter(fruitSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.apple))) {\n mFruit = FruitEntry.TYPE_APPLE;\n } else if (selection.equals(getString(R.string.banana))) {\n mFruit = FruitEntry.TYPE_BANANA;\n } else if (selection.equals(getString(R.string.peach))) {\n mFruit = FruitEntry.TYPE_PEACH;\n } else if (selection.equals(getString(R.string.pineapple))) {\n mFruit = FruitEntry.TYPE_PINEAPPLE;\n } else if (selection.equals(getString(R.string.strawberry))) {\n mFruit = FruitEntry.TYPE_STRAWBERRY;\n } else if (selection.equals(getString(R.string.watermelon))) {\n mFruit = FruitEntry.TYPE_WATERMELON;\n } else {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n });\n }", "public void initialize() {\r\n\t\tsetValue(initialValue);\r\n\t}", "public PengambilanBarang() {\n initComponents();\n \n FormLoad();\n }", "protected void initialize() {\n \ttarget = (int) SmartDashboard.getNumber(\"target\", 120);\n \ttarget = (int) (target * Constants.TICKS_TO_INCHES);\n\t\tRobot.drive.stop();\n\t\tmaxCount = (int) SmartDashboard.getNumber(\"max count\", 0);\n\t\ttolerance = (int) SmartDashboard.getNumber(\"tolerance\", 0);\n\t\tRobot.drive.left.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\t\tRobot.drive.right.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n }" ]
[ "0.61726886", "0.6088473", "0.6071019", "0.60037965", "0.59693265", "0.5960306", "0.58440197", "0.58242774", "0.5822374", "0.5767914", "0.5706264", "0.5686165", "0.5664048", "0.5654706", "0.5650077", "0.56451845", "0.56361026", "0.5616766", "0.55894756", "0.5582324", "0.55769736", "0.5571392", "0.5559712", "0.55428016", "0.5538853", "0.5511523", "0.5469092", "0.5467087", "0.54645145", "0.5455133", "0.542655", "0.5424904", "0.5424817", "0.54140306", "0.54016685", "0.53965163", "0.53955543", "0.5374193", "0.537301", "0.5368796", "0.5353566", "0.53418064", "0.533093", "0.53282243", "0.52991456", "0.52942425", "0.528969", "0.5279446", "0.52622503", "0.5255647", "0.5254983", "0.5240291", "0.5234846", "0.52322865", "0.5223526", "0.5223463", "0.5220996", "0.521951", "0.521543", "0.52148324", "0.5188906", "0.5187195", "0.5177906", "0.51769733", "0.51768917", "0.51675564", "0.5154259", "0.5150802", "0.513799", "0.5135615", "0.5135066", "0.51309335", "0.5127344", "0.51170987", "0.51127136", "0.51103884", "0.5105472", "0.5105004", "0.5099554", "0.50966847", "0.50944614", "0.50934714", "0.50907", "0.5089445", "0.50881743", "0.50874126", "0.50835645", "0.50759625", "0.50720054", "0.50709045", "0.507047", "0.50674975", "0.5060118", "0.5059993", "0.5053608", "0.5049794", "0.5047302", "0.5036489", "0.50288033", "0.5028364" ]
0.8079941
0
The method used to clear and build a tree
@FXML private void renderTree() { unmountTree(); buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength); mountTree(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clear() {\n tree.clear();\n }", "public void clear() {\n\t\troot.left = null;\n\t\troot.right = null;\n\t\troot = null;\n\t\tsize = 0;\n\t}", "public TreeBuilder() {\n\t\troot = null;\n\t}", "@Override\r\n public void clear(){\r\n root = null;\r\n }", "public void clear(){\n root = null;\n count = 0;\n }", "public void clear() {\n\t\tthis.root = new Node();\n\t}", "public void makeEmpty(){\n deleteAll(root);\n root = null;\n numItems = 0;\n }", "public void makeEmpty() {\r\n\t\troot = null;\r\n\t\tleftChild = null;\r\n\t\trightChild= null;\r\n\t}", "public void makeEmpty() {\r\n\t\troot = null;\r\n\t}", "@Override\n public void clear() {\n root = null;\n }", "public void clear()\r\n\t{\r\n\t\tdata = new IterativeBinarySearchTree<Entry>();\r\n\t}", "private void clearFullTree()\r\n {\r\n fullXmlTree = new StringBuilder();\r\n }", "public void makeEmpty( )\r\n\t{\r\n\t\troot = null;\r\n\t}", "public void makeEmpty() {\n\t\troot = null;\n\t}", "private void buildRoot() {\n this.root = new GPRootTreeNode(this.tree);\n }", "public void makeEmpty() {\n root = null;\n }", "@Override\n\tpublic void clear() {\n\t\tsize = 0;\n\t\troot = null;\n\t}", "public void clear() {\n root = null;\n }", "public void clear() {\n root = null;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\r\n\t\troot = null;\r\n\t\tsize = 0;\r\n\t}", "@Override\n public void clear() {\n size = 0;\n root = null;\n }", "public void clear() {\n count = 0;\n root = null;\n }", "@Generated(hash = 1311440767)\r\n public synchronized void resetTrees() {\r\n trees = null;\r\n }", "public void clear() {\n\t\troot = null;\n\t\tcount = 0;\n\t}", "public void recomputeTree() {\n\t\tsuperRoot = factory.createTreeNode(null, this);\n\t\tlayoutToTree.put(null, superRoot);\n\t\tcreateTrees(context.getNodes());\n\t}", "public Builder clearRecursive() {\n if (recursiveBuilder_ == null) {\n recursive_ = null;\n onChanged();\n } else {\n recursive_ = null;\n recursiveBuilder_ = null;\n }\n\n return this;\n }", "public BSearchTree() {\n\t\tthis.overallRoot = null;\n\t}", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public void makeEmpty()\n {\n root = nil;\n }", "public RedBlackTree()\n { \n \t root = null;\n }", "private void updateCategoryTree() {\n categoryTree.removeAll();\r\n fillTree(categoryTree);\r\n\r\n }", "public Builder clearDepth() {\n \n depth_ = 0;\n onChanged();\n return this;\n }", "public void clear() {\n this.root_.setNw(null);\n this.root_.setNe(null);\n this.root_.setSw(null);\n this.root_.setSe(null);\n this.root_.setNodeType(NodeType.EMPTY);\n this.root_.setPoint(null);\n this.count_ = 0;\n }", "private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}", "public Tree(){\n root = null;\n }", "public void clear()\n\t{\n\t\tthis.getChildren().clear();\n\t}", "public Builder clearRecursiveNull() {\n \n recursiveNull_ = false;\n onChanged();\n return this;\n }", "public void refreshTree(){\n\r\n\t\ttestCaseVector = db.getTestCases();\r\n\t\tFolderVector = db.getFolders();\r\n\t\trootNode_TC = new DefaultMutableTreeNode(\"Test Cases\");\r\n\t\ts = new MyTreeNode [testCaseVector.size()+FolderVector.size() +2];\r\n\t\tFolder1 = new DefaultMutableTreeNode [testCaseVector.size()+FolderVector.size() +2];\r\n\r\n\r\n\r\n\t\tint x = 1 ; \r\n\t\tfor(Folder f: FolderVector){\r\n\t\t\ts[x] = new MyTreeNode(f.getName(),'f', x, f.getFolderID());\r\n\r\n\t\t\tExpandedID[x] = f.getFolderID();\r\n\t\t\tFolder1[x] = new DefaultMutableTreeNode(s[x]);\r\n\r\n\t\t\tif (f.getParentID() == 0)\r\n\t\t\t{\r\n\t\t\t\trootNode_TC.add(Folder1[x]);\r\n\t\t\t\tx++;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\telse {\r\n\r\n\t\t\t\tfor (int u = 1 ; u < s.length; u++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif(s[u]!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(s[u].getType() == 'f')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(s[u].getID() == f.getParentID())\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tFolder1[u].add(Folder1[x]);\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tint l = x-1;\r\n\t\t\tfor(TestCase tc : testCaseVector)\r\n\t\t\t{\r\n\r\n\t\t\t\tif (tc.getFolderID() == f.getFolderID())\r\n\t\t\t\t{\r\n\t\t\t\t\ts[x] =new MyTreeNode(tc.getName(), 't', x, tc.getId());\r\n\r\n\t\t\t\t\tFolder1[l].add(new DefaultMutableTreeNode(s[x]));\r\n\t\t\t\t\tx++;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tint y = FolderVector.size()+1;\r\n\t\tfor(TestCase tc : testCaseVector)\r\n\t\t{\r\n\t\t\tif(tc.getFolderID() == 0){\r\n\r\n\r\n\t\t\t\tMyTreeNode s=new MyTreeNode(tc.getName(), 't', y, tc.getId());\r\n\t\t\t\trootNode_TC.add(new DefaultMutableTreeNode(s));\r\n\t\t\t\ty++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tDefaultTreeModel Tree1 = new DefaultTreeModel(rootNode_TC);\r\n\t\toverviewTree.setModel(Tree1);\r\n\t\toverviewTree.setCellRenderer(new TreeRenderer(isExpanded, ExpandedID));\r\n\t\tfor(Folder f: FolderVector)\r\n\t\t{\r\n\t\t\tif(isExpanded[f.getFolderID()]){ // To expand the already expanded folders\r\n\t\t\t\tfor (int u = 1 ; u < s.length; u++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif(s[u]!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(s[u].getType() == 'f')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(s[u].getID() == f.getFolderID())\r\n\t\t\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t\t\tEnumeration<DefaultMutableTreeNode> e = rootNode_TC.depthFirstEnumeration();\r\n\t\t\t\t\t\t\t\twhile (e.hasMoreElements()) {\r\n\t\t\t\t\t\t\t\t\tDefaultMutableTreeNode node = e.nextElement();\r\n\t\t\t\t\t\t\t\t\tif (node != overviewTree.getModel().getRoot() )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tMyTreeNode nodeInfo = null ;\r\n\t\t\t\t\t\t\t\t\t\tnodeInfo = (MyTreeNode) node.getUserObject();\r\n\t\t\t\t\t\t\t\t\t\tif (nodeInfo.getName().equalsIgnoreCase(s[u].getName())) \r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tTreePath p = new TreePath(node.getPath());\r\n\t\t\t\t\t\t\t\t\t\t\toverviewTree.expandRow(overviewTree.getRowForPath(p));\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public Tree() // constructor\n\t{ root = null; }", "public KdTree() {\n this.root = null;\n this.size = 0;\n }", "void resetTreeForQueries() {\n\t\t_queryTree = new Tree(_tree);\n\t\tif(DEBUG) {\n\t\t\tSystem.out.printf(\"\\nquery tree structure:\\n%s\\n\",_queryTree.getLongInfo());\n\t\t}\n\t}", "public void reset() {\r\n\t\t_tb = new TreeBuffer();\r\n\t}", "public RBTree() {\r\n\t\troot = null;\r\n\t}", "public void clear()\n\t\t{ while (!children.isEmpty()) remove(children.get(0)); }", "public Builder clearTreeNodeId() {\n if (treeNodeIdBuilder_ == null) {\n treeNodeId_ = null;\n onChanged();\n } else {\n treeNodeId_ = null;\n treeNodeIdBuilder_ = null;\n }\n\n return this;\n }", "public KdTree() {\n root = null;\n }", "@Override\n public void clearAst() {\n this.root = null;\n }", "BinarySearchTree() {\n this.root = null;\n }", "public void clear() {\n mSize = 0;\n mRoot = null;\n }", "public void clear() {\n lists = new TernarySearchTree<>();\n }", "public void delete() {\n this.root = null;\n }", "@Override\r\n\tpublic void buildTree() {\r\n\t\t\r\n\t\t// root level \r\n\t\trootNode = new TreeNode<String>(\"\");\r\n\t\t\r\n\t\t//first level\r\n\t\tinsert(\".\", \"e\");\r\n\t\tinsert(\"-\", \"t\");\r\n\t\t\r\n\t\t//second level\r\n\t\t\r\n\t\tinsert(\". .\", \"i\");\r\n\t\tinsert(\".-\", \"a\");\r\n\t\tinsert(\"-.\", \"n\"); \r\n\t\tinsert(\"--\", \"m\");\r\n\t\t\r\n\t\t//third level\r\n\t\tinsert(\"...\", \"s\");\r\n\t\tinsert(\"..-\", \"u\");\r\n\t\tinsert(\".-.\", \"r\");\r\n\t\tinsert(\".--\", \"w\");\r\n\t\tinsert(\"-..\", \"d\");\r\n\t\tinsert(\"-.-\", \"k\");\r\n\t\tinsert(\"--.\", \"g\");\r\n\t\tinsert(\"---\", \"o\");\r\n\t\t\r\n\t\t//fourth level\r\n\t\tinsert(\"....\", \"h\");\r\n\t\tinsert(\"...-\", \"v\");\r\n\t\tinsert(\"..-.\", \"f\");\r\n\t\tinsert(\".-..\", \"l\");\r\n\t\tinsert(\".--.\", \"p\");\r\n\t\tinsert(\".---\", \"j\");\r\n\t\tinsert(\"-...\", \"b\");\r\n\t\tinsert(\"-..-\", \"x\");\r\n\t\tinsert(\"-.-.\", \"c\");\r\n\t\tinsert(\"-.--\", \"y\");\r\n\t\tinsert(\"--..\", \"z\");\r\n\t\tinsert(\"--.-\", \"q\");\r\n\t\t\r\n\t}", "public static void build ()\r\n {\r\n lgt.insert(1);\r\n lgt.insert(2);\r\n lgt.insert(5);\r\n \r\n lgt.findRoot();\r\n lgt.insert(3);\r\n \r\n lgt.findRoot();\r\n lgt.insert(4);\r\n \r\n lgt.insert(6);\r\n lgt.findParent();\r\n lgt.insert(7);\r\n \r\n }", "@Override\n public void clear() {\n root = new Node ('i', false, 256);\n }", "private void buildTree() {\n if (treeBuilt) {\n return;\n }\n\n Vector gItems = protocol.getGroupItems();\n int gCount = gItems.size();\n for (int i = 0; i < gCount; ++i) {\n Group gItem = (Group)gItems.elementAt(i);\n gItem.updateContacts();\n gItem.updateGroupData();\n }\n\n TreeNode currentNode = getCurrentNode();\n TreeBranch root = getRoot();\n clear();\n root.setExpandFlag(false);\n boolean showOffline = !Options.getBoolean(Options.OPTION_CL_HIDE_OFFLINE);\n for (int groupIndex = 0; groupIndex < gCount; ++groupIndex) {\n Group group = (Group)gItems.elementAt(groupIndex);\n boolean isExpanded = group.isExpanded();\n group.setExpandFlag(false);\n cleanNode(group);\n Vector contacts = group.getContacts();\n int contactCount = contacts.size();\n for (int contactIndex = 0; contactIndex < contactCount; ++contactIndex) {\n Contact cItem = (Contact)contacts.elementAt(contactIndex);\n if (cItem.isVisibleInContactList()) {\n addNode(group, cItem);\n }\n }\n group.setExpandFlag(isExpanded);\n if (showOffline || (0 < group.getSubnodesCount())) {\n addNode(root, group);\n }\n }\n Vector cItems = getContactItems();\n int cCount = cItems.size();\n for (int contactIndex = 0; contactIndex < cCount; ++contactIndex) {\n Contact cItem = (Contact)cItems.elementAt(contactIndex);\n if ((Group.NOT_IN_GROUP == cItem.getGroupId()) && cItem.isVisibleInContactList()) {\n addNode(root, cItem);\n }\n }\n\n setCurrentNode(currentNode);\n root.setExpandFlag(true);\n updateMetrics();\n treeBuilt = true;\n }", "public RBTree() {\n\t\troot = null;\n\t\tdrawer = new RBTreeDrawer();\n\t}", "public void clear() {\n\t\t\tfor (AbstractTreeNode node : children) {\n\t\t\t\tnode.setParent(null);\n\t\t\t}\n\t\t\t\n\t\t\t// clear children\n\t\t\tchildren.clear();\n\t\t}", "public KdTree() {\n size = 0;\n }", "public KdTree()\n {\n root = null;\n size = 0;\n }", "public void reset(){\r\n \tif (blank != null){\r\n \t\tblank.clear();\r\n \t}\r\n \tif (blankNode != null){\r\n \t\tblankNode.clear();\r\n \t}\r\n }", "public void clear() {\r\n\t\t\r\n\t\ttopNode = null; // Sets topNode pointer to null.\r\n\t\t\r\n\t}", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "public AVLTree() {\r\n\r\n\r\n this.root = new AVLTreeNode(9);\r\n Delete(9);\r\n }", "private void CreateTree()\r\n\t{\r\n\r\n\t\t//sample nodes which are not identical\r\n\t\ta = new Node(1);\r\n\t\ta.left = new Node(3);\r\n\t\ta.left.left = new Node(5);\r\n\t\ta.right = new Node(2);\r\n\r\n\r\n\t\tb = new Node(2);\r\n\t\tb.left = new Node(1);\r\n\t\tb.right = new Node(3);\r\n\t\tb.right.right = new Node(7);\r\n\t\tb.left.right = new Node(4);\r\n\r\n\t\t//sample nodes which are identical\r\n\t\ta1 = new Node(1);\r\n\t\ta1.left = new Node(3);\r\n\t\ta1.left.left = new Node(5);\r\n\t\ta1.right = new Node(2);\r\n\r\n\r\n\t\tb1 = new Node(1);\r\n\t\tb1.left = new Node(3);\r\n\t\tb1.right = new Node(2);\r\n\t\tb1.left.left = new Node(5); \r\n\t}", "public Builder clearTreeNodeIdNull() {\n \n treeNodeIdNull_ = false;\n onChanged();\n return this;\n }", "public void clearData() {\r\n if (m_root != null) {\r\n m_root.destroy();\r\n m_root = null;\r\n }\r\n }", "public Builder clearNode() {\n if (nodeBuilder_ == null) {\n node_ = null;\n onChanged();\n } else {\n node_ = null;\n nodeBuilder_ = null;\n }\n\n return this;\n }", "public Builder clearNode() {\n if (nodeBuilder_ == null) {\n node_ = null;\n onChanged();\n } else {\n node_ = null;\n nodeBuilder_ = null;\n }\n\n return this;\n }", "public Hashtree<V> build() {\n return new UnmodifiableMerkleTree<>(tree);\n }", "public static TreeNode getTree() {\n\t\tTreeNode a = new TreeNode(\"a\", 314);\n\t\tTreeNode b = new TreeNode(\"b\", 6);\n\t\tTreeNode c = new TreeNode(\"c\", 271);\n\t\tTreeNode d = new TreeNode(\"d\", 28);\n\t\tTreeNode e = new TreeNode(\"e\", 0);\n\t\tTreeNode f = new TreeNode(\"f\", 561);\n\t\tTreeNode g = new TreeNode(\"g\", 3);\n\t\tTreeNode h = new TreeNode(\"h\", 17);\n\t\tTreeNode i = new TreeNode(\"i\", 6);\n\t\tTreeNode j = new TreeNode(\"j\", 2);\n\t\tTreeNode k = new TreeNode(\"k\", 1);\n\t\tTreeNode l = new TreeNode(\"l\", 401);\n\t\tTreeNode m = new TreeNode(\"m\", 641);\n\t\tTreeNode n = new TreeNode(\"n\", 257);\n\t\tTreeNode o = new TreeNode(\"o\", 271);\n\t\tTreeNode p = new TreeNode(\"p\", 28);\n\t\t\n\t\ta.left = b; b.parent = a;\n\t\tb.left = c; c.parent = b;\n\t\tc.left = d;\t d.parent = c;\n\t\tc.right = e; e.parent = c;\n\t\tb.right = f; f.parent = b;\n\t\tf.right = g; g.parent = f;\n\t\tg.left = h; h.parent = g;\n\t\ta.right = i; i.parent = a;\n\t\ti.left = j; j.parent = i;\n\t\ti.right = o; o.parent = i;\n\t\tj.right = k; k.parent = j;\n\t\to.right = p; p.parent = o;\n\t\tk.right = n; n.parent = k;\n\t\tk.left = l; l.parent = k;\n\t\tl.right = m; m.parent = l;\n\t\t\n\t\td.childrenCount = 0;\n\t\te.childrenCount = 0;\n\t\tc.childrenCount = 2;\n\t\tb.childrenCount = 6;\n\t\tf.childrenCount = 2;\n\t\tg.childrenCount = 1;\n\t\th.childrenCount = 0;\n\t\tl.childrenCount = 1;\n\t\tm.childrenCount = 0;\n\t\tn.childrenCount = 0;\n\t\tk.childrenCount = 3;\n\t\tj.childrenCount = 4;\n\t\to.childrenCount = 1;\n\t\tp.childrenCount = 0;\n\t\ti.childrenCount = 7;\n\t\ta.childrenCount = 15;\n\t\t\n\t\treturn a;\n\t}", "public void rebuild() {\n\t\tif (!divided) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint totalChildren = 0;\n\t\tfor (QuadTreeNode<E> q : nodes) {\n\t\t\t// If there is a divided child then we cant do anything\n\t\t\tif (q.isDivided()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\ttotalChildren += q.numPoints();\n\t\t}\n\t\t\n\t\t// If the sum of all the children contained in the sub nodes\n\t\t// is greater than allowed then we cant do anything\n\t\tif (totalChildren > QUADTREE_NODE_CAPACITY) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Add all the nodes from the children to this node then remvoe the nodes\n\t\tpoints = new HashMap<Point, E>();\n\t\tfor (QuadTreeNode<E> q : nodes) {\n\t\t\tpoints.putAll(q.points);\n\t\t}\n\t\t\n\t\tnodes.clear();\n\t\tdivided = false;\n\t}", "public void clearChildren() {\r\n this.children = null;\r\n }", "public void clearBuffer() {\r\n\t\t_tb = new TreeBuffer();\r\n\t}", "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "void deleteTree(TreeNode node) \n {\n root = null; \n }", "public void clear()\n {\n nodes.clear();\n }", "public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }", "public BST_Recursive() {\n\t\tthis.root = null;\n\t\tnumOfElements = 0; \n\t}", "private void initTree(E data, TernaryTree<E> leftTree, TernaryTree<E> middleTree, TernaryTree<E> rightTree) {\n /**\n * We have to create a new node here for the case where one of the input trees\n * is this. If we simply set node = new TernaryNode..., and one of the input\n * trees is this, then we lose all of the subchildren of one of the input trees!\n **/\n TernaryNode<E> newRoot = new TernaryNode<>(data);\n\n // if it's empty, then why add it?\n if (leftTree != null && !leftTree.isEmpty()) {\n newRoot.setLeftChild(leftTree.root);\n }\n\n if (middleTree != null && !middleTree.isEmpty()) {\n // if the middle tree is the same as the left tree, then we should create\n // a copy\n if (middleTree == leftTree) {\n newRoot.setMiddleChild(leftTree.root.copy());\n } else {\n newRoot.setMiddleChild(middleTree.root);\n }\n }\n\n if (rightTree != null && !rightTree.isEmpty()) {\n // same idea here, except that we need to check the left and the middle\n if (rightTree == leftTree) {\n newRoot.setRightChild(leftTree.root.copy());\n } else if (rightTree == middleTree) {\n newRoot.setRightChild(middleTree.root.copy());\n } else {\n newRoot.setRightChild(rightTree.root);\n }\n }\n\n // okay, now we can set this tree's root to the newRoot\n root = newRoot;\n\n /**\n * For the next three if-statements, we only clear the tree if the input tree is\n * not the same as this, otherwise we'd be clearing this!\n */\n if (leftTree != null && leftTree != this) {\n leftTree.clear();\n }\n\n if (middleTree != null && middleTree != this) {\n middleTree.clear();\n }\n\n if (rightTree != null && rightTree != this) {\n rightTree.clear();\n }\n }", "public static TreeNode buildTree() {\n\t\t\n\t\tTreeNode root = new TreeNode(1);\n\t\t\n\t\tTreeNode left = new TreeNode(2);\n\t\tleft.left = new TreeNode(4);\n\t\tleft.right = new TreeNode(5);\n\t\tleft.right.right = new TreeNode(8);\n\t\t\n\t\tTreeNode right = new TreeNode(3);\n\t\tright.left = new TreeNode(6);\n\t\tright.right = new TreeNode(7);\n\t\tright.right.left = new TreeNode(9);\n\t\t\n\t\troot.left = left;\n\t\troot.right = right;\n\t\t\n\t\treturn root;\n\t}", "public void refresh() {\n navTreeWidget.removeItems();\n selectedPath = null;\n loadInitialTree();\n }", "public KdTree() {\n root = null;\n n = 0;\n }", "private void expandTree() {\n tree.expand();\n }", "protected void clearData() {\n getValues().clear();\n getChildIds().clear();\n getBTreeMetaData().setDirty(this);\n }", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "public void clear() {\n\t\t//System.err.println(\"FCache::clear() dont know how to clear m_leafCache\");\n\t\tfor (int i = 0; i < m_TopOfBranche.size(); i++) {\n\t\t\tCacheObject o = m_TopOfBranche.elementAt(i);\n\t\t\tif (o != null) {\n\t\t\t\to.m_F = null;\n\t\t\t}\n\t\t}\n\t\t//m_TopOfBranche.removeAllElements();\n\t\tfor (int iNode = 0; iNode < m_BottomOfBrancheID.length; iNode++) {\n\t\t\tclearNode(iNode);\n\t\t}\n\t\tg_nID = 0;\n\t}", "public void BuildTree() {\n MerkleTree tmpMerkleTree = new MerkleTree();\n\n //assign core information into this block from merkleTree\n this.merkleRoot = tmpMerkleTree.getMerkleRoot();\n this.blockBody = tmpMerkleTree;\n }", "public void clear(){\n this.entities.clear();\n /*for(QuadTree node: this.getNodes()){\n node.clear();\n this.getNodes().remove(node);\n }*/\n this.nodes.clear();\n }", "public AVLTree() {\n\t\tthis.root = null;\n\t}", "public MyTreeSet()\r\n {\r\n root = null;\r\n }", "TreeNode(){\n this.elem = null;\n this.left = null;\n this.right = null;\n }", "public void refresh()\n\t{\n\t\tNode master = new Node(\"Tyler\");\n\t\t//master.add(new Node(\"Test\"));\n\t\tmaster.addParent(new Node(\"Clinton\"));\n\t\tmaster.addParent(new Node(\"Terry\"));\n\t\t\n\t\tmaster.add(\"Justin\", \"Terry\"); \n\t\tmaster.add(\"Justin\", \"Clinton\"); \n\t\t//this adds directly under Terry\n\t\t//maybe do this differently...\n\t\t\n\t\t\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"Diana\"));\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"George\"));\n\t\t\n\t\tmaster.add(new Node(\"Tyler 2.0\"));\n\t\tmaster.add(new Node(\"Tyler 3.0\"));\n\t\tmaster.add(new Node(\"Tyler Jr\"));\n\t\t\n\n\t\tmaster.add(\"Tyler Jr Jr\", \"Tyler 2.0\");\n\t\t\n\t\tmaster.add(\"Tyler 3.0\", \"Tyler Jr 2.0\");\n\t\t\n\t\tmaster.findNode(\"Clinton\").addParent(new Node(\"Eric\"));\n\t\tmaster.findNode(\"Eric\").addParent(new Node(\"Eric's Dad\"));\n\t\t\n\t\t\n\t\tmaster.findNode(\"Tyler Jr Jr\", 6).add(new Node(\"Mini Tyler\"));\n\t\t//master.findNode(\"Clinton\", 2).add(new Node(\"Justin\"));\n\t\t\n\t\t\n\t\tmaster.getParent().get(0).findNode(\"Justin\", 3).add(new Node(\"Mini Justin\"));\n\t\t\n\t\tmaster.add(new Node(\"Laptop\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Keyboard\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Mouse\"));\n\t\t\n\t\tmaster.add(\"Touchpad\", \"Laptop\");\n\t\t//master.add(\"Justin\", \"Eric\");\n\t\t\n\t\tmaster.add(\"Hunger\", \"Tyler\");\n\t\t\n\t\tselectedNode = master;\n\t\tselect(selectedNode);\n\t}", "public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }", "public BinaryTree()\n\t{\n\t\troot = null;\n\t}", "public void clear()\n {\n this.mi_Size = 0;\n this.m_RootNode = null;\n this.m_FirstNode = null;\n this.m_LastNode = null;\n }", "public BinaryTree(){\r\n root = null;\r\n }" ]
[ "0.7647076", "0.7209922", "0.7155653", "0.7146795", "0.71353114", "0.7130077", "0.7118458", "0.71030825", "0.71009463", "0.70842725", "0.70753175", "0.70702636", "0.7063944", "0.7057031", "0.70186317", "0.6994936", "0.69767404", "0.6969378", "0.6969378", "0.6951991", "0.6951991", "0.6951991", "0.6931985", "0.6931985", "0.69251263", "0.6903633", "0.68975437", "0.6884992", "0.686642", "0.685802", "0.6854208", "0.68132067", "0.674051", "0.6736191", "0.6733514", "0.6711895", "0.6703568", "0.6690923", "0.6679952", "0.6648195", "0.6638802", "0.66326606", "0.66029674", "0.66009074", "0.65985906", "0.6584768", "0.6582612", "0.65752965", "0.6571781", "0.65521586", "0.6541017", "0.65220547", "0.65130347", "0.65127254", "0.64935154", "0.6461791", "0.64536315", "0.64498764", "0.6442845", "0.6441606", "0.63985306", "0.63492626", "0.63464206", "0.63377994", "0.6326675", "0.6325265", "0.6321533", "0.6320864", "0.631989", "0.6318782", "0.63153803", "0.6309478", "0.6309478", "0.6302713", "0.63014156", "0.62974083", "0.6294062", "0.6291693", "0.62913656", "0.6257182", "0.6245873", "0.6228668", "0.62264484", "0.6220711", "0.6207961", "0.6206206", "0.6204734", "0.6200863", "0.61996657", "0.6189725", "0.6166479", "0.61662674", "0.6159357", "0.61519724", "0.61514586", "0.6137721", "0.6125233", "0.61212206", "0.6110156", "0.61068815", "0.6091947" ]
0.0
-1
Renders the slider that controls the inputBranchWitherRatio field
@FXML private void renderBranchWitherSlider() { renderSlider(0, 1, inputBranchWitherRatio, (e) -> { inputBranchWitherRatio = slider.getValue(); renderTree(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n private void renderBranchGrowthRatioSlider() {\n renderSlider(0.5, 1, inputBranchGrowthRatio, (e) -> {\n inputBranchGrowthRatio = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchAngleSlider() {\n renderSlider(1, 30, inputBranchAngle, (e) -> {\n inputBranchAngle = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchLengthSlider() {\n renderSlider(1, 100, inputBranchLength, (e) -> {\n inputBranchLength = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderTrunkAngleSlider() {\n renderSlider(-180, 0, inputTrunkAngle, (e) -> {\n inputTrunkAngle = slider.getValue();\n renderTree();\n });\n }", "private void renderSlider(double min, double max, double value, EventHandler eventHandler) {\n unmountSlider();\n buildSlider(min, max, value);\n slider.addEventHandler(MouseEvent.MOUSE_RELEASED, eventHandler);\n mountSlider();\n }", "private void iSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_iSliderStateChanged\n float tmp_value = ((float)this.iSlider.getValue())/10;\n this.paramILabel.setText(\"\" + tmp_value);\n }", "Controls () {\n \n barX = 40;\n barWidth = 15;\n \n minY = 40;\n maxY = minY + height/3 - sliderHeight/2;\n \n minZoomValue = height - height;\n maxZoomValue = height; // 300 percent\n valuePerY = (maxZoomValue - minZoomValue) / (maxY - minY);\n \n sliderWidth = 25;\n sliderHeight = 10;\n sliderX = (barX + (barWidth/2)) - (sliderWidth/2); \n sliderValue = minZoomValue; \n sliderY = minY; \n }", "public void sliderChange(int r, int g, int b)\n {\n String outPutR;\n String outPutG;\n String outPutB;\n \n //************output to binary()*******//\n if(binaryRBtn.isSelected() == true)\n { \n outPutR = Integer.toBinaryString(r);\n outPutG = Integer.toBinaryString(g);\n outPutB = Integer.toBinaryString(b);\n\n messageRed = (\"\" + outPutR); \n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //********output to hex()************//\n else if(hexDecRBtn.isSelected() == true)\n {\n outPutR = Integer.toHexString(r);\n outPutG = Integer.toHexString(g);\n outPutB = Integer.toHexString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //**********output to Octal()********//\n else if(octalRBtn.isSelected() == true)\n {\n outPutR = Integer.toOctalString(r);\n outPutG = Integer.toOctalString(g);\n outPutB = Integer.toOctalString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //*********output to decimal()********//\n else if(decimalRBtn.isSelected() == true)\n {\n outPutR = Integer.toString(r);\n outPutG = Integer.toString(g);\n outPutB = Integer.toString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n \n //******Bar Display rise and fall()******//\n redHeight=1; \n greenHeight=1; \n blueHeight=1;\n \n redHeight += rSliderValue;\n greenHeight += gSliderValue;\n blueHeight += bSliderValue;\n \n redYvalue = 475;\n redYvalue -=rSliderValue;\n \n greenYvalue = 475;\n greenYvalue -=gSliderValue;\n \n blueYvalue = 475;\n blueYvalue -=bSliderValue;\n \n repaint();\n \n }", "@Override\n public void updateUI() {\n setUI(new RangeSliderUI(this));\n // Update UI for slider labels. This must be called after updating the\n // UI of the slider. Refer to JSlider.updateUI().\n updateLabelUIs();\n }", "private void dSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_dSliderStateChanged\n float tmp_value = ((float)this.dSlider.getValue())/10;\n this.paramDLabel.setText(\"\" + tmp_value);\n }", "public abstract void updateSlider();", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tif(!source.getValueIsAdjusting()) {// getValueIsAdjusting 함수는 어떤 이벤트 인스턴스에서 연속적으로 이벤트가 일어 났을 때, \n\t\t\t//해당 이벤트 인스턴스들을 일종의 데이터 체인으로 보고 체인의 마지막 인스턴스 외에서 호출하는 경우 true를 반환하는 함수이다.\n\t\t\t\n\t\t\t\n\t\tint value = (int) slider.getValue();\n\t\timgBtn.setSize(value*10, value*10);// 슬라이더의 상태가 변경되면 호출됨\n\t\t}\n\t}", "private JComponent getSlider() {\n\t\t\n\t\t// ----------- slider -----------\n\t\tJSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 400,\n\t\t\t\tDEFAULT_SLIDER_VALUE);\n\t\tslider.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tJSlider source = (JSlider) e.getSource();\n\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\tsliderChanged(e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tslider.setMajorTickSpacing(100);\n\t\tslider.setMinorTickSpacing(30);\n\t\t\n\t\t// ---------- text field ----------\n\t\tselPictures = new JTextField(\"\");\n\t\t \n\t\tJPanel p = new JPanel(new BorderLayout());\n\t\tp.add(selPictures, BorderLayout.CENTER);\n \t\tp.add(slider, BorderLayout.SOUTH);\n\t\t\n\t\treturn p;\n\t}", "public JComponent getSlidersPanel(){ return slidersPanel; }", "private void pSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_pSliderStateChanged\n float tmp_value = ((float)this.pSlider.getValue())/10;\n this.paramPLabel.setText(\"\" + tmp_value);\n }", "void addSliders() {\n\t\t\tfinal JTextField impact_r = new JTextField(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\timpact_r.setEditable(false);\n\t\t\t\n\t\t\tJSlider impactR = new JSlider(JSlider.HORIZONTAL, 1, 10, 2);\n\t\t\timpactR.setMinorTickSpacing(1);\n\t\t\t\n\t\t\timpactR.addChangeListener(new ChangeListener() {\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tJSlider source = (JSlider)e.getSource();\n\t\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\t\tConstants.IMPACT_RADIUS = source.getValue() / 10.;\n\t\t\t\t\t\timpact_r.setText(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tHashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();\n\t\t\tlabelTable.put(new Integer(1), new JLabel(\"0.1\"));\n\t\t\tlabelTable.put(new Integer(5), new JLabel(\"0.5\"));\n\t\t\tlabelTable.put(new Integer(10), new JLabel(\"1\"));\n\t\t\timpactR.setLabelTable(labelTable);\n\t\t\timpactR.setPaintTicks(true);\n\t\t\timpactR.setPaintLabels(true);\n\t\t\t\n\t\t\tContainer ir = new Container();\n\t\t\tir.setLayout(new FlowLayout());\n\t\t\tir.add(new JLabel(\"Impact Radius\"));\n\t\t\tir.add(impact_r);\n\t\t\t\n\t\t\tguiFrame.add(ir);\n\t\t\tguiFrame.add(impactR);\n\t\t}", "private void ffSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ffSliderStateChanged\n float tmp_value = ((float)this.ffSlider.getValue())/10;\n this.paramffLabel.setText(\"\" + tmp_value);\n }", "private synchronized void updateNumberFormat()\n\t{\n\n\t\tfinal int sw = rangeSlider.getWidth();\n\t\tif ( sw > 0 )\n\t\t{\n\t\t\tfinal double vrange = range.getMaxBound() - range.getMinBound();\n\t\t\tfinal int digits = ( int ) Math.ceil( Math.log10( sw / vrange ) );\n\n\t\t\tblockUpdates = true;\n\n\t\t\tJSpinner.NumberEditor numberEditor = ( ( JSpinner.NumberEditor ) minSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( minSpinner ) );\n\n\t\t\tnumberEditor = ( ( JSpinner.NumberEditor ) maxSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( maxSpinner ) );\n\n\t\t\tblockUpdates = false;\n\t\t}\n\t}", "private void ssSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ssSliderStateChanged\n float tmp_value = ((float)this.ssSlider.getValue())/10;\n this.paramssLabel.setText(\"\" + tmp_value);\n }", "public RangeSlider() {\n initSlider();\n }", "@FXML\n void angleSliderEvent() {\n \tint value = (int) angleSlider.getValue();\n \tangleText.setText(Integer.toString(value));\n \tangle = value;\n \tdrawLauncher(value);\n }", "public void initPanel(String attrib, int desired_width){\r\n\r\n slider = new JSlider(JSlider.HORIZONTAL,\r\n min, max, min);\r\n\r\n slider.addChangeListener(new SliderBarActionListener(this,attrib));\r\n\r\n slider.setMajorTickSpacing((max-min)/5);\r\n slider.setPaintTicks(true);\r\n\r\n //Create the label table\r\n Hashtable labelTable = new Hashtable();\r\n labelTable.put( new Integer( min ), new JLabel(\"\"+ min/precision));\r\n labelTable.put( new Integer( max ), new JLabel(\"\" + max/precision));\r\n slider.setLabelTable( labelTable );\r\n\r\n slider.setPaintLabels(true);\r\n\r\n Dimension currentsize = slider.getPreferredSize();\r\n currentsize.width = desired_width;\r\n currentsize.height = (DIM_HEIGHT/12) * 11;\r\n slider.setPreferredSize(currentsize);\r\n\r\n this.setLayout(new GridLayout(2,1));\r\n\r\n this.add(label, BorderLayout.NORTH);\r\n\r\n this.add(slider, BorderLayout.SOUTH);\r\n\r\n this.revalidate();\r\n }", "@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint amount = betslider.getValue();\n\t\t\t\tbetAmount.setText(\"$\"+amount);\n\t\t\t}", "public void divisionsChanged(){\r\n voltagePerDivisionLabel.setText(getScienceNumber(VoltagePerDivision) + \"V/Division\");\r\n SecondsPerDivisionLabel.setText(getScienceNumber(secondsPerDivision)+\"S/Div\");\r\n }", "public void drawslider()\n{\n controlP5 = new ControlP5(this);\n sliderbutton = controlP5.addSlider(\"time\", 0, 28800, 400, 710, 792, 30).setSliderMode(Slider.FLEXIBLE).setLabel(\"\");\n backwardsbutton =controlP5.addButton(\"backwards\", 0, 1245, 710, 30, 30).setLabel(\"<\");\n forwardsbutton =controlP5.addButton(\"forwards\", 0, 1325, 710, 30, 30).setLabel(\">\");\n playbutton = controlP5.addButton(\"play\", 0, 1280, 710, 40, 30);\n speeddownbutton = controlP5.addButton(\"speeddown\", 0, 1210, 710, 30, 30).setLabel(\"<<\");\n speedupbutton = controlP5.addButton(\"speedup\", 0, 1360, 710, 30, 30).setLabel(\">>\");\n controlP5.getController(\"time\").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE);\n}", "@Override\n public void valueChanged(double control_val) {\n loop_end.setValue((float)control_val);\n // Write your DynamicControl code above this line \n }", "private void sliderChanged(ChangeEvent e) {\n\t\tif (isTest()) { // TEST TEST TEST TEST !!!!!!!!!!!!!\n\t\t\treturn;\n\t\t}\n\t\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tsliderValue = (int) source.getValue();\n\t\t// System.out.println(windowBase.getName() + \": sliderChanged: \" +\n\t\t// sliderValue);\n\t\tint size = index.data.getPictureSize();\n\t\tif (size == 0) {\n\t\t\tremoveAllPictureViews(); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\t \n\t\tPM_Picture pic = null;\n\t\t\n\t\tif (client.getComponentCount() > 0) {\n\t\t\tObject o = client.getComponent(0);\n\t\t\tif (o instanceof PM_PictureView) {\n\t\t\t\tpic = ((PM_PictureView)o).getPicture();\n\t\t\t}\n\t\t}\n\t\t\n//\t\tSystem.out.println(\"..... sliderChanged\");\n\t\tpaintViewport(pic);\n\t\t// paintViewport(null);\n\t}", "protected void createSliders() {\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentFish\"));\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentShark\"));\n\t}", "HorizontalControl () {\n \n barY = 15; //40;\n barHeight = 40; //15;\n \n minX = 40;\n maxX = minX + width/3 - sliderWidth/2;\n \n minZoomValue = texture.width - texture.width;\n maxZoomValue = texture.width; // 300 percent\n valuePerX = (maxZoomValue - minZoomValue) / (maxX - minX);\n \n sliderWidth = 10; //25;\n sliderHeight = 25; //10;\n // sliderY = (barY + (barHeight/2)) - (sliderHeight/2);\n sliderY = (barY - (sliderHeight/2)) + (barHeight/2);\n sliderValue = minZoomValue; \n sliderX = minX; \n }", "private void setOnSlide(JFXSlider cogSlider, final JFXTextField cogInput) {\n cogSlider.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n //TODO Round on 1 or more?\n DecimalFormat df = new DecimalFormat(\"#.#\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n cogInput.setText(df.format(newValue));\n }\n });\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n slider_slices = new javax.swing.JSlider();\n jLabel2 = new javax.swing.JLabel();\n slider_width = new javax.swing.JSlider();\n jLabel3 = new javax.swing.JLabel();\n slider_height = new javax.swing.JSlider();\n jLabel4 = new javax.swing.JLabel();\n slider_depth = new javax.swing.JSlider();\n check_showBounds = new javax.swing.JCheckBox();\n slider_opacity = new javax.swing.JSlider();\n jLabel5 = new javax.swing.JLabel();\n check_showLightbuffer = new javax.swing.JCheckBox();\n check_multisample = new javax.swing.JCheckBox();\n\n jLabel1.setText(\"Slices\");\n\n slider_slices.setMaximum(700);\n slider_slices.setMinimum(1);\n slider_slices.setValue(5);\n slider_slices.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_slicesStateChanged(evt);\n }\n });\n\n jLabel2.setText(\"Width\");\n\n slider_width.setMaximum(200);\n slider_width.setMinimum(20);\n slider_width.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_widthStateChanged(evt);\n }\n });\n\n jLabel3.setText(\"Height\");\n\n slider_height.setMaximum(200);\n slider_height.setMinimum(20);\n slider_height.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_heightStateChanged(evt);\n }\n });\n\n jLabel4.setText(\"Depth\");\n\n slider_depth.setMaximum(200);\n slider_depth.setMinimum(20);\n slider_depth.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_depthStateChanged(evt);\n }\n });\n\n check_showBounds.setSelected(true);\n check_showBounds.setText(\"Show Bounds\");\n check_showBounds.setToolTipText(\"Draw box around all volume data\");\n check_showBounds.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showBoundsActionPerformed(evt);\n }\n });\n\n slider_opacity.setMajorTickSpacing(1);\n slider_opacity.setMaximum(700);\n slider_opacity.setValue(5);\n slider_opacity.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_opacityStateChanged(evt);\n }\n });\n\n jLabel5.setText(\"Opacity\");\n\n check_showLightbuffer.setSelected(true);\n check_showLightbuffer.setText(\"Show Lightbuffer\");\n check_showLightbuffer.setToolTipText(\"Display lighting calculations onscreen\");\n check_showLightbuffer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showLightbufferActionPerformed(evt);\n }\n });\n\n check_multisample.setText(\"Multisample\");\n check_multisample.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_multisampleActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(slider_depth, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_width, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_height, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(check_showBounds)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_showLightbuffer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_multisample))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_opacity, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_slices, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(slider_width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(slider_height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(slider_depth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(check_showBounds)\n .addComponent(check_showLightbuffer)\n .addComponent(check_multisample))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(slider_slices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(slider_opacity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n }", "public ElevatorSlider (Elevator e, int name) {\n elevator = e;\n getInfo ();\n // Create the slider and adjust its properties\n slider = new JSlider (JSlider.VERTICAL, 0, numFloors, 0);\n slider.setMajorTickSpacing (MAJOR_TICK_SPACING);\n slider.setMinorTickSpacing (MINOR_TICK_SPACING);\n slider.setPaintTicks (true);\n slider.setPaintLabels (true);\n // Calculate the dimensions for the sliders\n int width = SLIDER_WIDTH;\n int height = HEIGHT_PER_FLOOR * numFloors;\n int heightResize = 1 + (numFloors / FLOOR_LIMIT);\n height /= heightResize;\n slider.setPreferredSize (new Dimension (width, height));\n \n // Add the slider\n this.add (slider);\n this.update (e, name);\n // Add the label to the panel\n this.add (stateLabel);\n this.add (capLabel);\n this.add (floorLabel);\n // Set the layout\n this.setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));\n \n }", "String updateSliderLabel() {\n if (this.direction.equals(\"H\"))\n return \"Percentage of Width : \";\n if (this.direction.equals(\"V\"))\n return \"Percentage of Height : \";\n return \"/!\\\\ Direction issue! Please relaunch the App /!\\\\\";\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n label = new javax.swing.JLabel();\n cantBrillo = new javax.swing.JSlider();\n ok = new javax.swing.JButton();\n cantidad = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n label.setFont(new java.awt.Font(\"Lucida Grande\", 0, 14)); // NOI18N\n label.setText(\"Selecciona la cantidad de Brillo\");\n\n cantBrillo.setFont(new java.awt.Font(\"Lucida Grande\", 0, 14)); // NOI18N\n cantBrillo.setMaximum(255);\n cantBrillo.setValue(0);\n cantBrillo.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n cantBrilloStateChanged(evt);\n }\n });\n\n ok.setText(\"Aceptar\");\n ok.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n okActionPerformed(evt);\n }\n });\n\n cantidad.setText(\"0\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(103, 103, 103)\n .addComponent(label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(37, 37, 37)\n .addComponent(cantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(cantBrillo, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(49, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(ok)\n .addGap(17, 17, 17))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(cantidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(cantBrillo, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE))\n .addGap(14, 14, 14)\n .addComponent(ok)\n .addContainerGap())\n );\n\n pack();\n }", "public void stateChanged(ChangeEvent e) {\n\n (model.getInterpol()).setBezierIterationen(((JSlider) e.getSource()).getValue());\n }", "private void initializeBranchLimitSpinner() {\n SpinnerValueFactory<Integer> valueFactory;\n valueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 20, inputN){\n @Override public void decrement(int steps) {\n final int min = getMin();\n final int currentValue = getValue();\n final int newIndex = currentValue - steps * getAmountToStepBy();\n setValue(Math.max(newIndex, min));\n inputN = newIndex;\n renderTree();\n }\n\n @Override public void increment(int steps) {\n final int max = getMax();\n final int currentValue = getValue();\n final int newIndex = currentValue + steps * getAmountToStepBy();\n setValue(Math.min(newIndex, max));\n inputN = newIndex;\n renderTree();\n }\n };\n branchLimitSpinner.setValueFactory(valueFactory);\n }", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "protected Control createSpinnerControl(Composite parent) {\r\n \t\tcomposite = new Composite(parent, SWT.NONE);\r\n \t\tGridLayout gridLayout = new GridLayout();\r\n \t\tgridLayout.numColumns = 2;\r\n gridLayout.marginWidth = 0;\r\n gridLayout.marginHeight = 0;\r\n gridLayout.horizontalSpacing = HORIZONTAL_GAP;\r\n \t\tcomposite.setLayout(gridLayout);\r\n \t\tGridData gd;\r\n \t\tgd = new GridData(GridData.FILL_HORIZONTAL);\r\n \t\tcomposite.setLayoutData(gd);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create label\r\n \t\t */\r\n \t\tsliderLabel = new Label(composite,SWT.NONE);\r\n \t\tgd = new GridData(SWT.LEFT);\r\n \t\tsliderLabel.setLayoutData(gd);\r\n \t\tsliderLabel.setText(SLIDER_LABEL_DEFAULT_TEXT);\r\n \t\tPoint size = sliderLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r\n \t\tsliderLabel.setSize(size);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create slider\r\n \t\t */\r\n \t\tslider = new Slider(composite, SWT.HORIZONTAL);\r\n \t\tgd = new GridData(SWT.RIGHT | GridData.FILL_HORIZONTAL);\r\n \t\tslider.setLayoutData(gd);\r\n \t\t\r\n \t\tslider.setMaximum(MAX_SLIDER_VALUE + slider.getThumb());\r\n \t\tslider.setMinimum(MIN_SLIDER_VALUE);\r\n \t\tslider.setIncrement(INCREMENT_SLIDER_VALUE);\r\n \r\n \t\t/*\r\n \t\t * Add listener to handle value change \r\n \t\t */\r\n \t\tselectionListener = new SelectionListener() {\r\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n \t\t\t\tvalueChanged();\r\n \t\t\t}\r\n \r\n \t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n \t\t\t\t// Do nothing\r\n \t\t\t}\r\n \t\t};\r\n \t\tslider.addSelectionListener(selectionListener);\r\n \t\ttry {\r\n \t\t\tintValue = Integer.parseInt(valueProvider.getStringValue(true).toString());\r\n\t\t} catch (Exception e) {\r\n \t\t\tintValue = DEFAULT_SLIDER_VALUE;\r\n \t\t}\r\n \t\t\r\n \t\t/*\r\n \t\t * Initialize slider presentation\r\n \t\t */\r\n \t\tslider.setSelection(intValue);\r\n \t\tString weightsString = \"\" + (intValue /10) + \"%\"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n \t\tslider.setToolTipText(weightsString);\r\n \t\tsliderLabel.setText(weightsString);\r\n \t\t\r\n \t\tslider.pack();\r\n \t\tsliderLabel.pack();\r\n \t\treturn composite;\r\n \t}", "public JComplexSlider(String discrtiption, int sliderMax, int sliderMin, int inital, String resultPanelShowingMode, String unit){\n\t\tthis.unit = unit;\n\t\tthis.slider = new JSlider();\n\t\tsetDisplayingFormat(resultPanelShowingMode);\n\t\tinitialize(sliderMax, sliderMin, inital);\n\t\tthis.resultPanel = new JTextLabel(\"\", Alignment.CENTER, Alignment.CENTER, 0, null, false);\n\t\tJTextLabel description = new JTextLabel(discrtiption, Alignment.CENTER, Alignment.CENTER, 0, null, false);\n\t\taddRestoreDefaultChild(description);\n\t\t//\taddRestoreDefaultChild(resultPanel);\n\t\taddEnableChild(description, false);\n\t\taddEnableChild(resultPanel, false);\n\t\tUtility.getUtility().setPreferredSize(description, Sizing.Menu.tripleOne, Sizing.Menu.smallItemHeight);\n\t\tUtility.getUtility().setPreferredSize(resultPanel, Sizing.Menu.tripleThree, Sizing.Menu.smallItemHeight);\n\t\tLayouter.SpringLayouter layout = new SpringLayouter(this);\n\t\tlayout.put(layout.instanceOf(this).put(Position.CONSTRAIN_Y_HEIGHT, Sizing.Menu.smallItemHeight));\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X, description, 0, Position.CONSTRAIN_X, this);\n\t\tlayout.put(Position.CONSTRAIN_Y, description, 0, Position.CONSTRAIN_Y, this);\n\t\tlayout.put(Position.CONSTRAIN_Y_HEIGHT, description, 0, Position.CONSTRAIN_Y_HEIGHT, this);\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X, slider, 0, Position.CONSTRAIN_X_WIDTH, description);\n\t\tlayout.put(Position.CONSTRAIN_Y, slider, 0, Position.CONSTRAIN_Y, this);\n\t\tlayout.put(Position.CONSTRAIN_Y_HEIGHT, slider, 0, Position.CONSTRAIN_Y_HEIGHT, this);\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X, resultPanel, 0, Position.CONSTRAIN_X_WIDTH, slider);\n\t\tlayout.put(Position.CONSTRAIN_Y, resultPanel, 0, Position.CONSTRAIN_Y, this);\n\t\tlayout.put(Position.CONSTRAIN_Y_HEIGHT, resultPanel, 0, Position.CONSTRAIN_Y_HEIGHT, this);\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X_WIDTH, this, 0, Position.CONSTRAIN_X_WIDTH, resultPanel);\n\t\taddAction();\n\t\trestoreDefault();\n\t}", "public void stateChanged(ChangeEvent event) {\n\t\t\t\t\t\t\t\t\tlabelFilons.setText(((JSlider)event.getSource()).getValue() + \" filons :\");\n\t\t\t\t\t\t\t\t}", "public void stateChanged(ChangeEvent e) {\r\n Object source = e.getSource();\r\n\r\n if (source instanceof JSlider) {\r\n JSlider slider = (JSlider) source;\r\n if (text != null) {\r\n text.setText(\"<html><font color=#FFFFFF>Volume: \"+slider.getValue()+\"</font></html>\");\r\n text.setLocation(getWidth()/2-text.getWidth()/2, text.getY());\r\n revalidate();\r\n repaint();\r\n }\r\n }\r\n }", "private void initSlider() {\n setOrientation(HORIZONTAL);\n }", "@Override\n public void stateChanged(ChangeEvent e) {\n if (getSliderThreadsPerScan().getValue() == 0) {\n getSliderThreadsPerScan().setValue(1);\n }\n setLabelThreadsPerScanValue(getSliderThreadsPerScan().getValue());\n }", "public BSlider(Class c, float minimum, float maximum, float value)\r\n {\r\n super();\r\n valueClass = c;\r\n _setMin(minimum);\r\n _setMax(maximum);\r\n _setValue(value);\r\n addChangeListener(new ChangeListener()\r\n {\r\n @Override\r\n public void stateChanged(ChangeEvent e)\r\n {\r\n //Refresh text\r\n repaint();\r\n }\r\n });\r\n }", "public void setSlider(Slider slider) {\n\t\tthis.slider = slider;\n\t}", "@Override\n\t\t\tpublic void stateChanged(final ChangeEvent evt) {\n\t\t\t\tfinal JSlider mySlider3 = (JSlider) evt.getSource();\n\t\t\t\t//if (source.getValueIsAdjusting()) {\n\t\t\t\tif (mySlider3.getValueIsAdjusting()) {\n\t\t\t\t\t// int freq = (int)source.getValue();\n\t\t\t\t\tfloat freq = (float) mySlider3.getValue();\n\t\t\t\t\tfreq = (freq / FREQ_MAX) * (freq / FREQ_MAX);\n\t\t\t\t\tfreq = freq * FREQ_MAX;\n\t\t\t\t\tfreq = freq + FREQ_MIN;\n\t\t\t\t\tdoPrintValue3(freq);\n\t\t\t\t\t// when the action occurs the doSendSlider method is invoked\n\t\t\t\t\t// with arguments for freq and node\n\t\t\t\t\tdoSendSlider(freq, 1002);\n\t\t\t\t}\n\t\t\t}", "public SliderAndButtonDemo() {\n \n setBorder(BorderFactory.createEmptyBorder(6,6,6,6));\n\n /* Create the display label, with properties to match the\n values of the sliders and the setting of the combo box. */\n\n displayLabel = new JLabel(\"Hello World!\", JLabel.CENTER);\n displayLabel.setOpaque(true);\n displayLabel.setBackground( new Color(100,100,100) );\n displayLabel.setForeground( Color.RED );\n displayLabel.setFont( new Font(\"Serif\", Font.BOLD, 30) );\n displayLabel.setBorder(BorderFactory.createEmptyBorder(0,8,0,8));\n\n /* Create the sliders, and set up the panel to listen for\n ChangeEvents that are generated by the sliders. */\n\n bgColorSlider = new JSlider(0,255,100);\n bgColorSlider.addChangeListener(this);\n\n fgColorSlider = new JSlider(0,100,0);\n fgColorSlider.addChangeListener(this);\n \n /* Create four buttons to control the font style, and set up the\n panel to listen for ActionEvents from the buttons. */\n \n JButton plainButton = new JButton(\"Plain Font\");\n plainButton.addActionListener(this);\n JButton italicButton = new JButton(\"Italic Font\");\n italicButton.addActionListener(this);\n JButton boldButton = new JButton(\"Bold Font\");\n boldButton.addActionListener(this);\n\n\n /* Set the layout for the panel, and add the four components. \n Use a GridLayout with 3 rows and 2 columns, and with\n 5 pixels between components. */\n\n setLayout(new GridLayout(3,2,5,5));\n add(displayLabel);\n add(plainButton);\n add(bgColorSlider);\n add(italicButton);\n add(fgColorSlider);\n add(boldButton);\n\n }", "private JSlider getZSlider() {\r\n\t\tif (zSlider == null) {\r\n\t\t\tzSlider = new JSlider(1,1);\r\n\t\t\tzSlider.setMajorTickSpacing(100);\r\n\t\t\tzSlider.setPaintLabels(true);\r\n\t\t\tzSlider.addChangeListener(new javax.swing.event.ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(javax.swing.event.ChangeEvent e) {\r\n\t\t\t\t\tsaveUserChangesToROI();\r\n\t\t\t\t\tupdateLabel(-1, -1);\r\n\t\t\t\t\tBufferedImage image = getImage();\r\n\t\t\t\t\tif (image != null){\r\n\t\t\t\t\t\timagePane.setUnderlyingImage(image,/*false,*/allPixelValuesRange);\r\n\t\t\t\t\t}\r\n\t\t\t\t\trefreshROI();\r\n\t\t\t\t\timagePane.repaint();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn zSlider;\r\n\t}", "private void updateHubHelps(BoundedRangeModel subModel , JLabel component) {\n DecimalFormat df = new DecimalFormat(\"#00.00\");\n float prc_current = (float)subModel.getValue() / (float)( subModel.getMaximum() - subModel.getMinimum() ) * 100f;\n float prc_total = this.hub.getWeight( this.hub.indexOf( subModel ) ) / this.hub.getTotalWeight() * 100f;\n component.setText( df.format(prc_current) + \" % of \" + df.format(prc_total) + \" %\" );\n }", "private void setWheelBaseSliderSettings() {\n wheelBaseSlider.setValueFactory(new Callback<JFXSlider, StringBinding>() {\n @Override\n public StringBinding call(JFXSlider arg0) {\n return Bindings.createStringBinding(new java.util.concurrent.Callable<String>(){\n @Override\n public String call() {\n DecimalFormat df = new DecimalFormat(\"#.0\");\n return df.format(wheelBaseSlider.getValue());\n }\n }, wheelBaseSlider.valueProperty());\n }\n });\n }", "public ImageAdjusterWidget(Picture p) {\n\t\tif (p == null) {\n\t\t\tthrow new IllegalArgumentException(\"Picture p cannot be null\");\n\t\t}\n\n\t\tsetLayout(new BorderLayout());\n\n\t\t// store the original pic and add it to the picture view\n\t\t_original_pic = p;\n\t\t_picture_view = new PictureView(_original_pic.createObservable());\n\t\tadd(_picture_view, BorderLayout.CENTER);\n\n\t\tJPanel j = new JPanel();\n\t\tj.setLayout(new GridLayout(3, 1));\n\n\t\t// the blur label will snap to ticks because integer values are needed\n\t\t// to find the number of pixels around the specified one\n\t\tJPanel a = new JPanel();\n\t\ta.setLayout(new BorderLayout());\n\t\t_blur_label = new JLabel(\"Blur: \");\n\t\t_blur_label.setFont(new Font(\"Serif\", Font.PLAIN, 14));\n\t\ta.add(_blur_label, BorderLayout.WEST);\n\t\t_blur_slider = new JSlider(0, 5);\n\t\t_blur_slider.setPaintTicks(true);\n\t\t_blur_slider.setPaintLabels(true);\n\t\t_blur_slider.setSnapToTicks(true);\n\t\t_blur_slider.setMajorTickSpacing(1);\n\t\t_blur_slider.setValue(0);\n\t\t_blur_slider.addChangeListener(this);\n\t\t// addChangeListener allows for the slider changes to call the method\n\t\t// stateChanged, each slider has the change listener\n\t\ta.add(_blur_slider, BorderLayout.CENTER);\n\n\t\t// The brightness label will span from -100 to 100, with -100 being a\n\t\t// black solid picture and 100 being a white solid picture\n\t\tJPanel b = new JPanel();\n\t\tb.setLayout(new BorderLayout());\n\t\t_brightness_label = new JLabel(\"Brightness: \");\n\t\t_brightness_label.setFont(new Font(\"Serif\", Font.PLAIN, 14));\n\t\tb.add(_brightness_label, BorderLayout.WEST);\n\t\t_brightness_slider = new JSlider(-100, 100);\n\t\t_brightness_slider.setPaintTicks(true);\n\t\t_brightness_slider.setPaintLabels(true);\n\t\t_brightness_slider.setMajorTickSpacing(25);\n\t\t_brightness_slider.setValue(0);\n\t\t_brightness_slider.addChangeListener(this);\n\t\tb.add(_brightness_slider, BorderLayout.CENTER);\n\n\t\t// the saturate slider will increase the intensity of each pixel based\n\t\t// on the major component (green, red, blue) of it\n\t\tJPanel c = new JPanel();\n\t\tc.setLayout(new BorderLayout());\n\t\t_saturation_label = new JLabel(\"Saturation: \");\n\t\t_saturation_label.setFont(new Font(\"Serif\", Font.PLAIN, 14));\n\t\tc.add(_saturation_label, BorderLayout.WEST);\n\t\t_saturation_slider = new JSlider(-100, 100);\n\t\t_saturation_slider.setPaintTicks(true);\n\t\t_saturation_slider.setPaintLabels(true);\n\t\t_saturation_slider.setMajorTickSpacing(25);\n\t\t_saturation_slider.setValue(0);\n\t\t_saturation_slider.addChangeListener(this);\n\t\tc.add(_saturation_slider, BorderLayout.CENTER);\n\n\t\tj.add(a);\n\t\tj.add(c);\n\t\tj.add(b);\n\t\tadd(j, BorderLayout.SOUTH);\n\n\t}", "public void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tif (!source.getValueIsAdjusting()) {\n\t\t\tdgopval = Math.pow(10, -source.getValue() / 10.0);\n\t\t\tpvalLabel.setText(\"X = \" + source.getValue() / 10.0\n\t\t\t\t\t+ \"; p-value threshold is \"\n\t\t\t\t\t+ DREMGui_KeyInputs.doubleToSz(dgopval));\n\t\t\taddGOLabels(rootptr);\n\t\t}\n\t}", "@Override\n\tprotected void setValueOnUi() {\n\n\t}", "protected\tvoid\t\trender(MiRenderer renderer)\n\t\t{\n\t\t// Draw background, valueDisplay and label\n\t\tsuper.render(renderer);\n\n\t\tMiBounds innerBounds = getInnerBounds(tmpBounds);\n\n\t\t// Move Strip over\n\t\trenderer.moveImageArea(innerBounds, scroll.x, scroll.y);\n\t\tscroll.zeroOut();\n\n\t\t// Draw ticks:\n\t\tfor (int i = 0; i < ticksToDrawX.size(); ++i)\n\t\t\t{\n\t\t\tticks.setCenterX(ticksToDrawX.elementAt(i));\n\t\t\tticks.setYmin(innerBounds.ymin);\n\t\t\tticks.setYmax(innerBounds.ymin + ticksToDrawHeight.elementAt(i));\n\t\t\tticks.render(renderer);\n\t\t\t}\n\t\tticksToDrawX.removeAllElements();\n\t\tticksToDrawHeight.removeAllElements();\n\t\t}", "@Override public void onValueChange(ValueChangeEvent<Object> event) {\n if (rating != null) render.onSuccess(rating);\r\n else grond.getGae().getRating(ratingId, render);\r\n }", "protected void valueChanged() {\r\n \t\tint newValue = slider.getSelection();\r\n \t\tint oldValue = this.intValue;\r\n \t\tintValue = newValue;\r\n \t\tjava.beans.PropertyChangeEvent event = new java.beans.PropertyChangeEvent(\r\n \t\t\t\tthis, IPropertyEditor.VALUE, oldValue, newValue);\r\n \t\tvalueChangeListener.valueChange(event);\r\n \t}", "public void onSliderChanged() {\r\n\r\n // So we can get the date of where our slider is pointing\r\n int sliderValue = (int) dateSlider.getValue();\r\n System.out.println(sliderValue);\r\n\r\n // When the slider is moved, only the correct button will appear\r\n if(sliderValue == 0) {\r\n eventButton1.setVisible(true);\r\n eventButton2.setVisible(false);\r\n eventButton3.setVisible(false);\r\n eventButton4.setVisible(false);\r\n eventButton5.setVisible(false);\r\n } else if(sliderValue == 6) {\r\n eventButton1.setVisible(false);\r\n eventButton2.setVisible(true);\r\n eventButton3.setVisible(false);\r\n eventButton4.setVisible(false);\r\n eventButton5.setVisible(false);\r\n } else if(sliderValue == 12) {\r\n eventButton1.setVisible(false);\r\n eventButton2.setVisible(false);\r\n eventButton3.setVisible(true);\r\n eventButton4.setVisible(false);\r\n eventButton5.setVisible(false);\r\n } else if(sliderValue == 18) {\r\n eventButton1.setVisible(false);\r\n eventButton2.setVisible(false);\r\n eventButton3.setVisible(false);\r\n eventButton4.setVisible(true);\r\n eventButton5.setVisible(false);\r\n } else if(sliderValue == 25) {\r\n eventButton1.setVisible(false);\r\n eventButton2.setVisible(false);\r\n eventButton3.setVisible(false);\r\n eventButton4.setVisible(false);\r\n eventButton5.setVisible(true);\r\n }\r\n }", "public double getStepSizeForSlider() {\n\t\treturn 1;\r\n\t}", "FloatLabelJSlider(String name) {\n this(name, 0.1f, 0.0f, 1.0f, 0.5f);\n }", "public GUIScaleView(final ControlPanelInterface parent)\n\t{\n\t\tsuper(\"Scale\", \"Modify the scaling\");\n\n\t\tfinal ChangeListener sliderChangeListener = new ChangeListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void stateChanged(final ChangeEvent e)\n\t\t\t{\n\t\t\t\tif (toggleUniformScaling)\n\t\t\t\t{\n\t\t\t\t\tfinal Object source = e.getSource();\n\t\t\t\t\tif (source instanceof JSlider)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal JSlider inputSlider = (JSlider)source;\n\t\t\t\t\t\tfinal int value = inputSlider.getValue();\n\n\t\t\t\t\t\tfor (final GUIBoundedSlider slider : sliders)\n\t\t\t\t\t\t\tslider.write(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tparent.update();\n\t\t\t}\n\t\t};\n\t\tfor (int i = 0; i < sliders.length; ++i)\n\t\t{\n\t\t\tsliders[i] = new GUIBoundedSlider(TITLES[i], 0, 200, 100, sliderChangeListener);\n\t\t\tsliders[i].setFeedbackDesign(1, \"%.0f%%\");\n\t add(sliders[i]);\n\t\t}\n\n\t\tfinal ActionListener checkboxActionListener = new ActionListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(final ActionEvent e)\n\t\t\t{\n\t\t\t\ttoggleUniformScaling = checkboxToggleUniformScaling.isSelected();\n\t\t\t}\n\t\t};\n\t\tcheckboxToggleUniformScaling.addActionListener(checkboxActionListener);\n\t\tadd(checkboxToggleUniformScaling);\n\t}", "@Override\r\n\tpublic void update() {\r\n\t\t// get the first element and set the values according to its\r\n\t\t// information\r\n\t\tIqmDataBox iqmDataBox = (IqmDataBox) this.workPackage.getSources().get(0);\r\n\t\tPlanarImage pi = iqmDataBox.getImage();\r\n\r\n\t\tjFormattedTextFieldOldWidth.setValue(pi.getWidth());\r\n\t\tjFormattedTextFieldOldHeight.setValue(pi.getHeight());\r\n\r\n\t\tint left = ((Number) jSpinnerLeft.getValue()).intValue();\r\n\t\tint right = ((Number) jSpinnerRight.getValue()).intValue();\r\n\t\tint top = ((Number) jSpinnerTop.getValue()).intValue();\r\n\t\tint bottom = ((Number) jSpinnerBottom.getValue()).intValue();\r\n\r\n\t\t// Set image dependent initial values;\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pi.getWidth() + left + right);\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.setValue(pi.getHeight() + top + bottom);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\t\t\r\n\t\tif (buttConst.isSelected()){\r\n\t\t\ttbConst.setTitleColor(Color.BLACK);\r\n\t\t\tjLabelConst.setEnabled(true);\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\ttbConst.setTitleColor(Color.GRAY);\r\n\t\t\tjLabelConst.setEnabled(false);\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\t\tthis.repaint(); //because of tb TitledBorder cahnge of color\r\n\t\t\r\n\r\n\t\tthis.updateParameterBlock();\r\n\t\tthis.setParameterValuesToGUI();\r\n\t}", "private void calculateEachDivision(int division) {\n DataController.setCurrentDivisionForWriting(division);\r\n percentageSlid = (division / (float) DIVISIONS_OF_VALUE_SLIDER);\r\n newCurrentValue = minValueNumeric + (percentageSlid * deltaValueNumeric);\r\n dataController.setValueAsFloat(currentSliderKey, newCurrentValue);\r\n CalculatedVariables.crunchCalculation();\r\n }", "@Override\n public void stateChanged(ChangeEvent e) {\n if (Controls.getSelectedIndex() == 3) {\n Controls.setComponentAt(3, LineCC);\n Controls.setComponentAt(4, null);\n } else if (Controls.getSelectedIndex() == 4) {\n Controls.setComponentAt(3, null);\n Controls.setComponentAt(4, BackGCC);\n } else {\n Controls.setComponentAt(3, null);\n Controls.setComponentAt(4, null);\n }\n Zoom = ZoomSlider.getValue() / 10f;\n DrawGraphPassive();\n if ((int) EquationNum.getValue() != CurrentEQNum) {\n CurrentEQNum = (int) EquationNum.getValue();\n BackGCC.setColor(lineGraphs.get(CurrentEQNum - 1).getBackColor());\n LineCC.setColor(lineGraphs.get(CurrentEQNum - 1).getLineColour());\n Cards.show(EquationCardLayout, Integer.toString((int) EquationNum.getValue()));\n }\n }", "public void bind(final Slider slider) {\n\t\t// view for the color\n\t\tthis.addView(new ColorView() {\n\t\t\tSlider that = slider;\n\n\t\t\t@Override\n\t\t\tpublic void update(ColorController controller, Object caller) {\n\t\t\t\tif (!that.equals(caller)) {\n\t\t\t\t\tthat.setValue(controller.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Listener for slider changes\n\t\tslider.valueProperty().addListener(new ChangeListener<Number>() {\n\t\t\tSlider that = slider;\n public void changed(ObservableValue<? extends Number> ov,\n Number old_val, Number new_val) {\n \t\n \tDouble value = that.getValue();\n \tInteger ivalue = value.intValue();\n \tColorController.this.setValue(ivalue, that);\n }\n });\n\t\t\n\t\t\n\t\t// Update the slider to the integer value\n\t\tslider.setValue(getValue());\n\t}", "public void stateChanged(ChangeEvent e) {\n JSlider source = (JSlider)e.getSource();\n //volume\n if(parameter=='v'){\n System.out.println(\"Panel: \"+numSampler+\" volume: \"+source.getValue());\n }\n //volume\n else if(parameter=='p'){\n System.out.println(\"Panel: \"+numSampler+\" pitch: \"+source.getValue());\n }\n else if(parameter=='f'){\n System.out.println(\"Panel: \"+numSampler+\" filter cutoff: \"+source.getValue());\n }\n }", "@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint perPersonTipPercentage=((JSlider) e.getSource()).getValue();\n\t\t\t\tfloat perPersonNewTip=(((float)perPersonTipPercentage)/100)*(Float.valueOf(TipCalcView.getInstance().totalTip.getText()).floatValue());\n\t\t\n\t\t\t\tDecimalFormat decimalFormat=new DecimalFormat(\"#.##\");\n\t\t\t\tTipTailorView.getInstance().labels[no].setText(String.valueOf(decimalFormat.format(perPersonNewTip)));\n\t\t\t\tTipCalcView.getInstance().perPersonTip.setText(\"Not Applicable\");\n\t\t\t\tTipCalcView.getInstance().perPersonTip.setEditable(false);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public void stateChanged(ChangeEvent evt) {\n if (evt.getSource() == bgColorSlider) {\n int bgVal = bgColorSlider.getValue();\n displayLabel.setBackground( new Color(bgVal,bgVal,bgVal) );\n // NOTE: The background color is a shade of gray,\n // determined by the setting on the slider.\n }\n else {\n float hue = fgColorSlider.getValue()/100.0f;\n displayLabel.setForeground( Color.getHSBColor(hue, 1.0f, 1.0f) );\n // Note: The foreground color ranges through all the colors\n // of the spectrum.\n }\n }", "@Override\n public Pane visualization() {\n //TODO: this will be replaced with the correct addition visualizer\n HBox layout = new HBox();\n layout.setSpacing(0);\n layout.setAlignment(Pos.TOP_LEFT);\n Visualizer vis = new AdditionVisualizer();\n layout.getChildren().addAll(left.visualization(), vis.drawString(this.getValue()), right.visualization());\n return layout;\n }", "private void setupVExpenseSlider() {\n\t\tif(verticalExpenseSlider != null)\n\t\t\tverticalExpensePanel.remove(verticalExpenseSlider);\n\t\tverticalExpenseSlider = new FloatingSliderPanel(0.0f, 1f, DEFAULT_VERTICAL_EXPENSE) {\n\t\t\tprotected void setDescriptionLabelText() {\n\t\t\t\tfloat currentValue = getCurrentValue();\n\t\t\t\tinfoLabel.setText(setVerticalExpenseInfoLabel(currentValue));\n\t\t\t}\n\t\t};\n\t\tGridBagConstraints gbc_verticalExpenseSlider = new GridBagConstraints();\n\t\tgbc_verticalExpenseSlider.insets = new Insets(0, 10, 0, 10);\n\t\tgbc_verticalExpenseSlider.fill = GridBagConstraints.BOTH;\n\t\tgbc_verticalExpenseSlider.gridx = 0;\n\t\tgbc_verticalExpenseSlider.gridy = 1;\n\t\tverticalExpensePanel.add(verticalExpenseSlider, gbc_verticalExpenseSlider);\n\t\t\n\t\trevalidate();\n\t}", "@Override\n public void stateChanged(ChangeEvent _e) {\n if (_e.getSource() instanceof JSlider){\n mView.setFrequencyTxt(((JSlider) _e.getSource()).getValue());\n mComponent.getCMUpdateThread().setInterval(((JSlider) _e.getSource()).getValue());\n if (mComponent.isPlaying())\n \tmComponent.getSimulationPlayer().setInterval(((JSlider) _e.getSource()).getValue());\n }\n }", "private void configureFields() {\n\t\ttargetDiastolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_DIASTOLIC_LIMIT,UPPER_DIASTOLIC_LIMIT));\n\t\ttargetDiastolic.setEditable(true);\n\t\ttargetSystolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_SYSTOLIC_LIMIT,UPPER_SYSTOLIC_LIMIT));\n\t\ttargetSystolic.setEditable(true);\n\t\tdiastolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(DIASTOLIC_ALARM_LOWER, DIASTOLIC_ALARM_HIGHER));\n\t\tdiastolicAlarm.setEditable(true);\n\t\tsystolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(SYSTOLIC_ALARM_LOWER, SYSTOLIC_ALARM_HIGHER));\n\t\tsystolicAlarm.setEditable(true);\n\t\tSpinnerValueFactory.DoubleSpinnerValueFactory rateFactory=new SpinnerValueFactory.DoubleSpinnerValueFactory(MIN_FLOW_RATE, MAX_FLOW_RATE);\n\t\trateFactory.setAmountToStepBy(0.1);\n\t\tinfusionRate.setValueFactory(rateFactory);\n\t\t\n\t\t/*\n\t\t * We use bindBidirectional here because systolicProperty and diastolicProperty and numbers,\n\t\t * but the text field is a String, and bindBidrectional allows us to specify a converter\n\t\t * to handle the change between the two.\n\t\t */\n\t\tcurrentSystolic.textProperty().bindBidirectional(systolicProperty, new NumberStringConverter());\n\t\tcurrentDiastolic.textProperty().bindBidirectional(diastolicProperty, new NumberStringConverter());\n\t\t\n\t\tcurrentSystolic.setEditable(false);\n\t\tcurrentDiastolic.setEditable(false);\n\t\t\n\n\t\toperatingMode.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {\n\n\t\t\t@Override\n\t\t\tpublic void changed(ObservableValue<? extends Toggle> ov, Toggle oldToggle, Toggle newToggle) {\n\t\t\t\tif(newToggle.equals(openRadio)) {\n\t\t\t\t\tbpVBox.setVisible(false);\n\t\t\t\t\tbpVBox.setManaged(false);\n\t\t\t\t} else {\n\t\t\t\t\tbpVBox.setManaged(true);\n\t\t\t\t\tbpVBox.setVisible(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "public void stateChanged(ChangeEvent evt) {\n lowBox. setText(String. valueOf(lowSlider. getValue()));\n updateThreshold(lowSlider. getValue(), highSlider. getValue()); \n }", "protected void updatePanelContent() {\n updating = true;\n jTextFieldName.setText(bulb.getName());\n jTextFieldName.setToolTipText(bulb.getType());\n jSlider1.setValue(bulb.getIntensity());\n jToggleButton1.setSelected(bulb.isOn());\n if (bulb.getColor() != null) {\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n switch(bulb.getColor()) {\n case TradfriConstants.COLOR_NORMAL: jRadioNormal.setSelected(true); break;\n case TradfriConstants.COLOR_WARM: jRadioWarm.setSelected(true); break;\n case TradfriConstants.COLOR_COLD: jRadioCold.setSelected(true); break;\n }\n }\n else {\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n }\n \n \n if (bulb.isOnline()) {\n jToggleButton1.setEnabled(true);\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n jSlider1.setEnabled(true);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [online]\");\n }\n else {\n jToggleButton1.setEnabled(false);\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n jSlider1.setEnabled(false);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [offline]\");\n }\n \n updating = false;\n }", "public void draw() {\n\t\tif (fill) {\n\t\t\tapplet.noStroke();\n\t\t\tapplet.fill(color);\n\t\t} else {\n\t\t\tapplet.noFill();\n\t\t\tapplet.stroke(color);\n\t\t}\n\t\tapplet.rect(position.x, position.y, size.x, size.y);\n\t\tsliderButton.draw(new PVector(-10,0));\n\t}", "@Override\n public void updateUI() {\n setUI(SubstanceRibbonGalleryUI.createUI(this));\n }", "public void stateChanged(ChangeEvent e)\n {\n slideLabel.setText(\"The speed is \" + speedSlider.getValue());\n }", "public Slider getSlider() {\n\t\treturn slider;\n\t}", "public CircularLayoutComponent() {\n initComponents();\n setOpaque(true);\n setDoubleBuffered(true);\n segmentSizeSpinner.addChangeListener(this);\n targetMarginSpinner.addChangeListener(this);\n sourceMarginSpinner.addChangeListener(this);\n segmentMarginSpinner.addChangeListener(this);\n segmentAngleSpinner.addChangeListener(this);\n }", "@Override\r\n public void paintComponent(Graphics g)\r\n {\n super.paintComponent(g);\r\n g.setColor(getParent().getBackground());\r\n g.fillRect(0, getHeight() / 2, getWidth(), getHeight());\r\n g.setColor(new Color(153, 153, 204));\r\n stringValue = Float.toString(_getValue());\r\n g.drawString(stringValue, getWidth() / 2 - (int) (stringValue.length() * 1.8f), getHeight() / 2 + 10);\r\n }", "public double getValue(){\n\t\treturn slider.getValue() ;\n\t}", "CartogramWizardPanelFour (JFrame contentFrame)\n\t{\n\t\n\t\tmCartogramWizard = (CartogramWizard)contentFrame;\n\t\t\n\t\tthis.setLocation(160, 90);\n\t\tthis.setSize(440, 340);\n\t\tthis.setLayout(null);\n\t\n\t\tClassLoader cldr = this.getClass().getClassLoader();\n\n\t\t// Add the slider for the amount of deformation.\n\t\tFont smallFont = new Font(null, Font.PLAIN, 11);\n\t\tmDeformationSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 50);\n\t\tmDeformationSlider.setMajorTickSpacing(25);\n\t\tmDeformationSlider.setMinorTickSpacing(5);\n\t\tmDeformationSlider.setPaintTicks(true);\n\t\tmDeformationSlider.setFont(smallFont);\n\t\tmDeformationSlider.setSize(440, 40);\n\t\tmDeformationSlider.setLocation(0, 20);\n\t\t\n\t\tHashtable labelTable = new Hashtable();\n\t\tJLabel sliderLabel = new JLabel(\"Low\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(0), sliderLabel);\n\t\tsliderLabel = new JLabel(\"Medium\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(50), sliderLabel);\n\t\tsliderLabel = new JLabel(\"High\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(100), sliderLabel);\n\t\t\n\t\tmDeformationSlider.setLabelTable(labelTable);\n\t\tmDeformationSlider.setPaintLabels(true);\n\t\tthis.add(mDeformationSlider);\n\t\t\n\t\t\n\t\t// Add the label for the amount of deformation.\n\t\tJLabel deformationLabel = new JLabel(\"Transformation quality:\");\n\t\tdeformationLabel.setSize(440, 14);\n\t\tdeformationLabel.setFont(new Font(null, Font.BOLD, 11));\n\t\tdeformationLabel.setLocation(0, 0);\n\t\tthis.add(deformationLabel);\n\n\n\n\n\t\t// Create the text pane which displays the help text for the\n\t\t// amount of deformation.\n\t\tJTextPane deformationTextPane = new JTextPane();\n\t\tString deformationText = null;\n\t\ttry\n\t\t{\n\t\t\tInputStream inStream = \n\t\t\t\tcldr.getResource(\"AmountOfDeformationText.rtf\").openStream();\n\t\t\tStringBuffer inBuffer = new StringBuffer();\n\t\t\tint c;\n\t\t\twhile ((c = inStream.read()) != -1)\n\t\t\t{\n\t\t\t\tinBuffer.append((char)c);\n\t\t\t}\n\t\t\tinStream.close();\n\t\t\tdeformationText = inBuffer.toString();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\tdeformationTextPane.setContentType(\"text/rtf\");\n\t\tdeformationTextPane.setText(deformationText);\n\t\tdeformationTextPane.setEditable(false);\n\t\tdeformationTextPane.setFont(new Font(null, Font.PLAIN, 11));\n\t\tdeformationTextPane.setBackground(null);\n\t\tdeformationTextPane.setLocation(40, 70);\n\t\tdeformationTextPane.setSize(400, 70);\n\t\tthis.add(deformationTextPane);\n\t\t\n\t\t\n\t\t\n\t\t// ADVANCED OPTIONS\n\t\t\n\t\t// A button and an explanatory text for the advanced options.\n\t\tJButton advancedButton = \n\t\t\tnew JButton(\"Advanced options...\");\n\t\tadvancedButton.setLocation(0, 170);\n\t\tadvancedButton.setSize(240, 26);\n\t\tadvancedButton.addActionListener(\n\t\t\tnew CartogramWizardAdvancedOptionsAction(\"showDialog\", null));\n\t\tthis.add(advancedButton);\n\t\t\n\t\t// Create the text pane which displays the help text for the\n\t\t// simultaneous layers.\n\t\tJTextPane advancedTextPane = new JTextPane();\n\t\tString advancedText = null;\n\t\ttry\n\t\t{\n\t\t\tInputStream inStream = \n\t\t\t\tcldr.getResource(\"AdvancedOptionsText.rtf\").openStream();\n\t\t\tStringBuffer inBuffer = new StringBuffer();\n\t\t\tint c;\n\t\t\twhile ((c = inStream.read()) != -1)\n\t\t\t{\n\t\t\t\tinBuffer.append((char)c);\n\t\t\t}\n\t\t\tinStream.close();\n\t\t\tadvancedText = inBuffer.toString();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\tadvancedTextPane.setContentType(\"text/rtf\");\n\t\tadvancedTextPane.setText(advancedText);\n\t\tadvancedTextPane.setEditable(false);\n\t\tadvancedTextPane.setFont(new Font(null, Font.PLAIN, 11));\n\t\tadvancedTextPane.setBackground(null);\n\t\tadvancedTextPane.setLocation(40, 205);\n\t\tadvancedTextPane.setSize(400, 60);\n\t\tthis.add(advancedTextPane);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Add the Compute button\n\t\tJButton computeButton = new JButton(\"Compute\");\n\t\tcomputeButton.setLocation(340, 314);\n\t\tcomputeButton.setSize(100, 26);\n\t\tcomputeButton.setMnemonic(KeyEvent.VK_ENTER);\n\t\tcomputeButton.addActionListener(new \n\t\t\tCartogramWizardComputeAction((CartogramWizard)contentFrame));\n\t\tthis.add(computeButton);\n\t\t\n\t\t\n\t\t\n\t\t// Add the Back button\n\t\tJButton backButton = new JButton(\"< Back\");\n\t\tbackButton.setLocation(235, 314);\n\t\tbackButton.setSize(100, 26);\n\t\tbackButton.addActionListener(new\n\t\t\tCartogramWizardGoToStepAction((CartogramWizard)contentFrame, 3));\n\t\tthis.add(backButton);\n\n\n\n\n\n\t\t// ADD THE HELP BUTTON\n\t\t\n\t\t//ClassLoader cldr = this.getClass().getClassLoader();\n\t\t\n\t\tjava.net.URL imageURL = cldr.getResource(\"help-22.png\");\n\t\tImageIcon helpIcon = new ImageIcon(imageURL);\n\n\t\tJButton helpButton = \n\t\t\tnew JButton(helpIcon);\n\t\t\n\t\thelpButton.setVerticalTextPosition(SwingConstants.BOTTOM);\n\t\thelpButton.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\thelpButton.setSize(30, 30);\n\t\thelpButton.setLocation(0, 312);\n\t\thelpButton.setFocusable(false);\n\t\thelpButton.setContentAreaFilled(false);\n\t\thelpButton.setBorderPainted(false);\n\t\t\n\t\thelpButton.addActionListener(new CartogramWizardShowURL(\n\t\t\t\"http://chorogram.choros.ch/scapetoad/help/c-transformation-parameters.php\"));\n\t\t\n\t\tthis.add(helpButton);\n\n\n\t\t\n\t\n\t}", "public AltAzController( float altitude, \n float azimuth, \n float min_distance,\n float max_distance,\n float distance )\n {\n setLayout( new GridLayout(3,1) );\n TitledBorder border = new TitledBorder(\n LineBorder.createBlackLineBorder(),\"View Control\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n setBorder( border );\n\n altitude_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n 0 );\n altitude_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Altitude\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n altitude_slider.setBorder( border );\n add( altitude_slider ); \n\n azimuth_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n 0 );\n azimuth_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Azimuth\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n azimuth_slider.setBorder( border );\n add( azimuth_slider ); \n\n distance_slider = new JSlider( JSlider.HORIZONTAL, 1, 20, 10 );\n distance_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Distance\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n distance_slider.setBorder( border );\n add( distance_slider ); \n\n setDistanceRange( min_distance, max_distance );\n setDistance( distance );\n setAltitudeAngle( altitude );\n setAzimuthAngle( azimuth );\n\n setView( true );\n }", "private void init() {\r\n setForeground(Color.black);\r\n setTitle(\"Evolve Boundary\");\r\n\r\n JPanel scalePanel = new JPanel(new GridLayout(4, 2));\r\n scalePanel.setForeground(Color.black);\r\n scalePanel.setBorder(buildTitledBorder(\"Contour Change\"));\r\n\r\n int[] aiUnits = image.getUnitsOfMeasure();\r\n JLabel labelChangeX = new JLabel(\"Enter size change in \" + FileInfoBase.getUnitsOfMeasureAbbrevStr(aiUnits[0]) + \" units \");\r\n labelChangeX.setForeground(Color.black);\r\n labelChangeX.setFont(serif12);\r\n scalePanel.add(labelChangeX);\r\n\r\n textChangeX = new JTextField();\r\n textChangeX.setText(\"2.0\");\r\n textChangeX.setFont(serif12);\r\n scalePanel.add(textChangeX);\r\n \r\n JLabel labelBoundaryDir = new JLabel(\"Move boundary \"); // make & set a label\r\n labelBoundaryDir.setForeground(Color.black);\r\n labelBoundaryDir.setFont(serif12);\r\n scalePanel.add(labelBoundaryDir); // add kernel label\r\n\r\n boundaryDirBox = new JComboBox();\r\n boundaryDirBox.setFont(serif12);\r\n boundaryDirBox.setBackground(Color.white);\r\n boundaryDirBox.addItem(\"Outward\");\r\n boundaryDirBox.addItem(\"Inward\");\r\n scalePanel.add(boundaryDirBox);\r\n\r\n //JPanel imageVOIPanel = new JPanel(new GridLayout(1, 1));\r\n //imageVOIPanel.setForeground(Color.black);\r\n //imageVOIPanel.setBorder(buildTitledBorder(\"Evolve Boundary\"));\r\n\r\n //ButtonGroup imageVOIGroup = new ButtonGroup();\r\n //singleSlice = new JRadioButton(\"Single slice\", true);\r\n //singleSlice.setFont(serif12);\r\n //imageVOIGroup.add(singleSlice);\r\n //imageVOIPanel.add(singleSlice);\r\n\r\n removeOriginalCheckBox = new JCheckBox(\"Replace Original Contour\");\r\n removeOriginalCheckBox.setFont(serif12);\r\n removeOriginalCheckBox.setForeground(Color.black);\r\n removeOriginalCheckBox.setSelected(false);\r\n scalePanel.add(removeOriginalCheckBox);\r\n\r\n\r\n JPanel mainPanel = new JPanel(new GridBagLayout());\r\n mainPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));\r\n\r\n GridBagConstraints gbc = new GridBagConstraints();\r\n gbc.gridwidth = 1;\r\n gbc.gridheight = 1;\r\n gbc.anchor = GridBagConstraints.WEST;\r\n gbc.weightx = 1;\r\n gbc.insets = new Insets(3, 3, 3, 3);\r\n gbc.gridx = 0;\r\n gbc.gridy = 0;\r\n gbc.fill = GridBagConstraints.HORIZONTAL;\r\n mainPanel.add(scalePanel, gbc);\r\n //gbc.gridy++;\r\n //mainPanel.add(imageVOIPanel, gbc);\r\n\r\n JPanel buttonPanel = new JPanel();\r\n buildOKButton();\r\n buttonPanel.add(OKButton);\r\n buildCancelButton();\r\n buttonPanel.add(cancelButton);\r\n buildHelpButton();\r\n buttonPanel.add(helpButton);\r\n\r\n getContentPane().add(mainPanel, BorderLayout.CENTER);\r\n getContentPane().add(buttonPanel, BorderLayout.SOUTH);\r\n pack();\r\n setVisible(true);\r\n }", "@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }", "private void divOperands() {\n\t\tif (text_Operand3.getText().isEmpty()) {\n\t\t\ttext_Operand3.setText(\"5\");\n\t\t}\n\t\tif (text_Operand4.getText().isEmpty()) {\n\t\t\ttext_Operand4.setText(\"5\");\n\t\t}\n\n\t\t/*\n\t\t * It will pass the value to the bussiness logic so trhat the further logics can\n\t\t * be performed on them.\n\t\t */\n\n\t\tif (conversionIsRequired(comboBox1.getSelectionModel().getSelectedItem(),\n\t\t\t\tcomboBox2.getSelectionModel().getSelectedItem())) {\n\t\t\tdouble op1 = Double.parseDouble(text_Operand1.getText());\n\t\t\tdouble op1et = Double.parseDouble(text_Operand3.getText());\n\t\t\tperform.setOperand1(String.valueOf(op1 * theFactor));\n\t\t\tperform.setOperand3(String.valueOf(op1et * theFactor));\n\t\t}\n\t\tif (binaryOperandIssues()) // If there are issues with the operands, return\n\t\t\treturn; // without doing the computation\n\t\tdouble x = Double.parseDouble(text_Operand2.getText());\n\t\tif (x == 0f) {\n\t\t\tlabel_errResult.setText(\"Divide by zero is not allowed\");\n\t\t\ttext_Result.setText(\"\");\n\n\t\t} else {\n\t\t\tString theAnswer = perform.division(); // Call the business logic Division method\n\t\t\tlabel_errResult.setText(\"\"); // Reset any result error messages from before\n\t\t\tString theAnswer1 = perform.division1(); // Call the business logic Division method\n\t\t\tlabel_errResulterr.setText(\"\"); // Reset any result error messages from before\n\n\t\t\tif (theAnswer.length() > 0 || theAnswer1.length() > 0) { // Check the returned String to see if it is okay\n\t\t\t\ttext_Result.setText(theAnswer); // If okay, display it in the result field and\n\t\t\t\tlabel_Result.setText(\"Quotient\"); // change the title of the field to \"Divide\".\n\t\t\t\tlabel_Result.setLayoutX(70);\n\t\t\t\tlabel_Result.setLayoutY(345);\n\t\t\t\ttext_Resulterr.setText(theAnswer1); // If okay, display it in the result field and\n\t\t\t\t// change the title of the field to \"Divide\"\n\t\t\t\tcomboBoxRes.getSelectionModel().select(comboBox1.getSelectionModel().getSelectedItem() + \"/\"\n\t\t\t\t\t\t+ comboBox2.getSelectionModel().getSelectedItem());\n\t\t\t} else { // Some error occurred while doing the division.\n\t\t\t\ttext_Result.setText(\"\"); // Do not display a result if there is an error.\n\t\t\t\tlabel_Result.setText(\"Result\"); // Reset the result label if there is an error.\n\t\t\t\tlabel_errResult.setText(perform.getResultErrorMessage()); // Display the error message.\n\t\t\t\ttext_Resulterr.setText(\"\"); // Do not display a result if there is an error.\n\t\t\t\t// Reset the result label if there is an error.\n\t\t\t\tlabel_errResulterr.setText(perform.getResulterrErrorMessage()); // Display the error message.\n\t\t\t}\n\n\t\t}\n\t}", "@Override\r\n public void onProgressChanged(SeekBar seekBar, int progress,\r\n boolean fromUser) {\n int value = seekBar.getProgress();\r\n LayoutParams paramsStrength = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\r\n int s = GlobalDefinitions.SCREEN_WIDTH-ScaleUtils.scale(240);\r\n paramsStrength.leftMargin = (int) (ScaleUtils.scale(83)+s*value/1000);\r\n paramsStrength.topMargin = ScaleUtils.scale(40);\r\n mValueTxt.setLayoutParams(paramsStrength);\r\n int res = (value/10);\r\n mValueTxt.setText(String.valueOf(res));\r\n mImgView.setImageBitmap(null);\r\n //skin white\r\n mImgView.setImageBitmap(mFaceEditor.BFSoftskin(GlobalDefinitions.softRatio, Math.abs(seekBar.getProgress()/10)));//));//change to 0-100\r\n\r\n }", "public void stateChanged(ChangeEvent event){\n\t\t\t\t\t\t\tlabelLargeur.setText(2*((JSlider)event.getSource()).getValue()-1 + \" cases :\");\n\t\t\t\t\t\t}", "private void modelToView(Handle handle) {\n\n if (handle.isUp()) {\n slider.setValue(1);\n } else {\n slider.setValue(0);\n }\n }", "protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }", "protected JComponent createEditor() {\n/* 84 */ JComponent editor = super.createEditor();\n/* 85 */ if (editor instanceof JSpinner.DefaultEditor) {\n/* */ \n/* 87 */ JSpinner.DefaultEditor de = (JSpinner.DefaultEditor)editor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 92 */ de.getTextField().setBorder(new EmptyBorder(0, 0, 0, 0));\n/* */ \n/* 94 */ Dimension prefSize = de.getPreferredSize();\n/* 95 */ int compHeight = prefSize.height;\n/* */ \n/* 97 */ int height = LiquidSpinnerButtonUI.getSkin(1).getVsize() + LiquidSpinnerButtonUI.getSkin(5).getVsize();\n/* 98 */ int diff = height - compHeight;\n/* */ \n/* 100 */ if (diff > 0) {\n/* */ \n/* 102 */ int half = diff / 2;\n/* 103 */ de.getTextField().setBorder(new EmptyBorder(half, 0, diff - half, 0));\n/* */ } \n/* */ } \n/* 106 */ return editor;\n/* */ }", "private JSlider getTimeSlider() {\r\n\t\tif (timeSlider == null) {\r\n\t\t\ttimeSlider = new JSlider(1,1);\r\n\t\t\ttimeSlider.setPaintLabels(true);\r\n\t\t\ttimeSlider.setMajorTickSpacing(100);\r\n\t\t\ttimeSlider.addChangeListener(new javax.swing.event.ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(javax.swing.event.ChangeEvent e) {\r\n\t\t\t\t\tforceImage();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn timeSlider;\r\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\tMaxFlowLevelDisplay(MaxFlowLevel);\n\t}", "@FXML\n void windSliderEvent() {\n \t\n \tint value = (int) windSlider.getValue();\n \twindText.setText(Integer.toString(value));\n \twindSpeed = value;\n }", "@Override\r\n\tpublic void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider)e.getSource();\r\n\t\tif (!source.getValueIsAdjusting()) {\r\n\t\t\tSystem.out.println(source.getValue());\r\n\t\t\tSliderState.setSliderValue(source.getValue());\r\n\t\t}\r\n\t}", "public HBox simulationControl() {\t\t\r\n\t\t// Setup Slider\r\n\t\tspeedControl.setPrefWidth(800);\r\n\t\tspeedControl.setBlockIncrement(10);\r\n\t\tspeedControl.setMajorTickUnit(10);\r\n\t\tspeedControl.setMinorTickCount(0);\r\n\t\tspeedControl.setSnapToTicks(true);\r\n\t\t\r\n\t\t// Setup HBox\r\n\t\tHBox control = new HBox(); \r\n\t\tcontrol.setAlignment(Pos.CENTER); \r\n\t\t\r\n\t\t// Add Slider To HBox\r\n\t\tcontrol.getChildren().add(speedControl);\r\n\t\t\r\n\t\treturn control;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lbOee1 = new javax.swing.JLabel();\n lbOeeMeta6 = new javax.swing.JLabel();\n jSlider1 = new javax.swing.JSlider();\n\n lbOee1.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n lbOee1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lbOee1.setText(\"OEE\");\n lbOee1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n\n lbOeeMeta6.setBackground(new java.awt.Color(51, 255, 51));\n lbOeeMeta6.setFont(new java.awt.Font(\"Tahoma\", 1, 9)); // NOI18N\n lbOeeMeta6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lbOeeMeta6.setText(\"A\");\n lbOeeMeta6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n lbOeeMeta6.setOpaque(true);\n lbOeeMeta6.setPreferredSize(new java.awt.Dimension(36, 36));\n\n jSlider1.setMajorTickSpacing(10);\n jSlider1.setMaximum(480);\n jSlider1.setPaintTrack(false);\n jSlider1.setValue(0);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lbOee1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGap(129, 129, 129)\n .addComponent(lbOeeMeta6, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSlider1, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)\n .addGap(0, 0, 0))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jSlider1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lbOee1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lbOeeMeta6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE))\n .addGap(0, 0, 0))\n );\n }", "private void mountSlider() {\n if (slider != null) {\n sliderPane.getChildren().add(slider);\n }\n }", "public void initUI() {\n\t\tFlowLayout flow = new FlowLayout();\r\n\t\tthis.setTitle(\"来一波\");\r\n\t\tthis.setSize(960, 720);\r\n\t\tthis.setLayout(flow);\r\n\t\tthis.setLocationRelativeTo(null);\r\n\t\tthis.setDefaultCloseOperation(3);\r\n\t\t\r\n\t\t\r\n\t\tJPanel panel = new JPanel();\r\n\t\tthis.add(panel);\r\n\t\tthis.setBackground(Color.BLACK);\r\n\t\t\r\n\t\tslider1.setName(\"改变大小\");\r\n\t\tslider1.setMinorTickSpacing(20);\r\n\t\tslider1.setPaintTicks(true);\r\n\t\tslider1.setPaintLabels(true);\r\n\t\tthis.add(slider1);\r\n\t\t\r\n\t\tJButton button1 = new JButton(\"导入图片\");\r\n\t\tbutton1.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button1);\r\n\t\t\r\n\t\tJButton button2 = new JButton(\"热感应\");\r\n\t\tbutton2.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button2);\r\n\t\t\r\n\t\tJButton button3 = new JButton(\"模糊化\");\r\n\t\tbutton3.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button3);\r\n\t\t\r\n\t\tJButton button4 = new JButton(\"流行拼接\");\r\n\t\tbutton4.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button4);\r\n\t\t\r\n\t\tJButton button5 = new JButton(\"万花筒\");\r\n\t\tbutton5.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button5);\r\n\t\t\r\n\t\tslider2.setName(\"调整参数\");\r\n\t\tslider2.setMinorTickSpacing(20);\r\n\t\tslider2.setPaintTicks(true);\r\n\t\tslider2.setPaintLabels(true);\r\n\t\tthis.add(slider2);\r\n\t\t\r\n\t\tthis.setVisible(true);\r\n\t\t\r\n\t\tGraphics g = this.getGraphics();//传画笔的操作一定要在设置界面可见后进行\r\n\t\t\r\n\t\tDrawListener ml = new DrawListener(g,this);\r\n\t\tbutton1.addActionListener(ml);\r\n\t\tbutton2.addActionListener(ml);\r\n\t\tbutton3.addActionListener(ml);\r\n\t\tbutton4.addActionListener(ml);\r\n\t\tbutton5.addActionListener(ml);\r\n\t\tslider1.addChangeListener(ml);\r\n\t\tslider2.addChangeListener(ml);\r\n\t\t\r\n\t}", "private void createSlider(){\n\t\tslider = new GVertSlider(winApp, (int)width - 10, (int)height, 10, maxRows * (int)height);\n\t\tslider.setBorder(1);\n\t\tslider.setVisible(false);\n\t\tslider.setLimits(0, 0, maxRows - 1);\n\t\tslider.addEventHandler(this, \"processSliderMotion\", new Class[] { GVertSlider.class } );\n\t\tadd(slider);\n\t}", "public int getSliderVolume() {\n return (int)(this.volume * 100);\n }" ]
[ "0.81464815", "0.7562315", "0.74384034", "0.62105924", "0.59863317", "0.5842651", "0.5821956", "0.57995373", "0.5765713", "0.5739573", "0.5712611", "0.5696003", "0.56489456", "0.56008995", "0.5599106", "0.5573541", "0.5533203", "0.5529043", "0.55173427", "0.5466139", "0.5449201", "0.54337287", "0.54271966", "0.5422469", "0.538662", "0.53466", "0.5331489", "0.53079724", "0.5299234", "0.52934325", "0.5286875", "0.5270464", "0.5267492", "0.5260007", "0.5252951", "0.5244782", "0.52437425", "0.5240472", "0.52370554", "0.5215616", "0.5214794", "0.5213493", "0.51954854", "0.51873225", "0.51805717", "0.51647246", "0.5163679", "0.5153768", "0.51526356", "0.51469", "0.51155865", "0.51066244", "0.5101976", "0.5097154", "0.50969505", "0.50899523", "0.5082026", "0.5080644", "0.5061201", "0.5051834", "0.5049394", "0.5046882", "0.5040593", "0.50216925", "0.5012375", "0.5008608", "0.5003242", "0.50024587", "0.4997509", "0.49857023", "0.49821663", "0.49809033", "0.49763164", "0.49715337", "0.4971467", "0.49666804", "0.49554923", "0.4952233", "0.4947872", "0.49461967", "0.4942105", "0.49263838", "0.49238378", "0.49117622", "0.49099642", "0.49063763", "0.49033502", "0.48987907", "0.48978886", "0.4897849", "0.48845822", "0.48843786", "0.4882585", "0.48824707", "0.4881911", "0.4880714", "0.48724595", "0.486924", "0.48692328", "0.48689938" ]
0.8416763
0
Renders the slider that controls the inputBranchLength field
@FXML private void renderBranchLengthSlider() { renderSlider(1, 100, inputBranchLength, (e) -> { inputBranchLength = slider.getValue(); renderTree(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n private void renderBranchGrowthRatioSlider() {\n renderSlider(0.5, 1, inputBranchGrowthRatio, (e) -> {\n inputBranchGrowthRatio = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchWitherSlider() {\n renderSlider(0, 1, inputBranchWitherRatio, (e) -> {\n inputBranchWitherRatio = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchAngleSlider() {\n renderSlider(1, 30, inputBranchAngle, (e) -> {\n inputBranchAngle = slider.getValue();\n renderTree();\n });\n }", "public void initPanel(String attrib, int desired_width){\r\n\r\n slider = new JSlider(JSlider.HORIZONTAL,\r\n min, max, min);\r\n\r\n slider.addChangeListener(new SliderBarActionListener(this,attrib));\r\n\r\n slider.setMajorTickSpacing((max-min)/5);\r\n slider.setPaintTicks(true);\r\n\r\n //Create the label table\r\n Hashtable labelTable = new Hashtable();\r\n labelTable.put( new Integer( min ), new JLabel(\"\"+ min/precision));\r\n labelTable.put( new Integer( max ), new JLabel(\"\" + max/precision));\r\n slider.setLabelTable( labelTable );\r\n\r\n slider.setPaintLabels(true);\r\n\r\n Dimension currentsize = slider.getPreferredSize();\r\n currentsize.width = desired_width;\r\n currentsize.height = (DIM_HEIGHT/12) * 11;\r\n slider.setPreferredSize(currentsize);\r\n\r\n this.setLayout(new GridLayout(2,1));\r\n\r\n this.add(label, BorderLayout.NORTH);\r\n\r\n this.add(slider, BorderLayout.SOUTH);\r\n\r\n this.revalidate();\r\n }", "@FXML\n private void renderTrunkAngleSlider() {\n renderSlider(-180, 0, inputTrunkAngle, (e) -> {\n inputTrunkAngle = slider.getValue();\n renderTree();\n });\n }", "private void renderSlider(double min, double max, double value, EventHandler eventHandler) {\n unmountSlider();\n buildSlider(min, max, value);\n slider.addEventHandler(MouseEvent.MOUSE_RELEASED, eventHandler);\n mountSlider();\n }", "private void initializeBranchLimitSpinner() {\n SpinnerValueFactory<Integer> valueFactory;\n valueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 20, inputN){\n @Override public void decrement(int steps) {\n final int min = getMin();\n final int currentValue = getValue();\n final int newIndex = currentValue - steps * getAmountToStepBy();\n setValue(Math.max(newIndex, min));\n inputN = newIndex;\n renderTree();\n }\n\n @Override public void increment(int steps) {\n final int max = getMax();\n final int currentValue = getValue();\n final int newIndex = currentValue + steps * getAmountToStepBy();\n setValue(Math.min(newIndex, max));\n inputN = newIndex;\n renderTree();\n }\n };\n branchLimitSpinner.setValueFactory(valueFactory);\n }", "@Override\n public void valueChanged(double control_val) {\n loop_end.setValue((float)control_val);\n // Write your DynamicControl code above this line \n }", "Controls () {\n \n barX = 40;\n barWidth = 15;\n \n minY = 40;\n maxY = minY + height/3 - sliderHeight/2;\n \n minZoomValue = height - height;\n maxZoomValue = height; // 300 percent\n valuePerY = (maxZoomValue - minZoomValue) / (maxY - minY);\n \n sliderWidth = 25;\n sliderHeight = 10;\n sliderX = (barX + (barWidth/2)) - (sliderWidth/2); \n sliderValue = minZoomValue; \n sliderY = minY; \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n slider_slices = new javax.swing.JSlider();\n jLabel2 = new javax.swing.JLabel();\n slider_width = new javax.swing.JSlider();\n jLabel3 = new javax.swing.JLabel();\n slider_height = new javax.swing.JSlider();\n jLabel4 = new javax.swing.JLabel();\n slider_depth = new javax.swing.JSlider();\n check_showBounds = new javax.swing.JCheckBox();\n slider_opacity = new javax.swing.JSlider();\n jLabel5 = new javax.swing.JLabel();\n check_showLightbuffer = new javax.swing.JCheckBox();\n check_multisample = new javax.swing.JCheckBox();\n\n jLabel1.setText(\"Slices\");\n\n slider_slices.setMaximum(700);\n slider_slices.setMinimum(1);\n slider_slices.setValue(5);\n slider_slices.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_slicesStateChanged(evt);\n }\n });\n\n jLabel2.setText(\"Width\");\n\n slider_width.setMaximum(200);\n slider_width.setMinimum(20);\n slider_width.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_widthStateChanged(evt);\n }\n });\n\n jLabel3.setText(\"Height\");\n\n slider_height.setMaximum(200);\n slider_height.setMinimum(20);\n slider_height.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_heightStateChanged(evt);\n }\n });\n\n jLabel4.setText(\"Depth\");\n\n slider_depth.setMaximum(200);\n slider_depth.setMinimum(20);\n slider_depth.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_depthStateChanged(evt);\n }\n });\n\n check_showBounds.setSelected(true);\n check_showBounds.setText(\"Show Bounds\");\n check_showBounds.setToolTipText(\"Draw box around all volume data\");\n check_showBounds.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showBoundsActionPerformed(evt);\n }\n });\n\n slider_opacity.setMajorTickSpacing(1);\n slider_opacity.setMaximum(700);\n slider_opacity.setValue(5);\n slider_opacity.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_opacityStateChanged(evt);\n }\n });\n\n jLabel5.setText(\"Opacity\");\n\n check_showLightbuffer.setSelected(true);\n check_showLightbuffer.setText(\"Show Lightbuffer\");\n check_showLightbuffer.setToolTipText(\"Display lighting calculations onscreen\");\n check_showLightbuffer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showLightbufferActionPerformed(evt);\n }\n });\n\n check_multisample.setText(\"Multisample\");\n check_multisample.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_multisampleActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(slider_depth, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_width, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_height, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(check_showBounds)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_showLightbuffer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_multisample))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_opacity, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_slices, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(slider_width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(slider_height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(slider_depth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(check_showBounds)\n .addComponent(check_showLightbuffer)\n .addComponent(check_multisample))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(slider_slices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(slider_opacity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n }", "private void iSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_iSliderStateChanged\n float tmp_value = ((float)this.iSlider.getValue())/10;\n this.paramILabel.setText(\"\" + tmp_value);\n }", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tif(!source.getValueIsAdjusting()) {// getValueIsAdjusting 함수는 어떤 이벤트 인스턴스에서 연속적으로 이벤트가 일어 났을 때, \n\t\t\t//해당 이벤트 인스턴스들을 일종의 데이터 체인으로 보고 체인의 마지막 인스턴스 외에서 호출하는 경우 true를 반환하는 함수이다.\n\t\t\t\n\t\t\t\n\t\tint value = (int) slider.getValue();\n\t\timgBtn.setSize(value*10, value*10);// 슬라이더의 상태가 변경되면 호출됨\n\t\t}\n\t}", "public void sliderChange(int r, int g, int b)\n {\n String outPutR;\n String outPutG;\n String outPutB;\n \n //************output to binary()*******//\n if(binaryRBtn.isSelected() == true)\n { \n outPutR = Integer.toBinaryString(r);\n outPutG = Integer.toBinaryString(g);\n outPutB = Integer.toBinaryString(b);\n\n messageRed = (\"\" + outPutR); \n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //********output to hex()************//\n else if(hexDecRBtn.isSelected() == true)\n {\n outPutR = Integer.toHexString(r);\n outPutG = Integer.toHexString(g);\n outPutB = Integer.toHexString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //**********output to Octal()********//\n else if(octalRBtn.isSelected() == true)\n {\n outPutR = Integer.toOctalString(r);\n outPutG = Integer.toOctalString(g);\n outPutB = Integer.toOctalString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //*********output to decimal()********//\n else if(decimalRBtn.isSelected() == true)\n {\n outPutR = Integer.toString(r);\n outPutG = Integer.toString(g);\n outPutB = Integer.toString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n \n //******Bar Display rise and fall()******//\n redHeight=1; \n greenHeight=1; \n blueHeight=1;\n \n redHeight += rSliderValue;\n greenHeight += gSliderValue;\n blueHeight += bSliderValue;\n \n redYvalue = 475;\n redYvalue -=rSliderValue;\n \n greenYvalue = 475;\n greenYvalue -=gSliderValue;\n \n blueYvalue = 475;\n blueYvalue -=bSliderValue;\n \n repaint();\n \n }", "public RangeSlider() {\n initSlider();\n }", "public void stateChanged(ChangeEvent e) {\r\n Object source = e.getSource();\r\n\r\n if (source instanceof JSlider) {\r\n JSlider slider = (JSlider) source;\r\n if (text != null) {\r\n text.setText(\"<html><font color=#FFFFFF>Volume: \"+slider.getValue()+\"</font></html>\");\r\n text.setLocation(getWidth()/2-text.getWidth()/2, text.getY());\r\n revalidate();\r\n repaint();\r\n }\r\n }\r\n }", "@Override\n public void updateUI() {\n setUI(new RangeSliderUI(this));\n // Update UI for slider labels. This must be called after updating the\n // UI of the slider. Refer to JSlider.updateUI().\n updateLabelUIs();\n }", "HorizontalControl () {\n \n barY = 15; //40;\n barHeight = 40; //15;\n \n minX = 40;\n maxX = minX + width/3 - sliderWidth/2;\n \n minZoomValue = texture.width - texture.width;\n maxZoomValue = texture.width; // 300 percent\n valuePerX = (maxZoomValue - minZoomValue) / (maxX - minX);\n \n sliderWidth = 10; //25;\n sliderHeight = 25; //10;\n // sliderY = (barY + (barHeight/2)) - (sliderHeight/2);\n sliderY = (barY - (sliderHeight/2)) + (barHeight/2);\n sliderValue = minZoomValue; \n sliderX = minX; \n }", "private JComponent getSlider() {\n\t\t\n\t\t// ----------- slider -----------\n\t\tJSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 400,\n\t\t\t\tDEFAULT_SLIDER_VALUE);\n\t\tslider.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tJSlider source = (JSlider) e.getSource();\n\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\tsliderChanged(e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tslider.setMajorTickSpacing(100);\n\t\tslider.setMinorTickSpacing(30);\n\t\t\n\t\t// ---------- text field ----------\n\t\tselPictures = new JTextField(\"\");\n\t\t \n\t\tJPanel p = new JPanel(new BorderLayout());\n\t\tp.add(selPictures, BorderLayout.CENTER);\n \t\tp.add(slider, BorderLayout.SOUTH);\n\t\t\n\t\treturn p;\n\t}", "private synchronized void updateNumberFormat()\n\t{\n\n\t\tfinal int sw = rangeSlider.getWidth();\n\t\tif ( sw > 0 )\n\t\t{\n\t\t\tfinal double vrange = range.getMaxBound() - range.getMinBound();\n\t\t\tfinal int digits = ( int ) Math.ceil( Math.log10( sw / vrange ) );\n\n\t\t\tblockUpdates = true;\n\n\t\t\tJSpinner.NumberEditor numberEditor = ( ( JSpinner.NumberEditor ) minSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( minSpinner ) );\n\n\t\t\tnumberEditor = ( ( JSpinner.NumberEditor ) maxSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( maxSpinner ) );\n\n\t\t\tblockUpdates = false;\n\t\t}\n\t}", "@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }", "public void stateChanged(ChangeEvent event) {\n\t\t\t\t\t\t\t\t\tlabelFilons.setText(((JSlider)event.getSource()).getValue() + \" filons :\");\n\t\t\t\t\t\t\t\t}", "public void updateOutputLabels(Integer charCount){\r\n\t\tview.lblOutputLengthValue.setText(charCount.toString());\r\n\t}", "public double getStepSizeForSlider() {\n\t\treturn 1;\r\n\t}", "private void dSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_dSliderStateChanged\n float tmp_value = ((float)this.dSlider.getValue())/10;\n this.paramDLabel.setText(\"\" + tmp_value);\n }", "private void ffSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ffSliderStateChanged\n float tmp_value = ((float)this.ffSlider.getValue())/10;\n this.paramffLabel.setText(\"\" + tmp_value);\n }", "public Slider(int width, int length, int location_x, int location_y, int orientation) {\r\n super(width, length, location_x, location_y, new JSlider(orientation));\r\n }", "@Override\n\t\t\tpublic void stateChanged(final ChangeEvent evt) {\n\t\t\t\tfinal JSlider mySlider3 = (JSlider) evt.getSource();\n\t\t\t\t//if (source.getValueIsAdjusting()) {\n\t\t\t\tif (mySlider3.getValueIsAdjusting()) {\n\t\t\t\t\t// int freq = (int)source.getValue();\n\t\t\t\t\tfloat freq = (float) mySlider3.getValue();\n\t\t\t\t\tfreq = (freq / FREQ_MAX) * (freq / FREQ_MAX);\n\t\t\t\t\tfreq = freq * FREQ_MAX;\n\t\t\t\t\tfreq = freq + FREQ_MIN;\n\t\t\t\t\tdoPrintValue3(freq);\n\t\t\t\t\t// when the action occurs the doSendSlider method is invoked\n\t\t\t\t\t// with arguments for freq and node\n\t\t\t\t\tdoSendSlider(freq, 1002);\n\t\t\t\t}\n\t\t\t}", "public LineThicknessSelectorSlider(View view, int min, int max) {\n\t\tsuper(true);\n\t\tJLabel sliderLabel = new JLabel(\"Line thickness\");\n\t\tthis.view = view;\n this.min = min;\n this.max = max;\n\t this.setLayout(new BorderLayout());\n\t Slider = new Slider(JSlider.HORIZONTAL,min, max, 3);\n\t Slider.setPaintTicks(true);\n\t Slider.setPaintLabels(true);\n\t Slider.setPreferredSize(new Dimension(120,40));;\n\n\t Slider.setLabelTable(Slider.createStandardLabels(1));\n\t Slider.setPaintLabels(true);\n\t this.add(Slider,BorderLayout.NORTH);\n\t this.add(sliderLabel,BorderLayout.CENTER);\n\t }", "public ElevatorSlider (Elevator e, int name) {\n elevator = e;\n getInfo ();\n // Create the slider and adjust its properties\n slider = new JSlider (JSlider.VERTICAL, 0, numFloors, 0);\n slider.setMajorTickSpacing (MAJOR_TICK_SPACING);\n slider.setMinorTickSpacing (MINOR_TICK_SPACING);\n slider.setPaintTicks (true);\n slider.setPaintLabels (true);\n // Calculate the dimensions for the sliders\n int width = SLIDER_WIDTH;\n int height = HEIGHT_PER_FLOOR * numFloors;\n int heightResize = 1 + (numFloors / FLOOR_LIMIT);\n height /= heightResize;\n slider.setPreferredSize (new Dimension (width, height));\n \n // Add the slider\n this.add (slider);\n this.update (e, name);\n // Add the label to the panel\n this.add (stateLabel);\n this.add (capLabel);\n this.add (floorLabel);\n // Set the layout\n this.setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));\n \n }", "@Override\n public void setVisibleLength(int length) {}", "@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint amount = betslider.getValue();\n\t\t\t\tbetAmount.setText(\"$\"+amount);\n\t\t\t}", "private void pSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_pSliderStateChanged\n float tmp_value = ((float)this.pSlider.getValue())/10;\n this.paramPLabel.setText(\"\" + tmp_value);\n }", "public JComponent getSlidersPanel(){ return slidersPanel; }", "void addSliders() {\n\t\t\tfinal JTextField impact_r = new JTextField(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\timpact_r.setEditable(false);\n\t\t\t\n\t\t\tJSlider impactR = new JSlider(JSlider.HORIZONTAL, 1, 10, 2);\n\t\t\timpactR.setMinorTickSpacing(1);\n\t\t\t\n\t\t\timpactR.addChangeListener(new ChangeListener() {\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tJSlider source = (JSlider)e.getSource();\n\t\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\t\tConstants.IMPACT_RADIUS = source.getValue() / 10.;\n\t\t\t\t\t\timpact_r.setText(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tHashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();\n\t\t\tlabelTable.put(new Integer(1), new JLabel(\"0.1\"));\n\t\t\tlabelTable.put(new Integer(5), new JLabel(\"0.5\"));\n\t\t\tlabelTable.put(new Integer(10), new JLabel(\"1\"));\n\t\t\timpactR.setLabelTable(labelTable);\n\t\t\timpactR.setPaintTicks(true);\n\t\t\timpactR.setPaintLabels(true);\n\t\t\t\n\t\t\tContainer ir = new Container();\n\t\t\tir.setLayout(new FlowLayout());\n\t\t\tir.add(new JLabel(\"Impact Radius\"));\n\t\t\tir.add(impact_r);\n\t\t\t\n\t\t\tguiFrame.add(ir);\n\t\t\tguiFrame.add(impactR);\n\t\t}", "public JComplexSlider(String discrtiption, int sliderMax, int sliderMin, int inital, String resultPanelShowingMode, String unit){\n\t\tthis.unit = unit;\n\t\tthis.slider = new JSlider();\n\t\tsetDisplayingFormat(resultPanelShowingMode);\n\t\tinitialize(sliderMax, sliderMin, inital);\n\t\tthis.resultPanel = new JTextLabel(\"\", Alignment.CENTER, Alignment.CENTER, 0, null, false);\n\t\tJTextLabel description = new JTextLabel(discrtiption, Alignment.CENTER, Alignment.CENTER, 0, null, false);\n\t\taddRestoreDefaultChild(description);\n\t\t//\taddRestoreDefaultChild(resultPanel);\n\t\taddEnableChild(description, false);\n\t\taddEnableChild(resultPanel, false);\n\t\tUtility.getUtility().setPreferredSize(description, Sizing.Menu.tripleOne, Sizing.Menu.smallItemHeight);\n\t\tUtility.getUtility().setPreferredSize(resultPanel, Sizing.Menu.tripleThree, Sizing.Menu.smallItemHeight);\n\t\tLayouter.SpringLayouter layout = new SpringLayouter(this);\n\t\tlayout.put(layout.instanceOf(this).put(Position.CONSTRAIN_Y_HEIGHT, Sizing.Menu.smallItemHeight));\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X, description, 0, Position.CONSTRAIN_X, this);\n\t\tlayout.put(Position.CONSTRAIN_Y, description, 0, Position.CONSTRAIN_Y, this);\n\t\tlayout.put(Position.CONSTRAIN_Y_HEIGHT, description, 0, Position.CONSTRAIN_Y_HEIGHT, this);\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X, slider, 0, Position.CONSTRAIN_X_WIDTH, description);\n\t\tlayout.put(Position.CONSTRAIN_Y, slider, 0, Position.CONSTRAIN_Y, this);\n\t\tlayout.put(Position.CONSTRAIN_Y_HEIGHT, slider, 0, Position.CONSTRAIN_Y_HEIGHT, this);\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X, resultPanel, 0, Position.CONSTRAIN_X_WIDTH, slider);\n\t\tlayout.put(Position.CONSTRAIN_Y, resultPanel, 0, Position.CONSTRAIN_Y, this);\n\t\tlayout.put(Position.CONSTRAIN_Y_HEIGHT, resultPanel, 0, Position.CONSTRAIN_Y_HEIGHT, this);\n\t\t// <DIV> //\n\t\tlayout.put(Position.CONSTRAIN_X_WIDTH, this, 0, Position.CONSTRAIN_X_WIDTH, resultPanel);\n\t\taddAction();\n\t\trestoreDefault();\n\t}", "public void stateChanged(ChangeEvent event){\n\t\t\t\t\t\t\tlabelLargeur.setText(2*((JSlider)event.getSource()).getValue()-1 + \" cases :\");\n\t\t\t\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n label = new javax.swing.JLabel();\n cantBrillo = new javax.swing.JSlider();\n ok = new javax.swing.JButton();\n cantidad = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n label.setFont(new java.awt.Font(\"Lucida Grande\", 0, 14)); // NOI18N\n label.setText(\"Selecciona la cantidad de Brillo\");\n\n cantBrillo.setFont(new java.awt.Font(\"Lucida Grande\", 0, 14)); // NOI18N\n cantBrillo.setMaximum(255);\n cantBrillo.setValue(0);\n cantBrillo.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n cantBrilloStateChanged(evt);\n }\n });\n\n ok.setText(\"Aceptar\");\n ok.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n okActionPerformed(evt);\n }\n });\n\n cantidad.setText(\"0\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(103, 103, 103)\n .addComponent(label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(37, 37, 37)\n .addComponent(cantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(cantBrillo, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(49, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(ok)\n .addGap(17, 17, 17))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(cantidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(cantBrillo, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE))\n .addGap(14, 14, 14)\n .addComponent(ok)\n .addContainerGap())\n );\n\n pack();\n }", "public void changedisplayLengthLabel() {\n\t\taffectiveGraphPlot.changedisplayLengthLabel();\n\t}", "private HBox createArrSizeSliderWrapper(BorderPane root) {\n HBox arrSizeSliderWrapper = new HBox();\n\n arrSizeSliderWrapper.setSpacing(10);\n Label arrSizeSliderText = new Label(\"Change Array Size:\");\n arrSizeSliderText.setTextFill(Color.WHITE);\n arrSizeSliderWrapper.getChildren().addAll(arrSizeSliderText, createArrSizeSlider(root));\n\n return arrSizeSliderWrapper;\n }", "@Override\r\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tsize = (int) spinnerModel.getValue();\r\n\t\t\t\t\tcanvas.repaint();\r\n\t\t\t\t}", "private void ssSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ssSliderStateChanged\n float tmp_value = ((float)this.ssSlider.getValue())/10;\n this.paramssLabel.setText(\"\" + tmp_value);\n }", "public BSlider(Class c, float minimum, float maximum, float value)\r\n {\r\n super();\r\n valueClass = c;\r\n _setMin(minimum);\r\n _setMax(maximum);\r\n _setValue(value);\r\n addChangeListener(new ChangeListener()\r\n {\r\n @Override\r\n public void stateChanged(ChangeEvent e)\r\n {\r\n //Refresh text\r\n repaint();\r\n }\r\n });\r\n }", "@Override\n public void stateChanged(ChangeEvent e) {\n if (getSliderThreadsPerScan().getValue() == 0) {\n getSliderThreadsPerScan().setValue(1);\n }\n setLabelThreadsPerScanValue(getSliderThreadsPerScan().getValue());\n }", "@Override\n\tprotected void UpdateUI() {\n\t\tMaxFlowLevelDisplay(MaxFlowLevel);\n\t}", "public void stateChanged(ChangeEvent e)\n {\n slideLabel.setText(\"The speed is \" + speedSlider.getValue());\n }", "public void stateChanged(ChangeEvent evt) {\n lowBox. setText(String. valueOf(lowSlider. getValue()));\n updateThreshold(lowSlider. getValue(), highSlider. getValue()); \n }", "private void buildComponent() {\n\t\tStoreItemCell cell = new StoreItemCell(\"Turret\");\n\t\tcell.initialize(mySize);\n\t\tmyContainer.getChildren().add(cell.getNode());\n\t}", "public void stateChanged(ChangeEvent e) {\n\n (model.getInterpol()).setBezierIterationen(((JSlider) e.getSource()).getValue());\n }", "@Override\n public void layoutControls() {\n labelArea.setPrefHeight(100);\n labelArea.setMinHeight(70);\n labelArea.setVgrow(nameLabel, Priority.ALWAYS);\n labelArea.setVgrow(powerLabel, Priority.ALWAYS);\n labelArea.setVgrow(titleLabel, Priority.ALWAYS);\n labelArea.setVgrow(startOfOperationFirstLabel, Priority.ALWAYS);\n\n labelArea.getChildren().addAll(titleLabel, nameLabel, powerLabel, startOfOperationFirstLabel);\n HBox.setHgrow(spacer, Priority.ALWAYS);\n\n\n getChildren().addAll(labelArea, spacer, waterControl);\n\n }", "@Override\n public void stateChanged(ChangeEvent _e) {\n if (_e.getSource() instanceof JSlider){\n mView.setFrequencyTxt(((JSlider) _e.getSource()).getValue());\n mComponent.getCMUpdateThread().setInterval(((JSlider) _e.getSource()).getValue());\n if (mComponent.isPlaying())\n \tmComponent.getSimulationPlayer().setInterval(((JSlider) _e.getSource()).getValue());\n }\n }", "void setLabelString() {\n int pad = 5; // fudge to make up for variable width fonts\n float maxVal = Math.max(Math.abs(min), Math.abs(max));\n intDigits = Math.round((float) (Math.log(maxVal) / Math.log(10))) + pad;\n if (min < 0) {\n intDigits++; // add one for the '-'\n }\n // fractDigits is num digits of resolution for fraction. Use base 10 log\n // of scale, rounded up, + 2.\n fractDigits = (int) Math.ceil((Math.log(scale) / Math.log(10)));\n nf.setMinimumFractionDigits(fractDigits);\n nf.setMaximumFractionDigits(fractDigits);\n String value = nf.format(current);\n while (value.length() < (intDigits + fractDigits)) {\n value = value + \" \";\n }\n valueLabel.setText(value);\n }", "String updateSliderLabel() {\n if (this.direction.equals(\"H\"))\n return \"Percentage of Width : \";\n if (this.direction.equals(\"V\"))\n return \"Percentage of Height : \";\n return \"/!\\\\ Direction issue! Please relaunch the App /!\\\\\";\n }", "private void sliderChanged(ChangeEvent e) {\n\t\tif (isTest()) { // TEST TEST TEST TEST !!!!!!!!!!!!!\n\t\t\treturn;\n\t\t}\n\t\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tsliderValue = (int) source.getValue();\n\t\t// System.out.println(windowBase.getName() + \": sliderChanged: \" +\n\t\t// sliderValue);\n\t\tint size = index.data.getPictureSize();\n\t\tif (size == 0) {\n\t\t\tremoveAllPictureViews(); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\t \n\t\tPM_Picture pic = null;\n\t\t\n\t\tif (client.getComponentCount() > 0) {\n\t\t\tObject o = client.getComponent(0);\n\t\t\tif (o instanceof PM_PictureView) {\n\t\t\t\tpic = ((PM_PictureView)o).getPicture();\n\t\t\t}\n\t\t}\n\t\t\n//\t\tSystem.out.println(\"..... sliderChanged\");\n\t\tpaintViewport(pic);\n\t\t// paintViewport(null);\n\t}", "private void createSlider(){\n\t\tslider = new GVertSlider(winApp, (int)width - 10, (int)height, 10, maxRows * (int)height);\n\t\tslider.setBorder(1);\n\t\tslider.setVisible(false);\n\t\tslider.setLimits(0, 0, maxRows - 1);\n\t\tslider.addEventHandler(this, \"processSliderMotion\", new Class[] { GVertSlider.class } );\n\t\tadd(slider);\n\t}", "private JPanel getJPanelAggLength() {\r\n\t\tif (jPanelAggLength == null) {\r\n\t\t\tjPanelAggLength = new JPanel();\r\n\t\t\tjPanelAggLength.setBorder(new EmptyBorder(0, 0, 0, 0));\r\n\t\t\tjPanelAggLength.setLayout(new BorderLayout());\r\n\t\t\tjLabelAggLength = new JLabel(\"Aggregation length: \");\r\n\t\t\tjLabelAggLength.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\t\tSpinnerModel sModel = new SpinnerNumberModel(2, 2, Integer.MAX_VALUE, 1); // init, min, max, step\r\n\t\t\tjSpinnerAggLength = new JSpinner(sModel);\r\n\t\t\tjSpinnerAggLength.addChangeListener(this);\r\n\t\t\tJSpinner.DefaultEditor defEditor = (JSpinner.DefaultEditor) jSpinnerAggLength.getEditor();\r\n\t\t\tJFormattedTextField ftf = defEditor.getTextField();\r\n\t\t\tftf.setColumns(4);\r\n\t\t\tInternationalFormatter intFormatter = (InternationalFormatter) ftf.getFormatter();\r\n\t\t\tDecimalFormat decimalFormat = (DecimalFormat) intFormatter.getFormat();\r\n\t\t\tdecimalFormat.applyPattern(\"#\"); // decimalFormat.applyPattern(\"#,##0.0\");\r\n\t\t\tjPanelAggLength.add(jLabelAggLength, BorderLayout.WEST);\r\n\t\t\tjPanelAggLength.add(jSpinnerAggLength, BorderLayout.CENTER);\r\n\t\t}\r\n\t\treturn jPanelAggLength;\r\n\t}", "@FXML\n void angleSliderEvent() {\n \tint value = (int) angleSlider.getValue();\n \tangleText.setText(Integer.toString(value));\n \tangle = value;\n \tdrawLauncher(value);\n }", "public abstract void updateSlider();", "private void initSlider() {\n setOrientation(HORIZONTAL);\n }", "public void drawslider()\n{\n controlP5 = new ControlP5(this);\n sliderbutton = controlP5.addSlider(\"time\", 0, 28800, 400, 710, 792, 30).setSliderMode(Slider.FLEXIBLE).setLabel(\"\");\n backwardsbutton =controlP5.addButton(\"backwards\", 0, 1245, 710, 30, 30).setLabel(\"<\");\n forwardsbutton =controlP5.addButton(\"forwards\", 0, 1325, 710, 30, 30).setLabel(\">\");\n playbutton = controlP5.addButton(\"play\", 0, 1280, 710, 40, 30);\n speeddownbutton = controlP5.addButton(\"speeddown\", 0, 1210, 710, 30, 30).setLabel(\"<<\");\n speedupbutton = controlP5.addButton(\"speedup\", 0, 1360, 710, 30, 30).setLabel(\">>\");\n controlP5.getController(\"time\").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE);\n}", "private void configureFields() {\n\t\ttargetDiastolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_DIASTOLIC_LIMIT,UPPER_DIASTOLIC_LIMIT));\n\t\ttargetDiastolic.setEditable(true);\n\t\ttargetSystolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_SYSTOLIC_LIMIT,UPPER_SYSTOLIC_LIMIT));\n\t\ttargetSystolic.setEditable(true);\n\t\tdiastolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(DIASTOLIC_ALARM_LOWER, DIASTOLIC_ALARM_HIGHER));\n\t\tdiastolicAlarm.setEditable(true);\n\t\tsystolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(SYSTOLIC_ALARM_LOWER, SYSTOLIC_ALARM_HIGHER));\n\t\tsystolicAlarm.setEditable(true);\n\t\tSpinnerValueFactory.DoubleSpinnerValueFactory rateFactory=new SpinnerValueFactory.DoubleSpinnerValueFactory(MIN_FLOW_RATE, MAX_FLOW_RATE);\n\t\trateFactory.setAmountToStepBy(0.1);\n\t\tinfusionRate.setValueFactory(rateFactory);\n\t\t\n\t\t/*\n\t\t * We use bindBidirectional here because systolicProperty and diastolicProperty and numbers,\n\t\t * but the text field is a String, and bindBidrectional allows us to specify a converter\n\t\t * to handle the change between the two.\n\t\t */\n\t\tcurrentSystolic.textProperty().bindBidirectional(systolicProperty, new NumberStringConverter());\n\t\tcurrentDiastolic.textProperty().bindBidirectional(diastolicProperty, new NumberStringConverter());\n\t\t\n\t\tcurrentSystolic.setEditable(false);\n\t\tcurrentDiastolic.setEditable(false);\n\t\t\n\n\t\toperatingMode.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {\n\n\t\t\t@Override\n\t\t\tpublic void changed(ObservableValue<? extends Toggle> ov, Toggle oldToggle, Toggle newToggle) {\n\t\t\t\tif(newToggle.equals(openRadio)) {\n\t\t\t\t\tbpVBox.setVisible(false);\n\t\t\t\t\tbpVBox.setManaged(false);\n\t\t\t\t} else {\n\t\t\t\t\tbpVBox.setManaged(true);\n\t\t\t\t\tbpVBox.setVisible(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "private void renderToolBarCustomizingSection() {\n\t\tfinal SpinnerField spinner = new SpinnerField();\n\n\t\tspinner.setMaxValue(50);\n\t\tspinner.setMinValue(20);\n\t\tspinner.setValue(Constants.TASK_BAR_SIZE);\n\n\t\tspinner.addListener(Events.Change, new Listener<BaseEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handleEvent(BaseEvent be) {\n\t\t\t\tGwosDesktop.getInstance().getTaskBar()\n\t\t\t\t\t\t.setBarSize(spinner.getValue().intValue());\n\t\t\t}\n\t\t});\n\n\t\tspinner.setFieldLabel(\"Task bar size (px)\");\n\n\t\t// 2. Task bar color\n\t\t// TODO\n\n\t\t// Add controls to the panel\n\t\ttoolbarSection.add(spinner);\n\t}", "@JSProperty(\"tickLength\")\n void setTickLength(double value);", "private Slider createArrSizeSlider(BorderPane root) {\n Slider arrSizeSlider = new Slider(MIN_ARR_SIZE, MAX_ARR_SIZE, arrSize);\n\n arrSizeSlider.valueProperty().addListener((observable, oldValue, newValue) -> {\n ((HBox) root.getTop()).getChildren().get(2).setDisable(false);\n ((HBox) root.getTop()).getChildren().get(3).setDisable(false);\n\n arrSize = newValue.intValue();\n width = (SORTING_DISPLAY_WIDTH - 2 * (arrSize - 1)) / arrSize;\n\n generateRandomHeights();\n root.setBottom(createSortingDisplay());\n });\n\n return arrSizeSlider;\n }", "public void stateChanged(ChangeEvent evt) {\n highBox. setText(String. valueOf(highSlider. getValue()));\n updateThreshold(lowSlider. getValue(), highSlider. getValue());\n }", "public void setWidth(Integer width) {\n this.width = width;\n control.draw();\n }", "@Override\n public void buildView(IModelForm modelForm) {\n FormSection inputSection = modelForm.addSection(\"Input\");\n inputSection.addEntityListField(_inputGrids, new Grid3dTimeDepthSpecification());\n inputSection.addEntityComboField(_velocityVolume, new VelocityVolumeSpecification());\n inputSection.addEntityComboField(_aoi, AreaOfInterest.class).showActiveFieldToggle(_aoiFlag);\n\n // Build the conversion section.\n FormSection parameterSection = modelForm.addSection(\"Conversion\");\n parameterSection.addRadioGroupField(_conversionMethod, Method.values());\n\n // Build the output section.\n FormSection outputSection = modelForm.addSection(\"Output\");\n outputSection.addTextField(_outputGridSuffix);\n }", "@FXML\n void windSliderEvent() {\n \t\n \tint value = (int) windSlider.getValue();\n \twindText.setText(Integer.toString(value));\n \twindSpeed = value;\n }", "public void stateChanged(ChangeEvent event){\n\t\t\t\t\t\t\tlabelHauteur.setText(2*((JSlider)event.getSource()).getValue()-1 + \" cases :\");\n\t\t\t\t\t\t}", "public void stateChanged(ChangeEvent evt) {\n if (evt.getSource() == bgColorSlider) {\n int bgVal = bgColorSlider.getValue();\n displayLabel.setBackground( new Color(bgVal,bgVal,bgVal) );\n // NOTE: The background color is a shade of gray,\n // determined by the setting on the slider.\n }\n else {\n float hue = fgColorSlider.getValue()/100.0f;\n displayLabel.setForeground( Color.getHSBColor(hue, 1.0f, 1.0f) );\n // Note: The foreground color ranges through all the colors\n // of the spectrum.\n }\n }", "@Override\n\tpublic double getRenderWidth() {\n\t\treturn width;\n\t}", "protected\tvoid\t\trender(MiRenderer renderer)\n\t\t{\n\t\t// Draw background, valueDisplay and label\n\t\tsuper.render(renderer);\n\n\t\tMiBounds innerBounds = getInnerBounds(tmpBounds);\n\n\t\t// Move Strip over\n\t\trenderer.moveImageArea(innerBounds, scroll.x, scroll.y);\n\t\tscroll.zeroOut();\n\n\t\t// Draw ticks:\n\t\tfor (int i = 0; i < ticksToDrawX.size(); ++i)\n\t\t\t{\n\t\t\tticks.setCenterX(ticksToDrawX.elementAt(i));\n\t\t\tticks.setYmin(innerBounds.ymin);\n\t\t\tticks.setYmax(innerBounds.ymin + ticksToDrawHeight.elementAt(i));\n\t\t\tticks.render(renderer);\n\t\t\t}\n\t\tticksToDrawX.removeAllElements();\n\t\tticksToDrawHeight.removeAllElements();\n\t\t}", "public ThicknessSlider() {\n\t\t// Create a new JSlider with a vertical orientation, minimum value of 1,\n\t\t// maximum value of 20, and start value of defaultThickness\n \t\tsuper(JSlider.VERTICAL, 1, 20, defaultThickness);\n \t\t\n\t\tthis.setMajorTickSpacing(19);\n\t\tthis.setMinorTickSpacing(1);\n\t\tthis.setPaintTicks(true);\n\t\tthis.setPaintLabels(true);\n\t\tthis.setSnapToTicks(true);\n\t\tthis.setToolTipText(\"Change thickness of the brush\");\n\t\tthis.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t}", "protected void createSliders() {\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentFish\"));\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentShark\"));\n\t}", "protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }", "@Override\n public void stateChanged(ChangeEvent e)\n {\n if (e.getSource()==delaySlider)\n {\n// System.out.println(delaySlider.getValue());\n rightPanel.setDelayMS(delaySlider.getValue());\n }\n }", "private void init() {\r\n setForeground(Color.black);\r\n setTitle(\"Evolve Boundary\");\r\n\r\n JPanel scalePanel = new JPanel(new GridLayout(4, 2));\r\n scalePanel.setForeground(Color.black);\r\n scalePanel.setBorder(buildTitledBorder(\"Contour Change\"));\r\n\r\n int[] aiUnits = image.getUnitsOfMeasure();\r\n JLabel labelChangeX = new JLabel(\"Enter size change in \" + FileInfoBase.getUnitsOfMeasureAbbrevStr(aiUnits[0]) + \" units \");\r\n labelChangeX.setForeground(Color.black);\r\n labelChangeX.setFont(serif12);\r\n scalePanel.add(labelChangeX);\r\n\r\n textChangeX = new JTextField();\r\n textChangeX.setText(\"2.0\");\r\n textChangeX.setFont(serif12);\r\n scalePanel.add(textChangeX);\r\n \r\n JLabel labelBoundaryDir = new JLabel(\"Move boundary \"); // make & set a label\r\n labelBoundaryDir.setForeground(Color.black);\r\n labelBoundaryDir.setFont(serif12);\r\n scalePanel.add(labelBoundaryDir); // add kernel label\r\n\r\n boundaryDirBox = new JComboBox();\r\n boundaryDirBox.setFont(serif12);\r\n boundaryDirBox.setBackground(Color.white);\r\n boundaryDirBox.addItem(\"Outward\");\r\n boundaryDirBox.addItem(\"Inward\");\r\n scalePanel.add(boundaryDirBox);\r\n\r\n //JPanel imageVOIPanel = new JPanel(new GridLayout(1, 1));\r\n //imageVOIPanel.setForeground(Color.black);\r\n //imageVOIPanel.setBorder(buildTitledBorder(\"Evolve Boundary\"));\r\n\r\n //ButtonGroup imageVOIGroup = new ButtonGroup();\r\n //singleSlice = new JRadioButton(\"Single slice\", true);\r\n //singleSlice.setFont(serif12);\r\n //imageVOIGroup.add(singleSlice);\r\n //imageVOIPanel.add(singleSlice);\r\n\r\n removeOriginalCheckBox = new JCheckBox(\"Replace Original Contour\");\r\n removeOriginalCheckBox.setFont(serif12);\r\n removeOriginalCheckBox.setForeground(Color.black);\r\n removeOriginalCheckBox.setSelected(false);\r\n scalePanel.add(removeOriginalCheckBox);\r\n\r\n\r\n JPanel mainPanel = new JPanel(new GridBagLayout());\r\n mainPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));\r\n\r\n GridBagConstraints gbc = new GridBagConstraints();\r\n gbc.gridwidth = 1;\r\n gbc.gridheight = 1;\r\n gbc.anchor = GridBagConstraints.WEST;\r\n gbc.weightx = 1;\r\n gbc.insets = new Insets(3, 3, 3, 3);\r\n gbc.gridx = 0;\r\n gbc.gridy = 0;\r\n gbc.fill = GridBagConstraints.HORIZONTAL;\r\n mainPanel.add(scalePanel, gbc);\r\n //gbc.gridy++;\r\n //mainPanel.add(imageVOIPanel, gbc);\r\n\r\n JPanel buttonPanel = new JPanel();\r\n buildOKButton();\r\n buttonPanel.add(OKButton);\r\n buildCancelButton();\r\n buttonPanel.add(cancelButton);\r\n buildHelpButton();\r\n buttonPanel.add(helpButton);\r\n\r\n getContentPane().add(mainPanel, BorderLayout.CENTER);\r\n getContentPane().add(buttonPanel, BorderLayout.SOUTH);\r\n pack();\r\n setVisible(true);\r\n }", "public void divisionsChanged(){\r\n voltagePerDivisionLabel.setText(getScienceNumber(VoltagePerDivision) + \"V/Division\");\r\n SecondsPerDivisionLabel.setText(getScienceNumber(secondsPerDivision)+\"S/Div\");\r\n }", "protected JComponent createEditor() {\n/* 84 */ JComponent editor = super.createEditor();\n/* 85 */ if (editor instanceof JSpinner.DefaultEditor) {\n/* */ \n/* 87 */ JSpinner.DefaultEditor de = (JSpinner.DefaultEditor)editor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 92 */ de.getTextField().setBorder(new EmptyBorder(0, 0, 0, 0));\n/* */ \n/* 94 */ Dimension prefSize = de.getPreferredSize();\n/* 95 */ int compHeight = prefSize.height;\n/* */ \n/* 97 */ int height = LiquidSpinnerButtonUI.getSkin(1).getVsize() + LiquidSpinnerButtonUI.getSkin(5).getVsize();\n/* 98 */ int diff = height - compHeight;\n/* */ \n/* 100 */ if (diff > 0) {\n/* */ \n/* 102 */ int half = diff / 2;\n/* 103 */ de.getTextField().setBorder(new EmptyBorder(half, 0, diff - half, 0));\n/* */ } \n/* */ } \n/* 106 */ return editor;\n/* */ }", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "public HBox simulationControl() {\t\t\r\n\t\t// Setup Slider\r\n\t\tspeedControl.setPrefWidth(800);\r\n\t\tspeedControl.setBlockIncrement(10);\r\n\t\tspeedControl.setMajorTickUnit(10);\r\n\t\tspeedControl.setMinorTickCount(0);\r\n\t\tspeedControl.setSnapToTicks(true);\r\n\t\t\r\n\t\t// Setup HBox\r\n\t\tHBox control = new HBox(); \r\n\t\tcontrol.setAlignment(Pos.CENTER); \r\n\t\t\r\n\t\t// Add Slider To HBox\r\n\t\tcontrol.getChildren().add(speedControl);\r\n\t\t\r\n\t\treturn control;\r\n\t}", "protected Control createSpinnerControl(Composite parent) {\r\n \t\tcomposite = new Composite(parent, SWT.NONE);\r\n \t\tGridLayout gridLayout = new GridLayout();\r\n \t\tgridLayout.numColumns = 2;\r\n gridLayout.marginWidth = 0;\r\n gridLayout.marginHeight = 0;\r\n gridLayout.horizontalSpacing = HORIZONTAL_GAP;\r\n \t\tcomposite.setLayout(gridLayout);\r\n \t\tGridData gd;\r\n \t\tgd = new GridData(GridData.FILL_HORIZONTAL);\r\n \t\tcomposite.setLayoutData(gd);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create label\r\n \t\t */\r\n \t\tsliderLabel = new Label(composite,SWT.NONE);\r\n \t\tgd = new GridData(SWT.LEFT);\r\n \t\tsliderLabel.setLayoutData(gd);\r\n \t\tsliderLabel.setText(SLIDER_LABEL_DEFAULT_TEXT);\r\n \t\tPoint size = sliderLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r\n \t\tsliderLabel.setSize(size);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create slider\r\n \t\t */\r\n \t\tslider = new Slider(composite, SWT.HORIZONTAL);\r\n \t\tgd = new GridData(SWT.RIGHT | GridData.FILL_HORIZONTAL);\r\n \t\tslider.setLayoutData(gd);\r\n \t\t\r\n \t\tslider.setMaximum(MAX_SLIDER_VALUE + slider.getThumb());\r\n \t\tslider.setMinimum(MIN_SLIDER_VALUE);\r\n \t\tslider.setIncrement(INCREMENT_SLIDER_VALUE);\r\n \r\n \t\t/*\r\n \t\t * Add listener to handle value change \r\n \t\t */\r\n \t\tselectionListener = new SelectionListener() {\r\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n \t\t\t\tvalueChanged();\r\n \t\t\t}\r\n \r\n \t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n \t\t\t\t// Do nothing\r\n \t\t\t}\r\n \t\t};\r\n \t\tslider.addSelectionListener(selectionListener);\r\n \t\ttry {\r\n \t\t\tintValue = Integer.parseInt(valueProvider.getStringValue(true).toString());\r\n\t\t} catch (Exception e) {\r\n \t\t\tintValue = DEFAULT_SLIDER_VALUE;\r\n \t\t}\r\n \t\t\r\n \t\t/*\r\n \t\t * Initialize slider presentation\r\n \t\t */\r\n \t\tslider.setSelection(intValue);\r\n \t\tString weightsString = \"\" + (intValue /10) + \"%\"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n \t\tslider.setToolTipText(weightsString);\r\n \t\tsliderLabel.setText(weightsString);\r\n \t\t\r\n \t\tslider.pack();\r\n \t\tsliderLabel.pack();\r\n \t\treturn composite;\r\n \t}", "public AltAzController( float altitude, \n float azimuth, \n float min_distance,\n float max_distance,\n float distance )\n {\n setLayout( new GridLayout(3,1) );\n TitledBorder border = new TitledBorder(\n LineBorder.createBlackLineBorder(),\"View Control\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n setBorder( border );\n\n altitude_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n 0 );\n altitude_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Altitude\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n altitude_slider.setBorder( border );\n add( altitude_slider ); \n\n azimuth_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n 0 );\n azimuth_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Azimuth\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n azimuth_slider.setBorder( border );\n add( azimuth_slider ); \n\n distance_slider = new JSlider( JSlider.HORIZONTAL, 1, 20, 10 );\n distance_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Distance\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n distance_slider.setBorder( border );\n add( distance_slider ); \n\n setDistanceRange( min_distance, max_distance );\n setDistance( distance );\n setAltitudeAngle( altitude );\n setAzimuthAngle( azimuth );\n\n setView( true );\n }", "protected void valueChanged() {\r\n \t\tint newValue = slider.getSelection();\r\n \t\tint oldValue = this.intValue;\r\n \t\tintValue = newValue;\r\n \t\tjava.beans.PropertyChangeEvent event = new java.beans.PropertyChangeEvent(\r\n \t\t\t\tthis, IPropertyEditor.VALUE, oldValue, newValue);\r\n \t\tvalueChangeListener.valueChange(event);\r\n \t}", "public void draw() {\n\t\tif (fill) {\n\t\t\tapplet.noStroke();\n\t\t\tapplet.fill(color);\n\t\t} else {\n\t\t\tapplet.noFill();\n\t\t\tapplet.stroke(color);\n\t\t}\n\t\tapplet.rect(position.x, position.y, size.x, size.y);\n\t\tsliderButton.draw(new PVector(-10,0));\n\t}", "public void setLength(double length){this.length=length;}", "public void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tif (!source.getValueIsAdjusting()) {\n\t\t\tdgopval = Math.pow(10, -source.getValue() / 10.0);\n\t\t\tpvalLabel.setText(\"X = \" + source.getValue() / 10.0\n\t\t\t\t\t+ \"; p-value threshold is \"\n\t\t\t\t\t+ DREMGui_KeyInputs.doubleToSz(dgopval));\n\t\t\taddGOLabels(rootptr);\n\t\t}\n\t}", "protected abstract void renderControlOn(KmHtmlBuilder out);", "public CircularLayoutComponent() {\n initComponents();\n setOpaque(true);\n setDoubleBuffered(true);\n segmentSizeSpinner.addChangeListener(this);\n targetMarginSpinner.addChangeListener(this);\n sourceMarginSpinner.addChangeListener(this);\n segmentMarginSpinner.addChangeListener(this);\n segmentAngleSpinner.addChangeListener(this);\n }", "@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 stepSlider = new javax.swing.JSlider();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n update = new javax.swing.JButton();\n stepState = new javax.swing.JLabel();\n Caculate = new javax.swing.JButton();\n showConnect = new javax.swing.JCheckBox();\n randLine = new javax.swing.JCheckBox();\n randInfect = new javax.swing.JCheckBox();\n widthSlider = new javax.swing.JSlider();\n heightSlider = new javax.swing.JSlider();\n drawPanel = new DrawPanel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(new javax.swing.border.MatteBorder(null));\n\n stepSlider.setMajorTickSpacing(10);\n stepSlider.setMinorTickSpacing(1);\n stepSlider.setPaintLabels(true);\n stepSlider.setPaintTicks(true);\n stepSlider.setToolTipText(\"Time\");\n stepSlider.setValue(0);\n stepSlider.setAutoscrolls(true);\n stepSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n stepSliderStateChanged(evt);\n }\n });\n\n jLabel1.setText(\"width\");\n\n jLabel2.setText(\"height\");\n\n update.setText(\"Update\");\n update.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n updateMousePressed(evt);\n }\n });\n update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n updateActionPerformed(evt);\n }\n });\n\n Caculate.setText(\"Caculate\");\n Caculate.setToolTipText(\"\");\n Caculate.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n CaculateMousePressed(evt);\n }\n });\n Caculate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CaculateActionPerformed(evt);\n }\n });\n\n showConnect.setText(\"ShowConnectLine\");\n showConnect.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n showConnectStateChanged(evt);\n }\n });\n showConnect.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n showConnectPropertyChange(evt);\n }\n });\n\n randLine.setText(\"Random Line\");\n\n randInfect.setText(\"Random Infected\");\n\n widthSlider.setMajorTickSpacing(10);\n widthSlider.setMinimum(10);\n widthSlider.setMinorTickSpacing(2);\n widthSlider.setPaintTicks(true);\n widthSlider.setToolTipText(\"\");\n widthSlider.setValue(10);\n widthSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n widthSliderStateChanged(evt);\n }\n });\n widthSlider.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n widthSliderPropertyChange(evt);\n }\n });\n\n heightSlider.setMajorTickSpacing(10);\n heightSlider.setMinimum(10);\n heightSlider.setMinorTickSpacing(2);\n heightSlider.setPaintTicks(true);\n heightSlider.setValue(10);\n heightSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n heightSliderStateChanged(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 .addComponent(stepSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(showConnect)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(randLine))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(randInfect)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(14, 14, 14)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(heightSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(stepState, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(update)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(Caculate))))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, 0)\n .addComponent(stepSlider, 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 .addComponent(stepState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(update)\n .addComponent(Caculate))\n .addComponent(heightSlider, javax.swing.GroupLayout.Alignment.TRAILING, 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(showConnect)\n .addComponent(randLine)\n .addComponent(randInfect))\n .addContainerGap())\n );\n\n drawPanel.setBorder(new javax.swing.border.MatteBorder(null));\n drawPanel.setName(\"drawPanel\"); // NOI18N\n drawPanel.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n drawPanelMouseClicked(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n drawPanelMousePressed(evt);\n }\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n drawPanelMouseReleased(evt);\n }\n });\n drawPanel.addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentResized(java.awt.event.ComponentEvent evt) {\n drawPanelComponentResized(evt);\n }\n });\n drawPanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n drawPanelMouseDragged(evt);\n }\n });\n drawPanel.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n drawPanelPropertyChange(evt);\n }\n });\n\n javax.swing.GroupLayout drawPanelLayout = new javax.swing.GroupLayout(drawPanel);\n drawPanel.setLayout(drawPanelLayout);\n drawPanelLayout.setHorizontalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 639, Short.MAX_VALUE)\n );\n drawPanelLayout.setVerticalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 259, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(drawPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(drawPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "public SliderAndButtonDemo() {\n \n setBorder(BorderFactory.createEmptyBorder(6,6,6,6));\n\n /* Create the display label, with properties to match the\n values of the sliders and the setting of the combo box. */\n\n displayLabel = new JLabel(\"Hello World!\", JLabel.CENTER);\n displayLabel.setOpaque(true);\n displayLabel.setBackground( new Color(100,100,100) );\n displayLabel.setForeground( Color.RED );\n displayLabel.setFont( new Font(\"Serif\", Font.BOLD, 30) );\n displayLabel.setBorder(BorderFactory.createEmptyBorder(0,8,0,8));\n\n /* Create the sliders, and set up the panel to listen for\n ChangeEvents that are generated by the sliders. */\n\n bgColorSlider = new JSlider(0,255,100);\n bgColorSlider.addChangeListener(this);\n\n fgColorSlider = new JSlider(0,100,0);\n fgColorSlider.addChangeListener(this);\n \n /* Create four buttons to control the font style, and set up the\n panel to listen for ActionEvents from the buttons. */\n \n JButton plainButton = new JButton(\"Plain Font\");\n plainButton.addActionListener(this);\n JButton italicButton = new JButton(\"Italic Font\");\n italicButton.addActionListener(this);\n JButton boldButton = new JButton(\"Bold Font\");\n boldButton.addActionListener(this);\n\n\n /* Set the layout for the panel, and add the four components. \n Use a GridLayout with 3 rows and 2 columns, and with\n 5 pixels between components. */\n\n setLayout(new GridLayout(3,2,5,5));\n add(displayLabel);\n add(plainButton);\n add(bgColorSlider);\n add(italicButton);\n add(fgColorSlider);\n add(boldButton);\n\n }", "private void setWheelBaseSliderSettings() {\n wheelBaseSlider.setValueFactory(new Callback<JFXSlider, StringBinding>() {\n @Override\n public StringBinding call(JFXSlider arg0) {\n return Bindings.createStringBinding(new java.util.concurrent.Callable<String>(){\n @Override\n public String call() {\n DecimalFormat df = new DecimalFormat(\"#.0\");\n return df.format(wheelBaseSlider.getValue());\n }\n }, wheelBaseSlider.valueProperty());\n }\n });\n }", "public void stateChanged(ChangeEvent e) {\n JSlider source = (JSlider)e.getSource();\n //volume\n if(parameter=='v'){\n System.out.println(\"Panel: \"+numSampler+\" volume: \"+source.getValue());\n }\n //volume\n else if(parameter=='p'){\n System.out.println(\"Panel: \"+numSampler+\" pitch: \"+source.getValue());\n }\n else if(parameter=='f'){\n System.out.println(\"Panel: \"+numSampler+\" filter cutoff: \"+source.getValue());\n }\n }", "public void bind(final Slider slider) {\n\t\t// view for the color\n\t\tthis.addView(new ColorView() {\n\t\t\tSlider that = slider;\n\n\t\t\t@Override\n\t\t\tpublic void update(ColorController controller, Object caller) {\n\t\t\t\tif (!that.equals(caller)) {\n\t\t\t\t\tthat.setValue(controller.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Listener for slider changes\n\t\tslider.valueProperty().addListener(new ChangeListener<Number>() {\n\t\t\tSlider that = slider;\n public void changed(ObservableValue<? extends Number> ov,\n Number old_val, Number new_val) {\n \t\n \tDouble value = that.getValue();\n \tInteger ivalue = value.intValue();\n \tColorController.this.setValue(ivalue, that);\n }\n });\n\t\t\n\t\t\n\t\t// Update the slider to the integer value\n\t\tslider.setValue(getValue());\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n\tJSlider createSlider(final FloatControl c) { \r\n if (c == null) \r\n return null; \r\n final JSlider s = new JSlider(0, 1000); \r\n final float min = c.getMinimum(); \r\n final float max = c.getMaximum(); \r\n final float width = max - min; \r\n float fval = c.getValue(); \r\n s.setValue((int) ((fval - min) / width * 1000)); \r\n \r\n java.util.Hashtable labels = new java.util.Hashtable(3); \r\n labels.put(new Integer(0), new JLabel(c.getMinLabel())); \r\n labels.put(new Integer(500), new JLabel(c.getMidLabel())); \r\n labels.put(new Integer(1000), new JLabel(c.getMaxLabel())); \r\n s.setLabelTable(labels); \r\n s.setPaintLabels(true); \r\n \r\n s.setBorder(new TitledBorder(c.getType().toString() + \" \" \r\n + c.getUnits())); \r\n \r\n s.addChangeListener(new ChangeListener() { \r\n public void stateChanged(ChangeEvent e) { \r\n int i = s.getValue(); \r\n float f = min + (i * width / 1000.0f); \r\n c.setValue(f); \r\n } \r\n }); \r\n return s; \r\n }", "public void handleIncreaseLengthPowerup(){\n myRectangle.setWidth(myRectangle.getWidth()*increaseLengthPowerupSizeFactor);\n myLength=(int)(myLength*increaseLengthPowerupSizeFactor);\n }", "void slide_numAgents_stateChanged(ChangeEvent e) {\n lbl_agentCount.setText( Integer.toString( slide_numAgents.getValue() ) );\n }", "@Override\r\n public Dimension getPreferredSize() {\r\n return new Dimension(colorWheelWidth + valueBarWidth + spacing + margins * 2,\r\n diameter + selectDiameter + margins * 2);\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lbOee1 = new javax.swing.JLabel();\n lbOeeMeta6 = new javax.swing.JLabel();\n jSlider1 = new javax.swing.JSlider();\n\n lbOee1.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n lbOee1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lbOee1.setText(\"OEE\");\n lbOee1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n\n lbOeeMeta6.setBackground(new java.awt.Color(51, 255, 51));\n lbOeeMeta6.setFont(new java.awt.Font(\"Tahoma\", 1, 9)); // NOI18N\n lbOeeMeta6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lbOeeMeta6.setText(\"A\");\n lbOeeMeta6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n lbOeeMeta6.setOpaque(true);\n lbOeeMeta6.setPreferredSize(new java.awt.Dimension(36, 36));\n\n jSlider1.setMajorTickSpacing(10);\n jSlider1.setMaximum(480);\n jSlider1.setPaintTrack(false);\n jSlider1.setValue(0);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lbOee1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGap(129, 129, 129)\n .addComponent(lbOeeMeta6, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSlider1, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)\n .addGap(0, 0, 0))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jSlider1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lbOee1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lbOeeMeta6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE))\n .addGap(0, 0, 0))\n );\n }", "private void drawScrollBar() {\r\n\r\n\t _scrollOffsetX = 68;\r\n\t _scrollOffsetY = _resolutionResolver.getScaledHeight() % 2 == 1 ? -33 : -32;\r\n\r\n\t ResourceLocation rl = getContentHeight() > getViewableHeight() ? SLIDER_RESOURCE : SLIDER_FULL_RESOURCE;\r\n\t int ySizeScrollToUse = getContentHeight() > getViewableHeight() ? SIZE_SCROLL_Y : SIZE_SCROLL_FULL_Y;\r\n\t int xTextureSize = getContentHeight() > getViewableHeight() ? 32 : 16;\r\n\t int yTextureSize = getContentHeight() > getViewableHeight() ? 32 : 128;\r\n\t _curScrollValue = getContentHeight() > getViewableHeight() ? _curScrollValue : 0;\r\n\r\n\t\tGL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tthis.mc.renderEngine.bindTexture(rl);\r\n\t\tint x1 = (width - SIZE_SCROLL_X) / 2;\r\n\t\tint y1 = (height - SIZE_SCROLL_Y) / 2;\r\n\t\t\r\n\t\t// draw the scroll bar\r\n\t\tHubbyUtils.drawTexturedRectHelper(0.0f, x1 + _scrollOffsetX, y1 + _scrollOffsetY + _curScrollValue, SIZE_SCROLL_X, ySizeScrollToUse, 0, 0, (256 / xTextureSize) * SIZE_SCROLL_X, (256 / yTextureSize) * ySizeScrollToUse);\r\n\t}", "private void setOnSlide(JFXSlider cogSlider, final JFXTextField cogInput) {\n cogSlider.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n //TODO Round on 1 or more?\n DecimalFormat df = new DecimalFormat(\"#.#\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n cogInput.setText(df.format(newValue));\n }\n });\n }" ]
[ "0.71128684", "0.69999975", "0.6957884", "0.57808393", "0.5700991", "0.5656721", "0.54315734", "0.54163754", "0.53798735", "0.5341865", "0.52874964", "0.5284961", "0.5252166", "0.52426", "0.516793", "0.51652676", "0.5124004", "0.51209766", "0.50761706", "0.50745875", "0.5064871", "0.50453365", "0.5014584", "0.5011753", "0.50036293", "0.49946046", "0.49940127", "0.4988295", "0.49769494", "0.49754706", "0.49674404", "0.49547973", "0.49531242", "0.49473375", "0.49427962", "0.49317452", "0.49314266", "0.49232665", "0.49049875", "0.48978883", "0.48939392", "0.48874003", "0.48719922", "0.48665345", "0.48623532", "0.4813981", "0.4811964", "0.48029208", "0.48019922", "0.47978467", "0.4795062", "0.47923762", "0.47878763", "0.4786998", "0.47833797", "0.47789484", "0.47780302", "0.47694626", "0.4762811", "0.47575012", "0.474794", "0.4747858", "0.47356147", "0.4732935", "0.47226727", "0.47218096", "0.47190174", "0.47177416", "0.47060698", "0.4705844", "0.470438", "0.4704168", "0.4694993", "0.46927065", "0.4684546", "0.46826494", "0.46785358", "0.4678167", "0.46756646", "0.46676758", "0.4663732", "0.46629378", "0.46610212", "0.46548408", "0.4653875", "0.46535408", "0.46485594", "0.4640985", "0.46353695", "0.462943", "0.46273807", "0.4625097", "0.46244255", "0.46202233", "0.46189672", "0.4616133", "0.4610684", "0.46056563", "0.4604984", "0.45905092" ]
0.8361786
0
Renders the slider that controls the inputBranchGrowthRatio field
@FXML private void renderBranchGrowthRatioSlider() { renderSlider(0.5, 1, inputBranchGrowthRatio, (e) -> { inputBranchGrowthRatio = slider.getValue(); renderTree(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n private void renderBranchWitherSlider() {\n renderSlider(0, 1, inputBranchWitherRatio, (e) -> {\n inputBranchWitherRatio = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchLengthSlider() {\n renderSlider(1, 100, inputBranchLength, (e) -> {\n inputBranchLength = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchAngleSlider() {\n renderSlider(1, 30, inputBranchAngle, (e) -> {\n inputBranchAngle = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderTrunkAngleSlider() {\n renderSlider(-180, 0, inputTrunkAngle, (e) -> {\n inputTrunkAngle = slider.getValue();\n renderTree();\n });\n }", "private void renderSlider(double min, double max, double value, EventHandler eventHandler) {\n unmountSlider();\n buildSlider(min, max, value);\n slider.addEventHandler(MouseEvent.MOUSE_RELEASED, eventHandler);\n mountSlider();\n }", "public void sliderChange(int r, int g, int b)\n {\n String outPutR;\n String outPutG;\n String outPutB;\n \n //************output to binary()*******//\n if(binaryRBtn.isSelected() == true)\n { \n outPutR = Integer.toBinaryString(r);\n outPutG = Integer.toBinaryString(g);\n outPutB = Integer.toBinaryString(b);\n\n messageRed = (\"\" + outPutR); \n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //********output to hex()************//\n else if(hexDecRBtn.isSelected() == true)\n {\n outPutR = Integer.toHexString(r);\n outPutG = Integer.toHexString(g);\n outPutB = Integer.toHexString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //**********output to Octal()********//\n else if(octalRBtn.isSelected() == true)\n {\n outPutR = Integer.toOctalString(r);\n outPutG = Integer.toOctalString(g);\n outPutB = Integer.toOctalString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //*********output to decimal()********//\n else if(decimalRBtn.isSelected() == true)\n {\n outPutR = Integer.toString(r);\n outPutG = Integer.toString(g);\n outPutB = Integer.toString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n \n //******Bar Display rise and fall()******//\n redHeight=1; \n greenHeight=1; \n blueHeight=1;\n \n redHeight += rSliderValue;\n greenHeight += gSliderValue;\n blueHeight += bSliderValue;\n \n redYvalue = 475;\n redYvalue -=rSliderValue;\n \n greenYvalue = 475;\n greenYvalue -=gSliderValue;\n \n blueYvalue = 475;\n blueYvalue -=bSliderValue;\n \n repaint();\n \n }", "public abstract void updateSlider();", "private void iSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_iSliderStateChanged\n float tmp_value = ((float)this.iSlider.getValue())/10;\n this.paramILabel.setText(\"\" + tmp_value);\n }", "private void initializeBranchLimitSpinner() {\n SpinnerValueFactory<Integer> valueFactory;\n valueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 20, inputN){\n @Override public void decrement(int steps) {\n final int min = getMin();\n final int currentValue = getValue();\n final int newIndex = currentValue - steps * getAmountToStepBy();\n setValue(Math.max(newIndex, min));\n inputN = newIndex;\n renderTree();\n }\n\n @Override public void increment(int steps) {\n final int max = getMax();\n final int currentValue = getValue();\n final int newIndex = currentValue + steps * getAmountToStepBy();\n setValue(Math.min(newIndex, max));\n inputN = newIndex;\n renderTree();\n }\n };\n branchLimitSpinner.setValueFactory(valueFactory);\n }", "private synchronized void updateNumberFormat()\n\t{\n\n\t\tfinal int sw = rangeSlider.getWidth();\n\t\tif ( sw > 0 )\n\t\t{\n\t\t\tfinal double vrange = range.getMaxBound() - range.getMinBound();\n\t\t\tfinal int digits = ( int ) Math.ceil( Math.log10( sw / vrange ) );\n\n\t\t\tblockUpdates = true;\n\n\t\t\tJSpinner.NumberEditor numberEditor = ( ( JSpinner.NumberEditor ) minSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( minSpinner ) );\n\n\t\t\tnumberEditor = ( ( JSpinner.NumberEditor ) maxSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( maxSpinner ) );\n\n\t\t\tblockUpdates = false;\n\t\t}\n\t}", "@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint amount = betslider.getValue();\n\t\t\t\tbetAmount.setText(\"$\"+amount);\n\t\t\t}", "private JComponent getSlider() {\n\t\t\n\t\t// ----------- slider -----------\n\t\tJSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 400,\n\t\t\t\tDEFAULT_SLIDER_VALUE);\n\t\tslider.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tJSlider source = (JSlider) e.getSource();\n\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\tsliderChanged(e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tslider.setMajorTickSpacing(100);\n\t\tslider.setMinorTickSpacing(30);\n\t\t\n\t\t// ---------- text field ----------\n\t\tselPictures = new JTextField(\"\");\n\t\t \n\t\tJPanel p = new JPanel(new BorderLayout());\n\t\tp.add(selPictures, BorderLayout.CENTER);\n \t\tp.add(slider, BorderLayout.SOUTH);\n\t\t\n\t\treturn p;\n\t}", "public void initPanel(String attrib, int desired_width){\r\n\r\n slider = new JSlider(JSlider.HORIZONTAL,\r\n min, max, min);\r\n\r\n slider.addChangeListener(new SliderBarActionListener(this,attrib));\r\n\r\n slider.setMajorTickSpacing((max-min)/5);\r\n slider.setPaintTicks(true);\r\n\r\n //Create the label table\r\n Hashtable labelTable = new Hashtable();\r\n labelTable.put( new Integer( min ), new JLabel(\"\"+ min/precision));\r\n labelTable.put( new Integer( max ), new JLabel(\"\" + max/precision));\r\n slider.setLabelTable( labelTable );\r\n\r\n slider.setPaintLabels(true);\r\n\r\n Dimension currentsize = slider.getPreferredSize();\r\n currentsize.width = desired_width;\r\n currentsize.height = (DIM_HEIGHT/12) * 11;\r\n slider.setPreferredSize(currentsize);\r\n\r\n this.setLayout(new GridLayout(2,1));\r\n\r\n this.add(label, BorderLayout.NORTH);\r\n\r\n this.add(slider, BorderLayout.SOUTH);\r\n\r\n this.revalidate();\r\n }", "@Override\n public void updateUI() {\n setUI(new RangeSliderUI(this));\n // Update UI for slider labels. This must be called after updating the\n // UI of the slider. Refer to JSlider.updateUI().\n updateLabelUIs();\n }", "private void dSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_dSliderStateChanged\n float tmp_value = ((float)this.dSlider.getValue())/10;\n this.paramDLabel.setText(\"\" + tmp_value);\n }", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tif(!source.getValueIsAdjusting()) {// getValueIsAdjusting 함수는 어떤 이벤트 인스턴스에서 연속적으로 이벤트가 일어 났을 때, \n\t\t\t//해당 이벤트 인스턴스들을 일종의 데이터 체인으로 보고 체인의 마지막 인스턴스 외에서 호출하는 경우 true를 반환하는 함수이다.\n\t\t\t\n\t\t\t\n\t\tint value = (int) slider.getValue();\n\t\timgBtn.setSize(value*10, value*10);// 슬라이더의 상태가 변경되면 호출됨\n\t\t}\n\t}", "@Override\n public void valueChanged(double control_val) {\n loop_end.setValue((float)control_val);\n // Write your DynamicControl code above this line \n }", "private void pSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_pSliderStateChanged\n float tmp_value = ((float)this.pSlider.getValue())/10;\n this.paramPLabel.setText(\"\" + tmp_value);\n }", "Controls () {\n \n barX = 40;\n barWidth = 15;\n \n minY = 40;\n maxY = minY + height/3 - sliderHeight/2;\n \n minZoomValue = height - height;\n maxZoomValue = height; // 300 percent\n valuePerY = (maxZoomValue - minZoomValue) / (maxY - minY);\n \n sliderWidth = 25;\n sliderHeight = 10;\n sliderX = (barX + (barWidth/2)) - (sliderWidth/2); \n sliderValue = minZoomValue; \n sliderY = minY; \n }", "public BSlider(Class c, float minimum, float maximum, float value)\r\n {\r\n super();\r\n valueClass = c;\r\n _setMin(minimum);\r\n _setMax(maximum);\r\n _setValue(value);\r\n addChangeListener(new ChangeListener()\r\n {\r\n @Override\r\n public void stateChanged(ChangeEvent e)\r\n {\r\n //Refresh text\r\n repaint();\r\n }\r\n });\r\n }", "public JComponent getSlidersPanel(){ return slidersPanel; }", "public void stateChanged(ChangeEvent e) {\n\n (model.getInterpol()).setBezierIterationen(((JSlider) e.getSource()).getValue());\n }", "private void setOnSlide(JFXSlider cogSlider, final JFXTextField cogInput) {\n cogSlider.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n //TODO Round on 1 or more?\n DecimalFormat df = new DecimalFormat(\"#.#\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n cogInput.setText(df.format(newValue));\n }\n });\n }", "private void ssSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ssSliderStateChanged\n float tmp_value = ((float)this.ssSlider.getValue())/10;\n this.paramssLabel.setText(\"\" + tmp_value);\n }", "private void updateHubHelps(BoundedRangeModel subModel , JLabel component) {\n DecimalFormat df = new DecimalFormat(\"#00.00\");\n float prc_current = (float)subModel.getValue() / (float)( subModel.getMaximum() - subModel.getMinimum() ) * 100f;\n float prc_total = this.hub.getWeight( this.hub.indexOf( subModel ) ) / this.hub.getTotalWeight() * 100f;\n component.setText( df.format(prc_current) + \" % of \" + df.format(prc_total) + \" %\" );\n }", "private void ffSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ffSliderStateChanged\n float tmp_value = ((float)this.ffSlider.getValue())/10;\n this.paramffLabel.setText(\"\" + tmp_value);\n }", "@Override\n\t\t\tpublic void stateChanged(final ChangeEvent evt) {\n\t\t\t\tfinal JSlider mySlider3 = (JSlider) evt.getSource();\n\t\t\t\t//if (source.getValueIsAdjusting()) {\n\t\t\t\tif (mySlider3.getValueIsAdjusting()) {\n\t\t\t\t\t// int freq = (int)source.getValue();\n\t\t\t\t\tfloat freq = (float) mySlider3.getValue();\n\t\t\t\t\tfreq = (freq / FREQ_MAX) * (freq / FREQ_MAX);\n\t\t\t\t\tfreq = freq * FREQ_MAX;\n\t\t\t\t\tfreq = freq + FREQ_MIN;\n\t\t\t\t\tdoPrintValue3(freq);\n\t\t\t\t\t// when the action occurs the doSendSlider method is invoked\n\t\t\t\t\t// with arguments for freq and node\n\t\t\t\t\tdoSendSlider(freq, 1002);\n\t\t\t\t}\n\t\t\t}", "public RangeSlider() {\n initSlider();\n }", "public void stateChanged(ChangeEvent evt) {\n if (evt.getSource() == bgColorSlider) {\n int bgVal = bgColorSlider.getValue();\n displayLabel.setBackground( new Color(bgVal,bgVal,bgVal) );\n // NOTE: The background color is a shade of gray,\n // determined by the setting on the slider.\n }\n else {\n float hue = fgColorSlider.getValue()/100.0f;\n displayLabel.setForeground( Color.getHSBColor(hue, 1.0f, 1.0f) );\n // Note: The foreground color ranges through all the colors\n // of the spectrum.\n }\n }", "void addSliders() {\n\t\t\tfinal JTextField impact_r = new JTextField(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\timpact_r.setEditable(false);\n\t\t\t\n\t\t\tJSlider impactR = new JSlider(JSlider.HORIZONTAL, 1, 10, 2);\n\t\t\timpactR.setMinorTickSpacing(1);\n\t\t\t\n\t\t\timpactR.addChangeListener(new ChangeListener() {\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tJSlider source = (JSlider)e.getSource();\n\t\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\t\tConstants.IMPACT_RADIUS = source.getValue() / 10.;\n\t\t\t\t\t\timpact_r.setText(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tHashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();\n\t\t\tlabelTable.put(new Integer(1), new JLabel(\"0.1\"));\n\t\t\tlabelTable.put(new Integer(5), new JLabel(\"0.5\"));\n\t\t\tlabelTable.put(new Integer(10), new JLabel(\"1\"));\n\t\t\timpactR.setLabelTable(labelTable);\n\t\t\timpactR.setPaintTicks(true);\n\t\t\timpactR.setPaintLabels(true);\n\t\t\t\n\t\t\tContainer ir = new Container();\n\t\t\tir.setLayout(new FlowLayout());\n\t\t\tir.add(new JLabel(\"Impact Radius\"));\n\t\t\tir.add(impact_r);\n\t\t\t\n\t\t\tguiFrame.add(ir);\n\t\t\tguiFrame.add(impactR);\n\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n slider_slices = new javax.swing.JSlider();\n jLabel2 = new javax.swing.JLabel();\n slider_width = new javax.swing.JSlider();\n jLabel3 = new javax.swing.JLabel();\n slider_height = new javax.swing.JSlider();\n jLabel4 = new javax.swing.JLabel();\n slider_depth = new javax.swing.JSlider();\n check_showBounds = new javax.swing.JCheckBox();\n slider_opacity = new javax.swing.JSlider();\n jLabel5 = new javax.swing.JLabel();\n check_showLightbuffer = new javax.swing.JCheckBox();\n check_multisample = new javax.swing.JCheckBox();\n\n jLabel1.setText(\"Slices\");\n\n slider_slices.setMaximum(700);\n slider_slices.setMinimum(1);\n slider_slices.setValue(5);\n slider_slices.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_slicesStateChanged(evt);\n }\n });\n\n jLabel2.setText(\"Width\");\n\n slider_width.setMaximum(200);\n slider_width.setMinimum(20);\n slider_width.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_widthStateChanged(evt);\n }\n });\n\n jLabel3.setText(\"Height\");\n\n slider_height.setMaximum(200);\n slider_height.setMinimum(20);\n slider_height.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_heightStateChanged(evt);\n }\n });\n\n jLabel4.setText(\"Depth\");\n\n slider_depth.setMaximum(200);\n slider_depth.setMinimum(20);\n slider_depth.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_depthStateChanged(evt);\n }\n });\n\n check_showBounds.setSelected(true);\n check_showBounds.setText(\"Show Bounds\");\n check_showBounds.setToolTipText(\"Draw box around all volume data\");\n check_showBounds.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showBoundsActionPerformed(evt);\n }\n });\n\n slider_opacity.setMajorTickSpacing(1);\n slider_opacity.setMaximum(700);\n slider_opacity.setValue(5);\n slider_opacity.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_opacityStateChanged(evt);\n }\n });\n\n jLabel5.setText(\"Opacity\");\n\n check_showLightbuffer.setSelected(true);\n check_showLightbuffer.setText(\"Show Lightbuffer\");\n check_showLightbuffer.setToolTipText(\"Display lighting calculations onscreen\");\n check_showLightbuffer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showLightbufferActionPerformed(evt);\n }\n });\n\n check_multisample.setText(\"Multisample\");\n check_multisample.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_multisampleActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(slider_depth, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_width, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_height, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(check_showBounds)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_showLightbuffer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_multisample))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_opacity, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_slices, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(slider_width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(slider_height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(slider_depth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(check_showBounds)\n .addComponent(check_showLightbuffer)\n .addComponent(check_multisample))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(slider_slices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(slider_opacity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n }", "private void sliderChanged(ChangeEvent e) {\n\t\tif (isTest()) { // TEST TEST TEST TEST !!!!!!!!!!!!!\n\t\t\treturn;\n\t\t}\n\t\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tsliderValue = (int) source.getValue();\n\t\t// System.out.println(windowBase.getName() + \": sliderChanged: \" +\n\t\t// sliderValue);\n\t\tint size = index.data.getPictureSize();\n\t\tif (size == 0) {\n\t\t\tremoveAllPictureViews(); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\t \n\t\tPM_Picture pic = null;\n\t\t\n\t\tif (client.getComponentCount() > 0) {\n\t\t\tObject o = client.getComponent(0);\n\t\t\tif (o instanceof PM_PictureView) {\n\t\t\t\tpic = ((PM_PictureView)o).getPicture();\n\t\t\t}\n\t\t}\n\t\t\n//\t\tSystem.out.println(\"..... sliderChanged\");\n\t\tpaintViewport(pic);\n\t\t// paintViewport(null);\n\t}", "public void stateChanged(ChangeEvent evt) {\n lowBox. setText(String. valueOf(lowSlider. getValue()));\n updateThreshold(lowSlider. getValue(), highSlider. getValue()); \n }", "@Override\r\n public void paintComponent(Graphics g)\r\n {\n super.paintComponent(g);\r\n g.setColor(getParent().getBackground());\r\n g.fillRect(0, getHeight() / 2, getWidth(), getHeight());\r\n g.setColor(new Color(153, 153, 204));\r\n stringValue = Float.toString(_getValue());\r\n g.drawString(stringValue, getWidth() / 2 - (int) (stringValue.length() * 1.8f), getHeight() / 2 + 10);\r\n }", "@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }", "protected void updatePanelContent() {\n updating = true;\n jTextFieldName.setText(bulb.getName());\n jTextFieldName.setToolTipText(bulb.getType());\n jSlider1.setValue(bulb.getIntensity());\n jToggleButton1.setSelected(bulb.isOn());\n if (bulb.getColor() != null) {\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n switch(bulb.getColor()) {\n case TradfriConstants.COLOR_NORMAL: jRadioNormal.setSelected(true); break;\n case TradfriConstants.COLOR_WARM: jRadioWarm.setSelected(true); break;\n case TradfriConstants.COLOR_COLD: jRadioCold.setSelected(true); break;\n }\n }\n else {\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n }\n \n \n if (bulb.isOnline()) {\n jToggleButton1.setEnabled(true);\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n jSlider1.setEnabled(true);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [online]\");\n }\n else {\n jToggleButton1.setEnabled(false);\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n jSlider1.setEnabled(false);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [offline]\");\n }\n \n updating = false;\n }", "public void stateChanged(ChangeEvent evt) {\n highBox. setText(String. valueOf(highSlider. getValue()));\n updateThreshold(lowSlider. getValue(), highSlider. getValue());\n }", "public void stateChanged(ChangeEvent e) {\r\n Object source = e.getSource();\r\n\r\n if (source instanceof JSlider) {\r\n JSlider slider = (JSlider) source;\r\n if (text != null) {\r\n text.setText(\"<html><font color=#FFFFFF>Volume: \"+slider.getValue()+\"</font></html>\");\r\n text.setLocation(getWidth()/2-text.getWidth()/2, text.getY());\r\n revalidate();\r\n repaint();\r\n }\r\n }\r\n }", "protected Control createSpinnerControl(Composite parent) {\r\n \t\tcomposite = new Composite(parent, SWT.NONE);\r\n \t\tGridLayout gridLayout = new GridLayout();\r\n \t\tgridLayout.numColumns = 2;\r\n gridLayout.marginWidth = 0;\r\n gridLayout.marginHeight = 0;\r\n gridLayout.horizontalSpacing = HORIZONTAL_GAP;\r\n \t\tcomposite.setLayout(gridLayout);\r\n \t\tGridData gd;\r\n \t\tgd = new GridData(GridData.FILL_HORIZONTAL);\r\n \t\tcomposite.setLayoutData(gd);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create label\r\n \t\t */\r\n \t\tsliderLabel = new Label(composite,SWT.NONE);\r\n \t\tgd = new GridData(SWT.LEFT);\r\n \t\tsliderLabel.setLayoutData(gd);\r\n \t\tsliderLabel.setText(SLIDER_LABEL_DEFAULT_TEXT);\r\n \t\tPoint size = sliderLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r\n \t\tsliderLabel.setSize(size);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create slider\r\n \t\t */\r\n \t\tslider = new Slider(composite, SWT.HORIZONTAL);\r\n \t\tgd = new GridData(SWT.RIGHT | GridData.FILL_HORIZONTAL);\r\n \t\tslider.setLayoutData(gd);\r\n \t\t\r\n \t\tslider.setMaximum(MAX_SLIDER_VALUE + slider.getThumb());\r\n \t\tslider.setMinimum(MIN_SLIDER_VALUE);\r\n \t\tslider.setIncrement(INCREMENT_SLIDER_VALUE);\r\n \r\n \t\t/*\r\n \t\t * Add listener to handle value change \r\n \t\t */\r\n \t\tselectionListener = new SelectionListener() {\r\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n \t\t\t\tvalueChanged();\r\n \t\t\t}\r\n \r\n \t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n \t\t\t\t// Do nothing\r\n \t\t\t}\r\n \t\t};\r\n \t\tslider.addSelectionListener(selectionListener);\r\n \t\ttry {\r\n \t\t\tintValue = Integer.parseInt(valueProvider.getStringValue(true).toString());\r\n\t\t} catch (Exception e) {\r\n \t\t\tintValue = DEFAULT_SLIDER_VALUE;\r\n \t\t}\r\n \t\t\r\n \t\t/*\r\n \t\t * Initialize slider presentation\r\n \t\t */\r\n \t\tslider.setSelection(intValue);\r\n \t\tString weightsString = \"\" + (intValue /10) + \"%\"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n \t\tslider.setToolTipText(weightsString);\r\n \t\tsliderLabel.setText(weightsString);\r\n \t\t\r\n \t\tslider.pack();\r\n \t\tsliderLabel.pack();\r\n \t\treturn composite;\r\n \t}", "@Override\n public void stateChanged(ChangeEvent e) {\n if (Controls.getSelectedIndex() == 3) {\n Controls.setComponentAt(3, LineCC);\n Controls.setComponentAt(4, null);\n } else if (Controls.getSelectedIndex() == 4) {\n Controls.setComponentAt(3, null);\n Controls.setComponentAt(4, BackGCC);\n } else {\n Controls.setComponentAt(3, null);\n Controls.setComponentAt(4, null);\n }\n Zoom = ZoomSlider.getValue() / 10f;\n DrawGraphPassive();\n if ((int) EquationNum.getValue() != CurrentEQNum) {\n CurrentEQNum = (int) EquationNum.getValue();\n BackGCC.setColor(lineGraphs.get(CurrentEQNum - 1).getBackColor());\n LineCC.setColor(lineGraphs.get(CurrentEQNum - 1).getLineColour());\n Cards.show(EquationCardLayout, Integer.toString((int) EquationNum.getValue()));\n }\n }", "public void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tif (!source.getValueIsAdjusting()) {\n\t\t\tdgopval = Math.pow(10, -source.getValue() / 10.0);\n\t\t\tpvalLabel.setText(\"X = \" + source.getValue() / 10.0\n\t\t\t\t\t+ \"; p-value threshold is \"\n\t\t\t\t\t+ DREMGui_KeyInputs.doubleToSz(dgopval));\n\t\t\taddGOLabels(rootptr);\n\t\t}\n\t}", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "protected void valueChanged() {\r\n \t\tint newValue = slider.getSelection();\r\n \t\tint oldValue = this.intValue;\r\n \t\tintValue = newValue;\r\n \t\tjava.beans.PropertyChangeEvent event = new java.beans.PropertyChangeEvent(\r\n \t\t\t\tthis, IPropertyEditor.VALUE, oldValue, newValue);\r\n \t\tvalueChangeListener.valueChange(event);\r\n \t}", "private void setupVExpenseSlider() {\n\t\tif(verticalExpenseSlider != null)\n\t\t\tverticalExpensePanel.remove(verticalExpenseSlider);\n\t\tverticalExpenseSlider = new FloatingSliderPanel(0.0f, 1f, DEFAULT_VERTICAL_EXPENSE) {\n\t\t\tprotected void setDescriptionLabelText() {\n\t\t\t\tfloat currentValue = getCurrentValue();\n\t\t\t\tinfoLabel.setText(setVerticalExpenseInfoLabel(currentValue));\n\t\t\t}\n\t\t};\n\t\tGridBagConstraints gbc_verticalExpenseSlider = new GridBagConstraints();\n\t\tgbc_verticalExpenseSlider.insets = new Insets(0, 10, 0, 10);\n\t\tgbc_verticalExpenseSlider.fill = GridBagConstraints.BOTH;\n\t\tgbc_verticalExpenseSlider.gridx = 0;\n\t\tgbc_verticalExpenseSlider.gridy = 1;\n\t\tverticalExpensePanel.add(verticalExpenseSlider, gbc_verticalExpenseSlider);\n\t\t\n\t\trevalidate();\n\t}", "public void draw() {\n\t\tif (fill) {\n\t\t\tapplet.noStroke();\n\t\t\tapplet.fill(color);\n\t\t} else {\n\t\t\tapplet.noFill();\n\t\t\tapplet.stroke(color);\n\t\t}\n\t\tapplet.rect(position.x, position.y, size.x, size.y);\n\t\tsliderButton.draw(new PVector(-10,0));\n\t}", "protected void createSliders() {\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentFish\"));\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentShark\"));\n\t}", "public void displayBankBranch() {\n\t\t if(getBankVisibility()) {\n\t\t\t setRenderBankBranch(true);\n\t\t }else{\n\t\t\tsetRenderBankBranch(false); \n\t\t }\n\t\t \n\t }", "@FXML\n void angleSliderEvent() {\n \tint value = (int) angleSlider.getValue();\n \tangleText.setText(Integer.toString(value));\n \tangle = value;\n \tdrawLauncher(value);\n }", "public void stateChanged(ChangeEvent event) {\n\t\t\t\t\t\t\t\t\tlabelFilons.setText(((JSlider)event.getSource()).getValue() + \" filons :\");\n\t\t\t\t\t\t\t\t}", "public void drawslider()\n{\n controlP5 = new ControlP5(this);\n sliderbutton = controlP5.addSlider(\"time\", 0, 28800, 400, 710, 792, 30).setSliderMode(Slider.FLEXIBLE).setLabel(\"\");\n backwardsbutton =controlP5.addButton(\"backwards\", 0, 1245, 710, 30, 30).setLabel(\"<\");\n forwardsbutton =controlP5.addButton(\"forwards\", 0, 1325, 710, 30, 30).setLabel(\">\");\n playbutton = controlP5.addButton(\"play\", 0, 1280, 710, 40, 30);\n speeddownbutton = controlP5.addButton(\"speeddown\", 0, 1210, 710, 30, 30).setLabel(\"<<\");\n speedupbutton = controlP5.addButton(\"speedup\", 0, 1360, 710, 30, 30).setLabel(\">>\");\n controlP5.getController(\"time\").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE);\n}", "private void setWheelBaseSliderSettings() {\n wheelBaseSlider.setValueFactory(new Callback<JFXSlider, StringBinding>() {\n @Override\n public StringBinding call(JFXSlider arg0) {\n return Bindings.createStringBinding(new java.util.concurrent.Callable<String>(){\n @Override\n public String call() {\n DecimalFormat df = new DecimalFormat(\"#.0\");\n return df.format(wheelBaseSlider.getValue());\n }\n }, wheelBaseSlider.valueProperty());\n }\n });\n }", "CartogramWizardPanelFour (JFrame contentFrame)\n\t{\n\t\n\t\tmCartogramWizard = (CartogramWizard)contentFrame;\n\t\t\n\t\tthis.setLocation(160, 90);\n\t\tthis.setSize(440, 340);\n\t\tthis.setLayout(null);\n\t\n\t\tClassLoader cldr = this.getClass().getClassLoader();\n\n\t\t// Add the slider for the amount of deformation.\n\t\tFont smallFont = new Font(null, Font.PLAIN, 11);\n\t\tmDeformationSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 50);\n\t\tmDeformationSlider.setMajorTickSpacing(25);\n\t\tmDeformationSlider.setMinorTickSpacing(5);\n\t\tmDeformationSlider.setPaintTicks(true);\n\t\tmDeformationSlider.setFont(smallFont);\n\t\tmDeformationSlider.setSize(440, 40);\n\t\tmDeformationSlider.setLocation(0, 20);\n\t\t\n\t\tHashtable labelTable = new Hashtable();\n\t\tJLabel sliderLabel = new JLabel(\"Low\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(0), sliderLabel);\n\t\tsliderLabel = new JLabel(\"Medium\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(50), sliderLabel);\n\t\tsliderLabel = new JLabel(\"High\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(100), sliderLabel);\n\t\t\n\t\tmDeformationSlider.setLabelTable(labelTable);\n\t\tmDeformationSlider.setPaintLabels(true);\n\t\tthis.add(mDeformationSlider);\n\t\t\n\t\t\n\t\t// Add the label for the amount of deformation.\n\t\tJLabel deformationLabel = new JLabel(\"Transformation quality:\");\n\t\tdeformationLabel.setSize(440, 14);\n\t\tdeformationLabel.setFont(new Font(null, Font.BOLD, 11));\n\t\tdeformationLabel.setLocation(0, 0);\n\t\tthis.add(deformationLabel);\n\n\n\n\n\t\t// Create the text pane which displays the help text for the\n\t\t// amount of deformation.\n\t\tJTextPane deformationTextPane = new JTextPane();\n\t\tString deformationText = null;\n\t\ttry\n\t\t{\n\t\t\tInputStream inStream = \n\t\t\t\tcldr.getResource(\"AmountOfDeformationText.rtf\").openStream();\n\t\t\tStringBuffer inBuffer = new StringBuffer();\n\t\t\tint c;\n\t\t\twhile ((c = inStream.read()) != -1)\n\t\t\t{\n\t\t\t\tinBuffer.append((char)c);\n\t\t\t}\n\t\t\tinStream.close();\n\t\t\tdeformationText = inBuffer.toString();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\tdeformationTextPane.setContentType(\"text/rtf\");\n\t\tdeformationTextPane.setText(deformationText);\n\t\tdeformationTextPane.setEditable(false);\n\t\tdeformationTextPane.setFont(new Font(null, Font.PLAIN, 11));\n\t\tdeformationTextPane.setBackground(null);\n\t\tdeformationTextPane.setLocation(40, 70);\n\t\tdeformationTextPane.setSize(400, 70);\n\t\tthis.add(deformationTextPane);\n\t\t\n\t\t\n\t\t\n\t\t// ADVANCED OPTIONS\n\t\t\n\t\t// A button and an explanatory text for the advanced options.\n\t\tJButton advancedButton = \n\t\t\tnew JButton(\"Advanced options...\");\n\t\tadvancedButton.setLocation(0, 170);\n\t\tadvancedButton.setSize(240, 26);\n\t\tadvancedButton.addActionListener(\n\t\t\tnew CartogramWizardAdvancedOptionsAction(\"showDialog\", null));\n\t\tthis.add(advancedButton);\n\t\t\n\t\t// Create the text pane which displays the help text for the\n\t\t// simultaneous layers.\n\t\tJTextPane advancedTextPane = new JTextPane();\n\t\tString advancedText = null;\n\t\ttry\n\t\t{\n\t\t\tInputStream inStream = \n\t\t\t\tcldr.getResource(\"AdvancedOptionsText.rtf\").openStream();\n\t\t\tStringBuffer inBuffer = new StringBuffer();\n\t\t\tint c;\n\t\t\twhile ((c = inStream.read()) != -1)\n\t\t\t{\n\t\t\t\tinBuffer.append((char)c);\n\t\t\t}\n\t\t\tinStream.close();\n\t\t\tadvancedText = inBuffer.toString();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\tadvancedTextPane.setContentType(\"text/rtf\");\n\t\tadvancedTextPane.setText(advancedText);\n\t\tadvancedTextPane.setEditable(false);\n\t\tadvancedTextPane.setFont(new Font(null, Font.PLAIN, 11));\n\t\tadvancedTextPane.setBackground(null);\n\t\tadvancedTextPane.setLocation(40, 205);\n\t\tadvancedTextPane.setSize(400, 60);\n\t\tthis.add(advancedTextPane);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Add the Compute button\n\t\tJButton computeButton = new JButton(\"Compute\");\n\t\tcomputeButton.setLocation(340, 314);\n\t\tcomputeButton.setSize(100, 26);\n\t\tcomputeButton.setMnemonic(KeyEvent.VK_ENTER);\n\t\tcomputeButton.addActionListener(new \n\t\t\tCartogramWizardComputeAction((CartogramWizard)contentFrame));\n\t\tthis.add(computeButton);\n\t\t\n\t\t\n\t\t\n\t\t// Add the Back button\n\t\tJButton backButton = new JButton(\"< Back\");\n\t\tbackButton.setLocation(235, 314);\n\t\tbackButton.setSize(100, 26);\n\t\tbackButton.addActionListener(new\n\t\t\tCartogramWizardGoToStepAction((CartogramWizard)contentFrame, 3));\n\t\tthis.add(backButton);\n\n\n\n\n\n\t\t// ADD THE HELP BUTTON\n\t\t\n\t\t//ClassLoader cldr = this.getClass().getClassLoader();\n\t\t\n\t\tjava.net.URL imageURL = cldr.getResource(\"help-22.png\");\n\t\tImageIcon helpIcon = new ImageIcon(imageURL);\n\n\t\tJButton helpButton = \n\t\t\tnew JButton(helpIcon);\n\t\t\n\t\thelpButton.setVerticalTextPosition(SwingConstants.BOTTOM);\n\t\thelpButton.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\thelpButton.setSize(30, 30);\n\t\thelpButton.setLocation(0, 312);\n\t\thelpButton.setFocusable(false);\n\t\thelpButton.setContentAreaFilled(false);\n\t\thelpButton.setBorderPainted(false);\n\t\t\n\t\thelpButton.addActionListener(new CartogramWizardShowURL(\n\t\t\t\"http://chorogram.choros.ch/scapetoad/help/c-transformation-parameters.php\"));\n\t\t\n\t\tthis.add(helpButton);\n\n\n\t\t\n\t\n\t}", "public CircularLayoutComponent() {\n initComponents();\n setOpaque(true);\n setDoubleBuffered(true);\n segmentSizeSpinner.addChangeListener(this);\n targetMarginSpinner.addChangeListener(this);\n sourceMarginSpinner.addChangeListener(this);\n segmentMarginSpinner.addChangeListener(this);\n segmentAngleSpinner.addChangeListener(this);\n }", "public void divisionsChanged(){\r\n voltagePerDivisionLabel.setText(getScienceNumber(VoltagePerDivision) + \"V/Division\");\r\n SecondsPerDivisionLabel.setText(getScienceNumber(secondsPerDivision)+\"S/Div\");\r\n }", "private void initHubTab() {\n\n /** Create the Hiub to manage the master model \"modelHub\"\n */\n this.hub = new BoundedRangeModelHub( this.modelHub );\n\n /** Define the range values of our master model\n */\n this.modelHub.setMinimum(0);\n this.modelHub.setMaximum(5000);\n\n /** Create 3 sub models initially with an arbitrary weight of 10\n * Theses weights are editable by the user\n */\n this.modelHub1 = this.hub.createFragment( 10 );\n this.modelHub2 = this.hub.createFragment( 10 );\n this.modelHub3 = this.hub.createFragment( 10 );\n\n /** Each SubModel's range values are independant and take it directly from theses slider.\n * All models (even the master) are independant and can have theses owns range values\n */\n this.modelHub1.setMinimum( this.jSliderModel1.getMinimum() );\n this.modelHub1.setMaximum( this.jSliderModel1.getMaximum() );\n this.modelHub2.setMinimum( this.jSliderModel2.getMinimum() );\n this.modelHub2.setMaximum( this.jSliderModel2.getMaximum() );\n this.modelHub3.setMinimum( this.jSliderModel3.getMinimum() );\n this.modelHub3.setMaximum( this.jSliderModel3.getMaximum() );\n\n /** Fix some default weight for sub models\n * At this stage of initialisation, listeners are effective on spinners.\n * Theses changes will change sub model weight\n */\n this.jSpinnerModel1.setValue(40);\n this.jSpinnerModel2.setValue(60);\n this.jSpinnerModel3.setValue(20);\n\n /** Set the BusyIcon to the label\n */\n this.jLabelHub.setIcon( iconHub );\n }", "@Override\n\tprotected void UpdateUI() {\n\t\tMaxFlowLevelDisplay(MaxFlowLevel);\n\t}", "@Override\r\n\tpublic void update() {\r\n\t\t// get the first element and set the values according to its\r\n\t\t// information\r\n\t\tIqmDataBox iqmDataBox = (IqmDataBox) this.workPackage.getSources().get(0);\r\n\t\tPlanarImage pi = iqmDataBox.getImage();\r\n\r\n\t\tjFormattedTextFieldOldWidth.setValue(pi.getWidth());\r\n\t\tjFormattedTextFieldOldHeight.setValue(pi.getHeight());\r\n\r\n\t\tint left = ((Number) jSpinnerLeft.getValue()).intValue();\r\n\t\tint right = ((Number) jSpinnerRight.getValue()).intValue();\r\n\t\tint top = ((Number) jSpinnerTop.getValue()).intValue();\r\n\t\tint bottom = ((Number) jSpinnerBottom.getValue()).intValue();\r\n\r\n\t\t// Set image dependent initial values;\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pi.getWidth() + left + right);\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.setValue(pi.getHeight() + top + bottom);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\t\t\r\n\t\tif (buttConst.isSelected()){\r\n\t\t\ttbConst.setTitleColor(Color.BLACK);\r\n\t\t\tjLabelConst.setEnabled(true);\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\ttbConst.setTitleColor(Color.GRAY);\r\n\t\t\tjLabelConst.setEnabled(false);\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\t\tthis.repaint(); //because of tb TitledBorder cahnge of color\r\n\t\t\r\n\r\n\t\tthis.updateParameterBlock();\r\n\t\tthis.setParameterValuesToGUI();\r\n\t}", "@Override\n public void updateUI() {\n setUI(SubstanceRibbonGalleryUI.createUI(this));\n }", "@Override\r\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tsize = (int) spinnerModel.getValue();\r\n\t\t\t\t\tcanvas.repaint();\r\n\t\t\t\t}", "@Override\n public void stateChanged(ChangeEvent e) {\n if (getSliderThreadsPerScan().getValue() == 0) {\n getSliderThreadsPerScan().setValue(1);\n }\n setLabelThreadsPerScanValue(getSliderThreadsPerScan().getValue());\n }", "private void init() {\r\n setForeground(Color.black);\r\n setTitle(\"Evolve Boundary\");\r\n\r\n JPanel scalePanel = new JPanel(new GridLayout(4, 2));\r\n scalePanel.setForeground(Color.black);\r\n scalePanel.setBorder(buildTitledBorder(\"Contour Change\"));\r\n\r\n int[] aiUnits = image.getUnitsOfMeasure();\r\n JLabel labelChangeX = new JLabel(\"Enter size change in \" + FileInfoBase.getUnitsOfMeasureAbbrevStr(aiUnits[0]) + \" units \");\r\n labelChangeX.setForeground(Color.black);\r\n labelChangeX.setFont(serif12);\r\n scalePanel.add(labelChangeX);\r\n\r\n textChangeX = new JTextField();\r\n textChangeX.setText(\"2.0\");\r\n textChangeX.setFont(serif12);\r\n scalePanel.add(textChangeX);\r\n \r\n JLabel labelBoundaryDir = new JLabel(\"Move boundary \"); // make & set a label\r\n labelBoundaryDir.setForeground(Color.black);\r\n labelBoundaryDir.setFont(serif12);\r\n scalePanel.add(labelBoundaryDir); // add kernel label\r\n\r\n boundaryDirBox = new JComboBox();\r\n boundaryDirBox.setFont(serif12);\r\n boundaryDirBox.setBackground(Color.white);\r\n boundaryDirBox.addItem(\"Outward\");\r\n boundaryDirBox.addItem(\"Inward\");\r\n scalePanel.add(boundaryDirBox);\r\n\r\n //JPanel imageVOIPanel = new JPanel(new GridLayout(1, 1));\r\n //imageVOIPanel.setForeground(Color.black);\r\n //imageVOIPanel.setBorder(buildTitledBorder(\"Evolve Boundary\"));\r\n\r\n //ButtonGroup imageVOIGroup = new ButtonGroup();\r\n //singleSlice = new JRadioButton(\"Single slice\", true);\r\n //singleSlice.setFont(serif12);\r\n //imageVOIGroup.add(singleSlice);\r\n //imageVOIPanel.add(singleSlice);\r\n\r\n removeOriginalCheckBox = new JCheckBox(\"Replace Original Contour\");\r\n removeOriginalCheckBox.setFont(serif12);\r\n removeOriginalCheckBox.setForeground(Color.black);\r\n removeOriginalCheckBox.setSelected(false);\r\n scalePanel.add(removeOriginalCheckBox);\r\n\r\n\r\n JPanel mainPanel = new JPanel(new GridBagLayout());\r\n mainPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));\r\n\r\n GridBagConstraints gbc = new GridBagConstraints();\r\n gbc.gridwidth = 1;\r\n gbc.gridheight = 1;\r\n gbc.anchor = GridBagConstraints.WEST;\r\n gbc.weightx = 1;\r\n gbc.insets = new Insets(3, 3, 3, 3);\r\n gbc.gridx = 0;\r\n gbc.gridy = 0;\r\n gbc.fill = GridBagConstraints.HORIZONTAL;\r\n mainPanel.add(scalePanel, gbc);\r\n //gbc.gridy++;\r\n //mainPanel.add(imageVOIPanel, gbc);\r\n\r\n JPanel buttonPanel = new JPanel();\r\n buildOKButton();\r\n buttonPanel.add(OKButton);\r\n buildCancelButton();\r\n buttonPanel.add(cancelButton);\r\n buildHelpButton();\r\n buttonPanel.add(helpButton);\r\n\r\n getContentPane().add(mainPanel, BorderLayout.CENTER);\r\n getContentPane().add(buttonPanel, BorderLayout.SOUTH);\r\n pack();\r\n setVisible(true);\r\n }", "public GUIScaleView(final ControlPanelInterface parent)\n\t{\n\t\tsuper(\"Scale\", \"Modify the scaling\");\n\n\t\tfinal ChangeListener sliderChangeListener = new ChangeListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void stateChanged(final ChangeEvent e)\n\t\t\t{\n\t\t\t\tif (toggleUniformScaling)\n\t\t\t\t{\n\t\t\t\t\tfinal Object source = e.getSource();\n\t\t\t\t\tif (source instanceof JSlider)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal JSlider inputSlider = (JSlider)source;\n\t\t\t\t\t\tfinal int value = inputSlider.getValue();\n\n\t\t\t\t\t\tfor (final GUIBoundedSlider slider : sliders)\n\t\t\t\t\t\t\tslider.write(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tparent.update();\n\t\t\t}\n\t\t};\n\t\tfor (int i = 0; i < sliders.length; ++i)\n\t\t{\n\t\t\tsliders[i] = new GUIBoundedSlider(TITLES[i], 0, 200, 100, sliderChangeListener);\n\t\t\tsliders[i].setFeedbackDesign(1, \"%.0f%%\");\n\t add(sliders[i]);\n\t\t}\n\n\t\tfinal ActionListener checkboxActionListener = new ActionListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(final ActionEvent e)\n\t\t\t{\n\t\t\t\ttoggleUniformScaling = checkboxToggleUniformScaling.isSelected();\n\t\t\t}\n\t\t};\n\t\tcheckboxToggleUniformScaling.addActionListener(checkboxActionListener);\n\t\tadd(checkboxToggleUniformScaling);\n\t}", "public PopulationGrowth() {\n initComponents();\n }", "public SliderAndButtonDemo() {\n \n setBorder(BorderFactory.createEmptyBorder(6,6,6,6));\n\n /* Create the display label, with properties to match the\n values of the sliders and the setting of the combo box. */\n\n displayLabel = new JLabel(\"Hello World!\", JLabel.CENTER);\n displayLabel.setOpaque(true);\n displayLabel.setBackground( new Color(100,100,100) );\n displayLabel.setForeground( Color.RED );\n displayLabel.setFont( new Font(\"Serif\", Font.BOLD, 30) );\n displayLabel.setBorder(BorderFactory.createEmptyBorder(0,8,0,8));\n\n /* Create the sliders, and set up the panel to listen for\n ChangeEvents that are generated by the sliders. */\n\n bgColorSlider = new JSlider(0,255,100);\n bgColorSlider.addChangeListener(this);\n\n fgColorSlider = new JSlider(0,100,0);\n fgColorSlider.addChangeListener(this);\n \n /* Create four buttons to control the font style, and set up the\n panel to listen for ActionEvents from the buttons. */\n \n JButton plainButton = new JButton(\"Plain Font\");\n plainButton.addActionListener(this);\n JButton italicButton = new JButton(\"Italic Font\");\n italicButton.addActionListener(this);\n JButton boldButton = new JButton(\"Bold Font\");\n boldButton.addActionListener(this);\n\n\n /* Set the layout for the panel, and add the four components. \n Use a GridLayout with 3 rows and 2 columns, and with\n 5 pixels between components. */\n\n setLayout(new GridLayout(3,2,5,5));\n add(displayLabel);\n add(plainButton);\n add(bgColorSlider);\n add(italicButton);\n add(fgColorSlider);\n add(boldButton);\n\n }", "public double getStepSizeForSlider() {\n\t\treturn 1;\r\n\t}", "@Override\n public void stateChanged(ChangeEvent _e) {\n if (_e.getSource() instanceof JSlider){\n mView.setFrequencyTxt(((JSlider) _e.getSource()).getValue());\n mComponent.getCMUpdateThread().setInterval(((JSlider) _e.getSource()).getValue());\n if (mComponent.isPlaying())\n \tmComponent.getSimulationPlayer().setInterval(((JSlider) _e.getSource()).getValue());\n }\n }", "public BlendingMonitorPanel() {\n initComponents();\n\t\tif (!java.beans.Beans.isDesignTime()) {\n\t\t\tBlendingMonitorImpl bmi = new BlendingMonitorImpl();\n\t\t\tbmi.setConfigBean(myBlendingMonitorBean);\n\t\t\tmyBlendingMonitorImpl = bmi;\n\t\t}\n }", "void setParameters(){\n highT = 192;\n lowT = 64;\n histImage = null;\n parameters = new JFrame(name);\n panel = new JPanel();\n panelLayout = new GridBagLayout();\n panelCon = new GridBagConstraints();\n histPanel = new JPanel();\n topPanel = new JPanel();\n midPanel = new JPanel();\n bottomPanel = new JPanel();\n\n //Create and add the components to the panels\n lowLabel = new JLabel(\"Low Threshold\");\n lowBox = new JTextField(5);\n lowBox. setText(\"64\");\n lowBox. addActionListener(new ActionListener(){\n public void actionPerformed(ActionEvent evt){\n\ttry{\n\t int val = Integer. valueOf (lowBox. getText()). intValue();\n\t if(val >= 0 && val <= 255){\n\t lowSlider. setValue(val);\n\t }\n\t else{\n\t JOptionPane.showMessageDialog(null,(\"Threshold must lie between 0 and 255\"),\n\t\t\t\t\t (\"Error!\"), JOptionPane.WARNING_MESSAGE); \n\t lowSlider. setValue(64);\n\t lowBox. setText(\"64\");\n\t }\n\t updateThreshold(lowSlider. getValue(), highSlider. getValue()); \n\t}\n\tcatch(NumberFormatException e){\n\t JOptionPane.showMessageDialog(null,(\"Invalid threshold specified\"),\n\t\t\t\t\t(\"Error!\"), JOptionPane.WARNING_MESSAGE); \n\t} \n }\n });\n lowSlider = new JSlider(JSlider.HORIZONTAL, 0, 255, 64);\n lowSlider. setMajorTickSpacing(50);\n lowSlider. setMinorTickSpacing(5);\n lowSlider. setPaintTicks(true);\n lowSlider. setPaintLabels(true);\n lowSlider. addChangeListener(new ChangeListener(){\n public void stateChanged(ChangeEvent evt) {\n //Do the slider change operations\n lowBox. setText(String. valueOf(lowSlider. getValue()));\n updateThreshold(lowSlider. getValue(), highSlider. getValue()); \n }\n });\n topPanel. add(lowLabel);\n topPanel. add(lowBox);\n topPanel. add(lowSlider);\n\n highLabel = new JLabel(\"High Threshold\");\n highBox = new JTextField(5);\n highBox. setText(\"192\");\n highBox. addActionListener(new ActionListener(){\n public void actionPerformed(ActionEvent evt){\n\ttry{\n\t try {\n\t val = Integer. valueOf (highBox. getText()). intValue();\n\t }\n\t \tcatch(NumberFormatException e){\n\t JOptionPane.showMessageDialog(null,(\"Invalid threshold specified\"),(\"Error!\"), JOptionPane.WARNING_MESSAGE);\n\t\t} \n\t if(val >= 0 && val <= 255){\n\t highSlider. setValue(val);\n\t }\n\t else{\n\t JOptionPane.showMessageDialog(null,(\"Threshold must lie between 0 and 255\"),\n\t\t\t\t\t (\"Error!\"), JOptionPane.WARNING_MESSAGE); \n\t highSlider. setValue(192);\n\t highBox. setText(\"192\");\n\t }\n\t updateThreshold(lowSlider. getValue(), highSlider. getValue()); \n\t}\n\tcatch(NumberFormatException e){\n\t JOptionPane.showMessageDialog(null,(\"Invalid threshold specified\"),\n\t\t\t\t\t(\"Error!\"), JOptionPane.WARNING_MESSAGE); \n\t} \n }\n });\n highSlider = new JSlider(JSlider.HORIZONTAL, 0, 255, 192);\n highSlider. setMajorTickSpacing(50);\n highSlider. setMinorTickSpacing(5);\n highSlider. setPaintTicks(true);\n highSlider. setPaintLabels(true);\n highSlider. addChangeListener(new ChangeListener(){\n public void stateChanged(ChangeEvent evt) {\n //Do the slider change operations\n highBox. setText(String. valueOf(highSlider. getValue()));\n updateThreshold(lowSlider. getValue(), highSlider. getValue());\n }\n });\n midPanel. add(highLabel);\n midPanel. add(highBox);\n midPanel. add(highSlider);\n\n applyButton = new JButton(\"Apply\");\n applyButton. addActionListener(new ActionListener(){\n public void actionPerformed(ActionEvent e){\n\tdothresh();\n }\n });\n bottomPanel. add(applyButton);\n\n //Add the panels to the main panel\n panel. setLayout(panelLayout);\n\n panelCon. gridx = 0;\n panelCon. gridy = 0;\n panelLayout. setConstraints(topPanel, panelCon);\n panel. add(topPanel);\n \n panelCon. gridx = 0;\n panelCon. gridy = 1;\n panelLayout. setConstraints(midPanel, panelCon);\n panel. add(midPanel);\n \n panelCon. gridx = 0;\n panelCon. gridy = 2;\n panelLayout. setConstraints(bottomPanel, panelCon);\n panel. add(bottomPanel);\n \n rescaleLabel = new JLabel(\"New maximum for histogram scaling:\");\n rescaleText = new JTextField(6);\n rescaleText. setText(\"-1\");\n rescalePanel = new JPanel();\n //rescalePanel.setLayout(new BorderLayout());\n rescalePanel.add(rescaleLabel);\n rescalePanel.add(rescaleText);\n JButton rescaleButton = new JButton(\"Scale\");\n rescalePanel.add(rescaleButton);\n rescaleButton. addActionListener(new ActionListener(){\n public void actionPerformed(ActionEvent e){\n\tscale();\n }\n });\n\n //Add the main panel\n parameters.getContentPane().add(panel);\n parameters.pack();\n parameters.setVisible(false);\n }", "HorizontalControl () {\n \n barY = 15; //40;\n barHeight = 40; //15;\n \n minX = 40;\n maxX = minX + width/3 - sliderWidth/2;\n \n minZoomValue = texture.width - texture.width;\n maxZoomValue = texture.width; // 300 percent\n valuePerX = (maxZoomValue - minZoomValue) / (maxX - minX);\n \n sliderWidth = 10; //25;\n sliderHeight = 25; //10;\n // sliderY = (barY + (barHeight/2)) - (sliderHeight/2);\n sliderY = (barY - (sliderHeight/2)) + (barHeight/2);\n sliderValue = minZoomValue; \n sliderX = minX; \n }", "public void Build() {\n //Equation input\n JPanel EquationPanel = new JPanel();\n EquationPanel.setLayout(new BoxLayout(EquationPanel, BoxLayout.Y_AXIS));\n JPanel EqButtons = new JPanel();\n JButton Add = new JButton(\"Add\");\n Add.addActionListener(new GraphActionListener(this, null));\n JButton Clear = new JButton(\"Clear\");\n Clear.addActionListener(new GraphActionListener(this, null));\n EqButtons.add(Add);\n EqButtons.add(Clear);\n JPanel CurrentEq = new JPanel();\n CurrentEq.add(new JLabel(\"Display Equation:\"));\n CurrentEq.add(EquationNum);\n EquationNum.addChangeListener(this);\n AddNewGraph();\n EquationPanel.add(EqButtons);\n EquationPanel.add(CurrentEq);\n JPanel p = new JPanel();\n p.add(EquationCardLayout);\n EquationPanel.add(p);\n Controls.addTab(\"Equation\", EquationPanel);\n\n //Range Input\n JPanel RangePanel = new JPanel();\n MinYSpin.setPreferredSize(new Dimension(100, 20));\n MaxYSpin.setPreferredSize(new Dimension(100, 20));\n MinYSpin.setEnabled(false);\n MaxYSpin.setEnabled(false);\n RangePanel.add(new JLabel(\"Range:\"));\n RangePanel.add(ForceRangeBox);\n ForceRangeBox.addActionListener(new GraphActionListener(this, null));\n RangePanel.add(MaxYSpin);\n RangePanel.add(MinYSpin);\n //Domain input\n JPanel DRPanel = new JPanel();\n DRPanel.setLayout(new BoxLayout(DRPanel, BoxLayout.Y_AXIS));\n JPanel DomainPanel = new JPanel();\n MinXSpin.setPreferredSize(new Dimension(100, 20));\n MaxXSpin.setPreferredSize(new Dimension(100, 20));\n DomainPanel.add(new JLabel(\"Domain:\"));\n DomainPanel.add(MinXSpin);\n DomainPanel.add(MaxXSpin);\n DRPanel.add(DomainPanel);\n DRPanel.add(RangePanel);\n Controls.addTab(\"Restrictions\", DRPanel);\n\n\n\n //Zoom input\n JPanel ZoomPanel = new JPanel();\n JButton toDefault = new JButton();\n toDefault.addActionListener(new GraphActionListener(this, null));\n toDefault.setText(\"Defualt Zoom\");\n ZoomPanel.add(ZoomSlider);\n ZoomSlider.addChangeListener(this);\n ZoomPanel.add(toDefault);\n Controls.addTab(\"Zoom\", ZoomPanel);\n\n //colours input\n Controls.addTab(\"Line Colours\", new JPanel());\n Controls.addTab(\"BackGround Colours\", new JPanel());\n\n //Visuals input\n JPanel VisualsPanel = new JPanel();\n VisualsPanel.setLayout(new BoxLayout(VisualsPanel, BoxLayout.Y_AXIS));\n VisualsPanel.add(DrawAreaBox);\n VisualsPanel.add(DrawScaleBox);\n\n //Options input\n JPanel OptionsPanel = new JPanel();\n OptionsPanel.setLayout(new BoxLayout(OptionsPanel, BoxLayout.Y_AXIS));\n JPanel stepPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));\n JLabel la = new JLabel(\"Step:\");\n stepPanel.add(la);\n stepPanel.add(StepSpin);\n stepPanel.add(DrawAreaBox);\n JPanel thicknessPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));\n thicknessPanel.add(new JLabel(\"Curve Thickness\"));\n thicknessPanel.add(CurveThicknessSpin);\n stepPanel.add(thicknessPanel);\n JPanel inc = new JPanel(new FlowLayout(FlowLayout.LEFT));\n la = new JLabel(\"grid lines:\");\n inc.add(la);\n inc.add(IncSpin);\n inc.add(DrawScaleBox);\n DrawScaleBox.setSelected(true);\n OptionsPanel.add(stepPanel);\n OptionsPanel.add(inc);\n Controls.addTab(\"Options\", OptionsPanel);\n\n //instructions\n JPanel instrpanel = new JPanel();\n instrpanel.add(new JLabel(\"<html>Hover over the graph \"\n + \"to get the coordinates at that point\"\n + \"<br>and evaluation of the top most equation for the given x value.\"\n + \"<br> Press Graph to graph the current equation and move it to the top with \"\n + \"<br>all settings. Press Bring To Top to move the graph to the top retaining\"\n + \"<br> it's previous settings\"\n + \"<br>All equations will follow standard BEDMAS rules.\"\n + \"<br><br>Supported functions:\"\n + \"<br> Standard operations, +,-,/,*\"\n + \"<br> Exponents using ^ (2 <sup>x</sup> = 2^x)\"\n + \"<br>fac : takes the factorial of the value ahead (x! = facx)\"\n + \"<br>abs : takes the absolute value\"\n + \"<br>sin, cos, tan : trig functions\"\n + \"<br>log : log base ten of the value\"));\n JScrollPane s = new JScrollPane(instrpanel);\n s.setPreferredSize(new Dimension(EquationPanel.getSize()));\n Controls.addTab(\"Help\", s);\n Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n Frame.setSize(550, 650);\n\n BorderLayout layout = new BorderLayout();\n Frame.setLayout(layout);\n Controls.addChangeListener(this);\n\n Frame.setTitle(\"Graphing Calculator\");\n String imagePath = \"icon.png\";\n InputStream imgStream = MainField.class.getResourceAsStream(imagePath);\n BufferedImage myImg;\n try {\n myImg = ImageIO.read(imgStream);\n Frame.setIconImage(myImg);\n } catch (IOException ex) {\n }\n Frame.add(Controls, BorderLayout.NORTH);\n Frame.add(CanvasWrapper, BorderLayout.CENTER);\n Frame.setVisible(true);\n Frame.validate();\n\n\n }", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t\tJSlider difficultySlider = (JSlider) e.getSource();\n\t\n\t\tint newDifficulty = difficultySlider.getValue();\n\t\tmodel.getLevelTemplate().setProbConst(newDifficulty);\n\t}", "private void configureFields() {\n\t\ttargetDiastolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_DIASTOLIC_LIMIT,UPPER_DIASTOLIC_LIMIT));\n\t\ttargetDiastolic.setEditable(true);\n\t\ttargetSystolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_SYSTOLIC_LIMIT,UPPER_SYSTOLIC_LIMIT));\n\t\ttargetSystolic.setEditable(true);\n\t\tdiastolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(DIASTOLIC_ALARM_LOWER, DIASTOLIC_ALARM_HIGHER));\n\t\tdiastolicAlarm.setEditable(true);\n\t\tsystolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(SYSTOLIC_ALARM_LOWER, SYSTOLIC_ALARM_HIGHER));\n\t\tsystolicAlarm.setEditable(true);\n\t\tSpinnerValueFactory.DoubleSpinnerValueFactory rateFactory=new SpinnerValueFactory.DoubleSpinnerValueFactory(MIN_FLOW_RATE, MAX_FLOW_RATE);\n\t\trateFactory.setAmountToStepBy(0.1);\n\t\tinfusionRate.setValueFactory(rateFactory);\n\t\t\n\t\t/*\n\t\t * We use bindBidirectional here because systolicProperty and diastolicProperty and numbers,\n\t\t * but the text field is a String, and bindBidrectional allows us to specify a converter\n\t\t * to handle the change between the two.\n\t\t */\n\t\tcurrentSystolic.textProperty().bindBidirectional(systolicProperty, new NumberStringConverter());\n\t\tcurrentDiastolic.textProperty().bindBidirectional(diastolicProperty, new NumberStringConverter());\n\t\t\n\t\tcurrentSystolic.setEditable(false);\n\t\tcurrentDiastolic.setEditable(false);\n\t\t\n\n\t\toperatingMode.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {\n\n\t\t\t@Override\n\t\t\tpublic void changed(ObservableValue<? extends Toggle> ov, Toggle oldToggle, Toggle newToggle) {\n\t\t\t\tif(newToggle.equals(openRadio)) {\n\t\t\t\t\tbpVBox.setVisible(false);\n\t\t\t\t\tbpVBox.setManaged(false);\n\t\t\t\t} else {\n\t\t\t\t\tbpVBox.setManaged(true);\n\t\t\t\t\tbpVBox.setVisible(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "public void updateValue(float value) {\n\t\tcurrentValue = value;\n\t\tsliderButton.position = buttonPosition();\n\t}", "public void bind(final Slider slider) {\n\t\t// view for the color\n\t\tthis.addView(new ColorView() {\n\t\t\tSlider that = slider;\n\n\t\t\t@Override\n\t\t\tpublic void update(ColorController controller, Object caller) {\n\t\t\t\tif (!that.equals(caller)) {\n\t\t\t\t\tthat.setValue(controller.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Listener for slider changes\n\t\tslider.valueProperty().addListener(new ChangeListener<Number>() {\n\t\t\tSlider that = slider;\n public void changed(ObservableValue<? extends Number> ov,\n Number old_val, Number new_val) {\n \t\n \tDouble value = that.getValue();\n \tInteger ivalue = value.intValue();\n \tColorController.this.setValue(ivalue, that);\n }\n });\n\t\t\n\t\t\n\t\t// Update the slider to the integer value\n\t\tslider.setValue(getValue());\n\t}", "FloatLabelJSlider(String name) {\n this(name, 0.1f, 0.0f, 1.0f, 0.5f);\n }", "private void renderToolBarCustomizingSection() {\n\t\tfinal SpinnerField spinner = new SpinnerField();\n\n\t\tspinner.setMaxValue(50);\n\t\tspinner.setMinValue(20);\n\t\tspinner.setValue(Constants.TASK_BAR_SIZE);\n\n\t\tspinner.addListener(Events.Change, new Listener<BaseEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handleEvent(BaseEvent be) {\n\t\t\t\tGwosDesktop.getInstance().getTaskBar()\n\t\t\t\t\t\t.setBarSize(spinner.getValue().intValue());\n\t\t\t}\n\t\t});\n\n\t\tspinner.setFieldLabel(\"Task bar size (px)\");\n\n\t\t// 2. Task bar color\n\t\t// TODO\n\n\t\t// Add controls to the panel\n\t\ttoolbarSection.add(spinner);\n\t}", "public void setValue(double value) {\n if(value<=0){\n mDrange = 0;\n pb.setProgress(0);\n ProgressDragLayout.this.requestLayout();\n ProgressDragLayout.this.invalidate();\n return;\n }\n progressAdd = 0;\n mDrange = 0;\n drange_1=0;\n int progress = (int) (value * 100);\n size = progress;\n double drange = (int) (value * viewWidth);\n drange_1 = drange / size;\n Log.e(\"size-------\", size +\"\");\n mhander.sendEmptyMessageDelayed(view_top.hashCode(),20);\n }", "private void modelToView(Handle handle) {\n\n if (handle.isUp()) {\n slider.setValue(1);\n } else {\n slider.setValue(0);\n }\n }", "public ElevatorSlider (Elevator e, int name) {\n elevator = e;\n getInfo ();\n // Create the slider and adjust its properties\n slider = new JSlider (JSlider.VERTICAL, 0, numFloors, 0);\n slider.setMajorTickSpacing (MAJOR_TICK_SPACING);\n slider.setMinorTickSpacing (MINOR_TICK_SPACING);\n slider.setPaintTicks (true);\n slider.setPaintLabels (true);\n // Calculate the dimensions for the sliders\n int width = SLIDER_WIDTH;\n int height = HEIGHT_PER_FLOOR * numFloors;\n int heightResize = 1 + (numFloors / FLOOR_LIMIT);\n height /= heightResize;\n slider.setPreferredSize (new Dimension (width, height));\n \n // Add the slider\n this.add (slider);\n this.update (e, name);\n // Add the label to the panel\n this.add (stateLabel);\n this.add (capLabel);\n this.add (floorLabel);\n // Set the layout\n this.setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));\n \n }", "private void initUI() {\r\n\t\tthis.form = new XdevGridLayout();\r\n\t\tthis.comboBoxState = new XdevComboBox<>();\r\n\t\tthis.lblSbxValidFrom = new XdevLabel();\r\n\t\tthis.dateSbxValidFrom = new XdevPopupDateField();\r\n\t\tthis.lblSbxAgeStartYear = new XdevLabel();\r\n\t\tthis.txtSbxAgeStartYear = new XdevTextField();\r\n\t\tthis.lblSbxCompany = new XdevLabel();\r\n\t\tthis.txtSbxCompany = new XdevTextField();\r\n\t\tthis.lblSbxWorker = new XdevLabel();\r\n\t\tthis.txtSbxWorker = new XdevTextField();\r\n\t\tthis.lblSbxState = new XdevLabel();\r\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\r\n\t\tthis.cmdSave = new XdevButton();\r\n\t\tthis.cmdClose = new XdevButton();\r\n\t\tthis.fieldGroup = new XdevFieldGroup<>(SalaryBvgBaseLine.class);\r\n\t\r\n\t\tthis.lblSbxValidFrom.setValue(\"Gültig ab\");\r\n\t\tthis.dateSbxValidFrom.setTabIndex(2);\r\n\t\tthis.lblSbxAgeStartYear.setValue(\"Alter ab\");\r\n\t\tthis.txtSbxAgeStartYear.setTabIndex(3);\r\n\t\tthis.lblSbxCompany.setValue(\"Arbeitgeber %\");\r\n\t\tthis.txtSbxCompany.setConverter(ConverterBuilder.stringToDouble().build());\r\n\t\tthis.txtSbxCompany.setTabIndex(4);\r\n\t\tthis.lblSbxWorker.setValue(\"Arbeitnehmer %\");\r\n\t\tthis.txtSbxWorker.setConverter(ConverterBuilder.stringToDouble().build());\r\n\t\tthis.txtSbxWorker.setTabIndex(5);\r\n\t\tthis.lblSbxState.setValue(\"Status\");\r\n\t\tthis.horizontalLayout.setMargin(new MarginInfo(false));\r\n\t\tthis.cmdSave.setIcon(FontAwesome.SAVE);\r\n\t\tthis.cmdSave.setCaption(\"Speichern\");\r\n\t\tthis.cmdSave.setTabIndex(8);\r\n\t\tthis.cmdSave.setClickShortcut(ShortcutAction.KeyCode.ENTER);\r\n\t\tthis.cmdClose.setIcon(FontAwesome.CLOSE);\r\n\t\tthis.cmdClose.setCaption(\"Schliessen\");\r\n\t\tthis.cmdClose.setClickShortcut(ShortcutAction.KeyCode.ESCAPE);\r\n\t\tthis.fieldGroup.bind(this.dateSbxValidFrom, SalaryBvgBaseLine_.sbxValidFrom.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxAgeStartYear, SalaryBvgBaseLine_.sbxAgeStartYear.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxCompany, SalaryBvgBaseLine_.sbxCompany.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxWorker, SalaryBvgBaseLine_.sbxWorker.getName());\r\n\t\tthis.fieldGroup.bind(this.comboBoxState, SalaryBvgBaseLine_.sbxState.getName());\r\n\t\r\n\t\tthis.cmdSave.setSizeUndefined();\r\n\t\tthis.horizontalLayout.addComponent(this.cmdSave);\r\n\t\tthis.horizontalLayout.setComponentAlignment(this.cmdSave, Alignment.MIDDLE_LEFT);\r\n\t\tthis.cmdClose.setSizeUndefined();\r\n\t\tthis.horizontalLayout.addComponent(this.cmdClose);\r\n\t\tthis.horizontalLayout.setComponentAlignment(this.cmdClose, Alignment.MIDDLE_LEFT);\r\n\t\tthis.form.setColumns(2);\r\n\t\tthis.form.setRows(7);\r\n\t\tthis.comboBoxState.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.comboBoxState, 1, 4);\r\n\t\tthis.lblSbxValidFrom.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxValidFrom, 0, 0);\r\n\t\tthis.dateSbxValidFrom.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.dateSbxValidFrom, 1, 0);\r\n\t\tthis.lblSbxAgeStartYear.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxAgeStartYear, 0, 1);\r\n\t\tthis.txtSbxAgeStartYear.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxAgeStartYear.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxAgeStartYear, 1, 1);\r\n\t\tthis.lblSbxCompany.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxCompany, 0, 2);\r\n\t\tthis.txtSbxCompany.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxCompany.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxCompany, 1, 2);\r\n\t\tthis.lblSbxWorker.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxWorker, 0, 3);\r\n\t\tthis.txtSbxWorker.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxWorker.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxWorker, 1, 3);\r\n\t\tthis.lblSbxState.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxState, 0, 4);\r\n\t\tthis.horizontalLayout.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.horizontalLayout, 0, 5, 1, 5);\r\n\t\tthis.form.setComponentAlignment(this.horizontalLayout, Alignment.TOP_CENTER);\r\n\t\tthis.form.setColumnExpandRatio(1, 100.0F);\r\n\t\tfinal CustomComponent form_vSpacer = new CustomComponent();\r\n\t\tform_vSpacer.setSizeFull();\r\n\t\tthis.form.addComponent(form_vSpacer, 0, 6, 1, 6);\r\n\t\tthis.form.setRowExpandRatio(6, 1.0F);\r\n\t\tthis.form.setSizeFull();\r\n\t\tthis.setContent(this.form);\r\n\t\tthis.setSizeFull();\r\n\t\r\n\t\tthis.cmdSave.addClickListener(event -> this.cmdSave_buttonClick(event));\r\n\t\tthis.cmdClose.addClickListener(event -> this.cmdClose_buttonClick(event));\r\n\t}", "public HBox simulationControl() {\t\t\r\n\t\t// Setup Slider\r\n\t\tspeedControl.setPrefWidth(800);\r\n\t\tspeedControl.setBlockIncrement(10);\r\n\t\tspeedControl.setMajorTickUnit(10);\r\n\t\tspeedControl.setMinorTickCount(0);\r\n\t\tspeedControl.setSnapToTicks(true);\r\n\t\t\r\n\t\t// Setup HBox\r\n\t\tHBox control = new HBox(); \r\n\t\tcontrol.setAlignment(Pos.CENTER); \r\n\t\t\r\n\t\t// Add Slider To HBox\r\n\t\tcontrol.getChildren().add(speedControl);\r\n\t\t\r\n\t\treturn control;\r\n\t}", "@Override\n\tpublic void tick() {\n\t\trenderer.render(this);\n\t}", "public ImageAdjusterWidget(Picture p) {\n\t\tif (p == null) {\n\t\t\tthrow new IllegalArgumentException(\"Picture p cannot be null\");\n\t\t}\n\n\t\tsetLayout(new BorderLayout());\n\n\t\t// store the original pic and add it to the picture view\n\t\t_original_pic = p;\n\t\t_picture_view = new PictureView(_original_pic.createObservable());\n\t\tadd(_picture_view, BorderLayout.CENTER);\n\n\t\tJPanel j = new JPanel();\n\t\tj.setLayout(new GridLayout(3, 1));\n\n\t\t// the blur label will snap to ticks because integer values are needed\n\t\t// to find the number of pixels around the specified one\n\t\tJPanel a = new JPanel();\n\t\ta.setLayout(new BorderLayout());\n\t\t_blur_label = new JLabel(\"Blur: \");\n\t\t_blur_label.setFont(new Font(\"Serif\", Font.PLAIN, 14));\n\t\ta.add(_blur_label, BorderLayout.WEST);\n\t\t_blur_slider = new JSlider(0, 5);\n\t\t_blur_slider.setPaintTicks(true);\n\t\t_blur_slider.setPaintLabels(true);\n\t\t_blur_slider.setSnapToTicks(true);\n\t\t_blur_slider.setMajorTickSpacing(1);\n\t\t_blur_slider.setValue(0);\n\t\t_blur_slider.addChangeListener(this);\n\t\t// addChangeListener allows for the slider changes to call the method\n\t\t// stateChanged, each slider has the change listener\n\t\ta.add(_blur_slider, BorderLayout.CENTER);\n\n\t\t// The brightness label will span from -100 to 100, with -100 being a\n\t\t// black solid picture and 100 being a white solid picture\n\t\tJPanel b = new JPanel();\n\t\tb.setLayout(new BorderLayout());\n\t\t_brightness_label = new JLabel(\"Brightness: \");\n\t\t_brightness_label.setFont(new Font(\"Serif\", Font.PLAIN, 14));\n\t\tb.add(_brightness_label, BorderLayout.WEST);\n\t\t_brightness_slider = new JSlider(-100, 100);\n\t\t_brightness_slider.setPaintTicks(true);\n\t\t_brightness_slider.setPaintLabels(true);\n\t\t_brightness_slider.setMajorTickSpacing(25);\n\t\t_brightness_slider.setValue(0);\n\t\t_brightness_slider.addChangeListener(this);\n\t\tb.add(_brightness_slider, BorderLayout.CENTER);\n\n\t\t// the saturate slider will increase the intensity of each pixel based\n\t\t// on the major component (green, red, blue) of it\n\t\tJPanel c = new JPanel();\n\t\tc.setLayout(new BorderLayout());\n\t\t_saturation_label = new JLabel(\"Saturation: \");\n\t\t_saturation_label.setFont(new Font(\"Serif\", Font.PLAIN, 14));\n\t\tc.add(_saturation_label, BorderLayout.WEST);\n\t\t_saturation_slider = new JSlider(-100, 100);\n\t\t_saturation_slider.setPaintTicks(true);\n\t\t_saturation_slider.setPaintLabels(true);\n\t\t_saturation_slider.setMajorTickSpacing(25);\n\t\t_saturation_slider.setValue(0);\n\t\t_saturation_slider.addChangeListener(this);\n\t\tc.add(_saturation_slider, BorderLayout.CENTER);\n\n\t\tj.add(a);\n\t\tj.add(c);\n\t\tj.add(b);\n\t\tadd(j, BorderLayout.SOUTH);\n\n\t}", "private void calculateEachDivision(int division) {\n DataController.setCurrentDivisionForWriting(division);\r\n percentageSlid = (division / (float) DIVISIONS_OF_VALUE_SLIDER);\r\n newCurrentValue = minValueNumeric + (percentageSlid * deltaValueNumeric);\r\n dataController.setValueAsFloat(currentSliderKey, newCurrentValue);\r\n CalculatedVariables.crunchCalculation();\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n label = new javax.swing.JLabel();\n cantBrillo = new javax.swing.JSlider();\n ok = new javax.swing.JButton();\n cantidad = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n label.setFont(new java.awt.Font(\"Lucida Grande\", 0, 14)); // NOI18N\n label.setText(\"Selecciona la cantidad de Brillo\");\n\n cantBrillo.setFont(new java.awt.Font(\"Lucida Grande\", 0, 14)); // NOI18N\n cantBrillo.setMaximum(255);\n cantBrillo.setValue(0);\n cantBrillo.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n cantBrilloStateChanged(evt);\n }\n });\n\n ok.setText(\"Aceptar\");\n ok.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n okActionPerformed(evt);\n }\n });\n\n cantidad.setText(\"0\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(103, 103, 103)\n .addComponent(label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(37, 37, 37)\n .addComponent(cantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(cantBrillo, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(49, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(ok)\n .addGap(17, 17, 17))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(cantidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(cantBrillo, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE))\n .addGap(14, 14, 14)\n .addComponent(ok)\n .addContainerGap())\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n stepSlider = new javax.swing.JSlider();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n update = new javax.swing.JButton();\n stepState = new javax.swing.JLabel();\n Caculate = new javax.swing.JButton();\n showConnect = new javax.swing.JCheckBox();\n randLine = new javax.swing.JCheckBox();\n randInfect = new javax.swing.JCheckBox();\n widthSlider = new javax.swing.JSlider();\n heightSlider = new javax.swing.JSlider();\n drawPanel = new DrawPanel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(new javax.swing.border.MatteBorder(null));\n\n stepSlider.setMajorTickSpacing(10);\n stepSlider.setMinorTickSpacing(1);\n stepSlider.setPaintLabels(true);\n stepSlider.setPaintTicks(true);\n stepSlider.setToolTipText(\"Time\");\n stepSlider.setValue(0);\n stepSlider.setAutoscrolls(true);\n stepSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n stepSliderStateChanged(evt);\n }\n });\n\n jLabel1.setText(\"width\");\n\n jLabel2.setText(\"height\");\n\n update.setText(\"Update\");\n update.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n updateMousePressed(evt);\n }\n });\n update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n updateActionPerformed(evt);\n }\n });\n\n Caculate.setText(\"Caculate\");\n Caculate.setToolTipText(\"\");\n Caculate.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n CaculateMousePressed(evt);\n }\n });\n Caculate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CaculateActionPerformed(evt);\n }\n });\n\n showConnect.setText(\"ShowConnectLine\");\n showConnect.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n showConnectStateChanged(evt);\n }\n });\n showConnect.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n showConnectPropertyChange(evt);\n }\n });\n\n randLine.setText(\"Random Line\");\n\n randInfect.setText(\"Random Infected\");\n\n widthSlider.setMajorTickSpacing(10);\n widthSlider.setMinimum(10);\n widthSlider.setMinorTickSpacing(2);\n widthSlider.setPaintTicks(true);\n widthSlider.setToolTipText(\"\");\n widthSlider.setValue(10);\n widthSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n widthSliderStateChanged(evt);\n }\n });\n widthSlider.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n widthSliderPropertyChange(evt);\n }\n });\n\n heightSlider.setMajorTickSpacing(10);\n heightSlider.setMinimum(10);\n heightSlider.setMinorTickSpacing(2);\n heightSlider.setPaintTicks(true);\n heightSlider.setValue(10);\n heightSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n heightSliderStateChanged(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 .addComponent(stepSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(showConnect)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(randLine))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(randInfect)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(14, 14, 14)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(heightSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(stepState, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(update)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(Caculate))))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, 0)\n .addComponent(stepSlider, 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 .addComponent(stepState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(update)\n .addComponent(Caculate))\n .addComponent(heightSlider, javax.swing.GroupLayout.Alignment.TRAILING, 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(showConnect)\n .addComponent(randLine)\n .addComponent(randInfect))\n .addContainerGap())\n );\n\n drawPanel.setBorder(new javax.swing.border.MatteBorder(null));\n drawPanel.setName(\"drawPanel\"); // NOI18N\n drawPanel.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n drawPanelMouseClicked(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n drawPanelMousePressed(evt);\n }\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n drawPanelMouseReleased(evt);\n }\n });\n drawPanel.addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentResized(java.awt.event.ComponentEvent evt) {\n drawPanelComponentResized(evt);\n }\n });\n drawPanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n drawPanelMouseDragged(evt);\n }\n });\n drawPanel.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n drawPanelPropertyChange(evt);\n }\n });\n\n javax.swing.GroupLayout drawPanelLayout = new javax.swing.GroupLayout(drawPanel);\n drawPanel.setLayout(drawPanelLayout);\n drawPanelLayout.setHorizontalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 639, Short.MAX_VALUE)\n );\n drawPanelLayout.setVerticalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 259, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(drawPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(drawPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n\tJSlider createSlider(final FloatControl c) { \r\n if (c == null) \r\n return null; \r\n final JSlider s = new JSlider(0, 1000); \r\n final float min = c.getMinimum(); \r\n final float max = c.getMaximum(); \r\n final float width = max - min; \r\n float fval = c.getValue(); \r\n s.setValue((int) ((fval - min) / width * 1000)); \r\n \r\n java.util.Hashtable labels = new java.util.Hashtable(3); \r\n labels.put(new Integer(0), new JLabel(c.getMinLabel())); \r\n labels.put(new Integer(500), new JLabel(c.getMidLabel())); \r\n labels.put(new Integer(1000), new JLabel(c.getMaxLabel())); \r\n s.setLabelTable(labels); \r\n s.setPaintLabels(true); \r\n \r\n s.setBorder(new TitledBorder(c.getType().toString() + \" \" \r\n + c.getUnits())); \r\n \r\n s.addChangeListener(new ChangeListener() { \r\n public void stateChanged(ChangeEvent e) { \r\n int i = s.getValue(); \r\n float f = min + (i * width / 1000.0f); \r\n c.setValue(f); \r\n } \r\n }); \r\n return s; \r\n }", "@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint perPersonTipPercentage=((JSlider) e.getSource()).getValue();\n\t\t\t\tfloat perPersonNewTip=(((float)perPersonTipPercentage)/100)*(Float.valueOf(TipCalcView.getInstance().totalTip.getText()).floatValue());\n\t\t\n\t\t\t\tDecimalFormat decimalFormat=new DecimalFormat(\"#.##\");\n\t\t\t\tTipTailorView.getInstance().labels[no].setText(String.valueOf(decimalFormat.format(perPersonNewTip)));\n\t\t\t\tTipCalcView.getInstance().perPersonTip.setText(\"Not Applicable\");\n\t\t\t\tTipCalcView.getInstance().perPersonTip.setEditable(false);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Override\n public void render() {\n super.render();\n }", "@Override\n public void render() {\n super.render();\n }", "public void stateChanged(ChangeEvent e)\n {\n slideLabel.setText(\"The speed is \" + speedSlider.getValue());\n }", "private void initSlider() {\n setOrientation(HORIZONTAL);\n }", "protected\tvoid\t\trender(MiRenderer renderer)\n\t\t{\n\t\t// Draw background, valueDisplay and label\n\t\tsuper.render(renderer);\n\n\t\tMiBounds innerBounds = getInnerBounds(tmpBounds);\n\n\t\t// Move Strip over\n\t\trenderer.moveImageArea(innerBounds, scroll.x, scroll.y);\n\t\tscroll.zeroOut();\n\n\t\t// Draw ticks:\n\t\tfor (int i = 0; i < ticksToDrawX.size(); ++i)\n\t\t\t{\n\t\t\tticks.setCenterX(ticksToDrawX.elementAt(i));\n\t\t\tticks.setYmin(innerBounds.ymin);\n\t\t\tticks.setYmax(innerBounds.ymin + ticksToDrawHeight.elementAt(i));\n\t\t\tticks.render(renderer);\n\t\t\t}\n\t\tticksToDrawX.removeAllElements();\n\t\tticksToDrawHeight.removeAllElements();\n\t\t}", "protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }", "public void stateChanged(ChangeEvent event){\n\t\t\t\t\t\t\tlabelLargeur.setText(2*((JSlider)event.getSource()).getValue()-1 + \" cases :\");\n\t\t\t\t\t\t}", "public ThicknessSlider() {\n\t\t// Create a new JSlider with a vertical orientation, minimum value of 1,\n\t\t// maximum value of 20, and start value of defaultThickness\n \t\tsuper(JSlider.VERTICAL, 1, 20, defaultThickness);\n \t\t\n\t\tthis.setMajorTickSpacing(19);\n\t\tthis.setMinorTickSpacing(1);\n\t\tthis.setPaintTicks(true);\n\t\tthis.setPaintLabels(true);\n\t\tthis.setSnapToTicks(true);\n\t\tthis.setToolTipText(\"Change thickness of the brush\");\n\t\tthis.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t}", "public void setBh(Float bh) {\r\n this.bh = bh;\r\n }", "@Override\n public void execute() {\n m_colorSpinner.spinMotor(1.0);\n }", "protected JComponent createEditor() {\n/* 84 */ JComponent editor = super.createEditor();\n/* 85 */ if (editor instanceof JSpinner.DefaultEditor) {\n/* */ \n/* 87 */ JSpinner.DefaultEditor de = (JSpinner.DefaultEditor)editor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 92 */ de.getTextField().setBorder(new EmptyBorder(0, 0, 0, 0));\n/* */ \n/* 94 */ Dimension prefSize = de.getPreferredSize();\n/* 95 */ int compHeight = prefSize.height;\n/* */ \n/* 97 */ int height = LiquidSpinnerButtonUI.getSkin(1).getVsize() + LiquidSpinnerButtonUI.getSkin(5).getVsize();\n/* 98 */ int diff = height - compHeight;\n/* */ \n/* 100 */ if (diff > 0) {\n/* */ \n/* 102 */ int half = diff / 2;\n/* 103 */ de.getTextField().setBorder(new EmptyBorder(half, 0, diff - half, 0));\n/* */ } \n/* */ } \n/* 106 */ return editor;\n/* */ }", "@Override\n public void layoutControls() {\n labelArea.setPrefHeight(100);\n labelArea.setMinHeight(70);\n labelArea.setVgrow(nameLabel, Priority.ALWAYS);\n labelArea.setVgrow(powerLabel, Priority.ALWAYS);\n labelArea.setVgrow(titleLabel, Priority.ALWAYS);\n labelArea.setVgrow(startOfOperationFirstLabel, Priority.ALWAYS);\n\n labelArea.getChildren().addAll(titleLabel, nameLabel, powerLabel, startOfOperationFirstLabel);\n HBox.setHgrow(spacer, Priority.ALWAYS);\n\n\n getChildren().addAll(labelArea, spacer, waterControl);\n\n }" ]
[ "0.7813283", "0.7500392", "0.74079984", "0.57754546", "0.5659731", "0.5554458", "0.5464184", "0.5448314", "0.5398842", "0.5363041", "0.5321663", "0.53177434", "0.53113294", "0.53094125", "0.53082395", "0.52994835", "0.5235362", "0.52122146", "0.52064896", "0.5158338", "0.5156455", "0.5156022", "0.51421666", "0.51324344", "0.51320726", "0.5105521", "0.5074497", "0.50588924", "0.50471425", "0.50455415", "0.5036683", "0.5030421", "0.50223476", "0.50175333", "0.50160915", "0.50151014", "0.49790335", "0.4949327", "0.4945833", "0.49441916", "0.4940562", "0.49380827", "0.49274653", "0.49233177", "0.49214733", "0.4897534", "0.48729378", "0.4864305", "0.4860081", "0.4846822", "0.48341456", "0.48329997", "0.48329905", "0.48322463", "0.48302674", "0.4830143", "0.48274294", "0.4825427", "0.48227996", "0.48226497", "0.48186117", "0.4811444", "0.4805058", "0.48007387", "0.4795019", "0.4793111", "0.47846428", "0.4780504", "0.47804955", "0.4778749", "0.47759286", "0.47712937", "0.47671577", "0.47650406", "0.4760242", "0.474949", "0.4749139", "0.4747922", "0.47420725", "0.47387007", "0.47360727", "0.47354573", "0.4730406", "0.47286215", "0.4728157", "0.47260088", "0.47247335", "0.47241578", "0.47131637", "0.47131637", "0.47070685", "0.47069418", "0.4699738", "0.46927336", "0.4691892", "0.4680311", "0.467242", "0.466652", "0.46642", "0.46618196" ]
0.85692126
0
Renders the slider that controls the inputBranchAngle field
@FXML private void renderBranchAngleSlider() { renderSlider(1, 30, inputBranchAngle, (e) -> { inputBranchAngle = slider.getValue(); renderTree(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n private void renderBranchWitherSlider() {\n renderSlider(0, 1, inputBranchWitherRatio, (e) -> {\n inputBranchWitherRatio = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchGrowthRatioSlider() {\n renderSlider(0.5, 1, inputBranchGrowthRatio, (e) -> {\n inputBranchGrowthRatio = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderTrunkAngleSlider() {\n renderSlider(-180, 0, inputTrunkAngle, (e) -> {\n inputTrunkAngle = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchLengthSlider() {\n renderSlider(1, 100, inputBranchLength, (e) -> {\n inputBranchLength = slider.getValue();\n renderTree();\n });\n }", "@FXML\n void angleSliderEvent() {\n \tint value = (int) angleSlider.getValue();\n \tangleText.setText(Integer.toString(value));\n \tangle = value;\n \tdrawLauncher(value);\n }", "private void renderSlider(double min, double max, double value, EventHandler eventHandler) {\n unmountSlider();\n buildSlider(min, max, value);\n slider.addEventHandler(MouseEvent.MOUSE_RELEASED, eventHandler);\n mountSlider();\n }", "public AngleDisplay() {\n initComponents();\n\n setPreferredSize(new Dimension(size, size));\n }", "public void setAngleField(String value) {\n JsoHelper.setAttribute(jsObj, \"angleField\", value);\n }", "public CircularLayoutComponent() {\n initComponents();\n setOpaque(true);\n setDoubleBuffered(true);\n segmentSizeSpinner.addChangeListener(this);\n targetMarginSpinner.addChangeListener(this);\n sourceMarginSpinner.addChangeListener(this);\n segmentMarginSpinner.addChangeListener(this);\n segmentAngleSpinner.addChangeListener(this);\n }", "public void sliderChange(int r, int g, int b)\n {\n String outPutR;\n String outPutG;\n String outPutB;\n \n //************output to binary()*******//\n if(binaryRBtn.isSelected() == true)\n { \n outPutR = Integer.toBinaryString(r);\n outPutG = Integer.toBinaryString(g);\n outPutB = Integer.toBinaryString(b);\n\n messageRed = (\"\" + outPutR); \n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //********output to hex()************//\n else if(hexDecRBtn.isSelected() == true)\n {\n outPutR = Integer.toHexString(r);\n outPutG = Integer.toHexString(g);\n outPutB = Integer.toHexString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //**********output to Octal()********//\n else if(octalRBtn.isSelected() == true)\n {\n outPutR = Integer.toOctalString(r);\n outPutG = Integer.toOctalString(g);\n outPutB = Integer.toOctalString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //*********output to decimal()********//\n else if(decimalRBtn.isSelected() == true)\n {\n outPutR = Integer.toString(r);\n outPutG = Integer.toString(g);\n outPutB = Integer.toString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n \n //******Bar Display rise and fall()******//\n redHeight=1; \n greenHeight=1; \n blueHeight=1;\n \n redHeight += rSliderValue;\n greenHeight += gSliderValue;\n blueHeight += bSliderValue;\n \n redYvalue = 475;\n redYvalue -=rSliderValue;\n \n greenYvalue = 475;\n greenYvalue -=gSliderValue;\n \n blueYvalue = 475;\n blueYvalue -=bSliderValue;\n \n repaint();\n \n }", "public void draw() {\n\t\tif (fill) {\n\t\t\tapplet.noStroke();\n\t\t\tapplet.fill(color);\n\t\t} else {\n\t\t\tapplet.noFill();\n\t\t\tapplet.stroke(color);\n\t\t}\n\t\tapplet.rect(position.x, position.y, size.x, size.y);\n\t\tsliderButton.draw(new PVector(-10,0));\n\t}", "private void initializeBranchLimitSpinner() {\n SpinnerValueFactory<Integer> valueFactory;\n valueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 20, inputN){\n @Override public void decrement(int steps) {\n final int min = getMin();\n final int currentValue = getValue();\n final int newIndex = currentValue - steps * getAmountToStepBy();\n setValue(Math.max(newIndex, min));\n inputN = newIndex;\n renderTree();\n }\n\n @Override public void increment(int steps) {\n final int max = getMax();\n final int currentValue = getValue();\n final int newIndex = currentValue + steps * getAmountToStepBy();\n setValue(Math.min(newIndex, max));\n inputN = newIndex;\n renderTree();\n }\n };\n branchLimitSpinner.setValueFactory(valueFactory);\n }", "Controls () {\n \n barX = 40;\n barWidth = 15;\n \n minY = 40;\n maxY = minY + height/3 - sliderHeight/2;\n \n minZoomValue = height - height;\n maxZoomValue = height; // 300 percent\n valuePerY = (maxZoomValue - minZoomValue) / (maxY - minY);\n \n sliderWidth = 25;\n sliderHeight = 10;\n sliderX = (barX + (barWidth/2)) - (sliderWidth/2); \n sliderValue = minZoomValue; \n sliderY = minY; \n }", "@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }", "public RangeSlider() {\n initSlider();\n }", "public void displayBankBranch() {\n\t\t if(getBankVisibility()) {\n\t\t\t setRenderBankBranch(true);\n\t\t }else{\n\t\t\tsetRenderBankBranch(false); \n\t\t }\n\t\t \n\t }", "@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint amount = betslider.getValue();\n\t\t\t\tbetAmount.setText(\"$\"+amount);\n\t\t\t}", "@Override\n public void execute() {\n m_colorSpinner.spinMotor(1.0);\n }", "@FXML\n void angleTextEvent(ActionEvent event) {\n \t// Get the current text\n \tString text = angleText.getText();\n \t// Filter out anything that is not related to numbers\n\t\ttext = text.replaceAll(\"[^-\\\\d.]\", \"\");\n\t\tangleText.setText(text);\n\t\tdouble val;\n\t\ttry\n\t\t{\n\t\t\t//Get a number from the textbox and set the angle value.\n\t\t\tval = Double.parseDouble(text);\n\t\t\tif(val < -15)\n\t\t\t\tval = -15;\n\t\t\telse if(val > 15)\n\t\t\t\tval = 15;\n\t\t\tangleSlider.setValue(val);\n\t\t\tangleText.setText(Double.toString(val));\n\t\t\tdrawLauncher(val);\n\t\t\tangle = val;\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{}\n }", "private void initSlider() {\n setOrientation(HORIZONTAL);\n }", "private void iSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_iSliderStateChanged\n float tmp_value = ((float)this.iSlider.getValue())/10;\n this.paramILabel.setText(\"\" + tmp_value);\n }", "public void drawslider()\n{\n controlP5 = new ControlP5(this);\n sliderbutton = controlP5.addSlider(\"time\", 0, 28800, 400, 710, 792, 30).setSliderMode(Slider.FLEXIBLE).setLabel(\"\");\n backwardsbutton =controlP5.addButton(\"backwards\", 0, 1245, 710, 30, 30).setLabel(\"<\");\n forwardsbutton =controlP5.addButton(\"forwards\", 0, 1325, 710, 30, 30).setLabel(\">\");\n playbutton = controlP5.addButton(\"play\", 0, 1280, 710, 40, 30);\n speeddownbutton = controlP5.addButton(\"speeddown\", 0, 1210, 710, 30, 30).setLabel(\"<<\");\n speedupbutton = controlP5.addButton(\"speedup\", 0, 1360, 710, 30, 30).setLabel(\">>\");\n controlP5.getController(\"time\").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE);\n}", "public AltAzController( float altitude, \n float azimuth, \n float min_distance,\n float max_distance,\n float distance )\n {\n setLayout( new GridLayout(3,1) );\n TitledBorder border = new TitledBorder(\n LineBorder.createBlackLineBorder(),\"View Control\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n setBorder( border );\n\n altitude_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n 0 );\n altitude_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Altitude\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n altitude_slider.setBorder( border );\n add( altitude_slider ); \n\n azimuth_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n 0 );\n azimuth_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Azimuth\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n azimuth_slider.setBorder( border );\n add( azimuth_slider ); \n\n distance_slider = new JSlider( JSlider.HORIZONTAL, 1, 20, 10 );\n distance_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Distance\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n distance_slider.setBorder( border );\n add( distance_slider ); \n\n setDistanceRange( min_distance, max_distance );\n setDistance( distance );\n setAltitudeAngle( altitude );\n setAzimuthAngle( azimuth );\n\n setView( true );\n }", "public abstract void updateSlider();", "public void stateChanged(ChangeEvent e) {\n\n (model.getInterpol()).setBezierIterationen(((JSlider) e.getSource()).getValue());\n }", "private JComponent getSlider() {\n\t\t\n\t\t// ----------- slider -----------\n\t\tJSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 400,\n\t\t\t\tDEFAULT_SLIDER_VALUE);\n\t\tslider.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tJSlider source = (JSlider) e.getSource();\n\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\tsliderChanged(e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tslider.setMajorTickSpacing(100);\n\t\tslider.setMinorTickSpacing(30);\n\t\t\n\t\t// ---------- text field ----------\n\t\tselPictures = new JTextField(\"\");\n\t\t \n\t\tJPanel p = new JPanel(new BorderLayout());\n\t\tp.add(selPictures, BorderLayout.CENTER);\n \t\tp.add(slider, BorderLayout.SOUTH);\n\t\t\n\t\treturn p;\n\t}", "@Override\n public void updateUI() {\n setUI(new RangeSliderUI(this));\n // Update UI for slider labels. This must be called after updating the\n // UI of the slider. Refer to JSlider.updateUI().\n updateLabelUIs();\n }", "public void render() {\r\n Color geneColor=null;\r\n\r\n if(isChanged) {\r\n this.removeChild(predRect);\r\n predRect = new PPath();\r\n\r\n if(type == SegmentInfo.TYPE_AUTO) predRect.setPathTo(new RoundRectangle2D.Double(startx,0.0,endx - startx,(double)this.PREDICTION_RECT_HEIGHT, 10, 10));\r\n else if(type == SegmentInfo.TYPE_MANUAL) predRect.setPathTo(new RoundRectangle2D.Double(startx,0.0,endx - startx,(double)this.PREDICTION_RECT_HEIGHT, 0, 0));\r\n\r\n if(this.isSelected()) {\r\n if(this.sign < 0) geneColor = this.SELECTED_DOWN_COLOR;\r\n else geneColor = this.SELECTED_UP_COLOR;\r\n }\r\n else {\r\n if(this.sign < 0) geneColor = this.DOWN_COLOR;\r\n else geneColor = this.UP_COLOR;\r\n }\r\n\r\n predRect.setPaint(geneColor);\r\n this.addChild(predRect);\r\n isChanged=false;\r\n }\r\n }", "protected JComponent createEditor() {\n/* 84 */ JComponent editor = super.createEditor();\n/* 85 */ if (editor instanceof JSpinner.DefaultEditor) {\n/* */ \n/* 87 */ JSpinner.DefaultEditor de = (JSpinner.DefaultEditor)editor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 92 */ de.getTextField().setBorder(new EmptyBorder(0, 0, 0, 0));\n/* */ \n/* 94 */ Dimension prefSize = de.getPreferredSize();\n/* 95 */ int compHeight = prefSize.height;\n/* */ \n/* 97 */ int height = LiquidSpinnerButtonUI.getSkin(1).getVsize() + LiquidSpinnerButtonUI.getSkin(5).getVsize();\n/* 98 */ int diff = height - compHeight;\n/* */ \n/* 100 */ if (diff > 0) {\n/* */ \n/* 102 */ int half = diff / 2;\n/* 103 */ de.getTextField().setBorder(new EmptyBorder(half, 0, diff - half, 0));\n/* */ } \n/* */ } \n/* 106 */ return editor;\n/* */ }", "public void setAngle(float angle){\n\n\t}", "private void dSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_dSliderStateChanged\n float tmp_value = ((float)this.dSlider.getValue())/10;\n this.paramDLabel.setText(\"\" + tmp_value);\n }", "public JComponent getSlidersPanel(){ return slidersPanel; }", "@Override\n public void valueChanged(double control_val) {\n loop_end.setValue((float)control_val);\n // Write your DynamicControl code above this line \n }", "HorizontalControl () {\n \n barY = 15; //40;\n barHeight = 40; //15;\n \n minX = 40;\n maxX = minX + width/3 - sliderWidth/2;\n \n minZoomValue = texture.width - texture.width;\n maxZoomValue = texture.width; // 300 percent\n valuePerX = (maxZoomValue - minZoomValue) / (maxX - minX);\n \n sliderWidth = 10; //25;\n sliderHeight = 25; //10;\n // sliderY = (barY + (barHeight/2)) - (sliderHeight/2);\n sliderY = (barY - (sliderHeight/2)) + (barHeight/2);\n sliderValue = minZoomValue; \n sliderX = minX; \n }", "public ElevatorSlider (Elevator e, int name) {\n elevator = e;\n getInfo ();\n // Create the slider and adjust its properties\n slider = new JSlider (JSlider.VERTICAL, 0, numFloors, 0);\n slider.setMajorTickSpacing (MAJOR_TICK_SPACING);\n slider.setMinorTickSpacing (MINOR_TICK_SPACING);\n slider.setPaintTicks (true);\n slider.setPaintLabels (true);\n // Calculate the dimensions for the sliders\n int width = SLIDER_WIDTH;\n int height = HEIGHT_PER_FLOOR * numFloors;\n int heightResize = 1 + (numFloors / FLOOR_LIMIT);\n height /= heightResize;\n slider.setPreferredSize (new Dimension (width, height));\n \n // Add the slider\n this.add (slider);\n this.update (e, name);\n // Add the label to the panel\n this.add (stateLabel);\n this.add (capLabel);\n this.add (floorLabel);\n // Set the layout\n this.setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));\n \n }", "@Override\n public void stateChanged(ChangeEvent e) {\n if (Controls.getSelectedIndex() == 3) {\n Controls.setComponentAt(3, LineCC);\n Controls.setComponentAt(4, null);\n } else if (Controls.getSelectedIndex() == 4) {\n Controls.setComponentAt(3, null);\n Controls.setComponentAt(4, BackGCC);\n } else {\n Controls.setComponentAt(3, null);\n Controls.setComponentAt(4, null);\n }\n Zoom = ZoomSlider.getValue() / 10f;\n DrawGraphPassive();\n if ((int) EquationNum.getValue() != CurrentEQNum) {\n CurrentEQNum = (int) EquationNum.getValue();\n BackGCC.setColor(lineGraphs.get(CurrentEQNum - 1).getBackColor());\n LineCC.setColor(lineGraphs.get(CurrentEQNum - 1).getLineColour());\n Cards.show(EquationCardLayout, Integer.toString((int) EquationNum.getValue()));\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n slider_slices = new javax.swing.JSlider();\n jLabel2 = new javax.swing.JLabel();\n slider_width = new javax.swing.JSlider();\n jLabel3 = new javax.swing.JLabel();\n slider_height = new javax.swing.JSlider();\n jLabel4 = new javax.swing.JLabel();\n slider_depth = new javax.swing.JSlider();\n check_showBounds = new javax.swing.JCheckBox();\n slider_opacity = new javax.swing.JSlider();\n jLabel5 = new javax.swing.JLabel();\n check_showLightbuffer = new javax.swing.JCheckBox();\n check_multisample = new javax.swing.JCheckBox();\n\n jLabel1.setText(\"Slices\");\n\n slider_slices.setMaximum(700);\n slider_slices.setMinimum(1);\n slider_slices.setValue(5);\n slider_slices.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_slicesStateChanged(evt);\n }\n });\n\n jLabel2.setText(\"Width\");\n\n slider_width.setMaximum(200);\n slider_width.setMinimum(20);\n slider_width.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_widthStateChanged(evt);\n }\n });\n\n jLabel3.setText(\"Height\");\n\n slider_height.setMaximum(200);\n slider_height.setMinimum(20);\n slider_height.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_heightStateChanged(evt);\n }\n });\n\n jLabel4.setText(\"Depth\");\n\n slider_depth.setMaximum(200);\n slider_depth.setMinimum(20);\n slider_depth.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_depthStateChanged(evt);\n }\n });\n\n check_showBounds.setSelected(true);\n check_showBounds.setText(\"Show Bounds\");\n check_showBounds.setToolTipText(\"Draw box around all volume data\");\n check_showBounds.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showBoundsActionPerformed(evt);\n }\n });\n\n slider_opacity.setMajorTickSpacing(1);\n slider_opacity.setMaximum(700);\n slider_opacity.setValue(5);\n slider_opacity.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_opacityStateChanged(evt);\n }\n });\n\n jLabel5.setText(\"Opacity\");\n\n check_showLightbuffer.setSelected(true);\n check_showLightbuffer.setText(\"Show Lightbuffer\");\n check_showLightbuffer.setToolTipText(\"Display lighting calculations onscreen\");\n check_showLightbuffer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showLightbufferActionPerformed(evt);\n }\n });\n\n check_multisample.setText(\"Multisample\");\n check_multisample.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_multisampleActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(slider_depth, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_width, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_height, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(check_showBounds)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_showLightbuffer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_multisample))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_opacity, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_slices, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(slider_width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(slider_height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(slider_depth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(check_showBounds)\n .addComponent(check_showLightbuffer)\n .addComponent(check_multisample))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(slider_slices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(slider_opacity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n }", "protected Control createSpinnerControl(Composite parent) {\r\n \t\tcomposite = new Composite(parent, SWT.NONE);\r\n \t\tGridLayout gridLayout = new GridLayout();\r\n \t\tgridLayout.numColumns = 2;\r\n gridLayout.marginWidth = 0;\r\n gridLayout.marginHeight = 0;\r\n gridLayout.horizontalSpacing = HORIZONTAL_GAP;\r\n \t\tcomposite.setLayout(gridLayout);\r\n \t\tGridData gd;\r\n \t\tgd = new GridData(GridData.FILL_HORIZONTAL);\r\n \t\tcomposite.setLayoutData(gd);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create label\r\n \t\t */\r\n \t\tsliderLabel = new Label(composite,SWT.NONE);\r\n \t\tgd = new GridData(SWT.LEFT);\r\n \t\tsliderLabel.setLayoutData(gd);\r\n \t\tsliderLabel.setText(SLIDER_LABEL_DEFAULT_TEXT);\r\n \t\tPoint size = sliderLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r\n \t\tsliderLabel.setSize(size);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create slider\r\n \t\t */\r\n \t\tslider = new Slider(composite, SWT.HORIZONTAL);\r\n \t\tgd = new GridData(SWT.RIGHT | GridData.FILL_HORIZONTAL);\r\n \t\tslider.setLayoutData(gd);\r\n \t\t\r\n \t\tslider.setMaximum(MAX_SLIDER_VALUE + slider.getThumb());\r\n \t\tslider.setMinimum(MIN_SLIDER_VALUE);\r\n \t\tslider.setIncrement(INCREMENT_SLIDER_VALUE);\r\n \r\n \t\t/*\r\n \t\t * Add listener to handle value change \r\n \t\t */\r\n \t\tselectionListener = new SelectionListener() {\r\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n \t\t\t\tvalueChanged();\r\n \t\t\t}\r\n \r\n \t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n \t\t\t\t// Do nothing\r\n \t\t\t}\r\n \t\t};\r\n \t\tslider.addSelectionListener(selectionListener);\r\n \t\ttry {\r\n \t\t\tintValue = Integer.parseInt(valueProvider.getStringValue(true).toString());\r\n\t\t} catch (Exception e) {\r\n \t\t\tintValue = DEFAULT_SLIDER_VALUE;\r\n \t\t}\r\n \t\t\r\n \t\t/*\r\n \t\t * Initialize slider presentation\r\n \t\t */\r\n \t\tslider.setSelection(intValue);\r\n \t\tString weightsString = \"\" + (intValue /10) + \"%\"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n \t\tslider.setToolTipText(weightsString);\r\n \t\tsliderLabel.setText(weightsString);\r\n \t\t\r\n \t\tslider.pack();\r\n \t\tsliderLabel.pack();\r\n \t\treturn composite;\r\n \t}", "private void control()\r\n\t\t{\n\t\tspinMin.addChangeListener(createMinListener());\r\n\t\tspinMax.addChangeListener(createMaxListener());\r\n\t\t}", "private void setWheelBaseSliderSettings() {\n wheelBaseSlider.setValueFactory(new Callback<JFXSlider, StringBinding>() {\n @Override\n public StringBinding call(JFXSlider arg0) {\n return Bindings.createStringBinding(new java.util.concurrent.Callable<String>(){\n @Override\n public String call() {\n DecimalFormat df = new DecimalFormat(\"#.0\");\n return df.format(wheelBaseSlider.getValue());\n }\n }, wheelBaseSlider.valueProperty());\n }\n });\n }", "private void pSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_pSliderStateChanged\n float tmp_value = ((float)this.pSlider.getValue())/10;\n this.paramPLabel.setText(\"\" + tmp_value);\n }", "public void renderGUI(Container drawArea) {\r\n gui.render(drawArea);\r\n }", "public void updateRenderAngles() {\n }", "private void ffSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ffSliderStateChanged\n float tmp_value = ((float)this.ffSlider.getValue())/10;\n this.paramffLabel.setText(\"\" + tmp_value);\n }", "@DISPID(1000) //= 0x3e8. The runtime will prefer the VTID if present\n @VTID(7)\n void baseVal(\n ms.html.ISVGAngle p);", "@Override\n public void execute() {\n //double sliderValue = -1.0 * m_xbox.getRawAxis(3);\n //sliderValue = (sliderValue /2) + 0.5;\n double joyForward = m_xbox.getRawAxis(Constants.OI.yAxis);\n double joyTurn = m_xbox.getRawAxis(Constants.OI.xAxis);\n // System.out.println(\"Y axis: \" + joyForward);\n // System.out.println(\"X axis: \" + joyTurn);\n if(Math.abs(joyForward) < 0.1 ) {\n joyForward = 0.0;\n }\n if(Math.abs(joyTurn) < 0.1) {\n joyTurn = 0.0;\n }\n m_drivetrain.setArcadeDrive(0.7*joyForward, 0.6 * joyTurn);\n // if(Math.abs(joyForward) < 0.1) {\n // m_drivetrain.setArcadeDrive(sliderValue * joyForward, joyTurn, true);\n // } else {\n // m_drivetrain.setArcadeDrive(sliderValue * joyForward, 0.8 * joyTurn, false);\n // }\n \n // 14 feet, 7 inches\n }", "String updateSliderLabel() {\n if (this.direction.equals(\"H\"))\n return \"Percentage of Width : \";\n if (this.direction.equals(\"V\"))\n return \"Percentage of Height : \";\n return \"/!\\\\ Direction issue! Please relaunch the App /!\\\\\";\n }", "@Override\n\t\t\tpublic void changed(ObservableValue<? extends Toggle> observable, Toggle oldValue, Toggle newValue) {\n\t\t\t\tSystem.out.println(\"distancia selecionada e \" + tg.getSelectedToggle().getUserData().toString());\n\t\t\t\t\n\t\t\t\tangle = Integer.parseInt(tg.getSelectedToggle().getUserData().toString()); \n\t\t\t}", "@Override\n\tpublic void render(int x, int y, float f) {\n\t\tPair<Integer, Integer> adjustedValueCoords = this.getAdjustedXYValue();\n\t\tint grayBoxX = adjustedValueCoords.getKey();\n\t\tint grayBoxY = adjustedValueCoords.getValue();\n\n\t\tthis.Tabs.x = adjustedValueCoords.getKey();\n\t\tthis.Tabs.y = adjustedValueCoords.getValue() - 21;\n\n\t\tthis.renderBackground();\n\n\t\t// Draw the control background.\n\t\tassert this.minecraft != null;\n\t\tthis.minecraft.getTextureManager().bindTexture(backgroundTextures);\n\t\tthis.blit(grayBoxX, grayBoxY, 0, 0, 256, 256);\n\n\t\tfor (Widget button : this.buttons) {\n\t\t\t// Make all buttons invisible.\n\t\t\tif (button != this.btnCancel && button != this.btnBuild) {\n\t\t\t\tbutton.visible = false;\n\t\t\t}\n\t\t}\n\n\t\tthis.btnAddTorches.visible = false;\n\t\tthis.btnAddBed.visible = false;\n\t\tthis.btnAddChest.visible = false;\n\t\tthis.btnAddChestContents.visible = false;\n\t\tthis.btnAddCraftingTable.visible = false;\n\t\tthis.btnAddFurnace.visible = false;\n\t\tthis.btnAddMineShaft.visible = false;\n\n\t\t// Update visibility on controls based on the selected tab.\n\t\tif (this.getSelectedTab() == this.tabGeneral) {\n\t\t\tthis.btnHouseStyle.visible = true;\n\t\t\tthis.btnVisualize.visible = true;\n\t\t} else if (this.getSelectedTab() == this.tabConfig) {\n\t\t\tthis.btnAddTorches.visible = this.serverConfiguration.addTorches;\n\t\t\tthis.btnAddBed.visible = this.serverConfiguration.addBed;\n\t\t\tthis.btnAddChest.visible = this.serverConfiguration.addChests;\n\t\t\tthis.btnAddChestContents.visible = this.allowItemsInChestAndFurnace && this.serverConfiguration.addChestContents;\n\t\t\tthis.btnAddCraftingTable.visible = this.serverConfiguration.addCraftingTable;\n\t\t\tthis.btnAddFurnace.visible = this.serverConfiguration.addFurnace;\n\t\t\tthis.btnAddMineShaft.visible = this.serverConfiguration.addMineshaft;\n\n\t\t} else if (this.getSelectedTab() == this.tabBlockTypes) {\n\t\t\tthis.btnGlassColor.visible = this.houseConfiguration.houseStyle != HouseStyle.SNOWY\n\t\t\t\t\t&& this.houseConfiguration.houseStyle != HouseStyle.DESERT;\n\t\t}\n\n\t\t// Draw the buttons, labels and tabs.\n\t\tsuper.render(x, y, f);\n\n\t\t// Draw the text here.\n\t\tint color = Color.DARK_GRAY.getRGB();\n\n\t\t// Draw the appropriate text based on the selected tab.\n\t\tif (this.getSelectedTab() == this.tabGeneral) {\n\t\t\tthis.minecraft.fontRenderer.drawString(GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_STYLE), grayBoxX + 10, grayBoxY + 10, color);\n\t\t\tthis.minecraft.fontRenderer.drawSplitString(this.houseConfiguration.houseStyle.getHouseNotes(), grayBoxX + 147, grayBoxY + 10, 95, color);\n\n\t\t\tthis.minecraft.getTextureManager().bindTexture(this.houseConfiguration.houseStyle.getHousePicture());\n\t\t\tGuiTabScreen.drawModalRectWithCustomSizedTexture(grayBoxX + 250, grayBoxY, 1,\n\t\t\t\t\tthis.houseConfiguration.houseStyle.getImageWidth(), this.houseConfiguration.houseStyle.getImageHeight(),\n\t\t\t\t\tthis.houseConfiguration.houseStyle.getImageWidth(), this.houseConfiguration.houseStyle.getImageHeight());\n\t\t} else if (this.getSelectedTab() == this.tabBlockTypes) {\n\t\t\tif (this.houseConfiguration.houseStyle == HouseConfiguration.HouseStyle.SNOWY\n\t\t\t\t\t|| this.houseConfiguration.houseStyle == HouseConfiguration.HouseStyle.DESERT) {\n\n\t\t\t} else {\n\t\t\t\t// Column 1:\n\t\t\t\tthis.minecraft.fontRenderer.drawString(GuiLangKeys.translateString(GuiLangKeys.GUI_STRUCTURE_GLASS), grayBoxX + 10, grayBoxY + 10, color);\n\t\t\t}\n\t\t}\n\n\t\tif (!CommonProxy.proxyConfiguration.serverConfiguration.enableStructurePreview) {\n\t\t\tthis.btnVisualize.visible = false;\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n shadePanel1 = new my.boxshader.ShadePanel();\n jPanel1 = new javax.swing.JPanel();\n jSlider1 = new javax.swing.JSlider();\n jTextField1 = new javax.swing.JTextField();\n shadePanel3 = new my.boxshader.ShadePanel();\n\n org.jdesktop.layout.GroupLayout shadePanel1Layout = new org.jdesktop.layout.GroupLayout(shadePanel1);\n shadePanel1.setLayout(shadePanel1Layout);\n shadePanel1Layout.setHorizontalGroup(\n shadePanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 100, Short.MAX_VALUE)\n );\n shadePanel1Layout.setVerticalGroup(\n shadePanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 100, Short.MAX_VALUE)\n );\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 100, 0)));\n\n org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 0, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 43, Short.MAX_VALUE)\n );\n\n jSlider1.setMajorTickSpacing(25);\n jSlider1.setMinorTickSpacing(5);\n jSlider1.setPaintLabels(true);\n jSlider1.setPaintTicks(true);\n jSlider1.setValue(0);\n jSlider1.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSlider1StateChanged(evt);\n }\n });\n\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n org.jdesktop.layout.GroupLayout shadePanel3Layout = new org.jdesktop.layout.GroupLayout(shadePanel3);\n shadePanel3.setLayout(shadePanel3Layout);\n shadePanel3Layout.setHorizontalGroup(\n shadePanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 0, Short.MAX_VALUE)\n );\n shadePanel3Layout.setVerticalGroup(\n shadePanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 124, Short.MAX_VALUE)\n );\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)\n .add(shadePanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()\n .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 83, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(25, 25, 25)\n .add(jSlider1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 259, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(0, 33, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(18, 18, 18)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jSlider1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)\n .add(shadePanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .add(12, 12, 12))\n );\n\n pack();\n }", "@Override\r\n public void paint(Graphics g) {\r\n if (colorWheel == null)\r\n colorWheel = makeColorWheel();\r\n if (valueBar == null) {\r\n valueBar = createImage(valueBarWidth + 3, diameter + 3);\r\n redrawValueBar = true;\r\n }\r\n if (redrawValueBar)\r\n drawValueBar(valueBar);\r\n\r\n // Draw the color wheel and value bar\r\n g.drawImage(colorWheel, offsetX, offsetY, this);\r\n\r\n int x = offsetX + colorWheelWidth + spacing;\r\n ;\r\n int y = offsetY + selectDiameter / 2;\r\n g.drawImage(valueBar, x, y, this);\r\n\r\n // Draw circle around current value in color wheel\r\n g.setColor(Color.black);\r\n g.drawOval(offsetX + colorX, offsetY + colorY,\r\n selectDiameter, selectDiameter);\r\n\r\n // Draw line at current color value\r\n g.setXORMode(Color.yellow);\r\n y += (diameter - diameter * currentHSBColor[2]);\r\n g.drawLine(x + 1, y + 1, x + valueBarWidth - 1, y + 1);\r\n }", "@Override\n\tprotected void setValueOnUi() {\n\n\t}", "void render() {\n\t\tif (!dragLock)\n\t\t\tfucusLocks();\n\n\t\t// display help information\n\t\tString selected = isSelected ? \" [selected]\" : \"\";\n\t\tmyParent.text(id + selected, anchor.x + 10, anchor.y);\n\n\t\t// display points and lines with their colourings\n\t\tfor (int i = 0; i < amount; i++) {\n\n\t\t\tpoint[i].render();\n\n\t\t\tif (state == State.DRAG_AREA)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\n\t\t\tline[i].draw();\n\n\t\t}\n\n\t\t// display rotation ellipse in anchor position\n\t\tif (state == State.ROTATE && isSelected) {\n\t\t\tmyParent.noFill();\n\t\t\tif (!dragLock)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\t\t\telse\n\t\t\t\tmyParent.stroke(0, 255, 0);\n\t\t\tmyParent.ellipse(anchor.x, anchor.y, 15, 15);\n\t\t}\n\n\t\t// display drag area rectangle in anchor position\n\t\tif (state == State.DRAG_AREA) {\n\t\t\tmyParent.noFill();\n\t\t\tif (!dragLock)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\t\t\telse\n\t\t\t\tmyParent.stroke(0, 255, 0);\n\t\t\tmyParent.rect(anchor.x, anchor.y, 15, 15);\n\t\t}\n\n\t\t// display anchor point\n\t\tmyParent.rect(anchor.x, anchor.y, 5, 5);\n\n\t\t// display line centres\n\t\tmyParent.noFill();\n\t\tmyParent.stroke(150);\n\t\tmyParent.rectMode(PConstants.CENTER);\n\t\tmyParent.rect(X.x, X.y, 5, 5);\n\t\tmyParent.rect(Y.x, Y.y, 5, 5);\n\t\tmyParent.rect(Z.x, Z.y, 5, 5);\n\t\tmyParent.rect(Q.x, Q.y, 5, 5);\n\t}", "void addSliders() {\n\t\t\tfinal JTextField impact_r = new JTextField(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\timpact_r.setEditable(false);\n\t\t\t\n\t\t\tJSlider impactR = new JSlider(JSlider.HORIZONTAL, 1, 10, 2);\n\t\t\timpactR.setMinorTickSpacing(1);\n\t\t\t\n\t\t\timpactR.addChangeListener(new ChangeListener() {\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tJSlider source = (JSlider)e.getSource();\n\t\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\t\tConstants.IMPACT_RADIUS = source.getValue() / 10.;\n\t\t\t\t\t\timpact_r.setText(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tHashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();\n\t\t\tlabelTable.put(new Integer(1), new JLabel(\"0.1\"));\n\t\t\tlabelTable.put(new Integer(5), new JLabel(\"0.5\"));\n\t\t\tlabelTable.put(new Integer(10), new JLabel(\"1\"));\n\t\t\timpactR.setLabelTable(labelTable);\n\t\t\timpactR.setPaintTicks(true);\n\t\t\timpactR.setPaintLabels(true);\n\t\t\t\n\t\t\tContainer ir = new Container();\n\t\t\tir.setLayout(new FlowLayout());\n\t\t\tir.add(new JLabel(\"Impact Radius\"));\n\t\t\tir.add(impact_r);\n\t\t\t\n\t\t\tguiFrame.add(ir);\n\t\t\tguiFrame.add(impactR);\n\t\t}", "public void drawAngleIndicator(){\n\t\tfloat bottomLineHyp = 60;\n\t\tfloat topLineHyp = 100;\n\t\t\n\t\tfloat bottomXCoord = (float) ((Math.cos(Math.toRadians(angle) ) ) * bottomLineHyp);\n\t\tfloat bottomYCoord = (float) ((Math.sin(Math.toRadians(angle) ) ) * bottomLineHyp);\n\t\t\n\t\tfloat bottomX = Player.getxPlayerLoc() + ((Player.getPlayerImage().getWidth() * Player.getPlayerScale()) / 2 ) + bottomXCoord;\n\t\tfloat bottomY = Player.getyPlayerLoc() + ((Player.getPlayerImage().getHeight() * Player.getPlayerScale()) / 2 ) + bottomYCoord ;\n\t\t\n\t\tfloat topXCoord = (float) ((Math.cos(Math.toRadians(angle) ) ) * topLineHyp);\n\t\tfloat topYCoord = (float) ((Math.sin(Math.toRadians(angle) ) ) * topLineHyp);\n\t\t\n\t\tfloat topX = Player.getxPlayerLoc() + ((Player.getPlayerImage().getWidth() * Player.getPlayerScale() ) / 2 ) + topXCoord;\n\t\tfloat topY = Player.getyPlayerLoc() + ((Player.getPlayerImage().getHeight() * Player.getPlayerScale() ) / 2 ) + topYCoord;\n\t\t\n\t\tShapeRenderer shape = new ShapeRenderer();\n\t\tshape.setColor(Color.BLACK);\n\t\tshape.begin(ShapeType.Line);\n\t\tshape.line(bottomX, bottomY, topX, topY);\n\t\tshape.end();\n\t}", "private JSlider getZSlider() {\r\n\t\tif (zSlider == null) {\r\n\t\t\tzSlider = new JSlider(1,1);\r\n\t\t\tzSlider.setMajorTickSpacing(100);\r\n\t\t\tzSlider.setPaintLabels(true);\r\n\t\t\tzSlider.addChangeListener(new javax.swing.event.ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(javax.swing.event.ChangeEvent e) {\r\n\t\t\t\t\tsaveUserChangesToROI();\r\n\t\t\t\t\tupdateLabel(-1, -1);\r\n\t\t\t\t\tBufferedImage image = getImage();\r\n\t\t\t\t\tif (image != null){\r\n\t\t\t\t\t\timagePane.setUnderlyingImage(image,/*false,*/allPixelValuesRange);\r\n\t\t\t\t\t}\r\n\t\t\t\t\trefreshROI();\r\n\t\t\t\t\timagePane.repaint();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn zSlider;\r\n\t}", "public JAngle(double angle) {\n GridBagLayout layout = new GridBagLayout();\n GridBagConstraints c = new GridBagConstraints();\n c.anchor = GridBagConstraints.EAST;\n c.fill = GridBagConstraints.BOTH;\n setLayout(layout);\n c.gridy = 0;\n\n JLabel ldeg = null;\n int unit = Coordinates.angleUnit();\n double d;\n switch(unit) {\n case Coordinates.RADIAN:\n deg = new JTextField(12);\n ldeg = new JLabel(\"rad\");\n deg.setText(String.valueOf(Math.round(angle * 10000000000.0) /\n\t\t 10000000000.0));\n break;\n case Coordinates.DEGRE:\n deg = new JTextField(14);\n ldeg = new JLabel(\"aa\");\n deg.setText(String.valueOf(Math.round(180.0 * angle / Math.PI *\n\t\t\t\t\t 10000000000.0) / 10000000000.0));\n break;\n case Coordinates.DEGMN:\n case Coordinates.DEGMNSEC:\n deg = new JTextField(3);\n String sgn = \"\";\n if(angle < 0.0) {\n\tangle = -angle;\n\tsgn = \"-\";\n }\n angle = 180.0 * angle / Math.PI;\n deg.setText(sgn + String.valueOf((int) angle));\n deg.setHorizontalAlignment(JTextField.RIGHT);\n ldeg = new JLabel(\"aa\");\n break;\n }\n c.gridx = 0;\n c.weightx = 0.0;\n\n layout.setConstraints(deg, c);\n add(deg);\n c.gridx = 1;\n c.weightx = 0.0;\n layout.setConstraints(ldeg, c);\n add(ldeg);\n\n if(unit == Coordinates.DEGMN || unit == Coordinates.DEGMNSEC) {\n mn = new JTextField((unit == Coordinates.DEGMN) ? 8 : 2);\n mn.setHorizontalAlignment(JTextField.RIGHT);\n c.gridx = 2;\n c.weightx = 0.0;\n layout.setConstraints(mn, c);\n add(mn);\n JLabel lmn = new JLabel(\"'\");\n c.gridx = 3;\n c.weightx = 0.0;\n layout.setConstraints(lmn, c);\n add(lmn);\n angle -= (int) angle;\n angle *= 60.0;\n \n if(unit == Coordinates.DEGMNSEC) {\n\tmn.setText(String.valueOf((int) angle));\n\tangle -= (int) angle;\n\tangle *= 60.0;\n\tsec = new JTextField((unit == Coordinates.DEGMN) ? 5 : 6);\n\tsec.setHorizontalAlignment(JTextField.RIGHT);\n\tc.gridx = 4;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(sec, c);\n\tadd(sec);\n\tJLabel lsec = new JLabel(\"\\\"\");\n\tc.gridx = 5;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(lsec, c);\n\tadd(lsec);\n\tsec.setText(String.valueOf(Math.round(angle * 10000.0) / 10000.0));\n }\n else {\n\tmn.setText(String.valueOf(Math.round(angle * 1000000.0) / 1000000.0));\n }\n }\n }", "public void initPanel(String attrib, int desired_width){\r\n\r\n slider = new JSlider(JSlider.HORIZONTAL,\r\n min, max, min);\r\n\r\n slider.addChangeListener(new SliderBarActionListener(this,attrib));\r\n\r\n slider.setMajorTickSpacing((max-min)/5);\r\n slider.setPaintTicks(true);\r\n\r\n //Create the label table\r\n Hashtable labelTable = new Hashtable();\r\n labelTable.put( new Integer( min ), new JLabel(\"\"+ min/precision));\r\n labelTable.put( new Integer( max ), new JLabel(\"\" + max/precision));\r\n slider.setLabelTable( labelTable );\r\n\r\n slider.setPaintLabels(true);\r\n\r\n Dimension currentsize = slider.getPreferredSize();\r\n currentsize.width = desired_width;\r\n currentsize.height = (DIM_HEIGHT/12) * 11;\r\n slider.setPreferredSize(currentsize);\r\n\r\n this.setLayout(new GridLayout(2,1));\r\n\r\n this.add(label, BorderLayout.NORTH);\r\n\r\n this.add(slider, BorderLayout.SOUTH);\r\n\r\n this.revalidate();\r\n }", "public void tree(Graphics bbg, int n, int length, int x, int y, double angle){\n double r1 = angle + Math.toRadians(-30);\n double r2 = angle + Math.toRadians(30);\n double r3 = angle + Math.toRadians(0);\n\n //length modifications of the different branches\n double l1 = length/1.3 + (l1I*5);\n double l2 = length/1.3 + (l2I*5);\n double l3 = length/1.3 + (l3I*5);\n\n //x and y points of the end of the different branches\n int ax = (int)(x - Math.sin(r1)*l1)+(int)(l1I);\n int ay = (int)(y - Math.cos(r1)*l1)+(int)(l1I);\n int bx = (int)(x - Math.sin(r2)*l2)+(int)(l2I);\n int by = (int)(y - Math.cos(r2)*l2)+(int)(l2I);\n int cx = (int)(x - Math.sin(r3)*l3)+(int)(l3I);\n int cy = (int)(y - Math.cos(r3)*l3)+(int)(l3I);\n\n if(n == 0){\n return;\n }\n\n\n increment();\n Color fluidC = new Color(colorR,colorG,colorB);\n //bbg.setColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random()*255)));\n bbg.setColor(fluidC);\n\n\n //draw different branches\n bbg.drawLine(x,y,ax,ay);\n bbg.drawLine(x,y,bx,by);\n bbg.drawLine(x,y,cx,cy);\n\n //call recursively to draw fractal\n tree(bbg,n-1,(int)l1, ax,ay,r1);\n tree(bbg, n - 1, (int)l2, bx,by,r2);\n tree(bbg, n - 1, (int)l3, cx,cy,r3);\n\n\n }", "private void configureFields() {\n\t\ttargetDiastolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_DIASTOLIC_LIMIT,UPPER_DIASTOLIC_LIMIT));\n\t\ttargetDiastolic.setEditable(true);\n\t\ttargetSystolic.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(LOWER_SYSTOLIC_LIMIT,UPPER_SYSTOLIC_LIMIT));\n\t\ttargetSystolic.setEditable(true);\n\t\tdiastolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(DIASTOLIC_ALARM_LOWER, DIASTOLIC_ALARM_HIGHER));\n\t\tdiastolicAlarm.setEditable(true);\n\t\tsystolicAlarm.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(SYSTOLIC_ALARM_LOWER, SYSTOLIC_ALARM_HIGHER));\n\t\tsystolicAlarm.setEditable(true);\n\t\tSpinnerValueFactory.DoubleSpinnerValueFactory rateFactory=new SpinnerValueFactory.DoubleSpinnerValueFactory(MIN_FLOW_RATE, MAX_FLOW_RATE);\n\t\trateFactory.setAmountToStepBy(0.1);\n\t\tinfusionRate.setValueFactory(rateFactory);\n\t\t\n\t\t/*\n\t\t * We use bindBidirectional here because systolicProperty and diastolicProperty and numbers,\n\t\t * but the text field is a String, and bindBidrectional allows us to specify a converter\n\t\t * to handle the change between the two.\n\t\t */\n\t\tcurrentSystolic.textProperty().bindBidirectional(systolicProperty, new NumberStringConverter());\n\t\tcurrentDiastolic.textProperty().bindBidirectional(diastolicProperty, new NumberStringConverter());\n\t\t\n\t\tcurrentSystolic.setEditable(false);\n\t\tcurrentDiastolic.setEditable(false);\n\t\t\n\n\t\toperatingMode.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {\n\n\t\t\t@Override\n\t\t\tpublic void changed(ObservableValue<? extends Toggle> ov, Toggle oldToggle, Toggle newToggle) {\n\t\t\t\tif(newToggle.equals(openRadio)) {\n\t\t\t\t\tbpVBox.setVisible(false);\n\t\t\t\t\tbpVBox.setManaged(false);\n\t\t\t\t} else {\n\t\t\t\t\tbpVBox.setManaged(true);\n\t\t\t\t\tbpVBox.setVisible(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "@Override\n public void start(Stage primaryStage) throws Exception{\n Parent root = FXMLLoader.load(getClass().getResource(\"GUI/layout.fxml\"));\n primaryStage.setTitle(\"Flock simulation\");\n primaryStage.setScene(new Scene(root, 1000, 750));\n primaryStage.show();\n\n Pane pane = (Pane) root.lookup(\"#draw_pane\");\n\n /* UI controls */\n\n Slider alignmentSlider = (Slider) root.lookup(\"#alignment_slider\");\n Slider cohesionSlider = (Slider) root.lookup(\"#cohesion_slider\");\n Slider separationSlider = (Slider) root.lookup(\"#separation_slider\");\n Slider maxForceSlider = (Slider) root.lookup(\"#maxforce_slider\");\n Slider maxSpeedSlider = (Slider) root.lookup(\"#maxspeed_slider\");\n Slider boidCountSlider = (Slider) root.lookup(\"#count_slider\");\n Slider alignmentDistanceSlider = (Slider) root.lookup(\"#alignment_distance_slider\");\n Slider cohesionDistanceSlider = (Slider) root.lookup(\"#cohesion_distance_slider\");\n Slider separationDistanceSlider = (Slider) root.lookup(\"#separation_distance_slider\");\n Slider detectionAngleSlider = (Slider) root.lookup(\"#detection_angle_slider\");\n\n TextField alignmentTextfield = (TextField) root.lookup(\"#alignment_field\");\n TextField cohesionTextfield = (TextField) root.lookup(\"#cohesion_field\");\n TextField separationTextfield = (TextField) root.lookup(\"#separation_field\");\n TextField maxForceTextfield = (TextField) root.lookup(\"#maxforce_field\");\n TextField maxSpeedTextfield = (TextField) root.lookup(\"#maxspeed_field\");\n TextField boidCountTextfield = (TextField) root.lookup(\"#count_field\");\n TextField alignmentDistanceTextfield = (TextField) root.lookup(\"#alignment_distance_field\");\n TextField cohesionDistanceTextfield = (TextField) root.lookup(\"#cohesion_distance_field\");\n TextField separationDistanceTextfield = (TextField) root.lookup(\"#separation_distance_field\");\n TextField detectionAngleTextfield = (TextField) root.lookup(\"#detection_angle_field\");\n\n StringProperty alignmentProperty = new SimpleStringProperty(alignmentTextfield.getText());\n StringProperty cohesionProperty = new SimpleStringProperty(cohesionTextfield.getText());\n StringProperty separationProperty = new SimpleStringProperty(separationTextfield.getText());\n StringProperty maxForceProperty = new SimpleStringProperty(maxForceTextfield.getText());\n StringProperty maxSpeedProperty = new SimpleStringProperty(maxSpeedTextfield.getText());\n StringProperty boidCountProperty = new SimpleStringProperty(boidCountTextfield.getText());\n StringProperty alignmentDistanceProperty = new SimpleStringProperty(alignmentDistanceTextfield.getText());\n StringProperty cohesionDistanceProperty = new SimpleStringProperty(cohesionDistanceTextfield.getText());\n StringProperty separationDistanceProperty = new SimpleStringProperty(separationDistanceTextfield.getText());\n StringProperty detectionAngleProperty = new SimpleStringProperty(detectionAngleTextfield.getText());\n\n /* Listeners for UI controls */\n\n alignmentProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, alignmentMultiplierBox, alignmentSlider, alignmentTextfield));\n alignmentSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentProperty, newValue.toString()));\n alignmentTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentProperty, newValue));\n\n cohesionProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, cohesionMultiplierBox, cohesionSlider, cohesionTextfield));\n cohesionSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionProperty, newValue.toString()));\n cohesionTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionProperty, newValue));\n\n separationProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, separationMultiplierBox, separationSlider, separationTextfield));\n separationSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationProperty, newValue.toString()));\n separationTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationProperty, newValue));\n\n maxForceProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, maxForceBox, maxForceSlider, maxForceTextfield));\n maxForceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxForceProperty, newValue.toString()));\n maxForceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxForceProperty, newValue));\n\n maxSpeedProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 10, maxSpeedBox, maxSpeedSlider, maxSpeedTextfield));\n maxSpeedSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxSpeedProperty, newValue.toString()));\n maxSpeedTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxSpeedProperty, newValue));\n\n boidCountProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 10000, entityCountBox, boidCountSlider, boidCountTextfield, 5));\n boidCountSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(boidCountProperty, newValue.intValue()));\n boidCountTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(boidCountProperty, newValue));\n\n alignmentDistanceProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 1000, alignmentDistanceBox, alignmentDistanceSlider, alignmentDistanceTextfield, 4));\n alignmentDistanceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentDistanceProperty, newValue.intValue()));\n alignmentDistanceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentDistanceProperty, newValue));\n\n cohesionDistanceProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 1000, cohesionDistanceBox, cohesionDistanceSlider, cohesionDistanceTextfield, 4));\n cohesionDistanceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionDistanceProperty, newValue.intValue()));\n cohesionDistanceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionDistanceProperty, newValue));\n\n separationDistanceProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 1000, separationDistanceBox, separationDistanceSlider, separationDistanceTextfield, 4));\n separationDistanceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationDistanceProperty, newValue.intValue()));\n separationDistanceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationDistanceProperty, newValue));\n\n detectionAngleProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 360, detectionAngleBox, detectionAngleSlider, detectionAngleTextfield));\n detectionAngleSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(detectionAngleProperty, newValue.toString()));\n detectionAngleTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(detectionAngleProperty, newValue));\n\n // Initiate controls\n boidCountProperty.setValue(entityCountBox.val.toString());\n alignmentProperty.setValue(alignmentMultiplierBox.val.toString());\n cohesionProperty.setValue(cohesionMultiplierBox.val.toString());\n separationProperty.setValue(separationMultiplierBox.val.toString());\n alignmentDistanceProperty.setValue(alignmentDistanceBox.val.toString());\n cohesionDistanceProperty.setValue(cohesionDistanceBox.val.toString());\n separationDistanceProperty.setValue(separationDistanceBox.val.toString());\n maxForceProperty.setValue(maxForceBox.val.toString());\n maxSpeedProperty.setValue(maxSpeedBox.val.toString());\n detectionAngleProperty.setValue(detectionAngleBox.val.toString());\n\n /* Create Boids */\n\n for (int i = 0; i < entityCountBox.val; i++) { createBoid(pane); }\n\n /* Create simulation loop */\n\n Thread updateThread = new Thread(() -> {\n while (true) {\n while (awaitsDrawing) {\n try { Thread.sleep(5); } catch (InterruptedException e) { e.printStackTrace(); }\n }\n updateAccelerations(pane.getWidth(), pane.getHeight());\n awaitsDrawing = true;\n }\n });\n updateThread.setDaemon(true);\n updateThread.start();\n\n new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (!awaitsDrawing) return;\n updateEntityCount(pane);\n for (Entity e : entities) { e.move(pane.getWidth(), pane.getHeight()); }\n awaitsDrawing = false;\n }\n }.start();\n }", "public void stateChanged(ChangeEvent e) {\r\n Object source = e.getSource();\r\n\r\n if (source instanceof JSlider) {\r\n JSlider slider = (JSlider) source;\r\n if (text != null) {\r\n text.setText(\"<html><font color=#FFFFFF>Volume: \"+slider.getValue()+\"</font></html>\");\r\n text.setLocation(getWidth()/2-text.getWidth()/2, text.getY());\r\n revalidate();\r\n repaint();\r\n }\r\n }\r\n }", "public void setBranchValue(entity.PolicyPeriod value);", "public BSlider(Class c, float minimum, float maximum, float value)\r\n {\r\n super();\r\n valueClass = c;\r\n _setMin(minimum);\r\n _setMax(maximum);\r\n _setValue(value);\r\n addChangeListener(new ChangeListener()\r\n {\r\n @Override\r\n public void stateChanged(ChangeEvent e)\r\n {\r\n //Refresh text\r\n repaint();\r\n }\r\n });\r\n }", "@Override\r\n\t\t\tpublic void stateChanged(ChangeEvent e)\r\n\t\t\t\t{\r\n\t\t\t\tint spinMinValue = (int)spinMin.getValue();\r\n\t\t\t\tint spinMaxValue = (int)spinMax.getValue();\r\n\r\n\t\t\t\tif (spinMinValue >= spinMaxValue) { // verify if the min spin goes upper the max limit and adjust the value if necessary\r\n\t\t\t\t\tif (++spinMaxValue > max)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tspinMin.setValue(spinMinValue = (spinMaxValue=max)-1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tspinMax.setValue(spinMaxValue);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (spinMaxValue > spinMinValue) // verify intervals are correct\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdiceBuilder.setInterval(spinMinValue, spinMaxValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@DISPID(1001) //= 0x3e9. The runtime will prefer the VTID if present\n @VTID(9)\n void animVal(\n ms.html.ISVGAngle p);", "@Override\r\n public void paintComponent(Graphics g)\r\n {\n super.paintComponent(g);\r\n g.setColor(getParent().getBackground());\r\n g.fillRect(0, getHeight() / 2, getWidth(), getHeight());\r\n g.setColor(new Color(153, 153, 204));\r\n stringValue = Float.toString(_getValue());\r\n g.drawString(stringValue, getWidth() / 2 - (int) (stringValue.length() * 1.8f), getHeight() / 2 + 10);\r\n }", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tif(!source.getValueIsAdjusting()) {// getValueIsAdjusting 함수는 어떤 이벤트 인스턴스에서 연속적으로 이벤트가 일어 났을 때, \n\t\t\t//해당 이벤트 인스턴스들을 일종의 데이터 체인으로 보고 체인의 마지막 인스턴스 외에서 호출하는 경우 true를 반환하는 함수이다.\n\t\t\t\n\t\t\t\n\t\tint value = (int) slider.getValue();\n\t\timgBtn.setSize(value*10, value*10);// 슬라이더의 상태가 변경되면 호출됨\n\t\t}\n\t}", "public void bind(final Slider slider) {\n\t\t// view for the color\n\t\tthis.addView(new ColorView() {\n\t\t\tSlider that = slider;\n\n\t\t\t@Override\n\t\t\tpublic void update(ColorController controller, Object caller) {\n\t\t\t\tif (!that.equals(caller)) {\n\t\t\t\t\tthat.setValue(controller.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Listener for slider changes\n\t\tslider.valueProperty().addListener(new ChangeListener<Number>() {\n\t\t\tSlider that = slider;\n public void changed(ObservableValue<? extends Number> ov,\n Number old_val, Number new_val) {\n \t\n \tDouble value = that.getValue();\n \tInteger ivalue = value.intValue();\n \tColorController.this.setValue(ivalue, that);\n }\n });\n\t\t\n\t\t\n\t\t// Update the slider to the integer value\n\t\tslider.setValue(getValue());\n\t}", "public void stateChanged(ChangeEvent event) {\n\t\t\t\t\t\t\t\t\tlabelFilons.setText(((JSlider)event.getSource()).getValue() + \" filons :\");\n\t\t\t\t\t\t\t\t}", "@Override\r\n\t\t\tpublic void stateChanged(ChangeEvent e)\r\n\t\t\t\t{\r\n\t\t\t\tint spinMinValue = (int)spinMin.getValue();\r\n\t\t\t\tint spinMaxValue = (int)spinMax.getValue();\r\n\r\n\t\t\t\tif (spinMaxValue <= spinMinValue) { // verify if the max spin goes under the min limit and adjust the value if necessary\r\n\t\t\t\t\tif (--spinMinValue < min)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tspinMax.setValue(spinMaxValue = (spinMinValue=min)+1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tspinMin.setValue(spinMinValue);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (spinMaxValue > spinMinValue) // verify intervals are correct\r\n\t\t\t\t\t{\r\n\t\t\t\t\tdiceBuilder.setInterval(spinMinValue, spinMaxValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "private void modelToView(Handle handle) {\n\n if (handle.isUp()) {\n slider.setValue(1);\n } else {\n slider.setValue(0);\n }\n }", "public SliderAndButtonDemo() {\n \n setBorder(BorderFactory.createEmptyBorder(6,6,6,6));\n\n /* Create the display label, with properties to match the\n values of the sliders and the setting of the combo box. */\n\n displayLabel = new JLabel(\"Hello World!\", JLabel.CENTER);\n displayLabel.setOpaque(true);\n displayLabel.setBackground( new Color(100,100,100) );\n displayLabel.setForeground( Color.RED );\n displayLabel.setFont( new Font(\"Serif\", Font.BOLD, 30) );\n displayLabel.setBorder(BorderFactory.createEmptyBorder(0,8,0,8));\n\n /* Create the sliders, and set up the panel to listen for\n ChangeEvents that are generated by the sliders. */\n\n bgColorSlider = new JSlider(0,255,100);\n bgColorSlider.addChangeListener(this);\n\n fgColorSlider = new JSlider(0,100,0);\n fgColorSlider.addChangeListener(this);\n \n /* Create four buttons to control the font style, and set up the\n panel to listen for ActionEvents from the buttons. */\n \n JButton plainButton = new JButton(\"Plain Font\");\n plainButton.addActionListener(this);\n JButton italicButton = new JButton(\"Italic Font\");\n italicButton.addActionListener(this);\n JButton boldButton = new JButton(\"Bold Font\");\n boldButton.addActionListener(this);\n\n\n /* Set the layout for the panel, and add the four components. \n Use a GridLayout with 3 rows and 2 columns, and with\n 5 pixels between components. */\n\n setLayout(new GridLayout(3,2,5,5));\n add(displayLabel);\n add(plainButton);\n add(bgColorSlider);\n add(italicButton);\n add(fgColorSlider);\n add(boldButton);\n\n }", "@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 stepSlider = new javax.swing.JSlider();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n update = new javax.swing.JButton();\n stepState = new javax.swing.JLabel();\n Caculate = new javax.swing.JButton();\n showConnect = new javax.swing.JCheckBox();\n randLine = new javax.swing.JCheckBox();\n randInfect = new javax.swing.JCheckBox();\n widthSlider = new javax.swing.JSlider();\n heightSlider = new javax.swing.JSlider();\n drawPanel = new DrawPanel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(new javax.swing.border.MatteBorder(null));\n\n stepSlider.setMajorTickSpacing(10);\n stepSlider.setMinorTickSpacing(1);\n stepSlider.setPaintLabels(true);\n stepSlider.setPaintTicks(true);\n stepSlider.setToolTipText(\"Time\");\n stepSlider.setValue(0);\n stepSlider.setAutoscrolls(true);\n stepSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n stepSliderStateChanged(evt);\n }\n });\n\n jLabel1.setText(\"width\");\n\n jLabel2.setText(\"height\");\n\n update.setText(\"Update\");\n update.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n updateMousePressed(evt);\n }\n });\n update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n updateActionPerformed(evt);\n }\n });\n\n Caculate.setText(\"Caculate\");\n Caculate.setToolTipText(\"\");\n Caculate.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n CaculateMousePressed(evt);\n }\n });\n Caculate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CaculateActionPerformed(evt);\n }\n });\n\n showConnect.setText(\"ShowConnectLine\");\n showConnect.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n showConnectStateChanged(evt);\n }\n });\n showConnect.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n showConnectPropertyChange(evt);\n }\n });\n\n randLine.setText(\"Random Line\");\n\n randInfect.setText(\"Random Infected\");\n\n widthSlider.setMajorTickSpacing(10);\n widthSlider.setMinimum(10);\n widthSlider.setMinorTickSpacing(2);\n widthSlider.setPaintTicks(true);\n widthSlider.setToolTipText(\"\");\n widthSlider.setValue(10);\n widthSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n widthSliderStateChanged(evt);\n }\n });\n widthSlider.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n widthSliderPropertyChange(evt);\n }\n });\n\n heightSlider.setMajorTickSpacing(10);\n heightSlider.setMinimum(10);\n heightSlider.setMinorTickSpacing(2);\n heightSlider.setPaintTicks(true);\n heightSlider.setValue(10);\n heightSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n heightSliderStateChanged(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 .addComponent(stepSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(showConnect)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(randLine))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(randInfect)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(14, 14, 14)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(heightSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(stepState, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(update)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(Caculate))))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, 0)\n .addComponent(stepSlider, 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 .addComponent(stepState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(update)\n .addComponent(Caculate))\n .addComponent(heightSlider, javax.swing.GroupLayout.Alignment.TRAILING, 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(showConnect)\n .addComponent(randLine)\n .addComponent(randInfect))\n .addContainerGap())\n );\n\n drawPanel.setBorder(new javax.swing.border.MatteBorder(null));\n drawPanel.setName(\"drawPanel\"); // NOI18N\n drawPanel.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n drawPanelMouseClicked(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n drawPanelMousePressed(evt);\n }\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n drawPanelMouseReleased(evt);\n }\n });\n drawPanel.addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentResized(java.awt.event.ComponentEvent evt) {\n drawPanelComponentResized(evt);\n }\n });\n drawPanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n drawPanelMouseDragged(evt);\n }\n });\n drawPanel.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n drawPanelPropertyChange(evt);\n }\n });\n\n javax.swing.GroupLayout drawPanelLayout = new javax.swing.GroupLayout(drawPanel);\n drawPanel.setLayout(drawPanelLayout);\n drawPanelLayout.setHorizontalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 639, Short.MAX_VALUE)\n );\n drawPanelLayout.setVerticalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 259, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(drawPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(drawPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "@Override\n public void render() {\n DepictedItem item = getContent();\n checkedView.setChecked(item.isSelected());\n depictsLabel.setText(item.getName());\n description.setText(item.getDescription());\n final String imageUrl = item.getImageUrl();\n if (TextUtils.isEmpty(imageUrl)) {\n imageView.setImageURI(UriUtil.getUriForResourceId(R.drawable.ic_wikidata_logo_24dp));\n } else {\n imageView.setImageURI(Uri.parse(imageUrl));\n }\n }", "private void ssSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ssSliderStateChanged\n float tmp_value = ((float)this.ssSlider.getValue())/10;\n this.paramssLabel.setText(\"\" + tmp_value);\n }", "public DefaultValueAxisEditor(ValueAxis axis) {\n/* 125 */ super(axis);\n/* */ \n/* 127 */ this.autoRange = axis.isAutoRange();\n/* 128 */ this.minimumValue = axis.getLowerBound();\n/* 129 */ this.maximumValue = axis.getUpperBound();\n/* 130 */ this.autoTickUnitSelection = axis.isAutoTickUnitSelection();\n/* */ \n/* 132 */ this.gridPaintSample = new PaintSample(Color.blue);\n/* 133 */ this.gridStrokeSample = new StrokeSample(new BasicStroke(1.0F));\n/* */ \n/* 135 */ this.availableStrokeSamples = new StrokeSample[3];\n/* 136 */ this.availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0F));\n/* */ \n/* 138 */ this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0F));\n/* */ \n/* 140 */ this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0F));\n/* */ \n/* */ \n/* 143 */ JTabbedPane other = getOtherTabs();\n/* */ \n/* 145 */ JPanel range = new JPanel(new LCBLayout(3));\n/* 146 */ range.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));\n/* */ \n/* 148 */ range.add(new JPanel());\n/* 149 */ this.autoRangeCheckBox = new JCheckBox(localizationResources.getString(\"Auto-adjust_range\"), this.autoRange);\n/* */ \n/* 151 */ this.autoRangeCheckBox.setActionCommand(\"AutoRangeOnOff\");\n/* 152 */ this.autoRangeCheckBox.addActionListener(this);\n/* 153 */ range.add(this.autoRangeCheckBox);\n/* 154 */ range.add(new JPanel());\n/* */ \n/* 156 */ range.add(new JLabel(localizationResources.getString(\"Minimum_range_value\")));\n/* */ \n/* 158 */ this.minimumRangeValue = new JTextField(Double.toString(this.minimumValue));\n/* */ \n/* 160 */ this.minimumRangeValue.setEnabled(!this.autoRange);\n/* 161 */ this.minimumRangeValue.setActionCommand(\"MinimumRange\");\n/* 162 */ this.minimumRangeValue.addActionListener(this);\n/* 163 */ this.minimumRangeValue.addFocusListener(this);\n/* 164 */ range.add(this.minimumRangeValue);\n/* 165 */ range.add(new JPanel());\n/* */ \n/* 167 */ range.add(new JLabel(localizationResources.getString(\"Maximum_range_value\")));\n/* */ \n/* 169 */ this.maximumRangeValue = new JTextField(Double.toString(this.maximumValue));\n/* */ \n/* 171 */ this.maximumRangeValue.setEnabled(!this.autoRange);\n/* 172 */ this.maximumRangeValue.setActionCommand(\"MaximumRange\");\n/* 173 */ this.maximumRangeValue.addActionListener(this);\n/* 174 */ this.maximumRangeValue.addFocusListener(this);\n/* 175 */ range.add(this.maximumRangeValue);\n/* 176 */ range.add(new JPanel());\n/* */ \n/* 178 */ other.add(localizationResources.getString(\"Range\"), range);\n/* */ \n/* 180 */ other.add(localizationResources.getString(\"TickUnit\"), \n/* 181 */ createTickUnitPanel());\n/* */ }", "private void mountSlider() {\n if (slider != null) {\n sliderPane.getChildren().add(slider);\n }\n }", "public void stateChanged(ChangeEvent evt) {\n if (evt.getSource() == bgColorSlider) {\n int bgVal = bgColorSlider.getValue();\n displayLabel.setBackground( new Color(bgVal,bgVal,bgVal) );\n // NOTE: The background color is a shade of gray,\n // determined by the setting on the slider.\n }\n else {\n float hue = fgColorSlider.getValue()/100.0f;\n displayLabel.setForeground( Color.getHSBColor(hue, 1.0f, 1.0f) );\n // Note: The foreground color ranges through all the colors\n // of the spectrum.\n }\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tif (angle < rightAngle) {\n\t\t\t\t\t\tangle++;\n\t\t\t\t\t\trightAngle = 110;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tangle--;\n\t\t\t\t\t\trightAngle = leftAngle;\n\t\t\t\t\t}\n\t\t\t\t\trepaint();\n\t\t\t\t}", "void setAngle(double angle);", "private void setOnSlide(JFXSlider cogSlider, final JFXTextField cogInput) {\n cogSlider.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n //TODO Round on 1 or more?\n DecimalFormat df = new DecimalFormat(\"#.#\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n cogInput.setText(df.format(newValue));\n }\n });\n }", "@Override\r\n public void onChange(SwitchButton sb, boolean state) {\n Log.d(\"switchButton\", state ? \"锟斤拷\":\"锟斤拷\");\r\n mImgView.setImageBitmap(null);\r\n //defreckle\r\n if(qubanSBtn.isSwitchOn())\r\n mImgView.setImageBitmap(mFaceEditor.BFDefreckleAuto());//));\r\n else\r\n mImgView.setImageBitmap(mFaceEditor.getBaseImage());\r\n }", "@Override\n\tpublic void init() {\n\t\tcolorSpeed = new GenericKnob(0.05f, scale(50), \"Color rotate speed\");\n\t\tbassBounce = new GenericKnob(0.7f, scale(50), \"Bass Bounce\");\n\t\trequestUserControl(colorSpeed);\n\t\trequestUserControl(bassBounce);\n\t\t\n\t\t// Set up a nice jazzy gradient!\n\t\tColor purple = new Color(255, 0, 128);\n\t\tColor nightBlue = new Color(0, 14, 122);\n\t\tgradient = new RGBGradientCompoundLinear(new Color[]{Color.BLUE, purple, nightBlue, Color.BLACK, Color.BLUE}, new double[]{0.0, 0.25, 0.5, 0.75, 1.0});\n\t\t\n\t\t\n\t}", "@Override\n public void render() { super.render(); }", "public void paintComponent(Graphics g)\r\n\t{\r\n\t\t//Sets the size and locations.\r\n\t\tsuper.paintComponent(g);\r\n\t\tsetSize(205,95);\r\n\t\tsetLocation(445,380);\r\n\r\n\t\t//Draws the outer rectangle of the slider.\r\n\t\tg.setColor(Color.black);\r\n\t\tg.drawRect(0, 20, 200, 30);\r\n\r\n\t\t//Draws the button that is moved when controlling the system.\r\n\t\tg.fillRect(border, 22, 25, 25);\r\n\t\tg.setColor(Color.red);\r\n\r\n\t\t//Sets the middle line, indicating the current value.\r\n\t\tg.drawLine((int)getCurrentValue(), 22, (int)getCurrentValue(), 46);\r\n\r\n\t\t//Markers for the inside of the Controller\r\n\t\tg.setColor(Color.GRAY);\r\n\t\tg.drawLine(100, 25, 100, 50); //Med\r\n\r\n\t\tfor (int i = 0; i<20; i++)\r\n\t\t\tg.drawLine(14+i*9, 28, 14+i*9, 42);\r\n\r\n\t\t//Draws the OFF, MED and MAX markers for the controller.\r\n\t\tg.setColor(Color.black);\r\n\t\tg.drawString(\"O\", 10, 65);\r\n\t\tg.drawString(\"F\", 10, 78);\r\n\t\tg.drawString(\"F\", 10, 91);\r\n\t\tg.drawString(\"M\", 96, 65);\r\n\t\tg.drawString(\"E\", 96, 78);\r\n\t\tg.drawString(\"D\", 96, 91);\r\n\t\tg.drawString(\"M\", 181, 65);\r\n\t\tg.drawString(\"A\", 181, 78);\r\n\t\tg.drawString(\"X\", 181, 91);\r\n\r\n\t\tg.drawString(\"System Controller\", 50, 15);\r\n\r\n\t}", "public Onview() {\r\n initComponents();\r\n loadDisplayScreen();\r\n jcbX_Axis.setModel(new DefaultComboBoxModel(new String[]{}));\r\n jcbX_Axis.setEnabled(false);\r\n jcbY_Axis.setModel(new DefaultComboBoxModel(new String[]{}));\r\n jcbY_Axis.setEnabled(false);\r\n setResizable(false);\r\n }", "@Override\r\n public void onAction(String name, boolean isPressed, float tpf)\r\n {\n slideLabel.setText(String.format(\"Value : %1.2f\", slider.getValues()[0]));\r\n }", "@Override\r\n\tpublic void setParameterValuesToGUI() {\r\n\t\tthis.pb = this.workPackage.getParameters();\r\n\r\n\t\tjSpinnerLeft.removeChangeListener(this);\r\n\t\tjSpinnerRight.removeChangeListener(this);\r\n\t\tjSpinnerTop.removeChangeListener(this);\r\n\t\tjSpinnerBottom.removeChangeListener(this);\r\n\t\tjSpinnerConst.removeChangeListener(this);\r\n\r\n\t\tjSpinnerLeft.setValue(pb.getIntParameter(\"Left\"));\r\n\t\tjSpinnerRight.setValue(pb.getIntParameter(\"Right\"));\r\n\t\tjSpinnerTop.setValue(pb.getIntParameter(\"Top\"));\r\n\t\tjSpinnerBottom.setValue(pb.getIntParameter(\"Bottom\"));\r\n\t\tjSpinnerConst.setValue(pb.getIntParameter(\"Const\"));\r\n\r\n\t\tjSpinnerLeft.addChangeListener(this);\r\n\t\tjSpinnerRight.addChangeListener(this);\r\n\t\tjSpinnerTop.addChangeListener(this);\r\n\t\tjSpinnerBottom.addChangeListener(this);\r\n\t\tjSpinnerConst.addChangeListener(this);\r\n\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pb.getIntParameter(\"NewWidth\"));\r\n\t\tjSpinnerNewHeight.setValue(pb.getIntParameter(\"NewHeight\"));\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.ZERO) buttZero.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.CONSTANT) buttConst.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.COPY) buttCopy.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.REFLECT) buttReflect.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.WRAP) buttWrap.setSelected(true);\r\n\r\n\t\tif (buttConst.isSelected()) {\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_BORDER) buttBorder.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_SIZE) buttSize.setSelected(true);\r\n\r\n\t}", "@Override\n public void onValueChanged(int i) {\n mTextViewDistance.setText(i + \" M\");\n // Delete old circle and draw the new circle with the radius given\n drawCircle(i);\n // Update the global variable RADIUS with the new value\n RADIUS = i;\n }", "@Override\n\tpublic void render () {\n\n\t}", "protected\tvoid\t\trender(MiRenderer renderer)\n\t\t{\n\t\t// Draw background, valueDisplay and label\n\t\tsuper.render(renderer);\n\n\t\tMiBounds innerBounds = getInnerBounds(tmpBounds);\n\n\t\t// Move Strip over\n\t\trenderer.moveImageArea(innerBounds, scroll.x, scroll.y);\n\t\tscroll.zeroOut();\n\n\t\t// Draw ticks:\n\t\tfor (int i = 0; i < ticksToDrawX.size(); ++i)\n\t\t\t{\n\t\t\tticks.setCenterX(ticksToDrawX.elementAt(i));\n\t\t\tticks.setYmin(innerBounds.ymin);\n\t\t\tticks.setYmax(innerBounds.ymin + ticksToDrawHeight.elementAt(i));\n\t\t\tticks.render(renderer);\n\t\t\t}\n\t\tticksToDrawX.removeAllElements();\n\t\tticksToDrawHeight.removeAllElements();\n\t\t}", "private synchronized void updateNumberFormat()\n\t{\n\n\t\tfinal int sw = rangeSlider.getWidth();\n\t\tif ( sw > 0 )\n\t\t{\n\t\t\tfinal double vrange = range.getMaxBound() - range.getMinBound();\n\t\t\tfinal int digits = ( int ) Math.ceil( Math.log10( sw / vrange ) );\n\n\t\t\tblockUpdates = true;\n\n\t\t\tJSpinner.NumberEditor numberEditor = ( ( JSpinner.NumberEditor ) minSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( minSpinner ) );\n\n\t\t\tnumberEditor = ( ( JSpinner.NumberEditor ) maxSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( maxSpinner ) );\n\n\t\t\tblockUpdates = false;\n\t\t}\n\t}", "@Override\n protected void execute() {\n double leftJogAmount = -Robot.oi.copilot.getTriggerAxis(Hand.kLeft);\n double rightJogAmount = Robot.oi.copilot.getTriggerAxis(Hand.kRight);\n\n if(leftJogAmount < .05 && rightJogAmount > leftJogAmount){\n //Robot.colorSensor.spinWheel(rightJogAmount);\n }\n if(rightJogAmount < .05 && leftJogAmount > rightJogAmount){\n //Robot.colorSensor.spinWheel(leftJogAmount);\n }\n\n }", "@Override\n public void render() {\n super.render();\n }", "@Override\n public void render() {\n super.render();\n }", "public void setAngle(final float angle);", "@Override\r\n\tpublic void render() {\n\t\t\r\n\t}", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n if (bdhcHandler != null) {\n int[] slopes = bdhcHandler.getSelectedPlate().getSlope();\n float angle = (float) Math.atan2(slopes[indexSlope1], slopes[indexSlope2]);\n\n Graphics2D g2 = (Graphics2D) g;\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n RenderingHints.VALUE_ANTIALIAS_ON);\n\n g.setColor(Color.magenta);\n final int angleRadius = (radius * 2) / 3;\n final int angleOffset = size / 2 - angleRadius;\n g2.setStroke(new BasicStroke(2));\n g.drawArc(angleOffset, angleOffset, 2 * angleRadius, 2 * angleRadius, 0, (int) (-(angle * 180) / Math.PI));\n\n g2.setStroke(new BasicStroke(2));\n if (frontView) {\n g.setColor(Color.red);\n g.drawLine(size / 2, size / 2, size, size / 2);\n g.setColor(Color.blue);\n g.drawLine(size / 2, size / 2, size / 2, 0);\n } else {\n g.setColor(Color.green);\n //g.drawLine(size / 2, size / 2, size, size / 2);\n g.drawLine(size / 2, size / 2, size, size / 2);\n g.setColor(Color.blue);\n g.drawLine(size / 2, size / 2, size / 2, 0);\n }\n\n int circleOffset = size / 2 - radius;\n g.setColor(Color.black);\n g2.setStroke(new BasicStroke(1));\n g.drawOval(circleOffset, circleOffset, radius * 2, radius * 2);\n\n int x = (int) (Math.cos(angle) * radius);\n int y = (int) (Math.sin(angle) * radius);\n int lineOffset = size / 2;\n g.setColor(Color.orange);\n g2.setStroke(new BasicStroke(3));\n g.drawLine(lineOffset - x, lineOffset - y, lineOffset + x, lineOffset + y);\n\n }\n\n }", "@FXML \n\tprivate void handleQuadradoButtonCH0() throws Exception {\n\t\tif(quadradoButtonCH0.isSelected()){\n\t\t\t//System.out.println(\"quadrado seleteed\");\n\t\t\tdutyFieldCH0.setDisable(false);\n\t\t\tdutyLabelCH0.setText(\"Duty\");\n\t\t\tdutyUnitLabelCH0.setText(\"%\");\n\t\t\tchartDrawer.drawQua();\n\t\t}\n\t\telse{\n\t\t\t//clear the chart\n\t\t\tdutyFieldCH0.setDisable(true);\n\t\t\tchartDrawer.clear();\n\t\t}\n\t}" ]
[ "0.7263239", "0.7179494", "0.71741235", "0.708682", "0.60620487", "0.5465874", "0.536721", "0.53148764", "0.5262232", "0.5258807", "0.51618713", "0.514601", "0.51015097", "0.50655574", "0.50556266", "0.5054633", "0.50312597", "0.50077367", "0.49805763", "0.4978545", "0.49699628", "0.49440816", "0.49422374", "0.49351445", "0.48884597", "0.48652864", "0.48559076", "0.48177707", "0.47870117", "0.47654435", "0.47455803", "0.47240648", "0.47178766", "0.47013482", "0.46913278", "0.46847823", "0.4672523", "0.46581456", "0.46557918", "0.46495685", "0.4632962", "0.46299356", "0.46282503", "0.46188858", "0.46146464", "0.46079296", "0.4597044", "0.4591609", "0.4583318", "0.45786682", "0.45685524", "0.45685163", "0.45647156", "0.45581225", "0.4552409", "0.4552247", "0.4551703", "0.45424744", "0.4539297", "0.45391127", "0.45338577", "0.45333087", "0.45313427", "0.45294526", "0.4526826", "0.4524936", "0.45123333", "0.45122072", "0.45088458", "0.45073822", "0.45037657", "0.45013344", "0.44980833", "0.44922313", "0.44878525", "0.44843653", "0.44811127", "0.44801408", "0.4470837", "0.44651797", "0.44621545", "0.44586837", "0.44491062", "0.4447367", "0.4445219", "0.44449964", "0.4443444", "0.44431177", "0.44419247", "0.4439831", "0.4438922", "0.44384703", "0.44231844", "0.4421639", "0.44193125", "0.44193125", "0.44174838", "0.44129747", "0.44007787", "0.43993294" ]
0.84581774
0
Renders the slider that controls the inputTrunkAngle field
@FXML private void renderTrunkAngleSlider() { renderSlider(-180, 0, inputTrunkAngle, (e) -> { inputTrunkAngle = slider.getValue(); renderTree(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n private void renderBranchAngleSlider() {\n renderSlider(1, 30, inputBranchAngle, (e) -> {\n inputBranchAngle = slider.getValue();\n renderTree();\n });\n }", "@FXML\n void angleSliderEvent() {\n \tint value = (int) angleSlider.getValue();\n \tangleText.setText(Integer.toString(value));\n \tangle = value;\n \tdrawLauncher(value);\n }", "@FXML\n private void renderBranchWitherSlider() {\n renderSlider(0, 1, inputBranchWitherRatio, (e) -> {\n inputBranchWitherRatio = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchLengthSlider() {\n renderSlider(1, 100, inputBranchLength, (e) -> {\n inputBranchLength = slider.getValue();\n renderTree();\n });\n }", "public void drawslider()\n{\n controlP5 = new ControlP5(this);\n sliderbutton = controlP5.addSlider(\"time\", 0, 28800, 400, 710, 792, 30).setSliderMode(Slider.FLEXIBLE).setLabel(\"\");\n backwardsbutton =controlP5.addButton(\"backwards\", 0, 1245, 710, 30, 30).setLabel(\"<\");\n forwardsbutton =controlP5.addButton(\"forwards\", 0, 1325, 710, 30, 30).setLabel(\">\");\n playbutton = controlP5.addButton(\"play\", 0, 1280, 710, 40, 30);\n speeddownbutton = controlP5.addButton(\"speeddown\", 0, 1210, 710, 30, 30).setLabel(\"<<\");\n speedupbutton = controlP5.addButton(\"speedup\", 0, 1360, 710, 30, 30).setLabel(\">>\");\n controlP5.getController(\"time\").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE);\n}", "@FXML\n void angleTextEvent(ActionEvent event) {\n \t// Get the current text\n \tString text = angleText.getText();\n \t// Filter out anything that is not related to numbers\n\t\ttext = text.replaceAll(\"[^-\\\\d.]\", \"\");\n\t\tangleText.setText(text);\n\t\tdouble val;\n\t\ttry\n\t\t{\n\t\t\t//Get a number from the textbox and set the angle value.\n\t\t\tval = Double.parseDouble(text);\n\t\t\tif(val < -15)\n\t\t\t\tval = -15;\n\t\t\telse if(val > 15)\n\t\t\t\tval = 15;\n\t\t\tangleSlider.setValue(val);\n\t\t\tangleText.setText(Double.toString(val));\n\t\t\tdrawLauncher(val);\n\t\t\tangle = val;\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{}\n }", "private void initSlider() {\n setOrientation(HORIZONTAL);\n }", "@FXML\n private void renderBranchGrowthRatioSlider() {\n renderSlider(0.5, 1, inputBranchGrowthRatio, (e) -> {\n inputBranchGrowthRatio = slider.getValue();\n renderTree();\n });\n }", "private void renderSlider(double min, double max, double value, EventHandler eventHandler) {\n unmountSlider();\n buildSlider(min, max, value);\n slider.addEventHandler(MouseEvent.MOUSE_RELEASED, eventHandler);\n mountSlider();\n }", "@FXML\n void windSliderEvent() {\n \t\n \tint value = (int) windSlider.getValue();\n \twindText.setText(Integer.toString(value));\n \twindSpeed = value;\n }", "void addSliders() {\n\t\t\tfinal JTextField impact_r = new JTextField(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\timpact_r.setEditable(false);\n\t\t\t\n\t\t\tJSlider impactR = new JSlider(JSlider.HORIZONTAL, 1, 10, 2);\n\t\t\timpactR.setMinorTickSpacing(1);\n\t\t\t\n\t\t\timpactR.addChangeListener(new ChangeListener() {\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tJSlider source = (JSlider)e.getSource();\n\t\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\t\tConstants.IMPACT_RADIUS = source.getValue() / 10.;\n\t\t\t\t\t\timpact_r.setText(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tHashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();\n\t\t\tlabelTable.put(new Integer(1), new JLabel(\"0.1\"));\n\t\t\tlabelTable.put(new Integer(5), new JLabel(\"0.5\"));\n\t\t\tlabelTable.put(new Integer(10), new JLabel(\"1\"));\n\t\t\timpactR.setLabelTable(labelTable);\n\t\t\timpactR.setPaintTicks(true);\n\t\t\timpactR.setPaintLabels(true);\n\t\t\t\n\t\t\tContainer ir = new Container();\n\t\t\tir.setLayout(new FlowLayout());\n\t\t\tir.add(new JLabel(\"Impact Radius\"));\n\t\t\tir.add(impact_r);\n\t\t\t\n\t\t\tguiFrame.add(ir);\n\t\t\tguiFrame.add(impactR);\n\t\t}", "public AltAzController( float altitude, \n float azimuth, \n float min_distance,\n float max_distance,\n float distance )\n {\n setLayout( new GridLayout(3,1) );\n TitledBorder border = new TitledBorder(\n LineBorder.createBlackLineBorder(),\"View Control\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n setBorder( border );\n\n altitude_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n 0 );\n altitude_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Altitude\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n altitude_slider.setBorder( border );\n add( altitude_slider ); \n\n azimuth_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n 0 );\n azimuth_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Azimuth\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n azimuth_slider.setBorder( border );\n add( azimuth_slider ); \n\n distance_slider = new JSlider( JSlider.HORIZONTAL, 1, 20, 10 );\n distance_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Distance\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n distance_slider.setBorder( border );\n add( distance_slider ); \n\n setDistanceRange( min_distance, max_distance );\n setDistance( distance );\n setAltitudeAngle( altitude );\n setAzimuthAngle( azimuth );\n\n setView( true );\n }", "public AngleDisplay() {\n initComponents();\n\n setPreferredSize(new Dimension(size, size));\n }", "private JComponent getSlider() {\n\t\t\n\t\t// ----------- slider -----------\n\t\tJSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 400,\n\t\t\t\tDEFAULT_SLIDER_VALUE);\n\t\tslider.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tJSlider source = (JSlider) e.getSource();\n\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\tsliderChanged(e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tslider.setMajorTickSpacing(100);\n\t\tslider.setMinorTickSpacing(30);\n\t\t\n\t\t// ---------- text field ----------\n\t\tselPictures = new JTextField(\"\");\n\t\t \n\t\tJPanel p = new JPanel(new BorderLayout());\n\t\tp.add(selPictures, BorderLayout.CENTER);\n \t\tp.add(slider, BorderLayout.SOUTH);\n\t\t\n\t\treturn p;\n\t}", "public SittingComponentProperties() {\n initComponents();\n //Translation spinners configuration\n Float value = new Float(0);\n Float min = new Float(Float.NEGATIVE_INFINITY);\n Float max = new Float(Float.POSITIVE_INFINITY);\n Float step = new Float(0.1);\n SpinnerNumberModel xTranslationModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel yTranslationModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel zTranslationModel = new SpinnerNumberModel(value, min, max, step);\n sittingTranslationXTF.setModel(xTranslationModel);\n sittingTranslationYTF.setModel(yTranslationModel);\n sittingTranslationZTF.setModel(zTranslationModel);\n sittingTranslationXTF.setEditor(\n new JSpinner.NumberEditor(sittingTranslationXTF, \"########0.00\"));\n sittingTranslationYTF.setEditor(\n new JSpinner.NumberEditor(sittingTranslationYTF, \"########0.00\"));\n sittingTranslationZTF.setEditor(\n new JSpinner.NumberEditor(sittingTranslationZTF, \"########0.00\"));\n\n //Rotation spinners configuration\n value = new Float(0);\n min = new Float(-360);\n max = new Float(360);\n step = new Float(1);\n SpinnerNumberModel xRotationModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel yRotationModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel zRotationModel = new SpinnerNumberModel(value, min, max, step);\n sittingRotationXTF.setModel(xRotationModel);\n sittingRotationYTF.setModel(yRotationModel);\n sittingRotationZTF.setModel(zRotationModel);\n sittingRotationXTF.setEditor(\n new JSpinner.NumberEditor(sittingRotationXTF, \"########0.00\"));\n sittingRotationYTF.setEditor(\n new JSpinner.NumberEditor(sittingRotationYTF, \"########0.00\"));\n sittingRotationZTF.setEditor(\n new JSpinner.NumberEditor(sittingRotationZTF, \"########0.00\"));\n \n //LieOffset spinners configuration\n value = new Float(0);\n min = new Float(Float.NEGATIVE_INFINITY);\n max = new Float(Float.POSITIVE_INFINITY);\n step = new Float(0.1);\n SpinnerNumberModel xLieOffsetModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel yLieOffsetModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel zLieOffsetModel = new SpinnerNumberModel(value, min, max, step);\n lieDownTranslationXTF.setModel(xLieOffsetModel);\n lieDownTranslationYTF.setModel(yLieOffsetModel);\n lieDownTranslationZTF.setModel(zLieOffsetModel);\n lieDownTranslationXTF.setEditor(\n new JSpinner.NumberEditor(lieDownTranslationXTF, \"########0.00\"));\n lieDownTranslationYTF.setEditor(\n new JSpinner.NumberEditor(lieDownTranslationYTF, \"########0.00\"));\n lieDownTranslationZTF.setEditor(\n new JSpinner.NumberEditor(lieDownTranslationZTF, \"########0.00\"));\n \n //Heading spinners configuration\n value = new Float(0);\n min = new Float(-360);\n max = new Float(360);\n step = new Float(1);\n SpinnerNumberModel xHeadingModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel yHeadingModel = new SpinnerNumberModel(value, min, max, step);\n SpinnerNumberModel zHeadingModel = new SpinnerNumberModel(value, min, max, step);\n lieDownRotationXTF.setModel(xHeadingModel);\n lieDownRotationYTF.setModel(yHeadingModel);\n lieDownRotationZTF.setModel(zHeadingModel);\n lieDownRotationXTF.setEditor(\n new JSpinner.NumberEditor(lieDownRotationXTF, \"########0.00\"));\n lieDownRotationYTF.setEditor(\n new JSpinner.NumberEditor(lieDownRotationYTF, \"########0.00\"));\n lieDownRotationZTF.setEditor(\n new JSpinner.NumberEditor(lieDownRotationZTF, \"########0.00\"));\n\n }", "public void setAngleField(String value) {\n JsoHelper.setAttribute(jsObj, \"angleField\", value);\n }", "public RangeSlider() {\n initSlider();\n }", "Controls () {\n \n barX = 40;\n barWidth = 15;\n \n minY = 40;\n maxY = minY + height/3 - sliderHeight/2;\n \n minZoomValue = height - height;\n maxZoomValue = height; // 300 percent\n valuePerY = (maxZoomValue - minZoomValue) / (maxY - minY);\n \n sliderWidth = 25;\n sliderHeight = 10;\n sliderX = (barX + (barWidth/2)) - (sliderWidth/2); \n sliderValue = minZoomValue; \n sliderY = minY; \n }", "@Override\n public void valueChanged(double control_val) {\n loop_end.setValue((float)control_val);\n // Write your DynamicControl code above this line \n }", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "@Override\n public void valueChanged(double control_val) {\n samplePlayer.setPosition(control_val);\n setAudioTextPosition(control_val);\n // Write your DynamicControl code above this line \n }", "HorizontalControl () {\n \n barY = 15; //40;\n barHeight = 40; //15;\n \n minX = 40;\n maxX = minX + width/3 - sliderWidth/2;\n \n minZoomValue = texture.width - texture.width;\n maxZoomValue = texture.width; // 300 percent\n valuePerX = (maxZoomValue - minZoomValue) / (maxX - minX);\n \n sliderWidth = 10; //25;\n sliderHeight = 25; //10;\n // sliderY = (barY + (barHeight/2)) - (sliderHeight/2);\n sliderY = (barY - (sliderHeight/2)) + (barHeight/2);\n sliderValue = minZoomValue; \n sliderX = minX; \n }", "public void updateRenderAngles() {\n }", "public abstract void updateSlider();", "public JComponent getSlidersPanel(){ return slidersPanel; }", "@Override\n public void updateUI() {\n setUI(new RangeSliderUI(this));\n // Update UI for slider labels. This must be called after updating the\n // UI of the slider. Refer to JSlider.updateUI().\n updateLabelUIs();\n }", "public void initPanel(String attrib, int desired_width){\r\n\r\n slider = new JSlider(JSlider.HORIZONTAL,\r\n min, max, min);\r\n\r\n slider.addChangeListener(new SliderBarActionListener(this,attrib));\r\n\r\n slider.setMajorTickSpacing((max-min)/5);\r\n slider.setPaintTicks(true);\r\n\r\n //Create the label table\r\n Hashtable labelTable = new Hashtable();\r\n labelTable.put( new Integer( min ), new JLabel(\"\"+ min/precision));\r\n labelTable.put( new Integer( max ), new JLabel(\"\" + max/precision));\r\n slider.setLabelTable( labelTable );\r\n\r\n slider.setPaintLabels(true);\r\n\r\n Dimension currentsize = slider.getPreferredSize();\r\n currentsize.width = desired_width;\r\n currentsize.height = (DIM_HEIGHT/12) * 11;\r\n slider.setPreferredSize(currentsize);\r\n\r\n this.setLayout(new GridLayout(2,1));\r\n\r\n this.add(label, BorderLayout.NORTH);\r\n\r\n this.add(slider, BorderLayout.SOUTH);\r\n\r\n this.revalidate();\r\n }", "protected Control createSpinnerControl(Composite parent) {\r\n \t\tcomposite = new Composite(parent, SWT.NONE);\r\n \t\tGridLayout gridLayout = new GridLayout();\r\n \t\tgridLayout.numColumns = 2;\r\n gridLayout.marginWidth = 0;\r\n gridLayout.marginHeight = 0;\r\n gridLayout.horizontalSpacing = HORIZONTAL_GAP;\r\n \t\tcomposite.setLayout(gridLayout);\r\n \t\tGridData gd;\r\n \t\tgd = new GridData(GridData.FILL_HORIZONTAL);\r\n \t\tcomposite.setLayoutData(gd);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create label\r\n \t\t */\r\n \t\tsliderLabel = new Label(composite,SWT.NONE);\r\n \t\tgd = new GridData(SWT.LEFT);\r\n \t\tsliderLabel.setLayoutData(gd);\r\n \t\tsliderLabel.setText(SLIDER_LABEL_DEFAULT_TEXT);\r\n \t\tPoint size = sliderLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r\n \t\tsliderLabel.setSize(size);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create slider\r\n \t\t */\r\n \t\tslider = new Slider(composite, SWT.HORIZONTAL);\r\n \t\tgd = new GridData(SWT.RIGHT | GridData.FILL_HORIZONTAL);\r\n \t\tslider.setLayoutData(gd);\r\n \t\t\r\n \t\tslider.setMaximum(MAX_SLIDER_VALUE + slider.getThumb());\r\n \t\tslider.setMinimum(MIN_SLIDER_VALUE);\r\n \t\tslider.setIncrement(INCREMENT_SLIDER_VALUE);\r\n \r\n \t\t/*\r\n \t\t * Add listener to handle value change \r\n \t\t */\r\n \t\tselectionListener = new SelectionListener() {\r\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n \t\t\t\tvalueChanged();\r\n \t\t\t}\r\n \r\n \t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n \t\t\t\t// Do nothing\r\n \t\t\t}\r\n \t\t};\r\n \t\tslider.addSelectionListener(selectionListener);\r\n \t\ttry {\r\n \t\t\tintValue = Integer.parseInt(valueProvider.getStringValue(true).toString());\r\n\t\t} catch (Exception e) {\r\n \t\t\tintValue = DEFAULT_SLIDER_VALUE;\r\n \t\t}\r\n \t\t\r\n \t\t/*\r\n \t\t * Initialize slider presentation\r\n \t\t */\r\n \t\tslider.setSelection(intValue);\r\n \t\tString weightsString = \"\" + (intValue /10) + \"%\"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n \t\tslider.setToolTipText(weightsString);\r\n \t\tsliderLabel.setText(weightsString);\r\n \t\t\r\n \t\tslider.pack();\r\n \t\tsliderLabel.pack();\r\n \t\treturn composite;\r\n \t}", "private void setupTintControl() {\n\n SeekBar tintControl = (SeekBar) findViewById(R.id.slider);\n tintControl.setMax(MAX_TINT);\n tintControl.setProgress(0);\n\n // Set an OnSeekBarChangeListener on the\n tintControl.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n\n\n\n public void onProgressChanged(SeekBar seekBar, final int progress,\n boolean fromUser) {\n updateAllViews(progress);\n }\n\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n public void onStopTrackingTouch(SeekBar seekBar) {\n\n }\n });\n\n }", "protected JComponent createEditor() {\n/* 84 */ JComponent editor = super.createEditor();\n/* 85 */ if (editor instanceof JSpinner.DefaultEditor) {\n/* */ \n/* 87 */ JSpinner.DefaultEditor de = (JSpinner.DefaultEditor)editor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 92 */ de.getTextField().setBorder(new EmptyBorder(0, 0, 0, 0));\n/* */ \n/* 94 */ Dimension prefSize = de.getPreferredSize();\n/* 95 */ int compHeight = prefSize.height;\n/* */ \n/* 97 */ int height = LiquidSpinnerButtonUI.getSkin(1).getVsize() + LiquidSpinnerButtonUI.getSkin(5).getVsize();\n/* 98 */ int diff = height - compHeight;\n/* */ \n/* 100 */ if (diff > 0) {\n/* */ \n/* 102 */ int half = diff / 2;\n/* 103 */ de.getTextField().setBorder(new EmptyBorder(half, 0, diff - half, 0));\n/* */ } \n/* */ } \n/* 106 */ return editor;\n/* */ }", "public TextBoxComponent(JButton draw)\n\t{\n\t\tsetLayout(new FlowLayout());\n\t\tsetComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\n\t\t\n\t\tqualityNum = sidesNum = 0;\n\t\tlengthNum = widthNum = heightNum = 1;\n\t\tradiusNum = radius2Num = rollNum = pitchNum = yawNum = 0;\n\t\t\n\t\txText = new JLabel(\" X:\");\n\t\tyText = new JLabel(\" Y:\"); \n\t\tzText = new JLabel(\" Z:\"); \n\t\tlengthText = new JLabel(\" Length:\"); \n\t\twidthText = new JLabel(\" Width:\"); \n\t\theightText = new JLabel(\" Height:\"); \n\t\tradiusText = new JLabel(\" Radius:\"); \n\t\tradius2Text = new JLabel(\" Radius 2:\"); \n\t\trollText = new JLabel(\" Roll:\"); \n\t\tpitchText = new JLabel(\" Pitch:\"); \n\t\tyawText = new JLabel(\" Yaw:\"); \n\t\tqualityText = new JLabel(\" Quality:\");\n\t\tsidesText = new JLabel(\" # of Sides:\");\n\t \t\n\t \tx = new JTextField(12); \n\t \ty = new JTextField(12); \n\t \tz = new JTextField(12); \n\t \tlength = new JTextField(5); \n\t \twidth = new JTextField(5); \n\t \theight = new JTextField(5); \n\t \tradius = new JTextField(5); \n\t \tradius2 = new JTextField(5);\n\t \troll = new JTextField(5); \n\t \tpitch = new JTextField(5); \n\t \tyaw = new JTextField(5); \n\t \tquality = new JTextField(5); \n\t \tsides = new JTextField(5);\n\t \t\n\t \t//radius.addActionListener(this);\n\t \t//radius.addMouseListener(this);\n\t \tadd(xText);\n\t\tadd(x);\n\t\tadd(yText);\n\t\tadd(y);\n\t\tadd(zText);\n\t\tadd(z);\n\t\tadd(lengthText);\n\t\tadd(length);\n\t\tadd(widthText);\n\t\tadd(width);\n\t\tadd(heightText);\n\t\tadd(height);\n\t\tadd(radiusText);\n\t\tadd(radius);\n\t\tadd(radius2Text);\n\t\tadd(radius2);\n\t\tadd(qualityText);\n\t\tadd(quality);\n\t\tadd(sidesText);\n \tadd(sides);\n \tadd(yawText);\n\t\tadd(yaw);\n\t\tadd(pitchText);\n\t\tadd(pitch);\n\t\tadd(rollText);\n\t\tadd(roll);\n\t\t\n\t \tsetShape(\"Cube\");\n\t \t\n\t \tadd(draw);\n\t \tsetVisible(true);\n\t \t\n\t \t\n\t \t//setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\n\t}", "private void createSlider(){\n\t\tslider = new GVertSlider(winApp, (int)width - 10, (int)height, 10, maxRows * (int)height);\n\t\tslider.setBorder(1);\n\t\tslider.setVisible(false);\n\t\tslider.setLimits(0, 0, maxRows - 1);\n\t\tslider.addEventHandler(this, \"processSliderMotion\", new Class[] { GVertSlider.class } );\n\t\tadd(slider);\n\t}", "public ThicknessSlider() {\n\t\t// Create a new JSlider with a vertical orientation, minimum value of 1,\n\t\t// maximum value of 20, and start value of defaultThickness\n \t\tsuper(JSlider.VERTICAL, 1, 20, defaultThickness);\n \t\t\n\t\tthis.setMajorTickSpacing(19);\n\t\tthis.setMinorTickSpacing(1);\n\t\tthis.setPaintTicks(true);\n\t\tthis.setPaintLabels(true);\n\t\tthis.setSnapToTicks(true);\n\t\tthis.setToolTipText(\"Change thickness of the brush\");\n\t\tthis.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t}", "public HBox simulationControl() {\t\t\r\n\t\t// Setup Slider\r\n\t\tspeedControl.setPrefWidth(800);\r\n\t\tspeedControl.setBlockIncrement(10);\r\n\t\tspeedControl.setMajorTickUnit(10);\r\n\t\tspeedControl.setMinorTickCount(0);\r\n\t\tspeedControl.setSnapToTicks(true);\r\n\t\t\r\n\t\t// Setup HBox\r\n\t\tHBox control = new HBox(); \r\n\t\tcontrol.setAlignment(Pos.CENTER); \r\n\t\t\r\n\t\t// Add Slider To HBox\r\n\t\tcontrol.getChildren().add(speedControl);\r\n\t\t\r\n\t\treturn control;\r\n\t}", "private void setWheelBaseSliderSettings() {\n wheelBaseSlider.setValueFactory(new Callback<JFXSlider, StringBinding>() {\n @Override\n public StringBinding call(JFXSlider arg0) {\n return Bindings.createStringBinding(new java.util.concurrent.Callable<String>(){\n @Override\n public String call() {\n DecimalFormat df = new DecimalFormat(\"#.0\");\n return df.format(wheelBaseSlider.getValue());\n }\n }, wheelBaseSlider.valueProperty());\n }\n });\n }", "private JSlider getTimeSlider() {\r\n\t\tif (timeSlider == null) {\r\n\t\t\ttimeSlider = new JSlider(1,1);\r\n\t\t\ttimeSlider.setPaintLabels(true);\r\n\t\t\ttimeSlider.setMajorTickSpacing(100);\r\n\t\t\ttimeSlider.addChangeListener(new javax.swing.event.ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(javax.swing.event.ChangeEvent e) {\r\n\t\t\t\t\tforceImage();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn timeSlider;\r\n\t}", "private void iSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_iSliderStateChanged\n float tmp_value = ((float)this.iSlider.getValue())/10;\n this.paramILabel.setText(\"\" + tmp_value);\n }", "public void sliderChange(int r, int g, int b)\n {\n String outPutR;\n String outPutG;\n String outPutB;\n \n //************output to binary()*******//\n if(binaryRBtn.isSelected() == true)\n { \n outPutR = Integer.toBinaryString(r);\n outPutG = Integer.toBinaryString(g);\n outPutB = Integer.toBinaryString(b);\n\n messageRed = (\"\" + outPutR); \n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //********output to hex()************//\n else if(hexDecRBtn.isSelected() == true)\n {\n outPutR = Integer.toHexString(r);\n outPutG = Integer.toHexString(g);\n outPutB = Integer.toHexString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //**********output to Octal()********//\n else if(octalRBtn.isSelected() == true)\n {\n outPutR = Integer.toOctalString(r);\n outPutG = Integer.toOctalString(g);\n outPutB = Integer.toOctalString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //*********output to decimal()********//\n else if(decimalRBtn.isSelected() == true)\n {\n outPutR = Integer.toString(r);\n outPutG = Integer.toString(g);\n outPutB = Integer.toString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n \n //******Bar Display rise and fall()******//\n redHeight=1; \n greenHeight=1; \n blueHeight=1;\n \n redHeight += rSliderValue;\n greenHeight += gSliderValue;\n blueHeight += bSliderValue;\n \n redYvalue = 475;\n redYvalue -=rSliderValue;\n \n greenYvalue = 475;\n greenYvalue -=gSliderValue;\n \n blueYvalue = 475;\n blueYvalue -=bSliderValue;\n \n repaint();\n \n }", "String updateSliderLabel() {\n if (this.direction.equals(\"H\"))\n return \"Percentage of Width : \";\n if (this.direction.equals(\"V\"))\n return \"Percentage of Height : \";\n return \"/!\\\\ Direction issue! Please relaunch the App /!\\\\\";\n }", "public Slider(int width, int length, int location_x, int location_y, int orientation) {\r\n super(width, length, location_x, location_y, new JSlider(orientation));\r\n }", "private JSlider getZSlider() {\r\n\t\tif (zSlider == null) {\r\n\t\t\tzSlider = new JSlider(1,1);\r\n\t\t\tzSlider.setMajorTickSpacing(100);\r\n\t\t\tzSlider.setPaintLabels(true);\r\n\t\t\tzSlider.addChangeListener(new javax.swing.event.ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(javax.swing.event.ChangeEvent e) {\r\n\t\t\t\t\tsaveUserChangesToROI();\r\n\t\t\t\t\tupdateLabel(-1, -1);\r\n\t\t\t\t\tBufferedImage image = getImage();\r\n\t\t\t\t\tif (image != null){\r\n\t\t\t\t\t\timagePane.setUnderlyingImage(image,/*false,*/allPixelValuesRange);\r\n\t\t\t\t\t}\r\n\t\t\t\t\trefreshROI();\r\n\t\t\t\t\timagePane.repaint();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn zSlider;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n shadePanel1 = new my.boxshader.ShadePanel();\n jPanel1 = new javax.swing.JPanel();\n jSlider1 = new javax.swing.JSlider();\n jTextField1 = new javax.swing.JTextField();\n shadePanel3 = new my.boxshader.ShadePanel();\n\n org.jdesktop.layout.GroupLayout shadePanel1Layout = new org.jdesktop.layout.GroupLayout(shadePanel1);\n shadePanel1.setLayout(shadePanel1Layout);\n shadePanel1Layout.setHorizontalGroup(\n shadePanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 100, Short.MAX_VALUE)\n );\n shadePanel1Layout.setVerticalGroup(\n shadePanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 100, Short.MAX_VALUE)\n );\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 100, 0)));\n\n org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 0, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 43, Short.MAX_VALUE)\n );\n\n jSlider1.setMajorTickSpacing(25);\n jSlider1.setMinorTickSpacing(5);\n jSlider1.setPaintLabels(true);\n jSlider1.setPaintTicks(true);\n jSlider1.setValue(0);\n jSlider1.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSlider1StateChanged(evt);\n }\n });\n\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n org.jdesktop.layout.GroupLayout shadePanel3Layout = new org.jdesktop.layout.GroupLayout(shadePanel3);\n shadePanel3.setLayout(shadePanel3Layout);\n shadePanel3Layout.setHorizontalGroup(\n shadePanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 0, Short.MAX_VALUE)\n );\n shadePanel3Layout.setVerticalGroup(\n shadePanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(0, 124, Short.MAX_VALUE)\n );\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)\n .add(shadePanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()\n .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 83, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(25, 25, 25)\n .add(jSlider1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 259, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(0, 33, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(18, 18, 18)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jSlider1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)\n .add(shadePanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .add(12, 12, 12))\n );\n\n pack();\n }", "private void control()\r\n\t\t{\n\t\tspinMin.addChangeListener(createMinListener());\r\n\t\tspinMax.addChangeListener(createMaxListener());\r\n\t\t}", "@DISPID(1001) //= 0x3e9. The runtime will prefer the VTID if present\n @VTID(9)\n void animVal(\n ms.html.ISVGAngle p);", "public ElevatorSlider (Elevator e, int name) {\n elevator = e;\n getInfo ();\n // Create the slider and adjust its properties\n slider = new JSlider (JSlider.VERTICAL, 0, numFloors, 0);\n slider.setMajorTickSpacing (MAJOR_TICK_SPACING);\n slider.setMinorTickSpacing (MINOR_TICK_SPACING);\n slider.setPaintTicks (true);\n slider.setPaintLabels (true);\n // Calculate the dimensions for the sliders\n int width = SLIDER_WIDTH;\n int height = HEIGHT_PER_FLOOR * numFloors;\n int heightResize = 1 + (numFloors / FLOOR_LIMIT);\n height /= heightResize;\n slider.setPreferredSize (new Dimension (width, height));\n \n // Add the slider\n this.add (slider);\n this.update (e, name);\n // Add the label to the panel\n this.add (stateLabel);\n this.add (capLabel);\n this.add (floorLabel);\n // Set the layout\n this.setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));\n \n }", "public CircularLayoutComponent() {\n initComponents();\n setOpaque(true);\n setDoubleBuffered(true);\n segmentSizeSpinner.addChangeListener(this);\n targetMarginSpinner.addChangeListener(this);\n sourceMarginSpinner.addChangeListener(this);\n segmentMarginSpinner.addChangeListener(this);\n segmentAngleSpinner.addChangeListener(this);\n }", "public void draw() {\n\t\tif (fill) {\n\t\t\tapplet.noStroke();\n\t\t\tapplet.fill(color);\n\t\t} else {\n\t\t\tapplet.noFill();\n\t\t\tapplet.stroke(color);\n\t\t}\n\t\tapplet.rect(position.x, position.y, size.x, size.y);\n\t\tsliderButton.draw(new PVector(-10,0));\n\t}", "private void armSliderMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_armSliderMouseDragged\n\n theta = armSlider.getValue(); //gets the value of the slider's value\n roboLogic.armSliderLogic(); //calls the arm slider logic function in the RobotLogic class\n\n }", "public void render(){\n ui.stroke(255,140,0);\r\n Random rand = new Random();\r\n int value1 = rand.nextInt(255);\r\n int value2 = rand.nextInt(255);\r\n int value3 = rand.nextInt(255);\r\n int value4 = rand.nextInt(255);\r\n ui.fill(value1,value2,value3,value4);\r\n ui.rect(x + 75 ,y + 380,200,40);\r\n String Text = \"TARGET ACQUIRED\";\r\n ui.textSize(18);\r\n ui.fill(255, 0, 0);\r\n ui.text(Text, x + 95 ,y + 407);\r\n\r\n //Create Target Aimer\r\n ui.noFill();\r\n ui.stroke(255,0,0);\r\n ui.ellipse(x + width / 2, y + height / 2, radius, radius);\r\n\r\n radius = radius + 1;\r\n if(radius>=150){\r\n radius *= -1;\r\n }\r\n }", "@Override\n public void valueChanged(String control_val) {\n if (samplePlayer.isPaused()) {\n // our string will be hh:mm:ss.m\n try {\n String[] units = control_val.split(\":\"); //will break the string up into an array\n int hours = Integer.parseInt(units[0]); //first element\n int minutes = Integer.parseInt(units[1]); //second element\n float seconds = Float.parseFloat(units[2]); // thirsd element\n float audio_seconds = 360 * hours + 60 * minutes + seconds; //add up our values\n\n float audio_position = audio_seconds * 1000;\n setAudioSliderPosition(audio_position);\n } catch (Exception ex) {\n }\n }\n // Write your DynamicControl code above this line \n }", "@Override\n public void reAngle() {\n }", "@Override\n public void valueChanged(Boolean control_val) {\n if (!control_val){\n playbackDirection.setValue(PLAY_FORWARD);\n }\n else{\n playbackDirection.setValue(PLAY_REVERSE);\n }\n // Write your DynamicControl code above this line\n }", "public void setSlider(Slider slider) {\n\t\tthis.slider = slider;\n\t}", "public RacePanelOneTurn() {\n initComponents();\n addCinderTrack(jSlider1, \"config/images/cars/ferrari.png\");\n }", "@Override\n protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3)\n {\n if (this.visible)\n {\n if (this.dragging)\n {\n this.sliderValue = (par2 - (this.xPosition + 4)) / (float)(this.width - 8);\n updateSlider();\n }\n\n GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n\n Vector2f sliderPos = new Vector2f(\n this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)),\n this.yPosition\n );\n\n Vector2f sliderSize = new Vector2f(8, this.height);\n\n // Draw slider\n Gui.drawRect((int) sliderPos.getX(), (int) sliderPos.getY(), (int) sliderPos.getX() + (int) sliderSize.x, (int) sliderPos.getY() + (int) sliderSize.getY(), Color.BLACK.getRGB());\n\n // Draw slider inner\n Gui.drawRect((int) sliderPos.getX() + 2, (int) sliderPos.getY() + 2, (int) sliderPos.getX() + (int) sliderSize.x - 2, (int) sliderPos.getY() + (int) sliderSize.getY() - 2, Color.WHITE.getRGB());\n }\n }", "@Override\n public void start(Stage primaryStage) throws Exception{\n Parent root = FXMLLoader.load(getClass().getResource(\"GUI/layout.fxml\"));\n primaryStage.setTitle(\"Flock simulation\");\n primaryStage.setScene(new Scene(root, 1000, 750));\n primaryStage.show();\n\n Pane pane = (Pane) root.lookup(\"#draw_pane\");\n\n /* UI controls */\n\n Slider alignmentSlider = (Slider) root.lookup(\"#alignment_slider\");\n Slider cohesionSlider = (Slider) root.lookup(\"#cohesion_slider\");\n Slider separationSlider = (Slider) root.lookup(\"#separation_slider\");\n Slider maxForceSlider = (Slider) root.lookup(\"#maxforce_slider\");\n Slider maxSpeedSlider = (Slider) root.lookup(\"#maxspeed_slider\");\n Slider boidCountSlider = (Slider) root.lookup(\"#count_slider\");\n Slider alignmentDistanceSlider = (Slider) root.lookup(\"#alignment_distance_slider\");\n Slider cohesionDistanceSlider = (Slider) root.lookup(\"#cohesion_distance_slider\");\n Slider separationDistanceSlider = (Slider) root.lookup(\"#separation_distance_slider\");\n Slider detectionAngleSlider = (Slider) root.lookup(\"#detection_angle_slider\");\n\n TextField alignmentTextfield = (TextField) root.lookup(\"#alignment_field\");\n TextField cohesionTextfield = (TextField) root.lookup(\"#cohesion_field\");\n TextField separationTextfield = (TextField) root.lookup(\"#separation_field\");\n TextField maxForceTextfield = (TextField) root.lookup(\"#maxforce_field\");\n TextField maxSpeedTextfield = (TextField) root.lookup(\"#maxspeed_field\");\n TextField boidCountTextfield = (TextField) root.lookup(\"#count_field\");\n TextField alignmentDistanceTextfield = (TextField) root.lookup(\"#alignment_distance_field\");\n TextField cohesionDistanceTextfield = (TextField) root.lookup(\"#cohesion_distance_field\");\n TextField separationDistanceTextfield = (TextField) root.lookup(\"#separation_distance_field\");\n TextField detectionAngleTextfield = (TextField) root.lookup(\"#detection_angle_field\");\n\n StringProperty alignmentProperty = new SimpleStringProperty(alignmentTextfield.getText());\n StringProperty cohesionProperty = new SimpleStringProperty(cohesionTextfield.getText());\n StringProperty separationProperty = new SimpleStringProperty(separationTextfield.getText());\n StringProperty maxForceProperty = new SimpleStringProperty(maxForceTextfield.getText());\n StringProperty maxSpeedProperty = new SimpleStringProperty(maxSpeedTextfield.getText());\n StringProperty boidCountProperty = new SimpleStringProperty(boidCountTextfield.getText());\n StringProperty alignmentDistanceProperty = new SimpleStringProperty(alignmentDistanceTextfield.getText());\n StringProperty cohesionDistanceProperty = new SimpleStringProperty(cohesionDistanceTextfield.getText());\n StringProperty separationDistanceProperty = new SimpleStringProperty(separationDistanceTextfield.getText());\n StringProperty detectionAngleProperty = new SimpleStringProperty(detectionAngleTextfield.getText());\n\n /* Listeners for UI controls */\n\n alignmentProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, alignmentMultiplierBox, alignmentSlider, alignmentTextfield));\n alignmentSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentProperty, newValue.toString()));\n alignmentTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentProperty, newValue));\n\n cohesionProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, cohesionMultiplierBox, cohesionSlider, cohesionTextfield));\n cohesionSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionProperty, newValue.toString()));\n cohesionTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionProperty, newValue));\n\n separationProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, separationMultiplierBox, separationSlider, separationTextfield));\n separationSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationProperty, newValue.toString()));\n separationTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationProperty, newValue));\n\n maxForceProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 1, maxForceBox, maxForceSlider, maxForceTextfield));\n maxForceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxForceProperty, newValue.toString()));\n maxForceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxForceProperty, newValue));\n\n maxSpeedProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 10, maxSpeedBox, maxSpeedSlider, maxSpeedTextfield));\n maxSpeedSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxSpeedProperty, newValue.toString()));\n maxSpeedTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(maxSpeedProperty, newValue));\n\n boidCountProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 10000, entityCountBox, boidCountSlider, boidCountTextfield, 5));\n boidCountSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(boidCountProperty, newValue.intValue()));\n boidCountTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(boidCountProperty, newValue));\n\n alignmentDistanceProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 1000, alignmentDistanceBox, alignmentDistanceSlider, alignmentDistanceTextfield, 4));\n alignmentDistanceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentDistanceProperty, newValue.intValue()));\n alignmentDistanceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(alignmentDistanceProperty, newValue));\n\n cohesionDistanceProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 1000, cohesionDistanceBox, cohesionDistanceSlider, cohesionDistanceTextfield, 4));\n cohesionDistanceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionDistanceProperty, newValue.intValue()));\n cohesionDistanceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(cohesionDistanceProperty, newValue));\n\n separationDistanceProperty.addListener((__, ___, newValue) -> changeIntModifier(newValue, 1000, separationDistanceBox, separationDistanceSlider, separationDistanceTextfield, 4));\n separationDistanceSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationDistanceProperty, newValue.intValue()));\n separationDistanceTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(separationDistanceProperty, newValue));\n\n detectionAngleProperty.addListener((__, ___, newValue) -> changeDoubleModifier(newValue, 360, detectionAngleBox, detectionAngleSlider, detectionAngleTextfield));\n detectionAngleSlider.valueProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(detectionAngleProperty, newValue.toString()));\n detectionAngleTextfield.textProperty().addListener((__, ___, newValue) -> setStringPropertyUnlessEqual(detectionAngleProperty, newValue));\n\n // Initiate controls\n boidCountProperty.setValue(entityCountBox.val.toString());\n alignmentProperty.setValue(alignmentMultiplierBox.val.toString());\n cohesionProperty.setValue(cohesionMultiplierBox.val.toString());\n separationProperty.setValue(separationMultiplierBox.val.toString());\n alignmentDistanceProperty.setValue(alignmentDistanceBox.val.toString());\n cohesionDistanceProperty.setValue(cohesionDistanceBox.val.toString());\n separationDistanceProperty.setValue(separationDistanceBox.val.toString());\n maxForceProperty.setValue(maxForceBox.val.toString());\n maxSpeedProperty.setValue(maxSpeedBox.val.toString());\n detectionAngleProperty.setValue(detectionAngleBox.val.toString());\n\n /* Create Boids */\n\n for (int i = 0; i < entityCountBox.val; i++) { createBoid(pane); }\n\n /* Create simulation loop */\n\n Thread updateThread = new Thread(() -> {\n while (true) {\n while (awaitsDrawing) {\n try { Thread.sleep(5); } catch (InterruptedException e) { e.printStackTrace(); }\n }\n updateAccelerations(pane.getWidth(), pane.getHeight());\n awaitsDrawing = true;\n }\n });\n updateThread.setDaemon(true);\n updateThread.start();\n\n new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (!awaitsDrawing) return;\n updateEntityCount(pane);\n for (Entity e : entities) { e.move(pane.getWidth(), pane.getHeight()); }\n awaitsDrawing = false;\n }\n }.start();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n slider_slices = new javax.swing.JSlider();\n jLabel2 = new javax.swing.JLabel();\n slider_width = new javax.swing.JSlider();\n jLabel3 = new javax.swing.JLabel();\n slider_height = new javax.swing.JSlider();\n jLabel4 = new javax.swing.JLabel();\n slider_depth = new javax.swing.JSlider();\n check_showBounds = new javax.swing.JCheckBox();\n slider_opacity = new javax.swing.JSlider();\n jLabel5 = new javax.swing.JLabel();\n check_showLightbuffer = new javax.swing.JCheckBox();\n check_multisample = new javax.swing.JCheckBox();\n\n jLabel1.setText(\"Slices\");\n\n slider_slices.setMaximum(700);\n slider_slices.setMinimum(1);\n slider_slices.setValue(5);\n slider_slices.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_slicesStateChanged(evt);\n }\n });\n\n jLabel2.setText(\"Width\");\n\n slider_width.setMaximum(200);\n slider_width.setMinimum(20);\n slider_width.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_widthStateChanged(evt);\n }\n });\n\n jLabel3.setText(\"Height\");\n\n slider_height.setMaximum(200);\n slider_height.setMinimum(20);\n slider_height.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_heightStateChanged(evt);\n }\n });\n\n jLabel4.setText(\"Depth\");\n\n slider_depth.setMaximum(200);\n slider_depth.setMinimum(20);\n slider_depth.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_depthStateChanged(evt);\n }\n });\n\n check_showBounds.setSelected(true);\n check_showBounds.setText(\"Show Bounds\");\n check_showBounds.setToolTipText(\"Draw box around all volume data\");\n check_showBounds.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showBoundsActionPerformed(evt);\n }\n });\n\n slider_opacity.setMajorTickSpacing(1);\n slider_opacity.setMaximum(700);\n slider_opacity.setValue(5);\n slider_opacity.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_opacityStateChanged(evt);\n }\n });\n\n jLabel5.setText(\"Opacity\");\n\n check_showLightbuffer.setSelected(true);\n check_showLightbuffer.setText(\"Show Lightbuffer\");\n check_showLightbuffer.setToolTipText(\"Display lighting calculations onscreen\");\n check_showLightbuffer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showLightbufferActionPerformed(evt);\n }\n });\n\n check_multisample.setText(\"Multisample\");\n check_multisample.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_multisampleActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(slider_depth, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_width, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_height, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(check_showBounds)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_showLightbuffer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_multisample))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_opacity, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_slices, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(slider_width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(slider_height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(slider_depth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(check_showBounds)\n .addComponent(check_showLightbuffer)\n .addComponent(check_multisample))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(slider_slices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(slider_opacity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n }", "private void mountSlider() {\n if (slider != null) {\n sliderPane.getChildren().add(slider);\n }\n }", "@Override\r\n public void onAction(String name, boolean isPressed, float tpf)\r\n {\n slideLabel.setText(String.format(\"Value : %1.2f\", slider.getValues()[0]));\r\n }", "private void syncSliderInput()\n {\n pickerSlider.valueProperty().removeListener(this::onColourSliderChange);\n pickerSlider.setStyle(\"-fx-background-color: linear-gradient(to top, #000000, \" + colourToRgb(toolColour) + \", #FFFFFF);\");\n pickerSlider.setValue(0.0);\n pickerSlider.valueProperty().addListener(this::onColourSliderChange);\n }", "private void dSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_dSliderStateChanged\n float tmp_value = ((float)this.dSlider.getValue())/10;\n this.paramDLabel.setText(\"\" + tmp_value);\n }", "@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint amount = betslider.getValue();\n\t\t\t\tbetAmount.setText(\"$\"+amount);\n\t\t\t}", "@Override\n protected void onFinishInflate() {\n super.onFinishInflate();\n tv_slider_icon = (TextView) findViewById(R.id.slider_icon);\n }", "@Override\r\n protected void controlUpdate(float tpf) {\n }", "private JComponent createBoxFor(final FloatTrait t){\n\t\tfinal JPanel box = new JPanel();\n\t\tfinal Swat.TextField floatLabel = new Swat.TextField();\n\t\tfloatLabel.setDocument(new MaxLengthDocument(Deikto.MAXIMUM_FIELD_LENGTH));\n\t\tfloatLabel.setText(t.getLabel());\n\t\tfloatLabel.addActionListener(new EditorListener(floatLabel){\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t@Override\n\t\t\tpublic boolean timedActionPerformed(ActionEvent e) {\n\t\t\t\treturn renameTrait(t,box,floatLabel.getText().trim());\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic String getText() { return t.getLabel(); }\n\t\t});\n\t\tfloatLabel.setBackground(Utils.lightlightBackground);\n\t\t//floatLabel.setPreferredSize(new Dimension(23,23));\n\t\t\n\t\tSwat.Slider sld = new Swat.Slider(JSlider.HORIZONTAL, 0, 100, 50){\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t@Override\n\t\t\tpublic String getToolTipText() {\n\t\t\t\treturn Utils.toHtmlTooltipFormat(t.getDescription());\n\t\t\t}\n\t\t};\n\t\tToolTipManager.sharedInstance().registerComponent(sld);\n\t\t\n\t\t//sld.setMaximumSize(new Dimension(200,30));\n\t\t//sld.setMinimumSize(new Dimension(200,30));\n\t\t//sld.setPreferredSize(new Dimension(200,30));\n\t\tsld.setMajorTickSpacing(50);\n\t\tsld.setMinorTickSpacing(10);\n\t\tsld.setPaintTicks(true);\t\t\t\n\t\tnew UndoableSlider(swat,sld) {\n\t\t\tEntity editedEntity;\n\t\t\t@Override\n\t\t\tpublic int init() {\n\t\t\t\teditedEntity = getEditedEntity();\n\t\t\t\treturn toSlider(getValue(editedEntity,t));\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void setValue(int value) {\n\t\t\t\tCustomTraitsControl.this.setValue(editedEntity,t,fromSlider(value));\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void undoRedoExecuted() {\n\t\t\t\tshowEditedEntity(editedEntity);\n\t\t\t\tUtils.scrollToVisible(box);\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic String getPresentationName(){\n\t\t\t\treturn \"change \"+floatLabel.getText()+\" of \"+editedEntity.getLabel();\n\t\t\t}\n\t\t};\n\t\t\n\t\tJButton deleteCustomTraitButton=new DeleteButton();\n\t\tdeleteCustomTraitButton.setToolTipText(Utils.toHtmlTooltipFormat(\"Deletes this trait.\"));\n\t\tdeleteCustomTraitButton.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdeleteTrait(box,t);\n\t\t\t}\n\t\t});\n\t\tDimension db=deleteCustomTraitButton.getPreferredSize();\n\t\tdb.height=floatLabel.getPreferredSize().height;\n\t\t//deleteCustomTraitButton.setPreferredSize(db);\n\t\n\t\tfinal QuestionMarkButton descriptionButton = new QuestionMarkButton(t.getLabel());\n\t\tdescriptionButton.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tshowDescriptionPopup(t,new DescriptionPopupDispatcher(t));\n\t\t\t}\n\t\t});\n\t\t\n\t\tJComponent buttonPanel = Box.createHorizontalBox();\n\t\tbuttonPanel.add(descriptionButton);\n\t\tbuttonPanel.add(deleteCustomTraitButton);\n\t\t\n\t\tJComponent aux=new JPanel(new BorderLayout());\n\t\taux.add(buttonPanel,BorderLayout.EAST);\n\t\taux.add(floatLabel,BorderLayout.CENTER);\n\t\t//aux.setMaximumSize(new Dimension(210,25));\n\t\t//aux.setPreferredSize(new Dimension(210,aux.getPreferredSize().height));\n\t\t\n\t\taux.setAlignmentX(0.5f);\t\t\t\n\t\tbox.add(aux);\n\t\tsld.setOpaque(false);\n\t\tsld.setAlignmentX(0.5f);\n\t\tbox.add(sld);\t\t\n\t\t\n\t\tbox.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS));\n\t\tbox.setOpaque(false);\n\t\tbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));\n\t\tbox.setAlignmentX(0.5f);\n\t\tbox.setMinimumSize(new Dimension(10,TRAIT_HEIGHT));\n\t\tbox.setPreferredSize(new Dimension(212,TRAIT_HEIGHT));\n\t\tbox.setMaximumSize(new Dimension(250,TRAIT_HEIGHT));\n\t\tTRAIT_HEIGHT = box.getPreferredSize().height;\n\t\treturn box;\n\t}", "@Override\n public void onValueChanged(int i) {\n mTextViewDistance.setText(i + \" M\");\n // Delete old circle and draw the new circle with the radius given\n drawCircle(i);\n // Update the global variable RADIUS with the new value\n RADIUS = i;\n }", "@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 stepSlider = new javax.swing.JSlider();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n update = new javax.swing.JButton();\n stepState = new javax.swing.JLabel();\n Caculate = new javax.swing.JButton();\n showConnect = new javax.swing.JCheckBox();\n randLine = new javax.swing.JCheckBox();\n randInfect = new javax.swing.JCheckBox();\n widthSlider = new javax.swing.JSlider();\n heightSlider = new javax.swing.JSlider();\n drawPanel = new DrawPanel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(new javax.swing.border.MatteBorder(null));\n\n stepSlider.setMajorTickSpacing(10);\n stepSlider.setMinorTickSpacing(1);\n stepSlider.setPaintLabels(true);\n stepSlider.setPaintTicks(true);\n stepSlider.setToolTipText(\"Time\");\n stepSlider.setValue(0);\n stepSlider.setAutoscrolls(true);\n stepSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n stepSliderStateChanged(evt);\n }\n });\n\n jLabel1.setText(\"width\");\n\n jLabel2.setText(\"height\");\n\n update.setText(\"Update\");\n update.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n updateMousePressed(evt);\n }\n });\n update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n updateActionPerformed(evt);\n }\n });\n\n Caculate.setText(\"Caculate\");\n Caculate.setToolTipText(\"\");\n Caculate.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n CaculateMousePressed(evt);\n }\n });\n Caculate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CaculateActionPerformed(evt);\n }\n });\n\n showConnect.setText(\"ShowConnectLine\");\n showConnect.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n showConnectStateChanged(evt);\n }\n });\n showConnect.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n showConnectPropertyChange(evt);\n }\n });\n\n randLine.setText(\"Random Line\");\n\n randInfect.setText(\"Random Infected\");\n\n widthSlider.setMajorTickSpacing(10);\n widthSlider.setMinimum(10);\n widthSlider.setMinorTickSpacing(2);\n widthSlider.setPaintTicks(true);\n widthSlider.setToolTipText(\"\");\n widthSlider.setValue(10);\n widthSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n widthSliderStateChanged(evt);\n }\n });\n widthSlider.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n widthSliderPropertyChange(evt);\n }\n });\n\n heightSlider.setMajorTickSpacing(10);\n heightSlider.setMinimum(10);\n heightSlider.setMinorTickSpacing(2);\n heightSlider.setPaintTicks(true);\n heightSlider.setValue(10);\n heightSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n heightSliderStateChanged(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 .addComponent(stepSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(showConnect)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(randLine))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(randInfect)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(14, 14, 14)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(heightSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(stepState, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(update)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(Caculate))))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, 0)\n .addComponent(stepSlider, 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 .addComponent(stepState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(widthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(update)\n .addComponent(Caculate))\n .addComponent(heightSlider, javax.swing.GroupLayout.Alignment.TRAILING, 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(showConnect)\n .addComponent(randLine)\n .addComponent(randInfect))\n .addContainerGap())\n );\n\n drawPanel.setBorder(new javax.swing.border.MatteBorder(null));\n drawPanel.setName(\"drawPanel\"); // NOI18N\n drawPanel.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n drawPanelMouseClicked(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n drawPanelMousePressed(evt);\n }\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n drawPanelMouseReleased(evt);\n }\n });\n drawPanel.addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentResized(java.awt.event.ComponentEvent evt) {\n drawPanelComponentResized(evt);\n }\n });\n drawPanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n drawPanelMouseDragged(evt);\n }\n });\n drawPanel.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n drawPanelPropertyChange(evt);\n }\n });\n\n javax.swing.GroupLayout drawPanelLayout = new javax.swing.GroupLayout(drawPanel);\n drawPanel.setLayout(drawPanelLayout);\n drawPanelLayout.setHorizontalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 639, Short.MAX_VALUE)\n );\n drawPanelLayout.setVerticalGroup(\n drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 259, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(drawPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(drawPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "public radiusRender() {\n setPluginName(pluginName);\n }", "public JGradientSlider() {\n\t\tthis(HORIZONTAL);\n\t}", "@Override\n \tpublic void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)\n \t{\n \t\tradiusTextField.setText(\"\" + progress);\n \t}", "public LineThicknessSelectorSlider(View view, int min, int max) {\n\t\tsuper(true);\n\t\tJLabel sliderLabel = new JLabel(\"Line thickness\");\n\t\tthis.view = view;\n this.min = min;\n this.max = max;\n\t this.setLayout(new BorderLayout());\n\t Slider = new Slider(JSlider.HORIZONTAL,min, max, 3);\n\t Slider.setPaintTicks(true);\n\t Slider.setPaintLabels(true);\n\t Slider.setPreferredSize(new Dimension(120,40));;\n\n\t Slider.setLabelTable(Slider.createStandardLabels(1));\n\t Slider.setPaintLabels(true);\n\t this.add(Slider,BorderLayout.NORTH);\n\t this.add(sliderLabel,BorderLayout.CENTER);\n\t }", "private void setOnSlide(JFXSlider cogSlider, final JFXTextField cogInput) {\n cogSlider.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n //TODO Round on 1 or more?\n DecimalFormat df = new DecimalFormat(\"#.#\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n cogInput.setText(df.format(newValue));\n }\n });\n }", "@Override\r\n public void onProgressChanged(SeekBar seekBar, int progress,\r\n boolean fromUser) {\n int value = seekBar.getProgress();\r\n LayoutParams paramsStrength = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\r\n int s = GlobalDefinitions.SCREEN_WIDTH-ScaleUtils.scale(240);\r\n paramsStrength.leftMargin = (int) (ScaleUtils.scale(83)+s*value/1000);\r\n paramsStrength.topMargin = ScaleUtils.scale(40);\r\n mValueTxt.setLayoutParams(paramsStrength);\r\n int res = (value/10);\r\n mValueTxt.setText(String.valueOf(res));\r\n mImgView.setImageBitmap(null);\r\n //skin white\r\n mImgView.setImageBitmap(mFaceEditor.BFSoftskin(GlobalDefinitions.softRatio, Math.abs(seekBar.getProgress()/10)));//));//change to 0-100\r\n\r\n }", "private void pSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_pSliderStateChanged\n float tmp_value = ((float)this.pSlider.getValue())/10;\n this.paramPLabel.setText(\"\" + tmp_value);\n }", "@Override\n public void valueChanged(double control_val) {\n float current_audio_position = (float)samplePlayer.getPosition();\n\n if (current_audio_position < control_val){\n samplePlayer.setPosition(control_val);\n }\n loop_start.setValue((float)control_val);\n // Write your DynamicControl code above this line \n }", "public void handle(ActionEvent ae) {\n angle += 15.0; \n \n rotate.setAngle(angle); \n rotate.setPivotX(btnRotate.getWidth()/2); \n rotate.setPivotY(btnRotate.getHeight()/2); \n }", "void addMidiControls() { \r\n // Add a slider to control the tempo \r\n final JSlider tempo = new JSlider(50, 200); \r\n tempo.setValue((int) (sequencer.getTempoFactor() * 100)); \r\n tempo.setBorder(new TitledBorder(\"Tempo Adjustment (%)\")); \r\n java.util.Hashtable labels = new java.util.Hashtable(); \r\n labels.put(new Integer(50), new JLabel(\"50%\")); \r\n labels.put(new Integer(100), new JLabel(\"100%\")); \r\n labels.put(new Integer(200), new JLabel(\"200%\")); \r\n tempo.setLabelTable(labels); \r\n tempo.setPaintLabels(true); \r\n // The event listener actually changes the tempo \r\n tempo.addChangeListener(new ChangeListener() { \r\n public void stateChanged(ChangeEvent e) { \r\n sequencer.setTempoFactor(tempo.getValue() / 100.0f); \r\n } \r\n }); \r\n \r\n this.add(tempo); \r\n \r\n // Create rows of solo and checkboxes for each track \r\n Track[] tracks = sequence.getTracks(); \r\n for (int i = 0; i < tracks.length; i++) { \r\n final int tracknum = i; \r\n // Two checkboxes per track \r\n final JCheckBox solo = new JCheckBox(\"solo\"); \r\n final JCheckBox mute = new JCheckBox(\"mute\"); \r\n // The listeners solo or mute the track \r\n solo.addActionListener(new ActionListener() { \r\n public void actionPerformed(ActionEvent e) { \r\n sequencer.setTrackSolo(tracknum, solo.isSelected()); \r\n } \r\n }); \r\n mute.addActionListener(new ActionListener() { \r\n public void actionPerformed(ActionEvent e) { \r\n sequencer.setTrackMute(tracknum, mute.isSelected()); \r\n } \r\n }); \r\n \r\n // Build up a row \r\n Box box = Box.createHorizontalBox(); \r\n box.add(new JLabel(\"Track \" + tracknum)); \r\n box.add(Box.createHorizontalStrut(10)); \r\n box.add(solo); \r\n box.add(Box.createHorizontalStrut(10)); \r\n box.add(mute); \r\n box.add(Box.createHorizontalGlue()); \r\n // And add it to this component \r\n this.add(box); \r\n } \r\n }", "@Override\n public void onSliderClick(BaseSliderView slider) {\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel3 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n slider_cateta_1 = new javax.swing.JSlider();\n jLabel1 = new javax.swing.JLabel();\n slider_cateta_2 = new javax.swing.JSlider();\n jLabel4 = new javax.swing.JLabel();\n grosime_linie_text = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n rezultatTangentaLabel = new javax.swing.JLabel();\n triunghiSurface = new javax.swing.JPanel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel2.setText(\"Cateta 1: \");\n\n slider_cateta_1.setName(\"SliderC1\"); // NOI18N\n\n jLabel1.setText(\"Cateta 2: \");\n\n slider_cateta_2.setName(\"SliderC2\"); // NOI18N\n\n jLabel4.setText(\"Grosimea Liniei\");\n\n grosime_linie_text.setText(\"1\");\n grosime_linie_text.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n changedText(evt);\n }\n });\n\n jLabel5.setText(\"Tangenta: \");\n\n rezultatTangentaLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n rezultatTangentaLabel.setText(\"...\");\n rezultatTangentaLabel.setToolTipText(\"\");\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_cateta_2, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)\n .addComponent(slider_cateta_1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(rezultatTangentaLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(110, 110, 110)\n .addComponent(jLabel2))\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(106, 106, 106)\n .addComponent(jLabel1))\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(85, 85, 85)\n .addComponent(jLabel4))\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(105, 105, 105)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(grosime_linie_text))))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(slider_cateta_1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addComponent(slider_cateta_2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(grosime_linie_text, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(rezultatTangentaLabel)\n .addContainerGap(30, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout triunghiSurfaceLayout = new javax.swing.GroupLayout(triunghiSurface);\n triunghiSurface.setLayout(triunghiSurfaceLayout);\n triunghiSurfaceLayout.setHorizontalGroup(\n triunghiSurfaceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 265, Short.MAX_VALUE)\n );\n triunghiSurfaceLayout.setVerticalGroup(\n triunghiSurfaceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(triunghiSurface, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(triunghiSurface, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n\n pack();\n }", "@Override\n public void onSliderClick(SliderView sliderView) {\n }", "@Override\r\n public void onProgressChanged(SeekBar seekBar, int progress,\r\n boolean fromUser) {\n int value = seekBar.getProgress();\r\n LayoutParams paramsStrength = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\r\n int s = GlobalDefinitions.SCREEN_WIDTH-ScaleUtils.scale(240);\r\n paramsStrength.leftMargin = (int) (ScaleUtils.scale(83)+s*value/1000);\r\n paramsStrength.topMargin = ScaleUtils.scale(40);\r\n mValueTxt.setLayoutParams(paramsStrength);\r\n int res = (value/10);\r\n mValueTxt.setText(String.valueOf(res));\r\n mImgView.setImageBitmap(null);\r\n //shou lian\r\n mImgView.setImageBitmap(mFaceEditor.BFFaceLift(seekBar.getProgress()/10,0,0,0));//));//change to 0-100\r\n\r\n }", "public void setAngle(float angle){\n\n\t}", "private void ffSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ffSliderStateChanged\n float tmp_value = ((float)this.ffSlider.getValue())/10;\n this.paramffLabel.setText(\"\" + tmp_value);\n }", "private JSlider thicknessSlider(final DrawingPanel thePanel) {\r\n final JSlider slider = new JSlider(JSlider.HORIZONTAL,\r\n 0, 20, 4);\r\n slider.setMajorTickSpacing(MAJOR_TICK_SPACING);\r\n slider.setMinorTickSpacing(MINOR_TICK_SPACING);\r\n slider.setPaintLabels(true);\r\n slider.setPaintTicks(true);\r\n \r\n slider.addChangeListener(new ChangeListener() {\r\n @Override\r\n public void stateChanged(final ChangeEvent theEvent) {\r\n final int value = slider.getValue();\r\n if (value > 0) {\r\n thePanel.setStrokeWidth(value);\r\n }\r\n }\r\n });\r\n return slider;\r\n }", "@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }", "private void ssSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ssSliderStateChanged\n float tmp_value = ((float)this.ssSlider.getValue())/10;\n this.paramssLabel.setText(\"\" + tmp_value);\n }", "protected void createSliders() {\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentFish\"));\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentShark\"));\n\t}", "public void stateChanged(ChangeEvent e) {\r\n Object source = e.getSource();\r\n\r\n if (source instanceof JSlider) {\r\n JSlider slider = (JSlider) source;\r\n if (text != null) {\r\n text.setText(\"<html><font color=#FFFFFF>Volume: \"+slider.getValue()+\"</font></html>\");\r\n text.setLocation(getWidth()/2-text.getWidth()/2, text.getY());\r\n revalidate();\r\n repaint();\r\n }\r\n }\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lbOee1 = new javax.swing.JLabel();\n lbOeeMeta6 = new javax.swing.JLabel();\n jSlider1 = new javax.swing.JSlider();\n\n lbOee1.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n lbOee1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lbOee1.setText(\"OEE\");\n lbOee1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n\n lbOeeMeta6.setBackground(new java.awt.Color(51, 255, 51));\n lbOeeMeta6.setFont(new java.awt.Font(\"Tahoma\", 1, 9)); // NOI18N\n lbOeeMeta6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lbOeeMeta6.setText(\"A\");\n lbOeeMeta6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n lbOeeMeta6.setOpaque(true);\n lbOeeMeta6.setPreferredSize(new java.awt.Dimension(36, 36));\n\n jSlider1.setMajorTickSpacing(10);\n jSlider1.setMaximum(480);\n jSlider1.setPaintTrack(false);\n jSlider1.setValue(0);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lbOee1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGap(129, 129, 129)\n .addComponent(lbOeeMeta6, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSlider1, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)\n .addGap(0, 0, 0))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jSlider1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lbOee1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lbOeeMeta6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE))\n .addGap(0, 0, 0))\n );\n }", "protected\tvoid\t\trender(MiRenderer renderer)\n\t\t{\n\t\t// Draw background, valueDisplay and label\n\t\tsuper.render(renderer);\n\n\t\tMiBounds innerBounds = getInnerBounds(tmpBounds);\n\n\t\t// Move Strip over\n\t\trenderer.moveImageArea(innerBounds, scroll.x, scroll.y);\n\t\tscroll.zeroOut();\n\n\t\t// Draw ticks:\n\t\tfor (int i = 0; i < ticksToDrawX.size(); ++i)\n\t\t\t{\n\t\t\tticks.setCenterX(ticksToDrawX.elementAt(i));\n\t\t\tticks.setYmin(innerBounds.ymin);\n\t\t\tticks.setYmax(innerBounds.ymin + ticksToDrawHeight.elementAt(i));\n\t\t\tticks.render(renderer);\n\t\t\t}\n\t\tticksToDrawX.removeAllElements();\n\t\tticksToDrawHeight.removeAllElements();\n\t\t}", "public ImageIcon getSliderTick1_notrangle()\r\n\t{\r\n\t\treturn getImage(IMGS_ROOT+\"/slider_tick1_notrangle.png\");\r\n\t}", "@Override\n\tpublic void render() {\n\t\tComponent frame = null;\n\t\tJOptionPane.showMessageDialog(frame, \"Radius: \" + radius +\"\\nSurface Area: \" + this.surfaceArea() + \"\\nVolume: \" + this.volume(), \"Sphere\", 1);\n\t}", "@Override\n public View renderForEdit(LayoutInflater layout, Plot plot, Activity activity, ViewGroup parent) {\n\n View container = null;\n\n if (this.canEdit) {\n container = layout.inflate(R.layout.plot_field_edit_row, parent, false);\n Object value = plot.getValueForKey(this.key);\n\n// ((TextView) container.findViewById(R.id.field_label)).setText(this.label);\n TextInputLayout newEdit = container.findViewById(R.id.field_label_new);\n newEdit.setHint(this.label+\" in \"+this.unitText);\n TextInputEditText newEditValue= newEdit.findViewById(R.id.field_value_new);\n// EditText edit = (EditText) container.findViewById(R.id.field_value);\n// TextView unitLabel = ((TextView) container.findViewById(R.id.field_unit));\n\n String safeValue = (!JSONObject.NULL.equals(value)) ? value.toString() : \"\";\n// edit.setText(safeValue);\n ((TextInputEditText)newEdit.findViewById(R.id.field_value_new)).setText(safeValue);\n\n this.valueView = newEditValue;\n// unitLabel.setText(this.unitText);\n\n if (this.format != null) {\n setFieldKeyboard(newEditValue);\n }\n }\n\n return container;\n }", "@DISPID(1001) //= 0x3e9. The runtime will prefer the VTID if present\n @VTID(10)\n ms.html.ISVGAngle animVal();", "public WaveView() {\n initComponents();\n }", "public KwikiSynopticOutputPanel ( int x, int y, ETFractionInterface fraction ) {\n super();\n\n this.fraction = fraction;\n\n setOpaque( true );\n\n setBackground(ReduxConstants.mySampleYellowColor );\n\n setBounds( x, y, 180, 275 );\n }", "@Override\n\tprotected void controlUpdate(float tpf) {\n\t\t\n\t}", "public void setRawWheelAngle(double angle){\n \tmodule.forEach(m -> m.setRawWheelAngle(angle));\n }", "public void stateChanged(ChangeEvent evt){player.seek(slider.getValue());}", "CartogramWizardPanelFour (JFrame contentFrame)\n\t{\n\t\n\t\tmCartogramWizard = (CartogramWizard)contentFrame;\n\t\t\n\t\tthis.setLocation(160, 90);\n\t\tthis.setSize(440, 340);\n\t\tthis.setLayout(null);\n\t\n\t\tClassLoader cldr = this.getClass().getClassLoader();\n\n\t\t// Add the slider for the amount of deformation.\n\t\tFont smallFont = new Font(null, Font.PLAIN, 11);\n\t\tmDeformationSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 50);\n\t\tmDeformationSlider.setMajorTickSpacing(25);\n\t\tmDeformationSlider.setMinorTickSpacing(5);\n\t\tmDeformationSlider.setPaintTicks(true);\n\t\tmDeformationSlider.setFont(smallFont);\n\t\tmDeformationSlider.setSize(440, 40);\n\t\tmDeformationSlider.setLocation(0, 20);\n\t\t\n\t\tHashtable labelTable = new Hashtable();\n\t\tJLabel sliderLabel = new JLabel(\"Low\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(0), sliderLabel);\n\t\tsliderLabel = new JLabel(\"Medium\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(50), sliderLabel);\n\t\tsliderLabel = new JLabel(\"High\");\n\t\tsliderLabel.setFont(smallFont);\n\t\tlabelTable.put(new Integer(100), sliderLabel);\n\t\t\n\t\tmDeformationSlider.setLabelTable(labelTable);\n\t\tmDeformationSlider.setPaintLabels(true);\n\t\tthis.add(mDeformationSlider);\n\t\t\n\t\t\n\t\t// Add the label for the amount of deformation.\n\t\tJLabel deformationLabel = new JLabel(\"Transformation quality:\");\n\t\tdeformationLabel.setSize(440, 14);\n\t\tdeformationLabel.setFont(new Font(null, Font.BOLD, 11));\n\t\tdeformationLabel.setLocation(0, 0);\n\t\tthis.add(deformationLabel);\n\n\n\n\n\t\t// Create the text pane which displays the help text for the\n\t\t// amount of deformation.\n\t\tJTextPane deformationTextPane = new JTextPane();\n\t\tString deformationText = null;\n\t\ttry\n\t\t{\n\t\t\tInputStream inStream = \n\t\t\t\tcldr.getResource(\"AmountOfDeformationText.rtf\").openStream();\n\t\t\tStringBuffer inBuffer = new StringBuffer();\n\t\t\tint c;\n\t\t\twhile ((c = inStream.read()) != -1)\n\t\t\t{\n\t\t\t\tinBuffer.append((char)c);\n\t\t\t}\n\t\t\tinStream.close();\n\t\t\tdeformationText = inBuffer.toString();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\tdeformationTextPane.setContentType(\"text/rtf\");\n\t\tdeformationTextPane.setText(deformationText);\n\t\tdeformationTextPane.setEditable(false);\n\t\tdeformationTextPane.setFont(new Font(null, Font.PLAIN, 11));\n\t\tdeformationTextPane.setBackground(null);\n\t\tdeformationTextPane.setLocation(40, 70);\n\t\tdeformationTextPane.setSize(400, 70);\n\t\tthis.add(deformationTextPane);\n\t\t\n\t\t\n\t\t\n\t\t// ADVANCED OPTIONS\n\t\t\n\t\t// A button and an explanatory text for the advanced options.\n\t\tJButton advancedButton = \n\t\t\tnew JButton(\"Advanced options...\");\n\t\tadvancedButton.setLocation(0, 170);\n\t\tadvancedButton.setSize(240, 26);\n\t\tadvancedButton.addActionListener(\n\t\t\tnew CartogramWizardAdvancedOptionsAction(\"showDialog\", null));\n\t\tthis.add(advancedButton);\n\t\t\n\t\t// Create the text pane which displays the help text for the\n\t\t// simultaneous layers.\n\t\tJTextPane advancedTextPane = new JTextPane();\n\t\tString advancedText = null;\n\t\ttry\n\t\t{\n\t\t\tInputStream inStream = \n\t\t\t\tcldr.getResource(\"AdvancedOptionsText.rtf\").openStream();\n\t\t\tStringBuffer inBuffer = new StringBuffer();\n\t\t\tint c;\n\t\t\twhile ((c = inStream.read()) != -1)\n\t\t\t{\n\t\t\t\tinBuffer.append((char)c);\n\t\t\t}\n\t\t\tinStream.close();\n\t\t\tadvancedText = inBuffer.toString();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\tadvancedTextPane.setContentType(\"text/rtf\");\n\t\tadvancedTextPane.setText(advancedText);\n\t\tadvancedTextPane.setEditable(false);\n\t\tadvancedTextPane.setFont(new Font(null, Font.PLAIN, 11));\n\t\tadvancedTextPane.setBackground(null);\n\t\tadvancedTextPane.setLocation(40, 205);\n\t\tadvancedTextPane.setSize(400, 60);\n\t\tthis.add(advancedTextPane);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Add the Compute button\n\t\tJButton computeButton = new JButton(\"Compute\");\n\t\tcomputeButton.setLocation(340, 314);\n\t\tcomputeButton.setSize(100, 26);\n\t\tcomputeButton.setMnemonic(KeyEvent.VK_ENTER);\n\t\tcomputeButton.addActionListener(new \n\t\t\tCartogramWizardComputeAction((CartogramWizard)contentFrame));\n\t\tthis.add(computeButton);\n\t\t\n\t\t\n\t\t\n\t\t// Add the Back button\n\t\tJButton backButton = new JButton(\"< Back\");\n\t\tbackButton.setLocation(235, 314);\n\t\tbackButton.setSize(100, 26);\n\t\tbackButton.addActionListener(new\n\t\t\tCartogramWizardGoToStepAction((CartogramWizard)contentFrame, 3));\n\t\tthis.add(backButton);\n\n\n\n\n\n\t\t// ADD THE HELP BUTTON\n\t\t\n\t\t//ClassLoader cldr = this.getClass().getClassLoader();\n\t\t\n\t\tjava.net.URL imageURL = cldr.getResource(\"help-22.png\");\n\t\tImageIcon helpIcon = new ImageIcon(imageURL);\n\n\t\tJButton helpButton = \n\t\t\tnew JButton(helpIcon);\n\t\t\n\t\thelpButton.setVerticalTextPosition(SwingConstants.BOTTOM);\n\t\thelpButton.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\thelpButton.setSize(30, 30);\n\t\thelpButton.setLocation(0, 312);\n\t\thelpButton.setFocusable(false);\n\t\thelpButton.setContentAreaFilled(false);\n\t\thelpButton.setBorderPainted(false);\n\t\t\n\t\thelpButton.addActionListener(new CartogramWizardShowURL(\n\t\t\t\"http://chorogram.choros.ch/scapetoad/help/c-transformation-parameters.php\"));\n\t\t\n\t\tthis.add(helpButton);\n\n\n\t\t\n\t\n\t}" ]
[ "0.7127012", "0.6531134", "0.60295886", "0.5923007", "0.5698197", "0.56713545", "0.5637436", "0.5626394", "0.5520627", "0.5428475", "0.5427872", "0.54096836", "0.5381897", "0.5330204", "0.53277165", "0.52696455", "0.52613765", "0.52575505", "0.52549887", "0.5225345", "0.52020496", "0.51299983", "0.5123965", "0.50810987", "0.50521505", "0.50414276", "0.50347966", "0.50272065", "0.5018531", "0.5013008", "0.5010225", "0.5007711", "0.49805573", "0.49521637", "0.49507022", "0.49485937", "0.49405584", "0.49253842", "0.49242753", "0.49005318", "0.48976395", "0.489728", "0.48815548", "0.48590383", "0.48513618", "0.48388237", "0.4832021", "0.48312938", "0.48283288", "0.48278964", "0.48231047", "0.4821124", "0.48146367", "0.4807822", "0.4799324", "0.47961226", "0.47871047", "0.47826606", "0.47615868", "0.47595492", "0.47302172", "0.47166336", "0.4696791", "0.46916357", "0.46861285", "0.46816835", "0.46769363", "0.46668112", "0.4665804", "0.46656483", "0.46641937", "0.46539813", "0.46537334", "0.46498767", "0.46478814", "0.46446592", "0.46437252", "0.4641346", "0.46402273", "0.46336725", "0.46197766", "0.461939", "0.4615449", "0.46033287", "0.4599822", "0.45935887", "0.4589744", "0.4587197", "0.4585534", "0.4579505", "0.45766294", "0.45753625", "0.45750594", "0.4569956", "0.45682406", "0.45641822", "0.45628393", "0.45583367", "0.4558335", "0.4556318" ]
0.82781607
0
A generic method for rendering sliders with an event on mouse release
private void renderSlider(double min, double max, double value, EventHandler eventHandler) { unmountSlider(); buildSlider(min, max, value); slider.addEventHandler(MouseEvent.MOUSE_RELEASED, eventHandler); mountSlider(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void mouseReleaseHandler(MouseEvent e) {\n\n\t}", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n public void onMouseReleased(MouseEvent event, DrawingView dv) {\n }", "@Override\n public void mouseReleased(MouseEvent e){\n }", "@Override\n public void mouseReleased(MouseEvent evt) {\n }", "@Override\r\n\t\t public void mouseReleased(MouseEvent arg0) {\n\t\t }", "@Override\r\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "@Override\r\n\t\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "public abstract void mouseReleased(MouseReleasedEvent mr);", "@Override\r\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n public void mouseReleased(MouseEvent e) {\n\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n\n }", "@Override\n\t\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t}", "@Override\n public void mouseReleased(MouseEvent e)\n {\n }", "@Override\n public void mouseReleased(MouseEvent e)\n {\n }", "@Override\n\tpublic void mouseReleased(MouseEvent event){}", "@Override\r\npublic void mouseReleased(MouseEvent arg0) {\n\t\r\n}", "@Override\npublic void mouseReleased(MouseEvent e)\n{\n\t\n}", "@Override\r\n public void mouseReleased(MouseEvent e) {\n }", "@Override\r\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n\tpublic void mouseReleased(MouseEvent event) {\n\t\t\n\t}", "@Override\n public void mouseReleased(MouseEvent e){\n \n }", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseReleased(MouseEvent e) {}", "public void mouseReleased(MouseEvent e) {}", "public void mouseReleased(MouseEvent e) {}", "@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "public void mouseReleased(MouseEvent event) {}", "@Override\r\n public void mouseReleased(MouseEvent e) {\r\n\r\n }", "@Override\r\n public void mouseReleased(MouseEvent e) {\r\n\r\n }", "@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\r\n\t\t}", "@Override\n public void mouseReleased(MouseEvent e) {\n }", "public void mouseReleased(MouseEvent event) { }", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}", "@Override\r\n public void mouseReleased(MouseEvent arg0)\r\n {\n }", "@Override\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\n\t\t\t\t}", "@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent e) {\n\r\n\t}" ]
[ "0.6847691", "0.68272895", "0.68209857", "0.67379", "0.67332166", "0.6728356", "0.6726712", "0.67183656", "0.670848", "0.670848", "0.67070156", "0.6705201", "0.6705201", "0.6705201", "0.6705201", "0.6705201", "0.66999835", "0.66999835", "0.66999835", "0.66999835", "0.6694474", "0.6694474", "0.66928893", "0.66928893", "0.6689536", "0.66859746", "0.6682608", "0.6679104", "0.6679104", "0.667267", "0.667267", "0.667267", "0.667267", "0.667267", "0.66566616", "0.66566616", "0.66566616", "0.6655629", "0.66489637", "0.6648144", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6635884", "0.6634374", "0.66315055", "0.66315055", "0.66315055", "0.66284", "0.66284", "0.66284", "0.6628129", "0.66185266", "0.66185266", "0.6616328", "0.6616328", "0.6616328", "0.66116476", "0.66116476", "0.66116476", "0.66116476", "0.66116476", "0.66116476", "0.66116476", "0.66116476", "0.66116476", "0.66116476", "0.6605473", "0.6605473", "0.6597073", "0.6597073", "0.65918285", "0.6588388", "0.6586434", "0.6586434", "0.6586434", "0.6586434", "0.6586434", "0.6586434", "0.6586434", "0.6586434", "0.65851337", "0.65840167", "0.65838915", "0.6582353", "0.6582353", "0.6582353", "0.6582353" ]
0.7178929
0
Unmounts tree from treePane
private void unmountTree() { if (tree != null) { treePane.getChildren().clear(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void removedFromWidgetTree();", "private void mountTree() {\n if (tree != null) {\n treePane.getChildren().addAll(tree);\n }\n }", "public void removeFromRoot(){\n Main.getRootPlayGround().getChildren().remove(imageView);\n }", "private void unmountSlider() {\n if (slider != null) {\n sliderPane.getChildren().remove(slider);\n }\n }", "public void detachFromRoot() {\n final ViewGroup contentView = getActivityContentView();\n\n if (contentView.equals(getParent())) {\n contentView.removeView(this);\n contentView.getChildAt(0).setVisibility(View.VISIBLE);\n contentView.requestLayout();\n contentView.invalidate();\n }\n }", "public void nodeUnselected(ITreeNode node, ITree tree,boolean needNotifier);", "public void hide() {\n getRoot().hide();\n }", "public static void setTreePane(TreePane pane)\n {\n for (Component c : frame.getContentPane().getComponents())\n {\n if (c instanceof TreePane)\n {\n frame.getContentPane().remove(c);\n }\n }\n frame.getContentPane().add(pane, BorderLayout.CENTER);\n frame.revalidate(); //Redraws the GUI, not only for looks, but also so that the user can interact. (Non-Responsive GUI without this)\n }", "public void detach() {\n\t\tsetParent(null);\n\t}", "public void deselectFocusedNode(){\r\n \tfocusOut();\r\n }", "public void removeFromPane(Node node) {\n pane.getChildren().remove(node);\n }", "public void removePeonStatusPane() {\n\t\tContextAreaHandler.getInstance().clearContext();\n\t}", "void deleteTree(TreeNode node) \n {\n root = null; \n }", "@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }", "public void dispose ()\n {\n if (_tree != null) {\n _tree.dispose();\n _tree = null;\n }\n }", "void detachFromGraphView();", "private void unhilitNode()\n {\n\tif (hilited==null) return;\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,Color.black);\n\trenderCircle(g,hilited.x,hilited.y,hilited.diameter+4);\n\thilited = null;\n }", "public boolean removeTree(String treeName);", "public void dropview() {\n\t\tthis.remove(scrollPane);\n\t}", "private void tear() {\n\t\tthis.torn = true;\n\t\tthis.getContainer().addToContents(getDucatContent());\n\t\tthis.getContainer().removeFromContents(this);\n\t}", "public void undo() {\n compositionManager.ungroup(group);\n }", "@Generated(hash = 1311440767)\r\n public synchronized void resetTrees() {\r\n trees = null;\r\n }", "public void removeChildren() {\r\n this.children.clear();\r\n childNum = 0;\r\n }", "public void removeLevel()\n {\n clearLevelAndDecreaseCount();\n }", "public void delete() {\n this.root = null;\n }", "public void setJTree(javax.swing.JTree tree) {\n this.remove(getJTree());\n jTree = tree;\n getJScrollPane().setViewportView(jTree);\n }", "public void clear() {\n tree.clear();\n }", "public static void cleanTree(final RainfallTool tool) {\n\t\tTree tree = null;\n\t\tTreeItem root = tree.getRootItem();\n\t\tfor (int i = 0 ; i < root.getItemCount() ; i++) {\n\t\t\tTreeItem item = root.getItem(i); \n\t\t\tif (item.isChecked())\n\t\t\t\titem.setChecked(false);\n\t\t\tfor (int j = 0 ; j < item.getItemCount() ; j++) {\n\t\t\t\tTreeItem subItem = item.getItem(j);\n\t\t\t\tif (subItem.isChecked())\n\t\t\t\t\tsubItem.setChecked(false);\n\t\t\t}\n\t\t}\n\t}", "public void clear(){\r\n canvas.getGraphicsContext2D().clearRect(canvas.getWidth(),canvas.getHeight(),1,1);\r\n pane.getChildren().clear();\r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t\tif (wrappedTree.getSelectionCount() != 1)\n\t\t\t\t\t\treturn;\n DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) wrappedTree.getLastSelectedPathComponent();\n GKInstance instance = (GKInstance) treeNode.getUserObject();\n InstanceDeletion deletion = new InstanceDeletion();\n JFrame parentFrame = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, wrappedTree);\n deletion.delete(instance, parentFrame);\n\t\t\t\t}", "@Override\r\n\tpublic void cleanup() {\r\n\t\tlevelList.setSelectedIndex(0);\t\t\r\n\t}", "public void runTree(int min) {\n getContentPane().remove(pane);\n pane = new Tree(1.05, min, .8, 200);\n getContentPane().add(pane);\n setVisible(true);\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\t\t\t\t\troot.getChildren().remove(product);\r\n\t\t\t\t\t\t\t}", "@FXML\n public void onDelete(ActionEvent event) {\n try {\n folders.delete(folders.getId(folderToDelete.getText()));\n stage.close();\n tree.displayTree();\n } catch (SQLException ex) {\n errorDelete.setText(ex.getMessage());\n }\n }", "public void flushToolPane() {\n\t\tthis.toolPane.removeAll();\n\t\tthis.toolPane.repaint();\n\t}", "@Override\n public void removeChildren()\n {\n children.clear();\n }", "public boolean removeFromRoot() {\n Views.removeFromParent(this);\n setVisibility(8);\n return true;\n }", "public void treeClosed(SrvSession sess, TreeConnection tree) {\n }", "public void refresh() {\n navTreeWidget.removeItems();\n selectedPath = null;\n loadInitialTree();\n }", "public void treeNodesRemoved(TreeModelEvent e) {\n //To change body of implemented methods use Options | File Templates.\n }", "private void deleteTree(tnode root){\n if (root != null)\n root = null;\n }", "public void deleteNode ()\n {\n ConfigTreeNode node = _tree.getSelectedNode();\n ConfigTreeNode parent = (ConfigTreeNode)node.getParent();\n int index = parent.getIndex(node);\n ((DefaultTreeModel)_tree.getModel()).removeNodeFromParent(node);\n int ccount = parent.getChildCount();\n node = (ccount > 0) ?\n (ConfigTreeNode)parent.getChildAt(Math.min(index, ccount - 1)) : parent;\n if (node != _tree.getModel().getRoot()) {\n _tree.setSelectionPath(new TreePath(node.getPath()));\n }\n DirtyGroupManager.setDirty(group, true);\n }", "public void deleteSelection() {\r\n /* Delete the node */\r\n try {\r\n deleteNode();\r\n } catch (NullPointerException e1) {\r\n }\r\n /* Delete the edge */\r\n try {\r\n deleteEdge();\r\n } catch (NullPointerException e2) {\r\n }\r\n /* Reload the scroll */\r\n scrollPane().doLayout();\r\n }", "public void clear()\n\t{\n\t\tthis.getChildren().clear();\n\t}", "public void removeAllInternalFrames() {\n ((JDesktopPane)peer).removeAll(); \n //--ARM-- public void removeAllInternalFrames()\n }", "public void deselectAll()\n {\n map.deselectAll();\n mapComponent.repaint();\n mapper.resetMenus();\n }", "public void unLoad() {\n try{\n deInitialize();\n iMenu.unLoad();\n }catch(Exception e){\n Logger.loggerError(\"Menu canvas unload Error\"+e.toString());\n }\n }", "private void resortAndReselectTreeGrid() {\n resortAndReselectTreeGrid(null);\n }", "public void destroy()\r\n\t{\r\n\t\tsetRoot(null);\r\n\t\tsetCounter(0);\r\n\t}", "private static void delTree(BoardTree root) {\n if (root.children == null) return;\n for (BoardTree child : root.children) {\n delTree(child);\n }\n root.children.clear();\n root = null;\n }", "void unsetLastrun();", "private void resetGUI() {\n leftVBox.getChildren().clear();\n rightVBox.getChildren().clear();\n connectionsPane.getChildren().clear();\n }", "public final void m7956e() {\n try {\n if (this.f3326b != null) {\n if (this.f3326b.getParent() != null) {\n ((ViewGroup) this.f3326b.getParent()).removeView(this.f3326b);\n }\n }\n this.f3326b = null;\n } catch (RejectedExecutionException e) {\n throw e;\n } catch (RejectedExecutionException e2) {\n throw e2;\n }\n }", "private void initializeTreePane() {\n Rectangle clipRect = new Rectangle(treePane.getWidth(), treePane.getHeight());\n clipRect.heightProperty().bind(treePane.heightProperty());\n clipRect.widthProperty().bind(treePane.widthProperty());\n treePane.setClip(clipRect);\n }", "@Override\n public void resetWorkspace() {\n\n taData.getOfficeHoursGridPane().getChildren().clear();\n taData.getOfficeHoursGridTimeHeaderPanes().clear();\n taData.getOfficeHoursGridTimeHeaderLabels().clear();\n taData.getOfficeHoursGridDayHeaderPanes().clear();\n taData.getOfficeHoursGridDayHeaderLabels().clear();\n taData.getOfficeHoursGridTimeCellPanes().clear();\n taData.getOfficeHoursGridTimeCellLabels().clear();\n taData.getOfficeHoursGridTACellPanes().clear();\n taData.getOfficeHoursGridTACellLabels().clear();\n }", "public void dockNodeDefocused(DockNodeEvent e) {}", "public void reset() {\r\n\t\t_tb = new TreeBuffer();\r\n\t}", "public void resetParents() {\n idemenController.setSelected(null);\n }", "public void remove () { this.setAsDown(); n.remove(); }", "public void interactiveTreeEditingRToL() {\r\n JTree tree = new JTree(); \r\n TreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setEditable(true);\r\n JXTree xTree = new JXTree();\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"standard Editing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "public void prune() {\n this.getTree().prune();\n }", "void unsetState();", "void detachCurrent();", "synchronized void detachParent() {\n if (!isRoot()) {\n Neighbor neighbor = node.getParent();\n if (neighbor != null) {\n neighbor.detach();\n node.parent = null;\n }\n node.makeRoot();\n }\n }", "public void clearSubbedTiles() { subbedTiles.clear(); }", "public void actionPerformed(ActionEvent evt) {\n\t\t\t\tDefaultMutableTreeNode selected = (DefaultMutableTreeNode) tree\n\t\t\t\t\t\t.getLastSelectedPathComponent();\n\t\t\t\tif (selected == null) return;\n\t\t\t\t\n\t\t\t\t// Identify the parent of the selected node; we are not allowing\n\t\t\t\t// the root node to be removed\n\t\t\t\tif (selected.getParent() == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t// User the models remove method to remove the selected node\n\t\t\t\ttModel.removeNodeFromParent(selected);\n\t\t\t}", "public void treeSelection() {\n\t\tFlowTreeNode ftn = (FlowTreeNode) tree.getLastSelectedPathComponent();\n\n\t\tif (ftn == null)\n\t\t\treturn;\n\t\telse\n\n\t\t{\n\n\t\t\tftn.execute();\n\t\t\tthis.revalidate();\n\t\t\t// buildTreeView();\n\n\t\t}\n\t}", "public void removePiece() {\n\t\troot.getChildren().clear();\n\t\tthis.piece = null;\n\t\troot.getChildren().add(rectangle);\n\t}", "public void detach(HashMap<Team, Integer> activeCount) {\n if (this.parent != null) {\n this.parent.getChildren().clear();\n this.parent.setAttachedPiece(null);\n this.parent = null;\n }\n\n if (this.isActive) {\n int activeCountInt = activeCount.get(this.team);\n activeCountInt--;\n activeCount.put(this.team, activeCountInt);\n }\n\n this.isActive = false;\n }", "public void detach(HashMap<Controller.Team, Integer> activeCount) {\n if (this.parent != null) {\n this.parent.getChildren().clear();\n this.parent.setAttachedPiece(null);\n this.parent = null;\n }\n\n if (this.isActive) {\n int activeCountInt = activeCount.get(this.team);\n activeCountInt--;\n activeCount.put(this.team, activeCountInt);\n }\n\n this.isActive = false;\n }", "void decrementOldDepth() {\n mOldDepth--;\n }", "public void clearComponentSelection(){\r\n ComponentSelectionTree.clearSelection();\r\n }", "private void clearAbove(int treeNum) {\n int nextTreeNum = (treeNum - 1) / 2;\n if (!nodeMap.get(nextTreeNum).getName().isEmpty()) {\n nodeMap.get(nextTreeNum).setName(\"\");\n clearAbove(nextTreeNum);\n }\n }", "public void clearChildren() throws RemoteException;", "@Override\r\n public void clear(){\r\n root = null;\r\n }", "public void clearChildren() {\n internalGroup.clearChildren();\n }", "public void mouseMoved(MouseEvent e) {\r\n nodeUnderMouse = null;\r\n }", "public void resetParents() {\n hospitalOperationController.setSelected(null);\n }", "protected void setTree(JTree newTree) {\n\tif(tree != newTree) {\n\t if(tree != null)\n\t\ttree.removeTreeSelectionListener(this);\n\t tree = newTree;\n\t if(tree != null)\n\t\ttree.addTreeSelectionListener(this);\n\t if(timer != null) {\n\t\ttimer.stop();\n\t }\n\t}\n }", "protected void clearRootLayout() {\n this.rootLayout.setVisible(false);\n this.rootLayout.removeAllComponents();\n removeStyleName(\"done\");\n }", "public void undo() {\n\t\tparent.requestChange(new ModelChangeRequest(this.getClass(), parent,\n\t\t\t\t\"create\") {\n\t\t\t@Override\n\t\t\tprotected void _execute() throws Exception {\n\t\t\t\teditor.selectPage((CompositeActor) parent);\n\t\t\t\tif (child instanceof NamedObj) {\n\t\t\t\t\tComponentUtility.setContainer(child, null);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void interactiveTreeXXEditingRToL() {\r\n JTree tree = new JTree(); \r\n tree.setEditable(true);\r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n DefaultTreeEditor treeCellEditor = new DefaultTreeEditor();\r\n tree.setCellEditor(treeCellEditor);\r\n JXTree xTree = new JXTree();\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n xTree.setCellEditor(new DefaultTreeEditor());\r\n\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"XXEditing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "public void paneUpdater(BTree<Integer> bTree) {\n this.getChildren().clear(); // Clear all children of pane & add new ones\n this.bTree = bTree;\n makeBTree(bTree.getRoot(), X, Y); // Call to makeBTree function\n }", "public void popScene() {\n moduleCSM.popScene();\n }", "public void removeFromParent();", "public void removeSelectionTreeListener(final SelectionTreeListener listener);", "private void loadTree(){ \n PBarHelper.show();\n DataProvider.getTreeHierarchy(mScreenId, new DataProvider.AsyncCallback<ViewNodeJSO>() {\n @Override\n public void onError(Request r, Throwable t) {\n PBarHelper.hide();\n Window.alert(t.getMessage());\n }\n\n @Override\n public void onDownloaded(ViewNodeJSO result) {\n mRoot = result; \n CellTree.Resources res = GWT.create(CustomTreeResources.class);\n //create tree model\n mTreeViewModel = new ViewHierarchyTreeViewModel(result);\n //add selection handler to select view on canvas\n mTreeViewModel.setOnSelectionChangedListener(new OnSelectionChangedListener() { \n @Override\n public void onSelectionChanged(ViewNodeJSO viewNode, boolean selected) { \n ScreenPreviewPage.this.onViewTreeNodeSelectionChanged(viewNode, selected);\n }\n });\n //add hover listener just to highlight view\n mTreeViewModel.setOnViewNodeMouseOverListener(new OnViewNodeMouseOverListener() {\n @Override\n public void onMouseOver(ViewNodeJSO viewNode) {\n if (mTreeViewModel.getSelectedNode() == null) {\n clearCanvas();\n drawRectForView(viewNode);\n }\n }\n });\n //remove old tree if necessary, currently there is no reload support (reload page only)\n if (mCellTree != null) {\n mCellTree.removeFromParent();\n }\n mCellTree = new CellTree(mTreeViewModel, null, res); \n mCellTree.setDefaultNodeSize(1000);//no show more button\n centerPanel.add(mCellTree); \n CellTreeTools.expandAll(mCellTree.getRootTreeNode());\n mCellTree.setAnimationEnabled(true);\n PBarHelper.hide();\n } \n });\n }", "public void dockNodeRestored(DockNodeEvent e) {}", "@Override\n public void reset() {\n setActive(false);\n if (tablePane != null) {\n tablePane.removeAll();\n }\n table = null;\n tablePane = null;\n }", "void deleteTreeRef(TreeNode nodeRef) \n { \n \tif(nodeRef == null) return;\n \t\n \t\n \tdeleteTreeRef(nodeRef.left);\n\n \tdeleteTreeRef(nodeRef.right);\n \t\n \t\n \t System.out.println(\"Deleting node:\" + nodeRef.val);\n \t deleteTree(nodeRef); \n \n nodeRef=null; \n }", "public void destroy() {\n ViewGroup parent = (ViewGroup) getParent();\n if (parent != null) {\n parent.removeView(this);\n }\n mRevealerSpring.destroy();\n }", "void freeTree(treeNode root){\n\n\t\twhile(!treeFinished(root)){\n\t\t\tif(root.lc == null && root.rc == null){\n\t\t\t\troot = root.parent;\n\t\t\t} else if(root.lc == null && root.rc != null){\n\t\t\t\t//Schau ob rc ein Blatt ist\n\t\t\t\tif(isLeaf(root.rc)){\n\t\t\t\t\t//Gebe rechtes Kind frei\n\t\t\t\t\troot.rc.free();\n\t\t\t\t\troot.rc = null;\n\t\t\t\t} else {\n\t\t\t\t\t//Fahre mit rechtem Kind fort\n\t\t\t\t\troot = root.rc;\n\t\t\t\t}\n\t\t\t} else if(root.lc != null) {\n\t\t\t\tif(isLeaf(root.lc)){\n\t\t\t\t\troot.lc.free();\n\t\t\t\t\troot.lc = null;\n\t\t\t\t} else {\n\t\t\t\t\troot = root.lc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\troot.free();\n\n\t}", "private void updateCategoryTree() {\n categoryTree.removeAll();\r\n fillTree(categoryTree);\r\n\r\n }", "@Override\n public void clear() {\n root = null;\n }", "public void revertToSafeDisplay() {\n\t\ttabGroup.revertToSafeDisplay();\n\t}", "@Override\n public void nodeDestroyed(NodeEvent ev) {\n if (ev.getNode().equals(getRootContext())) {\n // node has been deleted\n // [PENDING] better to show a node with a label such as \"<deleted>\"\n // and a tool tip explaining the situation\n setRootContext(Node.EMPTY);\n } else {\n // assume that the node is among currently selected nodes\n final Node n = ev.getNode();\n Runnable r = new Runnable() {\n public void run() {\n scheduleRemove(n);\n }\n };\n if (SCHEDULE_REMOVE_ASYNCH) {\n SwingUtilities.invokeLater(r);\n } else {\n r.run();\n }\n }\n }", "private void deActivateView() {\n if (!isActive()) {\n return;\n }\n setEnabled(false);\n if (editorListener != null) {\n ISelectionService service = getSite().getWorkbenchWindow()\n .getSelectionService();\n if (service != null) {\n service.removePostSelectionListener(editorListener);\n }\n FileBuffers.getTextFileBufferManager().removeFileBufferListener(\n editorListener);\n\n }\n if (textViewer != null && textViewer.getTextWidget() != null\n && !textViewer.getTextWidget().isDisposed()) {\n IDocument document = new Document(\"\");\n textViewer.setDocument(document);\n }\n if (tableControl != null && !tableControl.isDisposed()) {\n setVerifyTableItems(null);\n }\n /*\n * if(stackControl != null && !stackControl.isDisposed()){\n * stackControl.setText(\"\"); } if(lvtControl != null && !lvtControl.isDisposed()){\n * lvtControl.setText(\"\"); }\n */\n if (stackTable != null && !stackTable.isDisposed()) {\n stackTable.removeAll();\n }\n if (lvtTable != null && !lvtTable.isDisposed()) {\n lvtTable.removeAll();\n }\n if (statusControl != null && !statusControl.isDisposed()) {\n updateStatus(null, -1, -1);\n }\n currentSelection = null;\n lastDecompiledResult = null;\n javaEditor = null;\n setJavaInput(null);\n lastChildElement = null;\n setBufferIsDirty(false);\n isActive = false;\n }", "void unsetBox();", "protected abstract AnimationFX resetNode();", "@Override\n public void undo(){\n this.parent.getSelectedArea().clear();\n }" ]
[ "0.63570833", "0.6227573", "0.5964328", "0.59201646", "0.58464634", "0.5807764", "0.57793176", "0.5680599", "0.56556475", "0.56276566", "0.56223804", "0.56189305", "0.55402344", "0.5508049", "0.55004215", "0.54990774", "0.5466417", "0.54606736", "0.545505", "0.5368895", "0.5365652", "0.5338612", "0.53382593", "0.53315717", "0.5277792", "0.52754426", "0.52725154", "0.5264399", "0.5249323", "0.5240878", "0.5229605", "0.521606", "0.5208781", "0.5202691", "0.51964617", "0.5186776", "0.5182459", "0.5181795", "0.5179703", "0.51760226", "0.51611364", "0.51580536", "0.51490945", "0.51452535", "0.51150644", "0.510984", "0.5107847", "0.5102647", "0.50971895", "0.50922763", "0.50539297", "0.50382257", "0.503249", "0.5028244", "0.5012794", "0.50063145", "0.5000296", "0.49973682", "0.49941278", "0.4991433", "0.4989312", "0.4986097", "0.49837333", "0.4982486", "0.4981788", "0.49648598", "0.49531895", "0.4939944", "0.49390388", "0.4926879", "0.49225795", "0.4921381", "0.49177417", "0.49107856", "0.49105433", "0.49103463", "0.49100947", "0.49078277", "0.49066693", "0.48997727", "0.4899097", "0.48963165", "0.48908824", "0.48895928", "0.48894534", "0.4888284", "0.4875514", "0.48730245", "0.48678276", "0.48616225", "0.4858532", "0.4858218", "0.48574033", "0.48533988", "0.4853124", "0.4852718", "0.48502105", "0.48491532", "0.4845807", "0.48426363" ]
0.8659417
0
initializes the tree array and populates it
private void buildTree(int n, double x, double y, double a, double branchLength) { tree = new ArrayList<>(); populateTree(n, x, y, a, branchLength); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[] initializeTree() {\n BST myTree = new BST();\n int[] myArray = {0, 52, 33, 75, 21, 40, 64, 86, 15, 27, 37, 46, 58, 70, 81, 89, 12, 18, 24, 30, 35, 39, 43, 49, 55, 61, 67, 73, 79, 83, 87, 92};\n for (int i = 1; i < myArray.length; i++) {\n myTree.addItem(myArray[i]);\n }\n return myArray;\n }", "public static Node[] initTree(int[] arr){\n int i;\n Node[] tree = new Node[n];\n Node node;\n for(i = 0; i < n; i++){\n node = new Node();\n node.data = arr[i];\n tree[i] = node;\n }\n tree[0].data = arr[0];\n tree[1].data = arr[1];\n tree[2].data = arr[2];\n tree[3].data = arr[3];\n tree[4].data = arr[4];\n tree[5].data = arr[5];\n tree[6].data = arr[6];\n\n tree[0].parent = null;\n tree[0].left = tree[1];\n tree[0].right = tree[2];\n\n tree[1].parent = tree[0];\n tree[1].left = null;\n tree[1].right = tree[3];\n\n tree[2].parent = tree[0];\n tree[2].left = tree[4];\n tree[2].right = null;\n \n tree[3].parent = tree[1];\n tree[3].left = null;\n tree[3].right = null;\n\n tree[4].parent = tree[2];\n tree[4].left = tree[5];\n tree[4].right = tree[6];\n\n tree[5].parent = tree[4];\n tree[5].left = null;\n tree[5].right = null;\n\n tree[6].parent = tree[4];\n tree[6].left = null;\n tree[6].right = null;\n\n root = tree[0];\n return tree; \n }", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "private void setEverything(){\r\n int listLength = propertyList.length -1;\r\n arrayIterator = new ArrayIterator<>(propertyList, listLength+1);\r\n\r\n this.priceTree = new SearchTree<>(new PriceComparator());\r\n this.stockTree = new SearchTree<>(new StockComparator());\r\n this.ratingTree = new SearchTree<>(new RatingComparator());\r\n this.deliveryTree= new SearchTree<>(new DeliveryTimeComparator());\r\n\r\n this.foodArray = new ArrayQueue<>();\r\n this.restaurantArray = new ArrayQueue<>();\r\n\r\n // Fill arrays from property list.\r\n createFoodArray();\r\n arrayIterator.setCurrent(0); //Since the restaurantArray will use the same iterator\r\n createRestaurantArray();\r\n\r\n // Fill Binary Search Trees\r\n createFoodTrees();\r\n createRestaurantTrees();\r\n }", "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t\tvoid init() {\n\t\t\tsetNodes(offHeapService.newArray(JudyIntermediateNode[].class, NODE_SIZE, true));\n\t\t}", "public GenealogyTree(T root) {\r\n tree = (T[]) new Object[SIZE];\r\n tree[0] = root;\r\n }", "private void init() {\n this.listaObjetos = new ArrayList();\n this.root = null;\n this.objeto = new Tblobjeto();\n this.pagina = new Tblpagina();\n this.selectedObj = null;\n this.menus = null;\n this.subMenus = null;\n this.acciones = null;\n this.nodes = new ArrayList<TreeNode>();\n this.selectedObjeto = null;\n this.selectedTipo = null;\n this.renderPaginaForm = null;\n this.renderGrupoForm = null;\n this.selectedGrupo = null;\n this.populateTreeTable();\n }", "public RBTree() {\r\n\t\t// well its supposed just create a new Red Black Tree\r\n\t\t// Maybe create a new one that does a array of Objects\r\n\t}", "protected void init(String tree){\n\t\tJSONObject tree_model = null;\n\t\ttry {\n\t\t\ttree_model = (JSONObject)new JSONParser().parse(tree);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t\tJSONArray phys_tree = (JSONArray)tree_model.get(\"tree_diagram\");\n\t\troot_scheme = new TreeNode();\n\t\tbuildTree(phys_tree,root_scheme);\n\t}", "public void initializeStack(int depth) {\r\n\t\t//Initialize arrays for creating Array Tree\r\n\t\ttreeKey= new int [depth];\r\n\t\ttreeLeft=new int [depth];\r\n\t\ttreeRight= new int [depth];\r\n\t\tfor(int i=0;i<depth;i++) {\r\n\t\t\t//Right column is next available place\r\n\t\t\tsetRight(i,i+1);\r\n\t\t\tsetLeft(i,-1);\r\n\t\t\t//End of array\r\n\t\t\tif(i==depth-1) {\r\n\t\t\t\tsetRight(i,-1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public Tree(E[] arr, String label) {\n root = null;\n treeName = label;\n for (int i = 0; i < arr.length; i++) {\n bstInsert(arr[i]);\n }\n }", "public MyHashMap() {\n array = new TreeNode[1024];\n\n }", "public JdbTree() {\r\n this(new Object [] {});\r\n }", "public JdbNavTree() {\r\n super(new Object [] {});\r\n commonInit();\r\n }", "@Before\n public void prepareTree() {\n tree = new TreeNode();\n nodeOne = new TreeNode();\n nodeTwo = new TreeNode();\n nodeThree = new TreeNode();\n }", "private void init() {\n if (root == null) {\n root = buildRoot();\n }\n }", "private void initTree()\n {\n String currSpell;\n Node tempNode;\n String currString;\n Gestures currGest;\n for(int spellInd = 0; spellInd < SpellLibrary.spellList.length; spellInd++)\n {\n //Start casting a new spell from the root node\n tempNode = root;\n currSpell = SpellLibrary.spellList[spellInd];\n for(int currCharInd =0; currCharInd < currSpell.length(); currCharInd++)\n {\n currString = currSpell.substring(0,currCharInd+1);\n currGest = Gestures.getGestureByChar(currString.charAt(currString.length()-1));\n if(tempNode.getChild(currGest) == null) //Need to add a new node!\n {\n tempNode.addChild(currGest,new Node(currString));\n debug_node_number++;\n }\n //Walk into the existing node\n tempNode = tempNode.getChild(currGest);\n }\n\n }\n }", "private void setup(){\n buildTree(2);\n }", "private void initTrees() {\n // My machine tree init code\n myMachineTree = new FileTree(fileDomainModel);\n myMachineScrollPane.add(myMachineTree);\n // Connected machine tree init code\n connectedMachineTree = new FileTree(fileDomainModel);\n connectedMachineScrollPane.add(connectedMachineTree);\n }", "public JdbTree(Object [] value) {\r\n super(value);\r\n commonInit();\r\n }", "public JdbNavTree(Object [] value) {\r\n super(value);\r\n commonInit();\r\n }", "private void createFoodTrees(){\r\n while(!foodArray.isEmpty()){\r\n Food element= foodArray.dequeue();\r\n priceTree.add(element);\r\n stockTree.add(element);\r\n }\r\n }", "private void createRestaurantTrees() {\r\n while (!restaurantArray.isEmpty()) {\r\n Restaurant element = restaurantArray.dequeue();\r\n ratingTree.add(element);\r\n deliveryTree.add(element);\r\n }\r\n }", "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "public ArrayList<T> constructTree() {\n\t\treturn constructTree(r);\n\t}", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "private void initModel() {\t\n \t\t// build default tree structure\n \t\tif(treeMode == MODE_DEPENDENCY) {\n \t\t\t// don't re-init anything\n \t\t\tif(rootDependency == null) {\n \t\t\t\trootDependency = new DefaultMutableTreeNode();\n \t\t\t\tdepNode = new DefaultMutableTreeNode(); // dependent objects\n \t\t\t\tindNode = new DefaultMutableTreeNode();\n \t\t\t\tauxiliaryNode = new DefaultMutableTreeNode();\n \t\t\t\t\n \t\t\t\t// independent objects \n \t\t\t\trootDependency.add(indNode);\n \t\t\t\trootDependency.add(depNode);\n \t\t\t}\n \t\t\t\n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootDependency);\n \n \t\t\t// add auxiliary node if neccessary\n \t\t\tif(showAuxiliaryObjects) {\n \t\t\t\tif(!auxiliaryNode.isNodeChild(rootDependency)) {\n \t\t\t\t\tmodel.insertNodeInto(auxiliaryNode, rootDependency, rootDependency.getChildCount());\n \t\t\t\t}\n \t\t\t}\n \t\t} else {\n \t\t\t// don't re-init anything\n \t\t\tif(rootType == null) {\n \t\t\t\trootType = new DefaultMutableTreeNode();\n \t\t\t\ttypeNodesMap = new HashMap<String, DefaultMutableTreeNode>(5);\n \t\t\t}\n \t\t\t\n \t\t\t// always try to remove the auxiliary node\n \t\t\tif(showAuxiliaryObjects && auxiliaryNode != null) {\n \t\t\t\tmodel.removeNodeFromParent(auxiliaryNode);\n \t\t\t}\n \n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootType);\n \t\t}\n \t}", "private void buildRoot() {\n this.root = new GPRootTreeNode(this.tree);\n }", "public static void InitLattice(int maxLevel)\n\t{\n\t\ttheArray = new Node[maxLevel][maxLevel];\n\t\tfor (int r = 0; r < maxLevel; r++) {\n\t\t\tfor (int c = 0; c < maxLevel -r; c++)\n\t\t\t{\n\t\t\t\ttheArray[r][c] = new Node();\n\t\t\t\ttheArray[r][c].item = 0; \n } \n }\n\t\troot = theArray[0][0];\n }", "public void init$Children() {\n children = new ASTNode[1];\n }", "public TreeNode() { \n this.name = \"\"; \n this.rule = new ArrayList<String>(); \n this.child = new ArrayList<TreeNode>(); \n this.datas = null; \n this.candAttr = null; \n }", "public RBTree() {\n\t\troot = null;\n\t\tdrawer = new RBTreeDrawer();\n\t}", "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}", "public void init() {\n\t\tfor (Node node : nodes)\n\t\t\tnode.init();\n\t}", "public Tree(){\n root = null;\n }", "public RBTree() {\r\n\t\troot = null;\r\n\t}", "private void initialize() {\n\n\t\tint totalSets, iSet;\n\t\tInformationSet infoSet = null;\n\t\tTreeNode treeNode = null;\n\n\t\tArrayList informationSetList = efg.getInformationSets(iPlayer);\n\n\t\ttotalSets = informationSetList.size();\n\n\t\tmovesLists = new ArrayList[totalSets];\n\t\tprobsLists = new ArrayList[totalSets];\n\n\t\tfor (iSet = 0; iSet < totalSets; iSet++) {\n\t\t\tmovesLists[iSet] = new ArrayList();\n\t\t\tprobsLists[iSet] = new ArrayList();\n\t\t}\n\n\t\tfor (iSet = 0; iSet < totalSets; iSet++) {\n\t\t\tinfoSet = (InformationSet) informationSetList.get(iSet);\n\t\t\ttreeNode = infoSet.getTreeNode(0);\n\t\t\tmovesLists[iSet] = treeNode.getMovesList();\n\t\t}\n\t}", "public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }", "public KdTree() {\n size = 0;\n }", "public BSearchTree() {\n\t\tthis.overallRoot = null;\n\t}", "public Tree() // constructor\n\t{ root = null; }", "public void BuildTree() {\n MerkleTree tmpMerkleTree = new MerkleTree();\n\n //assign core information into this block from merkleTree\n this.merkleRoot = tmpMerkleTree.getMerkleRoot();\n this.blockBody = tmpMerkleTree;\n }", "private void initSubNodes()\n {\n children = createSubNodes(false);\n attributes = createSubNodes(true);\n }", "public static void build ()\r\n {\r\n lgt.insert(1);\r\n lgt.insert(2);\r\n lgt.insert(5);\r\n \r\n lgt.findRoot();\r\n lgt.insert(3);\r\n \r\n lgt.findRoot();\r\n lgt.insert(4);\r\n \r\n lgt.insert(6);\r\n lgt.findParent();\r\n lgt.insert(7);\r\n \r\n }", "private void initialize() {\r\n\r\n\t\tserverNode = new TreeParent(\"Servers\", \"Servers\", \"AA\", this);\r\n\t\tserverNode.setImageKey(\"System.gif\");\r\n\r\n\t\tnewServerNode = new TreeParent(\"NewServerWizard\", \"New Server\", \"AA\", this);\r\n\t\tnewServerNode.setImageKey(\"ApplicationFilter.gif\");\r\n\t\tnewServerNode.setExpandable(false);\r\n\t\tserverNode.addChild(newServerNode);\r\n\t\tnewServerNode.addChild(new TreeObject(\"Dummy\"));\r\n\t\r\n\t\tloadServers(serverNode);\r\n\r\n\t\tpreferenceNode = new TreeParent(\"Systems\", \"Preferences\", \"BB\", this);\r\n\t\tpreferenceNode.setImageKey(\"preference_page.gif\");\r\n\t\tpreferenceNode.addChild(new TreeObject(\"Dummy\"));\r\n\r\n\t\tinvisibleRoot = new TreeParent(\"\", \"InvisibleRoot\", \"AA\", this);\r\n\t\tinvisibleRoot.addChild(serverNode);\r\n\t\tinvisibleRoot.addChild(preferenceNode);\r\n\r\n\t}", "public Node(int numberChildren){\n board = new Board();\n children = new Node[numberChildren];\n }", "private void initialize() {\n\t\t\ttry {\n\t\t\t\tFMAOBO fmaobo = new FMAOBO();\n\t\t\t\tTA ta = new TA (fmaobo);\n\t\t\t\tBp3d bp3d = new Bp3d();\n\t\t\t\t\t\t\t\t\n\t\t\t\tMap<String, TreeParent> treeParents = \n\t\t\t\t\tnew TreeMap<String, TreeParent>();\n\t\t\t\tMap<String, TreeObject> treeObjects = \n\t\t\t\t\tnew TreeMap<String, TreeObject>();\n\t\t\t\t\t\t\t\t\n\t\t\t\t/** TreeParent/TreeObject作成**/\n\t\t\t\tfor(String id : bp3d.getAllIds()){\t\t\t\t\n\t\t\t\t\tString label = \"\";\n\n\t\t\t\t\tif(ta.contains(id)){\n\t\t\t\t\t\tSet<String> taIds = new TreeSet<String>();\n\t\t\t\t\t\tSet<String> taKanjis = new TreeSet<String>();\n\t\t\t\t\t\tfor(TAEntry taEnt : ta.getTAByFmaId(id)){\n\t\t\t\t\t\t\ttaIds.add(taEnt.getTaId());\n\t\t\t\t\t\t\ttaKanjis.add(taEnt.getTaKanji());\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tlabel = Bp3dUtility.join(taIds, \"/\") + \":\" + bp3d.getEntry(id).getEn() \n\t\t\t\t\t\t\t+ \":\" + Bp3dUtility.join(taKanjis, \"/\");\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\tlabel = id + \":\" + bp3d.getEntry(id).getEn();\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(bp3d.hasChild(id)){\n\t\t\t\t\t\ttreeParents.put(id, new TreeParent(label));\n\t\t\t\t\t}else{\n\t\t\t\t\t\ttreeObjects.put(id, new TreeObject(label));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/** addChild **/\n\t\t\t\tfor(String pid : bp3d.getReverseMemberOfs().keySet()){\n\t\t\t\t\tTreeParent parent = treeParents.get(pid);\n\t\t\t\t\tfor(String cid : bp3d.getChildren(pid)){\n\t\t\t\t\t\tif(bp3d.hasChild(cid)){\n\t\t\t\t\t\t\tparent.addChild(treeParents.get(cid));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(parent == null){\n\t\t\t\t\t\t\t\tSystem.out.println(\"parent pid=null:\" + pid + \":\" + bp3d.getEntry(pid).getEn());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tparent.addChild(treeObjects.get(cid));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/** parentのないノードをrootにぶら下げる**/\n\t\t\t\tinvisibleRoot = new TreeParent(\"\");\n\t\t\t\t\n\t\t\t\tfor(String id : bp3d.getAllIds()){\n\t\t\t\t\tif(!bp3d.hasParent(id)){\n//\t\t\t\t\t\tSystem.out.println(id + \" has no parent.\");\n\t\t\t\t\t\tif(bp3d.hasChild(id)){\n\t\t\t\t\t\t\tinvisibleRoot.addChild((TreeParent)(treeParents.get(id)));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tinvisibleRoot.addChild((TreeObject)(treeObjects.get(id)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\t\n\t\t}", "public void reset() {\r\n\t\tfor (int i = 0; i < trees.length; i++)\r\n\t\t\ttrees[i] = new GameTree(i);\r\n\t\tprepare();\r\n\t}", "public HIRTree(){\r\n\t\t\r\n\t}", "int[][] constructTree(ArrayList<Integer> arr, int n)\n {\n int x = (int)(Math.ceil(Math.log(n)/Math.log(2))); // Height of the tree\n\n int max_size = 2 * (int)Math.pow(2, x) - 1;\n int[][] tree = new int[max_size][4];\n\n build(tree, 0, n - 1, 1, arr);\n return tree;\n }", "public IntTree() {\n overallRoot = null;\n }", "public BinaryTree()\r\n\t{\r\n\t\t// Initialize field values\r\n\t\tthis.counter = 0;\r\n\t\tthis.arrayCounter = 0;\r\n\t\tthis.root = null;\r\n\t}", "public TwoFourTree()\r\n\t{\r\n\t\troot = new TreeNode(); //assign the root to a new tree node\r\n\t}", "public RoutingTree(int size){\r\n\t\tthis.routes = new Route[size];\r\n\t}", "FractalTree() {\r\n }", "private void initialize() {\r\n\t\tGridBagConstraints gridBagConstraints = new GridBagConstraints();\r\n\t\tgridBagConstraints.anchor = GridBagConstraints.NORTHWEST;\r\n\t\tgridBagConstraints.weightx = 1.0D;\r\n\t\tgridBagConstraints.weighty = 1.0D;\r\n\t\tgridBagConstraints.fill = GridBagConstraints.BOTH;\r\n\t\tthis.setLayout(new GridBagLayout());\r\n\t\tthis.setBorder(BorderFactory.createLineBorder(Color.gray, 1));\r\n\t\tthis.add(getJTree(), gridBagConstraints);\r\n\t}", "public JdbNavTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "private Node constructParsedTree(Node[] nodes) {\n int rootIndex = 0;\n for (int i = 0; i < nodes.length; i++) {\n if (nodes[i].getFather() > 0)\n nodes[nodes[i].getFather() - 1].addChild(nodes[i]);\n else\n rootIndex = i;\n }\n return nodes[rootIndex];\n }", "public TreeList()\n {\n\t this.lst = new AVLTree();\n\t this.length = 0;\n }", "public StaticTree (int depth) {\r\n\t\tinitializeStack(depth);\r\n\t\t//Initialize root for an empty tree\r\n\t\tthis.root=-1;\r\n\t\t//First available position when creating a new Tree\r\n\t\tthis.avail=0;\r\n\t\tcompares=0;\r\n\t\torderedArray=new int[depth];\r\n\t}", "public TreeNode(){ this(null, null, 0);}", "public TreeNode() {\n }", "private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}", "public KdTree() {\n root = null;\n n = 0;\n }", "public Tree(ArrayList<E> arr, String label, int height) {\n this.treeName = label;\n root = buildTree(arr, height, null);\n }", "private static SVIntervalTree<String> initTree() {\n final SVIntervalTree<String> tree = new SVIntervalTree<>();\n final String[] genes = {\"A\", \"B\", \"C\", \"D\", \"E\"};\n if (transcriptionStartSites.length != genes.length) {\n throw new TestException(\"Transcription start sites list and genes array are not the same length\");\n }\n for ( int idx = 0; idx < genes.length; ++idx ) {\n tree.put(transcriptionStartSites[idx], genes[idx]);\n }\n return tree;\n }", "public void populateTreeTable() {\n root = new DefaultTreeNode(\"root\", null);\n Session session = HibernateUtil.getSessionFactory().openSession();\n try {\n String sqlMenu = \"SELECT o from Tblobjeto o WHERE o.tipoObjeto LIKE 'menu' ORDER BY o.idObjeto\";\n menus = session.createQuery(sqlMenu).list();\n\n for (Tblobjeto mnu : menus) {\n TreeNode nodeMenu = new DefaultTreeNode(mnu, root);\n nodes.add(nodeMenu);\n\n Criteria cMenu = session.createCriteria(Tblobjeto.class);\n cMenu.add(Restrictions.eq(\"tblobjeto\", mnu));\n subMenus = (List<Tblobjeto>) cMenu.list();\n\n for (Tblobjeto smnu : subMenus) {\n TreeNode nodeSubMenu = new DefaultTreeNode(smnu, nodeMenu);\n nodes.add(nodeSubMenu);\n\n Criteria cSubMenu = session.createCriteria(Tblobjeto.class);\n cSubMenu.add(Restrictions.eq(\"tblobjeto\", smnu));\n acciones = (List<Tblobjeto>) cSubMenu.list();\n\n for (Tblobjeto ac : acciones) {\n nodes.add(new DefaultTreeNode(ac, nodeSubMenu));\n }\n }\n }\n } catch (HibernateException e) {\n logger.throwing(getClass().getName(), \"ObjetosBean\", e);\n } finally {\n session.close();\n }\n }", "public BinaryTree()\n {\n //this is the constructor for the BinaryTree object\n data = null;\n left = null;\n right = null;\n }", "public static void populateTree(BinarySearchTree tree)\n {\n for(int i = 0; i < 20; i++)\n {\n tree.add(i);\n }\n }", "public void init$Children() {\n children = new ASTNode[3];\n setChild(new List(), 1);\n setChild(new List(), 2);\n }", "@Override\r\n\tpublic void buildTree() {\r\n\t\t\r\n\t\t// root level \r\n\t\trootNode = new TreeNode<String>(\"\");\r\n\t\t\r\n\t\t//first level\r\n\t\tinsert(\".\", \"e\");\r\n\t\tinsert(\"-\", \"t\");\r\n\t\t\r\n\t\t//second level\r\n\t\t\r\n\t\tinsert(\". .\", \"i\");\r\n\t\tinsert(\".-\", \"a\");\r\n\t\tinsert(\"-.\", \"n\"); \r\n\t\tinsert(\"--\", \"m\");\r\n\t\t\r\n\t\t//third level\r\n\t\tinsert(\"...\", \"s\");\r\n\t\tinsert(\"..-\", \"u\");\r\n\t\tinsert(\".-.\", \"r\");\r\n\t\tinsert(\".--\", \"w\");\r\n\t\tinsert(\"-..\", \"d\");\r\n\t\tinsert(\"-.-\", \"k\");\r\n\t\tinsert(\"--.\", \"g\");\r\n\t\tinsert(\"---\", \"o\");\r\n\t\t\r\n\t\t//fourth level\r\n\t\tinsert(\"....\", \"h\");\r\n\t\tinsert(\"...-\", \"v\");\r\n\t\tinsert(\"..-.\", \"f\");\r\n\t\tinsert(\".-..\", \"l\");\r\n\t\tinsert(\".--.\", \"p\");\r\n\t\tinsert(\".---\", \"j\");\r\n\t\tinsert(\"-...\", \"b\");\r\n\t\tinsert(\"-..-\", \"x\");\r\n\t\tinsert(\"-.-.\", \"c\");\r\n\t\tinsert(\"-.--\", \"y\");\r\n\t\tinsert(\"--..\", \"z\");\r\n\t\tinsert(\"--.-\", \"q\");\r\n\t\t\r\n\t}", "public void populateBinaryTrees(){\n\t\tIndex[] codeIndexes = readIndexes(new File(ApplicationConstants.CODE_INDEX_FILE));\n\t\tIndex[] nameIndexes = readIndexes(new File(ApplicationConstants.NAME_INDEX_FILE));\n\n\t\tcreateIndexBinaryTree(codeIndexes, MainScreen.codeIndexTree);\n\t\tcreateIndexBinaryTree(nameIndexes, MainScreen.nameIndexTree);\n\n\t}", "private void loadInitialTree() {\n navTreeWidget.addItem( \"Please wait...\" );\n DeferredCommand.addCommand(new Command() {\n\t\t\tpublic void execute() {\n\t\t service.loadChildCategories( \"/\",\n\t\t new GenericCallback() {\n\n\n\t\t public void onSuccess(Object result) {\n\t\t selectedPath = null;\n\t\t navTreeWidget.removeItems();\n\n\t\t TreeItem root = new TreeItem();\n\t\t root.setHTML(\"<img src=\\\"images/desc.gif\\\"/>\");\n\t\t navTreeWidget.addItem(root);\n\n\t\t String[] categories = (String[]) result;\n\n\t\t if (categories.length == 0) {\n\t\t showEmptyTree();\n\t\t } else {\n\t\t hideEmptyTree();\n\t\t }\n\t\t for ( int i = 0; i < categories.length; i++ ) {\n\t\t TreeItem it = new TreeItem();\n\t\t it.setHTML( \"<img src=\\\"images/category_small.gif\\\"/>\" + categories[i] );\n\t\t it.setUserObject( categories[i] );\n\t\t it.addItem( new PendingItem() );\n\t\t root.addItem( it );\n\t\t }\n\n\t\t root.setState(true);\n\t\t }\n\n\n\n\t\t } );\n\t\t\t}}\n );\n\n }", "public TreeNode(String syscall){\r\n\t\t\tthis.syscall = syscall;\r\n\t\t\tchildren = new ArrayList<TreeNode>();\r\n\t\t\tfrequency = 0;\r\n\t\t\t//parent = null;\r\n\t\t\tindex = -1;\r\n\t\t}", "public JdbTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public MorseCodeTree()\r\n\t{\r\n\t\tbuildTree();\r\n\t}", "public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }", "static TreeNode createTree(TreeNode root, int[] arr, int index) {\r\n\t\t\r\n\t\tif (index < arr.length) {\r\n\t\t\tTreeNode tmp = null;\r\n\t\t\tif (arr[index]>=0) {\r\n\t\t\t\ttmp = new TreeNode(arr[index]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttmp = null;\r\n\t\t\t}\r\n\t\t\troot= tmp;\r\n\t\t\t\r\n\t\t\tif (root != null) {\r\n\t\t\t\troot.left = createTree(tmp.left,arr,index*2+1);\r\n\t\t\t\troot.right = createTree(tmp.right,arr,index*2+2);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn root;\r\n\t}", "static TreeNode createTree(TreeNode root, int[] arr, int index) {\r\n\t\t\r\n\t\tif (index < arr.length) {\r\n\t\t\tTreeNode tmp = null;\r\n\t\t\tif (arr[index]>=0) {\r\n\t\t\t\ttmp = new TreeNode(arr[index]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttmp = null;\r\n\t\t\t}\r\n\t\t\troot= tmp;\r\n\t\t\t\r\n\t\t\tif (root != null) {\r\n\t\t\t\troot.left = createTree(tmp.left,arr,index*2+1);\r\n\t\t\t\troot.right = createTree(tmp.right,arr,index*2+2);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn root;\r\n\t}", "public void init$Children() {\n children = new ASTNode[2];\n setChild(new List(), 1);\n }", "public TreeBuilder() {\n\t\troot = null;\n\t}", "public BinaryTree() {\n count = 0;\n root = null;\n }", "public void setUp() {\r\n tree = new Lab14BinarySearchTree<String>();\r\n }", "public void init$Children() {\n children = new ASTNode[3];\n setChild(new List(), 1);\n setChild(new Opt(), 2);\n }", "public KdTree()\n {\n root = null;\n size = 0;\n }", "private void initChildList() {\n if (childList == null) {\n childList = new ArrayList<>();\n }\n }", "public JdbNavTree(TreeNode root) {\r\n super(root);\r\n commonInit();\r\n }", "protected void buildHirarchyTree() {\r\n\t\tfor(SupplyZone s : supplyZoneLines){\r\n\t\t\tZoneNode currentZone = zoneNodeMap.get(s.getZoneName());\r\n\t\t\tZoneNode parentZone = zoneNodeMap.get(s.getParentZoneName());\r\n\t\t\tif(parentZone == null){\r\n\t\t\t\tzonesTreeRoot = currentZone;\r\n\t\t\t}\r\n\t\t\tcurrentZone.setParent(parentZone);\r\n\t\t\tif (parentZone != null) parentZone.addChild(currentZone); \r\n\t\t}\r\n\r\n\t}", "public AVLTree() {\n\t\tthis.root = null;\n\t}", "public RedBlackTree()\n { \n \t root = null;\n }", "public Data(SearchTree<Software> dataStructure){\n administratorMyArray = new ArrayList<>();\n IDList = new ArrayList<>();\n products = dataStructure;\n money=0.0;\n }", "public AVLTree() {\r\n\r\n\r\n this.root = new AVLTreeNode(9);\r\n Delete(9);\r\n }", "public AVLTree() \r\n\t{\r\n\t\tthis.root = new AVLNode(null);\r\n\t}", "public void convertBSTtoArray(){\r\n\t\tconvertBSTtoArray(BST.root) ;\r\n\t}", "public void treeSort() {\n MyTree tree = new MyTree((Comparable) array[0]);\n for (int i = 1; i < array.length; i++) {\n tree = MyTree.insert(tree, (Comparable) array[i]);\n }\n Object[] treeArray = MyTree.inorder(tree).toArray();\n for (int i = 0; i < array.length; i++) {\n array[i] = (T) treeArray[i];\n }\n\n }", "public TrieNode() {\n this.arr = new TrieNode[26];\n }", "private void buildBinaryTree() {\n log.info(\"Constructing priority queue\");\n Huffman huffman = new Huffman(cache.vocabWords());\n huffman.build();\n\n log.info(\"Built tree\");\n\n }" ]
[ "0.7268921", "0.7044916", "0.7042618", "0.69291246", "0.68158394", "0.68158394", "0.6808646", "0.6805295", "0.67891484", "0.6656674", "0.65560013", "0.6548724", "0.6520185", "0.6495217", "0.64779013", "0.63851863", "0.63804877", "0.63701475", "0.6325351", "0.63131696", "0.6311277", "0.6305866", "0.62901926", "0.6282907", "0.62610394", "0.6255639", "0.6223613", "0.61990935", "0.6196804", "0.61953944", "0.6191934", "0.61869216", "0.6184509", "0.6183226", "0.61426514", "0.6137872", "0.6129824", "0.61099905", "0.60563594", "0.6040492", "0.6034364", "0.6033976", "0.6015019", "0.60134697", "0.6005309", "0.5957354", "0.59419936", "0.593883", "0.59368056", "0.59303254", "0.5919476", "0.59050816", "0.5899288", "0.5899034", "0.5896972", "0.5894343", "0.58856857", "0.58842325", "0.5878296", "0.5872794", "0.58714294", "0.58692044", "0.5865829", "0.58589476", "0.585141", "0.58500206", "0.5848131", "0.58355445", "0.5835095", "0.58328086", "0.5831359", "0.582628", "0.5815551", "0.58145475", "0.58141327", "0.5810809", "0.5803455", "0.5800997", "0.57975864", "0.57956153", "0.5792803", "0.5792803", "0.5786943", "0.57862335", "0.57814574", "0.5781011", "0.5779419", "0.5773875", "0.57645", "0.575787", "0.5757341", "0.5754734", "0.5754256", "0.57541734", "0.57511145", "0.5745426", "0.57420295", "0.5740603", "0.57389504", "0.57349235" ]
0.6354159
18
Generic method for "curving" the branch wither ratio
private double curveBranchWitherRatio(int n){ return Math.pow(((double)n / (double)inputN), inputBranchWitherRatio); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getBranchProbability();", "private void reduce() {\n int gcd = gcd(this.numerator, this.denominator);\n this.numerator = this.numerator / gcd;\n this.denominator = this.denominator / gcd;\n }", "double getRatio();", "private void reduce() {\n /** The fraction is equal to 0. The numerator is 0 in this case */\n if(this.numerator == 0)\n this.denominator = 1;\n /** The numerator and denominator are not equal */\n else if (this.numerator != this.denominator) {\n\n /** The greatest common divisor of the numerator and denominator of this fraction */\n int gcd = getGCD(Math.abs(this.numerator), Math.abs(this.denominator));\n\n /** There is a greatest common divisor greater than 1 */\n if (gcd > 1) {\n this.numerator /= gcd;\n this.denominator /= gcd;\n }\n } \n /** The fraction is equal to 1 */\n else {\n this.numerator = 1;\n this.denominator = 1;\n }\n }", "protected abstract float _getGrowthChance();", "private void hAndBF(Node<T> current) {\n int h = Math.max(findHeight(current.getLeft()),\n findHeight(current.getRight())) + 1;\n current.setHeight(h);\n int bf = findHeight(current.getLeft()) - findHeight(current.getRight());\n current.setBalanceFactor(bf);\n }", "public void reduce() {\n\tint g = this.gcd();\n\tif ( g != 0 ) {\n\t numerator /= g;\n\t denominator /= g;\n\t}\n }", "private TreeNode getBranch(TreeNode treeNode, int sel) {\n TreeNode ret = null;\n int i = 0, prevCardinal = 1;\n if(sel == 0 && !treeNode.isLeaf()){\n return treeNode;\n }\n if(treeNode.isLeaf()){\n return null;\n }\n while(ret == null && i <treeNode.getChildren().length){\n ret = getBranch(treeNode.getChildren()[i], sel - prevCardinal);\n prevCardinal += treeNode.getChildren()[i].getHeight() - getLeafCardinal(treeNode.getChildren()[i]);\n i++;\n }\n return ret;\n }", "private float ratioToValue (float ratio){\n return ratio * (mMax - mMin) + mMin;\n }", "protected abstract double getReductionFactor();", "public void Reduce() {\n\t\tint gcd = MathHelper.GreatestCommonDivisor(this.numerator, this.denominator);\n\t\t\n\t\t// avoid divide by 0\n\t\tif (gcd > 0) {\n\t\t\tthis.numerator = this.numerator / gcd;\n\t\t\tthis.denominator = this.denominator / gcd;\n\t\t}\n\t}", "public abstract void bepaalGrootte();", "@Override\n protected SearchResponse compute() {\n if (this.searchRoot.children == null || this.searchRoot.children.isEmpty()) {\n return new SearchResponse(searchRoot.weight, null);\n }\n\n // Search child nodes recursively\n List<UnbalancedNodeSearcher> subtasks = new ArrayList<>(searchRoot.children.size());\n for (Node n : searchRoot.children) {\n UnbalancedNodeSearcher subtask = new UnbalancedNodeSearcher(n);\n subtasks.add(subtask);\n subtask.fork();\n }\n\n // Use a map to vote for the \"wrong\"(i.e. minority) disc weight\n Map<Long, AtomicLong> totalWeight = new HashMap<>();\n\n // To find out who reported the \"wrong\" weight\n Map<Long, Node> resultNodeMap = new HashMap<>();\n for (UnbalancedNodeSearcher searcher : subtasks) {\n SearchResponse response = searcher.join();\n\n // The search is over\n if (response.foundResult != null) {\n return response;\n }\n\n resultNodeMap.put(response.subSum, searcher.searchRoot);\n\n totalWeight.computeIfAbsent(response.subSum, (i) -> new AtomicLong(0L)).incrementAndGet();\n }\n\n if (totalWeight.size() == 1) {\n // Since there's only one\n long subtotal = totalWeight.keySet().iterator().next();\n long total = subtotal * subtasks.size() + searchRoot.weight;\n\n return new SearchResponse(total, null);\n } else if (totalWeight.size() == 2) {\n long correctWeight = -1;\n long wrongWeight = -1;\n for (Map.Entry<Long, AtomicLong> entry : totalWeight.entrySet()) {\n if (entry.getValue().get() != 1L) {\n correctWeight = entry.getKey();\n } else {\n wrongWeight = entry.getKey();\n }\n }\n\n return new SearchResponse(null, resultNodeMap.get(wrongWeight).weight - (wrongWeight - correctWeight));\n } else {\n throw new RuntimeException(\"More than one incorrect nodes\");\n }\n }", "private int balanceFactor() {\n return height(this.rightChild) - height(this.leftChild);\n }", "public void reduce()\n\t{\n\t\tint divider = getGCD(myNumerator, myDenominator);\n\t\tmyNumerator /= divider;\n\t\tmyDenominator /= divider;\n\t}", "private void computeRatio() {\n int i;\n int i2;\n int i3;\n boolean z = false;\n if (CameraSettings.getStrictAspectRatio(this.mRenderWidth, this.mRenderHeight) > -1 || !CameraSettings.isNearAspectRatio(this.mCameraWidth, this.mCameraHeight, this.mRenderWidth, this.mRenderHeight)) {\n int i4 = this.mCameraWidth;\n int i5 = this.mCameraHeight;\n switch (this.mTargetRatio) {\n case 0:\n this.mIsFullScreen = false;\n this.mIsRatio16_9 = false;\n if (!CameraSettings.isAspectRatio4_3(i4, i5)) {\n this.mNeedCropped = true;\n if (i4 * 4 > i5 * 3) {\n int i6 = (int) (((float) i5) * 0.75f);\n this.mScaleX = ((float) i6) / ((float) i4);\n i4 = i6;\n } else {\n int i7 = (int) ((((float) i4) * 4.0f) / 3.0f);\n this.mScaleY = ((float) i7) / ((float) i5);\n i5 = i7;\n }\n } else {\n this.mNeedCropped = false;\n this.mScaleX = 1.0f;\n this.mScaleY = 1.0f;\n }\n if (CameraSettings.sCroppedIfNeeded) {\n this.mIsFullScreen = true;\n this.mNeedCropped = true;\n this.mIsRatio16_9 = true;\n i = (int) ((((float) i4) * 16.0f) / 9.0f);\n this.mScaleX *= 0.75f;\n } else {\n i = i5;\n }\n if (b.isPad()) {\n this.mIsFullScreen = true;\n break;\n }\n break;\n case 1:\n this.mIsRatio16_9 = true;\n this.mIsFullScreen = true;\n if (!CameraSettings.isAspectRatio16_9(i4, i5)) {\n this.mNeedCropped = true;\n if (i4 * 16 <= i5 * 9) {\n int i8 = (int) ((((float) i4) * 16.0f) / 9.0f);\n this.mScaleY = ((float) i8) / ((float) i5);\n int i9 = i8;\n i2 = i4;\n i3 = i9;\n if (b.isPad()) {\n this.mIsRatio16_9 = false;\n this.mNeedCropped = true;\n i3 = (int) (((float) i3) * 0.75f);\n this.mScaleY *= 0.75f;\n }\n i = i3;\n i4 = i2;\n break;\n } else {\n i2 = (int) ((((float) i5) * 9.0f) / 16.0f);\n this.mScaleX = ((float) i2) / ((float) i4);\n }\n } else {\n this.mNeedCropped = false;\n this.mScaleX = 1.0f;\n this.mScaleY = 1.0f;\n i2 = i4;\n }\n i3 = i5;\n if (b.isPad()) {\n }\n i = i3;\n i4 = i2;\n case 2:\n this.mIsFullScreen = false;\n this.mIsRatio16_9 = false;\n this.mNeedCropped = true;\n if (i4 != i5) {\n this.mScaleX = 1.0f;\n this.mScaleY = ((float) i4) / ((float) i5);\n i = i4;\n break;\n }\n default:\n i = i5;\n break;\n }\n this.mWidth = i4;\n this.mHeight = i;\n } else if (!(this.mCameraWidth == 0 || this.mCameraHeight == 0)) {\n if (this.mRenderWidth == 0 || this.mRenderHeight == 0 || this.mRenderWidth * this.mCameraHeight == this.mRenderHeight * this.mCameraWidth) {\n this.mNeedCropped = false;\n this.mScaleX = 1.0f;\n this.mScaleY = 1.0f;\n this.mWidth = this.mCameraWidth;\n this.mHeight = this.mCameraHeight;\n } else {\n this.mNeedCropped = true;\n if (this.mCameraWidth * this.mRenderHeight > this.mCameraHeight * this.mRenderWidth) {\n this.mHeight = this.mCameraHeight;\n this.mWidth = (this.mCameraHeight * this.mRenderWidth) / this.mRenderHeight;\n this.mScaleX = ((float) this.mWidth) / ((float) this.mCameraWidth);\n this.mScaleY = 1.0f;\n } else {\n this.mWidth = this.mCameraWidth;\n this.mHeight = (this.mCameraWidth * this.mRenderHeight) / this.mRenderWidth;\n this.mScaleX = 1.0f;\n this.mScaleY = ((float) this.mHeight) / ((float) this.mCameraHeight);\n }\n }\n if ((((float) this.mRenderHeight) / ((float) this.mRenderWidth)) - (((float) Util.sWindowHeight) / ((float) Util.sWindowWidth)) < 0.1f) {\n z = true;\n }\n this.mIsFullScreen = z;\n }\n updateRenderSize();\n updateRenderRect();\n }", "public PriorityColor recalculateBranchColors(long level) {\n if (currentColor == null) {\n currentColor = new PriorityColor(nodeColor);\n }\n level++;\n if (children.size() == 0) {\n Context.getInstance().getEventQueue().add(new EventCandidate(nodeId, currentColor, level));\n return new PriorityColor(currentColor);\n }\n PriorityColor topPriorityColor = new PriorityColor(nodeColor);\n for (Node child : children) {\n PriorityColor childPriorityColor = child.recalculateBranchColors(level);\n if (childPriorityColor.getPriority() > topPriorityColor.getPriority()) {\n topPriorityColor = new PriorityColor(childPriorityColor);\n }\n }\n currentColor = topPriorityColor;\n Context.getInstance().getEventQueue().add(new EventCandidate(nodeId, currentColor, level));\n return topPriorityColor;\n }", "private void calculateBalancingFactors(boolean originChanged, \n boolean destinationChanged){\n\n //create a variable to hold the sum of denominator values\n double denominator = 0.0;\n //cycle the destinations\n for(int jLocal = 0; jLocal < data.getDestination().length; jLocal++){\n \n //Sum all of the destination calculations for \n //this origin into the denominator variable\n denominator += ( Math.pow(data.getDestination()[jLocal], alpha) \n * Math.exp(data.getDistance(i, jLocal) * beta) );\n\n\n //end destination cycle\n }\n //finally calculate the Ai value\n ai = 0.0;\n //check to make sure denominator > 0 so no div by 0 error\n if ( denominator != 0.0 ){\n ai = 1/denominator;\n }\n \n }", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "@Override\n public double proposal() {\n Tree tree = treeInput.get();\n\n Node node;\n if (useNodeNumbers) {\n int leafNodeCount = tree.getLeafNodeCount();\n int i = Randomizer.nextInt(leafNodeCount);\n node = tree.getNode(i);\n } else {\n int i = Randomizer.nextInt(taxonIndices.length);\n node = tree.getNode(taxonIndices[i]);\n }\n\n double value = node.getHeight();\n\n if (value == 0.0) {\n return Double.NEGATIVE_INFINITY;\n }\n double newValue = value;\n\n boolean drawFromDistribution = samplingDateTaxonNames.contains(node.getID());\n if (drawFromDistribution) {\n SamplingDate taxonSamplingDate = samplingDatesInput.get().get(samplingDateTaxonNames.indexOf(node.getID()));\n double range = taxonSamplingDate.getUpper() - taxonSamplingDate.getLower();\n newValue = taxonSamplingDate.getLower() + Randomizer.nextDouble() * range;\n } else {\n if (useGaussian) {\n newValue += Randomizer.nextGaussian() * windowSize;\n } else {\n newValue += Randomizer.nextDouble() * 2 * windowSize - windowSize;\n }\n }\n\n\n Node fake = null;\n double lower, upper;\n\n if (((ZeroBranchSANode)node).isDirectAncestor()) {\n fake = node.getParent();\n lower = getOtherChild(fake, node).getHeight();\n if (fake.getParent() != null) {\n upper = fake.getParent().getHeight();\n } else upper = Double.POSITIVE_INFINITY;\n } else {\n //lower = Double.NEGATIVE_INFINITY;\n lower = 0.0;\n upper = node.getParent().getHeight();\n }\n\n if (newValue < lower || newValue > upper) {\n return Double.NEGATIVE_INFINITY;\n }\n\n if (newValue == value) {\n // this saves calculating the posterior\n return Double.NEGATIVE_INFINITY;\n }\n\n if (fake != null) {\n fake.setHeight(newValue);\n }\n node.setHeight(newValue);\n\n if (newValue < 0) {\n for (int i=0; i<tree.getNodeCount(); i++){\n double oldHeight = tree.getNode(i).getHeight();\n tree.getNode(i).setHeight(oldHeight-newValue);\n }\n } else {\n boolean dateShiftDown = true;\n for (int i=0; i< tree.getLeafNodeCount(); i++){\n if (tree.getNode(i).getHeight() == 0){\n dateShiftDown = false;\n break;\n }\n }\n if (dateShiftDown) {\n ArrayList<Double> tipNodeHeights= new ArrayList<Double>();\n for (int i=0; i<tree.getLeafNodeCount(); i++){\n tipNodeHeights.add(tree.getNode(i).getHeight());\n }\n Collections.sort(tipNodeHeights);\n double shiftDown = tipNodeHeights.get(0);\n for (int i=0; i<tree.getNodeCount(); i++){\n double oldHeight = tree.getNode(i).getHeight();\n tree.getNode(i).setHeight(oldHeight-shiftDown);\n }\n }\n }\n\n boolean check = true;\n for (int i=0; i<tree.getNodeCount(); i++){\n if (tree.getNode(i).getHeight() < 0) {\n System.out.println(\"Negative height found\");\n System.exit(0);\n }\n if (tree.getNode(i).getHeight() == 0) {\n check = false;\n }\n }\n if (check) {\n System.out.println(\"There is no 0 height node\");\n System.exit(0);\n }\n\n //tree.setEverythingDirty(true);\n\n return 0.0;\n }", "int getRatioQuantity();", "public abstract double getFractionMultiplier();", "private double loadFactor()\n {\n double bucketsLength = buckets.length;\n return currentSize / bucketsLength;\n }", "private int roulette()\r\n {\r\n\treturn spinTheWheel();\r\n }", "public Composite gcd(Composite comp) {\n\t\tint pow = 0;\n\t\tNode head = new Node(0,0);\n\t\tNode divisor = head;\n\t\tNode current_node = this.head;\n\t\tNode first = comp.head;\n\t\tNode comp_head = first;\n\t\twhile(current_node != null){\n\t\t\twhile(comp.head != null){\n\t\t\t\tif(current_node.factor == comp.head.factor){\n\t\t\t\t\tif(current_node.power > comp.head.power){\n\t\t\t\t\t\tpow = comp.head.power;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tpow = current_node.power;\n\t\t\t\t\t}\n\t\t\t\t\tdivisor.next = new Node(current_node.factor, pow);\n\n\t\t\t\t\tdivisor = divisor.next;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcomp.head = comp.head.next;\n\t\t\t}\n\t\t\tcomp.head = comp_head;\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\tComposite head_comp = new Composite();\n\t\tif(head.next == null){\n\t\t\thead_comp.head = new Node(1,1);\n\t\t}\n\t\telse{\n\t\t\thead_comp.head = head.next;\n\t\t}\n\t\tcomp.head = first;\n\t\treturn head_comp;\n\t}", "private static void reduceFraction() {\n\t\tint temp=gcd(num,den);\n\t\tden=den/temp;\n\t\tnum=num/temp;\n\t}", "@DefaultFloat(1.497f / 60.0f * 3.6f * 1.33f * 34.0f / 19.0f)\n float crankSpeedRatio();", "public static void geoLimit(int a1, double ratio) {\n\t\tif (ratio == 1) System.out.println(\"Converge at zero\");\n\t\tif (Math.abs(ratio) > 1) System.out.println(\"Diverge (limit --> (-/+)infinity)\");\n\t\tif (Math.abs(ratio) < 1) System.out.println(\"Given: a = \" + a1 + \" and ratio = \" + ratio + \", converge at \" + a1/(1-ratio));\n\t}", "public abstract double getHeuristic(State state);", "org.hl7.fhir.Ratio addNewValueRatio();", "private void applyLvlUpCost() {\n }", "BaseNumber divide(BaseNumber operand);", "float getCostReduction();", "Post incrementRatio(Long id);", "public void reduce(){\r\n int num = numerator;\r\n int denom = denominator;\r\n int greatest;\r\n \r\n // Find the greater of numerator and denominator\r\n if(numerator < 0){\r\n num = -numerator;\r\n }\r\n if(num > denom){\r\n greatest = num;\r\n }\r\n else\r\n greatest = denom;\r\n \r\n // Find the GCD\r\n int gcd = 0;\r\n // starting from the largest\r\n for(int i = greatest; i > 1; i--){\r\n if((numerator % i == 0) && (denominator % i == 0)){\r\n gcd = i;\r\n break;\r\n }\r\n }\r\n // factor out the gcd in both the numerator and denominator\r\n if(gcd != 0){\r\n numerator /= gcd;\r\n denominator /= gcd;\r\n }\r\n }", "public float getMinRatio();", "public float getMaxRatio();", "private double getCurbHeight(ReaderWay way) {\n\t\tdouble res = 0d;\n\t\tString str = null;\n\t\t// http://taginfo.openstreetmap.org/keys/sloped_curb#overview: 90% nodes, 10% ways\n\t\t// http://taginfo.openstreetmap.org/keys/sloped_curb#values\n\t\tif (way.hasTag(\"sloped_curb\")) {\n\t\t\tstr = way.getTag(\"sloped_curb\").toLowerCase();\n\t\t\tstr = str.replace(\"yes\", \"0.03\");\n\t\t\tstr = str.replace(\"both\", \"0.03\");\n\t\t\tstr = str.replace(\"no\", \"0.15\");\n\t\t\tstr = str.replace(\"one\", \"0.15\");\n\t\t\tstr = str.replace(\"at_grade\", \"0.0\");\n\t\t\tstr = str.replace(\"flush\", \"0.0\");\n\t\t\tstr = str.replace(\"low\", \"0.03\");\n\t\t}\n\t\telse if (way.hasTag(\"kerb\")) {\n\t\t\tif (way.hasTag(\"kerb:height\")) {\n\t\t\t\tstr = way.getTag(\"kerb:height\").toLowerCase();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstr = way.getTag(\"kerb\").toLowerCase();\n\t\t\t\tstr = str.replace(\"lowered\", \"0.03\");\n\t\t\t\tstr = str.replace(\"raised\", \"0.15\");\n\t\t\t\tstr = str.replace(\"yes\", \"0.03\");\n\t\t\t\tstr = str.replace(\"flush\", \"0.0\");\n\t\t\t\tstr = str.replace(\"unknown\", \"0.03\");\n\t\t\t\tstr = str.replace(\"no\", \"0.15\");\n\t\t\t\tstr = str.replace(\"dropped\", \"0.03\");\n\t\t\t\tstr = str.replace(\"rolled\", \"0.03\");\n\t\t\t\tstr = str.replace(\"none\", \"0.15\");\n\t\t\t}\n\t\t}\n \n\t\t// http://taginfo.openstreetmap.org/keys/curb#overview: 70% nodes, 30% ways\n\t\t// http://taginfo.openstreetmap.org/keys/curb#values\n\t\telse if (way.hasTag(\"curb\")) {\n\t\t\tstr = way.getTag(\"curb\").toLowerCase();\n\t\t\tstr = str.replace(\"lowered\", \"0.03\");\n\t\t\tstr = str.replace(\"regular\", \"0.15\");\n\t\t\tstr = str.replace(\"flush;lowered\", \"0.0\");\n\t\t\tstr = str.replace(\"sloped\", \"0.03\");\n\t\t\tstr = str.replace(\"lowered_and_sloped\", \"0.03\");\n\t\t\tstr = str.replace(\"flush\", \"0.0\");\n\t\t\tstr = str.replace(\"none\", \"0.15\");\n\t\t\tstr = str.replace(\"flush_and_lowered\", \"0.0\");\n\t\t}\n\n\t\tif (str != null) {\n\t\t\tboolean isCm = false;\n\t\t\ttry {\n\t\t\t\tif (str.contains(\"c\")) {\n\t\t\t\t\tisCm = true;\n\t\t\t\t}\n\t\t\t\tres = Double.parseDouble(str.replace(\"%\", \"\").replace(\",\", \".\").replace(\"m\", \"\").replace(\"c\", \"\"));\n\t\t\t\tif (isCm) {\n\t\t\t\t\tres /= 100d;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception ex) {\n\t\t\t\t//\tlogger.warning(\"Error parsing value for Tag kerb from this String: \" + stringValue + \". Exception:\" + ex.getMessage());\n\t\t\t}\n\t\t}\n\n\t\t// check if the value makes sense (i.e. maximum 0.3m/30cm)\n\t\tif (-0.15 < res && res < 0.15) {\n\t\t\tres = Math.abs(res);\n\t\t}\n\t\telse {\n\t\t\t// doubleValue = Double.NaN;\n\t\t\tres = 0.15;\n\t\t}\n\t\t\n\t\treturn res;\n\t}", "private void branch01(Node parent) {\n final GeneralLP lp0 = parent.lp;\n final int v = intVars[parent.level];\n Maths.CnF cf = new Maths.CnF(lp0.x[v - 1]);\n\n double[][] a2 = Arrays.copyOf(lp0.a, lp0.m);\n double[] bLeft = lp0.b; // left branch\n double[] bRight = Arrays.copyOf(lp0.b, lp0.m); // right branch\n double[] c2 = Arrays.copyOf(lp0.c, lp0.n);\n double c0Right = lp0.c0 + lp0.c[v - 1]; // c0Left unchanged\n branch01Arguments(c2, a2, bRight, lp0, v);\n\n // LP1: left branch (=0)\n LOG.debug(parent, \"left branch x(\", v, \") =\", 0);\n GeneralLP lp1 = new GeneralLP(lp0.objectiveType, lp0.c0, c2, a2, lp0.signs, bLeft, lp0.freeVars);\n Node child1 = new Node(lp1, parent, Node.LEFT).binary(v);\n nodes.addLast(child1);\n\n // LP2: right branch (=1)\n LOG.debug(parent, \"right branch x(\", v, \") =\", 1);\n GeneralLP lp2 = new GeneralLP(lp0.objectiveType, c0Right, c2, a2, lp0.signs, bRight, lp0.freeVars);\n Node child2 = new Node(lp2, parent, Node.RIGHT).binary(v);\n nodes.addLast(child2);\n\n parent.lp = null; // release memory\n }", "public int getBranchCount() { return _brcnt; }", "private double heuristic(Node a, Node b){\n\n // absolute value of the differences in floors\n return Math.abs(a.getFloor() - b.getFloor());\n }", "Rational add(Rational p)\n {\n //get gcd then multiply gcd by the denominator of both then just add both numerator\n //https://www.mathsisfun.com/fractions_addition.html formulae for fraction\n\n Rational firstarg =new Rational();\n //firstargument being used to store the instance variable so i can call lowest form it's just the most convienet way that i'm aware of of being able to call the method on the insatnce variables\n firstarg.numerator=numerator;\n firstarg.denominator=denominator;\n\n firstarg=firstarg.lowestform();\n p=p.lowestform();\n //need to get it in it's lowest form before you can work with it\n int tempgcd=gcd(firstarg.denominator,p.denominator);\n if(firstarg.denominator==p.denominator)\n {\n // if both denominators are the same just gott add the numerator\n p.numerator=p.numerator+firstarg.numerator;\n return p;\n }\n else if(tempgcd==1)\n {\n int tempdenominator=p.denominator;\n\n p.denominator=firstarg.denominator*p.denominator;\n p.numerator=p.numerator*firstarg.denominator;\n\n //calculate the second fraction\n firstarg.numerator=firstarg.numerator*tempdenominator;\n firstarg.denominator=firstarg.denominator*tempdenominator;\n\n //now just add the numerators\n p.numerator=p.numerator+firstarg.numerator;\n\n return p;\n }\n else if(tempgcd>1)\n {\n\n p.denominator=tempgcd*p.denominator;\n p.numerator=p.numerator*tempgcd;\n //calculate the second fraction by getting the gcd and multiplying it by the top and bottom of bot fractions\n firstarg.numerator=firstarg.numerator*tempgcd;\n firstarg.denominator=firstarg.denominator*tempgcd;\n //now just add the numerators\n p.numerator=p.numerator+firstarg.numerator;\n\n return p;\n }\n return null;\n }", "public interface OrderBookBalancingLogic {\n boolean balancingByPercentage();\n}", "abstract double rightProbability();", "public void cloningFactor() {\n\t\t\t\n\t\t\tsort();\n\t\t\tdouble factorNum = 0.0; \n\t\t\t\n\t\t\tfor(Solution sol : population) {\n\t\t\t\tfactorNum = averagePath / (double) sol.getPath();\n\t\t\t\tsol.setCloningFactor(factorNum);\n\t\t\t}\n\t\t}", "protected abstract void calculateNextFactor();", "private int calcBF(Node node){\n\t\tint bf;\n\t\tif(node.left == null && node.right == null)\n\t\t\treturn 0;\n\t\tif(node.left == null){\n\t\t\tbf= -node.right.height;\n\t\t\tnode.height= 1+ node.right.height;\n\t\t}\n\t\telse if(node.right == null){\n\t\t\tbf= node.left.height;\n\t\t\tnode.height= 1+ node.left.height;\n\t\t}\n\t\telse {\n\t\t\tbf= node.left.height - node.right.height;\n\t\t\tnode.height = 1+ Math.max(node.left.height , node.right.height);\n\t\t}\n\t\treturn bf;\n\t}", "abstract double calculateCurrentDiscountRate();", "void calculating(int depth);", "public static int branch(long accountNo){\n return (int)(accountNo/div);\n }", "@Override\n public float getTreeBalance() {\n\treturn 0;\n }", "private int first_leaf() { return n/2; }", "boolean improvesRatio(List<Entity> currentRow, double nextEntity, double length) {\n\n if (currentRow.size() == 0) {\n return true;\n }\n\n double minCurrent = Double.MAX_VALUE, maxCurrent = Double.MIN_VALUE;\n for (Entity entity : currentRow) {\n if (getNormalizedWeight(entity) > maxCurrent) {\n maxCurrent = getNormalizedWeight(entity);\n }\n\n if (getNormalizedWeight(entity) < minCurrent) {\n minCurrent = getNormalizedWeight(entity);\n }\n }\n\n double minNew = (nextEntity < minCurrent) ? nextEntity : minCurrent;\n double maxNew = (nextEntity > maxCurrent) ? nextEntity : maxCurrent;\n\n double sumCurrent = 0;\n for (Entity entity : currentRow) {\n sumCurrent += getNormalizedWeight(entity);\n }\n double sumNew = sumCurrent + nextEntity;\n\n double currentRatio = max(pow(length, 2) * maxCurrent / pow(sumCurrent, 2),\n pow(sumCurrent, 2) / (pow(length, 2) * minCurrent));\n double newRatio = max(pow(length, 2) * maxNew / pow(sumNew, 2),\n pow(sumNew, 2) / (pow(length, 2) * minNew));\n\n return currentRatio >= newRatio;\n }", "abstract public double getBegBal(int yr);", "public int BFCalc(IAVLNode node)\r\n\t {\r\n\t\tif(node.isRealNode())\r\n\t\t\t return node.getLeft().getHeight()-node.getRight().getHeight();\r\n\t\treturn 0; //External node's balance factor\r\n\t }", "public void tree(Graphics bbg, int n, int length, int x, int y, double angle){\n double r1 = angle + Math.toRadians(-30);\n double r2 = angle + Math.toRadians(30);\n double r3 = angle + Math.toRadians(0);\n\n //length modifications of the different branches\n double l1 = length/1.3 + (l1I*5);\n double l2 = length/1.3 + (l2I*5);\n double l3 = length/1.3 + (l3I*5);\n\n //x and y points of the end of the different branches\n int ax = (int)(x - Math.sin(r1)*l1)+(int)(l1I);\n int ay = (int)(y - Math.cos(r1)*l1)+(int)(l1I);\n int bx = (int)(x - Math.sin(r2)*l2)+(int)(l2I);\n int by = (int)(y - Math.cos(r2)*l2)+(int)(l2I);\n int cx = (int)(x - Math.sin(r3)*l3)+(int)(l3I);\n int cy = (int)(y - Math.cos(r3)*l3)+(int)(l3I);\n\n if(n == 0){\n return;\n }\n\n\n increment();\n Color fluidC = new Color(colorR,colorG,colorB);\n //bbg.setColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random()*255)));\n bbg.setColor(fluidC);\n\n\n //draw different branches\n bbg.drawLine(x,y,ax,ay);\n bbg.drawLine(x,y,bx,by);\n bbg.drawLine(x,y,cx,cy);\n\n //call recursively to draw fractal\n tree(bbg,n-1,(int)l1, ax,ay,r1);\n tree(bbg, n - 1, (int)l2, bx,by,r2);\n tree(bbg, n - 1, (int)l3, cx,cy,r3);\n\n\n }", "public void girar(float amount) {\n }", "public abstract double getBarrierLevel(LocalDate date);", "private double noBranch() {\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('a');\n\t}", "public static int ratePieceAvailability(){\n\t\tint rating=0, bishopCount=0;\n for (int i=0;i<64;i++) {\n switch (AlphaBeta.chessBoard[i/8][i%8]) {\n case \"P\": rating+=100;\n break;\n case \"R\": rating+=500;\n break;\n case \"K\": rating+=300;\n break;\n case \"B\": bishopCount++;\n break;\n case \"Q\": rating+=900;\n break;\n }\n }\n if (bishopCount>=2) {\n \trating+=300*bishopCount;\n } else {\n if (bishopCount==1) {rating+=250;}\n }\n return rating;\n\t}", "@Override public double compute(BindRecord neoBindRecord, BindRecord selfBindRecord) {\n // Affinity is expressed as an IC50 concentration:\n // peptides with a lower IC50 bind more strongly, so we\n // invert the ratio relative to the stability model...\n //\n double neoAffinity = neoBindRecord.getAffinity();\n double selfAffinity = selfBindRecord.getAffinity();\n\n return DoubleUtil.log2(selfAffinity / neoAffinity);\n }", "float getGte();", "private void updateSingles(Hierarchy con, ViolatedCandidate lCandidate, ViolatedCandidate tCandidate,\n double delta) {\n Multiset<Constraint> targetPreferringView = UpdateUtils.getViolatedByLearner(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringView = UpdateUtils.getViolatedByTarget(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringHigh = HashMultiset.create(learnerPreferringView.size());\n double promoteWeightedDelta = delta / targetPreferringView.size();\n double maxTPreferringRanking = Double.MIN_VALUE;\n for (Constraint constraint : targetPreferringView.elementSet()) {\n maxTPreferringRanking = Math.max(maxTPreferringRanking, con.getRanking(constraint));\n double multipliedDelta = (targetPreferringView.count(constraint) * promoteWeightedDelta);\n con.changeConstraintRanking(constraint, multipliedDelta);\n }\n\n for (Constraint constraint : learnerPreferringView.elementSet()) {\n double thisRanking = con.getRanking(constraint);\n if (thisRanking > maxTPreferringRanking) {\n int count = learnerPreferringView.count(constraint);\n learnerPreferringHigh.add(constraint, count);\n }\n }\n // If 'higher' set is empty, just add argMax to it\n if (learnerPreferringHigh.isEmpty()) {\n Constraint argMax = UpdateUtils.getMax(learnerPreferringView, con);\n learnerPreferringHigh.add(argMax);\n }\n\n Multiset<Constraint> toIterateOver = learnerPreferringHigh;\n\n double demoteWeightedDelta = -(delta / toIterateOver.size());\n for (Constraint constraint : toIterateOver.elementSet()) {\n double multipliedDelta = toIterateOver.count(constraint) * demoteWeightedDelta;\n con.changeConstraintRanking(constraint, multipliedDelta);\n // System.out.println(\"↓ Updating \" + constraint +\" by \" +\n // multipliedDelta);\n }\n }", "void Step(){\n if(G().rn.nextDouble()<GetBirthProbability()){\n Divide();\n }\n }", "private void drawElement(Graphics g, int x, int y, int width, int height, float ratio) {\r\n\t Color holdColor;\r\n\t if (ratio > 0) {\r\n\t\tratio = (float)Math.abs(ratio/this.maxRatio);\r\n\t\tratio = ratio > 1f ? 1f : ratio;\r\n\t\tholdColor = new Color(ratio, 0, 0);\r\n\t } else if (ratio < 0) {\r\n\t\tratio = (float)Math.abs(ratio/this.minRatio);\r\n\t\tratio = ratio > 1f ? 1f : ratio;\r\n\t\tholdColor = new Color(0, ratio, 0);\r\n\t } else {\r\n\t\t//holdColor = new Color(0, 0, 0);\r\n\t\tholdColor = new Color(128, 128, 128);\r\n\t }\r\n\t g.setColor(holdColor);\r\n\t g.fillRect(x, y, width, height);\r\n\t}", "protected abstract BigDecimal calculate();", "@Override\n\tpublic void visit(Division arg0) {\n\t\t\n\t}", "private Node<T> getHelper(int treeIndex) {\n Node<T> currentNode = this.root;\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n int nextBranch = treeIndex / b;\n\n //down\n currentNode = currentNode.get(nextBranch);\n treeIndex = treeIndex % b;\n }\n return currentNode.get(treeIndex);\n }", "private int balance(AvlTreeNode<K, V> h) {\n return height(h.right) - height(h.left);\n }", "public void setRatio(Integer ratio) {\n this.ratio = ratio;\n }", "public String run() {\r\n\t// divisorSum[n] is the sum of all the proper divisors of n\r\n int divisorSum[]= new int[LIMIT+1];\r\n for(int i=1;i<=LIMIT;i++)\r\n {\r\n for(int j=i+i;j<=LIMIT;j+=i)\r\n divisorSum[j]+=i;\r\n }\r\n // Analyze the amicable chain length for each number in ascending order\r\n int maxChainLen=0;\r\n int minChainElem=-1;\r\n for(int i=0;i<=LIMIT;i++){\r\n Set<Integer> visited=new HashSet<>();\r\n for(int count=1,cur=i;;count++){\r\n visited.add(cur);\r\n int next=divisorSum[cur];\r\n if(next==i)\r\n {\r\n if(count>maxChainLen){\r\n minChainElem=i;\r\n maxChainLen=count;\r\n \r\n }\r\n break;\r\n }\r\n // Exceeds limit or not a chain (a rho shape instead)\r\n else if(next>LIMIT || visited.contains(next))\r\n break;\r\n else\r\n cur=next;\r\n }\r\n }\r\n return Integer.toString(minChainElem);\r\n }", "public void incrementBranchCount() {\n this.branchCount++;\n }", "private void updateHeightAndBalanceFactor(ArrayList<Node<T>> affectedNodes) {\n\t\tfor (Node<T> node : affectedNodes) {\n\t\t\tif (node.getLeft() == null && node.getRight() == null) {\n\t\t\t\tnode.setHeight(1);\n\t\t\t} else if (node.getLeft() == null && node.getRight() != null) {\n\t\t\t\tnode.setHeight(node.getRight().getHeight() + 1);\n\t\t\t} else if (node.getLeft() != null && node.getRight() == null) {\n\t\t\t\tnode.setHeight(node.getLeft().getHeight() + 1);\n\t\t\t} else {\n\t\t\t\tnode.setHeight((\n\t\t\t\t\tnode.getLeft().getHeight() > node.getRight().getHeight() \n\t\t\t\t\t? node.getLeft().getHeight() : node.getRight().getHeight()\n\t\t\t\t\t) + 1);\n\t\t\t}\n\t\t} // After height is updated, update balance factor\n\t\t\n\t\tfor (Node<T> node : affectedNodes) {\n\t\t\tif (node.getLeft() == null) {\n\t\t\t\tif (node.getRight() == null) {\n\t\t\t\t\tnode.setBalanceFactor(0);\n\t\t\t\t} else {\n\t\t\t\t\tnode.setBalanceFactor(0 - node.getRight().getHeight());\n\t\t\t\t}\n\t\t\t} else if (node.getRight() == null) {\n\t\t\t\tif (node.getLeft() == null) {\n\t\t\t\t\tnode.setBalanceFactor(0);\n\t\t\t\t} else {\n\t\t\t\t\tnode.setBalanceFactor(node.getLeft().getHeight());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.setBalanceFactor(node.getLeft().getHeight() - node.getRight().getHeight());\n\t\t\t}\n\t\t}\n\t}", "@Test\r\n\tpublic void calculMetricSuperiorWithLostPointsTest() {\r\n\t\tAssert.assertEquals(UtilCalculGrade.calculMetricSuperior(new ModelValue(10f, 1f), 12f, 9f), new Float(1));\r\n\t}", "private BigDecimal calculateBaseValueFare(PassengerCharterDTO passengerCharterDTO)\n {\n // Full fare = ((Actual transaction value)/ (100-discount percent)) * 100\n BigDecimal fullFare = null;\n\n fullFare = BigDecimal\n .valueOf((passengerCharterDTO.getTransactionValue().doubleValue() / (100 - passengerCharterDTO\n .getDiscountPercent().doubleValue())) * 100);\n return fullFare;\n }", "String branch();", "private static Node auctionRound(Node bidder, Graph solution, Graph reference) {\n\t\tNode matchedNode = null;\n\t\tFloat bestValue = 0F;\n\n\t\tfor (Node seller : reference.getNodeListY()) {\n\t\t\tEdge edge = reference.getEdge(bidder.GetIndex(), seller.GetIndex()); // find edge\n\t\t\tFloat value = edge.GetWeight() - seller.getPrice();\n\n\t\t\tif (value > bestValue) {\n\t\t\t\tmatchedNode = seller;\n\t\t\t\tbestValue = value;\n\t\t\t}\n\t\t}\n\n\t\treturn matchedNode;\n\t}", "private Fraction reduce() {\n Fraction f = null;\n try {\n f = (Fraction)clone();\n } catch (CloneNotSupportedException e) {};\n if (denominator == 0)\n throw new ArithmeticException (\" illegal denominator zero \");\n if (denominator < 0) {\n f.numerator = -numerator;\n f.denominator = -denominator;\n }\n if (numerator == 0)\n f.denominator = 1;\n else {\n int n = gcd (numerator, denominator);\n f.numerator = numerator / n;\n f.denominator = denominator / n;\n }\n return f;\n }", "@Override\n public double divideBy( AlgOptCost cost ) {\n VolcanoCost that = (VolcanoCost) cost;\n double d = 1;\n double n = 0;\n if ( (this.rowCount != 0)\n && !Double.isInfinite( this.rowCount )\n && (that.rowCount != 0)\n && !Double.isInfinite( that.rowCount ) ) {\n d *= this.rowCount / that.rowCount;\n ++n;\n }\n if ( (this.cpu != 0)\n && !Double.isInfinite( this.cpu )\n && (that.cpu != 0)\n && !Double.isInfinite( that.cpu ) ) {\n d *= this.cpu / that.cpu;\n ++n;\n }\n if ( (this.io != 0)\n && !Double.isInfinite( this.io )\n && (that.io != 0)\n && !Double.isInfinite( that.io ) ) {\n d *= this.io / that.io;\n ++n;\n }\n if ( n == 0 ) {\n return 1.0;\n }\n return Math.pow( d, 1 / n );\n }", "abstract double leftProbability();", "int getPercentageHeated();", "@Override\n public A makeDecision(S state) {\n metrics = new Metrics();\n StringBuffer logText = null;\n P player = game.getPlayer(state);\n List<A> results = orderActions(state, game.getActions(state), player, 0);\n timer.start();\n currDepthLimit = 0;\n do {\n incrementDepthLimit();\n if (logEnabled)\n logText = new StringBuffer(\"depth \" + currDepthLimit + \": \");\n heuristicEvaluationUsed = false;\n ActionStore<A> newResults = new ActionStore<>();\n for (A action : results) {\n double value = minValue(game.getResult(state, action), player, Double.NEGATIVE_INFINITY,\n Double.POSITIVE_INFINITY, 1);\n if (timer.timeOutOccurred())\n break; // exit from action loop\n newResults.add(action, value);\n if (logEnabled)\n logText.append(action).append(\"->\").append(value).append(\" \");\n }\n if (logEnabled)\n System.out.println(logText);\n if (newResults.size() > 0) {\n results = newResults.actions;\n if (!timer.timeOutOccurred()) {\n if (hasSafeWinner(newResults.utilValues.get(0)))\n break; // exit from iterative deepening loop\n else if (newResults.size() > 1\n && isSignificantlyBetter(newResults.utilValues.get(0), newResults.utilValues.get(1)))\n break; // exit from iterative deepening loop\n }\n }\n } while (!timer.timeOutOccurred() && heuristicEvaluationUsed);\n return results.get(0);\n }", "public void divide() {\n\t\t\n\t}", "private double lbranch(double x) {\n\t\r\n\t\tdouble w = approx(x, g, a);\r\n\t\tint i=0;\r\n\t\tdouble err=w+2;\r\n\t\tdouble arg=0,da=0,df=0;\r\n\t\twhile (i<niter && abs(err-w)>tol ) {\r\n\t\t\terr=w;\r\n\r\n\t\t\targ=(w-a)/g-log(g);\r\n\t\t\tda=-lw_minus.eval(arg);\t\r\n\t\t\tdf=iq_minus.eval(w);\r\n\t\t\t//System.out.println(w+\" \"+arg+\" \"+da+\" \"+df);\r\n\t\t\tif (Double.isNaN(df) || Double.isNaN(da)) {\r\n\t\t\t\t//System.out.println(\"df \"+df+ \" da \"+da+\" w \"+w);\r\n\t\t\t\treturn Double.NaN;\r\n\t\t\t}\r\n\t\t\tw+=w*(da+1.0)*(df-g*x);\r\n\t\t\tif (w<=0) return err;\r\n\t\t\ti++;\r\n\t\t} \r\n\t\taiter=i-1;\r\n\t//\tSystem.out.println(\" niter \" +aiter +\" err \"+abs(err));\r\n\r\n\t\treturn w;\r\n\t}", "@Override\n\tpublic int calculation(int a, int b) {\n\t\treturn b/a;\n\t}", "public int getRatio() {\r\n\t\treturn ratio;\r\n\t}", "@Override\n\tpublic void Update() {\n\t\tsuper.Update();\n\t\tsuper.decisionRect.x=coordinate.x+(Global.GetGlobal().GetTreeImgRect().width-decisionRect.width)/2;\n\t\tsuper.decisionRect.y=coordinate.y+(Global.GetGlobal().GetTreeImgRect().height-decisionRect.height)/2;\n\t}", "private RunGreatestCommonDivisor() {\r\n\t}", "org.hl7.fhir.Ratio getValueRatio();", "protected Double avoidResultHeuristicValue(AvoidResult r) {\n\t\tdouble adjustedSteps = 100-slowestArrivalStep(r.getPaths());\n\t\t// bonus points if we don't crash\n\t\tint noCrashFactor = 250;\n\t\tint globalCollisionCrashFactor = r.getNextGlobalCollision() == null ? 200 : 0;\n\t\tif(r.getNextCollision() != null) { \n\t\t\tnoCrashFactor = 0;\n\t\t}\n\t\t\n\t\treturn adjustedSteps + noCrashFactor + globalCollisionCrashFactor; \n\t}", "public Integer getRatio() {\n return ratio;\n }", "@Override\n\tpublic void visit(Division arg0) {\n\n\t}", "public Branch(int nCurveRes,float nCurve,float nCurveBack,float nCurveV,Random rand,float totalLength,float radius,Point3f startPoint,Vector3f startVector,float offset) {\n\t\tsetStartPoints(nCurveRes,radius,startVector,rand,offset,totalLength); //Some initialization.\n\t\tsetVectors(nCurveRes,nCurve,nCurveBack,nCurveV);\n\t\tpoints=utils.ThreeD.setPoints(directions,startPoint); //Derives points from vectors and starting point.\n\t}", "protected Double successProbability(){\n\t\tnodeKValues = collectKValues();\n\t\tList<Integer[]> placements = getDistinctPlacements(getMinKPath());\n\t\tlong maxNumberOfColorings = 0;\n\t\tfor (Integer[] placement : placements){\n\t\t\tlong colorings = numberOfColorings(placement);\n\t\t\tif (colorings > maxNumberOfColorings)\n\t\t\t\tmaxNumberOfColorings = colorings;\n\t\t}\n\t\tDouble probability = 1.0/maxNumberOfColorings;\n\t\tfor (int i=1; i<=pathLength; i++){ // factorial of pathlength\n\t\t\tprobability = probability * i;\n\t\t}\n\t\treturn probability;\n\t}", "private void updateGeneralEvaluation(Evaluation ev, double learnRatio) {\n\t\tgeneralEvaluation = (1-learnRatio)*generalEvaluation + learnRatio *ev.getGrade();\n\t}", "public Money priceHike(long l, long h, double rate) {\n double net = 0;\n Set<Map.Entry<Long, MDSEntry>> treeMapEntrySet = treeMap.entrySet();\n for (Map.Entry<Long, MDSEntry> entry : treeMapEntrySet) {\n Long key = entry.getKey();\n MDSEntry obj = entry.getValue();\n if (key >= l && key <= h) {\n long price = obj.getPrice().totalCents();\n long updatedPrice = price + (long)(price * rate / 100.0);\n obj.setPrice(new Money(updatedPrice / 100, (int)(updatedPrice % 100)));\n treeMap.put(obj.id, obj);\n net += (updatedPrice - price);\n }\n\n }\n return new Money((long)(net/100.0), (int) (net%100));\n}", "@Override\n\t\tpublic void calc(Env env)\n\t\t{\n\t\t\tif (!cond.test(env))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tenv.value *= 1.45;\n\t\t}", "public void call(int player)\r\n\t{\r\n\t\tint bet=maxBet-playerBet[player];\r\n\t\tif(bet>accountValue[player])System.out.println(\"cos\");//tu powino wyjatek rzucac \r\n\t\telse\r\n\t\t{\r\n\t\t\taccountValue[player]=accountValue[player]-bet;\r\n\t\t\tplayerBet[player]+=bet;\r\n\t\t\tpool+=bet;\r\n\t\t}\r\n\t}", "float getWinLossRatio();", "@Override\n\t\tpublic int compareTo(state arg0) {\n\t\t\treturn (this.weight1 * this.weight2) - (arg0.weight1 * arg0.weight2);\n\t\t}" ]
[ "0.6367253", "0.5861993", "0.57022095", "0.56775475", "0.5663086", "0.55269384", "0.55242926", "0.5484173", "0.5466344", "0.54548484", "0.54186654", "0.5416349", "0.53747463", "0.53664595", "0.53494334", "0.53197956", "0.5292197", "0.52755123", "0.5261603", "0.5236263", "0.52329", "0.51789534", "0.5165584", "0.5156992", "0.51323795", "0.5125563", "0.51248145", "0.51183546", "0.51171947", "0.5115206", "0.5113276", "0.50937885", "0.50862426", "0.50827503", "0.50718784", "0.505152", "0.5042668", "0.50355893", "0.5025962", "0.50149786", "0.50129724", "0.5008455", "0.4993143", "0.49929035", "0.49920222", "0.4991207", "0.4990551", "0.49848568", "0.4983794", "0.4978184", "0.4974794", "0.49714974", "0.49700552", "0.49540615", "0.49513417", "0.49508023", "0.4949835", "0.49466446", "0.4945808", "0.494426", "0.49358112", "0.49345133", "0.49300414", "0.49129698", "0.49084467", "0.49017704", "0.4893517", "0.48926634", "0.4892462", "0.4887736", "0.48862717", "0.48835397", "0.4881812", "0.48793975", "0.48723757", "0.48719388", "0.48715156", "0.4866017", "0.48626378", "0.48573813", "0.4851253", "0.4849621", "0.4848522", "0.48416078", "0.48370862", "0.48365903", "0.48362738", "0.4834706", "0.4819371", "0.4819317", "0.4818167", "0.48157302", "0.48134312", "0.48068804", "0.48061877", "0.48036984", "0.48014066", "0.47993177", "0.47981447", "0.47974992" ]
0.66868603
0
Mounts tree onto treePane
private void mountTree() { if (tree != null) { treePane.getChildren().addAll(tree); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }", "private void initializeTreePane() {\n Rectangle clipRect = new Rectangle(treePane.getWidth(), treePane.getHeight());\n clipRect.heightProperty().bind(treePane.heightProperty());\n clipRect.widthProperty().bind(treePane.widthProperty());\n treePane.setClip(clipRect);\n }", "private void setTree() throws IOException {\n TreeItem<File> root = new TreeItem<>();\n dirFolders.setRoot(buildTree(model.DirectoryManager.getTree(), root));\n dirFolders.setRoot(root.getChildren().get(0));\n\n // format cellFactory\n // we want to show file name in UI although treeView stores File object\n // Add directory logo if the file is a directory\n // Add photo thumbnail if the file is a photo\n dirFolders.setCellFactory(\n new Callback<TreeView<File>, TreeCell<File>>() {\n @Override\n public TreeCell<File> call(TreeView<File> param) {\n return new TreeCell<File>() {\n @Override\n protected void updateItem(File item, boolean empty) {\n super.updateItem(item, empty);\n if (item != null) {\n if (item.isDirectory()) {\n setGraphic(\n new ImageView(\n new Image(getClass().getResourceAsStream(\"/views/folder.png\"))));\n setDisclosureNode(null);\n File[] fileList = item.listFiles();\n if (fileList != null) {\n if (fileList.length == 0) {\n setDisable(true);\n }\n }\n } else {\n ImageView image = new ImageView(\"File:\" + item.getPath());\n image.setFitHeight(32);\n image.setFitWidth(36);\n setGraphic(image);\n }\n setText(item.getName());\n }\n }\n };\n }\n });\n\n // handle onClickAction\n dirFolders\n .getSelectionModel()\n .selectedItemProperty()\n .addListener(\n (observable, oldValue, newValue) -> {\n if (!dirFolders.getSelectionModel().getSelectedItem().getValue().isDirectory()) {\n model.User.setPhoto(\n model.PhotoManager.getPhoto(\n dirFolders.getSelectionModel().getSelectedItem().getValue().getPath()));\n try {\n loadNextScene(rootPane, \"/views/focusPhotoPane.fxml\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n Stage curStage = (Stage) rootPane.getScene().getWindow();\n File selectedDirectory =\n dirFolders.getSelectionModel().getSelectedItem().getValue();\n if (selectedDirectory != null) {\n Directory dir =\n DirectoryManager.getCurrentDirectory(selectedDirectory.getPath());\n if (dir != null) {\n model.User.setGalleryPhotos(dir.getPhotos());\n fadeOutEvent();\n }\n } else {\n curStage.show();\n }\n }\n });\n }", "private void unmountTree() {\n if (tree != null) {\n treePane.getChildren().clear();\n }\n }", "public static void setTreePane(TreePane pane)\n {\n for (Component c : frame.getContentPane().getComponents())\n {\n if (c instanceof TreePane)\n {\n frame.getContentPane().remove(c);\n }\n }\n frame.getContentPane().add(pane, BorderLayout.CENTER);\n frame.revalidate(); //Redraws the GUI, not only for looks, but also so that the user can interact. (Non-Responsive GUI without this)\n }", "private void loadTree(){ \n PBarHelper.show();\n DataProvider.getTreeHierarchy(mScreenId, new DataProvider.AsyncCallback<ViewNodeJSO>() {\n @Override\n public void onError(Request r, Throwable t) {\n PBarHelper.hide();\n Window.alert(t.getMessage());\n }\n\n @Override\n public void onDownloaded(ViewNodeJSO result) {\n mRoot = result; \n CellTree.Resources res = GWT.create(CustomTreeResources.class);\n //create tree model\n mTreeViewModel = new ViewHierarchyTreeViewModel(result);\n //add selection handler to select view on canvas\n mTreeViewModel.setOnSelectionChangedListener(new OnSelectionChangedListener() { \n @Override\n public void onSelectionChanged(ViewNodeJSO viewNode, boolean selected) { \n ScreenPreviewPage.this.onViewTreeNodeSelectionChanged(viewNode, selected);\n }\n });\n //add hover listener just to highlight view\n mTreeViewModel.setOnViewNodeMouseOverListener(new OnViewNodeMouseOverListener() {\n @Override\n public void onMouseOver(ViewNodeJSO viewNode) {\n if (mTreeViewModel.getSelectedNode() == null) {\n clearCanvas();\n drawRectForView(viewNode);\n }\n }\n });\n //remove old tree if necessary, currently there is no reload support (reload page only)\n if (mCellTree != null) {\n mCellTree.removeFromParent();\n }\n mCellTree = new CellTree(mTreeViewModel, null, res); \n mCellTree.setDefaultNodeSize(1000);//no show more button\n centerPanel.add(mCellTree); \n CellTreeTools.expandAll(mCellTree.getRootTreeNode());\n mCellTree.setAnimationEnabled(true);\n PBarHelper.hide();\n } \n });\n }", "private void setTreePresenter() {\n this.tree.setIconProvider(new ModelIconProvider<GPBeanTreeModel>() {\n \n @Override\n public AbstractImagePrototype getIcon(GPBeanTreeModel model) {\n return model.getIcon();\n }\n });\n \n this.tree.setLabelProvider(new ModelStringProvider<GPBeanTreeModel>() {\n \n @Override\n public String getStringValue(GPBeanTreeModel model, String property) {\n return model.getLabel();\n }\n });\n \n this.tree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);\n \n this.tree.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<GPBeanTreeModel>() {\n \n @Override\n public void selectionChanged(\n SelectionChangedEvent<GPBeanTreeModel> se) {\n if (se.getSelectedItem() != null) {\n MediatorToolbarTreeAction.getInstance().elementChanged(se.getSelectedItem());\n } else {\n MediatorToolbarTreeAction.getInstance().disableAllActions();\n }\n \n }\n });\n this.setCheckable(true);\n this.setCheckStyle(CheckCascade.NONE);\n this.tree.setAutoHeight(true);\n }", "public void runTree(int min) {\n getContentPane().remove(pane);\n pane = new Tree(1.05, min, .8, 200);\n getContentPane().add(pane);\n setVisible(true);\n }", "public void run(){\n\n File fileRoot = new File(path);\n root = new DefaultMutableTreeNode(new fileNode(fileRoot));\n treemodel = new DefaultTreeModel(root);\n\n tree = new JTree(treemodel);\n tree.setShowsRootHandles(true);\n JScrollPane scrollPane = new JScrollPane(tree);\n this.panel.add(scrollPane);\n //frame.setLocationByPlatform(true);\n this.panel.setSize(1000, 1000);\n this.panel.setVisible(true);\n /*\n this.panel.add(scrollPane);\n //frame.setLocationByPlatform(true);\n this.panel.setSize(1000, 1000);\n this.panel.setVisible(true);\n */\n\n createChildren cc = new createChildren(fileRoot, root);\n new Thread(cc).start();\n\n\n }", "private Pane createSubTree(int level, File directory) {\n\t\tVBox dirNameBox = new VBox();\n\t\t\n\t\tdouble maxPaneHeight = 0;\n\t\tdouble totalArea = 0;\n\t\tdouble totalPanesHeight = 0;\n\t\tdouble totalPanesWidth = 0;\n\n\t\tArrayList<Pane> panes = new ArrayList<Pane>();\n\t\t\n\t\t// Add label\n\t\tLabel newLabel = new Label(directory.getName());\n\t\tnewLabel.setFont(Font.font(\"System\", FontWeight.BOLD, 8.0f));\n\t\t//newLabel.setBackground(new Background(new BackgroundFill(Color.CORNFLOWERBLUE, CornerRadii.EMPTY, Insets.EMPTY)));\n\n\t\t//nodes.add(newLabel);\t\t\n\t\tdirNameBox.getChildren().add(newLabel);\n\t\t\n\t\t\n\t\tPane dirPane;\n\t\tif (level % 2 == 0) {\n\t\t\tdirPane = new VBox();\n\t\t\t// Setting the spacing between the nodes\n\t\t\t((VBox)dirPane).setSpacing(gap);\n\t\t\t((VBox)dirPane).setAlignment(Pos.TOP_LEFT); \t\t\n\t\t} else {\n\t\t\tdirPane = new HBox();\n\t\t\t// Setting the spacing between the nodes\n\t\t\t((HBox)dirPane).setSpacing(gap);\n\t\t\t((HBox)dirPane).setAlignment(Pos.TOP_LEFT); \t\t\n\t\t}\n\t\tdirNameBox.getChildren().add(dirPane);\n\t\t\n\t\t\t\t\n\t\tint numSubDirs = 0;\n\t\tString[] subFilesAndDirectories = directory.list(new FilenameFilter() {\n\t\t public boolean accept(File dir, String name) {\n\t\t \tif (fileExtensionFilter == null || fileExtensionFilter.length == 0 ) {\n\t\t \t\t// No Filter defined\n\t\t \t\treturn true;\n\t\t \t} else {\n\t\t\t \t// check if file extension is in the list of allowed extensions\n\t\t\t return Arrays.stream(fileExtensionFilter).anyMatch(FilenameUtils.getExtension(name.toLowerCase())::equals);\n\t\t \t}\n\t\t };\n\t\t});\t\n\n\t\tfor (String fileOrDirectoryName : subFilesAndDirectories) {\n\t\t\t\n\t\t\tFile fileOrDirectory = new File(directory, fileOrDirectoryName);\n\t\t\t\n\t\t\tif (fileOrDirectory.isDirectory()) {\n\t\t\t\tpanes.add(createSubTree(level++, fileOrDirectory));\n\t\t\t\tnumSubDirs++;\n\t\t\t} else {\n\t\t\t\tif (showFiles) {\n\t\t\t\t\tpanes.add(createFilePane(fileOrDirectory));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tdirNameBox.setSpacing(0);\n\t\t\n\t\tif (usePadding) {dirPane.setPadding(new Insets(gap,gap,gap,gap));}\n\t\t\n\t\tdirNameBox.setPadding(new Insets(1,1,1,1));\n\n\t\t//flowPane.autosize();\n\t\t\n\t\t// Alignments\n\t\tdirNameBox.setAlignment(Pos.TOP_LEFT); \n\n\t\tif (showRandomDirectoryBackgroundColor) {\n\t\t\tdirNameBox.setStyle(\"-fx-background-color: rgba(\" + (randomizer.nextInt(155) + 100) +\n\t\t\t\t\t\", \" + (randomizer.nextInt(155) + 100) + \", \" + (randomizer.nextInt(155) + 100) + \", \" +\n\t\t\t\t\t1 + \"); -fx-background-radius: 10;\");\n\t\t} else {\n//\t\t\tvBox.setStyle(\"-fx-background-color: rgba(\" + 255 + \", \" + 255 + \", \" + 255 + \", \" + 0\n//\t\t\t\t\t+ \"); -fx-background-radius: 10; \" + (showBorder ? \"-fx-border-color: gray\" : \"\")\n//\t\t\t);\n\t\t\tdirNameBox.setStyle(\"-fx-background-color: rgba(\" + 240 + \", \" + 240 + \", \" + 240 + \", \" + 1\n\t\t\t\t\t+ \"); -fx-background-radius: 10; \" + (showBorder ? \"-fx-border-color: gray\" : \"\")\n\t\t\t);\n\n\t\t}\n\n\t\tdirPane.setStyle(\"-fx-background-color: rgba(\" + 255 + \", \" + 255 + \", \" + 255 + \", \" + 0.5f\n\t\t\t\t+ \"); -fx-background-radius: 10; \" // + (showBorder ? \"-fx-border-color: blue; -fx-border-style: dotted;\" : \"\")\n\t\t);\n\n\t\t\n\t\t// Retrieving the childrens list of the parent pane\n\t\tObservableList<Node> list = dirPane.getChildren();\n\t\t\n\t\t// Adding all the nodes to the parent pane\n\t\tfor (Pane pane : panes) {\n\n\t\t\tlist.add(pane);\n\t\t\t\n\t\t\tdouble currentHeight = \n\t\t\t\t\t(pane instanceof VBox ? ((VBox)pane).getPrefHeight() + \n\t\t\t\t\t\t\t\t\t\t\t\t(showBorder ? 2 : 0) /*top + bottom border*/ + \n\t\t\t\t\t\t\t\t\t\t\t\t(usePadding ? 2 * gap : 0) /*padding*/ \n\t\t\t\t\t: (pane instanceof Pane ? ((Pane)pane).getPrefHeight() : 12 /*label*/)\n\t\t\t);\n\t\t\tdouble currentWidth = \n\t\t\t\t\t(pane instanceof HBox ? ((HBox)pane).getPrefHeight() + \n\t\t\t\t\t\t\t\t\t\t\t\t(showBorder ? 2 : 0) /*top + bottom border*/ + \n\t\t\t\t\t\t\t\t\t\t\t\t(usePadding ? 2 * gap : 0) /*padding*/ \n\t\t\t\t\t: (pane instanceof Pane ? ((Pane)pane).getPrefWidth() : 12 /*label*/)\n\t\t\t);\n\t\t\tmaxPaneHeight = Math.max(maxPaneHeight, currentHeight);\n\t\t\ttotalPanesHeight += currentHeight;\n\t\t\ttotalPanesWidth += currentWidth;\n\t\t\ttotalArea += pane.getPrefHeight() * pane.getPrefWidth();\n//\t\t\tSystem.out.println((p instanceof FlowPane ? \"Folder\" : \"File\") + \": \" + ((Label)p.getChildren().get(0)).getText() + \n//\t\t\t\t\t\" p.PrefHeight: \" + p.getPrefHeight() + \" p.PrefWidth: \" + p.getPrefWidth() + \n//\t\t\t\t\t\" p.Height: \" + p.getHeight() + \" p.Width: \" + p.getWidth() +\n//\t\t\t\t\t(p instanceof FlowPane ? \" p.PrefWrap: \" + ((FlowPane)p).getPrefWrapLength() : \"\") +\n//\t\t\t\t\t\" totalHeight: \" + totalPanesHeight);\n\t\t}\n\t\t\t\n\t\t// height of squared total area\n\t\tdouble areaHeight = Math.sqrt(totalArea) * transformFactor;\n\t\tdouble prefHeight = Math.max(areaHeight, maxPaneHeight);\n\t\t\n\t\tprefHeight = Math.min(totalPanesHeight, areaHeight);\n\t\t\n//\t\t// Setting preferred heights\n//\t\t((VBox)dirPane).setPrefHeight(\n//\t\t\t\ttotalPanesHeight\n//\t\t\t\t+ (panes.size() - 1) * gap /*gaps*/\n//\t\t\t\t// + 2 /*border*/\n//\t\t); \t\n\t\t\n//\t\tvBox.setPrefWrapLength(flowPane.getPrefWrapLength() + \n//\t\t\t\t12 /*label height*/ + \n//\t\t\t\t(showBorder ? 2 : 0) /*border around childFlowPane*/ +\n//\t\t\t\t(usePadding ? 2 * gap : 0) /*padding*/\n//\t\t\t\t);\n\n\t\t\t\n\t\tbindTooltip(dirNameBox, tooltip);\n\t\tbindTooltip(dirPane,tooltip);\n\t\tbindTooltip(newLabel, tooltip);\n\n\t\treturn dirNameBox;\n\t}", "public void placeTreeNodes() {\n int width;\n float rad;\n\n // Stores width and rad for convenience.\n width = MainActivity.getCanvas().getWidth();\n rad = AnimationParameters.NODE_RADIUS;\n\n // Places the Nodes.\n placeTreeNodes((int) (width / 2 + rad * 1.5), (int) (rad * 2),\n (int) (width - rad * 5), (int) AnimationParameters.depthLen);\n\n }", "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "private void initTrees() {\n // My machine tree init code\n myMachineTree = new FileTree(fileDomainModel);\n myMachineScrollPane.add(myMachineTree);\n // Connected machine tree init code\n connectedMachineTree = new FileTree(fileDomainModel);\n connectedMachineScrollPane.add(connectedMachineTree);\n }", "private void createTree() {\n\n // custom brown color\n Color brown = new Color(149, 99, 57);\n\n // trunk\n NscComponent trunk = new NscRectangle(49, 164, 13, 51);\n createShape(trunk, brown, true);\n\n // branches\n drawLine(50, 125, 50, 165, 10, brown);\n drawLine(25, 125, 50, 165, 10, brown);\n drawLine(75, 125, 50, 165, 10, brown);\n\n // branch outlines\n drawLine(49, 125, 49, 150, 1, Color.black);\n drawLine(60, 125, 60, 150, 1, Color.black);\n drawLine(24, 125, 49, 165, 1, Color.black);\n drawLine(35, 125, 50, 150, 1, Color.black);\n drawLine(85, 125, 60, 165, 1, Color.black);\n drawLine(74, 125, 60, 150, 1, Color.black);\n\n // leafs\n NscEllipse leafs2 = new NscEllipse(0, 5, 60, 122);\n NscEllipse leafs3 = new NscEllipse(50, 5, 60, 122);\n NscEllipse leafs = new NscEllipse(25, 0, 60, 127);\n NscEllipse leafs4 = new NscEllipse(25, 1, 60, 124);\n createShape(leafs2, treeColor, true);\n createShape(leafs3, treeColor, true);\n createShape(leafs, treeColor, true);\n createShape(leafs4, treeColor, false);\n\n repaint();\n }", "public TreeScenery() {\r\n\t\tstopped = false;\r\n\t\tthis.position = new Vector2(0, 400);\r\n boundingRectangle = new Rectangle();\r\n treeAnimation = AssetLoader.treeAnimation;\r\n\t}", "public void setCurrentSceneGraphTree(Node root) {\n \t\ttreeModel = new JMonkeyTreeModel(root);\n \t\tfinal PopUpTree tree = new PopUpTree(treeModel);\n \t\t// final JTree tree = new JTree(new DefaultMutableTreeNode());\n \t\ttree.setEditable(true);\n \t\ttree.getSelectionModel().setSelectionMode(\n \t\t\t\tTreeSelectionModel.SINGLE_TREE_SELECTION);\n \t\ttree.setShowsRootHandles(true);\n \t\tJMenuItem addTerrain = new JMenuItem(\"Add Enitity\");\n \t\ttree.addToPopup(addTerrain);\n \t\taddTerrain.addActionListener(new ActionListener() {\n \n \t\t\tpublic void actionPerformed(ActionEvent e) {\n \t\t\t\tdoAddEntity(tree.getSelectionPath());\n \t\t\t}\n \t\t});\n \n \t\tJMenuItem delete = new JMenuItem(\"Remove Entity\");\n \t\tdelete.addActionListener(new ActionListener() {\n \n \t\t\tpublic void actionPerformed(ActionEvent e) {\n \t\t\t\tdeleteNode(tree.getSelectionPath());\n \t\t\t}\n \t\t});\n \t\ttree.addToPopup(delete);\n \t\ttree.setOpaque(true);\n \n \t\ttreeScrollPane.removeAll();\n \t\ttreeScrollPane.add(new JScrollPane(tree), BorderLayout.CENTER);\n \t\trepaint();\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 }", "public void createPartControl(Composite parent) {\n//\t\tviewer = new TreeViewer(parent, SWT.VIRTUAL | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tviewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n\n\t\tdrillDownAdapter = new DrillDownAdapter(viewer);\n\t\tviewer.setContentProvider(new ViewContentProvider());\n\t\tviewer.setLabelProvider(new ViewLabelProvider());\n\t\tviewer.setSorter(new NameSorter()); // sorts the tree names alphabetically\n\t\tviewer.setInput(getViewSite());\n\t\t\n\t\tViewerFilter[] filters = {showAllFilter};\n\t\tviewer.setFilters(filters);\n\n\t\tshell = parent.getShell();\n\n\t\t// Create the help context id for the viewer's control\n\t\tPlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), \"org.openmodelica.modelicaml.view.componentstree\");\n\t\tmakeActions();\n\t\thookContextMenu();\n//\t\thookDoubleClickAction();\n\t\thookSelectionChangedAction();\n\t\tcontributeToActionBars();\n\n//\t\tgetSite().getWorkbenchWindow().getSelectionService().addSelectionListener(listener);\n\t\t\n\t\t// add a selection provider.\n\t\tgetSite().setSelectionProvider(viewer); \n\t\t\n\t\t// double click for opening/closing the sub tree\n\t\tviewer.addOpenListener(new IOpenListener() {\n\t\t\tpublic void open(final OpenEvent event) {\n\t\t\t\tObject firstElement = ((IStructuredSelection)\n\t\t\t\tevent.getSelection()).getFirstElement();\n\t\t\t\t\tif (viewer.getExpandedState(firstElement)) {\n\t\t\t\t\t\tviewer.collapseToLevel(firstElement, AbstractTreeViewer.ALL_LEVELS);\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tviewer.expandToLevel(firstElement, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\t// add drag support\n\t\tint operations = DND.DROP_MOVE;\n\t\tTransfer[] transferTypes = new Transfer[]{ LocalSelectionTransfer.getTransfer()};\n\t\tviewer.addDragSupport(operations, transferTypes, new DragListener(viewer));\n\n\t}", "private void setUpDefaultTree() {\n\t\tTreeItem<String> tempTreeItem = new TreeItem<String>(\"Floor 1\");\n\t\tFloor tempFloor = new Floor(new Image(\"scheduleyTest/floorplan1.jpg\"));\n\t\tfloorHashMap.put(tempTreeItem, tempFloor);\n\t\ttree.getRoot().getChildren().add(tempTreeItem);\n\t\ttempFloor.addMeetingSpace(new MeetingSpace(new Rectangle(88,40,213,113)));\n\t\ttempFloor.addMeetingSpace(new MeetingSpace(new Rectangle(88,153,139,119)));\n\t\ttempTreeItem.getChildren().addAll(new TreeItem<String>(\"Room 1\"), new TreeItem<String>(\"Room 2\"));\n\t}", "private void setupTab() {\n setLayout(new BorderLayout());\n JSplitPane mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);\n mainSplit.setDividerLocation(160);\n mainSplit.setBorder(BorderFactory.createEmptyBorder());\n\n // set up the MBean tree panel (left pane)\n tree = new XTree(this);\n tree.setCellRenderer(new XTreeRenderer());\n tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n tree.addTreeSelectionListener(this);\n tree.addTreeWillExpandListener(this);\n tree.addMouseListener(ml);\n JScrollPane theScrollPane = new JScrollPane(tree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,\n JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n JPanel treePanel = new JPanel(new BorderLayout());\n treePanel.add(theScrollPane, BorderLayout.CENTER);\n mainSplit.add(treePanel, JSplitPane.LEFT, 0);\n\n // set up the MBean sheet panel (right pane)\n viewer = new XDataViewer(this);\n sheet = new XSheet(this);\n mainSplit.add(sheet, JSplitPane.RIGHT, 0);\n\n add(mainSplit);\n }", "private void initTree()\n {\n String currSpell;\n Node tempNode;\n String currString;\n Gestures currGest;\n for(int spellInd = 0; spellInd < SpellLibrary.spellList.length; spellInd++)\n {\n //Start casting a new spell from the root node\n tempNode = root;\n currSpell = SpellLibrary.spellList[spellInd];\n for(int currCharInd =0; currCharInd < currSpell.length(); currCharInd++)\n {\n currString = currSpell.substring(0,currCharInd+1);\n currGest = Gestures.getGestureByChar(currString.charAt(currString.length()-1));\n if(tempNode.getChild(currGest) == null) //Need to add a new node!\n {\n tempNode.addChild(currGest,new Node(currString));\n debug_node_number++;\n }\n //Walk into the existing node\n tempNode = tempNode.getChild(currGest);\n }\n\n }\n }", "public void interactiveTreeEditingRToL() {\r\n JTree tree = new JTree(); \r\n TreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setEditable(true);\r\n JXTree xTree = new JXTree();\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"standard Editing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "private void initPane() {\n\t\tContainer localContainer = getContentPane();\n\t\tlocalContainer.setLayout(new BorderLayout());\n\t\t\n\t\tsplitpane_left_top.setBorder(BorderFactory.createTitledBorder(\"Training Data\"));\n\t\tsplitpane_left_bottom.setBorder(BorderFactory.createTitledBorder(\"Tree View\"));\n\t\tsplitpane_left.setDividerLocation(400);\n\t\tsplitpane_left.setLastDividerLocation(0);\n\t\tsplitpane_left.setOneTouchExpandable(true);\n\t\tsplitpane_right.setBorder(BorderFactory.createTitledBorder(\"Classifer Output\"));\n\t\tsplitpane_main.setDividerLocation(500);\n\t\tsplitpane_main.setLastDividerLocation(0);\n\t\tsplitpane_main.setOneTouchExpandable(true);\n\t\tlocalContainer.add(splitpane_main, \"Center\");\n\t\tlocalContainer.add(statusPanel,BorderLayout.SOUTH);\n\t}", "private void initRoot() {\n root = new VBox(10);\n root.setAlignment(Pos.CENTER);\n root.setPadding(new Insets(10));\n root.setPrefWidth(300);\n root.setPrefHeight(150);\n }", "@Override\n public void start(Stage primaryStage) {\n \n tabPane = new TabPane();\n tree = new OwnTreeView(tabPane, new OwnTreeItem());\n tabs = new OwnTabs(tree,tabPane);\n areas = new OwnTextAreas(tree,tabPane);\n projects = new Projects();\n file = new OwnFile(areas,tabs,tree,projects);\n areas.setTabs(tabs);\n tabs.setAreas(areas);\n tree.setAreas(areas);\n tree.setTabs(tabs);\n\n //Creo un array de separadores de menuitems\n for (int i = 0; i < separate.length; i++) {\n separate[i] = new SeparatorMenuItem();\n }\n\n Point3D punto = new Point3D(0, 0, 1);\n\n //Panel que contiene todos los demás contenidos\n root = new BorderPane();\n root.autosize();\n root.setMaxHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setMaxWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setMinHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setMinWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setPrefHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setPrefWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setScaleX(1);\n root.setScaleY(1);\n root.setScaleZ(1);\n root.setRotationAxis(punto);\n\n //Barra principal con las pestañas de los menús\n bar = new MenuBar();\n bar.autosize();\n bar.setMaxHeight(MenuBar.USE_COMPUTED_SIZE);\n bar.setMaxWidth(MenuBar.USE_COMPUTED_SIZE);\n bar.setMinHeight(24);\n bar.setMinWidth(MenuBar.USE_COMPUTED_SIZE);\n bar.setPrefHeight(22);\n bar.setPrefWidth(1024);\n bar.setScaleX(1);\n bar.setScaleY(1);\n bar.setScaleZ(1);\n bar.setRotationAxis(punto);\n\n //Menús\n menuFile = new Menu(\"Archivo\");\n\n //MenuItems del menú \"Archivo\"\n open = new MenuItem(\"Abrir Ctrl+O\");\n open.getStyleClass().add(\"menuitem\");\n /**\n * Abre un archivo en un nuevo tab que crea y escribe el texto de dicho\n * archivo en el area correspondiente al tab seleccionado, que es el tab\n * creado. ATAJO : CTRL+0\n */\n open.setOnAction(_openFile = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n\n file.open();\n }\n });\n \n /*\n * Abre un proyecto seleccionado,con todas sus subcarpetas\n * y archivos llamando a la función abrirProyecto(explicada mas abajo)\n */\n openProject = new MenuItem(\"Abrir proyecto\");\n openProject.getStyleClass().add(\"menuitem\");\n openProject.setOnAction(_projectOpen = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.openProject();\n }\n });\n /**\n * Guarda un archivo, en el caso de que el archivo haya sido abierto y\n * ya existiese, se guardará en la dirección que le corresponda, en el\n * caso de que no existiese se llamará a la función guardarComo\n * guardandose en la dirección que se le indique. ATAJO : CTRL + S\n */\n save = new MenuItem(\"Guardar Ctrl+S\");\n save.getStyleClass().add(\"menuitem\");\n save.setOnAction(_saveFile = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.save();\n }\n });\n\n /**\n * Guarda un archivo en una dirección determinada, ya estuviese o no\n * creado el archivo, al realizar el guardado con otro nombre\n * actualizara el nombre del tab y el nombre que aparezca en el\n * TreeView.\n */\n saveAs = new MenuItem(\"Guardar Como...\");\n saveAs.getStyleClass().add(\"menuitem\");\n saveAs.setOnAction(_asSave = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.saveAs();\n }\n });\n\n /**\n * Cierra el programa JavEditor\n */\n close = new MenuItem(\"Cerrar\");\n close.getStyleClass().add(\"menuitem\");\n close.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n System.exit(0);\n }\n });\n\n /**\n * Abre una nueva pestaña para crear un nuevo archivo. ATAJO : CTRL+N\n */\n newTab = new MenuItem(\"Nuevo Archivo Ctrl+N\");\n newTab.getStyleClass().add(\"menuitem\");\n newTab.setOnAction(_tabNew = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n tabs.newTab(_isForOpen);\n }\n });\n \n\n /*\n * Cierra el tab que se encuentra seleccionado. Buscamos el tab seleccionado, y cuando lo encontramos\n * borramos del TreeView el nombre del archivo correspondiente con actualizarArbol, y eliminamos\n * la posición creada para la dirección del archivo, el area y el tab de las listas tabs y areas, \n * a parte de eliminarlo del tabPane ya que al ser un atajo no se realiza por defecto. ATAJO : CTRL+A\n */\n closeFile = new MenuItem(\"Cerrar Archivo Ctrl+T\");\n closeFile.getStyleClass().add(\"menuitem\");\n closeFile.setOnAction(_fileClose = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n String s;\n boolean noestab = false;\n OwnTextArea a = areas.seleccionarArea();\n if(areas.isModificated(a)){\n int n = JOptionPane.showConfirmDialog(null, \"Do you want save the file?\");\n if(n==JOptionPane.CANCEL_OPTION){\n return;\n }else if(n==JOptionPane.YES_OPTION){\n _asSave.handle(null);\n }\n }\n for(int i=0;i<tabs.size();i++){\n if(!tabs.get(i).isSelected()){\n continue;\n }else{\n tree.getItems().getChildren().remove(tabs.get(i).getTreeItem());\n tabPane.getTabs().remove(tabs.get(i));\n areas.remove(a);\n tabs.remove(tabs.get(i));\n break;\n }\n }\n }\n });\n\n /*\n * Cierra todos los tabs abiertos del programa, recorre todos los tabs del tabPane y los va eleminando\n * de la lista uno por uno, ademas, se borran las correspondientes direcciones de archivos guardadas y\n * las areas creadas para los tabs.Además se van borrando los nombres del TreeView\n */\n closeAll = new MenuItem(\"Cerrar Todo Ctrl+Q\");\n closeAll.getStyleClass().add(\"menuitem\");\n closeAll.setOnAction(_allClose = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n int longitudTabPane = tabPane.getTabs().size();\n for (int i = 0; i < longitudTabPane; i++) {\n OwnTextArea a = areas.seleccionarArea();\n if(areas.isModificated(a)){\n int n = JOptionPane.showConfirmDialog(null, \"Do you want save the file?\");\n if(n==JOptionPane.CANCEL_OPTION){\n return;\n }else if(n==JOptionPane.YES_OPTION){\n _asSave.handle(null);\n }\n }\n if (tree.getItems().getChildren().size() > 0) {\n tree.getItems().getChildren().remove(0);\n }\n tabPane.getTabs().remove(0);\n }\n for (int i = 0; i < tabs.size(); i++) {\n tabs.remove(0);\n areas.remove(0);\n }\n }\n });\n menuFile.getItems().addAll(newTab, separate[0], open, openProject, save, saveAs, separate[1], closeFile, closeAll, separate[2], close);\n menuFile.getStyleClass().add(\"menu\");\n menuEdit = new Menu(\"Edición\");\n\n //Submenús de \"Edición\"\n undo = new MenuItem(\"Deshacer Ctrl+Z\");\n /*\n * Deshace la acción previa hecha\n */\n undo.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.undo();\n }\n });\n\n selectAll = new MenuItem(\"Seleccionar Todo Ctrl+A\");\n\n /*\n * Selecciona todo el texto del area del tab en el que se encuentra en el momento\n */\n selectAll.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.selectAll();\n }\n });\n\n deselect = new MenuItem(\"Deseleccionar\");\n /*\n * Deselecciona lo seleccionado previamente\n */\n deselect.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.deselect();\n }\n });\n\n cut = new MenuItem(\"Cortar Ctrl+X\");\n /*\n * Corta lo seleccionado, elimina de la pantalla lo seleccionado, almacenandolo en la variable seleccion\n * para su posible posterior pegado\n */\n cut.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.cut();\n }\n });\n\n copy = new MenuItem(\"Copiar Ctrl+C\");\n /**\n * Copia lo seleccionado, almacena dicha selección en la variable\n * seleccion para su posible posterior pegado\n */\n copy.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.copy();\n }\n });\n\n paste = new MenuItem(\"Pegar Ctrl+V\");\n /*\n * Añade al texto del area del tab seleccionado lo que se encuentra en la variable selección.\n */\n paste.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.paste(); \n }\n });\n\n delete = new MenuItem(\"Eliminar\");\n /*\n * Elimina lo seleccionado, a diferencia de cortar, este no guarda el texto en ninguna variable.\n */\n delete.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.delete();\n }\n });\n\n menuEdit.getItems().addAll(undo, separate[3], copy, cut, paste, delete, separate[4], selectAll,deselect);\n menuHelp = new Menu(\"Ayuda\");\n\n //Submenús de \"Ayuda\"\n about = new MenuItem(\"Sobre JavEditor\");\n\n /*\n * Abre una nueva ventana donde se da información de JavEditor\n */\n about.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n Stage stage = new Stage();\n About sobre = new About();\n sobre.start(stage);\n }\n });\n\n menuHelp.getItems().addAll(about);\n menuPreferences = new Menu(\"Preferencias\");\n\n //SubMenús de \"Preferencias\"\n font = new MenuItem(\"Fuente\");\n menuPreferences.getItems().addAll(font);\n bar.getMenus().addAll(menuFile, menuEdit, menuPreferences, menuHelp);\n\n //TabPane\n \n tabPane.getStyleClass().add(\"tabpane\");\n tabPane.autosize();\n tabPane.setLayoutX(0);\n tabPane.setLayoutY(24);\n tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.ALL_TABS);\n tabPane.setMinHeight(TabPane.USE_COMPUTED_SIZE);\n tabPane.setMinWidth(TabPane.USE_COMPUTED_SIZE);\n tabPane.setPrefHeight(378);\n tabPane.setPrefWidth(600);\n tabPane.setScaleX(1);\n tabPane.setScaleY(1);\n tabPane.setScaleZ(1);\n tabPane.setRotationAxis(punto);\n tabPane.setPrefWidth(1024);\n\n //TreeView\n \n tree.createChilds();\n tree.setPrefHeight(20);\n tree.getStyleClass().add(\"tree-view\");\n \n \n //Si una tecla es pulsada se almacena el codigo en la lista codigoTeclas y si hay mas de 1\n //se realiza la comprobacion de las teclas pulsadas.\n root.setOnKeyPressed(new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent event) {\n keyCodes.add(event.getCode());\n if (keyCodes.size() > 1) {\n comprobarTeclas();\n }\n }\n });\n //Si alguna tecla se suelta deja de ser pulsada se elimina de la lista\n root.setOnKeyReleased(new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent event) {\n keyCodes.remove(event.getCode());\n }\n });\n\n //El panel de tabs y la barra de herramientas se añaden al panel root\n root.setLeft(tree);\n root.setTop(bar);\n root.setCenter(tabPane);\n \n \n Scene scene = new Scene(root);\n scene.getStylesheets().add(\"/JavEditor/JavEditor.css\");\n Image imagen = new Image(\"JavEditor/Images/Icono.gif\", 10, 10, false, false);\n primaryStage.getIcons().add(imagen);\n primaryStage.setTitle(\"JavEditor\");\n primaryStage.setScene(scene);\n primaryStage.show();\n }", "public void setTree(Tree tree) {\n this.tree = tree;\n }", "private void createGestureTreeView(final String root) {\n this.root = new TreeItem<String>(root);\n this.root.setExpanded(true);\n this.treeView.setRoot(this.root);\n final List<String> userGestures = this.recognizer.getAllUserGesture();\n for (int i = 0; i < userGestures.size(); i++) {\n this.makeGestureBranch(userGestures.get(i), this.root);\n }\n }", "public void paint() {\n int L = 150; // Local convenience var\n\n // Declare three lines (left, middle, and right)\n Line left = new Line(L, L, L, getHeight() - L);\n Line middle = new Line(L, getHeight() / 2, getWidth() - L, getHeight() / 2);\n Line right = new Line(getWidth() - L, L, getWidth() - L, getHeight() - L);\n\n getChildren().clear(); // Clear the pane before redisplay\n\n displayHTree(order, left, middle, right); // Call the recursive method\n }", "private void split(){\n // Slice horizontaly to get sub nodes width\n float subWidth = this.getBounds().width / 2;\n // Slice vertically to get sub nodes height\n float subHeight = this.getBounds().height / 2;\n float x = this.getBounds().x;\n float y = this.getBounds().y;\n int newLevel = this.level + 1;\n\n // Create the 4 nodes\n this.getNodes().add(0, new QuadTree(newLevel, new Rectangle(x + subWidth, y, subWidth, subHeight)));\n this.getNodes().add(1, new QuadTree(newLevel, new Rectangle(x, y, subWidth, subHeight)));\n this.getNodes().add(2, new QuadTree(newLevel, new Rectangle(x, y + subHeight, subWidth, subHeight)));\n this.getNodes().add(3, new QuadTree(newLevel, new Rectangle(x + subWidth, y + subHeight, subWidth, subHeight)));\n\n }", "private void initComponents() {//GEN-BEGIN:initComponents\n scrollPanel = new javax.swing.JScrollPane();\n hierarchy = new JTree(treeModel);\n setLayout(new java.awt.BorderLayout());\n \n \n hierarchy.setPreferredSize(new java.awt.Dimension(300, 500));\n hierarchy.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n hierarchyMouseClicked(evt);\n }\n }\n );\n scrollPanel.setViewportView(hierarchy);\n \n \n add(scrollPanel, java.awt.BorderLayout.CENTER);\n \n }", "private void initAdminCard(Pane root) {\n\t\t//Get stack pane\n\t\tfinal StackPane sp1 = (StackPane) root.lookup(\"#sp1\");\n\n\t\t//set depth\n\t\tJFXDepthManager.setDepth(sp1, 2);\n\t\tFont font = Font.font(\"Verdana\", FontWeight.BOLD, 15);\n\t\t// initialize Header\n\t\tStackPane header = new StackPane();\n\t\tLabel headerText = new Label(\"Administration\");\n\t\theaderText.setFont(font);\n\t\theaderText.setTextFill(Paint.valueOf(\"#FFF\"));\n\t\theader.getChildren().add(headerText);\n\t\theader.setStyle(\"-fx-background-radius: 5 5 0 0; -fx-background-color: \" + headerColor);\n\t\tVBox.setVgrow(header, Priority.ALWAYS);\n\n\t\t//Initialize body\n\t\tStackPane body = new StackPane();\n\t\tbody.setMinHeight(80);\n\t\t//Create Image For Icon\n\t\tImageView icon = new ImageView(new Image(this.getClass().getResourceAsStream(\"boss.png\")));\n\t\tStackPane.setAlignment(icon, Pos.CENTER);\n\t\tStackPane.setMargin(icon, new Insets(5, 5, 5, 5));\n\t\t//Add icon in body\n\t\tbody.getChildren().add(icon);\n\n\t\t//Create vbox for header and body\n\t\tVBox content = new VBox();\n\t\tJFXRippler ripper = new JFXRippler(content);\n\t\tcontent.getChildren().addAll(header, body);\n\t\tbody.setStyle(\"-fx-background-radius: 0 0 5 5; -fx-background-color: rgb(255,255,255,0.87);\");\n\n\t\t//Initialize Button\n\t\tJFXButton button = new JFXButton(\"\");\n\t\tbutton.setTooltip(new Tooltip(\"Login As Administrator\"));\n\t\tbutton.setButtonType(ButtonType.RAISED);\n\t\tbutton.setStyle(\"-fx-background-radius: 40;-fx-background-color: #01A05E\");\n\t\tbutton.setPrefSize(40, 40);\n\t\tbutton.setRipplerFill(Color.valueOf(headerColor));\n\t\tbutton.setScaleX(0);\n\t\tbutton.setScaleY(0);\n\n\t\t//Glyph icon\n\t\tSVGGlyph glyph = new SVGGlyph(-1, \"Login\",\n\t\t\t\t\"M1008 6.286q18.857 13.714 15.429 36.571l-146.286 877.714q-2.857 16.571-18.286 25.714-8 4.571-17.714 4.571-6.286 \"\n\t\t\t\t\t\t+ \"0-13.714-2.857l-258.857-105.714-138.286 168.571q-10.286 13.143-28 13.143-7.429 \"\n\t\t\t\t\t\t+ \"0-12.571-2.286-10.857-4-17.429-13.429t-6.571-20.857v-199.429l493.714-605.143-610.857 \"\n\t\t\t\t\t\t+ \"528.571-225.714-92.571q-21.143-8-22.857-31.429-1.143-22.857 18.286-33.714l950.857-548.571q8.571-5.143 18.286-5.143\" + \" 11.429 0 20.571 6.286z\",\n\t\t\t\tColor.WHITE);\n\t\tglyph.setSize(20, 20);\n\n\t\tbutton.setGraphic(glyph);\n\t\tbutton.translateYProperty().bind(Bindings.createDoubleBinding(() -> {\n\t\t\treturn header.getBoundsInParent().getHeight() - button.getHeight() / 2;\n\t\t}, header.boundsInParentProperty(), button.heightProperty()));\n\t\tStackPane.setMargin(button, new Insets(0, 12, 0, 0));\n\t\tStackPane.setAlignment(button, Pos.BOTTOM_RIGHT);\n\n\t\t//Create timeline for animation\n\t\tTimeline animation = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(button.scaleXProperty(), 1, javafx.animation.Interpolator.EASE_IN),\n\t\t\t\tnew KeyValue(button.scaleYProperty(), 1, javafx.animation.Interpolator.EASE_IN)));\n\t\tanimation.setDelay(Duration.millis(1000));\n\t\tanimation.play();\n\t\tsp1.getChildren().addAll(content, button, ripper);\n\n\t\t///Event on Button\n\t\tbutton.setOnAction(new EventHandler<ActionEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "private void expandTree() {\n tree.expand();\n }", "private JScrollPane createTreeScrollPanel() {\n for (Map.Entry<VirtualFile, VcsRoot> entry : files.entrySet()) {\n createDirectoryNodes(entry.getKey(), entry.getValue());\n }\n\n final FileTreeRenderer renderer = new FileTreeRenderer();\n\n tree = new CheckboxTree(renderer, root);\n tree.setCellRenderer(renderer);\n tree.setRootVisible(true);\n tree.setShowsRootHandles(false);\n UIUtil.setLineStyleAngled(tree);\n TreeUtil.installActions(tree);\n\n final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(tree);\n scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n TreeUtil.expandAll(tree);\n\n tree.getModel().addTreeModelListener(treeModelListener);\n treeExpander = new DefaultTreeExpander(tree);\n\n return scrollPane;\n }", "public Tree(PApplet t, PImage tree) {\n\t\tthis.t = t;\n\t\tthis.tree = tree;\n\t}", "protected void addStructureTreeRoot() {\n\t\tif (doc.getDocumentCatalog().getStructureTreeRoot() == null) {\n\t\t\tdoc.getDocumentCatalog().setStructureTreeRoot(new PDStructureTreeRoot());\n\t\t}\n\t}", "private void initRootLayout() {\n try {\n // Load root layout from fxml file.\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(MainApp.class.getResource(VIEW_ROOT_LAYOUT_FXML));\n rootLayout = loader.load();\n\n mApplicationCompositionRoot = new ApplicationCompositionRoot(this, rootLayout);\n\n //grab your root here\n rootLayout.setOnMousePressed(event -> {\n xOffset = event.getSceneX();\n yOffset = event.getSceneY();\n });\n\n //move around here\n rootLayout.setOnMouseDragged(event -> {\n mPrimaryStage.setX(event.getScreenX() - xOffset);\n mPrimaryStage.setY(event.getScreenY() - yOffset);\n });\n\n // Show the scene containing the root layout.\n Scene scene = new Scene(rootLayout);\n mPrimaryStage.setScene(scene);\n mPrimaryStage.show();\n\n //Give the controller access to the main app.\n RootLayout controller = loader.getController();\n controller.setMainApp(this);\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void interactiveTreeXXEditingRToL() {\r\n JTree tree = new JTree(); \r\n tree.setEditable(true);\r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n DefaultTreeEditor treeCellEditor = new DefaultTreeEditor();\r\n tree.setCellEditor(treeCellEditor);\r\n JXTree xTree = new JXTree();\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n xTree.setCellEditor(new DefaultTreeEditor());\r\n\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"XXEditing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "private void initComponents() {\n jSplitPane1 = new javax.swing.JSplitPane();\n pnlTree = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jtrLocal = new DnDTree();\n pnlTab = new javax.swing.JPanel();\n jtpApps = new javax.swing.JTabbedPane();\n\n jSplitPane1.setDividerLocation(260);\n\n pnlTree.setBorder(javax.swing.BorderFactory.createTitledBorder(\n NbBundle.getMessage(\n EditDistributionVisualPanel2.class,\n \"EditDistributionVisualPanel2.pnlTree.border.title\"))); // NOI18N\n\n jtrLocal.setDragEnabled(true);\n jScrollPane1.setViewportView(jtrLocal);\n\n final javax.swing.GroupLayout pnlTreeLayout = new javax.swing.GroupLayout(pnlTree);\n pnlTree.setLayout(pnlTreeLayout);\n pnlTreeLayout.setHorizontalGroup(\n pnlTreeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(\n jScrollPane1,\n javax.swing.GroupLayout.DEFAULT_SIZE,\n 246,\n Short.MAX_VALUE));\n pnlTreeLayout.setVerticalGroup(\n pnlTreeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(\n jScrollPane1,\n javax.swing.GroupLayout.Alignment.TRAILING,\n javax.swing.GroupLayout.DEFAULT_SIZE,\n 238,\n Short.MAX_VALUE));\n\n jSplitPane1.setLeftComponent(pnlTree);\n\n final javax.swing.GroupLayout pnlTabLayout = new javax.swing.GroupLayout(pnlTab);\n pnlTab.setLayout(pnlTabLayout);\n pnlTabLayout.setHorizontalGroup(\n pnlTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(\n jtpApps,\n javax.swing.GroupLayout.Alignment.TRAILING,\n javax.swing.GroupLayout.DEFAULT_SIZE,\n 200,\n Short.MAX_VALUE));\n pnlTabLayout.setVerticalGroup(\n pnlTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(\n jtpApps,\n javax.swing.GroupLayout.Alignment.TRAILING,\n javax.swing.GroupLayout.DEFAULT_SIZE,\n 266,\n Short.MAX_VALUE));\n\n jSplitPane1.setRightComponent(pnlTab);\n\n final javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(\n jSplitPane1,\n javax.swing.GroupLayout.Alignment.TRAILING,\n javax.swing.GroupLayout.DEFAULT_SIZE,\n 471,\n Short.MAX_VALUE));\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(\n jSplitPane1,\n javax.swing.GroupLayout.Alignment.TRAILING,\n javax.swing.GroupLayout.DEFAULT_SIZE,\n 270,\n Short.MAX_VALUE));\n }", "private void createTree() {\n DefaultMutableTreeNode topNode = new DefaultMutableTreeNode(\"The World\");\n myTree = new JTree(topNode);\n\n DefaultMutableTreeNode mainPortNode = new DefaultMutableTreeNode(\"Sea Ports\");\n topNode.add(mainPortNode);\n\n for(SeaPort mySeaPort : world.getPorts()) {\n DefaultMutableTreeNode individualPortNode = new DefaultMutableTreeNode(mySeaPort.getName());\n mainPortNode.add(individualPortNode);\n\n DefaultMutableTreeNode peopleNode = new DefaultMutableTreeNode(\"People\");\n individualPortNode.add(peopleNode);\n for(Person myPerson : mySeaPort.getPersons()) {\n DefaultMutableTreeNode individualPeopleNode = new DefaultMutableTreeNode(myPerson.getName());\n peopleNode.add(individualPeopleNode);\n }\n\n DefaultMutableTreeNode dockNode = new DefaultMutableTreeNode(\"Docks\");\n individualPortNode.add(dockNode);\n for(Dock myDock : mySeaPort.getDocks()) {\n DefaultMutableTreeNode individualDockNode = new DefaultMutableTreeNode(myDock.getName());\n dockNode.add(individualDockNode);\n if(myDock.getShip() != null) {\n DefaultMutableTreeNode dockedShip = new DefaultMutableTreeNode(myDock.getShip().getName());\n individualDockNode.add(dockedShip);\n for(Job myJob : myDock.getShip().getJobs()) {\n DefaultMutableTreeNode dockedShipJob = new DefaultMutableTreeNode(myJob.getName());\n dockedShip.add(dockedShipJob);\n }\n }\n }\n\n DefaultMutableTreeNode portQueNode = new DefaultMutableTreeNode(\"Ship Queue\");\n individualPortNode.add(portQueNode);\n for(Ship myShip : mySeaPort.getQue()) {\n DefaultMutableTreeNode quedShip = new DefaultMutableTreeNode(myShip.getName());\n portQueNode.add(quedShip);\n for(Job myJob : myShip.getJobs()) {\n DefaultMutableTreeNode quedShipJob = new DefaultMutableTreeNode(myJob.getName());\n quedShip.add(quedShipJob);\n }\n }\n\n } //end of initial for loop inside createTree() method\n\n /*This method call is added in case a user reads a new data file after they\n have already read one or more data files.\n */\n myTreePanel.removeAll();\n\n //Add everything to the myTreePanel\n JScrollPane myTreeScroll = new JScrollPane(myTree);\n myTreePanel.add(myTreeScroll, BorderLayout.CENTER);\n validate();\n }", "@Override\r\n\tprotected Object createLowerView(Composite parent) {\n\t\tfTree = new Tree(parent, SWT.BORDER );\r\n\t\tfTree.addSelectionListener(new SelectionAdapter() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t// https://jira.jboss.org/browse/JBIDE-7107\r\n\t\t\t\t// update \"OK\" button enablement\r\n\t\t\t\tupdateOkState();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t \r\n\t\tfTreeViewer = new TreeViewer(fTree);\r\n\t\tfTreeViewer.setContentProvider( treeContentProvider );\r\n\t\tfTreeViewer.setLabelProvider(new ModelTreeLabelProvider());\r\n\t\tfTreeViewer.setInput ( null );\r\n\t\tfTreeViewer.setAutoExpandLevel( getAutoExpandLevel() );\r\n\t\t// end tree viewer for variable structure\r\n\t\tGridData data = new GridData(); \r\n\t data.grabExcessVerticalSpace = true;\r\n\t data.grabExcessHorizontalSpace = true;\r\n\t data.horizontalAlignment = GridData.FILL;\r\n\t data.verticalAlignment = GridData.FILL;\r\n\t data.minimumHeight = 200;\r\n\t fTree.setLayoutData(data);\r\n\t \r\n\t\treturn fTree;\r\n\t}", "private JTree makeCatalogTree() {\n\t\t\n\t\ttree_root = new DefaultMutableTreeNode(\"all photos\");\n\t\ttree_root.setUserObject(root);\n\t\t\n\t\tfinal JTree tree = new JTree(tree_root);\n\t\ttree.setMinimumSize(new Dimension(200,400));\n\n\t\ttree.setToggleClickCount(3); // so that we can use double-clicks for previewing instead of expanding/collapsing\n\n\t\tDefaultTreeSelectionModel selectionModel = new DefaultTreeSelectionModel();\n\t\tselectionModel.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);\n\t\ttree.setSelectionModel(selectionModel);\n\t\t\n\t\ttree.addMouseListener(new MouseInputAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t// if left-double-click @@@changed =2 to ==1\n\t\t\t\tif (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {\n\t\t\t\t\tDefaultMutableTreeNode tempNode = getSelectedTreeNode();\n\t\t\t\t\tAlbum chosenAlbum =(Album) tempNode.getUserObject();\n\t\t\t\t\t\n\t\t\t\t\tpreviewPane.display(chosenAlbum);\n\t\t\t\t\t\n\t\t\t\t\t// YOUR CODE HERE\n\t\t\t\t\tSystem.out.println(\"show the photos for album \" + getSelectedTreeNode());\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t\t\n\t\treturn tree;\n\t}", "public void refresh()\n\t{\n\t\tNode master = new Node(\"Tyler\");\n\t\t//master.add(new Node(\"Test\"));\n\t\tmaster.addParent(new Node(\"Clinton\"));\n\t\tmaster.addParent(new Node(\"Terry\"));\n\t\t\n\t\tmaster.add(\"Justin\", \"Terry\"); \n\t\tmaster.add(\"Justin\", \"Clinton\"); \n\t\t//this adds directly under Terry\n\t\t//maybe do this differently...\n\t\t\n\t\t\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"Diana\"));\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"George\"));\n\t\t\n\t\tmaster.add(new Node(\"Tyler 2.0\"));\n\t\tmaster.add(new Node(\"Tyler 3.0\"));\n\t\tmaster.add(new Node(\"Tyler Jr\"));\n\t\t\n\n\t\tmaster.add(\"Tyler Jr Jr\", \"Tyler 2.0\");\n\t\t\n\t\tmaster.add(\"Tyler 3.0\", \"Tyler Jr 2.0\");\n\t\t\n\t\tmaster.findNode(\"Clinton\").addParent(new Node(\"Eric\"));\n\t\tmaster.findNode(\"Eric\").addParent(new Node(\"Eric's Dad\"));\n\t\t\n\t\t\n\t\tmaster.findNode(\"Tyler Jr Jr\", 6).add(new Node(\"Mini Tyler\"));\n\t\t//master.findNode(\"Clinton\", 2).add(new Node(\"Justin\"));\n\t\t\n\t\t\n\t\tmaster.getParent().get(0).findNode(\"Justin\", 3).add(new Node(\"Mini Justin\"));\n\t\t\n\t\tmaster.add(new Node(\"Laptop\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Keyboard\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Mouse\"));\n\t\t\n\t\tmaster.add(\"Touchpad\", \"Laptop\");\n\t\t//master.add(\"Justin\", \"Eric\");\n\t\t\n\t\tmaster.add(\"Hunger\", \"Tyler\");\n\t\t\n\t\tselectedNode = master;\n\t\tselect(selectedNode);\n\t}", "public void recomputeTree() {\n\t\tsuperRoot = factory.createTreeNode(null, this);\n\t\tlayoutToTree.put(null, superRoot);\n\t\tcreateTrees(context.getNodes());\n\t}", "public void addChild(TreeItem t) {\n\t\tleaves = null;\n\t\ttreeLeaves = null;\n\t\tdecideNorm = false;\n\t\tItem newKids[] = new Item[numChildren+1];\n\t\tfor (int i = 0; i < numChildren; i++)\n\t\t\tnewKids[i] = children[i];\n\t\tnewKids[numChildren] = t;\n\t\tchildren = newKids;\n\t\tnumChildren++;\n\t\tsetHashCode();\n\t\tsetNumNodes();\n\t}", "public void showTree(IGPProgram a_prog, String a_filename,\n TreeBranchRenderer a_treeBranchRenderer,\n TreeNodeRenderer a_treeNodeRenderer)\n throws InvalidConfigurationException {\n TreeNode myTree = createTree(a_prog);\n if (myTree == null) {\n return;\n }\n TreeVisualizer tv = new TreeVisualizer();\n tv.setTreeBranchRenderer(a_treeBranchRenderer);\n tv.setTreeNodeRenderer(a_treeNodeRenderer);\n tv.setBranchStartWidth(18.0);\n tv.setArenaColor(Color.black);\n tv.setBkgndColor(Color.black);\n tv.setRenderNodes(true);\n tv.setSide(1024);\n tv.setCircleDiminishFactor(0.5);\n tv.writeImageFile(tv.renderTree(myTree), new File(a_filename));\n }", "private void loadInitialTree() {\n navTreeWidget.addItem( \"Please wait...\" );\n DeferredCommand.addCommand(new Command() {\n\t\t\tpublic void execute() {\n\t\t service.loadChildCategories( \"/\",\n\t\t new GenericCallback() {\n\n\n\t\t public void onSuccess(Object result) {\n\t\t selectedPath = null;\n\t\t navTreeWidget.removeItems();\n\n\t\t TreeItem root = new TreeItem();\n\t\t root.setHTML(\"<img src=\\\"images/desc.gif\\\"/>\");\n\t\t navTreeWidget.addItem(root);\n\n\t\t String[] categories = (String[]) result;\n\n\t\t if (categories.length == 0) {\n\t\t showEmptyTree();\n\t\t } else {\n\t\t hideEmptyTree();\n\t\t }\n\t\t for ( int i = 0; i < categories.length; i++ ) {\n\t\t TreeItem it = new TreeItem();\n\t\t it.setHTML( \"<img src=\\\"images/category_small.gif\\\"/>\" + categories[i] );\n\t\t it.setUserObject( categories[i] );\n\t\t it.addItem( new PendingItem() );\n\t\t root.addItem( it );\n\t\t }\n\n\t\t root.setState(true);\n\t\t }\n\n\n\n\t\t } );\n\t\t\t}}\n );\n\n }", "public ShowTree(GUIMain guiMn) throws HeadlessException {\n setSize(200, 400);\n\n guiMn.simMain.rootNode = new DefaultMutableTreeNode(\"Physiology systems\");\n guiMn.simMain.treeModel = new DefaultTreeModel(guiMn.simMain.rootNode);\n guiMn.simMain.treeModel.addTreeModelListener(new WBodyTreeModelListener());\n\n guiMn.myTree = new ConnectionJTree(guiMn.simMain.treeModel);\n\n guiMn.myTree.setEditable(true);\n guiMn.myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n\n guiMn.myTree.setCellRenderer(new CountryTreeCellRenderer());\n\n // even rootNode could be foldable\n guiMn.myTree.setShowsRootHandles(true);\n\n // make it possible to select a insideLeaf\n JLabel selectedLabel = new JLabel();\n add(selectedLabel, BorderLayout.SOUTH);\n\n /*\n * this call the routine managing clicks on tree's elements\n */\n guiMn.myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {\n @Override\n public void valueChanged(TreeSelectionEvent e) {\n DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) guiMn.myTree.getLastSelectedPathComponent();\n if (selectedNode != null) {\n // A button has been clicked\n WBodyTreeEvent wbte = new WBodyTreeEvent(guiMn);\n wbte.buttonClicked(selectedLabel, selectedNode);\n }\n }\n\n });\n\n }", "public void initRootLayout() {\n try {\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(MainApplication.class.getResource(\"view/RootLayout.fxml\"));\n rootLayout = (BorderPane) loader.load();\n Scene scene = new Scene(rootLayout);\n primaryStage.setScene(scene);\n primaryStage.show();\n } catch (IOException e) {\n e.printStackTrace();\n \t}\n }", "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}", "DnDTree() {\n dragSource = DragSource.getDefaultDragSource();\n dragSource.createDefaultDragGestureRecognizer(\n this, // component where drag originates\n DnDConstants.ACTION_COPY_OR_MOVE, // actions\n this); // drag gesture recognizer\n }", "public void treeSelection() {\n\t\tFlowTreeNode ftn = (FlowTreeNode) tree.getLastSelectedPathComponent();\n\n\t\tif (ftn == null)\n\t\t\treturn;\n\t\telse\n\n\t\t{\n\n\t\t\tftn.execute();\n\t\t\tthis.revalidate();\n\t\t\t// buildTreeView();\n\n\t\t}\n\t}", "private void setup(){\n buildTree(2);\n }", "public void refreshTree(){\n\r\n\t\ttestCaseVector = db.getTestCases();\r\n\t\tFolderVector = db.getFolders();\r\n\t\trootNode_TC = new DefaultMutableTreeNode(\"Test Cases\");\r\n\t\ts = new MyTreeNode [testCaseVector.size()+FolderVector.size() +2];\r\n\t\tFolder1 = new DefaultMutableTreeNode [testCaseVector.size()+FolderVector.size() +2];\r\n\r\n\r\n\r\n\t\tint x = 1 ; \r\n\t\tfor(Folder f: FolderVector){\r\n\t\t\ts[x] = new MyTreeNode(f.getName(),'f', x, f.getFolderID());\r\n\r\n\t\t\tExpandedID[x] = f.getFolderID();\r\n\t\t\tFolder1[x] = new DefaultMutableTreeNode(s[x]);\r\n\r\n\t\t\tif (f.getParentID() == 0)\r\n\t\t\t{\r\n\t\t\t\trootNode_TC.add(Folder1[x]);\r\n\t\t\t\tx++;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\telse {\r\n\r\n\t\t\t\tfor (int u = 1 ; u < s.length; u++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif(s[u]!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(s[u].getType() == 'f')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(s[u].getID() == f.getParentID())\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tFolder1[u].add(Folder1[x]);\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tint l = x-1;\r\n\t\t\tfor(TestCase tc : testCaseVector)\r\n\t\t\t{\r\n\r\n\t\t\t\tif (tc.getFolderID() == f.getFolderID())\r\n\t\t\t\t{\r\n\t\t\t\t\ts[x] =new MyTreeNode(tc.getName(), 't', x, tc.getId());\r\n\r\n\t\t\t\t\tFolder1[l].add(new DefaultMutableTreeNode(s[x]));\r\n\t\t\t\t\tx++;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tint y = FolderVector.size()+1;\r\n\t\tfor(TestCase tc : testCaseVector)\r\n\t\t{\r\n\t\t\tif(tc.getFolderID() == 0){\r\n\r\n\r\n\t\t\t\tMyTreeNode s=new MyTreeNode(tc.getName(), 't', y, tc.getId());\r\n\t\t\t\trootNode_TC.add(new DefaultMutableTreeNode(s));\r\n\t\t\t\ty++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tDefaultTreeModel Tree1 = new DefaultTreeModel(rootNode_TC);\r\n\t\toverviewTree.setModel(Tree1);\r\n\t\toverviewTree.setCellRenderer(new TreeRenderer(isExpanded, ExpandedID));\r\n\t\tfor(Folder f: FolderVector)\r\n\t\t{\r\n\t\t\tif(isExpanded[f.getFolderID()]){ // To expand the already expanded folders\r\n\t\t\t\tfor (int u = 1 ; u < s.length; u++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif(s[u]!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(s[u].getType() == 'f')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(s[u].getID() == f.getFolderID())\r\n\t\t\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t\t\tEnumeration<DefaultMutableTreeNode> e = rootNode_TC.depthFirstEnumeration();\r\n\t\t\t\t\t\t\t\twhile (e.hasMoreElements()) {\r\n\t\t\t\t\t\t\t\t\tDefaultMutableTreeNode node = e.nextElement();\r\n\t\t\t\t\t\t\t\t\tif (node != overviewTree.getModel().getRoot() )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tMyTreeNode nodeInfo = null ;\r\n\t\t\t\t\t\t\t\t\t\tnodeInfo = (MyTreeNode) node.getUserObject();\r\n\t\t\t\t\t\t\t\t\t\tif (nodeInfo.getName().equalsIgnoreCase(s[u].getName())) \r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tTreePath p = new TreePath(node.getPath());\r\n\t\t\t\t\t\t\t\t\t\t\toverviewTree.expandRow(overviewTree.getRowForPath(p));\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "@Override\r\n\tpublic void createPartControl(Composite parent) {\r\n\t\tComposite container = new Composite(parent, SWT.NONE);\r\n\t\tcontainer.setLayout(new FillLayout(SWT.HORIZONTAL));\r\n\r\n\t\ttreeViewer = new TreeViewer(container, SWT.BORDER);\r\n\t\tObservableListTreeContentProvider contentProvider = new ObservableListTreeContentProvider(\r\n\t\t\t\tnew IObservableFactory() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic IObservable createObservable(Object target) {\r\n\t\t\t\t\t\treturn new DecoratingObservableList(\r\n\t\t\t\t\t\t\t\t((Resource) target).getObservableChildren(),\r\n\t\t\t\t\t\t\t\tfalse);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, null);\r\n\t\ttreeViewer.setContentProvider(contentProvider);\r\n\t\tObservableMapLabelProvider labelProvider = new ObservableMapLabelProvider(\r\n\t\t\t\tBeanProperties.value(\"label\").observeDetail(\r\n\t\t\t\t\t\tcontentProvider.getKnownElements())) {\r\n\t\t\tprivate Image folderImage = Activator.getImageDescriptor(\r\n\t\t\t\t\t\"/icons/folder.gif\").createImage();\r\n\t\t\tprivate Image fileImage = Activator.getImageDescriptor(\r\n\t\t\t\t\t\"/icons/file.gif\").createImage();\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Image getImage(Object element) {\r\n\t\t\t\tResource node = (Resource) element;\r\n\t\t\t\tif (node.getType() != Resource.TYPE_ITEM) {\r\n\t\t\t\t\treturn folderImage;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn fileImage;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void dispose() {\r\n\t\t\t\tfolderImage.dispose();\r\n\t\t\t\tfileImage.dispose();\r\n\t\t\t\tsuper.dispose();\r\n\t\t\t}\r\n\t\t};\r\n\t\ttreeViewer.setLabelProvider(labelProvider);\r\n\t\ttreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\r\n\t\t\t\tsyncToolbarStatus();\r\n\t\t\t}\r\n\t\t});\r\n\t\ttreeViewer.addDoubleClickListener(new IDoubleClickListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void doubleClick(DoubleClickEvent event) {\r\n\t\t\t\tResource node = getSelectedItem();\r\n\t\t\t\tif (node != null) {\r\n\t\t\t\t\tif (node.getType() != Resource.TYPE_ITEM) {\r\n\t\t\t\t\t\ttreeViewer.setExpandedState(node,\r\n\t\t\t\t\t\t\t\t!treeViewer.getExpandedState(node));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\teditAction.run();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcreateActions();\r\n\t\tinitializeToolBar();\r\n\t\tinitializeMenu();\r\n\r\n\t\tloadTree(false);\r\n\t}", "public void refresh()\n {\n TreeViewer treeViewer = getTreeViewer();\n\n if ( treeViewer != null && composite != null )\n {\n if ( hasAnOutline() )\n {\n Control treeViewerControl = treeViewer.getControl();\n\n if ( ( treeViewerControl != null ) && ( !treeViewerControl.isDisposed() ) )\n {\n treeViewerControl.setParent( composite );\n }\n\n noOutlineComposite.setParent( fakeComposite );\n }\n else\n {\n Control treeViewerControl = treeViewer.getControl();\n\n if ( ( treeViewerControl != null ) && ( !treeViewerControl.isDisposed() ) )\n {\n treeViewerControl.setParent( fakeComposite );\n }\n\n noOutlineComposite.setParent( composite );\n }\n\n composite.layout();\n\n if ( treeViewer.getTree() != null && !treeViewer.getTree().isDisposed() )\n {\n TreeViewer entryEditorWidgetTreeViewer = getEntryEditorWidgetTreeViewer();\n if ( entryEditorWidgetTreeViewer != null )\n {\n treeViewer.setFilters( entryEditorWidgetTreeViewer.getFilters() );\n }\n if ( !treeViewer.getTree().isEnabled() )\n {\n treeViewer.getTree().setEnabled( true );\n }\n\n IEntry entry = getEntryEditorWidgetTreeViewerInput();\n if ( entry == null )\n {\n treeViewer.setInput( null );\n treeViewer.getTree().setEnabled( false );\n }\n else\n {\n treeViewer.setInput( entry );\n treeViewer.expandToLevel( 2 );\n }\n\n treeViewer.refresh();\n }\n }\n }", "public void fillTree(final Tree tree) {\r\n tree.setRedraw(true);\r\n List<Category> categories = ExampleManager.get().getCategories();\r\n List<Category> notPlacedCategories = new ArrayList<Category>();\r\n for (Category category : categories) {\r\n if (category.getParentId() == null) {\r\n TreeItem item = new TreeItem(tree, SWT.NONE);\r\n item.setText(category.getTitle());\r\n item.setData(category);\r\n } else {\r\n notPlacedCategories.add(category);\r\n }\r\n }\r\n\r\n for (Category cat : creatableCategories) {\r\n if (cat.getParentId() == null) {\r\n TreeItem item = new TreeItem(tree, SWT.NONE);\r\n item.setText(cat.getTitle());\r\n item.setData(cat);\r\n } else {\r\n notPlacedCategories.add(cat);\r\n }\r\n }\r\n\r\n // enable drawing\r\n tree.setRedraw(true);\r\n // subcategories.\r\n if (notPlacedCategories.size() > 0) {\r\n addCategory(Arrays.asList(tree.getItems()), tree.getItemCount(), notPlacedCategories,\r\n categories);\r\n }\r\n }", "private void mountSlider() {\n if (slider != null) {\n sliderPane.getChildren().add(slider);\n }\n }", "private void fillRoot(boolean resetCursor) {\n\t\tNode n = activeNode;\n\t\tn.removeChildren(resetCursor);\n\t\tn.insertChild(\"Edit\");\n\t\tn.insertChild(\"Back\");\n\t\tn.setDistance(35);\n\t\tn.setPositions(\n\t\t\t\tMenuValues.MENU_TEXT_X, \n\t\t\t\tMenuValues.MAIN_MENU_TEXT_Y_FOR_DECK);\n\t\tn.updateHandPos();\n\t}", "private void setupLayoutManager() {\n\n setLayout(new BorderLayout());\n add(directoryChooserPanel, BorderLayout.NORTH);\n add(splitPane, BorderLayout.CENTER);\n\n }", "public void interactiveXTreeEditingRToL() {\r\n JTree tree = new JTree(); \r\n tree.setEditable(true);\r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setCellEditor(new DefaultXTreeCellEditor(tree, renderer));\r\n JXTree xTree = new JXTree();\r\n xTree.setEditable(true);\r\n xTree.setCellRenderer(renderer);\r\n xTree.setCellEditor(new DefaultXTreeCellEditor(xTree, renderer));\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"XEditing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "public void interactiveTreeEditingRToLDatePicker() {\r\n DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Date());\r\n root.add(new DefaultMutableTreeNode(new Date()));\r\n TreeModel model = new DefaultTreeModel(root);\r\n JTree tree = new JTree(model); \r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setEditable(true);\r\n tree.setCellEditor(new DefaultTreeCellEditor(tree, renderer, new DatePickerCellEditor()));\r\n JXTree xTree = new JXTree(model);\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n xTree.setCellEditor(new DefaultTreeCellEditor(tree, renderer, new DatePickerCellEditor()));\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"standard Editing (DatePicker): compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "public void interactiveTreeXXEditingRToLDatePicker() {\r\n DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Date());\r\n root.add(new DefaultMutableTreeNode(new Date()));\r\n TreeModel model = new DefaultTreeModel(root);\r\n JTree tree = new JTree(model); \r\n tree.setEditable(true);\r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n DefaultTreeEditor treeCellEditor = new DefaultTreeEditor(new DatePickerCellEditor());\r\n tree.setCellEditor(treeCellEditor);\r\n JXTree xTree = new JXTree(model);\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n xTree.setCellEditor(new DefaultTreeEditor(new DatePickerCellEditor()));\r\n\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"XXEditing(DatePicker): compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "public void initRootLayout() {\n try {\n // Load root layout from fxml file.\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(Pepoview.class.getResource(\"MainWindow.fxml\"));\n rootLayout = (SplitPane) loader.load(); \n \n // Show the scene containing the root layout.\n Scene scene = new Scene(rootLayout);\n primaryStage.setScene(scene);\n primaryStage.show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public RootTreePanel() {\n\t\tsuper();\n\t\tTreeNode.setCentered(false);\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n tifTreeView = new com.ptc.tifworkbench.ui.TifTreeView();\n tifXmlView = new com.ptc.tifworkbench.ui.TifXmlView();\n tifCheckTreeViewer = new com.ptc.tifworkbench.ui.tree.TifCheckTreePanel();\n menuBar = new javax.swing.JMenuBar();\n viewMenu = new javax.swing.JMenu();\n xmlMenuItem = new javax.swing.JMenuItem();\n treeMenuItem = new javax.swing.JMenuItem();\n selTreeMenuItem = new javax.swing.JMenuItem();\n\n setClosable(true);\n setIconifiable(true);\n setMaximizable(true);\n setResizable(true);\n setTitle(\"Template tree\");\n setFrameIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/ptc/tifworkbench/ui/tables.gif\"))); // NOI18N\n getContentPane().setLayout(new java.awt.CardLayout());\n getContentPane().add(tifTreeView, \"TreeCard\");\n getContentPane().add(tifXmlView, \"XmlCard\");\n getContentPane().add(tifCheckTreeViewer, \"SelTreeCard\");\n\n viewMenu.setText(\"View\");\n\n xmlMenuItem.setText(\"XML\");\n xmlMenuItem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n xmlMenuItemActionPerformed(evt);\n }\n });\n viewMenu.add(xmlMenuItem);\n\n treeMenuItem.setText(\"Tree\");\n treeMenuItem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n treeMenuItemActionPerformed(evt);\n }\n });\n viewMenu.add(treeMenuItem);\n\n selTreeMenuItem.setText(\"Select Tree\");\n selTreeMenuItem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n selTreeMenuItemActionPerformed(evt);\n }\n });\n viewMenu.add(selTreeMenuItem);\n\n menuBar.add(viewMenu);\n\n setJMenuBar(menuBar);\n\n pack();\n }", "public void clickTreeViewButton() {\n\t\tfilePicker.stickyButton(locTreeBtn);\n\t}", "public static void expandTreePaths(ArrayList<TreePath> paths)\n {\n for (Component c : frame.getContentPane().getComponents())\n {\n if (c instanceof TreePane)\n {\n TreePane pane = (TreePane) c;\n JTree tree = pane.getTree();\n for (TreePath path : paths)\n {\n tree.expandPath(path);\n }\n }\n }\n }", "public void draw() {\n drawSubtree(root);\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void initTreeView(int index){\n\t treeView.setCellFactory(new Callback<TreeView<JTable>, TreeCell<JTable>>() {\r\n\r\n\t @Override\r\n\t public TreeCell<JTable> call(TreeView<JTable> jt) {\r\n\r\n\t \treturn new TreeCell<JTable>(){\r\n\r\n\t @Override\r\n\t protected void updateItem(JTable f, boolean empty) {\r\n\t \tsuper.updateItem(f, empty);\r\n\t \tif(empty){\r\n\t setText(null);\r\n\t setGraphic(null);\r\n\t }else{\r\n\t setText(f.getName());\r\n\t setGraphic(null);\r\n\t setOnMouseClicked((MouseEvent t) -> {\r\n\t \t//当前节点是子节点的时候,生成表格stage\r\n\r\n\t \tif(getChildren().size() == 1){\r\n\t \t\tif (t.getClickCount() == 1) {\r\n//\t\t \t\t \tDialogs.create()\r\n//\t\t \t\t .owner(Main.stage)\r\n//\t\t \t\t .title(\"提示\")\r\n//\t\t \t\t .masthead(\"提示\")\r\n//\t\t \t\t .message(\"弹出表格信息窗口\")\r\n\t//\r\n//\t\t \t\t .showInformation();\r\n\t\t \t\t//跳转至表格页面\r\n\t\t \t\tStage stage = new Stage();\r\n\t\t \t\t//stage.setTitle(f.getName());\r\n\t\t \t\t\tAnchorPane root = null;\r\n\t\t \t\t\tSpringFxmlLoader loader = new SpringFxmlLoader();\r\n\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\troot = (AnchorPane) loader.springLoad(\"view/tableView.fxml\", Main.class);\r\n\r\n\r\n\t\t\t TableController controller = loader.getController();\r\n\t\t\t controller.setStage(stage);\r\n\t\t\t controller.setTableName(f.getNameEn());\r\n\t\t\t controller.setChildFlag(false);\r\n\t\t\t controller.selectTable(\" where 1=1 \");\r\n\r\n\t\t\t Scene scene = new Scene(root);\r\n\t\t\t stage.setScene(scene);\r\n\t\t\t log.info(\"--弹出表\" + f.getName() + \"--\");\r\n\t\t\t stage.show();\r\n\t\t\t Integer total = tableService.getTotal(f.getNameEn(), \" where 1 =1 \");\r\n\t\t\t String title = f.getName() + \"[\" + f.getNameEn() + \"]\" + \"[\" + total + \"]\";\r\n\r\n\t\t\t //如果是几个汉化表的编辑,添加说明\r\n\t\t\t if(StaticData.translate_col_name.equalsIgnoreCase(f.getNameEn()) ||\r\n\t\t\t \t\tStaticData.translate_content_name.equalsIgnoreCase(f.getNameEn()) ||\r\n\t\t\t \t\tStaticData.translate_table_name.equalsIgnoreCase(f.getNameEn())){\r\n\t\t\t \tString tips = \"(*系统默认10分钟刷新一次汉化信息,若使汉化编辑立即生效,可点击刷新汉化按钮)\";\r\n\t\t\t \ttitle += tips;\r\n\t\t\t }\r\n\r\n\t\t\t stage.setTitle(title);\r\n\t\t\t\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\tlog.error(e.getStackTrace());\r\n\t\t\t\t\t\t\t\t\t\t\t\tlog.error(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\t\t\tDialogTools.error(\"错误\", \"出错了!\", \"查询表单数据出错!\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t \t\t }\r\n\t \t}\r\n\r\n\t } );\r\n\r\n\t }\r\n\t }\r\n\r\n\t };\r\n\t }\r\n\t });\r\n\r\n\t treeView.setRoot(StaticData.treeItemMap.get(index));\r\n\r\n\t }", "public void update(){\r\n try {\r\n TreePrinter.print(root);\r\n } catch (Exception e) {\r\n System.out.println(\"[Alert] Could not print diagram!\");\r\n }\r\n }", "public TreeObject(int x, int y, ImageView tree_fig, AnchorPane tree_pane) {\n this.pane = tree_pane;\n this.x = x;\n this.y = y;\n\n tree_fig.setLayoutX(x);\n tree_fig.setLayoutY(y);\n }", "public void setTreeModeEnabled (boolean enabled)\n {\n BaseEditorPanel opanel = _epanel;\n _epanel = enabled ? new TreeEditorPanel(this) :\n new EditorPanel(this, EditorPanel.CategoryMode.TABS);\n _epanel.addChangeListener(this);\n _epanel.setObject(opanel.getObject());\n if (_split.getRightComponent() == opanel) {\n _split.setRightComponent(_epanel);\n SwingUtil.refresh(_epanel);\n }\n }", "public void nodeDemo() {\n final PLayer layer = getCanvas().getLayer();\n final PNode aNode = PPath.createRectangle(0, 0, 100, 80);\n\n // A node needs to be a descendent of the root to be displayed on the\n // screen.\n layer.addChild(aNode);\n\n // The default color for a node is blue, but you can change that with\n // the setPaint method.\n aNode.setPaint(Color.red);\n\n // A node can have children nodes added to it.\n aNode.addChild(PPath.createRectangle(0, 0, 100, 80));\n\n // The base bounds of a node is easy to change. Note that changing the\n // base\n // bounds of a node will not change it's children.\n aNode.setBounds(-10, -10, 200, 110);\n\n // Each node has a transform that can be used to transform the node, and\n // all its children on the screen.\n aNode.translate(100, 100);\n aNode.scale(1.5);\n aNode.rotate(45);\n\n // The transparency of any node can be set, this transparency will be\n // applied to any of the nodes children as well.\n aNode.setTransparency(0.75f);\n\n // Its easy to copy nodes.\n final PNode aCopy = (PNode) aNode.clone();\n\n // Make is so that the copies children are not pickable. For this\n // example\n // that means you will not be able to grab the child and remove it from\n // its parent.\n aNode.setChildrenPickable(false);\n\n // Change the look of the copy\n aNode.setPaint(Color.GREEN);\n aNode.setTransparency(1.0f);\n\n // Let's add the copy to the root, and translate it so that it does not\n // cover the original node.\n layer.addChild(aCopy);\n aCopy.setOffset(0, 0);\n aCopy.rotate(-45);\n }", "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "public void addToGameRoot(){\n Main.getRootPlayGround().getChildren().add(imageView);\n }", "private void initializeExplorer() {\n\t\tthis.hydraExplorer = new HydraExplorer(this.stage);\n\t\tthis.splitPane.setTopComponent(this.hydraExplorer);\n\t\tthis.initializeExplorerCommands();\n\t}", "public void setup(Tree tree) {\n model.setTree(tree);\n\n for (TreeNode node : tree.nodes) {\n if (node.isLeaf()) {\n model.addCell(node.getKey(), node.getName(), 0, CellType.TREELEAF);\n } else {\n model.addCell(node.getKey(), node.getName(), 0, CellType.TREEMIDDLE);\n }\n }\n }", "public void initRootLayout(){\n try{\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(Game.class.getResource(\"view/RootLayout.fxml\"));\n rootLayout = (BorderPane) loader.load();\n\n Scene scene = new Scene(rootLayout);\n \n primaryStage.setScene(scene);\n \n RootLayoutController controller = loader.getController();\n controller.setGame(this);\n \n primaryStage.show(); \n showCreateNewPlayer();\n }catch(IOException e){\n }\n }", "public void attachToRoot() {\n final ViewGroup contentView = getActivityContentView();\n contentView.getChildAt(0).setVisibility(View.INVISIBLE);\n\n ViewCompat.setElevation(this, Float.MAX_VALUE);\n\n contentView.addView(this, 0, new ViewGroup.LayoutParams(\n ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.MATCH_PARENT\n ));\n }", "protected void init(String tree){\n\t\tJSONObject tree_model = null;\n\t\ttry {\n\t\t\ttree_model = (JSONObject)new JSONParser().parse(tree);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t\tJSONArray phys_tree = (JSONArray)tree_model.get(\"tree_diagram\");\n\t\troot_scheme = new TreeNode();\n\t\tbuildTree(phys_tree,root_scheme);\n\t}", "@Test\n\tpublic void test6_OpenTree() throws GeneralLeanFtException{\n\t\ttry\n\t\t{\t\t\t\t\n\t\t\tSystem.out.println(\"Test 6 - Open Trees Started\");\n\t\t\t\n\t\t\t//Main Window\n\t\t\tWindow mainWindow = Desktop.describe(Window.class, new WindowDescription.Builder()\n\t\t\t.title(\"SwingSet2\").index(0).build());\n\t\t\tThread.sleep(2000);\n\t\t\t\n\t\t\t//Toolbar Object\n\t\t\tToolBar toolbar = mySet.OR.MainWindow().ToolBar(); \n\n\t\t\t// Clicking the JTree displays the required frame\n\t\t\ttoolbar.getButton(\"JTree\").press();\n\t\t\t\n\t\t\t//Tree View Object\n\t\t\tTreeView javaTree = mainWindow.describe(TreeView.class, new TreeViewDescription.Builder()\n\t\t\t.nativeClass(\"TreeDemo$1\").build());\n\t\t\t\n\t\t\t//Expand a Node\n\t\t\tString nodePath = \"Music;Classical;Beethoven;concertos\";\n\t\t\tTreeViewNode requiredNode = javaTree.getNode(nodePath);\n\t\t\trequiredNode.expand();\n\n\t\t\t//Select a Node\n\t\t\tnodePath = \"Music;Classical;Beethoven;concertos;No. 4 - G Major\";\t\t\t\n\t\t\tjavaTree.activateNode(nodePath);\t\t\t\t\n\t\t\t\n\t\t\t//Get Number of Sub Nodes of a Node\n\t\t\tnodePath = \"Music;Classical;Beethoven;Quartets\";\t\t\t\n\t\t\tSystem.out.println(\"Child Count - \" + LeanFTJavaTreeHelper.getSubNodeCount(javaTree, nodePath));\n\n\t\t\t//Get All Sub Nodes\n\t\t\tjava.util.List<String> subNodes = LeanFTJavaTreeHelper.getAllSubNodes(javaTree,nodePath);\n\t\t\t\n\t\t\t//Search for a Node in the Whole Tree\n\t\t\tNativeObject root = LeanFTJavaTreeHelper.getRoot(javaTree);\n\t\t\tassertTrue(LeanFTJavaTreeHelper.searchNodeinTree(javaTree,root, \"No. 5 - E-Flat\"));\n\t\t\t\t\t\t\n\t\t}\t\t\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unexpected Error Occurred. Message = \" + e.getMessage());\n\t\t\tassertTrue(false);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tSystem.out.println(\"Test 6 - Open Trees finished\");\t\n\t\t}\n\t}", "protected void setTreeColumns(Tree tree) {\n \t\tTreeColumn tc = new TreeColumn(tree, SWT.LEFT, 0);\n \t\ttc.setResizable(true);\n \t\ttc.setWidth(400);\n \t\ttc = new TreeColumn(tree, SWT.LEFT, 1);\n \t\ttc.setWidth(600);\n \t\ttc.setResizable(true);\n \t}", "public void initRootLayout() {\n try {\n // Load root layout from fxml file.\n FXMLLoader loader = new FXMLLoader();\n URL url = TwitterFX.class.getClassLoader().getResource(\"twitterfx.fxml\");\n loader.setLocation(url);\n rootLayout = (AnchorPane) loader.load();\n buildLayout();\n // Show the scene containing the root layout.\n Scene scene = new Scene(rootLayout, 600,400);\n primaryStage.setScene(scene);\n primaryStage.show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void testRemoveAndAddNodes() {\n final Children c = new Array();\n Node n = new AbstractNode (c);\n final PListView lv = new PListView();\n final ExplorerPanel p = new ExplorerPanel();\n p.add(lv, BorderLayout.CENTER);\n p.getExplorerManager().setRootContext(n);\n p.open();\n Node[] children = new Node[NO_OF_NODES];\n\n for (int i = 0; i < NO_OF_NODES; i++) {\n children[i] = new AbstractNode(Children.LEAF);\n children[i].setDisplayName(Integer.toString(i));\n children[i].setName(Integer.toString(i));\n c.add(new Node[] { children[i] } );\n }\n //Thread.sleep(2000);\n \n try {\n // Waiting for until the view is updated.\n // This should not be necessary\n try {\n SwingUtilities.invokeAndWait( new EmptyRunnable() );\n } catch (InterruptedException ie) {\n fail (\"Caught InterruptedException:\" + ie.getMessage ());\n } catch (InvocationTargetException ite) {\n fail (\"Caught InvocationTargetException: \" + ite.getMessage ());\n }\n p.getExplorerManager().setSelectedNodes(new Node[] {children[0]} );\n } catch (PropertyVetoException pve) {\n fail (\"Caught the PropertyVetoException when set selected node \" + children[0].getName ()+ \".\");\n }\n \n for (int i = 0; i < NO_OF_NODES; i++) {\n c.remove(new Node [] { children[i] } );\n children[i] = new AbstractNode(Children.LEAF);\n children[i].setDisplayName(Integer.toString(i));\n children[i].setName(Integer.toString(i));\n c.add(new Node[] { children[i] } );\n //Thread.sleep(350);\n }\n assertEquals(NO_OF_NODES, c.getNodesCount());\n }", "public void testNodeAddingAndRemoving() {\n final Children c = new Array();\n Node n = new AbstractNode (c);\n final PListView lv = new PListView();\n final ExplorerPanel p = new ExplorerPanel();\n p.add(lv, BorderLayout.CENTER);\n p.getExplorerManager().setRootContext(n);\n p.open();\n\n final Node c1 = new AbstractNode(Children.LEAF);\n c1.setDisplayName(\"First\");\n c1.setName(\"First\");\n c.add(new Node[] { c1 });\n Node c2 = new AbstractNode(Children.LEAF);\n c2.setDisplayName(\"Second\");\n c2.setName(\"Second\");\n //Thread.sleep(500);\n\n for (int i = 0; i < 5; i++) {\n c.remove(new Node[] { c1 });\n c.add(new Node[] { c2 });\n \n // Waiting for until the view is updated.\n // This should not be necessary\n try {\n SwingUtilities.invokeAndWait( new EmptyRunnable() );\n } catch (InterruptedException ie) {\n fail (\"Caught InterruptedException:\" + ie.getMessage ());\n } catch (InvocationTargetException ite) {\n fail (\"Caught InvocationTargetException: \" + ite.getMessage ());\n }\n \n try {\n p.getExplorerManager().setSelectedNodes(new Node[] {c2} );\n } catch (PropertyVetoException pve) {\n fail (\"Caught the PropertyVetoException when set selected node \" + c2.getName ()+ \".\");\n }\n \n c.remove(new Node[] { c2 });\n c.add(new Node[] { c1 });\n \n //Thread.sleep(350);\n }\n }", "private void expandTree() {\n for (int i=0; i<tree.getRowCount(); i++) {\n tree.expandRow(i);\n }\n }", "private void loadTreasure() {\r\n\t\tchest = TreasureChest.getInstance();\r\n\t\tImageView chestView = chest.getImage();\r\n\t\tchestView.setX(chest.getX() * scalingFactor);\r\n\t\tchestView.setY(chest.getY() * scalingFactor);\r\n\r\n\t\troot.getChildren().add(chestView);\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTree1 = new javax.swing.JTree();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jScrollPane1.setViewportView(jTree1);\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(34, 34, 34)\n .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 197, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(169, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .addContainerGap()\n .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 275, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "private void displayPane(Node p){\n root.setCenter(p);\n //BorderPane.setAlignment(p,Pos.CENTER);\n }", "public void initRootLayout() {\r\n try {\r\n // Load root layout from fxml file.\r\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(getClass().getResource(\"/view/rootlayout.fxml\"));\r\n rootLayout = (BorderPane) loader.load();\r\n \r\n // Show the scene containing the root layout.\r\n scene = new Scene(rootLayout);\r\n primaryStage.setScene(scene);\r\n primaryStage.show();\r\n \r\n controller = loader.getController();\r\n controller.setMainApp(this);\r\n \r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void createTreeViewerComposite(Composite parent) {\n\t\tparent.setLayout(new GridLayout(1, false));\n\t\ttreeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n\t\ttreeViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));\n\t\ttreeViewer.setContentProvider(new TxDbContentProvider());\n\t\ttreeViewer.setLabelProvider(new TxDbLabelProvider());\n\t\ttreeViewer.setUseHashlookup(true);\n\t\ttreeViewer.setAutoExpandLevel(2);\n\t\ttreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\n\t\t\t\tISelection selection=event.getSelection();\n\t\t\t\tif( selection instanceof IStructuredSelection) {\n\t\t\t\t\tObject object= ((IStructuredSelection)selection).getFirstElement();\t\t\t\n\t\t\t\t\tif(object instanceof IHierNode&& ((IHierNode)object).getChildNodes().size()!=0){\n\t\t\t\t\t\ttxTableViewer.setInput(object);\n\t\t\t\t\t\tupdateButtons();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lblTitle = new javax.swing.JLabel();\n lblPath = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTree1 = new javax.swing.JTree();\n btnDelete = new javax.swing.JButton();\n btnInsert = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n lblTitle.setText(\"Tree 예제\");\n\n lblPath.setText(\"Path : \");\n\n jTree1.addTreeExpansionListener(new javax.swing.event.TreeExpansionListener() {\n public void treeCollapsed(javax.swing.event.TreeExpansionEvent evt) {\n jTree1TreeCollapsed(evt);\n }\n public void treeExpanded(javax.swing.event.TreeExpansionEvent evt) {\n jTree1TreeExpanded(evt);\n }\n });\n jTree1.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {\n public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {\n jTree1ValueChanged(evt);\n }\n });\n jScrollPane1.setViewportView(jTree1);\n\n btnDelete.setText(\"삭제\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n btnInsert.setText(\"추가\");\n btnInsert.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnInsertActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(165, 165, 165)\n .addComponent(lblTitle))\n .addGroup(layout.createSequentialGroup()\n .addGap(15, 15, 15)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblPath, javax.swing.GroupLayout.PREFERRED_SIZE, 367, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 292, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(btnInsert, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))))))\n .addContainerGap(8, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(lblTitle)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(lblPath, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnInsert)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnDelete)))\n .addContainerGap())\n );\n\n pack();\n }", "public void drawTree(GUIMain guiMn, MenuDoAction menu, DoNewInsertOpenModel doNewInsertOpenModel) {\n DefaultMutableTreeNode tissueBranch;\n HumanBody body = null;\n\n if (guiMn.simMain.solver == null) {\n System.err.println(\"The model files are not correct\\n\");\n }\n HostModel host = guiMn.simMain.solver.getHostModelToSolve().getHostModel();\n body = host.getPlacentalia();\n Map<Tissue, DefaultMutableTreeNode> ancestor = new HashMap<>();\n if (body.getNumOrganSystems() > 0) {\n Iterator<PhysioSystem> iter = body.getOrganSystems().iterator();\n\n // loop over PhysioSystems (usually there is only one)\n while (iter.hasNext()) {\n PhysioSystem organsys = iter.next();\n NodeLeaf organSystem = new NodeLeaf(organsys, \"./data/images/iconOrganSystem.gif\");\n DefaultMutableTreeNode organBranch = guiMn.simMain.st.addObject(guiMn, organSystem);\n ArrayList<Tissue> tissues = organsys.tissues;\n Iterator<Tissue> tissueIterator = tissues.iterator();\n\n // loop over Tissues in this PhysioSystem\n while (tissueIterator.hasNext()) {\n NodeLeaf leaf = null;\n\n Tissue tiss = tissueIterator.next();\n if (tiss.getName() == null) {\n System.out.println(\"Error null Tissue\");\n }\n NodeLeaf leafTissue = new NodeLeaf(tiss, \"./data/images/iconTissue.gif\");\n tissueBranch = guiMn.simMain.st.addObject(guiMn, organBranch, leafTissue, true);\n ancestor.put(tiss, tissueBranch);\n ArrayList<CompartmentSBML> comps = tiss.getInternVolumes();\n Iterator<CompartmentSBML> compIterator = comps.iterator();\n\n // loop over compartments in this Tissues\n while (compIterator.hasNext()) {\n CompartmentSBML compa = compIterator.next();\n leaf = processComp(guiMn, compa, tissueBranch);\n }\n // Post processing for \"outside\" field\n ArrayList<CompartmentSBML> compbis = tiss.getInternVolumes();\n Iterator<CompartmentSBML> postIterator = compbis.iterator();\n // loop over compartments in this Tissue\n CompartmentSBML compInside;\n while (postIterator.hasNext()) {\n compInside = postIterator.next();\n if(compInside == null)\n {\n System.out.println(\"No id in model: \" + compInside.getName());\n }\n postProcessComp(guiMn, tiss, tissueBranch, compInside);\n }\n // now there are still compartments in root that are at the wrong place\n } // end of Tissue loop\n } // end of Physiological systems loop\n }\n // when a tissue is embedded in another tissue \n careForPartOf(guiMn, ancestor);\n }", "private void showDirectory(final DefaultMutableTreeNode node) {\n view.getTree().setEnabled(false);\n view.getFileProperties().setLoadingFileStatus();\n view.getGuiPanel().repaint();\n\n SwingWorker<Void, File> worker = new SwingWorker<Void, File>() {\n @Override\n public Void doInBackground() {\n File file = (File) node.getUserObject();\n\n if (file.isFile() && ((FileTableModel)view.getTable().getModel())\n .getCurrentDirectory().equals(file.getParentFile())) {\n return null;\n }\n\n File[] files;\n\n if (file.isDirectory()) {\n files = fileSystemView.getFiles(file, true);\n\n if (node.isLeaf() || node.getChildCount() != files.length) {\n for (File child : files) {\n publish(child);\n }\n }\n } else {\n file = file.getParentFile();\n files = fileSystemView.getFiles(file, true);\n }\n\n setTableData(files, file);\n\n return null;\n }\n\n @Override\n protected void process(List<File> chunks) {\n chunks.stream()\n .sorted((o1, o2) -> o1.getName()\n .compareToIgnoreCase(o2.getName()))\n .map(DefaultMutableTreeNode::new)\n .forEach(node::add);\n }\n\n @Override\n protected void done() {\n view.getTree().setEnabled(true);\n view.getFileProperties().setOkFileStatus();\n view.getGuiPanel().repaint();\n }\n };\n worker.execute();\n }", "@Before\n public void prepareTree() {\n tree = new TreeNode();\n nodeOne = new TreeNode();\n nodeTwo = new TreeNode();\n nodeThree = new TreeNode();\n }", "public void interactiveXTreeEditingRToLDatePicker() {\r\n DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Date());\r\n root.add(new DefaultMutableTreeNode(new Date()));\r\n TreeModel model = new DefaultTreeModel(root);\r\n JTree tree = new JTree(model); \r\n tree.setEditable(true);\r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setCellEditor(new DefaultXTreeCellEditor(tree, renderer, new DatePickerCellEditor()));\r\n JXTree xTree = new JXTree(model);\r\n xTree.setEditable(true);\r\n xTree.setCellRenderer(renderer);\r\n xTree.setCellEditor(new DefaultXTreeCellEditor(xTree, renderer, new DatePickerCellEditor()));\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"XEditing(DatePicker): compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "public void addChild(MenuTree tree){\n tree.setParent(this);\n this.childMenuTrees.add(tree);\n }", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "protected void setTree(JTree newTree) {\n\tif(tree != newTree) {\n\t if(tree != null)\n\t\ttree.removeTreeSelectionListener(this);\n\t tree = newTree;\n\t if(tree != null)\n\t\ttree.addTreeSelectionListener(this);\n\t if(timer != null) {\n\t\ttimer.stop();\n\t }\n\t}\n }" ]
[ "0.6816048", "0.64292", "0.63967437", "0.6240624", "0.62085754", "0.6010165", "0.59163964", "0.587", "0.57927287", "0.57863486", "0.5770739", "0.5741902", "0.56922394", "0.5624246", "0.55535895", "0.55467564", "0.54782206", "0.5461528", "0.54571205", "0.5433121", "0.54283035", "0.5418461", "0.5413745", "0.5413005", "0.53906596", "0.53774107", "0.5373962", "0.53654265", "0.53579795", "0.5322378", "0.5316798", "0.5310355", "0.5304915", "0.53047436", "0.53008544", "0.528598", "0.52798146", "0.5279497", "0.5279374", "0.5278935", "0.5266594", "0.52399415", "0.52248436", "0.5217396", "0.51984197", "0.5195654", "0.51800495", "0.5156071", "0.51548547", "0.5153315", "0.51496494", "0.5146019", "0.5141151", "0.51383984", "0.5133147", "0.51283604", "0.51269823", "0.5125825", "0.5119856", "0.5116807", "0.511078", "0.510795", "0.5084012", "0.5080405", "0.5064613", "0.505974", "0.5053278", "0.50529987", "0.5036322", "0.5035471", "0.503267", "0.50292945", "0.50254804", "0.5025028", "0.5025028", "0.50247526", "0.5024683", "0.5023357", "0.5013742", "0.5013", "0.50085247", "0.50073045", "0.5002124", "0.49952376", "0.49911988", "0.49904853", "0.49889746", "0.4983676", "0.49787968", "0.49784303", "0.4972363", "0.4962539", "0.49617702", "0.4953831", "0.4953561", "0.49497136", "0.49484104", "0.4944387", "0.49363866", "0.49356753" ]
0.8122045
0
Unmounts slider from sliderPane
private void unmountSlider() { if (slider != null) { sliderPane.getChildren().remove(slider); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void dropview() {\n\t\tthis.remove(scrollPane);\n\t}", "public void removeFromRoot(){\n Main.getRootPlayGround().getChildren().remove(imageView);\n }", "@Override\r\n\tpublic void onClosed() {\n\t\tmSlidingLayer.removeAllViews();\r\n\t}", "private void mountSlider() {\n if (slider != null) {\n sliderPane.getChildren().add(slider);\n }\n }", "private void unmountTree() {\n if (tree != null) {\n treePane.getChildren().clear();\n }\n }", "public abstract void unbindComponents();", "@Override\n\tpublic void hide() {\n\t\t((InputMultiplexer)Gdx.input.getInputProcessor()).removeProcessor(ui);\n\t}", "@FXML\n private void closePreview() {\n hiddenSidesPane.setPinnedSide(null);\n }", "void unsetWheel();", "@Override\r\n public void removeFromView() {\r\n currentAnimation.stop();\r\n super.removeFromView();\r\n }", "void unsetControlPosition();", "void removeGestureHandler(GestureEventListener listener);", "public void removeFromPane(Node node) {\n pane.getChildren().remove(node);\n }", "public void stop()\n {\n animator = null;\n }", "public void removeFromSuperview(){\n setVisibility(View.INVISIBLE);\n if (listener != null){\n listener.OnVisible(false);\n }\n }", "public void hidePanel() {\n\t\tclipRect.layoutYProperty().bind(invertedYTrans);\n\t\ttranslateTrans.setToY(-slidingPanel.getHeight());\n\t\ttranslateTrans.setOnFinished((event)->{\n\t\t\tslidingPanel.setVisible(false);\n\t\t\tslidingPanel.heightProperty().addListener(slidingPanelHeightListener);\n\t\t});\n\t\ttranslateTrans.play();\n\t\tisSlidingPaneShown = false;\n\t}", "@Override\n\tpublic void unsetVisible() {\n\t\tviewer.setVisible(false);\n\t\tscrollbar.setVisible(false);\n\t}", "@Override\n\tprotected void deactivateFigure() {\n\t\tthis.layer.remove(getFigure());\n\t\tgetConnectionFigure().setSourceAnchor(null);\n\t\tgetConnectionFigure().setTargetAnchor(null);\n\t}", "@Override\r\n public void unsetup(SpigotImporter importer, Panel panel) {\n try{\r\n System.out.println(panels.length);\r\n //MavselWizardSwing2 \r\n ((MavselWizardSwing1) ((Panel) panels[0]).getComponent()).unsetup((MavselSpigot)importer); \r\n ((MavselWizardSwing2) ((Panel) panels[1]).getComponent()).unsetup((MavselSpigot)importer);\r\n }catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n \r\n panels = null;\r\n }", "void unsetState();", "private void syncSliderInput()\n {\n pickerSlider.valueProperty().removeListener(this::onColourSliderChange);\n pickerSlider.setStyle(\"-fx-background-color: linear-gradient(to top, #000000, \" + colourToRgb(toolColour) + \", #FFFFFF);\");\n pickerSlider.setValue(0.0);\n pickerSlider.valueProperty().addListener(this::onColourSliderChange);\n }", "public void destroy() {\r\n\t\thide();\r\n\t\tmenuButtonTouchListener_.unregister();\r\n\t}", "public void vanish() {\n\t\t\r\n\t\tlpanel.addMouseMotionListener(new MouseAdapter() {\r\n\t\t\tpublic void mouseMoved(MouseEvent e) {\r\n\t\t\t\t\r\n\t\t\t\tchecker.setEnabled(false);\r\n\t\t\t\tchecker.setVisible(false);\r\n\t\t\t\trequestL.setEnabled(false);\r\n\t\t\t\trequestL.setVisible(false);\r\n\t\t\t\tpatientL.setEnabled(false);\r\n\t\t\t\tpatientL.setVisible(false);\r\n\t\t\t\treport.setEnabled(false);\r\n\t\t\t\treport.setVisible(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\t}", "private void eraseContainer() {\r\n\t\tfor (Component comp:this.getComponents()) {\r\n\t\t\tcomp.setVisible(false);\r\n\t\t}\r\n\t}", "public void hide() {\n\t\t// Useless if called in outside animation loop\n\t\tactive = false;\n\t}", "void unsetValue();", "void unsetValue();", "public void unbind() {\n\t\tview.setAdapter(null);\n\t}", "void unsetPowerBox();", "void unsetPluginstate();", "void unsetBox();", "public Pane removeComponent(Component comp) {\r\n\t\treturn removeComponent(components.indexOf(comp));\r\n\t}", "@Override\r\n\tpublic void deactivate() {\n\t\tsuper.deactivate();\r\n\t\tthis.getArtFrag().removePropertyChangeListener(this);\r\n\t}", "private void stopAudioLevelPoll() {\n handler.removeCallbacks(audioPoller);\n volumeBar.setProgress(0);\n }", "public void removeButton() {\n pan.remove(playButton);\n }", "public void destroy() {\n ViewGroup parent = (ViewGroup) getParent();\n if (parent != null) {\n parent.removeView(this);\n }\n mRevealerSpring.destroy();\n }", "public void deselectPanel() {\n\t\tthis.displayNumberBlock.setBackground(dispNormal);\n\t}", "public void removeAllComponents();", "@FXML\n private void stopMoving(){\n\n Main.gang.setMoving(false);\n drivingTransition.stop();\n updateGUI();\n }", "void clearAnimatorPanel();", "@Override public void onDestroyView() {\n super.onDestroyView();\n unbinder.unbind();\n }", "public void cleanup() {\n mParentLayout.removeView(mContainer);\n mControlsVisible.clear();\n }", "@Override\n\tpublic void onDestroyView() {\n\t\tsuper.onDestroyView();\n\t\tunbinder.unbind();\n\t}", "public void destroy() {\n uiView.setMediaPlayer(null);\n mediaLoader.destroy();\n }", "public void deleteLaser() {\n shotVisible = false;\n shot.setVisible(false);\n }", "@Override\r\n\tpublic void onDestroy()\r\n\t{\n\t\tsuper.onDestroy();\r\n\t\tcollider.destroy();\r\n\t}", "void removeComponents()\n {\n JPanel panel = Simulator.getInstance().getPanel(1);\n JLayeredPane jl = (JLayeredPane)panel.getComponent(0);\n Component[] comps = jl.getComponentsInLayer(JLayeredPane.PALETTE_LAYER.intValue());\n int size = comps.length;\n int i=0;\n while(i<size)\n {\n jl.remove(comps[i]);\n i++;\n } \n }", "@Override\n\tpublic void removeTrigger() {\n\t\tplayer.removeListener(this.listener, EventNameType.SOUL_FIGHT);\n\t}", "@Override\n public void onDestroyView() {\n super.onDestroyView();\n mUnbinder.unbind();\n }", "public abstract void removedFromWidgetTree();", "public void removePeonStatusPane() {\n\t\tContextAreaHandler.getInstance().clearContext();\n\t}", "@Override\r\n\tpublic void removeLayoutComponent(Component arg0) {\n\t\t\r\n\t}", "public void removeNavigationPane(NavigationType type){\n switch (type){\n case LEFT:{\n containerPane.getChildren().remove(left_navigationPane);\n }break;\n case RIGHT:{\n containerPane.getChildren().remove(right_navigationPane);\n }case TOP:{\n containerPane.getChildren().remove(containerPane.topProperty().get());\n }break;\n case BOTTOM:{\n containerPane.getChildren().remove(containerPane.bottomProperty().get());\n }\n }\n }", "public void stop() {\n\t\tResources.getmScene().unregisterUpdateHandler(time);\n\t\trunning = false;\n\t}", "@Override public void onDestroyView() {\n super.onDestroyView();\n ButterKnife.unbind(this);\n }", "public void unsubscribeSwitchState() {\n\t\t\n\t}", "@FXML\n\tpublic void removeRegistrationPair() {\n\t\tRegistrationPair selected = m_registrationState.getSelected();\n\t\tm_registrationState.removePair(selected);\n\t}", "private void tear() {\n\t\tthis.torn = true;\n\t\tthis.getContainer().addToContents(getDucatContent());\n\t\tthis.getContainer().removeFromContents(this);\n\t}", "public void onDetachedFromWindow() {\n super.onDetachedFromWindow();\n SvgViewManager.dropSvgView(this);\n }", "protected void uninstallDefaults() {\n spinner.setLayout(null); }", "@Override\n protected void unregisterVisuals() {\n Map visualPartMap = this.getViewer().getVisualPartMap();\n visualPartMap.remove(getFigure().getLabel());\n visualPartMap.remove(getFigure().getCheckBox());\n super.unregisterVisuals();\n }", "@Override\n\t\t\t\tpublic void touchUp(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button) {\n\t\t\t\t\tgameObject.dispose();\n\t\t\t\t}", "public void deactivate()\n\t{\n\t\t_active = false;\n\t\t_leader.setObjectHandler(null);\n\t}", "private void unbindMediaPlayerService() {\n mediaPlayerService.setCoverArt(coverArt);\n mediaPlayerService.setSelectedMed(selectedMed);\n mediaPlayerService.setBindIsOngoing(true);\n\n unbindService(mediaPlayerConnection);\n serviceIsBound = false;\n setControlsVisible(false);\n\n Log.v(TAG, \"Service unbound\");\n }", "public void retirerPanneauSud() {\r\n\t\tif (panneauSud != null)\r\n\t\t\tgetContentPane().remove(panneauSud);\r\n\t}", "void unsetSurfaceRefs();", "public void uninstall()\r\n \t{\r\n \t\tif (realListeners == null) return;\r\n\r\n\t\t// Remove this class as the default listener\r\n\r\n\t\tscrollPane.removeMouseWheelListener( this );\r\n\r\n\t\t// Install the default listeners\r\n\r\n\t\tfor (MouseWheelListener mwl : realListeners)\r\n\t\t{\r\n\t\t\tscrollPane.addMouseWheelListener( mwl );\r\n\t\t}\r\n\r\n\t\trealListeners = null;\r\n \t}", "public void removeLayoutComponent(Component comp) {}", "public void removeLayoutComponent(Component comp) {}", "public void unset(){\n\t\tcurrentInst = -1;\n\t}", "void unsetRef();", "@Override\n\tpublic void hide() {\n\t\thits.remove();\n\t\ttimeLeft.remove();\n\t\tdarken.remove();\n\t\tcontainer.remove();\n\t\ttimer = null;\n\t\ttrainingBag = null;\n\t}", "public void destroy()\n {\n if (spinning)\n stopSpinning();\n node.destroy();\n }", "protected void uninstallListeners() {\n spinner.removePropertyChangeListener(propertyChangeListener); }", "@Override\n public void onDestroyView() {\n mBinding = null;\n super.onDestroyView();\n }", "void unsetValueAttachment();", "void unregister() {\n for (Component comp : jTabbedPane1.getComponents()) {\n if (comp instanceof MiniTimelinePanel) {\n DiscoveryEventUtils.getDiscoveryEventBus().unregister(comp);\n }\n }\n }", "@Override\n public void onAnimationEnd(Animator arg0) {\n photoLayout.removeView(item);\n }", "void unbind(boolean shouldPlaceSpacer, boolean switchingStream);", "public void unpin();", "public void unpin();", "@Override\r\n public synchronized void shutdownView(View view) {\r\n systems.remove(view); // remove view from system calls\r\n view.shutdown(); // shutdown the view appropriately\r\n running = false; // set running to false, engine will exit on next loop\r\n }", "@Override\n\tpublic void onGuiClosed() {\n\t\tfield_154330_a.removed();\n\t\tsuper.onGuiClosed();\n\t}", "public void remove(ImageView power){\n power.setImage(null);\n }", "public void removePawn() {\n lives = 0;\n }", "@Override\n public void onEnd(boolean bl, BaseSliderView baseSliderView) {\n if (!baseSliderView.isErrorDisappear()) return;\n if (bl) {\n return;\n }\n Iterator iterator = this.mImageContents.iterator();\n do {\n if (!iterator.hasNext()) return;\n } while (!((BaseSliderView)iterator.next()).equals((Object)baseSliderView));\n this.removeSlider(baseSliderView);\n }", "public final void destroy(){\n\t\tListHandler.get().remove(this);\n\t\tactivated = false;\n\t\tonDestroy();\n\t}", "private void destroyDisplayEditOverlay() {\n\t}", "public void removeLayoutComponent(Component component) { }", "public void stopProgressAnimation(){\n if(progressAnimator!=null){\n progressAnimator.cancel();\n progressAnimator = null;\n }\n }", "@Override\n protected void onDetachedFromWindow() {\n setImageDrawable(null);\n super.onDetachedFromWindow();\n }", "public void resetPresentation();", "public void _unlinkPresentation(PresentationElement presentation1);", "public void setSlider(Slider slider) {\n\t\tthis.slider = slider;\n\t}", "void hideProgress() {\n removeProgressView();\n removeScreenshotView();\n }", "private void detener() {\n player.stop();\n player.release();\n player = null;\n }", "@Override\n\tpublic void onHideScene() {\n\t\t\n\t}", "public void dispose() {\n\t\tif (_slideCacheEntry != null) {\r\n\t\t\t_slideCacheEntry.dispose();\r\n\t\t}\r\n\r\n\t\tif (_precacheCacheEntry != null) {\r\n\t\t\t_precacheCacheEntry.dispose();\r\n\t\t}\r\n\t\t\r\n\t\t// The slide might remain in usage, this graphicsListener not:\r\n\t\t_slide.removeListener(_graphicsListener);\r\n\t}", "@FXML\n\tpublic void audioManipulatorResetAllSliders() {\n\t\tsliderPitch.setValue(1);\n\t\tsliderGain.setValue(1);\n\t\tsliderEchoLength.setValue(1);\n\t\tsliderDecay.setValue(0);\n\t\tsliderFlangerLength.setValue(0.01);\n\t\tsliderWetness.setValue(0);\n\t\tsliderLfoFrequency.setValue(5);\n\t\tsliderLowPass.setValue(44100);\n\t}", "private void removeAllPictureViews() {\n\t\tscrollBarAdjEvtValueOld = 0;\n\t\tpictureViewTable.clear();\n\t\tint count = client.getComponentCount();\n\t\tif (count == 0) {\n\t\t\treturn; // no components (picture views painted)\n\t\t}\n\n\t\tpictureClosed.clear();\n\t\tclient.removeAll();\n\t\tclient.repaint();\n\t\tDimension cl = client.getPreferredSize();\n\t\tcl.height = 0;\n\t\tclient.setPreferredSize(cl);\n\t\tclient.revalidate();\n\t}" ]
[ "0.5891477", "0.5770983", "0.5760895", "0.57597435", "0.57505834", "0.57378703", "0.5545681", "0.5470041", "0.54341847", "0.543041", "0.54291815", "0.53988546", "0.5385946", "0.534111", "0.53298193", "0.5320292", "0.5313458", "0.53120625", "0.52916443", "0.52743036", "0.52516377", "0.523964", "0.52215004", "0.52188766", "0.5216524", "0.51934165", "0.51934165", "0.51911217", "0.5180236", "0.51796013", "0.5179286", "0.5170647", "0.5170404", "0.51682794", "0.5161633", "0.51501876", "0.5147963", "0.5137893", "0.5137817", "0.51356053", "0.5127195", "0.5115432", "0.5112674", "0.51002", "0.5099389", "0.50974613", "0.5087315", "0.50800365", "0.50762784", "0.5075046", "0.50477153", "0.5046612", "0.5040671", "0.5030325", "0.5029938", "0.50279975", "0.5017388", "0.5015575", "0.5013235", "0.50077665", "0.5006332", "0.5001277", "0.49986365", "0.49971798", "0.49959448", "0.49883035", "0.497773", "0.4975859", "0.4975859", "0.49676186", "0.49674448", "0.49673888", "0.49658513", "0.49586654", "0.49530816", "0.4950242", "0.49488425", "0.4946742", "0.494551", "0.4945321", "0.4945321", "0.49375567", "0.49334058", "0.49310008", "0.49262735", "0.4924497", "0.4923309", "0.49208346", "0.4917899", "0.4916943", "0.49140823", "0.4896976", "0.48963276", "0.4894282", "0.48883814", "0.48857617", "0.48848137", "0.48840764", "0.48836708", "0.48798507" ]
0.8895049
0
Mounts slider onto sliderPane
private void mountSlider() { if (slider != null) { sliderPane.getChildren().add(slider); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void unmountSlider() {\n if (slider != null) {\n sliderPane.getChildren().remove(slider);\n }\n }", "private void initSlider() {\n setOrientation(HORIZONTAL);\n }", "private void createSlider(){\n\t\tslider = new GVertSlider(winApp, (int)width - 10, (int)height, 10, maxRows * (int)height);\n\t\tslider.setBorder(1);\n\t\tslider.setVisible(false);\n\t\tslider.setLimits(0, 0, maxRows - 1);\n\t\tslider.addEventHandler(this, \"processSliderMotion\", new Class[] { GVertSlider.class } );\n\t\tadd(slider);\n\t}", "public void setSlider(Slider slider) {\n\t\tthis.slider = slider;\n\t}", "public JComponent getSlidersPanel(){ return slidersPanel; }", "@FXML\n private void renderBranchWitherSlider() {\n renderSlider(0, 1, inputBranchWitherRatio, (e) -> {\n inputBranchWitherRatio = slider.getValue();\n renderTree();\n });\n }", "public abstract void updateSlider();", "private HBox createArrSizeSliderWrapper(BorderPane root) {\n HBox arrSizeSliderWrapper = new HBox();\n\n arrSizeSliderWrapper.setSpacing(10);\n Label arrSizeSliderText = new Label(\"Change Array Size:\");\n arrSizeSliderText.setTextFill(Color.WHITE);\n arrSizeSliderWrapper.getChildren().addAll(arrSizeSliderText, createArrSizeSlider(root));\n\n return arrSizeSliderWrapper;\n }", "private void initRangeSliders()\n\t{\n\t\trangeSliders.put(\"alpha\", new RangeSlider());\n\t\trangeSliders.put(\"eta\", new RangeSlider());\n\t\trangeSliders.put(\"kappa\", new RangeSlider());\n\t\t\n\t\tfor (Map.Entry<String, RangeSlider> entry : rangeSliders.entrySet()) {\n\t\t\tRangeSlider rs = entry.getValue();\n\n\t\t\trs.setMaxWidth(337);\n\t\t\trs.setPrefWidth(337);\n\t\t\trs.setMax(15);\n\t\t\trs.setMajorTickUnit(5);\n\t\t\trs.setMinorTickCount(4);\n\t\t\trs.setShowTickLabels(true);\n\t\t\trs.setShowTickMarks(true);\n\t\t\trs.setLowValue(0);\n\t\t\trs.setHighValue(25);\n\t\t\t\n\t\t\t// Get some distance between range sliders and bar charts.\n\t\t\trs.setPadding(new Insets(10, 0, 0, 1));\n\t\t\t\n\t\t\taddEventHandlerToRangeSlider(rs, entry.getKey());\n\t\t}\n\t\t\n\t\t// Set variable-specific minima and maxima.\n\t\trangeSliders.get(\"kappa\").setMin(2);\n\t\trangeSliders.get(\"kappa\").setMax(50);\n\t\trangeSliders.get(\"kappa\").setHighValue(50);\n\t\t\n\t\t// Add to respective parents.\n\t\tvBoxes.get(\"alpha\").getChildren().add(rangeSliders.get(\"alpha\"));\n\t\tvBoxes.get(\"eta\").getChildren().add(rangeSliders.get(\"eta\"));\n\t\tvBoxes.get(\"kappa\").getChildren().add(rangeSliders.get(\"kappa\"));\n\t}", "@FXML\n private void renderTrunkAngleSlider() {\n renderSlider(-180, 0, inputTrunkAngle, (e) -> {\n inputTrunkAngle = slider.getValue();\n renderTree();\n });\n }", "public RangeSlider() {\n initSlider();\n }", "private void renderSlider(double min, double max, double value, EventHandler eventHandler) {\n unmountSlider();\n buildSlider(min, max, value);\n slider.addEventHandler(MouseEvent.MOUSE_RELEASED, eventHandler);\n mountSlider();\n }", "protected void createSliders() {\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentFish\"));\n\t\tsuper.addSlider(0, 1, myResources.getString(\"PercentShark\"));\n\t}", "private Slider createArrSizeSlider(BorderPane root) {\n Slider arrSizeSlider = new Slider(MIN_ARR_SIZE, MAX_ARR_SIZE, arrSize);\n\n arrSizeSlider.valueProperty().addListener((observable, oldValue, newValue) -> {\n ((HBox) root.getTop()).getChildren().get(2).setDisable(false);\n ((HBox) root.getTop()).getChildren().get(3).setDisable(false);\n\n arrSize = newValue.intValue();\n width = (SORTING_DISPLAY_WIDTH - 2 * (arrSize - 1)) / arrSize;\n\n generateRandomHeights();\n root.setBottom(createSortingDisplay());\n });\n\n return arrSizeSlider;\n }", "public void drawslider()\n{\n controlP5 = new ControlP5(this);\n sliderbutton = controlP5.addSlider(\"time\", 0, 28800, 400, 710, 792, 30).setSliderMode(Slider.FLEXIBLE).setLabel(\"\");\n backwardsbutton =controlP5.addButton(\"backwards\", 0, 1245, 710, 30, 30).setLabel(\"<\");\n forwardsbutton =controlP5.addButton(\"forwards\", 0, 1325, 710, 30, 30).setLabel(\">\");\n playbutton = controlP5.addButton(\"play\", 0, 1280, 710, 40, 30);\n speeddownbutton = controlP5.addButton(\"speeddown\", 0, 1210, 710, 30, 30).setLabel(\"<<\");\n speedupbutton = controlP5.addButton(\"speedup\", 0, 1360, 710, 30, 30).setLabel(\">>\");\n controlP5.getController(\"time\").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE);\n}", "public HBox simulationControl() {\t\t\r\n\t\t// Setup Slider\r\n\t\tspeedControl.setPrefWidth(800);\r\n\t\tspeedControl.setBlockIncrement(10);\r\n\t\tspeedControl.setMajorTickUnit(10);\r\n\t\tspeedControl.setMinorTickCount(0);\r\n\t\tspeedControl.setSnapToTicks(true);\r\n\t\t\r\n\t\t// Setup HBox\r\n\t\tHBox control = new HBox(); \r\n\t\tcontrol.setAlignment(Pos.CENTER); \r\n\t\t\r\n\t\t// Add Slider To HBox\r\n\t\tcontrol.getChildren().add(speedControl);\r\n\t\t\r\n\t\treturn control;\r\n\t}", "void addSliders() {\n\t\t\tfinal JTextField impact_r = new JTextField(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\timpact_r.setEditable(false);\n\t\t\t\n\t\t\tJSlider impactR = new JSlider(JSlider.HORIZONTAL, 1, 10, 2);\n\t\t\timpactR.setMinorTickSpacing(1);\n\t\t\t\n\t\t\timpactR.addChangeListener(new ChangeListener() {\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tJSlider source = (JSlider)e.getSource();\n\t\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\t\tConstants.IMPACT_RADIUS = source.getValue() / 10.;\n\t\t\t\t\t\timpact_r.setText(\" \" + Constants.IMPACT_RADIUS + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tHashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();\n\t\t\tlabelTable.put(new Integer(1), new JLabel(\"0.1\"));\n\t\t\tlabelTable.put(new Integer(5), new JLabel(\"0.5\"));\n\t\t\tlabelTable.put(new Integer(10), new JLabel(\"1\"));\n\t\t\timpactR.setLabelTable(labelTable);\n\t\t\timpactR.setPaintTicks(true);\n\t\t\timpactR.setPaintLabels(true);\n\t\t\t\n\t\t\tContainer ir = new Container();\n\t\t\tir.setLayout(new FlowLayout());\n\t\t\tir.add(new JLabel(\"Impact Radius\"));\n\t\t\tir.add(impact_r);\n\t\t\t\n\t\t\tguiFrame.add(ir);\n\t\t\tguiFrame.add(impactR);\n\t\t}", "@FXML\n private void renderBranchLengthSlider() {\n renderSlider(1, 100, inputBranchLength, (e) -> {\n inputBranchLength = slider.getValue();\n renderTree();\n });\n }", "@FXML\n private void renderBranchAngleSlider() {\n renderSlider(1, 30, inputBranchAngle, (e) -> {\n inputBranchAngle = slider.getValue();\n renderTree();\n });\n }", "@FXML\n void angleSliderEvent() {\n \tint value = (int) angleSlider.getValue();\n \tangleText.setText(Integer.toString(value));\n \tangle = value;\n \tdrawLauncher(value);\n }", "HorizontalControl () {\n \n barY = 15; //40;\n barHeight = 40; //15;\n \n minX = 40;\n maxX = minX + width/3 - sliderWidth/2;\n \n minZoomValue = texture.width - texture.width;\n maxZoomValue = texture.width; // 300 percent\n valuePerX = (maxZoomValue - minZoomValue) / (maxX - minX);\n \n sliderWidth = 10; //25;\n sliderHeight = 25; //10;\n // sliderY = (barY + (barHeight/2)) - (sliderHeight/2);\n sliderY = (barY - (sliderHeight/2)) + (barHeight/2);\n sliderValue = minZoomValue; \n sliderX = minX; \n }", "@Override\n protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3)\n {\n if (this.visible)\n {\n if (this.dragging)\n {\n this.sliderValue = (par2 - (this.xPosition + 4)) / (float)(this.width - 8);\n updateSlider();\n }\n\n GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n\n Vector2f sliderPos = new Vector2f(\n this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)),\n this.yPosition\n );\n\n Vector2f sliderSize = new Vector2f(8, this.height);\n\n // Draw slider\n Gui.drawRect((int) sliderPos.getX(), (int) sliderPos.getY(), (int) sliderPos.getX() + (int) sliderSize.x, (int) sliderPos.getY() + (int) sliderSize.getY(), Color.BLACK.getRGB());\n\n // Draw slider inner\n Gui.drawRect((int) sliderPos.getX() + 2, (int) sliderPos.getY() + 2, (int) sliderPos.getX() + (int) sliderSize.x - 2, (int) sliderPos.getY() + (int) sliderSize.getY() - 2, Color.WHITE.getRGB());\n }\n }", "public void initPanel(String attrib, int desired_width){\r\n\r\n slider = new JSlider(JSlider.HORIZONTAL,\r\n min, max, min);\r\n\r\n slider.addChangeListener(new SliderBarActionListener(this,attrib));\r\n\r\n slider.setMajorTickSpacing((max-min)/5);\r\n slider.setPaintTicks(true);\r\n\r\n //Create the label table\r\n Hashtable labelTable = new Hashtable();\r\n labelTable.put( new Integer( min ), new JLabel(\"\"+ min/precision));\r\n labelTable.put( new Integer( max ), new JLabel(\"\" + max/precision));\r\n slider.setLabelTable( labelTable );\r\n\r\n slider.setPaintLabels(true);\r\n\r\n Dimension currentsize = slider.getPreferredSize();\r\n currentsize.width = desired_width;\r\n currentsize.height = (DIM_HEIGHT/12) * 11;\r\n slider.setPreferredSize(currentsize);\r\n\r\n this.setLayout(new GridLayout(2,1));\r\n\r\n this.add(label, BorderLayout.NORTH);\r\n\r\n this.add(slider, BorderLayout.SOUTH);\r\n\r\n this.revalidate();\r\n }", "@FXML\n private void renderBranchGrowthRatioSlider() {\n renderSlider(0.5, 1, inputBranchGrowthRatio, (e) -> {\n inputBranchGrowthRatio = slider.getValue();\n renderTree();\n });\n }", "private void syncSliderInput()\n {\n pickerSlider.valueProperty().removeListener(this::onColourSliderChange);\n pickerSlider.setStyle(\"-fx-background-color: linear-gradient(to top, #000000, \" + colourToRgb(toolColour) + \", #FFFFFF);\");\n pickerSlider.setValue(0.0);\n pickerSlider.valueProperty().addListener(this::onColourSliderChange);\n }", "Controls () {\n \n barX = 40;\n barWidth = 15;\n \n minY = 40;\n maxY = minY + height/3 - sliderHeight/2;\n \n minZoomValue = height - height;\n maxZoomValue = height; // 300 percent\n valuePerY = (maxZoomValue - minZoomValue) / (maxY - minY);\n \n sliderWidth = 25;\n sliderHeight = 10;\n sliderX = (barX + (barWidth/2)) - (sliderWidth/2); \n sliderValue = minZoomValue; \n sliderY = minY; \n }", "public void bind(final Slider slider) {\n\t\t// view for the color\n\t\tthis.addView(new ColorView() {\n\t\t\tSlider that = slider;\n\n\t\t\t@Override\n\t\t\tpublic void update(ColorController controller, Object caller) {\n\t\t\t\tif (!that.equals(caller)) {\n\t\t\t\t\tthat.setValue(controller.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Listener for slider changes\n\t\tslider.valueProperty().addListener(new ChangeListener<Number>() {\n\t\t\tSlider that = slider;\n public void changed(ObservableValue<? extends Number> ov,\n Number old_val, Number new_val) {\n \t\n \tDouble value = that.getValue();\n \tInteger ivalue = value.intValue();\n \tColorController.this.setValue(ivalue, that);\n }\n });\n\t\t\n\t\t\n\t\t// Update the slider to the integer value\n\t\tslider.setValue(getValue());\n\t}", "private JComponent getSlider() {\n\t\t\n\t\t// ----------- slider -----------\n\t\tJSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 400,\n\t\t\t\tDEFAULT_SLIDER_VALUE);\n\t\tslider.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tJSlider source = (JSlider) e.getSource();\n\t\t\t\tif (!source.getValueIsAdjusting()) {\n\t\t\t\t\tsliderChanged(e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tslider.setMajorTickSpacing(100);\n\t\tslider.setMinorTickSpacing(30);\n\t\t\n\t\t// ---------- text field ----------\n\t\tselPictures = new JTextField(\"\");\n\t\t \n\t\tJPanel p = new JPanel(new BorderLayout());\n\t\tp.add(selPictures, BorderLayout.CENTER);\n \t\tp.add(slider, BorderLayout.SOUTH);\n\t\t\n\t\treturn p;\n\t}", "private void setSliders() {\n\n\t\tSliderListener birthThresholdSlider = new SliderListener() {\n\t\t\tpublic void execute() {\n\t\t\t\tif (isAdjusting) {\n\t\t\t\t\tsetBirthThreshold(value);\n\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tSliderListener grassGrowthRateSlider = new SliderListener() {\n\t\t\tpublic void execute() {\n\t\t\t\tif (isAdjusting) {\n\t\t\t\t\tsetGrowthRateGrass(value);\n\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Apparently, setFirstVal() doesn't work\n\t\tbirthThresholdSlider.setFirstVal(getBirthThreshold());\n\t\tgrassGrowthRateSlider.setFirstVal(getGrowthRateGrass());\n\n\t\tmodelManipulator.addSlider(\"Birth Threshold\", 0, MAX_BIRTH_THRESHOLD, 10, birthThresholdSlider);\n\t\tmodelManipulator.addSlider(\"Grass Growth Rate\", 0, MAX_GROWTH_RATE_GRASS, 25, grassGrowthRateSlider);\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttimeSlider.setMin(0);\n\t\t\t\ttimeSlider.setValue(0);\n\t\t\t\ttimeSlider.setMax(mp.getTotalDuration().toSeconds());\n\t\t\t\t\n\t\t\t\t//System.out.println(vbox.getPrefHeight());\n\t\t\t\t\n//\t\t\t\tAnimation\n\t\t\t\tslideOut.getKeyFrames().addAll(\n\t\t\t\t\t\tnew KeyFrame(new Duration(0),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.translateYProperty(), menuBar.getPrefHeight()-26),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.opacityProperty(), 0.9)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\tnew KeyFrame(new Duration(300),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.translateYProperty(), menuBar.getPrefHeight()-26),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.opacityProperty(), 0.0)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\tslideIn.getKeyFrames().addAll(\n\t\t\t\t\t\tnew KeyFrame(new Duration(0),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.translateYProperty(), menuBar.getPrefHeight()-26),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.opacityProperty(), 0.0)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\tnew KeyFrame(new Duration(300),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.translateYProperty(), menuBar.getPrefHeight()-26),\n\t\t\t\t\t\t\t\tnew KeyValue(menuBar.opacityProperty(), 0.9)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\tslideOut.getKeyFrames().addAll(\n\t\t\t\t\t\tnew KeyFrame(new Duration(0),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.translateYProperty(), vbox.getPrefHeight()),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.opacityProperty(), 0.9)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\tnew KeyFrame(new Duration(300),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.translateYProperty(), vbox.getPrefHeight()),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.opacityProperty(), 0.0)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\tslideIn.getKeyFrames().addAll(\n\t\t\t\t\t\tnew KeyFrame(new Duration(0),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.translateYProperty(), vbox.getPrefHeight()),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.opacityProperty(), 0.0)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\tnew KeyFrame(new Duration(300),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.translateYProperty(), vbox.getPrefHeight()),\n\t\t\t\t\t\t\t\tnew KeyValue(vbox.opacityProperty(), 0.9)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t}", "void updateSliderPosition(int currentTick);", "public Slider getSlider() {\n\t\treturn slider;\n\t}", "private JSlider getZSlider() {\r\n\t\tif (zSlider == null) {\r\n\t\t\tzSlider = new JSlider(1,1);\r\n\t\t\tzSlider.setMajorTickSpacing(100);\r\n\t\t\tzSlider.setPaintLabels(true);\r\n\t\t\tzSlider.addChangeListener(new javax.swing.event.ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(javax.swing.event.ChangeEvent e) {\r\n\t\t\t\t\tsaveUserChangesToROI();\r\n\t\t\t\t\tupdateLabel(-1, -1);\r\n\t\t\t\t\tBufferedImage image = getImage();\r\n\t\t\t\t\tif (image != null){\r\n\t\t\t\t\t\timagePane.setUnderlyingImage(image,/*false,*/allPixelValuesRange);\r\n\t\t\t\t\t}\r\n\t\t\t\t\trefreshROI();\r\n\t\t\t\t\timagePane.repaint();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn zSlider;\r\n\t}", "private void sliderChanged(ChangeEvent e) {\n\t\tif (isTest()) { // TEST TEST TEST TEST !!!!!!!!!!!!!\n\t\t\treturn;\n\t\t}\n\t\n\t\tJSlider source = (JSlider) e.getSource();\n\t\tsliderValue = (int) source.getValue();\n\t\t// System.out.println(windowBase.getName() + \": sliderChanged: \" +\n\t\t// sliderValue);\n\t\tint size = index.data.getPictureSize();\n\t\tif (size == 0) {\n\t\t\tremoveAllPictureViews(); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\t \n\t\tPM_Picture pic = null;\n\t\t\n\t\tif (client.getComponentCount() > 0) {\n\t\t\tObject o = client.getComponent(0);\n\t\t\tif (o instanceof PM_PictureView) {\n\t\t\t\tpic = ((PM_PictureView)o).getPicture();\n\t\t\t}\n\t\t}\n\t\t\n//\t\tSystem.out.println(\"..... sliderChanged\");\n\t\tpaintViewport(pic);\n\t\t// paintViewport(null);\n\t}", "@JSProperty(\"pane\")\n void setPane(double value);", "@Override\n public void onSliderClick(BaseSliderView slider) {\n }", "void slideUpDownWithHandle(int byPixels);", "private void initPieceDragged(ImageView imageView) {\n imageView.setOnMouseDragged(event -> {\n imageView.setX(event.getX() - marginX);\n imageView.setY(event.getY() - marginY);\n });\n }", "public void setFromSlider() {\n\t\tif (loDate.getValue() == null && hiDate.getValue() == null)\n\t\t\treturn;\n\t\t\n\t\tif (loDate.getValue() == null) {\n\t\t\tDate newLoDate = getDatePlusDays(hiDate.getValue(), -slider.getSlider().getValue());\n\t\t\tloDate.setValue(newLoDate);\n\t\t} else {\n\t\t\tDate newHiDate = getDatePlusDays(loDate.getValue(), slider.getSlider().getValue());\n\t\t\tif (hiDate.getValue() == null || !hiDate.getValue().equals(newHiDate))\n\t\t\t\thiDate.setValue(newHiDate);\n\t\t}\n\t}", "private void setupVExpenseSlider() {\n\t\tif(verticalExpenseSlider != null)\n\t\t\tverticalExpensePanel.remove(verticalExpenseSlider);\n\t\tverticalExpenseSlider = new FloatingSliderPanel(0.0f, 1f, DEFAULT_VERTICAL_EXPENSE) {\n\t\t\tprotected void setDescriptionLabelText() {\n\t\t\t\tfloat currentValue = getCurrentValue();\n\t\t\t\tinfoLabel.setText(setVerticalExpenseInfoLabel(currentValue));\n\t\t\t}\n\t\t};\n\t\tGridBagConstraints gbc_verticalExpenseSlider = new GridBagConstraints();\n\t\tgbc_verticalExpenseSlider.insets = new Insets(0, 10, 0, 10);\n\t\tgbc_verticalExpenseSlider.fill = GridBagConstraints.BOTH;\n\t\tgbc_verticalExpenseSlider.gridx = 0;\n\t\tgbc_verticalExpenseSlider.gridy = 1;\n\t\tverticalExpensePanel.add(verticalExpenseSlider, gbc_verticalExpenseSlider);\n\t\t\n\t\trevalidate();\n\t}", "@FXML\n\tprivate void initialize() {\n\t\tmDragOverIcon = new DragIcon();\n\n\t\tmDragOverIcon.setVisible(false);\n\t\tmDragOverIcon.setOpacity(0.65);\n\t\tgetChildren().add(mDragOverIcon);\n\n\t\t// populate left pane with multiple colored icons for testing\n\t\tfor (int i = 0; i < 2; i++) {\n\n\t\t\t// DragIcon icn = new DragIcon();\n\n\t\t\t// addDragDetection(icn);\n\n\t\t\t// icn.setType(DragIconType.values()[i]);\n\t\t\t// right_pane.getChildren().add(icn);\n\t\t\t/*\n\t\t\t * ScrollPane scrollpane = new ScrollPane(); s.setContent(base_pane);\n\t\t\t * scrollpane.setPrefSize(600, 200); right_pane.setRightAnchor(scrollpane,\n\t\t\t * null);\n\t\t\t */\n\n\t\t\t// ScrollPane scroller = new ScrollPane(base_pane);\n\t\t\t// right_pane.setLeftComponent(scroller);\n\n\t\t}\n\n\t\tbuildDragHandlers();\n\t\t// buildNodeClickHandlers();\n\t\tright_pane.addEventFilter(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tif (event.getButton().equals(MouseButton.PRIMARY)) {\n\t\t\t\t\tSystem.out.println(\"mouse clickd double\");\n\t\t\t\t\tboolean doubleClicked = event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() == 2;\n\t\t\t\t\tSystem.out.println(\"doubleClicked\" + doubleClicked);\n\t\t\t\t\tif (doubleClicked) {\n\t\t\t\t\t\tSystem.out.println(\"function starts\");\n\t\t\t\t\t\t// DragIcon icn = (DragIcon) event.getSource();\n\t\t\t\t\t\t// mDragOverIcon.setType(icn.getType());\n\t\t\t\t\t\t// event.getSource();\n\t\t\t\t\t\tDraggableNode dragnode = new DraggableNode(graphAct);\n\n\t\t\t\t\t\t// new Point2D(event.getSceneX(), event.getSceneY())\n\t\t\t\t\t\tdragnode.setLayoutX(event.getSceneX());\n\t\t\t\t\t\tdragnode.setLayoutY(event.getSceneY());\n\t\t\t\t\t\t// dragnode.screenToLocal(getLayoutX(), getLayoutY());\n\t\t\t\t\t\tright_pane.getChildren().add(dragnode);\n\n\t\t\t\t\t\tevent.consume();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\n\t\tright_pane.addEventFilter(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tif (event.getButton().equals(MouseButton.PRIMARY)) {\n\t\t\t\t\tSystem.out.println(\"mouse clickd double\");\n\t\t\t\t\tboolean doubleClicked = event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() == 2;\n\t\t\t\t\tSystem.out.println(\"doubleClicked\" + doubleClicked);\n\t\t\t\t\tif (doubleClicked) {\n\t\t\t\t\t\tSystem.out.println(\"function starts\");\n\t\t\t\t\t\t// DragIcon icn = (DragIcon) event.getSource();\n\t\t\t\t\t\t// mDragOverIcon.setType(icn.getType());\n\t\t\t\t\t\t// event.getSource();\n\t\t\t\t\t\tDraggableNode dragnode = new DraggableNode(graphAct);\n\n\t\t\t\t\t\t// new Point2D(event.getSceneX(), event.getSceneY())\n\t\t\t\t\t\tdragnode.setLayoutX(event.getSceneX());\n\t\t\t\t\t\tdragnode.setLayoutY(event.getSceneY());\n\t\t\t\t\t\t// dragnode.screenToLocal(getLayoutX(), getLayoutY());\n\t\t\t\t\t\tright_pane.getChildren().add(dragnode);\n\n\t\t\t\t\t\tevent.consume();\n\t\t\t\t\t}\n\t\t\t\t}else if(event.getButton().equals(MouseButton.SECONDARY)) {\n\t\t\t\t\tdouble zoomFactor = 1.5;\n\t\t\t\t\tif (event.isControlDown()) {\n\t\t\t\t\t\t// zoom out\n\t\t\t\t\t\tzoomFactor = 1 / zoomFactor;\n\t\t\t\t\t}\n\t\t\t\t\tzoomOperator.zoom(right_pane, zoomFactor, event.getSceneX(), event.getSceneY());\n\t\t\t\t\tevent.consume();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\n\t}", "public SlideshowEditor()\n {\n // INITIALIZING THE WINDOW\n \t\n try { //set theme for SlideshowEditors\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n setTitle(\"Slideshow Editor\");\n setLayout(new BorderLayout());\n\n // CREATING THE TIMELINE\n\n timeline = Timeline.getInstance();\n add(timeline, BorderLayout.EAST);\n\n // CREATING THE MEDIA LIBRARIES\n\n libraries = new JTabbedPane();\n\n m_ImageLibrary = ImageLibrary.getInstance(timeline, null); //initialize libraries with null since user has not selected a directory\n JScrollPane spImages = new JScrollPane(m_ImageLibrary);\n spImages.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n spImages.getVerticalScrollBar().setUnitIncrement(20);\n libraries.add(\"Images\", spImages);\n\n m_AudioLibrary = AudioLibrary.getInstance(timeline, null);\n JScrollPane spAudio = new JScrollPane(m_AudioLibrary);\n spAudio.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n spAudio.getVerticalScrollBar().setUnitIncrement(20);\n libraries.add(\"Audio\", spAudio);\n\n libraries.setPreferredSize(new Dimension(1000,750));\n add(libraries, BorderLayout.WEST);\n\n libraries.setBorder(BorderFactory.createTitledBorder(\"Media\"));\n\n libraries.addChangeListener(new ChangeListener() {\n public void stateChanged(ChangeEvent e) {\n timeline.setActivePane(libraries.getSelectedIndex()); //makes sure Timeline tab matches selected library\n }\n });\n\n timeline.enablePaneMatch(libraries);\n\n // CONFIGURING THE WINDOW\n\n JMenuBar topMenu = new JMenuBar(); //create a menu bar for the window\n setJMenuBar(topMenu);\n\n JMenu fileMenu = new JMenu(\"File\");\n topMenu.add(fileMenu);\n\n JMenuItem newDirectory = new JMenuItem(\"Set Directory\"); //allow user to set directory for Slideshow creation\n newDirectory.addActionListener(event -> changeDirectory());\n newDirectory.setAccelerator(\n KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK)); //add keyboard shortcut Ctrl + O\n fileMenu.add(newDirectory);\n\n JMenuItem exportSlideshow = new JMenuItem(\"Export Slideshow\");\n exportSlideshow.addActionListener(event -> timeline.exportSlideshow(automated));\n exportSlideshow.setAccelerator(\n KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK)); //add keyboard shortcut Ctrl + S\n fileMenu.add(exportSlideshow);\n\n JMenuItem closeProgram = new JMenuItem(\"Exit\"); //add Exit Program button to File menu\n closeProgram.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n System.exit(0);\n }\n });\n fileMenu.add(closeProgram);\n\n JMenu settingsMenu = new JMenu(\"Settings\");\n topMenu.add(settingsMenu);\n\n JMenuItem changeSettings = new JMenuItem(\"Change Playback Settings\");\n changeSettings.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (!settingsPresent)\n {\n settingsPresent = true;\n settingsPopup();\n }\n else\n settingsFrame.toFront();\n }\n });\n\n settingsMenu.add(changeSettings);\n\n JMenu helpMenu = new JMenu(\"Help\");\n topMenu.add(helpMenu);\n\n JMenuItem tutorial = new JMenuItem(\"Tutorial\");\n String tutorialMsg = \"<html>Creating a slideshow is easy!<br><ol><li>Open the folder containing the image and audio files you'd like to use. (File -> Set Directory)</li>\" +\n \"<li>To add image and audio files to your slideshow, just click \\\"Add\\\" under the given image/audio file.</li>\" +\n \"<li>To set your slideshow to play back automatically, open the settings window (Settings -> Change Playback Settings) and click the \\\"Automatic Slideshow\\\" checkbox. <br>From there, click the \\\"Submit Changes\\\" button to save your settings. (To set it back to manual, just do the reverse!)</li>\" +\n \"<li>To change the default slide duration of an automatic slideshow, open the settings window and change the value in the \\\"Default Slide Duration\\\" textbox. <br>From there, click the \\\"Submit Changes\\\" button to save your settings.</li>\" +\n \"<li>To change the duration of an individual slide in an automatic slideshow, uncheck the \\\"Use Default Slide Duration\\\" at the bottom of the slide item in the Timeline.<br>From there, click the \\\"Change Duration\\\" button to the right of the slide duration value and enter a new value.<br>(To set it back to the default slide duration, just recheck the \\\"Use Default Slide Duration\\\" checkbox!)</li>\" +\n \"<li>To set a transition to play at the beginning of a slide, select a transition type from the \\\"Transition Type\\\" dropdown at the top of a slide item.</li>\" +\n \"<li>To change the duration of a slide's transition, select a transition duration from the \\\"Transition Duration\\\" dropdown at the top of a slide item.<br>(This dropdown will only be enabled if a transition has been set.)</li>\" +\n \"<li>To move a slide up/down the timeline, click the \\\"Move Up/Down\\\" button at the bottom of a slide item.</li>\" +\n \"<li>To remove a slide from your slideshow, click the \\\"Remove\\\" button at the bottom on a slide item.</li>\" +\n \"<li>Audio items in the Timeline work the same as slide items, except they can't use transitions.</li>\" +\n \"<li>To export your slideshow, navigate to File -> Export Slideshow. From there, give your slideshow a name and click save!<br>Your slideshow is now stored in the same folder as your image and audio files.</li></ol>\" +\n \"NOTE: The left column of blocks in the \\\"Timing\\\" area of the screen, present when creating an automatic slideshow, represents slides. The right column represents audio clips.<br></html>\";\n tutorial.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n JOptionPane.showMessageDialog(null, tutorialMsg, \"Tutorial\", JOptionPane.INFORMATION_MESSAGE);\n }\n });\n\n helpMenu.add(tutorial);\n\n ImageIcon windowIcon = new ImageIcon(\"images\\\\SlideshowIcon.png\");\n // TODO: Uncomment below for JAR\n //ImageIcon windowIcon = new ImageIcon(getClass().getClassLoader().getResource(\"SlideshowIcon.png\"));\n Image icon = windowIcon.getImage();\n setIconImage(icon);\n setSize(new Dimension(1500, 750));\n setResizable(false);\n setDefaultCloseOperation(EXIT_ON_CLOSE);\n pack();\n setLocationRelativeTo(null);\n setVisible(true);\n\n\n String welcomeMsg = \"<html><div style='text-align: center;'>Welcome to the greatest slideshow creator ever made.<br>To start creating a slideshow, \" +\n \"use the \\\"File\\\" menu in the top left corner<br>and select \\\"Set Directory\\\" and find the directory containing the images and audio you'd like to work with.<br>\" +\n \"This will also be the directory you'll save your slideshow into.<br>Go ahead. Select one. (You know you want to.)</div></html>\";\n JOptionPane.showMessageDialog(null, welcomeMsg, \"Welcome to Slideshow Editor!\", JOptionPane.INFORMATION_MESSAGE);\n }", "private void setup() {\r\n\t\tscrollPane.setContent(iv);\r\n\t\tiv.setPickOnBounds(true);\r\n\t\tiv.requestFocus();\r\n\t\tiv.setOnMouseClicked(e -> {\r\n\t\tswitch (click) {\r\n\t\t\tcase 0:\r\n\t\t\t\tlines = image.getRGB((int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\tColor lColH = new Color(lines);\r\n\t\t\t\tjavafx.scene.paint.Color lCol = javafx.scene.paint.Color.rgb(lColH.getRed(), lColH.getGreen(), lColH.getBlue(), lColH.getTransparency());\r\n\t\t\t\twallRect.setFill(lCol);\r\n\t\t\t\tclick++;\r\n\t\t\t\te.consume();\r\n\t\t\t\tstateLabel.setText(\"Click on a corrider\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\tspace = image.getRGB((int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\tclick++;\r\n\t\t\t\tColor sColH = new Color(space);\r\n\t\t\t\tjavafx.scene.paint.Color sCol = javafx.scene.paint.Color.rgb(sColH.getRed(), sColH.getGreen(), sColH.getBlue(), sColH.getTransparency());\r\n\t\t\t\tspaceRect.setFill(sCol);\r\n\t\t\t\te.consume();\r\n\t\t\t\tstateLabel.setText(\"Choose start location\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tstart = new Pair<Integer, Integer>(\r\n\t\t\t\t\t\t(int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\timage.setRGB(start.getKey(), start.getValue(), Color.BLUE.getRGB());\r\n\t\t\t\tiv.setImage(SwingFXUtils.toFXImage(image, null));\r\n\t\t\t\tclick++;\r\n\t\t\t\tstateLabel.setText(\"Choose end location\");\r\n\t\t\t\te.consume();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tend = new Pair<Integer, Integer>(\r\n\t\t\t\t\t\t(int) Math.round(e.getX() * (image.getWidth() / iv.getLayoutBounds().getWidth())),\r\n\t\t\t\t\t\t(int) Math.round(e.getY() * (image.getHeight() / iv.getLayoutBounds().getHeight())));\r\n\t\t\t\te.consume();\r\n\t\t\t\timage.setRGB(end.getKey(), end.getValue(), Color.BLUE.getRGB());\r\n\t\t\t\tiv.setImage(SwingFXUtils.toFXImage(image, null));\r\n\t\t\t\tclick++;\r\n\t\t\t\tsolveButton.setDisable(false);\r\n\t\t\t\tstateLabel.setText(\"Ready to solve\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t\tzoomProperty.addListener(new InvalidationListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void invalidated(Observable arg0) {\r\n\t\t\t\tiv.setFitWidth(zoomProperty.get() * 4);\r\n\t\t\t\tiv.setFitHeight(zoomProperty.get() * 3);\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tscrollPane.addEventFilter(ScrollEvent.ANY, new EventHandler<ScrollEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ScrollEvent event) {\r\n\t\t\t\tif (event.getDeltaY() > 0) {\r\n\t\t\t\t\tzoomProperty.set(zoomProperty.get() * 1.1);\r\n\t\t\t\t} else if (event.getDeltaY() < 0) {\r\n\t\t\t\t\tzoomProperty.set(zoomProperty.get() / 1.1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t\tiv.setSmooth(false);\r\n\t\tiv.preserveRatioProperty().set(true);\r\n\t}", "private void setAllSliders() {\n setSliderValue(speedSlider, speedTF, 24);\n }", "private Parent createContent(){\n Pane root = new Pane();\n root.setPrefSize(BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n\n Rectangle background = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n background.setFill(Color.rgb(152, 172, 172));\n root.getChildren().add(background);\n\n Rectangle bar = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT+1), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1)); // the Board area\n bar.setFill(Color.rgb(31, 31, 31));\n root.getChildren().add(bar);\n\n Rectangle holdArea = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT-1) + 96, 10, BRICK_SIZE*4+4, BRICK_SIZE*4+4);\n holdArea.setFill(Color.rgb(31, 31, 31));\n holdArea.setStroke(Color.WHITE);\n holdArea.setStrokeWidth(1.0);\n root.getChildren().add(holdArea);\n\n Text holdLabel = new Text();\n holdLabel.setText(\"Hold: (X)\");\n holdLabel.setLayoutX(BRICK_SIZE*(Board.BOUNDARY_RIGHT) + 96);\n holdLabel.setLayoutY(32);\n holdLabel.setFill(Color.WHITESMOKE);\n holdLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(holdLabel);\n\n Rectangle next = new Rectangle(BRICK_SIZE*(Board.BOUNDARY_RIGHT-1) + 96, 150, BRICK_SIZE*4+4, BRICK_SIZE*4+4);\n next.setFill(Color.rgb(91, 91, 91));\n next.setStroke(Color.WHITE);\n next.setStrokeWidth(1.0);\n root.getChildren().add(next);\n\n Text nextLabel = new Text();\n nextLabel.setText(\"Next:\");\n nextLabel.setLayoutX(BRICK_SIZE*(Board.BOUNDARY_RIGHT) + 96);\n nextLabel.setLayoutY(172);\n nextLabel.setFill(Color.WHITESMOKE);\n nextLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(nextLabel);\n\n Canvas canvas = new Canvas(BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n g = canvas.getGraphicsContext2D();\n root.getChildren().add(canvas);\n\n Label scoreLabel = new Label();\n scoreLabel.setText(\"Score\");\n scoreLabel.setLayoutX(360);\n scoreLabel.setLayoutY(332);\n scoreLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(scoreLabel);\n\n Label highScoreLabel = new Label();\n highScoreLabel.setText(\"High Score\");\n highScoreLabel.setLayoutX(360);\n highScoreLabel.setLayoutY(382);\n highScoreLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(highScoreLabel);\n\n Label levelLabel = new Label();\n levelLabel.setText(\"Level\");\n levelLabel.setLayoutX(360);\n levelLabel.setLayoutY(432);\n levelLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(levelLabel);\n\n Label linesLabel = new Label();\n linesLabel.setText(\"Lines Cleared\");\n linesLabel.setLayoutX(360);\n linesLabel.setLayoutY(482);\n linesLabel.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(linesLabel);\n\n board = new Board();\n\n score.setText(\"\" + board.getScore());\n score.setLayoutX(360);\n score.setLayoutY(352);\n score.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(score);\n\n highScore.setText(\"\" + Math.max(FileHandler.readHighScore(), board.getScore()));\n highScore.setLayoutX(360);\n highScore.setLayoutY(402);\n highScore.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(highScore);\n\n level.setText(\"\" + board.getLevel());\n level.setLayoutX(360);\n level.setLayoutY(452);\n level.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(level);\n\n lines.setText(\"\" + board.getTotalLinesCleared());\n lines.setLayoutX(360);\n lines.setLayoutY(502);\n lines.setFont(Font.font(\"Impact\", 20));\n root.getChildren().add(lines);\n\n refreshDisplay();\n\n // The AnimationTimer is responsible for moving the currently controlled piece down.\n AnimationTimer animationTimer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if(time < 0.2){\n time = 0.0;\n }\n time += timeFractionBasedOnLevel();\n if(time >= 60.0){\n board.moveDown();\n refreshDisplay();\n time = 0.0;\n }\n }\n };\n animationTimer.start();\n\n return root;\n }", "@Override\n public void onSliderClick(SliderView sliderView) {\n }", "public abstract Pane getPane(PriceRange range);", "private void initPane() {\n\t\tContainer localContainer = getContentPane();\n\t\tlocalContainer.setLayout(new BorderLayout());\n\t\t\n\t\tsplitpane_left_top.setBorder(BorderFactory.createTitledBorder(\"Training Data\"));\n\t\tsplitpane_left_bottom.setBorder(BorderFactory.createTitledBorder(\"Tree View\"));\n\t\tsplitpane_left.setDividerLocation(400);\n\t\tsplitpane_left.setLastDividerLocation(0);\n\t\tsplitpane_left.setOneTouchExpandable(true);\n\t\tsplitpane_right.setBorder(BorderFactory.createTitledBorder(\"Classifer Output\"));\n\t\tsplitpane_main.setDividerLocation(500);\n\t\tsplitpane_main.setLastDividerLocation(0);\n\t\tsplitpane_main.setOneTouchExpandable(true);\n\t\tlocalContainer.add(splitpane_main, \"Center\");\n\t\tlocalContainer.add(statusPanel,BorderLayout.SOUTH);\n\t}", "public SolitairePane() {\n getChildren().addListener((ListChangeListener<Node>) c -> {\n while (c.next()) {\n List<? extends Node> added = c.getAddedSubList();\n added.forEach(this::makeDraggable);\n }\n });\n\n // Allow nodes to be directly dragged onto this pane\n this.setOnDragOver(event -> {\n final Dragboard dragboard = event.getDragboard();\n if (dragboard.hasContent(DRAG_FORMAT)\n && DRAG_KEY.equals(dragboard.getContent(DRAG_FORMAT))\n && dragging != null) {\n event.acceptTransferModes(TransferMode.MOVE);\n event.consume();\n }\n });\n\n // Drop dragged nodes onto this pane\n this.setOnDragDropped(event -> {\n Dragboard db = event.getDragboard();\n boolean success = false;\n if (db.hasContent(DRAG_FORMAT)) {\n Node nearestNode = findNearestNode(getChildren(), event.getX(), event.getY());\n if (nearestNode == null) {\n getChildren().add(dragging);\n } else {\n int targetIndex = getChildren().indexOf(nearestNode);\n if (event.getX() > nearestNode.getLayoutX()) {\n // dropped to the right of the node\n // bump the index to place it to that side\n targetIndex++;\n }\n getChildren().add(targetIndex, dragging);\n }\n success = true;\n }\n event.setDropCompleted(success);\n event.consume();\n });\n }", "private void setOnSlide(JFXSlider cogSlider, final JFXTextField cogInput) {\n cogSlider.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n //TODO Round on 1 or more?\n DecimalFormat df = new DecimalFormat(\"#.#\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n cogInput.setText(df.format(newValue));\n }\n });\n }", "public AltAzController( float altitude, \n float azimuth, \n float min_distance,\n float max_distance,\n float distance )\n {\n setLayout( new GridLayout(3,1) );\n TitledBorder border = new TitledBorder(\n LineBorder.createBlackLineBorder(),\"View Control\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n setBorder( border );\n\n altitude_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_ALT_ANGLE), \n 0 );\n altitude_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Altitude\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n altitude_slider.setBorder( border );\n add( altitude_slider ); \n\n azimuth_slider = new JSlider( JSlider.HORIZONTAL, \n -(int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n (int)(ANGLE_SCALE_FACTOR*MAX_AZI_ANGLE), \n 0 );\n azimuth_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Azimuth\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n azimuth_slider.setBorder( border );\n add( azimuth_slider ); \n\n distance_slider = new JSlider( JSlider.HORIZONTAL, 1, 20, 10 );\n distance_slider.addChangeListener( new SliderChanged() );\n border = new TitledBorder( LineBorder.createBlackLineBorder(),\"Distance\");\n border.setTitleFont( FontUtil.BORDER_FONT );\n distance_slider.setBorder( border );\n add( distance_slider ); \n\n setDistanceRange( min_distance, max_distance );\n setDistance( distance );\n setAltitudeAngle( altitude );\n setAzimuthAngle( azimuth );\n\n setView( true );\n }", "protected void createSlider(CompContainer cc, String name, int min, int max, \r\n\t\t\tint t1, int t2, int pointer, final String suffix)\r\n\t{\r\n\t\tcc.label = new JLabel(localer.getBundleText(name));\r\n\t\tcc.label.setName(\"Label-\" + name);\r\n\t\tcc.label.setFont(cc.label.getFont().deriveFont(Font.PLAIN));\r\n\r\n\t\tcc.extraLabel = new JLabel(\"\", JLabel.CENTER);\r\n\t\tcc.extraLabel.setName(\"ChgValue-\" + name);\r\n\t\tcc.extraLabel.setFont(cc.extraLabel.getFont().deriveFont(Font.PLAIN));\r\n\t\tfinal JLabel extra = cc.extraLabel;\r\n\t\t\r\n\t\tString preValue = prefMap.get(name);\r\n\t\tif(preValue == null || preValue.equals(\"\")) // if setting is found in prefs\r\n\t\t\tcc.extraLabel.setText(Integer.toString(pointer) + suffix);\r\n\t\telse\r\n\t\t{\r\n\t\t\tpointer = Integer.parseInt(preValue);\r\n\t\t\tcc.extraLabel.setText(preValue + suffix);\r\n\t\t}\r\n\t\t\r\n\t\tcc.comp = new JSlider(min, max, pointer);\r\n\t\tcc.comp.setName(name);\r\n\t\t\r\n\t\t((JSlider)cc.comp).setPaintTicks(true);\r\n\t\t((JSlider)cc.comp).setSnapToTicks(true);\r\n\t\t((JSlider)cc.comp).setMinorTickSpacing(t1);\r\n\t\t((JSlider)cc.comp).setMajorTickSpacing(t2);\r\n\t\t((JSlider)cc.comp).addChangeListener(new ChangeListener()\r\n\t\t{\r\n\t\t\tpublic void stateChanged(ChangeEvent e)\r\n\t\t\t{\r\n\t\t\t\textra.setText(Integer.toString(\r\n\t\t\t\t\t\t((JSlider)e.getSource()).getValue()) + suffix); \r\n\t\t\t} \r\n\t\t} ); \r\n\t}", "@Override\n\t\tpublic void setPane(JPanel pane) {\n\t\t\t\n\t\t}", "public ElevatorSlider (Elevator e, int name) {\n elevator = e;\n getInfo ();\n // Create the slider and adjust its properties\n slider = new JSlider (JSlider.VERTICAL, 0, numFloors, 0);\n slider.setMajorTickSpacing (MAJOR_TICK_SPACING);\n slider.setMinorTickSpacing (MINOR_TICK_SPACING);\n slider.setPaintTicks (true);\n slider.setPaintLabels (true);\n // Calculate the dimensions for the sliders\n int width = SLIDER_WIDTH;\n int height = HEIGHT_PER_FLOOR * numFloors;\n int heightResize = 1 + (numFloors / FLOOR_LIMIT);\n height /= heightResize;\n slider.setPreferredSize (new Dimension (width, height));\n \n // Add the slider\n this.add (slider);\n this.update (e, name);\n // Add the label to the panel\n this.add (stateLabel);\n this.add (capLabel);\n this.add (floorLabel);\n // Set the layout\n this.setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));\n \n }", "public void autoSwipeViews() {\n mTimer = new Timer();\n mTimer.scheduleAtFixedRate(new SliderTimer(), 10000, 10000);\n }", "@FXML\n\tpublic void onVolumeSliderChanged(MouseEvent e){\n\t\t//Grab the affected slider\n\t\tSlider sliderChanged = (Slider) e.getSource();\n\n\t\t//Grab old/new slider values\n\t\tdouble oldValue = synth.getVolume(),\n\t\t\t\tnewValue = sliderChanged.getValue();\n\n\t\t//Add the action if the values differ\n\t\tif(oldValue != newValue) {\n\t\t\ttry {\n\t\t\t\t//Add the action\n\t\t\t\tactionLog.AddAction(\n\t\t\t\t\t\toldValue,\n\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\tsliderChanged,\n\t\t\t\t\t\tsliderChanged.getClass().getMethod(\"setValue\", double.class),\n\t\t\t\t\t\tthis.getClass().getMethod(\"changeVolume\", double.class));\n\t\t\t} catch (NoSuchMethodException | SecurityException e1) {\n\t\t\t\tSystem.out.println(\"An unexpected error has occured.\");\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\n\t\t\tchangeVolume(newValue);\n\t\t}\n\t}", "private JSlider getTimeSlider() {\r\n\t\tif (timeSlider == null) {\r\n\t\t\ttimeSlider = new JSlider(1,1);\r\n\t\t\ttimeSlider.setPaintLabels(true);\r\n\t\t\ttimeSlider.setMajorTickSpacing(100);\r\n\t\t\ttimeSlider.addChangeListener(new javax.swing.event.ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(javax.swing.event.ChangeEvent e) {\r\n\t\t\t\t\tforceImage();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn timeSlider;\r\n\t}", "private void moveablePane(){\n dragPane.setOnMousePressed(pressEvent -> dragPane.setOnMouseDragged(dragEvent -> {\n Stage stage = (Stage) minimizeButton.getScene().getWindow();\n stage.setX(dragEvent.getScreenX() - pressEvent.getSceneX());\n stage.setY(dragEvent.getScreenY() - pressEvent.getSceneY());\n }));\n }", "private void addEventHandlerToRangeSlider(RangeSlider rs, String parameter)\n\t{\n\t\trs.addEventHandler(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) \n {\n \t// Special adjustments after drag is finished.\n \tif (parameter == \"kappa\") {\n \t\trs.setLowValue(Math.round(rs.getLowValue()));\n \t\trs.setHighValue(Math.round(rs.getHighValue()));\n \t}\n \t\n \t// Update control values after slider values were changed.\n \tupdateControlValues(rs, parameter);\n \t\n \t// Re-generate parameter values.\n \tgenerateParameterValues();\n };\n });\n\t\t\n\t\t// Add listener to determine position during mouse drag.\n\t\trs.addEventHandler(MouseEvent.MOUSE_DRAGGED, new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) \n {\n \t// Update control values after slider values where changed.\n \tupdateControlValues(rs, parameter);\n };\n });\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n slider_slices = new javax.swing.JSlider();\n jLabel2 = new javax.swing.JLabel();\n slider_width = new javax.swing.JSlider();\n jLabel3 = new javax.swing.JLabel();\n slider_height = new javax.swing.JSlider();\n jLabel4 = new javax.swing.JLabel();\n slider_depth = new javax.swing.JSlider();\n check_showBounds = new javax.swing.JCheckBox();\n slider_opacity = new javax.swing.JSlider();\n jLabel5 = new javax.swing.JLabel();\n check_showLightbuffer = new javax.swing.JCheckBox();\n check_multisample = new javax.swing.JCheckBox();\n\n jLabel1.setText(\"Slices\");\n\n slider_slices.setMaximum(700);\n slider_slices.setMinimum(1);\n slider_slices.setValue(5);\n slider_slices.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_slicesStateChanged(evt);\n }\n });\n\n jLabel2.setText(\"Width\");\n\n slider_width.setMaximum(200);\n slider_width.setMinimum(20);\n slider_width.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_widthStateChanged(evt);\n }\n });\n\n jLabel3.setText(\"Height\");\n\n slider_height.setMaximum(200);\n slider_height.setMinimum(20);\n slider_height.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_heightStateChanged(evt);\n }\n });\n\n jLabel4.setText(\"Depth\");\n\n slider_depth.setMaximum(200);\n slider_depth.setMinimum(20);\n slider_depth.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_depthStateChanged(evt);\n }\n });\n\n check_showBounds.setSelected(true);\n check_showBounds.setText(\"Show Bounds\");\n check_showBounds.setToolTipText(\"Draw box around all volume data\");\n check_showBounds.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showBoundsActionPerformed(evt);\n }\n });\n\n slider_opacity.setMajorTickSpacing(1);\n slider_opacity.setMaximum(700);\n slider_opacity.setValue(5);\n slider_opacity.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n slider_opacityStateChanged(evt);\n }\n });\n\n jLabel5.setText(\"Opacity\");\n\n check_showLightbuffer.setSelected(true);\n check_showLightbuffer.setText(\"Show Lightbuffer\");\n check_showLightbuffer.setToolTipText(\"Display lighting calculations onscreen\");\n check_showLightbuffer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_showLightbufferActionPerformed(evt);\n }\n });\n\n check_multisample.setText(\"Multisample\");\n check_multisample.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n check_multisampleActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(slider_depth, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_width, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_height, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(check_showBounds)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_showLightbuffer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(check_multisample))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(slider_opacity, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n .addComponent(slider_slices, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(slider_width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(slider_height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(slider_depth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(check_showBounds)\n .addComponent(check_showLightbuffer)\n .addComponent(check_multisample))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(slider_slices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(slider_opacity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n }", "private void configure() {\n\t\tthis.pressedListener = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tstartDragX = me.getSceneX();\n\t\t\t\tstartDragY = me.getSceneY();\n\t\t\t\tstartNodeX = getTranslateX();\n\t\t\t\tstartNodeY = getTranslateY();\n\t\t\t\tstartWidth = getMaxWidth();\n\t\t\t\tstartHeight = getMaxHeight();\n\t\t\t}\n\t\t};\n\t\ttopDragger.setOnMousePressed(this.pressedListener);\n\t\tbottomDragger.setOnMousePressed(this.pressedListener);\n\t\tleftDragger.setOnMousePressed(this.pressedListener);\n\t\trightDragger.setOnMousePressed(this.pressedListener);\n\n\t\tsetTop(topDragger);\n\t\tsetBottom(bottomDragger);\n\t\tsetLeft(leftDragger);\n\t\tsetRight(rightDragger);\n\t\tsetCenter(center);\n\t\tbuildDragListeners();\n\t\tbuildResizeListeners();\n\t}", "protected Control createSpinnerControl(Composite parent) {\r\n \t\tcomposite = new Composite(parent, SWT.NONE);\r\n \t\tGridLayout gridLayout = new GridLayout();\r\n \t\tgridLayout.numColumns = 2;\r\n gridLayout.marginWidth = 0;\r\n gridLayout.marginHeight = 0;\r\n gridLayout.horizontalSpacing = HORIZONTAL_GAP;\r\n \t\tcomposite.setLayout(gridLayout);\r\n \t\tGridData gd;\r\n \t\tgd = new GridData(GridData.FILL_HORIZONTAL);\r\n \t\tcomposite.setLayoutData(gd);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create label\r\n \t\t */\r\n \t\tsliderLabel = new Label(composite,SWT.NONE);\r\n \t\tgd = new GridData(SWT.LEFT);\r\n \t\tsliderLabel.setLayoutData(gd);\r\n \t\tsliderLabel.setText(SLIDER_LABEL_DEFAULT_TEXT);\r\n \t\tPoint size = sliderLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r\n \t\tsliderLabel.setSize(size);\r\n \t\t\r\n \t\t/*\r\n \t\t * Create slider\r\n \t\t */\r\n \t\tslider = new Slider(composite, SWT.HORIZONTAL);\r\n \t\tgd = new GridData(SWT.RIGHT | GridData.FILL_HORIZONTAL);\r\n \t\tslider.setLayoutData(gd);\r\n \t\t\r\n \t\tslider.setMaximum(MAX_SLIDER_VALUE + slider.getThumb());\r\n \t\tslider.setMinimum(MIN_SLIDER_VALUE);\r\n \t\tslider.setIncrement(INCREMENT_SLIDER_VALUE);\r\n \r\n \t\t/*\r\n \t\t * Add listener to handle value change \r\n \t\t */\r\n \t\tselectionListener = new SelectionListener() {\r\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n \t\t\t\tvalueChanged();\r\n \t\t\t}\r\n \r\n \t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n \t\t\t\t// Do nothing\r\n \t\t\t}\r\n \t\t};\r\n \t\tslider.addSelectionListener(selectionListener);\r\n \t\ttry {\r\n \t\t\tintValue = Integer.parseInt(valueProvider.getStringValue(true).toString());\r\n\t\t} catch (Exception e) {\r\n \t\t\tintValue = DEFAULT_SLIDER_VALUE;\r\n \t\t}\r\n \t\t\r\n \t\t/*\r\n \t\t * Initialize slider presentation\r\n \t\t */\r\n \t\tslider.setSelection(intValue);\r\n \t\tString weightsString = \"\" + (intValue /10) + \"%\"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n \t\tslider.setToolTipText(weightsString);\r\n \t\tsliderLabel.setText(weightsString);\r\n \t\t\r\n \t\tslider.pack();\r\n \t\tsliderLabel.pack();\r\n \t\treturn composite;\r\n \t}", "public void afterMousePressed(){\n // ##1## reset color of component\n setFocusedColor();\n\n // ##2## reset indicator flag (give alternative value to the flag \"isExpanded\")\n if ( this.isExpaneded )\n this.isExpaneded = false;\n else\n this.isExpaneded = true;\n\n \n \n // ##3## if we need to hide this right part on the splitter\n if( !this.isExpaneded )\n {\n // ##3.1## if current size of right part is TOO Smaller\n // reset the width of containpanel to 300\n if ( this.containPanelWidth < 300 ) {\n this.containPanelWidth = 300;\n log.LoggingToFile.log(Level.INFO, \"width1 = \"+ this.containPanelWidth);\n } \n else if ( this.containPanelWidth < ( main_splitpane.getWidth() - main_splitpane.getDividerLocation() ) )\n {\n this.containPanelWidth = main_splitpane.getWidth() - main_splitpane.getDividerLocation();\n log.LoggingToFile.log(Level.INFO, \"width2 = \"+ this.containPanelWidth);\n } \n else if ( this.containPanelWidth > ( main_splitpane.getWidth() - main_splitpane.getDividerLocation() ) )\n {\n this.containPanelWidth = main_splitpane.getWidth() - main_splitpane.getDividerLocation();\n log.LoggingToFile.log(Level.INFO, \"width3 = \"+ this.containPanelWidth);\n }\n\n // ##3.2## hide the pane by set dividerlocation of split pane:\n // the number after \"this.PANELWIDTH\" is the width which we left for\n // the button and split pane control bar\n main_splitpane.setDividerLocation(\n (Integer)(main_splitpane.getWidth()) // total width\n ); // width of current left pane\n }\n // ##4## if we need to expand right part on the splitter\n else\n {\n \n int width = main_splitpane.getRightComponent().getWidth();\n if(this.diffPanel!=null){\n //diff_splitpane.setDividerLocation(0.5);\n //diff_splitpane.setDividerLocation((Integer)(width/2));\n //splitpane_diff.setDividerLocation(splitpane_diff.getWidth()/2);\n //\n }\n\n main_splitpane.setDividerLocation( main_splitpane.getWidth() - this.containPanelWidth );\n \n \n }\n }", "private void initializeTreePane() {\n Rectangle clipRect = new Rectangle(treePane.getWidth(), treePane.getHeight());\n clipRect.heightProperty().bind(treePane.heightProperty());\n clipRect.widthProperty().bind(treePane.widthProperty());\n treePane.setClip(clipRect);\n }", "private void setWheelBaseSliderSettings() {\n wheelBaseSlider.setValueFactory(new Callback<JFXSlider, StringBinding>() {\n @Override\n public StringBinding call(JFXSlider arg0) {\n return Bindings.createStringBinding(new java.util.concurrent.Callable<String>(){\n @Override\n public String call() {\n DecimalFormat df = new DecimalFormat(\"#.0\");\n return df.format(wheelBaseSlider.getValue());\n }\n }, wheelBaseSlider.valueProperty());\n }\n });\n }", "private void createScene() \n {\n PlatformImpl.startup(\n new Runnable() {\n public void run() { \n Group root = new Group(); \n Scene scene = new Scene(root, 80, 20); \n SizeView sizeview = createSizeView(scene);\n root.getChildren().add(sizeview);\n jfxPanel.setScene(scene); \n } \n }); \n }", "public Slider(double min, double max, double value) {\n setMax(max);\n setMin(min);\n setValue(value);\n //adjustValues();\n //initialize();\n }", "public VolumeLayoutPanel()\n {\n initComponents();\n }", "public void setup()\n{\n \n textAlign(CENTER);\n \n // create a new flock\n flock = new Flock(birdAmount);\n setDefaultFields();\n // GUI\n font = createFont(\"arial\", 14);\n \n cp5 = new ControlP5(this, font);\n \n \n Group settings = cp5.addGroup(\"settings\")\n .setPosition(10,15)\n .setBackgroundHeight(570)\n .setWidth(350)\n .setBarHeight(16)\n .setBackgroundColor(color(0,25))\n ;\n \n cp5.addSlider(\"separationDist\")\n .setPosition(10,10)\n .setSize(180,16)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"cohesionDist\")\n .setPosition(10,30)\n .setSize(180,16)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"alignDist\")\n .setPosition(10,50)\n .setSize(180,16)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"birdSize\")\n .setRange(0, 20)\n .setPosition(10,70)\n .setSize(180,16)\n .setGroup(settings)\n ;\n \n cp5.addToggle(\"wandering\")\n .setPosition(10,100)\n .setSize(50,20)\n .setGroup(settings)\n ;\n \n cp5.addToggle(\"separating\")\n .setPosition(10,150)\n .setSize(50,20)\n .setGroup(settings)\n ;\n \n cp5.addToggle(\"cohesing\")\n .setPosition(10,200)\n .setSize(50,20)\n .setGroup(settings)\n ;\n \n cp5.addToggle(\"aligning\")\n .setPosition(10,250)\n .setSize(50,20)\n .setGroup(settings)\n ;\n \n cp5.addToggle(\"noiseEnabled\")\n .setPosition(10,300)\n .setSize(50,20)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"wanderMult\")\n .setPosition(10,350)\n .setSize(180,16)\n .setRange(0,5)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"separationMult\")\n .setPosition(10,370)\n .setSize(180,16)\n .setRange(0,5)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"cohesionMult\")\n .setPosition(10,390)\n .setSize(180,16)\n .setRange(0,5)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"alignMult\")\n .setPosition(10,410)\n .setSize(180,16)\n .setRange(0,5)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"noiseMult\")\n .setPosition(10,430)\n .setSize(180,16)\n .setRange(0,5)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"maxSpeed\")\n .setPosition(10,460)\n .setSize(180,16)\n .setRange(0,10)\n .setGroup(settings)\n ;\n \n cp5.addSlider(\"maxForce\")\n .setPosition(10,480)\n .setSize(180,16)\n .setRange(0,3)\n .setGroup(settings)\n ;\n \n cp5.addBang(\"setDefaultFields\")\n .setLabel(\"Reset\")\n .setPosition(10,520)\n .setSize(50,20)\n .setGroup(settings)\n ;\n \n cp5.hide();\n welcomeTimer = 255;\n welcomeFading = false;\n}", "@FXML\n\tpublic void onInstrumentSliderChanged(MouseEvent e) {\n\t\t//Grab the affected slider\n\t\tSlider sliderChanged = (Slider) e.getSource();\n\n\t\t//The envelope's array index corresponding to the slider type\n\t\tint sliderIndex = -1;\n\n\t\t//Switch conditional for the slider's fxID\n\t\t//Sets the slider index value\n\t\tswitch(sliderChanged.getId()) {\n\t\t\tcase \"attackSlider\":\n\t\t\t\tsliderIndex = Instrument.ATTACK_VALUE;\n\t\t\t\tbreak;\n\t\t\tcase \"decaySlider\":\n\t\t\t\tsliderIndex = Instrument.DECAY_VALUE;\n\t\t\t\tbreak;\n\t\t\tcase \"sustainSlider\":\n\t\t\t\tsliderIndex = Instrument.SUSTAIN_VALUE;\n\t\t\t\tbreak;\n\t\t\tcase \"releaseSlider\":\n\t\t\t\tsliderIndex = Instrument.RELEASE_VALUE;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//Grab old/new slider values\n\t\tdouble oldValue = synth.getSelectedInstrument().getEnvelopeData()[sliderIndex],\n\t\t\t\tnewValue = sliderChanged.getValue();\n\n\t\t//Add the action if the values differ and the slider index is valid\n\t\tif(oldValue != newValue && sliderIndex != -1) {\n\t\t\ttry {\n\t\t\t\t//Add the action\n\t\t\t\tactionLog.AddAction(\n\t\t\t\t\t\toldValue,\n\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\tsliderChanged,\n\t\t\t\t\t\tsliderChanged.getClass().getMethod(\"setValue\", double.class),\n\t\t\t\t\t\tthis.getClass().getMethod(\"updateEnvelope\", double.class));\n\t\t\t} catch (NoSuchMethodException | SecurityException e1) {\n\t\t\t\tSystem.out.println(\"An unexpected error has occured.\");\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\n\t\t\tupdateEnvelope(0);\n\t\t}\n\t}", "private Pane createLayout() {\n root = new Pane();\n root.setPrefSize(Main.APP_W, Main.APP_H);\n\n // Logo\n ImageView logoView = new ImageView(new Image(\"res/snake.png\"));\n logoView.setFitHeight(500);\n logoView.setPreserveRatio(true);\n logoView.setLayoutX(40);\n logoView.setLayoutY(40);\n\n // Controls diagram\n ImageView controlsView = new ImageView(new Image(\"res/controls.png\"));\n controlsView.setFitHeight(100);\n controlsView.setPreserveRatio(true);\n controlsView.setLayoutX(350);\n controlsView.setLayoutY(40);\n\n // Control instructions\n Text keys = new Text(\"Use arrow keys to direct the snake \\nspacebar to pause / resume the game\");\n keys.setFont(Font.font(\"Calibri\", FontWeight.BOLD, 20));\n keys.setFill(Color.BLUE);\n keys.setLayoutX(470);\n keys.setLayoutY(90);\n\n // Play button image\n ImageView playView = new ImageView(new Image(\"res/play.png\"));\n playView.setFitHeight(150);\n playView.setPreserveRatio(true);\n playView.setLayoutX(320);\n playView.setLayoutY(170);\n\n // Click here instructions\n // Control instructions\n Text clickHere = new Text(\"Click to play\");\n clickHere.setFont(Font.font(\"Calibri\", FontWeight.BOLD, 20));\n clickHere.setFill(Color.BLUE);\n clickHere.setLayoutX(348);\n clickHere.setLayoutY(348);\n\n // Background\n ImageView backgroundView = new ImageView(Main.BACKGROUND_IMAGE);\n\n // Add elements to the root\n root.getChildren().setAll(backgroundView, logoView, controlsView, keys, playView, clickHere);\n\n return root;\n }", "public void changeScene(Pane pane){\n Platform.runLater(()->{\n dynamicPane.getChildren().clear();\n dynamicPane.getChildren().add(pane);\n });\n }", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\n pane.setBackground(\r\n //la clase Background crea un fondo para agregar al Pane\r\n new Background(\r\n //la clase BackgroundFill permiete crear un relleno \r\n new BackgroundFill( \r\n Color.rgb(//Color RGB con los valores iniciales de los slider\r\n (int)barra1.getValue(),\r\n (int)barra2.getValue(),\r\n (int)barra3.getValue()\r\n ), CornerRadii.EMPTY, Insets.EMPTY)));\r\n \r\n barra1.valueProperty().addListener(new ChangeListener<Number>() { \r\n @Override\r\n public void changed(ObservableValue<? extends Number> ov,\r\n Number old_val, Number new_val) { \r\n pane.setBackground(new Background(new BackgroundFill( \r\n Color.rgb(\r\n new_val.intValue(),\r\n (int)barra2.getValue(),\r\n (int)barra3.getValue()\r\n ), CornerRadii.EMPTY, Insets.EMPTY)));\r\n }\r\n });\r\n \r\n barra2.valueProperty().addListener(new ChangeListener<Number>() { \r\n @Override\r\n public void changed(ObservableValue<? extends Number> ov,\r\n Number old_val, Number new_val) { \r\n pane.setBackground(new Background(new BackgroundFill( \r\n Color.rgb( \r\n (int)barra1.getValue(),\r\n new_val.intValue(),\r\n (int)barra3.getValue()\r\n ), CornerRadii.EMPTY, Insets.EMPTY)));\r\n }\r\n });\r\n \r\n barra3.valueProperty().addListener(new ChangeListener<Number>() { \r\n @Override\r\n public void changed(ObservableValue<? extends Number> ov,\r\n Number old_val, Number new_val) { \r\n pane.setBackground(new Background(new BackgroundFill( \r\n Color.rgb( \r\n (int)barra1.getValue(),\r\n (int)barra2.getValue(),\r\n new_val.intValue()\r\n ), CornerRadii.EMPTY, Insets.EMPTY)));\r\n }\r\n });\r\n\r\n }", "public HBox initializeHBox() {\n\t\t// Container for the control buttons\n\t\tHBox controlButtons = new HBox();\n\t\tcontrolButtons.setPadding(new Insets(10.0, 0.0, 10.0, 10.0));\n controlButtons.setSpacing(80);\n\n // Container for the Play/Pause and Reset buttons\n HBox simulationStateButtons = new HBox();\n\t\tsimulationStateButtons.setSpacing(5);\n\n Button playButton = new Button(\"Play\");\n simulationStateButtons.getChildren().add(playButton);\n\n playButton.setOnAction((event) -> {\n this.play = !this.play;\n if (this.play) {\n playButton.setText(\"Pause\");\n } else {\n playButton.setText(\"Play\");\n }\n simulation.setPlayState(this.play);\n });\n\n Button resetButton = new Button(\"Reset\");\n simulationStateButtons.getChildren().add(resetButton);\n\n resetButton.setOnAction((event) -> {\n \tthis.settingsScene.setSettingsSet(true);\n });\n\n controlButtons.getChildren().add(simulationStateButtons);\n\n // Container for the probability of death and reproduction sliders\n\t\tHBox probabilitySliders = new HBox();\n\t\tprobabilitySliders.setSpacing(20);\n\n\t\t// Container for the probability of reproduction slider\n\t\tVBox probabilityOfReproductionSlider = new VBox();\n\n // probability of Reproduction\n Slider probabilityOfReproduction = new Slider(1, 100, 100);\n probabilityOfReproduction.setMinWidth(200);\n probabilityOfReproduction.setMaxWidth(200);\n\t\tprobabilityOfReproduction.setShowTickMarks(true);\n\t\tprobabilityOfReproductionSlider.getChildren().add(probabilityOfReproduction);\n\n\t\tLabel probabilityOfReproductionCurrentValue = new Label(\"probability of reproduction: \" + Double.toString(Math.round(probabilityOfReproduction.getValue())) + \"%\");\n\t\tprobabilityOfReproductionCurrentValue.setPadding(new Insets(0, 15, 0, 15));\n\t\tprobabilityOfReproductionSlider.getChildren().add(probabilityOfReproductionCurrentValue);\n\n\t\tprobabilityOfReproduction.setOnMouseDragged((event) -> {\n\t\t\tthis.probabilityOfReproductionValue = Math.round(probabilityOfReproduction.getValue());\n\t\t\tthis.simulation.setprobabilityOfReproduction(this.probabilityOfReproductionValue);\n\t\t\tprobabilityOfReproductionCurrentValue.setText(\"probability of reproduction \" + Double.toString(Math.round(probabilityOfReproduction.getValue())) + \"%\");\n\t\t});\n\n\t\tprobabilitySliders.getChildren().add(probabilityOfReproductionSlider);\n\n\t\t// Container for the probability of dying slider\n\t\tVBox probabilityOfDyingSlider = new VBox();\n\n\t\t// probability of dying in the event of under, or overpopulation\n Slider probabilityOfDying = new Slider(1, 100, 100);\n probabilityOfDying.setMinWidth(200);\n probabilityOfDying.setMaxWidth(200);\n probabilityOfDying.setShowTickMarks(true);\n probabilityOfDyingSlider.getChildren().add(probabilityOfDying);\n\n\t\tLabel probabilityOfDyingCurrentValue = new Label(\"probability of dying: \" + Double.toString(Math.round(probabilityOfDying.getValue())) + \"%\");\n\t\tprobabilityOfDyingCurrentValue.setPadding(new Insets(0, 35, 0, 35));\n\t\tprobabilityOfDyingSlider.getChildren().add(probabilityOfDyingCurrentValue);\n\n\t\tprobabilityOfDying.setOnMouseDragged((event) -> {\n\t\t\tthis.probabilityOfDyingValue = Math.round(probabilityOfDying.getValue());\n\t\t\tthis.simulation.setprobabilityOfDying(this.probabilityOfDyingValue);\n\t\t\tprobabilityOfDyingCurrentValue.setText(\"probability of dying: \" + Double.toString(Math.round(probabilityOfDying.getValue())) + \"%\");\n\t\t});\n\n\t\tprobabilitySliders.getChildren().add(probabilityOfDyingSlider);\n\t\tcontrolButtons.getChildren().add(probabilitySliders);\n\n this.countOfGenerations = new Label(\"Generation: \" + 0);\n controlButtons.getChildren().add(countOfGenerations);\n\t\t\n\t\treturn controlButtons;\n\t}", "public Slider(int width, int length, int location_x, int location_y, int orientation) {\r\n super(width, length, location_x, location_y, new JSlider(orientation));\r\n }", "@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 soundLabel = new javax.swing.JLabel();\n keybindings = new javax.swing.JButton();\n musicLabel = new javax.swing.JLabel();\n back = new javax.swing.JButton();\n musicSlider = new javax.swing.JSlider();\n soundSlider = new javax.swing.JSlider();\n\n jPanel1.setOpaque(false);\n\n soundLabel.setForeground(new java.awt.Color(255, 255, 255));\n soundLabel.setText(\"Soundeffects\");\n\n keybindings.setText(\"Keybindings\");\n\n musicLabel.setForeground(new java.awt.Color(255, 255, 255));\n musicLabel.setText(\"Music\");\n\n back.setText(\"back\");\n\n musicSlider.setOpaque(true);\n\n soundSlider.setOpaque(true);\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 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(musicLabel)\n .addComponent(soundLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(musicSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(soundSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(131, 131, 131)\n .addComponent(back))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(101, 101, 101)\n .addComponent(keybindings)))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(keybindings)\n .addGap(75, 75, 75)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(musicSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(musicLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(42, 42, 42)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(soundSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(soundLabel))\n .addGap(297, 297, 297)\n .addComponent(back))\n );\n\n add(jPanel1);\n }", "public void enableSliderBoxes() {\n indexSlider.setDisable(false);\n radiusSlider.setDisable(false);\n objectPositionSlider.setDisable(false);\n objectHeightSlider.setDisable(false);\n principleBox.setDisable(false);\n pickPicture.setDisable(false);\n }", "@Override\n\tpublic void setPane() {\n\t\tNewSchedulePane SchListPane = new NewSchedulePane();\n\t\trootPane = new HomePane(new MainLeftPane(),SchListPane);\n\t}", "@FXML\n void windSliderEvent() {\n \t\n \tint value = (int) windSlider.getValue();\n \twindText.setText(Integer.toString(value));\n \twindSpeed = value;\n }", "public void respawn() {\n\t\t\t\n\t\t\tslider.resize(100, 20);//resize and position image\n\t\t\tslider.setX(GamePlay.getMiddleX() - slider.getWidth()/2);//reset the x to the orignal position\n\t\t\tslider.setY(GamePlay.getScreenHeight() - 100);\n\t\t\t\n\t\t\tball.setX(slider.getX() + slider.getWidth()/2 - ball.getWidth()/2);//set the ball to the center of the slider\n\t\t\tball.setY(slider.getY()-ball.getHeight()-5);\n\t\t\t\n\t\t\tballVX=1;\n\t\t\tballVY=-1;//reset the velocity to a 45 degree angle up to the right\n\t\t\t\n\t\t\tdied=false;//no longer died.\n\t\t}", "public void setPositionSlider(float f) {\n\t\tjsSlider.setValue((int) f);\n\t\trepaint();\n\t}", "@Override\n public void onViewDragStateChanged(int n2) {\n if (SlidingPaneLayout.this.mDragHelper.getViewDragState() != 0) return;\n if (SlidingPaneLayout.this.mSlideOffset == 0.0f) {\n SlidingPaneLayout.this.updateObscuredViewsVisibility(SlidingPaneLayout.this.mSlideableView);\n SlidingPaneLayout.this.dispatchOnPanelClosed(SlidingPaneLayout.this.mSlideableView);\n SlidingPaneLayout.this.mPreservedOpenState = false;\n return;\n }\n SlidingPaneLayout.this.dispatchOnPanelOpened(SlidingPaneLayout.this.mSlideableView);\n SlidingPaneLayout.this.mPreservedOpenState = true;\n }", "private void mountTree() {\n if (tree != null) {\n treePane.getChildren().addAll(tree);\n }\n }", "void slideLeftRightWithHandle(int byPixels);", "private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n tempoSlider = new de.free_creations.guicomponents.TempoSlider();\n tempoSpinner = new de.free_creations.guicomponents.TempoSpinner();\n jLabel1 = new javax.swing.JLabel();\n castConductorPanel = new ConductorPanel();\n\n setLayout(new java.awt.BorderLayout());\n\n jPanel1.setPreferredSize(new java.awt.Dimension(483, 40));\n\n tempoSlider.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n tempoSliderStateChanged(evt);\n }\n });\n\n tempoSpinner.setMinimumSize(new java.awt.Dimension(100, 28));\n tempoSpinner.setPreferredSize(new java.awt.Dimension(100, 28));\n tempoSpinner.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n tempoSpinnerStateChanged(evt);\n }\n });\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ConductorTopComponent.class, \"ConductorTopComponent.jLabel1.text\")); // NOI18N\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(tempoSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(tempoSlider, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)\n .addGap(12, 12, 12))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(tempoSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(tempoSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 6, Short.MAX_VALUE))\n );\n\n add(jPanel1, java.awt.BorderLayout.SOUTH);\n\n castConductorPanel.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n castConductorPanelMouseClicked(evt);\n }\n });\n\n javax.swing.GroupLayout castConductorPanelLayout = new javax.swing.GroupLayout(castConductorPanel);\n castConductorPanel.setLayout(castConductorPanelLayout);\n castConductorPanelLayout.setHorizontalGroup(\n castConductorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 483, Short.MAX_VALUE)\n );\n castConductorPanelLayout.setVerticalGroup(\n castConductorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 260, Short.MAX_VALUE)\n );\n\n add(castConductorPanel, java.awt.BorderLayout.CENTER);\n }", "@Override\n public void run() {\n initFX(fxPanel);\n }", "private void armSliderMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_armSliderMouseDragged\n\n theta = armSlider.getValue(); //gets the value of the slider's value\n roboLogic.armSliderLogic(); //calls the arm slider logic function in the RobotLogic class\n\n }", "private void control()\r\n\t\t{\n\t\tspinMin.addChangeListener(createMinListener());\r\n\t\tspinMax.addChangeListener(createMaxListener());\r\n\t\t}", "void setAudioSliderPosition(double audio_position){\n audioSliderPosition.setValue(audio_position);\n }", "@Override\n public void onSlideChanged() {\n }", "public HandlePanel(Handle handle, ChangeListener listener) {\n\n this.handle = handle;\n\n //\n // Initialize components\n //\n this.setLayout(new BorderLayout());\n\n label.setText(\"Handle\");\n label.setLabelFor(slider);\n this.add(label);\n\n slider.setOrientation(SwingConstants.VERTICAL);\n slider.setMaximum(1);\n slider.setValue(1);\n this.add(slider, BorderLayout.CENTER);\n\n //\n // Binds view to model and vice versa\n //\n slider.addChangeListener(listener);\n handle.addPropertyChangeListener(this);\n modelToView(handle);\n }", "CameraServoMount(){\r\n\t\tpan_servo = new Servo(PAN_SERVO_PORT);\r\n\t\ttilt_servo = new Servo(TILT_SERVO_PORT);\r\n\t\tsetCameraPos(startupPos);\r\n\t\t\r\n\t}", "@Override\n void connectComponents() {\n //TODO\n this.leftContainer.getChildren().addAll(title, sizeBox, numMovesProtectionBox, durationBox,\n isHumanPlayer1Button, isHumanPlayer2Button, toggleSoundButton, saveButton, returnButton);\n this.centerContainer.getChildren().addAll(infoText);\n this.setLeft(leftContainer);\n this.setCenter(centerContainer);\n fillValues();\n }", "private void StageAdjustment() {\n addFoodPane.getChildren().addAll(fiberLabel, caloriesLabel, fatLabel, carbohydrateLabel,\n proteinLabel, name, nameLabel, fiber, calories, fat, carbohydrate, protein, confirm, cancel,\n id, idLabel);\n // create a new scene with the size 300x350 based on addFoodPane\n this.addFoodScene = new Scene(addFoodPane, 300, 350);\n this.setScene(addFoodScene);\n this.setTitle(\"Add Food\");// set the title of the stage\n this.setResizable(false);// fix the size of the stage\n // protects user from accidentally click other session\n this.initModality(Modality.APPLICATION_MODAL);\n }", "private void modelToView(Handle handle) {\n\n if (handle.isUp()) {\n slider.setValue(1);\n } else {\n slider.setValue(0);\n }\n }", "@Override\r\n\tprotected void pack() {\r\n\r\n\t\tRectangle displayarea = shell.getDisplay().getPrimaryMonitor().getBounds();\r\n\t\tRectangle windowarea = shell.getBounds();\r\n\t\tshell.setBounds((displayarea.width - windowarea.width) / 2,\r\n\t\t\t\t(displayarea.height - windowarea.height) / 2,\r\n\t\t\t\twindowarea.width, windowarea.height);\r\n\t}", "private void initRootLayout() {\n try {\n // Load root layout from fxml file.\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(MainApp.class.getResource(VIEW_ROOT_LAYOUT_FXML));\n rootLayout = loader.load();\n\n mApplicationCompositionRoot = new ApplicationCompositionRoot(this, rootLayout);\n\n //grab your root here\n rootLayout.setOnMousePressed(event -> {\n xOffset = event.getSceneX();\n yOffset = event.getSceneY();\n });\n\n //move around here\n rootLayout.setOnMouseDragged(event -> {\n mPrimaryStage.setX(event.getScreenX() - xOffset);\n mPrimaryStage.setY(event.getScreenY() - yOffset);\n });\n\n // Show the scene containing the root layout.\n Scene scene = new Scene(rootLayout);\n mPrimaryStage.setScene(scene);\n mPrimaryStage.show();\n\n //Give the controller access to the main app.\n RootLayout controller = loader.getController();\n controller.setMainApp(this);\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public GUIScaleView(final ControlPanelInterface parent)\n\t{\n\t\tsuper(\"Scale\", \"Modify the scaling\");\n\n\t\tfinal ChangeListener sliderChangeListener = new ChangeListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void stateChanged(final ChangeEvent e)\n\t\t\t{\n\t\t\t\tif (toggleUniformScaling)\n\t\t\t\t{\n\t\t\t\t\tfinal Object source = e.getSource();\n\t\t\t\t\tif (source instanceof JSlider)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal JSlider inputSlider = (JSlider)source;\n\t\t\t\t\t\tfinal int value = inputSlider.getValue();\n\n\t\t\t\t\t\tfor (final GUIBoundedSlider slider : sliders)\n\t\t\t\t\t\t\tslider.write(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tparent.update();\n\t\t\t}\n\t\t};\n\t\tfor (int i = 0; i < sliders.length; ++i)\n\t\t{\n\t\t\tsliders[i] = new GUIBoundedSlider(TITLES[i], 0, 200, 100, sliderChangeListener);\n\t\t\tsliders[i].setFeedbackDesign(1, \"%.0f%%\");\n\t add(sliders[i]);\n\t\t}\n\n\t\tfinal ActionListener checkboxActionListener = new ActionListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(final ActionEvent e)\n\t\t\t{\n\t\t\t\ttoggleUniformScaling = checkboxToggleUniformScaling.isSelected();\n\t\t\t}\n\t\t};\n\t\tcheckboxToggleUniformScaling.addActionListener(checkboxActionListener);\n\t\tadd(checkboxToggleUniformScaling);\n\t}", "private void updateGraph() {\n if (centerBox.getChildren().size() > 0) {\n graphPane = new Pane();\n graphPane.setPrefSize(500, 500);\n centerBox.getChildren().set(0, this.drawGraph());\n } else {\n graphPane = new Pane();\n graphPane.setPrefSize(500, 500);\n centerBox.getChildren().add(this.drawGraph());\n }\n }", "public void initModule(){\n SplitPane pane = new SplitPane();\n VBox module = (VBox) loader.getNamespace().get(\"vbox_grapher\");\n ScrollPane module_parent = (ScrollPane) loader.getNamespace().get(\"vbox_grapher_parent\");\n\n //bug solution (set resizable with parent):\n module_parent.setFitToHeight(true);\n module_parent.setFitToWidth(true);\n\n //clear(module);\n createGraphes(-1, module);\n }" ]
[ "0.6620579", "0.6459802", "0.63890624", "0.62705684", "0.60200006", "0.58442074", "0.58395976", "0.57896096", "0.57786644", "0.5752813", "0.5698313", "0.5666282", "0.56498635", "0.5596167", "0.55955327", "0.55833435", "0.5578919", "0.5570712", "0.5563887", "0.55479413", "0.5544455", "0.54810107", "0.54785615", "0.54747576", "0.54673535", "0.5434264", "0.53701967", "0.5327751", "0.5277525", "0.52721334", "0.52704346", "0.52466106", "0.52361715", "0.52354133", "0.51972854", "0.5196467", "0.5162406", "0.5161082", "0.5160123", "0.51316965", "0.5129933", "0.5116409", "0.5107151", "0.509933", "0.50970066", "0.50689304", "0.5067478", "0.5046465", "0.503979", "0.50275993", "0.5027363", "0.5000554", "0.4994037", "0.49789885", "0.4972956", "0.4971318", "0.49711955", "0.4963547", "0.4955722", "0.49523422", "0.49496418", "0.49488363", "0.49439308", "0.49117357", "0.49060187", "0.4905032", "0.48965383", "0.4894994", "0.4893908", "0.48920858", "0.48915362", "0.48911053", "0.48863965", "0.48863545", "0.48677802", "0.4866083", "0.48511168", "0.48460862", "0.4842864", "0.4836257", "0.4818368", "0.48159876", "0.4804583", "0.48021424", "0.48016417", "0.479877", "0.4798344", "0.47978225", "0.47937652", "0.47853774", "0.47847098", "0.4783491", "0.47781467", "0.4771288", "0.4767084", "0.47629076", "0.47615838", "0.4753849", "0.4750478", "0.4748312" ]
0.82988966
0
Return the trade price
public BigDecimal getPrice() { return price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Price getTradePrice();", "@Field(26) \n\tpublic double TradePrice() {\n\t\treturn this.io.getDoubleField(this, 26);\n\t}", "TickerPrice getPrice(String symbol);", "public double getBuyPrice() {\n return buyPrice;\n }", "public static int getPrice() {\n return PRICE_TO_BUY;\n }", "double getPrice();", "double getPrice();", "double getPrice();", "BigDecimal getPrice();", "public double tradeRate()\n\t{\n\t\treturn _dblTradeRate;\n\t}", "public double getPrice(){\n\t\t\n\t\treturn price;\n\t}", "public BigDecimal getTradeTotal() {\n return tradeTotal;\n }", "double purchasePrice();", "public double getPrice(){\n\t\t\treturn price;\n\t\t}", "public double getPrice() {\n return price_;\n }", "public double price() {\n return price;\n }", "public BigDecimal\tgetPrice();", "public double getPrice() {\n return price_;\n }", "public double getPrice(){\r\n\t\treturn price;\r\n\t}", "public BigDecimal getMarketPrice() {\n return marketPrice;\n }", "public BigDecimal getPrice() {\r\n return price;\r\n }", "public BigDecimal getPrice() {\r\n return price;\r\n }", "public double getPrice(){\n\t\treturn price;\n\t}", "public double getPrice()\n {\n \treturn price;\n }", "public BigDecimal getPrice()\n\t{\n\t\treturn price;\n\t}", "public int getSellPrice(){\n\t\treturn (int)(price * 0.6);\n\t}", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "String getTradeCurrency();", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public float getPrice() {\n\t\treturn this._entree.getPriceWithAddons() + this._side.getPrice() + this._drink.getPrice() - 1f;\n\t}", "public double getPrice() {\n double price = BASE_PRICE;\n for (Topping topping : toppings) {\n if (topping.isPremium()) {\n price += 1.25;\n } else {\n price += 0.75;\n }\n }\n return price;\n }", "public double getPrice(){\r\n\t\ttry {\r\n\t\t\treturn this.workerobj.getDouble(WorkerController.PRICE);\r\n\t\t} catch (JSONException e) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "public int calcMarketPrice() {\r\n player = Context.getInstance().getPlayer();\r\n //Random r = new Random();\r\n int techLevel = player.getCurrentPlanet().getTechLevel();\r\n Event event = player.getCurrentPlanet().getEvent();\r\n Resource resource = player.getCurrentPlanet().getResource();\r\n double price = basePrice;\r\n price += (ipl * (techLevel - mtlb)) + variance;\r\n if (player.getCurrentPlanet().getTechLevel() == this.ttp) {\r\n price *= Context.TECH_PRICE_MULT;\r\n }\r\n if (event.equals(this.ie)) {\r\n price *= event.getUpMult();\r\n } else if (event.equals(this.de)) {\r\n price *= event.getDownMult();\r\n }\r\n if (resource.equals(this.cr)) {\r\n price *= resource.getDownMult();\r\n } else if (resource.equals(this.er)) {\r\n price *= resource.getUpMult();\r\n }\r\n price *= (((double) player.getTrader() / DFIFTY) + 1.0);\r\n int finalPrice = (int) price;\r\n if (player.getTrader() > 0) {\r\n double discountedPrice = price;\r\n double trader = (double) player.getTrader();\r\n discountedPrice -= (price) * (4.0 * trader / PERCENT);\r\n return (int) discountedPrice;\r\n } else {\r\n return finalPrice;\r\n }\r\n }", "public double getPrice() {\n return price;\n }", "public double getPrice(){\n\t\treturn this.price;\n\t}", "public double price(){\n if (basePrice() >1000){\n return basePrice() *0.95;\n }else\n return basePrice() * 0.98;\n }", "public double getPrice();", "public Double getPrice();", "public BigDecimal getPriceActual();", "long getPrice();", "double calculatePrice();", "public Float getPrice() {\r\n return price;\r\n }", "BigDecimal getOpenPrice();", "public Double getPrice() {\r\n return price;\r\n }", "public Double getPrice() {\r\n\t\treturn price;\r\n\t}", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "org.adscale.format.opertb.AmountMessage.Amount getExchangeprice();", "public Float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "protected float getPrice() {\n\t\t\treturn price;\n\t\t}", "public double getPrice()\r\n {\r\n return price;\r\n }", "public Money getPrice() {\n\t\treturn price;\n\t}", "public Double getPrice() {\n return price;\n }", "public Double getPrice() {\n return price;\n }", "@Override\n\tpublic double getPrice() {\n\t\t\n\t\treturn 2000;\n\t}", "public double calculatePrice(){\r\n\t\treturn getBasePrice()+getBasePrice()*getVat()+(getBasePrice()+getBasePrice()*getVat())*0.3;\r\n\t}", "@Override\r\n\tpublic double getPrice() {\n\t\treturn price;\r\n\t}", "public double getPrice() {\n\t\treturn this.price;\n\t\t\n\t}", "public double getPrice()\n\t{\n\t\treturn this.price;\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "BigDecimal getClosePrice();", "public java.math.BigDecimal getPrice() {\n return price;\n }", "public Double getPrice() {\n\t\treturn price;\n\t}", "public String getBuyprice() {\n return buyprice;\n }", "public double getPrice() {\n\t\t\treturn price;\n\t\t}", "public double getPrice() {\n return this.price;\n }", "public float getPrice() {\n return _price;\n }", "public double getPrice() {\n\t\treturn this.price;\n\t}", "public double getPrice()\n {\n return price;\n }", "public double getPrice()\n {\n return this.price;\n }", "public long getPrice() {\n return price;\n }", "public double getPrice()\r\n {\r\n return this.price;\r\n }", "@Override\n public double getPrice(){\n \n return currentPrice; \n }" ]
[ "0.88450676", "0.790492", "0.7516808", "0.74722284", "0.74597454", "0.7417922", "0.7417922", "0.7417922", "0.7379568", "0.73563653", "0.72945", "0.7285025", "0.7282232", "0.7280733", "0.72803754", "0.7278834", "0.72637856", "0.7250905", "0.725046", "0.72452146", "0.7216305", "0.7216305", "0.721264", "0.72017676", "0.7194779", "0.7182282", "0.7181187", "0.7181187", "0.71752983", "0.7171696", "0.7171696", "0.7171696", "0.7171696", "0.7159623", "0.7153971", "0.7149618", "0.7143111", "0.7142182", "0.713883", "0.7135203", "0.7134368", "0.71337366", "0.71320224", "0.71272933", "0.7126656", "0.7126234", "0.71167344", "0.7115429", "0.71145403", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7112905", "0.7110433", "0.71048814", "0.7102388", "0.7102388", "0.7102388", "0.7100423", "0.7100423", "0.7100423", "0.7100423", "0.7100423", "0.7099078", "0.7095419", "0.7094889", "0.70796144", "0.70796144", "0.7068629", "0.7066863", "0.7057704", "0.7057419", "0.7056568", "0.7053405", "0.7053405", "0.7053405", "0.70530456", "0.70518863", "0.7049227", "0.7048312", "0.70284873", "0.70233345", "0.702189", "0.7010325", "0.7001145", "0.69972014", "0.69839966", "0.6981013", "0.6979047" ]
0.7174617
30
Return the trade amount.
public BigDecimal getAmount() { return amount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BigDecimal getTradeTotal() {\n return tradeTotal;\n }", "public int getTradeValue() {\n \t\treturn tradeValue;\n \t}", "public double getDepositAmount()\n\t{\n\t\treturn this.getFlightCosts() + this.totalPrice * this.half;\n\t}", "public Double getTotalBuyMoney() {\r\n return totalBuyMoney;\r\n }", "public int getMoney() {\n return wallet.getMoney();\n }", "public double tradeRate()\n\t{\n\t\treturn _dblTradeRate;\n\t}", "Price getTradePrice();", "@Field(26) \n\tpublic double TradePrice() {\n\t\treturn this.io.getDoubleField(this, 26);\n\t}", "public double getAmount() \r\n {\r\n assert(true);\r\n return amount;\r\n }", "public String getAmountCredited() {\n\t\twaitForControl(driver, LiveGuru99.WithdrawallPage.GET_AMOUNT_DEPOSIT, timeWait);\n\t\tString amount = getText(driver, LiveGuru99.WithdrawallPage.GET_AMOUNT_DEPOSIT);\n\t\treturn amount;\n\t}", "public String getCurrentAmount() {\n\t\twaitForControl(driver, LiveGuru99.WithdrawallPage.GET_CURRENT_AMOUNT, timeWait);\n\t\tString currentAmount = getText(driver, LiveGuru99.WithdrawallPage.GET_CURRENT_AMOUNT);\n\t\treturn currentAmount;\n\t}", "public static int getAmount() {\n\t\treturn amount;\n\t}", "public float getAmount() {\n System.out.println(\"Account Balance:\" + amount);\n return amount;\n }", "public Double getTotalBuyFee() {\r\n return totalBuyFee;\r\n }", "long getAmount();", "public long getAmount() {\r\n return amount;\r\n }", "public long getAmount() {\n\t\treturn amount;\n\t}", "public io.lightcone.data.types.Amount getAmount() {\n return amount_ == null ? io.lightcone.data.types.Amount.getDefaultInstance() : amount_;\n }", "Money getCashSettlementAmount();", "float getAmount();", "public long getAmount() {\n return amount;\n }", "public int getAmount()\n {\n return this.transactionValue;\n }", "public int getAmountBought() {\n //System.out.println(clientName + \" has bought \" + amountBought + \" shares of \" + companyName);\n return amountBought;\n }", "public long getAmount();", "public long getAmount();", "public Trade getTrade()\n\t{\n\t\treturn m_trade;\n\t}", "public int amount() {\n return amount;\n }", "public double getAmount() {\r\n\t\treturn amount;\r\n\t}", "public double getAmount() {\r\n\t\treturn amount;\r\n\t}", "public double getAmount() {\r\n\t\treturn investmentAmount;\r\n\t}", "public double getAmount() {\n\t\treturn amount;\n\t}", "public double getAmount() {\n\t\treturn amount;\n\t}", "public double getAmount() {\n\t\treturn amount;\n\t}", "public double getAmount () {\r\n\t\treturn amount;\r\n\t}", "public double getMarketValue()\n {\n return this.totalShares * super.getCurrentPrice();\n }", "public java.math.BigDecimal getTransactionAmount() {\r\n return transactionAmount;\r\n }", "@Override\n\tpublic long getAmount() {\n\t\treturn amount;\n\t}", "String getTradeCurrency();", "public Double getTotalBuyNum() {\r\n return totalBuyNum;\r\n }", "public BigDecimal getTotalTransactrateMoney() {\n return totalTransactrateMoney;\n }", "public double getAmount() {\n return this.amount;\n }", "public io.lightcone.data.types.Amount getAmount() {\n if (amountBuilder_ == null) {\n return amount_ == null ? io.lightcone.data.types.Amount.getDefaultInstance() : amount_;\n } else {\n return amountBuilder_.getMessage();\n }\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public int getAmount() {\n return amount_;\n }", "@java.lang.Override\n public long getAmount() {\n return amount_;\n }", "public java.lang.Long getAmount () {\r\n\t\treturn amount;\r\n\t}", "public Float getAmount() {\n\t\treturn amount;\n\t}", "@Override\r\n\tpublic Trade getTrade() {\n\t\treturn trade;\r\n\t}", "public static int getPrice() {\n return PRICE_TO_BUY;\n }", "public double getPaymentAmount() {\n\t\tdouble amount = 0.0;\n\t\tString content = \"\";\n\t\t\n\t\tWebElement temp = (new WebDriverWait(driver, waitTime))\n\t\t\t\t.until(ExpectedConditions.presenceOfElementLocated(By.id(\"totalAmt\")));\t\t\n\t\tcontent = temp.findElement(By.xpath(\"span[2]\")).getAttribute(\"innerHTML\");\n\t\tamount = Double.parseDouble(content);\n\t\treturn amount;\n\t}", "ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount getAmount();", "public int getAmount() {\n return amount_;\n }", "public double dollarTorp()\r\n\t{\r\n\t\treturn getAmount() * 14251.25;\r\n\t}", "public double getAmount() {\n return amount;\n }", "public BigDecimal getAmount() \r\n {\t\r\n \treturn amount;\t\r\n }", "public Integer getTradePaying() {\n return tradePaying;\n }", "public long getMoney() {\n return money;\n }", "BigDecimal getAmount();", "public java.math.BigDecimal getAmount () {\r\n\t\treturn amount;\r\n\t}", "public java.math.BigDecimal getAmount() {\n return amount;\n }", "public Double getAmount() {\r\n return amount;\r\n }", "double getMoney();", "public int getMoney() {\n\t\treturn currentMoney.getAmount();\n\t}", "public BigDecimal getTransAmt() {\n return transAmt;\n }", "@java.lang.Override\n public long getAmount() {\n return instance.getAmount();\n }", "int getAmount();", "public String getLocalCurrencyAmount() {\n return sendLocalCurrencyAmount;\n }", "public BigDecimal getAmount() {\r\n return amount;\r\n }", "public BigDecimal getAmount()\n {\n return amount;\n }", "public int getMoney() {\n return money_;\n }", "public BigDecimal getAmount() {\n return this.amount;\n }", "public BigDecimal getArtificialWithdrawMoney() {\n return artificialWithdrawMoney;\n }", "public Long getAmount() {\n return amount;\n }", "public Long getAmount() {\n return amount;\n }", "public Long getAmount() {\n return amount;\n }", "public Long getAmount() {\n return amount;\n }", "public ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount getAmount()\n {\n synchronized (monitor())\n {\n check_orphaned();\n ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount target = null;\n target = (ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount)get_store().find_element_user(AMOUNT$6, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public double getMoney() {\n return money_;\n }", "public BigDecimal getWithdrawMoney() {\n return withdrawMoney;\n }", "public double getMoney() {\n\t\treturn totalMoney;\n\t}", "public BigDecimal getAMOUNT() {\r\n return AMOUNT;\r\n }", "public double getMoney() { //Not useful for the project but used on the test.\n\t\treturn money;\n\t}", "public int getMoney() {\n return money_;\n }", "public double getMoney() {\n return money_;\n }", "public int getMoney() {\r\n\t\treturn money;\r\n\t}", "public int getMoney() {\r\n\t\treturn money;\r\n\t}", "public int getMoney() {\n\t\tint money = super.getMoney();\n\t\treturn money;\n\t}" ]
[ "0.75257635", "0.730285", "0.6966845", "0.69192314", "0.6882328", "0.6881878", "0.68226755", "0.68053883", "0.67649233", "0.67506933", "0.67226547", "0.66950446", "0.66666675", "0.6629405", "0.6624925", "0.6607314", "0.6606099", "0.65890276", "0.65796447", "0.6570975", "0.6565292", "0.65510154", "0.6547331", "0.6529636", "0.6529636", "0.6528268", "0.649569", "0.64920527", "0.64920527", "0.64650893", "0.64573807", "0.64573807", "0.64573807", "0.6456477", "0.6455592", "0.6430771", "0.64279795", "0.6421928", "0.6389777", "0.63856953", "0.63846713", "0.6379691", "0.63776404", "0.63776404", "0.63776404", "0.63776404", "0.63776404", "0.63776404", "0.63776404", "0.6370673", "0.63683575", "0.63682145", "0.6368111", "0.63679594", "0.63678026", "0.636307", "0.6353586", "0.63521606", "0.6350797", "0.6350209", "0.63407797", "0.63344854", "0.6330668", "0.6330245", "0.6323981", "0.63230336", "0.63074446", "0.6288438", "0.6282268", "0.6281003", "0.6273351", "0.6262794", "0.62625283", "0.62620866", "0.6257814", "0.62407476", "0.6239276", "0.6237072", "0.6236699", "0.6236699", "0.6236699", "0.6236699", "0.623551", "0.6225744", "0.62249863", "0.622248", "0.62197673", "0.62166554", "0.62143546", "0.62128794", "0.6208283", "0.6208283", "0.6195168" ]
0.6214783
95
Return the trade id.
public BigDecimal getId() { return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Long getTradeId() {\n return tradeId;\n }", "public String getTradeId() {\n\t\treturn this.tradeId;\n\t}", "public String getTradeNo() {\n\t\treturn tradeNo;\n\t}", "public long id() {\n\t\treturn message.getBaseMarketId();\n\t}", "public java.lang.Long getInternalTradeId() {\n return internalTradeId;\n }", "java.lang.String getTxId();", "String getTransactionID();", "String getMarketId();", "long getTxid();", "public String getTradeCode() {\n return tradeCode;\n }", "public String getTradeCode() {\n return tradeCode;\n }", "long getTruckId();", "public Long getTraderId() {\n\t\treturn traderId;\n\t}", "public List<ObjectIdentifier> getTradeIds() {\n return _tradeIds;\n }", "public Identifier getTradeProviderKey() {\n return _tradeProviderKey;\n }", "public int getId() {\n return txId;\n }", "public long getTransactionid() {\n return transactionid;\n }", "public int getTradeValue() {\n \t\treturn tradeValue;\n \t}", "UUID getTransmissionId();", "public EI getPayerTrackingID() { \r\n\t\tEI retVal = this.getTypedField(5, 0);\r\n\t\treturn retVal;\r\n }", "public long getId() {\n\t\treturn _tempNoTiceShipMessage.getId();\n\t}", "@Override\n\tpublic long getId() {\n\t\treturn _buySellProducts.getId();\n\t}", "public java.lang.String getTxId() {\n java.lang.Object ref = txId_;\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 txId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public long getTransactionID() {\r\n return transactionID;\r\n }", "public void setTradeId(Long tradeId) {\n this.tradeId = tradeId;\n }", "public long getTraceId() {\n\t\treturn this.traceInformation.getTraceId();\n\t}", "public java.lang.String getTxId() {\n java.lang.Object ref = txId_;\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 txId_ = s;\n return s;\n }\n }", "public Integer getQuoteId() {\n\t\treturn quoteId;\n\t}", "int getTruckid();", "int getTruckid();", "int getTruckid();", "int getTruckid();", "int getTruckid();", "int getTruckid();", "public synchronized int getStockId() {\n\t\treturn stockId;\n\t}", "public String getMarketId() {\n\t\treturn marketId;\n\t}", "public String getTicketId() {\n String ticketId = getParameter(CosmoDavConstants.PARAM_TICKET);\n if (ticketId == null) {\n ticketId = getHeader(CosmoDavConstants.HEADER_TICKET);\n }\n return ticketId;\n }", "public String getMarketId() {\n return marketId;\n }", "public int getTransactionID() {\r\n return transactionID;\r\n }", "public String getTradeOrder() {\n\t\treturn tradeOrder;\n\t}", "public int getCurrentBuyID(){\n return currentBuyID;\n }", "public String getID(){\n return this.getKey().getTenantId(this.getTenantName());\n }", "public Short getTradeSeq() {\n\t\treturn tradeSeq;\n\t}", "Trade getTrade(String tradeId) throws OrderBookTradeException;", "public Integer getTradeTime() {\n return tradeTime;\n }", "public String getwPrTradeNo() {\n return wPrTradeNo;\n }", "String getTheirPartyId();", "public Integer\t\tgetOrderID();", "public Trade getTrade()\n\t{\n\t\treturn m_trade;\n\t}", "@Override\r\n\tpublic Trade getTrade() {\n\t\treturn trade;\r\n\t}", "String getReceiptId();", "TradeItem getTradeItem(long id);", "public String getTraceId() {\n return traceId;\n }", "public int geti_ordertrx_temp_ID();", "long getPlayerId();", "@Override\r\n\tpublic String getId() {\n\t\treturn mWarehouseId;\r\n\t}", "public String getOrderID() {\n\t\treturn this.token.get(\"orderID\").toString();\n\t}", "public String getTransactionID() {\n\t return this.transactionID;\n\t}", "public static String getTransId() {\n\n return MDC.get(MDC_KEY_REQUEST_ID);\n }", "public long getTradeDate() {\n return tradeDate_;\n }", "int getSendid();", "public String getTransId() {\n\t\treturn transId;\n\t}", "public long getTransactionId();", "public long getTradeDate() {\n return tradeDate_;\n }", "public String getTraderEmployeeId() {\n return traderEmployeeId;\n }", "public java.lang.String getTRADE() {\n return TRADE;\n }", "public static String id()\n {\n return _id;\n }", "public String getTransLogId() {\n return transLogId;\n }", "UUID getTransactionId();", "public int getId() {\n//\t\tif (!this.isCard())\n//\t\t\treturn 0;\n\t\treturn id;\n\t}", "int getMoneyID();", "int getMoneyID();", "int getMoneyID();", "public int getC_BPartnerCashTrx_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_BPartnerCashTrx_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public java.lang.Long getTradeType () {\r\n\t\treturn tradeType;\r\n\t}", "public String getCartId()\n\t{\n\t\treturn getCartId( getSession().getSessionContext() );\n\t}", "public String getId() {\n\t\treturn this.token.get(\"id\").toString();\n\t}", "public String getTransID()\n\t{\n\t\tif(response.containsKey(\"RRNO\")) {\n\t\t\treturn response.get(\"RRNO\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "com.google.protobuf.ByteString\n getTxIdBytes();", "public java.lang.String getTramiteId() {\n return tramiteId;\n }", "public java.lang.String getTxid() {\n java.lang.Object ref = txid_;\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 txid_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getAD_OrgTrx_ID() {\n\t\tInteger ii = (Integer) get_Value(\"AD_OrgTrx_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public String getServerTransId() {\n\t\treturn serverTransId;\n\t}", "public java.lang.Object getQuoteID() {\n return quoteID;\n }", "public String getBankTradeNo() {\n\t\treturn bankTradeNo;\n\t}", "public String getClientTransId() {\n\t\treturn clientTransId;\n\t}", "public long getMemberId() {\n return _sTransaction.getMemberId();\n }", "public String getTraderEmailId() {\n return traderEmailId;\n }", "long getTradeDate();", "java.lang.String getPlayerId();", "public Integer getTradePaying() {\n return tradePaying;\n }", "String getTransactionId();", "String getTransactionId();", "public String getId() {\n\t\treturn this.playerid;\n\t}", "private String generatePurchaseId() {\n\t\tint purchaseId = purchaseIdCounter.incrementAndGet();\n\t\treturn Integer.toString(purchaseId);\n\t}", "public String getMarketTradeTransactionInstanceReference() {\n return marketTradeTransactionInstanceReference;\n }", "public int getTraceID(){\r\n\t\treturn this.traceID;\r\n\t}", "public Integer getStorekeeperid() {\n return storekeeperid;\n }", "public int getId() {\n return orderID;\n }", "long getSteamID();", "public int obtId() {\r\n\t\treturn id;\r\n\t}" ]
[ "0.81206524", "0.8034848", "0.7211089", "0.71210355", "0.6815663", "0.6814581", "0.67674494", "0.6662002", "0.6655534", "0.6628759", "0.6586141", "0.647857", "0.6458992", "0.6339173", "0.629731", "0.6238321", "0.6205278", "0.6197215", "0.61952317", "0.61850446", "0.6172611", "0.6166687", "0.6157607", "0.6146304", "0.6140134", "0.612149", "0.6118255", "0.6095919", "0.60636973", "0.60636973", "0.60636973", "0.60636973", "0.60636973", "0.60636973", "0.60591686", "0.6052743", "0.6048828", "0.602986", "0.6024264", "0.6015561", "0.5998235", "0.5996138", "0.5985427", "0.5967278", "0.59669465", "0.59607506", "0.59387106", "0.5938193", "0.59352773", "0.59283996", "0.59150356", "0.59130335", "0.58634835", "0.5863321", "0.5847841", "0.5835757", "0.58330905", "0.58327943", "0.5815553", "0.58112884", "0.5805547", "0.5796815", "0.57960194", "0.5790448", "0.5766072", "0.5764916", "0.5760659", "0.57601", "0.5757702", "0.5753508", "0.57473916", "0.57473916", "0.57473916", "0.5732938", "0.57219255", "0.57151645", "0.5708661", "0.56905895", "0.56864154", "0.5677308", "0.56771106", "0.56768835", "0.5676283", "0.5670518", "0.566959", "0.5654204", "0.56481975", "0.56387806", "0.56386846", "0.5634698", "0.56341577", "0.5631926", "0.5631926", "0.5624298", "0.56185216", "0.5617472", "0.56167614", "0.5614287", "0.5614275", "0.56131214", "0.5611065" ]
0.0
-1
Returns true if the attribute "for" is set.
public final boolean isForSetted() { return engine.isPropertySetted(Properties.FOR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasSetAttribute();", "public final boolean hasAttribute ()\r\n {\r\n return _value.hasAttribute();\r\n }", "boolean isAttribute();", "boolean hasAttributes();", "boolean hasAttributes();", "public boolean isSetAttrs() {\n return this.attrs != null;\n }", "public boolean isSetLoop()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(LOOP$16) != null;\n }\n }", "boolean hasAttribute(String name);", "@Override\r\n\t\tpublic boolean hasAttribute(String name)\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}", "public boolean isAttribute() {\n\t\treturn false;\n\t}", "public boolean hasAttribute(String name) {\n // if attribute() returns a value, then this jode has that attribute\n return attribute(name, true) != null;\n }", "public boolean hasSetAttribute() {\n return ((bitField0_ & 0x08000000) == 0x08000000);\n }", "public boolean hasSetAttribute() {\n return ((bitField0_ & 0x08000000) == 0x08000000);\n }", "@Override\n public boolean isAttribute()\n {\n return attribute;\n }", "public boolean containAttribute(String name);", "protected boolean hasAttribute(String name) {\n\tfor (int i = 0; i < this.attributeFields.size(); i++) {\n\t AttributeField af = \n\t\t(AttributeField) this.attributeFields.elementAt(i);\n\t if (af.getAttribute().getName().equals(name))\n\t\treturn true;\n\t}\n\treturn false;\n }", "@Override\r\n\t\tpublic boolean hasAttributes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}", "public boolean getLoop()\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(LOOP$16);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(LOOP$16);\n }\n if (target == null)\n {\n return false;\n }\n return target.getBooleanValue();\n }\n }", "public boolean hasAttribute(String name)\n/* */ {\n/* 1234 */ return findAttribute(name) != null;\n/* */ }", "@Kroll.getProperty @Kroll.method\n\tpublic boolean getSpecified() {\n\t\tif (attr.getOwnerElement() == null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn attr.getSpecified();\n\t}", "@java.lang.Override\n public boolean hasAttributes() {\n return attributes_ != null;\n }", "boolean isSetTag();", "public boolean isSetTag() {\n return this.tag != null;\n }", "boolean isAttribute(Object object);", "public boolean isSpecified(int index)\n {\n return ((Attribute) attributesList.get(index)).specified;\n }", "public boolean hasDynamicAttributes();", "public boolean hasAttributes() {\n return attributesBuilder_ != null || attributes_ != null;\n }", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(NAME$2) != null;\r\n }\r\n }", "public boolean isSetKeff() {\r\n return isSetAttribute(MEConstants.keff);\r\n }", "public boolean isSetValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(VALUE$12) != null;\n }\n }", "public boolean isSet(String name) {\n\t\treturn paramElem.getElementsByTagName(name).getLength() > 0;\n\t}", "private boolean isAttributeDefined(String attrName)\n {\n return getAttributes().get(attrName) != null;\n }", "public boolean isUnset() {\n boolean isUnset = false;\n for (ASTNode child : this.getNode().getChildren(TokenSet.create(AsciiDocTokenTypes.ATTRIBUTE_UNSET))) {\n ASTNode treePrev = child.getTreePrev();\n if (treePrev != null && treePrev.getElementType() == AsciiDocTokenTypes.ATTRIBUTE_NAME_START) {\n isUnset = true;\n break;\n }\n ASTNode treeNext = child.getTreeNext();\n if (treeNext != null && treeNext.getElementType() == AsciiDocTokenTypes.ATTRIBUTE_NAME_END) {\n isUnset = true;\n break;\n }\n }\n return isUnset;\n }", "public boolean isSetName() {\n\t\treturn this.name != null;\n\t}", "public boolean isSetTraverse_spec() {\n return this.traverse_spec != null;\n }", "public boolean definesTargetAttribute(String name);", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\r\n return this.name != null;\r\n }", "@Override\n\tpublic boolean hasValue(Attribute attribute) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isMissing(final Attribute att) {\n\t\treturn false;\n\t}", "public boolean isSet() {\n\t\treturn false;\n\t}", "public boolean isSetValue() {\n return this.value != null;\n }", "public boolean isSetValue() {\n return this.value != null;\n }", "public boolean isSetAutoForwardToName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(AUTOFORWARDTONAME$12) != 0;\n }\n }", "public boolean isSetDesc()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(DESC$10) != null;\r\n }\r\n }", "public boolean isSetName() {\n return this.Name != null;\n }", "public boolean definesTargetAttribute(int idx);", "public boolean hasValue() throws SdpParseException {\n\t\tNameValue nameValue = getAttribute();\n\t\tif (nameValue == null)\n\t\t\treturn false;\n\t\telse {\n\t\t\tObject value = nameValue.getValue();\n\t\t\tif (value == null)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t}", "public boolean isSetLengthDependent() {\r\n return isSetAttribute(MEConstants.lengthDependent);\r\n }", "public boolean isSetFromName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FROMNAME$4) != 0;\n }\n }", "public boolean isAttributeDefined(String attrName) {\n Assert.notNull(attrName, \"attrName\");\n return (attrNST.getRowCount(\"name EQ '\" + attrName.toLowerCase() + \"'\") > 0);\n }", "public final boolean isDisabled() {\n return isAttributeDefined(\"disabled\");\n }", "@Override\n public final boolean hasForfeitAttribute() {\n return true;\n }", "boolean hasSetProperty();", "protected abstract boolean populateAttributes();", "public boolean isSetEnumSkillName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ENUMSKILLNAME$8) != null;\n }\n }", "public boolean isTaxonomyAttribute(String name) {\n\t\tif (taxoMap != null) {\n\t\t\treturn taxoMap.containsKey(name);\n\t\t}\n\t\treturn false;\n\t}", "private static boolean isAttributeAvailable(Element element, String attrName) {\n \t\tModelQuery modelQuery = ModelQueryUtil.getModelQuery(element\n \t\t\t\t.getOwnerDocument());\n \t\tif (modelQuery != null) {\n \t\t\tCMElementDeclaration decl = modelQuery\n \t\t\t\t\t.getCMElementDeclaration(element);\n \t\t\tif (decl != null) {\n \t\t\t\tCMNamedNodeMap map = decl.getAttributes();\n \t\t\t\tif ((CMAttributeDeclaration) map.getNamedItem(attrName) != null) {\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn false;\n \t}", "public boolean isSetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$24) != null;\n }\n }", "boolean hasStoreAttribute();", "public boolean containsAttribute(String key) {\n return attributes.containsKey(key);\n }", "public boolean isSetRFSequenceDesc() {\n return (this.rfSequenceDesc != null ? this.rfSequenceDesc.isSetValue() : false);\n }", "@Override\n public boolean isWithForOn() {\n return true;\n }", "public boolean isSetWidth()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(WIDTH$20) != null;\n }\n }", "public boolean isSetPage() {\n return __isset_bit_vector.get(__PAGE_ISSET_ID);\n }", "public boolean isDnAttributes()\n {\n return dnAttributes;\n }", "public boolean isSetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$12) != null;\n }\n }", "public boolean isSetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$12) != null;\n }\n }", "public boolean isSetSpecMap() {\n return this.specMap != null;\n }", "@Override\n public boolean isDefined()\n {\n return getValue() != null || getChildrenCount() > 0\n || getAttributeCount() > 0;\n }", "public static boolean forElement(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"forElement\")) return false;\n if (!nextTokenIs(b, \"<for element>\", AWAIT, FOR)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, FOR_ELEMENT, \"<for element>\");\n r = forElement_0(b, l + 1);\n r = r && consumeTokens(b, 1, FOR, LPAREN);\n p = r; // pin = 2\n r = r && report_error_(b, forLoopParts(b, l + 1));\n r = p && report_error_(b, consumeToken(b, RPAREN)) && r;\n r = p && element(b, l + 1) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "public boolean isSetBase()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(BASE$18) != null;\r\n }\r\n }", "public boolean isSetMaterialName() {\n return this.materialName != null;\n }", "public boolean isSetStartIndex()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(STARTINDEX$10) != null;\n }\n }", "public boolean isSetPoster_path() {\n return this.poster_path != null;\n }", "public boolean isSetPageNo() {\n return EncodingUtils.testBit(__isset_bitfield, __PAGENO_ISSET_ID);\n }", "private boolean isEmpty(ListItem<PropertyWrapper> attribute) {\n return false;\n }", "private boolean isForStatement() throws IOException\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(theCurrentToken.TokenType == TokenType.FOR)\n\t\t{\n\t\t\ttheCurrentSymbol = new Symbol(TokenType.IF, theCurrentToken.TokenLineNumber, null, null, null, null, null, false);\n\t\t\tupdateToken();\n\t\t\tif(theCurrentToken.TokenType == TokenType.LEFT_PARENTHESIS)\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tif(theCurrentToken.TokenType == TokenType.IDENTITY)\n\t\t\t\t{\n\t\t\t\t\tupdateToken();\n\t\t\t\t\tif(isDestination())\n\t\t\t\t\t{\n\t\t\t\t\t\tif(theCurrentToken.TokenType == TokenType.ASSIGN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\tif(isExpression())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\tif(theCurrentToken.TokenType == TokenType.SEMICOLON)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\t\tif(isExpression())\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\t\t\tif(theCurrentToken.TokenType == TokenType.RIGHT_PARENTHESIS)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\t\t\t\twhile(isStatement())\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"LOOP STATEMENT\");\n\t\t\t\t\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\t\t\t\t\tif(theCurrentToken.TokenType == TokenType.SEMICOLON)\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\tupdateToken();\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\telse\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\ttheLogger.LogParseError(theCurrentToken);\n\t\t\t\t\t\t\t\t\t\t\t\t\twhile(theCurrentToken.TokenType != TokenType.SEMICOLON)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(theCurrentToken.TokenType == TokenType.END)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tupdateToken();\n\t\t\t\t\t\t\t\t\t\t\t\tif(theCurrentToken.TokenType == TokenType.FOR)\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\tisValid = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"For!\");\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}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ttheCurrentSymbol = null;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public boolean isSetPageNo() {\n return EncodingUtils.testBit(__isset_bitfield, __PAGENO_ISSET_ID);\n }", "public boolean isSetPageNo() {\n return EncodingUtils.testBit(__isset_bitfield, __PAGENO_ISSET_ID);\n }", "public boolean attributeExists(String aname) {\n for (String s : attributes) {\n if (aname.equals(s))\n return true;\n }\n return false;\n }", "public boolean isSetWasNotGiven()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(WASNOTGIVEN$4) != 0;\n }\n }", "public boolean hasAttribute(String attributeName)\n\t{\n\t\treturn attributes.containsKey(attributeName);\n\t}", "public boolean attributeIsDensityValue ()\n\t{\n\t\n\t\treturn mAttributeTypeDensityButton.isSelected();\n\t\n\t}", "public Boolean getIsmap() {\n return (Boolean) attributes.get(\"ismap\");\n }", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$8) != 0;\n }\n }", "public final boolean isDeepAttributeReference ()\r\n {\r\n return _value.hasXmlTreePath();\r\n }", "public boolean isSetId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$6) != null;\n }\n }", "public boolean isSetMeta() {\n return this.meta != null;\n }", "public boolean isSetOID()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(OID$12) != null;\r\n }\r\n }", "public final boolean isForDelete() {\n\t\treturn JsUtils.getNativePropertyBoolean(this, \"forDelete\");\n\t}", "public boolean isSet() {\n\t\treturn is_set_;\n\t}", "boolean isSetTarget();", "public boolean isSetKey() {\n return EncodingUtils.testBit(__isset_bitfield, __KEY_ISSET_ID);\n }", "public boolean isSetKey() {\n return EncodingUtils.testBit(__isset_bitfield, __KEY_ISSET_ID);\n }", "public boolean isSetDataMsng()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DATAMSNG$18) != 0;\n }\n }" ]
[ "0.68169665", "0.65799344", "0.6396289", "0.63216114", "0.63216114", "0.62969863", "0.6222567", "0.61916256", "0.6170728", "0.61575115", "0.61423266", "0.61165786", "0.6071341", "0.6014158", "0.60066015", "0.59748966", "0.58895135", "0.5884925", "0.584304", "0.5814462", "0.5781436", "0.5768609", "0.5751086", "0.57152694", "0.5715213", "0.57019395", "0.56949925", "0.56785357", "0.5655776", "0.5632327", "0.56021154", "0.5600978", "0.5594712", "0.55701023", "0.55504143", "0.55290204", "0.5513485", "0.5513485", "0.5513485", "0.5513485", "0.5495411", "0.548744", "0.5434437", "0.5409051", "0.5402924", "0.540074", "0.53979385", "0.5388633", "0.53824", "0.53813815", "0.53508836", "0.53283775", "0.5326513", "0.5315602", "0.5313423", "0.5312142", "0.5282051", "0.52575916", "0.5249141", "0.5236105", "0.52344453", "0.52342", "0.523322", "0.5233174", "0.5230199", "0.52277017", "0.52212113", "0.5216323", "0.5206325", "0.52049863", "0.52047503", "0.52047503", "0.5201212", "0.51975965", "0.5189036", "0.5188984", "0.51882017", "0.5183157", "0.51830643", "0.5181656", "0.5170406", "0.51666737", "0.5144484", "0.5144484", "0.5144296", "0.5140679", "0.5139221", "0.51312876", "0.5125402", "0.5125166", "0.51170146", "0.5112145", "0.51114", "0.51022375", "0.509795", "0.5097748", "0.5096265", "0.5090707", "0.5090707", "0.50866646" ]
0.73865855
0
Returns true if the attribute "manyResultsMessage" is set.
public final boolean isManyResultsMessageSetted() { return engine.isPropertySetted(Properties.MANY_RESULTS_MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final boolean isOneResultMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.ONE_RESULT_MESSAGE);\n\t}", "public boolean isSetResults() {\n return this.results != null;\n }", "public boolean getMoreResults() {\n return moreResults_;\n }", "public boolean getMoreResults() {\n return moreResults_;\n }", "public boolean isSetTotalResults()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(TOTALRESULTS$4) != null;\n }\n }", "boolean isSetNumberOfResults();", "public final boolean isZeroResultMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.ZERO_RESULT_MESSAGE);\n\t}", "boolean getMoreResults();", "public boolean hasNextElement() {\n return resultsEnumeration.hasMoreElements();\n }", "boolean hasCollectResult();", "public final boolean isMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.MESSAGE);\n\t}", "public boolean hasMultiple() {\n/* 99 */ return this.multiple;\n/* */ }", "public boolean isSetResult() {\n return this.result != null;\n }", "public boolean isNoPagedMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.NO_PAGED_MESSAGE);\n\t}", "public boolean getMoreResults() throws SQLException {\n return false;\r\n }", "public boolean hasCount() {\n return result.hasCount();\n }", "public boolean hasNextResults() {\n\t\tif(totalCount != null && totalCount <= currentOffset) return false;\n\t\treturn true;\n\t}", "boolean hasResponseMessage();", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean isMultiple() {\r\n return multiple;\r\n }", "public boolean hasResponseMessage() {\n return ((bitField0_ & 0x00002000) == 0x00002000);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponseMessage() {\n return ((bitField0_ & 0x00002000) == 0x00002000);\n }", "public boolean isMultiple() {\n return multiple;\n }", "public boolean isMulti() {\n return getElement().isMulti();\n }", "boolean isMany();", "public boolean isCacheResults() {\n return cacheResults;\n }", "boolean hasQueryMessage();", "public boolean isSetReplyManagementRuleSet()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(REPLYMANAGEMENTRULESET$30) != 0;\n }\n }", "public boolean isSetMedication()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(MEDICATION$10) != 0;\n }\n }", "@Override\n public boolean hasErrorResults() {\n return false;\n }", "public boolean isSetMessage() {\n return this.Message != null;\n }", "@Override\n\tpublic boolean hasMessages() {\n\t\treturn false;\n\t}", "public boolean hasMessages()\r\n {\r\n return !mailbox.isEmpty();\r\n }", "public boolean hasNext() {\n return index < results.size();\n }", "private boolean verifyMessagePresence(){\n boolean overallResult = true;\n \n for(int ii = 0; ii < 3; ii = ii +1){\n if(121 == getHidden(ii)){\n overallResult = true;\n }else{\n overallResult = false;\n }\n }\n \n return overallResult;\n }", "@Override\n public boolean getMoreResults() throws SQLException {\n\n return (result != null);\n\n }", "public boolean hasResult() {\n return hasResult;\n }", "public boolean hasLimit() {\n return result.hasLimit();\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public Builder setMoreResults(boolean value) {\n \n moreResults_ = value;\n onChanged();\n return this;\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\r\n\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t}", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "public boolean getCallReturnOnMessage() {\n\t return isCallReturnOnMessage.get();\n\t}", "public boolean hasResult() {\r\n\t\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t\t}", "private Boolean printResults(Set<?> results){\n\t\t//if the results set is null, we know there were no results\n\t\tBoolean hasResults = results != null;\n\t\t//if the set is null, print 0 results, else print the number of results that were returned\n\t\tif (!hasResults) print(\"0 Results\");\n\t\telse print(results.size()+\" Results:\");\n\t\t\n\t\treturn hasResults;\n\t}", "public boolean isMultiStatus() {\n\t\treturn adaptee.isMultiStatus();\n\t}", "public final boolean hasResponseValues()\n\t{\n\t\treturn m_responseValues != null ? true : false;\n\t}", "public boolean isResult() {\n return result;\n }", "public boolean isResultRefined() {\n return mRefineResult;\n }", "public boolean hasResponse() {\n if(responses == null)\n return false;\n for(SapMessage response : responses) {\n if(response != null)\n return true;\n }\n return false;\n }", "public boolean hasAnswers() {\n return fieldSetFlags()[20];\n }", "boolean isSetMultiple();", "public boolean hasMessage(){\r\n return this.receivedMessages.size()>0;\r\n }", "public boolean isSearchPerformed()\n\t{\n\t\treturn this.searchPerformed || this.recordCount() > 0;\n\t}", "public Boolean getHasMoreItems()\n {\n return hasMoreItems;\n }", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "public boolean isSetErrorMessage() {\n return this.errorMessage != null;\n }", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "public boolean hasResultPost() {\n return fieldSetFlags()[8];\n }", "public boolean hasResultId() {\n return resultIdBuilder_ != null || resultId_ != null;\n }", "public boolean isDetailedMetrics() {\n\treturn detailedMetrics;\n }", "public boolean isSetMids() {\n return this.mids != null;\n }", "public boolean isSetErrorAffectedPageactionCount()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(ERRORAFFECTEDPAGEACTIONCOUNT$8) != null;\r\n }\r\n }", "public boolean isMultiple()\n {\n \tif (questionNumber == 0) {\n \t\treturn false;\n \t}\n int counter = 0;\n List<Answer> answers = test.getQuestions().get(questionNumber-1).getAnswers();\n for (Answer answer : answers) {\n if (answer.getCorrect()) {\n ++counter;\n if (counter > 1) {\n return true;\n }\n }\n }\n return false;\n }", "public Boolean hasMorePages() {\n return (this.paging.hasMore());\n }", "@Override\n\tpublic boolean hasMore() {\n\t\treturn false;\n\t}", "public boolean hasMoreElements() {\n\t return hasMoreTokens();\n\t}", "public boolean isSetErrorcount()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(ERRORCOUNT$4) != null;\r\n }\r\n }", "public synchronized boolean isComplete() throws MessagingException {\n/* 366 */ parse();\n/* 367 */ return this.complete;\n/* */ }", "public boolean isSetCount()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(COUNT$8) != null;\n }\n }", "public boolean getMoreResults() throws SQLException {\n return currentPreparedStatement.getMoreResults();\n }", "public boolean hasMoreElements() {\n/* 64 */ return this.iterator.hasNext();\n/* */ }", "public boolean isSetMsg() {\n return this.msg != null;\n }", "public boolean hasResultJson() {\n return fieldSetFlags()[7];\n }", "public boolean hasReply(int messageID){\n Message message = allmessage.get(messageID);\n return (message.getReply() != -1);\n }", "public boolean hasEk() {\n return result.hasEk();\n }", "public boolean hasEk() {\n return result.hasEk();\n }", "protected final boolean anyMsg() {\n\t\tDoorPulseCriterion dpc = new DoorPulseCriterion(this.getPulse() - 1);\n\t\treturn this.existMessage(dpc);\n\t}", "public static boolean retrievePartialResponseSent(Message message) {\n Boolean ret = (Boolean)message.get(PARTIAL_REPONSE_SENT_PROPERTY);\n return ret != null && ret.booleanValue();\n }", "@Override\r\n\tpublic boolean hasMoreElements() {\n\t\treturn it.hasNext();\r\n\t}", "public boolean hasSearchResponse() {\n return searchResponseBuilder_ != null || searchResponse_ != null;\n }" ]
[ "0.665829", "0.6501732", "0.6469233", "0.6448871", "0.62809116", "0.61320066", "0.5858878", "0.581694", "0.5786029", "0.5780845", "0.57478344", "0.5663061", "0.56095475", "0.55644226", "0.55608916", "0.55577284", "0.5527805", "0.54951066", "0.5491291", "0.54911244", "0.54817533", "0.5481479", "0.54507256", "0.5445716", "0.5428564", "0.5425935", "0.5402585", "0.53692746", "0.53692126", "0.53659123", "0.5354048", "0.53499395", "0.53485954", "0.53453255", "0.5335746", "0.5331834", "0.5326908", "0.5320365", "0.53044224", "0.5296815", "0.5296815", "0.5296815", "0.5296043", "0.5296043", "0.5294709", "0.52798086", "0.5270094", "0.5270094", "0.5270094", "0.52689946", "0.52689946", "0.52689946", "0.526183", "0.5241199", "0.5241199", "0.5241199", "0.5241199", "0.5241199", "0.5241199", "0.5241199", "0.5241199", "0.5236811", "0.52354646", "0.52305037", "0.5226244", "0.5222418", "0.52160656", "0.5203442", "0.5194366", "0.5188416", "0.51807195", "0.5176078", "0.5168723", "0.516174", "0.5138558", "0.5136103", "0.51355267", "0.51302576", "0.5126649", "0.51257104", "0.51213783", "0.51204807", "0.5102786", "0.51024044", "0.51018107", "0.5092817", "0.50867754", "0.508156", "0.50784355", "0.50783676", "0.5078104", "0.50704277", "0.50654405", "0.50595564", "0.505553", "0.505553", "0.50516385", "0.5048989", "0.50444376", "0.50428814" ]
0.86627984
0
Returns true if the attribute "message" is set.
public final boolean isMessageSetted() { return engine.isPropertySetted(Properties.MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSetMessage() {\n return this.Message != null;\n }", "public boolean is_set_msg() {\n return this.msg != null;\n }", "public boolean isSetMsg() {\n return this.msg != null;\n }", "public boolean isValid() {\n return message == null;\n }", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean getIsMessage()\n {\n return isMessage;\n }", "boolean hasMessageAnnotation();", "public boolean hasMessage(){\r\n return this.receivedMessages.size()>0;\r\n }", "public boolean hasMessageAttached()\n throws OculusException;", "public boolean isSetErrorMessage() {\n return this.errorMessage != null;\n }", "public boolean hasUserMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasUserMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessageID() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "public boolean hasMessageID() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "public boolean isFullMessage() {\n return fullMessage;\n }", "boolean hasUserMessage();", "public boolean hasMsg() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean hasMsg() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "boolean hasMsg();", "public boolean hasSendMessage() {\n return typeCase_ == 4;\n }", "public boolean isSetStateMsg() {\n return this.stateMsg != null;\n }", "public boolean hasSendMessage() {\n return typeCase_ == 4;\n }", "public boolean hasMessages()\r\n {\r\n return !mailbox.isEmpty();\r\n }", "public boolean isSetSender() {\n return this.sender != null;\n }", "@Override\n\tpublic boolean hasMessages() {\n\t\treturn false;\n\t}", "public boolean isSetKeff() {\r\n return isSetAttribute(MEConstants.keff);\r\n }", "boolean isDefaultMessage();", "boolean hasMessageID();", "public final boolean hasAttribute ()\r\n {\r\n return _value.hasAttribute();\r\n }", "boolean hasSetAttribute();", "public boolean isSetStatusEmail() {\n\t\treturn org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STATUSEMAIL_ISSET_ID);\n\t}", "public boolean hasMsgData() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMsgData() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "boolean hasSendMessage();", "public boolean hasContent() {\n return messageContent != null || messageContentBytes != null;\n }", "public boolean hasReqMessage() {\n return fieldSetFlags()[1];\n }", "public boolean hasSetAttribute() {\n return ((bitField0_ & 0x08000000) == 0x08000000);\n }", "public final boolean hasMessageFor(Component component)\n\t{\n\t\treturn messageForComponent(component) != null;\n\t}", "boolean hasMessageType();", "public boolean hasSetAttribute() {\n return ((bitField0_ & 0x08000000) == 0x08000000);\n }", "boolean hasMessageId();", "boolean hasMessageId();", "boolean hasMessageId();", "public boolean hasErrorMessage() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public boolean hasNewMessage() throws RemoteException {\r\n return !messages.isEmpty();\r\n }", "public boolean hasErrorMessage() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public boolean isSetReason() {\n return this.reason != null;\n }", "public boolean hasValue() throws SdpParseException {\n\t\tNameValue nameValue = getAttribute();\n\t\tif (nameValue == null)\n\t\t\treturn false;\n\t\telse {\n\t\t\tObject value = nameValue.getValue();\n\t\t\tif (value == null)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t}", "public boolean isSetDescription()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(DESCRIPTION$8) != null;\r\n }\r\n }", "public static boolean hasMessageData(Map<String, Object> data) {\r\n\t\treturn ( null != data.get(MESSAGE) );\r\n\t}", "public boolean isSetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(DESCRIPTION$14) != null;\n }\n }", "public synchronized boolean hasMessage() {\n\t while(_buffers.size() > 0) {\n ByteBuffer bytes = _buffers.remove(0);\n CharBuffer chars = CharBuffer.allocate(bytes.remaining());\n \t this._decoder.decode(bytes, chars, false); // false: more bytes may follow. Any unused bytes are kept in the decoder.\n \t chars.flip();\n \t this._stringBuf.append(chars);\n\t }\n\t return this._stringBuf.indexOf(this._messageSeparator) > -1;\n }", "boolean hasSetProperty();", "public boolean isSetDescription() {\n return (this.description != null ? this.description.isSetValue() : false);\n }", "public boolean isSetComment() {\n return this.comment != null;\n }", "public boolean hasMsgID() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasMsgID() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean validateMessage(String message) {\n try {\n parser.parse(message);\n return true;\n } catch (ParseException ex) {\n Logger.getLogger(JsonObjectProcessing.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n }", "public boolean hasMent() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean hasMsgID() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasMsgID() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasMent() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean hasMsgid() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean isSetValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(VALUE$12) != null;\n }\n }", "boolean isSetValueAttachment();", "public boolean hasMsgid() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean isCmasMessage() {\n return SmsCbHeader.isCmasMessage(mMessageIdentifier);\n }", "public final boolean hasStatusMessage()\n\t{\n\t\treturn m_statusMsg != null ? true : false;\n\t}", "public boolean isSetChat() {\n return this.chat != null;\n }", "public boolean hasMessageInfoID() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessageInfoID() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean isSetMFilePath() {\n return this.mFilePath != null;\n }", "public boolean isEtwsMessage() {\n return SmsCbHeader.isEtwsMessage(mMessageIdentifier);\n }", "public final boolean isEmpty()\n\t{\n\t\treturn messages == null || messages.isEmpty();\n\t}", "boolean hasMsgID();", "boolean hasMsgID();", "boolean hasMessageInfoID();", "protected final boolean anyMsg() {\n\t\tDoorPulseCriterion dpc = new DoorPulseCriterion(this.getPulse() - 1);\n\t\treturn this.existMessage(dpc);\n\t}", "public boolean hasAttribute(String name) {\n // if attribute() returns a value, then this jode has that attribute\n return attribute(name, true) != null;\n }" ]
[ "0.79260176", "0.74718606", "0.7249422", "0.7137898", "0.71103394", "0.71103394", "0.71103394", "0.71103394", "0.71103394", "0.71103394", "0.71103394", "0.71103394", "0.7035329", "0.7035329", "0.7035329", "0.7035329", "0.7035175", "0.7035175", "0.701567", "0.701567", "0.70142907", "0.70142907", "0.70142907", "0.70142907", "0.7007269", "0.69875216", "0.6753823", "0.670397", "0.6640458", "0.6554225", "0.6542162", "0.64716345", "0.6450679", "0.6429805", "0.6401806", "0.63507", "0.632557", "0.63144517", "0.63050383", "0.6289123", "0.62599117", "0.62435484", "0.6227915", "0.62116766", "0.6201297", "0.6193638", "0.6191345", "0.61904895", "0.6186661", "0.618244", "0.6177816", "0.6145096", "0.6135374", "0.6131923", "0.6131652", "0.61269075", "0.6116687", "0.6115197", "0.6109683", "0.6081333", "0.607531", "0.60717857", "0.60717857", "0.60717857", "0.60636884", "0.6049266", "0.60408723", "0.6036956", "0.6007667", "0.60032684", "0.598242", "0.5974579", "0.5952477", "0.5906175", "0.5904116", "0.5886599", "0.5879331", "0.5879331", "0.58695704", "0.5867827", "0.58605087", "0.58605087", "0.5860324", "0.5857532", "0.5838117", "0.5834745", "0.5828124", "0.58179384", "0.5771962", "0.57600343", "0.57576513", "0.57387596", "0.5710967", "0.570595", "0.5691165", "0.5678966", "0.5678966", "0.5671013", "0.56688094", "0.56602657" ]
0.77528805
1
Returns true if the attribute "oneResultMessage" is set.
public final boolean isOneResultMessageSetted() { return engine.isPropertySetted(Properties.ONE_RESULT_MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final boolean isZeroResultMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.ZERO_RESULT_MESSAGE);\n\t}", "public boolean isSetResult() {\n return this.result != null;\n }", "public boolean isSetMessage() {\n return this.Message != null;\n }", "public static void ensureResultMessageIsSet() {\r\n final EventHandlerContext context = ContextStore.get().getEventHandlerContext();\r\n if (!context.parameterExists(RESULT_MESSAGE_PARAMETER)\r\n || StringUtil.isNullOrEmpty(context.getParameter(RESULT_MESSAGE_PARAMETER))) {\r\n context.addResponseParameter(RESULT_MESSAGE_PARAMETER, RESULT_MESSAGE_OK);\r\n }\r\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResult() {\r\n\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t}", "public boolean hasResult() {\r\n\t\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t\t}", "public final boolean isManyResultsMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.MANY_RESULTS_MESSAGE);\n\t}", "public final boolean isMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.MESSAGE);\n\t}", "public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }", "public boolean isSetErrorMessage() {\n return this.errorMessage != null;\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }", "public boolean isSetSuccess() {\n return this.success != null;\n }" ]
[ "0.72161865", "0.68635327", "0.6455939", "0.64409065", "0.64051956", "0.64051956", "0.64051956", "0.6405153", "0.6405153", "0.64035285", "0.639855", "0.6385228", "0.6385228", "0.6385228", "0.6384776", "0.6384776", "0.6384776", "0.6378558", "0.6362597", "0.635765", "0.6347301", "0.6262059", "0.6246065", "0.6227571", "0.6185454", "0.6185454", "0.6185454", "0.6185454", "0.6185454", "0.6185454", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617", "0.6166617" ]
0.828893
0
Returns true if the attribute "zeroResultMessage" is set.
public final boolean isZeroResultMessageSetted() { return engine.isPropertySetted(Properties.ZERO_RESULT_MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final boolean isOneResultMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.ONE_RESULT_MESSAGE);\n\t}", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResult() {\r\n\t\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t\t}", "public boolean hasResult() {\r\n\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t}", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isSetResult() {\n return this.result != null;\n }", "public boolean isSetMessage() {\n return this.Message != null;\n }", "public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }", "public boolean hasResultCode() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResultCode() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isZero()\r\n\t{\r\n\t\tif(this.get_coefficient()==0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean hasResultCode() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResultCode() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isSetErrorMessage() {\n return this.errorMessage != null;\n }", "public boolean hasErrorMessage() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public boolean isZero()\n {\n return Native.fpaIsNumeralZero(getContext().nCtx(), getNativeObject());\n }", "public boolean hasErrorMessage() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public boolean isZero() {\r\n return (this.getReal() == 0 && this.getImag() == 0) ? true : false;\r\n }", "public static void ensureResultMessageIsSet() {\r\n final EventHandlerContext context = ContextStore.get().getEventHandlerContext();\r\n if (!context.parameterExists(RESULT_MESSAGE_PARAMETER)\r\n || StringUtil.isNullOrEmpty(context.getParameter(RESULT_MESSAGE_PARAMETER))) {\r\n context.addResponseParameter(RESULT_MESSAGE_PARAMETER, RESULT_MESSAGE_OK);\r\n }\r\n }", "public boolean isZero() {\n\t\treturn x == 0.0 && y == 0.0 && z == 0.0;\n\t}", "public boolean isZero() {return false;}", "public boolean isValid() {\n return message == null;\n }", "public boolean isZero() {\n return mJavaSize == 0 && mRegisteredNativeSize == 0;\n }", "public boolean getEmptyOk() {\r\n return _emptyok;\r\n }", "public boolean hasEresult() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "public boolean hasEresult() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "public boolean isSetMsg() {\n return this.msg != null;\n }", "public final boolean isMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.MESSAGE);\n\t}", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean isZero() {\n\t\treturn ((get() >> 7) & 1) == 1;\n\t}", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "boolean hasResponseMessage();", "default A isZero() {\n return satisfiesNumberCondition(new NumberCondition<>(0, EQUAL_TO));\n }", "public boolean hasResultId() {\n return resultId_ != null;\n }", "public boolean hasResult() {\n return hasResult;\n }", "public final boolean hasStatusMessage()\n\t{\n\t\treturn m_statusMsg != null ? true : false;\n\t}", "@Override\n\tpublic boolean\n\tisZero()\n\t{\n\t\treturn( data[0] == 0 && data[1] == 0 && data[2] == 0 );\n\t}", "public boolean is_set_predictResult() {\n return this.predictResult != null;\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean hasValue() {\n return result.hasValue();\n }", "public boolean hasValue() {\n return result.hasValue();\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isZeroLength() {\r\n return value.length() == 0;\r\n }", "public boolean hasResultId() {\n return resultIdBuilder_ != null || resultId_ != null;\n }", "boolean isDefaultMessage();", "public boolean isSetSuccess() {\r\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\r\n }", "public boolean isSetSuccess() {\r\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\r\n }", "public boolean hasProperty0() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isZero() {\r\n for (int i = 0; i < this.getDimension(); i++) {\r\n if (this.getComponent(i) != 0)\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isSetTotalResults()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(TOTALRESULTS$4) != null;\n }\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }", "public boolean isSetSuccess() {\n return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);\n }" ]
[ "0.65579", "0.6526155", "0.6503942", "0.6503942", "0.6503942", "0.6503753", "0.6503753", "0.6503753", "0.65007836", "0.64899474", "0.6487348", "0.6484246", "0.6484246", "0.6484081", "0.6484081", "0.6484081", "0.6482163", "0.641695", "0.62825334", "0.6264697", "0.62177575", "0.62177575", "0.62057513", "0.62047815", "0.62047815", "0.61740494", "0.6126764", "0.61230886", "0.6097973", "0.6086546", "0.6065793", "0.60059065", "0.59971726", "0.59968054", "0.5969197", "0.5956297", "0.5946423", "0.5945814", "0.5940209", "0.59112865", "0.58998525", "0.58998525", "0.58998525", "0.58998525", "0.58998525", "0.58998525", "0.58998525", "0.58998525", "0.58857197", "0.58857197", "0.5885404", "0.5885404", "0.5885404", "0.5885404", "0.58833176", "0.5858435", "0.5858435", "0.5856694", "0.5856694", "0.5856694", "0.5856694", "0.58518004", "0.5850086", "0.5820883", "0.5813657", "0.57717377", "0.57470936", "0.57303697", "0.572136", "0.57117474", "0.57109576", "0.57097864", "0.57097864", "0.5704396", "0.5704396", "0.5704396", "0.5704396", "0.5704396", "0.5704396", "0.5704396", "0.5704396", "0.5688402", "0.56864154", "0.5679772", "0.5678739", "0.5678739", "0.56705433", "0.56584", "0.5656183", "0.565189", "0.5650187", "0.5650187", "0.5650187", "0.5650187", "0.5650187", "0.5650187", "0.5650187", "0.5650187", "0.5650187", "0.5650187" ]
0.8491803
0
Returns a string specifying the message to display when there is no row to display.
public String getNoPagedMessage() { return getNoPagedMessage(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void displayNoResults()\n {\n tableData.add(new Company(null, \"No results found\"));\n tableView.setItems(tableData); \n }", "private void displayNoRoomMsg() {\n\t\t \n\t\t //displays error message to user\n\t\t System.out.println(\"Unable to move in that direction.\\n\"\n\t\t\t\t \t\t\t\t+ \"There is no Room in that direction.\\n\");\n\t }", "public void displayValidityReport() {\r\n\t\tif (this.tuple == null)\r\n\t\t\treturn;\r\n\t\tsetMessage(\"\");\r\n\t\tint row = this.tableView.getSelectedRow();\r\n\t\tif (row < this.tuple.getNumberOfEntries() && row >= 0)\r\n\t\t\tdisplayValidityReport(row);\r\n\t}", "void displayNoItemsSelectedErrorMessage();", "private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "public void show_message_no_data() {\n\t\tAlertDialog.Builder dialog=new AlertDialog.Builder(this);\n\t\t\n dialog.setTitle(\"Notice\");\n dialog.setMessage(\"No data for TI list\");\n \n dialog.setPositiveButton(\"OK\",new DialogListener(this, dialog, 0));\n \n dialog.create();\n dialog.show();\n\t\t\n\t}", "public static String wrongPick() {\n return \"Wrong column or row picked!\";\n }", "public String getMessage() {\n return \"Sorry, there isn't any event in the list on the given date.\";\n }", "public void displayNoTable() {\n\t\tcontent.removeComponent(tableDisplay.getGrid());\n\t\tthis.addStyleName(\"fr_map_component_no_table\");\n\t}", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic String getMessage() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String display() {\n\t\treturn null;\n\t}", "public String getMessage() {\n return null;\n }", "public boolean getNoDisplay() {\n\t\treturn false;\n\t}", "@Override\n public String toString() {\n if(null != problemStatement) {\n if (problemStatement.equals(\"\"))\n return \"No problem statement\";\n return problemStatement;\n }\n return \"No problem Statement\";\n }", "@Override\n\tpublic String getMessage() {\n\t\treturn \"there is zero balance\";\n\t}", "public static void emptyInventoryListMessage() {\n System.out.println(\"You do not have any Items in your inventory:(\");\n }", "@Override\n\tpublic String display() {\n\t\treturn \"null\";\n\t}", "protected void handleNoRowFound()\r\n/* 37: */ throws DataAccessException\r\n/* 38: */ {\r\n/* 39: 92 */ throw new EmptyResultDataAccessException(\r\n/* 40: 93 */ \"LobStreamingResultSetExtractor did not find row in database\", 1);\r\n/* 41: */ }", "public String getMessage()\n {\n return super.getMessage() + invoice_error + \" not found\";\n }", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n\t\tpublic String getMessage() {\n\t\t\treturn \"zero \" + super.getMessage();\n\t\t}", "public String getNoPagedMessage(javax.faces.context.FacesContext facesContext) {\n\t\tString s = engine.getStringProperty(Properties.NO_PAGED_MESSAGE, facesContext);\n\t\treturn s;\n\t}", "private void drawNoResultsMessage()\n\t{\n\t\tFont font = new Font(\"Invalid\", Font.BOLD, 30);\t\t\n\t\ttitle.setBounds((super.getWidth()/2) - 380, (super.getHeight()/2) - 70, 800, 50);\n\t\ttitle.setFont(font);\n\t\tthis.add(title);\n\t}", "public static String noPairFound() {\n return \"No pair found, try again.\";\n }", "@Override\n\t\tpublic void displayMessage() {\n\t\t\tsuper.displayMessage();\n\t\t}", "public String msg() {\n return null;\n }", "String getMessage() {\n return null;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"No user with id \" + this.id + \" could be found in our system\";\n\t}", "@Override\n public String toString() {\n String details = \"\";\n\n if (this.columnType.getValue() != ColumnType._ANY) {\n details += \" typu '\" + this.columnType.getValue().toString() + \"'\";\n }\n if (!this.columnName.getValue().isEmpty()) {\n details += \" s názvem '\" + this.columnName.getValue() + \"'\";\n }\n if (this.columnIsPrimary.getValue() != YesNoType._ANY) {\n details += \", které \" + (this.columnIsPrimary.getValue() == YesNoType.YES ? \"jsou\" : \"nejsou\") + \" primárním klíčem,\";\n }\n\n return \"Počet sloupců\" + details + \" v každé tabulce \" + this.countOp.getValue() + \" \" + this.count.getValue();\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "@Override\n public String getMessage() {\n return super.getMessage() + bonus_error + \"Not Found\";\n }", "@Override\r\n public String toString() {\r\n String s = \"Unknown Error\";\r\n String message = getLocalizedMessage();\r\n return (message != null) ? (message) : s;\r\n }", "@DefaultMessage(\"No records found\")\n @Key(\"gen.noRecordsFound\")\n String gen_noRecordsFound();", "public String toString(){\n StringBuffer returnString = new StringBuffer();\n for(int i = 0; i < this.matrixSize; i++){\n if(rows[i].length() != 0){\n returnString.append((i+1) + \":\" + rows[i]+ \"\\n\");\n }\n }\n return returnString.toString();\n }", "public boolean isNoDatamessagePresent() {\r\n\t\treturn isElementVisible(addVehiclesHeader.replace(\"Add Vehicle\", \"No data\"), SHORTWAIT);\r\n\t}", "@Override\n public String toString(){\n\n ArrayList<String> headers = new ArrayList<>();\n ArrayList<String[]> records = new ArrayList<>();\n\n for(Col col : columns){\n headers.add(col.getName());\n }\n\n if(getRecordSize() < 1){\n return headers.toString();\n }\n\n for(int i = 0; i < getRecordSize(); i++){\n\n ArrayList<Rec> recs = getRecordsByRowIndex(i);\n String[] r = new String[recs.size()];\n\n for(int j = 0; j < recs.size(); j++){\n r[j] = recs.get(j).getLastEntry().getData();\n }\n\n records.add(r);\n\n }\n\n return displayTable(headers, records);\n\n }", "public void showEmptyListMessage() {\n Toast.makeText(getBaseContext(), \"Lista de opiniones vacia!\", Toast.LENGTH_LONG).show();\n }", "private TextView getNoDataTextView(String content) {\n TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n layoutParams.gravity = Gravity.CENTER_HORIZONTAL;\n TextView textView = getTextView(content);\n textView.setLayoutParams(layoutParams);\n textView.setPadding(25, 30, 0, 30);\n return textView;\n }", "private boolean noMessage() {\n\t\treturn nbmsg==0;\n\t}", "public JLabelOperator lblTheDatabaseNameIsEmpty() {\n if (_lblTheDatabaseNameIsEmpty==null) {\n _lblTheDatabaseNameIsEmpty = new JLabelOperator(this,\n Bundle.getStringTrimmed(\"org.netbeans.modules.derby.ui.Bundle\", \"ERR_DatabaseNameEmpty\"));\n }\n return _lblTheDatabaseNameIsEmpty;\n }", "public void show() {\n if(heading.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in heading, nothing to show\");\r\n return;\r\n }\r\n if(rows.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in rows, nothing to show\");\r\n return;\r\n }\r\n for(String h : heading) {\r\n System.out.print(h + \" | \");\r\n }\r\n System.out.println(\"\");\r\n Set<String> keys = rows.keySet();\r\n for(String k : keys) {\r\n rows.get(k).show();\r\n System.out.println(\"\");\r\n }\r\n System.out.println(\"\");\r\n }", "@AutoEscape\n public String getModelIndexErrorMessage();", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private String getNullValueText() {\n return getNull();\n }", "@Override\n\tpublic int getNumRows() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int display() {\n\t\treturn 0;\n\t}", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "DataNotFoundMessage()\n\t{\n\t\t\n\t}", "public String detailedStatusMessage() {\n return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage();\n }", "public static void handleEmptyDetailException() {\n System.out.println(\"\\tSorry sir, you need to specify the details of the task.\");\n Duke.jarvis.printDivider();\n }", "public String fullCellText();", "@Override\n public String getErrorMessage() {\n return null;\n }", "protected String noAfk() {\n return cfg.getString(\"Messages.-afk\");\n }", "String printTable(String name) {\n\n try {\n return tables.get(name).getTable();\n } catch (IndexOutOfBoundsException e) {\n return \"ERROR: Cant print table\";\n } catch (NullPointerException e) {\n return \"ERROR: Cant print table\";\n }\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 String getMessage() {\n return \"☹ OOPS!!! There isn't a task labeled \" + label;\n }", "public static void handleNoMatchException() {\n System.out.println(\"\\tThere no task in the list that matches your search, sir.\");\n Duke.jarvis.printDivider();\n }", "public Rendable getMessageDisplay(){\n return MESSAGE_DISPLAY;\n }", "public final String getMessageErreur() {\n\t\tString messageErreur = null;\n\n\t\t// il faut que toutes les taches obligatoires soient accomplies\n\t\tNSMutableArray<I_WorkFlowItem> tachesObligatoiresAbsentes = getTachesObligatoiresAbsentes();\n\t\tif (tachesObligatoiresAbsentes.count() > 0) {\n\t\t\tmessageErreur = \"Tâches non effectuées : \";\n\t\t\tmessageErreur += \"<ul>\";\n\t\t\tfor (int i = 0; i < tachesObligatoiresAbsentes.count(); i++) {\n\t\t\t\tI_WorkFlowItem tache = tachesObligatoiresAbsentes.objectAtIndex(i);\n\t\t\t\tmessageErreur += \"<li>\";\n\t\t\t\tmessageErreur += tache.libelle();\n\t\t\t\tmessageErreur += \"</li>\";\n\t\t\t}\n\t\t\tmessageErreur += \"</ul>\";\n\t\t}\n\n\t\treturn messageErreur;\n\t}", "private String defendRow() {\r\n for (int i = 0; i < gameHeight; i++) {\r\n if (!enLaneInfo.get(i).get(0).isEmpty() && myLaneInfo.get(i).get(1).isEmpty()) {\r\n return DEFENSE.buildCommand(7,i);\r\n }\r\n }\r\n return buildTurret();\r\n }", "private String getStatusDefaultMessage() {\r\n\r\n\t\tfinal Collection<GalleryMT20Item> allSelectedPhoto = _galleryMT20.getSelection();\r\n\t\tfinal int allPhotoSize = allSelectedPhoto.size();\r\n\r\n\t\treturn allPhotoSize == 0 //\r\n\t\t\t\t// hide status message when nothing is selected\r\n\t\t\t\t? UI.EMPTY_STRING\r\n\t\t\t\t: NLS.bind(Messages.Pic_Dir_StatusLabel_SelectedImages, allPhotoSize);\r\n\t}", "@Override\r\n\tpublic String getMessage() {\r\n\t\treturn \"Veuillez entrer un nombre positif\";\r\n\t}", "public CrosstabCell getWhenNoDataCell()\r\n {\r\n for (int i=0; i<getCrosstabElement().getCells().size(); ++i)\r\n {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(i);\r\n if (cell.getType() == cell.NODATA_CELL)\r\n {\r\n return cell;\r\n }\r\n }\r\n return null;\r\n }", "public String simple() {\r\n return super.getMessage();\r\n }", "private void addEmptyRow()\n {\n TableLayout table = (TableLayout) findViewById(R.id.lossesTable);\n TableRow row = new TableRow(this);\n\n TextView emptyView1 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView1, \"\", R.drawable.emptyborder);\n TextView emptyView2 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView2, \"\", R.drawable.emptyborder);\n TextView emptyView3 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView3, \"\", R.drawable.emptyborder);\n TextView emptyView4 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView4, \"\", R.drawable.emptyborder);\n\n row.addView(emptyView1);\n row.addView(emptyView2);\n row.addView(emptyView3);\n row.addView(emptyView4);\n\n table.addView(row);\n }", "public String getErrorMessage() {\n return null;\r\n }", "public static void printEmptyTodoError() {\n botSpeak(Message.EMPTY_TODO_ERROR);\n }", "public String updateRowCount() {\n return null;\n }", "public String getErrorMessage() {\n\t\treturn null;\n\t}", "public String getErrorMessage() {\n\t\treturn null;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "public static String chosenCard1IsNull() {\n return \"The first card you chose is invalid, please select again: \";\n }", "public void displayNoRoute() {\n\t\tmetaInfo.showInfoWhenNoRouteIsSelected();\n\t\tutilities.removeAllPins();\n\t\tupdateLinesAndGrid();\n\t}", "public String getNoneText() {\r\n return ValueBindings.get(this, \"noneText\", noneText, \"None\");\r\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "public String diagnostic() {\n\t\tString output = \"\";\n\t\tString stateString = \"\";\n\t\tif (this.getState() == Player.HUMAN)\n\t\t\tstateString = \"is selected by the player\";\n\t\telse if (this.getState() == Player.COMPUTER)\n\t\t\tstateString = \"is selected by the computer\";\n\t\telse\n\t\t\tstateString = \"is not selected\";\n\t\t\t\n\t\toutput += \"The point \" + this.toString() + \" \" + stateString +\n\t\t\t\t\t\" and is associated with the rows:\\n\";\n\t\tfor (Row r : containingRows) {\n\t\t\toutput += r + \"\\n\";\n\t\t}\n\t\treturn output;\n\t}", "@Override\n\tpublic int getColumnDisplaySize(int arg0) throws SQLException {\n\t\treturn 0;\n\t}", "public static void noSupplierSelected(){\r\n\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\talert.setTitle(\"Error!\");\r\n\t\talert.setHeaderText(\"\");\r\n\t\talert.setContentText(\"Bitte wählen Sie einen Lieferanten aus!\");\r\n\t\talert.showAndWait();\r\n\t}", "@Test\n public void test035() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Table table0 = new Table(errorPage0, (String) null);\n // Undeclared exception!\n try {\n Component component0 = table0.body();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }" ]
[ "0.65571356", "0.64867556", "0.6467869", "0.6248714", "0.6151021", "0.60408384", "0.60408384", "0.5983701", "0.59688735", "0.5966816", "0.59420544", "0.59227043", "0.59227043", "0.5900729", "0.5877202", "0.5822069", "0.5809091", "0.57711357", "0.57458913", "0.5744804", "0.573751", "0.5736917", "0.5709295", "0.56949264", "0.5686676", "0.56609833", "0.5646557", "0.56185335", "0.5612714", "0.5596526", "0.55924046", "0.5576335", "0.55535144", "0.5510955", "0.54903173", "0.5483681", "0.54674417", "0.54648626", "0.54526687", "0.5439581", "0.5417449", "0.53931904", "0.5388234", "0.53649324", "0.53484964", "0.5334266", "0.5330835", "0.53262556", "0.53076863", "0.5297111", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.5287979", "0.52748704", "0.52678055", "0.52645224", "0.52575064", "0.5256587", "0.52467066", "0.52443194", "0.5241862", "0.5225327", "0.5216428", "0.52093184", "0.52028483", "0.51950496", "0.5193339", "0.51912665", "0.5190157", "0.5189564", "0.5187367", "0.51835454", "0.51811516", "0.51723915", "0.5166567", "0.5166567", "0.51552826", "0.51552826", "0.5154811", "0.51537746", "0.51501", "0.5147553", "0.51409364", "0.5136562", "0.5135675", "0.51327056" ]
0.57851326
17
Returns a string specifying the message to display when there is no row to display.
public String getNoPagedMessage(javax.faces.context.FacesContext facesContext) { String s = engine.getStringProperty(Properties.NO_PAGED_MESSAGE, facesContext); return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void displayNoResults()\n {\n tableData.add(new Company(null, \"No results found\"));\n tableView.setItems(tableData); \n }", "private void displayNoRoomMsg() {\n\t\t \n\t\t //displays error message to user\n\t\t System.out.println(\"Unable to move in that direction.\\n\"\n\t\t\t\t \t\t\t\t+ \"There is no Room in that direction.\\n\");\n\t }", "public void displayValidityReport() {\r\n\t\tif (this.tuple == null)\r\n\t\t\treturn;\r\n\t\tsetMessage(\"\");\r\n\t\tint row = this.tableView.getSelectedRow();\r\n\t\tif (row < this.tuple.getNumberOfEntries() && row >= 0)\r\n\t\t\tdisplayValidityReport(row);\r\n\t}", "void displayNoItemsSelectedErrorMessage();", "private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "public void show_message_no_data() {\n\t\tAlertDialog.Builder dialog=new AlertDialog.Builder(this);\n\t\t\n dialog.setTitle(\"Notice\");\n dialog.setMessage(\"No data for TI list\");\n \n dialog.setPositiveButton(\"OK\",new DialogListener(this, dialog, 0));\n \n dialog.create();\n dialog.show();\n\t\t\n\t}", "public static String wrongPick() {\n return \"Wrong column or row picked!\";\n }", "public String getMessage() {\n return \"Sorry, there isn't any event in the list on the given date.\";\n }", "public void displayNoTable() {\n\t\tcontent.removeComponent(tableDisplay.getGrid());\n\t\tthis.addStyleName(\"fr_map_component_no_table\");\n\t}", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic String getMessage() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String display() {\n\t\treturn null;\n\t}", "public String getMessage() {\n return null;\n }", "public boolean getNoDisplay() {\n\t\treturn false;\n\t}", "public String getNoPagedMessage() {\n\t\treturn getNoPagedMessage(null);\n\t}", "@Override\n public String toString() {\n if(null != problemStatement) {\n if (problemStatement.equals(\"\"))\n return \"No problem statement\";\n return problemStatement;\n }\n return \"No problem Statement\";\n }", "public static void emptyInventoryListMessage() {\n System.out.println(\"You do not have any Items in your inventory:(\");\n }", "@Override\n\tpublic String getMessage() {\n\t\treturn \"there is zero balance\";\n\t}", "@Override\n\tpublic String display() {\n\t\treturn \"null\";\n\t}", "protected void handleNoRowFound()\r\n/* 37: */ throws DataAccessException\r\n/* 38: */ {\r\n/* 39: 92 */ throw new EmptyResultDataAccessException(\r\n/* 40: 93 */ \"LobStreamingResultSetExtractor did not find row in database\", 1);\r\n/* 41: */ }", "public String getMessage()\n {\n return super.getMessage() + invoice_error + \" not found\";\n }", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n\t\tpublic String getMessage() {\n\t\t\treturn \"zero \" + super.getMessage();\n\t\t}", "private void drawNoResultsMessage()\n\t{\n\t\tFont font = new Font(\"Invalid\", Font.BOLD, 30);\t\t\n\t\ttitle.setBounds((super.getWidth()/2) - 380, (super.getHeight()/2) - 70, 800, 50);\n\t\ttitle.setFont(font);\n\t\tthis.add(title);\n\t}", "public static String noPairFound() {\n return \"No pair found, try again.\";\n }", "@Override\n\t\tpublic void displayMessage() {\n\t\t\tsuper.displayMessage();\n\t\t}", "public String msg() {\n return null;\n }", "String getMessage() {\n return null;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"No user with id \" + this.id + \" could be found in our system\";\n\t}", "@Override\n public String toString() {\n String details = \"\";\n\n if (this.columnType.getValue() != ColumnType._ANY) {\n details += \" typu '\" + this.columnType.getValue().toString() + \"'\";\n }\n if (!this.columnName.getValue().isEmpty()) {\n details += \" s názvem '\" + this.columnName.getValue() + \"'\";\n }\n if (this.columnIsPrimary.getValue() != YesNoType._ANY) {\n details += \", které \" + (this.columnIsPrimary.getValue() == YesNoType.YES ? \"jsou\" : \"nejsou\") + \" primárním klíčem,\";\n }\n\n return \"Počet sloupců\" + details + \" v každé tabulce \" + this.countOp.getValue() + \" \" + this.count.getValue();\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "@Override\n public String getMessage() {\n return super.getMessage() + bonus_error + \"Not Found\";\n }", "@Override\r\n public String toString() {\r\n String s = \"Unknown Error\";\r\n String message = getLocalizedMessage();\r\n return (message != null) ? (message) : s;\r\n }", "@DefaultMessage(\"No records found\")\n @Key(\"gen.noRecordsFound\")\n String gen_noRecordsFound();", "public String toString(){\n StringBuffer returnString = new StringBuffer();\n for(int i = 0; i < this.matrixSize; i++){\n if(rows[i].length() != 0){\n returnString.append((i+1) + \":\" + rows[i]+ \"\\n\");\n }\n }\n return returnString.toString();\n }", "public boolean isNoDatamessagePresent() {\r\n\t\treturn isElementVisible(addVehiclesHeader.replace(\"Add Vehicle\", \"No data\"), SHORTWAIT);\r\n\t}", "@Override\n public String toString(){\n\n ArrayList<String> headers = new ArrayList<>();\n ArrayList<String[]> records = new ArrayList<>();\n\n for(Col col : columns){\n headers.add(col.getName());\n }\n\n if(getRecordSize() < 1){\n return headers.toString();\n }\n\n for(int i = 0; i < getRecordSize(); i++){\n\n ArrayList<Rec> recs = getRecordsByRowIndex(i);\n String[] r = new String[recs.size()];\n\n for(int j = 0; j < recs.size(); j++){\n r[j] = recs.get(j).getLastEntry().getData();\n }\n\n records.add(r);\n\n }\n\n return displayTable(headers, records);\n\n }", "public void showEmptyListMessage() {\n Toast.makeText(getBaseContext(), \"Lista de opiniones vacia!\", Toast.LENGTH_LONG).show();\n }", "private TextView getNoDataTextView(String content) {\n TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n layoutParams.gravity = Gravity.CENTER_HORIZONTAL;\n TextView textView = getTextView(content);\n textView.setLayoutParams(layoutParams);\n textView.setPadding(25, 30, 0, 30);\n return textView;\n }", "private boolean noMessage() {\n\t\treturn nbmsg==0;\n\t}", "public JLabelOperator lblTheDatabaseNameIsEmpty() {\n if (_lblTheDatabaseNameIsEmpty==null) {\n _lblTheDatabaseNameIsEmpty = new JLabelOperator(this,\n Bundle.getStringTrimmed(\"org.netbeans.modules.derby.ui.Bundle\", \"ERR_DatabaseNameEmpty\"));\n }\n return _lblTheDatabaseNameIsEmpty;\n }", "public void show() {\n if(heading.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in heading, nothing to show\");\r\n return;\r\n }\r\n if(rows.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in rows, nothing to show\");\r\n return;\r\n }\r\n for(String h : heading) {\r\n System.out.print(h + \" | \");\r\n }\r\n System.out.println(\"\");\r\n Set<String> keys = rows.keySet();\r\n for(String k : keys) {\r\n rows.get(k).show();\r\n System.out.println(\"\");\r\n }\r\n System.out.println(\"\");\r\n }", "@AutoEscape\n public String getModelIndexErrorMessage();", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private String getNullValueText() {\n return getNull();\n }", "@Override\n\tpublic int getNumRows() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int display() {\n\t\treturn 0;\n\t}", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "DataNotFoundMessage()\n\t{\n\t\t\n\t}", "public static void handleEmptyDetailException() {\n System.out.println(\"\\tSorry sir, you need to specify the details of the task.\");\n Duke.jarvis.printDivider();\n }", "public String detailedStatusMessage() {\n return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage();\n }", "public String fullCellText();", "@Override\n public String getErrorMessage() {\n return null;\n }", "protected String noAfk() {\n return cfg.getString(\"Messages.-afk\");\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}", "String printTable(String name) {\n\n try {\n return tables.get(name).getTable();\n } catch (IndexOutOfBoundsException e) {\n return \"ERROR: Cant print table\";\n } catch (NullPointerException e) {\n return \"ERROR: Cant print table\";\n }\n }", "public String getMessage() {\n return \"☹ OOPS!!! There isn't a task labeled \" + label;\n }", "public static void handleNoMatchException() {\n System.out.println(\"\\tThere no task in the list that matches your search, sir.\");\n Duke.jarvis.printDivider();\n }", "public Rendable getMessageDisplay(){\n return MESSAGE_DISPLAY;\n }", "public final String getMessageErreur() {\n\t\tString messageErreur = null;\n\n\t\t// il faut que toutes les taches obligatoires soient accomplies\n\t\tNSMutableArray<I_WorkFlowItem> tachesObligatoiresAbsentes = getTachesObligatoiresAbsentes();\n\t\tif (tachesObligatoiresAbsentes.count() > 0) {\n\t\t\tmessageErreur = \"Tâches non effectuées : \";\n\t\t\tmessageErreur += \"<ul>\";\n\t\t\tfor (int i = 0; i < tachesObligatoiresAbsentes.count(); i++) {\n\t\t\t\tI_WorkFlowItem tache = tachesObligatoiresAbsentes.objectAtIndex(i);\n\t\t\t\tmessageErreur += \"<li>\";\n\t\t\t\tmessageErreur += tache.libelle();\n\t\t\t\tmessageErreur += \"</li>\";\n\t\t\t}\n\t\t\tmessageErreur += \"</ul>\";\n\t\t}\n\n\t\treturn messageErreur;\n\t}", "private String defendRow() {\r\n for (int i = 0; i < gameHeight; i++) {\r\n if (!enLaneInfo.get(i).get(0).isEmpty() && myLaneInfo.get(i).get(1).isEmpty()) {\r\n return DEFENSE.buildCommand(7,i);\r\n }\r\n }\r\n return buildTurret();\r\n }", "private String getStatusDefaultMessage() {\r\n\r\n\t\tfinal Collection<GalleryMT20Item> allSelectedPhoto = _galleryMT20.getSelection();\r\n\t\tfinal int allPhotoSize = allSelectedPhoto.size();\r\n\r\n\t\treturn allPhotoSize == 0 //\r\n\t\t\t\t// hide status message when nothing is selected\r\n\t\t\t\t? UI.EMPTY_STRING\r\n\t\t\t\t: NLS.bind(Messages.Pic_Dir_StatusLabel_SelectedImages, allPhotoSize);\r\n\t}", "public CrosstabCell getWhenNoDataCell()\r\n {\r\n for (int i=0; i<getCrosstabElement().getCells().size(); ++i)\r\n {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(i);\r\n if (cell.getType() == cell.NODATA_CELL)\r\n {\r\n return cell;\r\n }\r\n }\r\n return null;\r\n }", "private void addEmptyRow()\n {\n TableLayout table = (TableLayout) findViewById(R.id.lossesTable);\n TableRow row = new TableRow(this);\n\n TextView emptyView1 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView1, \"\", R.drawable.emptyborder);\n TextView emptyView2 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView2, \"\", R.drawable.emptyborder);\n TextView emptyView3 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView3, \"\", R.drawable.emptyborder);\n TextView emptyView4 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView4, \"\", R.drawable.emptyborder);\n\n row.addView(emptyView1);\n row.addView(emptyView2);\n row.addView(emptyView3);\n row.addView(emptyView4);\n\n table.addView(row);\n }", "@Override\r\n\tpublic String getMessage() {\r\n\t\treturn \"Veuillez entrer un nombre positif\";\r\n\t}", "public String simple() {\r\n return super.getMessage();\r\n }", "public static void printEmptyTodoError() {\n botSpeak(Message.EMPTY_TODO_ERROR);\n }", "public String getErrorMessage() {\n return null;\r\n }", "public String updateRowCount() {\n return null;\n }", "public String getErrorMessage() {\n\t\treturn null;\n\t}", "public String getErrorMessage() {\n\t\treturn null;\n\t}", "public void displayNoRoute() {\n\t\tmetaInfo.showInfoWhenNoRouteIsSelected();\n\t\tutilities.removeAllPins();\n\t\tupdateLinesAndGrid();\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "public static String chosenCard1IsNull() {\n return \"The first card you chose is invalid, please select again: \";\n }", "public String getNoneText() {\r\n return ValueBindings.get(this, \"noneText\", noneText, \"None\");\r\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "public String diagnostic() {\n\t\tString output = \"\";\n\t\tString stateString = \"\";\n\t\tif (this.getState() == Player.HUMAN)\n\t\t\tstateString = \"is selected by the player\";\n\t\telse if (this.getState() == Player.COMPUTER)\n\t\t\tstateString = \"is selected by the computer\";\n\t\telse\n\t\t\tstateString = \"is not selected\";\n\t\t\t\n\t\toutput += \"The point \" + this.toString() + \" \" + stateString +\n\t\t\t\t\t\" and is associated with the rows:\\n\";\n\t\tfor (Row r : containingRows) {\n\t\t\toutput += r + \"\\n\";\n\t\t}\n\t\treturn output;\n\t}", "@Override\n\tpublic int getColumnDisplaySize(int arg0) throws SQLException {\n\t\treturn 0;\n\t}", "public static void noSupplierSelected(){\r\n\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\talert.setTitle(\"Error!\");\r\n\t\talert.setHeaderText(\"\");\r\n\t\talert.setContentText(\"Bitte wählen Sie einen Lieferanten aus!\");\r\n\t\talert.showAndWait();\r\n\t}", "@Test\n public void test035() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Table table0 = new Table(errorPage0, (String) null);\n // Undeclared exception!\n try {\n Component component0 = table0.body();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }" ]
[ "0.6559164", "0.6488702", "0.6467328", "0.6249669", "0.6150954", "0.6040549", "0.6040549", "0.5984542", "0.5966944", "0.59653366", "0.5944742", "0.5923682", "0.5923682", "0.5898448", "0.5878485", "0.58192855", "0.5811681", "0.578501", "0.5769989", "0.5746674", "0.57449794", "0.5738643", "0.57367074", "0.5705147", "0.56908345", "0.5686514", "0.56482923", "0.56194305", "0.5611257", "0.5594581", "0.55897343", "0.5575878", "0.5551847", "0.5507917", "0.5487234", "0.5481071", "0.5468395", "0.54646355", "0.54551524", "0.5438224", "0.54190093", "0.5395367", "0.5390327", "0.53664523", "0.53484505", "0.5331487", "0.53275204", "0.53258866", "0.5309324", "0.5298924", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.52846247", "0.5274324", "0.5265408", "0.52652913", "0.52563083", "0.525468", "0.5246058", "0.5245287", "0.52432114", "0.52238953", "0.5218185", "0.5206748", "0.5201929", "0.51960266", "0.5193118", "0.5192966", "0.51899827", "0.51893425", "0.5187046", "0.5182008", "0.5181267", "0.517163", "0.5164141", "0.5164141", "0.5156907", "0.5156446", "0.5156446", "0.51551634", "0.51511663", "0.5145029", "0.5139186", "0.51373637", "0.513564", "0.5132597" ]
0.56609744
26
Steps a string specifying the message to display when there is no row to display.
public void setNoPagedMessage(String noPagedMessage) { engine.setProperty(Properties.NO_PAGED_MESSAGE, noPagedMessage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void displayValidityReport() {\r\n\t\tif (this.tuple == null)\r\n\t\t\treturn;\r\n\t\tsetMessage(\"\");\r\n\t\tint row = this.tableView.getSelectedRow();\r\n\t\tif (row < this.tuple.getNumberOfEntries() && row >= 0)\r\n\t\t\tdisplayValidityReport(row);\r\n\t}", "private void displayNoRoomMsg() {\n\t\t \n\t\t //displays error message to user\n\t\t System.out.println(\"Unable to move in that direction.\\n\"\n\t\t\t\t \t\t\t\t+ \"There is no Room in that direction.\\n\");\n\t }", "void displayNoItemsSelectedErrorMessage();", "public static void displayNoResults()\n {\n tableData.add(new Company(null, \"No results found\"));\n tableView.setItems(tableData); \n }", "public static void handleEmptyDetailException() {\n System.out.println(\"\\tSorry sir, you need to specify the details of the task.\");\n Duke.jarvis.printDivider();\n }", "public static void printEmptyTodoError() {\n botSpeak(Message.EMPTY_TODO_ERROR);\n }", "@Test\n public void test035() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Table table0 = new Table(errorPage0, (String) null);\n // Undeclared exception!\n try {\n Component component0 = table0.body();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public static void emptyInventoryListMessage() {\n System.out.println(\"You do not have any Items in your inventory:(\");\n }", "private String defendRow() {\r\n for (int i = 0; i < gameHeight; i++) {\r\n if (!enLaneInfo.get(i).get(0).isEmpty() && myLaneInfo.get(i).get(1).isEmpty()) {\r\n return DEFENSE.buildCommand(7,i);\r\n }\r\n }\r\n return buildTurret();\r\n }", "@Test(timeout = 4000)\n public void test010() throws Throwable {\n String[] stringArray0 = new String[6];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@DefaultMessage(\"No records found\")\n @Key(\"gen.noRecordsFound\")\n String gen_noRecordsFound();", "public void show_message_no_data() {\n\t\tAlertDialog.Builder dialog=new AlertDialog.Builder(this);\n\t\t\n dialog.setTitle(\"Notice\");\n dialog.setMessage(\"No data for TI list\");\n \n dialog.setPositiveButton(\"OK\",new DialogListener(this, dialog, 0));\n \n dialog.create();\n dialog.show();\n\t\t\n\t}", "protected void handleNoRowFound()\r\n/* 37: */ throws DataAccessException\r\n/* 38: */ {\r\n/* 39: 92 */ throw new EmptyResultDataAccessException(\r\n/* 40: 93 */ \"LobStreamingResultSetExtractor did not find row in database\", 1);\r\n/* 41: */ }", "public static void handleNoMatchException() {\n System.out.println(\"\\tThere no task in the list that matches your search, sir.\");\n Duke.jarvis.printDivider();\n }", "public void printTable() {\r\n \tif (table.size() == 0)\r\n Logger.error(\"Table \" + table.getType() + \" is empty!\");\r\n else {\r\n table.forEachRow(new EachRowListenerPrint());\r\n }\r\n }", "@Override\n\t\tpublic void displayMessage() {\n\t\t\tsuper.displayMessage();\n\t\t}", "public static void handleEmptyDescriptionException() {\n System.out.println(\"\\tSorry sir, you need to include a description of the task as well.\");\n Duke.jarvis.printDivider();\n }", "public String getNoPagedMessage(javax.faces.context.FacesContext facesContext) {\n\t\tString s = engine.getStringProperty(Properties.NO_PAGED_MESSAGE, facesContext);\n\t\treturn s;\n\t}", "void outputError(String message) {\n\n fatalCount++;\n/*\n if (fatalCount == 1) {\n //fatalErrorsTable.addRow(ec.cr1ColRow(\n // \"Fatal errors\", true, \"red\", IHAlign.CENTER));\n TableRow row = new TableRow();\n row.addCell(new TableDataCell(\n \"<font color=red><b>Fatal errors</b></font>\").setHAlign(IHAlign.CENTER));\n fatalErrorsTable.addRow(row);\n } // if (fatalCount == 1)\n //fatalErrorsTable.addRow(ec.cr1ColRow(message));\n TableRow row = new TableRow();\n row.addCell(new TableDataCell(message));\n fatalErrorsTable.addRow(row);\n*/\n ec.writeFileLine(reportFile, message);\n if (dbg) System.out.println(\"<br>outputError: message = \" + message);\n }", "public void invalidSkip() {\n JOptionPane.showMessageDialog(frame, \"Invalid skip\", \"Invalid skip\", JOptionPane.ERROR_MESSAGE);\n\n }", "private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}", "public void show() {\n if(heading.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in heading, nothing to show\");\r\n return;\r\n }\r\n if(rows.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in rows, nothing to show\");\r\n return;\r\n }\r\n for(String h : heading) {\r\n System.out.print(h + \" | \");\r\n }\r\n System.out.println(\"\");\r\n Set<String> keys = rows.keySet();\r\n for(String k : keys) {\r\n rows.get(k).show();\r\n System.out.println(\"\");\r\n }\r\n System.out.println(\"\");\r\n }", "@AutoEscape\n public String getModelIndexErrorMessage();", "public static String printSelectRow1() {\n return \"Choose card 1 and write the corresponding row (Only choose Ints between 1 - 4 or 0 to quit) : \";\n }", "public void displayNoTable() {\n\t\tcontent.removeComponent(tableDisplay.getGrid());\n\t\tthis.addStyleName(\"fr_map_component_no_table\");\n\t}", "@Then(\"^I can view \\\"([^\\\"]*)\\\" message$\")\n public void iCanViewMessage(String arg0) throws Throwable {\n String actual=addingAndDeletingAProduct.cartEmptyMessage();\n assertThat(\"Summary page message doesn't match\",actual,Matchers.equalToIgnoringWhiteSpace(\"(empty)\"));\n }", "protected int checkRows(int rows, java.lang.String message) {\n // TODO codavaj!!\n return 0;\n }", "private void drawNoResultsMessage()\n\t{\n\t\tFont font = new Font(\"Invalid\", Font.BOLD, 30);\t\t\n\t\ttitle.setBounds((super.getWidth()/2) - 380, (super.getHeight()/2) - 70, 800, 50);\n\t\ttitle.setFont(font);\n\t\tthis.add(title);\n\t}", "@Override\n public String toString() {\n if(null != problemStatement) {\n if (problemStatement.equals(\"\"))\n return \"No problem statement\";\n return problemStatement;\n }\n return \"No problem Statement\";\n }", "@Test\n\tpublic void assertNoEmptyCell()\n\t{\n\t\terrorMessage = \"The test failed as the table has a empty cell\";\n\t\tList<WebElement> allRows = dashboardPage.getActualRows();\n\t\tfor (WebElement row : allRows) {\n\t\t\t List<WebElement> cells = row.findElements(By.tagName(\"td\"));\n\t\t\t for (WebElement cell : cells) {\n\t\t\t String cellContent = cell.getText();\n\t\t\t boolean emptyCell = cellContent.isEmpty();\n\t\t\t Assert.assertFalse(emptyCell, errorMessage);\n\t\t\t }\n\t\t}\n\t}", "public static String wrongPick() {\n return \"Wrong column or row picked!\";\n }", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Then ( \"^Unselected patient text is displayed when no patient is selected.$\" )\r\n public void noPatientSelectedText () {\r\n waitForAngular();\r\n assertTextPresent( \"Please select a patient for which to view Obstetrics Records.\" );\r\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[18];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, (String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n\tpublic String display() {\n\t\treturn null;\n\t}", "@Override\n\tpublic int getNumRows() {\n\t\treturn 0;\n\t}", "@Test\n public void test070() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Table table0 = new Table(errorPage0, \"File problem: \");\n // Undeclared exception!\n try {\n Component component0 = table0.wrapSelf();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public static void emptyDescriptionErr(String line){\n printLine();\n System.out.println(\" Oops!!! The description of a \" + line + \" cannot be empty. Please try again!\");\n printLine();\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[9];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(expected = SuperCsvCellProcessorException.class)\n\tpublic void testWithEmptyString() {\n\t\tprocessor.execute(\"\", ANONYMOUS_CSVCONTEXT);\n\t}", "public void showEmptyListMessage() {\n Toast.makeText(getBaseContext(), \"Lista de opiniones vacia!\", Toast.LENGTH_LONG).show();\n }", "private void addEmptyRow()\n {\n TableLayout table = (TableLayout) findViewById(R.id.lossesTable);\n TableRow row = new TableRow(this);\n\n TextView emptyView1 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView1, \"\", R.drawable.emptyborder);\n TextView emptyView2 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView2, \"\", R.drawable.emptyborder);\n TextView emptyView3 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView3, \"\", R.drawable.emptyborder);\n TextView emptyView4 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView4, \"\", R.drawable.emptyborder);\n\n row.addView(emptyView1);\n row.addView(emptyView2);\n row.addView(emptyView3);\n row.addView(emptyView4);\n\n table.addView(row);\n }", "public static void printEmptyTaskListMessage() {\n botSpeak(Message.EMPTY_TASK_LIST_MESSAGE);\n }", "public static void handleEmptyListException() {\n System.out.println(\"\\tYou do not have any pending task, sir.\");\n Duke.jarvis.printDivider();\n }", "@Override\n\tpublic void setEmptyError() {\n\t\tnew Customdialog_Base(this, \"정보를 모두 입력해 주세요.\").show();\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "@Then(\"no results appear in the search list\")\n public void no_results_appear_in_the_search_list() {\n assert true;\n }", "public static void handleEmptyKeywordException() {\n System.out.println(\"\\tSorry sir, you need to include a keyword so that I can filter out the required tasks.\");\n Duke.jarvis.printDivider();\n }", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"콘텐츠화면이 출력되었습니다\");\n\t}", "@Test(timeout = 4000)\n public void test013() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnNames((DBColumn[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Then ( \"the Prescription was not added\" )\r\n public void failure () {\r\n // assertTrue( driver.getPageSource().contains( \"Error occurred creating\r\n // prescription\" ) );\r\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName((String) null, (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n public void execute_showEmptyItemList() {\n ModelStubWithRecipeList modelStub = new ModelStubWithRecipeList(new RecipeList());\n CommandResult expectedCommandResult = new CommandResult(ListRecipeCommand.MESSAGE_NO_RECIPES,\n false, false, DisplayedInventoryType.RECIPES);\n assertCommandSuccess(listRecipeCommand, modelStub, expectedCommandResult, modelStub);\n }", "public static void viewEmptyBooths() {\n\r\n for (int i=0; i < firstName.length; i++) {\r\n if (firstName[i].equals(\"empty\")) {\r\n System.out.println(\"Booth number \" + i + \" is empty.\"); //Check whether the booth is empty or not\r\n }\r\n }\r\n System.out.println(\" \");\r\n System.out.println(\"Note: If all the booths are occupied nothing will display.\");\r\n }", "@Override\n public void onFail(String error) {\n\n activity.displayView(MainScreenActivity.TABLE_FRAGMENT, null);\n Toast.makeText(activity, error, Toast.LENGTH_LONG).show();\n }", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumn((DBColumn) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void Verify_Home_error_msg_displayed_on_Empty_Search()\r\n\t{\r\n\t\tString Runtime_text=Home_error_msg.getText();\r\n\t\tif(Runtime_text.contains(Exp_home_err_msg))\r\n\t\t\tSystem.out.println(\"As expected error msg displayed at webpage\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Expected home error message displayed at webpage\");\r\n\t}", "@Override\n\tpublic int display() {\n\t\treturn 0;\n\t}", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumn((DBColumn) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void sendError()\n {\n \tString resultText = Integer.toString(stdID);\n \tresultText += \": \";\n\t\tfor(int i = 0; i<registeredCourses.size();i++)\n\t\t{\n\t\t\tresultText += registeredCourses.get(i);\n\t\t\tresultText += \" \";\n\t\t}\n\t\tresultText += \"--\";\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(semesterNum);\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(0); \n\t\tresultText += \" \";\n\t\tprintResults.writeResult(resultText);\n \tSystem.exit(1);\n }", "private void emptyCell(Composite parent) {\n new Label(parent, SWT.NONE);\n }", "@Override\n\tpublic String getMessage() {\n\t\treturn null;\n\t}", "public void displayNoRoute() {\n\t\tmetaInfo.showInfoWhenNoRouteIsSelected();\n\t\tutilities.removeAllPins();\n\t\tupdateLinesAndGrid();\n\t}", "public static void printEmptyEventDescriptionError() {\n botSpeak(Message.EMPTY_EVENT_DESCRIPTION_ERROR);\n }", "private void onDataEmpty() {\n mArticlesView.showNoArticles();\n }", "@Then ( \"^No current pregnancies text is displayed when the patient is selected and has no current pregnancies.$\" )\r\n public void noCurrentPregnanciesText () {\r\n waitForAngular();\r\n assertTextPresent( \"There are no current Obstetrics records for this Patient.\" );\r\n }", "@Test(timeout = 4000)\n public void test033() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.currentLine((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public abstract void displayMsgBeforeRun();", "public void popUpEmptyTextView() {\n final Intent intent = new Intent(this, AddUserDetailsActivity.class);\n AlertDialog alertDialog = new AlertDialog.Builder(AddUserDetailsActivity.this).create();\n alertDialog.setTitle(\"ERROR\");\n alertDialog.setMessage(\"One of the fields have been left empty, please try again.\"\n );\n alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n //Intent intent = new Intent(this, AddUserDetailsActivity.class);\n startActivity(intent);\n finish();\n\n }\n });\n alertDialog.show();\n }", "private boolean noMessage() {\n\t\treturn nbmsg==0;\n\t}", "public static void handleEmptyTaskIdException() {\n System.out.println(\"\\tSorry sir, you need to include the task ID too.\");\n Duke.jarvis.printDivider();\n }", "@Override\n\t\tpublic String getMessage() {\n\t\t\treturn \"zero \" + super.getMessage();\n\t\t}", "DataNotFoundMessage()\n\t{\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName(\"pw?(g[&h!X$;C/\", (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private TextView getNoDataTextView(String content) {\n TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n layoutParams.gravity = Gravity.CENTER_HORIZONTAL;\n TextView textView = getTextView(content);\n textView.setLayoutParams(layoutParams);\n textView.setPadding(25, 30, 0, 30);\n return textView;\n }", "public void showUserTurnMessage() {\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\"dein Zug... (9 drücken um zu speichern)\");\n\t\tSystem.out.println(\"\");\n\t}", "public void actionPerformed(ActionEvent event){\n tableModel.addRow(blank);\r\n }", "@Test(timeout = 4000)\n public void test065() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumn((DBColumn) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n public void test078() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n // Undeclared exception!\n try {\n Component component0 = errorPage0.title(\"%n.Is\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public void displayMessage()\n\t{\n\t\t// this statement calls getCourseName to get the\n\t\t// name of the course this GradeBook represents\n\t\tSystem.out.printf( \"Welcome to the grade book for\\n%s!\\n\", getCourseName() );\n\t}", "String printTable(String name) {\n\n try {\n return tables.get(name).getTable();\n } catch (IndexOutOfBoundsException e) {\n return \"ERROR: Cant print table\";\n } catch (NullPointerException e) {\n return \"ERROR: Cant print table\";\n }\n }", "public void printFaultyEmployees() {\n System.out.println(localizer.getString(Messages.INVALID_LINES, violations.size()));\n }", "public void displayMessage(){//displayMessage body start\n\t\tSystem.out.printf(\"course name = %s\\n\", getCourseName());\n\t}", "public boolean isNoDatamessagePresent() {\r\n\t\treturn isElementVisible(addVehiclesHeader.replace(\"Add Vehicle\", \"No data\"), SHORTWAIT);\r\n\t}", "@Test(timeout = 4000)\n public void test060() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnNames((List<DBColumn>) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n public void showEmptyFieldsValidationError() {\n showError(R.string.product_config_empty_fields_validation_error);\n }", "public static void noSavingsPrinter() {\n System.out.println(line);\n System.out.println(NO_ACHIEVED_SAVINGS_MSG);\n System.out.println(line);\n }", "public void limpiarReporte(){\n\n\t\tmodelo.setRowCount(0);\n\n\t}", "public void illFormattedAnswer() {\n\n if (currentTeam.getTeamIndex() == teamIndex) {\n announcementsLabel.setText(\"You had an illformatted answer. Please try again\");\n } else {\n announcementsLabel.setText(currentTeam.getTeamName() + \" had an illformatted answer. They get to answer again.\");\n }\n }", "public String getMessage()\n {\n return super.getMessage() + invoice_error + \" not found\";\n }", "private void logBeginningOfTheTable() {\n\t\tLOG.log(Level.FINER, () -> \"Stupac tablice:\");\n\t\tLOG.log(Level.FINER, () -> \"=================================\");\n\t}", "@Override\n\tpublic String display() {\n\t\treturn \"null\";\n\t}", "public void addDefaultRowToTables(){\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n ArrayList<Student>templist = ListStudents();\n int noOfRows = ThreadLocalRandom.current().nextInt(0,5);\n Object rowData[] = new Object[3];\n \n if(noOfRows != 0){\n for(int i =1; i<=noOfRows; i++){\n \n rowData[0] = templist.get(i-1).userName;\n if (templist.get(i-1).paused == false){\n rowData[1] = \"Unpaused\";\n }\n Student s = new Student(templist.get(i-1).userName,templist.get(i-1).passWord,templist.get(i-1).email);\n students.add(s);\n model.addRow(rowData);\n } \n }\n if(students.isEmpty()){\n jLabel1.setVisible(true);\n } else{\n jLabel1.setVisible(false);\n }\n \n \n \n \n }", "public String getNoPagedMessage() {\n\t\treturn getNoPagedMessage(null);\n\t}", "public static void displayTableTitle()\r\n {\n }", "private void displayErrorMessages(Exception exception) {\n String message = exception.getMessage();\n endUserLog.error(String.format(\"[%s] message: %s\", exception.getClass().getSimpleName(), message));\n\n Throwable error = exception.getCause();\n boolean stop = false;\n while (error != null) {\n if (!(error instanceof ReplicatorException)) {\n // Break after the second non ReplicatorException in a\n // row is found\n if (stop)\n break;\n\n stop = true;\n } else\n stop = false;\n\n String message2 = error.getMessage();\n endUserLog.error(String.format(\"[%s] message: %s\", error.getClass().getSimpleName(), message2));\n error = error.getCause();\n }\n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}" ]
[ "0.64088136", "0.6297014", "0.61763275", "0.6086415", "0.5667458", "0.56472045", "0.5609208", "0.55679077", "0.5494457", "0.54286444", "0.54209554", "0.5413702", "0.5402042", "0.53806627", "0.53801733", "0.5349081", "0.53278154", "0.5275024", "0.526673", "0.5259567", "0.52595484", "0.52521557", "0.5238677", "0.5237145", "0.52286094", "0.52250135", "0.5224028", "0.5219433", "0.52130085", "0.5211494", "0.5198289", "0.5181601", "0.5181601", "0.5177262", "0.51764256", "0.51559293", "0.51525193", "0.51452017", "0.5142882", "0.51411235", "0.5137327", "0.51220226", "0.5113985", "0.509384", "0.5090085", "0.5088257", "0.5082194", "0.50769013", "0.50769013", "0.5062744", "0.50507987", "0.5050549", "0.50496006", "0.50486046", "0.50418", "0.50387096", "0.50378734", "0.5031117", "0.5028147", "0.5013895", "0.5004891", "0.49978697", "0.4997376", "0.4985862", "0.49824154", "0.4982302", "0.49760392", "0.49753773", "0.49709025", "0.49597445", "0.49581614", "0.4954513", "0.49463737", "0.49445724", "0.49432293", "0.4939518", "0.49363536", "0.4933773", "0.49296948", "0.492649", "0.49220717", "0.49219456", "0.49199328", "0.49196237", "0.49162975", "0.49135572", "0.49084628", "0.49076787", "0.4907246", "0.49047658", "0.49036944", "0.4895509", "0.48927912", "0.48907492", "0.4885393", "0.48818988", "0.4880938", "0.4866683", "0.48647383", "0.48526242", "0.48526242" ]
0.0
-1
Steps a string specifying the message to display when there is no row to display.
public boolean isNoPagedMessageSetted() { return engine.isPropertySetted(Properties.NO_PAGED_MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void displayValidityReport() {\r\n\t\tif (this.tuple == null)\r\n\t\t\treturn;\r\n\t\tsetMessage(\"\");\r\n\t\tint row = this.tableView.getSelectedRow();\r\n\t\tif (row < this.tuple.getNumberOfEntries() && row >= 0)\r\n\t\t\tdisplayValidityReport(row);\r\n\t}", "private void displayNoRoomMsg() {\n\t\t \n\t\t //displays error message to user\n\t\t System.out.println(\"Unable to move in that direction.\\n\"\n\t\t\t\t \t\t\t\t+ \"There is no Room in that direction.\\n\");\n\t }", "void displayNoItemsSelectedErrorMessage();", "public static void displayNoResults()\n {\n tableData.add(new Company(null, \"No results found\"));\n tableView.setItems(tableData); \n }", "public static void handleEmptyDetailException() {\n System.out.println(\"\\tSorry sir, you need to specify the details of the task.\");\n Duke.jarvis.printDivider();\n }", "public static void printEmptyTodoError() {\n botSpeak(Message.EMPTY_TODO_ERROR);\n }", "@Test\n public void test035() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Table table0 = new Table(errorPage0, (String) null);\n // Undeclared exception!\n try {\n Component component0 = table0.body();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public static void emptyInventoryListMessage() {\n System.out.println(\"You do not have any Items in your inventory:(\");\n }", "private String defendRow() {\r\n for (int i = 0; i < gameHeight; i++) {\r\n if (!enLaneInfo.get(i).get(0).isEmpty() && myLaneInfo.get(i).get(1).isEmpty()) {\r\n return DEFENSE.buildCommand(7,i);\r\n }\r\n }\r\n return buildTurret();\r\n }", "@Test(timeout = 4000)\n public void test010() throws Throwable {\n String[] stringArray0 = new String[6];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@DefaultMessage(\"No records found\")\n @Key(\"gen.noRecordsFound\")\n String gen_noRecordsFound();", "public void show_message_no_data() {\n\t\tAlertDialog.Builder dialog=new AlertDialog.Builder(this);\n\t\t\n dialog.setTitle(\"Notice\");\n dialog.setMessage(\"No data for TI list\");\n \n dialog.setPositiveButton(\"OK\",new DialogListener(this, dialog, 0));\n \n dialog.create();\n dialog.show();\n\t\t\n\t}", "protected void handleNoRowFound()\r\n/* 37: */ throws DataAccessException\r\n/* 38: */ {\r\n/* 39: 92 */ throw new EmptyResultDataAccessException(\r\n/* 40: 93 */ \"LobStreamingResultSetExtractor did not find row in database\", 1);\r\n/* 41: */ }", "public static void handleNoMatchException() {\n System.out.println(\"\\tThere no task in the list that matches your search, sir.\");\n Duke.jarvis.printDivider();\n }", "public void printTable() {\r\n \tif (table.size() == 0)\r\n Logger.error(\"Table \" + table.getType() + \" is empty!\");\r\n else {\r\n table.forEachRow(new EachRowListenerPrint());\r\n }\r\n }", "@Override\n\t\tpublic void displayMessage() {\n\t\t\tsuper.displayMessage();\n\t\t}", "public static void handleEmptyDescriptionException() {\n System.out.println(\"\\tSorry sir, you need to include a description of the task as well.\");\n Duke.jarvis.printDivider();\n }", "public String getNoPagedMessage(javax.faces.context.FacesContext facesContext) {\n\t\tString s = engine.getStringProperty(Properties.NO_PAGED_MESSAGE, facesContext);\n\t\treturn s;\n\t}", "void outputError(String message) {\n\n fatalCount++;\n/*\n if (fatalCount == 1) {\n //fatalErrorsTable.addRow(ec.cr1ColRow(\n // \"Fatal errors\", true, \"red\", IHAlign.CENTER));\n TableRow row = new TableRow();\n row.addCell(new TableDataCell(\n \"<font color=red><b>Fatal errors</b></font>\").setHAlign(IHAlign.CENTER));\n fatalErrorsTable.addRow(row);\n } // if (fatalCount == 1)\n //fatalErrorsTable.addRow(ec.cr1ColRow(message));\n TableRow row = new TableRow();\n row.addCell(new TableDataCell(message));\n fatalErrorsTable.addRow(row);\n*/\n ec.writeFileLine(reportFile, message);\n if (dbg) System.out.println(\"<br>outputError: message = \" + message);\n }", "public void invalidSkip() {\n JOptionPane.showMessageDialog(frame, \"Invalid skip\", \"Invalid skip\", JOptionPane.ERROR_MESSAGE);\n\n }", "private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}", "public void show() {\n if(heading.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in heading, nothing to show\");\r\n return;\r\n }\r\n if(rows.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in rows, nothing to show\");\r\n return;\r\n }\r\n for(String h : heading) {\r\n System.out.print(h + \" | \");\r\n }\r\n System.out.println(\"\");\r\n Set<String> keys = rows.keySet();\r\n for(String k : keys) {\r\n rows.get(k).show();\r\n System.out.println(\"\");\r\n }\r\n System.out.println(\"\");\r\n }", "@AutoEscape\n public String getModelIndexErrorMessage();", "public static String printSelectRow1() {\n return \"Choose card 1 and write the corresponding row (Only choose Ints between 1 - 4 or 0 to quit) : \";\n }", "public void displayNoTable() {\n\t\tcontent.removeComponent(tableDisplay.getGrid());\n\t\tthis.addStyleName(\"fr_map_component_no_table\");\n\t}", "@Then(\"^I can view \\\"([^\\\"]*)\\\" message$\")\n public void iCanViewMessage(String arg0) throws Throwable {\n String actual=addingAndDeletingAProduct.cartEmptyMessage();\n assertThat(\"Summary page message doesn't match\",actual,Matchers.equalToIgnoringWhiteSpace(\"(empty)\"));\n }", "protected int checkRows(int rows, java.lang.String message) {\n // TODO codavaj!!\n return 0;\n }", "private void drawNoResultsMessage()\n\t{\n\t\tFont font = new Font(\"Invalid\", Font.BOLD, 30);\t\t\n\t\ttitle.setBounds((super.getWidth()/2) - 380, (super.getHeight()/2) - 70, 800, 50);\n\t\ttitle.setFont(font);\n\t\tthis.add(title);\n\t}", "@Override\n public String toString() {\n if(null != problemStatement) {\n if (problemStatement.equals(\"\"))\n return \"No problem statement\";\n return problemStatement;\n }\n return \"No problem Statement\";\n }", "@Test\n\tpublic void assertNoEmptyCell()\n\t{\n\t\terrorMessage = \"The test failed as the table has a empty cell\";\n\t\tList<WebElement> allRows = dashboardPage.getActualRows();\n\t\tfor (WebElement row : allRows) {\n\t\t\t List<WebElement> cells = row.findElements(By.tagName(\"td\"));\n\t\t\t for (WebElement cell : cells) {\n\t\t\t String cellContent = cell.getText();\n\t\t\t boolean emptyCell = cellContent.isEmpty();\n\t\t\t Assert.assertFalse(emptyCell, errorMessage);\n\t\t\t }\n\t\t}\n\t}", "public static String wrongPick() {\n return \"Wrong column or row picked!\";\n }", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String display() {\n\t\treturn null;\r\n\t}", "@Then ( \"^Unselected patient text is displayed when no patient is selected.$\" )\r\n public void noPatientSelectedText () {\r\n waitForAngular();\r\n assertTextPresent( \"Please select a patient for which to view Obstetrics Records.\" );\r\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[18];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, (String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n\tpublic String display() {\n\t\treturn null;\n\t}", "@Override\n\tpublic int getNumRows() {\n\t\treturn 0;\n\t}", "@Test\n public void test070() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Table table0 = new Table(errorPage0, \"File problem: \");\n // Undeclared exception!\n try {\n Component component0 = table0.wrapSelf();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public static void emptyDescriptionErr(String line){\n printLine();\n System.out.println(\" Oops!!! The description of a \" + line + \" cannot be empty. Please try again!\");\n printLine();\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[9];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(expected = SuperCsvCellProcessorException.class)\n\tpublic void testWithEmptyString() {\n\t\tprocessor.execute(\"\", ANONYMOUS_CSVCONTEXT);\n\t}", "public void showEmptyListMessage() {\n Toast.makeText(getBaseContext(), \"Lista de opiniones vacia!\", Toast.LENGTH_LONG).show();\n }", "private void addEmptyRow()\n {\n TableLayout table = (TableLayout) findViewById(R.id.lossesTable);\n TableRow row = new TableRow(this);\n\n TextView emptyView1 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView1, \"\", R.drawable.emptyborder);\n TextView emptyView2 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView2, \"\", R.drawable.emptyborder);\n TextView emptyView3 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView3, \"\", R.drawable.emptyborder);\n TextView emptyView4 = new TextView(this);\n ((BadBudgetApplication)this.getApplication()).initializeTableCell(emptyView4, \"\", R.drawable.emptyborder);\n\n row.addView(emptyView1);\n row.addView(emptyView2);\n row.addView(emptyView3);\n row.addView(emptyView4);\n\n table.addView(row);\n }", "public static void printEmptyTaskListMessage() {\n botSpeak(Message.EMPTY_TASK_LIST_MESSAGE);\n }", "public static void handleEmptyListException() {\n System.out.println(\"\\tYou do not have any pending task, sir.\");\n Duke.jarvis.printDivider();\n }", "@Override\n\tpublic void setEmptyError() {\n\t\tnew Customdialog_Base(this, \"정보를 모두 입력해 주세요.\").show();\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "public String fullCellText() {\r\n\t\treturn \"\";\r\n\t}", "@Then(\"no results appear in the search list\")\n public void no_results_appear_in_the_search_list() {\n assert true;\n }", "public static void handleEmptyKeywordException() {\n System.out.println(\"\\tSorry sir, you need to include a keyword so that I can filter out the required tasks.\");\n Duke.jarvis.printDivider();\n }", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"콘텐츠화면이 출력되었습니다\");\n\t}", "@Test(timeout = 4000)\n public void test013() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnNames((DBColumn[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Then ( \"the Prescription was not added\" )\r\n public void failure () {\r\n // assertTrue( driver.getPageSource().contains( \"Error occurred creating\r\n // prescription\" ) );\r\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName((String) null, (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n public void execute_showEmptyItemList() {\n ModelStubWithRecipeList modelStub = new ModelStubWithRecipeList(new RecipeList());\n CommandResult expectedCommandResult = new CommandResult(ListRecipeCommand.MESSAGE_NO_RECIPES,\n false, false, DisplayedInventoryType.RECIPES);\n assertCommandSuccess(listRecipeCommand, modelStub, expectedCommandResult, modelStub);\n }", "public static void viewEmptyBooths() {\n\r\n for (int i=0; i < firstName.length; i++) {\r\n if (firstName[i].equals(\"empty\")) {\r\n System.out.println(\"Booth number \" + i + \" is empty.\"); //Check whether the booth is empty or not\r\n }\r\n }\r\n System.out.println(\" \");\r\n System.out.println(\"Note: If all the booths are occupied nothing will display.\");\r\n }", "@Override\n public void onFail(String error) {\n\n activity.displayView(MainScreenActivity.TABLE_FRAGMENT, null);\n Toast.makeText(activity, error, Toast.LENGTH_LONG).show();\n }", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumn((DBColumn) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void Verify_Home_error_msg_displayed_on_Empty_Search()\r\n\t{\r\n\t\tString Runtime_text=Home_error_msg.getText();\r\n\t\tif(Runtime_text.contains(Exp_home_err_msg))\r\n\t\t\tSystem.out.println(\"As expected error msg displayed at webpage\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Expected home error message displayed at webpage\");\r\n\t}", "@Override\n\tpublic int display() {\n\t\treturn 0;\n\t}", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumn((DBColumn) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void sendError()\n {\n \tString resultText = Integer.toString(stdID);\n \tresultText += \": \";\n\t\tfor(int i = 0; i<registeredCourses.size();i++)\n\t\t{\n\t\t\tresultText += registeredCourses.get(i);\n\t\t\tresultText += \" \";\n\t\t}\n\t\tresultText += \"--\";\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(semesterNum);\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(0); \n\t\tresultText += \" \";\n\t\tprintResults.writeResult(resultText);\n \tSystem.exit(1);\n }", "private void emptyCell(Composite parent) {\n new Label(parent, SWT.NONE);\n }", "@Override\n\tpublic String getMessage() {\n\t\treturn null;\n\t}", "public void displayNoRoute() {\n\t\tmetaInfo.showInfoWhenNoRouteIsSelected();\n\t\tutilities.removeAllPins();\n\t\tupdateLinesAndGrid();\n\t}", "public static void printEmptyEventDescriptionError() {\n botSpeak(Message.EMPTY_EVENT_DESCRIPTION_ERROR);\n }", "private void onDataEmpty() {\n mArticlesView.showNoArticles();\n }", "@Then ( \"^No current pregnancies text is displayed when the patient is selected and has no current pregnancies.$\" )\r\n public void noCurrentPregnanciesText () {\r\n waitForAngular();\r\n assertTextPresent( \"There are no current Obstetrics records for this Patient.\" );\r\n }", "@Test(timeout = 4000)\n public void test033() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.currentLine((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public abstract void displayMsgBeforeRun();", "public void popUpEmptyTextView() {\n final Intent intent = new Intent(this, AddUserDetailsActivity.class);\n AlertDialog alertDialog = new AlertDialog.Builder(AddUserDetailsActivity.this).create();\n alertDialog.setTitle(\"ERROR\");\n alertDialog.setMessage(\"One of the fields have been left empty, please try again.\"\n );\n alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n //Intent intent = new Intent(this, AddUserDetailsActivity.class);\n startActivity(intent);\n finish();\n\n }\n });\n alertDialog.show();\n }", "private boolean noMessage() {\n\t\treturn nbmsg==0;\n\t}", "public static void handleEmptyTaskIdException() {\n System.out.println(\"\\tSorry sir, you need to include the task ID too.\");\n Duke.jarvis.printDivider();\n }", "@Override\n\t\tpublic String getMessage() {\n\t\t\treturn \"zero \" + super.getMessage();\n\t\t}", "DataNotFoundMessage()\n\t{\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName(\"pw?(g[&h!X$;C/\", (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private TextView getNoDataTextView(String content) {\n TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n layoutParams.gravity = Gravity.CENTER_HORIZONTAL;\n TextView textView = getTextView(content);\n textView.setLayoutParams(layoutParams);\n textView.setPadding(25, 30, 0, 30);\n return textView;\n }", "public void showUserTurnMessage() {\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\"dein Zug... (9 drücken um zu speichern)\");\n\t\tSystem.out.println(\"\");\n\t}", "public void actionPerformed(ActionEvent event){\n tableModel.addRow(blank);\r\n }", "@Test(timeout = 4000)\n public void test065() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumn((DBColumn) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n public void test078() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n // Undeclared exception!\n try {\n Component component0 = errorPage0.title(\"%n.Is\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public void displayMessage()\n\t{\n\t\t// this statement calls getCourseName to get the\n\t\t// name of the course this GradeBook represents\n\t\tSystem.out.printf( \"Welcome to the grade book for\\n%s!\\n\", getCourseName() );\n\t}", "String printTable(String name) {\n\n try {\n return tables.get(name).getTable();\n } catch (IndexOutOfBoundsException e) {\n return \"ERROR: Cant print table\";\n } catch (NullPointerException e) {\n return \"ERROR: Cant print table\";\n }\n }", "public void printFaultyEmployees() {\n System.out.println(localizer.getString(Messages.INVALID_LINES, violations.size()));\n }", "public void displayMessage(){//displayMessage body start\n\t\tSystem.out.printf(\"course name = %s\\n\", getCourseName());\n\t}", "public boolean isNoDatamessagePresent() {\r\n\t\treturn isElementVisible(addVehiclesHeader.replace(\"Add Vehicle\", \"No data\"), SHORTWAIT);\r\n\t}", "@Test(timeout = 4000)\n public void test060() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnNames((List<DBColumn>) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n public void showEmptyFieldsValidationError() {\n showError(R.string.product_config_empty_fields_validation_error);\n }", "public static void noSavingsPrinter() {\n System.out.println(line);\n System.out.println(NO_ACHIEVED_SAVINGS_MSG);\n System.out.println(line);\n }", "public void limpiarReporte(){\n\n\t\tmodelo.setRowCount(0);\n\n\t}", "public void illFormattedAnswer() {\n\n if (currentTeam.getTeamIndex() == teamIndex) {\n announcementsLabel.setText(\"You had an illformatted answer. Please try again\");\n } else {\n announcementsLabel.setText(currentTeam.getTeamName() + \" had an illformatted answer. They get to answer again.\");\n }\n }", "public String getMessage()\n {\n return super.getMessage() + invoice_error + \" not found\";\n }", "private void logBeginningOfTheTable() {\n\t\tLOG.log(Level.FINER, () -> \"Stupac tablice:\");\n\t\tLOG.log(Level.FINER, () -> \"=================================\");\n\t}", "@Override\n\tpublic String display() {\n\t\treturn \"null\";\n\t}", "public void addDefaultRowToTables(){\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n ArrayList<Student>templist = ListStudents();\n int noOfRows = ThreadLocalRandom.current().nextInt(0,5);\n Object rowData[] = new Object[3];\n \n if(noOfRows != 0){\n for(int i =1; i<=noOfRows; i++){\n \n rowData[0] = templist.get(i-1).userName;\n if (templist.get(i-1).paused == false){\n rowData[1] = \"Unpaused\";\n }\n Student s = new Student(templist.get(i-1).userName,templist.get(i-1).passWord,templist.get(i-1).email);\n students.add(s);\n model.addRow(rowData);\n } \n }\n if(students.isEmpty()){\n jLabel1.setVisible(true);\n } else{\n jLabel1.setVisible(false);\n }\n \n \n \n \n }", "public String getNoPagedMessage() {\n\t\treturn getNoPagedMessage(null);\n\t}", "public static void displayTableTitle()\r\n {\n }", "private void displayErrorMessages(Exception exception) {\n String message = exception.getMessage();\n endUserLog.error(String.format(\"[%s] message: %s\", exception.getClass().getSimpleName(), message));\n\n Throwable error = exception.getCause();\n boolean stop = false;\n while (error != null) {\n if (!(error instanceof ReplicatorException)) {\n // Break after the second non ReplicatorException in a\n // row is found\n if (stop)\n break;\n\n stop = true;\n } else\n stop = false;\n\n String message2 = error.getMessage();\n endUserLog.error(String.format(\"[%s] message: %s\", error.getClass().getSimpleName(), message2));\n error = error.getCause();\n }\n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}" ]
[ "0.64088136", "0.6297014", "0.61763275", "0.6086415", "0.5667458", "0.56472045", "0.5609208", "0.55679077", "0.5494457", "0.54286444", "0.54209554", "0.5413702", "0.5402042", "0.53806627", "0.53801733", "0.5349081", "0.53278154", "0.5275024", "0.526673", "0.5259567", "0.52595484", "0.52521557", "0.5238677", "0.5237145", "0.52286094", "0.52250135", "0.5224028", "0.5219433", "0.52130085", "0.5211494", "0.5198289", "0.5181601", "0.5181601", "0.5177262", "0.51764256", "0.51559293", "0.51525193", "0.51452017", "0.5142882", "0.51411235", "0.5137327", "0.51220226", "0.5113985", "0.509384", "0.5090085", "0.5088257", "0.5082194", "0.50769013", "0.50769013", "0.5062744", "0.50507987", "0.5050549", "0.50496006", "0.50486046", "0.50418", "0.50387096", "0.50378734", "0.5031117", "0.5028147", "0.5013895", "0.5004891", "0.49978697", "0.4997376", "0.4985862", "0.49824154", "0.4982302", "0.49760392", "0.49753773", "0.49709025", "0.49597445", "0.49581614", "0.4954513", "0.49463737", "0.49445724", "0.49432293", "0.4939518", "0.49363536", "0.4933773", "0.49296948", "0.492649", "0.49220717", "0.49219456", "0.49199328", "0.49196237", "0.49162975", "0.49135572", "0.49084628", "0.49076787", "0.4907246", "0.49047658", "0.49036944", "0.4895509", "0.48927912", "0.48907492", "0.4885393", "0.48818988", "0.4880938", "0.4866683", "0.48647383", "0.48526242", "0.48526242" ]
0.0
-1
Check if the last executed deployment scripts was successful.
@Override public boolean wasLastScriptSuccessful() { if (LOG.isDebugEnabled()) { LOG.debug("Checking if the last deployment script was successful"); } final StringBuilder queryBuilder = new StringBuilder(79); // The creation time is unreliable because on fast machines two items can have the same creation time. queryBuilder.append("SELECT {e.").append(ScriptExecutionModel.PK).append("}") .append(" FROM {").append(ScriptExecutionModel._TYPECODE) .append(" as e} WHERE {e.").append(ScriptExecutionModel.RESULT).append("} <> ?").append("willBeExecutedResult") .append(" ORDER BY {pk} DESC"); if (LOG.isTraceEnabled()) { LOG.trace("Executing the query: '{}'.", queryBuilder); } final FlexibleSearchQuery query = new FlexibleSearchQuery(queryBuilder.toString()); query.setCount(1); // The first range must have one element. query.setNeedTotal(false); query.addQueryParameter("willBeExecutedResult", scriptExecutionResultDao.getWillBeExecuted()); final SearchResult<ScriptExecutionModel> result = this.flexibleSearchService.search(query); if (result.getCount() == 0) { if (LOG.isTraceEnabled()) { LOG.trace("No script was run. Returning true."); } return true; } final ScriptExecutionModel lastScript = result.getResult().iterator().next(); final boolean hadErrors = this.scriptExecutionResultDao.getErrorResult().equals(lastScript.getResult()); if (LOG.isDebugEnabled()) { LOG.debug("Had the last script errors? {}", hadErrors); } return !hadErrors; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean wasLastScriptSuccessful() {\n return this.deploymentScriptService.wasLastScriptSuccessful();\n }", "public boolean runAllPendingScripts() {\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Running all pending update deployment scripts.\");\n }\n return this.runAllPendingScriptsInAllExtensions(false);\n }", "public boolean runDeploymentScripts(final UpdatingSystemExtensionContext context, final boolean runInitScripts) {\n if (this.isWasThereAnError()) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"There was an error running the deployment scripts of the previous extensions. \"\n + \"Due to this the deployment scripts of the extension {} will be ignored.\", context.getExtensionName());\n }\n return true;\n }\n return runDeploymentScriptsAndHandleErrors(context, runInitScripts);\n }", "public boolean wasSuccessful() throws TavernaException, ProcessException {\n try {\n boolean result = runner.waitFor() == 0;\n if (outputFile == null){\n saveOutput();\n }\n return result;\n } catch (InterruptedException ex) {\n throw new TavernaException(\"Error checking if run was successfull\", ex);\n }\n }", "public boolean isSuccessful() {\r\n return isTargetTemplateSetPresent() && missing.isEmpty();\r\n }", "private void checkStatus()\n {\n // If the last command failed\n if(!project.getLastCommandStatus())\n {\n view.alert(\"Error: \" + project.getLastCommandStatusMessage());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCommand lastCmd = project.getLastCommand();\n\t\t\tif (lastCmd != null && lastCmd.hasOptionalState())\n\t\t\t{\n\t\t\t\tview.loadFromJSON(lastCmd.getOptionalState());\n\t\t\t\tview.onUpdate(project.getProjectSnapshot(), false);\n\t\t\t}\n\t\t}\n }", "public boolean hasScriptRun() {\n return scriptHistory != null && scriptHistory.isRan();\n }", "@SystemSetup(type = SystemSetup.Type.ALL, process = SystemSetup.Process.ALL)\n public void runUpdateDeploymentScripts(\n final SystemSetupContext hybrisContext) {\n if (getConfiguredCreateDataStep().equals(hybrisContext.getType())) {\n final UpdatingSystemExtensionContext context = this.getUpdatingContext(hybrisContext);\n if (this.extensionHelper.isFirstExtension(context) && SystemSetup.Process.UPDATE.equals(context.getProcess())) {\n this.clearErrorFlag();\n }\n this.runDeploymentScripts(context, false);\n } else {\n if (LOG.isTraceEnabled()) {\n LOG.trace(String.format(\"Not running the deployment update scripts because were are in the %s data creation.\", hybrisContext.getType()));\n }\n }\n }", "public boolean hasBeenExecuted() {\n\t\treturn executed;\n\t}", "protected void executeScripts(List<Script> scripts) {\n for (Script script : scripts) {\n try {\n // We register the script execution, but we indicate it to be unsuccessful. If anything goes wrong or if the update is\n // interrupted before being completed, this will be the final state and the DbMaintainer will do a from-scratch update the next time\n ExecutedScript executedScript = new ExecutedScript(script, new Date(), false);\n versionSource.registerExecutedScript(executedScript);\n\n logger.info(\"Executing script \" + script.getFileName());\n scriptRunner.execute(script.getScriptContentHandle());\n // We now register the previously registered script execution as being successful\n executedScript.setSuccessful(true);\n versionSource.updateExecutedScript(executedScript);\n\n } catch (UnitilsException e) {\n logger.error(\"Error while executing script \" + script.getFileName(), e);\n throw e;\n }\n }\n }", "public boolean hasExitCode() {\n return result.hasExitCode();\n }", "public boolean hasExitCode() {\n return result.hasExitCode();\n }", "public boolean hasExitCode() {\n return result.hasExitCode();\n }", "public static boolean isFinishedStartupSuccessfully() {\r\n return finishedStartupSuccessfully;\r\n }", "public boolean scriptGenerated() {\n return scriptHistory != null;\n }", "public boolean hasMigrationFinished();", "boolean hasIsSuccess();", "public boolean isToDeploy() {\r\n\t\treturn attachUpdates>0 || catUpdates>0 || catTransUpdates>0 || prodUpdates>0 || prodTransUpdates>0 || menuUpdates>0;\r\n\t}", "public boolean hasSucceeded() {\n return succeeded;\n }", "public boolean areScriptsRunning()\n\t{\n\t\tfor (final Script script : scripts.values())\n\t\t{\n\t\t\tif (ScriptRunningState.RUNNING.equals(script.getStatus()))\n\t\t\t{\n\t\t\t\tlogger.debug(\"Script {} is still running\", script.getName());\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "boolean hasExecution();", "public boolean isSuccessful() {\n return code >= 200 && code < 300;\n }", "@Override\n public boolean performFinish() {\n String outputDirName = getFinishPage().getOutputDir();\n File statusDir = new File(outputDirName);\n if (!statusDir.exists() || !statusDir.isDirectory()) {\n UIUtils.errorMessageBox(getShell(), Labels.getString(\"LoadWizard.errorValidFolder\")); //$NON-NLS-1$\n return false;\n }\n // set the files for status output\n try {\n getController().setStatusFiles(outputDirName, false, true);\n getController().saveConfig();\n } catch (ProcessInitializationException e) {\n UIUtils.errorMessageBox(getShell(), e);\n return false;\n }\n\n int val = UIUtils.warningConfMessageBox(getShell(), getConfirmationText());\n\n if (val != SWT.YES) { return false; }\n\n if (!wizardhook_validateFinish()) { return false; }\n\n try {\n ProgressMonitorDialog dlg = new ProgressMonitorDialog(getShell());\n dlg.run(true, true, new SWTLoadRunable(getController()));\n\n } catch (InvocationTargetException e) {\n logger.error(Labels.getString(\"LoadWizard.errorAction\"), e); //$NON-NLS-1$\n UIUtils.errorMessageBox(getShell(), e.getCause() != null ? e.getCause() : e);\n return false;\n } catch (InterruptedException e) {\n logger.error(Labels.getString(\"LoadWizard.errorAction\"), e); //$NON-NLS-1$\n UIUtils.errorMessageBox(getShell(), e.getCause() != null ? e.getCause() : e);\n return false;\n }\n\n return true;\n }", "protected void executionSuccess() {\n this.isUndoable = true;\n }", "@Override\n\t\tpublic boolean isSuccess() {\n\t\t\treturn false;\n\t\t}", "private void checkExecutionStatus() {\r\n\t\tif (detenido) {\r\n\t\t\tthrow new RejectedExecutionException(\"el procesador está detenido. no puede aceptar más tareas\");\r\n\t\t}\r\n\t}", "private boolean executeCMSSyncJob() {\n\t\ttry {\n\t\t\tgetSyncJobService().executeCatalogSyncJob(\"frameit_content\");\n\t\t\treturn true;\n\t\t} catch (final SystemException e) {\n\t\t\tLOG.error(\"An exception was thrown trying to sync the CMS content catalog 'frameit_content'!\", e);\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasFinalTallyResult();", "public boolean wasScriptOutputAnalyzed() {\n return scriptHistory != null && scriptHistory.isOutputAnalyzed();\n }", "public boolean isExecuted()\n {\n return executed;\n }", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "boolean isSetupDone();", "public boolean wasSuccessful() {\n return this.failureCount() == 0 && this.errorCount() == 0;\n }", "public void afterMojoExecutionSuccess()\n throws MojoExecutionException;", "public boolean performFinish() {\n\t\t try\n\t\t {\n\t\t WorkspaceModifyOperation op = new WorkspaceModifyOperation() {\n\t\t protected void execute(IProgressMonitor monitor)\n\t\t {\n\t\t createProject(monitor != null ?\n\t\t monitor : new NullProgressMonitor());\n\t\t }\n\t\t };\n\t\t getContainer().run(false,true,op);\n\t\t }\n\t\t catch(InvocationTargetException x)\n\t\t {\n\t\t reportError(x);\n\t\t return false;\n\t\t }\n\t\t catch(InterruptedException x)\n\t\t {\n\t\t reportError(x);\n\t\t return false;\n\t\t }\n\t\t return true; \n\t}", "public boolean checkTamper()\n\t{\n\t\tboolean isDone = false;\n\t\tVector<Resource> allResources = new Vector<Resource>();\n\t\tResource resourceJournal = new Resource(DEFAULT_JOURANAL_LOG_FILE, JOURNAL_LOG_FILE_TYPE, JOURNAL_LOG_FILE_ID, FileDownload.DEFAULT_LOG_FOLDER, DEFAULT_JOURANAL_LOG_FILE_EXT);\n\t\tResource resourcePinpad = new Resource(DEFAULT_PINPAD_LOG_FILE, PINPAD_LOG_FILE_TYPE, PINPAD_LOG_FILE_ID, FileDownload.DEFAULT_LOG_FOLDER, DEFAULT_PINPAD_LOG_FILE_EXT);\n\t\tallResources.add(resourceJournal);\n\t\tallResources.add(resourcePinpad);\n\t\tif(FileDownload.getInstance().startDownload(allResources, false))\n\t\t{\n\t\t\tFile journal = new File(FileDownload.DEFAULT_LOG_FOLDER + \"//JOURNAL.log\");\n\t\t\tFile pinpad = new File (FileDownload.DEFAULT_LOG_FOLDER + \"//PINPAD_HIST\");\n\t\t\tDate firstDate=null;\n\t\t\tif(journal.exists())\n\t\t\t{\n\t\t\t\t/*First read the JOURNAl file and find the >>>>>> START DATE*/\t\t\t\n\t\t\t\tfirstDate = ParsePinPadLogsFile.getInstance().deviceLastStartDate(resourceJournal.getLogFilePath());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfirstDate = downloadJournalHist();\n\t\t\t}\n\t\t\tif(pinpad.exists())\n\t\t\t{\n\t\t\t\t/*Get the current date which is as last date here*/\n\t\t\t\tDate lastDate = currentDateofSystem();\n\t\t\t\tFile currFile = new File(resourcePinpad.getLogFilePath() );\n\t\t\t\tFile DestDirFolder = new File(FileDownload.DEFAULT_LOG_FOLDER);\n\t\t\t\tFileCompression.getInstance().uncompress(currFile, DestDirFolder);\n\t\t\t\tFile uncompressFilesDirectory = new File(FileDownload.DEFAULT_LOG_FOLDER +\"//gilbarco//logs\");\n\t\t\t\tParsePinPadLogsFile.getInstance().logByDateAction(uncompressFilesDirectory.toString(),firstDate,lastDate);\n\t\t\t\tif(uncompressFilesDirectory.length()!=0)\n\t\t\t\t{\n\t\t\t\t\tParsePinPadLogsFile.getInstance().unZipExtractedTarFiles(uncompressFilesDirectory, \".txt\");\n\t\t\t\t\tisTampered = ParsePinPadLogsFile.getInstance().searchKeyWord(uncompressFilesDirectory,DEFAULT_KEYWORD_TAMPER);\n\t\t\t\t}\n\t\t\t\tif(isTampered)\n\t\t\t\t{\n\t\t\t\t\tstatusMsg = \"tampered\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstatusMsg = \"not tampered\";\n\t\t\t\t}\n\t\t\t\tisDone = true;\n\t\t\t\tEdtFileUtil.delete(DestDirFolder, true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlogger.info(\"Pinpad and journal logs download failed\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlogger.info(\"Pinpad and journal logs download failed\");\n\t\t}\n\t\tlogger.info(\"Parsing pinpad logs process completed\");\n\t\treturn isDone;\n\t\t\n\t}", "public boolean scriptGenerationAvailable() {\n return scriptHistory == null && simConfigFile != null && simSpec != null;\n }", "boolean isSuccessful();", "public Guard isFinishedExecution() {\n if (depth == PSymGlobal.getConfiguration().getMaxStepBound()) {\n return Guard.constTrue();\n } else {\n return allMachinesHalted;\n }\n }", "protected boolean isFinished()\n\t{\n\t\treturn true;\n\t}", "public boolean isSuccess();", "public boolean isSuccess();", "boolean hasLastAction();", "private boolean executeProductSyncJob() {\n\t\ttry {\n\t\t\tgetSyncJobService().executeCatalogSyncJob(\"Default\");\n\t\t\treturn true;\n\t\t} catch (final SystemException e) {\n\t\t\tLOG.error(\"An exception was thrown trying to sync the product content catalog 'Default'!\", e);\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean performOk() {\n\t\ttry {\n\t\t\tProjectAdapter projectAdapter = getProjectAdapter();\n\t\t\tif (projectAdapter != null) {\n\t\t\t\tBuildProperties buildProperties = getBuildProperties();\n\t\t\t\tbuildProperties.setCustomInfoPListContent(_customInfoPListText.getText());\n\t\t\t\tbuildProperties.setServletDeployment(_servletDeploymentCheck.getSelection());\n\t\t\t\tbuildProperties.setWebXML(_generateWebXMLCheck.getSelection());\n\t\t\t\tbuildProperties.setWebXML_CustomContent(_customWebXMLText.getText());\n\n\t\t\t\tProjectFrameworkAdapter projectFrameworkAdapter = getProjectFrameworkAdapter();\n\t\t\t\tif (buildProperties.isServletDeployment()) {\n\t\t\t\t\tprojectFrameworkAdapter.addFrameworkNamed(\"JavaWOJSPServlet\");\n\t\t\t\t} else {\n\t\t\t\t\tprojectFrameworkAdapter.removeFrameworkNamed(\"JavaWOJSPServlet\");\n\t\t\t\t}\n\n\t\t\t\tfor (Root root : _embedButtons.keySet()) {\n\t\t\t\t\tButton embedButton = _embedButtons.get(root);\n\t\t\t\t\tboolean embed = buildProperties.isServletDeployment() || (embedButton.isEnabled() && embedButton.getSelection());\n\t\t\t\t\tbuildProperties.setEmbed(root, embed);\n\t\t\t\t}\n\n\t\t\t\tbuildProperties.setJavaClient(_javaClientButton.getSelection());\n\t\t\t\tbuildProperties.setJavaWebStart(_javaClientButton.getSelection() && _javaWebStartButton.getSelection());\n\t\t\t\tbuildProperties.save();\n\t\t\t}\n\t\t} catch (Exception up) {\n\t\t\tUIPlugin.getDefault().log(up);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isLastVersion();", "public boolean isSuccessful() {\n return responseCode >= 200 && responseCode < 300;\n }", "public boolean isSuccessful() {\n //loadSettingsFromFile(filePath);\n Login();\n if (EXPECTED_TITLE.equals(driver.getTitle()))\n return true;\n else\n return false;\n }", "private boolean checkExecution() {\n if (!checkPhoneStatusOK()) {\n return false;\n }\n if (!checkBatteryLevelOK()) {\n return false;\n }\n return true;\n }", "public void checkFinish()\t{\n\t\tif(readCompareResult() == true)\t{\n\t\t\tfinished = true;\n\t\t}\n\t}", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished()\n\t{\n\t\treturn false;\n\t}", "public boolean isDeployed(String deploymentUnitId) {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\r\n if (state == STATE_SUCCESS) {\r\n // Success\r\n return true;\r\n }\r\n if (state == STATE_FAILURE) {\r\n // Failure\r\n return true;\r\n }\r\n return false;\r\n }", "protected boolean isFinished() {\n\t\treturn false;\r\n\t}", "boolean hasExitStatus();", "boolean hasScript();", "private boolean commitChecker() {\n\t\tFile file = new File(stagePath);\n\t\tFile[] files = file.listFiles();\n\t\tif (files.length == 0 && untrackedFiles.size() == 0) {\n\t\t\tSystem.out.println(\"No changes added to the commit.\");\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected boolean isFinished(){\r\n return true;\r\n }", "public Status waitUntilFinished();", "public boolean commit() throws FileNotFoundException, FileAlreadyExistsException {\n\t\tif (validateStages().hasEncounteredError()) { // This should be done more thoroughly on command\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (int i = 1; i <= amountOfStages; i++) {\n\t\t\tmainStagesJson.add(String.valueOf(i), stageJsons.get(i));\n\t\t}\n\n\t\tmainJson.addProperty(\"name\", scriptName); // Sets the script name as the static identifier\n\t\tmainJson.addProperty(\"entityName\", entityName);\n\t\tmainJson.addProperty(\"entityType\", entityType.name());\n\t\tmainJson.addProperty(\"amountOfStages\", amountOfStages); // Used on loading\n\t\tmainJson.add(\"stages\", mainStagesJson);\n\n\t\tStagePlay plugin = StagePlay.getInstance();\n\t\tFile pluginDirectory = plugin.getDataFolder();\n\t\tif (!pluginDirectory.exists()) {\n\t\t\tif (pluginDirectory.mkdir()) {\n\t\t\t\tplugin.getLogger().info(\"Created plugin folder for StagePlay\");\n\t\t\t} else {\n\t\t\t\tthrow new FileNotFoundException(\"StagePlay has no plugin folder and cannot create one\");\n\t\t\t}\n\t\t}\n\n\t\tFile jsonFile = new File(pluginDirectory.getPath() + \"/\" + scriptName + \".json\");\n\t\tif (jsonFile.exists()) {\n\t\t\tthrow new FileAlreadyExistsException(\"Script file \" + scriptName + \".json already exists\");\n\t\t}\n\n\t\ttry (FileWriter writer = new FileWriter(jsonFile)) {\n\t\t\twriter.write(mainJson.toString());\n\t\t\tstageJsons.clear(); // Save some memory in the editor\n\t\t\tstagesOfActions.clear();\n\t\t\treturn true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasFinished();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "public boolean isSuccessful() {\n return this.reason == Reason.NONE;\n }", "public final boolean isDone() {\n\t\tboolean result = true;\n\t\tfor (String mdl : executors.keySet()) {\n\t\t\tSubstructureExecutorI exe = executors.get(mdl);\n\t\t\tresult = result && exe.stepIsDone();\n\t\t}\n\t\t// final int matlabWait = 200;\n\t\t// try {\n\t\t// log.debug(\"Waiting to return\");\n\t\t// Thread.sleep(matlabWait);\n\t\t// } catch (InterruptedException e) {\n\t\t// log.debug(\"HEY who woke me up?\");\n\t\t// }\n\t\treturn result;\n\t}", "protected boolean isFinished() {\n \tTargetTransform tt = Robot.vision_.getLatestGearLiftTargetTransform();\n \t\n \tif ( !isTimedOut() )\n \t{\n \t\treturn false;\n \t}\n \t\n \tif ( tt == null )\n \t{\n \t\treturn false;\n \t}\n \t\n \tif ( !tt.targetFound() )\n \t{\n \t\treturn false;\n \t}\n \t\n \tif ( previousTargetTransform == null )\n \t{\n \t\tRobot.vision_.takeTargetSnapshot( tt );\n\t\t\treturn true;\n \t}\n \t\n \tif ( !tt.equals(previousTargetTransform) )\n \t{\n\t\t\tRobot.vision_.takeTargetSnapshot( tt );\n\t\t\treturn true;\n \t}\n \t\n \treturn false;\n }", "public boolean isFinished(){\n return true;\n }", "public boolean lastOpSuccess()\r\n {\r\n \treturn this.stat == VirtualPointer.Serializer.STATUS_SUCCESS;\r\n }", "private void checkUpdateCheckSuccessful(PackageVersions packageVersions) {\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Assert the storage was updated.\n checkPackageStorageStatus(PackageStatus.CHECK_COMPLETED_SUCCESS, packageVersions);\n\n // Peek inside the package tracker to make sure it is tracking failure counts properly.\n assertEquals(0, mPackageTracker.getCheckFailureCountForTests());\n }", "@Override\r\n\tprotected boolean isFinished() {\n\t\treturn true;\r\n\t}", "@Override\r\n\tprotected boolean isFinished() {\n\t\treturn true;\r\n\t}", "@Override\r\n protected boolean isFinished() {\n if (super.isFinished()) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public static boolean wasSuccessful() {\n Result result = org.junit.runner.JUnitCore.runClasses(SimpleTest.class);\r\n return result.wasSuccessful();\r\n }", "@Override\n public Long action(MBeanServerConnection connection, JBoss5ProfileServiceProxy profileService) throws Exception {\n Object info = connection.invoke(new ObjectName(\"jboss.system:service=MainDeployer\"), // NOI18N\n \"getDeployment\", new Object[] {fileToDeploy.getCanonicalFile().toURL()}, new String[] {\"java.net.URL\"}); // NOI18N\n if (info == null) {\n info = connection.invoke(new ObjectName(\"jboss.system:service=MainDeployer\"), // NOI18N\n \"getDeployment\", new Object[] {fileToDeploy.toURL()}, new String[] {\"java.net.URL\"}); // NOI18N\n }\n if (info == null) {\n return Long.MIN_VALUE;\n }\n\n Class infoClass = info.getClass();\n return infoClass.getDeclaredField(\"lastDeployed\").getLong(info); // NOI18N\n }", "public static boolean isBasketAddingFinished() {\n\t\treturn (sacannedItemListForArticle == null || sacannedItemListForArticle\n\t\t\t\t.size() == 0)\n\t\t\t\t&& (basketArticleList == null || basketArticleList.size() == 0);\n\t}", "protected boolean isFinished() {\n return false;\n \n }", "protected void logScriptCompletionStatus(List<Object[]> associations,\n boolean[] isBad)\n {\n int assnIndex = 0;\n\n // Initialize the success/fail flags and log messages\n boolean isSuccess = false;\n boolean isFail = false;\n String successMessage = \"Following script(s) completed execution: \";\n String failMessage = \"Following script(s) failed to execute: \";\n\n // Step through each script association\n for (Object[] assn : associations)\n {\n // Check if the script executed successfully\n if (isBad != null && !isBad[assnIndex])\n {\n // Append the script name and table(s) to the success\n // message\n successMessage += \" '\"\n + assn[AssociationsColumn.SCRIPT_FILE.ordinal()]\n + \" : \"\n + assn[AssociationsColumn.MEMBERS.ordinal()]\n + \"',\";\n isSuccess = true;\n }\n // The script failed to execute\n else\n {\n // Append the script name and table(s) to the fail\n // message\n failMessage += \" '\"\n + assn[AssociationsColumn.SCRIPT_FILE.ordinal()]\n + \" : \"\n + assn[AssociationsColumn.MEMBERS.ordinal()]\n + \"',\";\n isFail = true;\n }\n\n assnIndex++;\n }\n\n // Remove the trailing commas\n successMessage = CcddUtilities.removeTrailer(successMessage, \",\");\n failMessage = CcddUtilities.removeTrailer(failMessage, \",\");\n\n // Check if any script executed successfully\n if (isSuccess)\n {\n // Update the event log\n eventLog.logEvent(STATUS_MSG, successMessage);\n }\n\n // Check if any script failed to be executed\n if (isFail)\n {\n // Update the event log\n eventLog.logEvent(FAIL_MSG, failMessage);\n }\n }", "public boolean exchangeFinishedSuccessfully() {\n\t\treturn isExchangeCompleteCondition();\n\t}", "public boolean checkForUpdate() throws Exception {\r\n\t\tboolean updateAvaible=false;\r\n\t\tString md5=\"\";\r\n\t\tif(IJ.is64Bit()){\r\n\t\t\tif(IJ.isWindows()){\r\n\t\t\t\tmd5=FileParser.getMD5Checksum(ClassManagement.updateSite+File.separator+\"matlabengine64w.exe\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn updateAvaible;\r\n\t}", "@Override\n\tpublic boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n //return controller.onTarget();\n return true;\n }" ]
[ "0.81606466", "0.65619195", "0.615247", "0.600427", "0.5953454", "0.5876571", "0.58717346", "0.57295275", "0.5710881", "0.5692137", "0.5630059", "0.5630059", "0.5630059", "0.5535444", "0.55185884", "0.5516604", "0.54417753", "0.54404473", "0.54182714", "0.54117155", "0.53983474", "0.53787744", "0.53700745", "0.53438103", "0.52761877", "0.5267665", "0.5259966", "0.52555203", "0.52198124", "0.521945", "0.52128625", "0.52128625", "0.52128625", "0.520141", "0.51984113", "0.5181521", "0.518115", "0.51761377", "0.5175204", "0.5168338", "0.5162938", "0.5162123", "0.515973", "0.515973", "0.5159206", "0.5146788", "0.51369005", "0.51348644", "0.5128384", "0.5120224", "0.51161104", "0.51085114", "0.5104741", "0.5104741", "0.5104741", "0.5104741", "0.5104741", "0.5104741", "0.51038384", "0.51038384", "0.51038384", "0.51038384", "0.51038384", "0.51038384", "0.50960815", "0.5090496", "0.50850606", "0.5083308", "0.50700414", "0.5068909", "0.5060019", "0.5054765", "0.5049593", "0.50374424", "0.50268686", "0.50221825", "0.50221825", "0.50221825", "0.50221825", "0.50221825", "0.50221825", "0.50221825", "0.50181955", "0.5010909", "0.500477", "0.500468", "0.49969378", "0.49934655", "0.49928194", "0.49928194", "0.49909228", "0.4990658", "0.4980658", "0.4980314", "0.49722165", "0.49656546", "0.49644473", "0.49596494", "0.49449217", "0.49422738" ]
0.79337823
1
TODO Autogenerated method stub
public static void main(String[] args) { VolatileDemo vd = new VolatileDemo(); for (int i=0;i<500;i++) { new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub vd.increase(); } }).start(); } while(Thread.activeCount() > 1) { Thread.yield(); } System.out.println(vd.getNumber()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void run() { vd.increase(); }
{ "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
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_registro_conductor, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.7904451", "0.78051436", "0.7766031", "0.77275425", "0.76321447", "0.7622237", "0.7584132", "0.7530231", "0.74875915", "0.7457484", "0.7457484", "0.7438372", "0.74221927", "0.7403421", "0.73915446", "0.738672", "0.7378976", "0.73701847", "0.7362139", "0.73556066", "0.7345311", "0.7341246", "0.7329451", "0.73279107", "0.7325488", "0.7318634", "0.73164856", "0.7313308", "0.7303783", "0.7303783", "0.7301652", "0.7297955", "0.7292932", "0.7286313", "0.72830737", "0.7280859", "0.727834", "0.72597456", "0.72596186", "0.72596186", "0.72596186", "0.7259111", "0.7249526", "0.72248167", "0.7219158", "0.72167176", "0.7204139", "0.72014624", "0.71993005", "0.71924645", "0.71849", "0.71768457", "0.7168308", "0.71671957", "0.71536094", "0.715337", "0.71353173", "0.713472", "0.713472", "0.71290565", "0.7129024", "0.7123704", "0.7122923", "0.7122913", "0.7121943", "0.71171355", "0.71171355", "0.71171355", "0.71171355", "0.7116945", "0.711672", "0.71161616", "0.71146005", "0.71121126", "0.7109434", "0.7108666", "0.71054304", "0.70990217", "0.7097671", "0.7095598", "0.709356", "0.709356", "0.70860773", "0.7082932", "0.7080972", "0.7080077", "0.7073454", "0.7068142", "0.70615613", "0.70599645", "0.70596546", "0.7051331", "0.70375246", "0.70375246", "0.7035565", "0.70352775", "0.70352775", "0.7031692", "0.7030686", "0.7029318", "0.70186836" ]
0.0
-1
Techtorial / T e c h ... 0123456789 Techtorial
public static void main(String[] args) { /* * T * e * c * h * ... */ //0123456789 //Techtorial String word="Techtorial"; for(int index=0, lenght=word.length() ; index<lenght ; index++ ) { System.out.println(word.charAt(index)); } // // for(int index=0, lenght=word.length()-1 ; lenght>=index ; lenght-- ) { // System.out.println(word.charAt(lenght)); // } for(int index=word.length()-1 ; index>=0 ; index--) { System.out.println(word.charAt(index)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String mo21078i();", "private static char[] m619z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 20);\n }\n return toCharArray;\n }", "private static String m12564b(String str, String str2, String str3) {\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 4 + String.valueOf(str2).length() + String.valueOf(str3).length());\n sb.append(str);\n sb.append(\"|T|\");\n sb.append(str2);\n sb.append(\"|\");\n sb.append(str3);\n return sb.toString();\n }", "private static char[] m3268z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 18);\n }\n return toCharArray;\n }", "private String formatTccId(TCC tcc) {\n\t\tString id = Integer.toString(tcc.getIdTCC());\n\t\twhile (id.length() < 5) {\n\t\t\tid = \"0\" + id;\n\t\t}\n\t\treturn id;\n\t}", "C12000e mo41087c(String str);", "private String getToken() {\n\t\tString numbers = \"0123456789\";\n\t\tRandom rndm_method = new Random();\n String OTP = \"\";\n for (int i = 0; i < 4; i++)\n {\n \tOTP = OTP+numbers.charAt(rndm_method.nextInt(numbers.length()));\n \n }\n return OTP;\n\t}", "private String creatNewText() {\n\t\tRandom rnd = new Random();\n\t\treturn \"Some NEW teXt U9\" + Integer.toString(rnd.nextInt(999999));\n\t}", "private String getID()\n {\n String chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()_+{}|:<>?/.,';][=-`~\";\n String id = \"\";\n int max = new Random().nextInt((16 - 12) + 1)+12;\n for(int i=0;i<16;i++)\n {\n int r = new Random().nextInt((chars.length()-1 - 0) + 1)+0;\n id+=chars.charAt(r);\n }\n return id;\n }", "private static String m60359b(String str, String str2, String str3) {\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 4 + String.valueOf(str2).length() + String.valueOf(str3).length());\n sb.append(str);\n sb.append(\"|T|\");\n sb.append(str2);\n sb.append(\"|\");\n sb.append(str3);\n return sb.toString();\n }", "public final void mo7596sH(String str) {\n }", "private static String shortUrlFrom(int num) {\n char[] digits = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".toCharArray(); // 62 possible characters\n\n StringBuilder shorturl = new StringBuilder();\n\n while (num > 0) {\n shorturl.append(digits[num % 62]); // store the actual character in shortUrl\n num = num/62;\n }\n // Reverse shortURL to complete base conversion\n return shorturl.reverse().toString();\n }", "private String createId() {\n int idLength = 5;\n String possibleChars = \"1234567890\";\n Random random = new Random();\n StringBuilder newString = new StringBuilder();\n\n for (int i = 0; i < idLength; i++) {\n int randomInt = random.nextInt(10);\n newString.append(possibleChars.charAt(randomInt));\n }\n\n return newString.toString();\n }", "String mo20731c();", "void mo1582a(String str, C1329do c1329do);", "public String mo38889c() {\n String trim = this.f30736g0.getText().toString().trim();\n return trim.length() == 5 ? trim.substring(3, 5) : \"\";\n }", "private static char[] m7947z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 16);\n }\n return toCharArray;\n }", "public static String dtrmn(int number) {\n\t\t\n\t\tString letter = \"\";\n\t\t\n\t\tint cl = number / 100;\n\t\tif (cl != 9 && cl != 4) {\n\t\t\t\n\t\t\tif (cl < 4) {\n\t\t\t\t\n\t\t\t\tfor(int i = 1; i <= cl; i++) {\n\t\t\t\t\tletter = letter + \"C\";\n\t\t\t\t}\n\t\t\t} else if (cl < 9 && cl > 4) {\n\t\t\t\t\n\t\t\t\tletter = letter + \"D\";\n\t\t\t\tfor (int i = 1; i <= cl - 5; i++) {\n\t\t\t\t\tletter = letter + \"C\";\n\t\t\t\t}\n\t\t\t} else if(cl == 10) { \n\t\t\t\t\n\t\t\t\tletter = letter + \"M\";\n\t\t\t}\n\t\t} else if (cl == 4) {\n\t\t\t\n\t\t\tletter = letter + \"CD\";\n\t\t\t\n\t\t} else if (cl == 9) {\n\t\t\t\n\t\t\tletter = letter + \"CM\";\n\t\t}\n\t\t\n\t\tint cl1 = (number % 100)/10;\n\t\tif (cl1 != 9 && cl1 != 4) {\n\t\t\t\n\t\t\tif (cl1 < 4) {\n\t\t\t\t\n\t\t\t\tfor (int i = 1; i <= cl1; i++) {\n\t\t\t\t\tletter = letter + \"X\";\n\t\t\t\t}\n\t\t\t} else if (cl1 < 9 && cl1 > 4) {\n\t\t\t\tletter = letter + \"L\";\n\t\t\t\t\n\t\t\t\tfor (int i = 1; i <= cl1 -5; i++) {\n\t\t\t\t\tletter = letter + \"X\";\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else if (cl1 == 4) {\n\t\t\tletter = letter + \"XL\";\n\t\t} else if (cl1 == 9) {\n\t\t\tletter = letter + \"XC\";\n\t\t}\n\t\t\n\t\tint cl2 = (number % 100)%10;\n\t\t\n\t\tif (cl2 != 9 && cl2 != 4) {\n\t\t\t\n\t\t\tif (cl2 < 4) {\n\t\t\t\tfor (int i = 1; i <= cl2; i++) {\n\t\t\t\t\tletter = letter + \"I\";\n\t\t\t\t}\n\t\t\t} else if (cl2 < 9 && cl2 > 4) {\n\t\t\t\t\n\t\t\t\tletter = letter + \"V\";\n\t\t\t\tfor (int i = 1; i <= cl2-5; i++) {\n\t\t\t\t\tletter = letter + \"I\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} else if (cl2 == 4) {\n\t\t\tletter = letter +\"IV\";\n\t\t} else if (cl2 == 9) {\n\t\t\tletter = letter + \"IX\";\n\t\t}\n\t\treturn letter;\n\t}", "private static String lettre2Chiffre1(String n) {\n\t\tString c= new String() ;\n\t\tswitch(n) {\n\t\tcase \"A\": case \"J\":\n\t\t\tc=\"1\";\n\t\t\treturn c;\n\t\tcase \"B\": case \"K\": case \"S\":\n\t\t\tc=\"2\";\n\t\t\treturn c;\n\t\tcase \"C\": case\"L\": case \"T\":\n\t\t\tc=\"3\";\n\t\t\treturn c;\n\t\tcase \"D\": case \"M\": case \"U\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\tcase \"E\": case \"N\": case \"V\":\n\t\t\tc=\"5\";\n\t\t\treturn c;\n\t\tcase \"F\": case \"O\": case \"W\":\n\t\t\tc=\"6\";\n\t\t\treturn c;\n\t\tcase \"G\": case \"P\": case \"X\":\n\t\t\tc=\"7\";\n\t\t\treturn c;\n\t\tcase \"H\": case \"Q\": case \"Y\":\n\t\t\tc=\"8\";\n\t\t\treturn c;\n\t\tcase \"I\": case \"R\": case \"Z\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\t\t\n\t\t}\n\t\treturn c;\n\t\t\n\t\n\t\t}", "private static String create50DigitString(){\n StringBuilder sb = new StringBuilder(\"1\");\n for(int i = 1; i < 50; i++){\n sb.append(\"0\");\n }\n return sb.toString();\n }", "public static String getChallenge() {\n return \"00 84 00 00 00\";\n }", "C8325a mo21498a(String str);", "public String generaNumPatente() {\n String numeroPatente = \"\";\r\n try {\r\n int valorRetornado = patenteActual.getPatCodigo();\r\n StringBuffer numSecuencial = new StringBuffer(valorRetornado + \"\");\r\n int valRequerido = 6;\r\n int valRetorno = numSecuencial.length();\r\n int valNecesita = valRequerido - valRetorno;\r\n StringBuffer sb = new StringBuffer(valNecesita);\r\n for (int i = 0; i < valNecesita; i++) {\r\n sb.append(\"0\");\r\n }\r\n numeroPatente = \"AE-MPM-\" + sb.toString() + valorRetornado;\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n }\r\n return numeroPatente;\r\n }", "public String generateString() {\n\t\tint maxLength = 9;\n\t\tRandom random = new Random();\n\t\tStringBuilder builder = new StringBuilder(maxLength);\n\n\t\t// Looping 9 times, one for each char\n\t\tfor (int i = 0; i < maxLength; i++) {\n\t\t\tbuilder.append(ALPHABET.charAt(random.nextInt(ALPHABET.length())));\n\t\t}\n\t\t// Generates a random ID that has may have a quintillion different combinations\n\t\t// (1/64^9)\n\t\treturn builder.toString();\n\t}", "private static char[] m6491z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 108);\n }\n return toCharArray;\n }", "private char hallarLetra() {\r\n\t\tchar[] letra= {'T','R','W','A','G','M','Y','F','P','D','X',\r\n\t\t\t\t\t'B','N','J','Z','S','Q','V','H','L','C','K','E'};\r\n\t\treturn letra[numeroDNI%23];\r\n\t}", "void mo33731Pw();", "private static String genString(){\n final String ALPHA_NUMERIC_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n int pwLength = 14; //The longer the password, the more likely the user is to change it.\n StringBuilder pw = new StringBuilder();\n while (pwLength-- != 0) {\n int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());\n pw.append(ALPHA_NUMERIC_STRING.charAt(character));\n }\n return pw.toString(); //\n }", "void mo5871a(String str);", "private String generatePhone() {\n\t\tString ret = \"\";\n\t\tString[] areaCode = { \"051\", \"055\", \"045\", \"043\", \"053\" };\n\n\t\t// Gets an area code\n\t\tret = areaCode[(new Random()).nextInt(5)];\n\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tint n = (new Random()).nextInt(9);\n\n\t\t\t// Checks if the first number is 0\n\t\t\tif (i == 0 && n == 0) {\n\t\t\t\ti -= 1;\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tret += n;\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t}", "private String generateToken () {\n SecureRandom secureRandom = new SecureRandom();\n long longToken;\n String token = \"\";\n for ( int i = 0; i < 3; i++ ) {\n longToken = Math.abs( secureRandom.nextLong() );\n token = token.concat( Long.toString( longToken, 34 + i ) );//max value of radix is 36\n }\n return token;\n }", "private static byte[] m24635a(Context context, String str) {\n String f = C6014b.m23956f();\n String string = Secure.getString(context.getContentResolver(), \"android_id\");\n String substring = str.substring(0, Math.min(8, str.length() - 1));\n StringBuilder sb = new StringBuilder();\n sb.append(substring);\n sb.append(f.substring(0, Math.min(8, f.length() - 1)));\n String sb2 = sb.toString();\n StringBuilder sb3 = new StringBuilder();\n sb3.append(sb2);\n sb3.append(string.substring(0, Math.min(8, string.length() - 1)));\n String sb4 = sb3.toString();\n if (sb4.length() != 24) {\n StringBuilder sb5 = new StringBuilder();\n sb5.append(sb4);\n sb5.append(str.substring(8, 24 - sb4.length()));\n sb4 = sb5.toString();\n }\n return sb4.getBytes();\n }", "public String designPN(String nr)\r\n {\r\n String newStr=\"(\";\r\n if(nr.length()!=10){return null;}\r\n else\r\n {\r\n newStr=newStr+nr.substring(0,4)+\")-\";\r\n // System.out.println(\"phase 1 \"+ newStr);\r\n newStr=newStr+nr.substring(4,7)+\"-\";\r\n // System.out.println(\"phase 2 \"+ newStr);\r\n newStr=newStr+nr.substring(7,10);\r\n // System.out.println(\"phase 3 \"+ newStr);\r\n }\r\n return newStr;\r\n\r\n }", "String mo10312id();", "String mo2801a(String str);", "public static final String number2show(String phoneNumber) throws Exception {\n\t\tif (phoneNumber == null || phoneNumber.length() == 0) {\n\t\t\treturn phoneNumber;\n\t\t}\n\n\t\tboolean isIpCall = false;\n\n\t\tint lth = phoneNumber.length();\n\t\tif(lth >= CHINA_MOBILE_LDC.length()){\n\t\t\tif (phoneNumber.substring(0, 5).equals(CHINA_MOBILE_LDC)) {\n\t\t\t\tisIpCall = true;\n\n\t\t\t\tphoneNumber = phoneNumber.substring(5);\n\t\t\t}\n\t\t}\n\t\t//phone not encrypt yet, like 10086/955555 etc, it is not a cipher text\n\t\tif (phoneNumber.length() != CIPHER_FIXED_LENGTH) {\n\t\t\t//with '+'\n\t\t\tif (phoneNumber.length() != 22) {\n\t\t\t\tif (isIpCall) {\n\t\t\t\t\treturn CHINA_MOBILE_LDC + phoneNumber;\n\t\t\t\t}\n\t\t\t\treturn phoneNumber;\n\t\t\t} else {\n\t\t\t\t// with '+' maybe\n\t\t\t\t//TODO: strange here\n\t\t\t\tchar first = phoneNumber.charAt(0);\n\t\t\t\tif (first != '+') {\n\t\t\t\t\tif (isIpCall) {\n\t\t\t\t\t\treturn CHINA_MOBILE_LDC + phoneNumber;\n\t\t\t\t\t}\n\t\t\t\t\treturn phoneNumber;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn phoneNumber;\n\t\t}\n\t\tif (phoneNumber.charAt(0) == '+') {\n\t\t\tphoneNumber = phoneNumber.substring(1);\n\t\t}\n\t\t\n\t\t//TODO when input length is 21, can not know it is a \n\t\t//plain text or encrypt text\n\t\t//check the last two bit, if more than 19, return \n\t\tint length = phoneNumber.length();\n\t\tString twobitString = phoneNumber.substring(length - 2);\n\t\tint twobitInt = 0;\n\t\ttry{\n\t\t\ttwobitInt = Integer.parseInt(twobitString);\n\t\t}catch(Exception e){\n\t\t\treturn phoneNumber;\n\t\t}\n\t\t\n\t\tif(twobitInt > CIPHER_FIXED_LENGTH - LAST_TWO_BITS_INDICATOR){\n\t\t\treturn phoneNumber;\n\t\t}\n\t\t//do the real work, it is must the valid encrypt phone\n\t\tString body = unpadding(phoneNumber);\n\n\t\tString realPhone = show(body, TIMES);\n\t\tif (!isEmpty(realPhone) || realPhone.length() >= 2) {\n\t\t\tString with86 = realPhone.substring(0, 2);\n\n\t\t\tif (with86.equals(\"86\")) {\n\t\t\t\trealPhone = realPhone.substring(2);\n\t\t\t}\n\t\t}\n\n\t\tif (isIpCall) {\n\t\t\treturn CHINA_MOBILE_LDC + realPhone;\n\t\t}\n\t\treturn realPhone;\n\t}", "public String generateTrackingNumber() {\n String randChars = \"ABCDEFGHIJ0123456789\";\n StringBuilder trackingNumber = new StringBuilder();\n Random rand = new Random();\n \n while(trackingNumber.length() < 12) {\n int i = (int) (rand.nextFloat() * randChars.length());\n trackingNumber.append(randChars.charAt(i));\n }\n String trackingNum = trackingNumber.toString();\n return trackingNum;\n }", "void mo12635a(String str);", "abstract String mo1748c();", "private String getTempPassword(int length) {\r\n\t\tRandom rand = new Random(9845936902l);\r\n\t\tchar[] buf = new char[length];\r\n\t\tfor (int idx = 0; idx < buf.length; ++idx)\r\n\t\t\tbuf[idx] = symbols[rand.nextInt(symbols.length)];\r\n\t\treturn new String(buf);\r\n\t}", "private String idToShortURL(int n)\n {\n char map[] = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".toCharArray();\n\n StringBuffer shorturl = new StringBuffer();\n\n // Convert given integer id to a base 62 number\n while (n > 0)\n {\n // use above map to store actual character\n // in short url\n shorturl.append(map[n%62]);\n n = n/62;\n }\n\n // Reverse shortURL to complete base conversion\n\n\n return shorturl.reverse().toString();\n }", "private String gettxt(String num) {\n\t\tString str=\"Full Time\";\n\t\tif(num.equals(\"1\"))\n\t\t\tstr = \"Volunteer\";\n\t\telse if(num.equals(\"2\")){\n\t\t\tstr =\"Part Time\";\n\t\t}\n\t\telse if(num.equals(\"4\")){\n\t\t\tstr =\"Internship\";\n\t\t}\n\t\telse if(num.equals(\"5\")){\n\t\t\tstr =\"Freelancer\";\n\t\t}\n\t\t\n\t\treturn str;\n\t}", "public static String generateCoupon() {\n \t\t// choose a Character random from this String\n\t\tString availableCharacters = \"ABCDEFGHIJKLMNPQRSTUVWXYZ\" + \"123456789\";\n\t\t// create StringBuffer \n\t\tStringBuilder sb = new StringBuilder(5);\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\t// generate a random number\n\t\t\tdouble indexDouble = availableCharacters.length() * Math.random();\n\t\t\tint index = (int)Math.round(indexDouble);\n\t\t\tif(index > 0 && index < 33) {\n\t\t\t\tsb.append(availableCharacters.charAt(index));\n\t\t\t}\n\t\t}\n\t\treturn sb.toString().substring(0,10);\t\t\n\t}", "C15430g mo56154a();", "C1111j mo5881f(String str);", "void mo5872a(String str, Data data);", "public static String calculateLetter(int dniNumber) {\n String letras = \"TRWAGMYFPDXBNJZSQVHLCKEU\";\n int indice = dniNumber % 23;\n return letras.substring(indice, indice + 1);\n }", "C12000e mo41091f(String str);", "private String getUnidades(String numero) {// 1 - 9\r\n //si tuviera algun 0 antes se lo quita -> 09 = 9 o 009=9\r\n String num = numero.substring(numero.length() - 1);\r\n return UNIDADES[Integer.parseInt(num)];\r\n }", "public String getDv43(String numero) {\r\n \r\n int total = 0;\r\n int fator = 2;\r\n \r\n int numeros, temp;\r\n \r\n for (int i = numero.length(); i > 0; i--) {\r\n \r\n numeros = Integer.parseInt( numero.substring(i-1,i) );\r\n \r\n temp = numeros * fator;\r\n if (temp > 9) temp=temp-9; // Regra do banco NossaCaixa\r\n \r\n total += temp;\r\n \r\n // valores assumidos: 212121...\r\n fator = (fator % 2) + 1;\r\n }\r\n \r\n int resto = total % 10;\r\n \r\n if (resto > 0)\r\n resto = 10 - resto;\r\n \r\n return String.valueOf( resto );\r\n \r\n }", "public abstract C0690a mo9258k(String str);", "String mo150a(String str);", "public String mo38887b() {\n String trim = this.f30736g0.getText().toString().trim();\n if (trim.length() < 2) {\n return \"\";\n }\n return trim.substring(0, 2);\n }", "public boolean verifisTel(String text) {\n if (text.matches(\"^[0-9]+$\")&& text.length()==8) {\n return true;\n } else {\n return false;\n }\n }", "@SuppressWarnings(\"unused\")\n\tpublic static String retornaNumeroCNF() {\n\n\t\tInteger cnf = (int) (Math.random() * 99999999);\n\n\t\treturn /*cnf.toString();*/ \"18005129\";\n\t}", "public static void main(String[] args) throws Exception {\n String s;\n// s = \"0000000000000\";\n s = \"000000-123456\";\n// s = \"000000123456\";\n if (s.matches(\"^0+$\")) {\n s = \"0\";\n }else{\n s = s.replaceFirst(\"^0+\",\"\");\n }\n System.out.println(s);\n\n\n// System.out.println(StringUtils.addRight(s,'A',mod));\n// String s = \"ECPay thong bao: Tien dien T11/2015 cua Ma KH PD13000122876, la 389.523VND. Truy cap www.ecpay.vn hoac lien he 1900561230 de biet them chi tiet.\";\n// Pattern pattern = Pattern.compile(\"^(.+)[ ](\\\\d+([.]\\\\d+)*)+VND[.](.+)$\");\n// Matcher matcher = pattern.matcher(s);\n// if(matcher.find()){\n// System.out.println(matcher.group(2));\n// }\n }", "String mo42332a();", "static public int getHobgoblinStr(){\n str = rand.nextInt(3) + 3;\n return str;\n }", "private String m48359a(String str) {\n if (TextUtils.isEmpty(str)) {\n return \"\";\n }\n return C8145d.m48410a(str) ? \"xxxxxx\" : str;\n }", "@Override\n\tpublic void printLotteryNo() {\n\t\tint[] prefixNums = generateNumber(35, 5);\n\t\tint[] suffixNums = generateNumber(12, 2);\n\t\tSystem.out.println(\"本期大乐透前区号码是:\" + printNums(prefixNums));\n\t\tSystem.out.println(\"本期大乐透后区号码是:\" + printNums(suffixNums));\n\t}", "private String Interpretar(String num) {\r\n\t\tif(num.length() > 3)\r\n\t\t\treturn \"\";\r\n\t\tString salida=\"\";\r\n\t\t\r\n\t\tif(Dataposi(num,2) != 0)\r\n\t\t\tsalida = Centenas[Dataposi(num,2)-1];\r\n\t\t\r\n\t\tint k = Integer.parseInt(String.valueOf(Dataposi(num,1))+String.valueOf(Dataposi(num,0)));\r\n\r\n\t\tif(k <= 20)\r\n\t\t\tsalida += Numero[k];\r\n\t\telse {\r\n\t\t\tif(k > 30 && Dataposi(num,0) != 0)\r\n\t\t\t\tsalida += Decenas[Dataposi(num,1)-2] + \"Y \" + Numero[Dataposi(num,0)];\r\n\t\t\telse\r\n\t\t\t\tsalida += Decenas[Dataposi(num,1)-2] + Numero[Dataposi(num,0)];\r\n\t\t}\r\n\t\t//Caso especial con el 100\r\n\t\tif(Dataposi(num,2) == 1 && k == 0)\r\n\t\t\tsalida=\"CIEN\";\r\n\t\t\r\n\t\treturn salida;\r\n\t}", "@Override\n\tpublic String damePatente() {\n\t\treturn \"TJH 123\";\n\t}", "void mo5875b(String str, long j);", "private String getLongText() {\n\t\treturn \"abcdefghijklmnopqrstuvwxyz\" + \"abcdefghijklmnopqrstuvwxyz\"\n\t\t\t\t+ \"abcdefghijklmnopqrstuvwxyz\" + \"abcdefghijklmnopqrstuvwxyz\";\n\n\t}", "private static String m10f() {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"sh\");\n stringBuilder.append(\"el\");\n stringBuilder.append(\"la\");\n return stringBuilder.toString();\n }", "private static boolean m4389a(String str) {\n return str != null && str.length() != 0 && Pattern.compile(\"^[0-9A-Fa-f]{13,18}+$\").matcher(str).matches() && str.indexOf(\"000000000\") == -1 && str.indexOf(\"111111111\") == -1 && str.indexOf(\"222222222\") == -1 && str.indexOf(\"333333333\") == -1 && str.indexOf(\"444444444\") == -1 && str.indexOf(\"555555555\") == -1 && str.indexOf(\"666666666\") == -1 && str.indexOf(\"777777777\") == -1 && str.indexOf(\"888888888\") == -1 && str.indexOf(\"999999999\") == -1;\n }", "@Test(timeout = 4000)\n public void test33() throws Throwable {\n String string0 = EWrapperMsgGenerator.fundamentalData((-1622103582), \"convertible = \");\n assertEquals(\"id = -1622103582 len = 14\\nconvertible = \", string0);\n }", "static String getAlphaNumericString(int n) \n {\n byte[] array = new byte[256]; \n new Random().nextBytes(array); \n \n String randomString \n = new String(array, Charset.forName(\"UTF-8\")); \n \n // Create a StringBuffer to store the result \n StringBuffer r = new StringBuffer(); \n \n // Append first 20 alphanumeric characters \n // from the generated random String into the result \n for (int k = 0; k < randomString.length(); k++) { \n \n char ch = randomString.charAt(k); \n \n if (((ch >= 'a' && ch <= 'z') \n || (ch >= 'A' && ch <= 'Z') \n || (ch >= '0' && ch <= '9')) \n && (n > 0)) { \n \n r.append(ch); \n n--; \n } \n } \n \n // return the resultant string \n return r.toString(); \n }", "public static String generatePlate() {\n\t\t\n\t\tString s = \"\";\n\t\t\n\t\tfor (int i=0; i < 3; i++)\n\t\t\ts += generateLetter();\n\t\t\n\t\ts += '-';\n\t\t\n\t\tfor (int i=0; i < 4; i++)\n\t\t\ts += generateDigit();\n\t\t\n\t\treturn s;\n\t}", "private static String smsCode() {\n\t\t\tString random=new Random().nextInt(1000000)+\"\";\r\n\t\t\treturn random;\r\n\t\t}", "private static String m12563a(String str, String str2) {\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 3 + String.valueOf(str2).length());\n sb.append(str);\n sb.append(\"|S|\");\n sb.append(str2);\n return sb.toString();\n }", "public String getUniqueIdentifier(){\n return (streetAddress + aptNumber + zip).toLowerCase().replaceAll(\"\\\\s+\",\"\"); \n }", "public static String createTimeDependentKey() {\r\n\t\tchar pad[];\r\n\t\tint padLen;\r\n\t\tStringBuilder retval = new StringBuilder(32);\r\n\t\tfinal long seed = System.currentTimeMillis();\r\n\t\tRandom rnd = new Random(seed);\r\n\t\t// 10 characters time dependent part\r\n\t\tString timePart = String.valueOf(Long.MAX_VALUE-seed);\r\n\t\tpadLen = timePart.length()-10;\r\n\t\tpad = new char[padLen];\r\n\t\tjava.util.Arrays.fill(pad, '0');\r\n\t\tretval.append(pad).append(timePart);\r\n\t\t// 6 characters sequential\r\n\t\tretval.append(Integer.toHexString(iSequence.incrementAndGet()));\r\n\t\tiSequence.compareAndSet(16777000, 1048576);\r\n\t\t// 8 characters IP dependent part\t\t\r\n\t\ttry {\r\n\t\t\tbyte[] localIPAddr = InetAddress.getLocalHost().getAddress();\r\n\t\t\tretval.append(byteToStr[((int) localIPAddr[0]) & 255]);\r\n\t\t\tretval.append(byteToStr[((int) localIPAddr[1]) & 255]);\r\n\t\t\tretval.append(byteToStr[((int) localIPAddr[2]) & 255]);\r\n\t\t\tretval.append(byteToStr[((int) localIPAddr[3]) & 255]);\r\n\t\t}\r\n\t\tcatch (UnknownHostException e) {\r\n\t\t\tretval.append(\"7f000000\");\r\n\t\t}\r\n\t\t// 8 characters random part\r\n\t\tString randomPart = String.valueOf(rnd.nextInt(Integer.MAX_VALUE));\r\n\t\tpadLen = timePart.length()-8;\r\n\t\tretval.append(randomPart).append(generateRandomId(padLen, \"0123456789abcdef\", Character.LOWERCASE_LETTER));\r\n\t\treturn retval.toString();\r\n\t}", "public abstract String mo24851a(String str);", "public static String m3984tk(String str) {\n AppMethodBeat.m2504i(93204);\n int lastIndexOf = str.lastIndexOf(\";?enc=\");\n String trim;\n if (lastIndexOf > 0) {\n trim = str.substring(lastIndexOf + 6).trim();\n AppMethodBeat.m2505o(93204);\n return trim;\n }\n trim = \"\";\n AppMethodBeat.m2505o(93204);\n return trim;\n }", "String mo2800a();", "public static void main(String[] args) \n\t{\n\t\tString str = \"647mahesh\";\n\t\tint size = str.length();\n\t\tint i;\n\t\tfor (i = 0; i < size ; i++)\n\t\t{\n\t\t\tchar split = str.charAt(i);\n\t\t\tif ('0'<=split && split<='8')\n\t\t\tbreak;\n\t\t}\n\t\tString numeric = str.substring(0,i);\n\t\tString alphabets = str.substring(i);\n\t\tSystem.out.println(numeric);\n\t\tSystem.out.println(alphabets);\n\t}", "String mo20730b();", "String billingPartNumber();", "void mo9697a(String str);", "public static void main(String[] args) {\n String key = \"4071321\";\n String strToDecode = \"Li, ailu jw au facntll\";\n StringBuilder ES = new StringBuilder();\n long spCount = 0;\n for(int i= 0;i<strToDecode.length();i++)\n {\n int ascii = strToDecode.charAt(i);\n\n if((ascii<65 || ascii>122) || (ascii > 90 && ascii < 97))\n {\n char a = strToDecode.charAt(i);\n System.out.println(a);\n ES.append(a);\n spCount++;\n }\n else\n {\n int keyPos = (int)(i - spCount)%7;\n int subKey = Character.getNumericValue(key.charAt(keyPos));\n long strAscii = ascii - subKey;\n\n if(strAscii<65)\n {\n strAscii = 91-(65- strAscii);\n }\n\n if(ascii >=97 && strAscii< 97) {\n strAscii = 123 - (97 - strAscii);\n }\n ES.append((char)strAscii);\n }\n\n }\n System.out.println(ES);\n\n }", "void mo85415a(String str);", "private static char toHexDigit(int h) {\n char out;\n if (h <= 9) out = (char) (h + 0x30);\n else out = (char) (h + 0x37);\n //System.err.println(h + \": \" + out);\n return out;\n }", "public final String mo5960az(String str) {\n try {\n if (TextUtils.isEmpty(str)) {\n return null;\n }\n byte[] bArr = new byte[16];\n new SecureRandom().nextBytes(bArr);\n Cipher instance = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n String string = C1251i.m5302ck().getString(f3976js, null);\n if (TextUtils.isEmpty(string)) {\n string = m5297cj();\n C1251i.m5302ck().putString(f3976js, string);\n }\n if (TextUtils.isEmpty(string)) {\n return null;\n }\n byte[] aA = m5293aA(string);\n if (aA == null) {\n return null;\n }\n instance.init(1, new SecretKeySpec(aA, \"AES\"), new IvParameterSpec(bArr));\n return Base64.encodeToString(m5292a(bArr, instance.doFinal(str.getBytes(AudienceNetworkActivity.WEBVIEW_ENCODING))), 2);\n } catch (Throwable unused) {\n return null;\n }\n }", "public String getdisplaycode1(){\r\n\t\t\r\n\t\tString displayCode = null;\r\n\t\tBigInteger found = transferDao.getTransferCode();\r\n\t\tString transferCodeNo = \"TR100000\";\r\n\t\tString transferNoList = \"TR\"+found;\r\n\t\t\r\n\t\tif(found != null){\r\n\t\t\t transferCodeNo = transferNoList; \t\r\n\t\t}\r\n\r\n\t String splitNo = transferCodeNo.substring(2);\r\n\t int num = Integer.parseInt(splitNo); \r\n\t num++; \r\n\t String number = Integer.toString(num); \r\n\t displayCode = transferCodeNo.substring(0, 2) + number;\r\n\t\treturn displayCode;\t\t\t\r\n\t}", "private String genSenderID(String phoneNumber) {\r\n String sid = phoneNumber.replaceAll(senderIDRegex, \"\");\r\n return sid.length() > 11 ? sid.substring(sid.length() - 11, sid.length()) : sid;\r\n }", "@Override\r\n\tpublic String getFortune() {\n\t\tString[] s= {\"have a nice day :)\",\r\n\t\t\t\t\"attaboy!\",\r\n\t\t\t\t\"good fortune to you <3\"\r\n\t\t};\r\n\t\tint x;\r\n\t\tx=((int)(Math.random()*9))%3;\r\n\t\t\r\n\t\treturn s[x] ;\r\n\t}", "void mo9075h(String str, int i, int i2);", "private final String getRandomString() {\n StringBuffer sbRan = new StringBuffer(11);\n String alphaNum = \"1234567890abcdefghijklmnopqrstuvwxyz\";\n int num;\n for (int i = 0; i < 11; i++) {\n num = (int) (Math.random() * (alphaNum.length() - 1));\n sbRan.append(alphaNum.charAt(num));\n }\n return sbRan.toString();\n }", "C1458cs mo7613iS();", "public C7249w(String str) {\n super(str);\n C6888i.m12438e(str, \"value\");\n }", "String mo38972c();", "private byte m1655h() {\n char charAt;\n int i = this.f2519d;\n while (true) {\n int i2 = this.f2519d;\n if (i2 <= 0) {\n break;\n }\n CharSequence charSequence = this.f2516a;\n int i3 = i2 - 1;\n this.f2519d = i3;\n char charAt2 = charSequence.charAt(i3);\n this.f2520e = charAt2;\n if (charAt2 == '<') {\n return 12;\n }\n if (charAt2 == '>') {\n break;\n } else if (charAt2 == '\\\"' || charAt2 == '\\'') {\n do {\n int i4 = this.f2519d;\n if (i4 <= 0) {\n break;\n }\n CharSequence charSequence2 = this.f2516a;\n int i5 = i4 - 1;\n this.f2519d = i5;\n charAt = charSequence2.charAt(i5);\n this.f2520e = charAt;\n } while (charAt != charAt2);\n }\n }\n this.f2519d = i;\n this.f2520e = '>';\n return 13;\n }", "public String generateOTP() {\n String values = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"; //characters to use in password\n Random random = new Random();\n char[] password = new char[6]; //setting password size to 6\n IntStream.range(0, password.length).forEach(i -> password[i] = values.charAt(random.nextInt(values.length())));\n return String.valueOf(password);\n }", "private void m81856t() {\n try {\n String c = m81844c(C6969H.m41409d(\"G738BEA0DBA32BD20E319AF5CEBF5C6\"));\n if (!TextUtils.isEmpty(c)) {\n this.f58084p = Integer.parseInt(c);\n }\n } catch (Exception e) {\n WebUtil.m68654a(C6969H.m41409d(\"G5C91D93EBA3CAE2EE71A95\"), e.getMessage());\n }\n }", "void mo3314b(String str);", "void mo303a(C0237a c0237a, String str, String str2, String str3);", "public static String m145769c(String str) {\n return f119470i.matcher(str).replaceAll(\" \");\n }", "private String e19BuildStaffGageString(String s) {\n String tmp1 = null;\n if ((s != null) && (s.length() > 0)) {\n tmp1 = String.format(\"%c%s-%c\", SEP_CHAR, s, SEP_CHAR);\n } else {\n tmp1 = String.format(\"%c-----%c\", SEP_CHAR, SEP_CHAR);\n }\n\n return tmp1;\n }", "private String zxt (long inp, int length) {\n String result = Long.toString(inp);\n int dist = (length - result.length());\n for (int i = 0; i < dist; i++) {\n result = \"0\" + result;\n }\n return result;\n }" ]
[ "0.59872085", "0.59645474", "0.5875846", "0.5816474", "0.5777148", "0.5774027", "0.5759332", "0.5752272", "0.5745448", "0.57408154", "0.5719666", "0.5716889", "0.56941265", "0.5640088", "0.56205004", "0.56066906", "0.5606121", "0.5600665", "0.55886716", "0.557705", "0.5565472", "0.5551171", "0.554705", "0.5546953", "0.55457413", "0.5530202", "0.5529703", "0.5511914", "0.5500672", "0.5498709", "0.54883635", "0.54318833", "0.54249823", "0.5424976", "0.5412915", "0.5412601", "0.54120475", "0.54024345", "0.5398378", "0.53784454", "0.53713274", "0.5370046", "0.53549784", "0.5352696", "0.53449386", "0.5336406", "0.53355795", "0.5332701", "0.5329573", "0.53291607", "0.53289753", "0.53241754", "0.53232723", "0.5319313", "0.5311064", "0.53063655", "0.5304259", "0.5296756", "0.52925336", "0.52903974", "0.5282764", "0.527375", "0.52736354", "0.5257882", "0.52520996", "0.5249262", "0.52491564", "0.52447766", "0.5241562", "0.52384883", "0.523698", "0.52365524", "0.5235675", "0.52331185", "0.5231918", "0.52302897", "0.52268285", "0.52262497", "0.5224865", "0.522264", "0.52195007", "0.51989746", "0.51977473", "0.51953644", "0.51938576", "0.51880795", "0.5187964", "0.51872927", "0.51811856", "0.5180696", "0.5180541", "0.5179454", "0.51771677", "0.5176159", "0.5175392", "0.51752067", "0.5174027", "0.5150391", "0.5142719", "0.5140864" ]
0.5495396
30
Keep max value low so that the basket total weight is low (problem limit is 100,000)
@Test public void when_provided_maximum_size_list_with_all_elements_that_can_be_added_then_return_sum_in_allowable_amount_of_time() { final int[] elements = Fixture.initializeRandomList(MAX_NUM_ELEMENTS, MIN_ELEMENT_SIZE, 5); final int elementSum = IntStream.of(elements).sum(); final long startTime = System.currentTimeMillis(); final int result = Knapsack.getOptimalWeight(elementSum, elements); assertThat(result, is(elementSum)); assertThat(System.currentTimeMillis() - startTime < Fixture.MAX_ALLOWABLE_CALCULATION_TIME, is(true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int knapsack(Item[] items, int maxWeight) {\n return knapsack(items, maxWeight, 0);\n }", "public void setMaxWeight(double inMaxWeight) {\n maxWeight = inMaxWeight;\n }", "public void setMaxprice(int value) {\n this.maxprice = value;\n }", "public void setmaxWeight(double maxWeight) {\n\t this.maxWeight = maxWeight;\n\t}", "public double getmaxWeight() {\n\t return this.maxWeight;\n\t}", "public void setMaxWeight(String newValue);", "public void setMaxTotalCost(int amount);", "private void setMaxThreshold() {\n maxThreshold = value - value * postBoundChange / 100;\n }", "private static void maxDuffelBagValue(JSONArray cakeTypes, int capacity) {\n for (int i = 0; i < cakeTypes.length(); i++) {\n \tJSONObject cakeType = (JSONObject) cakeTypes.remove(i);\n \tif (cakeType.getInt(\"weight\") <= capacity) {\n \t\tval += cakeType.getInt(\"value\");\n \t\tcapacity -= cakeType.getInt(\"weight\");\n \t\tmaxDuffelBagValue(cakeTypes, capacity);\n\t\t\t}\n }\n\t}", "@Override\n public int getSpecialValue() {\n return maxBonus;\n }", "public void setMaximumStock (double maximumStock) {\r\n\t\tthis.maximumStock = maximumStock;\r\n\t}", "public int getMaxTotalCost();", "public double getWitnessedMaxPrice() {\t\r\n\t\treturn witnessed_max_price;\r\n\t}", "public Knapsack bruteForceCalc (ArrayList <Item> items,int capacity, int num_items) {\n\t\tif (num_items <= 0) {\n\t\t\tKnapsack knapsack = new Knapsack(0);\n\t\t\treturn knapsack;\n\t\t} \n\t\telse if (items.get(num_items -1).getWeight() > capacity) {\n\t\t\treturn bruteForceCalc(items, capacity, num_items - 1);\n\t\t} else {\n\n\t\t\tKnapsack ignore = bruteForceCalc(items,capacity, num_items - 1);\n\t\t\tKnapsack take = bruteForceCalc(items,capacity - items.get(num_items -1).getWeight(), num_items - 1);\n\t\t\t\n\t\t\tint ignoreVal = ignore.getValue();\n\t\t\tint takeVal = items.get(num_items - 1).getValue() + take.getValue();\n\t\t\t \n\t\t\tif( Math.max(ignoreVal, takeVal) == ignoreVal ) \n\t\t\t\treturn ignore;\n\t\t\telse {\n\t\t\t\ttake.addItem(items.get(num_items - 1));\n\t\t\t\treturn take;\n\t\t\t}\n\t\t}\n\t}", "private long getMaxValue( Item[] items, int maxWeight, int n) {\n\t\tif ( n == 0 || maxWeight == 0 )\n\t\t\treturn 0;\n\n\t\t// Weight of the nth item is more than maxWeight -> \n\t\t// We cannot include this item into the optimal solutions.\n\t\t// Fall back to to the nth-1 item.\n\t\tif ( items[n - 1].getWeight() > maxWeight)\n\t\t\treturn getMaxValue( items, maxWeight, n-1);\n\t\t\n\t\t// Return the maximum of these two cases:\n\t\t// 1) nth item included\n\t\t// 2) nth item is not included\n\t\t\n\t\tlong includedValue = items[n-1].getValue() + getMaxValue(items, maxWeight-items[n-1].getWeight(), n-1);\n\t\tlong notIncludedValue = getMaxValue(items, maxWeight, n - 1);\n\t\treturn Math.max( includedValue, notIncludedValue);\n\t}", "public void setMaximumWeight(int maximumWeight) { // set the max weight\n\t\tthis.maximumWeight = maximumWeight;\n\t}", "public double getMaximumStock () {\r\n\t\treturn maximumStock;\r\n\t}", "static int knapsack(int[] weight, int[] value, int n, int maxWeight) {\n int[][] dp = new int[n+1][maxWeight+1];\n for (int i=0;i<=n;i++) {\n for (int j =0;j<=maxWeight;j++) {\n dp[i][j] = -1;\n }\n }\n int ans= knapsack(weight,value,n,maxWeight,dp);\n return ans;\n\n }", "public int getMaximumWeight() { // get the max weight\n\t\treturn maximumWeight;\n\t}", "void setWBMaximum(java.math.BigDecimal wbMaximum);", "public static void main(String[] args){ w = the total weight\n\t\t// i = item i\n\t\t// m[i, w] = maximum value attained with weight <= w using items up to i\n\t\t//\n\t\t// recurrence relation:\n\t\t// m[0, w] = 0, if there's zero items, the sum is zero\n\t\t// m[i, w] = m[i-1, w], if w(i) > w, the new item's weight > current weight limit\n\t\t// m[i, w] = max(m[i-1, w],\n\t\t// \t\t\t\t m[i-1, w-w(i)] + v(i), if w(i) <= w\n\t\t//\n\t\t//\n\t\tArrayList<Item> items = new ArrayList<Item>();\n\n\t\titems.add(new Item(10, 60));\n\t\titems.add(new Item(20, 100));\n\t\titems.add(new Item(30, 120));\n\n\t\tSystem.out.println(knapsack(items.size()-1, 50, items));\n\t}", "public BigDecimal getMaxQuantity() {\n return _maxQuantity;\n }", "java.math.BigDecimal getMultipleBetMinimum();", "private static int buyLowSellHigh(int[] prices) {\n int minPrice = Integer.MAX_VALUE;\n int maxProfit = Integer.MIN_VALUE;\n\n for (int v : prices) {\n if (minPrice == Integer.MAX_VALUE) {\n // update min price for the first time\n minPrice = v;\n } else if (v > minPrice) {\n // calculate profit since the stock price is > minPrice\n int profit = v - minPrice;\n maxProfit = Math.max(maxProfit, profit);\n } else {\n // either v is equal to or smaller than minPrice, then update it\n minPrice = v;\n }\n }\n System.out.printf(\"minPrice: %d\\n\", minPrice);\n return maxProfit;\n }", "public int getWeightedBucket() {\n float val = (float)(new Float((Math.random() * 100)));\n int totalWeight = 0;\n int i = 0;\n for (i = 0; i < weights.length; i++) {\n totalWeight += weights[i];\n if (val <= totalWeight)\n break;\n }\n return(i);\n }", "@Basic @Immutable\n\tpublic Weight getMaxWeight() {\n\t\treturn this.MAX_WEIGHT;\n\t}", "public long getPropertyBalanceMax();", "public static TempResult max(int allowedWeight, Set<Item> items) {\n\t\tint[] values=new int[items.size()];\n\t\tint[] weights=new int[items.size()];\n\t\t\n\n\t\tArrayList<Item> items2=new ArrayList<Item>(items);\n\t\tfor (int i=0; i<items2.size(); i++) {\n\t\t\tvalues[i]=items2.get(i).value;\n\t\t\tweights[i]=items2.get(i).weight;\n\t\t}\n\t\t\n int[][] totalValue = new int[values.length+1][allowedWeight+1];\n boolean[][] includedorNot = new boolean[values.length+1][allowedWeight+1];\n \n //We introduce item one by one to the system.\n //For each introduced item, we consider the maximal profit\n //for weight=[0:allowedWeight]\n for (int i=0; i<values.length; i++) {\n \t//introduce item i into the system.\n \tint val=values[i];\n \tint weight=weights[i];\n \t\n \tint itemIndex=i+1;\n \t\n \tfor (int w=1; w<=allowedWeight; w++) {\n \t\t\n \t\t//Zero copy of ith item; i-1 is calculated already\n \t\tint profit1=totalValue[itemIndex-1][w];\n \t\t\n \t\t//one copy of ith item.\n \t\tint profit2=Integer.MIN_VALUE;\n \t\tif (w-weight>=0) {\n \t\t\t//for a particular targeted weight, add item i does not overflow the targeted weight.\n \t\t\tprofit2=totalValue[itemIndex-1][w-weight]+val;\n \t\t}\n \t\t\n \t\tif (profit1>profit2) {\n \t\t\tincludedorNot[itemIndex][w]=false;\n \t\t\ttotalValue[itemIndex][w]=profit1;\n \t\t} else {\n \t\t\tincludedorNot[itemIndex][w]=true;\n \t\t\ttotalValue[itemIndex][w]=profit2;\n \t\t}\n \t}\n }\n\t\t\n \n TempResult result=new TempResult(0, 0);\n result.value=totalValue[values.length][allowedWeight];\n result.items=new LinkedList<>();\n int w=allowedWeight;\n for (int itemIndex=values.length; itemIndex>0; itemIndex--) {\n \tif (includedorNot[itemIndex][w]) {\n \t\tresult.items.add(items2.get(itemIndex-1));\n \t\tw=w-weights[itemIndex-1];\n \t} \n }\n \n return result;\n \n\t}", "protected float clampWeight(float weigth) {\n\t\t float ret = weigth;\n\t\t if (ret < -10) ret = -10;\n\t\t if (ret > 10) ret = 10;\n\t\t return ret;\n\t\t }", "public int getWeightLimit() {\n\t\treturn this.weightLimit;\n\t}", "public void setMaxQuantity(BigDecimal maxQuantity) {\n this._maxQuantity = maxQuantity;\n }", "public static void main(String[] args) {\n\t\t\n\t\tint max_size,n; \n \n ArrayList<item> items=new ArrayList();\n\t\t// item 1, value 6, size 1\n items.add(new item(1, 6, 1));\n\t\t// item 2, value 10, size 2\n\t\titems.add(new item(2, 10, 2));\n\t\t// item 3, value 12, size 3\n\t\titems.add(new item(3, 12, 3));\n\t\t// the size of your knapsack\n max_size=5; \n\t\t// sort items by density\n\t\tsortitems(items);\n \n System.out.println(\"The maximum value we can place into the knapsack is \"+ greedyfractionalknapsack(items, max_size));\n\n\n\n}", "public void setMaxAmount(int max) {\n _max = max;\n }", "public static int zeroOneKnapsack(int[] weight, int[] value, int capacity) {\n\t\tint[][] dp = new int[weight.length + 1][capacity + 1];\n\n\t\tfor (int i = 0; i < weight.length + 1 ; i++) {\n\t\t\t for (int j = 0; j < capacity + 1; j++) {\n\t\t\t\t\n\t\t\t\t // base condition for memoization\n\t\t\t\t // first row and first column for 2d matrix is initialised to 0\n\t\t\t\t // profit = 0 when number of items = 0 or bag capacity = 0 \n\t\t\t\t if (i == 0 || j == 0) { \n\t\t\t\t\t dp[i][j] = 0;\n\t\t\t\t } \n\t\t\t\t \n\t\t\t\t // weight of item under consideration is less than capacity of bag\n\t\t\t\t // value of i in 2d matrix corresponds to (i-1)th element in weight and value arrays\n\t\t\t\t // hence, weight(i-1) is compared with the corresponding matrix cell capacity(i.e.column)\n\t\t\t\t \n\t\t\t\t else if (weight[i-1] <= j){\n\t\t\t\t\t \n\t\t\t\t\t // possibility 1: when item having weight(i-1) is added to bag\n\t\t\t\t\t // item having weight(i-1) has value(i-1)\n\t\t\t\t\t // this value added to array value for (i-1)th row and (j-weight[i-1])th column\n\t\t\t\t\t // because :\n\t\t\t\t\t // 1) the total capacity reduced by weight(i-1) after deciding item inclusion\n\t\t\t\t\t // 2) total no.of elements reduced by 1 after deciding item inclusion\n\t\t\t\t\t \n\t\t\t\t\t int a = value[i-1] + dp[i-1][j-weight[i-1]];\n\t\t\t\t\t \n\t\t\t\t\t// possibility 1: when item having weight(i-1) is not added to bag\n\t\t\t\t\t// 1) the total capacity remains as is after deciding item exclusion\n\t\t\t\t\t// 2) total no.of elements reduced by 1 after deciding item exclusion\n\t\t\t\t\t \n\t\t\t\t\t int b = dp[i-1][j];\n\t\t\t\t\t \n\t\t\t\t\t // max of a and b taken to find maximum profit value \n\t\t\t\t\t dp[i][j] = Math.max(a, b);\t \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t // weight of item under consideration is more than capacity of bag\n\t\t\t\t // hence item having weight(i-1) is not added to bag\n\t\t\t\t else {\n\t\t\t\t\t \n\t\t\t\t\t// 1) the total capacity remains as is after deciding item exclusion\n\t\t\t\t\t// 2) total no.of elements reduced by 1 after deciding item exclusion\n\t\t\t\t\t \n\t\t\t\t\t dp[i][j] = dp[i-1][j];\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn dp[weight.length][capacity];\n\t\t\n\t}", "private void processLowValue(Bid bid) {\n\t}", "public int getMaxAmount() {\n return _max;\n }", "java.math.BigDecimal getSingleBetMinimum();", "java.math.BigDecimal getWagerMinimum();", "@Override\n public double getMaxLoadWeight() {\n return maxLoadWeight;\n }", "void setMaxValue();", "public boolean setPropertyBalanceMax(long aValue);", "java.math.BigDecimal getWBMaximum();", "public static int minimumNumberOfBlackWallsInStock()\n {\n return 0;\n }", "private void mostValuePerWeightFirst(Instance instance) {\n ArrayList<Pair> order = new ArrayList<Pair>();\n\n for (int i = 0; i < instance.getSize(); i++) {\n order.add(i, new Pair(i, instance.getValue(i), instance.getWeight(i)));\n }\n\n // Sort items according to c_i/w_i >= c_i+1/w_i+1\n order.sort(new Comparator<Pair>() {\n @Override\n public int compare(Pair o1, Pair o2) {\n return o1.compareTo(o2) * -1;\n }\n });\n\n setSolution(order);\n }", "public int getMaxprice() {\n return maxprice;\n }", "protected boolean update_best_value(Knapsack knapsack) {\n iteration+=1;\n if (knapsack.get_value()>best_value)\n {\n best_value=knapsack.get_value();\n return true;\n }\n if (iteration%100000==0)\n System.out.println(\"iteration:\"+iteration+\" time:\"+System.currentTimeMillis()+\n \" best_value:\"+best_value);\n return false;\n }", "private void setMaxLoss(float maxloss) \n\t{\n\t\tif (Math.abs(maxloss) < 1.0f)\n\t\t{\n\t\t\t_maxloss = Math.abs(maxloss);\t\n\t\t}\n\t}", "public static int minimumNumberOfWhiteWallsInStock()\n {\n return 0;\n }", "private double getMaxThreshold() {\n return maxThreshold;\n }", "BigDecimal getLowPrice();", "void xsetMaximum(org.apache.xmlbeans.XmlDecimal maximum);", "public BigDecimal getTradeMax() {\n return tradeMax;\n }", "double getMaxAmountl() {\n\t\treturn MAX_AMOUNT;\n\t}", "private void knapsack(Set<CMNMove> winSet, int count, int maxnum, int target) {\n\t\tint i;\n\t\ttarget -= maxnum; /* use maxnum in sum */\n\t\tcount--; /* now need one less summand */\n\n\t\tSet<CMNMove> tempSet = new TreeSet<CMNMove>(winSet);\n\t\ttempSet.add(moveList.get(maxnum)); /* adding the winning element */\n\n\t\tif (target == 0 && count == 0) { /* we have a win */\n\t\t\tWINS.add(tempSet);\n\t\t\treturn;\n\t\t}\n\n\t\tif (target < 0 || count == 0) { /* hopeless in either case */\n\t\t\treturn;\n\t\t}\n\n\t\tfor (i = maxnum - 1; i > 0; i--) { /* try to finish recursively */\n\t\t\tknapsack(tempSet, count, i, target);\n\t\t}\n\t\treturn;\n\t}", "@Override\n\tpublic double getTargetValueInCurrentBest() {\n\t\treturn 0;\n\t}", "public BigInteger getMaxUses() {\r\n return maxUses;\r\n }", "public static int getEnergyValueRandomLimit() {\r\n\t\treturn 50;\r\n\t}", "public int getMaxAmount() {\n return maxAmount;\n }", "public void setMaxpower(int maxpower) {\n\t\t\r\n\t}", "public BigDecimal maxPrice() {\n return this.maxPrice;\n }", "public void setCost(int maxTemp) {\n\t\tthis.cost = 900 + (200 * (Math.pow( 0.7, ((double)maxTemp/5.0) )));\n\t}", "private static int getBonus(int sales) {\n if (sales > 5000) {\n\n return sales / 10;\n\n }\n return 0;\n }", "public int getBestValue() {\n return bestValue;\n }", "protected BigDecimal testBasketValue(BigDecimal grossAmount) {\r\n\t\t\r\n\t\t// First test if the basket is negative\r\n\t\tif(grossAmount.compareTo(BigDecimal.ZERO) < 0 ) {\r\n\t\t\t\r\n\t\t\t//TODO Something has gone wrong - Raise an event to notify ESB of error\r\n\t\t\t\r\n\t\t\t// We do not want to be paying customers to shop\r\n\t\t\treturn BigDecimal.ZERO;\r\n\t\t}\r\n\t\t\r\n\t\t// Lets stick an arbitrary upper limit on the maximum amount allowed in the basket\r\n\t\tif(grossAmount.compareTo(new BigDecimal(\"10000\")) > 0 ) {\r\n\t\t\t\r\n\t\t\t//TODO Something has gone wrong - Raise an event to notify ESB of error\r\n\t\t\t\r\n\t\t\t// lets reset the basket to zero\r\n\t\t\treturn BigDecimal.ZERO;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// Otherwise return the value\r\n\t\treturn grossAmount;\r\n\t}", "void setWagerMinimum(java.math.BigDecimal wagerMinimum);", "public static int getFoodValueRandomLimit() {\r\n\t\treturn 50;\r\n\t}", "void updateMax(StockNode a){\n\t\tif(maxNode==null){\r\n\t\t\tmaxNode=a;\r\n\t\t} else { \r\n\t\t\tif(a.stockValue>maxNode.stockValue){\r\n\t\t\t\tmaxNode=a;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void honourMaxCount() {\n // Get free and total counts\n int freeCount = getFreeLaunchers().size();\n int totalCount = getTotalLaunchers().size();\n\n // Scale down if max is exceeded, irrespective of free buffer count\n if (totalCount > maxCount) {\n log.info(\"Scaling down until [freeBufferCount] \" + freeBufferCount + \" is met since [Max Count] \"\n + maxCount + \" has been exceeded.\");\n\n while (freeCount <= freeBufferCount){\n log.info(\"Scaling DOWN: REASON -> [Total Count] \" + totalCount + \" > [Max Count] \" + maxCount);\n scaleDown();\n freeCount = getFreeLaunchers().size();\n }\n\n totalCount = getTotalLaunchers().size();\n freeCount = getFreeLaunchers().size();\n\n log.info(\"Stats after scale down operation: [Total Count] \" + totalCount + \", [Free Count] \" + freeCount);\n\n return;\n }\n\n // Don't scale down if there are not enough free launchers\n if (freeCount <= freeBufferCount) {\n log.info(\"Not scaling down since [Free Count] \" + freeCount + \" <= [Free Buffer Size] \" +\n freeBufferCount + \"...\");\n return;\n }\n\n // Don't scale down if the desired count is not exceeded\n if (totalCount <= desiredCount) {\n log.info(\"Not scaling down since [Total Count] \" + totalCount + \" <= [Desired Count] \" +\n desiredCount + \"...\");\n return;\n }\n\n // Scale down if desired count is exceeded, but with more free launchers than buffer count by stepDown count\n // TODO: to test scale down\n if ((freeCount - stepDown) >= freeBufferCount) {\n log.info(\"Scaling DOWN: REASON -> [Total Count] \" + totalCount + \" > [Desired Count] \" + desiredCount +\n \" AND [Free Count] - [Step Down] \" + freeCount + \" - \" + stepDown +\n \" >= [Free Buffer Count] \" + freeBufferCount);\n\n scaleDown();\n return;\n }\n\n // If after scaling down there wouldn't be enough free launchers, don't scale down\n log.info(\"Not scaling down since [Free Count] + [Step Down] \" + freeCount + \" + \" + stepDown +\n \" < [Free Buffer Count] \" + freeBufferCount);\n }", "public void setMaximumquantity(Long maximumquantity) {\r\n this.maximumquantity = maximumquantity;\r\n }", "@Override\n\tpublic double getBestTargetValue() {\n\t\treturn 0;\n\t}", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "private void processSuperHighValue(Bid bid) {\n\t}", "public final void max() {\n\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (secondTopMostValue > topMostValue) {\n\t\t\t\tpush(secondTopMostValue);\n\t\t\t} else {\n\t\t\t\tpush(topMostValue);\n\t\t\t}\n\t\t}\n\t}", "void xsetWBMaximum(org.apache.xmlbeans.XmlDecimal wbMaximum);", "private void updateValue() {\n int minValue = 100; //Minimum value to be calculated, initialized to a large number\n value = 0; //Value reinitialized to 0\n for (Integer i : values) {\n if (i > value && i <= 21) {\n value = i; //Sets value to maximum value less than or equal to 21\n }\n if (i < minValue) {\n minValue = i; //Sets minimum value to lowest value in the list\n }\n }\n if (value == 0) {\n value = minValue; //Sets value to minValue if no values 21 or less\n }\n valueLabel.setText(\"Value: \" + value); //Sets text of value label\n if (value > 21) {\n bust(); //Busts if value greater than 21\n }\n }", "public float getWeightUsed()\r\n {\r\n // implement our own magic formula here ...\r\n return 2.0f;\r\n }", "public static double getBestknapSack01Value(double maxWeight, double[] w, double[] v) {\n // pack = new boolean[weight.length + 1];\n int[] weight = new int[w.length + 1];\n for (int i = 0; i < w.length; i++) {\n weight[i + 1] = (int) w[i];\n }\n int[] value = new int[v.length + 1];\n for (int i = 0; i < v.length; i++) {\n value[i + 1] = (int) v[i];\n }\n boolean[] pack = new boolean[v.length + 1];\n CalculateknapSack01((int) maxWeight, pack, weight, value);\n return getBestKnapSackValue((int) maxWeight, pack, weight, value);\n }", "public void setWeightLimit(int weightLimit) {\n\t\tthis.weightLimit = weightLimit;\n\t}", "public Long getMaximumquantity() {\r\n return maximumquantity;\r\n }", "public int getMaxOldProductPriceForUpdateInOurs() {\n return 24;\n }", "public void setMaximumWaterRequirement(double w) {\n this.Maximum_Water_Requirement = w;\n }", "Double getMaximumValue();", "public static int knapsackRep(int[] values, int[] weights, int twt) {\n //assume the two input are sorted\n int[] maxVals = new int[twt + 1];\n // maximum value for the minimum weight is corresponding value\n maxVals[weights[0]] = values[0];\n // iterate over until you get the target wt\n for (int currWt = weights[0] + 1; currWt <= twt; currWt++) {\n // initialize current max weight to be infinity\n int currMaxVal = -1;\n for (int wtInd = 0; wtInd < weights.length; wtInd++) {\n // prevWt to check is current\n if ((currWt == weights[wtInd]) && (values[wtInd] > currMaxVal)) {\n currMaxVal = values[wtInd];\n }\n int prevWt = currWt - weights[wtInd];\n // if the prevWt value is valid\n if ((prevWt > 0) && (prevWt <= twt)) {\n // if there is a valid value for prevWt\n if (maxVals[prevWt] > 0) {\n int candMaxVal = maxVals[prevWt] + values[wtInd];\n if (candMaxVal > currMaxVal) {\n currMaxVal = candMaxVal;\n }\n }\n }\n }\n if (currMaxVal != -1) {\n maxVals[currWt] = currMaxVal;\n }\n }\n printArr(maxVals, \"Maximum value is %d for weight %d\" + System.lineSeparator());\n return maxVals[twt];\n }", "public int getTopWeight(){\r\n\t \treturn this.topWeight;\r\n\t }", "static int unboundedKnapsack(int [] val,int[] wt, int W){\n int n = val.length;\n int[][] dp = new int[n+1][W+1];\n for (int i =0;i<=n;i++){\n dp[i][0] = 0;\n }\n for (int j = 0;j<=W;j++){\n dp[0][j] = 0;\n }\n\n for (int i=1;i<=n;i++){\n for (int j = 1;j<=W;j++){\n if (wt[i-1] <= j){\n dp[i][j] = Math.max(dp[i-1][j], val[i-1] + dp[i][j - wt[i-1]]);\n }else{\n dp[i][j] = dp[i-1][j];\n }\n }\n }\n return dp[n][W];\n }", "public static int[] knapsackNoRep(int[] values, int[] weights, int twt) {\n // at maxValSets[i] points to a row of weight indices that provide the max set to achieve weight i;\n int[][] maxValSets = new int[twt + 1][];\n for (int i = 0; i < weights.length; i++) {\n //there is only one value[i] to achieve maximum weight i\n maxValSets[weights[i]] = new int[]{i};\n }\n\n // maxValSets[weights[0]] = new int[]{0};\n int currWt = weights[0];\n while (currWt <= twt) {\n // start with weights at currWt\n for (int wtIndx = 0; wtIndx < weights.length; wtIndx++) {\n // these are set of indices that provide current max value at currWt\n int[] currMaxIndices = maxValSets[currWt];\n // if the current weight index has not already been used\n int nextWt = currWt + weights[wtIndx];\n if ((nextWt <= twt) && (!contains(currMaxIndices, wtIndx))) {\n // need to find weight indices at currWt + weight[wtIndx]\n int nextMaxWithCurr = Arrays.stream(currMaxIndices).map((ind) -> values[ind]).sum() + values[wtIndx];\n int[] nextCurrMaxIndices = maxValSets[nextWt];\n int nextCurrMax = 0;\n if (nextCurrMaxIndices != null) {\n nextCurrMax = Arrays.stream(nextCurrMaxIndices).map((ind) -> values[ind]).sum();\n }\n // if\n if (nextMaxWithCurr > nextCurrMax) {\n int[] newMaxArr = new int[currMaxIndices.length + 1];\n System.arraycopy(currMaxIndices, 0, newMaxArr, 0, currMaxIndices.length);\n // at the last element add the current weight index\n newMaxArr[currMaxIndices.length] = wtIndx;\n maxValSets[nextWt] = newMaxArr;\n }\n }\n }\n currWt++;\n while ((currWt <= twt) && (maxValSets[currWt] == null)) {\n currWt++;\n }\n }\n int[] tinds = maxValSets[twt];\n if (tinds != null) {\n int maxVal = 0;\n System.out.println(\"For target weight \" + twt + \" use:\");\n for (int i : tinds) {\n System.out.print(\"weight \" + weights[i] + \" val \" + values[i] + \" ,\");\n maxVal += values[i];\n }\n System.out.println(\" Total value = \" + maxVal);\n }\n return maxValSets[twt];\n\n }", "private static long calculateBestPickWithoutRepetition(int weight, Item[] items, long[][] DP) {\n\n for(int w = 1; w <= weight; w++) {\n for(int i = 1; i <= items.length; i++) {\n DP[w][i] = DP[w][i-1];\n Item item = items[i-1];\n\n if (item.getWeight() <= w) {\n DP[w][i] = Math.max(DP[w][i], DP[w - item.getWeight() ][i-1] + item.getValue());\n }\n }\n }\n\n return DP[DP.length -1][DP[0].length - 1];\n }", "public int getMaxpower() {\n\t\treturn 0;\r\n\t}", "public void setXpeQtyMax(BigDecimal value) {\n setAttributeInternal(XPEQTYMAX, value);\n }", "public static double calculateLimit() {\n return 500;\n }", "static int maxProfit(int[] prices)\n\t{\n\t\tint len = prices.length;\n\t\tint min = Integer.MAX_VALUE;\n\t\tint profit = 0;\n\t\tfor (int i = 0; i < len; i++)\n\t\t{\n\t\t\tmin = min > prices[i] ? prices[i] : min;\n\t\t\tprofit = prices[i] - min > profit ? prices[i] - min : profit; \n\t\t}\n\t\treturn profit;\n\t}", "void setMaximum(java.math.BigDecimal maximum);", "public float getMaxValue();", "void ksUnbounded(int targetWeight, int nItems, int[] iWeights, int[] iValues) {\n\r\n\t\tint[][] ksItemCapacity = new int[nItems + 1][targetWeight + 1];\r\n\t\tint[][] ksTrack = new int[nItems + 1][targetWeight + 1];\r\n\r\n\t\tfor (int w = 0; w <= targetWeight; w++) {\r\n\t\t\tksItemCapacity[0][w] = 0;\r\n\t\t}\r\n\r\n\t\tfor (int item = 1; item < nItems; item++) {\r\n\t\t\tfor (int w = 0; w <= targetWeight; w++) {\r\n\t\t\t\t// last known Maximum value of KS contents s.t. their weight\r\n\t\t\t\t// totals to atmost w-iWeights[item]\r\n\t\t\t\tint eItemValue = (iWeights[item] <= w) ? ksItemCapacity[item - 1][w\r\n\t\t\t\t\t\t- iWeights[item]]\r\n\t\t\t\t\t\t: 0;\r\n\t\t\t\tif ((iWeights[item] <= w)\r\n\t\t\t\t\t\t&& (iValues[item] + eItemValue) > ksItemCapacity[item - 1][w]) {\r\n\t\t\t\t\tksItemCapacity[item][w] = eItemValue + iValues[item];\r\n\t\t\t\t\t// current item included\r\n\t\t\t\t\tksTrack[item][w] = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tksItemCapacity[item][w] = ksItemCapacity[item - 1][w];\r\n\t\t\t\t\t// current item not included\r\n\t\t\t\t\tksTrack[item][w] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Print KS contents\r\n\t\tArrayList<Integer> ksContents = new ArrayList<Integer>();\r\n\t\tint tW = targetWeight;\r\n\t\tfor (int item = nItems; item >= 0; item--) {\r\n\t\t\tif (ksTrack[item][tW] == 1) {\r\n\t\t\t\ttW -= iWeights[item];\r\n\t\t\t\tksContents.add(item);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Items choosen are:\");\r\n\t\tint W = 0, V = 0;\r\n\t\tfor (Integer e : ksContents) {\r\n\t\t\tW += iWeights[e];\r\n\t\t\tV += iValues[e];\r\n\t\t\tSystem.out.println(\"Weight: \" + iWeights[e] + \", Value: \"\r\n\t\t\t\t\t+ iValues[e]);\r\n\t\t}\r\n\t\tSystem.out.println(\"Total weight: \" + W + \" Total value: \" + V);\r\n\t}", "public static int getOreValueRandomLimit() {\r\n\t\treturn 50;\r\n\t}", "void modifyMaximumBudget(TotalBudget totalBudget) throws NoUserSelectedException;", "public double knapsack(double[] valuePass, double[] weightPass, double capacity) {\n\n if (valuePass.length == 0) { return 0; }\n value = valuePass;\n weight = weightPass;\n double[] subsets = new double[value.length];\n double takenValue = 0;\n double takenWeight = 0;\n double selection = 0;\n\n // look at each subset of the entire set\n for (int i = 0; i < Math.pow(2, value.length); i++) {\n\n /* INVARIANT: the value/weight values are greater than 0 */\n if (KnapsackMain.debug)\n assert assertionValueWeightGreaterThanZero(takenValue, takenWeight);\n\n // variables for the inner loop\n int itemToTake = value.length - 1;\n double temporaryValue = 0;\n double temporaryWeight = 0;\n\n // wh\n while (subsets[itemToTake] != 0 && itemToTake > 0) {\n subsets[itemToTake] = 0;\n itemToTake = itemToTake - 1;\n }\n\n subsets[itemToTake] = 1;\n\n for (int j = 0; j < value.length; j++) {\n\n // if the item is marked in the subset, then add it to the takenValue\n if (subsets[j] == 1 ) {\n temporaryValue = temporaryValue + value[j];\n temporaryWeight = temporaryWeight + weight[j];\n }\n }\n\n if (temporaryValue > takenValue && temporaryWeight <= capacity) {\n takenValue = temporaryValue;\n takenWeight = temporaryWeight;\n }\n }\n return takenValue;\n }", "public static int knapsack(int[] weights, int[] values, int n, int maxWeight) {\n return knapSack(maxWeight, weights, values, n);\r\n }", "org.apache.xmlbeans.XmlDecimal xgetSingleBetMinimum();", "private void updateMax(int val) {\n overallMax.updateMax(val);\n for (HistoryItem item : watchers.values()) {\n item.max.updateMax(val);\n }\n }" ]
[ "0.6650229", "0.6519421", "0.64571065", "0.6399682", "0.6357538", "0.6351207", "0.6313644", "0.629626", "0.6145918", "0.6127599", "0.6116213", "0.6100449", "0.6087184", "0.60794073", "0.607563", "0.60680765", "0.6039796", "0.60363775", "0.60312504", "0.5989931", "0.5986619", "0.598474", "0.5983222", "0.59751666", "0.59619504", "0.59557724", "0.59557104", "0.59522426", "0.59441966", "0.59234875", "0.5918085", "0.5912954", "0.589737", "0.58913237", "0.5877226", "0.58711225", "0.58693576", "0.585802", "0.58523244", "0.5838179", "0.5836471", "0.5835749", "0.58290297", "0.5815015", "0.57879955", "0.57827246", "0.576347", "0.57477105", "0.57327193", "0.5730643", "0.57075787", "0.569828", "0.56946754", "0.5679731", "0.56786084", "0.56732374", "0.56589574", "0.5648648", "0.5648254", "0.5645759", "0.5645706", "0.5637659", "0.5630365", "0.5628456", "0.56282026", "0.56238997", "0.561815", "0.56181335", "0.561374", "0.56113315", "0.56078446", "0.56069547", "0.56025535", "0.5601089", "0.55928004", "0.55926764", "0.5590271", "0.55899584", "0.5587869", "0.5585326", "0.55837345", "0.55773205", "0.55756193", "0.55748737", "0.557352", "0.5572105", "0.55711126", "0.55697536", "0.5568353", "0.55651665", "0.5564421", "0.55626804", "0.55621505", "0.5560934", "0.5560509", "0.55602735", "0.555985", "0.55592465", "0.5555322", "0.55546224" ]
0.57092255
50
Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.bestbuy.tsh.facilities.locations.service.v2
public ObjectFactory() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private EntityFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "ObjectFactoryGenerator objectFactoryGenerator();", "@Override\n protected ObjectFactory initObjectFactory() {\n try {\n BeanManager bm = (BeanManager) new InitialContext().lookup(\"java:comp/BeanManager\");\n Set<Bean<?>> beans = bm.getBeans(CdiObjectFactory.class);\n Bean<CdiObjectFactory> beanType = (Bean<CdiObjectFactory>) beans.iterator().next();\n CreationalContext<CdiObjectFactory> ctx = bm.createCreationalContext(beanType);\n CdiObjectFactory objFactory = (CdiObjectFactory) bm.getReference(beanType, CdiObjectFactory.class, ctx);\n objFactory.init(this);\n return objFactory;\n } catch (Exception ex) {\n throw new RuntimeException(ex);\n }\n }", "public ObjectifyFactory factory() {\n return ofy().factory();\n }", "private ObjectFactory() { }", "public interface GraphQLFactory extends EFactory\n{\n /**\n * The singleton instance of the factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @generated\n */\n GraphQLFactory eINSTANCE = io.github.katmatt.graphql.graphQL.impl.GraphQLFactoryImpl.init();\n\n /**\n * Returns a new object of class '<em>Type System Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type System Definition</em>'.\n * @generated\n */\n TypeSystemDefinition createTypeSystemDefinition();\n\n /**\n * Returns a new object of class '<em>Schema Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Schema Definition</em>'.\n * @generated\n */\n SchemaDefinition createSchemaDefinition();\n\n /**\n * Returns a new object of class '<em>Root Operation Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Root Operation Type Definition</em>'.\n * @generated\n */\n RootOperationTypeDefinition createRootOperationTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type Definition</em>'.\n * @generated\n */\n TypeDefinition createTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Scalar Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Scalar Type Definition</em>'.\n * @generated\n */\n ScalarTypeDefinition createScalarTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Object Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Type Definition</em>'.\n * @generated\n */\n ObjectTypeDefinition createObjectTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Interface Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Interface Definition</em>'.\n * @generated\n */\n InterfaceDefinition createInterfaceDefinition();\n\n /**\n * Returns a new object of class '<em>Field Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Definition</em>'.\n * @generated\n */\n FieldDefinition createFieldDefinition();\n\n /**\n * Returns a new object of class '<em>Union Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Union Type Definition</em>'.\n * @generated\n */\n UnionTypeDefinition createUnionTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Enum Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Type Definition</em>'.\n * @generated\n */\n EnumTypeDefinition createEnumTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Enum Value Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Value Definition</em>'.\n * @generated\n */\n EnumValueDefinition createEnumValueDefinition();\n\n /**\n * Returns a new object of class '<em>Input Object Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Input Object Type Definition</em>'.\n * @generated\n */\n InputObjectTypeDefinition createInputObjectTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Input Value Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Input Value Definition</em>'.\n * @generated\n */\n InputValueDefinition createInputValueDefinition();\n\n /**\n * Returns a new object of class '<em>Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type</em>'.\n * @generated\n */\n Type createType();\n\n /**\n * Returns a new object of class '<em>Named Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Named Type</em>'.\n * @generated\n */\n NamedType createNamedType();\n\n /**\n * Returns a new object of class '<em>List Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>List Type</em>'.\n * @generated\n */\n ListType createListType();\n\n /**\n * Returns a new object of class '<em>Int Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Int Value</em>'.\n * @generated\n */\n IntValue createIntValue();\n\n /**\n * Returns a new object of class '<em>Float Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Float Value</em>'.\n * @generated\n */\n FloatValue createFloatValue();\n\n /**\n * Returns a new object of class '<em>Null Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Null Value</em>'.\n * @generated\n */\n NullValue createNullValue();\n\n /**\n * Returns a new object of class '<em>String Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>String Value</em>'.\n * @generated\n */\n StringValue createStringValue();\n\n /**\n * Returns a new object of class '<em>Boolean Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Boolean Value</em>'.\n * @generated\n */\n BooleanValue createBooleanValue();\n\n /**\n * Returns a new object of class '<em>Enum Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Value</em>'.\n * @generated\n */\n EnumValue createEnumValue();\n\n /**\n * Returns a new object of class '<em>Object Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Value</em>'.\n * @generated\n */\n ObjectValue createObjectValue();\n\n /**\n * Returns a new object of class '<em>Object Field</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Field</em>'.\n * @generated\n */\n ObjectField createObjectField();\n\n /**\n * Returns a new object of class '<em>Const Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Const Value</em>'.\n * @generated\n */\n ConstValue createConstValue();\n\n /**\n * Returns a new object of class '<em>List Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>List Value</em>'.\n * @generated\n */\n ListValue createListValue();\n\n /**\n * Returns a new object of class '<em>Directive Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Directive Definition</em>'.\n * @generated\n */\n DirectiveDefinition createDirectiveDefinition();\n\n /**\n * Returns a new object of class '<em>Directive</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Directive</em>'.\n * @generated\n */\n Directive createDirective();\n\n /**\n * Returns a new object of class '<em>Argument</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Argument</em>'.\n * @generated\n */\n Argument createArgument();\n\n /**\n * Returns the package supported by this factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return the package supported by this factory.\n * @generated\n */\n GraphQLPackage getGraphQLPackage();\n\n}", "private ObjectFactory createObjectFactory(String objectFactoryNamespace)\r\n throws CockpitConfigurationException {\r\n try {\r\n return new ObjectFactory(new ConfigManagerSpecificationFactory(objectFactoryNamespace));\r\n } catch (IllegalReferenceException e) {\r\n throw new CockpitConfigurationException(\r\n \"IllegalReferenceException occurs while creating ObjectFactory instance using namespace \"\r\n + objectFactoryNamespace, e);\r\n } catch (SpecificationConfigurationException e) {\r\n throw new CockpitConfigurationException(\r\n \"SpecificationConfigurationException occurs while creating ObjectFactory instance using namespace \"\r\n + objectFactoryNamespace, e);\r\n }\r\n }", "private DTOFactory() {\r\n \t}", "@SuppressWarnings(\"unchecked\")\n\tprivate static XmlEntityObjectFactory getFactory() {\n\t\tif (factory == null) {\n\t\t\tfactory = new XmlEntityObjectFactory();\n\t\t\ttry {\n\t\t\t\tClass<IXmlEntityResolverLoader> loaderClass = (Class<IXmlEntityResolverLoader>) Class\n\t\t\t\t\t\t.forName(defaulEntityResolverLoaderClassName);\n\t\t\t\tIXmlEntityResolverLoader loader;\n\t\t\t\tloader = loaderClass.newInstance();\n\t\t\t\tloader.loadTo(factory);\n\t\t\t} catch (Exception ex) {\n\t\t\t\tthrow new UnexpectedRuntimeException(ex);\n\t\t\t}\n\t\t}\n\t\treturn factory;\n\t}", "public OBStoreFactory getFactory();", "private ORMServiceFactory() { }", "public interface ApiFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tApiFactory eINSTANCE = work.andycarpenter.webgen.pims.api.impl.ApiFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>API</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>API</em>'.\n\t * @generated\n\t */\n\tAPI createAPI();\n\n\t/**\n\t * Returns a new object of class '<em>Resource</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Resource</em>'.\n\t * @generated\n\t */\n\tResource createResource();\n\n\t/**\n\t * Returns a new object of class '<em>Resource Selection</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Resource Selection</em>'.\n\t * @generated\n\t */\n\tResourceSelection createResourceSelection();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tApiPackage getApiPackage();\n\n}", "public static Tp2Factory init() {\n\t\ttry {\n\t\t\tTp2Factory theTp2Factory = (Tp2Factory)EPackage.Registry.INSTANCE.getEFactory(\"http:///recette1-tp2-v0\"); \n\t\t\tif (theTp2Factory != null) {\n\t\t\t\treturn theTp2Factory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new Tp2FactoryImpl();\n\t}", "SchemaBuilder withFactory(String factoryClassName);", "public ObjectFactory() {\n\t}", "public ObjectFactory() {\r\n\t}" ]
[ "0.5970813", "0.5906768", "0.5906768", "0.5906768", "0.5899731", "0.58580935", "0.58211935", "0.5797012", "0.578937", "0.5783719", "0.57710516", "0.5770201", "0.5765123", "0.5758739", "0.57543504", "0.57472646", "0.57397753", "0.5729349", "0.57234794" ]
0.0
-1
Check if it's need to compare values as numbers or not. value1 is usually expected one and could contain formula from ComparisonUtils. So need to process it like notnumeric value in default way
@Override public ComparisonResult compareValues(String expectedValue, String actualValue, String column) throws Exception { if (StringUtils.isNotBlank(expectedValue) && StringUtils.isNotBlank(actualValue) && !expectedValue.startsWith(MatrixFunctions.FORMULA_START) && numericColumns.containsKey(column)) { try { BigDecimal bdExpectedValue = new BigDecimal(bdValueTransformer != null ? bdValueTransformer.transform(expectedValue) : expectedValue), bdActualValue = new BigDecimal(bdValueTransformer != null ? bdValueTransformer.transform(actualValue) : actualValue), precision = numericColumns.get(column); return ComparisonResult.from(bdExpectedValue.subtract(bdActualValue).abs().compareTo(precision) <= 0); } catch (Exception e) { logger.trace("Couldn't present values '{}' and '{}' for numeric column '{}' as BigDecimal." + " They will be compared by default as strings", expectedValue, actualValue, column, e); } } return super.compareValues(expectedValue, actualValue, column); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testGetNumericValue1() {\n ValueString vs = new ValueString(\"1000\");\n\n assertEquals(\"1000\", vs.getString());\n assertEquals(1000.0D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(1000, vs.getInteger());\n assertEquals(BigDecimal.valueOf(1000), vs.getBigNumber());\n }", "public abstract boolean isNumeric();", "public void testGetNumericValue2() {\n ValueString vs = new ValueString(\"2.8\");\n\n assertEquals(\"2.8\", vs.getString());\n assertEquals(2.8D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n assertEquals(2.8D, vs.getBigNumber().doubleValue(), 0.1D);\n }", "private void processNumericValues(ReportConcept entry, ConceptLabel lbl) {\n\t\tif (isNumber(entry.getConceptClass()) && !entry.getConceptEntry().hasNumericValue()) {\n\t\t\tentry.setNumericValue(TextHelper.parseDecimalValue(lbl.getText()));\n\t\t}\n\t}", "private static int numCompare(Number value1, Number value2) {\n\t\tif (value1 instanceof Double || value2 instanceof Double) {\n\t\t\treturn Double.compare(\n\t\t\t\t\t(value1).doubleValue(),\n\t\t\t\t\t(value2).doubleValue()\n\t\t\t);\n\t\t}\n\t\treturn Integer.compare(\n\t\t\t\t(Integer)value1,\n\t\t\t\t(Integer)value2\n\t\t);\n\t}", "public static boolean checkIfNumeric(Object toBeChecked)\r\n\t{\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble((String) toBeChecked);\r\n\t\t\treturn true;\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\treturn true;\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isNumberValue()\n {\n return getFieldType().equalsIgnoreCase(TYPE_NUMBER);\n }", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static boolean isNumberRatio(Object val) throws BaseException\n {\n \tif(val instanceof Number && (NumberUtil.toDouble(val) >= 0 && NumberUtil.toDouble(val) <= 100))\n \t{\n \t return true;\n \t}\n \treturn false;\n }", "public static boolean isNumeric(String value) {\n // Procedimiento para monitorear e informar sobre la excepcion\n try {\n //Se realiza asignacion de dato numerico\n Float.parseFloat(value);\n return true;\n\n }\n //Mostrar mensaje de error\n catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null,Constantes.TXT_Msg_Error,\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n\n return false;\n\n }\n\n }", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}", "private static boolean isNumber(String value){\r\n\t\tfor (int i = 0; i < value.length(); i++){\r\n\t\t\tif (value.charAt(i) < '0' || value.charAt(i) > '9')\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean checkIfObjectIsDecimal(Object[] values)\n\t{\n\t\tfor (Object o : values)\n\t\t{\n\t\t\tif (o != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tDouble.parseDouble(o.toString());\n\t\t\t\t//\treturn true;\n\t\t\t\t}\n\t\t\t\tcatch (NumberFormatException e)\n\t\t\t\t{\n\t\t\t\t\t// it's text :)\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean checkNumber() {\n\t\treturn true;\n\t}", "private boolean validarNumDistanc(double value) {\n\n String msjeError;\n if (value < 0) {\n\n msjeError = \"Valor No Aceptado\";\n this.jLabelError.setText(msjeError);\n this.jLabelError.setForeground(Color.RED);\n this.jLabelError.setVisible(true);\n\n this.jLabel5.setForeground(Color.red);\n return false;\n } else {\n\n this.jLabel5.setForeground(jlabelColor);\n this.jLabelError.setVisible(false);\n return true;\n }\n }", "@Override\r\n public boolean verify(JComponent arg0) {\r\n \r\n this.field = (JFormattedTextField) arg0;\r\n boolean result = false;\r\n this.value = this.field.getText();\r\n result = Input.isNumericWithDecimal(this.value);\r\n \r\n //if it is numeric with a decimal\r\n if(result == true){\r\n \r\n //Split string on decimal\r\n String[] array = this.value.split(\"\\\\.\");\r\n if (array[0].length() < 12 && array[1].length() < 3) {\r\n result = true;\r\n }\r\n else{\r\n result = false;\r\n }\r\n \r\n }\r\n //check for reasonable length and if value is only numeric\r\n else if (this.value.length() < 12 && Input.isNumeric(this.value)) {\r\n result = true;\r\n }\r\n \r\n return result;\r\n }", "@Override\n public Boolean getValue(Number number, Number number2) {\n if(number==number2){\n return true;\n }\n else {\n return false;\n }\n\n }", "private boolean compare(ValueType first, ValueType second) {\r\n // TODO\r\n return false;\r\n }", "public boolean isNumeric() {\n return this.isInteger() || this.isDecimal() || this.isDouble();\n }", "private void processNumericModifier() {\n\n Token token = tokens.get(currentTokenPointer);\n\n if (currentVersionComponent == 3) {\n\n raiseParseProblem(\"cannot specify a numerical +/- value for the qualifier, found '\" + string(token) + \"' at position \" + token.start,\n\n token.start);\n\n }\n\n String tokenString = string(token);\n\n try {\n\n Integer value = null;\n\n if (token.kind == TokenKind.PLUSNUMBER) {\n\n value = Integer.parseInt(tokenString.substring(1));\n\n } else {\n\n value = Integer.parseInt(tokenString);\n\n }\n\n pushIt(new SumTransformer(value));\n\n } catch (NumberFormatException nfe) {\n\n raiseParseProblem(\"cannot parse numerical value '\" + tokenString + \"' at position \" + token.start, token.start);\n\n }\n\n }", "private boolean acceptedValueRange(double amount){\n if(amount <= 1.0 && amount >= 0.0){\n return true;\n }\n else{\n throw new IllegalArgumentException(\"Number must be in range of [0,1]\");\n }\n }", "private boolean isValidValue(double value) {\r\n\t\treturn (value > 0);\r\n\t}", "public static Object ge(Object val1, Object val2) {\n\t\tif (isFloat(val1) && isFloat(val2)) {\n\t\t\treturn ((BigDecimal) val1).compareTo((BigDecimal) val2) >= 0;\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).compareTo((BigInteger) val2) >= 0;\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in ge\");\n\t}", "double getBasedOnValue();", "public static Object isNaN(Context cx, Scriptable thisObj,\n Object[] args, Function funObj)\n {\n if (args.length < 1)\n return Boolean.TRUE;\n double d = ScriptRuntime.toNumber(args[0]);\n return (d != d) ? Boolean.TRUE : Boolean.FALSE;\n }", "public static Object gt(Object val1, Object val2) {\n\t\tif (isFloat(val1) && isFloat(val2)) {\n\t\t\treturn ((BigDecimal) val1).compareTo((BigDecimal) val2) > 0;\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).compareTo((BigInteger) val2) > 0;\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in gt\");\n\t}", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "private Comparison compareValues(SimpleNode first, SimpleNode second) {\n return Objects.equals(first.jjtGetValue(), second.jjtGetValue()) ? Comparison.IS_EQUAL\n : Comparison.notEqual(\"Node values differ: \" + first.jjtGetValue() + \" vs \" + second.jjtGetValue());\n }", "boolean isNumber(Formula pTt);", "protected boolean isDefaultValue(Object value){\n\n return value instanceof Number && value.equals(0);\n\n }", "public abstract Value validateValue(Value value);", "public boolean Mayor(Object obj1, Object obj2){\n return (Double.parseDouble(obj1.toString()) > Double.parseDouble(obj2.toString()));\n }", "private boolean isAllNums(String fieldVal){\r\n // Get rid of all whitespace\r\n String val = fieldVal.replaceAll(\"\\\\s\",\"\").trim();\r\n // check for presence of letters in the string, ignoring '()' and '-'\r\n for (int i=0; i < val.length(); i++){\r\n if (val.charAt(i) != '(' || val.charAt(i) != ')' || val.charAt(i) != '-'){\r\n if (Character.isLetter(val.charAt(i))){\r\n return false;\r\n }\r\n }\r\n }\r\n return true; \r\n }", "protected boolean isNumberValid(@NotNull ConversationContext context, @NotNull Number input) {\n/* 30 */ return true;\n/* */ }", "@Test\n public void testFloatInRange() {\n int lowEnd = -10;\n int highEnd = 10;\n Optional<NumberValue> optRslt = floatService.floatInRange(lowEnd, highEnd);\n assertTrue(optRslt.isPresent());\n NumberValue numberValue = optRslt.get();\n assertTrue(lowEnd * 1.0 <= numberValue.getNumber().doubleValue());\n assertTrue(highEnd * 1.0 >= numberValue.getNumber().doubleValue());\n System.out.println(\"Number Value = \" + numberValue.toString());\n }", "public static boolean isNumber(String val)\n {\n\t if(val == null || val.trim().isEmpty())\n\t {\n\t\t return false;\n\t }\n\t else\n\t {\n\t\t Pattern patternForNumber = Pattern.compile(\"^[+-]?(([0-9]+\\\\.?[0-9]+)|[0-9]+)\");\n\t\t return patternForNumber.matcher(val).matches();\n\t }\n }", "@SuppressWarnings(\"unchecked\")\n protected void \n validate\n (\n Comparable value\t \n )\n throws IllegalArgumentException \n {\n if((value != null) && !(value instanceof Double))\n throw new IllegalArgumentException\n\t(\"The parameter (\" + pName + \") only accepts (Double) values!\");\n }", "public static boolean almostEqualsNumber(double value1, double value2) {\n return almostEqualsNumber(value1, value2, DOUBLE_EPSILON);\n }", "@Test\n public void isNumericNegetive() {\n Boolean bool = Utils.isNumeric(\"123a\");\n Assert.assertEquals(false, bool);\n }", "public void testSetNumber() {\n ValueString vs = new ValueString();\n\n vs.setNumber(0);\n assertEquals(\"0.0\", vs.getString());\n vs.setNumber(1);\n assertEquals(\"1.0\", vs.getString());\n vs.setNumber(-1);\n assertEquals(\"-1.0\", vs.getString());\n vs.setNumber(2.5);\n assertEquals(\"2.5\", vs.getString());\n vs.setNumber(2.8);\n assertEquals(\"2.8\", vs.getString());\n }", "public static boolean compareNumerics(Parser parser, ResultValue resOp1, ResultValue resOp2, String operator)\r\n {\r\n \tdouble val1 = Numeric.getDoubleValue(resOp1.value);\r\n \tdouble val2 = Numeric.getDoubleValue(resOp2.value);\r\n \t\r\n \t\r\n \t\r\n \tswitch(operator)\r\n \t{\r\n \t\tcase \">=\" :\r\n \t\t\tif(val1 >= val2)\r\n \t\t\t\treturn true;\r\n \t\t\telse \r\n \t\t\t\treturn false;\r\n \t\t\r\n \t\tcase \">\" :\r\n \t\t\tif(val1 > val2)\r\n \t\t\t\treturn true;\r\n \t\t\telse\r\n \t\t\t\treturn false;\r\n \t\t\r\n \t\tcase \"<=\" :\r\n \t\t\tif(val1 <= val2)\r\n \t\t\t\treturn true;\r\n \t\t\telse\r\n \t\t\t\treturn false;\r\n \t\t\r\n \t\tcase \"<\" :\r\n \t\t\tif(val1 < val2)\r\n \t\t\t\treturn true;\r\n \t\t\telse\r\n \t\t\t\treturn false;\r\n \t\t\r\n \t\tcase \"!=\" :\r\n \t\t\tif(val1 != val2)\r\n \t\t\t\treturn true;\r\n \t\t\telse\r\n \t\t\t\treturn false;\r\n \t\t\r\n \t\tcase \"==\" :\r\n \t\t\tif(val1 == val2)\r\n \t\t\t\treturn true;\r\n \t\t\telse\r\n \t\t\t\treturn false;\r\n \t\t\r\n \t\tdefault :\r\n \t\t\tSystem.out.println(\"Error in compare Numerics, \" + operator + \" is not valid\");\r\n \t\t\treturn false;\r\n \t\t\r\n \t\t\t\r\n \t\t\r\n \t}\r\n }", "public static boolean numberFormatIsValid(String value) {\n return value.matches(\"^(([0-9]{1,3}[.][0-9]{1,2})|([0-9]{1,3}))$\");\n }", "private Double check_mathOperator(Double result) {\n \r\n switch(mathOperator){\r\n case '/':\r\n result =totalFirst/totalLast;\r\n break;\r\n case 'x':\r\n result =totalFirst*totalLast;\r\n break;\r\n case '-':\r\n result =totalFirst-totalLast;\r\n break;\r\n case '+':\r\n result =totalFirst+totalLast;\r\n break;\r\n \r\n }\r\n return result;\r\n }", "protected boolean processWeightTextField()\n {\n String text = weightTextField.getText();\n try\n {\n // If parsing causes no errors, then return true.\n float x = Float.parseFloat(text);\n\n // probably should use a better float comparison\n Boolean result = x >= 0.f && x <= 1.f;\n\n if (!result)\n {\n throw new IllegalArgumentException();\n }\n return true;\n\n }\n catch (NumberFormatException e)\n {\n updateWeightTextFieldToStored(\"Value should be\"\n + \" between 0.0 and 1.0\");\n }\n catch (IllegalArgumentException e)\n {\n updateWeightTextFieldToStored(\"Value should be\"\n + \" between 0.0 and 1.0\");\n\n }\n return false;\n }", "public Number getNumberValue();", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "protected int compareNumbers(Number n1, Number n2) {\n BigDecimal bd1 = new BigDecimal(n1.toString());\n BigDecimal bd2 = new BigDecimal(n2.toString());\n return bd1.compareTo(bd2);\n }", "public boolean isNumber(String key)\n {\n return getDouble(key, Double.MAX_VALUE) != Double.MAX_VALUE;\n }", "private void processNumber() {\r\n\t\tString number = extractNumber();\r\n\r\n\t\tif ((!number.equals(\"1\")) && (!number.equals(\"0\"))) {\r\n\t\t\tthrow new LexerException(String.format(\"Unexpected number: %s.\", number));\r\n\t\t}\r\n\r\n\t\ttoken = new Token(TokenType.CONSTANT, number.equals(\"1\"));\r\n\t}", "@Test\n\tpublic void testValidInput() {\n\t\t\n\t\tString normalInput = \"1357.459\";\n\t\tString germanInput = \"1357,459\";\n\t\tBigDecimal expectedOutput = new BigDecimal(normalInput);\n\t\t\n\t\t// normal input\n\t\tfor( final CellProcessor p : Arrays.asList(processor, processor2, processorChain, processorChain2) ) {\n\t\t\tassertExecution(p, normalInput, expectedOutput);\n\t\t}\n\t\t\n\t\t// german input (\",\" instead of \".\" as decimal symbol)\n\t\tfor( final CellProcessor p : Arrays.asList(processor3, processorChain3) ) {\n\t\t\tassertExecution(p, germanInput, expectedOutput);\n\t\t}\n\t}", "public static boolean isNumber(String token) {\n boolean toret = true;\n\n try {\n Double.parseDouble(token);\n }\n catch(Exception e)\n {\n toret = false;\n }\n\n return toret;\n }", "@Test\n public void isNumeric() {\n assertTrue(Deadline.isNumeric(VALID_YEAR_2018));\n\n //contains other symbols -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SYMBOLS));\n\n //contains alphabets -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_ALPHABETS));\n\n //contains space -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SPACE));\n }", "protected void runTest() throws OgnlException\n {\n Object result;\n\n result = OgnlOps.convertValue(value, toClass);\n if (!isEqual(result, expectedValue)) {\n if (scale >= 0) {\n double scalingFactor = Math.pow(10, scale),\n v1 = ((Number) value).doubleValue() * scalingFactor,\n v2 = ((Number) expectedValue).doubleValue() * scalingFactor;\n\n assertTrue((int) v1 == (int) v2);\n } else {\n fail();\n }\n }\n }", "public boolean areNumeric(Type typeone, Type typetwo){\n /* if they are both the same alias type, get the underlying type */\n if(areBinaryAlias(typeone,typetwo)){\n typeone = removeAlias(typeone);\n typetwo = removeAlias(typetwo);\n }//if exactly one is an alias, get it's underlying type \n// else if (typeone instanceof AliasType && !(typetwo instanceof AliasType) \n//\t\t\t\t|| !(typeone instanceof AliasType) && typetwo instanceof AliasType ) {\n//\ttypeone = removeAlias(typeone);\n//\ttypetwo = removeAlias(typetwo);\n//}\n \t\n if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof Float64Type && typetwo instanceof Float64Type) || (typeone instanceof RuneType && typetwo instanceof RuneType)) return true;\n else return false;\n }", "private static boolean checkIfIsDouble(String num) {\n try {\n Double.parseDouble(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "private boolean isNumber(String number){\n\t\ttry{\r\n\t\t\tFloat.parseFloat(number);\r\n\t\t}catch(Exception e){\r\n\t\t\treturn false;// if the user input is not number it throws flase\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isNumberNegative(Object val) throws BaseException\n{\n\tif(val instanceof Number && NumberUtil.toDouble(val) < 0 )\n\t{\n\t return true;\n\t}\n\treturn false;\n}", "@Test\n\tpublic void testNumberType() throws Exception {\n\t\tassertThat(0, is(0));\n\t}", "private static boolean isNumeric(String str) { \n\t\ttry { \n\t\t\tDouble.parseDouble(str); \n\t\t} \n\t\tcatch(NumberFormatException nfe) { \n\t\t\treturn false; \n\t\t} \n\t\treturn true; \n\t}", "private static boolean isPrimitive(String value) {\n boolean status = true;\n value = value.trim();\n if (value.length() < 1) {\n return false;\n }\n for (int i = 0; i < value.length(); i++) {\n char c = value.charAt(i);\n if (!Character.isDigit(c)) {\n status = false;\n break;\n }\n }\n\n return status;\n }", "@Test\n void checkIsTrueForStringWithNumbersWithSpacesAtTheBeginningAndEnd() {\n // Act, Assert\n assertTrue(IsNumeric.check(\" 3\"));\n assertTrue(IsNumeric.check(\"32 \"));\n assertTrue(IsNumeric.check(\" 3.2 \"));\n assertTrue(IsNumeric.check(\" -0.2\"));\n assertTrue(IsNumeric.check(\" -0.2d\"));\n assertTrue(IsNumeric.check(\"0.24D \"));\n assertTrue(IsNumeric.check(\"0.28 \"));\n assertTrue(IsNumeric.check(\" 3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F \"));\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public boolean lessThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(this, other) == -1;\n }", "protected IExpressionValue getNum() throws TableFunctionMalformedException {\r\n\t\tvalue = \"\";\r\n\r\n\t\tif (!((isNumeric(look)) || ((look == '.') && (value.indexOf('.') == -1))))\r\n\t\t\texpected(\"Number\");\r\n\r\n\t\twhile ((isNumeric(look))\r\n\t\t\t\t|| ((look == '.') && (value.indexOf('.') == -1))) {\r\n\t\t\tvalue += look;\r\n\t\t\tnextChar();\r\n\t\t}\r\n\r\n\t\ttoken = '#';\r\n\t\tskipWhite();\r\n\r\n\t\t// Debug.println(\"GetNum returned \" + Float.parseFloat(value));\r\n\t\treturn new SimpleProbabilityValue(Float.parseFloat(value));\r\n\t}", "public static boolean IsNumber(double par_Number) {\n return true;\n }", "private Double parseNumber(String num) {\r\n\t\tDouble tempnum = (double) 0;\r\n\t\tint opos; //operator position\r\n\t\tif ((num == null) || (num.length() < 1) ) {\r\n\t\t\treturn tempnum;\r\n\t\t}\r\n\r\n\t\t//replace constants with their value\r\n\t\twhile (num.indexOf(\"P\") >= 0) { //PI constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'P', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.PI)+numparts[1];\r\n\t\t}\r\n\t\twhile (num.indexOf(\"X\") >= 0) { //e constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'X', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.E)+numparts[1];\r\n\t\t}\r\n\r\n\t\tif (num.indexOf(\"^\") >= 0) { //allows to specify powers (e.g.: 2^10)\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '^', 2);\r\n\t\t\ttempnum = Math.pow(parseNumber(numparts[0]), parseNumber(numparts[1]));\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"-\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '-', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) - parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"+\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '+', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) + parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"/\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '/', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) / parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"*\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '*', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) * parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttempnum = Double.valueOf(num);\r\n\t\t}\r\n\r\n\t\treturn tempnum;\r\n\t}", "private double readPositive1(JTextField field, double oldValue, String title) {\n boolean isOK = true;\n double newValue = 1;\n try{\n //test input\n newValue = Double.parseDouble(field.getText());\n }\n catch (NumberFormatException e){\n //Error message\n JOptionPane.showMessageDialog(null,\n NOT_A_NUMBER,\n title,\n JOptionPane.ERROR_MESSAGE);\n isOK = false;\n }\n if (newValue <-1 ^ newValue >1){\n //ERROR message\n JOptionPane.showMessageDialog(null,\n NOT_ACCEPTED,\n title,\n JOptionPane.ERROR_MESSAGE);\n isOK = false;\n }\n if (isOK){\n return newValue;\n }\n else {\n field.setText(numberFormatter.format(oldValue));\n return oldValue;\n }\n\n }", "public static boolean almostEqualsNumber(double value1, double value2, double acceptableDifference) {\n return Math.abs(value1 - value2) <= acceptableDifference;\n }", "public static boolean isNumericString(String value) {\n\t try {\n\t\t if (Double.parseDouble(value) > 0) {\n\t\t return true;\n\t\t }\n\t } catch (NumberFormatException nfe) {\n\t return false;\n\t }\n\t return false;\n\t}", "public static Object le(Object val1, Object val2) {\n\t\tif (isFloat(val1) && isFloat(val2)) {\n\t\t\treturn ((BigDecimal) val1).compareTo((BigDecimal) val2) <= 0;\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).compareTo((BigInteger) val2) <= 0;\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in le\");\n\t}", "boolean hasNumber();", "@Override\n public boolean isValid(BigDecimal value, ConstraintValidatorContext context) {\n if (value == null) {\n return true;\n }\n\n // check if it greater than or equal $1\n if (value.compareTo(BigDecimal.valueOf(1.00)) < 0) {\n return false;\n }\n\n // if pass all of them,\n return true;\n }", "@Test\n public void testMinMaxNumber() {\n NumberValue minNumber = factory.getMinNumber();\n NumberValue maxNumber = factory.getMaxNumber();\n MatcherAssert.assertThat(minNumber + \" < \" + maxNumber, minNumber.compareTo(maxNumber), lessThan(0));\n }", "public static boolean existsExplicitNumericConversion(final TypeSpec from,\n final TypeSpec to, final Value fromValue) {\n if (from.isANum() && !existsImplicitNumericConversion(from, to)) {\n return true;\n }\n\n if (from.isANum() && (to.isANum() || (to.isAny()))) {\n return true;\n }\n\n if ((from.isVector() || from.isMatrix() || from.isList() || from\n .isString()) && to.isANum()) {\n return true;\n }\n\n return false;\n }", "public void testInferNumber1a() throws Exception {\n assertType(\"10 \", 0, 2, \"java.lang.Integer\");\n }", "public boolean setInputNumericValue(int pos, double value){\r\n\t\tAttribute at = (Attribute)Attributes.getInputAttribute(pos);\r\n\t\tif (at.getType() == Attribute.NOMINAL) return false;\r\n\t\telse{\r\n\t\t\tif (at.isInBounds(value)){\r\n\t\t\t\trealValues[0][pos] = value;\r\n\t\t\t\tmissingValues[0][pos] = false;\r\n\t\t\t\tanyMissingValue[0] = false;\r\n\t\t\t\tfor (int i=0; i<missingValues[0].length; i++) \r\n\t\t\t\t\tanyMissingValue[0] |= missingValues[0][i];\r\n\t\t\t}\r\n\t\t\telse return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "protected boolean signMustBeFormated (double value){\n return (!signFormat.equals(FormatIntegerSignVisibility.IGNORE_ALL) &&\n ((signFormat.equals(FormatIntegerSignVisibility.SHOW_NEGATIVE_ONLY) || signFormat.equals(FormatIntegerSignVisibility.SHOW_ALL)) && value < 0.0) ||\n ((signFormat.equals(FormatIntegerSignVisibility.SHOW_POSITIVE_ONLY) || signFormat.equals(FormatIntegerSignVisibility.SHOW_ALL)) && value > 0.0) ||\n (signFormat.equals(FormatIntegerSignVisibility.SHOW_ALL) && value == 0.0));\n }", "private final boolean compareIntValues(final String data1, final String data2,\n\t\t\tfinal String colName, final String key){\n\t\tint tolerance = ContextComparatorConfigReferences.DEFAULT_TOLERANCE_PERCENTAGE;\n\t\ttry {\n\t\t\ttolerance = Integer.parseInt(\n\t\t\t\t\tconfig.get(\"tolerancePercent\").toString());\n\t\t} catch (NumberFormatException e) {\n\t\t\tLOGGER.warn(\"Unable to parse tolerance percentage, falling back to default.\", e);\n\t\t}\n\n\t\t// FIXME: What if values are decimals?\n\t\tint count1 = 0;\n\t\tint count2 = 0;\n\t\ttry {\n\t\t\tcount1 = Integer.parseInt(data1);\n\t\t\tcount2 = Integer.parseInt(data2);\n\t\t} catch (NumberFormatException e) {\n\t\t\tLOGGER.error(\"Unable to parse count in \" + colName + \" for key: \" + key, e);\n\t\t\tContextComparator.addResult(namespace,\n\t\t\t\t\tContextComparatorConfigReferences.TEST_CATEGORY_COUNT_VALUES,\n\t\t\t\t\tContextComparatorConfigReferences.TEST_STATUS_FAILED,\n\t\t\t\t\t\"Parse exception for \" + colName + \" and key \" + key);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (count1 == count2) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfinal int error = Math.abs(count1 - count2)/count1*100;\n\t\tif (error < tolerance) {\n\t\t\treturn true;\n\t\t}\n\n\t\tContextComparator.addResult(namespace,\n\t\t\t\tContextComparatorConfigReferences.TEST_CATEGORY_COUNT_VALUES,\n\t\t\t\tContextComparatorConfigReferences.TEST_STATUS_FAILED,\n\t\t\t\terror + \"% error for \" + colName + \" and key \" + key\n\t\t\t\t+ \". \" + ContextComparator.CONTEXT_1.getName()\n\t\t\t\t+ \": \" + count1 + \", \" + ContextComparator.CONTEXT_2.getName()\n\t\t\t\t+ \": \" + count2);\n\t\treturn false;\n\t}", "private void validateValue()\r\n {\r\n try\r\n {\r\n Long.parseLong(getText());\r\n }\r\n catch (NumberFormatException ex)\r\n {\r\n setText(\"\");\r\n }\r\n \r\n }", "protected boolean isNumber(String s)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDouble.parseDouble(s);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\n public int compareTo(Value v) {\n DataType t = v.getType();\n\n if (t == DataType.NOVALUE || type == DataType.NOVALUE) {\n return -69;\n } else if (type == DataType.NaN) {\n if (t == type) {\n return 0;\n } else {\n return 1;\n }\n } else if (t == DataType.NaN && type != DataType.STRING) {\n return -1;\n } else if (type == DataType.FLOAT && t == DataType.INT) {\n return compareFloatAndInt(aFloat, v.getInteger());\n } else if (type == DataType.INT && t == DataType.FLOAT) {\n return compareIntAndFloat(integer, v.getFloat());\n } else if (type == DataType.INT && t == type) {\n return Integer.compare(integer, v.getInteger());\n } else if (type == DataType.FLOAT && t == type) {\n return Float.compare(aFloat, v.getFloat());\n } else {\n return string.compareTo(v.getString());\n }\n }", "@Test\n public void isNumeric() {\n Boolean bool = Utils.isNumeric(\"123\");\n Assert.assertEquals(true, bool);\n }", "@ParameterizedTest\n @CsvSource({\n \"0.9f\", // invalidGrade < 1\n \"10.1f\", // invalidGrade > 10\n })\n void invalidGrades(float invalidGrade) {\n assertThatThrownBy(() -> passingGradeConcepts.calculateGrade(invalidGrade))\n .isInstanceOf(IllegalArgumentException.class);\n }", "private boolean valid_numbers(String nr)\n\t{\n\t\t// loop through the string, char by char\n\t\tfor(int i = 0; i < nr.length();i++)\n\t\t{\n\t\t\t// if the char is not a numeric value or negative\n\t\t\tif(Character.getNumericValue(nr.charAt(i)) < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// if it did not return false in the loop, return true\n\t\treturn true;\n\t}", "private void matchValues(String vConfValue, String resValue, Comparison comparison, String param) {\r\n\r\n if (vConfValue != null && (Double.parseDouble(vConfValue) == Double.parseDouble(resValue)\r\n || (Double.parseDouble(vConfValue) == (Double.parseDouble(resValue) * m_Fact_1024))\r\n || (Double.parseDouble(resValue) * m_Fact_1000 - Double.parseDouble(vConfValue) <10 ) && (Double.parseDouble(resValue) * m_Fact_1000 - Double.parseDouble(vConfValue) >=0 ) )) {\r\n comparison.setMatchSatus(\"MATCH\");\r\n } else {\r\n comparison.setMatchSatus(\"MISMATCH\");\r\n matchResult = false;\r\n }\r\n }", "public boolean test_entry() {\n\t\tboolean t = false;\n\t\tdouble val = Double.parseDouble(numericfield.getText());\n\n\t\tif (val == opt) {\n\t\t\tt = true;\n\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\"Vous avez trouvé le bon parametre pour ce remede\");\n\t\t}\n\t\t// case init > opt ---> on doit diminuer la valeur !!!!\n\t\tif (init > opt) {\n\t\t\tif (init > val && val > opt)\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\"Vous allez dans le bon sens , continuez\");\n\t\t\tif (init > val && opt > val)\n\t\t\t\tJOptionPane\n\t\t\t\t\t\t.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\" Vous avez raté le parametre optimale et vous allez dans le mauvais sens\");\n\t\t\tif (val > init)\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\" Vous allez dans le mauvais sens\");\n\t\t}\n\n\t\t// case init < opt ---> on doit augmenter la valeur !!!!\n\t\tif (init < opt) {\n\t\t\tif (init < val && val < opt)\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\"Vous allez dans le bon sens , continuez\");\n\t\t\tif (init < val && opt < val)\n\t\t\t\tJOptionPane\n\t\t\t\t\t\t.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\" Vous avez raté le parametre optimale et vous allez dans le mauvais sens\");\n\t\t\tif (val < init)\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\" Vous allez dans le mauvais sens\");\n\t\t}\n\t\treturn t;\n\t}", "@Test\n void checkIsFalseForStringWithoutNumbers() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a\"));\n assertFalse(IsNumeric.check(\"ö\"));\n assertFalse(IsNumeric.check(\"\"));\n assertFalse(IsNumeric.check(\"´´´\"));\n assertFalse(IsNumeric.check(\"lgk\"));\n assertFalse(IsNumeric.check(\"lL y\"));\n assertFalse(IsNumeric.check(\" \"));\n assertFalse(IsNumeric.check(\"h* \"));\n assertFalse(IsNumeric.check(\"/+\"));\n assertFalse(IsNumeric.check(\"-\"));\n assertFalse(IsNumeric.check(\"+\"));\n assertFalse(IsNumeric.check(\"d\"));\n assertFalse(IsNumeric.check(\"ariel\"));\n assertFalse(IsNumeric.check(\"#€%/!\"));\n }", "private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "@Test\n void checkIsFalseForStringWithNumbersAndOtherChars() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a3\"));\n assertFalse(IsNumeric.check(\"3l\"));\n assertFalse(IsNumeric.check(\"345L\"));\n assertFalse(IsNumeric.check(\"32b\"));\n assertFalse(IsNumeric.check(\"*3.2 \"));\n assertFalse(IsNumeric.check(\"/0.2\"));\n assertFalse(IsNumeric.check(\"0.28L\"));\n assertFalse(IsNumeric.check(\"0.28.\"));\n assertFalse(IsNumeric.check(\"3.2.4\"));\n assertFalse(IsNumeric.check(\"0x400\"));\n assertFalse(IsNumeric.check(\"0.24Dd\"));\n }", "private boolean isNumber(String s) {\n\t\ttry {\n\t\t\tDouble.parseDouble(s);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private int validateNumber(int data, int defaultValue, int minValue, int maxValue)\n {\n return (data < minValue || data > maxValue) ? defaultValue : data;\n }", "public void handleNumbers() {\n // TODO handle \"one\", \"two\", \"three\", etc.\n }", "private double min(double value1 , double value2){\n double minValue = 0.0;\n if(value1 <= value2){\n minValue = value1;\n }else{\n minValue = value2;\n }\n\n return minValue;\n }", "public static Object lt(Object val1, Object val2) {\n\t\tif (isFloat(val1) && isFloat(val2)) {\n\t\t\treturn ((BigDecimal) val1).compareTo((BigDecimal) val2) < 0;\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).compareTo((BigInteger) val2) < 0;\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in lt\");\n\t}", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "private String auxOperacion(int operando1, int operando2, String valor1, String valor2, int op) {\n if (ManejadorMemoria.isInt(operando1)) {\n if (ManejadorMemoria.isInt(operando2)) {\n switch (op) {\n case Codigos.SUMA:\n return (Integer.parseInt(valor1) + Integer.parseInt(valor2)) + \"\";\n case Codigos.RESTA:\n return (Integer.parseInt(valor1) - Integer.parseInt(valor2)) + \"\";\n case Codigos.MULT:\n return (Integer.parseInt(valor1) * Integer.parseInt(valor2)) + \"\";\n case Codigos.DIV:\n return (Integer.parseInt(valor1) / Integer.parseInt(valor2)) + \"\";\n case Codigos.MAYOR:\n System.out.println(valor1 + \" \" + valor2 + \" \" + (Integer.parseInt(valor1) > Integer.parseInt(valor2)));\n return (Integer.parseInt(valor1) > Integer.parseInt(valor2)) + \"\";\n case Codigos.MENOR:\n return (Integer.parseInt(valor1) < Integer.parseInt(valor2)) + \"\";\n case Codigos.MAYORIG:\n return (Integer.parseInt(valor1) >= Integer.parseInt(valor2)) + \"\";\n case Codigos.MENORIG:\n return (Integer.parseInt(valor1) <= Integer.parseInt(valor2)) + \"\";\n case Codigos.IGUAL:\n return (Integer.parseInt(valor1) == Integer.parseInt(valor2)) + \"\";\n case Codigos.DIFERENTE:\n return (Integer.parseInt(valor1) != Integer.parseInt(valor2)) + \"\";\n }\n } else if (ManejadorMemoria.isFloat(operando2)) {\n switch (op) {\n case Codigos.SUMA:\n return (Integer.parseInt(valor1) + Double.parseDouble(valor2)) + \"\";\n case Codigos.RESTA:\n return (Integer.parseInt(valor1) - Double.parseDouble(valor2)) + \"\";\n case Codigos.MULT:\n return (Integer.parseInt(valor1) * Double.parseDouble(valor2)) + \"\";\n case Codigos.DIV:\n return (Integer.parseInt(valor1) / Double.parseDouble(valor2)) + \"\";\n case Codigos.MAYOR:\n return (Integer.parseInt(valor1) > Double.parseDouble(valor2)) + \"\";\n case Codigos.MENOR:\n return (Integer.parseInt(valor1) < Double.parseDouble(valor2)) + \"\";\n case Codigos.MAYORIG:\n return (Integer.parseInt(valor1) >= Double.parseDouble(valor2)) + \"\";\n case Codigos.MENORIG:\n return (Integer.parseInt(valor1) <= Double.parseDouble(valor2)) + \"\";\n case Codigos.IGUAL:\n return (Integer.parseInt(valor1) == Double.parseDouble(valor2)) + \"\";\n case Codigos.DIFERENTE:\n return (Integer.parseInt(valor1) != Double.parseDouble(valor2)) + \"\";\n }\n }\n } else if (ManejadorMemoria.isFloat(operando1)) {\n if (ManejadorMemoria.isInt(operando2)) {\n switch (op) {\n case Codigos.SUMA:\n return (Double.parseDouble(valor1) + Integer.parseInt(valor2)) + \"\";\n case Codigos.RESTA:\n return (Double.parseDouble(valor1) - Integer.parseInt(valor2)) + \"\";\n case Codigos.MULT:\n return (Double.parseDouble(valor1) * Integer.parseInt(valor2)) + \"\";\n case Codigos.DIV:\n return (Double.parseDouble(valor1) / Integer.parseInt(valor2)) + \"\";\n case Codigos.MAYOR:\n return (Double.parseDouble(valor1) > Integer.parseInt(valor2)) + \"\";\n case Codigos.MENOR:\n return (Double.parseDouble(valor1) < Integer.parseInt(valor2)) + \"\";\n case Codigos.MAYORIG:\n return (Double.parseDouble(valor1) >= Integer.parseInt(valor2)) + \"\";\n case Codigos.MENORIG:\n return (Double.parseDouble(valor1) <= Integer.parseInt(valor2)) + \"\";\n case Codigos.IGUAL:\n return (Double.parseDouble(valor1) == Integer.parseInt(valor2)) + \"\";\n case Codigos.DIFERENTE:\n return (Double.parseDouble(valor1) != Integer.parseInt(valor2)) + \"\";\n }\n } else if (ManejadorMemoria.isFloat(operando2)) {\n switch (op) {\n case Codigos.SUMA:\n return (Double.parseDouble(valor1) + Double.parseDouble(valor2)) + \"\";\n case Codigos.RESTA:\n return (Double.parseDouble(valor1) - Double.parseDouble(valor2)) + \"\";\n case Codigos.MULT:\n return (Double.parseDouble(valor1) * Double.parseDouble(valor2)) + \"\";\n case Codigos.DIV:\n return (Double.parseDouble(valor1) / Double.parseDouble(valor2)) + \"\";\n case Codigos.MAYOR:\n return (Double.parseDouble(valor1) > Double.parseDouble(valor2)) + \"\";\n case Codigos.MENOR:\n return (Double.parseDouble(valor1) < Double.parseDouble(valor2)) + \"\";\n case Codigos.MAYORIG:\n return (Double.parseDouble(valor1) >= Double.parseDouble(valor2)) + \"\";\n case Codigos.MENORIG:\n return (Double.parseDouble(valor1) <= Double.parseDouble(valor2)) + \"\";\n case Codigos.IGUAL:\n return (Double.parseDouble(valor1) == Double.parseDouble(valor2)) + \"\";\n case Codigos.DIFERENTE:\n return (Double.parseDouble(valor1) != Double.parseDouble(valor2)) + \"\";\n }\n }\n } else if (ManejadorMemoria.isString(operando1)) {\n return valor1 + valor2;\n } else if(ManejadorMemoria.isBool(operando1)){\n switch(op){\n case Codigos.AND:\n return (Boolean.parseBoolean(valor1) && Boolean.parseBoolean(valor2)) + \"\";\n case Codigos.OR:\n return (Boolean.parseBoolean(valor1) || Boolean.parseBoolean(valor2)) + \"\";\n case Codigos.NOT:\n return (! Boolean.parseBoolean(valor1))+ \"\";\n }\n }\n\n return \"\";\n }", "public boolean isNumber1(String s) {\n\t\tif (s==null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ts = s.trim(); // Get rid of leading and trailing whitespaces\n if (s.isEmpty()) {\n \treturn false;\n }\n \n boolean isFractional = false; // Indicate appearance of '.'\n boolean isExponential = false; // Indicate appearance of 'e/E'\n boolean valid = false; // Indicate whether preceding digits are valid\n boolean expoBefore = false; // Indicate whether the preceding digit is 'e/E'\n boolean validFrac = true; // Indicate whether the number is a vaild fraction (true by default)\n boolean validExpo = true; // Indicate whether the number is a valid exponential (true by default)\n \n int i = 0;\n if (s.charAt(0) == '+' || s.charAt(0) == '-') // Consider sign\n i = 1;\n \n // Process each digit in sequence\n for (; i < s.length(); i++) {\n char c = s.charAt(i);\n //2e-1, 2e+1\n if (c == '+' || c == '-') { // +/- is valid only after e/E\n if (!expoBefore) {\n \treturn false;\n } \n expoBefore = false;\n valid = false;\n } else if (c == 'e' || c == 'E') { // Only one e/E is valid; preceding digits should be valid\n if (isExponential || !valid) {\n \treturn false;\n } \n isExponential = true;\n valid = false;\n expoBefore = true;\n validExpo = false;\n } else if (c == '.') { // Only one '.' is valid; cannot appear as an exponential\n if (isFractional || isExponential) {\n \treturn false;\n } \n isFractional = true;\n // Must have fractional part\n if (!valid) {\n \tvalidFrac = false;\n } \n } else if (c >= '0' && c <='9') { // Regular digits\n valid = true;\n expoBefore = false;\n validFrac = true;\n validExpo = true;\n } else {\n return false;\n }\n }\n \n // After reaching the end, make sure the number is indeed valid\n if (!valid || !validFrac || !validExpo) {\n \t return false;\n } else {\n \t return true; \n }\n \n }", "@Override\n public InterpreterValue smaller_equals(InterpreterValue v) {\n\n // If the given value is a IntegerValue then check if the value is smaller than\n // or equal to the own value and return a BooleanValue\n if(v instanceof IntegerValue) return BooleanValue.from(getValue() <= ((IntegerValue) v).getValue());\n\n // If the given value is a DoubleValue then check if the value is smaller than\n // or equal to the own value and return a BooleanValue\n if(v instanceof DoubleValue) return BooleanValue.from(getValue() <= ((DoubleValue) v).getValue());\n\n // In other case just throw an error\n throw new Error(\"Operator '<=' is not defined for type integer and \" + v.getName());\n\n }" ]
[ "0.6406389", "0.6257816", "0.6235029", "0.6010553", "0.59858894", "0.59606755", "0.587236", "0.5812742", "0.5796492", "0.5763025", "0.57388186", "0.57323223", "0.5714801", "0.56903946", "0.5653628", "0.56501627", "0.56500155", "0.5606238", "0.55873275", "0.5570015", "0.5536046", "0.5512306", "0.5442524", "0.54210466", "0.5404948", "0.5394359", "0.5392445", "0.5364752", "0.5346972", "0.53455645", "0.5343506", "0.5343399", "0.5340656", "0.5338669", "0.5330994", "0.53300303", "0.5317934", "0.53042066", "0.5302935", "0.5286118", "0.5285748", "0.52828836", "0.52775484", "0.5269421", "0.525745", "0.5253638", "0.5249679", "0.5242016", "0.5237087", "0.52355397", "0.52300775", "0.5217852", "0.5211535", "0.5207052", "0.51997244", "0.5195708", "0.517921", "0.51778215", "0.516479", "0.514829", "0.51464754", "0.51452506", "0.51349103", "0.51345086", "0.5132124", "0.5128503", "0.5124344", "0.5120064", "0.51180446", "0.51164836", "0.5114329", "0.5111557", "0.5102676", "0.510021", "0.5097041", "0.50864834", "0.5082198", "0.50813377", "0.5080685", "0.507283", "0.5072295", "0.5057236", "0.5056835", "0.5056329", "0.5055789", "0.5051622", "0.50457877", "0.5039659", "0.5038984", "0.5034885", "0.50344443", "0.5032657", "0.503265", "0.50276625", "0.5024702", "0.5021541", "0.50207704", "0.49953157", "0.49951273", "0.49933872" ]
0.60942626
3
Creates new form Formas
public Formas() { initComponents(); setIconImage(new ImageIcon(this.getClass().getResource("/Imagen/capsule.png")).getImage()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FORM createFORM();", "public static void create(Formulario form){\n daoFormulario.create(form);\n }", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "public SalidaCajaForm() {\n\t\tinicializarComponentes();\n }", "public FormInserir() {\n initComponents();\n }", "public creacionempresa() {\n initComponents();\n mostrardatos();\n }", "public static AssessmentCreationForm openFillCreationForm(Assessment assm) {\n openCreationSearchForm(Roles.STAFF, WingsTopMenu.WingsStaffMenuItem.P_ASSESSMENTS, Popup.Create);\n\n Logger.getInstance().info(\"Fill out the required fields with valid data\");\n AssessmentCreationForm creationForm = new AssessmentCreationForm();\n creationForm.fillAssessmentInformation(new User(Roles.STAFF), assm);\n\n return new AssessmentCreationForm();\n }", "public frm_tutor_subida_prueba() {\n }", "@Override\n\tpublic void createForm(ERForm form) {\n\t\t\tString sql = \"insert into project1.reimbursementInfo (userName, fullName, thedate, eventstartdate, thelocation, description, thecost, gradingformat, passingpercentage, eventtype, filename,status,reason) values (?,?,?,?,?,?,?,?,?,?,?,?,?);\";\n\t\t\ttry {PreparedStatement stmt = conn.prepareCall(sql);\n\t\t\t//RID should auto increment, so this isnt necessary\n\t\t\t\n\t\t\tstmt.setString(1, form.getUserName());\n\t\t\tstmt.setString(2, form.getFullName());\n\t\t\tstmt.setDate(3, Date.valueOf(form.getTheDate()));\n\t\t\tstmt.setDate(4, Date.valueOf(form.getEventStartDate()));\n\t\t\tstmt.setString(5, form.getTheLocation());\n\t\t\tstmt.setString(6, form.getDescription());\n\t\t\tstmt.setDouble(7, form.getTheCost());\n\t\t\tstmt.setString(8, form.getGradingFormat());\n\t\t\tstmt.setString(9, form.getPassingPercentage());\n\t\t\tstmt.setString(10, form.getEventType());\n\t\t\tstmt.setString(11, form.getFileName());\n\t\t\tstmt.setString(12, \"pending\");\n\t\t\tstmt.setString(13, \"\");\n\t\t\tstmt.executeUpdate();\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 frmAfiliado() {\n initComponents();\n \n }", "public Form getCreationForm() throws ProcessManagerException {\r\n try {\r\n Action creation = processModel.getCreateAction();\r\n return processModel.getPublicationForm(creation.getName(), currentRole,\r\n getLanguage());\r\n } catch (WorkflowException e) {\r\n throw new ProcessManagerException(\"SessionController\",\r\n \"processManager.ERR_NO_CREATION_FORM\", e);\r\n }\r\n }", "public void createAd(/*Should be a form*/){\n Ad ad = new Ad();\n User owner = this.user;\n Vehicle vehicle = this.vehicle;\n String \n// //ADICIONAR\n ad.setOwner();\n ad.setVehicle();\n ad.setDescription();\n ad.setPics();\n ad.setMain_pic();\n }", "@Override\n public boolean createApprisialForm(ApprisialFormBean apprisial) {\n apprisial.setGendate(C_Util_Date.generateDate());\n return in_apprisialformdao.createApprisialForm(apprisial);\n }", "public GestaoFormando() {\n \n initComponents();\n listarEquipamentos();\n listarmapainscritos();\n }", "@Command\n\tpublic void nuevoAnalista(){\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\n\n\t\t//parametros.put(\"recordMode\", \"NEW\");\n\t\tllamarFormulario(\"formularioAnalistas.zul\", null);\n\t}", "@GetMapping(\"/create\")\n public ModelAndView create(@ModelAttribute(\"form\") final CardCreateForm form) {\n return getCreateForm(form);\n }", "public static FormV1 createEntity() {\n FormV1 formV1 = new FormV1()\n .customerId(DEFAULT_CUSTOMER_ID)\n .formType(DEFAULT_FORM_TYPE);\n return formV1;\n }", "public Form(){\n\t\ttypeOfLicenseApp = new TypeOfLicencsApplication();\n\t\toccupationalTrainingList = new ArrayList<OccupationalTraining>();\n\t\taffiadavit = new Affidavit();\n\t\tapplicationForReciprocity = new ApplicationForReciprocity();\n\t\teducationBackground = new EducationBackground();\n\t\toccupationalLicenses = new OccupationalLicenses();\n\t\tofficeUseOnlyInfo = new OfficeUseOnlyInfo();\n\t}", "@GetMapping(value = \"/create\") // https://localhost:8080/etiquetasTipoDisenio/create\n\tpublic String create(Model model) {\n\t\tetiquetasTipoDisenio etiquetasTipoDisenio = new etiquetasTipoDisenio();\n\t\tmodel.addAttribute(\"title\", \"Registro de una nuev entrega\");\n\t\tmodel.addAttribute(\"etiquetasTipoDisenio\", etiquetasTipoDisenio); // similar al ViewBag\n\t\treturn \"etiquetasTipoDisenio/form\"; // la ubicacion de la vista\n\t}", "public Form_soal() {\n initComponents();\n tampil_soal();\n }", "private void azzeraInsertForm() {\n\t\tviewInserimento.getCmbbxTipologia().setSelectedIndex(-1);\n\t\tviewInserimento.getTxtFieldDataI().setText(\"\");\n\t\tviewInserimento.getTxtFieldValore().setText(\"\");\n\t\tviewInserimento.getTxtFieldDataI().setBackground(Color.white);\n\t\tviewInserimento.getTxtFieldValore().setBackground(Color.white);\n\t}", "private void initFormulario() {\n btnCadastro = findViewById(R.id.btnCadastro);\n editNome = findViewById(R.id.editNome);\n editEmail = findViewById(R.id.editEmail);\n editSenhaA = findViewById(R.id.editSenha);\n editSenhaB = findViewById(R.id.editSenhaB);\n chTermo = findViewById(R.id.chTermos);\n isFormOk = false;\n }", "public Form(){ \n\t\tsuper(tag(Form.class)); \n\t}", "@Override\r\n protected void createDbContentCreateEdit() {\n DbContentCreateEdit dbContentCreateEdit = new DbContentCreateEdit();\r\n dbContentCreateEdit.init(null);\r\n form.getModelObject().setDbContentCreateEdit(dbContentCreateEdit);\r\n dbContentCreateEdit.setParent(form.getModelObject());\r\n ruServiceHelper.updateDbEntity(form.getModelObject()); \r\n }", "public Formulario() {\n initComponents();\n }", "public static void insertForm(Form form) {\n\t\t\n\t\ttry {\n\t\t\tConnection connection = getConnection();\n\t\t\ttry {\n\t\t\t\tPreparedStatement statement = connection.prepareStatement(\"INSERT INTO form (form_version, form_name, field_id, field_value) \"\n\t\t\t\t\t\t+ \"VALUES ('\"+form.getTheVersion()+\"','\"+form.getTheName()+\"', '\"+form.getTheFieldId()+\"', '\"+form.getTheFieldValue()+\"')\");\n\t\t\t\t\n\t\t\t\tstatement.executeUpdate();\n\n statement.close();\n connection.close();\n\t\t\t\t\n\t\t\t}catch(SQLException ex) {\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}catch (Exception e) {\n e.printStackTrace();\n }\n\t\t\n\t}", "private void initFormCreateMode() {\n initSpinnerSelectionChamps();\n //TODO\n }", "@Override public SnpAssociationForm createForm(Association association) {\n\n\n SnpAssociationStandardMultiForm form = new SnpAssociationStandardMultiForm();\n\n // Set association ID\n form.setAssociationId(association.getId());\n form.setAssociationExtension(association.getAssociationExtension());\n\n // Set simple string and float association attributes\n form.setRiskFrequency(association.getRiskFrequency());\n form.setPvalueDescription(association.getPvalueDescription());\n form.setSnpType(association.getSnpType());\n form.setMultiSnpHaplotype(association.getMultiSnpHaplotype());\n form.setSnpApproved(association.getSnpApproved());\n form.setPvalueMantissa(association.getPvalueMantissa());\n form.setPvalueExponent(association.getPvalueExponent());\n form.setStandardError(association.getStandardError());\n form.setRange(association.getRange());\n form.setDescription(association.getDescription());\n\n // Set OR/Beta values\n form.setOrPerCopyNum(association.getOrPerCopyNum());\n form.setOrPerCopyRecip(association.getOrPerCopyRecip());\n form.setOrPerCopyRecipRange(association.getOrPerCopyRecipRange());\n form.setBetaNum(association.getBetaNum());\n form.setBetaUnit(association.getBetaUnit());\n form.setBetaDirection(association.getBetaDirection());\n\n // Add collection of Efo traits\n form.setEfoTraits(association.getEfoTraits());\n\n // For each locus get genes and risk alleles\n Collection<Locus> loci = association.getLoci();\n Collection<Gene> locusGenes = new ArrayList<>();\n Collection<RiskAllele> locusRiskAlleles = new ArrayList<RiskAllele>();\n\n // For multi-snp and standard snps we assume their is only one locus\n for (Locus locus : loci) {\n locusGenes.addAll(locus.getAuthorReportedGenes());\n locusRiskAlleles.addAll(locus.getStrongestRiskAlleles()\n .stream()\n .sorted((v1, v2) -> Long.compare(v1.getId(), v2.getId()))\n .collect(Collectors.toList()));\n\n // There should only be one locus thus should be safe to set these here\n form.setMultiSnpHaplotypeNum(locus.getHaplotypeSnpCount());\n form.setMultiSnpHaplotypeDescr(locus.getDescription());\n }\n\n\n // Get name of gene and add to form\n Collection<String> authorReportedGenes = new ArrayList<>();\n for (Gene locusGene : locusGenes) {\n authorReportedGenes.add(locusGene.getGeneName());\n }\n form.setAuthorReportedGenes(authorReportedGenes);\n\n // Handle snp rows\n Collection<GenomicContext> snpGenomicContexts = new ArrayList<GenomicContext>();\n Collection<SingleNucleotidePolymorphism> snps = new ArrayList<>();\n List<SnpFormRow> snpFormRows = new ArrayList<SnpFormRow>();\n List<SnpMappingForm> snpMappingForms = new ArrayList<SnpMappingForm>();\n for (RiskAllele riskAllele : locusRiskAlleles) {\n SnpFormRow snpFormRow = new SnpFormRow();\n snpFormRow.setStrongestRiskAllele(riskAllele.getRiskAlleleName());\n\n SingleNucleotidePolymorphism snp = riskAllele.getSnp();\n snps.add(snp);\n String rsID = snp.getRsId();\n snpFormRow.setSnp(rsID);\n\n Collection<Location> locations = snp.getLocations();\n for (Location location : locations) {\n SnpMappingForm snpMappingForm = new SnpMappingForm(rsID, location);\n snpMappingForms.add(snpMappingForm);\n }\n\n // Set proxy if one is present\n Collection<String> proxySnps = new ArrayList<>();\n if (riskAllele.getProxySnps() != null) {\n for (SingleNucleotidePolymorphism riskAlleleProxySnp : riskAllele.getProxySnps()) {\n proxySnps.add(riskAlleleProxySnp.getRsId());\n }\n }\n snpFormRow.setProxySnps(proxySnps);\n\n snpGenomicContexts.addAll(genomicContextRepository.findBySnpId(snp.getId()));\n snpFormRows.add(snpFormRow);\n }\n\n form.setSnpMappingForms(snpMappingForms);\n form.setGenomicContexts(snpGenomicContexts);\n form.setSnps(snps);\n form.setSnpFormRows(snpFormRows);\n return form;\n }", "public CrearPedidos() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Team create(TeamDTO teamForm);", "public FormFuncionario(FormMenu telaPai) {\n initComponents();\n this.telaPai = telaPai;\n\n txtNome.setText(\"Nome\");\n lblNome.setVisible(false);\n txtSobrenome.setText(\"Sobrenome\");\n lblSobrenome.setVisible(false);\n campoMensagem.setVisible(false);\n lblMensagem.setVisible(false);\n\n }", "@Override\n\tpublic void onFormCreate(AbstractForm arg0, DataMsgBus arg1) {\n\t}", "public ServerskaForma() {\n initComponents();\n \n \n \n }", "protected abstract void addFormComponents(final Form<T> form);", "protected void nuevo(){\n wp = new frmEspacioTrabajo();\n System.runFinalization();\n inicializar();\n }", "public void registrarMateria() {\n materia.setIdDepartamento(departamento);\n ejbFacade.create(materia);\n RequestContext requestContext = RequestContext.getCurrentInstance();\n requestContext.execute(\"PF('MateriaCreateDialog').hide()\");\n items = ejbFacade.findAll();\n departamento = new Departamento();\n materia = new Materia();\n\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se registró con éxito\");\n FacesContext.getCurrentInstance().addMessage(null, msg);\n requestContext.update(\"msg\");//Actualiza la etiqueta growl para que el mensaje pueda ser mostrado\n\n requestContext.update(\"MateriaListForm\");\n requestContext.update(\"MateriaCreateForm\");\n }", "public FrmInsertar() {\n initComponents();\n }", "public FormCadastroAutomovel() {\n initComponents();\n }", "@Override\n\tprotected Fragment createFragment() {\n\t\treturn new FormFragment();\n\t}", "public static Result startNewForm() {\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tDecision firstDecision = CMSGuidedFormFill.startNewForm(formName,\r\n\t\t\t\tCMSSession.getEmployeeName(), CMSSession.getEmployeeId());\r\n\t\treturn ok(backdrop.render(firstDecision));\r\n\t}", "@GetMapping(\"/createRegistro\")\n\tpublic String crearValidacion(Model model) {\n\t\tList<Barrio> localidades = barrioService.obtenerBarrios();\n\t\tmodel.addAttribute(\"localidades\",localidades);\n\t\tmodel.addAttribute(\"persona\",persona);\n\t\tmodel.addAttribute(\"validacion\",validacion);\n\t\tmodel.addAttribute(\"registro\",registro);\n\t\tmodel.addAttribute(\"barrio\",barrio);\n\t\treturn \"RegistroForm\";\n\t}", "@_esCocinero\n public Result crearPaso() {\n Form<Paso> frm = frmFactory.form(Paso.class).bindFromRequest();\n\n // Comprobación de errores\n if (frm.hasErrors()) {\n return status(409, frm.errorsAsJson());\n }\n\n Paso nuevoPaso = frm.get();\n\n // Comprobar autor\n String key = request().getQueryString(\"apikey\");\n if (!SeguridadFunctions.esAutorReceta(nuevoPaso.p_receta.getId(), key))\n return Results.badRequest();\n\n // Checkeamos y guardamos\n if (nuevoPaso.checkAndCreate()) {\n Cachefunctions.vaciarCacheListas(\"pasos\", Paso.numPasos(), cache);\n Cachefunctions.vaciarCacheListas(\"recetas\", Receta.numRecetas(), cache);\n return Results.created();\n } else {\n return Results.badRequest();\n }\n\n }", "public FormUtama() {\n initComponents();\n }", "@RequestMapping(method = RequestMethod.POST, value = {\"\",\"/\"})\r\n\tpublic ResponseEntity<FormularioDTO> add(@RequestBody @Valid Formulario formulario) throws AuthenticationException {\r\n\t\tformulario.setInstituicao(new Instituicao(authService.getDados().getInstituicaoId()));\r\n\t\treturn new ResponseEntity<>(formularioService.create(formulario), HttpStatus.CREATED);\r\n\t}", "public FormularioPregunta() {\n initComponents();\n \n setLocationRelativeTo(this);\n }", "public frmPrincipal() {\n initComponents(); \n inicializar();\n \n }", "@GetMapping(\"/addPharmacist\")\n public String pharmacistForm(Model model) {\n model.addAttribute(\"pharmacist\", new Pharmacist());\n return \"addPharmacist\";\n }", "public frmMantEmpresas() {\n initComponents();\n this.presentarDatos();\n ClaseUtil.activarComponente(jPanelDatos, false);\n ClaseUtil.activarComponente(jPanelTabla, true);\n ClaseUtil.activarComponente(jPanelAcciones, false);\n }", "public void limpiarCamposFormBusqueda() {\n\t}", "public FrmCrearFotoEmpresa() {\n initComponents();\n }", "public void createAgendamento() {\n\n if (tbagendamento.getTmdataagendamento().after(TimeControl.getDateIni())) {\n if (agendamentoLogic.createTbagendamento(tbagendamento)) {\n AbstractFacesContextUtils.redirectPage(PagesUrl.URL_AGENDAMENTO_LIST);\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento cadastrado com sucesso.\");\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falhar ao realizado cadastro do agendamento.\");\n }\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"verifique se a data de agendamento esta correta.\");\n }\n }", "public void onNew() {\t\t\n\t\tdesignWidget.addNewForm();\n\t}", "public FormImportar() {\n initComponents();\n }", "public MostraVenta(String idtrasp, Object[][] clienteM1, Object[][] vendedorM1, String idmarc, String responsable,ListaTraspaso panel)\n{\n this.padre = panel;\n this.clienteM = clienteM1;\n this.vendedorM = vendedorM1;\n this.idtraspaso= idtrasp;\n this.idmarca=idmarc;\n//this.tipoenvioM = new String[]{\"INGRESO\", \"TRASPASO\"};\n String tituloTabla =\"Detalle Venta\";\n // padre=panel;\n String nombreBoton1 = \"Registrar\";\n String nombreBoton2 = \"Cancelar\";\n // String nombreBoton3 = \"Eliminar Empresa\";\n\n setId(\"win-NuevaEmpresaForm1\");\n setTitle(tituloTabla);\n setWidth(400);\n setMinWidth(ANCHO);\n setHeight(250);\n setLayout(new FitLayout());\n setPaddings(WINDOW_PADDING);\n setButtonAlign(Position.CENTER);\n setCloseAction(Window.CLOSE);\n setPlain(true);\n\n but_aceptar = new Button(nombreBoton1);\n but_cancelar = new Button(nombreBoton2);\n // addButton(but_aceptarv);\n addButton(but_aceptar);\n addButton(but_cancelar);\n\n formPanelCliente = new FormPanel();\n formPanelCliente.setBaseCls(\"x-plain\");\n //formPanelCliente.setLabelWidth(130);\n formPanelCliente.setUrl(\"save-form.php\");\n formPanelCliente.setWidth(ANCHO);\n formPanelCliente.setHeight(ALTO);\n formPanelCliente.setLabelAlign(Position.LEFT);\n\n formPanelCliente.setAutoWidth(true);\n\n\ndat_fecha1 = new DateField(\"Fecha\", \"d-m-Y\");\n fechahoy = new Date();\n dat_fecha1.setValue(fechahoy);\n dat_fecha1.setReadOnly(true);\n\ncom_vendedor = new ComboBox(\"Vendedor al que enviamos\", \"idempleado\");\ncom_cliente = new ComboBox(\"Clientes\", \"idcliente\");\n//com_tipo = new ComboBox(\"Tipo Envio\", \"idtipo\");\n initValues1();\n\n\n\n formPanelCliente.add(dat_fecha1);\n// formPanelCliente.add(com_tipo);\n// formPanelCliente.add(tex_nombreC);\n// formPanelCliente.add(tex_codigoBarra);\n // formPanelCliente.add(tex_codigoC);\nformPanelCliente.add(com_vendedor);\n formPanelCliente.add(com_cliente);\n add(formPanelCliente);\nanadirListenersTexfield();\n addListeners();\n\n }", "public formPrincipal() {\n initComponents();\n }", "@RequestMapping(value={\"/projects/add\"}, method= RequestMethod.GET)\r\n\tpublic String createProjectForm(Model model) {\r\n\t\tUser loggedUser= sessionData.getLoggedUser();\r\n\t\tmodel.addAttribute(\"loggedUser\", loggedUser);\r\n\t\tmodel.addAttribute(\"projectForm\", new Project());\r\n\t\treturn \"addProject\";\r\n\t}", "public void crearProgramaFormacion(String nombre, String descripcion, Date fechaI, Date fechaF, Date fechaA, String url) throws ProgramaFormacionExcepcion;", "public frmVenda() {\n initComponents();\n }", "public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}", "@RequestMapping(method = RequestMethod.GET)\n \tpublic String createForm(Model model, ForgotLoginForm form) {\n \t\tmodel.addAttribute(\"form\", form);\n \t\treturn \"forgotlogin/index\";\n \t}", "@RequestMapping(value=\"/formpaciente\")\r\n\tpublic String crearPaciente(Map<String, Object> model) {\t\t\r\n\t\t\r\n\t\tPaciente paciente = new Paciente();\r\n\t\tmodel.put(\"paciente\", paciente);\r\n\t\tmodel.put(\"obrasociales\",obraSocialService.findAll());\r\n\t\t//model.put(\"obrasPlanesForm\", new ObrasPlanesForm());\r\n\t\t//model.put(\"planes\", planService.findAll());\r\n\t\tmodel.put(\"titulo\", \"Formulario de Alta de Paciente\");\r\n\t\t\r\n\t\treturn \"formpaciente\";\r\n\t}", "public FormPpal() {\n initComponents();\n setIconImage(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(\"Imagenes/icon.png\")));\n setLocationRelativeTo(null);\n setTitle(\"Men\\372 principal\");\n setResizable(false);\n formBackUp = null;\n formBuscador = null;\n fb1 = null;\n fb2 = null;\n formListado = null;\n conn = new Conn();\n pacientesCumpleanos = new LinkedList();\n pacientesControl = new LinkedList();\n cargarCumpleanos();\n cargarControlesHoy();\n }", "public FGlavna() {\n initComponents();\n pripremiFormu();\n }", "public abstract void addEditorForm();", "@Override\n\tprotected BaseProcesoForm devuelveFormProceso() throws Exception {\n\t\tProcesoBASLoggerForm objForm = new ProcesoBASLoggerForm();\n\t\treturn objForm;\n\t}", "public frmAddIncidencias() {\n initComponents();\n }", "public void crear(Tarea t) {\n t.saveIt();\n }", "@RequestMapping(\"/save\")\n\tpublic String createProjectForm(Project project, Model model) {\n\t\t\n\tproRep.save(project);\n\tList<Project> getall = (List<Project>) proRep.getAll();\n\tmodel.addAttribute(\"projects\", getall);\n\t\n\treturn \"listproject\";\n\t\t\n\t}", "@GetMapping(\"/add\")\n public String showSocioForm(Model model, Persona persona) {\n List<Cargo> cargos = cargoService.getCargos();\n model.addAttribute(\"cargos\", cargos);\n return \"/backoffice/socioForm\";\n }", "public CrearProductos() {\n initComponents();\n }", "public static void instanciarCreencias() {\n\t\tfor(int i =0; i < GestorPartida.getContJugadores(); i++) {\n\t\t\t\n\t\t\tGestorPartida.jugadores[i].setCreencias(new Creencias(GestorPartida.jugadores, GestorPartida.objetoJugador, GestorPartida.objetoSala, i)); \n\t\t}\n\t}", "public void clickCreate() {\n\t\tbtnCreate.click();\n\t}", "@Override\n\tpublic Oglas createNewOglas(NewOglasForm oglasForm) {\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\n\t\tOglas oglas = new Oglas();\n\t\tSystem.out.println(oglas.getId());\n\t\toglas.setNaziv(oglasForm.getNaziv());\n\t\toglas.setOpis(oglasForm.getOpis());\n\t\ttry {\n\t\t\toglas.setDatum(formatter.parse(oglasForm.getDatum()));\n\t\t\tSystem.out.println(oglas.getDatum());\n System.out.println(formatter.format(oglas.getDatum()));\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn repository.save(oglas);\n\t}", "private void createForm(ArrayList<HashMap<String, String>> data) {\n\t\tLayoutInflater inflater = LayoutInflater.from(IPropertyRegistrationActivity.this);\n\t\tLinearLayout.LayoutParams params = new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT,\n\t\t\t\tandroid.widget.LinearLayout.LayoutParams.WRAP_CONTENT);\n\t\tparams.topMargin = 10;\n\n\t\tfields = data;\n\t\tLinearLayout layout = null;\n\t\tint len = fields.size();\n\t\tfor (int j = 0; j < len; j++) {\n\t\t\tfinal HashMap<String, String> field = fields.get(j);\n\t\t\tView fieldView = inflater.inflate(R.layout.iproperty_registration_dynamic_view_item, null);\n\n\t\t\tif (field.get(TYPE).equals(LABEL)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrLabel));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t} else if (field.get(TYPE).equals(PASSWORD)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEdit));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tif (field.get(NAME).contains(getString(R.string.phone)) || field.get(NAME).contains(getString(R.string.year))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_CLASS_NUMBER);\n\t\t\t\t} else if (field.get(NAME).contains(getString(R.string.website)) || field.get(NAME).contains(getString(R.string.email))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);\n\t\t\t\t}\n\t\t\t} else if (field.get(TYPE).equals(TEXT)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEdit));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tif (field.get(NAME).contains(getString(R.string.phone)) || field.get(NAME).contains(getString(R.string.year))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_CLASS_NUMBER);\n\t\t\t\t} else if (field.get(NAME).contains(getString(R.string.website)) || field.get(NAME).contains(getString(R.string.email))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);\n\t\t\t\t}\n\t\t\t} else if (field.get(TYPE).equals(TEXTAREA)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditArea));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\n\t\t\t\tif (field.get(VALUE).toString().trim().length() > 0) {\n\t\t\t\t\tedit.setText(field.get(VALUE));\n\t\t\t\t} else {\n\t\t\t\t}\n\n\t\t\t} else if (field.get(TYPE).equals(MAP)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tfinal ImageView imgMap;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditMap));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\timgMap = ((ImageView) layout.findViewById(R.id.imgMap));\n\t\t\t\tif (field.get(NAME).equalsIgnoreCase(getString(R.string.state))) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tAddress address = IjoomerUtilities.getAddressFromLatLong(0, 0);\n\t\t\t\t\t\tedit.setText(address.getAdminArea().replace(address.getCountryName() == null ? \"\" : address.getCountryName(), \"\")\n\t\t\t\t\t\t\t\t.replace(address.getPostalCode() == null ? \"\" : address.getPostalCode(), \"\"));\n\t\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\t\tedit.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} else if (field.get(NAME).equalsIgnoreCase(getString(R.string.city_town))) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tAddress address = IjoomerUtilities.getAddressFromLatLong(0, 0);\n\t\t\t\t\t\tedit.setText(address.getSubAdminArea());\n\t\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\t\tedit.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\timgMap.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\teditMap = edit;\n\t\t\t\t\t\tIntent intent = new Intent(IPropertyRegistrationActivity.this, IjoomerMapAddress.class);\n\t\t\t\t\t\tstartActivityForResult(intent, GET_ADDRESS_FROM_MAP);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (field.get(TYPE).equals(SELECT)) {\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrSpin));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tfinal Spinner spn;\n\t\t\t\tspn = ((Spinner) layout.findViewById(R.id.txtValue));\n\t\t\t\tspn.setAdapter(IjoomerUtilities.getSpinnerAdapter(field));\n\t\t\t\tif (field.get(NAME).equalsIgnoreCase(getString(R.string.country))) {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tAddress address = IjoomerUtilities.getAddressFromLatLong(0, 0);\n\t\t\t\t\t\tString country = address.getCountryName();\n\t\t\t\t\t\tint selectedIndex = 0;\n\t\t\t\t\t\tJSONArray jsonArray = null;\n\n\t\t\t\t\t\tjsonArray = new JSONArray(field.get(OPTIONS));\n\t\t\t\t\t\tint optionSize = jsonArray.length();\n\t\t\t\t\t\tfor (int k = 0; k < optionSize; k++) {\n\t\t\t\t\t\t\tJSONObject options = (JSONObject) jsonArray.get(k);\n\n\t\t\t\t\t\t\tif (options.getString(VALUE).equalsIgnoreCase(country)) {\n\t\t\t\t\t\t\t\tselectedIndex = k;\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\tspn.setSelection(selectedIndex);\n\t\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tspn.setSelection(0);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if (field.get(TYPE).equals(DATE)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tedit.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(final View v) {\n\t\t\t\t\t\tIjoomerUtilities.getDateDialog(((IjoomerEditText) v).getText().toString(), true, new CustomClickListner() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(String value) {\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setText(value);\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setError(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (field.get(TYPE).equals(TIME)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tedit.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(final View v) {\n\t\t\t\t\t\tIjoomerUtilities.getTimeDialog(((IjoomerEditText) v).getText().toString(), new CustomClickListner() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(String value) {\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setText(value);\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setError(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (field.get(TYPE).equals(MULTIPLESELECT)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tedit.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(final View v) {\n\t\t\t\t\t\tIjoomerUtilities.getMultiSelectionDialog(field.get(NAME), field.get(OPTIONS), ((IjoomerEditText) v).getText().toString(), new CustomClickListner() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(String value) {\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setText(value);\n\t\t\t\t\t\t\t}\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\tif (field.get(REQUIRED).equalsIgnoreCase(\"1\")) {\n\t\t\t\t((IjoomerTextView) layout.findViewById(R.id.txtLable)).setText(field.get(NAME) + \" *\");\n\t\t\t} else {\n\t\t\t\t((IjoomerTextView) layout.findViewById(R.id.txtLable)).setText(field.get(NAME));\n\t\t\t}\n\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrEdit)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrEditArea)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrSpin)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrLabel)).setVisibility(View.GONE);\n\n\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrReadOnly));\n\t\t\tlayout.setVisibility(View.VISIBLE);\n\n\t\t\t((IjoomerTextView) layout.findViewById(R.id.txtLable)).setText(field.get(NAME));\n\t\t\t((IjoomerEditText) layout.findViewById(R.id.txtValue)).setText(field.get(VALUE));\n\t\t\tfieldView.setTag(field);\n\t\t\tlnr_form.addView(fieldView, params);\n\t\t}\n\t}", "public FormularioCliente() {\n initComponents();\n }", "public frmTelaVendas() {\n initComponents();\n this.carrinho = new CarrinhoDeCompras();\n listaItens.setModel(this.lista);\n }", "public FrmAbmAfiliado() {\n initComponents();\n }", "@GetMapping(\"/students/new\")\r\n\tpublic String createStudentForm(Model model) {\n\t\tStudent student =new Student();\r\n\t\tmodel.addAttribute(\"student\",student);\r\n\t\treturn \"create_student\";\r\n\t}", "public TorneoForm() {\n initComponents();\n }", "private void newProject()\n\t{\n\t\tnew FenetreCreationProjet();\n\t}", "static public ApplicationFormItem createNew(int id, String shortname, boolean required, ApplicationFormItemType type,\n\t\t\t\t\t\t\t\t\t\t\t\tString federationAttribute, String perunSourceAttribute, String perunDestinationAttribute, String regex,\n\t\t\t\t\t\t\t\t\t\t\t\tList<Application.ApplicationType> applicationTypes, Integer ordnum, boolean forDelete)\t{\n\t\tApplicationFormItem afi = new JSONObject().getJavaScriptObject().cast();\n\t\tafi.setId(id);\n\t\tafi.setShortname(shortname);\n\t\tafi.setRequired(required);\n\t\tafi.setType(type);\n\t\tafi.setFederationAttribute(federationAttribute);\n\t\tafi.setPerunSourceAttribute(perunSourceAttribute);\n\t\tafi.setPerunDestinationAttribute(perunDestinationAttribute);\n\t\tafi.setRegex(regex);\n\t\tafi.setApplicationTypes(applicationTypes);\n\t\tafi.setOrdnum(ordnum);\n\t\tafi.setForDelete(forDelete);\n\t\treturn afi;}", "public ProfilsFIForm() {\r\n\t\tsuper();\r\n\t}", "public ContactoFormBean() {\r\n setContexto();\r\n }", "@PostMapping( value = \"/new\", params = \"auto\" )\n public String createEventFormAutoPopulate( @ModelAttribute CreateEventForm createEventForm )\n {\n // provide default values to make user submission easier\n createEventForm.setSummary( \"A new event....\" );\n createEventForm.setDescription( \"This was autopopulated to save time creating a valid event.\" );\n createEventForm.setWhen( new Date() );\n\n // make the attendee not the current user\n CalendarUser currentUser = userContext.getCurrentUser();\n int attendeeId = currentUser.getId() == 0 ? 1 : 0;\n CalendarUser attendee = calendarService.getUser( attendeeId );\n createEventForm.setAttendeeEmail( attendee.getEmail() );\n\n return \"events/create\";\n }", "@PostMapping(\"/addFormation/{eid}\")\n\t\tpublic Formation createFormation(@PathVariable(value = \"eid\") Long Id, @Valid @RequestBody Formation formationDetails) {\n\n\t\t \n\t\t Formation me=new Formation();\n\t\t\t Domaine domaine = Domainev.findById(Id).orElseThrow(null);\n\t\t\t \n\t\t\t \n\t\t\t\t me.setDom(domaine);\n\t\t\t me.setTitre(formationDetails.getTitre());\n\t\t\t me.setAnnee(formationDetails.getAnnee());\n\t\t\t me.setNb_session(formationDetails.getNb_session());\n\t\t\t me.setDuree(formationDetails.getDuree());\n\t\t\t me.setBudget(formationDetails.getBudget());\n\t\t\t me.setTypeF(formationDetails.getTypeF());\n\t\t\t \n\t\t\t \n\n\t\t\t //User affecterUser= \n\t\t\t return Formationv.save(me);\n\t\t\t//return affecterUser;\n\t\t\n\n\t\t}", "public Result inicioGenerarLibro(){\n ContabilidadDTO dto = new ContabilidadDTO();\n dto.tipoLibro = new Parametro(\"\",\"LVEN\",\"\");\n //dto.tipoLibro.id.codigo =\"LVEN\";\n dto.anio = new Parametro(\"\",\"2018\",\"\");\n //dto.anio.id.codigo =\"2018\";\n dto.mes = new Parametro(\"\",\"3\",\"\");\n //dto.mes.id.codigo =\"3\"; //Simpre debe ser el mes anterior al actual\n\n Form<ContabilidadDTO> contabilidadDTOForm = formFactory.form(ContabilidadDTO.class).fill(dto);\n\n/*\n EbeanServer db = DBConnectionUtil.getDBServerFacturador();\n List<BandejaFactura> lista = db.find(BandejaFactura.class).findList();; //BandejaFactura.find.all();//obtenerTodos();\n for (BandejaFactura x:lista) {\n System.out.println(x);\n }\n*/\n/*\n EbeanServer db = DBConnectionUtil.getDBServerSGV();\n List<ControlVenta> lista = db.find(ControlVenta.class)\n .where().ilike(\"CVNT_NUM_DOCUMENTO\", \"F002-00000213\")\n .findList();\n for (ControlVenta x:lista) {\n System.out.println(\"*********** \"+x);\n }\n*/\n/*\n EbeanServer db = DBConnectionUtil.getDBServerSGV();\n List<ControlVenta> lista = db.find(ControlVenta.class).findList();; //BandejaFactura.find.all();//obtenerTodos();\n for (ControlVenta x:lista) {\n System.out.println(x);\n }\n*/\n\n return ok(generadorLibrosContables.render(contabilidadDTOForm));\n }", "public StorageForm() {\n}", "public void crearAbonar(){\n \t\n getContentPane().setLayout(new BorderLayout());\n \n p1 = new JPanel();\n\t\tp2 = new JPanel();\n \n\t\t// Not used anymore\n\t\t//String[] a={\"Regresar\",\"Continuar\"},c={\"Cuenta\",\"Monto\"};\n \n\t\t// Layout : # row, # columns\n\t\tp1.setLayout(new GridLayout(1,2));\n \n\t\t// Create the JTextField : Cuenta\n\t\t// And add it to the panel\n tf = new JTextField(\"Cuenta\");\n textos.add(tf);\n tf.setPreferredSize(new Dimension(10,100));\n p1.add(tf);\n\n\t\t// Create the JTextField : Monto\n\t\t// And add it to the panel\n tf = new JTextField(\"Monto\");\n textos.add(tf);\n tf.setPreferredSize(new Dimension(10,100));\n p1.add(tf);\n \n // Add the panel to the Frame layout\n add(p1, BorderLayout.NORTH);\n \n // Create the button Regresar\n buttonRegresar = new JButton(\"Regresar\");\n botones.add(buttonRegresar);\n\n // Create the button Continuar\n buttonContinuar = new JButton(\"Continuar\");\n botones.add(buttonContinuar);\n \n // Layout : 1 row, 2 columns\n p2.setLayout(new GridLayout(1,2));\n \n // Add the buttons to the layout\n for(JButton x:botones){\n x.setPreferredSize(new Dimension(110,110));\n p2.add(x);\n }\n \n // Add the panel to the Frame layout\n add(p2, BorderLayout.SOUTH);\n }", "public FormCompra() {\n initComponents();\n }", "@GetMapping(\"/producto/nuevo\")\n\tpublic String nuevoProductoForm(Model model) {\n\t\tmodel.addAttribute(\"producto\", new Producto());\n\t\treturn \"app/producto/form\";\n\t}", "public PDMRelationshipForm() {\r\n initComponents();\r\n }", "private void validarForm(AtualizarTramiteEspecificacaoActionForm form){\n\n\t\tString idLocalidade = form.getIdLocalidade();\n\t\tString codigoSetorComercial = form.getCodigoSetorComercial();\n\t\tString idMunicipio = form.getIdMunicipio();\n\t\tString codigoBairro = form.getCodigoBairro();\n\t\tString idSistemaAbastecimento = form.getIdSistemaAbastecimento();\n\t\tString idDistritoOperacional = form.getIdDistritoOperacional();\n\t\tString idZonaAbastecimento = form.getIdZonaAbastecimento();\n\t\tString idSetorAbastecimento = form.getIdSetorAbastecimento();\n\t\tString idSistemaEsgoto = form.getIdSistemaEsgoto();\n\t\tString idSubsistemaEsgoto = form.getIdSubsistemaEsgoto();\n\t\tString idBacia = form.getIdBacia();\n\t\tString idSubBacia = form.getIdSubBacia();\n\t\tString idUnidadeOrganizacionalOrigem = form.getIdUnidadeOrganizacionalOrigem();\n\t\tString idUnidadeOrganizacionalDestino = form.getIdUnidadeOrganizacionalDestino();\n\t\tString indicadorUso = form.getIndicadorUso();\n\n\t\tString numeroNaoInformadoStr = Integer.toString(ConstantesSistema.NUMERO_NAO_INFORMADO);\n\n\t\tFachada fachada = Fachada.getInstancia();\n\n\t\t// Localidade\n\t\tif(!Util.isVazioOuBranco(idLocalidade)){\n\t\t\tFiltroLocalidade filtro = new FiltroLocalidade();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroLocalidade.INDICADORUSO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroLocalidade.ID, idLocalidade));\n\n\t\t\tCollection<Localidade> colecao = fachada.pesquisar(filtro, Localidade.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Localidade\");\n\t\t\t}\n\t\t}\n\n\t\t// Setor Comercial\n\t\tif(Util.isVazioOuBranco(idLocalidade) && !Util.isVazioOuBranco(codigoSetorComercial)){\n\t\t\tthrow new ActionServletException(\"atencao.required\", null, \"Localidade\");\n\t\t}else if(!Util.isVazioOuBranco(idLocalidade) && !Util.isVazioOuBranco(codigoSetorComercial)){\n\t\t\tFiltroSetorComercial filtro = new FiltroSetorComercial();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSetorComercial.INDICADORUSO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSetorComercial.ID_LOCALIDADE, idLocalidade));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSetorComercial.CODIGO_SETOR_COMERCIAL, codigoSetorComercial));\n\n\t\t\tCollection<SetorComercial> colecao = fachada.pesquisar(filtro, SetorComercial.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Setor Comercial\");\n\t\t\t}\n\t\t}\n\n\t\t// Bairro\n\t\tif(Util.isVazioOuBranco(idMunicipio) && !Util.isVazioOuBranco(codigoBairro)){\n\t\t\tthrow new ActionServletException(\"atencao.required\", null, \"Município\");\n\t\t}else if(!Util.isVazioOuBranco(idMunicipio) && !Util.isVazioOuBranco(codigoBairro)){\n\t\t\tFiltroBairro filtro = new FiltroBairro();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroBairro.INDICADOR_USO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroBairro.MUNICIPIO_ID, idMunicipio));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroBairro.CODIGO, codigoBairro));\n\n\t\t\tCollection<Bairro> colecao = fachada.pesquisar(filtro, Bairro.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Bairro\");\n\t\t\t}\n\t\t}\n\n\t\t// Sistema de Abastecimento\n\t\tif(!Util.isVazioOuBranco(idSistemaAbastecimento) && !idSistemaAbastecimento.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroSistemaAbastecimento filtro = new FiltroSistemaAbastecimento();\n\t\t\tfiltro\n\t\t\t\t\t\t\t.adicionarParametro(new ParametroSimples(FiltroSistemaAbastecimento.INDICADOR_USO,\n\t\t\t\t\t\t\t\t\t\t\tConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSistemaAbastecimento.ID, idSistemaAbastecimento));\n\n\t\t\tCollection<SistemaAbastecimento> colecao = fachada.pesquisar(filtro, SistemaAbastecimento.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Sistema de Abastecimento\");\n\t\t\t}\n\t\t}\n\n\t\t// Unidade Operacional\n\t\tif(!Util.isVazioOuBranco(idDistritoOperacional) && !idDistritoOperacional.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroDistritoOperacional filtro = new FiltroDistritoOperacional();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroDistritoOperacional.INDICADORUSO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroDistritoOperacional.ID, idDistritoOperacional));\n\n\t\t\tCollection<DistritoOperacional> colecao = fachada.pesquisar(filtro, DistritoOperacional.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Unidade Operacional\");\n\t\t\t}\n\t\t}\n\n\t\t// Zona de Abastecimento\n\t\tif(!Util.isVazioOuBranco(idZonaAbastecimento) && !idZonaAbastecimento.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroZonaAbastecimento filtro = new FiltroZonaAbastecimento();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroZonaAbastecimento.INDICADOR_USO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroZonaAbastecimento.ID, idZonaAbastecimento));\n\n\t\t\tCollection<ZonaAbastecimento> colecao = fachada.pesquisar(filtro, ZonaAbastecimento.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Zona de Abastecimento\");\n\t\t\t}\n\t\t}\n\n\t\t// Setor de Abastecimento\n\t\tif(!Util.isVazioOuBranco(idSetorAbastecimento) && !idSetorAbastecimento.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroSetorAbastecimento filtro = new FiltroSetorAbastecimento();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSetorAbastecimento.INDICADOR_USO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSetorAbastecimento.ID, idSetorAbastecimento));\n\n\t\t\tCollection<SetorAbastecimento> colecao = fachada.pesquisar(filtro, SetorAbastecimento.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Setor de Abastecimento\");\n\t\t\t}\n\t\t}\n\n\t\t// Sistema de Esgoto\n\t\tif(!Util.isVazioOuBranco(idSistemaEsgoto) && !idSistemaEsgoto.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroSistemaEsgoto filtro = new FiltroSistemaEsgoto();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSistemaEsgoto.INDICADOR_USO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSistemaEsgoto.ID, idSistemaEsgoto));\n\n\t\t\tCollection<SistemaEsgoto> colecao = fachada.pesquisar(filtro, SistemaEsgoto.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Sistema de Esgoto\");\n\t\t\t}\n\t\t}\n\n\t\t// Subsistema de Esgoto\n\t\tif(!Util.isVazioOuBranco(idSubsistemaEsgoto) && !idSubsistemaEsgoto.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroSubsistemaEsgoto filtro = new FiltroSubsistemaEsgoto();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSubsistemaEsgoto.INDICADOR_USO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSubsistemaEsgoto.ID, idSubsistemaEsgoto));\n\n\t\t\tCollection<SubsistemaEsgoto> colecao = fachada.pesquisar(filtro, SubsistemaEsgoto.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Subsistema de Esgoto\");\n\t\t\t}\n\t\t}\n\n\t\t// Bacia\n\t\tif(!Util.isVazioOuBranco(idBacia) && !idBacia.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroBacia filtro = new FiltroBacia();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroBacia.INDICADORUSO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroBacia.ID, idBacia));\n\n\t\t\tCollection<Bacia> colecao = fachada.pesquisar(filtro, Bacia.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Bacia\");\n\t\t\t}\n\t\t}\n\n\t\t// Subbacia\n\t\tif(!Util.isVazioOuBranco(idSubBacia) && !idSubBacia.equals(numeroNaoInformadoStr)){\n\t\t\tFiltroSubBacia filtro = new FiltroSubBacia();\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSubBacia.INDICADOR_USO, ConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroSubBacia.ID, idSubBacia));\n\n\t\t\tCollection<SubBacia> colecao = fachada.pesquisar(filtro, SubBacia.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Subbacia\");\n\t\t\t}\n\t\t}\n\n\t\t// Unidade Origem\n\t\tif(!Util.isVazioOuBranco(idUnidadeOrganizacionalOrigem)){\n\t\t\tFiltroUnidadeOrganizacional filtro = new FiltroUnidadeOrganizacional();\n\t\t\tfiltro\n\t\t\t\t\t\t\t.adicionarParametro(new ParametroSimples(FiltroUnidadeOrganizacional.INDICADOR_USO,\n\t\t\t\t\t\t\t\t\t\t\tConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroUnidadeOrganizacional.ID, idUnidadeOrganizacionalOrigem));\n\n\t\t\tCollection<UnidadeOrganizacional> colecao = fachada.pesquisar(filtro, UnidadeOrganizacional.class.getName());\n\t\t\tif(colecao == null || colecao.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Unidade Origem\");\n\t\t\t}\n\t\t}\n\n\t\t// Unidade Destino\n\t\tif(Util.isVazioOuBranco(idUnidadeOrganizacionalDestino)){\n\t\t\tthrow new ActionServletException(\"atencao.required\", null, \"Unidade Destino\");\n\t\t}else{\n\t\t\tFiltroUnidadeOrganizacional filtro = new FiltroUnidadeOrganizacional();\n\t\t\tfiltro\n\t\t\t\t\t\t\t.adicionarParametro(new ParametroSimples(FiltroUnidadeOrganizacional.INDICADOR_USO,\n\t\t\t\t\t\t\t\t\t\t\tConstantesSistema.INDICADOR_USO_ATIVO));\n\t\t\tfiltro.adicionarParametro(new ParametroSimples(FiltroUnidadeOrganizacional.ID, idUnidadeOrganizacionalDestino));\n\n\t\t\tCollection<UnidadeOrganizacional> colecaoUnidadeOrganizacional = fachada.pesquisar(filtro, UnidadeOrganizacional.class\n\t\t\t\t\t\t\t.getName());\n\t\t\tif(colecaoUnidadeOrganizacional == null || colecaoUnidadeOrganizacional.isEmpty()){\n\t\t\t\tthrow new ActionServletException(\"atencao.pesquisa_inexistente\", null, \"Unidade Destino\");\n\t\t\t}\n\t\t}\n\n\t\t// Indicador de Uso\n\t\tif(Util.isVazioOuBranco(indicadorUso)){\n\t\t\tthrow new ActionServletException(\"atencao.required\", null, \"Indicador de Uso\");\n\t\t}\n\t}", "public UserForm(){ }", "Compuesta createCompuesta();", "public FormularioP() {\n initComponents();\n }", "private void creatingElements() {\n\t\ttf1 = new JTextField(20);\n\t\ttf2 = new JTextField(20);\n\t\ttf3 = new JTextField(20);\n\t\tJButton btn = new JButton(\"Add\");\n\t\tbtn.addActionListener(control);\n\t\tbtn.setActionCommand(\"add\");\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.add(tf1);\n\t\tpanel.add(tf2);\n\t\tpanel.add(btn);\n\t\tpanel.add(tf3);\n\t\t\n\t\tthis.add(panel);\n\t\t\n\t\tthis.validate();\n\t\tthis.repaint();\t\t\n\t\t\n\t}", "public MechanicForm() {\n initComponents();\n }", "@RequestMapping(params = \"new\", method = RequestMethod.GET)\n\t@PreAuthorize(\"hasRole('ADMIN')\")\n\tpublic String createProductForm(Model model) { \t\n \t\n\t\t//Security information\n\t\tmodel.addAttribute(\"admin\",security.isAdmin()); \n\t\tmodel.addAttribute(\"loggedUser\", security.getLoggedInUser());\n\t\t\n\t model.addAttribute(\"product\", new Product());\n\t return \"products/newProduct\";\n\t}", "public frmNewArtist() {\n initComponents();\n lblID.setText(Controller.Agent.ManageController.getNewArtistID());\n lblGreeting.setText(\"Dear \"+iMuzaMusic.getLoggedUser().getFirstName()+\", please use the form below to add an artist to your ranks.\");\n \n }", "@ApiMethod(name = \"createContact\", path = \"contact\", httpMethod = HttpMethod.POST)\n\tpublic Contact createContact(final ContactForm form) {\n\t\tfinal Key<Contact> key = Contact.allocateKey();\n\t\tContact contact = new Contact(key.getId(), form);\n\n\t\tofy().save().entity(contact).now();\n\n\t\treturn contact;\n\t}" ]
[ "0.748264", "0.7274339", "0.65657145", "0.65645075", "0.6318116", "0.62970716", "0.60711354", "0.60194737", "0.60178494", "0.60037094", "0.5986952", "0.59763", "0.5963809", "0.5938802", "0.5932473", "0.59083813", "0.5908022", "0.5899548", "0.58720845", "0.5865205", "0.58472556", "0.58425033", "0.58364964", "0.5836196", "0.5801452", "0.5776597", "0.5760578", "0.5758816", "0.5741167", "0.5739546", "0.5725394", "0.57045764", "0.5701677", "0.57011116", "0.56968117", "0.56944984", "0.5675885", "0.5669252", "0.5668997", "0.56655926", "0.5628955", "0.56270164", "0.5626534", "0.56126267", "0.56078464", "0.5600354", "0.5589303", "0.5587839", "0.5579856", "0.55780214", "0.55763644", "0.5559871", "0.5557835", "0.5554903", "0.55547136", "0.55541325", "0.555203", "0.5551749", "0.55358285", "0.5532155", "0.55242616", "0.55221266", "0.5520883", "0.551808", "0.55047154", "0.550327", "0.5493485", "0.5491806", "0.54869086", "0.5485011", "0.5475738", "0.5475426", "0.54708713", "0.54647434", "0.5463988", "0.54601085", "0.5454705", "0.5451344", "0.54440236", "0.5441798", "0.54386026", "0.54367137", "0.5431773", "0.54306775", "0.54266995", "0.5422293", "0.5421168", "0.540876", "0.54061234", "0.5404761", "0.54028827", "0.54025644", "0.5401708", "0.54007787", "0.5394951", "0.5392038", "0.53862983", "0.53764224", "0.53677183", "0.53639966", "0.53590643" ]
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setResizable(false); jLabel1.setText("Graficas"); jPanel1.add(jLabel1); getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 477, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 346, Short.MAX_VALUE) ); getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER); setSize(new java.awt.Dimension(493, 409)); setLocationRelativeTo(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public intrebarea() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public vpemesanan1() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public CovidGUI(){\n initComponents();\n }" ]
[ "0.73197734", "0.72908777", "0.72908777", "0.72908777", "0.72870827", "0.7248368", "0.7213462", "0.7208004", "0.7195763", "0.7189973", "0.7184436", "0.7159332", "0.71478266", "0.709268", "0.7080727", "0.7057287", "0.6986775", "0.6977119", "0.69554067", "0.69548035", "0.6945748", "0.69436246", "0.6936225", "0.69309264", "0.6927764", "0.6925464", "0.69240505", "0.6911828", "0.69114214", "0.6893614", "0.68917346", "0.6891525", "0.6891501", "0.6889125", "0.68829834", "0.6882533", "0.68808794", "0.687905", "0.687687", "0.68740726", "0.68708014", "0.68595254", "0.68561274", "0.68560076", "0.6854643", "0.6854604", "0.6853724", "0.685311", "0.685311", "0.6844816", "0.6836794", "0.6835743", "0.68294543", "0.6828841", "0.682637", "0.68245006", "0.6823792", "0.68175477", "0.6817179", "0.6811031", "0.68096155", "0.6809008", "0.68087083", "0.68081945", "0.6801884", "0.6795609", "0.6793828", "0.67930275", "0.67915165", "0.6789997", "0.6788734", "0.6788487", "0.67816335", "0.67663425", "0.6765744", "0.67648494", "0.6757314", "0.6755897", "0.67526966", "0.6750367", "0.67429197", "0.67399955", "0.6736908", "0.6736084", "0.6734342", "0.6726562", "0.67264515", "0.67205596", "0.6716381", "0.67154187", "0.67150515", "0.6709329", "0.6708348", "0.67050624", "0.67021835", "0.6700595", "0.6699073", "0.6698866", "0.66942847", "0.6690904", "0.66897583" ]
0.0
-1
End of variables declaration//GENEND:variables
public void SetValues(Map<String, Integer> Usuario,int cont){ //Crear un dataset DefaultPieDataset data = new DefaultPieDataset(); Iterator it = Usuario.keySet().iterator(); int c = 0; while(it.hasNext()){ if(c<5){ String key = (String)it.next(); data.setValue(key,Usuario.get(key)); } } //Creamos un Chart JFreeChart chart = ChartFactory.createPieChart3D( "Mejor Empleado ", //Títrulo del gráfico data, true,//Leyenda true,//ToolTips true); //Creamos una especie de frame y mostramos el JFreeChart en él //Este constructor nos pide el título del Chart y el chart creado ChartPanel jp = new ChartPanel(chart); this.getContentPane().add(jp); this.setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "private void assignment() {\n\n\t\t\t}", "private void kk12() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void mo21779D() {\n }", "public final void mo51373a() {\n }", "protected boolean func_70041_e_() { return false; }", "public void mo4359a() {\n }", "public void mo21782G() {\n }", "private void m50366E() {\n }", "public void mo12930a() {\n }", "public void mo115190b() {\n }", "public void method_4270() {}", "public void mo1403c() {\n }", "public void mo3376r() {\n }", "public void mo3749d() {\n }", "public void mo21793R() {\n }", "protected boolean func_70814_o() { return true; }", "public void mo21787L() {\n }", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo21780E() {\n }", "public void mo21792Q() {\n }", "public void mo21791P() {\n }", "public void mo12628c() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo97908d() {\n }", "public void mo21878t() {\n }", "public void mo9848a() {\n }", "public void mo21825b() {\n }", "public void mo23813b() {\n }", "public void mo3370l() {\n }", "public void mo21879u() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo21785J() {\n }", "public void mo21795T() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void m23075a() {\n }", "public void mo21789N() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21794S() {\n }", "public final void mo12688e_() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "public void mo6944a() {\n }", "public static void listing5_14() {\n }", "public void mo1405e() {\n }", "public final void mo91715d() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo9137b() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void func_70295_k_() {}", "void mo57277b();", "public void mo21877s() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "void berechneFlaeche() {\n\t}", "public void mo115188a() {\n }", "public void mo21880v() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo21784I() {\n }", "private stendhal() {\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void mo56167c() {\n }", "public void mo44053a() {\n }", "public void mo21781F() {\n }", "public void mo2740a() {\n }", "public void mo21783H() {\n }", "public void mo1531a() {\n }", "double defendre();", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public void stg() {\n\n\t}", "void m1864a() {\r\n }", "private void poetries() {\n\n\t}", "public void skystonePos4() {\n }", "public void mo2471e() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "private void yy() {\n\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@AnyLogicInternalCodegenAPI\n private void setupPlainVariables_Main_xjal() {\n }", "static void feladat4() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }", "public void furyo ()\t{\n }", "public void verliesLeven() {\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "protected void mo6255a() {\n }" ]
[ "0.6359434", "0.6280371", "0.61868024", "0.6094568", "0.60925734", "0.6071678", "0.6052686", "0.60522056", "0.6003249", "0.59887564", "0.59705925", "0.59680873", "0.5967989", "0.5965816", "0.5962006", "0.5942372", "0.5909877", "0.5896588", "0.5891321", "0.5882983", "0.58814824", "0.5854075", "0.5851759", "0.58514243", "0.58418584", "0.58395296", "0.5835063", "0.582234", "0.58090156", "0.5802706", "0.5793836", "0.57862717", "0.5784062", "0.5783567", "0.5782131", "0.57758564", "0.5762871", "0.5759349", "0.5745087", "0.57427835", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.57326084", "0.57301426", "0.57266665", "0.57229686", "0.57175463", "0.5705802", "0.5698347", "0.5697827", "0.569054", "0.5689405", "0.5686434", "0.56738997", "0.5662217", "0.56531453", "0.5645255", "0.5644223", "0.5642628", "0.5642476", "0.5640595", "0.56317437", "0.56294966", "0.56289655", "0.56220204", "0.56180173", "0.56134313", "0.5611337", "0.56112075", "0.56058615", "0.5604383", "0.5602629", "0.56002104", "0.5591573", "0.55856615", "0.5576992", "0.55707216", "0.5569681", "0.55570376", "0.55531484", "0.5551123", "0.5550893", "0.55482954", "0.5547471", "0.55469507", "0.5545719", "0.5543553", "0.55424106", "0.5542057", "0.55410767", "0.5537739", "0.55269134", "0.55236584", "0.55170715", "0.55035424", "0.55020875" ]
0.0
-1
Create remote console writer instance.
public RemoteConsoleWriter(int port) { debug("Create remote console server instance."); ServerSocket server = null; Thread thread = null; try { server = new ServerSocket(); thread = new Thread(this); thread.setDaemon(true); thread.start(); } catch(IOException e) { error("Error creating the server. Remote console writer is unable to process appender messages."); } this.port = port; this.server = server; this.thread = thread; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ConsoleHandler createConsoleHandler () {\r\n\t\t\t\r\n\t\tConsoleHandler consoleHandler = null;\r\n\t\t\t\r\n\t\ttry {\r\n\t\t \t\r\n\t\t\tconsoleHandler = new ConsoleHandler();\r\n\t\t\t\t\r\n\t\t} catch (SecurityException e) {\r\n\t\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t \r\n\t\t return consoleHandler;\r\n\t}", "private void handleCreateCommand() throws IOException,\r\n ClassNotFoundException,\r\n InstantiationException,\r\n IllegalAccessException {\r\n final String className = (String) m_in.readObject();\r\n Class klass = Class.forName(className, false, m_loader);\r\n final Object instance = klass.newInstance();\r\n final String handle = RemoteProxy.wrapInstance(instance);\r\n m_out.writeObject(handle);\r\n m_out.flush();\r\n }", "Communicator createCommunicator();", "public static PrintWriter createPrintWriter(File outputFile, PrintWriter console)\n throws FileNotFoundException, UnsupportedEncodingException\n {\n return createPrintWriter(outputFile, console, false);\n }", "AdminConsole createAdminConsole();", "public ConsoleWriter(TextConsole console, int fgColor) {\n this.console = console;\n this.fgColor = fgColor;\n }", "private void setupWriter() {\n output = new StringWriter();\n writer = new PrintWriter(output);\n }", "void setConsole(ConsoleManager console);", "private PrintWriterUtil() {}", "public CreateRemoteClassic<Msg, Ref> create();", "private void createWriter() throws IOException {\n if (outputFile.exists()) {\n outputFile.delete();\n }\n FileWriter outFw = null;\n try {\n outFw = new FileWriter(outputFile.getAbsolutePath());\n } catch (IOException e) {\n LOG.error(\"Can not create writer for {} {}\", outputFile.getAbsolutePath(), e);\n throw e;\n }\n this.bufferedWriter = new BufferedWriter(outFw);\n writeOutputLine(\"User Agent - started\");\n }", "Write createWrite();", "public static PrintWriter createPrintWriter(File outputFile,\n PrintWriter console,\n boolean append)\n throws FileNotFoundException, UnsupportedEncodingException\n {\n return outputFile == Configuration.STD_OUT ?\n console :\n new PrintWriter(\n new BufferedWriter(\n new OutputStreamWriter(\n new FileOutputStream(outputFile, append), \"UTF-8\")));\n }", "Console(/*@ non_null */ Properties p, /*@ non_null */ CommandHandler ch)\n\t{\n\t\tsuper(\"Console\");\n\n\t\tthis._handler = ch;\n\t}", "public Console(/*@ non_null */ CommandHandler ch)\n\t{\n\t\tsuper(\"Console\");\n\t\tthis._handler = ch;\n\t}", "private Console startConsole( String consoleHost ) throws RemoteException\n {\n Console console = null;\n Registry registry = null;\n int attempt = 0;\n final int numAttempts = 5;\n final int delay = 750; // 0.75 seconds.\n \n if( Launcher.startChameleonConsole( consoleHost ) )\n {\n for( ; attempt < numAttempts; ++attempt )\n {\n try\n {\n registry = LocateRegistry.getRegistry( consoleHost,\n RegistrationManager.PORT );\n console = (Console) registry.lookup( Console.SERVICE_NAME );\n }\n catch( Exception anyException )\n {\n }\n \n if( null == console )\n {\n try\n {\n Thread.sleep( delay );\n }\n catch( InterruptedException interruptedException )\n {\n }\n }\n }\n }\n \n return( console );\n }", "@Override\n public void create() {\n setScreen(new ServerScreen(\n new RemoteGame(),\n new SocketIoGameServer(HOST, PORT)\n ));\n }", "com.lxd.protobuf.msg.result.console.Console.Console_ getConsole();", "public BootstrapInstrumentor(PrintWriter w) {\n this.w = w;\n }", "Commands createCommands();", "abstract void initiateConsole();", "public void writeToConsole(String text) {\n consoleToWrite += text;\n\n class ConsoleNodeWriteConsole implements Runnable {\n public void run() {\n if (consoleTextArea != null) {\n consoleTextArea.appendText(consoleToWrite);\n\n List<Trigger> triggers = getProgram().getFlowController().getActiveTriggers(getContainedText(), \"New line\");\n for (Trigger trigger : triggers) {\n NodeRunParams nodeRunParams = new NodeRunParams();\n nodeRunParams.setOneTimeVariable(consoleToWrite);\n Program.runHelper(trigger.getParent().getNextNodeToRun(), getProgram().getFlowController().getReferenceID(), trigger.getParent(), false, true, null, nodeRunParams);\n }\n\n consoleToWrite = \"\";\n }\n }\n }\n\n Platform.runLater(new ConsoleNodeWriteConsole());\n }", "public ImageWriter createWriterInstance(Object extension)\n throws IOException\n {\n return new DcmImageWriter(this);\n }", "@RequestMapping(value = \"/console\", method = RequestMethod.POST)\n @ResponseStatus(value = HttpStatus.CREATED)\n public Console addConsole(@RequestBody @Valid Console console) {\n return serviceLayer.addConsole(console);\n }", "public interface ConsoleIO {\n void write(String line);\n\n}", "SocketWriter newSocketWriter(SocketConnection connection);", "@Resource(name=\"console\")\r\n\tpublic void setLogWriter(ConsoleWriter logWriter) {\r\n\t\tthis.consoleWriter = logWriter;\r\n\t}", "public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}", "public IConsole getConsole() {\n return console;\n }", "Command createCommandWith(CommandCreator creator);", "public EnumeratedSaveCommand(PrintWriter writer) {\n this.writer = writer;\n }", "public JCoresScript console() {\n \tthis.console = true;\n \treturn this;\n }", "public ConsoleOutputWrapper() {\n fCurrent = ConsoleUtils.getDefault().getConsole();\n }", "RemoteActuator createRemoteActuator();", "public void consoleWrite(String message) {\n if (console == null) {\n console = new ConsoleWindowPane();\n getDefaultWindow().getContent().add(console);\n } else if (console.getParent() == null) {\n getDefaultWindow().getContent().add(console);\n }\n if (message != null) {\n console.writeMessage(message);\n }\n }", "public PrintWriter createOutput(String name) {\n if (name == null) {\n throw new NullPointerException();\n }\n\n synchronized (TestResult.this) {\n synchronized (this) {\n checkMutable();\n\n OutputBuffer b = new WritableOutputBuffer(name);\n buffers = DynamicArray.append(buffers, b);\n\n notifyCreatedOutput(this, name);\n\n return b.getPrintWriter();\n }\n }\n }", "OutputPort createOutputPort();", "public PrintWriter writeTextStream() throws IOException {\n return new PrintWriter(new OutputStreamWriter(\n writeStream(WebSocketMessage.OPCODE_TEXT), UTF8));\n }", "public static ConverterRunner createInstance() { return new ConverterRunner(); }", "Command createCommand();", "@Override\n\tpublic IWidgetInstance createInstance(ISocketInstance socket) {\n\t\treturn this;\n\t}", "public static void main(String args[]) { We must set the RMI security manager to allow downloading of code\n // which, in this case, is the Blitz proxy amongst other things\n //\n try {\n// if (System.getSecurityManager() == null)\n// System.setSecurityManager(new RMISecurityManager());\n\n new Writer().exec();\n } catch (Exception anE) {\n System.err.println(\"Whoops\");\n anE.printStackTrace(System.err);\n }\n }", "public PrintWriter createClientOutputStream(String name) throws IOException\n\t{\n\t\tSocket clientSocket = clientTable.get(name);\n\t\tPrintWriter clientOutputStream = new PrintWriter(clientSocket.getOutputStream(), true);\n\t\tclientOutputStreams.put(name, clientOutputStream);\n\t\treturn clientOutputStream;\n\t\t\n\t}", "Drone createDrone();", "public static StringDescriptionWriter stringWriter() {\n return new StringDescriptionWriter();\n }", "private WriterFactory() {\n }", "public Builder setConsole(com.lxd.protobuf.msg.result.console.Console.Console_ value) {\n if (consoleBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n console_ = value;\n onChanged();\n } else {\n consoleBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000002;\n return this;\n }", "protected abstract CreateRemoteClassic<Msg, Ref> make_create();", "public static Writer writerCreator(String iFile, String config) throws IOException\n\t{\n\t\tWriter writer = new BufferedWriter(\n\t\t\t\tnew OutputStreamWriter(new FileOutputStream(iFile), UTF8));\n\t\twriter.write(config);\n\t\treturn writer;\n\t}", "private ServerSocket createServerSocket() throws IOException {\n ServerSocket serverSocket = new ServerSocket(Constants.SERVER_PORT);\n System.out.printf(\"Server for chatting started at %d\\n\", Constants.SERVER_PORT);\n return serverSocket;\n }", "public Writer getWriter(String cliParameter) {\n Writer writer = null;\n if(\"csv\".equals(cliParameter)){\n writer = new WriterCSV();\n }\n \n return writer;\n }", "public JsonGenerator createGenerator(Writer w)\n/* */ throws IOException\n/* */ {\n/* 1129 */ IOContext ctxt = _createContext(w, false);\n/* 1130 */ return _createGenerator(_decorate(w, ctxt), ctxt);\n/* */ }", "public interface ConsolePrinter {\r\n\r\n\t/**\r\n\t * Prints given text line to console.\r\n\t * \r\n\t * @param line\r\n\t * text to print.\r\n\t */\r\n\tvoid println(String line);\r\n\r\n\t/**\r\n\t * Prints given (formatted) string to current server console.<br>\r\n\t * <i>Note: This method neither throws an exception nor prints anything if a\r\n\t * command line is available but no server console running. Use\r\n\t * {@link EduLog} for that.</i>\r\n\t * \r\n\t * @see Formatter\r\n\t * \r\n\t * @param line\r\n\t * A (format) string that should be printed.\r\n\t * \r\n\t * @param args\r\n\t * Format arguments.\r\n\t * \r\n\t * @throws IllegalFormatException\r\n\t * If a format string contains an illegal syntax, a format\r\n\t * specifier that is incompatible with the given arguments,\r\n\t * insufficient arguments given the format string, or other\r\n\t * illegal conditions. For specification of all possible\r\n\t * formatting errors, see the detail section of\r\n\t * {@link Formatter} class specification.\r\n\t */\r\n\tvoid printlnf(String line, Object... args);\r\n\r\n}", "public KVServerInstance createServerInstance(KVCommunicationModule com, KVServer master){\n KVServerInstance newInstance = new KVServerInstance(com,master);\n newInstance.changeLogLevel(kv_out.getOutputLevel(),kv_out.getLogLevel());\n return newInstance;\n }", "Writer run(Writer writer, List<Object> scopes);", "public static JSONWriter getInstance(){\n\t\treturn new JSONWriter();\n\t}", "protected void appendSuiteCreatorCommand(StringBuffer buffer, String bootstrapSuitePath) {\n buffer.append(getSquawkExecutable());\n if (verbose) {\n buffer.append(\" -verbose\");\n }\n// buffer.append(\" -J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999\");\n buffer.append(\" -J-Djava.awt.headless=true\");\n// buffer.append(\" -veryverbose\");\n if (bootstrapSuitePath != null) {\n buffer.append(\" -Xboot:\");\n buffer.append(bootstrapSuitePath);\n }\n if (suiteCreatorDebug) {\n buffer.append(\" com.sun.squawk.debugger.sda.SDA\");\n }\n buffer.append(\" com.sun.squawk.SuiteCreator\");\n }", "void create(T instance) throws IOException;", "public static JsonWriter newWriter(Writer writer) {\n if (provider == JsonProvider.UNKNOWN) {\n init();\n }\n return provider.newWriter(writer);\n }", "public static OutputQueue createOutputThread() {\n\tfinal OutputQueue queue = new OutputQueue();\n\tThread t = new Thread() {\n\t public void run() {\n\t\tUtterance utterance = null;\n\t\tdo {\n\t\t utterance = queue.pend();\n\t\t if (utterance != null) {\n\t\t\tVoice voice = utterance.getVoice();\n\t\t\tvoice.log(\"OUT: \" + utterance.getString(\"input_text\"));\n voice.outputUtterance(utterance, voice.threadTimer);\n\t\t }\n\t\t} while (utterance != null);\n\t }\n\t};\n\tt.setDaemon(true);\n\tt.start();\n\treturn queue;\n }", "Contender createContender();", "public static void main(String[] args) {\n \tWelcome console = null;\n\t\ttry {\n\t\t\t//console = new Welcome(conn);\n\t\t\tconsole = new Welcome();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \tconsole.start();\n }", "private void initializeConsole() {\n\t\tthis.hydraConsole = new HydraConsole(this.stage, this.commands);\n\t\tthis.splitPane.setBottomComponent(this.hydraConsole);\n\t}", "private ConsoleUtils(String name) {\n instance = this;\n fConsole = new IOConsole(\"Mobius\" + name + \" Console\", EImages.TOOL.getDescriptor());\n fConsole.activate();\n ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{fConsole});\n final Display display = PlatformUI.getWorkbench().getDisplay();\n fRed = new Color(display, RED);\n fBlue = new Color(display, BLUE);\n fPurple = new Color(display, PURPLE);\n fBlack = new Color(display, BLACK);\n }", "private void crearFlujos() throws IOException {\n salidaDecorada = new PrintStream(socket.getOutputStream());\n entradaDecorada = new Scanner(socket.getInputStream());\n }", "private JTextArea getConsole() {\r\n\t\tif (console == null) {\r\n\t\t\tconsole = new JTextArea();\r\n\t\t}\r\n\t\treturn console;\r\n\t}", "@RequestMapping(value = \"/console\", method = RequestMethod.POST)\n public ResponseEntity<Consoles> create(@RequestBody @Valid @NotNull Consoles consoles) {\n consoles.setConsolesId(UUID.randomUUID().toString());\n consolesService.saveConsoles(consoles);\n return ResponseEntity.ok().body(consoles);\n }", "public StdOutWriter ()\n {\n super (System.out, true);\n }", "public CreateConsole pretty(String pretty) {\n put(\"pretty\", pretty);\n return this;\n }", "public abstract JsonWriter newWriter(Writer writer);", "private void initWriter(int queueSize) {\n\t\tthis.writer = new RoutingWriter(this.myName, this.remoteName, new Writer(\n\t\t\t\tthis.dos, queueSize, true));\n\t\tthis.writer.start();\n\t}", "Process createProcess();", "abstract ManagedChannel createChannel(List<ServerInfo> servers);", "@Override\n\tpublic IOProcessor create(Interpreter interpreter) {\n\t\tTestCustomIOProc ioProc = new TestCustomIOProc();\n\t\tioProc.interpreter = interpreter;\n\t\tioProc.swigReleaseOwnership();\n\t\treturn ioProc;\n\t}", "Port createPort();", "Port createPort();", "default ServerTextChannelUpdater createUpdater() {\n return new ServerTextChannelUpdater(this);\n }", "public static RoMServer createServer() throws IOException, Exception {\r\n \t\t// Ip and Port out of config\r\n \t\tIConfig cfg = ConfigurationFactory.getConfig();\r\n \r\n \t\treturn RoMServer.createServer(cfg.getIp(), cfg.getPort());\r\n \t}", "public JPanel buildConsole()\n\t{\n\t\tJPanel output = new JPanel(new BorderLayout());\n\t\tString hold = \"\";\n\t\t\n output.setBorder (new TitledBorder(new EtchedBorder(),\"Console\")); //Create the border\n output.setPreferredSize(new Dimension(50,150)); //Set the size of the JPanel\n console.insert(hold,0);\n console.setLineWrap(true);\n console.setWrapStyleWord(true);\n console.setEditable(false); //Does not allow the user to edit the output\n JScrollPane Cscroll = new JScrollPane (console); //Create a JScrollPane object\n Cscroll.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED ); //Set the scroll bars to appear when necessary\n output.add(Cscroll); //Add the scroll to the JPanel\n textField = new JTextField();\n output.add(BorderLayout.PAGE_END, textField);\n \n\t\treturn output;\n\t}", "DynamicPort createDynamicPort();", "public WriteToClient(Socket c) throws IOException { //initialize printwirte and scanner\r\n\t\ttoClient = new PrintWriter(c.getOutputStream());\r\n\t\tstdin = new Scanner(System.in);\r\n\t}", "private Command createPushCommand() {\n\t\treturn new PushCommand();\n\t}", "public ResourceBroker(ServerHandlerManager shm,\n\t\t\tAdminServer admin,\n\t\t\tAdminWriter writer) \n {\n super();\n Hashtable defs = new Hashtable(3);\n defs.put(\"identifier\", \"broker-frame\");\n registerFrame( new BrokerFrame(shm, admin, writer), defs);\n }", "private PrintWriter createOutputFile(String outputFile) throws IOException {\n return new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));\n }", "public static void setup() {\n\t\toutputs.add(new Console.stdout());\n\t}", "protected Device createOutputDevice(HttpServletRequest request,\n HttpServletResponse response,\n ExternalizedResource extInfo) \n throws IOException {\n return new ServletDevice(response.getOutputStream());\n }", "public void setConsole(Console c) {\n con = c;\n console = true;\n }", "public ServerConsole(String uID, String host, String password, int port){\n\t\ttry{\n\t\t\tclient= new ChatClient(uID, host, password, port, this);\n\t\t} \n\t\tcatch(IOException exception){\n\t\t\tSystem.out.println(\"Error: Can't setup connection!\" + \" Terminating client.\");\t\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "private void writeToConsole(IOConsoleOutputStream stream, String output){\n try {\n stream.write(output);\n } catch (IOException e) {\n OPIBuilderPlugin.getLogger().log(Level.WARNING, \"Write Console error\",e); //$NON-NLS-1$\n }\n }", "@Override\n public Writer getOutputStreamWriter() throws IOException {\n return new OutputStreamWriter(getOutputStream());\n }", "public static Writer wrapWriter(StyledPrintWriter w) {\n return new WrappedWriter(w);\n }", "private PrintWriter\n\tgetStreamWriter(\n\t\tOutputStream\toutputStream)\n\t{\n\t\treturn(new PrintWriter(outputStream, true));\n\t}", "default Writer execute(Writer writer, Object scope) {\n return execute(writer, makeList(scope));\n }", "public ServerWriter(ServerConnection connection) {\n super(connection);\n }", "Subprocess createSubprocess();", "private BufferedWriter createWriter(String filePath, String fileName)\r\n\t\t\tthrows IOException {\r\n\t\tString fullPath = filePath + \"/\" + fileName;\r\n\t\tFile file = new File(fullPath);\r\n\t\tboolean exists = new File(filePath).exists();\r\n\t\tif (!exists) {\r\n\t\t\tfile.mkdir();\r\n\t\t}\r\n\t\tFileWriter writer = new FileWriter(file);\r\n\t\tBufferedWriter bufferWriter = new BufferedWriter(writer);\r\n\r\n\t\treturn bufferWriter;\r\n\t}", "public void instantiateCommand() throws SystemException {\r\n\t\t// Check the definitation.\r\n\t\tdefinitionCheck();\r\n\t\t\r\n\t\t// Create the fresh instance.\r\n\t\tcommandInstance = new ReadWriteableAttributes();\r\n\t}", "public AbstractInvoker(Console console) {\n\t\tthis.console = console;\n\t}", "public Cli (BufferedReader in,PrintWriter out , Controller thecontroller) {\r\n\t\tsuper(thecontroller);\r\n\t\tthis.in=in;\r\n\t\tthis.out=out;\r\n\t\tthis.commandsSet= controller.getCommandSet();\r\n\t}", "public static XMLStringWriter create() {\r\n return new XMLStringWriter(new StringWriter());\r\n }" ]
[ "0.567867", "0.5450029", "0.54417866", "0.52625364", "0.525718", "0.52485496", "0.51781327", "0.5171072", "0.5167998", "0.514637", "0.51183426", "0.51164347", "0.50651383", "0.5045914", "0.50295967", "0.50021845", "0.4972306", "0.49389556", "0.4936409", "0.49284518", "0.48786974", "0.4873728", "0.4871558", "0.48702386", "0.4857459", "0.48173717", "0.4809427", "0.48082364", "0.47957706", "0.4792136", "0.47515076", "0.4749112", "0.47487926", "0.47201264", "0.47186473", "0.4697516", "0.46887243", "0.46878457", "0.46755627", "0.4666798", "0.4655882", "0.46520185", "0.46244165", "0.46117404", "0.4589904", "0.45799863", "0.45704278", "0.4568889", "0.45682803", "0.4561579", "0.45598197", "0.45439926", "0.45421082", "0.45364326", "0.4520775", "0.45145068", "0.45109156", "0.45104644", "0.45033938", "0.449926", "0.4497281", "0.44917467", "0.44904485", "0.44860977", "0.4479123", "0.44751406", "0.44640398", "0.4459578", "0.44545504", "0.44542617", "0.4452475", "0.44399208", "0.44370264", "0.44208837", "0.44189814", "0.44189814", "0.44158527", "0.44138926", "0.44134414", "0.44118562", "0.4411287", "0.44098404", "0.44095227", "0.4405288", "0.43974903", "0.43923315", "0.439143", "0.4388762", "0.43860853", "0.43816146", "0.4379084", "0.43771988", "0.43753278", "0.43724006", "0.43708432", "0.43690613", "0.43655962", "0.4362158", "0.43598995", "0.43571976" ]
0.70811266
0
Writes a portion of an array of characters.
@Override public void write(char[] cbuf, int off, int len) throws IOException { builder.append(cbuf, off, len); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void writeChars(char[] c, int off, int len) throws IOException;", "public void write(char[] charArray, int offset, int length) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(charArray, offset, length);\r\n }", "public void write(char[] charArray) throws IOException{\r\n write(charArray, 0, charArray.length);\r\n }", "public void write(char cbuf[], int off, int len) throws IOException {\n ensureOpen();\n if ((off < 0) || (off > cbuf.length) || (len < 0) ||\n ((off + len) > cbuf.length) || ((off + len) < 0)) {\n throw new IndexOutOfBoundsException();\n } else if (len == 0) {\n return;\n }\n out.write(cbuf, off, len);\n }", "public void write(String[] buf, int offset, int size) throws IOException;", "void write (char ch, int offset);", "void writeChars(String s) throws IOException;", "public void write(char[] cArr) throws XMLStreamException {\n try {\n this.writer.write(cArr);\n } catch (IOException e) {\n throw new XMLStreamException((Throwable) e);\n }\n }", "public void write(char[] buffer, int offset, int length) {\n final String text = new String(buffer, offset, length);\n //Java 8\n //SwingUtilities.invokeLater(()->{try{pane.getDocument().insertString(pane.getDocument().getLength(), text, properties);}catch(Exception e){}});\n\n //Java 7\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n try{pane.getDocument().insertString(pane.getDocument().getLength(), text, properties);}\n catch(Exception e){}\n }\n });\n }", "public void write(String[] buf) throws IOException;", "public abstract void drawChars(char data[], int offset, int length, int x, int y);", "@Override\n public void characters(char ch[], int start, int length) {\n\n }", "@Override\r\n public void write(char[] cbuf, int off, int len) throws IOException {\r\n\r\n IOException ioException = null;\r\n for (WriterInfo writerInfo : mWriters) {\r\n try {\r\n writerInfo.getWriter().write(cbuf, off, len);\r\n } catch(IOException ioex) {\r\n ioException = ioex;\r\n }\r\n }\r\n if (ioException != null) {\r\n throw ioException;\r\n }\r\n\r\n }", "@Override\n\tpublic void characters(char ch[], int start, int length) {\n\t\tchars.append(new String(ch, start, length));\n\t}", "private static void writer(String filename, char[] chars) {\n BinaryOut binaryOut = new BinaryOut(filename);\n\n for (char c : chars) {\n binaryOut.write(c);\n }\n\n binaryOut.close();\n }", "@Override \n\t public void characters(char ch[], int start, int length) { \n\t\t \n\t }", "public synchronized void write(final byte[] cbuf, final int off, final int len) throws IOException {\n\t\tif (len < 0) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tif (off < 0) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\tif (cbuf == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif ((len + off) > cbuf.length) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\n\t\tensureSize(cursor + len);\n\n\t\tSystem.arraycopy(cbuf, off, this.buffer, cursor, len);\n\t\tcursor += len;\n\t}", "public void write(byte b[], int off, int len) throws IOException;", "void write (String s, int offset);", "void write(byte[] buffer, int bufferOffset, int length) throws IOException;", "public void write(char[] b, int off, int len) throws IOException {\n\t\t\tif (!initialized) {\n\t\t\t\tarea.setText(\"\");\n\t\t\t\tinitialized = true;\n\t\t\t}\n\t\t\tString str = new String(b, off, len);\n\t\t\tStringBuffer sb = new StringBuffer(len);\n\t\t\twhile (str != null && str.length() > 0) {\n\t\t\t\tif (lastCR && str.charAt(0) == '\\n')\n\t\t\t\t\tstr = str.substring(1);\n\t\t\t\tint crIndex = str.indexOf('\\r');\n\t\t\t\tif (crIndex >= 0) {\n\t\t\t\t\tsb.append(str.substring(0, crIndex));\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tstr = str.substring(crIndex + 1);\n\t\t\t\t\tlastCR = true;\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(str);\n\t\t\t\t\tstr = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tarea.append(sb.toString());\n\t\t}", "@Override\n void characters(char[] ch, int start, int length);", "public void writeText(char[] text, int off, int len) throws IOException {\r\n deNude();\r\n writerEscape.writeText(text, off, len);\r\n }", "public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }", "public void write(byte[] data, long offset);", "public void write( byte[] array, int firstIndex,\n\t\t\tint count );", "public void characters (char ch[], int start, int length)\n\t\t{\n//\t\t\tfor (int i = start; i < start + length; i++) \n//\t\t\t\tSystem.out.print(ch[i]);\n//\t\t\tSystem.out.println();\n\t\t}", "public void write(char c){\n\t\tbuffer[bufferPos++] = c;\n\n\t\tif(bufferPos == limit) flush();\n\t}", "public void characters( char[] buf, int offset, int len ) {\r\n\r\n // Append the new characters\r\n currentString.append( new String( buf, offset, len ) );\r\n }", "public void printToClient(char[] charArray) {\n for (int i = 0; i < charArray.length; i++) {\n out.print(charArray[i] + \" \");\n }\n out.println();\n }", "private void _writeString(char[] text, int offset, int len)\n/* */ throws IOException\n/* */ {\n/* 1049 */ if (this._characterEscapes != null) {\n/* 1050 */ _writeStringCustom(text, offset, len);\n/* 1051 */ return;\n/* */ }\n/* 1053 */ if (this._maximumNonEscapedChar != 0) {\n/* 1054 */ _writeStringASCII(text, offset, len, this._maximumNonEscapedChar);\n/* 1055 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1062 */ len += offset;\n/* 1063 */ int[] escCodes = this._outputEscapes;\n/* 1064 */ int escLen = escCodes.length;\n/* 1065 */ while (offset < len) {\n/* 1066 */ int start = offset;\n/* */ for (;;)\n/* */ {\n/* 1069 */ char c = text[offset];\n/* 1070 */ if ((c < escLen) && (escCodes[c] != 0)) {\n/* */ break;\n/* */ }\n/* 1073 */ offset++; if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1079 */ int newAmount = offset - start;\n/* 1080 */ if (newAmount < 32)\n/* */ {\n/* 1082 */ if (this._outputTail + newAmount > this._outputEnd) {\n/* 1083 */ _flushBuffer();\n/* */ }\n/* 1085 */ if (newAmount > 0) {\n/* 1086 */ System.arraycopy(text, start, this._outputBuffer, this._outputTail, newAmount);\n/* 1087 */ this._outputTail += newAmount;\n/* */ }\n/* */ } else {\n/* 1090 */ _flushBuffer();\n/* 1091 */ this._writer.write(text, start, newAmount);\n/* */ }\n/* */ \n/* 1094 */ if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ \n/* 1098 */ char c = text[(offset++)];\n/* 1099 */ _appendCharacterEscape(c, escCodes[c]);\n/* */ }\n/* */ }", "@Override\n public void writeSpace(char[] text, int offset, int length)\n throws XMLStreamException\n {\n writeRaw(text, offset, length);\n }", "@Override\n public void write(char[] cbuf, int off, int len) throws IOException {\n if (textArea == null) {\n throw new IOException(\"Writer has already been closed!\");\n }\n String toWrite = String.copyValueOf(cbuf, off, len);\n textArea.appendText(toWrite);\n\n }", "T println(char[] data, int from, int len) throws PrintingException, ArrayIndexOutOfBoundsException;", "public void write(byte b[]) throws IOException;", "public void write(char[] cArr, int i, int i2) throws XMLStreamException {\n try {\n this.writer.write(cArr, i, i2);\n } catch (IOException e) {\n throw new XMLStreamException((Throwable) e);\n }\n }", "private void writeChar(byte[] bytes) {\n // let terminal do auto wrap around. \n term.writeChar(bytes);\n\n // update cursor \n //int x=term.getCursorX(); \n //int y=term.getCursorY();\n //term.putChar(bytes, x, y);\n // increment: let terminal do auto wrap around. \n //term.moveCursor(1,0); \n\n }", "void writeChar(char value);", "void write(byte b[]) throws IOException;", "@Override\n public void write(final byte[] data, final int offset, final int length)\n throws IOException {\n if (offset < 0 || length < 0 || length > data.length - offset) {\n throw new IndexOutOfBoundsException();\n }\n\n writeInternal(data, offset, length);\n }", "public static void write(@Nullable final char[] data, final Writer output) throws IOException {\n if (data != null) {\n output.write(data);\n }\n }", "public void write(byte[] b, int offset, int len) throws IOException {\n if (pos + len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, pos, len);\n pos += len;\n } else {\n flush();\n if (len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, 0, len);\n } else {\n ConsoleRedirect.this.flush(b, offset, len);\n }\n }\n }", "void writeInts(int[] i, int off, int len) throws IOException;", "@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }", "public void write(byte[] buffer);", "private static void shiftArray(char [] dest,int start, int e, char subChar){\n int w = e;\n int r = e;\n while (--r >= start) {\n char ch = dest[r];\n if (ch != subChar) {\n --w;\n if (w != r) {\n dest[w] = ch;\n }\n }\n }\n }", "CharacterTarget put(char[] symbols, int from, int to) throws PrintingException;", "T print(char[] data, int from, int len) throws PrintingException, ArrayIndexOutOfBoundsException;", "public void charData(char[] c, int offset, int length) throws Exception {\n\t\t\tString s = new String(c, offset, length);\n\n\t\t\tif (isVerbose()) {\n\t\t\t\tString x;\n\n\t\t\t\tif (s.length() > 40) {\n\t\t\t\t\tx = s.substring(0, 40) + \"...\";\n\t\t\t\t} else {\n\t\t\t\t\tx = s;\n\t\t\t\t}\n\n\t\t\t\tlogInfo(\"cdata\", \"[\" + offset + \",\" + length + \"] \" + x);\n\t\t\t}\n\n\t\t\t_currentElement.appendPCData(s);\n\t\t}", "public void characters(char[] ch, int start, int length) {\n\n\t\tfor (int i=start; i!=start+length; ++i) {\n\t\t\tif (Character.isWhitespace(ch[i])) {\n\t\t\t\tif (lastCharWS)\n\t\t\t\t\tcontinue;\n\t\t\t\tlastCharWS = true;\n\t\t\t\tbuffer.append(\" \");\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tlastCharWS = false;\n\t\t\t\tbuffer.append(ch[i]);\n\t\t\t}\n\t\t}\n\t}", "public static void writeWriterContents(Writer writer, char[] text) throws CoreException {\r\n\t\tCheck.checkArg(writer);\r\n try {\r\n \ttry {\r\n \t\twriter.write(text, 0, text.length);\r\n \t} finally {\r\n \t\twriter.close();\r\n \t}\r\n } catch (UnsupportedEncodingException e) {\r\n throw new CoreException(createErrorStatus(e));\r\n } catch (IOException e) {\r\n throw new CoreException(createErrorStatus(e));\r\n }\r\n\t}", "@Override\n public void write(char[] cbuf, int off, int len) throws IOException {\n for (int i = 0; i < cbuf.length; ++i)\n cbuf[i] = Character.toUpperCase(cbuf[i]);\n \n super.write(cbuf, off, len);\n \n }", "public void writeCharactersInternal(char[] cArr, int i, int i2, boolean z) throws XMLStreamException {\n CharsetEncoder charsetEncoder;\n if (i2 != 0) {\n int i3 = 0;\n while (i3 < i2) {\n char c = cArr[i3 + i];\n if (c == '\\\"') {\n if (z) {\n break;\n }\n } else if (c != '&' && c != '<' && c != '>') {\n if (c >= ' ') {\n if (c > 127 && (charsetEncoder = this.encoder) != null && !charsetEncoder.canEncode(c)) {\n break;\n }\n } else if (!z) {\n if (!(c == 9 || c == 10)) {\n break;\n }\n } else {\n break;\n }\n } else {\n break;\n }\n i3++;\n }\n if (i3 < i2) {\n slowWriteCharacters(cArr, i, i2, z);\n } else {\n write(cArr, i, i2);\n }\n }\n }", "public static void printArray(char[] array) {\n for (int i = 0; i < array.length; i++) {\n System.out.print(array[i] + \" \");\n }\n System.out.println();\n }", "public void write(char cbuf[], int off, int len) {\r\n if ((cbuf != null) && (len > 0)) {\r\n\r\n // Force flush if we have accumulated more than 1K of text\r\n boolean flushMe = false;\r\n synchronized (LogWriter.this) {\r\n buffer.append(cbuf, off, len);\r\n if (buffer.length() >= 1024) {\r\n flushMe = true;\r\n } else {\r\n // Look for embedded EOL\r\n for (int i=off+len-1; i>= off; i--) {\r\n if (cbuf[i] == '\\n') {\r\n flushMe = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (flushMe) flush();\r\n }\r\n }", "String charWrite();", "public static void printCharArr(char[] arr){\n\t for(int i = 0; i < arr.length; i++){\n\t System.out.println(arr[i]);\n\t }\n\t}", "public abstract void read_char_array(char[] value, int offset, int\nlength);", "public void setText(char[] chars, int start, int length);", "public static void writeArray(byte[] buffer, long offset, long length , byte [] name) {\n int i =0 ;\n while(length-- > 0){\n buffer[(int) offset++] = (byte) (name[i++] & 0xff);\n }\n }", "public final void write(int c) {\r\n if (cbyte == size) {\r\n throw new ArrayIndexOutOfBoundsException(String.format(\"%d\", cbyte));\r\n }\r\n \r\n // Append the input byte to the data element.\r\n elem |= (c & 0xff) << (bytenum << 3);\r\n \r\n bytenum++;\r\n cbyte++;\r\n if (bytenum == BYTES_IN_ELEMENT) {\r\n // Write the data\r\n data[offset] = elem;\r\n // Increase offset\r\n offset++;\r\n // Reset current element\r\n elem = 0;\r\n // Reset bytenum\r\n bytenum = 0;\r\n }\r\n }", "void writeShorts(short[] s, int off, int len) throws IOException;", "public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }", "static void printArray(char [] a) {\n\t\tfor (int i=0; i< a.length; i++) System.out.print(a[i]); \n\t\tSystem.out.println();\n\t}", "@Override\n public int write(byte[] bytes, int offset, int length) throws SWPException {\n int codePointLength = getLength();\n SWPException.requireTrue(length >= codePointLength, \"Buffer overflow.\");\n bytes[offset] = (byte) ((codePointLength << 8) & 0xff);\n bytes[offset + 1] = (byte) (codePointLength & 0xff);\n bytes[offset + 2] = (byte) (codePoint >>> 8);\n bytes[offset + 3] = (byte) (codePoint & 0xff);\n if (isNull()) {\n\n bytes[offset + 4] = SwpConstants.NULL_INDICATOR;\n }\n else {\n\n bytes[offset + 4] = SwpConstants.NOT_NULL_INDICATOR;\n primitive.write(bytes, offset + 5, length - 5);\n }\n return codePointLength;\n }", "@Override\n public void write(byte[] buf, int offset, int size) throws IOException;", "public abstract void writeBytes(byte[] b, int offset, int length) throws IOException;", "public abstract void writeRange(int startElement, int count,\r\n ByteBuffer src, int offsetBytes, boolean bForward);", "public void characters(char[] ch, int start, int length) throws SAXException {\n contents.write(ch, start, length);//ne znam cemu sluzi ali neka ostane\n textBuffer.append(new String(ch, start, length));\n }", "@Override\n public void write (final char buf[], final int off, final int len)\n {\n if (text != null)\n {\n text.append (new String (buf, off, len));\n if ((col += len) > wrap)\n println ();\n }\n else\n super.write (buf, off, len);\n }", "static void writearray(String[]array) {\n\t\t for (int i = 0; i < array.length; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\t}", "public static void writeOnBoard(char[][] a, char letter, int x, int y){\r\n //first check if valid\r\n int rowNumber = a.length;\r\n int colNumber = a[0].length;\r\n if (colNumber<=x || rowNumber<=y || x<0 || y<0){\r\n throw new IllegalArgumentException(\"Point out of the span. Please re-enter a new point.\");\r\n }\r\n if (!spotIsEmpty(a[x][y])){\r\n throw new IllegalArgumentException(\"This spot has already been taken! Please re-enter a new point.\");\r\n }\r\n a[x][y] = letter;\r\n \r\n }", "private void writeEsc(char ch[], int start, int length, boolean isAttVal) throws IOException {\n\t\tescapeHandler.escape(ch, start, length, isAttVal, output);\n\t}", "@Override\n public void characters(char[] ch, int start, int length) {\n Node current = eltStack.peek();\n if (current.getChildNodes().getLength() == 1\n && current.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE) {\n Text text = (Text) current.getChildNodes().item(0);\n text.appendData(new String(ch, start, length));\n } else {\n Text text = document.createTextNode(new String(ch, start, length));\n eltStack.peek().appendChild(text);\n }\n }", "@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}", "public void write(final byte[] data, final int offset, final int len) throws IOException {\n checkOpened();\n dos.write(data, offset, len);\n flush();\n }", "private void addCharacters(\n final SAXEventType eventType,\n char[] characters, int offset, int length) {\n\n boolean coalesce = true;\n\n startRecording();\n\n // Coalesce adjacent character events together.\n if (lastEventType != eventType) {\n // Add the event type.\n addEvent(eventType);\n\n coalesce = false;\n }\n\n if (coalesce) {\n int lastLength = lastCharacterEventLength.getValue();\n int totalLength = lastLength + length;\n lastCharacterEventLength.setValue(totalLength);\n if(LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"characters (coalesce)='\" +\n new String(characters,offset, length) + \"'\");\n }\n } else {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"characters='\" +\n new String(characters, offset, length) + \"'\");\n }\n addInt(characterCount);\n\n addPlaceHolderValue(lastCharacterEventLength);\n\n lastCharacterEventLength.setValue(length);\n }\n\n ensureCharacterArrayCapacity(characterCount + length);\n System.arraycopy(characters, offset, characterArray, characterCount,\n length);\n characterCount += length;\n }", "public void cdata(char[] chars, int start, int length);", "public abstract void write(byte[] b);", "public void characters(char[] ch, int start, int len) {\r\n \tif (charState > 0) {\r\n \t\tif (charState == 2) {\r\n \t\t\tlineBuffer.append(' ');\r\n \t\t}\r\n \t\tcharState = 1;\r\n \tlineBuffer.append(new String(ch, start, len));\r\n \t}\r\n }", "CharacterTarget put(char[] symbols) throws PrintingException;", "public static void main(String[] args) {\n\t\t\r\n\t\tString charArray = \"Benjamin\";\r\n\t\t\r\n\t\tchar[] myChar = charArray.toCharArray(); //string returns to char\r\n\t\t\r\n\t\tSystem.out.println(Arrays.toString(myChar));\r\n\t\t\r\n\t\tSystem.out.println(\"elements in myChar: \"+myChar.length);\r\n\t\t\r\n\r\n\t\t\r\n\t\tString str =\"\";\r\n\t\tchar mychar[] = {'a', 'b', 'c'};\r\n\t\t\r\n\t\tfor(int i=0; i<mychar.length; i++) {\r\n\t\t\tchar c= mychar[i];\r\n\t\t\tstr+=c;\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(\"char to string result is: \"+str);\r\n\t}", "private void doClipWrite(byte b[], int off, int len) {\n\t\tif (count + len <= maxOutputSize) { // won't overflow\n\t\t\tthis.writeDirectly(b, off, len);\n\t\t} else {\n\t\t\tint discardBytes = len + count - maxOutputSize;\n\t\t\tif (len >= maxOutputSize) {\n\t\t\t\treset();\n\t\t\t\tthis.writeDirectly(b, off + len - maxOutputSize, maxOutputSize);\n\t\t\t} else {\n\t\t\t\tint shiftStart = count - maxOutputSize + len;\n\t\t\t\tint remaining = maxOutputSize - len;\n\t\t\t\tSystem.arraycopy(buf, shiftStart, buf, 0, remaining);\n\t\t\t\tcount = remaining;\n\t\t\t\tthis.writeDirectly(b, off, len);\n\t\t\t}\n\t\t\tclipNum ++;\n\t\t\tSystem.out.println(String.format(\"Overflow count: %d, discarded bytes number: %d\", clipNum,\n\t\t\t\t\tdiscardBytes));\n\t\t\t\n\t\t}\n\n\t}", "@Override\n public void write(byte[] data) throws IOException {\n for (int i = 0; i < data.length; i++) {\n write(data[i]);\n }\n }", "public void writeArray(Object o) throws IOException;", "void writeChar(final char result) throws WriterException;", "public static byte[] writeInArray(byte[] array, String value, int pos) {\n\n byte[] strVal = value.getBytes();\n System.arraycopy(strVal, 0, array, pos, value.length());\n\n return array;\n }", "public void setChars(char[] data, int row, int column) {\n\t\tcolumns[column].setChars(data, subset[row]);\n\t}", "private void writeBuffer( byte b[], int offset, int length) throws IOException\r\n\t{\r\n\t\t// Write the chunk length as a hex number.\r\n\t\tfinal String size = Integer.toHexString(length);\r\n\t\tthis.out.write(size.getBytes());\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// Write the data.\r\n\t\tif (length != 0 )\r\n\t\t\tthis.out.write(b, offset, length);\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// And flush the real stream.\r\n\t\tthis.out.flush();\r\n\t}", "public void write(byte b[]) throws IOException\n {\n checkThreshold(b.length);\n getStream().write(b);\n written += b.length;\n }", "public static int compress(char[] chars) {\n int anchor = 0, write = 0;\n for (int read = 0; read < chars.length; read++){\n if (read + 1 == chars.length || chars[read + 1] != chars[read]){\n chars[write++] = chars[anchor];\n if (read > anchor) {\n// Integer.toString(read-anchor + 1)\n for (char c: (\"\" + (read - anchor + 1)).toCharArray()){\n chars[write++] = c;\n }\n }\n anchor = read + 1;\n }\n }\n return write;\n }", "public void safeEncode(char[] chars, int off, int len, CharWriter writer) throws EncodingException\n {\n int previous = off;\n\n //\n int to = off + len;\n\n // Perform lookup char by char\n for (int current = off; current < to; current++)\n {\n // Lookup\n String replacement = lookup(chars[current]);\n\n // Do we have a replacement\n if (replacement != null)\n {\n // We lazy create the result\n\n // Append the previous chars if any\n writer.append(chars, previous, current - previous);\n\n // Append the replaced entity\n writer.append('&').append(replacement).append(';');\n\n // Update the previous pointer\n previous = current + 1;\n }\n }\n\n //\n writer.append(chars, previous, chars.length - previous);\n }", "public void write​(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}", "@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}", "@Override\n\tpublic int write( byte [] buffer, int offset, int length ) {\n\t\tByteBuffer out = getOutputBuffer();\n\t\tif( out.limit() <= 0 ) {\n\t\t\tout.limit( out.capacity() );\n\t\t}\n\t\tsynchronized( out ) {\n\t\t\tout.put( buffer, offset, length );\n\t\t}\n\t\tdispatcher.requestWrite( this );\n\t\treturn length;\n\t}", "private void _writeSegment(int end)\n/* */ throws IOException\n/* */ {\n/* 1006 */ int[] escCodes = this._outputEscapes;\n/* 1007 */ int escLen = escCodes.length;\n/* */ \n/* 1009 */ int ptr = 0;\n/* 1010 */ int start = ptr;\n/* */ \n/* */ \n/* 1013 */ while (ptr < end)\n/* */ {\n/* */ char c;\n/* */ for (;;) {\n/* 1017 */ c = this._outputBuffer[ptr];\n/* 1018 */ if ((c >= escLen) || (escCodes[c] == 0))\n/* */ {\n/* */ \n/* 1021 */ ptr++; if (ptr >= end) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1030 */ int flushLen = ptr - start;\n/* 1031 */ if (flushLen > 0) {\n/* 1032 */ this._writer.write(this._outputBuffer, start, flushLen);\n/* 1033 */ if (ptr >= end) {\n/* */ break;\n/* */ }\n/* */ }\n/* 1037 */ ptr++;\n/* */ \n/* 1039 */ start = _prependOrWriteCharacterEscape(this._outputBuffer, ptr, end, c, escCodes[c]);\n/* */ }\n/* */ }", "public void characters(char ch[], int start, int length)\n throws SAXException {\n int i = 0;\n while ( i < length ) {\n char c = ch[start + i];\n switch (c) {\n case '&':\n newContent.append(\"&amp;\");\n break;\n case '<':\n newContent.append(\"&lt;\");\n break;\n case '>':\n newContent.append(\"&gt;\");\n break;\n case '\"':\n newContent.append(\"&quot;\");\n break;\n case '\\'':\n newContent.append(\"&apos;\");\n break;\n default:\n // If we're outside 7 bit ascii encode as a character ref.\n // Not sure what the proper behavior here should be.\n if ((int) c > 127) {\n newContent.append(\"&#\" + (int) c + \";\");\n }\n else {\n newContent.append(c);\n }\n }\n\n i++;\n }\n }", "public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }", "public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}", "public void write(String value){\r\n for(int i=0; i<value.length(); i++){\r\n mBufferData.add(value.charAt(i));\r\n }\r\n }" ]
[ "0.8040365", "0.69351685", "0.6754314", "0.66677344", "0.64745426", "0.64163166", "0.6251137", "0.62477624", "0.6234871", "0.6193163", "0.61458325", "0.6139917", "0.61393845", "0.61271626", "0.6127038", "0.61244005", "0.60924226", "0.60894907", "0.60780525", "0.60670334", "0.60516983", "0.60458136", "0.6015765", "0.601447", "0.6006369", "0.59926116", "0.598219", "0.58733153", "0.5869798", "0.5846469", "0.5846419", "0.578059", "0.5777774", "0.57600355", "0.57591337", "0.5757569", "0.5755024", "0.5731398", "0.5697031", "0.5694418", "0.5674944", "0.56361353", "0.5615913", "0.558431", "0.5562722", "0.55613285", "0.5546506", "0.55173016", "0.5516495", "0.5511201", "0.5501984", "0.54811716", "0.54783005", "0.54734135", "0.54534996", "0.5441175", "0.543563", "0.5414898", "0.53922945", "0.5383738", "0.53690374", "0.5367528", "0.53663534", "0.53627795", "0.5361538", "0.5358196", "0.53574765", "0.53303987", "0.53224355", "0.52996224", "0.5299515", "0.5292664", "0.5289184", "0.528877", "0.52597237", "0.5250477", "0.524046", "0.52397877", "0.523943", "0.52224195", "0.52221245", "0.5221805", "0.52152616", "0.5213843", "0.5201804", "0.51969314", "0.5188298", "0.51839924", "0.51810724", "0.51798147", "0.51712257", "0.5165429", "0.5162857", "0.51350397", "0.51296276", "0.51277906", "0.51257086", "0.51174283", "0.5103709", "0.5098239" ]
0.6314676
6
Flushes this stream by writing any buffered output to the underlying stream.
@Override public void flush() throws IOException { for(;;) { int index = indexOneOf(builder, '\r', '\n'); if(index == -1) { break; } // ignore false returned by offer when queue is full queue.offer(builder.substring(0, index)); if(builder.charAt(index) == '\r') { ++index; } if(builder.charAt(index) != '\n') { throw new IllegalStateException(); } ++index; builder.delete(0, index); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flush() {\n wasFlushed = true;\n }", "public void flush() throws IOException\n {\n getStream().flush();\n }", "public static void flush() {\n if (outputEnabled)\n out.flush();\n }", "public synchronized void flush() {\n\t\ttry {\n\t\t\tcloseWriter();\n\t\t} catch(IOException ioe ) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\topenWriter(true);\n\t\t} catch(IOException ioe ) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}", "@Override\n public void flush() throws IOException {\n byteBufferStreamOutput.flush();\n }", "public void flush() {\n writer.flush();\n }", "public void flush() {\n flushed = true;\n }", "public void flush() throws IOException {\n try {\n out.flush();\n } catch (IOException ioe) {\n String msg = \"Failed to flush \" + this;\n LOG.error(msg, ioe);\n throw new IOException(msg, ioe);\n }\n }", "public void flush() throws IOException {\n mPrintWriter.flush();\n }", "@Override\n public void flush()\n throws XMLStreamException\n {\n try {\n mWriter.flush();\n } catch (IOException ie) {\n throw new WstxIOException(ie);\n }\n }", "public void flush() throws IOException;", "public void flush() throws IOException;", "public void flush() throws IOException;", "public synchronized void flush() throws IOException {\n\t\tcheckNotClosed();\n\t\ttrimToSize();\n\t\tjournalWriter.flush();\n\t}", "public void flush();", "public void flush();", "public void flush();", "public void flush();", "public void flush() {\n\r\n int inflatedSize = buffer.position();\r\n deflator.setInput(buffer.getBuffer(), 0, inflatedSize);\r\n deflator.finish();\r\n int deflatedSize = deflator.deflate(compressionBuffer.array());\r\n deflator.reset();\r\n\r\n try {\r\n outputStream.writeInt(deflatedSize);\r\n outputStream.writeInt(inflatedSize);\r\n outputStream.write(compressionBuffer.array(), 0, deflatedSize);\r\n }\r\n catch (IOException e) {\r\n throw new RuntimeException(\"Failed to write compressed data to stream\", e);\r\n }\r\n\r\n buffer.clear();\r\n compressionBuffer.clear();\r\n }", "@Override\n\t\tpublic void flush() throws IOException {\n\t\t\twriteBlock(true);\n\t\t\tout.flush();\n\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\tif (debug) {\n\t\t\t\tlog.flush();\n\t\t\t}\n\t\t}", "@Override\n public void flush() throws IOException {\n checkStreamState();\n flushIOBuffers();\n }", "public void flush() throws IOException {\n\t\tmFile.seek(mOffset);\n\t\tmWriter.write(mBuffer, 0, mBufferLength);\n\t\tmOffset += mBufferLength;\n\t\tmBufferLength = 0;\n\t}", "public void flush()\r\n\tthrows IOException\r\n\t{\r\n\tgetWriter().flush();\r\n\treturn;\r\n\t}", "public void flush() {\n\t\t\n\t}", "public void flush()\n/* */ throws IOException\n/* */ {\n/* 833 */ _flushBuffer();\n/* 834 */ if ((this._writer != null) && \n/* 835 */ (isEnabled(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM))) {\n/* 836 */ this._writer.flush();\n/* */ }\n/* */ }", "private void flush() {\n try {\n output.write(digits);\n } catch (IOException e) {\n throw new RuntimeException(e.toString());\n }\n digits = 0;\n numDigits = 0;\n }", "public void flush(){\n\t\ttry{\n\t\t\tse.write(buffer, 0, bufferPos);\n\t\t\tbufferPos = 0;\n\t\t\tse.flush();\n\t\t}catch(IOException ioex){\n\t\t\tfailures = true;\n\t\t}\n\t}", "public abstract void flush();", "public void flush() throws IOException {\n\t\t// TODO implement me\n\t}", "public void flush() {\r\n\t\ttry {\r\n\t\t\tdos.flush();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void flush() throws IOException {\n if (firstMessage != null) {\n writer.messageWrite(firstMessage);\n }\n firstMessage = null;\n }", "@Override\r\n public synchronized void flush() throws IOException {\r\n\t\tif ( count != 0 ) {\r\n\t\t writeBuffer(buf, 0, count );\r\n\t\t count = 0;\r\n\t\t}\r\n\t}", "void flush() throws IOException;", "void flush() throws IOException;", "void flush() throws IOException;", "@Override\r\n public void flush ()\r\n {\r\n }", "public void flush() throws IOException {\n // nothing to do with cached bytes\n }", "public void flush(){\r\n mBufferData.clear();\r\n }", "@Override\n public void flush() throws IOException {\n }", "public void flush()\r\n {\r\n if ( content != null )\r\n {\r\n content.flush();\r\n }\r\n }", "@Override\r\n\tpublic void flush() {\n\t\t\r\n\t}", "@Override\n public void flush() {\n }", "@Override\n public void flush() {\n }", "@Override\n public void flush() {\n }", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "public synchronized void flush() throws IOException {\n if (sink != null) {\n synchronized (sink) {\n sink.notifyAll();\n }\n }\n }", "@Override\r\n\tpublic void flush() {\n\t}", "@Override\n public void flush()\n {\n }", "@Override\n\tpublic void flush() {\n\t}", "void flushToOutputStream(OutputStream outputStream) throws IOException;", "@Override\n\tpublic void flushBuffer() throws IOException {\n\t}", "@Override\n public void flush () throws IOException\n {\n if ((null == _topParts) || (null == _mmDelimiter))\n throw new EOFException(\"No parsing in progress to flush\");\n if (null == this.out)\n throw new EOFException(\"No underlying output stream to flush\");\n this.out.flush();\n }", "public void flush() {\n mMessages.postToServer();\n }", "public void flush() throws IOException {\n dos.flush();\n }", "public void flush() throws Exception{\r\n\tout.flush();\r\n}", "static public void flushPrintStream() {\n \t out.flush();\n }", "void flush() throws Exception;", "public void close() {\n try { out.flush(); } catch (Exception e) {}; // just to be sure\n \n cleanup();\n }", "private void flush() {\n try {\n final int flushResult = Mp3EncoderWrap.newInstance().encodeFlush(mp3Buffer);\n Log.d(TAG, \"===zhongjihao====flush mp3Buffer: \"+mp3Buffer+\" flush size: \"+flushResult);\n if (flushResult > 0) {\n mp3File.write(mp3Buffer, 0, flushResult);\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n mp3File.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n Log.d(TAG, \"===zhongjihao====destroy===mp3 encoder====\");\n Mp3EncoderWrap.newInstance().destroyMp3Encoder();\n }\n }", "protected void finish() {\n writerServerTimingHeader();\n\n try {\n\n // maybe nobody ever call getOutputStream() or getWriter()\n if (bufferedOutputStream != null) {\n\n // make sure the writer flushes everything to the underlying output stream\n if (bufferedWriter != null) {\n bufferedWriter.flush();\n }\n\n // send the buffered response to the client\n bufferedOutputStream.writeBufferTo(getResponse().getOutputStream());\n\n }\n\n } catch (IOException e) {\n throw new IllegalStateException(\"Could not flush response buffer\", e);\n }\n\n }", "public void flush() throws IOException {\n\t\tif ((buffer.length - cursor) > 50000) {\n\t\t\tSystem.out.println(\"WASTED: \" + (buffer.length - cursor));\n\t\t}\n\t}", "void flush() throws EDIStreamException;", "protected void deferFlush()\n {\n // push next flush out to avoid attempts at multiple simultaneous\n // flushes\n m_lNextFlush = Long.MAX_VALUE;\n }", "void flush() {\r\n synchronized (sync) {\r\n updatedFiles.clear();\r\n }\r\n }", "@Override\n public void flush() throws IOException {\n ConsoleRedirect.this.flush(buffer, 0, pos);\n pos = 0;\n }", "@Override\n public void flushBuffer() throws IOException {\n\n }", "public void close() {\n this.output.flush();\n this.output.close();\n }", "@Override\n public void close() throws IOException {\n flush();\n }", "public void flush() {\r\n if (SwingUtilities.isEventDispatchThread()) {\r\n flushImpl();\r\n } else {\r\n synchronized (this) {\r\n if (!flusherRunning) {\r\n SwingUtilities.invokeLater(flusher);\r\n flusherRunning = true;\r\n }\r\n }\r\n }\r\n }", "public void flush() {\n renderMesh();\n }", "public void flush () {\n\t\ttracker.flush();\n\t}", "public void flush () throws IOException\n {\n if (m_nBufferedBitCount > 0)\n {\n if (m_nBufferedBitCount != CGlobal.BITS_PER_BYTE)\n if (LOGGER.isDebugEnabled ())\n LOGGER.debug (\"Flushing BitOutputStream with only \" + m_nBufferedBitCount + \" bits\");\n m_aOS.write ((byte) m_nBuffer);\n m_nBufferedBitCount = 0;\n m_nBuffer = 0;\n }\n }", "public boolean isFlushed() {\n return flushed;\n }", "public void flushStreamSpecs();", "public void close() {\n if (this.out == null) {\n return;\n }\n try {\n this.out.flush();\n this.out.close();\n this.out = null;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void hflush() throws IOException {\n hsync();\n }", "@Override\n public void flush() throws IOException {\n FileDescriptor myFd = fd;\n if (myFd == null) throw new IOException(\"socket closed\");\n\n // Loop until the output buffer is empty.\n Int32Ref pending = new Int32Ref(0);\n while (true) {\n try {\n // See linux/net/unix/af_unix.c\n Os.ioctlInt(myFd, OsConstants.TIOCOUTQ, pending);\n } catch (ErrnoException e) {\n throw e.rethrowAsIOException();\n }\n\n if (pending.value <= 0) {\n // The output buffer is empty.\n break;\n }\n\n try {\n Thread.sleep(10);\n } catch (InterruptedException ie) {\n break;\n }\n }\n }", "@Override\n public void flush() {\n new QueueConsumer().run();\n }", "public void flush() {\r\n // Flushing is required only if there are written bytes in\r\n // the current data element.\r\n if (bytenum != 0) {\r\n data[offset] = elem;\r\n }\r\n }", "public void close() throws IOException\n {\n try\n {\n flush();\n }\n catch (IOException ignored)\n {\n // ignore\n }\n getStream().close();\n }", "public void flushBuffer() throws IOException {\n this.response.flushBuffer();\n }", "public void flush() throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n // the newline character should not be necessary. The PrintWriter\r\n // should autmatically put the newline, but it doesn't seem to work\r\n textArea.append(getBuffer().toString());\r\n if(System.getProperty(\"java.version\").startsWith(\"1.1\")){\r\n textArea.append(\"\\n\");\r\n }\r\n textArea.setCaretPosition(textArea.getDocument().getLength());\r\n buffer = new StringBuffer();\r\n }", "@Override\r\n public void flush() {\n\r\n }", "private void flushData()\n {\n try\n {\n while(state.get().ordinal() < SimulationState.TEARING_DOWN.ordinal() || !flushing.isEmpty())\n {\n ICardinality cardinality = flushing.poll(1, TimeUnit.MILLISECONDS);\n if (cardinality == null)\n continue;\n\n long numToFlush = cardinality.cardinality();\n counters.numFlushed.addAndGet(numToFlush);\n generateSSTables(cardinality, numToFlush, partitioner.getMinimumToken(), partitioner.getMaximumToken(), \"flushing\", true);\n }\n }\n catch (InterruptedException e)\n {\n logger.error(\"Exception happen during flushing\", e);\n }\n }", "private void flush() throws IOException {\n if (!rates.isEmpty()) {\n writeRates();\n rates.clear();\n firstBatch = false;\n }\n }", "@Override\r\n public void flush() {\n\r\n }", "public void flushEvent()\n throws SAXException;", "public synchronized void flush() throws java.io.IOException { throw new RuntimeException(\"Stub!\"); }", "private void flush() {\n\t\ttry {\n\t\t\tif (mResultSet != null) {\n\t\t\t\tmResultSet.close();\n\t\t\t}\n\n\t\t\tif (mStatement != null) {\n\t\t\t\tmStatement.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "@Override\r\n\tpublic void flushAll() {\n\t\t\r\n\t}" ]
[ "0.75294834", "0.73114276", "0.7289606", "0.7164379", "0.71445906", "0.70890856", "0.69873977", "0.68884796", "0.6833588", "0.682276", "0.68087804", "0.68087804", "0.68087804", "0.67931044", "0.6788341", "0.6788341", "0.6788341", "0.6788341", "0.6774422", "0.6735276", "0.67298067", "0.67288727", "0.67227405", "0.6709895", "0.6685825", "0.66590786", "0.6640151", "0.65943813", "0.6582967", "0.6569456", "0.65625983", "0.65571827", "0.6503751", "0.6503751", "0.6503751", "0.6501189", "0.64950365", "0.6469978", "0.6455921", "0.64457303", "0.6426386", "0.6366622", "0.6366622", "0.6366622", "0.63583386", "0.63583386", "0.63583386", "0.63583386", "0.63583386", "0.63583386", "0.63583386", "0.63583386", "0.63459563", "0.63459563", "0.63459563", "0.63459563", "0.63445306", "0.6313955", "0.6300498", "0.62420154", "0.61438936", "0.6136186", "0.6132334", "0.61221063", "0.61084384", "0.6072604", "0.60615736", "0.6058717", "0.6027275", "0.6025469", "0.5989358", "0.59513885", "0.5929456", "0.5918468", "0.59112567", "0.58858424", "0.5841442", "0.58395827", "0.58357805", "0.5834828", "0.58156145", "0.58095765", "0.57966805", "0.5789755", "0.57822776", "0.57738686", "0.574976", "0.57364774", "0.57201415", "0.57019556", "0.57016045", "0.5696319", "0.56905544", "0.5689429", "0.5670722", "0.566709", "0.56625575", "0.565407", "0.5644526", "0.5606351", "0.5587362" ]
0.0
-1
Closes the stream, flushing it first.
@Override public void close() throws IOException { debug("Dispose remote console server."); // this method tries its best and as a least resort uses thread interruption synchronized(this) { try { // try to break server.accept in order to force queue reading on thread Socket socket = new Socket(); socket.connect(new InetSocketAddress(port), 500); socket.close(); } catch(IOException e) { error(e); } queue.clear(); queue.offer(SHUTDOWN); try { wait(SHUTDOWN_TIMEOUT); } catch(InterruptedException unused) { thread.interrupt(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void closeStream() {\n output.close();\n input.close();\n }", "protected void closeStream ()\n {\n stream.close ();\n }", "public void closeStream() {\n\t\ttry {\n\t\t\tisReaderStatusClosed = true;\n\t\t\tif(buffReader != null) {\n\t\t\t\tbuffReader.close();\n\t\t\t}\n\t\t} catch(Exception e) { }\n\t}", "public void close ()\n {\n StreamHelper.flush (this);\n StreamHelper.close (m_aOS);\n m_aOS = null;\n }", "public void close() throws IOException\n {\n try\n {\n flush();\n }\n catch (IOException ignored)\n {\n // ignore\n }\n getStream().close();\n }", "public void close() {\n try { out.flush(); } catch (Exception e) {}; // just to be sure\n \n cleanup();\n }", "public void close() throws IOException {\n open = false;\n stream.close();\n }", "private void closeStream() throws IOException {\n if (originalInputStream != inputStream) {\n // Close the byte input stream or file input stream, if either is the current one\n inputStream.close();\n }\n\n if (closeOriginalStreamOnClose) {\n originalInputStream.close();\n }\n }", "@Override\n public void close() throws IOException {\n flush();\n }", "public void close() {\r\n\t\tflush();\r\n\t\ttry {\r\n\t\t\tdos.close();\r\n\t\t\ts.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "private void close() {\n try {\n if (reader != null) {\n this.reader.close();\n }\n if (writer != null) {\n this.writer.close();\n }\n }\n catch (IOException e) {\n log.error(e);\n log.debug(Constants.STREAM_IS_CLOSED);\n }\n }", "public void close() {\n this.output.flush();\n this.output.close();\n }", "public void finish( OutputStream stream ) throws IOException\n {\n }", "protected void close() {\n\t\tif(sOutput != null) {\n\t\t\ttry {\n\t\t\t\tsOutput.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"error closing output stream\");\n\t\t\t}\n\t\t\t\n\t\t\tsOutput = null;\n\t\t}\n\t}", "public static void end()\n {\n if(out!=null) {\n out.println(\"close \" + name);\n out.flush();\n }\n }", "public synchronized void close() throws IOException {\n\t\t\tfinish();\n\t\t\tout.close();\n\t\t}", "public void close() throws IOException {\n\t\tif (keyClass != null) {\n\t\t keySerializer.close();\n\t\t valueSerializer.close();\n\t\t}\n\n\t\t// Write EOF_MARKER for key/value length\n\t\tWritableUtils.writeVInt(out, EOF_MARKER);\n\t\tWritableUtils.writeVInt(out, EOF_MARKER);\n\t\tdecompressedBytesWritten += 2 * WritableUtils.getVIntSize(EOF_MARKER);\n \n\t\t//Flush the stream\n\t\tout.flush();\n \n\t\tif (compressOutput) {\n\t\t // Flush\n\t\t compressedOut.finish();\n\t\t compressedOut.resetState();\n\t\t}\n \n\t\t// Close the underlying stream iff we own it...\n\t\tif (ownOutputStream) {\n\t\t out.close();\n\t\t}\n\t\telse {\n\t\t // Write the checksum\n\t\t checksumOut.finish();\n\t\t}\n\n\t\tcompressedBytesWritten = rawOut.getPos() - start;\n\n\t\tif (compressOutput) {\n\t\t // Return back the compressor\n\t\t CodecPool.returnCompressor(compressor);\n\t\t compressor = null;\n\t\t}\n\n\t\tout = null;\n\t\tif(writtenRecordsCounter != null) {\n\t\t writtenRecordsCounter.increment(numRecordsWritten);\n\t\t}\n\t }", "public void close() throws IOException {\n\t\tout.flush();\n\t\tout.close();\n\t}", "public void flush() throws IOException\n {\n getStream().flush();\n }", "public void close()\n\t{\n\t\ttry { stream.close(); } catch(Exception ex1) {}\n\t\ttry { channel.close(); } catch(Exception ex2) {}\n\t}", "@Override\n public void close() {\n LOG.info(\"Closing stream writer:\" + streamName);\n shutdown();\n try {\n awaitTermination(1, TimeUnit.MINUTES);\n } catch (InterruptedException ignored) {\n }\n }", "public void close() {\n if (this.out == null) {\n return;\n }\n try {\n this.out.flush();\n this.out.close();\n this.out = null;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void close() throws IOException {\n if (sink != null) {\n sink.receivedLast();\n }\n }", "public void close() throws IOException {\n\t\tthis.finish();\n\t\tthis.buffer.close();\n\t\t}", "public void close()\n throws IOException\n {\n outstream.close();\n }", "private void close() {\n\t\tif (socketChannel != null) {\n\t\t\ttry {\n\t\t\t\tif (in != null) {\n\t\t\t\t\tin.close();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.log(Level.SEVERE, \"Close in stream \", e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (out != null) {\n\t\t\t\t\tout.close();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.log(Level.SEVERE, \"Close out stream \", e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tsocketChannel.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tlog.log(Level.SEVERE, \"Can't close socket channel\", ex);\n\t\t\t}\n\n\t\t}\n\t\t//Defender.stopConnection();\n\t}", "protected void onEndOfStream()\n {\n synchronized (f_aBuffSingleInbound)\n {\n synchronized (f_aBuffSingleOutbound)\n {\n if (f_engine.getSession().isValid())\n {\n try\n {\n f_engine.closeInbound();\n closeOutbound(false);\n }\n catch (SSLException e)\n {\n // mimicking SSLSocket\n }\n catch (IOException ignored)\n {\n // won't occur\n }\n }\n }\n }\n }", "public synchronized void close() {\n try {\n audioInputStream.close();\n } catch (IOException ioe) {\n System.err.println(\"Problem while closing the audioInputSteam\");\n }\n\n }", "public static void closeIO()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tinStream.close();\r\n\t\t\toutStream.close();\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}", "private void closeOutputStream() {\n\t\tPrintStreamManagement.closeOutputStream();\n\t}", "public void close() {\n if (numDigits > 0)\n flush();\n try {\n output.close();\n } catch (IOException e) {\n throw new RuntimeException(e.toString());\n }\n }", "@Override\n public void close() throws IOException {\n opened = false;\n if (socket != null) {\n Utils.closeSilent(dis);\n Utils.closeSilent(dos);\n socket.close();\n }\n }", "@Override\n public void close() {\n backingIterator.close();\n outputBuffer.close();\n isClosed = true;\n }", "public void close() throws IOException {\n\t\tistream.close();\n\t\tostream.close();\n\t\tsocket.close();\n\t}", "public void close()\r\n\t{\r\n\t if (isOpen()) try {\r\n\t \tfd.close();\r\n\t } catch (IOException ex) {\r\n\t \t/* do nothing */\r\n\t } finally {\r\n\t\t thisc = EOF;\r\n\t\t holdc = EOF;\r\n\t\t fd = null;\r\n\t }\r\n\t}", "@Override\n\t public synchronized void close() throws IOException {\n\t\tout.close();\n\t\topen = false;\n\t }", "protected void close()\n {\n out.close();\n }", "public void close() throws IOException {\n maxStreamPos = cache.length();\n\n seek(maxStreamPos);\n flushBefore(maxStreamPos);\n super.close();\n cache.close();\n cache = null;\n cacheFile.delete();\n cacheFile = null;\n stream.flush();\n stream = null;\n StreamCloser.removeFromQueue(closeAction);\n }", "public void close(){\n\t\ttry{\n\t\t\tflush();\n\t\t\tse.close();\n\t\t}catch(IOException ioex){\n\t\t\tfailures = true;\n\t\t}\n\t}", "public static void closeStreamAndForceCompleteResponse() throws IOException {\n FacesContext fc = FacesContext.getCurrentInstance();\n ExternalContext ex = Faces.getExternalContext();\n ex.getResponseOutputStream().flush();\n ex.getResponseOutputStream().close();\n fc.responseComplete();\n }", "@Override\n public void close() throws IOException {\n input.close();\n }", "public void close() {\n try {\n socket.close();\n outputStream.close();\n inputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void close() {\n\t\ttry {\n\t\t\t_inputStream.close();\n\t\t\t_outputStream.close();\n\t\t\t_socket.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private static void closeStream(@javax.annotation.Nullable Closeable stream) {\n if (stream != null) {\n try {\n stream.close();\n } catch (IOException e) {\n // ignore\n }\n }\n }", "@Override\n public void onClose() {\n logger.info(\"Closing {} streams for file {}\", this.getTransferType(), this.getResource().file);\n try {\n if (inputChannel != null) {\n inputChannel.close();\n inputChannel = null;\n inputBuffer.clear();\n inputBuffer = null;\n }\n if (outputStream != null) {\n outputStream.close();\n outputStream = null;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void close() throws IOException\n {\n InputStream in = _inputSource;\n\n if (in != null) {\n _inputSource = null;\n if (_autoClose) {\n in.close();\n }\n }\n freeBuffers();\n }", "private void close()\n {\n try\n {\n if (outputStream != null)\n {\n outputStream.close();\n }\n } catch (Exception e)\n {\n\n }\n try\n {\n if (inputStream != null)\n {\n inputStream.close();\n }\n } catch (Exception e)\n {\n\n }\n try\n {\n if (socket != null)\n {\n socket.close();\n }\n } catch (Exception e)\n {\n\n }\n }", "public void close() throws FormatException, IOException {\n if (in != null) in.close();\n in = null;\n currentId = null;\n }", "public void close() throws IOException {\n\t\tin.close();\n \n\t\t// Release the buffer\n\t\tdataIn = null;\n\t\tbuffer = null;\n\t\tif(readRecordsCounter != null) {\n\t\t readRecordsCounter.increment(numRecordsRead);\n\t\t}\n\n\t\t// Return the decompressor\n\t\tif (decompressor != null) {\n\t\t decompressor.reset();\n\t\t CodecPool.returnDecompressor(decompressor);\n\t\t decompressor = null;\n\t\t}\n\t }", "@Override\n\t public synchronized void close() throws IOException {\n\t\tin.close();\n\t\topen = false;\n\t }", "public void close() throws IOException {\n isClosed = true;\n inputStreamOpened = false;\n outputStreamOpened = false;\n parent.setInactive();\n }", "public void streamSubscriberClose(ISubscriberStream stream);", "@Override\n\tpublic void close() throws IOException {\n\t\tLog.d(TAG, \"rtsp data source close!\");\n\t\tif (_RtspClient != null) {\n\t\t\t_RtspClient.shutdown();\n\t\t}\n\t}", "private void closeStreams() {\n try {\n System.out.println(\"Closing streams and terminating thread.\");\n running = false;\n outputStream.close();\n inputStream.close();\n clientSocket.close();\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n }", "@Override\r\n\tpublic void finish() {\n\t\tsuper.finish();\r\n\t\tif(!s.isClosed()){\r\n\t\t\ttry {\r\n\t\t\t\ts.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void close() {\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void close() {\n this.output = null;\n }", "@Override\n public void close() throws IOException {\n isClosed = true;\n }", "@Override\n public void flush() throws IOException {\n byteBufferStreamOutput.flush();\n }", "public void ensureInputStreamClosed() {\n if (claimInputStream()) {\n try {\n Closeables.close(_stream, true);\n } catch (IOException e) {\n // Already caught and logged\n }\n }\n }", "@Override\n\t\tpublic void close() throws IOException {\n\t\t\tout.close();\n\t\t}", "public void flushStreamSpecs();", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; // indicate end of file\n zzEndRead = zzStartRead; // invalidate buffer\n\n if (zzReader != null) {\n zzReader.close();\n }\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; // indicate end of file\n zzEndRead = zzStartRead; // invalidate buffer\n\n if (zzReader != null) {\n zzReader.close();\n }\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n zzAtEOF = true; /* indicate end of file */\n zzEndRead = zzStartRead; /* invalidate buffer */\n\n if (zzReader != null)\n zzReader.close();\n }", "public final void yyclose() throws java.io.IOException {\n\t\tzzAtEOF = true; /* indicate end of file */\n\t\tzzEndRead = zzStartRead; /* invalidate buffer */\n\n\t\tif (zzReader != null)\n\t\t\tzzReader.close();\n\t}", "protected static void close(InputStream iStream, OutputStream oStream) throws\r\n IOException {\r\n try {\r\n if (iStream != null) {\r\n iStream.close();\r\n }\r\n }\r\n finally {\r\n if (oStream != null) {\r\n oStream.close();\r\n }\r\n }\r\n }", "@Override\n protected void done() throws IOException {\n if (this.closeable instanceof Flushable) {\n ((Flushable)((Object)this.closeable)).flush();\n }\n if (!this.ignoreCloseExceptions) {\n this.closeable.close();\n return;\n }\n try {\n this.closeable.close();\n return;\n }\n catch (IOException iOException) {\n return;\n }\n }", "@Override\n public void close() throws IOException\n {\n _out.close();\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "public final void yyclose() throws java.io.IOException {\r\n zzAtEOF = true; /* indicate end of file */\r\n zzEndRead = zzStartRead; /* invalidate buffer */\r\n\r\n if (zzReader != null)\r\n zzReader.close();\r\n }", "@Override\n public void close() throws IOException\n {\n try\n {\n fAVMRemote.closeInputHandle(fTicketHolder.getTicket(), fHandle);\n }\n catch (Exception e)\n {\n throw new IOException(\"Remote Error closing input stream.\");\n }\n }", "private void closeStreams() {\n try {\n windowForCommunication.append(\"Closing connection now.\" + \"\\n\");\n sendMessageToClient(\"ENDING CHAT: Closing connection now\");\n input.close();\n output.close();\n serverSocket.close();\n }\n catch(IOException e) {\n System.out.println(e);\n windowForCommunication.append(\"Uh oh. Seems like there was a communication error....!\");\n }\n }", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;" ]
[ "0.742372", "0.73023313", "0.7160331", "0.70681417", "0.69970876", "0.67976123", "0.66543734", "0.6564473", "0.64817876", "0.64380145", "0.64156985", "0.6405659", "0.6285523", "0.627561", "0.62693334", "0.625075", "0.6232578", "0.6231858", "0.62049574", "0.61861706", "0.6165183", "0.6131752", "0.6110503", "0.6102961", "0.6097", "0.60851914", "0.60779613", "0.60685843", "0.60683024", "0.605122", "0.60451406", "0.6008812", "0.59965706", "0.5992124", "0.59849584", "0.5956828", "0.59553033", "0.595342", "0.594544", "0.5904884", "0.5903145", "0.59031266", "0.58971876", "0.586967", "0.58621657", "0.5832557", "0.5828823", "0.5817927", "0.58101285", "0.5799819", "0.57972056", "0.5773901", "0.5773007", "0.57718617", "0.5770487", "0.5762706", "0.5761155", "0.57469195", "0.57388914", "0.5734517", "0.57253873", "0.5722466", "0.5714114", "0.5714114", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56946594", "0.56923014", "0.5680454", "0.56773937", "0.56766343", "0.56674135", "0.56674135", "0.56674135", "0.56674135", "0.56674135", "0.566428", "0.5662045", "0.5660415", "0.5660415", "0.5660415" ]
0.0
-1
internal logging helpers uses log4j internal logger LogLog in order to avoid circular dependencies Internal debug message.
private static void debug(String message, Object... args) { StatusLogger.getLogger().debug(String.format(message, args)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "protected static Logger log() {\n return LogSingleton.INSTANCE.value;\n }", "abstract protected void logInternal(int level, String message);", "private void debugLog(String msg)\n {\n m_log.log(\"[\" + m_appName + \"] :\" + msg);\n }", "private Log() {\r\n\t}", "private static void _logInfo ()\n {\n System.err.println (\"Logging is enabled using \" + log.getClass ().getName ());\n }", "protected void log(Object msg) {\n\t\n\t\tSystem.out.println(\"MusicDataAccessor: \" + msg);\n\t}", "protected void initLogger() {\n initLogger(\"DEBUG\");\n }", "@Override\n public void log()\n {\n }", "abstract void initiateLog();", "public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}", "private static void log_d( String msg ) {\n\t if (D) Log.d( TAG, TAG_SUB + \" \" + msg );\n}", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "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}", "private void log_d( String msg ) {\n\t if (D) Log.d( TAG, TAG_SUB + \" \" + msg );\n}", "final void out (String msg) { if (m_debugMode) { Logger.println (msg); } }", "private Log getLog(final String key) {\r\n Log l = this.logs.get(key);\r\n\r\n if (l == null) {\r\n l = LogFactory.getLog(key);\r\n\r\n if (l != null) {\r\n this.addLog(key, l);\r\n } else {\r\n throw new IllegalStateException(\"LogUtil : Log4J is not initialized correctly : missing logger [\" + key + \"] = check the log4j configuration file (log4j.xml) !\");\r\n }\r\n }\r\n\r\n return l;\r\n }", "void initializeLogging();", "@Override\n\t\t\t\t\t\t\tpublic void log(String msg, int level, Date date, StackTraceElement trace) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "void log(Log log);", "private void log(String msg) {\r\n\t\tif (logger != null) {\r\n\t\t\tlogger.append(msg);\r\n\t\t\tlogger.println();\r\n\t\t}\r\n\t}", "private ExtentLogger() {}", "private final Log getLogBase() {\r\n return this.logBase;\r\n }", "private void setupLogging() {\n\t\t// Ensure all JDK log messages are deferred until a target is registered\n\t\tLogger rootLogger = Logger.getLogger(\"\");\n\t\tHandlerUtils.wrapWithDeferredLogHandler(rootLogger, Level.SEVERE);\n\n\t\t// Set a suitable priority level on Spring Framework log messages\n\t\tLogger sfwLogger = Logger.getLogger(\"org.springframework\");\n\t\tsfwLogger.setLevel(Level.WARNING);\n\n\t\t// Set a suitable priority level on Roo log messages\n\t\t// (see ROO-539 and HandlerUtils.getLogger(Class))\n\t\tLogger rooLogger = Logger.getLogger(\"org.springframework.shell\");\n\t\trooLogger.setLevel(Level.FINE);\n\t}", "private static final Logger getLog4JLogger(final Log l) {\r\n return ((org.apache.commons.logging.impl.Log4JLogger) l).getLogger();\r\n }", "private static final void log(String msg) {\n\t\tlog.println(msg);\n\t}", "private Log() {\n }", "private static void LOG(String msg) {\n if ( DEBUG ) {\n Log.d(TAG, msg);\n }\n }", "@Override\n public void logs() {\n \n }", "private void debug(String msg) {\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(msg);\r\n }\r\n }", "final void out (String msg1, String msg2) { if (m_debugMode) { Logger.print (msg1); Logger.println (msg2); } }", "private void init() {\r\n this.log = this.getLog(LOGGER_MAIN);\r\n\r\n if (!(this.log instanceof org.apache.commons.logging.impl.Log4JLogger)) {\r\n throw new IllegalStateException(\r\n \"LogUtil : apache Log4J library or log4j.xml file are not present in classpath !\");\r\n }\r\n\r\n // TODO : check if logger has an appender (use parent hierarchy if needed)\r\n if (this.log.isWarnEnabled()) {\r\n this.log.warn(\"LogUtil : logging enabled now.\");\r\n }\r\n\r\n this.logBase = this.getLog(LOGGER_BASE);\r\n this.logDev = this.getLog(LOGGER_DEV);\r\n }", "protected abstract Logger getLogger();", "Appendable getLog();", "public Log(Logger logger) {\n this.logger = logger;\n }", "protected void log(String msg) {\n\t\tif(isLogging) {\n\t\t\tSystem.out.println(\"[TRACKER \" + id() + \"] \" + msg);\n\t\t}\n\t}", "@SuppressWarnings(\"unused\")\n protected void debug(String msg) {\n if (this.getContainer() != null && this.getContainer().getLogger().isDebugEnabled()) {\n this.getContainer().getLogger().debug(msg);\n }\n }", "@Override\n\tpublic void initLogger() {\n\t\t\n\t}", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "private final Log getLog() {\r\n return this.log;\r\n }", "private static Logger getLogger() {\n return LogDomains.getLogger(ClassLoaderUtil.class, LogDomains.UTIL_LOGGER);\n }", "private TypicalLogEntries() {}", "@Override\n protected void log(String tag, String msg) {\n Log.i(tag, \"[you can use your custom logger here \\\"]\" + msg);\n }", "@Override\n protected Logger getLogger() {\n return LOGGER;\n }", "protected abstract ILogger getLogger();", "protected static void logAndPrint(Logger logger, String msg) {\n\t\tSystem.out.println(msg);\n\t\tlogger.debug(msg);\n\t}", "private LogUtil() {\r\n /* no-op */\r\n }", "private Logger getLogger() {\n return LoggingUtils.getLogger();\n }", "private JavaUtilLogHandlers() { }", "public void setLogUtilities(LogUtilities log) { this.log = log; }", "public static Log getLoggerDev() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLogDev();\r\n }\r\n return l;\r\n }", "public void customLogger() {\n KOOM.getInstance().setLogger(new KLog.KLogger() {\n @Override\n public void i(String TAG, String msg) {\n //get the log of info level\n }\n\n @Override\n public void d(String TAG, String msg) {\n //get the log of debug level\n }\n\n @Override\n public void e(String TAG, String msg) {\n //get the log of error level\n }\n });\n }", "@Override\n public void initializeLogging() {\n // Wraps Android's native log framework.\n LogWrapper logWrapper = new LogWrapper();\n // Using Log, front-end to the logging chain, emulates android.util.log method signatures.\n Log.setLogNode(logWrapper);\n\n // Filter strips out everything except the message text.\n MessageOnlyLogFilter msgFilter = new MessageOnlyLogFilter();\n logWrapper.setNext(msgFilter);\n\n // On screen logging via a fragment with a TextView.\n //LogFragment logFragment = (LogFragment) getSupportFragmentManager()\n // .findFragmentById(R.id.log_fragment);\n //msgFilter.setNext(logFragment.getLogView());\n\n mLogFragment = (LogFragment) getSupportFragmentManager()\n .findFragmentById(R.id.log_fragment);\n msgFilter.setNext(mLogFragment.getLogView());\n\n Log.i(TAG, \"Ready\");\n }", "public interface LoggerUtil {\n\t/**\n\t * Set the logger for the controller\n\t * \n\t * @param logName\n\t * @param filePath\n\t * @param logLevel\n\t * @return\n\t */\n\tLogger loggerArrangement(String logName, String filePath, LogeLevel logLevel);\n}", "public Logger log() {\n return LOG;\n }", "public static Log getLoggerBase() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLogBase();\r\n }\r\n return l;\r\n }", "private static Log getLog() {\n if (log == null) {\n log = new SystemStreamLog();\n }\n\n return log;\n }", "private void doIt() {\n\t\tlogger.debug(\"hellow this is the first time I use Logback\");\n\t\t\n\t}", "public Logger getLogger()\n/* */ {\n/* 77 */ if (this.logger == null) {\n/* 78 */ this.logger = Hierarchy.getDefaultHierarchy().getLoggerFor(this.name);\n/* */ }\n/* 80 */ return this.logger;\n/* */ }", "@Override\n\tprotected Logger getLogger() {\n\t\treturn HMetis.logger;\n\t}", "protected final LogTarget getLogTarget() \n {\n return m_wrappedLogTarget; \n }", "private DAOLogger() {\n\t}", "public interface Log {\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param handler 添加handler.\n * @author admin\n */\n default void addHandler(Handler handler) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param newLevel 设置日志级别.\n * @throws SecurityException 抛出安全异常.\n * @author admin\n */\n default void setLevel(final Level newLevel) throws SecurityException {\n //\n }\n\n /**\n * 信息日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void info(final String message, final Object... args);\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void info(final String message);\n\n /**\n * 详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void debug(final String message, final Object... args);\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void debug(final String message);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void trace(final String message, final Object... args);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void trace(final String message);\n\n /**\n * 警告日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void warn(final String message, final Object... args);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void warn(final String message);\n\n /**\n * 严重日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void error(final String message, final Object... args);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void error(final String message);\n\n /**\n * 致命错误日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void fatal(final String message, final Object... args);\n\n /**\n * 致命错误日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void fatal(final String message);\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param args 日志传递进来的参数.\n * @param message 日志消息.\n * @author admin\n */\n default void off(final String message, final Object... args) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n default void off(final String message) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param args 日志传递进来的参数.\n * @param message 日志消息.\n * @author admin\n */\n default void all(final String message, final Object... args) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n default void all(final String message) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param args 日志传递进来的参数.\n * @param message 日志消息.\n * @author admin\n */\n default void config(final String message, final Object... args) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n default void config(final String message) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @return 是否开启调试.\n * @author admin\n */\n default boolean isDebugEnabled() {\n return false;\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @return 是否开启Info.\n * @author admin\n */\n default boolean isInfoEnabled() {\n return false;\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @return 是否开启Warn.\n * @author admin\n */\n default boolean isWarnEnabled() {\n return false;\n }\n}", "public static final void debug(@org.jetbrains.annotations.NotNull org.jetbrains.anko.AnkoLogger r4, @org.jetbrains.annotations.Nullable java.lang.Object r5, @org.jetbrains.annotations.Nullable java.lang.Throwable r6) {\n /*\n r3 = \"$receiver\";\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r4, r3);\n r0 = 3;\n r2 = r4.getLoggerTag();\n r3 = android.util.Log.isLoggable(r2, r0);\n if (r3 == 0) goto L_0x0025;\n L_0x0011:\n if (r6 == 0) goto L_0x002a;\n L_0x0013:\n if (r5 == 0) goto L_0x0026;\n L_0x0015:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x0026;\n L_0x001b:\n r6 = (java.lang.Throwable) r6;\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.d(r1, r3, r6);\n L_0x0025:\n return;\n L_0x0026:\n r3 = \"null\";\n goto L_0x001b;\n L_0x002a:\n if (r5 == 0) goto L_0x003b;\n L_0x002c:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x003b;\n L_0x0032:\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.d(r1, r3);\n goto L_0x0025;\n L_0x003b:\n r3 = \"null\";\n goto L_0x0032;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jetbrains.anko.Logging.debug(org.jetbrains.anko.AnkoLogger, java.lang.Object, java.lang.Throwable):void\");\n }", "@Override\n\tpublic void debug(MessageSupplier msgSupplier) {\n\n\t}", "private void initLog() {\n _logsList = (ListView) findViewById(R.id.lv_log);\n setupLogger();\n }", "private void initLogger(BundleContext bc) {\n\t\tBasicConfigurator.configure();\r\n\t\tlogger = Logger.getLogger(Activator.class);\r\n\t\tLogger.getLogger(\"org.directwebremoting\").setLevel(Level.WARN);\r\n\t}", "private static void log(String msg) {\n Log.d(LOG_TAG, msg);\n }", "public abstract void logd(String str);", "void log();", "public void log(String msg) {\n\n\t}", "ExtendedCommonLogger() {\n this.msgbuf = new byte[128];\n }", "private static void longer_logmsg_Log4j(Logger log, Object msg, Throwable ex, int id, \n String original_methname, Object msg_modified) {\n\n Level level = Level.toLevel(original_methname);\n boolean legacyEnabled = log.isEnabledFor(level);\n int printResult = shouldPrint(id, legacyEnabled);\n if( (printResult & LOG_OUT) != 0) {\n /*LEVS methname = getWarnLevel(id);\n if(methname == null)\n methname = setMeth(id, original_methname);\n Level level = Level.toLevel(methname.toString());*/\n if(msg_modified == null)\n msg_modified = taggedID(id) + msg;\n \n String logname = log.getName();\n\n log.callAppenders(\n new org.apache.log4j.spi.LoggingEvent(logname, log, level, msg_modified, ex));\n }\n if( (printResult & RECORD_OUT) != 0)\n RecordStatements.record(id, original_methname, msg, ex);\n }", "@Override\n\tpublic void log(String msg) throws IOException {\n\t\t\n\t}", "@Override\n public void log(String message) {\n }", "protected abstract void debug(String msg);", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void setLOG(Logger newLog)\r\n\t{\r\n\t\tlog = newLog;\r\n\t}", "private static void initLog() {\n LogManager.mCallback = null;\n if (SettingsManager.getDefaultState().debugToasts) {\n Toast.makeText(mContext, mContext.getClass().getCanonicalName(), Toast.LENGTH_SHORT).show();\n }\n if (SettingsManager.getDefaultState().debugLevel >= LogManager.LEVEL_ERRORS) {\n new TopExceptionHandler(SettingsManager.getDefaultState().debugMail);\n }\n //Si hubo un crash grave se guardo el reporte en el sharedpreferences, por lo que al inicio\n //levanto los posibles crashes y, si el envio por mail está activado , lo envio\n String possibleCrash = StoreManager.pullString(\"crash\");\n if (!possibleCrash.equals(\"\")) {\n OtherAppsConnectionManager.sendMail(\"Stack\", possibleCrash, SettingsManager.getDefaultState().debugMailAddress);\n StoreManager.removeObject(\"crash\");\n }\n }", "public void debug(Object message)\n/* */ {\n/* 118 */ if (message != null) {\n/* 119 */ getLogger().debug(String.valueOf(message));\n/* */ }\n/* */ }", "@Override\r\n\tpublic Log getLog() {\n\t\treturn log;\r\n\t}", "private static void log(String aMsg){\n\t System.out.println(aMsg);\n\t }", "public void setLog (Logger log) {\n this.log = log;\n }", "public Log log() {\n return _log;\n }", "@Override\n public boolean isDebugEnabled() {\n return innerLog.isDebugEnabled();\n }", "private final Log getLogDev() {\r\n return this.logDev;\r\n }", "public void logthis(String msg) {\n logger.append(msg + \"\\n\");\n Log.d(TAG, msg);\n }", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "private void addLog(String log) {\n LogHelper.addIdentificationLog(log);\n }", "abstract protected void _log(TrackingActivity activity) throws Exception;", "IFileLogger log();", "private void initLoggers() {\n _logger = LoggerFactory.getInstance().createLogger();\n _build_logger = LoggerFactory.getInstance().createAntLogger();\n }", "public static final void debug(@org.jetbrains.annotations.NotNull org.jetbrains.anko.AnkoLogger r2, @org.jetbrains.annotations.NotNull kotlin.jvm.functions.Function0<? extends java.lang.Object> r3) {\n /*\n r1 = \"$receiver\";\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r2, r1);\n r1 = \"message\";\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r3, r1);\n r0 = r2.getLoggerTag();\n r1 = 3;\n r1 = android.util.Log.isLoggable(r0, r1);\n if (r1 == 0) goto L_0x0026;\n L_0x0017:\n r1 = r3.invoke();\n if (r1 == 0) goto L_0x0027;\n L_0x001d:\n r1 = r1.toString();\n if (r1 == 0) goto L_0x0027;\n L_0x0023:\n android.util.Log.d(r0, r1);\n L_0x0026:\n return;\n L_0x0027:\n r1 = \"null\";\n goto L_0x0023;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jetbrains.anko.Logging.debug(org.jetbrains.anko.AnkoLogger, kotlin.jvm.functions.Function0):void\");\n }", "@Override\n\tpublic void debug(Message msg) {\n\n\t}", "public Logger getLog () {\n return log;\n }", "public interface ILog {\n\n /**\n * Send an information level log message, used by time-related log.\n *\n * @param tag Used to identify the source of a log message. It usually identifies\n * the class or activity where the log call occurs.\n * @param msg The message you would like logged.\n */\n void info(String tag, String msg);\n\n\n /**\n * Send an warning level log message, used by exception-related log.\n *\n * @param tag Used to identify the source of a log message. It usually identifies\n * the class or activity where the log call occurs.\n * @param msg The message you would like logged.\n */\n void warn(String tag, String msg);\n}", "protected Log getLogger() {\n return LOGGER;\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 void logDebug(String str) {\n }" ]
[ "0.6820123", "0.6780879", "0.671974", "0.6700964", "0.6637071", "0.6519738", "0.64312446", "0.6427003", "0.6338282", "0.63056445", "0.63048685", "0.6277209", "0.6267726", "0.6261081", "0.62280333", "0.62098986", "0.62031895", "0.62021124", "0.6188186", "0.6185712", "0.61808074", "0.6173148", "0.61684114", "0.61620116", "0.6149724", "0.61394423", "0.6131203", "0.6126038", "0.6125655", "0.61103153", "0.60740346", "0.60644716", "0.60558945", "0.60552174", "0.6040714", "0.602795", "0.6027447", "0.6012363", "0.6003667", "0.6002481", "0.60000324", "0.59520453", "0.5950816", "0.5943747", "0.5943327", "0.5938905", "0.59330547", "0.59322", "0.5926746", "0.5911022", "0.5910872", "0.5907544", "0.59022284", "0.5900104", "0.58992976", "0.58850825", "0.58835894", "0.58791417", "0.5876871", "0.5872153", "0.58668643", "0.58631444", "0.5860514", "0.58594924", "0.5855271", "0.5853562", "0.58470654", "0.58426034", "0.58406985", "0.5839392", "0.58353657", "0.58332574", "0.58315", "0.5822201", "0.58180743", "0.5817632", "0.58174103", "0.58174103", "0.58174103", "0.5813102", "0.5812082", "0.5806511", "0.580503", "0.5802578", "0.58003616", "0.57885253", "0.5786708", "0.5786249", "0.5776296", "0.5762361", "0.5757521", "0.57560074", "0.57535243", "0.57535195", "0.57526743", "0.5750215", "0.5749337", "0.5740211", "0.5735069", "0.57341754", "0.57252127" ]
0.0
-1
also needs to path auth
@GetMapping("/info") public String info(){ return "info"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean authNeeded();", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "boolean hasAuth();", "private void authenticate(String user, String pass) {\n }", "@Override\n protected void configure(AuthenticationManagerBuilder auth) {\n }", "@Override\n protected void afterAuthenticating() {\n }", "@GetMapping(\"/\")\n\tpublic String auth() throws IOException \n\t{\n\t\t/* Returns to home.html : index.html */\n\t\treturn appservice.authentication() ? \"application.html\" : \"log.html\";\n\t}", "private void loginHandler(RoutingContext context) {\n JsonObject creds = new JsonObject()\n .put(\"username\", context.getBodyAsJson().getString(\"username\"))\n .put(\"password\", context.getBodyAsJson().getString(\"password\"));\n\n // TODO : Authentication\n context.response().setStatusCode(500).end();\n }", "private AppAuth() {\n }", "@Override\n\tpublic void credite() {\n\t\t\n\t}", "private void authorize() {\r\n\r\n\t}", "private boolean authenticatedUser(String uName, String pass) {\n\t\treturn true;\n\t}", "protected void login() {\n\t\t\r\n\t}", "@Override\n protected void configure(AuthenticationManagerBuilder auth) throws Exception {\n auth.inMemoryAuthentication()\n .withUser(\"ahmed\")\n .password(\"123456\")\n .roles(\"admin\");\n }", "boolean isAuthenticated();", "public boolean isAuthRequired() {\n\t\treturn false;\n\t}", "private void authenticateAction() {\n if (requestModel.getUsername().equals(\"superuser\")\n && requestModel.getPassword().equals(\"\")) {\n Collection<Webres> webres = getAllWebres();\n proceedWhenAuthenticated(new User(null, null, null, \"superuser\", \"\", null) {\n @Override\n public Collection<Webres> getAllowedResources() {\n return webres;\n }\n @Override\n public ActionController getDefaultController() {\n return ActionController.EMPLOYEES_SERVLET;\n }\n });\n return;\n }\n \n // try to authenticate against other credentials from the database\n Optional<User> u = getUserByCredentials(requestModel.getUsername(), requestModel.getPassword()); \n if (u.isPresent()) {\n proceedWhenAuthenticated(u.get());\n return;\n }\n \n // report authentication failed\n LOG.log(Level.INFO, \"{0} Authentication failed. Login: {1}, Password: {2}\", new Object[]{httpSession.getId(), requestModel.getUsername(), requestModel.getPassword()});\n SignInViewModel viewModel = new SignInViewModel(true);\n renderSignInView(viewModel);\n }", "@Override\n public JsonResponse duringAuthentication(String... params) {\n try {\n final String username = params[0];\n final String password = params[1];\n return RequestHandler.authenticate(this.getApplicationContext(), username, password);\n } catch (IOException e) {\n return null;\n }\n }", "public boolean auth() throws IOException {\r\n \treturn auth(false);\r\n }", "public User doAuthentication(String account, String password);", "@Override\n protected void configure(AuthenticationManagerBuilder auth) {\n auth.authenticationProvider(authProvider);\n }", "@Override\n protected void configure(AuthenticationManagerBuilder auth) throws Exception {\n auth.inMemoryAuthentication()\n .withUser(\"user1\").password(\"secret1\").roles(\"USER\");\n }", "public void setAuth(int pAuth){\n this.auth = pAuth;\n }", "@Override\n public void showAuthScreen() {\n }", "@Override\n public boolean auth(String email, String pseudonyme) {\n Properties props = new Properties();\n props.setProperty(\"org.omg.CORBA.ORBInitialHost\", \"localhost\");\n props.setProperty(\"org.omg.CORBA.ORBInitialPort\", \"3700\");\n props.setProperty(\"java.naming.factory.initial\", \"com.sun.enterprise.naming.SerialInitContextFactory\");\n props.setProperty(\"java.naming.factory.url.pkgs\", \"com.sun.enterprise.naming\");\n props.setProperty(\"java.naming.factory.state\", \"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl\");\n \n StatelessDirectoryManagerBeanRemote sb = null;\n InitialContext ic;\n \n try {\n ic = new InitialContext(props);\n sb = (StatelessDirectoryManagerBeanRemote)ic.lookup(\"com.master2.datascale.directorymanager.bean.StatelessDirectoryManagerBeanRemote\");\n\t\t\t\n } catch (NamingException ex) {\n Logger.getLogger(StatefulAuctionManagerBean.class.getName()).log(Level.SEVERE, null, ex);\n }\n\t\t\t\n return sb.auth(email, pseudonyme);\n }", "@Override\n\tpublic Authentication authenticate(Authentication auth) throws AuthenticationException {\n\t\t username = auth.getName();\n\t\tString pass = auth.getCredentials().toString();\n\t\t\n\t\tif(AppController.users.containsKey(username))\n\t\t{\n\t\tString password = AppController.users.get(username); \n\t\t\t\n\t\tif(password.equals(pass))\n\t\t\treturn new UsernamePasswordAuthenticationToken(username,pass,Collections.EMPTY_LIST);\n\t\telse\n\t\t\tthrow new BadCredentialsException(\"authentication failed\");\n\t\t\n\t\t}\n\t\telse\n\t\t\tthrow new BadCredentialsException(\"authentication failed\");\n\t}", "protected abstract String getAuthorization();", "final void setAuthentication(boolean required)\r\n {\r\n requires_AUT = required;\r\n }", "abstract public boolean checkAuth(String userId) throws IOException;", "@Override\n\tpublic User auth()\n\t{\n\t\treturn this.user;\n\t}", "@Override\r\n\tprotected void configure(AuthenticationManagerBuilder auth) throws Exception {\n\t\tauth.inMemoryAuthentication().withUser(\"purna\").password(\"purna43$\").roles(\"USER\")\r\n\t\t.and().withUser(\"chandu\").password(\"chandu43$\").roles(\"ADMIN\");\r\n\t}", "private void checkAuthAtMain() {\n val auth = config.getString(\"authAtMain\");\n\n checkArgument(auth.length() > 10, \"auth string (at-main) length is less than or equal to 10!\");\n }", "public void handleAuthenticationRequest(RoutingContext context) {\n\n final HttpServerRequest request = context.request();\n\n final String basicAuthentication = request.getHeader(AUTHORIZATION_HEADER);\n\n try {\n\n final String[] auth =\n BasicAuthEncoder.decodeBasicAuthentication(basicAuthentication).split(\":\");\n\n if (auth.length < 2) {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, HTML_CONTENT_TYPE)\n .end(Json.encode(Errors.CREDENTIAL_ERROR.error()));\n\n } else {\n\n final Credential credential = new Credential(auth[0], auth[1]);\n\n authenticationService.authenticate(credential, user -> {\n\n if (null != user) {\n\n tokenService.generateToken(user, token -> {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, HTML_CONTENT_TYPE).end(token);\n\n }, err -> {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(Errors.INTERNAL_ERROR.error()));\n\n });\n\n } else {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(Errors.CREDENTIAL_ERROR.error()));\n\n }\n\n }, err -> {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(err.toError()));\n\n });\n\n\n }\n\n } catch (final Exception e) {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(Errors.INVALID_AUTHENTICATION_TOKEN.error()));\n\n\n }\n\n\n\n }", "private void signIn() {\n }", "@Override\n protected void configure(AuthenticationManagerBuilder auth) throws Exception {\n auth.inMemoryAuthentication()\n .withUser(\"user\").password(\"{noop}user\").roles(\"USER\")\n .and()\n .withUser(\"admin\").password(\"{noop}admin\").roles(\"ADMIN\", \"USER\");\n }", "@Override\npublic boolean supports(Class<?> authentication) {\n return true;\n}", "private AuthenticationService() {}", "@Override\n\tprotected void configure(AuthenticationManagerBuilder auth) throws Exception {\n\t\tauth.inMemoryAuthentication().withUser(\"nandy@yahoo.in\").password(\"{noop}12345\").roles(\"USER\");\n\t}", "UserPermissions authenticate (Request request);", "protected abstract void appendRootUri(StringBuilder buffer, boolean addPassword);", "@Override\n public void onAuthenticationFailed() {\n }", "@Test\n public void testAddDemotivatorPageRequiresAuthentication(){\n \tResponse response = GET(\"/add\");\n \n assertNotNull(response);\n assertStatus(302, response);\n \n assertHeaderEquals(\"Location\", \"/secure/login\", response);\n }", "@Override\n protected void configure(AuthenticationManagerBuilder auth) throws Exception {\n\n //CREATE USERS\n auth.inMemoryAuthentication().withUser(\"myadmin\").password(\"{noop}myadminpassword\").roles(\"ADMIN\");\n auth.inMemoryAuthentication().withUser(\"myuser\" ).password(\"{noop}myuserpassword\" ).roles(\"USER\" );\n\n }", "public interface AuthService {\n void init();\n boolean login(HttpServletRequest request, String user, String password);\n\n void logout(HttpServletRequest request);\n\n boolean register(User user);\n\n\n User checkLogin(String username, String password);\n}", "@Override\n\tprotected String url() {\n\t\treturn \"user\";\n\t}", "public interface IAuthService {\n AuthInfo getAuthentication(String username, String password);\n}", "@Given(\"^The app (.+) auth (.+) and (.+)$\")\n\tpublic void the_app_auth_and(String url, String username, String password) throws IOException {\n\t\tLOGGER.info(\"Starting to test the Basic Auth \");\n\t\tboolean turnOffSSL = url.contains(\"8443\")?true:false;\n\t\trestTemplate = RestTemplateUtils.newRestTemplate(turnOffSSL);\n\t\trestTemplate.getInterceptors().add(CPEHeaderInterceptor.Builder.fromBasicAuth(username, password).build());\n\t\tthis.url = url;\n\t}", "public Authentification() {\n initComponents();\n }", "@Override\r\n\tpublic void onAuthenticationSuccess(HttpServletRequest req, HttpServletResponse res,\r\n\t\t\tAuthentication auth) throws IOException, ServletException {\n\t\tlogger.info(\"Login Success !\");\r\n\t\tlogger.info(\"Login ID [ {} ].\",auth.getName());\r\n\t\t\r\n\t\tfor(GrantedAuthority a : auth.getAuthorities()) {\r\n\t\t\tlogger.info(\"authority = [ {} ].\",a.getAuthority());\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(auth.getDetails().toString());\r\n\t\tlogger.info(auth.getPrincipal().toString());\r\n\t\t\r\n\t\tUserDetails u = (UserDetails)auth.getPrincipal();\r\n\t\t\r\n\t\tlogger.info(String.valueOf(u.isAccountNonExpired()));\r\n\t\t\r\n\t\tlogger.info(\"sending URL..\");\r\n\t\t\r\n\t\tclearAuthenticationAttributes(req);\r\n\t\t\r\n\t\tint intRedirectStrategy = decideRedirectStrategy(req, res);\r\n\t\t\r\n\t\tswitch(intRedirectStrategy) {\r\n\t\t\r\n\t\tcase 1:\r\n\t\t\tuseTargetUrl(req, res);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 2:\r\n\t\t\tuseSessionUrl(req, res);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 3:\r\n\t\t\tuseRefererUrl(req, res);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tdefault:\r\n\t\t\tuseDefaultUrl(req, res);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "protected EscidocAuthenticationProvider() {\r\n }", "@Test\n public void basicAuthentication() {\n RestAssured.given().auth().basic(\"admin\",\"admin\").when().get(\"https://the-internet.herokuapp.com/basic_auth\").\n then().assertThat().statusCode(200);\n\n //api key is one type of authentication, we can also be authenticated by providing a name and password.\n }", "public interface AuthManager\n{\n void checkAuthAnnounce(Id<Node> nodeId, DynamicAnnouncement announcement, HttpServletRequest request);\n\n void checkAuthDelete(Id<Node> nodeId, HttpServletRequest request);\n\n void checkAuthReplicate(HttpServletRequest request);\n}", "@Override\n\tpublic void setAuthProvider(AuthProvider arg0) {\n\t}", "@RequestMapping(\"/auth\") \r\n\tpublic String redirect(Model model,HttpServletRequest httpRequest) { \r\n\t\t String path = httpRequest.getContextPath();\r\n\t String basePath = httpRequest.getScheme()+\"://\"+httpRequest.getServerName()+\":\"+httpRequest.getServerPort()+path; \r\n\t model.addAttribute(\"base\", basePath);\r\n\t\treturn \"/index/login\"; \r\n\t}", "public CheckAuthCommand() {\n this.authLevel = AUTH_LEVEL_LOGGED_IN;\n }", "MeshAuthChain getAuthChain();", "@Autowired\r\n public void globalUserDetails(AuthenticationManagerBuilder auth) throws Exception {\n auth.inMemoryAuthentication()\r\n // Define user's roles\r\n .withUser(adminId).password(adminPassword).roles(ADMIN_ROLE).and()\r\n .withUser(userId).password(userPassword).roles(USER_ROLE);\r\n }", "@Override\r\n\tpublic void login() {\n\t\t\r\n\t}", "protected Response login() {\n return login(\"\");\n }", "@Override\n public void onAuthenticationFailed() {\n }", "private ModelAndView handleScriptBasicAuth(HttpServletRequest request, HttpServletResponse response)\n {\n\tfinal HttpSession session = request.getSession();\n\tString http_basic_auth = null, http_basic_auth_username = null, http_basic_auth_password = null, openid = null;\n\tBoolean user_authenticated = false;\n\tbyte[] byteArray = null;\n\thttp_basic_auth = request.getHeader(\"Authorization\");\n\t \n\t \n\tString http_basic_auth_enc = http_basic_auth.replaceAll(\"Basic \", \"\");\n\tbyteArray = Base64.decodeBase64(http_basic_auth_enc.getBytes());\n\tString http_basic_auth_dec = new String(byteArray);\n\tString[] parts = http_basic_auth_dec.split(\":\");\n\thttp_basic_auth_username = parts[0];\n\thttp_basic_auth_password = parts[1];\n\t \n\tif (LOG.isDebugEnabled()) LOG.debug(\"Attempting authentication with user=\"+http_basic_auth_username+\" password=\"+http_basic_auth_password);\n\t\t\n\tuser_authenticated = idp.authenticate_ids(http_basic_auth_username, http_basic_auth_password);\n\topenid = idp.getOpenid(http_basic_auth_username);\t\t\n\t\t\n\tif((user_authenticated) && (openid != null)) \n\t{\n\t return setPositiveSessionAuth(session, openid);\n\t} \n\telse\n\t{\n\t // set session-scope authentication flag to FALSE\n\t session.setAttribute(OpenidPars.SESSION_ATTRIBUTE_AUTHENTICATED, Boolean.FALSE);\n\t if (LOG.isDebugEnabled()) LOG.debug(\"Authentication error\");\n\t response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);\n\t return null;\n\t}\n }", "public void authenticationProcedure(){\n\t\tthrow new UnsupportedOperationException(\"TODO: auto-generated method stub\");\r\n\t}", "@Test\n @Transactional\n public void testUrlsRequireAuthentication() throws Exception {\n final View view = viewTestTools.createView(\"TestView\");\n\n // View \"stream\" page.\n testUrlRequiresAuthentication(\"/stream/\" + view.getId(), false);\n }", "public void addBasicAuthentication() {\n\t\tAuthorization auth = new Authorization();\n\t\tauth.setUser(this.authUsername);\n\t\tauth.setPass(this.authPassword);\n\t\tauth.setURL(\"\");\n\n\t\tAuthManager authManager = new AuthManager();\n\t\tauthManager.setEnabled(true);\n\t\tauthManager.setName(\"HTTP Authorization Manager\");\n\t\tauthManager.getClearEachIteration();\n\t\tauthManager.addAuth(auth);\n\t\tauthManager.setProperty(TestElement.TEST_CLASS, AuthManager.class.getName());\n\t\tauthManager.setProperty(TestElement.GUI_CLASS, AuthPanel.class.getName());\n\n\t\tthis.testPlanHashTree.add(authManager);\n\t}", "@Test\n public void test001() {\n String login = \"admin\";\n String password = \"admin\";\n\n openBasicAuthPage(login, password);\n assertThatAuthenticated();\n\n }", "private void checkAuthControl() {\n val authKey = config.getString(\"authControlKey\");\n val authValue = config.getString(\"authControlValue\");\n\n checkArgument(authKey.length() > 2, \"auth string (control key) length is less than or equal to 2!\");\n checkArgument(authValue.length() > 2, \"auth string (control value) length is less than or equal to 2!\");\n }", "private static Object doAuth(Request req, Response res) {\n \n HashMap<String, String> response = new HashMap<>();\n\t\t \n String email = Jsoup.parse(req.queryParams(\"email\")).text();\n\t\t String password = Jsoup.parse(req.queryParams(\"password\")).text();\n\t\t\n res.type(Path.Web.JSON_TYPE);\n \t\t\n\t\t\n\t\tif(email != null && !email.isEmpty() && password != null && !password.isEmpty() ) {\n \n authenticate = new Authenticate(password);\n\t\t\t//note that the server obj has been created during call to login()\n\t\t\tString M2 = authenticate.getM2(server);\n\t\t\t\n if(M2 != null || !M2.isEmpty()) {\n \n \n\t\t\tSession session = req.session(true);\n\t\t\tsession.maxInactiveInterval(Path.Web.SESSION_TIMEOUT);\n\t\t\tUser user = UserController.getUserByEmail(email);\n\t\t\tsession.attribute(Path.Web.ATTR_USER_NAME, user.getUsername());\n session.attribute(Path.Web.ATTR_USER_ID, user.getId().toString()); //saves the id as String\n\t\t\tsession.attribute(Path.Web.AUTH_STATUS, authenticate.authenticated);\n\t\t\tsession.attribute(Path.Web.ATTR_EMAIL, user.getEmail());\n logger.info(user.toString() + \" Has Logged In Successfully\");\n \n response.put(\"M2\", M2);\n response.put(\"code\", \"200\");\n response.put(\"status\", \"success\");\n response.put(\"target\", Path.Web.DASHBOARD);\n \n String respjson = gson.toJson(response);\n logger.info(\"Final response sent By doAuth to client = \" + respjson);\n res.status(200);\n return respjson;\n }\n\t\t\t\t\n\t\t} \n \n res.status(401);\n response.put(\"code\", \"401\");\n response.put(\"status\", \"Error! Invalid Login Credentials\");\n \n return gson.toJson(response);\n }", "public interface AuthService {\n User register(User user, CheckError checkError);\n \n String login(String username, String password);\n \n String refresh(String oldToken);\n}", "@Test(dependsOnMethods = \"testEnableAuth\", groups = \"authEnable\", priority = 1)\n public void setupAuthClient() {\n this.userClient = Client.builder()\n .endpoints(endpoints)\n .user(user)\n .password(userNewPass).build();\n this.rootClient = Client.builder()\n .endpoints(endpoints)\n .user(root)\n .password(rootPass).build();\n }", "@Autowired\n public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {\n auth.inMemoryAuthentication().withUser(\"John\").password(\"{noop}test\").roles(\"ADMIN\");\n auth.inMemoryAuthentication().withUser(\"Oliver\").password(\"{noop}test\").roles(\"USER\");\n }", "private void loggedInUser() {\n\t\t\n\t}", "@Test\n @Transactional\n public void testUrlsRequireAuthentication() throws Exception {\n // cluster index page.\n testUrlRequiresAuthentication(\"/cluster\", false);\n }", "private void debugAuthentcation() {\n\n\t\t/*\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: serviceName: \" +\n\t\t * serviceName + \", baseUrl: \" + baseUrl + \" username: \" + username +\n\t\t * \" password: \" + password);\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: service name: \" +\n\t\t * serviceName + \", hardcodedBaseUrl: \" + hardcodedBaseUrl +\n\t\t * \" hardcodedUsername: \" + hardcodedUsername + \" hardcodedPassword: \" +\n\t\t * hardcodedPassword);\n\t\t */\n\t}", "public Result authenticate() {\r\n // 1. Define class to send JSON response back\r\n class Login {\r\n public Long id;\r\n public String gamerTag;\r\n public String token;\r\n\r\n public Login() {\r\n }\r\n }\r\n\r\n // 2. Read email and password from request()\r\n JsonNode request = request().body().asJson();\r\n String gamerTag = request.get(\"gamerTag\").asText();\r\n String password = request.get(\"password\").asText();\r\n\r\n // 3. Find user with given gamerTag\r\n Login ret = new Login();\r\n User user = User.gamerTagLogin(gamerTag);\r\n if (user == null) {\r\n return unauthorized(Json.toJson(ret));\r\n }\r\n // 4. Compare password.\r\n String sha256 = User.getSha256(request.get(\"password\").asText());\r\n if (sha256.equals(user.getPassword())) {\r\n // Success\r\n String authToken = generateAuthToken();\r\n user.setToken(authToken);\r\n Ebean.update(user);\r\n ret.token = authToken;\r\n ret.gamerTag = user.getGamerTag();\r\n ret.id = user.getId();\r\n return ok(Json.toJson(ret));\r\n\r\n }\r\n // 5. Unauthorized access\r\n return unauthorized();\r\n }", "public Builder setAuth(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n auth_ = value;\n onChanged();\n return this;\n }", "public Builder setAuth(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n auth_ = value;\n onChanged();\n return this;\n }", "public Builder setAuth(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n auth_ = value;\n onChanged();\n return this;\n }", "private LogIn() {}", "private void startAuth() {\n if (ConnectionUtils.getSessionInstance().isLoggedIn()) {\n ConnectionUtils.getSessionInstance().logOut();\n } else {\n ConnectionUtils.getSessionInstance().authenticate(this);\n }\n updateUiForLoginState();\n }", "@Override\n public void onAuthenticated(AuthData authData) {\n Log.i(\"lt\", \"authed\");\n }", "@Override\r\n\tpublic void login() {\n\r\n\t}", "void setAuthenticated(boolean b);", "@Override\r\n protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) {\n }", "public static void run_auth(String pass)\r\n\t{\r\n\t\tpassword = pass;\r\n\t\t\r\n\t\t// Call hash function to encrypt the input password\r\n\t\ttry \r\n\t\t{\r\n\t\t\thash = hash_password(password);\r\n\t\t\tSystem.out.println(\"Hashed password: \" + hash);\r\n\t\t} \r\n\t\tcatch (Exception e) \r\n\t\t{\r\n\t\t\tSystem.out.println(\"There was an error hashing the input password...\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t// Call query function to retrieve hash from the DB\r\n\t\ttry \r\n\t\t{\r\n\t\t\tquery_hash = query_hash();\r\n\t\t\tSystem.out.println(\"Queried hash: \" + query_hash);\r\n\t\t} \r\n\t\tcatch (ClassNotFoundException e) \r\n\t\t{\r\n\t\t\tSystem.out.println(\"There was an error querying the database...\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public interface Authentication extends Component {\n /**\n * Given an incoming HTTP request, determine who the user is and create a UserPermissions object with that\n * information. If the user cannot be identified and/or authenticated, don't set those attributes and throw an\n * exception. Otherwise return a UserPermissions object.\n */\n UserPermissions authenticate (Request request);\n}", "@Override\n public boolean isClientAuthEnabled() {\n return true;\n }", "@Override\r\n\tprotected void configure(AuthenticationManagerBuilder auth) throws Exception {\n\t\tauth.authenticationProvider(authenticateionProvider());\r\n\t}", "protected String getAuthInfo ()\n\t{\n\t\treturn authInfo;\n\t}", "@Override\n\t\t\tpublic void handle(Request req, Response res) throws Exception {\n\t\t\t\tfinal String op = req.params(\":op\");\n\t\t\t\tfinal String username = req.queryParams(\"user\");\n\t\t\t\tfinal String path = req.queryParams(\"path\");\n\t\t\t\t\n\t\t\t\t//--- framework access ---//\n\t\t\t\tif (!Results.hasFrameworkAccess(op, path)) halt(404);\n\t\t\t\t//--- path exists? ---//\n\t\t\t\tif (!Directories.isExist(path)) halt(404);\n\t\t\t\t//--- section and path access ---//\n\t\t\t\tif (!AccessManager.hasAccess(username, path)) halt(401);\n\n\t\t\t}", "public void authenticate(LoginRequest loginRequest) {\n\n }", "@Override\n\tprotected void configure(AuthenticationManagerBuilder auth) throws Exception {\n\t\tif (isDevelopment()) {\n\t\t\tswitch (this.applicationProperties.getMode()) {\n\t\t\tcase basic:\n\t\t\t\tauth.inMemoryAuthentication().withUser(\"INTW1\").password(\"{noop}intw1\")\n\t\t\t\t\t\t.and()\n\t\t\t\t\t\t.withUser(\"ABC\").password(\"{noop}abc\")\n\t\t\t\t\t\t.and()\n\t\t\t\t\t\t.withUser(\"JKL\").password(\"{noop}jkl\")\n\t\t\t\t\t\t.and()\n\t\t\t\t\t\t.withUser(\"noWrite\").password(\"{noop}a\");\n\t\t\t\tbreak;\n\t\t\tcase noauth:\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void authentication2() \n {\n\t Response resp = RestAssured.given().auth().oauth2(\"accessTokenToPass\").post(\"URL/URL\");\n\t resp.getStatusCode();\n\t \n\t //Getting entire data value\n\t System.out.println(\"Content is :\" +resp.getBody().asString());\n\t \n\t //Converting in to Json path value\n\t JsonPath json = resp.getBody().jsonPath();\n\t \n\t //Printing in JSON value\n\t System.out.println(\"Json Value are :\" +json);\n }", "private static IndexAuthorization buildAuth(final Properties authProps,\n final Reporter reporter) throws IOException {\n if(authProps.size() == 0) {\n return null;\n }\n\n IndexAuthorization authorization = new BasicAuth(authProps);\n for(String index : authorization.authorizedIndexes()) {\n reporter.createStore(index);\n }\n\n return authorization;\n }", "protected void onSuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) throws IOException {\n }", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public F.Promise<Result> onAuthFailure(Http.Context context, String content) {\n final Http.Context c = context;\n return F.Promise.promise(new F.Function0<Result>() {\n @Override\n public Result apply() throws Throwable {\n String path = c.request().path();\n String sessionId = context.session().get(\"sessionId\");\n try {\n SessionStoreAdapter.getInstance().getUserSession(sessionId);\n c.flash().put(\"error\", Messages.get(\"global.error.noauthorizationforthispage\"));\n return ok(index.render());\n } catch(Exception e) {\n return ok(login.render(path));\n }\n }\n });\n }", "boolean authenticate(String userName, String password);", "public GluewineSecuredStaticHandler(String context, UseridPasswordAuthentication authenticator)\n {\n super(context);\n this.authenticator = authenticator;\n }", "@Before(unless = { \"signin\", \"doLogin\" })\n\tprivate static void checkAuthentification() {\n\t\t// get ID from secure social plugin\n\t\tString uid = session.get(PLAYUSER_ID);\n\t\tif (uid == null) {\n\t\t\tsignin(null);\n\t\t}\n\n\t\t// get the user from the store. TODO Can also get it from the cache...\n\t\tUser user = null;\n\t\tif (Cache.get(uid) == null) {\n\t\t\ttry {\n\t\t\t\tuser = UserClient.getUserFromID(uid);\n\t\t\t\tCache.set(uid, user);\n\t\t\t} catch (ApplicationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tflash.error(\"Problem while getting user from store...\");\n\t\t\t}\n\t\t} else {\n\t\t\tuser = (User) Cache.get(uid);\n\t\t}\n\n\t\tif (user == null) {\n\t\t\tflash.error(\"Problem while getting user from store...\");\n\t\t\tAuthentifier.logout();\n\t\t}\n\n\t\tif (user.avatarURL == null) {\n\t\t\tuser.avatarURL = Gravatar.get(user.email, 100);\n\t\t}\n\n\t\t// push the user object in the request arguments for later display...\n\t\trenderArgs.put(PLAYUSER, user);\n\t}" ]
[ "0.6752812", "0.6218072", "0.6218072", "0.6218072", "0.61995625", "0.6182027", "0.6143835", "0.61392474", "0.59708935", "0.5931679", "0.5897202", "0.5876196", "0.58608854", "0.5836865", "0.5805912", "0.57852453", "0.57065666", "0.5679263", "0.56727016", "0.5665092", "0.5657559", "0.5639054", "0.5628175", "0.56262445", "0.56213766", "0.56080866", "0.56073517", "0.5596074", "0.55562496", "0.5545854", "0.5541551", "0.5539277", "0.55365586", "0.55352324", "0.5511259", "0.55081433", "0.5492164", "0.5480358", "0.548014", "0.54745096", "0.5474404", "0.54701126", "0.5460282", "0.5452545", "0.54425526", "0.54420614", "0.5438612", "0.54335135", "0.5424193", "0.5421142", "0.54184216", "0.54168284", "0.5408668", "0.5402845", "0.5392506", "0.5389495", "0.5371197", "0.53695846", "0.5368256", "0.53574264", "0.5356464", "0.53482527", "0.5345655", "0.5332896", "0.53286666", "0.5326883", "0.5323012", "0.5320954", "0.5316024", "0.53152245", "0.53037786", "0.5290835", "0.52896255", "0.5283606", "0.52789813", "0.52719647", "0.52686995", "0.52686995", "0.52686995", "0.52671397", "0.52666515", "0.5251483", "0.5245294", "0.52427316", "0.5240792", "0.5240763", "0.52365625", "0.52258855", "0.5224146", "0.5216968", "0.5209082", "0.5207595", "0.52046627", "0.5201218", "0.5196107", "0.5187832", "0.5187797", "0.51863706", "0.5183466", "0.51767063", "0.5176167" ]
0.0
-1
TODO Autogenerated method stub
protected void checkQueryForSearch(CandidateQuery query, List<Object> params) { if(query==null) { throw new IllegalArgumentException("checkQueryForSearch(CandidateQuery query, List<Object> params) "+query+" can not be null"); } String[] checkList= { "query.getTargetType()",query.getTargetType(), "query.getOwnerType()",query.getOwnerType(), "query.getTargetType()",query.getTargetType(), "query.getListType()",query.getListType(), "query.getOwnerId()",query.getOwnerId(), }; int length = checkList.length; for(int i=0;i<length;i++) { String target = checkList[i]; if(target!=null) { continue; } String parameterName = checkList[i-1]; String message = String.format("Parameter '%s' in '%s' is not expected to be null", parameterName,"prepareSqlForSearch(CandidateQuery query, List<Object> params)"); throw new IllegalArgumentException(message); } }
{ "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
Converts Date given as String to date given as object.
public Date parseDate(String date, String format) { return this.convertStringToDate(date, format); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Date convertStringToDate(String strDate)\n\t {\n\t Date myDate = null;\n\t if (strDate.length() > 0)\n\t {\n\t DateFormat formatter = new SimpleDateFormat(EProcurementConstants.INPUT_DATE_FORMAT);\n\t try\n\t {\n\t myDate = formatter.parse(strDate);\n\t } catch (ParseException e)\n\t {\n\t LOGGER.error(\"Not able to parse \" + strDate + \" into date ..\" + e.getMessage());\n\t }\n\t }\n\t return myDate;\n\t }", "public static Date toDate(String dateStr, SimpleDateFormat format) throws ParseException {\r\n\t\treturn format.parse(dateStr);\r\n\t}", "private Date convertStringToDate(String dateInString){\n DateFormat format = new SimpleDateFormat(\"d-MM-yyyy HH:mm\", Locale.ENGLISH);\n Date date = null;\n try {\n date = format.parse(dateInString);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return date;\n }", "public static Date parseDate(String date) {\n return DateUtil.toDate(date);\n }", "public static Date stringToDate(String date)\r\n/* 29: */ {\r\n/* 30: 39 */ log.debug(\"DateUtil.stringToDate()\");\r\n/* 31: */ try\r\n/* 32: */ {\r\n/* 33: 41 */ return sdfDate.parse(date);\r\n/* 34: */ }\r\n/* 35: */ catch (ParseException e)\r\n/* 36: */ {\r\n/* 37: 43 */ log.fatal(\"DateUtil.stringToDate抛出异常\", e);\r\n/* 38: */ }\r\n/* 39: 44 */ return new Date();\r\n/* 40: */ }", "public static Date strToDate(String strDate)\r\n/* 127: */ {\r\n/* 128:178 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 129:179 */ ParsePosition pos = new ParsePosition(0);\r\n/* 130:180 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 131:181 */ return strtodate;\r\n/* 132: */ }", "public static Date GetDateObjectFromString(String dateAsString) {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tDate tempDate = null;\n\t\ttry {\n\t\t\tif (dateAsString != null && !dateAsString.equalsIgnoreCase(\"null\"))\n\t\t\t\ttempDate = sdf.parse(dateAsString);\n\t\t} catch (Exception e) {\n\t\t\t// do some error reporting here\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn tempDate;\n\t}", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static Date String2Date(String date){\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n Date currentDate = null;\n try {\n currentDate = format.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return currentDate;\n }", "public Date convertStringToDate(String s) throws ParseException {\n\t\tDate dateTime = SDF.parse(s);\n\t\treturn dateTime;\n\t}", "public static Date convertStringToDate(String date) throws ParseException {\n\t return new SimpleDateFormat(\"yyyy-MM-dd\").parse(date); \n\t}", "public static Date stringToDate(String dateString) {\n for(String format: DATE_FORMATS){\n try {\n return new SimpleDateFormat(format).parse(dateString);\n }\n catch (Exception e){}\n }\n throw new IllegalArgumentException(\"Date is not parsable\");\n }", "public static Date stringToDate (String s) {\n\t\tint year=0 , month=0 , date=0;\n\t\tCalendar cal = Calendar.getInstance(Locale.getDefault());\n\t\t\n\t\tStringTokenizer st = new StringTokenizer (s,\"/\");\n\t\t\n\t\tdate = Integer.parseInt(st.nextToken());\n\t\tmonth = Integer.parseInt(st.nextToken());\n\t\tyear = Integer.parseInt(st.nextToken());\n\t\tcal.clear();\n\t\tcal.set(year,month-1,date);\n\t\t//System.out.println(\"\\nDate : \"+getStringFromDate(cal.getTime()));\n\t\treturn (Date)cal.getTime().clone();\n\t}", "public static java.util.Date convertFromStringToDate(String strDate){\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd-MMM-yyyy\"); /*This stringDate is come from UI*/\n\t\tjava.util.Date date = null;\n\t\tif(strDate != null && !strDate.trim().isEmpty()){\n\t\t\ttry {\n\t\t\t\tdate = format.parse(strDate);\n\t\t\t\tSystem.out.println(strDate);\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\n\t\treturn date;\n\t}", "public static Date convertStringToDate(String strDate)\n\t\t\tthrows ParseException {\n\t\tDate aDate = null;\n\n\t\ttry {\n\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\tlog.debug(\"converting date with pattern: \" + getDatePattern());\n\t\t\t}\n\n\t\t\taDate = convertStringToDate(getDatePattern(), strDate);\n\t\t} catch (ParseException pe) {\n\t\t\tlog.error(\"Could not convert '\" + strDate\n\t\t\t\t\t+ \"' to a date, throwing exception\");\n\t\t\tpe.printStackTrace();\n\t\t\tthrow new ParseException(pe.getMessage(), pe.getErrorOffset());\n\t\t}\n\n\t\treturn aDate;\n\t}", "public static Date parseDate(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateFormat());\n\t}", "@SuppressWarnings(\"deprecation\")\n\tpublic static Date getDateForString(String dateString) {\n\t\tString[] separation1 = dateString.split(\" \");\n\t\tString[] separation2 = separation1[0].split(\"/\");\n\t\tString[] separation3 = separation1[1].split(\":\");\n\t\treturn new Date(Integer.parseInt(separation2[2])-1900, (Integer.parseInt(separation2[1])-1), Integer.parseInt(separation2[0]), Integer.parseInt(separation3[0]), Integer.parseInt(separation3[1]), Integer.parseInt(separation3[2]));\n\t}", "public static Date stringToDate(String dateAsString){\r\n try { \r\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\"); \r\n return df.parse(dateAsString);\r\n } catch (ParseException ex) {\r\n ex.printStackTrace();\r\n return null;\r\n }\r\n }", "public Date convertStringToDate(String dateToParse, String format) {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n Date result = null;\n try {\n result = formatter.parse(dateToParse);\n } catch (Exception exception1) {\n System.err.println(\n String.format(\"ERROR, converting from String %s to date with format %s\", dateToParse, format)\n );\n result = null;\n }\n return result;\n }", "private Date stringToDate(String s) throws ParseException{\r\n\t\tSimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT);\r\n\t\treturn fmt.parse(s);\r\n\t}", "public static Date StringToDate(String dateString) {\n int y = new Integer(dateString.substring(0, 4));\n int m = new Integer(dateString.substring(4, 6));\n int d = new Integer(dateString.substring(6, 8));\n int h = new Integer(dateString.substring(8, 10));\n int min = new Integer(dateString.substring(10, 12));\n\n try {\n Calendar convCal = Calendar.getInstance();\n convCal.set(y, m - 1, d, h, min);\n Date date = convCal.getTime();\n\n return date;\n } catch (Exception ex) {\n System.out.println(\"BwInfo.convertStringToDate() \" + ex);\n return null;\n }\n\n }", "public static Date toDate(Object obj) {\n return toDate(obj, (String) null, (TimeZone) null);\n }", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\n }", "@Test\n\t@DisplayName(\"string to date\")\n\tpublic void testStringToDate() throws ParseException\n\t{\n\t\tDateConverter d = new DateConverter(string1);\n\t\t\n\t\tString dateInString = \"1997-03-19\";\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\ttry {\n\t\t date1 = formatter.parse(dateInString);\n\t\t} catch (ParseException e) {\n\t\t //handle exception if date is not in \"dd-MMM-yyyy\" format\n\t\t}\n\t\tassertEquals(date1, d.getDate());\n\t}", "public static Date fromString(String fullDate) {\n\t\tString[] parsed = fullDate.split(\",\");\n\t\tif (parsed.length != 3 && parsed.length != 5) {\n\t\t\tthrow new InvalidParsingStringException(Date.class.getName());\n\t\t}\n\t\tDate date = new Date();\n\t\tdate.setYear(Integer.valueOf(parsed[0]));\n\t\tdate.setMonth(Integer.valueOf(parsed[1]));\n\t\tdate.setDay(Integer.valueOf(parsed[2]));\n\t\tif (parsed.length == 5) {\n\t\t\tdate.setHour(Integer.valueOf(parsed[3]));\n\t\t\tdate.setMin(Integer.valueOf(parsed[4]));\n\t\t}\n\t\treturn date;\n\t}", "public static Date GetDateObjectFromStringUpdate(String dateAsString) {\n\t\tSimpleDateFormat lv_formatter = new SimpleDateFormat(\n\t\t\t\t\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tlv_formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\tDate tempDate = null;\n\t\ttry {\n\t\t\tif (dateAsString != null && !dateAsString.equalsIgnoreCase(\"null\"))\n\t\t\t\ttempDate = lv_formatter.parse(dateAsString);\n\t\t} catch (Exception e) {\n\t\t\t// do some error reporting here\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn tempDate;\n\t}", "public static Date convertirStringADateUtil(String s){\n\t\tFORMATO_FECHA.setLenient(false);\n\t\tDate fecha = null;\n\t\ttry {\n\t\t\tfecha = FORMATO_FECHA.parse(s);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn fecha;\n\t}", "public static java.sql.Date convertToSDate(String dateInString) {\n\t\tif (dateInString == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\tjava.util.Date uDate = null;\n\t\t\tjava.sql.Date sDate = null;\n\t\t\ttry {\n\t\t\t\tuDate = dateFormat.parse(dateInString);\n\t\t\t\tsDate = new java.sql.Date(uDate.getTime());\n\t\t\t} catch (ParseException e) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn sDate;\n\t\t}\n\t}", "private Date deserializeToDate(String object) {\n synchronized (this) {\n Object object2;\n boolean bl2;\n Object object3 = this.dateFormats;\n object3 = object3.iterator();\n while (bl2 = object3.hasNext()) {\n object2 = object3.next();\n object2 = (DateFormat)object2;\n try {\n return ((DateFormat)object2).parse((String)object);\n }\n catch (ParseException parseException) {\n }\n }\n try {\n bl2 = false;\n object2 = null;\n object3 = new ParsePosition(0);\n return ISO8601Utils.parse((String)object, (ParsePosition)object3);\n }\n catch (ParseException object22) {\n object2 = new JsonSyntaxException((String)object, object22);\n throw object2;\n }\n }\n }", "public static Date date(String str) throws Exception {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\n return sdf.parse( str );\n }", "public static Date createDate(String dateStr) throws ParseException {\n\t\tSimpleDateFormat date = new SimpleDateFormat(\"yyyy/MM/dd\");\n\t\treturn date.parse(dateStr);\n\t}", "public static Date stringToDate(String string_date){\n Date myDate = null;\n \n try {\n java.util.Date utilDate = new SimpleDateFormat(\"yyyy-MM-dd\").parse(string_date);\n myDate = new java.sql.Date(utilDate.getTime());\n } catch (Exception e) {\n // Si hay una excepcion se imprime un mensaje\n System.err.println(e.getMessage());\n }\n \n return myDate;\n }", "public static Date stringToDate(String date) {\n\t\tDate result = null;\n\t\tif (date != null && !\"\".equals(date)) {\n\t\t\tDateTimeFormatter f = DateTimeFormat.forPattern(SmartMoneyConstants.DATE_FORMAT);\n\t\t\tDateTime dateTime = f.parseDateTime(date);\n\t\t\tresult = dateTime.toDate();\n\t\t}\n\n\t\treturn result;\n\t}", "public static Date convertStringToDate(String stringDate) {\n\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\"); \n\t\tDate startDate = null;\n\n\t\ttry {\n\t\t startDate = df.parse(stringDate);\n\n\t\t} catch (ParseException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t\treturn startDate;\n\t\t\n\t}", "public Date stringToDate(String date) throws ParseException {\n String[] splitDate = date.split(\"T\");\n String day = splitDate[0];\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date dayDate = dateFormat.parse(day);\n return dayDate;\n }", "public static Date StringToDate(String strFecha) throws ParseException {\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n return simpleDateFormat.parse(strFecha);\r\n }", "public Date(String sDate) {\r\n\t\tint m, d, y;\r\n\t\tString[] chopDate = sDate.split(\"-\");\r\n\t\tm = Integer.parseInt(chopDate[ZEROI]);\r\n\t\td = Integer.parseInt(chopDate[ONEI]);\r\n\t\ty = Integer.parseInt(chopDate[TWOI]);\r\n\t\tif (!isValid(m, d, y))\r\n\t\t\tthrow new RuntimeException(\"Invalid date\");\r\n\t\tmonth = m;\r\n\t\tday = d;\r\n\t\tyear = y;\r\n\t}", "public static Date convertStringToDate(String dateString) {\n\t\tLocalDate date = null;\n\t\t\n\t\ttry {\n\t\t\tDateTimeFormatter formatter = DateTimeFormatter.ofPattern(Constants.ddmmyyydateFormatInCSV);\n\t\t\tdate = LocalDate.parse(dateString, formatter);\n\n\t\t} catch (DateTimeParseException ex) {\n\t\t\tthrow new SalesException(\"enter the proper date in \" + Constants.ddmmyyydateFormatInCSV + \" format\");\n\t\t} catch (SalesException ex) {\n\t\t\tthrow new SalesException(\"Recevied excepion during date parser \" + ex.getMessage());\n\t\t}\n\t\treturn Date.valueOf(date);\n\t}", "public Date getConvertedDate(String dateToBeConverted) {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yy hh:mm:ss\");\n\t\ttry{\n\t\t\tbookedDate = sdf.parse(dateToBeConverted);\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn bookedDate;\n\t}", "public static Date parseDate(String s) {\n\t\tDate d = null;\n\t\tif (s == null) {\n\t\t\treturn d;\n\t\t}\n\n\t\tString pattern = \"\";\n\n\t\tif (s.indexOf(':') >= 0) {\n\t\t\tif (s.length() > 20) {\n\t\t\t\tpattern = \"yyyy-MM-dd HH:mm:ss.SSS\";\n\t\t\t} else {\n\t\t\t\tif (s.lastIndexOf(':') != s.indexOf(':'))\n\t\t\t\t\tpattern = DD_MM_YYYY_HH_MM_SS;\n\t\t\t\telse\n\t\t\t\t\tpattern = \"dd/MM/yyyy HH:mm\";\n\t\t\t}\n\t\t} else {\n\t\t\tpattern = DD_MM_YYYY;\n\t\t}\n\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(pattern);\n\t\tsdf.setTimeZone(TimeZone.getDefault());\n\t\tif (s.length() > 0) {\n\t\t\ttry {\n\t\t\t\td = sdf.parse(s);\n\t\t\t} catch (ParseException e) {\n\t\t\t\tthrow new FenixException(\"Errore nella conversione della data. \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\treturn d;\n\t}", "public Date parseString(String dateString) throws ParseException {\n return dateFormat.parse(dateString);\n }", "public Date stringToDate(String d)\n\t{\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"MMM-yyyy\");\n\t\t\n\t\tDate date = new Date();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tdate = format.parse(d);\n\t\t} \n\t\tcatch (ParseException e) \n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "public static Date parseDate(String date) {\r\n return parseDateWithPattern(date, \"dd/MM/yyyy\");\r\n }", "public static HISDate valueOf(String datStr) throws HISDateException {\r\n return HISDate.valueOf(datStr, null);\r\n }", "public static Date convertString2Date(String strTime) {\r\n\t\t Calendar calendar = Calendar.getInstance();\r\n\t\t calendar.setTimeInMillis(Long.valueOf(strTime));\r\n\t\t return calendar.getTime();\r\n\t}", "public static java.util.Date convertToUDate(String dateInString) {\n\t\tif (dateInString == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\tjava.util.Date uDate = null;\n\t\t\ttry {\n\t\t\t\tuDate = dateFormat.parse(dateInString);\n\t\t\t} catch (ParseException e) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn uDate;\n\t\t}\n\t}", "public static Date parseDate(String date)\n {\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date dt = null;\n try {\n dt = format.parse(date);\n } \n catch (ParseException ex) \n {\n System.out.println(\"Unexpected error during the conversion - \" + ex);\n }\n return dt;\n }", "public static Date FormatStringToDate(String dateString) {\r\n SimpleDateFormat dF = new SimpleDateFormat(\"dd/mm/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateString);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n return date;\r\n }", "public static Date dateFromShortString(String dateString) {\n SimpleDateFormat fmt = new SimpleDateFormat(\"dd-MMM-yyyy\", Locale.getDefault());\n try {\n return fmt.parse(dateString);\n } catch (ParseException e) {\n e.printStackTrace();\n return new Date();\n }\n }", "public static Date stringToDate(String date) throws InvalidDateException{\n DateFormat format = new SimpleDateFormat(Constants.BIRTH_DATE_FORMAT);\n format.setLenient(false); //é uma flag para que a data esteja sempre entre os limites corretos\n try {\n return format.parse(date);\n } catch (ParseException ignored) {\n throw new InvalidDateException(\"Invalid date\");\n }\n }", "@Override\n\tpublic Date convert(String source) {\n\t\tif (StringUtils.isValid(source)) {\n\t\t\tDateFormat dateFormat;\n\t\t\tif (source.indexOf(\":\") != -1) {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t} else {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd\"); \n\t\t\t}\n\t\t\t//日期转换为严格模式\n\t\t dateFormat.setLenient(false); \n\t try {\n\t\t\t\treturn dateFormat.parse(source);\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t}\n\t\treturn null;\n\t}", "private Date parseStringToDate(String date) {\n Date resultDate = null;\n if (date.contains(TODAY) || date.contains(YESTERDAY)) {\n String[] dateStrings = date.split(\",\");\n if (dateStrings[0].equalsIgnoreCase(TODAY)) {\n Calendar today = Calendar.getInstance();\n resultDate = today.getTime();\n } else if (dateStrings[0].equalsIgnoreCase(YESTERDAY)) {\n Calendar yesterday = Calendar.getInstance();\n yesterday.add(Calendar.DATE, MINUS_DAY);\n resultDate = yesterday.getTime();\n }\n } else {\n SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n try {\n resultDate = formatter.parse(date);\n } catch (ParseException e) {\n LOG.error(e.getMessage(), e);\n }\n }\n return resultDate;\n }", "public static Date strToTime(String strDate)\r\n/* 135: */ {\r\n/* 136:192 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n/* 137:193 */ ParsePosition pos = new ParsePosition(0);\r\n/* 138:194 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 139:195 */ return strtodate;\r\n/* 140: */ }", "@TypeConverter\n public static Date toDate(String value) {\n if (value == null) return null;\n\n try {\n return df.parse(value);\n } catch (ParseException e) {\n e.printStackTrace();\n return null;\n }\n }", "private static Date toDate(final Object value, final String identifier) throws ParseException {\n if (value == null) {\n return null;\n }\n if (value instanceof Number) {\n return new Date(((Number) value).longValue());\n }\n final String t = (String) value;\n if (t.indexOf('-') < 0) try {\n return new Date(Long.valueOf(t));\n } catch (NumberFormatException e) {\n throw new ParseException(\"Illegal date: \" + value + \" (property:\" + identifier +\")\", e);\n }\n try {\n synchronized (JsonMetadataConstants.DATE_FORMAT) {\n return JsonMetadataConstants.DATE_FORMAT.parse((String) value);\n }\n } catch (java.text.ParseException e) {\n throw new ParseException(\"Illegal date: \" + value + \" (property:\" + identifier +\")\", e);\n }\n }", "protected static Date parseDate(String dateStr) {\n if (dateStr != null) {\n try {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n return df.parse(dateStr);\n }\n catch (Exception e) {\n throw new IllegalArgumentException(\"Expected date in format yyyy-MM-dd but got \" + dateStr, e);\n }\n }\n return null;\n }", "public static Date toDate(Object obj, String pattern) {\n return toDate(obj, pattern, (TimeZone) null);\n }", "public static synchronized Date parseDate(String s) throws ParseException {\n return dateFormat.parse(s);\n }", "private static String convertDate(String dateString) {\n String date = null;\n\n try {\n //Parse the string into a date variable\n Date parsedDate = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\").parse(dateString);\n\n //Now reformat it using desired display pattern:\n date = new SimpleDateFormat(DATE_FORMAT).format(parsedDate);\n\n } catch (ParseException e) {\n Log.e(TAG, \"getDate: Error parsing date\", e);\n e.printStackTrace();\n }\n\n return date;\n }", "public static Date parseDate(DateFormat format, String dateStr) throws ParseException {\n\t\tDate date = null;\n\t\tif (dateStr != null && !dateStr.isEmpty()) {\n\t\t\tdate = format.parse(dateStr);\n\t\t}\n\t\treturn date;\n\t}", "public Date parseDateFromString(final String dateString) {\r\n\t\tDateFormat df = getDateTimeFormat();\r\n\t\tsynchronized (df) {\r\n\t\t\ttry {\r\n\t\t\t\treturn df.parse(dateString);\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t\tDominoUtils.handleException(e);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private Date stringToDate(String datum)\r\n\t{\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd.MM.yyyy\");\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDate d = df.parse(datum);\r\n\t\t\treturn d;\r\n\t\t}\r\n\t\tcatch (ParseException e)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public Date(String date) {\n String[] fields = date.split(\"/\");\n if (fields.length != 3) {\n throw new IllegalArgumentException(\"Invalid date\");\n }\n month = Integer.parseInt(fields[0]);\n day = Integer.parseInt(fields[1]);\n year = Integer.parseInt(fields[2]);\n if (!isValid(month, day, year)) throw new IllegalArgumentException(\"Invalid date\");\n }", "@Test\n\t@DisplayName(\"date to string\")\n\tpublic void testDateToString()\n\t{\n\t\tString dateInString = \"2000-04-12\";\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\ttry {\n\t\t date1 = formatter.parse(dateInString);\n\t\t} catch (ParseException e) {\n\t\t //handle exception if date is not in \"dd-MMM-yyyy\" format\n\t\t}\n\t\tDateConverter s = new DateConverter(date1);\n\t\tassertEquals(\"2000-04-12\", s.getDateAsString());\n\t}", "public static native JsDate create(String dateString) /*-{\n return new Date(dateString);\n }-*/;", "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 Date toDateFormat_1(String dateString) {\r\n\t\treturn stringToDate(dateString, DATE_FORMAT_1);\r\n\t}", "private Date convertMongoToDate(String dateString, String timeString) {\n int year = Integer.parseInt(dateString.substring(0, 4));\n //Log.e(\"KARA\", \"year \" + year);\n int month = Integer.parseInt(dateString.substring(5, 7));\n //Log.e(\"KARA\", \"month \" + month);\n int day = Integer.parseInt(dateString.substring(8, 10));\n //Log.e(\"KARA\", \"day \" + day);\n int hour = Integer.parseInt(timeString.substring(0, 2));\n //Log.e(\"KARA\", \"hour \" + hour);\n int min = Integer.parseInt(timeString.substring(3, 5));\n return new Date(year - 1900, month - 1, day, hour, min);\n }", "public static Date convert(String timeString){\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MMM/yyyy:HH:mm:ss ZZZZ\");\n // set default timezone to be runtime independent\n TimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"));\n try {\n return dateFormat.parse(timeString);\n } catch (ParseException e) {\n LOGGER.log(Level.SEVERE, \"Date cannot be parsed: \"+ timeString, e);\n return null;\n }\n }", "public static Date de_STRING_a_DATE(String fechaEnString) {\n SimpleDateFormat miFormato2 = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date fechaenjava = null;\n try {\n fechaenjava = miFormato2.parse(fechaEnString);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return fechaenjava;\n }", "public Calendar convertFromString(String stringDate) {\n Calendar dateVacancy = Calendar.getInstance();\n dateVacancy.set(Calendar.MILLISECOND, 0); //remove milliseconds\n if (months.isEmpty()) {\n fillMap();\n }\n if (stringDate.contains(TODAY)) {\n year = Calendar.getInstance().get(Calendar.YEAR);\n month = Calendar.getInstance().get(Calendar.MONTH);\n day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n dateVacancy.set(year, month, day);\n } else if (stringDate.contains(YESTERDAY)) {\n year = Calendar.getInstance().get(Calendar.YEAR);\n month = Calendar.getInstance().get(Calendar.MONTH);\n day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n dateVacancy.set(year, month, day - 1);\n } else {\n stringDate = stringDate.substring(0, 9);\n String monthStr = stringDate.substring(stringDate.length() - 7, stringDate.length() - 3).trim();\n this.year = convertToYear(stringDate);\n this.month = months.get(monthStr);\n this.day = convertToDay(stringDate);\n dateVacancy.set(year, month, day);\n }\n return dateVacancy;\n }", "public Date createDate(String strDate){\n\n Date date = null;\n\n // Get time\n Calendar cal = Calendar.getInstance();\n Date currentLocalTime = cal.getTime();\n DateFormat dateformat = new SimpleDateFormat(\"HH:mm:ss\");\n String localTime = dateformat.format(currentLocalTime);\n\n // Concat strings\n String tmpDate = strDate + \" \" + localTime;\n //\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n try {\n date = format.parse(tmpDate);\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return date;\n }", "private static Date getDate(String sdate)\n\t{\n\t\tDate date = null;\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\ttry {\n\t\t\tdate = formatter.parse(sdate);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn date;\n\t}", "public E_Date(String value) throws ParseException {\n\t\tsuper(DATE_TIME.parse(value).toDate());\n\t}", "public Date ToDate(String line){\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy/MM/dd\");\n try {\n Date d = sdf.parse(line);\n return d;\n } catch (ParseException ex) {\n\n Log.v(\"Exception\", ex.getLocalizedMessage());\n return null;\n }\n }", "public static Date toDate(Object obj, String pattern, TimeZone timeZone) {\n if (obj == null) {\n return null;\n } else if (obj instanceof String) {\n return toDateFromString((String) obj, pattern, timeZone);\n } else if (obj instanceof Date) {\n final Date paramDate = (Date) obj;\n if (Date.class.equals(paramDate.getClass())) { // pure date\n return paramDate;\n } else { // sub class\n // because the Date is not final class.\n final Date date = new Date();\n date.setTime(paramDate.getTime());\n return date;\n }\n } else if (obj instanceof Calendar) {\n return ((Calendar) obj).getTime();\n } else if (obj instanceof byte[]) {\n return toDate(toSerializable((byte[]) obj)); // recursive\n } else if (obj instanceof Long) {\n return new Date((Long) obj);\n } else {\n return toDateFromString(obj.toString(), pattern, timeZone);\n }\n }", "public static Date getDateFromString(String date) {\r\n Date newdate = null;\r\n SimpleDateFormat dateformat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n\r\n try {\r\n newdate = dateformat.parse(date);\r\n System.out.println(newdate);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return newdate;\r\n }", "public Date formatForDate(String data) throws ParseException{\n //definindo a forma da Data Recebida\n DateFormat formatUS = new SimpleDateFormat(\"dd-MM-yyyy\");\n return formatUS.parse(data);\n }", "public static Date converteStringInvertidaSemBarraAAMMDDParaDate(String data) {\r\n\t\tDate retorno = null;\r\n\r\n\t\tString dataInvertida = data.substring(4, 6) + \"/\" + data.substring(2, 4) + \"/20\" + data.substring(0, 2);\r\n\r\n\t\tSimpleDateFormat dataTxt = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t\ttry {\r\n\t\t\tretorno = dataTxt.parse(dataInvertida);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tthrow new IllegalArgumentException(data + \" não tem o formato dd/MM/yyyy.\");\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "private static final Date convertStringToDate(String aMask, String strDate) {\n SimpleDateFormat df = null;\n Date date = null;\n df = new SimpleDateFormat(aMask);\n try {\n date = df.parse(strDate);\n } catch (ParseException pe) {\n throw new ValidateException(\"日期转换出现异常,\"+pe.getMessage(), pe);\n }\n\n return (date);\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}", "public void parseDate(String d)\n {\n\tdate.set(d);\n String [] dateList = d.split(\"-\");\n \n year.set(Integer.valueOf(dateList[0]));\n month.set(Integer.valueOf(dateList[1]));\n day.set(Integer.valueOf(dateList[2]));\n }", "public static Date toDate(final String data, final String sFormat, final Locale locale) {\n final SimpleDateFormat formato = new SimpleDateFormat(sFormat, locale == null ? getLocale(CalendarParams.LOCALE_PT) : locale);\n Date date = null;\n try {\n date = formato.parse(data);\n } catch (ParseException e) {\n // LOG.error(\"Date dont convert \", e);\n System.out.println(e.getMessage());\n }\n return date;\n }", "public static Date converteStringInvertidaSemBarraAAAAMMDDParaDate(String data) {\r\n\t\tDate retorno = null;\r\n\r\n\t\tString dataInvertida = data.substring(6, 8) + \"/\" + data.substring(4, 6) + \"/\" + data.substring(0, 4);\r\n\r\n\t\tSimpleDateFormat dataTxt = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t\ttry {\r\n\t\t\tretorno = dataTxt.parse(dataInvertida);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tthrow new IllegalArgumentException(data + \" não tem o formato dd/MM/yyyy.\");\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "public static LocalDate stringToDate(String inputStringDate) {\n\t\treturn LocalDate.parse(inputStringDate);\n\t}", "public static Date convertStringToDate(String aMask, String strDate)\n\t\t\tthrows ParseException {\n\t\tSimpleDateFormat df;\n\t\tDate date;\n\t\tdf = new SimpleDateFormat(aMask);\n\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"converting '\" + strDate + \"' to date with mask '\"\n\t\t\t\t\t+ aMask + \"'\");\n\t\t}\n\n\t\ttry {\n\t\t\tdate = df.parse(strDate);\n\t\t} catch (ParseException pe) {\n\t\t\t// log.error(\"ParseException: \" + pe);\n\t\t\tthrow new ParseException(pe.getMessage(), pe.getErrorOffset());\n\t\t}\n\n\t\treturn (date);\n\t}", "public static Date parseDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateTimeFormat());\n\t}", "public static String parseDate(String input) {\n String year = input.substring(0, 4);\n String month = input.substring(5, 7);\n String day = input.substring(8, 10);\n return year + \"-\" + month + \"-\" + day;\n }", "@Test\n void test7(){\n\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = new Date();\n String dString = formatter.format(date);\n System.out.println(\"dString=\"+dString);\n\n Date datas = java.sql.Date.valueOf(dString);\n System.out.println(\"datas=\"+datas);\n\n\n }", "private Date parseDate(String text) throws Exception {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n return dateFormat.parse(text);\n }", "public Date parseDate(String date) {\t\t\n\t\ttry{\n\t\t\tDate d2 = sdf.parse(date);\n\t\t\t//String month = parseMonth(date);\n\t\t\t//cal.setTime(d2);\t\t\t\n\t\t\t//months.put(month, new Integer(cal.get(Calendar.MONTH) + 1));\t\t\t\n\t\t\treturn d2;\n\t\t} catch(ParseException e){\n\t\t\tSystem.out.println(\"Invalid Date Format or No Such Date : \" + date + \". Message: \" + e.getMessage() );\n\t\t\treturn null;\n\t\t}\n\t}", "public static Date parseDate(String date) throws java.text.ParseException {\n if(date == null) return null;\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n try {\n return sdf.parse(date);\n\n } catch(ParseException e) {\n sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\n try {\n return sdf.parse(date);\n\n } catch(ParseException e2) {\n sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n return sdf.parse(date);\n }\n } \n }", "public Date(String icalStr) throws ParseException, BogusDataException\r\n\t{\r\n\t\tsuper(icalStr);\r\n\r\n\t\tyear = month = day = 0;\r\n\t\thour = minute = second = 0;\r\n\r\n\t\tfor (int i = 0; i < attributeList.size(); i++)\r\n\t\t{\r\n\t\t\tAttribute a = attributeAt(i);\r\n\t\t\tString aname = a.name.toUpperCase(Locale.ENGLISH);\r\n\t\t\tString aval = a.value.toUpperCase(Locale.ENGLISH);\r\n\t\t\t// TODO: not sure if any attributes are allowed here...\r\n\t\t\t// Look for VALUE=DATE or VALUE=DATE-TIME\r\n\t\t\t// DATE means untimed for the event\r\n\t\t\tif (aname.equals(\"VALUE\"))\r\n\t\t\t{\r\n\t\t\t\tif (aval.equals(\"DATE\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tdateOnly = true;\r\n\t\t\t\t} else if (aval.equals(\"DATE-TIME\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tdateOnly = false;\r\n\t\t\t\t}\r\n\t\t\t} else if (aname.equals(\"TZID\"))\r\n\t\t\t{\r\n\t\t\t\ttzid = a.value;\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\t// TODO: anything else allowed here?\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString inDate = value;\r\n\r\n\t\tif (inDate.length() < 8)\r\n\t\t{\r\n\t\t\t// Invalid format\r\n\t\t\tthrow new ParseException(\"Invalid date format '\" + inDate + \"'\",\r\n\t\t\t\t\tinDate);\r\n\t\t}\r\n\r\n\t\t// Make sure all parts of the year are numeric.\r\n\t\tfor (int i = 0; i < 8; i++)\r\n\t\t{\r\n\t\t\tchar ch = inDate.charAt(i);\r\n\t\t\tif (ch < '0' || ch > '9')\r\n\t\t\t{\r\n\t\t\t\tthrow new ParseException(\r\n\t\t\t\t\t\t\"Invalid date format '\" + inDate + \"'\", inDate);\r\n\t\t\t}\r\n\t\t}\r\n\t\tyear = Integer.parseInt(inDate.substring(0, 4));\r\n\t\tmonth = Integer.parseInt(inDate.substring(4, 6));\r\n\t\tday = Integer.parseInt(inDate.substring(6, 8));\r\n\t\tif (day < 1 || day > 31 || month < 1 || month > 12)\r\n\t\t\tthrow new BogusDataException(\"Invalid date '\" + inDate + \"'\",\r\n\t\t\t\t\tinDate);\r\n\t\t// Make sure day of month is valid for specified month\r\n\t\tif (year % 4 == 0)\r\n\t\t{\r\n\t\t\t// leap year\r\n\t\t\tif (day > leapMonthDays[month - 1])\r\n\t\t\t{\r\n\t\t\t\tthrow new BogusDataException(\"Invalid day of month '\" + inDate\r\n\t\t\t\t\t\t+ \"'\", inDate);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t{\r\n\t\t\tif (day > monthDays[month - 1])\r\n\t\t\t{\r\n\t\t\t\tthrow new BogusDataException(\"Invalid day of month '\" + inDate\r\n\t\t\t\t\t\t+ \"'\", inDate);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// TODO: parse time, handle localtime, handle timezone\r\n\t\tif (inDate.length() > 8)\r\n\t\t{\r\n\t\t\t// TODO make sure dateOnly == false\r\n\t\t\tif (inDate.charAt(8) == 'T')\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\thour = Integer.parseInt(inDate.substring(9, 11));\r\n\t\t\t\t\tminute = Integer.parseInt(inDate.substring(11, 13));\r\n\t\t\t\t\tsecond = Integer.parseInt(inDate.substring(13, 15));\r\n\t\t\t\t\tif (hour > 23 || minute > 59 || second > 59)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new BogusDataException(\r\n\t\t\t\t\t\t\t\t\"Invalid time in date string '\" + inDate + \"'\",\r\n\t\t\t\t\t\t\t\tinDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (inDate.length() > 15)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tisUTC = inDate.charAt(15) == 'Z';\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (NumberFormatException nef)\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new BogusDataException(\r\n\t\t\t\t\t\t\t\"Invalid time in date string '\" + inDate + \"' - \"\r\n\t\t\t\t\t\t\t\t\t+ nef, inDate);\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\t// Invalid format\r\n\t\t\t\tthrow new ParseException(\r\n\t\t\t\t\t\t\"Invalid date format '\" + inDate + \"'\", inDate);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t{\r\n\t\t\t// Just date, no time\r\n\t\t\tdateOnly = true;\r\n\t\t}\r\n\r\n\t\tif (isUTC && !dateOnly)\r\n\t\t{\r\n\t\t\t// Use Joda Time to convert UTC to localtime\r\n\t\t\tDateTime utcDateTime = new DateTime(DateTimeZone.UTC);\r\n\t\t\tutcDateTime = utcDateTime.withDate(year, month, day).withTime(hour,\r\n\t\t\t\t\tminute, second, 0);\r\n\t\t\tDateTime localDateTime = utcDateTime.withZone(DateTimeZone\r\n\t\t\t\t\t.getDefault());\r\n\t\t\tyear = localDateTime.getYear();\r\n\t\t\tmonth = localDateTime.getMonthOfYear();\r\n\t\t\tday = localDateTime.getDayOfMonth();\r\n\t\t\thour = localDateTime.getHourOfDay();\r\n\t\t\tminute = localDateTime.getMinuteOfHour();\r\n\t\t\tsecond = localDateTime.getSecondOfMinute();\r\n\t\t} else if (tzid != null)\r\n\t\t{\r\n\t\t\tDateTimeZone tz = DateTimeZone.forID(tzid);\r\n\t\t\tif (tz != null)\r\n\t\t\t{\r\n\t\t\t\t// Convert to localtime\r\n\t\t\t\tDateTime utcDateTime = new DateTime(tz);\r\n\t\t\t\tutcDateTime = utcDateTime.withDate(year, month, day).withTime(\r\n\t\t\t\t\t\thour, minute, second, 0);\r\n\t\t\t\tDateTime localDateTime = utcDateTime.withZone(DateTimeZone\r\n\t\t\t\t\t\t.getDefault());\r\n\t\t\t\tyear = localDateTime.getYear();\r\n\t\t\t\tmonth = localDateTime.getMonthOfYear();\r\n\t\t\t\tday = localDateTime.getDayOfMonth();\r\n\t\t\t\thour = localDateTime.getHourOfDay();\r\n\t\t\t\tminute = localDateTime.getMinuteOfHour();\r\n\t\t\t\tsecond = localDateTime.getSecondOfMinute();\r\n\t\t\t\t// Since we have converted to localtime, remove the TZID\r\n\t\t\t\t// attribute\r\n\t\t\t\tthis.removeNamedAttribute(\"TZID\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tisUTC = false;\r\n\r\n\t\t// Add attribute that says date-only or date with time\r\n\t\tif (dateOnly)\r\n\t\t\taddAttribute(\"VALUE\", \"DATE\");\r\n\t\telse\r\n\t\t\taddAttribute(\"VALUE\", \"DATE-TIME\");\r\n\r\n\t}", "private Date stringToSQLDate(String fecha){\n\t\t\n\t\t\n\t\tint ano=Integer.parseInt(fecha.substring(0,4));\n\t\tint mes =Integer.parseInt(fecha.substring(5,7));\n\t\tint dia =Integer.parseInt( fecha.substring(8));\n\t\t\n\t\t@SuppressWarnings(\"deprecation\")\n\t\tDate tmp = new Date(ano-1900,mes-1,dia);\n\t\t\n\t\treturn tmp;\n\t}", "public static java.sql.Date StringToSqlDate(String StringValue){\n return java.sql.Date.valueOf(StringValue);\n }", "private LocalDate createDate(String date) {\n LocalDate localDate = LocalDate.parse(date);\n\n return localDate;\n }", "public static Date wccDateToDate(String strDate) {\n Date date = null;\n if ((null != strDate) && !strDate.trim().isEmpty()) {\n SimpleDateFormat sdf = new SimpleDateFormat(WccConstants.WCC_DATE_FORMAT);\n try {\n date = sdf.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }\n return date;\n }", "@Test public void testDateFormat() {\n String str = \"{dateField: 123456789}\";\n TestBean bean = JSONCoder.getGlobal().decode(str, TestBean.class);\n assertEquals(123456789L, bean.getDateField().getTime());\n\n str = \"{dateField: '1900-1-1'}\";\n bean = JSONCoder.getGlobal().decode(str, TestBean.class);\n assertEquals(\"1900-01-01\", new SimpleDateFormat(\"yyyy-MM-dd\").format(bean.getDateField()));\n\n str = \"{dateField: '1900-1-1 11:11:11'}\";\n bean = JSONCoder.getGlobal().decode(str, TestBean.class);\n assertEquals(\"1900-01-01 11:11:11\", new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(bean.getDateField()));\n\n str = \"{dateField: 'invalidDateFormat'}\";\n expectDecodeWithException(str, TestBean.class,\n \"java.text.ParseException: Unparseable date: \\\"invalidDateFormat\\\"\");\n }", "public static Date toDateFormat_2(String dateString) {\r\n\t\treturn stringToDate(dateString, DATE_FORMAT_2);\r\n\t}", "public static Date isoStringToDate(String d) {\n\t\tDateTime dt = XML_DATE_TIME_FORMAT.parseDateTime(d);\n\t\treturn dt.toDate();\n\t}" ]
[ "0.6909921", "0.6881368", "0.68681103", "0.6784058", "0.67214596", "0.66932607", "0.668448", "0.6682733", "0.66671634", "0.6661706", "0.6592853", "0.65484166", "0.6543475", "0.65428084", "0.65289915", "0.651658", "0.6513105", "0.6494011", "0.6493836", "0.64858776", "0.6470408", "0.6469805", "0.6460947", "0.64576787", "0.6447253", "0.6434062", "0.64340615", "0.64105904", "0.6410218", "0.6391713", "0.6390289", "0.6380305", "0.63720256", "0.6361005", "0.6352107", "0.63469964", "0.63419485", "0.631145", "0.6254166", "0.6250892", "0.6249973", "0.6221776", "0.62175876", "0.6203144", "0.61980873", "0.6162136", "0.6103184", "0.6090055", "0.6078048", "0.6074059", "0.6061212", "0.6054869", "0.60536975", "0.6030682", "0.60291886", "0.602588", "0.59707004", "0.59478825", "0.5937856", "0.59249735", "0.5909724", "0.58930194", "0.58909696", "0.5880642", "0.5874604", "0.5867961", "0.58676594", "0.5863864", "0.5859922", "0.584951", "0.58186316", "0.5817607", "0.58115727", "0.58088005", "0.58052105", "0.58025336", "0.5799303", "0.57977706", "0.57949126", "0.5793776", "0.5779818", "0.57681537", "0.5765932", "0.5756428", "0.5750809", "0.572626", "0.5718425", "0.56955564", "0.56736475", "0.5669833", "0.5659281", "0.5647579", "0.5633523", "0.56289494", "0.56265104", "0.56203026", "0.5620042", "0.5608438", "0.55900943", "0.5589155" ]
0.60682964
50
Converts Date given as String to date given as object.
public Date convertStringToDate(String dateToParse, String format) { SimpleDateFormat formatter = new SimpleDateFormat(format); Date result = null; try { result = formatter.parse(dateToParse); } catch (Exception exception1) { System.err.println( String.format("ERROR, converting from String %s to date with format %s", dateToParse, format) ); result = null; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Date convertStringToDate(String strDate)\n\t {\n\t Date myDate = null;\n\t if (strDate.length() > 0)\n\t {\n\t DateFormat formatter = new SimpleDateFormat(EProcurementConstants.INPUT_DATE_FORMAT);\n\t try\n\t {\n\t myDate = formatter.parse(strDate);\n\t } catch (ParseException e)\n\t {\n\t LOGGER.error(\"Not able to parse \" + strDate + \" into date ..\" + e.getMessage());\n\t }\n\t }\n\t return myDate;\n\t }", "public static Date toDate(String dateStr, SimpleDateFormat format) throws ParseException {\r\n\t\treturn format.parse(dateStr);\r\n\t}", "private Date convertStringToDate(String dateInString){\n DateFormat format = new SimpleDateFormat(\"d-MM-yyyy HH:mm\", Locale.ENGLISH);\n Date date = null;\n try {\n date = format.parse(dateInString);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return date;\n }", "public static Date parseDate(String date) {\n return DateUtil.toDate(date);\n }", "public static Date stringToDate(String date)\r\n/* 29: */ {\r\n/* 30: 39 */ log.debug(\"DateUtil.stringToDate()\");\r\n/* 31: */ try\r\n/* 32: */ {\r\n/* 33: 41 */ return sdfDate.parse(date);\r\n/* 34: */ }\r\n/* 35: */ catch (ParseException e)\r\n/* 36: */ {\r\n/* 37: 43 */ log.fatal(\"DateUtil.stringToDate抛出异常\", e);\r\n/* 38: */ }\r\n/* 39: 44 */ return new Date();\r\n/* 40: */ }", "public static Date strToDate(String strDate)\r\n/* 127: */ {\r\n/* 128:178 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 129:179 */ ParsePosition pos = new ParsePosition(0);\r\n/* 130:180 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 131:181 */ return strtodate;\r\n/* 132: */ }", "public static Date GetDateObjectFromString(String dateAsString) {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tDate tempDate = null;\n\t\ttry {\n\t\t\tif (dateAsString != null && !dateAsString.equalsIgnoreCase(\"null\"))\n\t\t\t\ttempDate = sdf.parse(dateAsString);\n\t\t} catch (Exception e) {\n\t\t\t// do some error reporting here\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn tempDate;\n\t}", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static Date String2Date(String date){\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n Date currentDate = null;\n try {\n currentDate = format.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return currentDate;\n }", "public Date convertStringToDate(String s) throws ParseException {\n\t\tDate dateTime = SDF.parse(s);\n\t\treturn dateTime;\n\t}", "public static Date convertStringToDate(String date) throws ParseException {\n\t return new SimpleDateFormat(\"yyyy-MM-dd\").parse(date); \n\t}", "public static Date stringToDate(String dateString) {\n for(String format: DATE_FORMATS){\n try {\n return new SimpleDateFormat(format).parse(dateString);\n }\n catch (Exception e){}\n }\n throw new IllegalArgumentException(\"Date is not parsable\");\n }", "public static java.util.Date convertFromStringToDate(String strDate){\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd-MMM-yyyy\"); /*This stringDate is come from UI*/\n\t\tjava.util.Date date = null;\n\t\tif(strDate != null && !strDate.trim().isEmpty()){\n\t\t\ttry {\n\t\t\t\tdate = format.parse(strDate);\n\t\t\t\tSystem.out.println(strDate);\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\n\t\treturn date;\n\t}", "public static Date stringToDate (String s) {\n\t\tint year=0 , month=0 , date=0;\n\t\tCalendar cal = Calendar.getInstance(Locale.getDefault());\n\t\t\n\t\tStringTokenizer st = new StringTokenizer (s,\"/\");\n\t\t\n\t\tdate = Integer.parseInt(st.nextToken());\n\t\tmonth = Integer.parseInt(st.nextToken());\n\t\tyear = Integer.parseInt(st.nextToken());\n\t\tcal.clear();\n\t\tcal.set(year,month-1,date);\n\t\t//System.out.println(\"\\nDate : \"+getStringFromDate(cal.getTime()));\n\t\treturn (Date)cal.getTime().clone();\n\t}", "public static Date convertStringToDate(String strDate)\n\t\t\tthrows ParseException {\n\t\tDate aDate = null;\n\n\t\ttry {\n\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\tlog.debug(\"converting date with pattern: \" + getDatePattern());\n\t\t\t}\n\n\t\t\taDate = convertStringToDate(getDatePattern(), strDate);\n\t\t} catch (ParseException pe) {\n\t\t\tlog.error(\"Could not convert '\" + strDate\n\t\t\t\t\t+ \"' to a date, throwing exception\");\n\t\t\tpe.printStackTrace();\n\t\t\tthrow new ParseException(pe.getMessage(), pe.getErrorOffset());\n\t\t}\n\n\t\treturn aDate;\n\t}", "public static Date parseDate(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateFormat());\n\t}", "@SuppressWarnings(\"deprecation\")\n\tpublic static Date getDateForString(String dateString) {\n\t\tString[] separation1 = dateString.split(\" \");\n\t\tString[] separation2 = separation1[0].split(\"/\");\n\t\tString[] separation3 = separation1[1].split(\":\");\n\t\treturn new Date(Integer.parseInt(separation2[2])-1900, (Integer.parseInt(separation2[1])-1), Integer.parseInt(separation2[0]), Integer.parseInt(separation3[0]), Integer.parseInt(separation3[1]), Integer.parseInt(separation3[2]));\n\t}", "public static Date stringToDate(String dateAsString){\r\n try { \r\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\"); \r\n return df.parse(dateAsString);\r\n } catch (ParseException ex) {\r\n ex.printStackTrace();\r\n return null;\r\n }\r\n }", "private Date stringToDate(String s) throws ParseException{\r\n\t\tSimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT);\r\n\t\treturn fmt.parse(s);\r\n\t}", "public static Date StringToDate(String dateString) {\n int y = new Integer(dateString.substring(0, 4));\n int m = new Integer(dateString.substring(4, 6));\n int d = new Integer(dateString.substring(6, 8));\n int h = new Integer(dateString.substring(8, 10));\n int min = new Integer(dateString.substring(10, 12));\n\n try {\n Calendar convCal = Calendar.getInstance();\n convCal.set(y, m - 1, d, h, min);\n Date date = convCal.getTime();\n\n return date;\n } catch (Exception ex) {\n System.out.println(\"BwInfo.convertStringToDate() \" + ex);\n return null;\n }\n\n }", "public static Date toDate(Object obj) {\n return toDate(obj, (String) null, (TimeZone) null);\n }", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\n }", "@Test\n\t@DisplayName(\"string to date\")\n\tpublic void testStringToDate() throws ParseException\n\t{\n\t\tDateConverter d = new DateConverter(string1);\n\t\t\n\t\tString dateInString = \"1997-03-19\";\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\ttry {\n\t\t date1 = formatter.parse(dateInString);\n\t\t} catch (ParseException e) {\n\t\t //handle exception if date is not in \"dd-MMM-yyyy\" format\n\t\t}\n\t\tassertEquals(date1, d.getDate());\n\t}", "public static Date fromString(String fullDate) {\n\t\tString[] parsed = fullDate.split(\",\");\n\t\tif (parsed.length != 3 && parsed.length != 5) {\n\t\t\tthrow new InvalidParsingStringException(Date.class.getName());\n\t\t}\n\t\tDate date = new Date();\n\t\tdate.setYear(Integer.valueOf(parsed[0]));\n\t\tdate.setMonth(Integer.valueOf(parsed[1]));\n\t\tdate.setDay(Integer.valueOf(parsed[2]));\n\t\tif (parsed.length == 5) {\n\t\t\tdate.setHour(Integer.valueOf(parsed[3]));\n\t\t\tdate.setMin(Integer.valueOf(parsed[4]));\n\t\t}\n\t\treturn date;\n\t}", "public static Date GetDateObjectFromStringUpdate(String dateAsString) {\n\t\tSimpleDateFormat lv_formatter = new SimpleDateFormat(\n\t\t\t\t\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tlv_formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\tDate tempDate = null;\n\t\ttry {\n\t\t\tif (dateAsString != null && !dateAsString.equalsIgnoreCase(\"null\"))\n\t\t\t\ttempDate = lv_formatter.parse(dateAsString);\n\t\t} catch (Exception e) {\n\t\t\t// do some error reporting here\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn tempDate;\n\t}", "public static Date convertirStringADateUtil(String s){\n\t\tFORMATO_FECHA.setLenient(false);\n\t\tDate fecha = null;\n\t\ttry {\n\t\t\tfecha = FORMATO_FECHA.parse(s);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn fecha;\n\t}", "public static java.sql.Date convertToSDate(String dateInString) {\n\t\tif (dateInString == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\tjava.util.Date uDate = null;\n\t\t\tjava.sql.Date sDate = null;\n\t\t\ttry {\n\t\t\t\tuDate = dateFormat.parse(dateInString);\n\t\t\t\tsDate = new java.sql.Date(uDate.getTime());\n\t\t\t} catch (ParseException e) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn sDate;\n\t\t}\n\t}", "private Date deserializeToDate(String object) {\n synchronized (this) {\n Object object2;\n boolean bl2;\n Object object3 = this.dateFormats;\n object3 = object3.iterator();\n while (bl2 = object3.hasNext()) {\n object2 = object3.next();\n object2 = (DateFormat)object2;\n try {\n return ((DateFormat)object2).parse((String)object);\n }\n catch (ParseException parseException) {\n }\n }\n try {\n bl2 = false;\n object2 = null;\n object3 = new ParsePosition(0);\n return ISO8601Utils.parse((String)object, (ParsePosition)object3);\n }\n catch (ParseException object22) {\n object2 = new JsonSyntaxException((String)object, object22);\n throw object2;\n }\n }\n }", "public static Date createDate(String dateStr) throws ParseException {\n\t\tSimpleDateFormat date = new SimpleDateFormat(\"yyyy/MM/dd\");\n\t\treturn date.parse(dateStr);\n\t}", "public static Date date(String str) throws Exception {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\n return sdf.parse( str );\n }", "public static Date stringToDate(String string_date){\n Date myDate = null;\n \n try {\n java.util.Date utilDate = new SimpleDateFormat(\"yyyy-MM-dd\").parse(string_date);\n myDate = new java.sql.Date(utilDate.getTime());\n } catch (Exception e) {\n // Si hay una excepcion se imprime un mensaje\n System.err.println(e.getMessage());\n }\n \n return myDate;\n }", "public static Date stringToDate(String date) {\n\t\tDate result = null;\n\t\tif (date != null && !\"\".equals(date)) {\n\t\t\tDateTimeFormatter f = DateTimeFormat.forPattern(SmartMoneyConstants.DATE_FORMAT);\n\t\t\tDateTime dateTime = f.parseDateTime(date);\n\t\t\tresult = dateTime.toDate();\n\t\t}\n\n\t\treturn result;\n\t}", "public static Date convertStringToDate(String stringDate) {\n\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\"); \n\t\tDate startDate = null;\n\n\t\ttry {\n\t\t startDate = df.parse(stringDate);\n\n\t\t} catch (ParseException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t\treturn startDate;\n\t\t\n\t}", "public Date stringToDate(String date) throws ParseException {\n String[] splitDate = date.split(\"T\");\n String day = splitDate[0];\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date dayDate = dateFormat.parse(day);\n return dayDate;\n }", "public static Date StringToDate(String strFecha) throws ParseException {\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n return simpleDateFormat.parse(strFecha);\r\n }", "public Date(String sDate) {\r\n\t\tint m, d, y;\r\n\t\tString[] chopDate = sDate.split(\"-\");\r\n\t\tm = Integer.parseInt(chopDate[ZEROI]);\r\n\t\td = Integer.parseInt(chopDate[ONEI]);\r\n\t\ty = Integer.parseInt(chopDate[TWOI]);\r\n\t\tif (!isValid(m, d, y))\r\n\t\t\tthrow new RuntimeException(\"Invalid date\");\r\n\t\tmonth = m;\r\n\t\tday = d;\r\n\t\tyear = y;\r\n\t}", "public static Date convertStringToDate(String dateString) {\n\t\tLocalDate date = null;\n\t\t\n\t\ttry {\n\t\t\tDateTimeFormatter formatter = DateTimeFormatter.ofPattern(Constants.ddmmyyydateFormatInCSV);\n\t\t\tdate = LocalDate.parse(dateString, formatter);\n\n\t\t} catch (DateTimeParseException ex) {\n\t\t\tthrow new SalesException(\"enter the proper date in \" + Constants.ddmmyyydateFormatInCSV + \" format\");\n\t\t} catch (SalesException ex) {\n\t\t\tthrow new SalesException(\"Recevied excepion during date parser \" + ex.getMessage());\n\t\t}\n\t\treturn Date.valueOf(date);\n\t}", "public Date getConvertedDate(String dateToBeConverted) {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yy hh:mm:ss\");\n\t\ttry{\n\t\t\tbookedDate = sdf.parse(dateToBeConverted);\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn bookedDate;\n\t}", "public static Date parseDate(String s) {\n\t\tDate d = null;\n\t\tif (s == null) {\n\t\t\treturn d;\n\t\t}\n\n\t\tString pattern = \"\";\n\n\t\tif (s.indexOf(':') >= 0) {\n\t\t\tif (s.length() > 20) {\n\t\t\t\tpattern = \"yyyy-MM-dd HH:mm:ss.SSS\";\n\t\t\t} else {\n\t\t\t\tif (s.lastIndexOf(':') != s.indexOf(':'))\n\t\t\t\t\tpattern = DD_MM_YYYY_HH_MM_SS;\n\t\t\t\telse\n\t\t\t\t\tpattern = \"dd/MM/yyyy HH:mm\";\n\t\t\t}\n\t\t} else {\n\t\t\tpattern = DD_MM_YYYY;\n\t\t}\n\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(pattern);\n\t\tsdf.setTimeZone(TimeZone.getDefault());\n\t\tif (s.length() > 0) {\n\t\t\ttry {\n\t\t\t\td = sdf.parse(s);\n\t\t\t} catch (ParseException e) {\n\t\t\t\tthrow new FenixException(\"Errore nella conversione della data. \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\treturn d;\n\t}", "public Date parseString(String dateString) throws ParseException {\n return dateFormat.parse(dateString);\n }", "public Date stringToDate(String d)\n\t{\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"MMM-yyyy\");\n\t\t\n\t\tDate date = new Date();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tdate = format.parse(d);\n\t\t} \n\t\tcatch (ParseException e) \n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "public static Date parseDate(String date) {\r\n return parseDateWithPattern(date, \"dd/MM/yyyy\");\r\n }", "public static HISDate valueOf(String datStr) throws HISDateException {\r\n return HISDate.valueOf(datStr, null);\r\n }", "public static Date convertString2Date(String strTime) {\r\n\t\t Calendar calendar = Calendar.getInstance();\r\n\t\t calendar.setTimeInMillis(Long.valueOf(strTime));\r\n\t\t return calendar.getTime();\r\n\t}", "public static java.util.Date convertToUDate(String dateInString) {\n\t\tif (dateInString == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\tjava.util.Date uDate = null;\n\t\t\ttry {\n\t\t\t\tuDate = dateFormat.parse(dateInString);\n\t\t\t} catch (ParseException e) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn uDate;\n\t\t}\n\t}", "public static Date parseDate(String date)\n {\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date dt = null;\n try {\n dt = format.parse(date);\n } \n catch (ParseException ex) \n {\n System.out.println(\"Unexpected error during the conversion - \" + ex);\n }\n return dt;\n }", "public static Date FormatStringToDate(String dateString) {\r\n SimpleDateFormat dF = new SimpleDateFormat(\"dd/mm/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateString);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n return date;\r\n }", "public static Date dateFromShortString(String dateString) {\n SimpleDateFormat fmt = new SimpleDateFormat(\"dd-MMM-yyyy\", Locale.getDefault());\n try {\n return fmt.parse(dateString);\n } catch (ParseException e) {\n e.printStackTrace();\n return new Date();\n }\n }", "public static Date stringToDate(String date) throws InvalidDateException{\n DateFormat format = new SimpleDateFormat(Constants.BIRTH_DATE_FORMAT);\n format.setLenient(false); //é uma flag para que a data esteja sempre entre os limites corretos\n try {\n return format.parse(date);\n } catch (ParseException ignored) {\n throw new InvalidDateException(\"Invalid date\");\n }\n }", "public Date parseDate(String date, String format) {\n return this.convertStringToDate(date, format);\n }", "@Override\n\tpublic Date convert(String source) {\n\t\tif (StringUtils.isValid(source)) {\n\t\t\tDateFormat dateFormat;\n\t\t\tif (source.indexOf(\":\") != -1) {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t} else {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd\"); \n\t\t\t}\n\t\t\t//日期转换为严格模式\n\t\t dateFormat.setLenient(false); \n\t try {\n\t\t\t\treturn dateFormat.parse(source);\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t}\n\t\treturn null;\n\t}", "private Date parseStringToDate(String date) {\n Date resultDate = null;\n if (date.contains(TODAY) || date.contains(YESTERDAY)) {\n String[] dateStrings = date.split(\",\");\n if (dateStrings[0].equalsIgnoreCase(TODAY)) {\n Calendar today = Calendar.getInstance();\n resultDate = today.getTime();\n } else if (dateStrings[0].equalsIgnoreCase(YESTERDAY)) {\n Calendar yesterday = Calendar.getInstance();\n yesterday.add(Calendar.DATE, MINUS_DAY);\n resultDate = yesterday.getTime();\n }\n } else {\n SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n try {\n resultDate = formatter.parse(date);\n } catch (ParseException e) {\n LOG.error(e.getMessage(), e);\n }\n }\n return resultDate;\n }", "public static Date strToTime(String strDate)\r\n/* 135: */ {\r\n/* 136:192 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n/* 137:193 */ ParsePosition pos = new ParsePosition(0);\r\n/* 138:194 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 139:195 */ return strtodate;\r\n/* 140: */ }", "private static Date toDate(final Object value, final String identifier) throws ParseException {\n if (value == null) {\n return null;\n }\n if (value instanceof Number) {\n return new Date(((Number) value).longValue());\n }\n final String t = (String) value;\n if (t.indexOf('-') < 0) try {\n return new Date(Long.valueOf(t));\n } catch (NumberFormatException e) {\n throw new ParseException(\"Illegal date: \" + value + \" (property:\" + identifier +\")\", e);\n }\n try {\n synchronized (JsonMetadataConstants.DATE_FORMAT) {\n return JsonMetadataConstants.DATE_FORMAT.parse((String) value);\n }\n } catch (java.text.ParseException e) {\n throw new ParseException(\"Illegal date: \" + value + \" (property:\" + identifier +\")\", e);\n }\n }", "@TypeConverter\n public static Date toDate(String value) {\n if (value == null) return null;\n\n try {\n return df.parse(value);\n } catch (ParseException e) {\n e.printStackTrace();\n return null;\n }\n }", "protected static Date parseDate(String dateStr) {\n if (dateStr != null) {\n try {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n return df.parse(dateStr);\n }\n catch (Exception e) {\n throw new IllegalArgumentException(\"Expected date in format yyyy-MM-dd but got \" + dateStr, e);\n }\n }\n return null;\n }", "public static Date toDate(Object obj, String pattern) {\n return toDate(obj, pattern, (TimeZone) null);\n }", "public static synchronized Date parseDate(String s) throws ParseException {\n return dateFormat.parse(s);\n }", "private static String convertDate(String dateString) {\n String date = null;\n\n try {\n //Parse the string into a date variable\n Date parsedDate = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\").parse(dateString);\n\n //Now reformat it using desired display pattern:\n date = new SimpleDateFormat(DATE_FORMAT).format(parsedDate);\n\n } catch (ParseException e) {\n Log.e(TAG, \"getDate: Error parsing date\", e);\n e.printStackTrace();\n }\n\n return date;\n }", "public static Date parseDate(DateFormat format, String dateStr) throws ParseException {\n\t\tDate date = null;\n\t\tif (dateStr != null && !dateStr.isEmpty()) {\n\t\t\tdate = format.parse(dateStr);\n\t\t}\n\t\treturn date;\n\t}", "public Date parseDateFromString(final String dateString) {\r\n\t\tDateFormat df = getDateTimeFormat();\r\n\t\tsynchronized (df) {\r\n\t\t\ttry {\r\n\t\t\t\treturn df.parse(dateString);\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t\tDominoUtils.handleException(e);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Date(String date) {\n String[] fields = date.split(\"/\");\n if (fields.length != 3) {\n throw new IllegalArgumentException(\"Invalid date\");\n }\n month = Integer.parseInt(fields[0]);\n day = Integer.parseInt(fields[1]);\n year = Integer.parseInt(fields[2]);\n if (!isValid(month, day, year)) throw new IllegalArgumentException(\"Invalid date\");\n }", "private Date stringToDate(String datum)\r\n\t{\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd.MM.yyyy\");\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDate d = df.parse(datum);\r\n\t\t\treturn d;\r\n\t\t}\r\n\t\tcatch (ParseException e)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Test\n\t@DisplayName(\"date to string\")\n\tpublic void testDateToString()\n\t{\n\t\tString dateInString = \"2000-04-12\";\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\ttry {\n\t\t date1 = formatter.parse(dateInString);\n\t\t} catch (ParseException e) {\n\t\t //handle exception if date is not in \"dd-MMM-yyyy\" format\n\t\t}\n\t\tDateConverter s = new DateConverter(date1);\n\t\tassertEquals(\"2000-04-12\", s.getDateAsString());\n\t}", "public static native JsDate create(String dateString) /*-{\n return new Date(dateString);\n }-*/;", "public static Date toDateFormat_1(String dateString) {\r\n\t\treturn stringToDate(dateString, DATE_FORMAT_1);\r\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 }", "private Date convertMongoToDate(String dateString, String timeString) {\n int year = Integer.parseInt(dateString.substring(0, 4));\n //Log.e(\"KARA\", \"year \" + year);\n int month = Integer.parseInt(dateString.substring(5, 7));\n //Log.e(\"KARA\", \"month \" + month);\n int day = Integer.parseInt(dateString.substring(8, 10));\n //Log.e(\"KARA\", \"day \" + day);\n int hour = Integer.parseInt(timeString.substring(0, 2));\n //Log.e(\"KARA\", \"hour \" + hour);\n int min = Integer.parseInt(timeString.substring(3, 5));\n return new Date(year - 1900, month - 1, day, hour, min);\n }", "public static Date convert(String timeString){\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MMM/yyyy:HH:mm:ss ZZZZ\");\n // set default timezone to be runtime independent\n TimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"));\n try {\n return dateFormat.parse(timeString);\n } catch (ParseException e) {\n LOGGER.log(Level.SEVERE, \"Date cannot be parsed: \"+ timeString, e);\n return null;\n }\n }", "public static Date de_STRING_a_DATE(String fechaEnString) {\n SimpleDateFormat miFormato2 = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date fechaenjava = null;\n try {\n fechaenjava = miFormato2.parse(fechaEnString);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return fechaenjava;\n }", "public Calendar convertFromString(String stringDate) {\n Calendar dateVacancy = Calendar.getInstance();\n dateVacancy.set(Calendar.MILLISECOND, 0); //remove milliseconds\n if (months.isEmpty()) {\n fillMap();\n }\n if (stringDate.contains(TODAY)) {\n year = Calendar.getInstance().get(Calendar.YEAR);\n month = Calendar.getInstance().get(Calendar.MONTH);\n day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n dateVacancy.set(year, month, day);\n } else if (stringDate.contains(YESTERDAY)) {\n year = Calendar.getInstance().get(Calendar.YEAR);\n month = Calendar.getInstance().get(Calendar.MONTH);\n day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n dateVacancy.set(year, month, day - 1);\n } else {\n stringDate = stringDate.substring(0, 9);\n String monthStr = stringDate.substring(stringDate.length() - 7, stringDate.length() - 3).trim();\n this.year = convertToYear(stringDate);\n this.month = months.get(monthStr);\n this.day = convertToDay(stringDate);\n dateVacancy.set(year, month, day);\n }\n return dateVacancy;\n }", "public Date createDate(String strDate){\n\n Date date = null;\n\n // Get time\n Calendar cal = Calendar.getInstance();\n Date currentLocalTime = cal.getTime();\n DateFormat dateformat = new SimpleDateFormat(\"HH:mm:ss\");\n String localTime = dateformat.format(currentLocalTime);\n\n // Concat strings\n String tmpDate = strDate + \" \" + localTime;\n //\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n try {\n date = format.parse(tmpDate);\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return date;\n }", "private static Date getDate(String sdate)\n\t{\n\t\tDate date = null;\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\ttry {\n\t\t\tdate = formatter.parse(sdate);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn date;\n\t}", "public E_Date(String value) throws ParseException {\n\t\tsuper(DATE_TIME.parse(value).toDate());\n\t}", "public Date ToDate(String line){\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy/MM/dd\");\n try {\n Date d = sdf.parse(line);\n return d;\n } catch (ParseException ex) {\n\n Log.v(\"Exception\", ex.getLocalizedMessage());\n return null;\n }\n }", "public static Date toDate(Object obj, String pattern, TimeZone timeZone) {\n if (obj == null) {\n return null;\n } else if (obj instanceof String) {\n return toDateFromString((String) obj, pattern, timeZone);\n } else if (obj instanceof Date) {\n final Date paramDate = (Date) obj;\n if (Date.class.equals(paramDate.getClass())) { // pure date\n return paramDate;\n } else { // sub class\n // because the Date is not final class.\n final Date date = new Date();\n date.setTime(paramDate.getTime());\n return date;\n }\n } else if (obj instanceof Calendar) {\n return ((Calendar) obj).getTime();\n } else if (obj instanceof byte[]) {\n return toDate(toSerializable((byte[]) obj)); // recursive\n } else if (obj instanceof Long) {\n return new Date((Long) obj);\n } else {\n return toDateFromString(obj.toString(), pattern, timeZone);\n }\n }", "public static Date getDateFromString(String date) {\r\n Date newdate = null;\r\n SimpleDateFormat dateformat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n\r\n try {\r\n newdate = dateformat.parse(date);\r\n System.out.println(newdate);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return newdate;\r\n }", "public Date formatForDate(String data) throws ParseException{\n //definindo a forma da Data Recebida\n DateFormat formatUS = new SimpleDateFormat(\"dd-MM-yyyy\");\n return formatUS.parse(data);\n }", "private static final Date convertStringToDate(String aMask, String strDate) {\n SimpleDateFormat df = null;\n Date date = null;\n df = new SimpleDateFormat(aMask);\n try {\n date = df.parse(strDate);\n } catch (ParseException pe) {\n throw new ValidateException(\"日期转换出现异常,\"+pe.getMessage(), pe);\n }\n\n return (date);\n }", "public static Date converteStringInvertidaSemBarraAAMMDDParaDate(String data) {\r\n\t\tDate retorno = null;\r\n\r\n\t\tString dataInvertida = data.substring(4, 6) + \"/\" + data.substring(2, 4) + \"/20\" + data.substring(0, 2);\r\n\r\n\t\tSimpleDateFormat dataTxt = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t\ttry {\r\n\t\t\tretorno = dataTxt.parse(dataInvertida);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tthrow new IllegalArgumentException(data + \" não tem o formato dd/MM/yyyy.\");\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "@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}", "public void parseDate(String d)\n {\n\tdate.set(d);\n String [] dateList = d.split(\"-\");\n \n year.set(Integer.valueOf(dateList[0]));\n month.set(Integer.valueOf(dateList[1]));\n day.set(Integer.valueOf(dateList[2]));\n }", "public static Date toDate(final String data, final String sFormat, final Locale locale) {\n final SimpleDateFormat formato = new SimpleDateFormat(sFormat, locale == null ? getLocale(CalendarParams.LOCALE_PT) : locale);\n Date date = null;\n try {\n date = formato.parse(data);\n } catch (ParseException e) {\n // LOG.error(\"Date dont convert \", e);\n System.out.println(e.getMessage());\n }\n return date;\n }", "public static Date converteStringInvertidaSemBarraAAAAMMDDParaDate(String data) {\r\n\t\tDate retorno = null;\r\n\r\n\t\tString dataInvertida = data.substring(6, 8) + \"/\" + data.substring(4, 6) + \"/\" + data.substring(0, 4);\r\n\r\n\t\tSimpleDateFormat dataTxt = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t\ttry {\r\n\t\t\tretorno = dataTxt.parse(dataInvertida);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tthrow new IllegalArgumentException(data + \" não tem o formato dd/MM/yyyy.\");\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "public static LocalDate stringToDate(String inputStringDate) {\n\t\treturn LocalDate.parse(inputStringDate);\n\t}", "public static Date convertStringToDate(String aMask, String strDate)\n\t\t\tthrows ParseException {\n\t\tSimpleDateFormat df;\n\t\tDate date;\n\t\tdf = new SimpleDateFormat(aMask);\n\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"converting '\" + strDate + \"' to date with mask '\"\n\t\t\t\t\t+ aMask + \"'\");\n\t\t}\n\n\t\ttry {\n\t\t\tdate = df.parse(strDate);\n\t\t} catch (ParseException pe) {\n\t\t\t// log.error(\"ParseException: \" + pe);\n\t\t\tthrow new ParseException(pe.getMessage(), pe.getErrorOffset());\n\t\t}\n\n\t\treturn (date);\n\t}", "public static Date parseDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateTimeFormat());\n\t}", "public static String parseDate(String input) {\n String year = input.substring(0, 4);\n String month = input.substring(5, 7);\n String day = input.substring(8, 10);\n return year + \"-\" + month + \"-\" + day;\n }", "@Test\n void test7(){\n\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = new Date();\n String dString = formatter.format(date);\n System.out.println(\"dString=\"+dString);\n\n Date datas = java.sql.Date.valueOf(dString);\n System.out.println(\"datas=\"+datas);\n\n\n }", "private Date parseDate(String text) throws Exception {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n return dateFormat.parse(text);\n }", "public Date parseDate(String date) {\t\t\n\t\ttry{\n\t\t\tDate d2 = sdf.parse(date);\n\t\t\t//String month = parseMonth(date);\n\t\t\t//cal.setTime(d2);\t\t\t\n\t\t\t//months.put(month, new Integer(cal.get(Calendar.MONTH) + 1));\t\t\t\n\t\t\treturn d2;\n\t\t} catch(ParseException e){\n\t\t\tSystem.out.println(\"Invalid Date Format or No Such Date : \" + date + \". Message: \" + e.getMessage() );\n\t\t\treturn null;\n\t\t}\n\t}", "public static Date parseDate(String date) throws java.text.ParseException {\n if(date == null) return null;\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n try {\n return sdf.parse(date);\n\n } catch(ParseException e) {\n sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\n try {\n return sdf.parse(date);\n\n } catch(ParseException e2) {\n sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n return sdf.parse(date);\n }\n } \n }", "public Date(String icalStr) throws ParseException, BogusDataException\r\n\t{\r\n\t\tsuper(icalStr);\r\n\r\n\t\tyear = month = day = 0;\r\n\t\thour = minute = second = 0;\r\n\r\n\t\tfor (int i = 0; i < attributeList.size(); i++)\r\n\t\t{\r\n\t\t\tAttribute a = attributeAt(i);\r\n\t\t\tString aname = a.name.toUpperCase(Locale.ENGLISH);\r\n\t\t\tString aval = a.value.toUpperCase(Locale.ENGLISH);\r\n\t\t\t// TODO: not sure if any attributes are allowed here...\r\n\t\t\t// Look for VALUE=DATE or VALUE=DATE-TIME\r\n\t\t\t// DATE means untimed for the event\r\n\t\t\tif (aname.equals(\"VALUE\"))\r\n\t\t\t{\r\n\t\t\t\tif (aval.equals(\"DATE\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tdateOnly = true;\r\n\t\t\t\t} else if (aval.equals(\"DATE-TIME\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tdateOnly = false;\r\n\t\t\t\t}\r\n\t\t\t} else if (aname.equals(\"TZID\"))\r\n\t\t\t{\r\n\t\t\t\ttzid = a.value;\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\t// TODO: anything else allowed here?\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString inDate = value;\r\n\r\n\t\tif (inDate.length() < 8)\r\n\t\t{\r\n\t\t\t// Invalid format\r\n\t\t\tthrow new ParseException(\"Invalid date format '\" + inDate + \"'\",\r\n\t\t\t\t\tinDate);\r\n\t\t}\r\n\r\n\t\t// Make sure all parts of the year are numeric.\r\n\t\tfor (int i = 0; i < 8; i++)\r\n\t\t{\r\n\t\t\tchar ch = inDate.charAt(i);\r\n\t\t\tif (ch < '0' || ch > '9')\r\n\t\t\t{\r\n\t\t\t\tthrow new ParseException(\r\n\t\t\t\t\t\t\"Invalid date format '\" + inDate + \"'\", inDate);\r\n\t\t\t}\r\n\t\t}\r\n\t\tyear = Integer.parseInt(inDate.substring(0, 4));\r\n\t\tmonth = Integer.parseInt(inDate.substring(4, 6));\r\n\t\tday = Integer.parseInt(inDate.substring(6, 8));\r\n\t\tif (day < 1 || day > 31 || month < 1 || month > 12)\r\n\t\t\tthrow new BogusDataException(\"Invalid date '\" + inDate + \"'\",\r\n\t\t\t\t\tinDate);\r\n\t\t// Make sure day of month is valid for specified month\r\n\t\tif (year % 4 == 0)\r\n\t\t{\r\n\t\t\t// leap year\r\n\t\t\tif (day > leapMonthDays[month - 1])\r\n\t\t\t{\r\n\t\t\t\tthrow new BogusDataException(\"Invalid day of month '\" + inDate\r\n\t\t\t\t\t\t+ \"'\", inDate);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t{\r\n\t\t\tif (day > monthDays[month - 1])\r\n\t\t\t{\r\n\t\t\t\tthrow new BogusDataException(\"Invalid day of month '\" + inDate\r\n\t\t\t\t\t\t+ \"'\", inDate);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// TODO: parse time, handle localtime, handle timezone\r\n\t\tif (inDate.length() > 8)\r\n\t\t{\r\n\t\t\t// TODO make sure dateOnly == false\r\n\t\t\tif (inDate.charAt(8) == 'T')\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\thour = Integer.parseInt(inDate.substring(9, 11));\r\n\t\t\t\t\tminute = Integer.parseInt(inDate.substring(11, 13));\r\n\t\t\t\t\tsecond = Integer.parseInt(inDate.substring(13, 15));\r\n\t\t\t\t\tif (hour > 23 || minute > 59 || second > 59)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new BogusDataException(\r\n\t\t\t\t\t\t\t\t\"Invalid time in date string '\" + inDate + \"'\",\r\n\t\t\t\t\t\t\t\tinDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (inDate.length() > 15)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tisUTC = inDate.charAt(15) == 'Z';\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (NumberFormatException nef)\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new BogusDataException(\r\n\t\t\t\t\t\t\t\"Invalid time in date string '\" + inDate + \"' - \"\r\n\t\t\t\t\t\t\t\t\t+ nef, inDate);\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\t// Invalid format\r\n\t\t\t\tthrow new ParseException(\r\n\t\t\t\t\t\t\"Invalid date format '\" + inDate + \"'\", inDate);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t{\r\n\t\t\t// Just date, no time\r\n\t\t\tdateOnly = true;\r\n\t\t}\r\n\r\n\t\tif (isUTC && !dateOnly)\r\n\t\t{\r\n\t\t\t// Use Joda Time to convert UTC to localtime\r\n\t\t\tDateTime utcDateTime = new DateTime(DateTimeZone.UTC);\r\n\t\t\tutcDateTime = utcDateTime.withDate(year, month, day).withTime(hour,\r\n\t\t\t\t\tminute, second, 0);\r\n\t\t\tDateTime localDateTime = utcDateTime.withZone(DateTimeZone\r\n\t\t\t\t\t.getDefault());\r\n\t\t\tyear = localDateTime.getYear();\r\n\t\t\tmonth = localDateTime.getMonthOfYear();\r\n\t\t\tday = localDateTime.getDayOfMonth();\r\n\t\t\thour = localDateTime.getHourOfDay();\r\n\t\t\tminute = localDateTime.getMinuteOfHour();\r\n\t\t\tsecond = localDateTime.getSecondOfMinute();\r\n\t\t} else if (tzid != null)\r\n\t\t{\r\n\t\t\tDateTimeZone tz = DateTimeZone.forID(tzid);\r\n\t\t\tif (tz != null)\r\n\t\t\t{\r\n\t\t\t\t// Convert to localtime\r\n\t\t\t\tDateTime utcDateTime = new DateTime(tz);\r\n\t\t\t\tutcDateTime = utcDateTime.withDate(year, month, day).withTime(\r\n\t\t\t\t\t\thour, minute, second, 0);\r\n\t\t\t\tDateTime localDateTime = utcDateTime.withZone(DateTimeZone\r\n\t\t\t\t\t\t.getDefault());\r\n\t\t\t\tyear = localDateTime.getYear();\r\n\t\t\t\tmonth = localDateTime.getMonthOfYear();\r\n\t\t\t\tday = localDateTime.getDayOfMonth();\r\n\t\t\t\thour = localDateTime.getHourOfDay();\r\n\t\t\t\tminute = localDateTime.getMinuteOfHour();\r\n\t\t\t\tsecond = localDateTime.getSecondOfMinute();\r\n\t\t\t\t// Since we have converted to localtime, remove the TZID\r\n\t\t\t\t// attribute\r\n\t\t\t\tthis.removeNamedAttribute(\"TZID\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tisUTC = false;\r\n\r\n\t\t// Add attribute that says date-only or date with time\r\n\t\tif (dateOnly)\r\n\t\t\taddAttribute(\"VALUE\", \"DATE\");\r\n\t\telse\r\n\t\t\taddAttribute(\"VALUE\", \"DATE-TIME\");\r\n\r\n\t}", "private Date stringToSQLDate(String fecha){\n\t\t\n\t\t\n\t\tint ano=Integer.parseInt(fecha.substring(0,4));\n\t\tint mes =Integer.parseInt(fecha.substring(5,7));\n\t\tint dia =Integer.parseInt( fecha.substring(8));\n\t\t\n\t\t@SuppressWarnings(\"deprecation\")\n\t\tDate tmp = new Date(ano-1900,mes-1,dia);\n\t\t\n\t\treturn tmp;\n\t}", "public static java.sql.Date StringToSqlDate(String StringValue){\n return java.sql.Date.valueOf(StringValue);\n }", "private LocalDate createDate(String date) {\n LocalDate localDate = LocalDate.parse(date);\n\n return localDate;\n }", "public static Date wccDateToDate(String strDate) {\n Date date = null;\n if ((null != strDate) && !strDate.trim().isEmpty()) {\n SimpleDateFormat sdf = new SimpleDateFormat(WccConstants.WCC_DATE_FORMAT);\n try {\n date = sdf.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }\n return date;\n }", "@Test public void testDateFormat() {\n String str = \"{dateField: 123456789}\";\n TestBean bean = JSONCoder.getGlobal().decode(str, TestBean.class);\n assertEquals(123456789L, bean.getDateField().getTime());\n\n str = \"{dateField: '1900-1-1'}\";\n bean = JSONCoder.getGlobal().decode(str, TestBean.class);\n assertEquals(\"1900-01-01\", new SimpleDateFormat(\"yyyy-MM-dd\").format(bean.getDateField()));\n\n str = \"{dateField: '1900-1-1 11:11:11'}\";\n bean = JSONCoder.getGlobal().decode(str, TestBean.class);\n assertEquals(\"1900-01-01 11:11:11\", new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(bean.getDateField()));\n\n str = \"{dateField: 'invalidDateFormat'}\";\n expectDecodeWithException(str, TestBean.class,\n \"java.text.ParseException: Unparseable date: \\\"invalidDateFormat\\\"\");\n }", "public static Date isoStringToDate(String d) {\n\t\tDateTime dt = XML_DATE_TIME_FORMAT.parseDateTime(d);\n\t\treturn dt.toDate();\n\t}", "public static Date toDateFormat_2(String dateString) {\r\n\t\treturn stringToDate(dateString, DATE_FORMAT_2);\r\n\t}" ]
[ "0.690975", "0.68790036", "0.68677276", "0.6784011", "0.6719434", "0.6692963", "0.66848546", "0.668141", "0.66657454", "0.6659591", "0.6591835", "0.6546939", "0.6541635", "0.6541179", "0.65279484", "0.6516968", "0.65118176", "0.6491956", "0.64834255", "0.64689696", "0.6466199", "0.64598006", "0.6455555", "0.6448227", "0.643395", "0.643109", "0.640989", "0.64086187", "0.6389556", "0.6389145", "0.6378502", "0.6371149", "0.6360912", "0.63510716", "0.634552", "0.6344947", "0.6309216", "0.62535423", "0.6248647", "0.6248509", "0.6219307", "0.6217705", "0.6203482", "0.6196517", "0.6161671", "0.61029094", "0.6088667", "0.60774", "0.60733783", "0.6066901", "0.6058303", "0.6054263", "0.6054195", "0.6029019", "0.60275644", "0.6026597", "0.59669244", "0.59452945", "0.59366024", "0.59237826", "0.59083694", "0.5892567", "0.5891935", "0.5879182", "0.58746344", "0.5866148", "0.58660567", "0.58634067", "0.58564246", "0.584938", "0.5819057", "0.58171076", "0.581144", "0.5808536", "0.5804197", "0.5800365", "0.57984316", "0.57958543", "0.579484", "0.579401", "0.57772076", "0.5768565", "0.57633066", "0.57552135", "0.57500976", "0.57265604", "0.57184225", "0.56929713", "0.5672797", "0.5667154", "0.56597596", "0.56474364", "0.5634956", "0.56290895", "0.5625253", "0.5621059", "0.5619489", "0.56099534", "0.55896777", "0.55893445" ]
0.6491432
18
Formats given date with given format.
public String formatDate(Date date, String format) { return this.convertDateToString(date, format); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String format (Date date , String dateFormat) ;", "public Date formatDate( String date, String format )\n throws ParseException {\n SimpleDateFormat dateFormat = new SimpleDateFormat(format);\n dateFormat.setLenient(false);\n return dateFormat.parse(date);\n }", "public static String formatDate(Calendar date, DateFormat format) {\n\n switch (format) {\n case COMPLETE_DATE_FORMAT:\n format = DateFormat.COMPLETE_DATE_FORMAT;\n break;\n case DAY_FORMAT:\n format = DateFormat.DAY_FORMAT;\n break;\n }\n\n SimpleDateFormat dateFormatter = new SimpleDateFormat(format.getFormat(), Locale.US);\n\n return dateFormatter.format(date.getTime());\n }", "public static String formatDate(Date date, String format)\n\t{\n\t\tDateFormat dateFormat = new SimpleDateFormat(format);\n\t\treturn dateFormat.format(date);\n\t}", "public static String formatDateToString(Date dateObj, String format) {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n return formatter.format(dateObj);\n }", "public static synchronized String formatDate(Date d) {\n return dateFormat.format(d);\n }", "public static String dateToStringFormat(Date date, String format){\n return new SimpleDateFormat(format).format(date);\n }", "@Method(selector = \"stringFromDate:toDate:\")\n public native String format(NSDate fromDate, NSDate toDate);", "private String easyDateFormat(final String format) {\n Date today = new Date();\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n String datenewformat = formatter.format(today);\n return datenewformat;\n }", "@Override\n public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {\n String value = ISO8601Utils.format(date, true);\n toAppendTo.append(value);\n return toAppendTo;\n }", "public static String formatDate(String format, long timestamp) {\n return DateFormat.format(format, new Date(timestamp)).toString();\n }", "public static String getFormattedDateString(Date date, String format) {\n Calendar cal = Calendar.getInstance();\n TimeZone timeZone = cal.getTimeZone();\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(format);\n dateFormat.setTimeZone(timeZone);\n\n return dateFormat.format(date);\n }", "public String formatDate(Date date) {\n String result = \"\";\n if (date != null) {\n result = DateUtility.simpleFormat(date, MEDIUM_DATE_FORMAT);\n }\n return result;\n }", "public static String formatDate(Date valor, String formato) {\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(formato);\r\n\t\treturn sdf.format(valor);\r\n\t}", "public String dateFormatter(String fromDate) {\n\t\tString newDateString=\"\";\n\t\ttry {\n\t\t\tfinal String oldFormat = \"yyyy/MM/dd\";\n\t\t\tfinal String newFormat = \"yyyy-MM-dd\";\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(oldFormat);\n\t\t\tDate d = sdf.parse(fromDate);\n\t\t\tsdf.applyPattern(newFormat);\n\t\t\tnewDateString = sdf.format(d);\n\t\t} catch(Exception exp) {\n\t\t\tthrow ExceptionUtil.getYFSException(ExceptionLiterals.ERRORCODE_INVALID_DATE, exp);\n\t\t}\n\t\treturn newDateString;\n\t}", "private String formatDate(Date date) {\n String resultDate;\n SimpleDateFormat dateFormat;\n dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n resultDate = dateFormat.format(date);\n return resultDate;\n }", "public static String formatDate(java.util.Date value, String pattern) {\r\n\t\tif (value != null) {\r\n\t\t\t// Cria Locale informando Portugues Brasil\r\n\t\t\tLocale locale = new Locale(\"pt\", \"BR\");\r\n\t\t\t// Cria Formatador de data informando padr�o\r\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale);\r\n\t\t\t// Passa o resultado final obtido para uma String\r\n\t\t\tString retorno = dateFormat.format(value);\r\n\t\t\t// Trata a String para que a primeira letra seja maiuscula (caso esteja no padr�o MMM/yyyy\r\n\t\t\tif ((retorno != null) && (retorno.length() > 0)) {\r\n\t\t\t\tretorno = (retorno.charAt(0) + \"\").toUpperCase() + retorno.substring(1);\r\n\t\t\t}\r\n\t\t\treturn retorno;\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public static String date_d(String sourceDate,String format) throws ParseException {\n SimpleDateFormat sdf_ = new SimpleDateFormat(\"yyyy-MM-dd\");\n SimpleDateFormat sdfNew_ = new SimpleDateFormat(format);\n return sdfNew_.format(sdf_.parse(sourceDate));\n }", "@org.jetbrains.annotations.NotNull()\n public static final java.lang.String getFormattedDate(@org.jetbrains.annotations.NotNull()\n java.util.Calendar $this$getFormattedDate, @org.jetbrains.annotations.NotNull()\n java.lang.String format) {\n return null;\n }", "public String formatDate (Date date){\r\n\t\tDateFormat df = new SimpleDateFormat(\"EEE, d MMM yyyy HH:mm:ss z\", Locale.ENGLISH);\r\n\t\treturn df.format(date);\r\n\t}", "public static String getFormattedDate(String dateStr, String toformat)\r\n\t{\r\n\t\tString mName = \"getFormattedDate()\";\r\n\t\tIDateFormatter dateFormatter = null;\r\n\t\tDateFormatConfig dateFormat = null;\r\n\t\tString formattedDate = null;\r\n\t\tdateFormat = getDateFormat(toformat);\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateFormatter = (IDateFormatter) ResourceLoaderUtils.createInstance(dateFormat.getFormatterClass(),\r\n\t\t\t\t\t(Object[]) null);\r\n\t\t\tformattedDate = dateFormatter.formatDate(dateStr, dateFormat.getJavaDateFormat());\r\n\t\t} catch (Exception exp)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00112\", exp, mName);\r\n\r\n\t\t}\r\n\t\treturn formattedDate;\r\n\t}", "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 static String formatSdf(Date data, String format) {\n if (data == null) {\n return null;\n }\n return new SimpleDateFormat(format).format(data);\n }", "public static String formatDate(Date date) {\n\t\tString newstring = new SimpleDateFormat(\"MM-dd-yyyy\").format(date);\n\t\treturn newstring;\n\t}", "private String formatDate (Date date) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss\", Locale.ENGLISH);\n return sdf.format(date);\n }", "public String formatDate(Date date) {\n\t\tString formattedDate;\n\t\tif (date != null) {\n\t\t\tformattedDate = simpleDateFormat.format(date);\n\t\t\tformattedDate = formattedDate.substring(0,\n\t\t\t\t\tformattedDate.length() - 5);\n\t\t} else {\n\t\t\tformattedDate = Constants.EMPTY_STRING;\n\t\t}\n\t\treturn formattedDate;\n\t}", "public static String formatDateToString(Date d, String formatoData) {\n\t\tfinal String OLD_FORMAT = \"yyyy-MM-dd\";\r\n\r\n\t\tString newDateString;\r\n\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(OLD_FORMAT);\r\n\t\tsdf.applyPattern(formatoData);\r\n\t\tnewDateString = sdf.format(d);\r\n\t\t\r\n\t\treturn newDateString;\r\n\t}", "public static String formatterDate(Date date){\n\t\tString retour = null;\n\t\tif(date != null){\n\t\t\tretour = dfr.format(date);\n\t\t}\n\t\treturn retour;\n\t}", "public static Date changeDateFormat(String date, String format){\n SimpleDateFormat sdf = new SimpleDateFormat(format);\n try {\n return sdf.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n return null;\n }\n }", "public java.sql.Date format(String date) {\n int i = 0;\n int dateAttr[];\n dateAttr = new int[3];\n for(String v : date.split(\"/\")) {\n dateAttr[i] = Integer.parseInt(v);\n i++;\n }\n\n GregorianCalendar gcalendar = new GregorianCalendar();\n gcalendar.set(dateAttr[2], dateAttr[0]-1, dateAttr[1]); // Year,Month,Day Of Month\n java.sql.Date sdate = new java.sql.Date(gcalendar.getTimeInMillis());\n return sdate;\n }", "public static String formatDate(Date date) {\n final SimpleDateFormat formatter = new SimpleDateFormat(\"MM-dd-yyyy\");\n return formatter.format(date);\n }", "private String formatDate(final Date date) {\r\n\t\tfinal Calendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(date);\r\n\r\n\t\tfinal String dayOfMonth = formatDayOfMonth(calendar);\r\n\t\tfinal String month = formatMonth(calendar);\r\n\t\tfinal String year = String.valueOf(calendar.get(Calendar.YEAR));\r\n\r\n\t\treturn String.format(\"%s/%s/%s\", year, month, dayOfMonth);\r\n\t}", "public static String formatDate(Date date, String userId)\n\t{\n\t\tDateFormat format = new SimpleDateFormat(\"MMM dd, yyyy hh:mm a\", getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tString rv = format.format(date);\n\t\treturn rv;\n\t}", "private String formatDate(Date date){\n SimpleDateFormat format = new SimpleDateFormat(\"dd-MM-yyyy HH:mm\", Locale.getDefault());\n\n return format.format(date);\n }", "public static String format(LocalDate date){\r\n\t\t\r\n\t\tif(date==null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn DATE_FORMATTER.format(date);\r\n\t}", "private String getFormattedDate(String date) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(getString(R.string.received_import_date_format));\n SimpleDateFormat desiredDateFormat = new SimpleDateFormat(getString(R.string.desired_import_date_format));\n Date parsedDate;\n try {\n parsedDate = dateFormat.parse(date);\n return desiredDateFormat.format(parsedDate);\n } catch (ParseException e) {\n // Return an empty string in case of issues parsing the date string received.\n e.printStackTrace();\n return \"\";\n }\n }", "private String formatDate(String dateStr) {\n try {\n SimpleDateFormat fmt = new SimpleDateFormat(Properties.DATE_FORMAT_ALL);\n Date date = fmt.parse(dateStr);\n SimpleDateFormat fmtOut = new SimpleDateFormat(Properties.DATE_FORMAT);\n return fmtOut.format(date);\n } catch (ParseException e) {\n System.out.println( Properties.K_WARNING + \" \" + e.getMessage());\n }\n return \"\";\n }", "public static String formatDateOnly(Date date, String userId)\n\t{\t\t\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMM dd, yyyy\", getPreferredLocale(userId));\n\t\tdateFormat.setTimeZone(getPreferredTimeZone(userId));\n\t\tString rv = dateFormat.format(date);\n\t\treturn rv;\n\t}", "public String convertDateToString(Date date, String format) {\n DateFormat dateFormat = new SimpleDateFormat(format);\n String dateAsString = dateFormat.format(date);\n return dateAsString;\n }", "public static String convertDateFormat (String dateStr, String fromFormatPattern, String toFormatPattern) {\n\t\tDateFormat fromFormat = new SimpleDateFormat(fromFormatPattern);\n\t\tDateFormat toFormat = new SimpleDateFormat(toFormatPattern);\n\t\ttoFormat.setLenient(false);\n\t\tDate date;\n\t\ttry {\n\t\t\tdate = fromFormat.parse(dateStr);\n\t\t\treturn toFormat.format(date);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.d(\"ERROR\", \"Date formatting Error\");\n\t\t}\n\t\treturn null;\n\t}", "public static String formatDate(String dateValue) {\n Date uploadDateTime = null;\n try {\n uploadDateTime = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.US).parse(dateValue);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return new SimpleDateFormat(\"dd/MM/yyyy HH:mm\", Locale.US).format(uploadDateTime);\n }", "private String formatDate(Date dateObject) {\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\r\n return dateFormat.format(dateObject);\r\n }", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\n return dateFormat.format(dateObject);\n }", "public void setDateFormat(String format) {\n this.mDateFormat = format;\n }", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\", Locale.getDefault());\n return dateFormat.format(dateObject);\n }", "public static String format(Date d, DateFormat formatter, int gmt) {\n return formatter.format(DateUtil.transform(d, gmt));\n }", "public static String formatDate(String date){\n String formatedDate = date;\n if (!date.matches(\"[0-9]{2}-[0-9]{2}-[0-9]{4}\")){\n if (date.matches(\"[0-9]{1,2}/[0-9]{1,2}/([0-9]{2}|[0-9]{4})\"))\n formatedDate = date.replace('/', '-');\n if (date.matches(\"[0-9]{1,2}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\")){\n if (formatedDate.matches(\"[0-9]{1}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = \"0\" + formatedDate;\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{1}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = formatedDate.substring(0, 3) + \"0\" + \n formatedDate.substring(3);\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{2}.[0-9]{2}\")){\n String thisYear = String.valueOf(LocalDate.now().getYear());\n String century = thisYear.substring(0,2);\n /* If the last two digits of the date are larger than the two last digits of \n * the current date, then we can suppose that the year corresponds to the last \n * century.\n */ \n if (Integer.valueOf(formatedDate.substring(6)) > Integer.valueOf(thisYear.substring(2)))\n century = String.valueOf(Integer.valueOf(century) - 1);\n formatedDate = formatedDate.substring(0, 6) + century +\n formatedDate.substring(6); \n }\n }\n }\n return formatedDate;\n }", "public static String formatDate(Date d) {\n\t\tint month = d.getMonth() + 1;\n\t\tint dayOfMonth = d.getDate();\n\t\tint year = d.getYear() + 1900;\n\t\tString y = \"\" + year;\n\t\tString m = \"\" + month;\n\t\tString dom = \"\" + dayOfMonth;\n\t\tif (month < 10) {\n\t\t\tm = \"0\" + m;\n\t\t}\n\t\tif (dayOfMonth < 10) {\n\t\t\tdom = \"0\" + dom;\n\t\t}\n\t\treturn m + \"/\" + dom + \"/\" + y.substring(2);\n\t}", "public static String formatDate(String strDate) {\n return formatDate(strDate, false);\n }", "public static String convertDateFormat(Date sourceDate, SimpleDateFormat dateForm) {\n return dateForm.format(sourceDate);\n }", "public static String formatDate(final Date data, final String sFormat, final Locale locale) {\n final SimpleDateFormat simple = new SimpleDateFormat(sFormat, locale == null ? getLocale(CalendarParams.LOCALE_PT) : locale);\n String dateRetorno;\n if (data == null) {\n final GregorianCalendar cal = new GregorianCalendar();\n dateRetorno = simple.format(cal.getTime());\n } else {\n dateRetorno = simple.format(data);\n }\n\n return dateRetorno;\n }", "public Date formatDate( String dob )\n throws ParseException {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n dateFormat.setLenient(false);\n return dateFormat.parse(dob);\n }", "public static String dateToString(Date date, String format) {\n\t\n\t\tString result = \"\";\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(format);\n\n\t\tif (date != null) {\n\t\t\tresult = dateFormat.format(date);\n\t\t}\n\t\n\t\treturn result;\n\t}", "public static String formatDate(java.sql.Date date){\n\t\treturn date!=null?toTheString(date):\"\";\n\t}", "public static String formatDate(Date date) {\n\t\tDateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);\n\n\t\tif (dateFormat instanceof SimpleDateFormat) {\n\t\t\tSimpleDateFormat sdf = (SimpleDateFormat) dateFormat;\n\t\t\t// we want short date format but with 4 digit year\n\t\t\tsdf.applyPattern(sdf.toPattern().replaceAll(\"y+\", \"yyyy\").concat(\" z\"));\n\t\t}\n\n\t\treturn dateFormat.format(date);\n\t}", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public static String formatDateForQuery(java.util.Date date){\n return (new SimpleDateFormat(\"yyyy-MM-dd\")).format(date);\n }", "public DateTextFieldConfig withFormat(final String value) {\n put(Key.Format, Dates.toJavaScriptDateFormat(value));\n return this;\n }", "public void mostrarHora(String formato){\n Date objDate = new Date();\n SimpleDateFormat objSDF = new SimpleDateFormat(formato);\n //este sera el resultado de la fechas\n fecha=objSDF.format(objDate);\n }", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "public static String formatDate(Date date) {\n return DateFormat.getDateFormat(BaracusApplicationContext.getContext()).format(date);\n }", "public void setDateFormat(String format) {\n dateFormat = format;\n constructVssDateTimeFormat();\n }", "public static String formatDate(Date source, String pattern) throws Exception {\n\tif (null != source) {\n\t DateFormat format = new SimpleDateFormat(pattern);\n\t return format.format(source);\n\t}\n\treturn null;\n }", "public static String formatterDateUS(Date date){\n\t\tString retour = null;\n\t\tif(date != null){\n\t\t\tretour = df.format(date);\n\t\t}\n\t\treturn retour;\n\t}", "@SuppressLint(\"SimpleDateFormat\") public static String parse(String date, String format){\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat localFormatter= new SimpleDateFormat(format);\r\n\t\t\tlocalFormatter.setLenient(false);\r\n\t\t\tString formattedDate=localFormatter.parse(date).toString();\r\n\t\t\t\r\n\t\t\t//days, months, years\r\n\t\t\tif(format.equals(formats[0])) return convertDate(formattedDate);\r\n\t\t\t\r\n\t\t\t//hours, minutes, seconds\r\n\t\t\telse if(format.equals(formats[1])) return convertHoursMinsSecs(formattedDate);\t\r\n\t\t\t\r\n\t\t\t//hours, minutes\r\n\t\t\telse if(format.equals(formats[2])) return convertHoursMins(formattedDate);\t\r\n\t\t\t\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\t} catch (ParseException e) {\r\n\t\t\t//e.printStackTrace();\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "private static void formatDate(Date i) {\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yy\");\n\t\tformatter.setLenient(false);\n\t\tAnswer = formatter.format(i);\n\t}", "String formatDateCondition(Date date);", "private static Date getFormattedDate(String date){\n\t\tString dateStr = null;\n\t\tif(date.length()<11){\n\t\t\tdateStr = date+\" 00:00:00.0\";\n\t\t}else{\n\t\t\tdateStr = date;\n\t\t}\n\t\tDate formattedDate = null;\n\t\ttry {\n\t\t\tformattedDate = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(dateStr);\n\t\t} catch (ParseException e) {\n\t\t\tCommonUtilities.createErrorLogFile(e);\n\t\t}\n\t\treturn formattedDate;\n\n\t}", "public static String toStringFormat_1(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_1);\r\n\t}", "private String formatDate(String date)\n\t{\n\t\tif(date == null || date.isEmpty())\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString[] dateSplit = date.split(\"/\");\n\t\t\tif(dateSplit.length != 3)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn getMonthName(dateSplit[0]) + \" \"+ dateSplit[1]+\", \"+ dateSplit[2];\n\t\t\t}\n\t\t}\n\t}", "public static String formatDate(java.util.Date uDate) {\n\t\tif (uDate == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\treturn dateFormat.format(uDate);\n\t\t}\n\t}", "public Date formatForDate(String data) throws ParseException{\n //definindo a forma da Data Recebida\n DateFormat formatUS = new SimpleDateFormat(\"dd-MM-yyyy\");\n return formatUS.parse(data);\n }", "public static String formatFechaMascara(String fecha, String formatoFecha) {\n SimpleDateFormat sdf = new SimpleDateFormat(formatoFecha);\n String response = \"\";\n // format BD\n SimpleDateFormat sdfBD = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date fechaParse = null;\n try {\n\n fechaParse = sdfBD.parse(fecha.substring(0, 10));\n\n } catch (java.text.ParseException e) {\n try {\n fechaParse = sdf.parse(fecha);\n } catch (java.text.ParseException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }\n\n if (fechaParse == null) return \"\";\n\n response = sdf.format(fechaParse);\n return response;\n }", "public static String formatDate(Date time) {\n\t\tSimpleDateFormat df = new SimpleDateFormat(PreferenceProperties.JMS_DATE_FORMAT);\n\t\treturn df.format(time);\n\t}", "public String formatDateAndTime(String date){\n\n return dateTimeFormatter.parse(date).toString();\n\n }", "public static String getFormatString(Date date, DateFormat dateFormat)\n\t{\n\t\treturn dateFormat.format(date);\n\t}", "public static final String DateFormat(final Object object, final String format) {\n\t\t\n\t\tlong date;\n\t\ttry {\n\t\t\tif (object == null) {\n\t\t\t\tdate = 0;\n\t\t\t} else if (object instanceof Date) {\n\t\t\t\tdate = ((Date) object).getTime();\n\t\t\t} else {\n\t\t\t\tdate = Convert.Any.toLong(object, 0L);\n\t\t\t}\n\t\t} catch (final Throwable e) {\n\t\t\tdate = Convert.Any.toLong(object, 0L);\n\t\t}\n\t\tfinal SimpleDateFormat formatter = new SimpleDateFormat(format);\n\t\treturn formatter.format(new Date(date));\n\t}", "protected static SimpleDateFormat dateFormat() {\n return dateFormat(true, false);\n }", "public static String formatDateTime(String date) {\n\t\tif(date == null) return \"\";\n\t\tdate = date.trim();\n\t\tif(date.equals(\"&nbsp;\")) return \"\";\n\t\tif (date.length() == 0 || date.length() != 14) return date;\n\t\tdate = date.substring(0,4) + \"/\" + date.substring(4,6) \n\t\t\t\t+ \"/\" + date.substring(6,8)\n\t\t\t\t+\" \"+date.substring(8,10)\n\t\t\t\t+\":\"+date.substring(10,12)\n\t\t\t\t+\":\"+date.substring(12,14);\n\t\treturn date;\n\t}", "public String DateFormatted(){\n\t\tSimpleDateFormat simDate = new SimpleDateFormat(\"E, dd/MM/yy hh:mm:ss a\");\n\t\treturn simDate.format(date.getTime());\n\t}", "private LocalDate parse(String format) {\r\n\t\tString lista[] = format.split(\"/\"); // DD - MM - YYYY\r\n\t\tint dia = Integer.parseInt(lista[0]);\r\n\t\tint mes = Integer.parseInt(lista[1]);\r\n\t\tint ano = Integer.parseInt(lista[2]);\r\n\t\tLocalDate date = LocalDate.of(ano, mes, dia);\r\n\t\treturn date;\r\n\t}", "public static String formatDateForName(Date date, String userId)\n\t{\n\t\tDateFormat format = new SimpleDateFormat(\"MMM dd, yyyy hh:mm a\", getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\n\t\tString rv = format.format(date);\n\t\treturn rv;\n\t}", "@NotNull\n public static String dateToString(Date date, String pattern, Locale locale) {\n DateFormat format = new SimpleDateFormat(pattern, locale);\n return format.format(date);\n }", "public static String getStringFromDate(Date date, String format) {\n if(date == null || format == null || format.isEmpty()) return \"\";\n\n String str = \"\";\n\n try {\n DateFormat dateFormat = new SimpleDateFormat(format);\n str = dateFormat.format(date);\n }\n catch (Exception e) {e.printStackTrace();}\n\n return str;\n }", "public static String format(String $formatString, long $timeValue /*= 0*/) {\n return (new SimpleDateFormat($formatString)).format($timeValue == 0 ? new Date() : new Date($timeValue));\n }", "public static String dateToStringFormat(Calendar calendar, String format){\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);\n return simpleDateFormat.format(calendar.getTime());\n }", "private static String formatDate(long date) {\n Date systemDate = new java.util.Date(date * 1000L);\n // the format of your date\n SimpleDateFormat sdf = new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n // give a timezone reference for formatting (see comment at the bottom)\n sdf.setTimeZone(java.util.TimeZone.getTimeZone(\"GMT-4\"));\n String formattedDate = sdf.format(systemDate);\n return formattedDate;\n }", "protected String date(String format, double time) {\n\t\treturn new java.util.Date((long)(time*1000)).toString();\n\t}", "public void formatDateTime() {\n // Check if type of parsing is for display or not. \n // If it is for display, no need to check if date has already passed.\n if (parseType != 2) {\n startDate = dtFormat.formatDate(startDate,0);\n endDate = dtFormat.formatDate(endDate,0);\n } else {\n startDate = dtFormat.formatDate(startDate,1);\n endDate = dtFormat.formatDate(endDate,1);\n }\n \n startTime = dtFormat.formatTime(startTime);\n endTime = dtFormat.formatTime(endTime);\n }", "public static String DateToString(Date fecha, String formato){\n if (nullToBlank(fecha).equals(\"\")) {\n return \"\";\n }\n SimpleDateFormat df = new SimpleDateFormat(formato);\n return df.format(fecha);\n }", "@Override // override for Javadoc and performance\n public String format(DateTimeFormatter formatter) {\n Objects.requireNonNull(formatter, \"formatter\");\n return formatter.format(this);\n }", "public void setDateFormats(String dateFormats)\n {\n this.dateFormats = dateFormats;\n }", "public static String toStringFormat_2(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_2);\r\n\t}", "public static String getStringFromDate(Date date, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n return formatter.format(date);\n }", "private String changeDateFormat (String oldDate) throws ParseException {\n // Source: https://stackoverflow.com/questions/3469507/how-can-i-change-the-date-format-in-java\n final String OLD_FORMAT = \"MM/dd/yyyy\";\n final String NEW_FORMAT = \"yyyyMMdd\";\n String newDateString;\n SimpleDateFormat sdf = new SimpleDateFormat(OLD_FORMAT);\n Date d = sdf.parse(oldDate);\n sdf.applyPattern(NEW_FORMAT);\n newDateString = sdf.format(d);\n return newDateString;\n }", "public Date parseDate(String date, String format) {\n return this.convertStringToDate(date, format);\n }", "public static boolean isDate(InputField f, String format) {\r\n\t\tString d = f.getValue().replace(\"-\", \"\").replace(\"/\", \"\");\r\n\t\ttry {\r\n\t\t\tnew SimpleDateFormat(format).parse(d);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static String FormatDate(int day, int month, int year) {\r\n String jour = Integer.toString(day);\r\n String mois = Integer.toString(month + 1);\r\n if (jour.length() == 1) {\r\n jour = \"0\" + jour;\r\n }\r\n\r\n if (mois.length() == 1) {\r\n mois = \"0\" + mois;\r\n }\r\n return jour + \"/\" + mois + \"/\" + Integer.toString(year);\r\n }", "public static String formatDate(Date date){\n\t\tCalendar now = Calendar.getInstance(); // Gets the current date and time\n\t\tint currentYear = now.get(Calendar.YEAR);\n\t\tint dateYear = Integer.parseInt(new SimpleDateFormat(\"yyyy\").format(date));\n\n\t\tif (dateYear <= currentYear){\n\t\t\treturn new SimpleDateFormat(\"E MMM dd HH:mm\").format(date);\n\t\t} else {\n\t\t\treturn new SimpleDateFormat(\"E yyyy MMM dd HH:mm\").format(date);\n\t\t}\n\t}", "public static String formatDateU(java.sql.Date date){\n\t\treturn date!=null?toTheString(date):\"unknown\";\n\t}" ]
[ "0.7205822", "0.7132317", "0.7005666", "0.69919586", "0.6561013", "0.64861333", "0.64353704", "0.63492525", "0.6329546", "0.62939", "0.6269629", "0.62261266", "0.6205373", "0.6187804", "0.6160959", "0.6159536", "0.6156424", "0.611411", "0.6104788", "0.61036026", "0.6083815", "0.6082056", "0.6071837", "0.60524386", "0.60480565", "0.60448575", "0.60351735", "0.602319", "0.6023139", "0.6015031", "0.59924155", "0.59731865", "0.5964154", "0.59377074", "0.5936687", "0.5935422", "0.59241414", "0.5907228", "0.5906302", "0.59021217", "0.58970934", "0.58708924", "0.58629376", "0.5852768", "0.58436584", "0.5826243", "0.5823432", "0.5817178", "0.5814904", "0.58098197", "0.580415", "0.57932365", "0.57821506", "0.5764829", "0.57565635", "0.57452977", "0.5734206", "0.57275414", "0.5723646", "0.57166266", "0.5715584", "0.56969017", "0.5696216", "0.5680365", "0.5672137", "0.56606156", "0.5649479", "0.5630725", "0.56148964", "0.5612112", "0.5605588", "0.5594372", "0.5588115", "0.5588022", "0.5569762", "0.5561027", "0.55491", "0.5540647", "0.5532555", "0.552364", "0.55112195", "0.55064666", "0.5496336", "0.5494174", "0.54787266", "0.54756284", "0.5472924", "0.5471271", "0.54687315", "0.54641104", "0.54593414", "0.5452148", "0.5449916", "0.54448944", "0.5425714", "0.5425073", "0.5424869", "0.5421625", "0.54187536", "0.5417326" ]
0.7147396
1
Converts given date with given pattern to String object.
public String convertDateToString(Date date, String format) { DateFormat dateFormat = new SimpleDateFormat(format); String dateAsString = dateFormat.format(date); return dateAsString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static final Function<Date,String> toStr(final String pattern) {\r\n return new ToString(pattern);\r\n }", "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 }", "@NotNull\n public static String dateToString(Date date, String pattern, Locale locale) {\n DateFormat format = new SimpleDateFormat(pattern, locale);\n return format.format(date);\n }", "public static final Function<Date,String> toStr(final String pattern, final String locale) {\r\n return new ToString(pattern, locale);\r\n }", "public static final Function<Date,String> toStr(final String pattern, final Locale locale) {\r\n return new ToString(pattern, locale);\r\n }", "public static String getDate(String pattern) {\n return getDate(pattern, System.currentTimeMillis());\n }", "public static String formatDate(Date source, String pattern) throws Exception {\n\tif (null != source) {\n\t DateFormat format = new SimpleDateFormat(pattern);\n\t return format.format(source);\n\t}\n\treturn null;\n }", "public static String formatDate(java.util.Date value, String pattern) {\r\n\t\tif (value != null) {\r\n\t\t\t// Cria Locale informando Portugues Brasil\r\n\t\t\tLocale locale = new Locale(\"pt\", \"BR\");\r\n\t\t\t// Cria Formatador de data informando padr�o\r\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale);\r\n\t\t\t// Passa o resultado final obtido para uma String\r\n\t\t\tString retorno = dateFormat.format(value);\r\n\t\t\t// Trata a String para que a primeira letra seja maiuscula (caso esteja no padr�o MMM/yyyy\r\n\t\t\tif ((retorno != null) && (retorno.length() > 0)) {\r\n\t\t\t\tretorno = (retorno.charAt(0) + \"\").toUpperCase() + retorno.substring(1);\r\n\t\t\t}\r\n\t\t\treturn retorno;\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public static String now(String pattern){\n return DateFormatUtils.format(Calendar.getInstance(),pattern);\n }", "public static String getCurrentDateFormatted(String pattern) {\r\n\t\tDate now = new Date();\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(pattern);\r\n\t\t\treturn df.format(now);\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t}", "public DateGraphFormat(String pattern){\n\t((SimpleDateFormat) dateFormat).applyPattern(pattern);\n }", "public static String getTimeStamp(String pattern){\n Timestamp timestamp = new Timestamp(System.currentTimeMillis());\n SimpleDateFormat sdf = new SimpleDateFormat(pattern);\n return String.valueOf(sdf.format(timestamp));\n\n }", "public static String getDatePattern() {\n\t\treturn DATE_PATTERN;\n\t}", "public static String getDate(String pattern, long timeInMillis) {\n SimpleDateFormat format = new SimpleDateFormat(pattern);\n return format.format(new Date(timeInMillis));\n }", "public String format (Date date , String dateFormat) ;", "public static String toStringFormat_1(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_1);\r\n\t}", "public static String convertDateFormat (String dateStr, String fromFormatPattern, String toFormatPattern) {\n\t\tDateFormat fromFormat = new SimpleDateFormat(fromFormatPattern);\n\t\tDateFormat toFormat = new SimpleDateFormat(toFormatPattern);\n\t\ttoFormat.setLenient(false);\n\t\tDate date;\n\t\ttry {\n\t\t\tdate = fromFormat.parse(dateStr);\n\t\t\treturn toFormat.format(date);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.d(\"ERROR\", \"Date formatting Error\");\n\t\t}\n\t\treturn null;\n\t}", "public static String toStringFormat_4(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_4);\r\n\t}", "public static String formatDateToString(Date dateObj) {\n return formatDateToString(dateObj, DATE_FORMAT.DEFAULT);\n }", "public static String formatString(Timestamp timestamp,\n String pattern,\n boolean withZoneUTC) {\n return formatString(timestamp, pattern, withZoneUTC, false, 0);\n }", "public static Date toDate(Object obj, String pattern) {\n return toDate(obj, pattern, (TimeZone) null);\n }", "public static String parseStringDate(String s, String myPattern) {\n\n\t\tString pattern = \"\";\n\t\tLocale locale = null;\n\t\tif (s.indexOf(':') >= 0) {\n\t\t\tif (s.length() > 23) {\n\n\t\t\t\tpattern = \"EEE MMM dd HH:mm:ss Z yyyy\";\n\t\t\t\tlocale = Locale.ENGLISH;\n\n\t\t\t} else if (s.length() > 20) {\n\n\t\t\t\tpattern = \"yyyy-MM-dd HH:mm:ss.SSS\";\n\n\t\t\t} else {\n\t\t\t\tpattern = DD_MM_YYYY_HH_MM_SS;\n\n\t\t\t}\n\t\t} else {\n\t\t\tpattern = DD_MM_YYYY;\n\t\t}\n\n\t\tSimpleDateFormat sdfSource = null;\n\t\tif (pattern.length() > 23) {\n\t\t\tsdfSource = new SimpleDateFormat(pattern, locale);\n\t\t} else {\n\t\t\tsdfSource = new SimpleDateFormat(pattern);\n\t\t}\n\n\t\tDate date = null;\n\t\ttry {\n\t\t\tdate = sdfSource.parse(s);\n\t\t} catch (ParseException e) {\n\t\t\tLOGGER.error(e);\n\t\t}\n\n\t\tSimpleDateFormat sdfDestination = new SimpleDateFormat(myPattern);\n\n\t\treturn sdfDestination.format(date);\n\t}", "public String getFormattedDateOnly(DateTime date) {\n String datePattern = context.getString(R.string.general_date_pattern_date_only);\n DateTimeFormatter dtfOut = DateTimeFormat.forPattern(datePattern);\n return dtfOut.print(date);\n }", "public static String convertToString(Date value) {\r\n if (value == null) {\r\n return null;\r\n }\r\n\r\n String dateFormat = ResourceUtil.getMessageResourceString(\"application.pattern.timestamp\");\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);\r\n String result = simpleDateFormat.format(value);\r\n\r\n return result;\r\n }", "public static Date parseDateWithPattern(String date, String pattern) {\r\n DateFormat format = new SimpleDateFormat(pattern, Locale.ITALY);\r\n try {\r\n return format.parse(date);\r\n } catch (Exception ex) {\r\n return null;\r\n }\r\n }", "public static java.util.Date parseStringToDate(String data, String pattern) {\r\n\t\tjava.util.Date retorno = null;\r\n\r\n\t\tif (data != null && pattern != null) {\r\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(pattern);\r\n\t\t\tformat.setLenient(false);\r\n\t\t\ttry {\r\n\t\t\t\tretorno = format.parse(data);\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "private String dateToString(Date d){\r\n\t\tSimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT);\r\n\t\treturn fmt.format(d);\r\n\t}", "public void setDatePattern(String datePattern)\r\n\t{\r\n\t\tthis.datePattern = datePattern;\r\n\t}", "static String formatString(TimestampValueImpl value,\n String pattern,\n boolean withZoneUTC) {\n\n if ((pattern == null ||\n pattern.equals(TimestampDef.DEFAULT_PATTERN)) &&\n withZoneUTC == true) {\n\n return stringFromBytes(value.getBytes(),\n value.getDefinition().getPrecision());\n }\n return formatString(value.get(), pattern, withZoneUTC,\n false /* optionalFracSecond */,\n ((pattern == null) ?\n value.getDefinition().getPrecision() : 0));\n }", "public static String formatDateToString(Date dateObj, String format) {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n return formatter.format(dateObj);\n }", "public String getCreationTime(String pattern) {\n\t\tString ret = new SimpleDateFormat(pattern).format(this.creationTime);\n\t\treturn ret;\n\t}", "public static String toStringFormat_2(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_2);\r\n\t}", "public static String toString(Object obj, String pattern) {\n if (obj == null) {\n return null;\n } else if (obj instanceof String) {\n return (String) obj;\n } else if (obj instanceof Date) {\n return toStringFromDate((Date) obj, pattern);\n } else if (obj instanceof Number) {\n return toStringFromNumber((Number) obj, pattern);\n } else if (obj instanceof Calendar) {\n return toStringFromDate(((Calendar) obj).getTime(), pattern);\n } else if (obj instanceof byte[]) {\n return encodeAsBase64((byte[]) obj);\n } else if (obj instanceof Throwable) {\n return toStringStackTrace((Throwable) obj);\n } else {\n return obj.toString();\n }\n }", "public String getDatePattern()\r\n\t{\r\n\t\treturn datePattern;\r\n\t}", "public static String convertDateToString(Date aDate) {\n\t\treturn getDateTime(getDatePattern(), aDate);\n\t}", "public static String dateToStringFormat(Date date, String format){\n return new SimpleDateFormat(format).format(date);\n }", "String formatDateCondition(Date date);", "public static String dateToString(Date date)\r\n/* 19: */ {\r\n/* 20: 23 */ return sdfDate.format(date);\r\n/* 21: */ }", "public static String toStringFormat_7(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_7);\r\n\t}", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public static String dateToString(Date date){\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MMddyy\");\n\t\treturn formatter.format(date);\n\t}", "public String dateToString() {\n\t\treturn new String(year + \"/\"\n\t\t\t\t+ month + \"/\"\n\t\t\t\t+ day);\n }", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "public static String dateToString(Date date){\r\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n return df.format(date);\r\n }", "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 static Date inputDate(String p, String pattern) {\n SimpleDateFormat sdf = new SimpleDateFormat(pattern);\n Date date = new Date();\n String tmp;\n while (true) {\n try {\n System.out.print(p);\n tmp = in.nextLine();\n if (!tmp.isEmpty()) {\n date = sdf.parse(tmp);\n if (tmp.equals(sdf.format(date))) {\n return date;\n } else {\n System.err.println(\"Please enter a right date, enter again.\");\n }\n } else {\n System.err.println(\"Not empty! Re-enter.\");\n }\n } catch (Exception e) {\n System.err.println(\"Format must be \" + pattern + \" ! Enter again.\");\n }\n }\n }", "public String convertDateToString(Date date) {\n\t\tString dateTime = SDF.format(date);\n\t\treturn dateTime;\t\n\t}", "private String formatDate(final Date date) {\r\n\t\tfinal Calendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(date);\r\n\r\n\t\tfinal String dayOfMonth = formatDayOfMonth(calendar);\r\n\t\tfinal String month = formatMonth(calendar);\r\n\t\tfinal String year = String.valueOf(calendar.get(Calendar.YEAR));\r\n\r\n\t\treturn String.format(\"%s/%s/%s\", year, month, dayOfMonth);\r\n\t}", "private String dateToString(Date datum)\r\n\t{\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd.MM.yyyy\");\r\n\t\tString dat = df.format(datum);\r\n\t\treturn dat;\r\n\t}", "public static String dateToString(final Date date, final String inFormat) {\n\t\tString output = null;\n\t\tif (date != null) {\n\t\t\tString format = inFormat;\n\t\t\tif (inFormat == null) {\n\t\t\t\tformat = DD_MM_YYYY;\n\t\t\t}\n\t\t\tSimpleDateFormat dateFormatter = new SimpleDateFormat(format);\n\t\t\tdateFormatter.setTimeZone(TimeZone.getDefault());\n\t\t\toutput = dateFormatter.format(date);\n\t\t}\n\t\treturn output;\n\t}", "public String convertDateToString(){\n\t\tString aDate = \"\";\n\t\taDate += Integer.toString(day);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(month);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(year);\n\t\treturn aDate;\n\t}", "private String stringifyDate(Date date){\n\t\tDateFormat dateFormatter = new SimpleDateFormat(\"yyyy-MM-dd\");\t\t\n\t\treturn dateFormatter.format(date);\n\t}", "static String formatString(Timestamp timestamp,\n String pattern,\n boolean withZoneUTC,\n boolean optionalFracSecond,\n int nFracSecond) {\n\n String fmt = (pattern == null) ? TimestampDef.DEFAULT_PATTERN : pattern;\n try {\n ZonedDateTime zdt = toUTCDateTime(timestamp);\n return zdt.format(getDateTimeFormatter(fmt, withZoneUTC,\n optionalFracSecond,\n false, nFracSecond));\n } catch (IllegalArgumentException iae) {\n throw new IllegalArgumentException(\"Failed to format the \" +\n \"timestamp with pattern '\" + fmt + \"': \" + iae.getMessage(),\n iae);\n } catch (DateTimeException dte) {\n throw new IllegalArgumentException(\"Failed to format the \" +\n \"timestamp with pattern '\" + fmt + \"': \" + dte.getMessage(),\n dte);\n }\n }", "public static String dateStr(String input ){\n String mm = input.substring(0,2);\n String dd = input.substring(3,5);\n String yyyy = input.substring(6,10);\n return dd + \" - \" + mm + \" - \" + yyyy;\n }", "public static String dateToString(Date date, String format) {\n\t\n\t\tString result = \"\";\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(format);\n\n\t\tif (date != null) {\n\t\t\tresult = dateFormat.format(date);\n\t\t}\n\t\n\t\treturn result;\n\t}", "public String convertDayToString(Date date) {\n SimpleDateFormat formatDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n return formatDate.format(date);\n }", "public static String englishStringOf(LocalDate date) {\n String[] dateStrings = date.toString().split(\"-\");\n String dateString = dateStrings[1] + \"/\" + dateStrings[2] + \"/\" + dateStrings[0];\n return dateString;\n }", "private static String format(String pattern, Object... params) {\n\t\tStringBuffer result = new StringBuffer();\n\t\tnew MessageFormat(pattern, getLocale()).format(params, result, null);\n\t\treturn result.toString();\n\t}", "private String formatDate(Date dateObject) {\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\r\n return dateFormat.format(dateObject);\r\n }", "public String getFormattedDateShort(DateTime date) {\n String datePattern = context.getString(R.string.general_date_pattern_short);\n DateTimeFormatter dtfOut = DateTimeFormat.forPattern(datePattern);\n return dtfOut.print(date);\n }", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\n return dateFormat.format(dateObject);\n }", "public static String formatDateToString(Date d, String formatoData) {\n\t\tfinal String OLD_FORMAT = \"yyyy-MM-dd\";\r\n\r\n\t\tString newDateString;\r\n\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(OLD_FORMAT);\r\n\t\tsdf.applyPattern(formatoData);\r\n\t\tnewDateString = sdf.format(d);\r\n\t\t\r\n\t\treturn newDateString;\r\n\t}", "public static String format(LocalDate date){\r\n\t\t\r\n\t\tif(date==null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn DATE_FORMATTER.format(date);\r\n\t}", "public static String getStringFromDate(Date date, String format) {\n if(date == null || format == null || format.isEmpty()) return \"\";\n\n String str = \"\";\n\n try {\n DateFormat dateFormat = new SimpleDateFormat(format);\n str = dateFormat.format(date);\n }\n catch (Exception e) {e.printStackTrace();}\n\n return str;\n }", "public static String getStringFromDate(Date date, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n return formatter.format(date);\n }", "private static String convertDate(String dateString) {\n String date = null;\n\n try {\n //Parse the string into a date variable\n Date parsedDate = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\").parse(dateString);\n\n //Now reformat it using desired display pattern:\n date = new SimpleDateFormat(DATE_FORMAT).format(parsedDate);\n\n } catch (ParseException e) {\n Log.e(TAG, \"getDate: Error parsing date\", e);\n e.printStackTrace();\n }\n\n return date;\n }", "@Method(selector = \"stringFromDate:toDate:\")\n public native String format(NSDate fromDate, NSDate toDate);", "public String dateStr(String date) {\n\t\treturn AnalyticsUDF.dateFormatter(date);\n\t}", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "public static String formatDateU(java.sql.Date date){\n\t\treturn date!=null?toTheString(date):\"unknown\";\n\t}", "java.lang.String getDate();", "public static String formatterDate(Date date){\n\t\tString retour = null;\n\t\tif(date != null){\n\t\t\tretour = dfr.format(date);\n\t\t}\n\t\treturn retour;\n\t}", "public static String getFormattedDateString(Date date, String format) {\n Calendar cal = Calendar.getInstance();\n TimeZone timeZone = cal.getTimeZone();\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(format);\n dateFormat.setTimeZone(timeZone);\n\n return dateFormat.format(date);\n }", "protected String formatDateToString(Date date) {\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy.MM.dd HH:mm:ss\");\n\t\tString formatted = format.format(date);\n\t\treturn formatted;\n\t}", "private String getFormattedDate(String date) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(getString(R.string.received_import_date_format));\n SimpleDateFormat desiredDateFormat = new SimpleDateFormat(getString(R.string.desired_import_date_format));\n Date parsedDate;\n try {\n parsedDate = dateFormat.parse(date);\n return desiredDateFormat.format(parsedDate);\n } catch (ParseException e) {\n // Return an empty string in case of issues parsing the date string received.\n e.printStackTrace();\n return \"\";\n }\n }", "public static java.sql.Date toSqlDate(Object obj, String pattern) {\n return toSqlDate(obj, pattern, (TimeZone) null);\n }", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\", Locale.getDefault());\n return dateFormat.format(dateObject);\n }", "public static String formatDate(Date date) {\n\t\tString newstring = new SimpleDateFormat(\"MM-dd-yyyy\").format(date);\n\t\treturn newstring;\n\t}", "public static String fromDate(String s){\n \t\t\n \t\tString[] date = s.split(\"T\");\n \t\tString time = date[1].substring(0,5);\n \t\tString[] dates = date[0].split(\"-\"); \n \t\tString month = dates[1];\n \t\tString day = dates[2];\n \t\t\n \t\treturn day + \"/\" + month + \", kl: \" + time;\n \t}", "public static DateTimeFormatter forStrptimePattern(String pattern) {\n if (pattern == null || pattern.length() == 0)\n throw new IllegalArgumentException(\"Empty date time pattern specification\");\n\n DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();\n parseToBuilder(builder, pattern);\n DateTimeFormatter formatter = builder.toFormatter();\n\n return formatter;\n }", "String getDate();", "String getDate();", "public static String getDate(Date date)\n\t{\n\t\treturn getFormatString(date, getDateFormat());\n\t}", "public static String getDateAsString(Date date) {\r\n\t\tSimpleDateFormat dateform = new SimpleDateFormat(_dateFormat);\r\n\r\n\t\treturn dateform.format(date);\r\n\t}", "public String getFormatedDate(Date date) {\r\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"dd/mm/yyyy\");\r\n\t\treturn sdf.format(date);\r\n\t}", "public static String convert( Date date )\r\n {\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat( \"yyyy-MM-dd\" );\r\n\r\n return simpleDateFormat.format( date );\r\n }", "public static String formatToString(long unixTimeInSecond, String pattern) {\n if (StringUtils.isBlank(pattern)) {\n pattern = DEFAULT_TIME_PATTERN;\n }\n LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(unixTimeInSecond), ZoneOffset.systemDefault());\n return DateTimeFormatter.ofPattern(pattern).format(dateTime);\n }", "public java.sql.Date format(String date) {\n int i = 0;\n int dateAttr[];\n dateAttr = new int[3];\n for(String v : date.split(\"/\")) {\n dateAttr[i] = Integer.parseInt(v);\n i++;\n }\n\n GregorianCalendar gcalendar = new GregorianCalendar();\n gcalendar.set(dateAttr[2], dateAttr[0]-1, dateAttr[1]); // Year,Month,Day Of Month\n java.sql.Date sdate = new java.sql.Date(gcalendar.getTimeInMillis());\n return sdate;\n }", "public String formatDate (Date date){\r\n\t\tDateFormat df = new SimpleDateFormat(\"EEE, d MMM yyyy HH:mm:ss z\", Locale.ENGLISH);\r\n\t\treturn df.format(date);\r\n\t}", "public static String formatDate(java.sql.Date date){\n\t\treturn date!=null?toTheString(date):\"\";\n\t}", "private String formatDate(Date date) {\n String resultDate;\n SimpleDateFormat dateFormat;\n dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n resultDate = dateFormat.format(date);\n return resultDate;\n }", "public static String dateToStringFormat(Calendar calendar, String format){\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);\n return simpleDateFormat.format(calendar.getTime());\n }", "private static String toString(int year, int month, int day) {\n\n // Use a buffer to create the string\n StringBuffer buffer = new StringBuffer(8);\n\n // Append the year\n if (year < 10) {\n buffer.append(\"000\");\n } else if (year < 100) {\n buffer.append(\"00\");\n } else if (year < 1000) {\n buffer.append('0');\n }\n buffer.append(year);\n\n // Append the month\n if (month < 10) {\n buffer.append('0');\n }\n buffer.append(month);\n\n // Append the day\n if (day < 10) {\n buffer.append('0');\n }\n buffer.append(day);\n\n return buffer.toString();\n }", "@Override\n\tpublic String toString() {\n\t\ttry {\n\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\t\tDate date = formatter.parse(month + \"/\" + day + \"/\" + year);\n\n\t\t\treturn formatter.format(date);\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public String getStringDate(){\n String finalDate = \"\";\n Locale usersLocale = Locale.getDefault();\n DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);\n String weekdays[] = dfs.getWeekdays();\n int day = date.get(Calendar.DAY_OF_WEEK);\n String nameOfDay = weekdays[day];\n\n finalDate += nameOfDay + \" \" + date.get(Calendar.DAY_OF_MONTH) + \", \";\n\n String months[] = dfs.getMonths();\n int month = date.get(Calendar.MONTH);\n String nameOfMonth = months[month];\n\n finalDate += nameOfMonth + \", \" + date.get(Calendar.YEAR);\n\n return finalDate;\n }", "public static String getStrDate(Date date) {\n //TODO get date\n SimpleDateFormat formatter;\n if (DateUtils.isToday(date.getTime())) {\n formatter = new SimpleDateFormat(\"HH:mm\");\n return formatter.format(date);\n }\n formatter = new SimpleDateFormat(\"MMM dd\");\n return formatter.format(date);\n }", "public String dateFormatter(String fromDate) {\n\t\tString newDateString=\"\";\n\t\ttry {\n\t\t\tfinal String oldFormat = \"yyyy/MM/dd\";\n\t\t\tfinal String newFormat = \"yyyy-MM-dd\";\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(oldFormat);\n\t\t\tDate d = sdf.parse(fromDate);\n\t\t\tsdf.applyPattern(newFormat);\n\t\t\tnewDateString = sdf.format(d);\n\t\t} catch(Exception exp) {\n\t\t\tthrow ExceptionUtil.getYFSException(ExceptionLiterals.ERRORCODE_INVALID_DATE, exp);\n\t\t}\n\t\treturn newDateString;\n\t}", "public String getDateString(Date date) {\n Calendar cal = Calendar.getInstance();\n\n cal.setTime(date);\n int year = cal.get(Calendar.YEAR);\n String month = String.format(\"%02d\", cal.get(Calendar.MONTH) + 1);\n String day = String.format(\"%02d\", cal.get(Calendar.DAY_OF_MONTH));\n return year + month + day;\n }", "public static String formatDate(Calendar date, DateFormat format) {\n\n switch (format) {\n case COMPLETE_DATE_FORMAT:\n format = DateFormat.COMPLETE_DATE_FORMAT;\n break;\n case DAY_FORMAT:\n format = DateFormat.DAY_FORMAT;\n break;\n }\n\n SimpleDateFormat dateFormatter = new SimpleDateFormat(format.getFormat(), Locale.US);\n\n return dateFormatter.format(date.getTime());\n }", "private String formatDate(String date)\n\t{\n\t\tif(date == null || date.isEmpty())\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString[] dateSplit = date.split(\"/\");\n\t\t\tif(dateSplit.length != 3)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn getMonthName(dateSplit[0]) + \" \"+ dateSplit[1]+\", \"+ dateSplit[2];\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.8005487", "0.7416862", "0.7283096", "0.7163661", "0.70958173", "0.70723426", "0.6571093", "0.65497774", "0.6296196", "0.61360383", "0.6113263", "0.6046777", "0.6011517", "0.59892505", "0.5979728", "0.5913717", "0.5908517", "0.5901056", "0.5875054", "0.5874348", "0.5867673", "0.58613604", "0.58308756", "0.58186454", "0.5812609", "0.58111656", "0.580759", "0.5751799", "0.57500327", "0.57472", "0.57361424", "0.5713485", "0.5704553", "0.5680443", "0.56473744", "0.56392324", "0.5632651", "0.5631565", "0.56232", "0.5611041", "0.55978465", "0.55934644", "0.55832034", "0.5566068", "0.55635107", "0.5534174", "0.5530577", "0.5527725", "0.5522139", "0.55097324", "0.55056596", "0.5462446", "0.5456043", "0.5455127", "0.54485404", "0.54357344", "0.5430631", "0.542966", "0.5425687", "0.5424553", "0.54184604", "0.54182845", "0.54108983", "0.5406839", "0.5391986", "0.53882986", "0.5374705", "0.53706217", "0.5364299", "0.5357174", "0.5353532", "0.5353124", "0.5342692", "0.53386337", "0.5335802", "0.533475", "0.53296787", "0.532229", "0.5321082", "0.5302743", "0.5298221", "0.5298221", "0.5292962", "0.5292539", "0.52864563", "0.5285505", "0.52849466", "0.527898", "0.5278626", "0.5276619", "0.5272451", "0.52675116", "0.5267232", "0.5266506", "0.5263754", "0.5259917", "0.5256444", "0.5240094", "0.5239505", "0.52355045" ]
0.54833686
51
/ finds the shortest path in a graph using bellmanford Algorithm.
public int[] findMinimunPathBF(int src, int[][] graph) { // The distance from the src to each vertices. int[] dist = new int[graph.length]; // Maximizing the distance of the sre to all the vertices. for (int i = 0; i < dist.length; i++) { dist[i] = Integer.MAX_VALUE; } dist[src] = 0; // Loop |v|-1 times, For each edge in the graph. for (int k = 0; k < graph.length - 1; k++) { // For each edge in the graph. for (int i = 0; i < graph.length; i++) { for (int j = 0; j < graph.length; j++) { // Relax edge(i, j). if (graph[i][j] != 0) { if (dist[i] != Integer.MAX_VALUE && dist[j] > dist[i] + graph[i][j]) { dist[j] = dist[i] + graph[i][j]; } } } } } // Check if there is a negative cycle, loop the edges. for (int i = 0; i < graph.length; i++) { // For each edge in the graph. for (int j = 0; j < graph.length; j++) { if (graph[i][j] != 0) { // Still can relax the edges?. if (dist[i] != Integer.MAX_VALUE && dist[j] > dist[i] + graph[i][j]) { // Put a sign of having a negative cycle. dist[0] = Integer.MIN_VALUE; return dist; } } } } return dist; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void bellman_ford(int s)\n {\n int dist[]=new int[V]; \n \n //to track the path from s to all\n int parent[]=new int[V] ;\n //useful when a vertex has no parent\n for(int i=0;i<V;i++)\n parent[i]=-2;\n \n for(int i=0;i<V;i++) \n dist[i]=INF;\n \n //start from source vertex\n dist[s]=0;\n parent[s]=-1;\n \n //we have to iterate over all the edges for V-1 times\n //each ith iteration finds atleast ith path length dist\n //worst case each ith will find ith path length \n \n for(int i=1;i<V;i++) \n {\n for(int j=0;j<E;j++)\n {\n //conside for all edges (u,v), wt\n int u=edge[j].src;\n int v=edge[j].dest;\n int wt=edge[j].wt; \n //since dist[u]=INF and adding to it=>overflow, therefore check first\n if( dist[u]!=INF && dist[u]+wt < dist[v])\n {\n dist[v]=dist[u]+wt;\n parent[v]=u;\n } \n }\n }\n \n //iterate for V-1 times, one more iteration necessarily gives a path length of atleast V in W.C=>cycle\n for(int j=0;j<E;j++) \n {\n int u=edge[j].src;\n int v=edge[j].dest;\n int wt=edge[j].wt;\n if( dist[u]!=INF && dist[u]+wt < dist[v])\n {\n System.out.println(\"Graph has cycle\");\n return;\n } \n }\n \n //print the distance to all from s\n System.out.println(\"from source \"+s+\" the dist to all other\");\n print_dist(dist); \n print_path(parent,dist,s); \n \n }", "private static void bellmanfordTest() {\n\t\t\n\t\tgraphs.objectorientedgraph.Graph<Integer> graph = new graphs.objectorientedgraph.Graph<Integer>();\n\t\t\n\t\tfor (int i = 0; i < 6; i++)\n\t\t\tgraph.addVertex(i, i);\n\t\t\n\t\tgraph.addDirectedEdge(0, 1, 0);\n\t\tgraph.addDirectedEdge(0, 2, 0);\n\t\tgraph.addDirectedEdge(0, 3, 0);\n\t\tgraph.addDirectedEdge(0, 4, 0);\n\t\tgraph.addDirectedEdge(0, 5, 0);\n\t\tgraph.addDirectedEdge(5, 1, -1);\n\t\tgraph.addDirectedEdge(5, 2, 1);\n\t\tgraph.addDirectedEdge(1, 4, 4);\n\t\tgraph.addDirectedEdge(1, 3, 5);\n\t\tgraph.addDirectedEdge(2, 1, 0);\n\t\tgraph.addDirectedEdge(3, 5, -3);\n\t\tgraph.addDirectedEdge(3, 4, -1);\n\t\tgraph.addDirectedEdge(4, 5, -3);\n\t\t\n\t\tBellmanFordAlgo<Integer> bellnBellmanFordAlgo = new BellmanFordAlgo(graph ,graph.vertexList.get(0));\n\t\t\n\t\tbellnBellmanFordAlgo.getSingleSourceShortestPath();\n\t\t\n\t\tbellnBellmanFordAlgo.printPath(graph.vertexList.get(3));\n\t\t\n\t}", "public void bellman_ford(int input)\n{\n this.minimumTree = this._getKruskalTree(false);\n /*\n * Lets write the heritage of our minimum spanning tree to our Bellman Ford\n * arrays, and see what happens.\n */\n while (0 != minimumTree.size()) {\n Edge nextEdge = minimumTree.remove();\n this.bellmanParent[nextEdge.destVert] = nextEdge.srcVert;\n this.bellmanDistance[nextEdge.destVert] = nextEdge.distance;\n }\n System.out.println(\"shortest path \\t\\t\\t weight\");\n /*\n * We need to find the immediate children for the input vertex, and see how\n * far that gets us. Depending upon where the input is in the minimum\n * spanning tree, only a subtree may be accessible since this is a directed\n * graph.\n */\n for (int loop = 0;\n loop < this.nVerts;\n loop++\n ) {\n LinkedList<Integer> output = this._findShortestPath(input, loop);\n Integer result = output.removeFirst();\n int weight = 0;\n if (-1 == result) {\n continue;\n }\n System.out.print(this.vertexList[result].label);\n weight += this.bellmanDistance[result];\n while (0 != output.size()) {\n result = output.removeFirst();\n weight += this.bellmanDistance[result];\n System.out.print(\" -> \" + this.vertexList[result].label);\n }\n System.out.println(\" \\t\\t\\t\\t \" + weight);\n }\n}", "@Override\n\tpublic void bellmanFord(IWeightedGraph<N, E> graph, int startnode) {\n\t\tif(graph == null){\n\t\t\tthrow new NullPointerException();\n\t\t}else if (startnode < 0 || startnode > graph.numberOfNodes()-1){\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\n\n\t\tfor(int i= 0; i<shortestPaths.length;i++){\n\t\t\tshortestPaths[i] = Double.POSITIVE_INFINITY;\n\t\t}\n\t\tshortestPaths[startnode] = 0;\n\n\t\tfor(int i= 1; i<graph.numberOfNodes(); i++){\n\t\t\tIterator<IEdge<E>> edgesIterator = graph.edgeIterator();\n\t\t\twhile(edgesIterator.hasNext()){\n\t\t\t\tIEdge<E> edge = edgesIterator.next();\n\t\t\t\tif(shortestPaths[edge.getSource()] + edge.getWeight() < shortestPaths[edge.getDestination()]){\n\t\t\t\t\tshortestPaths[edge.getDestination()] = shortestPaths[edge.getSource()] + edge.getWeight();\n\t\t\t\t\tpreviousNode[edge.getDestination()] = edge.getSource();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "int[] bfs(int[][] graph,int source){\n int len=graph.length;\n int shortest_path[]=new int[len];\n int parent[]=new int[len];\n Arrays.fill(shortest_path, Integer.MAX_VALUE/2);\n shortest_path[source]=0;\n Queue<Integer> q=new LinkedList<>();\n q.add(source);\n while (!q.isEmpty()) { \n int u=q.poll();\n for(int v:graph[u]){\n if(shortest_path[v]==Integer.MAX_VALUE/2){\n q.add(v);\n shortest_path[v]=shortest_path[u]+1;\n parent[v]=u;\n }\n }\n }\n return shortest_path;\n }", "void shortestPath( final VertexType fromNode, Integer node );", "private static void shortestPath(Graph graph, Character startNode, int algorithm) {\n Node currentNode = graph.getNode(startNode);\n\n // keep track of the nodes visited\n List<Character> nodesVisited = new ArrayList<>();\n\n // add the current node\n nodesVisited.add(currentNode.getName());\n\n // breadth first search to help keep track of the nodes we have already visited\n // helps with backtracking\n Stack<Node> visitingNodes = new Stack<>();\n\n // loop through the graph\n while (currentNode != graph.getNode('Z')) {\n // we have visited a node\n // add it to the stack\n // set true to since its been visited and it will be in the shortest path\n visitingNodes.add(currentNode);\n currentNode.setNodeVisited(true);\n currentNode.setInShortestPath(true);\n\n // get all the edges that are connected to the current node we are on\n List<Edge> adjacentNodes = currentNode.getNeighbors();\n\n // temp for next node\n Node nextNode = null;\n int weightDistanceTotal = Integer.MAX_VALUE;\n\n for (Edge i: adjacentNodes) {\n // testing\n // System.out.println(i.destination.getName());\n // System.out.println(i.destination.getDistanceToZ());\n\n // 1. always check to see if we have visited the node\n if (i.destination.isNodeVisited()) {\n // System.out.println(i.destination.getName() + \" is already in the path\");\n continue;\n }\n\n // 2. assign the next node to the destination\n if (nextNode == null) {\n nextNode = i.destination;\n }\n\n // compare distances\n if (algorithm == 1) {\n nextNode = updateNextNodeAlgo1(nextNode, i.destination);\n } else {\n NodeWithWeightDistanceTotal nodeWithWeightDistanceTotal = updateNextNodeAlgo2(nextNode, i, weightDistanceTotal);\n nextNode = nodeWithWeightDistanceTotal.node;\n weightDistanceTotal = nodeWithWeightDistanceTotal.weightDistanceTotal;\n }\n //if (nextNode.getDistanceToZ() > i.destination.getDistanceToZ()) {\n // nextNode = i.destination;\n //}\n }\n\n // next has no other edges\n if (nextNode == null) {\n // System.out.println(\"There no place to go from \" + currentNode.getName());\n // pop off the node we just visited\n nextNode = visitingNodes.pop();\n // its not in the shortest path to Z\n nextNode.setInShortestPath(false);\n // set the next node to the previous node\n nextNode = visitingNodes.pop();\n }\n\n // add the nodes we visit to keep track of the path\n nodesVisited.add(nextNode.getName());\n\n // System.out.println(Arrays.toString(nodesVisited.toArray()));\n // testing purposes to see if the node is on the shortest path\n\n// for (Character node: nodesVisited) {\n// Node boolVisit = graph.getNode(node);\n// System.out.println(boolVisit.isInShortestPath());\n// }\n\n // progress to the next node\n currentNode = nextNode;\n // when visiting the last node mark z in the shortest path\n if (currentNode.getName() == 'Z') {\n currentNode.setInShortestPath(true);\n }\n // testing\n // System.out.println(\"next node = \" + currentNode.getName());\n }\n\n // keep track of the path visited and the total addition of weights\n int pathCounter = 0;\n\n // construct the shortest path\n List<Node> shortestPath = new ArrayList<>();\n\n for (Character nodeVisitor: nodesVisited) {\n // get the node\n Node node = graph.getNode(nodeVisitor);\n\n // add to the shortest path\n if (node.isInShortestPath() && !shortestPath.contains(node)) {\n shortestPath.add(node);\n }\n }\n\n // print the shortest path\n for (int i = 0; i < shortestPath.size() - 1; i++) {\n currentNode = shortestPath.get(i);\n Node nextNode = shortestPath.get(i + 1);\n\n // find the weight of that node\n int weight = currentNode.findWeight(nextNode);\n pathCounter += weight;\n\n // System.out.println(\"weight \" + weight);\n // System.out.println(\"path total \" + pathCounter);\n }\n\n // final output\n String fullPathSequence = \"\";\n String shortestPathSequence = \"\";\n\n for (int i = 0; i < nodesVisited.size(); i++) {\n if (i != nodesVisited.size() - 1) {\n fullPathSequence += nodesVisited.get(i) + \" -> \";\n }\n }\n\n fullPathSequence += nodesVisited.get(nodesVisited.size() - 1);\n\n for (int i = 0; i < shortestPath.size(); i++) {\n if (i != shortestPath.size() - 1) {\n shortestPathSequence += shortestPath.get(i).getName() + \" -> \";\n }\n }\n\n if (currentNode.getName() == 'Z') {\n shortestPathSequence += \"Z\";\n } else {\n shortestPathSequence += shortestPath.get(shortestPath.size() - 1).getName();\n }\n\n System.out.println(\"Algorithm \" + algorithm + \" : \");\n System.out.println(\"Sequence of all nodes \" + fullPathSequence);\n System.out.println(\"Shortest path: \" + shortestPathSequence);\n System.out.println(\"Shortest path length: \" + pathCounter);\n System.out.println(\"\\n\");\n\n // reset the graph\n graph.graphReset();\n\n }", "public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }", "void BFS(int s, int d) \r\n { \r\n int source = s;\r\n int destination = d;\r\n boolean visited[] = new boolean[V];\r\n int parent[] = new int[V];\r\n \r\n // Create a queue for BFS \r\n LinkedList<Integer> queue = new LinkedList<Integer>(); \r\n \r\n // Mark the current node as visited and enqueue it \r\n \r\n visited[s]=true; \r\n queue.add(s); \r\n System.out.println(\"Search Nodes: \");\r\n while (queue.size() != 0) \r\n { \r\n int index = 0;\r\n \r\n // Dequeue a vertex from queue and print it \r\n \r\n s = queue.poll();\r\n \r\n System.out.print(convert2(s)); \r\n \r\n if(s == destination)\r\n {\r\n break;\r\n }\r\n \r\n System.out.print(\" -> \");\r\n while(index < adj[s].size()) \r\n { \r\n \r\n \r\n int n = adj[s].get(index); \r\n if (!visited[n]) \r\n { \r\n visited[n] = true;\r\n parent[n] = s;\r\n queue.add(n); \r\n }\r\n index = index+ 2;\r\n \r\n \r\n }\r\n \r\n \r\n \r\n }\r\n int check = destination;\r\n int cost = 0, first, second = 0;\r\n String string = \"\" + convert2(check);\r\n while(check!=source)\r\n {\r\n \r\n first = parent[check];\r\n string = convert2(first) + \" -> \" + string;\r\n while(adj[first].get(second) != check)\r\n {\r\n second++;\r\n }\r\n cost = cost + adj[first].get(second +1);\r\n check = first;\r\n second = 0;\r\n \r\n }\r\n \r\n System.out.println(\"\\n\\nPathway: \");\r\n \r\n System.out.println(string);\r\n \r\n \r\n System.out.println(\"\\nTotal cost: \" + cost);\r\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 int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}", "ShortestPath(UndirectedWeightedGraph graph, String startNodeId, String endNodeId) throws NotFoundNodeException {\r\n\t\t\r\n\t\tif (!graph.containsNode(startNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, startNodeId);\r\n\t\t}\t\t\r\n\t\tif (!graph.containsNode(endNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, endNodeId);\r\n\t\t}\t\r\n\r\n\t\tsrc = startNodeId;\r\n\t\tdst = endNodeId;\r\n\t\t\r\n\t\tif (endNodeId.equals(startNodeId)) {\r\n\t\t\tlength = 0;\r\n\t\t\tnumOfPath = 1;\r\n\t\t\tArrayList<String> path = new ArrayList<String>();\r\n\t\t\tpath.add(startNodeId);\r\n\t\t\tpathList.add(path);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// create a HashMap of updated distance from the starting node to every node\r\n\t\t\t// initially it is 0, inf, inf, inf, ...\r\n\t\t\tHashMap<String, Double> distance = new HashMap<String, Double>();\t\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif (nodeId.equals(startNodeId)) {\r\n\t\t\t\t\t// the starting node will always have 0 distance from itself\r\n\t\t\t\t\tdistance.put(nodeId, 0.0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// the others have initial distance is infinity\r\n\t\t\t\t\tdistance.put(nodeId, Double.MAX_VALUE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// a HashMap of preceding node of each node\r\n\t\t\tHashMap<String, HashSet<String>> precedence = new HashMap<String, HashSet<String>>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif ( nodeId.equals(startNodeId) ) {\r\n\t\t\t\t\tprecedence.put(nodeId, null);\t// the start node will have no preceding node\r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tprecedence.put(nodeId, new HashSet<String>());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\tSet<String> unvisitedNode = new HashSet<String>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tunvisitedNode.add(nodeId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble minUnvisitedLength;\r\n\t\t\tString minUnvisitedNode;\r\n\t\t\t// run loop while not all node is visited\r\n\t\t\twhile ( unvisitedNode.size() != 0 ) {\r\n\t\t\t\t// find the unvisited node with minimum current distance in distance list\r\n\t\t\t\tminUnvisitedLength = Double.MAX_VALUE;\r\n\t\t\t\tminUnvisitedNode = \"\";\r\n\t\t\t\tfor (String nodeId : unvisitedNode) {\r\n\t\t\t\t\tif (distance.get(nodeId) < minUnvisitedLength) {\r\n\t\t\t\t\t\tminUnvisitedNode = nodeId;\r\n\t\t\t\t\t\tminUnvisitedLength = distance.get(nodeId); \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if there are no node that can be visited from the unvisitedNode, break the loop \r\n\t\t\t\tif (minUnvisitedLength == Double.MAX_VALUE) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// remove the node from unvisitedNode\r\n\t\t\t\tunvisitedNode.remove(minUnvisitedNode);\r\n\t\t\t\t\r\n\t\t\t\t// update the distance of its neighbors\r\n\t\t\t\tfor (Node neighborNode : graph.getNodeList().get(minUnvisitedNode).getNeighbors().keySet()) {\r\n\t\t\t\t\tdouble distanceFromTheMinNode = distance.get(minUnvisitedNode) + graph.getNodeList().get(minUnvisitedNode).getNeighbors().get(neighborNode).getWeight();\r\n\t\t\t\t\t// if the distance of the neighbor can be shorter from the current node, change \r\n\t\t\t\t\t// its details in distance and precedence\r\n\t\t\t\t\tif ( distanceFromTheMinNode < distance.get(neighborNode.getId()) ) {\r\n\t\t\t\t\t\tdistance.replace(neighborNode.getId(), distanceFromTheMinNode);\r\n\t\t\t\t\t\t// renew the precedence of the neighbor node\r\n\t\t\t\t\t\tprecedence.put(neighborNode.getId(), new HashSet<String>());\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (distanceFromTheMinNode == distance.get(neighborNode.getId())) {\r\n\t\t\t\t\t\t// unlike dijkstra's algorithm, multiple path should be update into the precedence\r\n\t\t\t\t\t\t// if from another node the distance is the same, add it to the precedence\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// if the current node in the process is the end node, we can stop the while loop here\r\n\t\t\t\tif (minUnvisitedNode == endNodeId) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (distance.get(endNodeId) == Double.MAX_VALUE) {\r\n\t\t\t\t// in case there is no shortest path between the 2 nodes\r\n\t\t\t\tlength = 0;\r\n\t\t\t\tnumOfPath = 0;\r\n\t\t\t\tpathList = null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// other wise we have these information\r\n\t\t\t\tlength = distance.get(endNodeId);\r\n\t\t\t\t//numOfPath = this.getNumPath(precedence, startNodeId, endNodeId);\r\n\t\t\t\tpathList = this.findPathList(precedence, startNodeId, endNodeId);\r\n\t\t\t\tnumOfPath = pathList.size();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t// END ELSE\t\t\r\n\t}", "public ShortestPath(IWeightedGraph<N,E> graph, int startNode) {\n\t\tthis.graph = graph;\n\t\tthis.startNode = startNode;\n\t\tthis.shortestPaths = new double[graph.numberOfNodes()];\n\t\tthis.previousNode = new int[graph.numberOfNodes()];\n\t\tbellmanFord(this.graph, this.startNode);\n\t}", "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 }", "private int bfs(String source, String destination, Map<String, List<String>> graph) {\n\n class Node {\n String word;\n int distance = 0;\n\n public Node(String word, int distance) {\n this.word = word;\n this.distance = distance;\n }\n }\n\n final Queue<Node> queue = new LinkedList<>();\n Set<String> visited = new HashSet<>();\n queue.offer(new Node(source, 0)); //distance of source to source is 0\n visited.add(source);\n\n while (!queue.isEmpty()) {\n\n final Node node = queue.poll();\n final int distance = node.distance;\n\n //if we reached the destination node\n if (node.word.equals(destination)) {\n return distance + 1;\n }\n\n //try all word which is 1 weight away\n for (String neighbour : graph.getOrDefault(node.word, new ArrayList<>())) {\n if (!visited.contains(neighbour)) {\n visited.add(neighbour);\n queue.offer(new Node(neighbour, distance + 1));\n }\n }\n\n\n }\n return 0;\n }", "void shortestPaths( Set<Integer> nodes );", "private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\n }", "@Override\n public List dijkstrasShortestPath(T start, T end) {\n Vertex<T> origin = new Vertex<>(start);\n Vertex<T> destination = new Vertex<>(end);\n List<Vertex<T>> path;\n\n settledNodes = new HashSet<>();\n unSettledNodes = new HashSet<>();\n distancesBetweenNodes = new HashMap<>();\n predecessors = new HashMap<>();\n\n distancesBetweenNodes.put(origin,0);\n unSettledNodes.add(origin);\n\n while(unSettledNodes.size() > 0){\n Vertex<T> minimumWeightedVertex = getMinimum(unSettledNodes);\n settledNodes.add(minimumWeightedVertex);\n unSettledNodes.remove(minimumWeightedVertex);\n findMinimumDistance(minimumWeightedVertex);\n }\n path = getPath(destination);\n return path;\n\n }", "static void BellmanFord(int[][] edges, int src) {\n int V = edges[0].length;\n int dist[] = new int[V];\n\n // Step 1: Initialize distances from src to all other\n // vertices as INFINITE\n for (int i = 0; i < V; i++)\n dist[i] = Integer.MAX_VALUE;\n dist[src] = 0;\n\n // Step 2: Relax all edges |V| - 1 times. A simple\n // shortest path from src to any other vertex can\n // have at-most |V| - 1 edges\n // var++ is the value of the variable before incrementing, whereas the result returned by ++var is the value of the variable after the increment is applied.\n for (int i = 1; i < V; i++) {\n for (int j = 0; j < V; j++) {\n for (int k = 0; k < V; k++) {\n if (j != k && edges[j][k] != Integer.MAX_VALUE) {\n int weight = edges[j][k];\n if (dist[j] != Integer.MAX_VALUE && dist[j] + weight < dist[k])\n dist[k] = dist[j] + weight;\n }\n }\n }\n }\n\n // Step 3: check for negative-weight cycles. The above\n // step guarantees shortest distances if graph doesn't\n // contain negative weight cycle. If we get a shorter\n // path, then there is a cycle.\n for (int j = 0; j < V; j++) {\n for (int k = 0; k < V; k++) {\n if (j != k && edges[j][k] != Integer.MAX_VALUE) {\n int weight = edges[j][k];\n if (dist[j] != Integer.MAX_VALUE && dist[j] + weight < dist[k])\n System.out.println(\"Graph contains negative weight cycle\");\n }\n }\n }\n System.out.println();\n }", "private LinkedList<Integer> _findShortestPath(int source, int destination)\n{\n LinkedList<Integer> output = new LinkedList<Integer>();\n if (this.bellmanParent[destination] == source) {\n output.addFirst(destination);\n output.addFirst(source);\n return output;\n }\n /*\n * Our source is only part of the subtree, and we requested a node beyond\n * its reach. Lets flag it so that the calling function knows to ignore this\n * result.\n */\n if (this.bellmanParent[destination] == destination) {\n output.addFirst(-1);\n return output;\n }\n output = this._findShortestPath(source, this.bellmanParent[destination]);\n output.addLast(destination);\n return output;\n}", "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 List<GraphEdge<String, String>> shortestPath(Graph<String, String> graph, String src, String dest) {\n // ... implement BFS as described in HW6 ...\n\t Queue<GraphNode<String>> q = new LinkedList<GraphNode<String>>();\n\t \n\t // Each key in m is a visited node\n\t // Each value is a list containing the shortest path from start\n\t Map<GraphNode<String>, List<GraphEdge<String, String>>> m = new HashMap<GraphNode<String>, List<GraphEdge<String, String>>>();\n\t \n\t q.add(graph.getNode(src));\n\t m.put(graph.getNode(src), new ArrayList<GraphEdge<String, String>>());\n\t \n\t //{{Inv: m has a key for every node added to q so far\n\t //\t\t (even those that have since been removed)\n\t //\t The value associated with each key is the shortest path to that node}}\n\t while (!q.isEmpty()) {\n\t\t GraphNode<String> temp = q.remove();\n\t\t if (temp.getData().equals(dest)) {\n\t\t\t return m.get(temp);\n\t\t }\n\t\t \n\t\t Set<GraphEdge<String, String>> set = new TreeSet<GraphEdge<String, String>>();\n\t\t set.addAll(graph.getChildren(temp));\n\t\t \n\t\t for (GraphEdge<String, String> edge : set) {\n\t\t\t if (!m.containsKey(edge.getDestination())) {\n\t\t\t\t List<GraphEdge<String, String>> list = new ArrayList<GraphEdge<String, String>>(m.get(temp));\n\t\t\t\t list.add(edge);\n\t\t\t\t m.put(edge.getDestination(), list);\n\t\t\t\t q.add(edge.getDestination());\n\t\t\t }\n\t\t }\n\t }\n\t \n\t return null;\n }", "public static int shortestDistance(Graph graph, Vertex a, Vertex b) {\n Set<List<Vertex>> listSetVertex=breadthFirstSearch(graph);\n int distance=graph.getVertices().size();\n for(List<Vertex> lv: listSetVertex){\n int aindex=lv.indexOf(a);\n int bindex=lv.indexOf(b);\n if(aindex>=0&&bindex>=0){\n distance=distance>Math.abs(aindex-bindex)?Math.abs(aindex-bindex):distance;\n }\n }\n return distance==graph.getVertices().size()?-1:distance;\n }", "private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}", "public List<node_info> shortestPath(int src, int dest);", "public static int dijkstra(AdjList<String> adjList, String startNode, String endNode, LinkedList<String> pathList) {\n //Valid AdjList\n if (adjList == null || adjList.size() == 0 || adjList.hasNegativeEdges())\n return Integer.MAX_VALUE;\n\n //Checks if start and end nodes exist in adjList\n if (!adjList.contains(startNode) || !adjList.contains(endNode))\n return Integer.MAX_VALUE;\n\n //Checks if graph is suitable for BFS\n if (!adjList.isWeighted())\n return BFS(adjList, startNode, endNode, pathList);\n\n //Sets all node objects in adjList to defaults\n adjList.cleanNodeFields();\n\n //Fibonacci heap for storing current shortest path\n FibHeap<Integer, String> q = new FibHeap<>();\n\n //Set source node value to 0\n q.insert(adjList.getNode(startNode), 0);\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, String>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, String> neighbor, u;//Current Node with shortest path / top of min-queue\n int edgeWeight;\n while (q.size() != 0) {\n u = q.extractMin();\n u.closed = true;\n\n //endNode found\n if (Objects.equals(u.value, endNode)) {\n //Build path of vertexes\n Node<Integer, String> current = adjList.getNode(endNode);\n pathList.add(current.value);\n while ((current = current.prev) != null)\n pathList.addFirst(current.value);\n return u.d;\n }\n\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, String>, Integer> neighborKeyValuePair : neighbors) {//Loops through every neighbor\n neighbor = neighborKeyValuePair.getKey();\n edgeWeight = neighborKeyValuePair.getValue();\n //Relaxation step\n //Checks if distance to neighbor node is less than the min distance already found\n if (!neighbor.visited || neighbor.d > u.d + edgeWeight) {\n //Assign shorter path found to neighbor in out array\n neighbor.d = u.d + edgeWeight;\n\n //Assigns previous shortest node to neighbor\n neighbor.prev = u;\n\n //Inserts or decrease key\n if (!neighbor.visited) {\n q.insert(neighbor, u.d + edgeWeight);\n neighbor.visited = true;\n } else {\n q.decreaseKey(neighbor, u.d + edgeWeight);\n }\n }\n }\n }\n return Integer.MAX_VALUE;\n }", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "public int shortestPath(Village startVillage, Village targetVillage) {\n// setting the initial point 's minimum distance to zera\n startVillage.setMinDistance(0);\n// accourting to bellman ford if there are n number of dots then n-1 iterations to be done to find the minimum distances of every dot from one initial dot\n int length = this.villageList.size();\n// looping n-1 times\n for (int i = 0; i < length - 1; i++) {\n// looping through all the roads and mark the minimum distances of all the possible points\n for (Road road : roadList) {\n\n\n// if the road is a main road then skip the path\n if (road.getWeight() == 900)\n continue; //why 900 ? : just a random hightest number as a minimum distance and same 900 is used as a mix number\n Village v = road.getStartVertex();\n Village u = road.getTargetVertex();\n// if the newly went path is less than the path it used to be the update the min distance of the reached vertex\n int newLengtha = v.getMinDistance() + road.getWeight();\n if (newLengtha < u.getMinDistance()) {\n u.setMinDistance(newLengtha);\n u.setPreviousVertex(v);\n }\n int newLengthb = u.getMinDistance() + road.getWeight();\n if (newLengthb < v.getMinDistance()) {\n v.setMinDistance(newLengthb);\n v.setPreviousVertex(v);\n }\n }\n }\n// finally return the minimum distance\n return targetVillage.getMinDistance();\n }", "private void breadthFirst(PathBetweenNodes graph, LinkedList<String> visited) {\r\n\r\n LinkedList<String> nodes = graph.adjacentNodes(visited.getLast());\r\n for (String node : nodes)\r\n {\r\n if (visited.contains(node))\r\n {\r\n continue;\r\n }\r\n if (node.equals(END))\r\n {\r\n \tif (mode1 && mode){\r\n visited.add(node);\r\n printPath(visited); \r\n graph.flag=false;\r\n mode=false;\r\n visited.removeLast();\r\n \t} else if(mode2){\r\n visited.add(node);\r\n printPath(visited); \r\n flag=mode2; \r\n visited.removeLast();\r\n \t} \r\n } \r\n }\r\n\r\n for (String node : nodes) { // implementing a for loop to call each node in the array nodes\r\n if (visited.contains(node) || node.equals(END)) { // if statement to see if node is already visited or it is the end node\r\n continue;\r\n }\r\n flag=true;\r\n visited.addLast(node); //adding the last node to visited array\r\n breadthFirst(graph, visited); // implementing the breath first search\r\n visited.removeLast(); // removing the last node from array visited\r\n }\r\n if (flag == false) {\r\n System.out.println(\"No path Exists between \" + START + \" and \" + END);\r\n flag = true;\r\n }\r\n }", "public void shortestRouteDijkstra(){\n int landmark1 = l1.getSelectionModel().getSelectedIndex();\n int landmark2 = l2.getSelectionModel().getSelectedIndex();\n GraphNodeAL<MapPoint> lm1 = landmarkList.get(landmark1);\n GraphNodeAL<MapPoint> lm2 = landmarkList.get(landmark2);\n\n shortestRouteDij(lm1, lm2);\n }", "@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tList<node_data> ans = new ArrayList<>();\n\t\tthis.shortestPathDist(src, dest);\n\t\tif(this.GA.getNode(src).getWeight() == Integer.MAX_VALUE || this.GA.getNode(dest).getWeight() == Integer.MAX_VALUE){\n\t\t\tSystem.out.print(\"There is not a path between the nodes.\");\n\t\t\treturn null;\n\t\t}\n\t\tgraph copied = this.copy();\n\t\ttransPose(copied);\n\t\tnode_data first = copied.getNode(dest);\n\t\tans.add(first);\n\t\twhile (first.getKey() != src) {\n\t\t\tCollection<edge_data> temp = copied.getE(first.getKey());\n\t\t\tdouble check= first.getWeight();\n\t\t\tif(temp!=null) {\n\t\t\t\tfor (edge_data edge : temp) {\n\t\t\t\t\tif (copied.getNode(edge.getDest()).getWeight() + edge.getWeight() == check) {\n\t\t\t\t\t\tfirst = copied.getNode(edge.getDest());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tans.add(first);\n\t\t}\n\t\tList<node_data> ans2 = new ArrayList<>();\n\t\tfor (int i = ans.size()-1;i>=0;i--){\n\t\t\tans2.add(ans.get(i));\n\t\t}\n\t\treturn ans2;\n\t}", "int main()\n{\n // Create a graph given in the above diagram\n Graph g(4);\n g.addEdge(0, 1);\n g.addEdge(0, 2);\n g.addEdge(1, 2);\n g.addEdge(2, 0);\n g.addEdge(2, 3);\n g.addEdge(3, 3);\n \n cout << \"Following is Breadth First Traversal \"\n << \"(starting from vertex 2) n\";\n g.BFS(2);\n \n return 0;\n}", "public Path getShortestPath() {\n\t\tNodeRecord startRecord = new NodeRecord(start, null, 0.0f, (float) heuristic.estimate(start), Category.OPEN);\n\n\t\t// Initialize the open list\n\t\tPathFindingList open = new PathFindingList();\n\t\topen.addRecordByEstimatedTotalCost(startRecord);\n\t\trecords.set(Integer.parseInt(startRecord.node.id), startRecord);\n\t\tNodeRecord current = null;\n\t\t\n\t\t// Iterate through processing each node\n\t\twhile (!open.isEmpty()) {\n\t\t\t// Find smallest element in the open list using estimatedTotalCost\n\t\t\tcurrent = open.getSmallestNodeRecordByEstimatedTotalCost();\n\n\t\t\t// If its the goal node, terminate\n\t\t\tif (current.node.equals(end)) break;\n\n\t\t\t// Otherwise get its outgoing connections\n\t\t\tArrayList<DefaultWeightedEdge> connections = g.getConnections(current.node);\n\t\t\t\n\t\t\t// Loop through each connection\n\t\t\tfor (DefaultWeightedEdge connection : connections) {\n\t\t\t\t// Get the cost and other information for end node\n\t\t\t Vertex endNode = g.graph.getEdgeTarget(connection);\n\t\t\t int endNodeRecordIndex = Integer.parseInt(endNode.id);\n NodeRecord endNodeRecord = records.get(endNodeRecordIndex); // this is potentially null but we handle it\n\t\t\t\tdouble newEndNodeCost = current.costSoFar + g.graph.getEdgeWeight(connection);\n\t\t\t\tdouble endNodeHeuristic = 0;\n\t\t\t\t\n\t\t\t\t// if node is closed we may have to skip, or remove it from closed list\t\n\t\t\t\tif( endNodeRecord != null && endNodeRecord.category == Category.CLOSED ){ \n\t\t\t\t\t// Find the record corresponding to the endNode\n\t\t\t\t\tendNodeRecord = records.get(endNodeRecordIndex);\n\n\t\t\t\t\t// If we didn't find a shorter route, skip\n\t\t\t\t\tif (endNodeRecord.costSoFar <= newEndNodeCost) continue;\n\n\t\t\t\t\t// Otherwise remove it from closed list\n\t\t\t\t\trecords.get(endNodeRecordIndex).category = Category.OPEN;\n\n\t\t\t\t\t// Use node's old cost values to calculate its heuristic to save computation\n\t\t\t\t\tendNodeHeuristic = endNodeRecord.estimatedTotalCost - endNodeRecord.costSoFar;\n\n\t\t\t\t// Skip if node is open and we've not found a better route\n\t\t\t\t} else if( endNodeRecord != null && endNodeRecord.category == Category.OPEN ){ \n\t\t\t\t\t// Here we find the record in the open list corresponding to the endNode\n\t\t\t\t\tendNodeRecord = records.get(endNodeRecordIndex);\n\n\t\t\t\t\t// If our route isn't better, skip\n\t\t\t\t\tif (endNodeRecord.costSoFar <= newEndNodeCost) continue;\n\n\t\t\t\t\t// Use the node's old cost values to calculate its heuristic to save computation\n\t\t\t\t\tendNodeHeuristic = endNodeRecord.estimatedTotalCost - endNodeRecord.costSoFar;\n\n\t\t\t\t// Otherwise we know we've got an unvisited node, so make a new record\n\t\t\t\t} else { // if endNodeRecord.category == Category.UNVISITED\n\t\t\t\t endNodeRecord = new NodeRecord();\n\t\t\t\t\tendNodeRecord.node = endNode;\n\t\t\t\t\trecords.set(endNodeRecordIndex, endNodeRecord);\n\n\t\t\t\t\t// Need to calculate heuristic since this is new\n\t\t\t\t\tendNodeHeuristic = heuristic.estimate(endNode);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t// We're here if we need to update the node\n\t\t\t\t// update the cost, estimate, and connection\n\t\t\t\tendNodeRecord.costSoFar = newEndNodeCost;\n\t\t\t\tendNodeRecord.edge = connection;\n\t\t\t\tendNodeRecord.estimatedTotalCost = newEndNodeCost + endNodeHeuristic;\n\n\t\t\t\t// Add it to the open list\n\t\t\t\tif ( endNodeRecord.category != Category.OPEN ) {\n\t\t\t\t\topen.addRecordByEstimatedTotalCost(endNodeRecord);\n\t\t\t\t\tendNodeRecord.category = Category.OPEN;\n\t\t\t\t\trecords.set(endNodeRecordIndex, endNodeRecord);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// We’ve finished looking at the connections for\n\t\t\t// the current node, so add it to the closed list\n\t\t\t// and remove it from the open list\n\t\t\topen.removeRecord(current);\n\t\t\tcurrent.category = Category.CLOSED;\n\t\t\trecords.set(Integer.parseInt(current.node.id), current);\n\t\t}\n\t\t\n\t\t// We’re here if we’ve either found the goal, or\n\t\t// if we’ve no more nodes to search, find which.\n\t\tif (!current.node.equals(end)) {\n\t\t\t// Ran out of nodes without finding the goal, no solution\n\t\t\treturn null;\n\t\t} else {\n\t\t // Compile the list of connections in the path\n\t\t\tArrayList<DefaultWeightedEdge> path = new ArrayList<>();\n\n\t\t\twhile (!current.node.equals(start)) {\n\t\t\t\tpath.add(current.edge);\n\t\t\t\t// Set current (NodeRecord) to is source.\n\t\t\t\tcurrent = records.get( Integer.parseInt(g.graph.getEdgeSource(current.edge).id) );\n\t\t\t}\n\n\t\t\t// Reverse the path, and return it\n\t\t\tCollections.reverse(path);\n\t\t\treturn new Path(g, path);\n\t\t}\n\n\t}", "public static <N>Path<N> findShortestPath(DirectedGraph<N, Double> graph, N first, N last){\n PriorityQueue<Path<N>> active = new PriorityQueue<>(new Comparator<Path<N>>() {\n @Override\n public int compare(Path<N> x, Path<N> y) {\n if(x.getCost() > y.getCost()){\n return 1;\n } else if (x.getCost() < y.getCost()){\n return -1;\n }\n return 0;\n }\n });\n\n Set<N> finished = new HashSet<>();\n N start = first;\n N end = last;\n\n active.add(new Path<N>(start));\n while(!active.isEmpty()){\n Path<N> minPath = active.remove();\n N minDest = minPath.getEnd();\n if(minDest.equals(end)){\n return minPath;\n }\n if(finished.contains(minDest)){\n continue;\n }\n for(Edge<N, Double> e : graph.getEdges(minDest)){\n if(!finished.contains(e.getChild())){\n Path<N> newPath = minPath.extend(e.getChild(), e.getLabel());\n active.add(newPath);\n }\n }\n finished.add(minDest);\n }\n return null;\n }", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "public List<Integer> BFS(int s, int t, ArrayList<ArrayList<Integer>> adjacencyLists) {\n\t\tint N = adjacencyLists.size();\n boolean visited[] = new boolean[N]; \n int parrent[] = new int[N];\n \n // Create a queue for BFS \n LinkedList<Integer> queue = new LinkedList<Integer>(); \n \n // Mark the current node as visited and enqueue it \n visited[s]=true; \n parrent[s]=-1;\n queue.add(s); \n Boolean hasPath = false;\n \n while (queue.size() != 0) \n { \n // Dequeue a vertex from queue and print it \n int current = queue.poll(); \n \n Iterator<Integer> i = adjacencyLists.get(current).listIterator();\n while (i.hasNext()) \n { \n int n = i.next(); \n if (!visited[n]) \n { \n visited[n] = true; \n parrent[n] = current;\n if (n == t) {\n \thasPath = true;\n \tbreak;\n }\n queue.add(n); \n } \n } \n } \n if (!hasPath) {\n \treturn null;\n }\n \n int trace = t;\n ArrayList<Integer> shortestPath = new ArrayList<Integer>();\n while(parrent[trace] != -1) {\n \tshortestPath.add(trace);\t\n \ttrace = parrent[trace];\n }\n shortestPath.add(s);\n Collections.reverse(shortestPath);\n return shortestPath;\n }", "public int[] djekstra(Router root, Router destination){\n //if router and destination same\n if (root.getID() == destination.getID()){\n int[] result = new int[2];\n result[0] = root.getID();\n result[1] = 0;\n hops.add(0);\n return result;\n }\n\n //Storing shortest path currently known\n int[] shortestPath = new int[size];\n //Storing the weights of the current router's connection to neighbors\n int[] currentNeighborConnectionWeight = new int[size];\n\n //First set all of the positions to 9999 (pseudo infinity)\n for (int i = 0; i < shortestPath.length;i++){\n shortestPath[i] = 9999;\n }\n\n // Set the distance to itself as 0, mark as visited\n shortestPath[root.getID()-1] = 0;\n root.visit();\n\n //For each connection the root has, set the shortestPath available to the weight to the neighbor\n for (Connection c : root.getConnections()){\n shortestPath[c.getDestination().getID()-1] = c.getWeight();\n }\n\n //Find the smallest router to start the algorithm\n //ID of smallest router, start the value with the first available option\n int smallestRouterID = 0;\n int smallestRouterWeight = 9999;\n //Router used for iterating\n Router current = null;\n //Storing path length\n int totalPathLength = 0;\n\n\n //Find the shortest available path link to start with\n for (int k = 0; k < shortestPath.length; k++){\n if ((shortestPath[k] < smallestRouterWeight) && (shortestPath[k] != 0)){\n // Check to see if dead end\n if (routers.get(k).getConnections().size() > 1){\n // id is pos+1\n smallestRouterID = k + 1;\n smallestRouterWeight = shortestPath[k];\n } else if (routers.get(k).getID() == destination.getID()){ //edge case\n // id is pos+1\n smallestRouterID = k + 1;\n smallestRouterWeight = shortestPath[k];\n }\n }\n }\n // add its weight\n totalPathLength += smallestRouterWeight;\n\n //This is where we start our first step\n current = getRouter(smallestRouterID);\n hops.add(current.getID());\n current.visit();\n //System.out.println(\"First step--> Router:\" + smallestRouterID + \" Weight to router from root:\" + smallestRouterWeight);\n //Now we loop\n Router firstRouter = current;\n boolean done = false;\n while (done == false){\n //Break case 1, we found the router\n if (current.getID() == destination.getID()){\n // check if root has available connections\n\n // set current to root and store totalPathLength to new variable && store hops in new array ArrayList\n // compare totals and store the one that's lower ++ hops list too\n // could we recursively call djekstra?\n done = true;\n // System.out.println(\"Router found\");\n break;\n }\n\n //Break case 2, all of the connections have been visited already\n boolean destinationAvailable = hasAvailableConnections(current);\n if (destinationAvailable == false){\n if(hasAvailableConnections(root)){\n current = root;\n hops.clear();\n totalPathLength= 0;\n } else {\n done = true;\n // System.out.println(\"v-- No more routers available\");\n break;\n }\n }\n\n //set all to 9999 to assume we cant see\n for (int a = 0; a < currentNeighborConnectionWeight.length; a++){\n currentNeighborConnectionWeight[a] = 9999;\n }\n\n //Recalculate for new path lengths\n for (Connection c : current.getConnections()){\n //Only calculate path for routers that havent been visited\n if (c.getDestination().getVisit() == false){\n currentNeighborConnectionWeight[c.getDestination().getID()-1] = c.getWeight();\n }\n }\n\n //Find the next step to take\n //Find the shortest available path link to start with\n smallestRouterID = 0;\n smallestRouterWeight = 9999;\n for (int b = 0; b < currentNeighborConnectionWeight.length; b++){\n if ((currentNeighborConnectionWeight[b] < smallestRouterWeight)){\n // id is pos+1\n smallestRouterID = b + 1;\n smallestRouterWeight = currentNeighborConnectionWeight[b];\n }\n }\n\n // add its weight\n totalPathLength += smallestRouterWeight;\n current = getRouter(smallestRouterID);\n hops.add(current.getID());\n current.visit();\n // System.out.println(\"Next shortest path--> Router: \" + current.getID() + \" Length from root:\" + totalPathLength);\n\n\n } // <--------------------------------------------------------------------------------End of while loop\n\n // returns <lasthop, pathcost>\n int[] result = new int[2];\n //Check and see if the path length is smaller then the original\n if (totalPathLength <= shortestPath[destination.getID()-1]){\n //System.out.println(\"Case new \" + firstRouter.getID());\n shortestPath[destination.getID()-1] = totalPathLength;\n result[0] = firstRouter.getID();\n result[1] = shortestPath[destination.getID()-1];\n } else {\n //root was shorter\n //System.out.println(\"Case old \" + root.getID());\n result[0] = root.getID();\n result[1] = shortestPath[destination.getID()-1];\n }\n // System.out.println(\"Next hop:\" + current.getID() + \" Total Distance:\" + shortestPath[destination.getID()-1]);\n\n //reset the visited list\n for (Router r: routers){\n r.unvisit();\n }\n return result;\n }", "public void findShortestPath(String startName, String endName) {\n checkValidEndpoint(startName);\n checkValidEndpoint(endName);\n\n Vertex<String> start = vertices.get(startName);\n Vertex<String> end = vertices.get(endName);\n\n double totalDist; // totalDist must be update below\n\n Map<Vertex<String>, Double> distance = new HashMap<>();\n Map<Vertex<String>, Vertex<String>> previous = new HashMap<>();\n Set<Vertex<String>> explored = new HashSet<>();\n PriorityQueue<VertexDistancePair> pq = new PriorityQueue<>();\n\n\n\n addPQ(distance, start, pq, previous);\n\n\n\n dijkstraHelper(pq, end, explored, distance, previous);\n\n\n\n\n\n\n totalDist = distance.get(end);\n List<Edge<String>> path = getPath(end, start);\n printPath(path, totalDist);\n }", "private Path findShortestPath(Address start, Address destination) throws Exception{\n HashMap<Intersection, Segment> pi = dijkstra(start);\n Segment seg = pi.get(destination);\n if(seg == null){\n throw new Exception();\n }\n LinkedList<Segment> newPathComposition = new LinkedList<>();\n Path newPath = new Path(start, destination, newPathComposition);\n newPathComposition.add(seg);\n while (!seg.getOrigin().equals(start)) {\n Intersection s = seg.getOrigin();\n seg = pi.get(s);\n if(seg == null){\n throw new Exception();\n }\n newPathComposition.add(seg);\n }\n Collections.reverse(newPathComposition);\n newPath.setSegmentsOfPath(newPathComposition);\n return newPath;\n }", "public void shortestPaths(int source) {\n\n\t\tlong start = 0;\n\t\tlong stop;\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tedgeList[v] = new Edge(vertexList[v].id, rand, 5000);\n\t\t}\n\t\t// creating object of fibonacci\n\t\tFHeap pq = new FHeap();\n\t\t// creating a map for checking\n\t\tMap<Integer, FHeap.Node> check = new HashMap<Integer, FHeap.Node>();\n\t\t// storing the mst costs\n\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tcheck.put(vertexList[v].id,\n\t\t\t\t\tpq.enqueue(vertexList[v].id, Double.POSITIVE_INFINITY));\n\t\t}\n\t\tstart = System.currentTimeMillis();\n\t\t// allot cost 0 to initial node\n\t\tpq.decreaseKey(check.get(vertexList[source].id), 0.0);\n\n\t\twhile (!pq.isEmpty()) {\n\t\t\t// take the current node and get its minimum cost\n\t\t\tFHeap.Node current = pq.dequeueMin();\n\n\t\t\t// store the values in the table\n\t\t\tresult.put(current.getValue(), current.getCost());\n\n\t\t\t// update the costs\n\t\t\tfor (Neighbor nbr = vertexList[current.getValue()].adjList; nbr != null; nbr = nbr.next) {\n\n\t\t\t\t// edge is not added if shortest cost is known\n\t\t\t\tif (result.containsKey(vertexList[nbr.vertexNumber].id))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// update cost to shortest\n\t\t\t\tFHeap.Node finalCost = check\n\t\t\t\t\t\t.get(vertexList[nbr.vertexNumber].id);\n\t\t\t\tif (nbr.weight < finalCost.getCost())\n\t\t\t\t\tpq.decreaseKey(finalCost, nbr.weight);\n\t\t\t}\n\t\t}\n\t\tstop = System.currentTimeMillis();\n\t\t// computing the time\n\t\ttime = stop - start;\n\n\t\t// calculate the MST cost\n\t\tfor (int i = 0; i < vertexList.length; i++) {\n\t\t\tsumHeapCost = (int) (sumHeapCost + result.get(i));\n\t\t}\n\t\t// for printing in case of input from file in fibonacci mode\n\t\n\t\t// System.out.println(sumHeapCost);\n\t}", "private LinkedList<Node> aStarPath() throws PathNotFoundException {\n\n // Set of nodes already evaluated\n List<Node> closedSet = new ArrayList<Node>();\n\n // Set of nodes visited, but not evaluated\n List<Node> openSet = new ArrayList<Node>();\n openSet.add(start);\n\n\n // Map of node with shortest path leading to it\n Map<Node, Node> cameFrom = new HashMap<>();\n\n // Map of cost of navigating from start to node\n Map<Node, Double> costFromStart = new HashMap<>();\n costFromStart.put(start, 0.0);\n\n // Map of cost of navigating path from start to end through node\n Map<Node, Double> costThrough = new HashMap<>();\n costThrough.put(start, heuristic(start, end));\n\n while (!openSet.isEmpty()){\n\n Node current = lowestCostThrough(openSet, costThrough);\n\n if(current.equals(end)){\n return reconstructPath(cameFrom, current);\n }\n\n openSet.remove(current);\n closedSet.add(current);\n\n for(Node neighbor: current.getNodes()) {\n if (closedSet.contains(neighbor)) {\n continue;\n }\n\n double tentativeCost = costFromStart.get(current) + distanceBetween(current, neighbor);\n\n if (!openSet.contains(neighbor)) { // found new neighbor\n openSet.add(neighbor);\n } else if (tentativeCost >= costFromStart.get(neighbor)) { // not a better path\n continue;\n }\n\n cameFrom.put(neighbor, current);\n costFromStart.put(neighbor, tentativeCost);\n costThrough.put(neighbor, tentativeCost + heuristic(neighbor, end));\n\n }\n }\n // no path\n throw pathNotFound;\n }", "@Test public void testPublic14() {\n Graph<String> graph= TestGraphs.testGraph2();\n List<String> shortestPath= new ArrayList<String>();\n\n assertEquals(1, graph.Dijkstra(\"apple\", \"banana\", shortestPath));\n assertEquals(\"apple banana\", TestGraphs.listToString(shortestPath));\n\n assertEquals(2, graph.Dijkstra(\"apple\", \"cherry\", shortestPath));\n assertEquals(\"apple banana cherry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(3, graph.Dijkstra(\"apple\", \"date\", shortestPath));\n assertEquals(\"apple banana cherry date\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra(\"apple\", \"elderberry\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(5, graph.Dijkstra(\"apple\", \"fig\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(6, graph.Dijkstra(\"apple\", \"guava\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig guava\",\n TestGraphs.listToString(shortestPath));\n }", "@Override\n public Double calculateShortestPathFromSource(String from, String to) {\n Node source = graph.getNodeByName(from);\n Node destination = graph.getNodeByName(to);\n source.setDistance(0d);\n Set<Node> settledNodes = new HashSet<>();\n PriorityQueue<Node> unsettledNodes = new PriorityQueue<>(Comparator.comparing(Node::getDistance));\n unsettledNodes.add(source);\n while (unsettledNodes.size() != 0) {\n Node currentNode = unsettledNodes.poll();\n for (Map.Entry<Node, Double> adjacencyPair : currentNode.getAdjacentNodes().entrySet()) {\n Node adjacentNode = adjacencyPair.getKey();\n Double distance = adjacencyPair.getValue();\n if (!settledNodes.contains(adjacentNode)) {\n calculateMinimumDistance(adjacentNode, distance, currentNode);\n unsettledNodes.add(adjacentNode);\n }\n }\n settledNodes.add(currentNode);\n }\n return destination.getDistance() == Double.MAX_VALUE ? -9999d : destination.getDistance();\n }", "public int bellman(Edge[] graph, int start, int end, int n) {\n int[] dist = new int[n+1];\n fill(dist, inf);\n dist[start] = 0;\n\n for(int i=1; i<=n; i++) {\n for(Edge e: graph) {\n dist[e.to] = min(dist[e.from] + e.weight, dist[e.to]);\n }\n }\n\n if(hasNegCycle(graph, dist, end)) {\n return -1;\n } else if(dist[end] == inf){\n return -2;\n } else {\n return dist[end];\n }\n }", "private List<routerNode> getPathVertexList(routerNode beginNode, routerNode endNode) {\r\n\t\tTransformer<routerLink, Integer> wtTransformer; // transformer for getting edge weight\r\n\t\twtTransformer = new Transformer<routerLink, Integer>() {\r\n public Integer transform(routerLink link) {\r\n return link.getWeight();\r\n \t}\r\n };\t\t\r\n\r\n\t\t\r\n\t\tList<routerNode> vlist;\r\n\t\tDijkstraShortestPath<routerNode, routerLink> DSPath = \r\n\t \t new DijkstraShortestPath<routerNode, routerLink>(gGraph, wtTransformer);\r\n \t// get the shortest path in the form of edge list \r\n List<routerLink> elist = DSPath.getPath(beginNode, endNode);\r\n\t\t\r\n \t\t// get the node list form the shortest path\r\n\t Iterator<routerLink> ebIter = elist.iterator();\r\n\t vlist = new ArrayList<routerNode>(elist.size() + 1);\r\n \tvlist.add(0, beginNode);\r\n\t for(int i=0; i<elist.size(); i++){\r\n\t\t routerLink aLink = ebIter.next();\r\n\t \t \t// get the nodes corresponding to the edge\r\n \t\tPair<routerNode> endpoints = gGraph.getEndpoints(aLink);\r\n\t routerNode V1 = endpoints.getFirst();\r\n\t routerNode V2 = endpoints.getSecond();\r\n\t \tif(vlist.get(i) == V1)\r\n\t \t vlist.add(i+1, V2);\r\n\t else\r\n\t \tvlist.add(i+1, V1);\r\n\t }\r\n\t return vlist;\r\n\t}", "@Override\r\n public List<T> breadthFirstPath(T start, T end) {\r\n\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n LinkedList<Vertex<T>> vertexList = new LinkedList<>();\r\n //Set<Vertex<T>> visited = new HashSet<>();\r\n ArrayList<Vertex<T>> visited = new ArrayList<>();\r\n\r\n LinkedList<Vertex<T>> pred = new LinkedList<>();\r\n int currIndex = 0;\r\n\r\n pred.add(null);\r\n\r\n vertexList.add(startV);\r\n visited.add(startV);\r\n\r\n LinkedList<T> path = new LinkedList<>();\r\n\r\n if (breadthFirstSearch(start, end) == false) {\r\n path = new LinkedList<>();\r\n return path;\r\n } else {\r\n while (vertexList.size() > 0) {\r\n Vertex<T> next = vertexList.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if (next == endV) {\r\n path.add(endV.getValue());\r\n break;\r\n }\r\n for (Vertex<T> neighbor : next.getNeighbors()) {\r\n if (!visited.contains(neighbor)) {\r\n pred.add(next);\r\n visited.add(neighbor);\r\n vertexList.add(neighbor);\r\n }\r\n }\r\n currIndex++;\r\n //path.add(next.getValue());\r\n\r\n }\r\n while (currIndex != 0) {\r\n Vertex<T> parent = pred.get(currIndex);\r\n path.add(parent.getValue());\r\n currIndex = visited.indexOf(parent);\r\n }\r\n }\r\n Collections.reverse(path);\r\n return path;\r\n }", "private static void simpleDijikstra(final DirectedGraph directedGraph,\n final Map<String, Integer> currentShortestPaths,\n final String start, final Set<String> visitedSet, final String destination) {\n // Terminate when we have visited all the nodes or if our start value isn't in our dijikstra table\n if (containsAndNotNull(currentShortestPaths, start) && visitedSet.size() != currentShortestPaths.keySet().size()) {\n compareDistanceAndReplace(directedGraph, currentShortestPaths, start);\n visitedSet.add(start);\n // Calculate the next current smallest node that hasn't been visited and not infinity\n final Optional<Map.Entry<String, Integer>> optionalSmallest =\n currentShortestPaths.entrySet().stream()\n .filter(node -> !visitedSet.contains(node.getKey()) && node.getValue() != null)\n .min(Comparator.comparingInt(Map.Entry::getValue));\n // Continue to next node if there is one available\n optionalSmallest.ifPresent(smallest -> {\n // No need to continue if the next smallest node is our destination\n if (!smallest.getKey().equals(destination)) {\n simpleDijikstra(directedGraph, currentShortestPaths, smallest.getKey(), visitedSet, destination);\n }\n });\n }\n }", "public Dijkstra(Graph graph, int firstVertexPortNum)\n {\n this.graph = graph;\n Set<String> vertexKeys = this.graph.vertexKeys();\n \n this.initialVertexPortNum = firstVertexPortNum;\n this.predecessors = new HashMap<String, String>();\n this.distances = new HashMap<String, Integer>();\n this.availableVertices = new PriorityQueue<Vertex>(vertexKeys.size(), new Comparator<Vertex>()\n {\n // compare weights of these two vertices.\n public int compare(Vertex v1, Vertex v2)\n {\n \t// errors are here.\n int weightOne = Dijkstra.this.distances.get(v1.convertToString(v1.getVertexPortNum())); // distances stored by portnum in string form.\n int weightTwo = Dijkstra.this.distances.get(v2.convertToString(v2.getVertexPortNum())); // distances stored by portnum in string form.\n return weightOne - weightTwo; // return the modified weight of the two vertices.\n }\n });\n \n this.visitedVertices = new HashSet<Vertex>();\n \n // for each Vertex in the graph\n for(String key: vertexKeys)\n {\n this.predecessors.put(key, null);\n this.distances.put(key, Integer.MAX_VALUE); // assuming that the distance of this is infinity.\n }\n \n \n //the distance from the initial vertex to itself is 0\n this.distances.put(convertToString(initialVertexPortNum), 0); \n \n //and seed initialVertex's neighbors\n Vertex initialVertex = this.graph.getVertex(convertToString(initialVertexPortNum)); // converted portnum to String to make this work.\n ArrayList<Edge> initialVertexNeighbors = initialVertex.getSquad();\n for(Edge e : initialVertexNeighbors)\n {\n Vertex other = e.getNeighbor(initialVertex);\n this.predecessors.put(convertToString(other.getVertexPortNum()), convertToString(initialVertexPortNum));\n this.distances.put(convertToString(other.getVertexPortNum()), e.getWeight()); // converted portnum to String to make this work.\n this.availableVertices.add(other); // add to available vertices.\n }\n \n this.visitedVertices.add(initialVertex); // add to list of visited vertices.\n \n // apply Dijkstra's algorithm to the overlay.\n processOverlay();\n \n }", "public static void breadthFirstSearch(ArrayList<Node> graph) {\n\t\tSystem.out.println(\"BFS:\");\n\t\tif(graph.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tGraphUtils.cleanGraph(graph);\n\n\t\tQueue<Node> queue = new LinkedList<Node>();\n\t\tfor(Node node : graph) {\n\t\t\tif(node.state != Node.State.UNDISCOVERED) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnode.state = Node.State.DISCOVERED;\n\t\t\tqueue.add(node);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()) {\n\t\t\t\tnode = queue.remove();\n\t\t\t\t\n\t\t\t\t//process node\n\t\t\t\tSystem.out.print(node.name + \" -> \");\n\t\t\t\t\n\t\t\t\tfor(Edge e : node.edges) {\n\t\t\t\t\t//process edge\n\t\t\t\t\tNode neighbor = e.getNeighbor(node);\n\t\t\t\t\t\n\t\t\t\t\t//first time we see this node it gets added to the queue for later processing\n\t\t\t\t\tif(neighbor.state == Node.State.UNDISCOVERED) {\n\t\t\t\t\t\tneighbor.state = Node.State.DISCOVERED;\n\t\t\t\t\t\tqueue.add(neighbor);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//finished with this node\n\t\t\t\tnode.state = Node.State.COMPLETE;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println();\n\t\tGraphUtils.cleanGraph(graph);\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n public List<Edge<T>> viterbiPath() {\n final int numNodes = nodeList.size();\n double[] d_v = new double[numNodes];\n Arrays.fill(d_v, annihilator());\n d_v[ROOT_ID] = identity();\n Edge[] p_v = new Edge[numNodes]; \n \n // Forward pass\n for (int v = ROOT_ID+1; v < numNodes; ++v) {\n List<Edge<T>> edgeList = nodeList.get(v).backwardStar();\n for (Edge<T> edge : edgeList) {\n int u = edge.start().id();\n double bestCost = d_v[v];\n double transitionCost = score(d_v[u], edge.weight());\n if (compare(bestCost, transitionCost) == transitionCost) {\n // Do an update to the best cost\n d_v[v] = transitionCost;\n p_v[v] = edge;\n }\n }\n }\n \n // Backout the solution\n List<Edge<T>> bestPath = new LinkedList<Edge<T>>();\n Edge<T> bestEdge = p_v[numNodes-1];\n bestEdge = p_v[bestEdge.start().id()]; // Skip the goal node\n while(bestEdge.start().id() != ROOT_ID) {\n bestPath.add(0, bestEdge); // O(c) pre-pend\n bestEdge = p_v[bestEdge.start().id()];\n }\n\n return bestPath;\n }", "@Override\n public List<node_info> shortestPath(int src, int dest) {\n int counter=0;//counter for index of listPath\n List<node_info> listPath=new ArrayList<node_info>();//The reverse list that is returned\n List<node_info> listResult=new ArrayList<node_info>();//the returned list\n if(!DijkstraHelp(src,dest)) return null;//if there is no path from src to dest\n if(src==dest) {\n listPath.add(this.ga.getNode(src));\n return listPath;\n }\n //the other case:\n node_info d=this.ga.getNode(dest);\n listPath.add(counter,d);//insert the dest in order to go from destination to source\n //counter++;\n weighted_graph gCopy=copy();\n Iterator<node_info> it=gCopy.getV().iterator();//run on the whole graph\n while(it.hasNext()){\n if(listPath.get(counter).getKey()==src) break;//if we finished\n if(gCopy.getV(listPath.get(counter).getKey()).contains(it.next())) {//remove the nodes that we were already checked if\n //they need to be insert to listPath\n continue;\n }\n Iterator<node_info> currentIt=gCopy.getV(listPath.get(counter).getKey()).iterator();//iterator on the ni-list of the\n //last node were insert to the listPath\n if(currentIt!=null) {\n node_info min=null;\n while (currentIt.hasNext()){\n node_info currentLoop=currentIt.next();\n if(currentLoop.getTag()+gCopy.getEdge(listPath.get(counter).getKey(),currentLoop.getKey())==\n listPath.get(counter).getTag()){//check if this is the node that appropriate to the shortest path\n min=currentLoop;\n }\n }\n listPath.add(min);//insert to listPath\n counter++;\n }\n }\n for(int i=listPath.size()-1;i>=0;i--){\n listResult.add(listPath.size()-i-1,listPath.get(i));//reverse the list\n }\n return listResult;\n }", "public int shortestPathLength(int[][] graph) {\n Queue<MyPath> q = new LinkedList<>();\n Set<String> visited = new HashSet<>();\n\n for (int i = 0; i < graph.length; i++) {\n MyPath path = new MyPath(i, (1 << i));\n visited.add(path.convertToString());\n q.offer(path);\n }\n\n int length = 0;\n while (!q.isEmpty()) {\n int size = q.size();\n while (size-- > 0) {\n MyPath next = q.poll();\n int curr = next.curr;\n int currPath = next.nodes;\n // Assume we have two nodes -> n = 2\n // 1 << 2 -> 100\n // 100 - 1 -> 011 which means both nodes are visited\n if (currPath == (1 << graph.length) - 1) {\n return length;\n }\n for (int neighbors : graph[curr]) {\n MyPath newPath = new MyPath(neighbors, currPath | (1 << neighbors));\n String pathString = newPath.convertToString();\n if (visited.add(pathString)) {\n q.offer(newPath);\n }\n }\n }\n length++;\n }\n\n return -1;\n }", "public List<Node> findShortestPath(Node s, Node t);", "public static List<CampusGraph.Edges<String, String>> findPath(CampusGraph<String, String> cg, String start, String destination) {\n if (cg == null || start == null || destination == null) {\n throw new IllegalArgumentException();\n }\n Queue<String> visitedNodes = new LinkedList<>();\n Map<String, List<CampusGraph.Edges<String, String>>> paths = new HashMap<>();\n visitedNodes.add(start); // Add start to Q\n paths.put(start, new LinkedList<>()); // Add start->[] to M (start mapped to an empty list)\n\n while (!visitedNodes.isEmpty()) {\n String currentNode = visitedNodes.remove();\n if (currentNode.equals(destination)) { // found the path\n return paths.get(currentNode);\n } else {\n List<CampusGraph.Edges<String, String>> neighbors = cg.getAllChildren(currentNode);\n neighbors.sort(new Comparator<CampusGraph.Edges<String, String>>() {\n @Override\n public int compare(CampusGraph.Edges<String, String> o1, CampusGraph.Edges<String, String> o2) {\n int cmpEndNode = o1.getEndTag().compareTo(o2.getEndTag());\n if (cmpEndNode == 0) {\n return o1.getEdgeLabel().compareTo(o2.getEdgeLabel());\n }\n return cmpEndNode;\n }\n }); // ascending list. Sort characters and books names all at once??\n\n for (CampusGraph.Edges<String, String> e: neighbors) {\n String neighbor = e.getEndTag();\n if (!paths.containsKey(neighbor)) { // i.e. if the neighbor is unvisited\n List<CampusGraph.Edges<String, String>> pathCopy = new LinkedList<>(paths.get(currentNode));\n pathCopy.add(e);\n paths.put(neighbor, pathCopy); // add the path exclusive to this neighbor\n visitedNodes.add(neighbor); // then, mark the neighbor as visited\n }\n }\n }\n }\n return null; // No destination found\n }", "public List<Node> computeDijkstraShortestPath(Node source, Node destination) {\n\n source.minDistance = 0.;\n PriorityQueue<Node> nodeQueue = new PriorityQueue<Node>();\n nodeQueue.add(source);\n\n int destinationGroup = destination._groupID;\n\n while (!nodeQueue.isEmpty()) {\n Node v = nodeQueue.poll();\n\n Log.i(\"bbb\", \"In dijsk node name \"+ v._waypointName);\n //Stop searching when reach the destination node\n\n\n if(destinationGroup!=0){\n\n if(v._groupID==destinationGroup){\n destination = navigationGraph.get(navigationGraph.size()-1).nodesInSubgraph.get(v._waypointID);\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n break;\n }\n\n }\n\n if (v._waypointID.equals(destination._waypointID))\n break;\n\n\n // Visit each edge that is adjacent to v\n for (Edge e : v._edges) {\n Node a = e.target;\n Log.i(\"bbb\", \"node a \"+a._waypointName);\n double weight = e.weight;\n double distanceThroughU = v.minDistance + weight;\n if (distanceThroughU < a.minDistance) {\n nodeQueue.remove(a);\n a.minDistance = distanceThroughU;\n a.previous = v;\n Log.i(\"bbb\", \"set previous\");\n nodeQueue.add(a);\n }\n }\n }\n\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n return getShortestPathToDestination(destination);\n }", "List<V> getShortestPath(V vertex);", "private int bfs(int startNode, Map<Integer, List<Integer>> adjacencyList, int[] distanceToNode) {\n int furthestNode = 1;\n int furthestDistance = Integer.MIN_VALUE;\n\n Queue<Integer> queue = new LinkedList<>();\n Arrays.fill(distanceToNode, -1);\n\n // Put start node in queue\n queue.add(startNode);\n // Set distance of the first node to 0 (0 edge to itself)\n distanceToNode[startNode - 1] = 0;\n\n // While queue is not empty\n while (!queue.isEmpty()) {\n // Pop node\n int curNode = queue.remove();\n\n // Iterate through node's neighbours\n for (int neighbour : adjacencyList.get(curNode)) {\n // If neighbour is not visited (distance not -1)\n if (distanceToNode[neighbour - 1] == -1) {\n // Calculate distance by taking curNode distance and add 1\n // Update distance in array as a way of marking it as visited\n distanceToNode[neighbour - 1] = distanceToNode[curNode - 1] + 1;\n\n // Add to queue to process next\n queue.add(neighbour);\n\n // If the distance is bigger than current furthest one, update\n if (distanceToNode[neighbour - 1] > furthestDistance)\n furthestNode = neighbour;\n }\n }\n }\n return furthestNode;\n }", "public int[] shortestPath(int destination) throws BellmanFordException{\n \n Stack<Integer> tempStack = new Stack<Integer>(); // We create a temporary stack to store the path that we would want to return backwardly. ie: pushing the destination (our last node) into the stack first.\n int[] shortestPath; // array to return \n tempStack.push(destination);\n \n int currentNode = destination;\n\n while (predecessors[currentNode] != -1) \n {\n\t\t\tcurrentNode = predecessors[currentNode]; // Get the predecessor of each node from the predecessor array\n\t\t\ttempStack.push(currentNode); // Push our result into our temp stack.\n\t\t}\n\n if (tempStack.peek() == destination) // Check if the top of our stack is our input destination, if so, that means there isn't a path exists between our source and destination.\n {\n\t\t\tthrow (new PathDoesNotExistException (\"Error: there isn't a path exists between the node: \" + this.source + \" and the node: \" + destination + \".\"));\n\t\t}\n \n shortestPath = new int[tempStack.size()]; // Our return array will have the same size as our tempStack.\n int i = 0;\n while (tempStack.isEmpty() == false) \n {\n\t\t\tcurrentNode = tempStack.pop(); // Popping nodes from our temp stack \n\t\t\tshortestPath[i] = currentNode; // and store them into our return array. By doing this, we will have the correct order of nodes that forms a path between our source and destination.\n\t\t\ti++;\n\t\t}\n\t\treturn shortestPath;\n }", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + 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\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\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/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int i = 0; i < V; i++) {\n dist[i] = Integer.MAX_VALUE;\n sptSet[i] = false;\n }\n\n dist[src] = 0;\n\n // Find shortest path for all vertices\n for (int count = 0; count < V-1; count++) {\n\n int u = minDistance(dist, sptSet);\n\n // Mark the picked vertex as processed\n sptSet[u] = true;\n\n // Update dist value of the adjacent vertices of the\n // picked vertex.\n for (int v = 0; v < V; v++)\n\n\n if (!sptSet[v] && graph[u][v]!=0 &&\n dist[u] != Integer.MAX_VALUE &&\n dist[u]+graph[u][v] < dist[v])\n dist[v] = dist[u] + graph[u][v];\n }\n\n printSolution(dist, V);\n }", "@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }", "@Override\n public List<node_data> shortestPath(int src, int dest) {\n reset();\n for (node_data node : G.getV()) {\n node.setWeight(Double.POSITIVE_INFINITY);\n }\n\n DWGraph_DS.Node currentNode = (DWGraph_DS.Node) G.getNode(src);\n currentNode.setWeight(0);\n PriorityQueue<node_data> unvisitedNodes = new PriorityQueue(G.nodeSize(), weightComperator);\n unvisitedNodes.addAll(G.getV());\n HashMap<Integer, node_data> parent = new HashMap<>();\n parent.put(src, null);\n\n while (currentNode.getWeight() != Double.POSITIVE_INFINITY) {\n if (G.getNode(dest).getTag() == 1) {\n break;\n }\n for (edge_data edge : G.getE(currentNode.getKey())) {\n DWGraph_DS.Node neighbor = (DWGraph_DS.Node) G.getNode(edge.getDest());\n double tmpWeight = currentNode.getWeight() + edge.getWeight();\n if (tmpWeight < neighbor.getWeight()) {\n neighbor.setWeight(tmpWeight);\n unvisitedNodes.remove(neighbor);\n unvisitedNodes.add(neighbor);\n parent.put(neighbor.getKey(), currentNode);\n }\n }\n currentNode.setTag(1);\n if(currentNode.getKey()==dest) break;\n unvisitedNodes.remove(currentNode);\n currentNode = (DWGraph_DS.Node) unvisitedNodes.poll();\n }\n /*\n Rebuild the path list\n */\n if (!parent.keySet().contains(dest)) return null;\n List<node_data> pathList = new ArrayList<>();\n currentNode = (DWGraph_DS.Node) G.getNode(dest);\n while (parent.get(currentNode.getKey()) != null) {\n pathList.add(currentNode);\n currentNode = (DWGraph_DS.Node) parent.get(currentNode.getKey());\n }\n Collections.reverse(pathList);\n return pathList;\n }", "public List<Vertex> shortestPath(Vertex start, Vertex end) {\r\n\t\tMap<Vertex, Vertex> backRefs = new HashMap<Vertex, Vertex>();\r\n\r\n\t\t// Create a queue for BFS\r\n\t\tQueue<Vertex> queue = new LinkedList<Vertex>();\r\n\r\n\t\t// Mark the current node as visited and enqueue it. Use backRef as\r\n\t\t// visited set\r\n\t\tqueue.offer(start);\r\n\t\tbackRefs.put(start, null);\r\n\r\n\t\tVertex currentNode;\r\n\t\tSet<Vertex> neighbors;\r\n\r\n\t\twhile (queue.size() != 0) { // or !queue.isEmpty()\r\n\t\t\t// Dequeue a vertex from queue and print it\r\n\t\t\tcurrentNode = queue.poll();\r\n\r\n\t\t\tif (currentNode.equals(end)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Get all adjacent vertices of the dequeued vertex s\r\n\t\t\t// If a adjacent has not been visited, then mark it\r\n\t\t\t// visited and enqueue it\r\n\t\t\tneighbors = currentNode.getNeighbors();\r\n\r\n\t\t\tfor (Vertex n : neighbors) {\r\n\t\t\t\tif (!backRefs.containsKey(n)) {\r\n\t\t\t\t\tqueue.offer(n);\r\n\t\t\t\t\tbackRefs.put(n, currentNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!backRefs.containsKey(end))\r\n\t\t\treturn null;\r\n\r\n\t\tList<Vertex> path = new ArrayList<Vertex>();\r\n\t\tcurrentNode = end;\r\n\r\n\t\twhile (currentNode != null) {\r\n\t\t\tpath.add(currentNode);\r\n\t\t\tcurrentNode = backRefs.get(currentNode);\r\n\t\t}\r\n\r\n\t\tCollections.reverse(path);\r\n\r\n\t\treturn path;\r\n\t}", "@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tfor(node_data vertex : dwg.getV()) {\n\t\t\tvertex.setInfo(\"\"+Double.MAX_VALUE);\n\t\t}\n\t\tint[] prev = new int[dwg.nodeSize()];\n\t\tnode_data start = dwg.getNode(src);\n\t\tstart.setInfo(\"0.0\");\n\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\tq.add(start);\n\t\tprev[src%dwg.nodeSize()] = -1;\n\t\twhile(!q.isEmpty()) {\n\t\t\tnode_data v = q.poll();\n\t\t\tCollection<edge_data> edgesV = dwg.getE(v.getKey());\n\t\t\tfor(edge_data edgeV : edgesV) {\n\t\t\t\tdouble newSumPath = Double.parseDouble(v.getInfo()) +edgeV.getWeight();\n\t\t\t\tint keyU = edgeV.getDest();\n\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\tif(newSumPath < Double.parseDouble(u.getInfo())) {\n\t\t\t\t\tu.setInfo(\"\"+newSumPath);\n\t\t\t\t\tq.remove(u);\n\t\t\t\t\tq.add(u);\n\t\t\t\t\tprev[u.getKey()%dwg.nodeSize()] = v.getKey();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tList<node_data> ans = new ArrayList<node_data>();\n\t\tint run = dest;\n\t\twhile(run != src) {\n\t\t\tans.add(0,dwg.getNode(run));\n\t\t\trun = prev[run%dwg.nodeSize()];\n\t\t}\n\t\tans.add(0, dwg.getNode(src));\n\n\t\treturn ans;\n\t}", "@Override\n public List<Node> findShortestPath(Node s, Node t)\n {\n nodeDists.clear(); //clear previously calculated distances\n\n recordNodeDistances(s, t); //record node distances to target\n\n LinkedList<Node> shortestPath = new LinkedList<Node>();\n\n shortestPath.addLast(s);\n\n boolean reachedEnd = false;\n\n if(s==t) reachedEnd = true; // \"That was easy\"\n\n while(!reachedEnd)\n {\n //get the neighbors from the most recent step on the path\n Collection<? extends Node> neighbors = shortestPath.getLast().getNeighbors();\n\n //minimum cost from neighbors\n Node minNode = null;\n\n for(Node n: neighbors)\n {\n if(minNode == null || nodeDists.get(n) < nodeDists.get(minNode))\n {\n minNode = n;\n\n if(nodeDists.get(n) == 0)\n {\n reachedEnd = true;\n break;\n }\n }\n }\n\n if(nodeDists.get(minNode) == Integer.MAX_VALUE) return null; //no path\n else shortestPath.addLast(minNode);\n }\n\n return shortestPath;\n }", "private static void computePaths(Vertex source) {\n source.minDistance = 0;\n // retrieves with log(n) time\n PriorityQueue<Vertex> vertexPriorityQueue = new PriorityQueue<>();\n\n //BFS traversal\n vertexPriorityQueue.add(source);\n\n // O((v + e) * log(v))\n while (!vertexPriorityQueue.isEmpty()) {\n // this poll always returns the shortest distance vertex at log(v) time\n Vertex vertex = vertexPriorityQueue.poll();\n\n //visit each edge exiting vertex (adjacencies)\n for (Edge edgeInVertex : vertex.adjacencies) {\n // calculate new distance between edgeInVertex and target\n Vertex targetVertex = edgeInVertex.target;\n double edgeWeightForThisVertex = edgeInVertex.weight;\n double distanceThruVertex = vertex.minDistance + edgeWeightForThisVertex;\n if (distanceThruVertex < targetVertex.minDistance) {\n // modify the targetVertex with new calculated minDistance and previous vertex\n // by removing the old vertex and add new vertex with updates\n vertexPriorityQueue.remove(targetVertex);\n targetVertex.minDistance = distanceThruVertex;\n // update previous with the shortest distance vertex\n targetVertex.previous = vertex;\n vertexPriorityQueue.add(targetVertex);// adding takes log(v) time because needs to heapify\n }\n }\n }\n }", "public static void main(String[] args) {\n\n BDNode a = new BDNode(\"A\");\n BDNode b = new BDNode(\"B\");\n BDNode c = new BDNode(\"C\");\n BDNode d = new BDNode(\"D\");\n BDNode e = new BDNode(\"E\");\n\n a.link(b);\n a.link(d);\n b.link(a);\n b.link(c);\n b.link(e);\n c.link(b);\n c.link(d);\n d.link(a);\n d.link(c);\n d.link(e);\n e.link(b);\n e.link(d);\n\n BDNode target = e;\n\n/*\n // BFS\n Queue<BDNode> queue = new LinkedList<>();\n queue.offer(a);\n\n while(!queue.isEmpty()) {\n BDNode n = queue.poll();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if(n.equals(target)) {\n System.out.println(\"BFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if(l.isVisited()) continue;\n if (queue.contains(l)) continue;\n queue.offer(l);\n }\n\n // 위랑 같은 표현\n// n.links.stream()\n// .filter(l -> !queue.contains(l))\n// .forEach(queue::offer);\n }\n*/\n\n // DFS\n Stack<BDNode> stack = new Stack<>();\n stack.push(a);\n\n while(!stack.isEmpty()) {\n BDNode n = stack.pop();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if (n.equals(target)) {\n System.out.println(\"DFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if (l.isVisited()) continue;\n if (stack.contains(l)) continue;\n\n stack.push(l);\n }\n }\n\n\n }", "public static Graph dijkstra(Graph graph, Node source) {\n source.distance = 0;\n Set<Node> settledNodes = new HashSet<>();\n Set<Node> unsettledNodes = new HashSet<>();\n unsettledNodes.add(source);\n \n while (unsettledNodes.size() != 0) {\n Node currentNode = Graph.getLowestDistanceNode(unsettledNodes);\n unsettledNodes.remove(currentNode);\n for (Map.Entry<Node, Integer> adjacencyPair: \n currentNode.adjacentNodes.entrySet()) {\n Node adjacentNode = adjacencyPair.getKey();\n Integer edgeWeight = adjacencyPair.getValue();\n if (!settledNodes.contains(adjacentNode)) {\n Graph.calculateMinimumDistance(adjacentNode, edgeWeight, currentNode);\n unsettledNodes.add(adjacentNode);\n }\n }\n settledNodes.add(currentNode);\n }\n return graph;\n }", "static void FindPath(vertex s, vertex[] array){\r\n\t\tvertex v; \r\n\t\tint min = Integer.MAX_VALUE;\r\n\t\t//node wN; vertex wV; //wN= adjacent node in LinkedList; wV= find the values in the vertices for wL\r\n\t\tint j =0;\r\n\t\ts.known = true;\r\n\t\ts.dist = 0;\r\n\t\tShortestPath(s, array);\r\n\t\r\n\t\twhile(j<array.length-1 ){ //&& array[j].known== false){\r\n\t\t\tint count = 0; \r\n\t\t\tmin = Integer.MAX_VALUE;\r\n\t\t\tfor(int i = 0; i<array.length; i++){\r\n\t\t\t\tif(array[i].known== false && array[i].dist < min){\r\n\t\t\t\t\tmin = array[i].dist;\r\n\t\t\t\t\tcount = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tv = array[count];\r\n //System.out.println(\"count: \" + count + \"Next v: \" + v.name);\r\n\t\t\tShortestPath(v, array);\r\n\t\t\tj++; \t\t\r\n }\r\n\t}", "private void breadthFirstSearch(Node sourceNode, Node destinationNode, String path, HashSet<Character> visited) {\n // Create a list of nodes to visit (children of nodes)\n LinkedList<Node> nextToVisit = new LinkedList<>();\n // Add the first node to the list\n nextToVisit.add(sourceNode);\n\n // Traverse level by level by traversing to all of its children first\n while(!nextToVisit.isEmpty()) {\n Node node = nextToVisit.remove();\n // If its visited already, continue to the next child\n if(visited.contains(node.charId)) {\n continue;\n }\n // Mark the node as visited\n path += \"->\" + node.charId;\n visited.add(node.charId);\n // If destination is reached\n if(node == destinationNode) {\n paths.add(path);\n return;\n }\n // Add all of its children to the next node to visit\n for(Node children : node.adjacent) {\n nextToVisit.add(children);\n }\n }\n\n }", "public void dijkstra(int graphWeight[][], int source){\r\n\t\t\r\n\t\tint queue[] = new int[vertices]; //The array which will hold the shortest distance from source to node i\r\n\t\tboolean set[] = new boolean[vertices]; //It will store true for node i if the shortest path to that vertex or node is found\r\n\t\t\r\n\t\t//Initialize distances to infinity and set[] array to false \r\n\t\tfor(int i=0;i<vertices;i++){\r\n\t\t\tqueue[i] = Integer.MAX_VALUE; \r\n\t\t\tset[i] = false;\r\n\t\t}\r\n\t\t\r\n\t\t//Distance of source vertex from itself is always 0\r\n\t\tqueue[source] = 0;\r\n\r\n\t\t//Find shortest path of all the vertices\r\n\t\tfor(int count=0;count<vertices-1;count++){\r\n\t\t\t\r\n\t\t\t//Pick the minimum distance vertex from the from the set of vertices \r\n\t\t\t//not processed. u is equal to source in first iteration\r\n\t\t\tint u = extractMinDistance(queue, set);\r\n\t\t\t\r\n\t\t\t//Mark the picked vertex processed\r\n\t\t\tset[u] = true;\r\n\t\t\t//Update queue value of the adjacent vertices of the picked vertex\r\n\t\t\tfor(int v=0;v<vertices;v++)\r\n\t\t\t{\r\n\t\t\t\t//Update queue[v] only if\r\n\t\t\t\t// 1. It is not in set true in the Set Array\r\n\t\t\t\t// 2. There is an edge from u to v\r\n\t\t\t\t// 3. Total weight of path from source to v through u is smaller than current value of queue[v]\r\n\t\t\t\tif((graphWeight[u][v] > 0) && set[v] == false){\r\n\t\t\t\t\t\tif(queue[u] + graphWeight[u][v] < queue[v]){\r\n\t\t\t\t\t\t\tqueue[v] = queue[u] + graphWeight[u][v];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//printSolution(queue, vertices);\r\n\t\t}\r\n\t\t//Print the constructed distance array\r\n\t\tprintSolution(queue, vertices);\r\n\t}", "public Stack<Point> shortestPath() {\n\t\tresetVisited();\n\t\tStack <Point> shortestPath = new Stack<Point>();\n\t\tprev = new HashMap<Point,Point>();\n\t\tCompass[] direction = Compass.values();\n\t\tQueue <Point> path = new LinkedList<Point>();\n\t\tpath.add(playerStart);\n\t\twhile(!path.isEmpty()) {\n\t\t\tPoint current = path.poll();\n\t\t\tfor (Compass pointing: direction) {\n\t\t\t\tif (current.equals(goal)) {\n\t\t\t\t\tshortestPath.push(current);\n\t\t\t\t\twhile (prev.containsKey(shortestPath.peek()) && !shortestPath.peek().equals(playerStart)){\n\t\t\t\t\t\tshortestPath.push(prev.get(shortestPath.peek()));\n\t\t\t\t\t}\n\t\t\t\t\treturn shortestPath;\n\t\t\t\t}\n\t\t\t\tint nextW = (int)current.getX() + pointing.mapX;\n\t\t\t\tint nextH = (int)current.getY() + pointing.mapY;\n\t\t\t\tPoint nextPoint = new Point(nextW, nextH);\n\t\t\t\tif (arrayBounds(nextW, width) && arrayBounds (nextH, height) && maze[nextW][nextH] == 0 && !visited.contains(nextPoint)) {\n\t\t\t\t\tpath.add(nextPoint);\n\t\t\t\t\tvisited.add(nextPoint);\n\t\t\t\t\tprev.put(nextPoint, current);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn shortestPath;\t\t\n\t}", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "public String BFS(int g) {\n\t\t//TODO\n\t}", "public List<GeographicPoint> dijkstra(GeographicPoint start, \n\t\t\t\t\t\t\t\t\t\t GeographicPoint goal, Consumer<GeographicPoint> nodeSearched)\n\t{\n\t\t// TODO: Implement this method in WEEK 4\n\n\t\t// Hook for visualization. See writeup.\n\t\t//nodeSearched.accept(next.getLocation());\n\t\t\n\t\t//initialize distance of each MapNode from start to infinity\n\t\t\n\t\tSet<GeographicPoint> visited = new HashSet<GeographicPoint>();\n\t\tPriorityQueue<MapNode> queue = new PriorityQueue<MapNode>();\n\t\tHashMap<GeographicPoint, List<GeographicPoint>> path = new HashMap<GeographicPoint, List<GeographicPoint>>();\n\t\tint count = 0;\n\t\t\n\t\tif (!map.containsKey(start) || !map.containsKey(goal))\n\t\t\treturn null;\n\t\t\n\t\tfor (GeographicPoint temp : map.keySet())\n\t\t\tpath.put(temp, new ArrayList<GeographicPoint>());\n\t\t\n\t\tMapNode startNode = map.get(start);\n\t\tstartNode.setTimeToStart(0.0);\n\t\tstartNode.setDistanceToStart(0.0);\n\t\tqueue.add(startNode);\n\t\t\n\t\twhile (!queue.isEmpty()) {\n\t\t\tMapNode currNode = queue.poll();\n\t\t\tnodeSearched.accept(currNode.getLocation());\n\t\t\t\n\t\t\tif (!visited.contains(currNode.getLocation())) {\n\t\t\t\tvisited.add(currNode.getLocation());\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\tif (currNode.getLocation().equals(goal))\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tHashMap<MapEdge, GeographicPoint> neighbours = currNode.getNeighbours();\n\t\t\t\tfor (MapEdge edge : neighbours.keySet()) {\n\t\t\t\t\t\n\t\t\t\t\tif (!visited.contains(edge.getEnd())) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tMapNode addNode = map.get(neighbours.get(edge));\n\t\t\t\t\t\tdouble tempTime = currNode.getTimeToStart() + ((edge.getDistance())/(edge.getSpeedLimit()));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (tempTime < addNode.getTimeToStart()) {\n\t\t\t\t\t\t\taddNode.setTimeToStart(tempTime);\n\t\t\t\t\t\t\tqueue.add(addNode);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tList<GeographicPoint> temp = path.get(neighbours.get(edge));\n\t\t\t\t\t\t\ttemp.add(currNode.getLocation());\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(\"Dijkstra: \" + count);\n\t\treturn backTrack(path,goal);\n\t}", "public void floyd_warshall()\n{\n /*\n * We get the minimum tree again, but we allow cycles this time. This gives\n * us the complete tree, but with edges ranked by priority.\n */\n this.minimumTree = this._getKruskalTree(true);\n for (int loop = 0;\n loop < this.nVerts;\n loop++\n ) {\n this.bellman_ford(loop);\n }\n}", "private List<Pair<Integer, Integer>> getBestPath(Pair<Integer, Integer> curLocation, Pair<Integer, Integer> dest) {\n\t\tList<Pair<Integer, Integer>> path = new LinkedList<Pair<Integer, Integer>>();\n\t\t\n\t\t\n\t\tNode current = new Node(curLocation.getX(), curLocation.getY(), getHitProbability(curLocation.getX(), curLocation.getY()));\n\t\tNode target = new Node(dest.getX(), dest.getY(), getHitProbability(dest.getX(), dest.getY()));\n\t\tList<Node> openSet = new ArrayList<>();\n List<Node> closedSet = new ArrayList<>();\n \n \n while (true) {\n openSet.remove(current);\n List<Node> adjacent = getAdjacentNodes(current, closedSet, target);\n\n // Find the adjacent node with the lowest heuristic cost.\n for (Node neighbor : adjacent) {\n \tboolean inOpenset = false;\n \tList<Node> openSetCopy = new ArrayList<>(openSet);\n \tfor (Node node : openSetCopy) {\n \t\tif (neighbor.equals(node)) {\n \t\t\tinOpenset = true;\n \t\t\tif (neighbor.getAccumulatedCost() < node.getAccumulatedCost()) {\n \t\t\t\topenSet.remove(node);\n \t\t\t\topenSet.add(neighbor);\n \t\t\t}\n \t\t}\n \t}\n \t\n \tif (!inOpenset) {\n \t\topenSet.add(neighbor);\n \t}\n }\n\n // Exit search if done.\n if (openSet.isEmpty()) {\n System.out.printf(\"Target (%d, %d) is unreachable from position (%d, %d).\\n\",\n target.getX(), target.getY(), curLocation.getX(), curLocation.getY());\n return null;\n } else if (/*isAdjacent(current, target)*/ current.equals(target)) {\n break;\n }\n\n // This node has been explored now.\n closedSet.add(current);\n\n // Find the next open node with the lowest cost.\n Node next = openSet.get(0);\n for (Node node : openSet) {\n if (node.getCost(target) < next.getCost(target)) {\n next = node;\n }\n }\n// System.out.println(\"Moving to node: \" + current);\n current = next;\n }\n \n // Rebuild the path using the node parents\n path.add(new Pair<Integer, Integer>(curLocation.getX(), curLocation.getY()));\n while(current.getParent() != null) {\n \tcurrent = current.getParent();\n \tpath.add(0, new Pair<Integer, Integer>(current.getX(), current.getY()));\n }\n \n if (path.size() > 1) {\n \tpath.remove(0);\n }\n \n\t\treturn path;\n\t}", "public String breadthFirstSearch( AnyType start_vertex ) throws VertexException {\n \n StringBuffer buffer = new StringBuffer();\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n boolean exists = false;\n Vertex<AnyType> S = new Vertex<AnyType>(start_vertex);\n int counter = 1;\n //make new vertex to check if its in list\n //make queue to hold vertices\n SemiConstantTimeQueue<Vertex<AnyType>> queue = new SemiConstantTimeQueue<Vertex<AnyType>>();\n //loop through and set not visited\n for( int i = 0; i < vertex_adjacency_list.size(); i++){\n vertex_adjacency_list.get(i).setVisited(-1);\n //if it's in list then set exists to true\n //and set visited \n if(vertex_adjacency_list.get(i).compareTo(S) == 0){\n exists = true;\n vertex_adjacency_list.get(i).setVisited(counter);\n counter = i;\n }\n } \n //if doesn't exist then throw the exception\n if(exists == false){\n throw new VertexException(\"Start Vertex does not exist\");\n }\n //make new queue\n queue.add(vertex_adjacency_list.get(counter));\n vertex_adjacency_list.get(counter).setVisited(1);\n counter = 1;\n int k=0;\n Vertex<AnyType>e;\n //while the queue isn't empty\n while(queue.peek() !=null){\n //make e the top of the queue \n e = queue.peek(); \n //go through the list and if you reach the begining it exits loop\n for( k = 0; k < vertex_adjacency_list.size()-1; k++){\n if(vertex_adjacency_list.get(k).compareTo(e)==0){\n break;\n }\n } \n //go through loop and check if visited, if not then add it to queue, set visited\n for( int j = 0; j< vertex_adjacency_list.get(k).numberOfAdjacentVertices(); j++){\n if(vertex_adjacency_list.get(k).getAdjacentVertex(j).hasBeenVisited()==false){\n counter++;\n queue.add(vertex_adjacency_list.get(k).getAdjacentVertex(j));\n vertex_adjacency_list.get(k).getAdjacentVertex(j).setVisited(counter);\n }\n }\n //remove from queue when through loop once\n k++;\n queue.remove();\n }\n //loop through list and print vertex and when it was visited\n for(int o = 0; o< vertex_adjacency_list.size(); o++){\n buffer.append(vertex_adjacency_list.get(o) + \":\" + vertex_adjacency_list.get(o).getVisited()+ \"\\n\");\n }\n return buffer.toString();\n }", "public static ArrayList<edges<String, Double>> Dijkstra(String CHAR1, String CHAR2, graph<String,Float> g) {\n\t\tPriorityQueue<ArrayList<edges<String, Double>>> active = \n\t\t\tnew PriorityQueue<ArrayList<edges<String, Double>>>(10,new Comparator<ArrayList<edges<String, Double>>>() {\n\t\t\t\tpublic int compare(ArrayList<edges<String, Double>> path1, ArrayList<edges<String, Double>> path2) {\n\t\t\t\t\tedges<String, Double> dest1 = path1.get(path1.size() - 1);\n\t\t\t\t\tedges<String, Double> dest2 = path2.get(path2.size() - 1);\n\t\t\t\t\tif (!(dest1.getLabel().equals(dest2.getLabel())))\n\t\t\t\t\t\treturn dest1.getLabel().compareTo(dest2.getLabel());\n\t\t\t\t\treturn path1.size() - path2.size();\n\t\t\t\t}\n\t\t\t});\n\t\t\tSet<String> known = new HashSet<String>();\n\t\t\tArrayList<edges<String, Double>> begin = new ArrayList<edges<String, Double>>();\n\t\t\tbegin.add(new edges<String, Double>(CHAR1, 0.0));\n\t\t\tactive.add(begin);\t\t\n\t\t\twhile (!active.isEmpty()) {\n\t\t\t\tArrayList<edges<String, Double>> minPath = active.poll();\n\t\t\t\tedges<String, Double> endOfMinPath = minPath.get(minPath.size() - 1);\n\t\t\t\tString minDest = endOfMinPath.getDest();\n\t\t\t\tdouble minCost = endOfMinPath.getLabel();\n\t\t\t\tif (minDest.equals(CHAR2)) {\n\t\t\t\t\treturn minPath;\n\t\t\t\t}\n\t\t\t\tif (known.contains(minDest))\n\t\t\t\t\tcontinue;\n\t\t\t\tSet<edges<String,Float>> children = g.childrenOf(minDest);\n\t\t\t\tfor (edges<String, Float> e : children) {\n\t\t\t\t\tif (!known.contains(e.getDest())) {\n\t\t\t\t\t\tdouble newCost = minCost + e.getLabel();\n\t\t\t\t\t\tArrayList<edges<String, Double>> newPath = new ArrayList<edges<String, Double>>(minPath); \n\t\t\t\t\t\tnewPath.add(new edges<String, Double>(e.getDest(), newCost));\n\t\t\t\t\t\tactive.add(newPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tknown.add(minDest);\n\t\t\t}\n\t\t\treturn null;\n\t}", "private void computeShortestPathsFromSource(V source) {\n\t\tBFSDistanceLabeler<V, E> labeler = new BFSDistanceLabeler<V, E>();\n\t\tlabeler.labelDistances(mGraph, source);\n\t\tdistances = labeler.getDistanceDecorator();\n\t\tMap<V, Number> currentSourceSPMap = new HashMap<V, Number>();\n\t\tMap<V, E> currentSourceEdgeMap = new HashMap<V, E>();\n\n\t\tfor (V vertex : mGraph.getVertices()) {\n\n\t\t\tNumber distanceVal = distances.get(vertex);\n\t\t\t// BFSDistanceLabeler uses -1 to indicate unreachable vertices;\n\t\t\t// don't bother to store unreachable vertices\n\t\t\tif (distanceVal != null && distanceVal.intValue() >= 0) {\n\t\t\t\tcurrentSourceSPMap.put(vertex, distanceVal);\n\t\t\t\tint minDistance = distanceVal.intValue();\n\t\t\t\tfor (E incomingEdge : mGraph.getInEdges(vertex)) {\n\t\t\t\t\tfor (V neighbor : mGraph\n\t\t\t\t\t\t\t.getIncidentVertices(incomingEdge)) {\n\t\t\t\t\t\tif (neighbor.equals(vertex))\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t// V neighbor = mGraph.getOpposite(vertex,\n\t\t\t\t\t\t// incomingEdge);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tNumber predDistanceVal = distances.get(neighbor);\n\n\t\t\t\t\t\tint pred_distance = predDistanceVal.intValue();\n\t\t\t\t\t\tif (pred_distance < minDistance && pred_distance >= 0) {\n\t\t\t\t\t\t\tminDistance = predDistanceVal.intValue();\n\t\t\t\t\t\t\tcurrentSourceEdgeMap.put(vertex, incomingEdge);\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\tmDistanceMap.put(source, currentSourceSPMap);\n\t\tmIncomingEdgeMap.put(source, currentSourceEdgeMap);\n\t}", "private void dijkstra(final NavigableSet<Node> queue) {\n Node firstNode, neighbor;\n while (!queue.isEmpty()) {\n // vertex with shortest distance (first iteration will return source)\n firstNode = queue.pollFirst();\n assert firstNode != null;\n if (!explored.contains(firstNode.coordinate)) {\n explored.add(firstNode.coordinate);\n }\n if (firstNode.dist == Integer.MAX_VALUE)\n // we can ignore u (and any other remaining vertices) since they are unreachable\n break;\n //look at distances to each neighbour\n for (Map.Entry<Node, Integer> temp : firstNode.neighbours.entrySet()) {\n neighbor = temp.getKey(); //the neighbour in this iteration\n if (!explored.contains(neighbor.coordinate)) {\n explored.add(neighbor.coordinate);\n }\n final int alternateDist = firstNode.dist + temp.getValue();\n if (alternateDist < neighbor.dist) { // shorter path to neighbour found\n queue.remove(neighbor);\n neighbor.dist = alternateDist;\n neighbor.previous = firstNode;\n queue.add(neighbor);\n }\n }\n }\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}", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "@Nullable\n private NodeWithCost<V, A> findShortestPath(@Nonnull DirectedGraph<V, A> graph,\n V start, V goal, @Nonnull ToDoubleFunction<A> costf) {\n PriorityQueue< NodeWithCost<V, A>> frontier = new PriorityQueue<>(61);\n Map<V, NodeWithCost<V, A>> frontierMap = new HashMap<>(61);\n // Size of explored is the expected number of nextArrows that we need to explore.\n Set<V> explored = new HashSet<>(61);\n return doFindShortestPath(start, frontier, frontierMap, goal, explored, graph, costf);\n }", "public LinkedList<Node> shortestPath() throws PathNotFoundException {\n // Which strategy shall we use?\n ApplicationConfiguration config = ApplicationConfiguration.getInstance();\n switch(config.getCurrentSearchAlgorithm()) {\n case A_STAR:\n return aStarPath();\n case BFS:\n return bfsPath();\n case DFS:\n return dfsPath();\n default:\n return null;\n }\n }", "public ArrayList<String> breadthFirstSearch(Character sourceId, Character destinationId) {\n if(!graph.containsKey(sourceId) || !graph.containsKey(destinationId)) {\n throw new NullPointerException(\"The graph does not contain the source or the destination node ID\");\n }\n // Initialize the list of paths & visited set\n paths = new ArrayList<>();\n HashSet<Character> visited = new HashSet<>();\n // Get the nodes from the map\n Node sourceNode = getNode(sourceId);\n Node destinationNode = getNode(destinationId);\n // Call the private method\n breadthFirstSearch(sourceNode, destinationNode, \"\", visited);\n // Return the paths found\n return paths;\n }", "private HashMap<String, Integer> getShortestPathBetweenDifferentNodes(Node start, Node end) {\n HashMap<Node, Node> parentChildMap = new HashMap<>();\n parentChildMap.put(start, null);\n\n // Shortest path between nodes\n HashMap<Node, Integer> shortestPathMap = new HashMap<>();\n\n for (Node node : getNodes()) {\n if (node == start)\n shortestPathMap.put(start, 0);\n else shortestPathMap.put(node, Integer.MAX_VALUE);\n }\n\n for (Edge edge : start.getEdges()) {\n shortestPathMap.put(edge.getDestination(), edge.getWeight());\n parentChildMap.put(edge.getDestination(), start);\n }\n\n while (true) {\n Node currentNode = closestUnvisitedNeighbour(shortestPathMap);\n\n if (currentNode == null) {\n return null;\n }\n\n // Save path to nearest unvisited node\n if (currentNode == end) {\n Node child = end;\n String path = end.getName();\n while (true) {\n Node parent = parentChildMap.get(child);\n if (parent == null) {\n break;\n }\n\n // Create path using previous(parent) and current(child) node\n path = parent.getName() + \"\" + path;\n child = parent;\n }\n HashMap<String,Integer> hm= new HashMap<>();\n hm.put(path, shortestPathMap.get(end));\n return hm;\n }\n currentNode.visit();\n\n // Go trough edges and find nearest\n for (Edge edge : currentNode.getEdges()) {\n if (edge.getDestination().isVisited())\n continue;\n\n if (shortestPathMap.get(currentNode) + edge.getWeight() < shortestPathMap.get(edge.getDestination())) {\n shortestPathMap.put(edge.getDestination(), shortestPathMap.get(currentNode) + edge.getWeight());\n parentChildMap.put(edge.getDestination(), currentNode);\n }\n }\n }\n }", "public List<String> computeBestPath(String source, String dest)\r\n {\r\n Vertex v;\r\n List<String>shortestPath = new LinkedList<String>();\r\n \r\n // First, relax all nodes\r\n computeAllPaths(source);\r\n \r\n // Then go through each one and return the path as a list of strings\r\n for (v= network_topology.get(dest); v != null; v = v.previous)\r\n { \r\n shortestPath.add(v.name);\r\n }\r\n \r\n Collections.reverse(shortestPath);\r\n \r\n // Clear the relaxed values so that they can be recalculated with each term\r\n clearPathData();\r\n \r\n return shortestPath;\r\n }", "public KnightNode getPathByBFS(KnightNode startNode,\n\t\t\tKnightNode finishNode) {\n\t\tif (startNode == null) {\n\t\t\tthrow new IllegalArgumentException(\"start node shouldn't be null!\");\n\t\t}\n\n\t\tif (finishNode == null) {\n\t\t\tthrow new IllegalArgumentException(\"finish node shouldn't be null!\");\n\t\t}\n\n\t\tQueue<KnightNode> queue = new LinkedList<KnightNode>();\n\n\t\t// step 0\n\t\tstartNode.isUsed = true;\n\t\tqueue.add(startNode);\n\t\n\t\twhile (!queue.isEmpty()) {\n\t\t\t// get next node from head of queue\n\t\t\tKnightNode tmpNode = queue.remove();\n\t\t\tSet<KnightNode> childNodes = tmpNode.availableMoves;\n\t\t\tfor (KnightNode tmpChild : childNodes) {\n\t\t\t\ttmpChild = findNode(tmpChild.x, tmpChild.y);\n\t\t\t\t// check if we have already been here\n\t\t\t\tif (!tmpChild.isUsed) {\n\t\t\t\t\ttmpChild.root = tmpNode;\n\t\t\t\t\ttmpChild.isUsed = true;\n\t\t\t\t\tqueue.add(tmpChild);\n\n\t\t\t\t\tif (tmpChild.equals(finishNode)) {\n\t\t\t\t\t\t// we have found our short path\n\t\t\t\t\t\treturn tmpChild;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// path is not exist\n\t\treturn null;\n\t}", "void dijkstra(Coordinate startName) {\n if (!graph.containsKey(startName)) {\n //test use print statement\n //System.out.printf(\"Graph doesn't contain start vertex \\\"%s\\\"\\n\", startName);\n return;\n }\n final Node source = graph.get(startName);\n NavigableSet<Node> queue = new TreeSet<>();\n\n // set-up vertices\n for (Node node : graph.values()) {\n node.previous = node == source ? source : null;\n node.dist = node == source ? 0 : Integer.MAX_VALUE;\n queue.add(node);\n }\n dijkstra(queue);\n }", "public static void exampleGraph() {\n\t\t// create a simple FNSS topology\n\t\tTopology topology = new Topology();\n\t\ttopology.addEdge(\"1\", \"2\", new Edge());\n\t\ttopology.addEdge(\"2\", \"3\", new Edge());\n\t\t\n\t\t// convert to JGraphT\n\t\tGraph<String, Edge> graph = JGraphTConverter.getGraph(topology);\n\t\t\n\t\t// Find shortest paths\n\t\tString source = \"3\";\n\t\tString destination = \"1\";\n\t\tList<Edge> sp = DijkstraShortestPath.findPathBetween(graph, source, destination);\n\t\t\n\t\t// Print results\n\t\tSystem.out.println(\"Shortest path from \" + source + \" to \" + destination + \":\");\n\t\tfor (Edge e : sp) {\n\t\t\tSystem.out.println(graph.getEdgeSource(e) + \" -> \" + graph.getEdgeTarget(e));\n\t\t}\n\t}", "public static void djikstra(int[][] graph, int src) {\n\t\t/* output array */\n\t\tint[] dist = new int[graph.length];\n\t\tboolean[] visited = new boolean[graph.length];\n\n\t\tfor (int i = 0; i < graph.length; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE;\n\t\t\tvisited[i] = false;\n\t\t}\n\n\t\tdist[src] = 0;\n\n\t\tfor (int i = 0; i < graph.length - 1; i++) {\n\n\t\t\t// Pick the minimum distance vertex from the set of vertices not\n\t\t\t// yet processed. u is always equal to src in first iteration.\n\t\t\tint u = findMinDistanceVertex(dist, visited);\n\t\t\t// Mark the picked vertex as processed\n\t\t\tvisited[u] = true;\n\t\t\t\n\t\t\tfor(int j = 0; j < graph.length; j++) {\n\t\t\t\t\n\t\t\t\t// Update dist[v] only if is not in sptSet, there is an edge from \n\t\t // u to v, and total weight of path from src to v through u is \n\t\t // smaller than current value of dist[v]\n\t\t\t\tif(!visited[j] && graph[u][j] != 0\n\t\t\t\t\t\t&& dist[u] != Integer.MAX_VALUE\n\t\t\t\t\t\t&& dist[u] + graph[u][j] < dist[j]) {\n\t\t\t\t\tdist[j] = dist[u] + graph[u][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintSolution(dist, graph.length);\n\t}", "public static void getShortestPath()\r\n\t{\r\n\t\tScanner scan = new Scanner(System.in); //instance for input declared\r\n\t\tSystem.out.print(\"\\nPlease enter the Source node for shortest path: \");\r\n\t\tint src = scan.nextInt() - 1;\r\n\t\twhile(src < 0 || src > routers-1)\r\n {\r\n\t\t\tSystem.out.println(\"The entered source node is out of range, please enter again: \"); // Printing error\r\n\t\t\tsrc = scan.nextInt() - 1;\t//re-input source\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.print(\"Please enter the destination node for shortest path: \");\r\n\t\tint dest = scan.nextInt() - 1;\r\n\t\twhile(dest < 0 || dest > routers-1)\r\n {\r\n\t\t\tSystem.out.println(\"The entered destination node is out of range, please enter again: \"); // Printing error\r\n\t\t\tdest = scan.nextInt() - 1;\t//re-input destination\r\n\t\t}\r\n\t\t\r\n\t\tconnectNetwork(src, dest, true);\r\n\t}", "static int shortestCellPath(int[][] grid, int sr, int sc, int tr, int tc) {\n\n\n Queue<Pair> queue = new LinkedList<>();\n\n\n boolean visited[][] = new boolean[grid.length][grid[0].length];\n\n\n int dirs[][] = new int[][]{{1,0},{0,1},{-1,0},{0,-1}};\n\n queue.offer(new Pair(sr,sc,0));\n visited[sr][sc] = true;\n\n while(!queue.isEmpty()){\n\n Pair currentNode = queue.poll();\n\n if(currentNode.row == tr && currentNode.col == tc) {\n return currentNode.d;\n }\n\n\n\n\n for(int[] dir : dirs) {\n\n\n int row = currentNode.row + dir[0];\n int col = currentNode.col + dir[1];\n\n if(row >= 0 && row < grid.length && col >= 0 && col < grid[0].length && !visited[row][col] && grid[row][col] == 1) {\n queue.offer(new Pair(row,col,currentNode.d+1));\n visited[row][col] = true;\n }\n }\n\n\n\n }\n\n return -1;\n }", "HashMap<GamePiece, GamePiece> bfs(GamePiece from) {\n ArrayDeque<GamePiece> worklist = new ArrayDeque<GamePiece>();\n ArrayList<GamePiece> seen = new ArrayList<GamePiece>();\n HashMap<GamePiece, GamePiece> graph = new HashMap<GamePiece, GamePiece>();\n worklist.addFirst(from);\n graph.put(from, from);\n while (worklist.size() > 0) {\n GamePiece next = worklist.removeFirst();\n if (seen.contains(next)) {\n // if seen has the next element, don't do anything with it\n }\n else {\n for (String s : this.directions) {\n if (next.hasNeighbor(s) && next.connected(s)) {\n worklist.addFirst(next.neighbors.get(s));\n graph.put(next.neighbors.get(s), next);\n }\n }\n seen.add(next);\n }\n }\n return graph;\n }", "private PathCostFlow findCheapestPath(int start, int end, double max_flow) throws Exception {\n if (getNode(start) == null || getNode(end) == null\n || !getNode(start).isSource() || getNode(end).isSource()) {\n throw new IllegalArgumentException(\"start must be the index of a source and end must be the index of a sink\");\n }\n double amount = Math.min(Math.min(getNode(start).getResidualCapacity(),\n getNode(end).getResidualCapacity()), max_flow);\n\n boolean[] visited = new boolean[n];\n int[] parent = new int[n];\n for (int i = 0; i < n; i++) {\n parent[i] = -1;\n }\n double[] cost = new double[n];\n for (int i = 0; i < n; i++) {\n cost[i] = Integer.MAX_VALUE;\n }\n cost[start] = 0;\n\n PriorityQueue<IndexCostTuple> queue = new PriorityQueue<IndexCostTuple>();\n queue.add(new IndexCostTuple(start, 0));\n\n while (!queue.isEmpty()) {\n IndexCostTuple current = queue.poll();\n\n // we found the target node\n if (current.getIndex() == end) {\n ArrayList<Integer> path = new ArrayList<Integer>();\n path.add(new Integer(end));\n while (path.get(path.size() - 1) != start) {\n path.add(parent[path.get(path.size() - 1)]);\n }\n Collections.reverse(path);\n if ((path.get(0) != start) || (path.get(path.size() - 1) != end)) {\n throw new Exception(\"I fucked up coding Dijkstra's\");\n }\n return new PathCostFlow(path, cost[end], amount);\n }\n\n // iterate through all possible neighbors of the current node\n for (int i = 0; i < n; i++) {\n SingleEdge e = matrix[current.getIndex()][i];\n if ((!visited[i]) && (e != null)\n && (current.getCost() + e.getCost(amount) < cost[i])) {\n cost[i] = current.getCost() + e.getCost(amount);\n parent[i] = current.getIndex();\n\n // update the entry for this node in the queue\n IndexCostTuple newCost = new IndexCostTuple(i, cost[i]);\n queue.remove(newCost);\n queue.add(newCost);\n }\n }\n visited[current.getIndex()] = true;\n }\n\n return null; //the target node was unreachable\n }", "private Path aStar(AStarNode start, AStarNode end) {\n\n\t/*pre-search setup*/\n astarSetup(end);\n AStarNode current = start;\n current.updateDist(0.0F);\n ArrayList<AStarNode> openSet = new ArrayList<>(getNodes().size());\n addNode(openSet, start);\n start.setFound(true);\n\n while (!openSet.isEmpty()) { // While there are nodes to evaluate\n if (current.equals(end)) // When reached the destination\n return createPath(start, end);\n openSet.remove(current); // Removes the node whose shortest distance from start position is determined\n current.setVisited(true); // marking the field that is added to closedSet\n \n for (AStarNode neighbor : current.getConnections()) { \n if (!neighbor.isVisited() && !neighbor.found()) { // if it is not seen before, add to open list\n addNode(openSet,neighbor);\n neighbor.setFound(true);\n neighbor.setPrevious(current);\n neighbor.setHeruistic(end);\n neighbor.updateDist(current.getDist() + current.getDistTo(neighbor));\n }\n else if(!neighbor.isVisited()){ //If seen before, update cost.\n double tempGScore = current.getDist() + current.getDistTo(neighbor);\n if (neighbor.getDist() > tempGScore) {\n neighbor.updateDist(tempGScore);\n neighbor.setPrevious(current);\n neighbor.setHeruistic(end);\n }\n }\n }\n current = getMinFScore(openSet); // setting next node as a node with minimum fScore.\n }\n\t\n\t/*If search ends without returning a path, there is no possible path.*/\n throw new PathFindingAlgorithm.AlgorithmFailureException();\n }", "private String getShortestPath(final Pair<Long, Long> src, final Pair<Long, Long> dst,\n final String passCode, final boolean first) {\n final var queue = new LinkedList<Node>();\n final var seen = new HashSet<Node>();\n //start from source\n final var srcNode = new Node( src, \"\" );\n queue.add( srcNode );\n seen.add( srcNode );\n\n int max = 0;\n while ( !queue.isEmpty() ) {\n final var curr = queue.remove();\n if ( curr.pos.equals( dst ) ) {\n if ( first ) {\n //shortest path\n return curr.path;\n } else {\n //store path length\n max = curr.path.length();\n //stop this path\n }\n } else {\n for ( final var neighbour : getNeighbours( curr, passCode ) ) {\n //unseen neighbour\n if ( seen.add( neighbour ) ) {\n //add to the queue\n queue.add( neighbour );\n }\n }\n }\n }\n\n return itoa( max );\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}" ]
[ "0.7235284", "0.71405", "0.70830643", "0.6733986", "0.65027964", "0.64627135", "0.6458492", "0.6431659", "0.6394997", "0.6389615", "0.6381586", "0.63688207", "0.6359802", "0.6355839", "0.63443756", "0.6308898", "0.6297694", "0.62451416", "0.6212219", "0.6200578", "0.61981344", "0.6186831", "0.6183426", "0.6169001", "0.6165777", "0.61378664", "0.6123661", "0.61168486", "0.609643", "0.60807484", "0.60694057", "0.60526264", "0.6032997", "0.6028948", "0.60130405", "0.60130066", "0.6010968", "0.5985051", "0.5975607", "0.5955093", "0.5946875", "0.594349", "0.5933025", "0.5932357", "0.5928044", "0.59215456", "0.5920365", "0.5918939", "0.59089816", "0.5904789", "0.5901767", "0.58975434", "0.5889175", "0.5876909", "0.5875338", "0.5874729", "0.587313", "0.58660793", "0.586433", "0.5859104", "0.58584446", "0.5858099", "0.5841035", "0.5833367", "0.5822998", "0.5814504", "0.58097076", "0.58072567", "0.5804677", "0.5799135", "0.57949656", "0.5793569", "0.5792463", "0.57862055", "0.577285", "0.5770348", "0.57683337", "0.57640386", "0.5762087", "0.576035", "0.57567406", "0.5754551", "0.57504785", "0.57497233", "0.5740796", "0.57383615", "0.573787", "0.5724957", "0.57227224", "0.57225204", "0.5721608", "0.5720476", "0.5719365", "0.5714245", "0.5705123", "0.5696933", "0.56958383", "0.5695606", "0.56931555", "0.5692458" ]
0.5797351
70
Sort in decreasing length order
@Override public int compare(String o1, String o2) { return Integer.compare(o2.length(), o1.length()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }", "public static ArrayList<String> lineLengthSort(ArrayList<String> inArray)\n\t{\n\t\tboolean hasSwapped = true;\n\t\twhile (hasSwapped)\n\t\t{\n\t\t\thasSwapped = false;\n\t\t\tfor(int i = 1; i < inArray.size(); i++)\n\t\t\t{\n\t\t\t\tif(inArray.get(i - 1).length() > inArray.get(i).length())\n\t\t\t\t{\n\t\t\t\t\tString temp = inArray.get(i - 1);\n\t\t\t\t\tinArray.set(i - 1, inArray.get(i));\n\t\t\t\t\tinArray.set(i, temp);\n\t\t\t\t\thasSwapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn inArray;\n\t}", "public void sortByWordLengthDesc() {\r\n\t\tcomparator = new WordLengthDesc();\r\n\t}", "private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }", "public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private static void sort(String[] a, int lo, int hi, int d) { \n if (hi <= lo + CUTOFF) {\n insertion(a, lo, hi, d);\n return;\n }\n int lt = lo;\n int gt = hi;\n int v = charAt(a[lo], d);\n int i = lo + 1;\n while (i <= gt) {\n int t = charAt(a[i], d);\n if (t < v) {\n \texch(a, lt++, i++);\n }\n else if (t > v) {\n \texch(a, i, gt--);\n }\n else {\n \ti++;\n }\n }\n //a[lo..lt-1] < v = a[lt..gt] < a[gt+1..hi]. \n sort(a, lo, lt-1, d);\n if (v >= 0) sort(a, lt, gt, d+1);\n sort(a, gt+1, hi, d);\n }", "void sort();", "void sort();", "public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }", "public void sortByWordLengthAsc() {\r\n\t\tcomparator = new WordLengthAsc();\r\n\t}", "public String doSort();", "public void sort() {\n\tqsort(a,0,a.length-1);\n }", "public static <Key extends Comparable<Key> > void sort (Key [] a){\n int n=a.length;\n //rearrange the array to a max heap\n for (int k=n/2;k>=1;k--) sink(a,k,n);\n for ( int i=0;i<a.length;i++){\n exch(a,1,n--);\n sink(a,1,n);\n }\n\n }", "public static List<String> sortDNA(List<String> unsortedSequences) {\n\t\tfor (int i = 0; i < unsortedSequences.size()-1; i++) {\n\t\t\tif (unsortedSequences.get(i).length()>unsortedSequences.get(i+1).length()) {\n\t\t\t\t\n\t\t\t\tString temp = unsortedSequences.get(i);\n\t\t\t\t\n\t\t\t\tunsortedSequences.set(i, unsortedSequences.get(i+1));\n\t\t\t\t\n\t\t\t\tunsortedSequences.set(i+1, temp);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn unsortedSequences;\n\t\t//return 0;\n\t}", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}", "private static <T> void sort1(char x[], char[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x,a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tchar v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x, a2,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x, a2,b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "public static WordFrq[] sort(WordFrq b[]){\n WordFrq temp;\n int i=0;\n while (i < 3) {\n for (i = 1; i < 3; i++) {\n if (b[i-1].count > b[i].count) {\n temp = b[i];\n b[i] = b[i-1];\n b[i-1] = temp;\n break;\n }\n }\n }\n\n\n return b;\n\n\n\n\n\n }", "@Override\n\tpublic T[] sort(T[] input) {\n\t\tfor(int i = 1; i < input.length; i++){\n\t\t\t//compare with the previous one, if smaller, switch with it.\n\t\t\tfor(int j = i; j > 0 && input[j-1].compareTo( input[j]) > 0; j--){\n\t\t\t\t//add the condition input[j-1] > input[j] in the for loop;\n\t\t\t\t//cause if j-1th < jth, j-2th < jth(left part is ordered)\n\t\t\t\tswap(input, j, j-1);\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "static void sort(int[] a)\n {\n for ( int j = 1; j<a.length; j++)\n {\n int i = j - 1;\n while(i>=0 && a[i]>a[i+1])\n {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n i--;\n }\n }\n }", "public void sortByLength()\n {\n boolean swapMade;//has a swap been made in the most recent pass?\n \n //repeat looking for swaps\n do\n {\n swapMade=false;//just starting this pass, so no swap yet\n \n //go through entire array. looking for swaps that need to be done\n for(int i = 0; i<currentRide-1; i++)\n {\n //if the other RideLines has less people\n if(rides[i].getCurrentPeople()<rides[i+1].getCurrentPeople())\n {\n // standard swap, using a temporary. swap with less people\n RideLines temp = rides[i];\n rides[i]=rides[i+1];\n rides[i+1]=temp;\n \n swapMade=true;//remember this pass made at least one swap\n }\n \n } \n }while(swapMade);//until no swaps were found in the most recent past\n \n redrawLines();//redraw the image\n \n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint k = input.nextInt();\n\t\tString s = input.next();\n\t\tString smallest = \" \";\n\t\tString largest = \" \";\n\t\tList<String> SubStringsOf_k_Length = new ArrayList<String>();\n\t\tfor(int i=0;(i+k)<=s.length();i++) {\n\t\t\tSubStringsOf_k_Length.add(s.substring(i,i+k));\n\t\t}\n//\t\tSystem.out.println(\"Before Sorting\");\n\t\tSystem.out.println(SubStringsOf_k_Length);\n\t\tSystem.out.println(SubStringsOf_k_Length.size());\n//\t\tCollections.sort(SubStringsOf_k_Length);\n//\t\tSystem.out.println(\"After Sorting\");\n//\t\tSystem.out.println(SubStringsOf_k_Length);\n\t\t\n//\t\tIterator itr = SubStringsOf_k_Length.iterator();\n//\t\t\n//\t\twhile(itr.hasNext()) {\n//\t\t\t\n//\t\t}\n\t\tString temp_largest = SubStringsOf_k_Length.get(0);\n\t\tString temp_smallest = SubStringsOf_k_Length.get(0);\n\t\tfor(int i=0;i<SubStringsOf_k_Length.size();i++) {\n\t\t\tif(temp_largest.compareTo(SubStringsOf_k_Length.get(i))>0 || temp_smallest.compareTo(SubStringsOf_k_Length.get(i))<0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor(int j=i+1;j<SubStringsOf_k_Length.size();j++) {\n\t\t\t\t\tif(SubStringsOf_k_Length.get(i).compareTo(SubStringsOf_k_Length.get(j))>0) {\n\t\t\t\t\t\tlargest = SubStringsOf_k_Length.get(i);\n\t\t\t\t\t\tsmallest=SubStringsOf_k_Length.get(j);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//smallest = SubStringsOf_k_Length.get(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_largest = largest;\n\t\t\t\ttemp_smallest = smallest;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(largest);\n\t\tSystem.out.println(smallest);\n//\t\tfor(int i=1;i<subStrings_Of_k_Length.length;i++) {\n//\t\t\tSystem.out.println(subStrings_Of_k_Length[i-1]);\n//\t\t\tsmallest = subStrings_Of_k_Length[i-1];\n//\t\t\tif((subStrings_Of_k_Length[i].compareTo(smallest))<0) {\n//\t\t\t\tlargest = subStrings_Of_k_Length[i-1];\n//\t\t\t\tsmallest = subStrings_Of_k_Length[i];\n//\t\t\t}\n//\t\t}\n//\t\tSystem.out.println(\"Smallest:\" +smallest);\n//\t\tSystem.out.println(\"Largest:\" +largest);\n\t}", "private static List<String> sort(String a)\n {\n String temp;\n List<String> list = new ArrayList<String>();\n for(int t = 0; t < a.length(); t++)\n {\n list.add(\"\"+a.charAt(t));\n }\n for(int i = 1; i < list.size(); i++)\n {\n for(int j = i ; j > 0; j--)\n {\n if(list.get(j).charAt(0) < list.get(j-1).charAt(0))\n {\n temp = list.get(j);\n list.set(j,list.get(j-1));\n list.set(j-1,temp);\n }\n \n }\n }\n return list;\n }" ]
[ "0.6709117", "0.66611093", "0.66513926", "0.6611596", "0.65257436", "0.6493754", "0.6491357", "0.6491357", "0.6490662", "0.64609885", "0.64414567", "0.64180756", "0.6372272", "0.6300941", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6286009", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6285722", "0.6234266", "0.6225888", "0.6211854", "0.620978", "0.61882836", "0.6156285", "0.61403954", "0.6138353", "0.6129032", "0.61288995", "0.61248106" ]
0.0
-1
Find by unique key
public CurrencyXRateProvider findByCode(String code) { return (CurrencyXRateProvider) this .getEntityManager() .createNamedQuery(CurrencyXRateProvider.NQ_FIND_BY_CODE) .setParameter("clientId", Session.user.get().getClient().getId()) .setParameter("code", code).getSingleResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Entry find(Object key) {\r\n Entry entry_with_key = new Entry();\r\n entry_with_key.key = key; \r\n int comp_hash = compFunction(entry_with_key.key.hashCode());\r\n if (hash_table[comp_hash] == null) {\r\n return null;\r\n } else {\r\n DList searching = hash_table[comp_hash];\r\n for(Object entry: searching){\r\n if(((Entry) entry).key().equals(key)){\r\n return (Entry) entry;\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n\r\n\r\n }", "public V search(K key);", "private Node<Pair<K, V>> findItem(K key) {\n Node<Pair<K, V>> result = null;\n\n int hash1 = hash1(key);\n\n if (table[hash1] != null) {\n Node<Pair<K, V>> node = search(table[hash1].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n int hash2 = hash2(key);\n\n if (table[hash2] != null && result == null) {\n Node<Pair<K, V>> node = search(table[hash2].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n return result;\n }", "String search(int key);", "public DataItem find(int key){\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key);\n\t\twhile(hashArray[hashVal] != null){\n\t\t\tif(hashArray[hashVal].getKey() == key){\n\t\t\t\tDataItem temp = hashArray[hashVal]; //find the item\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t\thashVal += stepSize;\n\t\t\thashVal %= arraySize;\n\t\t}\n\t\treturn null;\n\t}", "Online selectByPrimaryKey(String hash);", "boolean containsKey(long key);", "public Entry find(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 return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null;\n }", "public KeyedItem retrieve(Comparable searchKey);", "@Nullable IStrongSlot find(LuaValue key);", "private int locate(Key key) {\n\t\tint index = hash(key);\n\t\twhile(this.keys[index] != null && !this.keys[index].equals(key)) {\n\t\t\tindex = increment(index);\n\t\t}\n\t\treturn index;\n\t}", "boolean exists(Integer key);", "public Entry<K, V> find(K key) {\r\n try {\r\n int hash = key.hashCode();\r\n ListNode<Entry<K, V>> node = table[compFunction(hash)].front();\r\n if (node.isValidNode()) {\r\n return (Entry<K, V>) node.getItem();\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n }\r\n return null;\r\n }", "public T retrieveByKey(S key) throws SQLException;", "public boolean contains(Key key);", "public abstract boolean lookup(Key key);", "public boolean containsKey(Key key) ;", "@Override\n public Message findOne(Integer key) throws SQLException {\n //Ei toteutettu\n return null;\n }", "public E find(K key){\n\t\tE output= null;\n\t\t\n\t\tint i = 0;\n\t\twhile (i<keys.length && output == null){\n\t\t\tif(keys[i] != null && keys[i].equals(key))\n\t\t\t\toutput = elem[i];\n\t\t\ti = i + 1;\n\t\t}\n\t\treturn output;\n\t}", "private Node _locate(Object key){\n\t\tint hashCode = key.hashCode();\r\n\t\tint bucketNum = hashCode % _numBuckets;\r\n\t\treturn _locate(key, bucketNum);\r\n\t}", "private boolean isIdExists(SQLiteDatabase db, String tableName, String firstColumnName, Object key) {\n boolean ret = false;\n String query = new StringBuilder(\"SELECT \")\n .append(firstColumnName)\n .append(\" FROM \")\n .append(tableName)\n .append(\" WHERE \")\n .append(firstColumnName)\n .append(\" = \")\n .append(key)\n .append(\";\")\n .toString();\n JSArray resQuery = this.selectSQL(db, query, new ArrayList<String>());\n if (resQuery.length() == 1) ret = true;\n return ret;\n }", "@Override\n\tpublic User findByKey(Integer id) {\n\t\treturn null;\n\t}", "public Object findRecord(Object key) \n\t{\n\t check(\"find\", key);\n \n\t Object record = htRecords.get(key);\n\t if ( record != null )\n\t {\n\t\t //--- Return a copy of the record\n\t return copy ( record );\n\t }\n\t else\n\t {\n\t return null ;\n\t }\n\t}", "int find(K key)\n {\n return Math.abs(key.hashCode() % this.buckets.length);\n }", "@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "UrlMap findByKey(String key);", "public String find(String key) {\n\t\t\n\t\tsearchProbe = 0;\n\t\tint h = hash(key);\n\t\twhile(table[h]!=null) {\n\t\t\t\n\t\t\tif(table[h].toString().substring(0, 19).equals(key)) {\n\t\t\t\treturn table[h].toString();\n\t\t\t}\n\t\t\tsearchProbe++;\n\t\t\th=(h+1)%getTablesize();\n\t\t}\n\t\t\n\t\t\n\treturn \"Not Found\";\n\t}", "public int getIndexOf(K key);", "V get(UniqueId uniqueId);", "private HashGroupifyEntry findEntry(final int row, final int index, final int keyHash) {\n HashGroupifyEntry m = hashTableBuckets[index];\n while ((m != null) && ((m.hashcode != keyHash) || !dataOutput.equals(row, m.row))) {\n m = m.next;\n }\n return m;\n }", "Object getKey();", "private Node find(String key) {\n Node now = head;\n while (now != null) {\n if (now.pairStringString.getKey().equals(key)) {\n return now;\n }\n now = now.next;\n }\n return null;\n }", "public Entry find(Object key) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n if(defTable[index].isEmpty()) {\n return null;\n }\n\n Entry entry = new Entry();\n ListNode current = defTable[index].front();\n\n try{\n while(true) {\n if(((Entry) current.item()).key().equals(key)) {\n entry.key = key;\n entry.value = ((Entry) current.item()).value();\n return entry;\n }\n if(current==defTable[index].back()) {\n break;\n }\n current = current.next();\n }\n } catch(Exception err) {\n System.out.println(err);\n }\n return null;\n }", "public int find(K key){\r\n int k =0;\r\n int ik;\r\n while(true){\r\n ik = getIndex(k,key);\r\n if(hashTable[ik] == null || hashTable[ik].equals(key))\r\n return ik;\r\n else if(hashTable[ik].isDeleted){ // deleted\r\n break;\r\n }else{\r\n k++;\r\n }\r\n }\r\n int xspot = ik;\r\n while(true){\r\n k++;\r\n if(hashTable[ik]!=null && hashTable[ik].equals(key)){\r\n return ik;\r\n }\r\n if(hashTable[ik] == null){\r\n return xspot;\r\n }\r\n }\r\n }", "Option<AcHost> findByKey(String key) throws Throwable;", "Collection getUniqueKeysInGroup(Object groupID) throws Exception;", "private Node<Pair<K, V>> search(\n BiDirectionalNullTerminatedTailedLinkedList<Pair<K, V>> list,\n K key) {\n\n for (Node<Pair<K, V>> i = list.getHead().getNext(); i != list.getTail();\n i = i.getNext()) {\n if (i.getData().key.equals(key)) {\n return i;\n }\n }\n\n return null;\n }", "E findById(K id);", "boolean hasKey(String collection, String hkey);", "public int Search(int key)\n {\n for(int i=0; i<n; i++)\n {\n if(a[i]==key)\n return 1;\n }\n return 0;\n }", "public boolean existsKey(String inKey);", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "public V lookup(K key);", "String getLookupKey();", "String getKey(int index);", "int getKey(int i);", "T get(final UniqueId uniqueId) {\n _readLock.lock();\n try {\n return _uniqueIdMap.get(uniqueId);\n } finally {\n _readLock.unlock();\n }\n }", "Storage selectByPrimaryKey(StorageKey key);", "K findKeyForValue(V val);", "@Override\r\n\tpublic CommonParamDomain findByKey(CommonParamDomain t) {\n\t\treturn getPersistanceManager().load(getNamespace() + \".findByKey\", t);\r\n\t}", "T find(String collection, String hkey, Class<T> tclass);", "E find(KeyType key) {\n int position = findPosKey(key);\n if (mArray[position].state == FHhashQP.ACTIVE) {\n return mArray[findPosKey(key)].data;\n } else {\n throw new NoSuchElementException();\n }\n }", "public Record find(String key) {\n\t\tint hash = toHashKey(key);\n\t\tint baseValue = (baseHash(hash,length))% length;\n\t\tif (Table[baseValue].hash == -1){ //If slot is empty\n\t\t\treturn null;\n\t\t}\n\t\telse if (Table[baseValue].key.equals(key)){ //if the slot is the key we are looking for\n\t\t\treturn Table[baseValue];\n\t\t}\n\t\telse {\n\t\t\tint step = (stepHash(hash,length)); //checks first slot after base\n\t\t\tint current = (baseValue + step)% length; //checks first slot after base\n\t\t\twhile (current != baseValue){ //cycle through table until reaching first value again\n\t\t\t\tif (Table[current].hash == -1){//If slot is empty\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\telse if (Table[current].key.equals(key)){ //if the slot is the key we are looking for\n\t\t\t\t\treturn Table[current];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent = (current + step) % length; //Cycle through table without going over the newlength\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Key getPrimaryKey();", "public abstract boolean containsKey(K key);", "private Document findInCache(String userId) {\n\t\tString key;\n\t\tSet<String> keys = cache.keySet();\n\t\tIterator<String> itr = keys.iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tkey = itr.next();\n\t\t\tDocument data = cache.get(key);\n\t\t\t// check if email in profile object is same as input userId\n\t\t\tString email = \"\";\n\t\t\ttry {\n\t\t\t\temail = DOMUtil.value(data, Profile.xpathMap.get(\"email\"), Profile.nameSpaceCtx);\n\t\t\t} catch (XMLException e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// cache hit\n\t\t\tif (StringUtil.equalsIgnoreCase(email, userId)) {\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\t\t// Cache miss\n\t\treturn null;\n\t}", "public T search(K key) {\n\t\tfor (T item : list) {\n\t\t\tif (item.matches(key)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public E findById(Serializable pk) ;", "abstract public String getKey();", "@Override\n public int find(int p) {\n while (p != id[p]) { p = id[p]; }\n return p;\n }", "public boolean containsId(String key, Long userId) {\n if(index.containsKey(key)) {\n return index.get(key).contains(userId);\n }\n return false;\n }", "public boolean contains(K key);", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "MongoDBEntry<K, V> get(byte[] key);", "private ImmutablePair<byte[], byte[]> getFuzzyKeyFor(MDSKey key) {\n byte[] keyBytes = key.getKey();\n // byte array is automatically initialized to 0, which implies fixed match in fuzzy info\n // the row key after targetId doesn't need to be a match.\n // Workaround for HBASE-15676, need to have at least one 1 in the fuzzy filter\n byte[] infoBytes = new byte[keyBytes.length + 1];\n infoBytes[infoBytes.length - 1] = 1;\n\n // the key array size and mask array size has to be equal so increase the size by 1\n return new ImmutablePair<>(Bytes.concat(keyBytes, new byte[1]), infoBytes);\n }", "private CAUEntry findElementWithTID(CAUList ulist, int tid){\n\t\tList<CAUEntry> list = ulist.CAUEntries;\n\t\t\n\t\t// perform a binary search to check if the subset appears in level k-1.\n int first = 0;\n int last = list.size() - 1;\n \n // the binary search\n while( first <= last )\n {\n \tint middle = ( first + last ) >>> 1; // divide by 2\n\n if(list.get(middle).tid < tid){\n \tfirst = middle + 1; // the itemset compared is larger than the subset according to the lexical order\n }\n else if(list.get(middle).tid > tid){\n \tlast = middle - 1; // the itemset compared is smaller than the subset is smaller according to the lexical order\n }\n else{\n \treturn list.get(middle);\n }\n }\n\t\treturn null;\n\t}", "public void test_findUniqueByProperty() {\r\n\t\tPerson person = (Person) this.persistenceService.findUniqueByProperty(Person.class, NAME_PROPERTY, NAME_PARAM[2]);\r\n\t\tassertForFindUniquePerson(person);\r\n\t}", "private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }", "Kaiwa selectByPrimaryKey(String maht);", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "private Node findKey(String key){\n Node N = front;\n while(N != null){\n if(N.key.equals(key)){\n return N; \n }\n else{\n N = N.next; \n }\n }\n return null;\n }", "boolean has(String key);", "public int search (int[] db, int skey)\n { \n for (int i = 0; i < db.length; i++)\n { \n if (skey == db[i])\n {\n return i;\n }\n }\n return -1;\n }", "@Override\r\n\tpublic boolean exists(T key) {\r\n\t\treturn existsRec(raiz, key);\r\n\t}", "private ListNode find(K key) {\r\n\t\t\tif (key == null) throw new NullPointerException();\r\n\t\t\tListNode current = header;\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tif (current.key.equals(key)) return current;\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}", "public String findUserData(String login, String key);", "String getKey(Object entity);", "public V find (K key) throws KeyNotFoundException {\n\t\treturn findKey(root, key);\n\t}", "T key();", "@Override\n public boolean containsKey(Object key) {\n LinkedList<Entry> tempBucket = chooseBucket(key);\n \n for(int i=0;i<tempBucket.size();i++) {\n \t\tEntry tempEntry = tempBucket.get(i);\n \t\t\n \t\tif(tempEntry.getKey() == key) {\n \t\t\treturn true;\n \t\t}\n \t}\n \n return false;\n }", "boolean containsKey(K key);", "boolean containsKey(K key);", "public Object get(Object key) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key))\n\t\t\t\treturn p.value;\n\t\t}\n\t\t// if not found, return null\n\t\treturn null;\n\t}", "public boolean contains(String key);" ]
[ "0.6557548", "0.643432", "0.6391567", "0.6365645", "0.63271624", "0.62824047", "0.6248718", "0.62012416", "0.6187755", "0.6091412", "0.60801125", "0.60783225", "0.6019925", "0.6017186", "0.60071295", "0.5949148", "0.59168965", "0.590516", "0.5889019", "0.58544356", "0.5850748", "0.58504003", "0.5846398", "0.58166367", "0.5811134", "0.58050877", "0.58001983", "0.57801753", "0.57700527", "0.5754542", "0.5737355", "0.5725294", "0.56994325", "0.56967604", "0.5690346", "0.56514287", "0.5645431", "0.5622744", "0.56095856", "0.5595444", "0.5590188", "0.5569931", "0.5565742", "0.55463564", "0.55400485", "0.5533375", "0.5528807", "0.55126166", "0.5506231", "0.54987705", "0.5493664", "0.5479118", "0.5474766", "0.5466993", "0.54360306", "0.5434999", "0.5426315", "0.5424639", "0.54224426", "0.5421154", "0.5420269", "0.5414533", "0.5412998", "0.5412998", "0.5412998", "0.5412998", "0.5412998", "0.5412998", "0.5408697", "0.5408657", "0.5406584", "0.5400865", "0.5400679", "0.53918445", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.53858477", "0.5380723", "0.53777474", "0.5373163", "0.5370162", "0.53610617", "0.5359053", "0.53486764", "0.5346942", "0.5346161", "0.5345456", "0.5345456", "0.5345237", "0.53392893" ]
0.0
-1
Find by unique key
public CurrencyXRateProvider findByName(String name) { return (CurrencyXRateProvider) this .getEntityManager() .createNamedQuery(CurrencyXRateProvider.NQ_FIND_BY_NAME) .setParameter("clientId", Session.user.get().getClient().getId()) .setParameter("name", name).getSingleResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Entry find(Object key) {\r\n Entry entry_with_key = new Entry();\r\n entry_with_key.key = key; \r\n int comp_hash = compFunction(entry_with_key.key.hashCode());\r\n if (hash_table[comp_hash] == null) {\r\n return null;\r\n } else {\r\n DList searching = hash_table[comp_hash];\r\n for(Object entry: searching){\r\n if(((Entry) entry).key().equals(key)){\r\n return (Entry) entry;\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n\r\n\r\n }", "public V search(K key);", "private Node<Pair<K, V>> findItem(K key) {\n Node<Pair<K, V>> result = null;\n\n int hash1 = hash1(key);\n\n if (table[hash1] != null) {\n Node<Pair<K, V>> node = search(table[hash1].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n int hash2 = hash2(key);\n\n if (table[hash2] != null && result == null) {\n Node<Pair<K, V>> node = search(table[hash2].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n return result;\n }", "String search(int key);", "public DataItem find(int key){\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key);\n\t\twhile(hashArray[hashVal] != null){\n\t\t\tif(hashArray[hashVal].getKey() == key){\n\t\t\t\tDataItem temp = hashArray[hashVal]; //find the item\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t\thashVal += stepSize;\n\t\t\thashVal %= arraySize;\n\t\t}\n\t\treturn null;\n\t}", "Online selectByPrimaryKey(String hash);", "boolean containsKey(long key);", "public Entry find(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 return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null;\n }", "public KeyedItem retrieve(Comparable searchKey);", "@Nullable IStrongSlot find(LuaValue key);", "private int locate(Key key) {\n\t\tint index = hash(key);\n\t\twhile(this.keys[index] != null && !this.keys[index].equals(key)) {\n\t\t\tindex = increment(index);\n\t\t}\n\t\treturn index;\n\t}", "boolean exists(Integer key);", "public Entry<K, V> find(K key) {\r\n try {\r\n int hash = key.hashCode();\r\n ListNode<Entry<K, V>> node = table[compFunction(hash)].front();\r\n if (node.isValidNode()) {\r\n return (Entry<K, V>) node.getItem();\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n }\r\n return null;\r\n }", "public T retrieveByKey(S key) throws SQLException;", "public boolean contains(Key key);", "public abstract boolean lookup(Key key);", "public boolean containsKey(Key key) ;", "@Override\n public Message findOne(Integer key) throws SQLException {\n //Ei toteutettu\n return null;\n }", "public E find(K key){\n\t\tE output= null;\n\t\t\n\t\tint i = 0;\n\t\twhile (i<keys.length && output == null){\n\t\t\tif(keys[i] != null && keys[i].equals(key))\n\t\t\t\toutput = elem[i];\n\t\t\ti = i + 1;\n\t\t}\n\t\treturn output;\n\t}", "private Node _locate(Object key){\n\t\tint hashCode = key.hashCode();\r\n\t\tint bucketNum = hashCode % _numBuckets;\r\n\t\treturn _locate(key, bucketNum);\r\n\t}", "private boolean isIdExists(SQLiteDatabase db, String tableName, String firstColumnName, Object key) {\n boolean ret = false;\n String query = new StringBuilder(\"SELECT \")\n .append(firstColumnName)\n .append(\" FROM \")\n .append(tableName)\n .append(\" WHERE \")\n .append(firstColumnName)\n .append(\" = \")\n .append(key)\n .append(\";\")\n .toString();\n JSArray resQuery = this.selectSQL(db, query, new ArrayList<String>());\n if (resQuery.length() == 1) ret = true;\n return ret;\n }", "@Override\n\tpublic User findByKey(Integer id) {\n\t\treturn null;\n\t}", "public Object findRecord(Object key) \n\t{\n\t check(\"find\", key);\n \n\t Object record = htRecords.get(key);\n\t if ( record != null )\n\t {\n\t\t //--- Return a copy of the record\n\t return copy ( record );\n\t }\n\t else\n\t {\n\t return null ;\n\t }\n\t}", "int find(K key)\n {\n return Math.abs(key.hashCode() % this.buckets.length);\n }", "@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "UrlMap findByKey(String key);", "public String find(String key) {\n\t\t\n\t\tsearchProbe = 0;\n\t\tint h = hash(key);\n\t\twhile(table[h]!=null) {\n\t\t\t\n\t\t\tif(table[h].toString().substring(0, 19).equals(key)) {\n\t\t\t\treturn table[h].toString();\n\t\t\t}\n\t\t\tsearchProbe++;\n\t\t\th=(h+1)%getTablesize();\n\t\t}\n\t\t\n\t\t\n\treturn \"Not Found\";\n\t}", "public int getIndexOf(K key);", "V get(UniqueId uniqueId);", "private HashGroupifyEntry findEntry(final int row, final int index, final int keyHash) {\n HashGroupifyEntry m = hashTableBuckets[index];\n while ((m != null) && ((m.hashcode != keyHash) || !dataOutput.equals(row, m.row))) {\n m = m.next;\n }\n return m;\n }", "Object getKey();", "private Node find(String key) {\n Node now = head;\n while (now != null) {\n if (now.pairStringString.getKey().equals(key)) {\n return now;\n }\n now = now.next;\n }\n return null;\n }", "public Entry find(Object key) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n if(defTable[index].isEmpty()) {\n return null;\n }\n\n Entry entry = new Entry();\n ListNode current = defTable[index].front();\n\n try{\n while(true) {\n if(((Entry) current.item()).key().equals(key)) {\n entry.key = key;\n entry.value = ((Entry) current.item()).value();\n return entry;\n }\n if(current==defTable[index].back()) {\n break;\n }\n current = current.next();\n }\n } catch(Exception err) {\n System.out.println(err);\n }\n return null;\n }", "public int find(K key){\r\n int k =0;\r\n int ik;\r\n while(true){\r\n ik = getIndex(k,key);\r\n if(hashTable[ik] == null || hashTable[ik].equals(key))\r\n return ik;\r\n else if(hashTable[ik].isDeleted){ // deleted\r\n break;\r\n }else{\r\n k++;\r\n }\r\n }\r\n int xspot = ik;\r\n while(true){\r\n k++;\r\n if(hashTable[ik]!=null && hashTable[ik].equals(key)){\r\n return ik;\r\n }\r\n if(hashTable[ik] == null){\r\n return xspot;\r\n }\r\n }\r\n }", "Option<AcHost> findByKey(String key) throws Throwable;", "Collection getUniqueKeysInGroup(Object groupID) throws Exception;", "private Node<Pair<K, V>> search(\n BiDirectionalNullTerminatedTailedLinkedList<Pair<K, V>> list,\n K key) {\n\n for (Node<Pair<K, V>> i = list.getHead().getNext(); i != list.getTail();\n i = i.getNext()) {\n if (i.getData().key.equals(key)) {\n return i;\n }\n }\n\n return null;\n }", "E findById(K id);", "boolean hasKey(String collection, String hkey);", "public int Search(int key)\n {\n for(int i=0; i<n; i++)\n {\n if(a[i]==key)\n return 1;\n }\n return 0;\n }", "public boolean existsKey(String inKey);", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "public V lookup(K key);", "String getLookupKey();", "String getKey(int index);", "int getKey(int i);", "T get(final UniqueId uniqueId) {\n _readLock.lock();\n try {\n return _uniqueIdMap.get(uniqueId);\n } finally {\n _readLock.unlock();\n }\n }", "Storage selectByPrimaryKey(StorageKey key);", "K findKeyForValue(V val);", "@Override\r\n\tpublic CommonParamDomain findByKey(CommonParamDomain t) {\n\t\treturn getPersistanceManager().load(getNamespace() + \".findByKey\", t);\r\n\t}", "T find(String collection, String hkey, Class<T> tclass);", "E find(KeyType key) {\n int position = findPosKey(key);\n if (mArray[position].state == FHhashQP.ACTIVE) {\n return mArray[findPosKey(key)].data;\n } else {\n throw new NoSuchElementException();\n }\n }", "public Record find(String key) {\n\t\tint hash = toHashKey(key);\n\t\tint baseValue = (baseHash(hash,length))% length;\n\t\tif (Table[baseValue].hash == -1){ //If slot is empty\n\t\t\treturn null;\n\t\t}\n\t\telse if (Table[baseValue].key.equals(key)){ //if the slot is the key we are looking for\n\t\t\treturn Table[baseValue];\n\t\t}\n\t\telse {\n\t\t\tint step = (stepHash(hash,length)); //checks first slot after base\n\t\t\tint current = (baseValue + step)% length; //checks first slot after base\n\t\t\twhile (current != baseValue){ //cycle through table until reaching first value again\n\t\t\t\tif (Table[current].hash == -1){//If slot is empty\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\telse if (Table[current].key.equals(key)){ //if the slot is the key we are looking for\n\t\t\t\t\treturn Table[current];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent = (current + step) % length; //Cycle through table without going over the newlength\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Key getPrimaryKey();", "public abstract boolean containsKey(K key);", "private Document findInCache(String userId) {\n\t\tString key;\n\t\tSet<String> keys = cache.keySet();\n\t\tIterator<String> itr = keys.iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tkey = itr.next();\n\t\t\tDocument data = cache.get(key);\n\t\t\t// check if email in profile object is same as input userId\n\t\t\tString email = \"\";\n\t\t\ttry {\n\t\t\t\temail = DOMUtil.value(data, Profile.xpathMap.get(\"email\"), Profile.nameSpaceCtx);\n\t\t\t} catch (XMLException e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// cache hit\n\t\t\tif (StringUtil.equalsIgnoreCase(email, userId)) {\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\t\t// Cache miss\n\t\treturn null;\n\t}", "public T search(K key) {\n\t\tfor (T item : list) {\n\t\t\tif (item.matches(key)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public E findById(Serializable pk) ;", "abstract public String getKey();", "@Override\n public int find(int p) {\n while (p != id[p]) { p = id[p]; }\n return p;\n }", "public boolean containsId(String key, Long userId) {\n if(index.containsKey(key)) {\n return index.get(key).contains(userId);\n }\n return false;\n }", "public boolean contains(K key);", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "MongoDBEntry<K, V> get(byte[] key);", "private ImmutablePair<byte[], byte[]> getFuzzyKeyFor(MDSKey key) {\n byte[] keyBytes = key.getKey();\n // byte array is automatically initialized to 0, which implies fixed match in fuzzy info\n // the row key after targetId doesn't need to be a match.\n // Workaround for HBASE-15676, need to have at least one 1 in the fuzzy filter\n byte[] infoBytes = new byte[keyBytes.length + 1];\n infoBytes[infoBytes.length - 1] = 1;\n\n // the key array size and mask array size has to be equal so increase the size by 1\n return new ImmutablePair<>(Bytes.concat(keyBytes, new byte[1]), infoBytes);\n }", "private CAUEntry findElementWithTID(CAUList ulist, int tid){\n\t\tList<CAUEntry> list = ulist.CAUEntries;\n\t\t\n\t\t// perform a binary search to check if the subset appears in level k-1.\n int first = 0;\n int last = list.size() - 1;\n \n // the binary search\n while( first <= last )\n {\n \tint middle = ( first + last ) >>> 1; // divide by 2\n\n if(list.get(middle).tid < tid){\n \tfirst = middle + 1; // the itemset compared is larger than the subset according to the lexical order\n }\n else if(list.get(middle).tid > tid){\n \tlast = middle - 1; // the itemset compared is smaller than the subset is smaller according to the lexical order\n }\n else{\n \treturn list.get(middle);\n }\n }\n\t\treturn null;\n\t}", "public void test_findUniqueByProperty() {\r\n\t\tPerson person = (Person) this.persistenceService.findUniqueByProperty(Person.class, NAME_PROPERTY, NAME_PARAM[2]);\r\n\t\tassertForFindUniquePerson(person);\r\n\t}", "private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }", "Kaiwa selectByPrimaryKey(String maht);", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "private Node findKey(String key){\n Node N = front;\n while(N != null){\n if(N.key.equals(key)){\n return N; \n }\n else{\n N = N.next; \n }\n }\n return null;\n }", "boolean has(String key);", "public int search (int[] db, int skey)\n { \n for (int i = 0; i < db.length; i++)\n { \n if (skey == db[i])\n {\n return i;\n }\n }\n return -1;\n }", "@Override\r\n\tpublic boolean exists(T key) {\r\n\t\treturn existsRec(raiz, key);\r\n\t}", "private ListNode find(K key) {\r\n\t\t\tif (key == null) throw new NullPointerException();\r\n\t\t\tListNode current = header;\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tif (current.key.equals(key)) return current;\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}", "public String findUserData(String login, String key);", "String getKey(Object entity);", "public V find (K key) throws KeyNotFoundException {\n\t\treturn findKey(root, key);\n\t}", "T key();", "@Override\n public boolean containsKey(Object key) {\n LinkedList<Entry> tempBucket = chooseBucket(key);\n \n for(int i=0;i<tempBucket.size();i++) {\n \t\tEntry tempEntry = tempBucket.get(i);\n \t\t\n \t\tif(tempEntry.getKey() == key) {\n \t\t\treturn true;\n \t\t}\n \t}\n \n return false;\n }", "boolean containsKey(K key);", "boolean containsKey(K key);", "public Object get(Object key) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key))\n\t\t\t\treturn p.value;\n\t\t}\n\t\t// if not found, return null\n\t\treturn null;\n\t}", "public boolean contains(String key);" ]
[ "0.6557548", "0.643432", "0.6391567", "0.6365645", "0.63271624", "0.62824047", "0.6248718", "0.62012416", "0.6187755", "0.6091412", "0.60801125", "0.60783225", "0.6019925", "0.6017186", "0.60071295", "0.5949148", "0.59168965", "0.590516", "0.5889019", "0.58544356", "0.5850748", "0.58504003", "0.5846398", "0.58166367", "0.5811134", "0.58050877", "0.58001983", "0.57801753", "0.57700527", "0.5754542", "0.5737355", "0.5725294", "0.56994325", "0.56967604", "0.5690346", "0.56514287", "0.5645431", "0.5622744", "0.56095856", "0.5595444", "0.5590188", "0.5569931", "0.5565742", "0.55463564", "0.55400485", "0.5533375", "0.5528807", "0.55126166", "0.5506231", "0.54987705", "0.5493664", "0.5479118", "0.5474766", "0.5466993", "0.54360306", "0.5434999", "0.5426315", "0.5424639", "0.54224426", "0.5421154", "0.5420269", "0.5414533", "0.5412998", "0.5412998", "0.5412998", "0.5412998", "0.5412998", "0.5412998", "0.5408697", "0.5408657", "0.5406584", "0.5400865", "0.5400679", "0.53918445", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.5386191", "0.53858477", "0.5380723", "0.53777474", "0.5373163", "0.5370162", "0.53610617", "0.5359053", "0.53486764", "0.5346942", "0.5346161", "0.5345456", "0.5345456", "0.5345237", "0.53392893" ]
0.0
-1
Constructor to call if output to console desired or DAG visual desired
public OWLReasoner createReasoner(OWLOntology ontology, boolean verbose, boolean showGraph) { return new DMTReasoner(ontology, verbose, showGraph); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PrintStreamCommandOutput()\n {\n this( System.out );\n }", "public OutputConsole() {\n initComponents();\n setSize (1520, 750);\n }", "public NullPrintStream()\r\n\t{\r\n\t\tsuper(System.out);\r\n\t}", "abstract void initiateConsole();", "private CGraphInliner() {\n }", "private Output() {}", "public EventPrinter() {\n this(System.out);\n }", "public Bach() {\n this(LOGGER, System.out::println);\n }", "public AbstractCommand()\n {\n this.logger = new ConsoleLogger();\n }", "public HelloWorldProgramOutput ()\n {\n initialize();\n }", "public Console() {\n initComponents();\n }", "private CommandLine() {\n\t}", "public StdOutWriter ()\n {\n super (System.out, true);\n }", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public PlotDrawer() {\n\n\t}", "public ConsoleView() {\n\t\tcrapsControl = new CrapsControl();\n\t\tinput = new Scanner(System.in);\n\t}", "private AbstractTerminal()\n\t{\n\t\tio = new SwingTextTerminal();\n\t}", "public ConsoleView(GraphModel g) {\n this.graphModel = g;\n g.addObserver(this);\n }", "public Main() {\n\t\tsuper();\n\t}", "public StandardPipeline() {\n this(null);\n }", "public Cli (BufferedReader in,PrintWriter out , Controller thecontroller) {\r\n\t\tsuper(thecontroller);\r\n\t\tthis.in=in;\r\n\t\tthis.out=out;\r\n\t\tthis.commandsSet= controller.getCommandSet();\r\n\t}", "private Main() {\n\n super();\n }", "public Main() {\n \n \n }", "public IcsSystemConsoleDesignation(Connection connection, String encoding){\n super(connection, encoding);\n }", "public CLI()\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = \"\";\r\n\t\t//this.exitStr = exitStr;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}", "public Terminal() {\n initComponents();\n }", "public Main() {\r\n\t}", "public ABBOut() {}", "public static void setup() {\n\t\toutputs.add(new Console.stdout());\n\t}", "private void initializeConsole() {\n\t\tthis.hydraConsole = new HydraConsole(this.stage, this.commands);\n\t\tthis.splitPane.setBottomComponent(this.hydraConsole);\n\t}", "private void initializeConsole()\n {\n final ConsolePrintStream consolePrintStream = new ConsolePrintStream(this.informationMessage);\n System.setOut(consolePrintStream.getPrintStream());\n }", "public EnlightenedJavaPrinter() {\n\n }", "public Console() {\n instance = this;\n\n this.setPrefViewportHeight(300);\n lb = new Label();\n lb.setWrapText(true);\n instance.setContent(lb);\n\n }", "private AlgorithmRegistryCLI() {\n super();\n }", "public TaskQueue(){\n this(\n new PrintWriter(System.out, true),\n new PrintWriter(System.err, true),\n DEFAULT_CONCURRENT_ACTIONS\n );\n }", "@Override\n public void populateDAG(DAG dag, Configuration conf)\n {\n DummyOutputOperator combinedConsole = dag.addOperator(\"console\", new DummyOutputOperator());\n \n FileInputReaderWithShutDown inputOp = dag.addOperator(\"inputWordsReader\", new FileInputReaderWithShutDown());\n inputOp.setDirectory(\"/media/isha/apex-samples/sampleInput1\");\n dag.addStream(\"stream1\", inputOp.output, combinedConsole.input1);\n \n FileInputReaderWithoutShutDownException inputOp1 = dag.addOperator(\"inputTextReader1\", new FileInputReaderWithoutShutDownException());\n inputOp1.setDirectory(\"/media/isha/apex-samples/sampleInput2\");\n dag.addStream(\"stream2\", inputOp1.output, combinedConsole.input2);\n }", "public Main() {\r\n }", "public Main() {\r\n }", "public LessCSSTask() {\n // empty\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tGraph g = new Graph();\r\n\t\tg.printData();\r\n\t\t\r\n\t}", "public DecisionTrace() {\r\n\r\n\t}", "public Connect4TextConsole(){\r\n this.board = new Connect4(); \r\n this.comp = new Connect4ComputerPlayer(this.board);\r\n }", "public interface Console {\n\t//For know without description\n\t\n\t/**\n\t * Prints all information in XML src\n\t * @param src - document \n\t */\n\tpublic void startInfo(Document src);\n\t\n\t/**\n\t * Reading and printing inform. from console\n\t * @param str - string from console with request\n\t */\n\tpublic void readAndPrint(String str);\n\t\n\t/**\n\t * Starts listening InputStream in\n\t * @param in - in this program it's System.in\n\t */\n\n\tpublic void start(InputStream in, String path);\n\t\n\t/**\n\t * Printing all information about Node n\n\t * @param n\n\t */\n\tpublic void printNode(Node n);\n}", "public Main() {\n }", "public WalkingDistance() {\n this(ApplicationMode.CONSOLE);\n }", "public PrintStreamCommandOutput( PrintStream output )\n {\n this( output, System.err );\n }", "private Main ()\n {\n super ();\n }", "public Example2() {\n\t\tSystem.out.println(\"Example2....\");\n\t}", "public Main() {\n }", "public Main() {\n }", "public void prepare() {\r\n\t\tsuper.prepare();\r\n\t\tSystem.out.println(\" - Gather the grains\");\r\n\t\tSystem.out.println(\" - Shape into circles\");\r\n\t\tSystem.out.println(\" - Randomly color circles\");\r\n\t\tSystem.out.println(\" - Let circles dry\");\r\n\t}", "public void createOutput() {\n\t\tsetOutput(new Output());\n\t}", "com.lxd.protobuf.msg.result.console.Console.Console_ getConsole();", "Mouse(){\n System.out.println(\"This is Mouse class.\");\n }", "public ChessclubHelpConsoleDesignation(\n Connection connection, String encoding, boolean isConsoleCloseable) {\n super(connection, true, encoding, isConsoleCloseable);\n }", "public Printer(){ }", "private SimpleCLI(Options options) {\n this.options = options;\n }", "public abstract void printPlan(Operator plan) throws OutputException;", "public MyViewCLI(InputStreamReader in, OutputStreamWriter out, Controller controller) {\r\n\t\tcli = new CLI(in, out, controller);\r\n\t\tthis.controller = controller;\r\n\t}", "public static void main(String[] args) {\n\t\tDirectedAcyclicGraph<String, DefaultEdge> dag = new DirectedAcyclicGraph<>(DefaultEdge.class);\r\n\t\t\r\n\t\t//Add some vertices to the DAG and display the contents\r\n\t\tdag.addVertex(\"1\");\r\n\t\tdag.addVertex(\"2\");\r\n\t\tdag.addVertex(\"3\");\r\n\t\tdag.addVertex(\"4\");\r\n\t\tSystem.out.println(dag.toString());\r\n\t\t\r\n\t\t//Properly use the addDagEdge() method and display the contents\r\n\t\ttry {\r\n\t\t\tdag.addDagEdge(\"1\", \"2\");\r\n\t\t\tdag.addDagEdge(\"2\", \"3\");\r\n\t\t\tdag.addDagEdge(\"3\", \"4\");\r\n\t\t} catch (CycleFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(dag.toString());\r\n\t\t\r\n\t\t//Purposefully have addDagEdge() throw an exception\r\n\t\ttry {\r\n\t\t\tdag.addDagEdge(\"4\", \"1\");\r\n\t\t} catch (CycleFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//Display the contents of the DAG\r\n\t\tSystem.out.println(dag.toString());\r\n\t\t\r\n\t\t//Acknowledge that the addEdge() method can work without a try-catch block\r\n\t\tdag.addEdge(\"2\", \"4\");\r\n\t\t\r\n\t\t//Display the contents of the DAG\r\n\t\tSystem.out.println(dag.toString());\r\n\t\t\r\n\t\t//Show that addEdge() throws an IllegalArgumentException when used improperly\r\n\t\ttry {\r\n\t\t\tdag.addEdge(\"4\", \"1\");\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//Remove \"4\" from the DAG and display the contents\r\n\t\tdag.removeVertex(\"4\");\r\n\t\tSystem.out.println(dag.toString());\r\n\t\t\r\n\t\t//Add \"4\" and \"5\" and associated edges (3, 4) and (3, 5)\r\n\t\tdag.addVertex(\"4\");\r\n\t\tdag.addVertex(\"5\");\r\n\t\ttry {\r\n\t\t\tdag.addDagEdge(\"3\", \"4\");\r\n\t\t\tdag.addDagEdge(\"3\", \"5\");\r\n\t\t} catch (CycleFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//Display the ancestors of \"4\"\r\n\t\tSystem.out.println(dag.getAncestors(dag, \"4\").toString());\r\n\t\t\r\n\t\t//Display the descendants of \"2\"\r\n\t\tSystem.out.println(dag.getDescendants(dag, \"2\").toString());\r\n\t}", "public yyAnim (String title, int io) { this(System.class, title, io); }", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "Output createOutput();", "public Main() {}", "public Plot() {\r\n }", "Car()\r\n\t{\r\n\t\tSystem.out.println(\"hello\");\r\n\t}", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public Panel03Console() {\n System.out.println(\"Panel03 ConsolePanel()\");\n initComponents();\n super.setPreferredSize(new Dimension(CONSOLE_WIDTH, CONSOLE_HEIGHT));\n }", "void visualize(Object o) {\n\t\tif (o == null) {\n\t\t\to = new NullObject();\n\t\t}\n\n\t\tScratch scratch = scratchFactory.create(o);\n\t\tscratch.addCSSClass(\"printOut\");\n\n\t\tvisualizeScratch(scratch);\n\t}", "protected Plot() {\r\n }", "public FlowNodeInstance() {\n\t}", "public StateVisualizer() {\r\n }", "public AbstractCar(String car){\n\t\n\tSystem.out.println(\"\\n\\n The following are the details for : \" + car);\n}", "public RoutingResourceGraph() {\n ex = new RunGraph(3,2);\n squares = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_sinks = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_wires = new JLabel[2 * ex.getGraphSize() * ex.getGraphSize()][ex.getWireSize()];\n switches = new JToggleButton[ex.getGraphSize()][ex.getGraphSize()];\n ex.initialize();\n initComponents();\n initialize();\n add_edge();\n ex.find_shortest_path();\n showCong();\n showGraph();\n }", "public XMLOutputter() {\r\n }", "private ColorWithConstructor() {\n\t\tSystem.out.println(\"Constructor called for : \" + this.toString());\n\t}", "public CLI(String inputCommand)\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = inputCommand;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}", "private static void consoleOutput() {\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n airportFlightCounter.toConsole();\n flightInventory.toConsole();\n flightPassengerCounter.toConsole();\n mileageCounter.toConsole();\n }", "protected ConsoleHandler() {\n super();\n setConsole(System.err);\n setFormatter(LOG_FORMATTER);\n setLevel(DEFAULT_LEVEL);\n }", "public Main() {\n // Required empty public constructor\n }", "private ConsoleUtils(String name) {\n instance = this;\n fConsole = new IOConsole(\"Mobius\" + name + \" Console\", EImages.TOOL.getDescriptor());\n fConsole.activate();\n ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{fConsole});\n final Display display = PlatformUI.getWorkbench().getDisplay();\n fRed = new Color(display, RED);\n fBlue = new Color(display, BLUE);\n fPurple = new Color(display, PURPLE);\n fBlack = new Color(display, BLACK);\n }", "public void init()\n {\n _appContext = SubAppContext.createOMM(System.out);\n _serviceName = CommandLine.variable(\"serviceName\");\n initGUI();\n }", "public Calculator() {\r\n\t\t/*\r\n\t\t * Constructor - Method name which has the same class name is called a Consatructor\r\n\t\t */\r\n\t\tSystem.out.println(\"Calling constructor\");\r\n\t}", "public abstract void debug(PrintStream console);", "public SystemLog () {\r\n\t\tsuper();\r\n\t}", "public NewCommand(ApplicationData data) {\n super(\"NewCommand\");\n this.data = data;\n // configure log4j using resource URL APF-548\n DOMConfigurator.configure(getClass().getResource(\"/META-INF/log4j.xml\"));\n log = getLogger(NewCommand.class);\n\n }", "public NGATAstro()\n\t{\n\t\tsuper();\n\t\tlogger = LogManager.getLogger(this);\n\t\tinitialiseLoggerReference(logger);\n\t}", "public GoalViewer()\r\n/* 25: */ {\r\n/* 26: 28 */ setBorder(BorderFactory.createLineBorder(Color.BLACK));\r\n/* 27: */ }", "public DepthFirst(Graph g,JTextArea output) {\n\t\tsuper();\n\t\tthis.g=g;\n\t\tthis.output=output;\n\t\tthis.output.setText(\"\");\n\n\t}", "protected MethodCallPrinter()\n {\n }", "private Shell() { }", "public VectorOutput () { }", "public BootstrapInstrumentor(PrintWriter w) {\n this.w = w;\n }", "public Controller() {\n\t\tdoResidu = false;\n\t\tdoTime = false;\n\t\tdoReference = false;\n\t\tdoConstraint = false;\n\t\ttimeStarting = System.nanoTime();\n\t\t\n\t\tsetPath(Files.getWorkingDirectory());\n\t\tsetSystem(true);\n\t\tsetMultithreading(true);\n\t\tsetDisplayFinal(true);\n\t\tsetFFT(FFT.getFastestFFT().getDefaultFFT());\n\t\tsetNormalizationPSF(1);\n\t\tsetEpsilon(1e-6);\n\t\tsetPadding(new Padding());\n\t\tsetApodization(new Apodization());\n\n\t\tmonitors = new Monitors();\n\t\tmonitors.add(new ConsoleMonitor());\n\t\tmonitors.add(new TableMonitor(Constants.widthGUI, 240));\n\n\t\tsetVerbose(Verbose.Log);\n\t\tsetStats(new Stats(Stats.Mode.NO));\n\t\tsetConstraint(Constraint.Mode.NO);\n\t\tsetResiduMin(-1);\n\t\tsetTimeLimit(-1);\n\t\tsetReference(null);\n\t\tsetOuts(new ArrayList<Output>());\n\t}", "public StackAnalysesView() {\n\t\tsuper(\"Stack Analyses\");\n\t\tinternalBrowser = new InternalBrowser(new DefaultShell());\n\t}", "public HtShowDetailedLog() {\n\t}", "public void setOut(PrintStream out);", "private Log()\n {\n //Hides implicit constructor.\n }", "public Output(Input input)\n {\n outputHelper = new OutputHelper();\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n add(outputHelper);\n setSize(Constants.WIDTH, Constants.HEIGHT);\n setVisible(true);\n addMouseListener(input);\n addMouseMotionListener(input);\n addKeyListener(input);\n }", "public ConsoleOutputWrapper() {\n fCurrent = ConsoleUtils.getDefault().getConsole();\n }", "public CLI(BufferedReader in, Writer out) {\n\t\t_in = in;\n\t\t_out = out;\n\t}" ]
[ "0.6333759", "0.6127229", "0.6077421", "0.60292816", "0.5983578", "0.59658235", "0.5913372", "0.58349746", "0.5833874", "0.5833127", "0.5796187", "0.57904845", "0.57721853", "0.5746298", "0.57434523", "0.5726681", "0.5707729", "0.5701344", "0.56994724", "0.56431377", "0.55765367", "0.55451024", "0.5544818", "0.554125", "0.5529355", "0.55199575", "0.551071", "0.5503881", "0.54958344", "0.5483733", "0.54612654", "0.54456633", "0.5445081", "0.5442437", "0.54348207", "0.5429681", "0.5419993", "0.5419993", "0.5412625", "0.54051316", "0.54021347", "0.53657806", "0.5364082", "0.5362689", "0.5358805", "0.5351668", "0.5323397", "0.53167063", "0.5315601", "0.5315601", "0.53123486", "0.5305322", "0.52792853", "0.5276636", "0.5276259", "0.52672875", "0.5261834", "0.52603275", "0.5253799", "0.5253126", "0.52508956", "0.5241535", "0.5240586", "0.5233245", "0.52291137", "0.52236146", "0.5220771", "0.52198744", "0.5218945", "0.52187324", "0.5217959", "0.5199332", "0.51958764", "0.51926655", "0.51782054", "0.51735747", "0.51671624", "0.5163603", "0.5163224", "0.51585126", "0.5155879", "0.51558435", "0.5154405", "0.5145911", "0.5145286", "0.5143396", "0.51427823", "0.51402354", "0.5130067", "0.5129732", "0.5113065", "0.51125634", "0.51101923", "0.5091926", "0.5086845", "0.5082865", "0.5079263", "0.5076887", "0.50696385", "0.50663316", "0.506613" ]
0.0
-1
Costruttore per un'istanza RuleParser
public RuleParser() { this.fileName = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Rule createRule();", "Rule createRule();", "Rule createRule();", "public interface ValidParserRules {\n String getName();\n String getPrefix();\n PropertyType getType();\n ValidParserRules getParent();\n}", "Rule getRule();", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }", "@Override public ParserRule getRule() { return rule; }" ]
[ "0.62157726", "0.62157726", "0.62157726", "0.62084335", "0.60326684", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5987451", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146", "0.5952146" ]
0.60495967
4
Permette di specificare il percorso del file da cui estrarre le regole
public void setUp(String fileName) { this.fileName = fileName; this.timer = new MyTimer("TimerThread"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void armarPreguntas(){\n preguntas = file.listaPreguntas(\"Preguntas.txt\");\n }", "public void showFile() throws FileNotFoundException, IOException{\r\n ArrayList<String> arxiu = new ArrayList<>();\r\n \r\n BufferedReader br = new BufferedReader(new FileReader(fitxerUsuaris));\r\n \r\n String usuari;\r\n \r\n while((usuari = br.readLine()) != null){\r\n arxiu.add(usuari);\r\n }\r\n \r\n for (int i = 0; i < arxiu.size(); i++) {\r\n System.out.println(arxiu.get(i));\r\n }\r\n }", "public void seleccionarFichero(){\n JFileChooser fileChooser = new JFileChooser();\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"xml\", \"xml\");\n fileChooser.setFileFilter(filter);\n fileChooser.setCurrentDirectory(new java.io.File(\"./ficheros\"));\n int seleccion = fileChooser.showOpenDialog(vista_principal);\n if (seleccion == JFileChooser.APPROVE_OPTION){\n fichero = fileChooser.getSelectedFile();\n vista_principal.getTxtfield_nombre_fichero().\n setText(fichero.getName().substring(0, fichero.getName().length()-4));\n }\n }", "private void abrirFichero() {\r\n\t\tJFileChooser abrir = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tabrir.setFileFilter(filtro);\r\n\t\tif(abrir.showOpenDialog(abrir) == JFileChooser.APPROVE_OPTION){\r\n\t\t\ttry {\r\n\t\t\t\tGestion.liga = (Liga) Gestion.abrir(abrir.getSelectedFile());\r\n\t\t\t\tGestion.setAbierto(true);\r\n\t\t\t\tGestion.setFichero(abrir.getSelectedFile());\r\n\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t} catch (ClassNotFoundException | IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"No se ha podido abrir el fichero\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void choixRepertoire(int format){\n\t\tString path = \"\"; //Chemin a parcourir\n\t\tJFileChooser chooser = null;\n\t\tif(SauvegardeRepertoire.getPaths().isEmpty()){//Si la liste des repertoires est vide\n\t\t\tchooser = new JFileChooser();\n\t\t}\n\t\telse{//si elle n'est pas vide\n\t\t\tIterator<String> it = SauvegardeRepertoire.getPaths().iterator();\n\t\t\twhile (it.hasNext() && path.equals(\"\")) {\n\t\t\t\tString str = (String) it.next();\n\t\t\t\tFile file = new File(str);\n\n\t\t\t\tif (file.exists()) //on recupere le premier repertoire possible\t\n\t\t\t\t\tpath = file.getAbsolutePath();\n\t\t\t}\n\n\t\t\tif(path.equals(\"\"))//si on a pas trouvé de chemin coherent\n\t\t\t\tchooser = new JFileChooser();\n\t\t\telse\n\t\t\t\tchooser = new JFileChooser(path);\n\t\t}\n\t\tFileNameExtensionFilter filter=null;\n\t\tswitch(format)\n\t\t{\n\t\t\tcase PDFFile:\n\t\t\t\tfilter = new FileNameExtensionFilter(\"PDF\",\"pdf\");\n\t\t\t\tbreak;\n\t\t\tcase ARFFFile:\n\t\t\t\tchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t\t\tchooser.setAcceptAllFileFilterUsed(false);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tchooser.setFileFilter(filter);\n\t\tchooser.setMultiSelectionEnabled(false);\n\t\tint returnVal = chooser.showOpenDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tSauvegardeRepertoire.ajoutPath(chooser);//permet de sauvegarder les repertoires\n\t\t\tif(filter!=null && filter.getExtensions()[0].equals(\"pdf\")) {\n\t\t\t\tgestionFichier(chooser);\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgestionFichierDataSet(chooser);\n\t\t\t\tbDataTraining.setEnabled(true);\n\t\t\t}\n\n\t\t}\n\t}", "public void loadFile()\n {\n\n FileDialog fd = null; //no value\n fd = new FileDialog(fd , \"Pick up a bubble file: \" , FileDialog.LOAD); //create popup menu \n fd.setVisible(true); // make visible manu\n String directory = fd.getDirectory(); // give the location of file\n String name = fd.getFile(); // give us what file is it\n String fullName = directory + name; //put together in one sting \n \n File rideNameFile = new File(fullName); //open new file with above directory and name\n \n Scanner nameReader = null;\n //when I try to pick up it read as scanner what I choose\n try\n {\n nameReader = new Scanner(rideNameFile);\n }\n catch (FileNotFoundException fnfe)//if dont find return this message below\n {\n return; // immedaitely exit from here\n }\n \n //if load button pressed, it remove all ride lines in the world\n if(load.getFound()){\n removeAllLines();\n } \n \n //read until is no more stings inside of file and until fullfill max rides\n while(nameReader.hasNextLine()&&currentRide<MAX_RIDES)\n {\n \n String rd= nameReader.nextLine();//hold and read string with name of ride\n RideLines nova =new RideLines(rd);\n rides[currentRide]=nova;\n \n //Create a RideLine with string given from file\n addObject(rides[currentRide++], 650, 20 + 40*currentRide);\n }\n \n //when is no more strings inside it close reader\n nameReader.close();\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\tListaNombre nombres = new ListaNombre();\n//\t\tnombres.add(new Nombre(\"guido\"));\n//\t\tnombres.add(new Nombre(\"guido\"));\n//\t\tnombres.add(new Nombre(\"guido\"));\n//\t\tnombres.add(new Nombre(\"juan\"));\n//\t\tnombres.add(new Nombre(\"juan\"));\n//\t\tnombres.add(new Nombre(\"daria\"));\n//\t\tnombres.add(new Nombre(\"daria\"));\n//\t\tnombres.add(new Nombre(\"pedro\"));\n//\t\tnombres.add(new Nombre(\"pedro\"));\n//\t\tnombres.add(new Nombre(\"pedro\"));\n//\t\tnombres.setCantRepetidos(3);\n//\t\tfor (Nombre nom : nombres.getNombres()) {\n//\t\t\tSystem.out.println(nom.getNombre() + \" \" + nom.getCant());\n//\t\t}\n\t\tnombres = ( Archivo.leer(\"C:\\\\Users\\\\guido\\\\eclipse-workspace\\\\DescubriendoNombresRepetidos\\\\premioA.in\"));\n\t\tArchivo.escribir(\"C:\\\\Users\\\\guido\\\\eclipse-workspace\\\\DescubriendoNombresRepetidos\\\\salida.out\",nombres);\n\t}", "public static void RT() {////cada clase que tiene informacion en un archivo txt tiene este metodo para leer el respectivo archivoy guardarlo en su hashmap\n\t\treadTxt(\"peliculas.txt\", pelisList);\n\t}", "private void dialogEcritureFichier(File file) {\n\t\tJOptionPane.showMessageDialog(null, \"le fichier \" + file.getName() +\" a été écrit\", \"Info\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "public void subir_file()\n {\n FileChooser fc = new FileChooser();\n\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"PDF Files\",\"*.pdf\")\n , new FileChooser.ExtensionFilter(\"Jpg Images\",\"*.jpg\",\"*.JPEG\",\"*.JPG\",\"*.jpeg\",\"*.PNG\",\"*.png\"));\n\n File fileSelected = fc.showOpenDialog(null);\n\n if (fileSelected!= null){\n txt_ruta.setText(fileSelected.getPath());\n\n if(txt_ruta.getText().contains(\".pdf\"))\n {\n System.out.println(\"si es pdf\");\n Image image = new Image(\"/sample/Clases/pdf.png\");\n image_esquema.setImage(image);\n\n }\n else\n {\n File file = new File(txt_ruta.getText());\n javafx.scene.image.Image image = new Image(file.toURI().toString());\n image_esquema.setImage(image);\n }\n\n }\n else{\n System.out.println(\"no se seleccinoó\");\n }\n }", "public void OuvrirAgd() {\n //on charge l'agenda à partir d'un fichier en lecture\n try {\n File agd_a_lire = new File(\"C:\\\\Projet_Agenda_ING3\\\\saved_agendas\");\n Scanner sc = new Scanner(agd_a_lire);\n\n //on lit le fichier ligne par ligne\n /*while (sc.) {\n\n }*/\n\n sc.close();\n } catch (Exception e) {\n System.out.print(\"Erreur d'ouverture du fichier en lecture\\n\");\n }\n }", "private static void obtenirUneListe() throws FileNotFoundException {\n\t\tSystem.out.println(\"\\r\\nPour combien de jours : \");\n\t\tint nbJours = sc.nextInt();\n\n\t\tSystem.out.println(\"\\r\\nCombien de propositions : \");\n\t\tint nbPropositions = sc.nextInt();\n\n\t\tList<List<Recette>> listeProposition = genererListePropositions(nbJours, nbPropositions);\n\n\t\tSystem.out.println(\"\\r\\nChoix ? \");\n\t\tint choix = sc.nextInt();\n\n\t\tgenererFichier(listeProposition.get(choix - 1));\n\n\t\tsc.nextLine();\n\n\t\traz();\n\t}", "@objid (\"116a5759-3df1-4c8b-bd9e-e521507f07e6\")\r\n public String searchFile() {\r\n String nomFichier = this.dialog.open();\r\n if ((nomFichier != null) && (nomFichier.length() != 0)) {\r\n this.currentFile = new File(nomFichier);\r\n this.text.setText(nomFichier);\r\n }\r\n return this.text.getText();\r\n }", "public void arquivo(String nomarq)\r\n {\n }", "public void FermerAgd() {\n //on essaye d'ouvrir un fichier dans lequel enregistrer le contenu de l'agenda\n try {\n Formatter agd_a_enreg = new Formatter(\"C:\\\\Projet_Agenda_ING3\\\\saved_agendas\");\n\n for (RdV el : this.getAgenda()) {\n //on enregistre 1 rdv par ligne\n //faire gaffe aux formats : %..\n agd_a_enreg.format(\"%s/%s/%s de %s a %s : %s , %s\\n\",\n el.getDate().getDayOfMonth(), el.getDate().getMonthValue(),\n el.getDate().getYear(), el.getHdebut(),\n el.getHfin(), el.getLibelle(), el.getRappel());\n //on supprime le rdv de l'arraylist d'agenda \n this.suppressionRdV(el);\n }\n //on ferme le fichier en ecriture\n agd_a_enreg.close();\n //on met l'attribut agenda à null une fois qu'il est \"vidé\"\n this.agd = null;\n } //en cas de probleme dans l'ouverture du fichier on affiche une erreur\n catch (Exception e) {\n System.out.print(\"Erreur d'ouverture du fichier en ecriture\\n\");\n }\n\n }", "private static void info ( File f ) {\n\tString nume = f . getName () ;\n\tif( f.isFile () )\n\tSystem.out.println ( \" Fisier : \" + nume ) ;\n\telse\n\tif( f.isDirectory () )\n\tSystem.out.println ( \" Director : \" + nume ) ;\n\tSystem.out.println (\n\t\" Cale absoluta : \" + f.getAbsolutePath () +\n\t\" \\n Poate citi : \" + f.canRead () +\n\t\" \\n Poate scrie : \" + f.canWrite () +\n\t\" \\n Parinte : \" + f.getParent () +\n\t\" \\n Cale : \" + f.getPath () +\n\t\" \\n Lungime : \" + f.length () +\n\t\" \\n Data ultimei modificari : \" +\n\tnew Date ( f.lastModified () ) ) ;\n\tSystem.out.println ( \" --------------\" ) ;\n\t}", "public void service_psy (Personne p) throws FileNotFoundException\r\n\t{\r\n\t\r\n\t\t\r\n\t\t \t\tString [] info_psy=null ;\r\n\t\t \t\tString [] cle_valeur=null;\r\n\t\t \t\tboolean spec,adr;\r\n\t\t \t\tFileInputStream f=new FileInputStream(\"C://Users/Azaiez Hamed/Desktop/workspace/Projet de programmation/src/Medecin.txt\");\r\n\t\t \t\ttry {\r\n\t\t \t\t\tBufferedReader reader =new BufferedReader (new InputStreamReader(f,\"UTF-8\"));\r\n\t\t \t\t\tString line=reader.readLine();\r\n\t\t \t\t\twhile(line!=null){\r\n\t\t \t\t\t\tinfo_psy=line.split(\"\\t\\t\\t\");\r\n\t\t \t\t\t\tspec=false;adr=false;\r\n\t\t \t\t\t\tfor(int i=0;i<info_psy.length;i++)\r\n\t\t \t\t\t\t{\r\n\t\t \t\t\t\t\t cle_valeur=info_psy[i].split(\":\");\r\n\t\t\t\t\t\t if ((cle_valeur[0].equals(\"specialite\"))&& (cle_valeur[1].equals(\"psy\")))\r\n\t\t\t\t\t\t \t spec=true;\r\n\t\t\t\t\t\t if ((cle_valeur[0].equals(\"gouvernerat\"))&&(cle_valeur[1].equals(p.getGouvernerat())))\r\n\t\t \t\t\t\t\t \tadr=true;\r\n\t\t\t\t\t\t}\r\n\t\t \t\t\t\tif (spec && adr) {\r\n\t\t \t\t\t\t\t System.out.println(\"voilà toutes les informations du psy, veuillez lui contacter immédiatement **\");\r\n\t\t \t\t\t\t\t System.out.println(line);return;}\r\n\t\t \t\t\t\telse\r\n\t\t \t\t\t\t line=reader.readLine();\r\n\t\t \t\t\t\t }\r\n\t\t \t\t }\r\n\t\t \t\t \tcatch(IOException e){e.printStackTrace();}\r\n\t\t \t\t System.out.println(\"Pas de psy trouvé dans votre gouvernerat\");\r\n\t}", "public ifrm_historial() {\n initComponents();\n this.setTitle(\"Historial bitacoraCalculadora.txt\");\n File archivo;\n try{\n final BufferedReader lector = new BufferedReader(new FileReader(\"bitacoraCalculadora.txt\"));\n String line = \"\";\n while ((line = lector.readLine()) != null){\n //txt_mostrar.setText(line);\n txt_mostrar.append(line +\"\\n\");\n }lector.close();\n }catch(FileNotFoundException e){\n e.printStackTrace();\n } catch(IOException e){\n e.printStackTrace();\n }\n }", "private static void letturaFilePerRiga(File file) {\n\t\ttry(FileReader reader = new FileReader(file);\n\t\t\tBufferedReader buffReader = new BufferedReader(reader)) {\n\t\t\tString riga = null;\n\t\t\t\n\t\t\tdo {\n\t\t\t\triga = buffReader.readLine();\n\t\t\t\tSystem.out.println(riga);\n\n\t\t\t} while (riga != null);\n\t\t\twhile(riga != null);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO: handle exception\n\t\t} catch (IOException e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\n\n\t}", "public void salvaPartita(String file) {\n\r\n }", "public void afficherFile() {\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Voici la File (tete a gauche, queue a droite): \");\r\n\t\tSystem.out.println(\"----------------------------------------------\");\r\n\r\n\t\tif (this.estVide() == true) {\r\n\r\n\t\t\tSystem.out.println();\r\n\t\t} else {\r\n\r\n\t\t\tCellule<T> ref = this.tete;\r\n\r\n\t\t\tfor (int i = 1; i <= this.getLongueurFile(); i++) {\r\n\r\n\t\t\t\tSystem.out.print(ref.getValeur() + \" \");\r\n\r\n\t\t\t\tif (ref.getSuivant() != null) {\r\n\r\n\t\t\t\t\tref = ref.getSuivant();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t}", "public void abrirArchivo() {\r\n try {\r\n entrada = new Scanner(new File(\"estudiantes.txt\"));\r\n } // fin de try\r\n catch (FileNotFoundException fileNotFoundException) {\r\n System.err.println(\"Error al abrir el archivo.\");\r\n System.exit(1);\r\n } // fin de catch\r\n }", "private void validateFile(final boolean isRustica) {\n\t\thayErroresFilas = false;\r\n\t\thayErroresFila = false;\r\n\r\n\t\tcampoMasaCorrectos = true;\r\n\t\tcampoHojaCorrecto = true;\r\n\t\tcampoParecelaCorrecto = true;\r\n\t\tcampoTipoCorrecto = true;\r\n\t\tcampoFechaAltaCorrecto = true;\r\n\t\tcampoFechaBajaCorrecto = true;\r\n\r\n\t\tFile currentDirectory = (File) blackboard.get(ImportarUtils_LCGIII.LAST_IMPORT_DIRECTORY);\r\n\r\n\t\tGeopistaFiltroFicheroFilter filter = new GeopistaFiltroFicheroFilter();\r\n\t\tfilter.addExtension(\"SHP\");\r\n filter.setDescription(\"Shapefiles\");\r\n\t\t\r\n final JFileChooser jfc;\r\n final JTextField jtf;\r\n if (isRustica)\r\n {\r\n \tjfc = fcRustica;\t\r\n \tjtf = this.txtFicheroRustica;\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t\tjfc = fcUrbana;\r\n\t\t\tjtf = this.txtFicheroUrbana;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// FILES(*.*)\r\n jfc.setFileFilter(filter);\r\n \tjfc.setAcceptAllFileFilterUsed(false); // QUITA LA OPCION ALL\r\n\t\tjfc.setCurrentDirectory(currentDirectory);\r\n\t\t\r\n\t\tint returnVal = jfc.showOpenDialog(this);\r\n\t\tblackboard.put(ImportarUtils_LCGIII.LAST_IMPORT_DIRECTORY, jfc.getCurrentDirectory());\r\n\r\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION)\r\n\t\t{\r\n\t\t\t// Cargamos el fichero que hemos obtenido\r\n\t\t\tString fichero;\r\n\t\t\tfichero = jfc.getSelectedFile().getPath();\r\n\t\t\tjtf.setText(fichero); // meto el fichero seleccionado\r\n\t\t\t// en el campo\r\n\r\n\t\t\tcadenaTexto = \"<font face=SansSerif size=3>\"\r\n\t\t\t\t+ aplicacion.getI18nString(\"ImportacionComenzar\") + \"<b>\" + \" \"\r\n\t\t\t\t+ jfc.getSelectedFile().getName() + \"</b>\";\r\n\t\t\t\r\n\t\t\tcadenaTexto = cadenaTexto + \"<p>\" + aplicacion.getI18nString(\"OperacionMinutos\") + \" ...</p></font>\";\r\n\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"importar.datos.parcelas\");\r\n\r\n\t\t\tediError.setText(cadenaTexto);\r\n\t\t\tcadenaTexto=\"\";\r\n\r\n\t\t\tfinal TaskMonitorDialog progressDialog = \r\n\t\t\t\tnew TaskMonitorDialog(aplicacion.getMainFrame(), geopistaEditor.getContext().getErrorHandler());\r\n\r\n\t\t\tprogressDialog.setTitle(aplicacion.getI18nString(\"ValidandoDatos\"));\r\n\t\t\tprogressDialog.report(aplicacion.getI18nString(\"ValidandoDatos\"));\r\n\t\t\tprogressDialog.addComponentListener(new ComponentAdapter()\r\n\t\t\t{\r\n\t\t\t\tpublic void componentShown(ComponentEvent e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Wait for the dialog to appear before starting the\r\n\t\t\t\t\t// task. Otherwise\r\n\t\t\t\t\t// the task might possibly finish before the dialog\r\n\t\t\t\t\t// appeared and the\r\n\t\t\t\t\t// dialog would never close. [Jon Aquino]\r\n\t\t\t\t\tnew Thread(new Runnable()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tpublic void run()\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tGeopistaLayer layerParcelas = (GeopistaLayer) blackboard.get(\"capaParcelasInfoReferencia\");\r\n\t\t\t\t\t\t\t\tif (layerParcelas != null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tgeopistaEditor.getLayerManager().remove(layerParcelas);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tlayerParcelas = (GeopistaLayer) geopistaEditor.loadData(\r\n\t\t\t\t\t\t\t\t\t\tjfc.getSelectedFile().getAbsolutePath(),\r\n\t\t\t\t\t\t\t\t\t\taplicacion.getI18nString(\"importar.informe.parcelas\"));\r\n\t\t\t\t\t\t\t\tlayerParcelas.setActiva(false);\r\n\t\t\t\t\t\t\t\tlayerParcelas.addStyle(new BasicStyle(new Color(64, 64,64)));\r\n\t\t\t\t\t\t\t\tlayerParcelas.setVisible(false);\r\n\r\n\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\tblackboard.put(\"capaParcelasInfoReferencia\", layerParcelas);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tblackboard.put(\"capaParcelasInfoReferenciaUrbana\", layerParcelas);\r\n\r\n\t\t\t\t\t\t\t\t// Obtener el esquema\r\n\t\t\t\t\t\t\t\tFeatureSchema esquema = layerParcelas.getFeatureCollectionWrapper().getFeatureSchema();\r\n\r\n\t\t\t\t\t\t\t\t// Localizar los campos\r\n\t\t\t\t\t\t\t\tcampoMasaCorrectos = encontrarCampo(\"MASA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoHojaCorrecto = encontrarCampo(\"HOJA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoParecelaCorrecto = encontrarCampo(\"PARCELA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoTipoCorrecto = encontrarCampo(\"TIPO\",esquema);\r\n\t\t\t\t\t\t\t\tcampoFechaAltaCorrecto = encontrarCampo(\"FECHAALTA\", esquema);\r\n\t\t\t\t\t\t\t\tcampoFechaBajaCorrecto = encontrarCampo(\"FECHABAJA\", esquema);\r\n\r\n\t\t\t\t\t\t\t\tif (campoMasaCorrectos \r\n\t\t\t\t\t\t\t\t\t\t&& campoHojaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoParecelaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoTipoCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoFechaAltaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoFechaBajaCorrecto)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// A partir de aqui hay que\r\n\t\t\t\t\t\t\t\t\t// verificar que no hay nulos y es\r\n\t\t\t\t\t\t\t\t\t// del tipo correcto los valores.\r\n\t\t\t\t\t\t\t\t\tList listaLayer = layerParcelas.getFeatureCollectionWrapper().getFeatures();\r\n\t\t\t\t\t\t\t\t\tIterator itLayer = listaLayer.iterator();\r\n\r\n\t\t\t\t\t\t\t\t\twhile (itLayer.hasNext())\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (hayErroresFila)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tFeature f = (Feature) itLayer.next();\r\n\t\t\t\t\t\t\t\t\t\tString masa = f.getString(\"MASA\");\r\n\t\t\t\t\t\t\t\t\t\tString hoja = f.getString(\"HOJA\");\r\n\t\t\t\t\t\t\t\t\t\tString parcela = f.getString(\"PARCELA\");\r\n\r\n\t\t\t\t\t\t\t\t\t\tString tipo = f.getString(\"TIPO\");\r\n\t\t\t\t\t\t\t\t\t\t// Comprobamos que no sea nulo y\r\n\t\t\t\t\t\t\t\t\t\t// sea una U o una R\r\n\t\t\t\t\t\t\t\t\t\tif ((!tipo.equals(\"U\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"R\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"D\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"X\")))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// Solo puede haber una R \r\n\t\t\t\t\t\t\t\t\t\t\t// una U una D o una X.\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.rustico\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\telse if (!isRustica && (tipo.equals(\"R\") || tipo.equals(\"D\") || tipo.equals(\"X\")))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.urbana\") + \r\n\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse if (isRustica && tipo.equals(\"U\"))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.rustica\") + \r\n\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que la fecha\r\n\t\t\t\t\t\t\t\t\t\t\t// que viene sea fecha\r\n\t\t\t\t\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tDate date = (Date) formatter.parse(f.getString(\"FECHAALTA\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que la\r\n\t\t\t\t\t\t\t\t\t\t\t\t// fecha de baja es nula\r\n\t\t\t\t\t\t\t\t\t\t\t\t// o valida o 9999999\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (f.getString(\"FECHABAJA\").equals(\"99999999\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Correcto\r\n\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ((f.getString(\"FECHABAJA\")) == null)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que sea una fecha correcta\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDateFormat formatter1 = new SimpleDateFormat(\"yyyyMMdd\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate date1 = (Date) formatter1.parse(f.getString(\"FECHABAJA\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcatch (Exception excp)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texcp.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fecha.baja\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t//jtf.setBorder(BorderFactory.createLineBorder(Color.GREEN, 2));\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\trusticaValida = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\turbanaValida = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\tcatch (Exception exc)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t// En la fecha de alta\r\n\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fecha.alta.validacion\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\t\texc.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//Se comprueba si la geometría es de tipo polygon y no es empty (únicas válidas en la capa parcelas)\r\n\t\t\t\t\t\t\t\t\t\t\tif (!(f.getGeometry() instanceof Polygon)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| f.getGeometry().isEmpty())\r\n\t\t\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.geometria\") + \r\n\t\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// Alguno de los campos no están\r\n\t\t\t\t\t\t\t\t\t// definidos\r\n\t\t\t\t\t\t\t\t\t// JOptionPane.showMessageDialog(this,aplicacion.getI18nString(\"importar.informe.parcelas.algun.campo\"));\r\n\t\t\t\t\t\t\t\t\tcadenaTexto += aplicacion.getI18nString(\"importar.informacion.ficheros.no.correctos\");\r\n\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\t\trusticaValida = false;\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\turbanaValida = false;\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tcatch (Exception e)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tfinally\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tprogressDialog.setVisible(false);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}).start();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tGUIUtil.centreOnWindow(progressDialog);\r\n\t\t\tprogressDialog.setVisible(true);\r\n\r\n\t\t\tif (hayErroresFilas)\r\n\t\t\t{\r\n\t\t\t\tjtf.setBorder(BorderFactory.createLineBorder(Color.RED, 2));\r\n\t\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"validacion.finalizada\");\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tjtf.setBorder(BorderFactory.createLineBorder(Color.GREEN, 2));\r\n\t\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"importar.informe.parcelas.fichero.correcto\")\r\n\t\t\t\t+ aplicacion.getI18nString(\"validacion.finalizada\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tediError.setText(cadenaTexto);\r\n\t\t\twizardContext.inputChanged();\r\n\t\t}\r\n\r\n\t}", "public static void readMetro(String ligne){\n file=ligne;\n try{\n Metro.readGraph();\n }\n catch (FileNotFoundException e){\n System.out.println(\"It's not the file you're looking for.\");\n }\n ;\n }", "public void restaurarPartida() throws FileNotFoundException, IOException, ClassNotFoundException {\n\t\tjuego.restaurarPartida(jugador.getID());\t\r\n\t}", "public static void otvoriFajl() {\r\n\t\tJFileChooser fc = new JFileChooser();\r\n\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"Gym files\", \"gym\");\r\n\r\n\t\tfc.setFileFilter(filter);\r\n\t\tfc.setCurrentDirectory(new File(\".\"));\r\n\t\tint izbor = fc.showOpenDialog(teretanaGui.getContentPane());\r\n\r\n\t\tif (izbor == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tFile f = fc.getSelectedFile();\r\n\r\n\t\t\tString fileName = f.getAbsolutePath();\r\n\r\n\t\t\tpath = fileName;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tlistaClanova.ucitajIzFajla(fileName);\r\n\t\t\t\tpopuniTabelu();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(teretanaGui.getContentPane(), \"Greska pri ucitavanju clanova!\", \"Greska\",\r\n\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public void loadShow(File f) {\n \n }", "public void seleccionarArchivo(){\n JFileChooser j= new JFileChooser();\r\n FileNameExtensionFilter fi= new FileNameExtensionFilter(\"pdf\",\"pdf\");\r\n j.setFileFilter(fi);\r\n int se = j.showOpenDialog(this);\r\n if(se==0){\r\n this.txtCurriculum.setText(\"\"+j.getSelectedFile().getName());\r\n ruta_archivo=j.getSelectedFile().getAbsolutePath();\r\n }else{}\r\n }", "private void jButtonCreateInsexActionPerformed(java.awt.event.ActionEvent evt) {\n try {\n lstPerson = new ArrayList();\n Properties prop = new Properties();//почти тоже самое что ini файлы\n content = Files.readAllLines(Paths.get(PATH_FILE_SOURCE), Charset.forName(\"cp1251\"));\n String s = content.get(0);\n for (int i = 0, j = 1; i < s.length(); i += 128, j++) {\n Person p = new Person(\n s.substring(i, i + 30).trim(),\n s.substring(i + 30, i + 50).trim(),\n s.substring(i + 50, i + 70).trim(),\n s.substring(i + 70, i + 78).trim(),\n s.substring(i + 78).trim(), j);\n lstPerson.add(p);\n }\n\n for (Person person : lstPerson) {\n prop.put(person.getSurname().toUpperCase(), Integer.toString(person.getID()));\n }\n prop.storeToXML(new FileOutputStream(FILE_PATH_INDEX_SURNAME), \"LIB\");//можно и без xml\n jLabelStatusBar.setForeground(Color.magenta);\n jLabelStatusBar.setText(\"Индексный файл создан!\");\n jLabelStatusBar.setForeground(Color.BLACK);\n\n } catch (IOException ex) {\n jLabelStatusBar.setForeground(Color.red);\n jLabelStatusBar.setText(\"Индексный файл не создан!\");\n Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void leerFichero(String rutaFichero) {\r\n\t\t\ttry {\r\n\t\t\t\tBufferedReader fichero;\r\n\t\t\t\tfichero = new BufferedReader(new FileReader(rutaFichero));\r\n\t\t\t\tString registro;\r\n\t\t\t\twhile ((registro = fichero.readLine()) != null) {\r\n\t\t\t\t\tSystem.out.println(registro);\r\n\r\n\t\t\t\t\t// ................\r\n\r\n\t\t\t\t}\r\n\t\t\t\tfichero.close();\r\n\t\t\t\tSystem.out.println(\"Fin de la lectura del fichero\");\r\n\r\n\t\t\t} catch (FileNotFoundException excepcion) {\r\n\t\t\t\tSystem.out.println(\"fichero no encontrado\");\r\n\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"IO Excepcion\");\r\n\t\t\t}\r\n\t\t}", "public void KvtTartListFrissit( String sKonyvtar)\r\n {\n File cAktKvt = null ;\r\n Object aKvtTartalma[] = null ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit( \" + sKonyvtar + \")\") ;\r\n\r\n// cAktKvt = new File( \".\") ;\r\n// cAktKvt = new File( \"/home/tamas/java/Polar/hrmfiles\") ;\r\n cAktKvt = new File( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit cAktKvt = new File() utan\") ;\r\n\r\n // Az aktualis konyvtar teljes utvonalanak beirasa\r\n// Itt nyeli le a vegerol a \\-t vagy /-t :\r\n// m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) ; // getAbsolutePath()\r\n m_jKonyvtarTxtFld.setText( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) utan\") ;\r\n if ( cAktKvt != null && cAktKvt.isDirectory() == true )\r\n {\r\n aKvtTartalma = HRMFileSzuro( cAktKvt) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : HRMFileSzuro() utan\") ;\r\n\r\n if ( aKvtTartalma != null )\r\n {\r\n/*\r\nfor ( int i=0 ; i < aKvtTartalma.length ; i++ )\r\n{\r\nSystem.out.println( \"JFileValasztDlg.KvtTartListFrissit() : cKvtrkFileok[\" + i + \"]=\" + aKvtTartalma[i].toString()) ;\r\n}\r\n*/\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : .setListData() utan\") ;\r\n\r\n // Itt mar valoszinu, hogy a ListBox a konyvtar file-jait tartalmazza +++\r\n SetAktKonyvtar( sKonyvtar) ;\r\n\r\n m_jKvtTartList.setSelectedIndex( 0) ;\r\n \r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : SetAktKonyvtar() utan\") ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : setListData\") ;\r\n/*\r\n for ( nIdx = 0 ; nIdx < aKvtTartalma.length ; nIdx++ )\r\n {\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n }\r\n*/\r\n }\r\n }\r\n }", "public AppGenALexicos(File f) {\n initComponents();\n String cadena = \"\";\n try {\n FileReader fr = new FileReader(f);\n try (BufferedReader br = new BufferedReader(fr)) {\n while ((cadena = br.readLine()) != null) {\n jTextArea1.append(cadena + \"\\n\");\n }\n }\n } catch (FileNotFoundException ex) {\n Logger.getLogger(AppCompiladores.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(AppCompiladores.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void cargarFichero() throws FileNotFoundException {\n\t\tFile miFichero = new File(NOMBRE_FICHERO);\n\t\tFileWriter erroresFichero;\n\t\t\n\t\tScanner in = new Scanner(miFichero);\n\t\t\n\t\tEjercicio nuevoEjer;\n\t\tString siguienteLinea;\n\t\tComprobadorEntradaFichero comprobador = new ComprobadorEntradaFichero();\n\t\tString errores = \"\";\n\t\tint numLinea = 1;\n\t\t\n\t\twhile (in.hasNextLine()) {\n\t\t\t\n\t\t\tsiguienteLinea = in.nextLine();\n\t\t\tif (comprobador.test(siguienteLinea)) {\n\t\t\t\tnuevoEjer = new Ejercicio(siguienteLinea);\n\t\t\t\tcoleccionEj.addEjercicio(nuevoEjer);\n\t\t\t} else {\n\t\t\t\t//Controlar cuántos errores va dando\n\t\t\t\terrores += \"Error en la línea: \" + String.valueOf(numLinea) + \". Datos: \" + siguienteLinea + \"\\n\";\n\t\t\t}\n\t\t\tnumLinea++;\n\t\t}\n\t\t\n\t\tin.close();\n\t\t\n\t\t\n\t\t//Ahora escribimos \n\t\tif (errores != \"\") {\n\t\t\ttry {\n\t\t\t erroresFichero = new FileWriter(NOMBRE_FICHERO_ERRORES);\n\t\t\n\t\t\t erroresFichero.write(errores);\n\n\t\t\t erroresFichero.close();\n\n\t\t\t} catch (Exception ex) {\n\t\t\t\tSystem.out.println(\"Mensaje de la excepción: \" + ex.getMessage());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void instalarTipoLetra()\r\n\t{\r\n\t\ttry\r\n { \r\n FileInputStream fIn = new FileInputStream(\"./images/dandelion in the spring.ttf\");\r\n FileOutputStream fOut = new FileOutputStream(\"C:/windows/fonts/dandelion in the spring.ttf\");\r\n \r\n FileChannel fIChan = fIn.getChannel();\r\n FileChannel fOChan = fOut.getChannel();\r\n \r\n long fSize = fIChan.size();\r\n \r\n MappedByteBuffer mBuf = \r\n fIChan.map(FileChannel.MapMode.READ_ONLY, 0, fSize); \r\n fOChan.write(mBuf);//con esto copiamos el archivo\r\n \r\n //nunca olvidemos cerrar los archivos\r\n fIChan.close();\r\n fIn.close();\r\n fOChan.close();\r\n fOut.close();\r\n JOptionPane.showMessageDialog(this,\"El tipo de letra ha sido instalada en el sistema operativo.\",\"Instalar Tipo Letra\", JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n JOptionPane.showMessageDialog(this,\"Cierre el Sistema Experto - SESP y vuelva a iniciar el ejecutable.\",\"Instalar Tipo Letra\", JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n }\r\n catch(Exception ef)\r\n {\r\n \tJOptionPane.showMessageDialog(this,\"Error al instalar el tipo de letra dandelion in the spring en el sistema operativo\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n \tJOptionPane.showMessageDialog(this,\"Intente instalar manualmente el archivo (dandelion in the spring.ttf) que esta en la carpeta images o intente\"+\"\\n\"+\" copiar manualmente el archivo (dandelion in the spring.ttf) en el directorio C:/windows/fonts\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n \t}\r\n\t}", "private static void showFiles(File f) {\n\t\n}", "public void importaRegole(String file, ArrayList<Sensore> listaSensori, ArrayList<Attuatore> listaAttuatori) {\n ArrayList<String> nomiDispPres = new ArrayList<>();\n\n for (Sensore s : listaSensori) {\n nomiDispPres.add(s.getNome());\n }\n\n for (Attuatore att : listaAttuatori) {\n nomiDispPres.add(att.getNome());\n }\n\n String regoleImport = readFromFile(file);\n\n if (regoleImport.equals(\"\")) {\n System.out.println(\"XX Errore di lettura file. Non sono state inserite regole per l'unita immobiliare XX\\n\");\n return;\n }\n\n String[] regole = regoleImport.split(\"\\n\");\n\n for (String r : regole) {\n try {\n ArrayList<String> dispTrovati = verificaCompRegola(r);\n\n for (String nomeDis : dispTrovati) {\n if (nomeDis.contains(\".\")){\n String nomeS = nomeDis.split(\"\\\\.\")[0];\n\n if (!nomiDispPres.contains(nomeS)) {\n throw new Exception(\"XX Dispositivi Incompatibili all'interno della regola XX\\n\");\n }\n\n Sensore s = listaSensori.stream().filter(sensore -> sensore.getNome().equals(nomeS)).iterator().next();\n String nomeInfo = nomeDis.split(\"\\\\.\")[1];\n\n if (s.getInformazione(nomeInfo) == null)\n throw new Exception(\"XX Regola non compatibile XX\\n\");\n\n\n } else if (!nomiDispPres.contains(nomeDis)) {\n throw new Exception(\"XX Dispositivi Incompatibili all'interno della regola XX\\n\");\n\n }\n }\n System.out.println(\"*** Importazione della regola avvenuta con successo ***\\n\");\n writeRuleToFile(r, true);\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n\n }\n eliminaDoppie(listaSensori,listaAttuatori);\n }", "void load_from_file(){\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a file\", FileDialog.LOAD);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"load path: \" + file_withpath);\t\n\t\t\n\t\t\t \n\t\t\t /**\n\t\t\t * read object from file \n\t\t\t */\n\t\t\t\ttry {\n\t\t\t\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(file_withpath));\n\n\t\t\t\t\tKey_Lists = Key_Lists.copy((key_lists) in.readObject());\n\n\t\t\t\t\tkeys_area.setText(Key_Lists.arraylist_tostring());\t\t\n\t\t\t\t\t\n\t\t\t\t\tin.close();\n\t\t\t\t\t\n\t\t\t\t\tinfo_label.setForeground(green);\n\t\t\t\t\tinfo_label.setText(\"file loaded :D\");\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tinfo_label.setForeground(white);\n\t\t\t\t\tinfo_label.setText(\"wrong file format\");\n\t\t\t\t\tSystem.out.println(\"io exception\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\n\t}", "public FrmFerramentas() throws IOException {\n initComponents();\n SelecionaLocal();\n //PreencheLook();\n }", "public void leerDeFichero() {\n try\n {\n Scanner sc = new Scanner(new File(\"texto.txt\"));\n while (sc.hasNextLine() && !textoCompleto())\n addFrase(sc.nextLine());\n sc.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n File myFile = new File (\"d:/names.txt\");\r\n // para saber si el archivo no existe, devuelve true o false\r\n System.out.println(\"file.exists(): \" + myFile.exists());\r\n System.out.println(\"file.isDirectory(): \" + myFile.isDirectory());\r\n // para saber la fecha de modificación\r\n System.out.println(\"file.lastModified(): \" + myFile.lastModified());\r\n // para saber el nombre del archivo\r\n System.out.println(\"file.getName(): \" + myFile.getName());\r\n // para saber la ruta\r\n System.out.println(\"file.getPath(): \" + myFile.getPath());\r\n // para saber el tamaño en bytes que ocupa en disco\r\n System.out.println(\"file.length(): \" + myFile.length()+\" bytes\");\r\n // para saber si es de lectura, devuelve true o false\r\n System.out.println(\"file.canRead():\" + myFile.canRead());\r\n\r\n //File newfolder = new File(\"D:/carpeta con archivos año mío\");\r\n //System.out.println(newfolder.mkdir());\r\n\r\n // si fuera un directorio, para saber los archivos que contiene\r\n File carpeta = new File(\"D:/carpeta_con_archivos\");\r\n System.out.println(\"----listado archivos D:/carpeta_archivos------\");\r\n for (String archivo : carpeta.list()) {\r\n System.out.println(archivo);\r\n }\r\n\r\n //agregar una linea nueva a un archivo existente (METODO 1)\r\n /*try {\r\n //abra el archivo , TRUE en un forma append (agregar nuevos valores)\r\n FileWriter myFile2 = new FileWriter(\"d:/names.txt\", true);\r\n //cargar en memora ram del SO el contenido del archivo\r\n BufferedWriter dataFile = new BufferedWriter(myFile2);\r\n //agregar una nueva linea\r\n dataFile.write(\"\\nnueva linea tres\");\r\n dataFile.close();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }*/\r\n //agregar una linea nueva a un archivo existente (METODO 1 optimizado)\r\n /*try{\r\n BufferedWriter dataFile = new BufferedWriter(new FileWriter(\"d:/names.txt\",true));\r\n //agregamos la nueva linea\r\n dataFile.write(\"nueva linea sin borrar\");\r\n dataFile.close();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }*/\r\n // agregar nueva linea con metodo super optimizado en lineas (METODO FLAHS)\r\n try{\r\n PrintWriter myFile3 = new PrintWriter(new BufferedWriter(new FileWriter(\"d:/names.txt\", true)));\r\n myFile3.println(\"Otra nueva línea mezclando las dos librerías (PrintWriter + FileWriter) \");\r\n myFile3.close();\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n\r\n }", "public void Leer() throws FileNotFoundException\n {\n // se crea una nueva ruta en donde se va a ir a leer el archivo\n String ruta = new File(\"datos.txt\").getAbsolutePath(); \n archivo=new File(ruta); \n }", "public static void LeerCaracter(File rutaLeer, File rutaEscribir) throws IOException {\n\n FileReader lector = new FileReader(rutaLeer);\n FileWriter escritor = new FileWriter(rutaEscribir);\n\n String cartelera = (\"--------------------------------------\\n\"\n + \" Cartelera de CineFBMoll\\n\"\n + \"--------------------------------------\\n\\n\");\n\n String linea = \"--------------------------------------\\n\\n\";\n\n //se escribe la cartelera\n for (int i = 0; i < cartelera.length(); i++) {\n escritor.write(cartelera.charAt(i));\n }\n\n int caracter;\n int contador = 0;\n boolean encontrarSigno = true;\n\n while ((caracter = lector.read()) != -1) {\n if (((char) caracter) != '#') {\n if (((char) caracter) != '{') {\n if (encontrarSigno) {\n for (int i = 0; i < datos[contador].length(); i++) {\n escritor.write(datos[contador].charAt(i)); // imprimir elemento de datos\n }\n escritor.write(\": \");\n encontrarSigno = false;\n }\n escritor.write(((char) caracter));\n } else {\n escritor.write(\"\\n\");\n escritor.write(\"\\n\");\n for (int i = 0; i < linea.length(); i++) {\n escritor.write(linea.charAt(i));\n }\n\n contador = 0;\n encontrarSigno = true;\n }\n } else {\n escritor.write(\"\\n\");\n escritor.write(\"\\n\");\n contador++;\n encontrarSigno = true;\n }\n }//while\n lector.close();// Cierra el archivo \n escritor.close();// Cierra el archivo \n\n }", "private void dialogFichierInexistant(File file){\n\t\tJOptionPane.showMessageDialog(null, \"le fichier \" + file.getName() +\"\\n'existe pas\", \"Erreur\", JOptionPane.ERROR_MESSAGE);\n\t}", "public void lesBok(String filen)throws Exception\n {\n liste.add(new Ord(\"null\"));//se siste linje i finnOrd-metod\n Scanner inn = new Scanner(new File(filen));//henter ord fra filen anngitt i kallet paa metode lesBok og legger det inn i scanner inn\n while (inn.hasNextLine())\n {\n String tempOrd = inn.nextLine();\n leggeTilOrd(tempOrd);//sender ord fra scanner via string til metode legeTilOrd\n }\n }", "private void guardarComo() {\r\n\t\tJFileChooser guardar = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tguardar.setFileFilter(filtro);\r\n\t\tif(guardar.showSaveDialog(guardar) == JFileChooser.APPROVE_OPTION){\r\n\t\t\tGestion.setFichero(Gestion.extensionValida(guardar.getSelectedFile()));\r\n\t\t\ttry {\r\n\t\t\t\tif(!Gestion.existe(Gestion.getFichero())){\r\n\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tswitch(JOptionPane.showConfirmDialog(null, \"El archivo existe. Desea sobreescribirlo?\", \"Aviso\", JOptionPane.WARNING_MESSAGE)){\r\n\t\t\t\t\tcase JOptionPane.OK_OPTION:\r\n\t\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void pruebaEscritura() {\n\t\tFileWriter fichero = null;\n\t\tPrintWriter pw = null;\n\t\ttry {\n\t\t\tfichero = new FileWriter(\"//172.16.1.141/Modelo_Raster/Varios/Monitoreo_Forestal/REDD/Metadatos/test.xml\");\n\t\t\tpw = new PrintWriter(fichero);\n\n\t\t\tfor (int i = 0; i < 10; i++)\n\t\t\t\tpw.println(\"Linea \" + i);\n\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\t// Nuevamente aprovechamos el finally para\n\t\t\t\t// asegurarnos que se cierra el fichero.\n\t\t\t\tif (null != fichero) fichero.close();\n\t\t\t}\n\t\t\tcatch (Exception e2) {\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public String ouvrir(){\n \n JTextArea text=new JTextArea();\n FileNameExtensionFilter filter = new FileNameExtensionFilter (\n \"java\", \"java\");\n chooser.setFileFilter(filter);\n \n int ret=chooser.showOpenDialog(text);\n String path=\"\";\n if(ret==JFileChooser.APPROVE_OPTION){\n path=chooser.getSelectedFile().getAbsolutePath();\n }\n\n return path;\n }", "private String setFichero(enumFicheros fichero)\n\t{\n\t\tswitch(fichero)\n\t\t{\n\t\tcase FICHERO_INFO_RANURA1:\n\t\t{\n\t\t\treturn fichero_info_ranura1;\n\t\t}\n\t\tcase FICHERO_INFO_RANURA2:\n\t\t{\n\t\t\treturn fichero_info_ranura2;\n\t\t}\n\t\tcase FICHERO_INFO_RANURA3:\n\t\t{\n\t\t\treturn fichero_info_ranura3;\n\t\t}\n\t\tcase FICHERO_PJ_RANURA1:\n\t\t{\n\t\t\treturn fichero_pj_ranura1;\n\t\t}\n\t\tcase FICHERO_PJ_RANURA2:\n\t\t{\n\t\t\treturn fichero_pj_ranura2;\n\t\t}\n\t\tcase FICHERO_PJ_RANURA3:\n\t\t{\n\t\t\treturn fichero_pj_ranura3;\n\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public void xuLyLuuHoaHoaDon(){\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getAbsolutePath().endsWith(\".txt\");\n }\n\n @Override\n public String getDescription() {\n return \".txt\";\n }\n });\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getAbsolutePath().endsWith(\".doc\");\n }\n\n @Override\n public String getDescription() {\n return \".doc\";\n }\n });\n int flag = fileChooser.showSaveDialog(null);\n if(flag == JFileChooser.APPROVE_OPTION){\n File file = fileChooser.getSelectedFile();\n try {\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file), Charset.forName(\"UTF-8\"));\n PrintWriter printWriter = new PrintWriter(outputStreamWriter);\n String lineTieuDe1 = \"----------------Phiếu Thanh Toán-----------------------\";\n String lineMaPTT = \"+Mã Phiếu Thanh Toán: \" + txtMaPTT.getText();\n String lineMaPDK = \"+Mã Phiếu Đăng Ký: \" + cbbMaPDK.getSelectedItem().toString();\n String lineSoThang = \"+Số Tháng: \" + txtSoThang.getText()+\"|\";\n String lineNgayTT = \"+Ngày Thanh Toán: \" + txtNgayTT.getText();\n String lineTienPhong = \"+Tiền Phòng: \" + txtTongTien.getText();\n String lineTienDV = \"+Tiền Dịch Vụ: \"+txtThanhToanTongCong.getText();\n String lineTieuDe2 = \"--------------------------------------------------------\";\n String lineTienPhaiTra =\"+Tiền Phải Trả: \" + txtTienPhaiTra.getText()+\" \";\n String lineTieuDe3 = \"--------------------------------------------------------\";\n \n printWriter.println(lineTieuDe1);\n printWriter.println(lineMaPTT);\n printWriter.println(lineMaPDK);\n printWriter.println(lineSoThang);\n printWriter.println(lineNgayTT);\n printWriter.println(lineTienPhong);\n printWriter.println(lineTienDV);\n printWriter.println(lineTieuDe2);\n printWriter.println(lineTienPhaiTra);\n printWriter.println(lineTieuDe3);\n \n printWriter.close();\n outputStreamWriter.close();\n \n } catch (Exception e) {\n e.printStackTrace();\n }\n JOptionPane.showMessageDialog(null, \"Đã lưu\");\n }\n \n }", "public void readFromFile() {\n\n\t}", "private void jMenuItem_ShowProspectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_ShowProspectActionPerformed\n File fProspect = new File(\"Propsect_Relance.csv\");\n try {\n Desktop.getDesktop().open(fProspect);\n } catch (IOException ex) {\n Logger.getLogger(JFrame_Accueil.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void grabarGrafoColoreado(String archivo) {\n\t\tPrintWriter salida = null;\n\t\ttry {\n\n\t\t\tsalida = new PrintWriter(new FileWriter(archivo));\n\t\t\tsalida.println(cantNodos + \" \" + cantColores);\n\n\t\t\tfor (int i = 0; i < cantNodos; i++)\n\t\t\t\tsalida.println(nodos.get(i).getNumero() + \" \" + nodos.get(i).getColor());\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsalida.close();\n\t\t}\n\t}", "public static void main(String[] args) {\n\r\n String contenido = \"\";\r\n\r\n try {\r\n FileReader in = new FileReader(\"./src/fichero_prueba.txt\");\r\n int c = in.read();\r\n\r\n while (c != -1) {\r\n contenido += (char) c;\r\n c = in.read();\r\n }\r\n in.close();\r\n } catch (IOException e){\r\n System.out.println(e.getMessage());\r\n }\r\n\r\n System.out.println(contenido);\r\n\r\n\r\n //LEER MENSAJE POR BLOQUES\r\n\r\n String contenido2 = \"\";\r\n\r\n try {\r\n BufferedReader inb = new BufferedReader(new FileReader(\"./src/fichero_prueba.txt\"));\r\n\r\n String linea = inb.readLine();\r\n while (linea!=null){\r\n contenido2 += linea+\"\\n\";\r\n linea = inb.readLine();\r\n }\r\n inb.close();\r\n } catch (IOException e){\r\n e.printStackTrace();\r\n }\r\n System.out.println(contenido2);\r\n\r\n }", "private void openFile() {\n\t\t\n\t\n\t\t\t\n\t\tFile file = jfc.getSelectedFile();\n\t\tint a = -1;\n\t\tif(file==null&&!jta.getText().equals(\"\"))\n\t\t{\n\t\t\ta = JOptionPane.showConfirmDialog(this, \"저장?\");\n\t\t\n\t\t}\n\t\tswitch (a){\n\t\tcase 0:\n\t\t\ttry {\n\t\t\t\tint c = -1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tc = jfc.showSaveDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || c ==0)\n\t\t\t\t{\t\n\t\t\t\t\tFileWriter fw = new FileWriter(jfc.getSelectedFile());\n\t\t\t\t\tfw.write(jta.getText());\n\t\t\t\t\tfw.close();\n\t\t\t\t\tSystem.out.println(\"파일을 저장하였습니다\");\n\t\t\t\t}\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\tbreak;\n\t\tcase 1:\n\t\t\ttry {\n\t\t\t\tint j=-1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tj = jfc.showOpenDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || j == 1)\n\t\t\t\t{\t\n\t\t\t\t\tFileReader fr = new FileReader(file);\n\n\t\t\t\t\tString str=\"\";\n\t\t\t\t\twhile((j=fr.read())!=-1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr = str+(char)j;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tjta.setText(str);\n\t\t\t\t\t\n\t\t\t\t\tsetTitle(file.getName());\n\t\t\t\t\t\n\t\t\t\t\tfr.close();\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tcatch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tint d= jfc.showOpenDialog(this);\n\t\t\n\t\tif(d==0)\n\t\t\ttry {\n\t\t\t\tFileReader fr = new FileReader(jfc.getSelectedFile());\n\t\t\t\tint l;\n\t\t\t\tString str=\"\";\n\t\t\t\twhile((l=fr.read())!=-1)\n\t\t\t\t{\n\t\t\t\t\tstr = str+(char)l;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tjta.setText(str);\n\t\t\t\t\n\t\t\t\tfr.close();\n\t\n\t\t\t\t\t\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t}", "final public void GuardarCuadruplos() throws ParseException {\ntry {\n // Crea un cuadro de dialogo. El input se guarda en strNomArchivo\n String strNomArchivo = \"\";\n\n // Si el campo quedo vacío o se cerró la ventana, volver a mostrarlo\n while (strNomArchivo==null || strNomArchivo.trim().isEmpty()) {\n strNomArchivo = (String)JOptionPane.showInputDialog(\n null, \"Escribe el nombre que tendra el archivo\", \"Input\", JOptionPane.PLAIN_MESSAGE, null, null, null);\n }\n\n // objeto printwriter con el nombre del archivo\n PrintWriter codigoObj = new PrintWriter(strNomArchivo);\n\n // Agrega uno por uno los cuadruplos al archivo\n for (int i=0; i < cuadruplos.size(); i++) {\n codigoObj.println( Cuadruplo.returnCuadruplo( (Cuadruplo)cuadruplos.get(i) ) );\n }\n\n // cierra el archivo\n codigoObj.close();\n\n } catch(FileNotFoundException e) {\n System.out.println(e.getMessage());\n }\n }", "public void LoadTxt(File Arquivo) {\n if (Arquivo.exists()) {\r\n\r\n try {\r\n\r\n FileReader FR = new FileReader(Arquivo);\r\n BufferedReader BW = new BufferedReader(new InputStreamReader(new FileInputStream(Arquivo.getAbsolutePath()), \"ISO-8859-1\"));\r\n\r\n //BufferedReader BW = new BufferedReader(FR);\r\n\r\n String dados;\r\n String[] paraArray = new String[3];\r\n String matricula;\r\n \r\n String serie = Arquivo.getName();\r\n int pos = serie.lastIndexOf(\".\");\r\n if (pos > 0) {\r\n serie = serie.substring(0, pos);\r\n }\r\n\r\n Sala novaSala = new Sala(serie); //CRIANDO SALA COM NOME DE TURMA\r\n salas2.add(novaSala); // ADICIONANDO SALA NA LISTA DE SALAS\r\n while ((dados = BW.readLine()) != null) {\r\n paraArray = dados.split(\";\");\r\n\r\n matricula = /*Integer.parseInt*/ (paraArray[0]);\r\n //senha = /*Integer.parseInt*/(paraArray[2]);\r\n Dados novoDado = new Dados(matricula, paraArray[1], paraArray[2]);\r\n\r\n novoDado.setSerie(serie); //ADICIONANDO TURMA AO DADO\r\n novaSala.getDadosalas().add(novoDado); //ADICIONANDO DADOS A LISTA DE DADOS QUE ESTA EM SALA\r\n\r\n }\r\n \r\n\r\n BW.close();\r\n FR.close();\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Erro ao carregar arquivo acima\");\r\n System.out.println(e.getMessage());\r\n\r\n }\r\n\r\n } else {\r\n System.out.println(\"Nenhum arquivo de dados encontrado\");\r\n }\r\n\r\n }", "public void escribir(String direccion,String texto) {\n try {\n FileWriter writer = new FileWriter(direccion);\n PrintWriter print = new PrintWriter(writer);\n print.print(texto);\n writer.close();\n } catch (IOException e) {\n System.out.println(e.getMessage());\n }\n }", "private static void createFileContribuicaoUmidade() throws IOException{\r\n\t\tInteger contribuicaoDefault = 0;\r\n\t\tarqContribuicaoUmidade = new File(pathContribuicaoUmidade);\r\n\t\tif(!arqContribuicaoUmidade.exists()) {\r\n\t\t\tarqContribuicaoUmidade.createNewFile();\r\n\t\t\tFileWriter fw = new FileWriter(getArqContribuicaoUmidade());\r\n\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));\r\n\t\t\tbuffWrite.close();\r\n\t\t}else {//Se arquivo existir\r\n\t\t\tFileReader fr = new FileReader(getArqContribuicaoUmidade());\r\n\t\t\tBufferedReader buffRead = new BufferedReader(fr);\r\n\t\t\tif(!buffRead.ready()) {/*Se o arquivo se encontar criado mas estiver vazio(modificado)*/\r\n\t\t\t\tFileWriter fw = new FileWriter(arqContribuicaoUmidade);\r\n\t\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma contribuicao Inicial*/\r\n\t\t\t\tbuffWrite.close();\r\n\t\t\t}\r\n\t\t\tbuffRead.close();\r\n\t\t}\r\n\t}", "public static void processOneFileSelecction()\n {\n int answer = JSoundsMainWindowViewController.jfcOneFile.showOpenDialog(JSoundsMainWindowViewController.jSoundsMainWindow);\n \n if (answer == JFileChooser.APPROVE_OPTION)\n {\n File actualDirectory = JSoundsMainWindowViewController.jfcOneFile.getCurrentDirectory();\n String directory = actualDirectory.getAbsolutePath() + \"/\" + JSoundsMainWindowViewController.jfcOneFile.getSelectedFile().getName();\n UtilFunctions.listOneFile(JSoundsMainWindowViewController.jfcOneFile.getSelectedFile());\n JSoundsMainWindowViewController.orderBy(true, false, false); \n }\n }", "public static void main(String[] args) {\n\r\n String cFields = \"NIC,SIMBOLO_VARIABLE,FECHA_VENCIMIENTO,FECHA_PAGO_OPORTUNO,FECHA_EMISION,NUMERO_FACTURA,INDICATIVO_SUMINISTRO,CIIU,TIPO_COBRO,SECUENCIAL_RECIBO,NIS,TIPO_SERVICIO,ORDEN_LECTURA,MEDIDOR,LECT_ANTERIOR,LECT_ACTUAL,FECHA_LECTURA_ACTUAL,CONSUMO_FACTURADO,VALOR_FACTURA,GRUPO_FAMILIAR,PRECIO_UNITARIO_CU,IND_VISUSALIZACION_BARCODI,IMPORTE_TOTAL_DEUDA,CANTIDAD_FACTURAS_ADEUDADAS,DESC_ANOMALIA_LECTURA,IMPORTE_TOTAL_FACTURA,SUBTOTAL_FACTURA,DESCRIPCION_TARIFA,CONSUMO_PROMEDIO,DIAS_FACTURADOS,CLAVE_ORDEN_FACTURA,PROPIEDAD_EQUIPO_MEDIDA,UNICOM,RUTA,ITINERARIO\";\r\n fields = cFields.split(\",\");\r\n\r\n readConfiguracion();\r\n\r\n if (configuracion.size() != fields.length) {\r\n System.out.println(\"Longitud de campos y configuración es diferente. Fields: \" + fields.length + \" Configuracion: \" + configuracion.size());\r\n Utilidades.AgregarLog(\"Longitud de campos y configuración es diferente. Fields: \" + fields.length + \" Configuracion: \" + configuracion.size());\r\n return;\r\n }\r\n\r\n if (configuracion.size() > 0) {\r\n System.out.println(\"Campos a leer: \" + configuracion.size());\r\n Utilidades.AgregarLog(\"Campos a leer: \" + configuracion.size());\r\n String ruta = \"C:\\\\REPARTO\\\\\";\r\n File directorio = new File(ruta);\r\n Utilidades.AgregarLog(\"Descomprimiendo archivos ruta:\" + ruta);\r\n DescomprimirArchivosCarpeta(directorio);\r\n Utilidades.AgregarLog(\"Procesando archivos de reparto en ruta:\" + ruta);\r\n ProcesarDirectorio(directorio);\r\n\r\n } else {\r\n System.out.println(\"No se ha cargado la configuracion\");\r\n Utilidades.AgregarLog(\"No se ha cargado la configuracion\");\r\n }\r\n\r\n }", "public void loadFile() {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tString filename = JOptionPane.showInputDialog(null,\"Enter the filename.\");\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\n\t\t\tMinLFile nminl = new MinLFile(filename);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\n\t\t\t\t\n\t\t\t\tnminl.CodeArea.setText(\"\");\n\t\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tDocument doc = nminl.CodeArea.getDocument();\n\t\t\t\t\ttry {\n\t\t\t\t\tdoc.insertString(doc.getLength(), str, null);\n\t\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\n\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t\t\t\n\t\t\tJComponent panel = nminl;\n\t\t\t\n\t\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\t\tfilename);\t\t\n\t\t\ttabbedPane.setMnemonicAt(0, 0);\n\t\t}\t\n\t}", "public static String cargarPreguntas(String fileName){\n String line = null; \n try {\n //Para lectura del archivo\n FileReader fileReader =\n new FileReader(fileName); \n \n //BufferedReader para optimización de recursos\n BufferedReader bufferedReader =\n new BufferedReader(fileReader);\n \n// Lee línea por línea, verifica que tengan algo de texto\n while(((line = bufferedReader.readLine()) != null)) {\n if ((line.length() > 0) && !(line.startsWith(\"//\"))){\n// Para ignorar las líneas de comentario en el archivo de texto\n //if (!(line.startsWith(\"//\"))){\n// Crea una lista de Strings para cada línea a evaluar\n List<String> listaLinea = new ArrayList<>(Arrays.asList(line.split(\";\")));\n// Impresión de prueba del ArrayList(descomentar)\n// System.out.println(listaLinea);\n \n //Obtiene lista de Respuestas, en tipo String\n List <String >resp = listaLinea.subList(1,listaLinea.size());\n //Creación de Respuestas (bajo el debido constructor) en un HashSet\n HashSet<Respuesta> respuestas = new HashSet(); \n for (int i = 0; i < resp.size();i++){\n if (i == 0){\n //Identifica la respuesta correcta\n respuestas.add(new Respuesta(resp.get(i), true));\n }\n else{\n //Identifica las respuestas incorrectas\n respuestas.add(new Respuesta(resp.get(i), false));\n } \n }\n //System.out.println(resp); Impresión de prueba (descomentar)\n \n //Agrega Preguntas y Respuestas a nuestro HashSet y HashMap\n Almacenamiento.getPreguntas().add(new Pregunta(listaLinea.get(0)));\n Almacenamiento.getMapaPR().put(new Pregunta(listaLinea.get(0)), respuestas); \n //}\n }\n }\n //Impresiones de prueba, descomentar.\n// for(Pregunta p: Almacenamiento.getPreguntas()){\n// System.out.println(p.toString()); \n// } \n// Almacenamiento.getMapaPR().forEach((k,v)-> System.out.println(k+\", \"+v));\n \n // Siempre cerrar archivo, para optimizar recursos\n bufferedReader.close(); \n }\n //Detalle de exception impreso en consola\n catch(FileNotFoundException ex) {\n System.out.println(\n \"No se pudo abrir archivo '\" +\n fileName + \"'\"); \n }\n //Detalle de exception impreso en consola\n catch(IOException ex) {\n System.out.println(\n \"Error leyendo archivo '\"\n + fileName + \"'\"); \n }\n return null;\n }", "private void chooseRemaindersFile() {\n JFileChooser setEF = new JFileChooser(System.getProperty(\"user.home\"));\n setEF.setDialogType(JFileChooser.OPEN_DIALOG);\n setEF.showDialog(this, \"Выбрать файл\");\n remainderFile = setEF.getSelectedFile();\n putLog(\"Файл остатков: \" + remainderFile.getPath());\n jbParse.setEnabled(workingDirectory != null && remainderFile != null);\n }", "public ArrayList<String> Info_Disco_Pel_Rep4(String genero) {\r\n String line;\r\n ArrayList<String> Lista_datos_nombre_genero = new ArrayList();\r\n try (BufferedReader br = new BufferedReader(new FileReader(\"src/Archivos/cat_peliculas.txt\"))) {\r\n while ((line = br.readLine()) != null) {\r\n String[] info_disco = line.split(\";\");\r\n if (info_disco[2].equals(genero)) {\r\n Lista_datos_nombre_genero.add(info_disco[0]);\r\n }\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(ex);\r\n }\r\n return Lista_datos_nombre_genero;\r\n }", "public static void crearPartida() throws FileNotFoundException, IOException, ExcepcionesFich {\n\t\tLecturaFicheros.AllLecture(\"C:\\\\Users\\\\Erick\\\\pruebaPOO.txt\");\n\t\tinterfaz = new GUI(0);\t\t\n\t}", "public String afficherInfoFichierTexte(){\n\t\tString fichierComplet = \"\";\n\t\tfor (Joueur j: ListJoueur) {\n\t\t\tfichierComplet += j.afficherFichierTexte();\n\t\t}\n\t\treturn fichierComplet;\n\t}", "public ArrayList<String> Info_Disc_Mus_Compras(String genero) {\r\n ArrayList<String> Lista_nombre = Info_Disco_Mus_Rep1(genero);\r\n ArrayList<String> Lista_datos_compras = new ArrayList();\r\n String line;\r\n try (BufferedReader br = new BufferedReader(new FileReader(\"src/Archivos/Compra_Musica.txt\"))) {\r\n while ((line = br.readLine()) != null) {\r\n String[] info_disco_compra = line.split(\";\");\r\n for (int s = 0; s < Lista_nombre.size(); s++) {\r\n if (Lista_nombre.get(s).equals(info_disco_compra[3])) {\r\n Lista_datos_compras.add(info_disco_compra[3]);\r\n Lista_datos_compras.add(info_disco_compra[5]);\r\n }\r\n }\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(ex);\r\n }\r\n return Lista_datos_compras;\r\n }", "public ArrayList<String> Info_Disco_Pel_Rep1(String genero) {\r\n String line;\r\n ArrayList<String> Lista_datos_nombre_genero = new ArrayList();\r\n try (BufferedReader br = new BufferedReader(new FileReader(\"src/Archivos/cat_peliculas.txt\"))) {\r\n while ((line = br.readLine()) != null) {\r\n String[] info_disco = line.split(\";\");\r\n if (info_disco[2].equals(genero)) {\r\n Lista_datos_nombre_genero.add(info_disco[0]);\r\n }\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(ex);\r\n }\r\n return Lista_datos_nombre_genero;\r\n }", "public static void RT() {//metodo para leer la informacion del txt , presente en todas las clases que se guardan en un txt\n\t\treadTxt(\"usuarios.txt\", usersList);\n\t}", "public void lecture() throws FileNotFoundException, IOException {\n \n //ouverture du fichier en lecture\n InputStream is = this.getClass().getClassLoader().getResourceAsStream(adresseFichier);\n InputStreamReader ir = new InputStreamReader(is);\n BufferedReader fichier = new BufferedReader(ir);\n \n //Lecture ligne à ligne\n String ligne;\n int numLigne = 0;\n while((ligne = fichier.readLine()) != null){\n //parsage de la ligne\n this.parseLigne(numLigne, ligne);\n numLigne++;\n }\n }", "private void readSavedFile() {\n\n String[] files = new String[0];\n \n // On récupère la liste des fichiers\n File file = new File(folderName);\n\n // check if the specified pathname is directory first\n if(file.isDirectory()){\n //list all files on directory\n files = file.list();\n }\n\n if (files != null) {\n for(String currentFile : files) {\n Vehicule voiture;\n try {\n FileInputStream fileIn = new FileInputStream(folderName + \"/\" + currentFile);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n voiture = (Vehicule) in.readObject();\n addVoitureToList(voiture);\n in.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"#Erreur : Impossible de récupérer l'objet \" + currentFile);\n c.printStackTrace();\n return;\n }\n }\n }\n }", "public static void main(String[] args) throws IOException {\n File archivo = new File(\"/Users/Germayn/Documents/NetBeansProjects/busquedalineal/archivoprueba.txt\");\r\n \r\n Scanner teclado = new Scanner(System.in);\r\n \r\n System.out.println(\"palabra a buscar\");\r\n String palabra = teclado.nextLine();\r\n System.out.println(\"\");\r\n \r\n buscarpalabra(archivo,palabra);\r\n \r\n }", "private void viewAllInfo(){\r\n try{\r\n Scanner scanner = new Scanner(file);\r\n String info;\r\n\r\n while (scanner.hasNext()){\r\n String line = scanner.nextLine();\r\n String[] components = line.split(separator);\r\n info = \" Name: \" + components[0] + \"\\n\";\r\n info += \" Phone No.: \"+components[1]+\"\\n\";\r\n info += \" Email: \"+components[2]+\"\\n\";\r\n info += \" Address: \"+components[3]+\"\\n\";\r\n textAreaFromAllInfo.append(info+\"\\n\");\r\n }\r\n\r\n }catch (IOException e){\r\n fileError();\r\n }\r\n }", "void citire(FileReader f);", "public void fillFilenames() {\r\n if (this.pl_LastFiles.getParam(\"nodelist-file\") != null\r\n && this.pl_LastFiles.getParam(\"edgelist-file\") != null) {\r\n this.nodefileText.setText(this.pl_LastFiles.getParam(\"nodelist-file\"));\r\n this.edgeFileText.setText(this.pl_LastFiles.getParam(\"edgelist-file\"));\r\n } else {\r\n this.nodefileText.setText(\"examples\" + System.getProperty(\"file.separator\") + \"20nodes.txt\");\r\n this.edgeFileText.setText(\"examples\" + System.getProperty(\"file.separator\") + \"20edges.txt\");\r\n }\r\n }", "public n501070324_PedidosAssistencia() {\n super(\"Pedidos.txt\");\n }", "private void winOpen() {\n try {\n content = Files.readAllLines(Paths.get(FILE_PATH_INDEX_TXT), Charset.forName(\"cp1251\"));\n String[] Str = content.get(0).split(\";\");\n mapIndexes = new HashMap();\n int i = 0;\n for (String string : Str) {\n mapIndexes.put(string, ++i);\n }\n setLocation(main.getLocation().x + main.getWidth(), main.getLocation().y + this.getHeight() - 10);\n } catch (IOException ex) {\n JOptionPane.showOptionDialog(this, \"Ошибка\", \"Не найден индексный файл!\", JOptionPane.DEFAULT_OPTION,\n JOptionPane.ERROR_MESSAGE, null, null, null);\n }\n\n }", "public void Horas() {\r\n File archivo = null;\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n \r\n try {\r\n // Apertura del fichero y creacion de BufferedReader para poder\r\n // hacer una lectura comoda (disponer del metodo readLine()).\r\n \r\n \r\n // Lectura del fichero\r\n String linea;\r\n \r\n for (a=0;a<5;a++){\r\n if (a==0){\r\n categoria=\"Embarazadas\";\r\n }\r\n if (a==1){\r\n categoria=\"Regulares\";\r\n }\r\n if (a==2){\r\n categoria=\"Discapacitados\";\r\n }\r\n if (a==3){\r\n categoria=\"Mayores\";\r\n }\r\n if (a==4){\r\n categoria=\"Corporativos\";\r\n }\r\n archivo = new File (System.getProperty(\"user.dir\")+\"/Clientes/\"+categoria+\".txt\");\r\n fr = new FileReader (archivo);\r\n br = new BufferedReader(fr);\r\n while((linea=br.readLine())!=null)\r\n if (leerHora == contador){\r\n comparar = linea.substring(0,2);\r\n \r\n if (\"09\".equals(comparar)){\r\n nueve++;\r\n }\r\n if (\"10\".equals(comparar)){\r\n diez++;\r\n }\r\n if (\"11\".equals(comparar)){\r\n once++;\r\n }\r\n if (\"13\".equals(comparar)){\r\n una++;\r\n }\r\n if (\"14\".equals(comparar)){\r\n dos++;\r\n }\r\n if (\"15\".equals(comparar)){\r\n tres++;\r\n }\r\n if (\"16\".equals(comparar)){\r\n cuatro++;\r\n }\r\n \r\n contador +=1;\r\n leerHora += 6;\r\n }\r\n else{\r\n contador += 1;\r\n }\r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n // En el finally cerramos el fichero, para asegurarnos\r\n // que se cierra tanto si todo va bien como si salta \r\n // una excepcion.\r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n }", "private void lesFil()\n\t{\n\t\tDATAFIL = datafil(false);\n\n\t\ttry ( ObjectInputStream innfil = new ObjectInputStream( new FileInputStream( DATAFIL ) ) )\n\t\t{\n\t\t\tbr = (Boligregister) innfil.readObject();\n\t\t\tvisMelding( \"Data er hentet fra fil.\" );\n\t\t}\n\t\tcatch(ClassNotFoundException cnfe)\n\t\t{\n\t\t\tvisMelding( \"<html>Feil:<br><br>\" + cnfe.getMessage() + \"<br><br>Oppretter tom datafil. Tar vare p&aring; gammel datafil.</html>\" );\n\t\t\ttomtRegister();\n\t\t\tDATAFIL = datafil(true);\n\t\t\tskrivTilFil(false);\n\t\t}\n\t\tcatch(FileNotFoundException fne)\n\t\t{\n\t\t\tvisMelding( \"Ingen datafil funnet. Oppretter tom datafil.\" );\n\t\t\ttomtRegister();\n\t\t\tskrivTilFil(false);\n\t\t}\n\t\tcatch(IOException ioe)\n\t\t{\n\t\t\tvisMelding( \"<html>Innlesingsfeil. Oppretter tom datafil. Tar vare p&aring; gammel datafil.</html>\" );\n\t\t\ttomtRegister();\n\t\t\tDATAFIL = datafil(true);\n\t\t\tskrivTilFil(false);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tFileUTL fUtl = new FileUTL();\n\t\tString fileAddres = \"C:\\\\Users\\\\lenovo\\\\Desktop\\\\医嘱和对应路径信息\\\\\";\n\t\tString filename = fileAddres+\"12个病人的医嘱信息-utf8.csv\";\n\t\tString splitSign = \",\";\n\t\tString dateSign = \"/\";\n\t\tfUtl.readFile(filename, splitSign, dateSign);\n\t}", "public ExcluirFilme() {\n initComponents();\n setTitle(\"LocVideo\");\n AtualizarCombo();\n }", "public static void main(String[] args) {\n\t\t\r\n\t\ttry {\r\n\t\t\tFile f = new File(\"MonFichier.txt\");\r\n\t\t\tFileReader fr = new FileReader(f);\r\n\t\t\t//flot de communication pour les caractères,\r\n\t\t\t//qui se connecte à un fichier\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\t//flot de traitement pour les caractères (buffer)\r\n\t\t\t//ce flot est chaîné au FileReader\r\n\t\t\tString ligne = null; // contiendra chaque ligne\r\n\t\t\twhile ((ligne = br.readLine()) != null) {\r\n\t\t\t\tSystem.out.println(ligne);\r\n\t\t\t}\r\n\t\t\tbr.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n int returnVal = fc.showOpenDialog(panel);\n if(returnVal == JFileChooser.APPROVE_OPTION){\n file = fc.getSelectedFile();\n System.out.println(file);\n \n try {\n Scanner scanner = new Scanner(file);\n String appendString = \"\";\n \n while(scanner.hasNext()){\n String oneString = scanner.nextLine();\n txtArea.append(oneString + \"\\n\");\n }\n \n try {\n read_characters(file.toString());\n } catch (IOException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n resultArea.append(resultString);\n resultPane.setText(resultString);\n } catch (FileNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n //Print ID table\n Map<String,Integer> map = new TreeMap<String,Integer>(userDefinedWords);\n identifierTableArea.append(\"Number of Occurences \" + \"\\t\" +\n \t\t\t\t\t\t\t\"Symbol\" + \"\\n\\n\");\n Iterator iter = \n \t\tmap.entrySet().iterator();\n while(iter.hasNext()){\n \t Map.Entry pair = \n \t\t\t (Map.Entry)iter.next();\n \t identifierTableArea.append(\n \t\t\t pair.getValue() + \"\\t\\t\" + pair.getKey() + \"\\n\");\n }\n \n }\n }", "public ArrayList<String> Info_Disc_Pel_Compras(String genero) {\r\n ArrayList<String> Lista_nombre = Info_Disco_Pel_Rep4(genero);\r\n ArrayList<String> Lista_datos_compras = new ArrayList();\r\n String line;\r\n try (BufferedReader br = new BufferedReader(new FileReader(\"src/Archivos/Compra_Peliculas.txt\"))) {\r\n while ((line = br.readLine()) != null) {\r\n String[] info_disco_compra = line.split(\";\");\r\n for (int s = 0; s < Lista_nombre.size(); s++) {\r\n if (Lista_nombre.get(s).equals(info_disco_compra[3])) {\r\n Lista_datos_compras.add(info_disco_compra[3]);\r\n Lista_datos_compras.add(info_disco_compra[5]);\r\n }\r\n }\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(ex);\r\n }\r\n return Lista_datos_compras;\r\n }", "static void LeerArchivo(){ \r\n \t//iniciamos el try y si no funciona se hace el catch\r\n\r\n try{ \r\n \t//se crea un objeto br con el archivo de txt\r\n \tBufferedReader br = new BufferedReader( \r\n \tnew FileReader(\"reporte.txt\")\r\n );\r\n String s;\r\n //Mientras haya una linea de texto se imprime\r\n while((s = br.readLine()) != null){ \r\n System.out.println(s);\r\n }\r\n //se cierra el archivo de texto\r\n br.close(); \r\n } catch(Exception ex){\r\n \t//si no funciona se imprime el error\r\n System.out.println(ex); \r\n }\r\n }", "void selectFile(){\n JLabel lblFileName = new JLabel();\n fc.setCurrentDirectory(new java.io.File(\"saved\" + File.separator));\n fc.setDialogTitle(\"FILE CHOOSER\");\n FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter(\n \"json files (*.json)\", \"json\");\n fc.setFileFilter(xmlfilter);\n int response = fc.showOpenDialog(this);\n if (response == JFileChooser.APPROVE_OPTION) {\n lblFileName.setText(fc.getSelectedFile().toString());\n }else {\n lblFileName.setText(\"the file operation was cancelled\");\n }\n System.out.println(fc.getSelectedFile().getAbsolutePath());\n }", "public static void main(String[] args) {\n File myFile= new File(\"D:/yeah.txt\");\n System.out.println(\"Iiim file bnuu? \"+myFile.exists());\n\t System.out.println(\"Zaagdsan zam deeree bnuu?\"+myFile.isFile());\t \n\t System.out.println(\"Ug file iin ner \"+myFile.getName());\n\t System.out.println(\"Ug file iin zam \"+myFile.getPath());\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Excel Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"xls\"); // 파일 필터로 사용되는 확장자. *.xml 만 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tString readFilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을 알아온다.\t\t\t\t\r\n\t\t\t\tShowPatientInfo_K showPatientInfo = new ShowPatientInfo_K(readFilePath);\r\n\t\t\t}", "private static void recorrerFicheros(File[] ficheros, int indice,\n\t\t\tString texto) {\n\t\tif (indice <= ficheros.length - 1) {\n\t\t\tif (practica6.Prueba1.\n\t\t\t\t\tesFicheroGrafico(ficheros[indice])) {\n\t\t\t\tImageIcon img = new ImageIcon(ficheros[indice].\n\t\t\t\t\t\tgetPath().toLowerCase());\n\t\t\t\t// comprueba si tiene alguna coincidencia\n\t\t\t\tif (ficheros[indice].getName().\n\t\t\t\t\t\tindexOf(texto) != -1) {\n\t\t\t\t\tSystem.out.printf(\"%s%n\", ficheros[indice].\n\t\t\t\t\t\t\tgetPath());\n\t\t\t\t\t// lo agrega al vector\n\t\t\t\t\tv.add(img);\n\t\t\t\t}\n\t\t\t\tindice++;\n\t\t\t\trecorrerFicheros(ficheros, indice, texto);\n\t\t\t} else {\n\t\t\t\tindice++;\n\t\t\t\trecorrerFicheros(ficheros, indice, texto);\n\t\t\t}\n\t\t}\n\t}", "public void readFromFile(String doc) {\n\t\tString newline = \"\\n\";\n\t\tString doc_text = \"\";\n\t\tint count = 0;\n\t\tString line=\"\";\n\t\t\n\t\t//for random button\n\t\tint buttoncount = 0;\n\t\tArrayList<JButton> list = new ArrayList<JButton>();\n\t\t\n\t\ttry{\n\t\t\t//input stream for reading special characters in German\t\n\t\t\t//documents from folder textfiles\n \tBufferedReader rd = new BufferedReader(new InputStreamReader(new FileInputStream(\"textfiles/\" + doc),StandardCharsets.UTF_8));\n \twhile ((line=rd.readLine()) != null) {\n \t\t//question text\n \t\tif (count == 0) {\n \t\t\t\n \t\t\tswitch(bg) {\n \t\t\t\tcase(1):\n \t\t\t\tdoc_text = \"Dein Charakter lässt sich durch 4 Merkmale beschreiben.\\r\\n\" + \n \t\t\t\t\t\t\"Wähle als 1. dein Persönlichkeitsmerkmal:\" + newline;\n \t\t\t\t\tcount++;\n \t\t\t\tbreak;\n \t\t\tcase(2):\n \t\t\t\tdoc_text = \"Wähle das 2. Merkmal ein Ideal:\" + newline;\n \t\t\t\tcount++;\n \t\t\t\tbreak;\n \t\t\tcase(3):\n \t\t\t\tdoc_text = \"Entscheide dich als nächstes für eine Bindung:\"+ newline;\n \t\t\t\tcount++;\n \t\t\t\tbreak;\n \t\t\tcase(4):\n \t\t\t\tdoc_text = \"Deine letzte Frage. Im Anschluss wird dein Charakter generiert.\\r\\n\" + \n \t\t\t\t\t\t\"Wähle ein Makel der dich beschreibt:\"+ newline;\n \t\t\t\tcount++;\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\tdoc_text = doc_text + line + newline;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\ttxt.setText(doc_text);\n \t\t\tif(randomButton == true) {\n\t\t \t\ttxt.setVisible(false);\n \t\t\t\t}\n \t\t\tpanelA.add(txt);\n \t\t}\n \t\t\n \t\t//buttonname;next document(;information)\n \t\tif (count == 1) {\n \t\t\tString[] tokens = line.split(\";\");\n \t\t\tJButton button = new JButton (tokens[0]);\n \t\t\t\tbutton.setFont(new Font(\"Rockwell\", Font.PLAIN, 24));\n \t\t\t//for random button: add buttons to a list and count them\n \t\t\tlist.add(button);\n \t\t\tbuttoncount++;\n \t\t\t\tif(randomButton == true) {\n \t\t\t\t\tbutton.setVisible(false);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tpanelB.add(button);\n\t\t\t\t\tbutton.addActionListener( new ActionListener() {\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\t\t\t\tif(ae.getSource() == button) {\n\t\t\t\t\t\t\t\tif (tokens.length == 1) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tclearPanel();\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//if race is already set but class not yet, than read question for class\n\t\t\t\t\t\t\t\t\tif(baseRace == true && baseClass == false) {\n \t\t\t\t\t\t\t\t\tspecific_race = tokens[0];\n \t\t\t\t\t\t\t\t\treadFromFile(\"/question_class/question_class_\" + attribute + \".txt\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//if race and class is already set -> open question for background\n\t\t\t\t\t\t\t\t\telse if(baseRace == true && baseClass == true) {\n\t\t\t \t\t\t\t\tspecific_class = tokens[0];\n \t\t\t\t\t\t\t\t\treadFromFile(\"question_backgrounds\" + \".txt\");\n\t\t\t \t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (tokens.length > 1) {\n\t\t\t\t\t\t\t\t\t//Buttonname/tokens[0];[tokens[1];tokens[2] \n\t\t\t\t\t\t\t\t\tif (tokens.length>2) {\n\t\t\t\t\t\t\t\t\t\tif (baseRace == false && baseClass == false) {\n\t\t\t \t\t\t\t\t\tbase_race.setRace(tokens[2]);\n\t\t\t \t\t\t\t\t\tbaseRace = true;\n\t\t\t \t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (baseRace == true && baseClass == false) {\n\t\t\t \t\t\t\t\t\tbase_class.setClass(tokens[2]);\n\t\t\t \t\t\t\t\t\tbaseClass = true;\n\n\t\t\t \t\t\t\t\t} \t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//random button\n\t\t\t\t\t\t\t\t\tif (tokens[0].equals(\"Zufallscharakter erstellen\")) {\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\trandomButton = true;\n\t\t\t\t\t\t\t\t\t\tclearPanel();\n\t\t\t\t\t\t\t\t\t\treadFromFile(tokens[1] + \".txt\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//choose main attribute for race and class\n\t\t\t\t\t\t\t\t\telse if(doc.equals(\"question_1.txt\")) {\n\t\t\t \t\t\t\t\tString attribute_tokens [] = tokens[1].split(\"_\");\n\t\t\t \t\t\t\t\tattribute = attribute_tokens[3];\n\t\t\t \t\t\t\t\tclearPanel();\n\t\t\t\t\t\t\t\t\t\treadFromFile(tokens[1]+\".txt\");\t\n\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\t//choose background personality\n\t\t\t\t\t\t\t\t\telse if(doc.equals(\"question_backgrounds.txt\")) {\n\t\t\t\t\t\t\t\t\t\tpersonality = tokens[1];\n\t\t\t \t \t\tbase_personality.setPersonality(tokens[0]);\n\t\t\t \t \t\tclearPanel();\n\t\t\t \t \t\tbg++;\n\t\t\t \t \t\treadFromFile(\"question_personalities/\" + personality + \"/question_personality_\" + personality + \".txt\");\n\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\t//background\n\t\t\t\t\t\t\t\t\telse if (bg == 1) {\t\n\t\t\t\t\t\t\t\t\t\tbg++;\n\t \t\t\t\t\t\t\t\tbase_personality.setPersonalityTrait(tokens[1]);\n\t \t\t\t\t\t\t\t\tclearPanel();\n\t \t\t\t\t\t\t\t\treadFromFile(\"/question_personalities/\" + personality + \"/question_ideal_\" + personality + \".txt\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (bg == 2) {\n\t\t\t\t\t\t\t\t\t\tbg++;\n\t\t\t\t\t\t\t\t\t\tbase_personality.setIdeal(tokens[1]);\n\t\t\t\t\t\t\t\t\t\tclearPanel();\n\t \t\t \t\t\t\treadFromFile(\"/question_personalities/\" + personality + \"/question_bond_\" + personality + \".txt\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (bg == 3) {\t\n\t\t\t\t\t\t\t\t\t\tbg++;\n\t \t\t\t\t\t\t\t\tbase_personality.setBond(tokens[1]);\n\t \t\t\t\t\t\t\t\tclearPanel();\n\t \t\t \t\t\t\treadFromFile(\"/question_personalities/\" + personality + \"/question_flaw_\" + personality + \".txt\");\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\t\t\telse if (bg == 4) {\n\t\t\t\t\t\t\t\t\t\tbg = 0;\n\t \t\t\t\t\t\t\t\tbase_personality.setFlaw(tokens[1]);\n\t \t\t\t\t\t\t\t\tsetAttributes();\n\t \t\t \t\tshowResults();\n\t \t\t \t\t\n\t\t\t\t \t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tclearPanel();\n\t\t\t\t\t\t\t\t\t\treadFromFile(tokens[1]+\".txt\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t \t \t\t\t\t\n \t\t\t}); //actionlistener close \n \t\t\t\n \t\t} //if count == 1 end\n\n \t\t//empty line\n\t\t if (line.length() == 0) {\n\t\t \tcount++;\n\t\t \ttxt.setText(doc_text);\n\t\t \tif(randomButton == true) {\n\t\t \t\ttxt.setVisible(false);\n \t\t\t\t}\n\t\t \tpanelA.add(txt);\n\t\t }\n\t\t \n \t} // while end\n \t\n\t\t\t\n \trd.close();\n \t\n } //try\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsetFrameContent();\n\t\tif(randomButton == true) {\n\t\t\trandomInt = rdm.nextInt(buttoncount);\t\n\t\t\tlist.get(randomInt).doClick();\n\t\t}\n\t}", "public ArrayList<String> Info_Disco_Mus_Rep1(String genero) {\r\n String line;\r\n ArrayList<String> Lista_datos_nombre_genero = new ArrayList();\r\n try (BufferedReader br = new BufferedReader(new FileReader(\"src/Archivos/cat_musica.txt\"))) {\r\n while ((line = br.readLine()) != null) {\r\n String[] info_disco = line.split(\";\");\r\n if (info_disco[2].equals(genero)) {\r\n Lista_datos_nombre_genero.add(info_disco[0]);\r\n }\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(ex);\r\n }\r\n return Lista_datos_nombre_genero;\r\n }", "private void btnAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarActionPerformed\n \n camino=null;\n \n int status = fileChooser.showOpenDialog (null);\n if (status == JFileChooser.APPROVE_OPTION){\n File selectedFile = fileChooser.getSelectedFile();\n camino = selectedFile.getAbsolutePath();\n }\n else{ \n if (status == JFileChooser.CANCEL_OPTION){\n System.out.println(\"CANCELAR\");\n }\n \n }\n try {\n cancion.agregarCancion(camino);\n } catch (IOException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedTagException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InvalidDataException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n }\n String[] test = cancion.mostrarCancion(i);\n lista.addElement(\" \"+test[0]);\n libCancion.setModel(lista);\n i++;\n }", "private void dialogEchecConversionFichier(File file, File file2){\n\t\tJOptionPane.showMessageDialog(null, \"le fichier \" + file.getName() +\"\\nn'a pas été converti en \"+ file2.getName(), \"Erreur\", JOptionPane.ERROR_MESSAGE);\n\t}", "public void setFileRegExpr(String f) {\n this.fileRegExpr = f;\n }", "public int Tipo() {\r\n File archivo = null;\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n \r\n try {\r\n String linea;\r\n for (a=0;a<5;a++){\r\n if (a==0){\r\n tipo=\"Embarazadas\";\r\n }\r\n if (a==1){\r\n tipo=\"Regulares\";\r\n }\r\n if (a==2){\r\n tipo=\"Discapacitados\";\r\n }\r\n if (a==3){\r\n tipo=\"Mayores\";\r\n }\r\n if (a==4){\r\n tipo=\"Corporativos\";\r\n }\r\n archivo = new File (System.getProperty(\"user.dir\")+\"/Clientes/\"+tipo+\".txt\");\r\n fr = new FileReader (archivo);\r\n br = new BufferedReader(fr);\r\n while((linea=br.readLine())!=null){\r\n if (leerTipo == contador){\r\n errorTipo =String.valueOf(String.valueOf(leerTipo).length());\r\n if (a==0){\r\n resultadoembarazadas+=1;\r\n }\r\n if (a==1){\r\n resultadoregulares+=1;\r\n }\r\n if (a==2){\r\n resultadodiscapacitados+=1;\r\n }\r\n if (a==3){\r\n resultadomayores+=1;\r\n }\r\n if (a==4){\r\n resultadocorporativos+=1;\r\n }\r\n contador +=1;\r\n leerTipo +=6;\r\n\r\n }\r\n else{\r\n contador += 1;\r\n }\r\n }\r\n }\r\n\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n // En el finally cerramos el fichero, para asegurarnos\r\n // que se cierra tanto si todo va bien como si salta \r\n // una excepcion.\r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n //return resultado;\r\n return 0;\r\n }", "public void Fecha() throws FileNotFoundException, IOException {\r\n File archivo = null;\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n \r\n try {\r\n // Apertura del fichero y creacion de BufferedReader para poder\r\n // hacer una lectura comoda (disponer del metodo readLine()).\r\n // Lectura del fichero\r\n String linea;\r\n \r\n for (b=0;b<5;b++){\r\n if (b==0){\r\n categoria=\"Embarazadas\";\r\n }\r\n if (b==1){\r\n categoria=\"Regulares\";\r\n }\r\n if (b==2){\r\n categoria=\"Discapacitados\";\r\n }\r\n if (b==3){\r\n categoria=\"Mayores\";\r\n }\r\n if (b==4){\r\n categoria=\"Corporativos\";\r\n }\r\n archivo = new File (System.getProperty(\"user.dir\")+\"/Clientes/\"+categoria+\".txt\");\r\n fr = new FileReader (archivo);\r\n br = new BufferedReader(fr);\r\n while((linea=br.readLine())!=null){\r\n if (leerFecha == contador){\r\n errorFecha = linea.substring(1,2);\r\n if (errorFecha.equals(\"/\")){\r\n comparar = linea.substring(0, 1);\r\n if (\"1\".equals(comparar)){\r\n d1++;\r\n }\r\n if (\"2\".equals(comparar)){\r\n d2++;\r\n }\r\n if (\"3\".equals(comparar)){\r\n d3++;\r\n }\r\n if (\"4\".equals(comparar)){\r\n d4++;\r\n }\r\n if (\"5\".equals(comparar)){\r\n d5++;\r\n }\r\n if (\"6\".equals(comparar)){\r\n d6++;\r\n }\r\n if (\"7\".equals(comparar)){\r\n d7++;\r\n }\r\n if (\"8\".equals(comparar)){\r\n d8++;\r\n }\r\n if (\"9\".equals(comparar)){\r\n d9++;\r\n }\r\n } \r\n else{\r\n comparar1=linea.substring(0, 2);\r\n if (\"10\".equals(comparar1)){\r\n d10++;\r\n }\r\n if (\"11\".equals(comparar1)){\r\n d11++;\r\n }\r\n if (\"12\".equals(comparar1)){\r\n d12++;\r\n }\r\n if (\"13\".equals(comparar1)){\r\n d13++;\r\n }\r\n if (\"14\".equals(comparar1)){\r\n d14++;\r\n }\r\n if (\"15\".equals(comparar1)){\r\n d15++;\r\n }\r\n if (\"16\".equals(comparar1)){\r\n d16++;\r\n }\r\n if (\"17\".equals(comparar1)){\r\n d17++;\r\n }\r\n if (\"18\".equals(comparar1)){\r\n d18++;\r\n }\r\n if (\"19\".equals(comparar1)){\r\n d19++;\r\n }\r\n if (\"20\".equals(comparar1)){\r\n d20++;\r\n }\r\n if (\"21\".equals(comparar1)){\r\n d21++;\r\n }\r\n if (\"22\".equals(comparar1)){\r\n d22++;\r\n }\r\n if (\"23\".equals(comparar1)){\r\n d23++;\r\n }\r\n if (\"24\".equals(comparar1)){\r\n d24++;\r\n }\r\n if (\"25\".equals(comparar1)){\r\n d25++;\r\n }\r\n if (\"26\".equals(comparar1)){\r\n d26++;\r\n }\r\n if (\"27\".equals(comparar1)){\r\n d27++;\r\n }\r\n if (\"28\".equals(comparar1)){\r\n d28++;\r\n }\r\n if (\"29\".equals(comparar1)){\r\n d29++;\r\n }\r\n if (\"30\".equals(comparar1)){\r\n d30++;\r\n }\r\n if (\"31\".equals(comparar1)){\r\n d31++;\r\n }\r\n \r\n }\r\n leerFecha+=6;\r\n contador += 1;\r\n }\r\n \r\n else{\r\n contador += 1;\r\n \r\n \r\n }\r\n } \r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n // En el finally cerramos el fichero, para asegurarnos\r\n // que se cierra tanto si todo va bien como si salta \r\n // una excepcion.\r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n }", "public static void main(String[] args) throws IOException {\n File ruta = new File(\"C:\\\\Users\\\\usuario\\\\Documents\\\\curso de java online sepe\\\\unidad 1 clase file\\\\ejercicios\");\n // establecer el nombre del fichero a crear\n File f = new File(ruta, \"datos.txt\");\n File f1 = new File(ruta, \"datosNuevos.txt\");\n // imprimir la ruta absoluta del archivo\n System.out.println(f.getAbsolutePath());\n // Devuelve un String conteniendo el directorio padre del File. Devuelve null si no tiene directorio padre. del archivo\n System.out.println(f.getParent());\n // imprimir la ruta absoluta de la ruta del archivo\n System.out.println(ruta.getAbsolutePath());\n // Devuelve un String conteniendo el directorio padre del File. Devuelve null si no tiene directorio padre. de la ruta\n System.out.println(ruta.getParent());\n if (!f.exists()) { //se comprueba si el fichero existe o no\n System.out.println(\"Fichero \" + f.getName() + \" no existe\");\n if (!ruta.exists()) { //se comprueba si la ruta existe o no\n System.out.println(\"El directorio \" + ruta.getName() + \" no existe\");\n if (ruta.mkdir()) { //se crea la carpeta\n System.out.println(\"Directorio creado\");\n if (f.createNewFile()) { //se crea el fichero.\n System.out.println(\"Fichero \" + f.getName() + \" creado\");\n } else {\n System.out.println(\"No se ha podido crear \" + f.getName());\n }\n } else {\n System.out.println(\"No se ha podido crear \" + ruta.getName());\n }\n } else { //si la ruta existe creamos el fichero\n if (f.createNewFile()) {\n System.out.println(\"Fichero \" + f.getName() + \" creado\");\n } else {\n System.out.println(\"No se ha podido crear \" + f.getName());\n }\n }\n } else { //el fichero existe. Mostramos el tamaño\n System.out.println(\"Fichero \" + f.getName() + \" existe\");\n System.out.println(\"Tamaño \" + f.length() + \" bytes\");\n }\n\n // mostrar los archivos en esa carpeta\n File f2 = new File(ruta, \".\");\n // creamos un array para mostrar todos los archivos en esa ruta\n String[] listaArchivos = f2.list();\n if (!f1.exists()) { //se comprueba si el fichero existe o no\n System.out.println(\"Fichero \" + f1.getName() + \" no existe\");\n }\n if (f1.createNewFile()) { //se crea el fichero. Si se ha creado correctamente\n System.out.println(\"Fichero \" + f1.getName() + \" creado\");\n } else {\n System.out.println(\"No se ha podido crear \" + f1.getName());\n }\n for (int i = 0; i < listaArchivos.length; i++) {\n System.out.println(listaArchivos[i]);\n }\n // mostrar el numero de archivos en esa carpeta\n String[] elementos = ruta.list();\n System.out.println(\"La carpeta \" + ruta.getAbsolutePath() + \" tiene \" + elementos.length + \" subelementos\");\n }", "private void leerOracion(){\r\n\tString wor=\"\";\r\n\r\n try {\r\n\r\n arch = new File (\"texto.txt\");\r\n fr = new FileReader (arch);\r\n br = new BufferedReader(fr);\r\n\r\n String lin;\r\n int ind=0;\r\n while((lin=br.readLine())!=null){\r\n \twor=lin;\r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n\r\n\twhile(wor.compareTo(\"\")!=0){\r\n\tint lugar=wor.indexOf(' ');\r\n if(lugar!=-1){\r\n orac.add(wor.substring(0,lugar));\r\n wor=wor.substring(lugar+1);\r\n }else{\r\n orac.add(wor);\r\n wor=\"\";\r\n }\r\n }\r\n }", "void doShowFiles()\n\t{\n\t\ttry\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tIterator itr = m_fileInfo.getAllFiles();\n\n\t\t\twhile(itr.hasNext())\n\t\t\t{\n\t\t\t\tSourceFile m = (SourceFile) ((Map.Entry)itr.next()).getValue();\n\n\t\t\t\tString name = m.getName();\n\t\t\t\tint id = m.getId();\n\t\t\t\tString path = m.getFullPath();\n\n\t\t\t\tsb.append(id);\n\t\t\t\tsb.append(' ');\n\t\t\t\tsb.append(path);\n\t\t\t\tsb.append(\", \"); //$NON-NLS-1$\n\t\t\t\tsb.append(name);\n\t\t\t\tsb.append(m_newline);\n\t\t\t}\n\t\t\tout( sb.toString() );\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noSourceFilesFound\")); //$NON-NLS-1$\n\t\t}\n\t}", "private void cargarFichaLepra_control() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\r\n\t\tficha_inicio_lepraService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean ficha_inicio = ficha_inicio_lepraService\r\n\t\t\t\t.existe_paciente_lepra(parameters);\r\n\t\t// log.info(\"ficha_inicio>>>>\" + ficha_inicio);\r\n\r\n\t\tif (ficha_inicio) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_SEGUIMIENTO_TRATAMIENTO_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_SEGUIMIENTO_TRATAMIENTO_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n String filePath = \"C:\\\\Users\\\\Catalin\\\\Desktop\\\\fisierdecitit.txt\";\n\n try {\n //incarcarea fisierului in memoria programului cu ajutorul ob fileReader\n FileReader fileReader = new FileReader(filePath);\n //incepem citirea din fisier linie cu line cu ajutorul BufferedReader\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String text = bufferedReader.readLine();\n while (text != null) {\n System.out.println(\"Linia citita este: \" + text);\n String[] array = text.split(\" \");\n System.out.println(array.length);\n text = bufferedReader.readLine();\n\n }\n\n } catch (IOException e) {\n System.out.println(\"A aparut o eroare: \" + e.getMessage());\n }\n\n\n //invatam sa scriem intr un fisier\n String filePathToWrite = \"C:\\\\Users\\\\Catalin\\\\Desktop\\\\fisierdescris.txt\";\n try {\n FileWriter fileWriter = new FileWriter(filePathToWrite);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n String text = \"Mama lu' Ana nu are nici mere si nici pere.\";\n String text2 = \"smhjhdgfdsbfkdhj\";\n\n bufferedWriter.write(text2);\n bufferedWriter.newLine();\n bufferedWriter.write(text);\n bufferedWriter.flush();\n bufferedWriter.close();\n } catch (IOException e) {\n System.out.println(\"A aparut o exceptie: \" + e.getMessage());\n }\n\n\n }" ]
[ "0.6538007", "0.6518997", "0.6489293", "0.6483024", "0.6373594", "0.6324646", "0.6267357", "0.6245618", "0.61500937", "0.61420095", "0.61260396", "0.61188596", "0.6105742", "0.6100809", "0.6062974", "0.60073733", "0.60028297", "0.59977794", "0.59917605", "0.59848845", "0.59717774", "0.59634125", "0.5949149", "0.59480286", "0.59445506", "0.5908735", "0.58979255", "0.58904874", "0.5888346", "0.58856124", "0.5878339", "0.58646244", "0.5843941", "0.58020747", "0.5779035", "0.57774043", "0.5759568", "0.575633", "0.5756105", "0.5744652", "0.5738489", "0.5737409", "0.5732473", "0.5725211", "0.5721766", "0.5716957", "0.5710698", "0.57101953", "0.57088363", "0.570552", "0.570519", "0.56870985", "0.56798863", "0.567897", "0.56723756", "0.5660166", "0.5651389", "0.56490195", "0.5645403", "0.5626968", "0.56215197", "0.5619775", "0.56174415", "0.5612189", "0.56055474", "0.56037", "0.5602835", "0.5600196", "0.5597591", "0.5596273", "0.5580282", "0.55723876", "0.55702966", "0.55602324", "0.5555133", "0.55525935", "0.55521643", "0.5551493", "0.5538748", "0.55331504", "0.553165", "0.5531244", "0.5507286", "0.5507206", "0.54972756", "0.5496017", "0.5493676", "0.54922664", "0.5492147", "0.5489562", "0.5489128", "0.5486009", "0.5484589", "0.54824907", "0.54804456", "0.547829", "0.5476577", "0.54764396", "0.5473805", "0.5466652", "0.54640394" ]
0.0
-1
Permette la scrittura di regola/e nel file dal percorso specficato in modo da salvare permanentemente
public void writeRuleToFile(String text, boolean append) { if (fileName.isEmpty()) return; try { FileWriter fileWriter = new FileWriter(fileName, append); PrintWriter writer = new PrintWriter(fileWriter); writer.println(text); writer.close(); fileWriter.close(); } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void pruebaEscritura() {\n\t\tFileWriter fichero = null;\n\t\tPrintWriter pw = null;\n\t\ttry {\n\t\t\tfichero = new FileWriter(\"//172.16.1.141/Modelo_Raster/Varios/Monitoreo_Forestal/REDD/Metadatos/test.xml\");\n\t\t\tpw = new PrintWriter(fichero);\n\n\t\t\tfor (int i = 0; i < 10; i++)\n\t\t\t\tpw.println(\"Linea \" + i);\n\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\t// Nuevamente aprovechamos el finally para\n\t\t\t\t// asegurarnos que se cierra el fichero.\n\t\t\t\tif (null != fichero) fichero.close();\n\t\t\t}\n\t\t\tcatch (Exception e2) {\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void salvaSuFile() {\n\t\tString path = \"alimenti.txt\";\n\t\tString allergeni = Alimento.getStringaAllergeni(getElencoAllergeni());\n\t\ttry {\n\t\t\tFile file = new File(path);\n\t\t\tFileWriter fw = new FileWriter(file, true);\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\tbw.write(getNome() + \" - \" + getPrezzo() + \"€\\n\");\n\t\t\tbw.write(\"Adatto a vegani: \" + (getVegano() ? \"sì\\n\" : \"no\\n\"));\n\t\t\tbw.write(\"Adatto a vegetariani: \" + (getVegetariano() ? \"sì\\n\" : \"no\\n\"));\n\t\t\tbw.write(\"Tipologia: \" + getTipoPortata().getNome().toUpperCase() + \"\\n\");\n\t\t\tbw.write(\"Cottura: \" + getTipoCottura().getNome().toUpperCase() + \"\\n\");\n\t\t\tbw.write(\"Allergeni: \" + (allergeni.isEmpty() ? \"--\" : allergeni) + \"\\n\\n\");\n\t\t\tbw.flush();\n\t\t\tbw.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void salvaPartita(String file) {\n\r\n }", "private static void createFileContribuicaoUmidade() throws IOException{\r\n\t\tInteger contribuicaoDefault = 0;\r\n\t\tarqContribuicaoUmidade = new File(pathContribuicaoUmidade);\r\n\t\tif(!arqContribuicaoUmidade.exists()) {\r\n\t\t\tarqContribuicaoUmidade.createNewFile();\r\n\t\t\tFileWriter fw = new FileWriter(getArqContribuicaoUmidade());\r\n\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));\r\n\t\t\tbuffWrite.close();\r\n\t\t}else {//Se arquivo existir\r\n\t\t\tFileReader fr = new FileReader(getArqContribuicaoUmidade());\r\n\t\t\tBufferedReader buffRead = new BufferedReader(fr);\r\n\t\t\tif(!buffRead.ready()) {/*Se o arquivo se encontar criado mas estiver vazio(modificado)*/\r\n\t\t\t\tFileWriter fw = new FileWriter(arqContribuicaoUmidade);\r\n\t\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma contribuicao Inicial*/\r\n\t\t\t\tbuffWrite.close();\r\n\t\t\t}\r\n\t\t\tbuffRead.close();\r\n\t\t}\r\n\t}", "public void arquivoSaida() {\r\n\r\n try {\r\n File file = new File(\"arquivoSaida.txt\");\r\n try (FileWriter arquivoSaida = new FileWriter(file, true)) {\r\n arquivoSaida.write(\"Rota do menor caminho entre as cidades escolhidas: \\n\\n\");\r\n Vertice v;\r\n \r\n //Escreve no arquivo a rota de ida de entrega nas cidades\r\n for (int i = 0; i < rota.getLista_de_rota().size() - 1; i++) {\r\n for (int j = 0; j < rota.getLista_de_rota().get(i).size(); j++) {\r\n v = rota.getLista_de_rota().get(i).get(j);\r\n arquivoSaida.write(v.getId() + \"; \");\r\n }\r\n }\r\n \r\n arquivoSaida.write(\"\\n\\nRota do menor caminho de volta: (Considerando que não há mais nenhuma entrega)\\n\\n\");\r\n // pegando a ultima posição da lista geral em que está a lista do menor caminho de volta\r\n int t = rota.getLista_de_rota().size() - 1; \r\n \r\n //Escreve a rota do caminho de volta, verificando a distancia entre a cidade origem e a cidade destino\r\n for (int j = rota.getLista_de_rota().get(t).size() - 1; j >= 0; j--) {\r\n v = (Vertice) rota.getLista_de_rota().get(t).get(j);\r\n arquivoSaida.write(v.getId() + \"; \");\r\n }\r\n arquivoSaida.write(\"Distancia percorrida: \"+rota.getDistancia()+\"\\n\");\r\n arquivoSaida.close();\r\n }\r\n } catch (IOException ex) { //caso nao seja possivel abrir algum dos arquivos\r\n System.out.println(\"Não foi possivel abrir arquivo\");\r\n }\r\n }", "public void importaRegole(String file, ArrayList<Sensore> listaSensori, ArrayList<Attuatore> listaAttuatori) {\n ArrayList<String> nomiDispPres = new ArrayList<>();\n\n for (Sensore s : listaSensori) {\n nomiDispPres.add(s.getNome());\n }\n\n for (Attuatore att : listaAttuatori) {\n nomiDispPres.add(att.getNome());\n }\n\n String regoleImport = readFromFile(file);\n\n if (regoleImport.equals(\"\")) {\n System.out.println(\"XX Errore di lettura file. Non sono state inserite regole per l'unita immobiliare XX\\n\");\n return;\n }\n\n String[] regole = regoleImport.split(\"\\n\");\n\n for (String r : regole) {\n try {\n ArrayList<String> dispTrovati = verificaCompRegola(r);\n\n for (String nomeDis : dispTrovati) {\n if (nomeDis.contains(\".\")){\n String nomeS = nomeDis.split(\"\\\\.\")[0];\n\n if (!nomiDispPres.contains(nomeS)) {\n throw new Exception(\"XX Dispositivi Incompatibili all'interno della regola XX\\n\");\n }\n\n Sensore s = listaSensori.stream().filter(sensore -> sensore.getNome().equals(nomeS)).iterator().next();\n String nomeInfo = nomeDis.split(\"\\\\.\")[1];\n\n if (s.getInformazione(nomeInfo) == null)\n throw new Exception(\"XX Regola non compatibile XX\\n\");\n\n\n } else if (!nomiDispPres.contains(nomeDis)) {\n throw new Exception(\"XX Dispositivi Incompatibili all'interno della regola XX\\n\");\n\n }\n }\n System.out.println(\"*** Importazione della regola avvenuta con successo ***\\n\");\n writeRuleToFile(r, true);\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n\n }\n eliminaDoppie(listaSensori,listaAttuatori);\n }", "public static void RT() {////cada clase que tiene informacion en un archivo txt tiene este metodo para leer el respectivo archivoy guardarlo en su hashmap\n\t\treadTxt(\"peliculas.txt\", pelisList);\n\t}", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "public void abrirArchivo() {\r\n try {\r\n entrada = new Scanner(new File(\"estudiantes.txt\"));\r\n } // fin de try\r\n catch (FileNotFoundException fileNotFoundException) {\r\n System.err.println(\"Error al abrir el archivo.\");\r\n System.exit(1);\r\n } // fin de catch\r\n }", "public void Leer() throws FileNotFoundException\n {\n // se crea una nueva ruta en donde se va a ir a leer el archivo\n String ruta = new File(\"datos.txt\").getAbsolutePath(); \n archivo=new File(ruta); \n }", "String prepareFile();", "public void FermerAgd() {\n //on essaye d'ouvrir un fichier dans lequel enregistrer le contenu de l'agenda\n try {\n Formatter agd_a_enreg = new Formatter(\"C:\\\\Projet_Agenda_ING3\\\\saved_agendas\");\n\n for (RdV el : this.getAgenda()) {\n //on enregistre 1 rdv par ligne\n //faire gaffe aux formats : %..\n agd_a_enreg.format(\"%s/%s/%s de %s a %s : %s , %s\\n\",\n el.getDate().getDayOfMonth(), el.getDate().getMonthValue(),\n el.getDate().getYear(), el.getHdebut(),\n el.getHfin(), el.getLibelle(), el.getRappel());\n //on supprime le rdv de l'arraylist d'agenda \n this.suppressionRdV(el);\n }\n //on ferme le fichier en ecriture\n agd_a_enreg.close();\n //on met l'attribut agenda à null une fois qu'il est \"vidé\"\n this.agd = null;\n } //en cas de probleme dans l'ouverture du fichier on affiche une erreur\n catch (Exception e) {\n System.out.print(\"Erreur d'ouverture du fichier en ecriture\\n\");\n }\n\n }", "public void remFile(){\n ((MvwDefinitionDMO) core).remFile();\n }", "private void removeContentsFromFile() {\n Log.d(\"debugMode\", \"deleting entire file contents...\");\n try {\n FileOutputStream openFileInput = openFileOutput(\"Locations.txt\", MODE_PRIVATE);\n PrintWriter printWriter = new PrintWriter(openFileInput);\n printWriter.print(\"\");\n printWriter.close();\n Log.d(\"debugMode\", \"deleting entire file contents successful\");\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "private void guardarComo() {\r\n\t\tJFileChooser guardar = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tguardar.setFileFilter(filtro);\r\n\t\tif(guardar.showSaveDialog(guardar) == JFileChooser.APPROVE_OPTION){\r\n\t\t\tGestion.setFichero(Gestion.extensionValida(guardar.getSelectedFile()));\r\n\t\t\ttry {\r\n\t\t\t\tif(!Gestion.existe(Gestion.getFichero())){\r\n\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tswitch(JOptionPane.showConfirmDialog(null, \"El archivo existe. Desea sobreescribirlo?\", \"Aviso\", JOptionPane.WARNING_MESSAGE)){\r\n\t\t\t\t\tcase JOptionPane.OK_OPTION:\r\n\t\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void OuvrirAgd() {\n //on charge l'agenda à partir d'un fichier en lecture\n try {\n File agd_a_lire = new File(\"C:\\\\Projet_Agenda_ING3\\\\saved_agendas\");\n Scanner sc = new Scanner(agd_a_lire);\n\n //on lit le fichier ligne par ligne\n /*while (sc.) {\n\n }*/\n\n sc.close();\n } catch (Exception e) {\n System.out.print(\"Erreur d'ouverture du fichier en lecture\\n\");\n }\n }", "public void apagarFicheiro(String s) {\r\n\t\tFile f = new File(s + \".dat\");\r\n\t\ttry {\r\n\t\t\tif (f.exists()) {\r\n\t\t\t\tf.delete();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t//\r\n\t\t}\r\n\t}", "public void EliminarArchivos(){\n\t\ttry{\n\t\tFile Delete = new File(\"Cod.txt\");\n\t\tDelete.deleteOnExit();\n\t\tFile Borrar = new File(\"Maq.txt\");\n\t\tBorrar.deleteOnExit();\n\t\tFile eliminar = new File(\"WS.txt\");\n\t\teliminar.deleteOnExit();\n\t\tFile Bye = new File(\"RESPALDO.txt\");\n\t\tBye.deleteOnExit();\n\t\t\tBufferedReader numero= new BufferedReader(new FileReader(\"WS.txt\"));\n\t\t\tString valor = numero.readLine();\n\t\t\tint NumAreas= Integer.valueOf(valor);\n\t\t\tfor(int i=0; i< NumAreas;i++){\n\t\t\t\tvalor= numero.readLine();\n\t\t\t\tFile eliminas = new File(\"WS\"+valor+\".txt\");\n\t\t\t\teliminas.deleteOnExit();\n\t\t\t}\n\t\t\tnumero.close();\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(\"File not found\");\n\t\t}\n\t}", "public void disabilitaRegolaConDispositivo(String nomeDispositivo) {\n String[] regole = readRuleFromFile().split(\"\\n\");\n for (String s : regole) {\n try {\n ArrayList<String> disps = verificaCompRegola(s);\n\n if (disps.contains(nomeDispositivo)) {\n cambiaAbilitazioneRegola(s,false);\n }\n\n } catch (Exception e) {\n String msg = e.getMessage();\n }\n\n if (s.contains(nomeDispositivo)) {\n cambiaAbilitazioneRegola(s, false);\n }\n }\n }", "private void cargarFichero() throws FileNotFoundException {\n\t\tFile miFichero = new File(NOMBRE_FICHERO);\n\t\tFileWriter erroresFichero;\n\t\t\n\t\tScanner in = new Scanner(miFichero);\n\t\t\n\t\tEjercicio nuevoEjer;\n\t\tString siguienteLinea;\n\t\tComprobadorEntradaFichero comprobador = new ComprobadorEntradaFichero();\n\t\tString errores = \"\";\n\t\tint numLinea = 1;\n\t\t\n\t\twhile (in.hasNextLine()) {\n\t\t\t\n\t\t\tsiguienteLinea = in.nextLine();\n\t\t\tif (comprobador.test(siguienteLinea)) {\n\t\t\t\tnuevoEjer = new Ejercicio(siguienteLinea);\n\t\t\t\tcoleccionEj.addEjercicio(nuevoEjer);\n\t\t\t} else {\n\t\t\t\t//Controlar cuántos errores va dando\n\t\t\t\terrores += \"Error en la línea: \" + String.valueOf(numLinea) + \". Datos: \" + siguienteLinea + \"\\n\";\n\t\t\t}\n\t\t\tnumLinea++;\n\t\t}\n\t\t\n\t\tin.close();\n\t\t\n\t\t\n\t\t//Ahora escribimos \n\t\tif (errores != \"\") {\n\t\t\ttry {\n\t\t\t erroresFichero = new FileWriter(NOMBRE_FICHERO_ERRORES);\n\t\t\n\t\t\t erroresFichero.write(errores);\n\n\t\t\t erroresFichero.close();\n\n\t\t\t} catch (Exception ex) {\n\t\t\t\tSystem.out.println(\"Mensaje de la excepción: \" + ex.getMessage());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "void reloadeRooms( ) throws FileNotFoundException;", "public void afterCleaner() throws NumberFormatException, IOException{\n \t\t\t fileCleaner(\"ini.time\" );\n \t\t\t fileCleaner(\"failed.num\" );\n// \t\t\t fileCleaner(\"test.num\" );\n \t\t\t fileCleaner(\"add.num\" );\n// \t\t\t fileCleaner(\"prev.num\" );\n \t\t\t fileCleaner(\"server.info\");\n \t\t\t fileCleaner(\"email.opt\" );\n \t\t\t fileCleaner(\"email.all\" );\n \t\t\t fileCleaner(\"email.cont\" );\n \t\t\t fileCleaner(\"email.subj\" );\n \t\t\t fileCleaner(\"add.show\" );\n \t\t\t fileCleaner(\"screen-shots.zip\");\n \t\t\t fileCleaner(\"screen-shots.renameToZip\");\n \t\t}", "public void saveFile() {\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\tfileloc += ((MinLFile) tabbedPane.getSelectedComponent()).filename;;\t\t\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\ttry {\n\t\t\tif(fl.exists()) {\n\t\t\t\tint option = JOptionPane.showConfirmDialog(null, \"The file with this name already exists, do you want to overwrite it?\", \"Save File\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(option == 0) {\n\t\t\t\t\tFiles.delete(fl.toPath());\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\tFileWriter fw = new FileWriter(fileloc);\n\t\t\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\t\t\tbw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText());\n\t\t\t\t\t\tbw.close();\n\t\t\t\t\t\tfw.close();\n\t\t\t\t\t\t((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false;\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tFileWriter fw = new FileWriter(fileloc);\n\t\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\t\tbw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText());\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t\t((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false;\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The specified folder doesnt exist.\");\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "private void fecharArquivoEscrita(BufferedWriter file) {\n\t\ttry {\n\t\t\tfile.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void 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 static void createFileUmidade() throws IOException {\r\n\t\tInteger defaultUmidade = 30;\r\n\t\tarqUmidade = new File(pathUmidade);\r\n\t\tif(!arqUmidade.exists()) {\r\n\t\t\tarqUmidade.createNewFile();\r\n\t\t\tFileWriter fw = new FileWriter(getArqUmidade());\r\n\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\tbuffWrite.append(defaultUmidade.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma umidade Inicial*/\r\n\t\t\tbuffWrite.close();\r\n\t\t}else {\r\n\t\t\tFileReader fr = new FileReader(getArqUmidade());\r\n\t\t\tBufferedReader buffRead = new BufferedReader(fr);\r\n\t\t\tif(!buffRead.ready()) {/*Se o arquivo se encontar criado mas estiver vazio*/\r\n\t\t\t\tFileWriter fw = new FileWriter(arqUmidade);\r\n\t\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\t\tbuffWrite.append(defaultUmidade.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma umidade Inicial*/\r\n\t\t\t\tbuffWrite.close();\r\n\t\t\t}\r\n\t\t\tbuffRead.close();\r\n\t\t}\r\n\t}", "private void grabarArchivo() {\n\t\tPrintWriter salida;\n\t\ttry {\n\t\t\tsalida = new PrintWriter(new FileWriter(super.salida));\n\t\t\tsalida.println(this.aDevolver);\n\t\t\tsalida.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void guardarContribuintes () throws IOException {\n FileWriter f = new FileWriter(\"registo_contribuintes.txt\");\n \n for(String NIF : contribuintes.keySet())\n f.write(getContribuinte(NIF).toString());\n \n f.close();\n }", "public void leeArchivo() throws IOException {\n // defino el objeto de Entrada para tomar datos\n BufferedReader brwEntrada;\n try {\n // creo el objeto de entrada a partir de un archivo de texto\n brwEntrada = new BufferedReader(new FileReader(\"datos.txt\"));\n } catch (FileNotFoundException e) {\n // si marca error es que el archivo no existia entonces lo creo\n File filPuntos = new File(\"datos.txt\");\n PrintWriter prwSalida = new PrintWriter(filPuntos);\n // le pongo datos ficticios o de default\n // lo cierro para que se grabe lo que meti al archivo\n prwSalida.close();\n // lo vuelvo a abrir porque el objetivo es leer datos\n brwEntrada = new BufferedReader(new FileReader(\"datos.txt\"));\n }\n // con el archivo abierto leo los datos que estan guardados\n brwEntrada.close();\n }", "public static void fix(World world) {\n \t\tFile regionFolder = new File(Bukkit.getWorldContainer() + File.separator + world.getName() + File.separator + \"region\");\r\n \t\tif (regionFolder.exists()) {\r\n \t\t\t// Loop through all region files of the world\r\n \t\t\tint dx, dz;\r\n \t\t\tint rx, rz;\r\n \t\t\tfor (String regionFileName : regionFolder.list()) {\r\n \t\t\t\t// Validate file\r\n \t\t\t\tFile file = new File(regionFolder + File.separator + regionFileName);\r\n \t\t\t\tif (!file.isFile() || !file.exists()) {\r\n \t\t\t\t\tcontinue;\r\n \t\t\t\t}\r\n \t\t\t\tString[] parts = regionFileName.split(\"\\\\.\");\r\n \t\t\t\tif (parts.length != 4 || !parts[0].equals(\"r\") || !parts[3].equals(\"mca\")) {\r\n \t\t\t\t\tcontinue;\r\n \t\t\t\t}\r\n \t\t\t\t// Obtain the chunk offset of this region file\r\n \t\t\t\ttry {\r\n \t\t\t\t\trx = Integer.parseInt(parts[1]) << 5;\r\n \t\t\t\t\trz = Integer.parseInt(parts[2]) << 5;\r\n \t\t\t\t} catch (Exception ex) {\r\n \t\t\t\t\tcontinue;\r\n \t\t\t\t}\r\n \r\n \t\t\t\t// Is it contained in the cache?\r\n \t\t\t\tReference<RegionFile> ref = RegionFileCacheRef.FILES.get(file);\r\n \t\t\t\tRegionFile reg = null;\r\n \t\t\t\tif (ref != null) {\r\n \t\t\t\t\treg = ref.get();\r\n \t\t\t\t}\r\n \t\t\t\tboolean closeOnFinish = false;\r\n \t\t\t\tif (reg == null) {\r\n \t\t\t\t\tcloseOnFinish = true;\r\n \t\t\t\t\t// Manually load this region file\r\n \t\t\t\t\treg = new RegionFile(file);\r\n \t\t\t\t}\r\n \t\t\t\t// Obtain all generated chunks in this region file\r\n \t\t\t\tfor (dx = 0; dx < 32; dx++) {\r\n \t\t\t\t\tfor (dz = 0; dz < 32; dz++) {\r\n \t\t\t\t\t\tif (reg.c(dx, dz)) {\r\n \t\t\t\t\t\t\t// Region file exists - add it\r\n\t\t\t\t\t\t\tfix(world, rx + dx, rz + dz, true);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (closeOnFinish) {\r\n \t\t\t\t\t// Close the region file stream - we are done with it\r\n \t\t\t\t\treg.c();\r\n \t\t\t\t}\r\n \t\t\t}\r\n\t\t} else {\r\n\t\t\tNoLagg.plugin.log(Level.WARNING, \"Failed to fix world '\" + world.getName() + \"': Region folder is missing!\");\r\n \t\t}\r\n \t}", "private void guardarArchivoMemoriaInterna(String objeto,String fileName,int modoGuardado) throws FileSaverException{\n String msg = contexto.getResources().getString(R.string.fileSaverErrorEscrituraLocal);\n FileOutputStream mOutput;\n if(objeto!=null) {\n try {\n Log.v(TAG,\"Guardando el archivo \"+fileName+\" en memoriaInterna\");\n mOutput = contexto.openFileOutput(fileName, modoGuardado);\n mOutput.write(objeto.toString().getBytes());\n mOutput.flush();\n mOutput.close();\n msg = contexto.getResources().getString(R.string.fileSaverAlmacenExitoso);\n Log.v(TAG,msg);\n }\n catch(FileNotFoundException e){\n throw new FileSaverException(msg);\n }\n catch(IOException e){\n throw new FileSaverException(msg);\n }\n }\n else{\n throw new FileSaverException(msg);\n }\n }", "private void RemoverMapa(String nomeMapa){\n try{\n BufferedReader br = new BufferedReader(new FileReader(caminho.getPath()+\"/caminho.txt\"));\n File rm = new File(caminho.getPath()+\"/\"+nomeMapa+\".txt\");\n rm.delete();\n String linha = br.readLine();\n ArrayList<String> salvar = new ArrayList();\n String array[] = new String[3];\n while (linha != null){\n array = linha.split(\",\");\n if(!array[1].equals(nomeMapa)){\n salvar.add(linha);\n }\n linha = br.readLine();\n }\n br.close();\n FileWriter fw = new FileWriter(caminho.getPath()+\"/caminho.txt\", true);\n fw.close();\n BufferedWriter bw = new BufferedWriter(new FileWriter(caminho.getPath()+\"/caminho.txt\"));\n for (int i = 0; i < salvar.size();i++){\n bw.write(salvar.get(i));\n bw.newLine();\n }\n bw.close();\n\n }catch (IOException ioe){\n }\n }", "public EnigmaFile() throws Exception\n {\n\n String path = Main.class.getClassLoader().getResource(\"filein.txt\").getPath();\n File currentDirectory=new File(path);\n finstream = new FileInputStream(currentDirectory);\n\n\n String pathToWrite = path.replaceFirst(\"filein.txt\",\"fileout.txt\");\n File outputFile = new File(pathToWrite);\n br = new BufferedReader(new InputStreamReader(finstream));\n outputFile.createNewFile();\n FileWriter fileWrite = new FileWriter(outputFile.getAbsoluteFile());\n writer = new BufferedWriter(fileWrite);\n\n\n }", "public static void LeerCaracter(File rutaLeer, File rutaEscribir) throws IOException {\n\n FileReader lector = new FileReader(rutaLeer);\n FileWriter escritor = new FileWriter(rutaEscribir);\n\n String cartelera = (\"--------------------------------------\\n\"\n + \" Cartelera de CineFBMoll\\n\"\n + \"--------------------------------------\\n\\n\");\n\n String linea = \"--------------------------------------\\n\\n\";\n\n //se escribe la cartelera\n for (int i = 0; i < cartelera.length(); i++) {\n escritor.write(cartelera.charAt(i));\n }\n\n int caracter;\n int contador = 0;\n boolean encontrarSigno = true;\n\n while ((caracter = lector.read()) != -1) {\n if (((char) caracter) != '#') {\n if (((char) caracter) != '{') {\n if (encontrarSigno) {\n for (int i = 0; i < datos[contador].length(); i++) {\n escritor.write(datos[contador].charAt(i)); // imprimir elemento de datos\n }\n escritor.write(\": \");\n encontrarSigno = false;\n }\n escritor.write(((char) caracter));\n } else {\n escritor.write(\"\\n\");\n escritor.write(\"\\n\");\n for (int i = 0; i < linea.length(); i++) {\n escritor.write(linea.charAt(i));\n }\n\n contador = 0;\n encontrarSigno = true;\n }\n } else {\n escritor.write(\"\\n\");\n escritor.write(\"\\n\");\n contador++;\n encontrarSigno = true;\n }\n }//while\n lector.close();// Cierra el archivo \n escritor.close();// Cierra el archivo \n\n }", "public void escribir(String direccion,String texto) {\n try {\n FileWriter writer = new FileWriter(direccion);\n PrintWriter print = new PrintWriter(writer);\n print.print(texto);\n writer.close();\n } catch (IOException e) {\n System.out.println(e.getMessage());\n }\n }", "public void save() {\r\n File distDataFile = new File(path);\r\n\r\n //String basePath = path;\r\n String endOfPath = path.substring(path.lastIndexOf(\"/\"));\r\n\r\n File rootDataFile;\r\n if (!path.contains(\"artists\")) {\r\n rootDataFile = new File(BASEDIR + \"/resources/data\" + endOfPath);\r\n } else {\r\n rootDataFile = new File(BASEDIR + \"/resources/data/artists\" + endOfPath);\r\n }\r\n\r\n File distTempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n File rootTempFile;\r\n if (!path.contains(\"artists\")) {\r\n rootTempFile = new File(BASEDIR + \"/resources/data/myTempFile.txt\");\r\n } else {\r\n rootTempFile = new File(BASEDIR + \"/resources/data/artists/myTempFile.txt\");\r\n }\r\n \r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(distTempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n distDataFile.delete();\r\n distTempFile.renameTo(distDataFile);\r\n\r\n BufferedWriter bw2 = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(rootTempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw2.write(line);\r\n bw2.newLine();\r\n }\r\n\r\n bw2.close();\r\n rootDataFile.delete();\r\n rootTempFile.renameTo(rootDataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOExceptoin in save1 : FileData\");\r\n }\r\n }", "void saveSimpleCodesToFile() {\n\t\tPrintWriter writer;\r\n\t\ttry {\r\n\t\t\t//writer = new PrintWriter(pathStr + \"/../pt.iscte.pidesco.codegenerator/Settings/Code.cg\", \"UTF-8\");\r\n\t\t\twriter = new PrintWriter(\"Code.cg\", \"UTF-8\");\r\n\t\t\tfor (SimpleCode sc : SimpleCodeMap.values()) {\r\n\t\t\t\twriter.print(sc.getCodeName() + \"-CGSeparator-\" + sc.resultCodeToWrite());\r\n\t\t\t\twriter.print(\"-CGCodeSeparator-\");\r\n\t\t\t}\r\n\t\t\twriter.close();\r\n\t\t} catch (FileNotFoundException | UnsupportedEncodingException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "static void escribir(Planeta planeta_a_escribir) {\n if (escritor != null) {\n try {\n escritor.writeObject(planeta_a_escribir);\n \n } catch (IOException ex) {\n System.out.println(\"Error al escribir el archivo\");\n }\n }\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\tListaNombre nombres = new ListaNombre();\n//\t\tnombres.add(new Nombre(\"guido\"));\n//\t\tnombres.add(new Nombre(\"guido\"));\n//\t\tnombres.add(new Nombre(\"guido\"));\n//\t\tnombres.add(new Nombre(\"juan\"));\n//\t\tnombres.add(new Nombre(\"juan\"));\n//\t\tnombres.add(new Nombre(\"daria\"));\n//\t\tnombres.add(new Nombre(\"daria\"));\n//\t\tnombres.add(new Nombre(\"pedro\"));\n//\t\tnombres.add(new Nombre(\"pedro\"));\n//\t\tnombres.add(new Nombre(\"pedro\"));\n//\t\tnombres.setCantRepetidos(3);\n//\t\tfor (Nombre nom : nombres.getNombres()) {\n//\t\t\tSystem.out.println(nom.getNombre() + \" \" + nom.getCant());\n//\t\t}\n\t\tnombres = ( Archivo.leer(\"C:\\\\Users\\\\guido\\\\eclipse-workspace\\\\DescubriendoNombresRepetidos\\\\premioA.in\"));\n\t\tArchivo.escribir(\"C:\\\\Users\\\\guido\\\\eclipse-workspace\\\\DescubriendoNombresRepetidos\\\\salida.out\",nombres);\n\t}", "public void loadSave(){\n if((new File(\"data.MBM\")).exists()){\n isNew = false;\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"data.MBM\"));\n String line = br.readLine();\n \n while (line != null) {\n \n if(line.contains(\"outDir\")){\n String[] result = line.split(\":\");\n outputDir = new File(result[1]);\n if(outputDir.exists() == false){\n isNew = true;\n }\n }\n else if(line.contains(\"MBMWORLD\")){\n String[] result = line.split(\":\");\n //1 = filename\n //2 = world name\n //3 = path\n //4 = date\n addWorld(new File(result[3]), result[2]);\n worlds.get(numWorlds()-1).setLastBackup(result[4]);\n }\n \n line = br.readLine();\n }\n \n br.close();\n \n } catch(IOException e){\n System.out.println(e);\n }\n }\n }", "public void service_psy (Personne p) throws FileNotFoundException\r\n\t{\r\n\t\r\n\t\t\r\n\t\t \t\tString [] info_psy=null ;\r\n\t\t \t\tString [] cle_valeur=null;\r\n\t\t \t\tboolean spec,adr;\r\n\t\t \t\tFileInputStream f=new FileInputStream(\"C://Users/Azaiez Hamed/Desktop/workspace/Projet de programmation/src/Medecin.txt\");\r\n\t\t \t\ttry {\r\n\t\t \t\t\tBufferedReader reader =new BufferedReader (new InputStreamReader(f,\"UTF-8\"));\r\n\t\t \t\t\tString line=reader.readLine();\r\n\t\t \t\t\twhile(line!=null){\r\n\t\t \t\t\t\tinfo_psy=line.split(\"\\t\\t\\t\");\r\n\t\t \t\t\t\tspec=false;adr=false;\r\n\t\t \t\t\t\tfor(int i=0;i<info_psy.length;i++)\r\n\t\t \t\t\t\t{\r\n\t\t \t\t\t\t\t cle_valeur=info_psy[i].split(\":\");\r\n\t\t\t\t\t\t if ((cle_valeur[0].equals(\"specialite\"))&& (cle_valeur[1].equals(\"psy\")))\r\n\t\t\t\t\t\t \t spec=true;\r\n\t\t\t\t\t\t if ((cle_valeur[0].equals(\"gouvernerat\"))&&(cle_valeur[1].equals(p.getGouvernerat())))\r\n\t\t \t\t\t\t\t \tadr=true;\r\n\t\t\t\t\t\t}\r\n\t\t \t\t\t\tif (spec && adr) {\r\n\t\t \t\t\t\t\t System.out.println(\"voilà toutes les informations du psy, veuillez lui contacter immédiatement **\");\r\n\t\t \t\t\t\t\t System.out.println(line);return;}\r\n\t\t \t\t\t\telse\r\n\t\t \t\t\t\t line=reader.readLine();\r\n\t\t \t\t\t\t }\r\n\t\t \t\t }\r\n\t\t \t\t \tcatch(IOException e){e.printStackTrace();}\r\n\t\t \t\t System.out.println(\"Pas de psy trouvé dans votre gouvernerat\");\r\n\t}", "private void validateFile(final boolean isRustica) {\n\t\thayErroresFilas = false;\r\n\t\thayErroresFila = false;\r\n\r\n\t\tcampoMasaCorrectos = true;\r\n\t\tcampoHojaCorrecto = true;\r\n\t\tcampoParecelaCorrecto = true;\r\n\t\tcampoTipoCorrecto = true;\r\n\t\tcampoFechaAltaCorrecto = true;\r\n\t\tcampoFechaBajaCorrecto = true;\r\n\r\n\t\tFile currentDirectory = (File) blackboard.get(ImportarUtils_LCGIII.LAST_IMPORT_DIRECTORY);\r\n\r\n\t\tGeopistaFiltroFicheroFilter filter = new GeopistaFiltroFicheroFilter();\r\n\t\tfilter.addExtension(\"SHP\");\r\n filter.setDescription(\"Shapefiles\");\r\n\t\t\r\n final JFileChooser jfc;\r\n final JTextField jtf;\r\n if (isRustica)\r\n {\r\n \tjfc = fcRustica;\t\r\n \tjtf = this.txtFicheroRustica;\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t\tjfc = fcUrbana;\r\n\t\t\tjtf = this.txtFicheroUrbana;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// FILES(*.*)\r\n jfc.setFileFilter(filter);\r\n \tjfc.setAcceptAllFileFilterUsed(false); // QUITA LA OPCION ALL\r\n\t\tjfc.setCurrentDirectory(currentDirectory);\r\n\t\t\r\n\t\tint returnVal = jfc.showOpenDialog(this);\r\n\t\tblackboard.put(ImportarUtils_LCGIII.LAST_IMPORT_DIRECTORY, jfc.getCurrentDirectory());\r\n\r\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION)\r\n\t\t{\r\n\t\t\t// Cargamos el fichero que hemos obtenido\r\n\t\t\tString fichero;\r\n\t\t\tfichero = jfc.getSelectedFile().getPath();\r\n\t\t\tjtf.setText(fichero); // meto el fichero seleccionado\r\n\t\t\t// en el campo\r\n\r\n\t\t\tcadenaTexto = \"<font face=SansSerif size=3>\"\r\n\t\t\t\t+ aplicacion.getI18nString(\"ImportacionComenzar\") + \"<b>\" + \" \"\r\n\t\t\t\t+ jfc.getSelectedFile().getName() + \"</b>\";\r\n\t\t\t\r\n\t\t\tcadenaTexto = cadenaTexto + \"<p>\" + aplicacion.getI18nString(\"OperacionMinutos\") + \" ...</p></font>\";\r\n\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"importar.datos.parcelas\");\r\n\r\n\t\t\tediError.setText(cadenaTexto);\r\n\t\t\tcadenaTexto=\"\";\r\n\r\n\t\t\tfinal TaskMonitorDialog progressDialog = \r\n\t\t\t\tnew TaskMonitorDialog(aplicacion.getMainFrame(), geopistaEditor.getContext().getErrorHandler());\r\n\r\n\t\t\tprogressDialog.setTitle(aplicacion.getI18nString(\"ValidandoDatos\"));\r\n\t\t\tprogressDialog.report(aplicacion.getI18nString(\"ValidandoDatos\"));\r\n\t\t\tprogressDialog.addComponentListener(new ComponentAdapter()\r\n\t\t\t{\r\n\t\t\t\tpublic void componentShown(ComponentEvent e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Wait for the dialog to appear before starting the\r\n\t\t\t\t\t// task. Otherwise\r\n\t\t\t\t\t// the task might possibly finish before the dialog\r\n\t\t\t\t\t// appeared and the\r\n\t\t\t\t\t// dialog would never close. [Jon Aquino]\r\n\t\t\t\t\tnew Thread(new Runnable()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tpublic void run()\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tGeopistaLayer layerParcelas = (GeopistaLayer) blackboard.get(\"capaParcelasInfoReferencia\");\r\n\t\t\t\t\t\t\t\tif (layerParcelas != null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tgeopistaEditor.getLayerManager().remove(layerParcelas);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tlayerParcelas = (GeopistaLayer) geopistaEditor.loadData(\r\n\t\t\t\t\t\t\t\t\t\tjfc.getSelectedFile().getAbsolutePath(),\r\n\t\t\t\t\t\t\t\t\t\taplicacion.getI18nString(\"importar.informe.parcelas\"));\r\n\t\t\t\t\t\t\t\tlayerParcelas.setActiva(false);\r\n\t\t\t\t\t\t\t\tlayerParcelas.addStyle(new BasicStyle(new Color(64, 64,64)));\r\n\t\t\t\t\t\t\t\tlayerParcelas.setVisible(false);\r\n\r\n\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\tblackboard.put(\"capaParcelasInfoReferencia\", layerParcelas);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tblackboard.put(\"capaParcelasInfoReferenciaUrbana\", layerParcelas);\r\n\r\n\t\t\t\t\t\t\t\t// Obtener el esquema\r\n\t\t\t\t\t\t\t\tFeatureSchema esquema = layerParcelas.getFeatureCollectionWrapper().getFeatureSchema();\r\n\r\n\t\t\t\t\t\t\t\t// Localizar los campos\r\n\t\t\t\t\t\t\t\tcampoMasaCorrectos = encontrarCampo(\"MASA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoHojaCorrecto = encontrarCampo(\"HOJA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoParecelaCorrecto = encontrarCampo(\"PARCELA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoTipoCorrecto = encontrarCampo(\"TIPO\",esquema);\r\n\t\t\t\t\t\t\t\tcampoFechaAltaCorrecto = encontrarCampo(\"FECHAALTA\", esquema);\r\n\t\t\t\t\t\t\t\tcampoFechaBajaCorrecto = encontrarCampo(\"FECHABAJA\", esquema);\r\n\r\n\t\t\t\t\t\t\t\tif (campoMasaCorrectos \r\n\t\t\t\t\t\t\t\t\t\t&& campoHojaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoParecelaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoTipoCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoFechaAltaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoFechaBajaCorrecto)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// A partir de aqui hay que\r\n\t\t\t\t\t\t\t\t\t// verificar que no hay nulos y es\r\n\t\t\t\t\t\t\t\t\t// del tipo correcto los valores.\r\n\t\t\t\t\t\t\t\t\tList listaLayer = layerParcelas.getFeatureCollectionWrapper().getFeatures();\r\n\t\t\t\t\t\t\t\t\tIterator itLayer = listaLayer.iterator();\r\n\r\n\t\t\t\t\t\t\t\t\twhile (itLayer.hasNext())\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (hayErroresFila)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tFeature f = (Feature) itLayer.next();\r\n\t\t\t\t\t\t\t\t\t\tString masa = f.getString(\"MASA\");\r\n\t\t\t\t\t\t\t\t\t\tString hoja = f.getString(\"HOJA\");\r\n\t\t\t\t\t\t\t\t\t\tString parcela = f.getString(\"PARCELA\");\r\n\r\n\t\t\t\t\t\t\t\t\t\tString tipo = f.getString(\"TIPO\");\r\n\t\t\t\t\t\t\t\t\t\t// Comprobamos que no sea nulo y\r\n\t\t\t\t\t\t\t\t\t\t// sea una U o una R\r\n\t\t\t\t\t\t\t\t\t\tif ((!tipo.equals(\"U\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"R\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"D\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"X\")))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// Solo puede haber una R \r\n\t\t\t\t\t\t\t\t\t\t\t// una U una D o una X.\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.rustico\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\telse if (!isRustica && (tipo.equals(\"R\") || tipo.equals(\"D\") || tipo.equals(\"X\")))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.urbana\") + \r\n\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse if (isRustica && tipo.equals(\"U\"))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.rustica\") + \r\n\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que la fecha\r\n\t\t\t\t\t\t\t\t\t\t\t// que viene sea fecha\r\n\t\t\t\t\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tDate date = (Date) formatter.parse(f.getString(\"FECHAALTA\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que la\r\n\t\t\t\t\t\t\t\t\t\t\t\t// fecha de baja es nula\r\n\t\t\t\t\t\t\t\t\t\t\t\t// o valida o 9999999\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (f.getString(\"FECHABAJA\").equals(\"99999999\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Correcto\r\n\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ((f.getString(\"FECHABAJA\")) == null)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que sea una fecha correcta\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDateFormat formatter1 = new SimpleDateFormat(\"yyyyMMdd\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate date1 = (Date) formatter1.parse(f.getString(\"FECHABAJA\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcatch (Exception excp)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texcp.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fecha.baja\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t//jtf.setBorder(BorderFactory.createLineBorder(Color.GREEN, 2));\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\trusticaValida = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\turbanaValida = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\tcatch (Exception exc)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t// En la fecha de alta\r\n\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fecha.alta.validacion\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\t\texc.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//Se comprueba si la geometría es de tipo polygon y no es empty (únicas válidas en la capa parcelas)\r\n\t\t\t\t\t\t\t\t\t\t\tif (!(f.getGeometry() instanceof Polygon)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| f.getGeometry().isEmpty())\r\n\t\t\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.geometria\") + \r\n\t\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// Alguno de los campos no están\r\n\t\t\t\t\t\t\t\t\t// definidos\r\n\t\t\t\t\t\t\t\t\t// JOptionPane.showMessageDialog(this,aplicacion.getI18nString(\"importar.informe.parcelas.algun.campo\"));\r\n\t\t\t\t\t\t\t\t\tcadenaTexto += aplicacion.getI18nString(\"importar.informacion.ficheros.no.correctos\");\r\n\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\t\trusticaValida = false;\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\turbanaValida = false;\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tcatch (Exception e)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tfinally\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tprogressDialog.setVisible(false);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}).start();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tGUIUtil.centreOnWindow(progressDialog);\r\n\t\t\tprogressDialog.setVisible(true);\r\n\r\n\t\t\tif (hayErroresFilas)\r\n\t\t\t{\r\n\t\t\t\tjtf.setBorder(BorderFactory.createLineBorder(Color.RED, 2));\r\n\t\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"validacion.finalizada\");\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tjtf.setBorder(BorderFactory.createLineBorder(Color.GREEN, 2));\r\n\t\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"importar.informe.parcelas.fichero.correcto\")\r\n\t\t\t\t+ aplicacion.getI18nString(\"validacion.finalizada\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tediError.setText(cadenaTexto);\r\n\t\t\twizardContext.inputChanged();\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\r\n String cFields = \"NIC,SIMBOLO_VARIABLE,FECHA_VENCIMIENTO,FECHA_PAGO_OPORTUNO,FECHA_EMISION,NUMERO_FACTURA,INDICATIVO_SUMINISTRO,CIIU,TIPO_COBRO,SECUENCIAL_RECIBO,NIS,TIPO_SERVICIO,ORDEN_LECTURA,MEDIDOR,LECT_ANTERIOR,LECT_ACTUAL,FECHA_LECTURA_ACTUAL,CONSUMO_FACTURADO,VALOR_FACTURA,GRUPO_FAMILIAR,PRECIO_UNITARIO_CU,IND_VISUSALIZACION_BARCODI,IMPORTE_TOTAL_DEUDA,CANTIDAD_FACTURAS_ADEUDADAS,DESC_ANOMALIA_LECTURA,IMPORTE_TOTAL_FACTURA,SUBTOTAL_FACTURA,DESCRIPCION_TARIFA,CONSUMO_PROMEDIO,DIAS_FACTURADOS,CLAVE_ORDEN_FACTURA,PROPIEDAD_EQUIPO_MEDIDA,UNICOM,RUTA,ITINERARIO\";\r\n fields = cFields.split(\",\");\r\n\r\n readConfiguracion();\r\n\r\n if (configuracion.size() != fields.length) {\r\n System.out.println(\"Longitud de campos y configuración es diferente. Fields: \" + fields.length + \" Configuracion: \" + configuracion.size());\r\n Utilidades.AgregarLog(\"Longitud de campos y configuración es diferente. Fields: \" + fields.length + \" Configuracion: \" + configuracion.size());\r\n return;\r\n }\r\n\r\n if (configuracion.size() > 0) {\r\n System.out.println(\"Campos a leer: \" + configuracion.size());\r\n Utilidades.AgregarLog(\"Campos a leer: \" + configuracion.size());\r\n String ruta = \"C:\\\\REPARTO\\\\\";\r\n File directorio = new File(ruta);\r\n Utilidades.AgregarLog(\"Descomprimiendo archivos ruta:\" + ruta);\r\n DescomprimirArchivosCarpeta(directorio);\r\n Utilidades.AgregarLog(\"Procesando archivos de reparto en ruta:\" + ruta);\r\n ProcesarDirectorio(directorio);\r\n\r\n } else {\r\n System.out.println(\"No se ha cargado la configuracion\");\r\n Utilidades.AgregarLog(\"No se ha cargado la configuracion\");\r\n }\r\n\r\n }", "public static void main(String[] args){\n File testFile = new File(args[1]);\n File testFile_new = new File(args[2]);\n String all = \"\";\n // read all data\n try {\n Scanner input = null;\n input = new Scanner(testFile);\n while (input.hasNext()){\n all += input.nextLine() + \"\\r\\n\";\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n // print and replace\n System.out.println(all);\n all = all.replaceAll(args[0], \"\");\n // save to other file with replaced\n try{\n PrintWriter output = new PrintWriter(testFile_new);\n output.write(all);\n output.close();\n } catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n }", "@Override\n public void incluir(Colaborador objeto)throws Exception {\n try {\n System.out.println(\"Estou Gravando no Arquivo\" + nomeDoArquivoNoDisco);\n FileWriter fw = new FileWriter(nomeDoArquivoNoDisco, true);\n //Criar o buffer do arquivo\n BufferedWriter bw = new BufferedWriter(fw);\n //Escreve no arquivo\n bw.write(objeto.toString() + \"\\n\");\n //Fechar o arquivo\n bw.close();\n } catch (Exception erro) {\n throw erro;\n }\n }", "public void save() throws FileNotFoundException, IOException, ClassNotFoundException ;", "public void guardarPuntaje() {\r\n\t\tFile archivo = new File(\"archivos/puntajes.txt\");\r\n\t\tBufferedWriter bw;\r\n\t\ttry {\r\n\t\t\tif (archivo.exists()) {\r\n\t\t\t\tFileWriter fw = new FileWriter(archivo, true);\r\n\t\t\t\tbw = new BufferedWriter(fw);\r\n\t\t\t\tbw.write(\"\\r\\n\"+jugadorActual.getNombre()+\"-\"+jugadorActual.getPuntaje());\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tFileWriter fw = new FileWriter(archivo, true);\r\n\t\t\t\tbw = new BufferedWriter(fw);\r\n\t\t\t\tbw.write(jugadorActual.getNombre()+\"-\"+jugadorActual.getPuntaje());\r\n\t\t\t\t\r\n\t\t\t}\t\t\t\t\t\r\n\t\t\tbw.close();\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t}\r\n\t}", "static void inicializarentrada(){\n try {\n archivo_entrada= new FileInputStream(\"src/serializacion/salida.txt\");\n } catch (FileNotFoundException ex) {\n System.out.println(\"Error al abrir el archivo\");\n }\n \n try {\n lector= new ObjectInputStream(archivo_entrada);\n } catch (IOException ex) {\n System.out.println(\"Error al acceder al archivo\");\n }\n }", "public void crearArchivoDeTexto(String rutas,String nombre, String texto){\n try{\n archivo = new File(rutas + File.separator + nombre);\n String rutaCompleta=archivo.getAbsolutePath();\n \n System.out.println(rutaCompleta);\n FileWriter archivoEscritura= new FileWriter(rutaCompleta,true);\n BufferedWriter escritura= new BufferedWriter(archivoEscritura);\n escritura.append(texto+\"\\n\");\n escritura.close();\n archivoEscritura.close();\n }catch(FileNotFoundException e1){\n System.out.println(\"Ruta de archivo no encontrada\");\n }catch(IOException e2){\n System.out.println(\"Error de escritura\");\n }catch(Exception e3){\n System.out.println(\"Error General\");\n }\n }", "public void leerDeFichero() {\n try\n {\n Scanner sc = new Scanner(new File(\"texto.txt\"));\n while (sc.hasNextLine() && !textoCompleto())\n addFrase(sc.nextLine());\n sc.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "public void armarPreguntas(){\n preguntas = file.listaPreguntas(\"Preguntas.txt\");\n }", "public void guardarGrafo(final String archivo) {\n\t\tPrintWriter salida = null;// !=BufferedReader\n\t\ttry {\n\n\t\t\tsalida = new PrintWriter(new FileWriter(archivo));\n\t\t\tsalida.println(cantNodos + \" \" + cantAristas + \" \" + porcentAdy + \" \" + grMax + \" \" + grMin);\n\t\t\tfor (int f = 0; f < cantNodos; f++) {\n\t\t\t\tfor (int c = f + 1; c < cantNodos; c++) {\n\t\t\t\t\tif (getValor(f, c) == true) {\n\t\t\t\t\t\tsalida.println((f + 1) + \" \" + (c + 1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsalida.close();\n\t\t}\n\t}", "static void LeerArchivo(){ \r\n \t//iniciamos el try y si no funciona se hace el catch\r\n\r\n try{ \r\n \t//se crea un objeto br con el archivo de txt\r\n \tBufferedReader br = new BufferedReader( \r\n \tnew FileReader(\"reporte.txt\")\r\n );\r\n String s;\r\n //Mientras haya una linea de texto se imprime\r\n while((s = br.readLine()) != null){ \r\n System.out.println(s);\r\n }\r\n //se cierra el archivo de texto\r\n br.close(); \r\n } catch(Exception ex){\r\n \t//si no funciona se imprime el error\r\n System.out.println(ex); \r\n }\r\n }", "static void cerrarSalida(){\n if (escritor!=null){\n try {\n escritor.close();\n } catch (IOException ex) {\n System.out.println(\"Error al cerrar el archivo\");\n }\n }\n }", "private void updateFile(CrowdinFile _file) {\n String fileN = _file.getFile().getName();\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Initializing: \" + fileN);\n // Making sure the file is a master file and not a translation\n if (_file.getClass().equals(CrowdinFile.class)) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Init dir\");\n initDir(_file.getCrowdinPath());\n try {\n if (_file.getFile().exists()) {\n \n //escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersBeforeSyncFromCodeToCrowdin\");\n \n if (!getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Add file: \" + _file.getCrowdinPath());\n String result = getHelper().addFile(_file);\n if (result.contains(\"success\")) {\n getLog().info(\"File \" + fileN + \" created succesfully.\");\n initTranslations(_file);\n } else {\n getLog().warn(\"Cannot create file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n }\n } else {\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"*** Update file: \" + _file.getCrowdinPath());\n }\n String result = getHelper().updateFile(_file);\n System.out.println(result);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" updated succesfully.\");\n else\n getLog().warn(\"Cannot update file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n \n //remove escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersAfterSyncFromCodeToCrowdin\");\n \n }\n } else {\n if (getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Delete file: \" + _file.getCrowdinPath());\n String result = getHelper().deleteFile(_file);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" deleted succesfully.\");\n else\n getLog().warn(\"Cannot delete file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n }\n }\n } catch (MojoExecutionException e) {\n getLog().error(\"Error while updating file '\" + _file.getFile().getPath() + \"'. Exception:\\n\" + e.getMessage());\n }\n }\n }", "public static void fileEditor(String path, String search, String replace) {\t \t\n\t\t\ttry {\n\t\t\t\t File log= new File(path);\t \t\n\t\t\t FileReader fr = new FileReader(log);\n\t\t\t String s;\n\t\t\t String totalStr = \"\";\n\t\t\t try (BufferedReader br = new BufferedReader(fr)) {\n\t\t\t while ((s = br.readLine()) != null) { totalStr += s + \"\\n\"; }\t \n\t\t\t totalStr = totalStr.replaceAll(search, replace);\n\t\t\t FileWriter fw = new FileWriter(log);\n\t\t\t fw.write(totalStr);\n\t\t\t fw.close();\n\t\t\t }\n\t\t\t } catch(Exception e) { System.out.println(\"Problem reading file.\"); }\n\t\t\t}", "public void writeFile() {\n\t\ttry {\n\t\t\tFile dir = Environment.getExternalStorageDirectory();\n\t\t\tFile myFile = new File(dir.toString() + File.separator + FILENAME);\n\t\t\tLog.i(\"MyMovies\", \"SeSus write : \" + myFile.toString());\n\t\t\tmyFile.createNewFile();\n\t\t\tFileOutputStream fOut = new FileOutputStream(myFile);\n\t\t\tOutputStreamWriter myOutWriter = \n\t\t\t\t\tnew OutputStreamWriter(fOut);\n\t\t\tfor (Map.Entry<String, ValueElement> me : hm.entrySet()) {\n\t\t\t\tString refs = (me.getValue().cRefMovies>0? \"MOVIE\" : \"\");\n\t\t\t\trefs += (me.getValue().cRefBooks>0? \"BOOK\" : \"\");\n\t\t\t\tString line = me.getKey() + DELIMITER + me.getValue().zweiteZeile \n\t\t\t\t\t\t //+ DELIMITER\n\t\t\t\t\t\t //+ me.getValue().count\n\t\t\t\t\t \t+ DELIMITER\n\t\t\t\t\t \t+ refs\n\t\t\t\t\t \t + System.getProperty(\"line.separator\");\n\t\t\t\t//Log.i(\"MyMovies\", \"SeSus extracted : \" + line);\n\t\t\t\tmyOutWriter.write(line);\n\t\t\t}\n\t\t\tmyOutWriter.close();\n\t\t\tfOut.close();\n\t\t} catch (IOException e) {\n\t\t\t//\n\t\t\tLog.i(\"MyMovies\", \"SeSus write Exception : \");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic void remFile(String path) {\n\t\t\r\n\t}", "void abreArquivo (String filetText, String fileData){\n //Abre e le o arquivo\n arquivo.abrirArquivo(filetText); //Le primeiro arquivo\n separaDados.salvaInstrucao (arquivo.arquivo, memoria); //Salva na memoria de texto\n\n arquivo.abrirArquivo(fileData); //Le arquivo de dados\n separaDados.salvaDados (arquivo.arquivo, memoria); //Armazena arquivo lido na memoria\n }", "void writeToFile () throws IOException{\n FileWriter deleteFile = new FileWriter(\"Resolved Ticket of \" + this.resovedDate + \".txt\");\n BufferedWriter FileDeleted = new BufferedWriter(deleteFile);\n\n FileDeleted.write(\"Resolution: \" + this.Resolution + \" ; Date: \" + this.resovedDate);\n FileDeleted.close();\n }", "public void mo210a(File file) {\n }", "public void crearPrimerFichero(){\n File f=new File(getApplicationContext().getFilesDir(),\"datos.json\");\n // si no existe lo creo\n if(!f.exists()) {\n String filename = \"datos.json\";\n String fileContents = \"[]\";\n FileOutputStream outputStream;\n\n try {\n outputStream = openFileOutput(filename, Context.MODE_PRIVATE);\n outputStream.write(fileContents.getBytes());\n outputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n }", "public void suppfichier(String chemin) {\n Path path = Paths.get(chemin);\n if (path.toFile().isDirectory()) { //si c'esst un dossier\n try (DirectoryStream<Path> listing = Files.newDirectoryStream(path)) {\n if (path != null) {\n for (Path nom : listing) { //parsourir les fichier et sou dossier\n if (!Files.isDirectory(nom)) {\n Files.delete(nom);\n } else {\n suppfichier(nom.toFile().getAbsolutePath());\n }\n }\n Files.delete(path);\n } else {\n Files.delete(path);\n }\n } catch (IOException e) {\n File file = new File(chemin);\n file.delete();\n }\n } else {\n File file = new File(chemin);\n file.delete();\n }\n }", "private void abrirEntTransaccion(){\n try{\n entTransaccion = new ObjectInputStream(\n Files.newInputStream(Paths.get(\"trans.ser\")));\n }\n catch(IOException iOException){\n System.err.println(\"Error al abrir el archivo. Terminado.\");\n System.exit(1);\n }\n }", "public void setWorldFile(File newFile) {\n File configDirectory = new File(newFile,CONFIG_DIRECTORY);\n configDirectory.mkdir();\n\n String configName = generalConfigFile.getPath();\n String generalConfigDirectoryName = generalConfigFile.getParentFile().getPath();\n String detailName = configName.substring(generalConfigDirectoryName.length()+1);\n //logger.info(\"Filename \"+detailName);\n File localConfigFile = new File(configDirectory,detailName);\n setWorldConfigFile(localConfigFile);\n }", "public void save(File f) {\n\t\tif (f.exists()) {\r\n\t\t\tString filename = f.getName();\r\n\t\t\tString backName;\r\n\t\t\tif (filename.contains(\".\")) {\r\n\t\t\t\tbackName = filename.substring(0,filename.lastIndexOf('.'));\r\n\t\t\t\tbackName += \"_backup\";\r\n\t\t\t\tbackName += filename.substring(filename.lastIndexOf('.'));\r\n\t\t\t} else {\r\n\t\t\t\tbackName = filename + \"_backup\";\r\n\t\t\t}\r\n\t\t\tFile back = new File(f.getParent(),backName);\r\n\t\t\tSystem.out.println(\"Writing backup to: \"+back.getAbsolutePath());\r\n\t\t\tif (back.exists()) back.delete();\r\n\t\t\tFile newF = f;\r\n\t\t\tf.renameTo(back);\r\n\t\t\tf = newF;\r\n\t\t}\r\n\r\n\t\tFileOutputStream outputStream = null;\r\n\t\ttry {\r\n\t\t\tDocument doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();\r\n//\t\t\tb.append(\"<Map xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:noNamespaceSchemaLocation=\\\"map.xsd\\\">\");\r\n//\t\t\tProcessingInstruction pi = doc.createProcessingInstruction(\"xml-stylesheet\", \"type=\\\"text/xsl\\\" href=\\\"/assistantdm/static/CharacterSheetTemplate.xsl\\\"\");\r\n//\t\t\tdoc.appendChild(pi);\r\n\t\t\tXMLMapExporter processor = new XMLMapExporter(doc);\r\n\t\t\tmapPanel.executeProcess(processor);\r\n\t\t\tdoc.setXmlStandalone(true);\r\n\r\n\t\t\tTransformer trans = TransformerFactory.newInstance().newTransformer();\r\n\t\t\ttrans.setOutputProperty(OutputKeys.INDENT, \"yes\");\r\n\t\t\ttrans.setOutputProperty(OutputKeys.ENCODING, \"UTF-8\");\r\n\t\t\ttrans.setOutputProperty(\"{http://xml.apache.org/xslt}indent-amount\", \"4\");\r\n\t\t\toutputStream = new FileOutputStream(f);\r\n\t\t\ttrans.transform(new DOMSource(doc), new StreamResult(outputStream));\r\n\t\t\tmapPanel.modified = false;\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tif (outputStream != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\toutputStream.close();\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void geraArquivoAjudaTextual(String caminho, String nomeArquivo, String texto) {\r\n\t\ttry {\r\n\t\t\tarquivoTexto = new File(caminho + \"\\\\\" + nomeArquivo);\r\n\t\t\tFileWriter fw = new FileWriter(arquivoTexto);\r\n\t\t\tPrintWriter pw = new PrintWriter(fw);\r\n\t\t\tpw.write(texto);\r\n\t\t\tfw.close();\r\n\t\t} catch (IOException e) {\r\n\t\t}\r\n\t}", "private void guardar() {\n\t\t//JFileChooser fglobal = principal.getFglobal();\n\t\tprincipal.getFglobal().setDialogTitle(ic.buscar(38)); // Tag 38\n\n\t\t\tprincipal.getFglobal().setDialogType(JFileChooser.SAVE_DIALOG);\n\n\t\tAccesorio pep = new Accesorio(principal.getFglobal(),t, principal.getIC());\n\t\tprincipal.getFglobal().setAccessory(pep);\n\t\tpep.setProfundidad(true);\n\t\t\n principal.getFglobal().resetChoosableFileFilters();\n \n ExampleFileFilter filtroT = new ExampleFileFilter (\n new String [] {\"tiff\",\n \"tif\",\n },\n ic.buscar(3)); // Tag 3\n \n\n \n\t\t\t\n ExampleFileFilter filtroJ = new ExampleFileFilter (\n new String [] {\"jpeg\",\n \"jpg\"\n },\n ic.buscar(4)); // Tag 4\n principal.getFglobal().addChoosableFileFilter(filtroT);\n principal.getFglobal().addChoosableFileFilter(filtroJ);\n\t\t\n\t\t\n\t\t\n\t\tint retval = principal.getFglobal().showDialog(t, null);\n\t\tif (retval == JFileChooser.APPROVE_OPTION) \n\t\t{\t\t\n\t\t\tFile guardar = principal.getFglobal().getSelectedFile();\n \n\t\t\tif (\tprincipal.getFglobal().getFileFilter().getDescription().equals(filtroJ.getDescription()) )\n\t\t\t{// Guardar como JPEG\n \n\t\t\t\tJAI.create(\"filestore\",imagen_original,guardar.getPath(),\"JPEG\", new JPEGEncodeParam());\n\t\t\t}\n\t\t\telse if (principal.getFglobal().getFileFilter().getDescription().equals(filtroT.getDescription()))\n\t\t\t{// Guardar como TIFF\n\t\t\t\tint profundidad = pep.getEP().getMarcada();\n\t\t\t\t// Cubre todas las posibilidades (¿esto guarda los metadatos?)\n\t\t\t\tTiledImage tiled = null;\n\t\t\t\tif (profundidad != ElegirProfundidad.OCHO)\n\t\t\t\t{\n\t\t\t\t\ttiled = \n ElegirProfundidad.crearProfundidadReducida(\n ipixel_o, \n profundidad, \n imagen_original.getWidth(), \n imagen_original.getHeight());\n\t\t\t\t}\n\n\t\t\t\t//imgGuardar = djai.getSource();\n\t\t\t\tParameterBlock pb = new ParameterBlock();\n\t\t\t\tif (profundidad != ElegirProfundidad.OCHO)\n\t\t\t\t{\n\t\t\t\t\tpb.addSource(tiled);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpb.addSource(imagen_original);\n\t\t\t\t}\n\t\t\t\tpb.add(guardar);\n\t\t\t\tpb.add(\"TIFF\");\n\t\t\t\tpb.add(false); //UseProperties\n\t\t\t\tpb.add(false); //Transcode\n\t\t\t\tpb.add(true); //VerifyOutput\n\t\t\t\tpb.add(false); //AllowPixelReplacement\n\t\t\t\tpb.add(null); //TileSize\n\t\t\t\tpb.add(streamData);\n\t\t\t\tpb.add(imageData);\n\t \t\t\tJAI.create(\"imagewrite\", pb);\n\t\t\t\t\n\t\t\t\t//JAI.create(\"imagewrite\",tiled,guardar.getPath(),\"TIFF\");\n\t\t\t}\n\t\t\telse\n\t\t\t{// No tiene extensión o es una extensión extraña\n\t\t\t\tJAI.create(\"imagewrite\",imagen_original,guardar.getPath()+\".tif\",\"TIFF\");\n\t\t\t}\n\t\t\t\n\t\t}\t\t\t \n\t\telse \n\t\t{\n\t\t\tdibujarMensajesError(retval);\n\t\t} \n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n File myFile = new File (\"d:/names.txt\");\r\n // para saber si el archivo no existe, devuelve true o false\r\n System.out.println(\"file.exists(): \" + myFile.exists());\r\n System.out.println(\"file.isDirectory(): \" + myFile.isDirectory());\r\n // para saber la fecha de modificación\r\n System.out.println(\"file.lastModified(): \" + myFile.lastModified());\r\n // para saber el nombre del archivo\r\n System.out.println(\"file.getName(): \" + myFile.getName());\r\n // para saber la ruta\r\n System.out.println(\"file.getPath(): \" + myFile.getPath());\r\n // para saber el tamaño en bytes que ocupa en disco\r\n System.out.println(\"file.length(): \" + myFile.length()+\" bytes\");\r\n // para saber si es de lectura, devuelve true o false\r\n System.out.println(\"file.canRead():\" + myFile.canRead());\r\n\r\n //File newfolder = new File(\"D:/carpeta con archivos año mío\");\r\n //System.out.println(newfolder.mkdir());\r\n\r\n // si fuera un directorio, para saber los archivos que contiene\r\n File carpeta = new File(\"D:/carpeta_con_archivos\");\r\n System.out.println(\"----listado archivos D:/carpeta_archivos------\");\r\n for (String archivo : carpeta.list()) {\r\n System.out.println(archivo);\r\n }\r\n\r\n //agregar una linea nueva a un archivo existente (METODO 1)\r\n /*try {\r\n //abra el archivo , TRUE en un forma append (agregar nuevos valores)\r\n FileWriter myFile2 = new FileWriter(\"d:/names.txt\", true);\r\n //cargar en memora ram del SO el contenido del archivo\r\n BufferedWriter dataFile = new BufferedWriter(myFile2);\r\n //agregar una nueva linea\r\n dataFile.write(\"\\nnueva linea tres\");\r\n dataFile.close();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }*/\r\n //agregar una linea nueva a un archivo existente (METODO 1 optimizado)\r\n /*try{\r\n BufferedWriter dataFile = new BufferedWriter(new FileWriter(\"d:/names.txt\",true));\r\n //agregamos la nueva linea\r\n dataFile.write(\"nueva linea sin borrar\");\r\n dataFile.close();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }*/\r\n // agregar nueva linea con metodo super optimizado en lineas (METODO FLAHS)\r\n try{\r\n PrintWriter myFile3 = new PrintWriter(new BufferedWriter(new FileWriter(\"d:/names.txt\", true)));\r\n myFile3.println(\"Otra nueva línea mezclando las dos librerías (PrintWriter + FileWriter) \");\r\n myFile3.close();\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n\r\n }", "public AsociarArchivoSerializado(String nuevoMaest, String registro){\n try{\n salNuevoMaest = new ObjectOutputStream(\n Files.newOutputStream(Paths.get(nuevoMaest)));\n \n salRegistro = new ObjectOutputStream(\n Files.newOutputStream(Paths.get(registro)));\n }\n catch(IOException iOException){\n System.err.println(\"Error al abrir el archivo. Terminado.\");\n System.exit(1);\n }\n }", "public void DesSerializar() throws FileNotFoundException {\n try {\n FileInputStream archivo = new FileInputStream(\"SerializacionEdificios\");\n ObjectInputStream entrada = new ObjectInputStream(archivo);\n ArrayList<Edificio> edificiosDes = (ArrayList<Edificio>) entrada.readObject();\n archivo = new FileInputStream(\"SerializacionEstudiantes\");\n entrada = new ObjectInputStream(archivo);\n ArrayList<Estudiante> estudiantesDes = (ArrayList<Estudiante>) entrada.readObject();\n archivo = new FileInputStream(\"SerializacionProfesores\");\n entrada = new ObjectInputStream(archivo);\n ArrayList<Profesor> profesoresDes = (ArrayList<Profesor>) entrada.readObject();\n archivo = new FileInputStream(\"SerializacionAdministradores\");\n entrada = new ObjectInputStream(archivo);\n ArrayList<Administrador> administradoresDes = (ArrayList<Administrador>) entrada.readObject();\n edificios = edificiosDes;\n estudiantes = estudiantesDes;\n profesores = profesoresDes;\n administradores = administradoresDes;\n entrada.close();\n }\n catch (IOException e){\n e.printStackTrace();\n }\n catch (ClassNotFoundException e){\n e.printStackTrace();\n }\n\n\n }", "private BufferedWriter abrirArquivoEscrita() {\n\t\ttry{\n\t\t\tBufferedWriter file = null;\n\t\t\tfile = new BufferedWriter(new FileWriter(caminho));\n\t\t\treturn file;\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public void escribir(String cadena) throws IOException\n {\n fileWriter = new FileWriter(archivo);\n printWriter = new PrintWriter(fileWriter);\n printWriter.println(cadena);\n }", "private static void saveTemplateFile(File file, Template newTemp) {\n String string = newTemp.toString();\n\n //Save File\n try {\n FileOutputStream fos = new FileOutputStream(file);\n fos.write(string.getBytes());\n fos.flush();\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //Read back file and check against original.\n try {\n FileInputStream fis = new FileInputStream(file);\n byte[] data = new byte[(int)file.length()];\n\n fis.read(data);\n String tmpIN = new String(data,\"UTF-8\");\n Log.d(\"Behave\",\"Read Back Template: \"+ tmpIN);\n Log.d(\"Behave\",\"Template Saved Correctly: \"+tmpIN.equals(string));\n } catch (FileNotFoundException | UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n // Separate catch block for IOException because other exceptions are encapsulated by it.\n Log.e(\"Behave\", \"IOException not otherwise caught\");\n e.printStackTrace();\n }\n }", "private void jButtonCreateInsexActionPerformed(java.awt.event.ActionEvent evt) {\n try {\n lstPerson = new ArrayList();\n Properties prop = new Properties();//почти тоже самое что ini файлы\n content = Files.readAllLines(Paths.get(PATH_FILE_SOURCE), Charset.forName(\"cp1251\"));\n String s = content.get(0);\n for (int i = 0, j = 1; i < s.length(); i += 128, j++) {\n Person p = new Person(\n s.substring(i, i + 30).trim(),\n s.substring(i + 30, i + 50).trim(),\n s.substring(i + 50, i + 70).trim(),\n s.substring(i + 70, i + 78).trim(),\n s.substring(i + 78).trim(), j);\n lstPerson.add(p);\n }\n\n for (Person person : lstPerson) {\n prop.put(person.getSurname().toUpperCase(), Integer.toString(person.getID()));\n }\n prop.storeToXML(new FileOutputStream(FILE_PATH_INDEX_SURNAME), \"LIB\");//можно и без xml\n jLabelStatusBar.setForeground(Color.magenta);\n jLabelStatusBar.setText(\"Индексный файл создан!\");\n jLabelStatusBar.setForeground(Color.BLACK);\n\n } catch (IOException ex) {\n jLabelStatusBar.setForeground(Color.red);\n jLabelStatusBar.setText(\"Индексный файл не создан!\");\n Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private static boolean writeStringToFile(java.io.File r6, java.lang.String r7) {\n /*\n if (r7 != 0) goto L_0x0004\n java.lang.String r7 = \"\"\n L_0x0004:\n r1 = 0\n r2 = 0\n java.io.File r4 = r6.getParentFile() // Catch:{ IOException -> 0x0020 }\n ensureDirectory(r4) // Catch:{ IOException -> 0x0020 }\n java.io.FileWriter r3 = new java.io.FileWriter // Catch:{ IOException -> 0x0020 }\n r3.<init>(r6) // Catch:{ IOException -> 0x0020 }\n r3.write(r7) // Catch:{ IOException -> 0x003c, all -> 0x0039 }\n r1 = 1\n if (r3 == 0) goto L_0x003f\n r3.close() // Catch:{ IOException -> 0x001d }\n r2 = r3\n L_0x001c:\n return r1\n L_0x001d:\n r4 = move-exception\n r2 = r3\n goto L_0x001c\n L_0x0020:\n r0 = move-exception\n L_0x0021:\n java.lang.String r4 = \"PluginNativeHelper\"\n java.lang.String r5 = \"error occurs while writing file\"\n com.tencent.component.utils.log.LogUtil.d(r4, r5, r0) // Catch:{ all -> 0x0030 }\n if (r2 == 0) goto L_0x001c\n r2.close() // Catch:{ IOException -> 0x002e }\n goto L_0x001c\n L_0x002e:\n r4 = move-exception\n goto L_0x001c\n L_0x0030:\n r4 = move-exception\n L_0x0031:\n if (r2 == 0) goto L_0x0036\n r2.close() // Catch:{ IOException -> 0x0037 }\n L_0x0036:\n throw r4\n L_0x0037:\n r5 = move-exception\n goto L_0x0036\n L_0x0039:\n r4 = move-exception\n r2 = r3\n goto L_0x0031\n L_0x003c:\n r0 = move-exception\n r2 = r3\n goto L_0x0021\n L_0x003f:\n r2 = r3\n goto L_0x001c\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.component.plugin.PluginNativeHelper.writeStringToFile(java.io.File, java.lang.String):boolean\");\n }", "public void save(String newFilePath) {\r\n File deletedFile = new File(path);\r\n deletedFile.delete();\r\n path = newFilePath;\r\n File dataFile = new File(path);\r\n File tempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(tempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n dataFile.delete();\r\n tempFile.renameTo(dataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOException in save2 : FileData\");\r\n }\r\n }", "public static void main(String[] args) {\n String filePath = \"C:\\\\Users\\\\Catalin\\\\Desktop\\\\fisierdecitit.txt\";\n\n try {\n //incarcarea fisierului in memoria programului cu ajutorul ob fileReader\n FileReader fileReader = new FileReader(filePath);\n //incepem citirea din fisier linie cu line cu ajutorul BufferedReader\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String text = bufferedReader.readLine();\n while (text != null) {\n System.out.println(\"Linia citita este: \" + text);\n String[] array = text.split(\" \");\n System.out.println(array.length);\n text = bufferedReader.readLine();\n\n }\n\n } catch (IOException e) {\n System.out.println(\"A aparut o eroare: \" + e.getMessage());\n }\n\n\n //invatam sa scriem intr un fisier\n String filePathToWrite = \"C:\\\\Users\\\\Catalin\\\\Desktop\\\\fisierdescris.txt\";\n try {\n FileWriter fileWriter = new FileWriter(filePathToWrite);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n String text = \"Mama lu' Ana nu are nici mere si nici pere.\";\n String text2 = \"smhjhdgfdsbfkdhj\";\n\n bufferedWriter.write(text2);\n bufferedWriter.newLine();\n bufferedWriter.write(text);\n bufferedWriter.flush();\n bufferedWriter.close();\n } catch (IOException e) {\n System.out.println(\"A aparut o exceptie: \" + e.getMessage());\n }\n\n\n }", "public static void overwritePal() throws Exception {\n\n\t\tString fileName = PropertiesFile.getInstance().getProperty(\"input_qualifier\")+ Constants.PALETTE_FILE_EXTENSION;\n\t\tFile templateFile = new File(getFullyQualifiedFileName(\"cell\") +\"/\" + fileName );\n\n\t\tFile newPal = new File(getRISEInputFolder()+\"/\" + fileName );\n\n\t\tFileInputStream input = new FileInputStream(templateFile);\n\t\twriter(input, newPal);\n\t}", "public void zerarSistema() {\r\n\t\tarquivo.clear();\r\n\t\tcriaRepositorio();\r\n\t}", "@Override\n\tpublic void resolver() \n\t{\n\t\tPrintWriter sal = null;\n\t\ttry \n\t\t{\n\t\t\tsal = new PrintWriter(new File(salida));\n\t\t} \n\t\tcatch (FileNotFoundException e) \n\t\t{\n\t\t\tSystem.out.println(\"Ha ocurrido un error con el archivo de salida\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tArrayList<ClaveValor> ninos = new ArrayList<ClaveValor>();\n\t\t//Este for es el for del archivo cuando voy leyendo los nombres.\n\t\tfor(String s : nombres)\n\t\t{\n\t\t\tClaveValor aux = new ClaveValor(s,1);\n\t\t\tif(ninos.contains(aux))\n\t\t\t\tninos.get(ninos.indexOf(aux)).valor++;\n\t\t\telse\n\t\t\t\tninos.add(aux);\n\t\t}\n\t\t//Ordeno las nombres de los ninos por repeticion.\n\t\tCollections.sort(ninos, new Comparator<Object>() {\n\t\t @Override\n\t\t public int compare(Object a1, Object a2) \n\t\t {\n\t\t return ((ClaveValor)a2).valor-((ClaveValor)a1).valor;\n\t\t }\n\t\t});\n\t\t\n\t\tfor(int i = 0; i<n && i < ninos.size(); i++)\n\t\t\tsal.println(ninos.get(i));\n\tsal.close();\n\t}", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "public void LecturaEscrituraOBjetosManual(File rutaEscribir) throws IOException {\n ObjectOutputStream escribir = new ObjectOutputStream(\n new BufferedOutputStream(\n new FileOutputStream(rutaEscribir)));\n\n Scanner read = new Scanner(System.in);\n System.out.println(\"¿Cuántas carteleras agregarás?\");\n //se ingresa cantidad de carteleras, para generar el array\n //se crea el array y se piden los datos de cada objeto\n //se agrega cada objeto al array y lo devuelve con la información rellenada\n Cartelera[] lista = Cartelera.listaCartelera(read.nextInt());\n\n //se escribe un array de cartelera. \n escribir.writeObject(lista);\n escribir.close();\n }", "private void fecharArquivoLeitura(BufferedReader file) {\n\t\ttry {\n\t\t\tfile.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void resetINIFile(){\n\tFileOutputStream outstream = null;\n System.out.println(\"do reset\");\n InputStream instream = brokenJavaNaming(\"UI.ini\");\n if (instream == null){\n System.out.println(\"instream null looking for UI.ini\");\n System.exit(1);\n }\n \n \ttry{\n \t File outfile = iniFile;\n \n \t outstream = new FileOutputStream(outfile);\n \n \t byte[] buffer = new byte[1024];\n \n \t int length;\n \t /*copying the contents from input stream to\n \t * output stream using read and write methods\n \t */\n \t while ((length = instream.read(buffer)) > 0){\n \t \toutstream.write(buffer, 0, length);\n \t }\n\n \t //Closing the input/output file streams\n \t instream.close();\n \t outstream.close();\n \t \n System.out.println(\"File copied successfully!!\");\n \n \t}catch(IOException ioe){\n \t\tioe.printStackTrace();\n \t }\n }", "static void GuardarToken(int clase, String valor){\r\n try{\r\n String archivo;\r\n FileWriter fr;\r\n BufferedWriter br;\r\n\r\n archivo = \"token.txt\";\r\n fr = new FileWriter(archivo, true);\r\n br = new BufferedWriter(fr);\r\n\r\n br.write(clase + \" \" + valor);\r\n br.newLine();\r\n\r\n br.close();\r\n }\r\n catch(Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void Horas() {\r\n File archivo = null;\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n \r\n try {\r\n // Apertura del fichero y creacion de BufferedReader para poder\r\n // hacer una lectura comoda (disponer del metodo readLine()).\r\n \r\n \r\n // Lectura del fichero\r\n String linea;\r\n \r\n for (a=0;a<5;a++){\r\n if (a==0){\r\n categoria=\"Embarazadas\";\r\n }\r\n if (a==1){\r\n categoria=\"Regulares\";\r\n }\r\n if (a==2){\r\n categoria=\"Discapacitados\";\r\n }\r\n if (a==3){\r\n categoria=\"Mayores\";\r\n }\r\n if (a==4){\r\n categoria=\"Corporativos\";\r\n }\r\n archivo = new File (System.getProperty(\"user.dir\")+\"/Clientes/\"+categoria+\".txt\");\r\n fr = new FileReader (archivo);\r\n br = new BufferedReader(fr);\r\n while((linea=br.readLine())!=null)\r\n if (leerHora == contador){\r\n comparar = linea.substring(0,2);\r\n \r\n if (\"09\".equals(comparar)){\r\n nueve++;\r\n }\r\n if (\"10\".equals(comparar)){\r\n diez++;\r\n }\r\n if (\"11\".equals(comparar)){\r\n once++;\r\n }\r\n if (\"13\".equals(comparar)){\r\n una++;\r\n }\r\n if (\"14\".equals(comparar)){\r\n dos++;\r\n }\r\n if (\"15\".equals(comparar)){\r\n tres++;\r\n }\r\n if (\"16\".equals(comparar)){\r\n cuatro++;\r\n }\r\n \r\n contador +=1;\r\n leerHora += 6;\r\n }\r\n else{\r\n contador += 1;\r\n }\r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n // En el finally cerramos el fichero, para asegurarnos\r\n // que se cierra tanto si todo va bien como si salta \r\n // una excepcion.\r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n }", "private String readAndReplaceString(String fileName, String packageName, String className) {\n String baseFilePath = \"com.bgn.baseframe.base\";\n\n String time = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\").format(new Date());\n String path = (codeType == 0 ? \"kotlin/\" : \"java/\");\n return readFile(path + fileName + \".txt\")\n .replace(\"&time&\", time)\n .replace(\"&package&\", packageName)\n .replace(\"&mvp&\", baseFilePath)\n .replace(\"&className&\", className);\n }", "public void Sauvegarder(Partie p) {\n if (SaveNum > 0 && SaveNum < 10) {\n //System.out.println(\"index ok\");\n try {\n if (erase) {\n slot[SaveNum - 1].delete();\n }\n //System.out.println(\"Try start\");\n //File f = new File(i + \".\" + p.getJoueur1().getNom() + \"-vs-\" + p.getJoueur2().getNom() + \".ser\");\n SaveName = (SaveNum - 1 + \"-\" + SaveName + \".ser\");\n File fichier = new File(SavePath + SaveName);\n FileOutputStream fos = new FileOutputStream(fichier);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n //System.out.println(\"ok\");\n oos.writeObject(p);\n //System.out.println(\"ok\");\n oos.close();\n //slot[i] = fichier;\n SaveName = \"Sauvegarde\";\n //System.out.println(\"Save Done\" + SaveNum);\n SaveNum = 20;\n } catch (IOException | NullPointerException e) {\n System.out.println(\"Erreur lors de la sauvegarde du fichier\");\n }\n }\n }", "public void analizarArchivoDeLog(String nombreArchivo)\n {\n archivoLog.clear();\n try{\n File log = new File(nombreArchivo);\n Scanner sc = new Scanner(log);\n while (sc.hasNextLine()) {\n String linea = sc.nextLine();\n String[] arrayDeString = linea.split(\" \");\n archivoLog.add(new Acceso (Integer.parseInt(arrayDeString[0]),Integer.parseInt(arrayDeString[1]),Integer.parseInt(arrayDeString[2]),Integer.parseInt(arrayDeString[3]),Integer.parseInt(arrayDeString[4])));\n }\n sc.close();\n }\n\n catch (FileNotFoundException e){\n e.printStackTrace();\n }\n }", "public void recevoirDossier() {\n try {\n fileInfo = (FileInfo) ois.readObject(); //lire les informations du fichier\n //chemin du fichier en sortie\n String outputFile = fileInfo.getDestinationDirectory() + fileInfo.getFilename();\n dstFile = new File(outputFile);\n if (!new File(fileInfo.getDestinationDirectory()).exists()) { //si le fichier n'existe pas\n new File(fileInfo.getDestinationDirectory()).mkdirs(); //creation du fichier\n fos = new FileOutputStream(dstFile);\n fos.write(fileInfo.getFileData()); //ecrire les données dans le fichier\n fos.flush();\n fileInfo.setFileData(null);\n System.gc();\n fos.close();\n dstFile.setLastModified(fileInfo.getModifier());\n\n } else if (dstFile.lastModified() < fileInfo.getModifier()) { //si le fichier existe et que c'est une nouvelle version alors\n fos = new FileOutputStream(dstFile);\n fos.write(fileInfo.getFileData());\n fos.flush();\n fileInfo.setFileData(null);\n fos.close();\n dstFile.setLastModified(fileInfo.getModifier());\n }\n } catch (IOException | ClassNotFoundException ex) {\n Logger.getLogger(RecevoirFichier.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tpublic void init() throws RemoteException {\n\t\ttry {\n\t\t\tFile f5 = new File(\"TxtData/warein.txt\");\n\t\t\tFileWriter fw5 = new FileWriter(f5);\n\t\t\tBufferedWriter bw1 = new BufferedWriter(fw5);\n\t\t\tbw1.write(\"\");\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "public static void genArchivoTokens(){\r\n\t\tString path = AnManager.getPath() + File.separator +\"Resultados Grupo81\" + File.separator+ \"Tokens.txt\";\r\n\t\tFile f = new File(path);\r\n\t\tf.getParentFile().mkdirs(); \r\n\t\ttry {\r\n\t\t\tf.delete(); //Eliminamos si existe algo antes\r\n\t\t\tf.createNewFile();\r\n\t\t} catch (IOException e) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Fallo al crear archivo tokens\");\r\n\t\t}\r\n\t}", "public void salvaAula()\n { \n JFileChooser fileChooser = new JFileChooser();\n String strFilePlan = \"out/\" + this.myAula.getNome()+ \"_plan\"+ \".png\";\n System.out.println(\"scrivo su file \"+ strFilePlan);\n File fp = new File(strFilePlan);\n String strFileDati = \"out/\" + this.myAula.getNome()+ \"_dati\"+ \".png\";\n File fd = new File(strFileDati);\n fileChooser.setSelectedFile(fd);\n try\n { \n ImageIO.write(this.getPlan(), \"png\", fp);\n ImageIO.write(this.getDati(), \"png\", fd);\n }\n catch (Exception ex)\n {\n System.out.println(\"errore in Salvataggio aula su file\");\n }\n \n JOptionPane.showMessageDialog(this, \"file salvati correttamente sotto cartella /out\",\"Info\", JOptionPane.INFORMATION_MESSAGE);\n }", "final public void GuardarCuadruplos() throws ParseException {\ntry {\n // Crea un cuadro de dialogo. El input se guarda en strNomArchivo\n String strNomArchivo = \"\";\n\n // Si el campo quedo vacío o se cerró la ventana, volver a mostrarlo\n while (strNomArchivo==null || strNomArchivo.trim().isEmpty()) {\n strNomArchivo = (String)JOptionPane.showInputDialog(\n null, \"Escribe el nombre que tendra el archivo\", \"Input\", JOptionPane.PLAIN_MESSAGE, null, null, null);\n }\n\n // objeto printwriter con el nombre del archivo\n PrintWriter codigoObj = new PrintWriter(strNomArchivo);\n\n // Agrega uno por uno los cuadruplos al archivo\n for (int i=0; i < cuadruplos.size(); i++) {\n codigoObj.println( Cuadruplo.returnCuadruplo( (Cuadruplo)cuadruplos.get(i) ) );\n }\n\n // cierra el archivo\n codigoObj.close();\n\n } catch(FileNotFoundException e) {\n System.out.println(e.getMessage());\n }\n }", "public void LoadTxt(File Arquivo) {\n if (Arquivo.exists()) {\r\n\r\n try {\r\n\r\n FileReader FR = new FileReader(Arquivo);\r\n BufferedReader BW = new BufferedReader(new InputStreamReader(new FileInputStream(Arquivo.getAbsolutePath()), \"ISO-8859-1\"));\r\n\r\n //BufferedReader BW = new BufferedReader(FR);\r\n\r\n String dados;\r\n String[] paraArray = new String[3];\r\n String matricula;\r\n \r\n String serie = Arquivo.getName();\r\n int pos = serie.lastIndexOf(\".\");\r\n if (pos > 0) {\r\n serie = serie.substring(0, pos);\r\n }\r\n\r\n Sala novaSala = new Sala(serie); //CRIANDO SALA COM NOME DE TURMA\r\n salas2.add(novaSala); // ADICIONANDO SALA NA LISTA DE SALAS\r\n while ((dados = BW.readLine()) != null) {\r\n paraArray = dados.split(\";\");\r\n\r\n matricula = /*Integer.parseInt*/ (paraArray[0]);\r\n //senha = /*Integer.parseInt*/(paraArray[2]);\r\n Dados novoDado = new Dados(matricula, paraArray[1], paraArray[2]);\r\n\r\n novoDado.setSerie(serie); //ADICIONANDO TURMA AO DADO\r\n novaSala.getDadosalas().add(novoDado); //ADICIONANDO DADOS A LISTA DE DADOS QUE ESTA EM SALA\r\n\r\n }\r\n \r\n\r\n BW.close();\r\n FR.close();\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Erro ao carregar arquivo acima\");\r\n System.out.println(e.getMessage());\r\n\r\n }\r\n\r\n } else {\r\n System.out.println(\"Nenhum arquivo de dados encontrado\");\r\n }\r\n\r\n }", "private void cerrarSalRegistro(){\n try{\n if(salRegistro != null)\n salRegistro.close();\n }\n catch(IOException iOException){\n System.err.println(\"Error al cerrar el archivo. Terminado.\");\n System.exit(1);\n }\n }", "public void gerarCupom(String cliente, String vendedor,List<Produto> produtos, float totalVenda ) throws IOException {\r\n \r\n File arquivo = new File(\"cupomFiscal.txt\");\r\n String produto =\" \"; \r\n if(arquivo.exists()){\r\n System.out.println(\"Arquivo localizado com sucessso\");\r\n }else{\r\n System.out.println(\"Arquivo não localizado, será criado outro\");\r\n arquivo.createNewFile();\r\n } \r\n \r\n for(Produto p: produtos){\r\n produto += \" \"+p.getQtd()+\" \"+ p.getNome()+\" \"+p.getMarca()+\" \"+ p.getPreco()+\"\\n \";\r\n }\r\n \r\n \r\n \r\n FileWriter fw = new FileWriter(arquivo, true);\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n \r\n \r\n bw.write(\" \"+LOJA);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"CLIENTE CPF\");\r\n bw.newLine();\r\n bw.write(cliente);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(DateCustom.dataHora());\r\n bw.newLine();\r\n bw.write(\" CUPOM FISCAL \");\r\n bw.newLine();\r\n bw.write(\"QTD DESCRIÇÃO PREÇO\");\r\n bw.newLine();\r\n bw.write(produto);\r\n bw.newLine(); \r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"TOTAL R$ \" + totalVenda);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"Vendedor \" + vendedor);\r\n bw.newLine();\r\n bw.newLine();\r\n bw.close();\r\n fw.close();\r\n }", "private boolean renomeiaArquivo(File origem, File destino)\n\t{\n\t\t// Tenta executar o renameTo da classe File. Caso o destino seja em filesystem diferente entao\n\t\t// este comando ira falhar, portanto realiza a copia do arquivo, executa o delete para entao\n\t\t// retornar a funcao\n\t\tboolean renomeou = origem.renameTo(destino);\n\t\t// Se o comando falhou entao tenta copiar e apagar o arquivo\n\t\tif (!renomeou)\n\t\t{\n\t\t\trenomeou = copiaArquivo(origem,destino);\n\t\t\t// Caso tenha conseguido copiar o arquivo origem para o destino, entao remove o arquivo\n\t\t\t// origem. Simulacao do move.\n\t\t\tif (renomeou)\n\t\t\t\trenomeou = origem.delete();\n\t\t}\n\t\treturn renomeou;\n\t}" ]
[ "0.63330466", "0.6260972", "0.623227", "0.6163346", "0.6153471", "0.6147348", "0.61067605", "0.6017744", "0.60124224", "0.6009369", "0.59205586", "0.5892288", "0.5828394", "0.5813266", "0.5761136", "0.572993", "0.5706137", "0.5700054", "0.5694814", "0.5680734", "0.56720215", "0.5665566", "0.5656568", "0.5637716", "0.5631437", "0.5628627", "0.5621946", "0.56211734", "0.5613639", "0.56054395", "0.56027955", "0.5594543", "0.5588595", "0.5585137", "0.5581268", "0.5576992", "0.5576906", "0.5563496", "0.5558538", "0.55537724", "0.5549325", "0.553109", "0.5528981", "0.550366", "0.5493805", "0.5488402", "0.54659307", "0.5445374", "0.5442983", "0.543141", "0.5431364", "0.54280996", "0.5422498", "0.54172784", "0.5414524", "0.5413941", "0.5411998", "0.5402602", "0.54015887", "0.54012054", "0.53893566", "0.53889495", "0.5386936", "0.53865117", "0.53545356", "0.5353898", "0.5351505", "0.53451425", "0.53442955", "0.5343456", "0.53422403", "0.53417593", "0.5334764", "0.5334719", "0.5333871", "0.5332491", "0.53294665", "0.53275985", "0.53210443", "0.5319106", "0.5318948", "0.53179216", "0.5316688", "0.53112966", "0.53097486", "0.53068864", "0.53012097", "0.5299786", "0.5299763", "0.5292796", "0.529183", "0.52884775", "0.528727", "0.5285549", "0.5281705", "0.52764803", "0.5264435", "0.5261153", "0.52552253", "0.5252419", "0.5251068" ]
0.0
-1